From 012ed5bd6455ce291741ad540a5e356e4810133b Mon Sep 17 00:00:00 2001 From: wrmr Date: Fri, 8 Nov 2024 23:25:03 -0500 Subject: use strv_t for doc_add_text, remove doc_add_textn, add strv() --- strv.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'strv.c') diff --git a/strv.c b/strv.c index 5da11f5..a3e9f6a 100644 --- a/strv.c +++ b/strv.c @@ -2,6 +2,10 @@ #include "strv.h" +strv_t strv(const char *s) { + return (strv_t) { s, strlen(s) }; +} + strv_t strv_head(strv_t ss, int chr, size_t *i) { size_t j = i ? *i : 0; char *c = memchr(&ss.s[j], chr, ss.n - j); -- cgit 1.4.1-2-gfad0