diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-04-19 14:21:56 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:51:09 -0500 |
commit | 3c5618fb1b5cf484c528a7c957a5a9f260d75a4a (patch) | |
tree | 2cb6c68c80d2a19760d2da7e16a05775f86320be | |
parent | 6bc249edbfd59532978543fbbb54a98c5853e6ab (diff) | |
download | samba-3c5618fb1b5cf484c528a7c957a5a9f260d75a4a.tar.gz samba-3c5618fb1b5cf484c528a7c957a5a9f260d75a4a.tar.bz2 samba-3c5618fb1b5cf484c528a7c957a5a9f260d75a4a.zip |
r22373: move in_list() to util_strlist.c to remove the dependency
from util.o to next_token() and strcasecmp_m()
with this the pidl tests link better on some hosts
metze
(This used to be commit 54bfc1dccc40883d602402865eff3cfae676e9af)
-rw-r--r-- | source4/lib/util/util_str.c | 24 | ||||
-rw-r--r-- | source4/lib/util/util_strlist.c | 25 |
2 files changed, 25 insertions, 24 deletions
diff --git a/source4/lib/util/util_str.c b/source4/lib/util/util_str.c index 163ef3828e..86cd3176c5 100644 --- a/source4/lib/util/util_str.c +++ b/source4/lib/util/util_str.c @@ -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" /** @@ -247,29 +246,6 @@ _PUBLIC_ void hex_encode(const unsigned char *buff_in, size_t len, char **out_he } /** - 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 **/ static BOOL string_init(char **dest,const char *src) diff --git a/source4/lib/util/util_strlist.c b/source4/lib/util/util_strlist.c index 48ddbde9e1..0e9fcd9db9 100644 --- a/source4/lib/util/util_strlist.c +++ b/source4/lib/util/util_strlist.c @@ -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); +} |