From 9b5c844feb67045a98fc238fef801ef8732d29a5 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 29 Apr 2018 14:07:29 +0200 Subject: Clean up and separate internal headers --- src/string.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 01ed25a0..6e0edcd8 100644 --- a/src/string.c +++ b/src/string.c @@ -15,6 +15,7 @@ */ #include "serd_internal.h" +#include "string_utils.h" #include @@ -41,34 +42,6 @@ serd_strerror(SerdStatus status) return "Unknown error"; // never reached } -static inline void -serd_update_flags(const char 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); -} - size_t serd_strlen(const char* str, SerdNodeFlags* flags) { -- cgit v1.2.1