Add xstrtokenize to the dix.

Move tokenize out of the parser, make it a dix util function instead.
Splitting a string into multiple substrings is useful by other places, so
let's use it across the line. Future users include config/hal, config/udev
and of course the parser.

Example usage:
char **substrings = xstrtokenize(my_string, "\n");

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
This commit is contained in:
Peter Hutterer 2010-02-10 15:36:49 +10:00
commit 3ac43df5d4
3 changed files with 46 additions and 41 deletions

View file

@ -210,6 +210,9 @@ pad_to_int32(const int bytes) {
return (((bytes) + 3) & ~3);
}
extern char**
xstrtokenize(const char *str, const char* separators);
/* some macros to help swap requests, replies, and events */
#define LengthRestB(stuff) \