]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmbconf: move smbconf_find_in_array() to smbconf_util.c
authorMichael Adam <obnox@samba.org>
Mon, 7 Apr 2008 13:09:28 +0000 (15:09 +0200)
committerMichael Adam <obnox@samba.org>
Wed, 9 Apr 2008 23:28:55 +0000 (01:28 +0200)
Michael

source/lib/smbconf/smbconf_private.h
source/lib/smbconf/smbconf_txt_simple.c
source/lib/smbconf/smbconf_util.c

index 85b529ac85e6f4e8b0be117ca052289db6ed0b54..cba9148c7c8466357ec9c5063ba10c8fe0716a23 100644 (file)
@@ -67,4 +67,7 @@ WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
                                   uint32_t count,
                                   const char *string);
 
+bool smbconf_find_in_array(const char *string, char **list,
+                          uint32_t num_entries, uint32_t *entry);
+
 #endif
index 3972b319a7ac5e1ee122c296f4c9349724d2006c..53768dec88cd78d7656e0b731d001c8df30c1081 100644 (file)
@@ -56,27 +56,6 @@ static struct txt_private_data *pd(struct smbconf_ctx *ctx)
        return (struct txt_private_data *)(ctx->data);
 }
 
-static bool smbconf_find_in_array(const char *string, char **list,
-                                 uint32_t num_entries, uint32_t *entry)
-{
-       uint32_t i;
-
-       if ((string == NULL) || (list == NULL)) {
-               return false;
-       }
-
-       for (i = 0; i < num_entries; i++) {
-               if (strequal(string, list[i])) {
-                       if (entry != NULL) {
-                               *entry = i;
-                       }
-                       return true;
-               }
-       }
-
-       return false;
-}
-
 static bool smbconf_txt_do_section(const char *section, void *private_data)
 {
        WERROR werr;
index 137e3a825c685f6e36208eb7bab7be563e5aa5ea..99b08cdd70827d5cb0a2bbce9156c38d46a6d1fe 100644 (file)
@@ -101,3 +101,24 @@ WERROR smbconf_add_string_to_array(TALLOC_CTX *mem_ctx,
 
        return WERR_OK;
 }
+
+bool smbconf_find_in_array(const char *string, char **list,
+                          uint32_t num_entries, uint32_t *entry)
+{
+       uint32_t i;
+
+       if ((string == NULL) || (list == NULL)) {
+               return false;
+       }
+
+       for (i = 0; i < num_entries; i++) {
+               if (strequal(string, list[i])) {
+                       if (entry != NULL) {
+                               *entry = i;
+                       }
+                       return true;
+               }
+       }
+
+       return false;
+}