summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-07 15:09:28 +0200
committerMichael Adam <obnox@samba.org>2008-04-10 01:28:55 +0200
commit498e5f99d256dd1394d4fa3b3ea8cbf9ca51e109 (patch)
tree307a0bb289bedfcaa9975166354673cbb2d205f0 /source3/lib
parent015e424bf129dfb583ce9d46430cefe228c8ed30 (diff)
downloadsamba-498e5f99d256dd1394d4fa3b3ea8cbf9ca51e109.tar.gz
samba-498e5f99d256dd1394d4fa3b3ea8cbf9ca51e109.tar.bz2
samba-498e5f99d256dd1394d4fa3b3ea8cbf9ca51e109.zip
libsmbconf: move smbconf_find_in_array() to smbconf_util.c
Michael (This used to be commit 7af79e60a3060083eae67bd053837c955b3f5c10)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbconf/smbconf_private.h3
-rw-r--r--source3/lib/smbconf/smbconf_txt_simple.c21
-rw-r--r--source3/lib/smbconf/smbconf_util.c21
3 files changed, 24 insertions, 21 deletions
diff --git a/source3/lib/smbconf/smbconf_private.h b/source3/lib/smbconf/smbconf_private.h
index 85b529ac85..cba9148c7c 100644
--- a/source3/lib/smbconf/smbconf_private.h
+++ b/source3/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/source3/lib/smbconf/smbconf_txt_simple.c b/source3/lib/smbconf/smbconf_txt_simple.c
index 3972b319a7..53768dec88 100644
--- a/source3/lib/smbconf/smbconf_txt_simple.c
+++ b/source3/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/source3/lib/smbconf/smbconf_util.c b/source3/lib/smbconf/smbconf_util.c
index 137e3a825c..99b08cdd70 100644
--- a/source3/lib/smbconf/smbconf_util.c
+++ b/source3/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;
+}