diff options
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/string.c b/src/string.c index 238c41a9..7b8fc662 100644 --- a/src/string.c +++ b/src/string.c @@ -18,6 +18,8 @@ #include <math.h> +#include "string_utils.h" + SERD_API const char* serd_strerror(SerdStatus status) @@ -36,34 +38,6 @@ serd_strerror(SerdStatus status) return "Unknown error"; // never reached } -static inline void -serd_update_flags(const uint8_t c, SerdNodeFlags* const flags) -{ - switch (c) { - case '\r': case '\n': - *flags |= SERD_HAS_NEWLINE; - break; - case '"': - *flags |= SERD_HAS_QUOTE; - } -} - -size_t -serd_substrlen(const char* const str, - const size_t len, - SerdNodeFlags* const flags) -{ - if (flags) { - size_t i = 0; - *flags = 0; - for (; i < len && str[i]; ++i) { - serd_update_flags(str[i], flags); - } - return i; - } - return strlen(str); -} - SERD_API size_t serd_strlen(const char* str, SerdNodeFlags* flags) |