summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2007-12-19 21:59:28 +0100
committerVolker Lendecke <vl@samba.org>2007-12-21 09:58:20 +0100
commitbea16599112eade0a23b810abcb8cdc4b2480fd9 (patch)
treec56ba1b433dca435a93f2f71e0e4709e7f749de8 /source3/lib/util_str.c
parent44d086a15f4908a01d0c719498fde953bd4809e7 (diff)
downloadsamba-bea16599112eade0a23b810abcb8cdc4b2480fd9.tar.gz
samba-bea16599112eade0a23b810abcb8cdc4b2480fd9.tar.bz2
samba-bea16599112eade0a23b810abcb8cdc4b2480fd9.zip
Remove next_token_nr_talloc and its associated global
Only client.c and clitar.c used this, I think they should carry the static themselves. Also move the a bit funny routine toktocliplist to clitar.c, the only place where it is used. (This used to be commit 86d9412611fd99c21e15c71d30a3f95e35d8535b)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c77
1 files changed, 0 insertions, 77 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index ee76e33de8..7e21fe1195 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -137,83 +137,6 @@ bool next_token_no_ltrim_talloc(TALLOC_CTX *ctx,
}
/**
-This is like next_token but is not re-entrant and "remembers" the first
-parameter so you can pass NULL. This is useful for user interface code
-but beware the fact that it is not re-entrant!
-**/
-
-static const char *last_ptr=NULL;
-
-bool next_token_nr_talloc(TALLOC_CTX *ctx,
- const char **ptr,
- char **pp_buff,
- const char *sep)
-{
- bool ret;
- if (!ptr) {
- ptr = &last_ptr;
- }
-
- ret = next_token_talloc(ctx, ptr, pp_buff, sep);
- last_ptr = *ptr;
- return ret;
-}
-
-void set_first_token(char *ptr)
-{
- last_ptr = ptr;
-}
-
-/**
- Convert list of tokens to array; dependent on above routine.
- Uses last_ptr from above - bit of a hack.
-**/
-
-char **toktocliplist(int *ctok, const char *sep)
-{
- char *s=(char *)last_ptr;
- int ictok=0;
- char **ret, **iret;
-
- if (!sep)
- sep = " \t\n\r";
-
- while(*s && strchr_m(sep,*s))
- s++;
-
- /* nothing left? */
- if (!*s)
- return(NULL);
-
- do {
- ictok++;
- while(*s && (!strchr_m(sep,*s)))
- s++;
- while(*s && strchr_m(sep,*s))
- *s++=0;
- } while(*s);
-
- *ctok=ictok;
- s=(char *)last_ptr;
-
- if (!(ret=iret=SMB_MALLOC_ARRAY(char *,ictok+1)))
- return NULL;
-
- while(ictok--) {
- *iret++=s;
- if (ictok > 0) {
- while(*s++)
- ;
- while(!*s)
- s++;
- }
- }
-
- ret[*ctok] = NULL;
- return ret;
-}
-
-/**
* Case insensitive string compararison.
*
* iconv does not directly give us a way to compare strings in