diff options
Diffstat (limited to 'src/serd_internal.h')
-rw-r--r-- | src/serd_internal.h | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/serd_internal.h b/src/serd_internal.h index e573a806..6c00fea1 100644 --- a/src/serd_internal.h +++ b/src/serd_internal.h @@ -98,36 +98,4 @@ is_digit(const uint8_t c) return in_range(c, '0', '9'); } -/** - UTF-8 strlen. - @return Length of @c str in characters. - @param str A null-terminated UTF-8 string. - @param n_bytes (Output) Set to the size of @a str in bytes (incl. NULL). -*/ -static inline size_t -serd_strlen(const uint8_t* str, size_t* n_bytes, uint32_t* flags) -{ - size_t n_chars = 0; - size_t i = 0; - for (; str[i]; ++i) { - if ((str[i] & 0xC0) != 0x80) { - // Does not start with `10', start of a new character - ++n_chars; - switch (str[i]) { - case '\r': - case '\n': - *flags |= SERD_HAS_NEWLINE; - break; - case '"': - *flags |= SERD_HAS_QUOTE; - } - } - } - if (n_bytes) { - *n_bytes = i + 1; - } - return n_chars; -} - - #endif // SERD_INTERNAL_H |