From 3d1c458e0c10c73f9f03cbbf06ec2ec0302b2a68 Mon Sep 17 00:00:00 2001 From: Randy Jordan Date: Wed, 8 Apr 2026 19:45:06 -0500 Subject: [PATCH] README --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 8dfd6f2..fd6da8a 100644 --- a/README.md +++ b/README.md @@ -51,21 +51,11 @@ uintptr_t spp_until(struct Stream s, const char *list); // Returns current cursor position of the stream. const char *spp_cursor(struct Stream s); -``` +// Pass a custom callback to parse a stream. +typedef bool (*parse)(struct Stream s, const char **start, ptrdiff_t *len); +uintptr_t spp_parse(struct Stream s, parse fn, const char *buf[], ptrdiff_t cnt[], uintptr_t cap ); -## Tokenizing Words -``` -while (!spp_eof(s)) { - spp_skip(s, WS); - - const char *start = spp_cursor(s); - uintptr_t len = spp_until(s, WS); - - if (len > 0) { - printf("Token: %.*s\n", (int)len, start); - } -} ``` ## Acknowledgments