mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-27 21:22:26 +00:00
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:
parent
27d1b86d1b
commit
3ac43df5d4
3 changed files with 46 additions and 41 deletions
|
|
@ -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) \
|
||||
|
|
|
|||
Loading…
Reference in a new issue