[PATCH 07/13] utils/common: add str_token function

Johannes Berg johannes
Tue Oct 21 23:48:53 PDT 2014


On Tue, 2014-10-21 at 08:16 -0400, Ilan Peer wrote:
> From: Eliad Peller <eliad at wizery.com>
> 
> Add helper function to get next token from a string.

> +/**
> + * str_token - get next token from string
> + * @buf: string to tokenize. Note that the string might be modified.
> + * @delim: string of delimiters
> + * @context: pointer to save our context. should be initialized with
> + *	NULL on the first call, and passed for any further call.
> + * Returns: The next token, NULL if there are no more valid tokens.
> + */
> +char *str_token(char *str, const char *delim, char **context)

Isn't that equivalent to strtok_r(), and could at least where that's
available be implemented using it?

johannes




More information about the Hostap mailing list