From 38987f3f5a3919ac81ba419e05ac8610c269faff Mon Sep 17 00:00:00 2001 From: wrmr Date: Sat, 9 Nov 2024 02:04:33 -0500 Subject: rename buf_t to str_t, and consolidate str.c/h with strv.c/h --- strv.c | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 strv.c (limited to 'strv.c') 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 - -#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; -} -- cgit 1.4.1-2-gfad0