diff options
Diffstat (limited to 'strv.c')
-rw-r--r-- | strv.c | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/strv.c b/strv.c deleted file mode 100644 index 0d37a6f..0000000 --- a/strv.c +++ /dev/null @@ -1,18 +0,0 @@ -#include <string.h> - -#include "strv.h" - -strv_t strv(const char *s) { - return (strv_t) { s, strlen(s) }; -} - -int strv_split(strv_t *src, int chr, strv_t *dest) { - char *c = memchr(src->s, chr, src->n); - *dest = (strv_t) { - src->s, - c ? c - src->s : src->n - }; - src->s = c ? c + 1 : &src->s[src->n]; - src->n -= dest->n + !!c; - return dest->n > 0; -} |