summaryrefslogtreecommitdiffhomepage
path: root/include/stc/utf8.h
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-05-31 07:06:15 +0200
committerTyge Lovset <[email protected]>2022-05-31 07:06:15 +0200
commit0a92ec2235b5f42e93012be14938bb11e3f3650a (patch)
tree84366f6da2684388c4f3eadd33d35d0272beffe1 /include/stc/utf8.h
parentb09f435cf7fe7a8b4d976b921384c6176381cc7f (diff)
downloadSTC-modified-0a92ec2235b5f42e93012be14938bb11e3f3650a.tar.gz
STC-modified-0a92ec2235b5f42e93012be14938bb11e3f3650a.zip
cleanup of icmp impl.
Diffstat (limited to 'include/stc/utf8.h')
-rw-r--r--include/stc/utf8.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/stc/utf8.h b/include/stc/utf8.h
index a3647e3c..e5fa5894 100644
--- a/include/stc/utf8.h
+++ b/include/stc/utf8.h
@@ -38,9 +38,9 @@ uint32_t utf8_toupper(uint32_t c);
bool utf8_valid(const char* s);
bool utf8_valid_n(const char* s, size_t n);
+
int utf8_icmp_n(size_t u8max, const char* s1, size_t n1,
const char* s2, size_t n2);
-
/* encode/decode next utf8 codepoint. */
enum { UTF8_OK = 0, UTF8_ERROR = 4 };
typedef struct { uint32_t state, codep, size; } utf8_decode_t;
@@ -50,8 +50,9 @@ unsigned utf8_encode(char *out, uint32_t c);
void utf8_decode(utf8_decode_t *d, const uint8_t b);
/* case-insensitive utf8 string comparison */
-STC_INLINE int utf8_icmp(const char* s1, const char* s2)
- { return utf8_icmp_n(~(size_t)0, s1, ~(size_t)0, s2, ~(size_t)0); }
+STC_INLINE int utf8_icmp(const char* s1, const char* s2) {
+ return utf8_icmp_n(~(size_t)0, s1, ~(size_t)0, s2, ~(size_t)0);
+}
/* number of characters in the utf8 codepoint from s */
STC_INLINE unsigned utf8_codep_size(const char *s) {