I had some unusued functions in the uuid and modrdn plugins, do to
copy&paste.

Remove unused functions.

Simo.

-- 
Simo Sorce * Red Hat, Inc * New York
>From 60e4b0c7f096e4cfb8827f3127a794bc6f970bb0 Mon Sep 17 00:00:00 2001
From: Simo Sorce <sso...@redhat.com>
Date: Mon, 25 Oct 2010 17:12:18 -0400
Subject: [PATCH] ipa-modrdn: Remove unused functions

---
 daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c |  146 ---------------------
 1 files changed, 0 insertions(+), 146 deletions(-)

diff --git a/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c b/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c
index 6e48496..72e16e9 100644
--- a/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c
+++ b/daemons/ipa-slapi-plugins/ipa-modrdn/ipa_modrdn.c
@@ -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);
 
 /**
  *
@@ -169,18 +166,6 @@ 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);
-}
-- 
1.7.2.3

>From 1594c96dda3449c189a73b8cfeddf5d066720642 Mon Sep 17 00:00:00 2001
From: Simo Sorce <sso...@redhat.com>
Date: Mon, 25 Oct 2010 16:25:13 -0400
Subject: [PATCH] ipa-uuid: Remove unused functions

---
 daemons/ipa-slapi-plugins/ipa-uuid/ipa_uuid.c |  119 -------------------------
 1 files changed, 0 insertions(+), 119 deletions(-)

diff --git a/daemons/ipa-slapi-plugins/ipa-uuid/ipa_uuid.c b/daemons/ipa-slapi-plugins/ipa-uuid/ipa_uuid.c
index 8c43126..d122f7d 100644
--- a/daemons/ipa-slapi-plugins/ipa-uuid/ipa_uuid.c
+++ b/daemons/ipa-slapi-plugins/ipa-uuid/ipa_uuid.c
@@ -156,8 +156,6 @@ static void ipauuid_free_config_entry(struct configEntry ** entry);
 static char *ipauuid_get_dn(Slapi_PBlock * pb);
 static int ipauuid_dn_is_config(char *dn);
 static int ipauuid_list_contains_attr(char **list, char *attr);
-static int ipauuid_list_contains_attrs(char **list, char **attrs);
-static void ipauuid_list_remove_attr(char **list, char *attr);
 
 /**
  *
@@ -176,18 +174,6 @@ void ipauuid_dump_config();
 void ipauuid_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
  *
@@ -774,73 +760,6 @@ ipauuid_list_contains_attr(char **list, char *attr)
     return ret;
 }
 
-/*
- * ipauuid_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
-ipauuid_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;
-}
-
-/*
- * ipauuid_list_remove_attr()
- *
- * Removes a attr from a list of attrs.
- */
-static void 
-ipauuid_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;
-            }
-        }
-    }
-}
-
 /* for mods and adds:
 	where dn's are supplied, the closest in scope
 	is used as long as the type filter matches
@@ -1210,41 +1129,3 @@ static int ipauuid_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 ipauuid_dump_config()
-{
-    PRCList *list;
-
-    ipauuid_read_lock();
-
-    if (!PR_CLIST_IS_EMPTY(ipauuid_global_config)) {
-        list = PR_LIST_HEAD(ipauuid_global_config);
-        while (list != ipauuid_global_config) {
-            ipauuid_dump_config_entry((struct configEntry *) list);
-            list = PR_NEXT_LINK(list);
-        }
-    }
-
-    ipauuid_unlock();
-}
-
-
-void ipauuid_dump_config_entry(struct configEntry * entry)
-{
-    int i = 0;
-
-    printf("<---- attr type ------> %s\n", entry->attr);
-    printf("<---- filter ---------> %s\n", entry->filter);
-    printf("<---- scope ----------> %s\n", entry->scope);
-    printf("<---- generate flag --> %s\n", entry->generate);
-    printf("<---- prefix ---------> %s\n", entry->prefix);
-}
-- 
1.7.2.3

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to