summaryrefslogtreecommitdiffhomepage
path: root/include/stc/utf8.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-08 21:00:05 +0200
committerTyge Løvset <[email protected]>2022-08-08 21:00:05 +0200
commitc9e0c46d29db9c2a85154c9c6a75ce0d2e2180ff (patch)
tree9428677961c947e5d0ca28db78c9837628a6c914 /include/stc/utf8.h
parent27adc09589fe1a5ab6f10c1ed385685842a99b78 (diff)
downloadSTC-modified-c9e0c46d29db9c2a85154c9c6a75ce0d2e2180ff.tar.gz
STC-modified-c9e0c46d29db9c2a85154c9c6a75ce0d2e2180ff.zip
Changed cstr_icmp_n() to cstr_icmp_sv(), and FIXED it.
Diffstat (limited to 'include/stc/utf8.h')
-rw-r--r--include/stc/utf8.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/stc/utf8.h b/include/stc/utf8.h
index 34368737..4b87bc0b 100644
--- a/include/stc/utf8.h
+++ b/include/stc/utf8.h
@@ -16,8 +16,7 @@ extern uint32_t utf8_casefold(uint32_t c);
extern uint32_t utf8_tolower(uint32_t c);
extern uint32_t utf8_toupper(uint32_t c);
extern bool utf8_valid_n(const char* s, size_t nbytes);
-extern int utf8_icmp_n(size_t u8max, const char* s1, size_t n1,
- const char* s2, size_t n2);
+extern int utf8_icmp_sv(size_t u8max, csview s1, csview s2);
extern unsigned utf8_encode(char *out, uint32_t c);
extern uint32_t utf8_peek(const char *s, int u8pos);
@@ -36,7 +35,7 @@ STC_INLINE uint32_t utf8_decode(utf8_decode_t* d, const uint32_t byte) {
/* 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);
+ return utf8_icmp_sv(~(size_t)0, c_sv(s1, ~(size_t)0), c_sv(s2, ~(size_t)0));
}
STC_INLINE bool utf8_valid(const char* s) {