String Processing. More...
Functions | |
JAS_EXPORT char * | jas_strdup (const char *) |
Create a copy of a null-terminated string. More... | |
JAS_EXPORT char * | jas_strtok (char *str, const char *delim, char **saveptr) |
Extract tokens from a string. More... | |
JAS_EXPORT int | jas_stringtokenize (const char *string, const char *delim, char ***tokens_buf, size_t *max_tokens_buf, size_t *num_tokens_buf) |
Split a string into tokens based on specified delimiters. More... | |
String Processing.
General information can be found here.
JAS_EXPORT char* jas_strdup | ( | const char * | ) |
Create a copy of a null-terminated string.
This function has a behavior similar to the well-known strdup function.
JAS_EXPORT int jas_stringtokenize | ( | const char * | string, |
const char * | delim, | ||
char *** | tokens_buf, | ||
size_t * | max_tokens_buf, | ||
size_t * | num_tokens_buf | ||
) |
Split a string into tokens based on specified delimiters.
string | A pointer to a null-terminated string to be split into tokens. |
delim | A pointer to a null-terminated string contained characters used to delimit tokens. |
tokens_buf | A pointer to the output token array. |
max_tokens_buf | A pointer to the allocated size of the token array. |
num_tokens_buf | A pointer to the number of elements in the token array. |
The memory to hold token information is allocated via jas_malloc() and friends.
JAS_EXPORT char* jas_strtok | ( | char * | str, |
const char * | delim, | ||
char ** | saveptr | ||
) |
Extract tokens from a string.
This function has a similar behavior as strtok_r
in the POSIX standard.