diff options
Diffstat (limited to 'src/string.c')
-rw-r--r-- | src/string.c | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/string.c b/src/string.c index 8cc839bd..ed3149d0 100644 --- a/src/string.c +++ b/src/string.c @@ -1,16 +1,10 @@ // Copyright 2011-2020 David Robillard <d@drobilla.net> // SPDX-License-Identifier: ISC -#include "string_utils.h" - #include "serd/memory.h" -#include "serd/node.h" #include "serd/status.h" -#include "serd/string.h" -#include <assert.h> #include <stdlib.h> -#include <string.h> void serd_free(void* const ptr) @@ -68,50 +62,3 @@ serd_strerror(const SerdStatus status) return "Unknown error"; } - -static 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; - break; - default: - break; - } -} - -size_t -serd_substrlen(const char* const str, - const size_t len, - SerdNodeFlags* const flags) -{ - assert(flags); - - size_t i = 0; - *flags = 0; - for (; i < len && str[i]; ++i) { - serd_update_flags(str[i], flags); - } - - return i; -} - -size_t -serd_strlen(const char* const str, SerdNodeFlags* const flags) -{ - if (flags) { - size_t i = 0; - *flags = 0; - for (; str[i]; ++i) { - serd_update_flags(str[i], flags); - } - return i; - } - - return strlen(str); -} |