diff options
author | wrmr | 2024-11-09 02:04:33 -0500 |
---|---|---|
committer | wrmr | 2024-11-09 02:04:33 -0500 |
commit | 38987f3f5a3919ac81ba419e05ac8610c269faff (patch) | |
tree | dc76c691f0e7d8385224ede708b9390b50b68dff /strv.c | |
parent | 12d5d0df5c4b958bbb5cc339a9e556c50136a974 (diff) |
rename buf_t to str_t, and consolidate str.c/h with strv.c/h
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; -} |