]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Remove unused next_token()
authorVolker Lendecke <vl@samba.org>
Wed, 19 Feb 2025 06:25:05 +0000 (07:25 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 5 Mar 2025 17:41:34 +0000 (17:41 +0000)
Replaced by next_token_talloc()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/util/charset/charset.h
lib/util/util_str.c
source3/include/proto.h

index 4316c1b2c6cebdf032b3947ded02d193966a03cc..ab91c0abd433ee6ad4b10e132c4db9f9fd2277ce 100644 (file)
@@ -165,7 +165,6 @@ int strncasecmp_ldb(const char *s1,
 int strncasecmp_m(const char *s1, const char *s2, size_t n);
 int strncasecmp_m_handle(struct smb_iconv_handle *iconv_handle,
                         const char *s1, const char *s2, size_t n);
-bool next_token(const char **ptr,char *buff, const char *sep, size_t bufsize);
 int strcasecmp_m_handle(struct smb_iconv_handle *iconv_handle,
                        const char *s1, const char *s2);
 int strcasecmp_m(const char *s1, const char *s2);
index 7c1d15dbeb0b196f18b73e89fc90c900fbe724de..19acff4a983ab8a120a4cc2f8a6c4e39bc186f73 100644 (file)
@@ -141,6 +141,14 @@ _PUBLIC_ bool strequal(const char *s1, const char *s2)
  * @brief String utilities.
  **/
 
+/**
+ * Get the next token from a string, return False if none found.
+ * Handles double-quotes.
+ *
+ * Based on a routine by GJC@VILLAGE.COM.
+ * Extensively modified by Andrew.Tridgell@anu.edu.au
+ **/
+
 static bool next_token_internal_talloc(TALLOC_CTX *ctx,
                                const char **ptr,
                                 char **pp_buff,
@@ -236,52 +244,6 @@ bool next_token_no_ltrim_talloc(TALLOC_CTX *ctx,
        return next_token_internal_talloc(ctx, ptr, pp_buff, sep, false);
 }
 
-/**
- * Get the next token from a string, return False if none found.
- * Handles double-quotes.
- *
- * Based on a routine by GJC@VILLAGE.COM.
- * Extensively modified by Andrew.Tridgell@anu.edu.au
- **/
-_PUBLIC_ bool next_token(const char **ptr,char *buff, const char *sep, size_t bufsize)
-{
-       const char *s;
-       bool quoted;
-       size_t len=1;
-
-       if (!ptr)
-               return false;
-
-       s = *ptr;
-
-       /* default to simple separators */
-       if (!sep)
-               sep = " \t\n\r";
-
-       /* find the first non sep char */
-       while (*s && strchr_m(sep,*s))
-               s++;
-
-       /* nothing left? */
-       if (!*s)
-               return false;
-
-       /* copy over the token */
-       for (quoted = false; len < bufsize && *s && (quoted || !strchr_m(sep,*s)); s++) {
-               if (*s == '\"') {
-                       quoted = !quoted;
-               } else {
-                       len++;
-                       *buff++ = *s;
-               }
-       }
-
-       *ptr = (*s) ? s+1 : s;
-       *buff = 0;
-
-       return true;
-}
-
 /**
  Set a boolean variable from the text value stored in the passed string.
  Returns true in success, false if the passed string does not correctly
index 8b446fa9f9e0e70e16435606a597324a24e9662e..75270c1a0255bbaa8b70ffc3b7da02b920e999c7 100644 (file)
@@ -521,7 +521,6 @@ int poll_intr_one_fd(int fd, int events, int timeout, int *revents);
 
 /* The following definitions come from lib/util_str.c  */
 
-bool next_token(const char **ptr, char *buff, const char *sep, size_t bufsize);
 bool strnequal(const char *s1,const char *s2,size_t n);
 bool strcsequal(const char *s1,const char *s2);
 char *skip_string(const char *base, size_t len, char *buf);