summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-07 15:09:28 +0200
committerKarolin Seeger <kseeger@samba.org>2008-04-11 08:57:33 +0200
commita05c24df2d714d17309e684749fd1c607f2e92d0 (patch)
tree69a60c59c2377f5cac46f5762669f528d12bb665
parent79a2aeac008e6e2d751743ade6a275055ebf83b7 (diff)
downloadsamba-a05c24df2d714d17309e684749fd1c607f2e92d0.tar.gz
samba-a05c24df2d714d17309e684749fd1c607f2e92d0.tar.xz
samba-a05c24df2d714d17309e684749fd1c607f2e92d0.zip
libsmbconf: move smbconf_find_in_array() to smbconf_util.c
Michael (cherry picked from commit 7af79e60a3060083eae67bd053837c955b3f5c10)
-rw-r--r--source/lib/smbconf/smbconf_private.h3
-rw-r--r--source/lib/smbconf/smbconf_txt_simple.c21
-rw-r--r--source/lib/smbconf/smbconf_util.c21
3 files changed, 24 insertions, 21 deletions
diff --git a/source/lib/smbconf/smbconf_private.h b/source/lib/smbconf/smbconf_private.h
index 85b529ac85e..cba9148c7c8 100644
--- a/source/lib/smbconf/smbconf_private.h
+++ b/source/lib/smbconf/smbconf_private.h
@@ -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
diff --git a/source/lib/smbconf/smbconf_txt_simple.c b/source/lib/smbconf/smbconf_txt_simple.c
index 3972b319a7a..53768dec88c 100644
--- a/source/lib/smbconf/smbconf_txt_simple.c
+++ b/source/lib/smbconf/smbconf_txt_simple.c
@@ -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;
diff --git a/source/lib/smbconf/smbconf_util.c b/source/lib/smbconf/smbconf_util.c
index 137e3a825c6..99b08cdd708 100644
--- a/source/lib/smbconf/smbconf_util.c
+++ b/source/lib/smbconf/smbconf_util.c
@@ -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;
+}