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);
* @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,
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
/* 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);