Find next token in string.
#include <ldap_utf8.h>
char * ldap_x_utf8_strtok (
char *str,
const char *sep,
char **last);
(IN) UTF-8 string to parse. On subsequent calls to this function this parameter should be NULL.
(IN) Set of separator characters.
(IN/OUT) After each function call, returns a pointer to the token following the separator character. This value should be passed in to the next function call.
Returns a pointer to the next token found in str.
Parses a string into tokens based on a set of delimiters. When a delimiter is encountered, it is replaced by a NULL, allowing the token to be processed as a null-terminated string.
On the first call, a value is returned in last. On subsequent calls, NULL should be given for str. Last is updated after each call.
char utstr[] = { ’a’, 0xe2U, 0x98U, 0xa0U, ’b’, 0xe2U, 0x98U, 0xa0U, ’c’, 0 };
char delims[] = { 0xe2U, 0x98U, 0xa0U, 0 };
char *last;
char *p;
p = ldap_x_utf8_strtok(utstr, delims, &last); /* p points to "a" */
p = ldap_x_utf8_strtok(NULL, delims, &last); /* p points to "b" */
p = ldap_x_utf8_strtok(NULL, delims, &last); /* p points to "c" */