Artifact 5b7510ffd8e91e1d4197e69fa3024c44ee63268b5190fe8424819df4bdfb11e1:
- File lib/libstuff/util/stokenize.c — part of check-in [15eae1e8e6] at 2019-06-20 16:42:23 on branch trunk — Import sources to have something to work with (user: KhazAkar size: 379)
/* Written by Kris Maglione <maglione.k at Gmail> */ /* Public domain */ #include <string.h> #include "util.h" uint stokenize(char *res[], uint reslen, char *str, char *delim) { char *s; uint i; i = 0; s = str; while(i < reslen && *s) { while(*s && strchr(delim, *s)) *(s++) = '\0'; if(*s) res[i++] = s; while(*s && !strchr(delim, *s)) s++; } return i; }