tokens_parse3abz
Parse strings and split them into tokens
Usage
#include <abz/tokens.h> #include <abz/error.h> int tokens_parse(struct tokens *tokens, const char *str); void tokens_destroy(struct tokens *tokens);
Libraries
Abz Library (-labz), Debug Library (-ldebug)
Overview
The tokens_parse() function converts a string to a tokens structure which is defined in <abz/tokens.h> as follows:
struct tokens
{
int argc;
char **argv;
};
Each argument consists of non-whitespace characters or characters between double quotes ("). The tokens_destroy() function free memory allocated by the tokens_parse() function.
Return value
The tokens_parse() function returns 0 if successful or -1 if some error occurred. Call abz_get_error() to see what error occurred.
Notes
None of the libabz routines are thread-safe. I'm not planning to change this either! For more information, please see http://threading.2038bug.com/