ipa-modrdn: Remove unused functions

This commit is contained in:
Simo Sorce 2010-10-25 17:12:18 -04:00
parent 874dc15c5d
commit 3f1293582f

View File

@ -150,9 +150,6 @@ static void ipamodrdn_free_config_entry(struct configEntry ** entry);
*/
static char *ipamodrdn_get_dn(Slapi_PBlock * pb);
static int ipamodrdn_dn_is_config(char *dn);
static int ipamodrdn_list_contains_attr(char **list, char *attr);
static int ipamodrdn_list_contains_attrs(char **list, char **attrs);
static void ipamodrdn_list_remove_attr(char **list, char *attr);
/**
*
@ -168,18 +165,6 @@ static int ipamodrdn_post_op(Slapi_PBlock * pb);
void ipamodrdn_dump_config();
void ipamodrdn_dump_config_entry(struct configEntry *);
/**
* set the debug level
*/
#ifdef _WIN32
int *module_ldap_debug = 0;
void plugin_init_debug_level(int *level_ptr)
{
module_ldap_debug = level_ptr;
}
#endif
/**
*
* Deal with cache locking
@ -690,97 +675,6 @@ static int ipamodrdn_dn_is_config(char *dn)
than config and startup
****************************************************/
/*
* ipamodrdn_list_contains_attr()
*
* Checks if a attr is contained in a list of attrs.
* Returns 1 if the attr is found, 0 otherwise.
*/
static int
ipamodrdn_list_contains_attr(char **list, char *attr)
{
int ret = 0;
int i = 0;
if (list && attr) {
for (i = 0; list[i]; i++) {
if (slapi_attr_types_equivalent(attr, list[i])) {
ret = 1;
break;
}
}
}
return ret;
}
/*
* ipamodrdn_list_contains_attrs()
*
* Checks if all attrs in one list (attrs) are contained
* in another list of attrs (list). Returns 1 if all
* attrs are found, 0 otherwise.
*/
static int
ipamodrdn_list_contains_attrs(char **list, char **attrs)
{
int ret = 1;
int i = 0;
int j = 0;
if (list && attrs) {
for (i = 0; attrs[i]; i++) {
int found = 0;
for (j = 0; list[j]; j++) {
if (slapi_attr_types_equivalent(attrs[i], list[i])) {
found = 1;
break;
}
}
if (!found) {
ret = 0;
break;
}
}
} else {
ret = 0;
}
return ret;
}
/*
* ipamodrdn_list_remove_attr()
*
* Removes a attr from a list of attrs.
*/
static void
ipamodrdn_list_remove_attr(char **list, char *attr)
{
int i = 0;
int found_attr = 0;
if (list && attr) {
/* Go through the list until we find the attr that
* we want to remove. We simply free the attr we
* want to remove and shift the remaining array
* elements down by one index. This will leave us
* with two NULL elements at the end of the list,
* but this should not cause any problems. */
for (i = 0; list[i]; i++) {
if (found_attr) {
list[i] = list[i + 1];
} else if (slapi_attr_types_equivalent(attr, list[i])) {
slapi_ch_free_string(&list[i]);
list[i] = list[i + 1];
found_attr = 1;
}
}
}
}
static int
ipamodrdn_change_attr(struct configEntry *cfgentry,
char *targetdn, const char *value)
@ -949,43 +843,3 @@ static int ipamodrdn_config_check_post_op(Slapi_PBlock * pb)
return 0;
}
/****************************************************
End of
Functions that actually do things other
than config and startup
****************************************************/
/**
* debug functions to print config
*/
void ipamodrdn_dump_config()
{
PRCList *list;
ipamodrdn_read_lock();
if (!PR_CLIST_IS_EMPTY(ipamodrdn_global_config)) {
list = PR_LIST_HEAD(ipamodrdn_global_config);
while (list != ipamodrdn_global_config) {
ipamodrdn_dump_config_entry((struct configEntry *) list);
list = PR_NEXT_LINK(list);
}
}
ipamodrdn_unlock();
}
void ipamodrdn_dump_config_entry(struct configEntry * entry)
{
int i = 0;
printf("<---- source attr-----> %s\n", entry->sattr);
printf("<---- target attr-----> %s\n", entry->tattr);
printf("<---- prefix ---------> %s\n", entry->prefix);
printf("<---- suffix ---------> %s\n", entry->suffix);
printf("<---- filter ---------> %s\n", entry->filter);
printf("<---- scope ----------> %s\n", entry->scope);
}