r22373: move in_list() to util_strlist.c to remove the dependency
authorStefan Metzmacher <metze@samba.org>
Thu, 19 Apr 2007 14:21:56 +0000 (14:21 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:51:09 +0000 (14:51 -0500)
from util.o to next_token() and strcasecmp_m()

with this the pidl tests link better on some hosts

metze

source/lib/util/util_str.c
source/lib/util/util_strlist.c

index 163ef3828ef9ff7b3301c724bdc1cc96f52ad989..86cd3176c511a69d961b40f03e254edf57556572 100644 (file)
@@ -25,7 +25,6 @@
 #include "includes.h"
 #include "libcli/raw/smb.h"
 #include "pstring.h"
-#include "lib/ldb/include/ldb.h"
 #include "system/locale.h"
 
 /**
@@ -246,29 +245,6 @@ _PUBLIC_ void hex_encode(const unsigned char *buff_in, size_t len, char **out_he
                slprintf(&hex_buffer[i*2], 3, "%02X", buff_in[i]);
 }
 
-/**
- Check if a string is part of a list.
-**/
-_PUBLIC_ BOOL in_list(const char *s, const char *list, BOOL casesensitive)
-{
-       pstring tok;
-       const char *p=list;
-
-       if (!list)
-               return(False);
-
-       while (next_token(&p,tok,LIST_SEP,sizeof(tok))) {
-               if (casesensitive) {
-                       if (strcmp(tok,s) == 0)
-                               return(True);
-               } else {
-                       if (strcasecmp_m(tok,s) == 0)
-                               return(True);
-               }
-       }
-       return(False);
-}
-
 /**
  Set a string value, allocing the space for the string
 **/
index 48ddbde9e1bd7ee228bea15668578f7644e45b01..0e9fcd9db9eba4d73681431d2d26f1434534ffdb 100644 (file)
@@ -20,6 +20,8 @@
 */
 
 #include "includes.h"
+#include "pstring.h"
+#include "system/locale.h"
 
 /**
  * @file
@@ -298,3 +300,26 @@ _PUBLIC_ BOOL str_list_check_ci(const char **list, const char *s)
        }
        return False;
 }
+
+/**
+ Check if a string is part of a list.
+**/
+_PUBLIC_ BOOL in_list(const char *s, const char *list, BOOL casesensitive)
+{
+       pstring tok;
+       const char *p=list;
+
+       if (!list)
+               return(False);
+
+       while (next_token(&p,tok,LIST_SEP,sizeof(tok))) {
+               if (casesensitive) {
+                       if (strcmp(tok,s) == 0)
+                               return(True);
+               } else {
+                       if (strcasecmp_m(tok,s) == 0)
+                               return(True);
+               }
+       }
+       return(False);
+}