summaryrefslogtreecommitdiffhomepage
path: root/include/stc/csview.h
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2022-05-31 04:54:03 +0200
committerTyge Lovset <[email protected]>2022-05-31 04:54:03 +0200
commitb09f435cf7fe7a8b4d976b921384c6176381cc7f (patch)
tree7df61684e10afcfc433e7d7120faa000f8b0d400 /include/stc/csview.h
parent2688277a4efe011ffd35f0e3ce859bb110207d8e (diff)
downloadSTC-modified-b09f435cf7fe7a8b4d976b921384c6176381cc7f.tar.gz
STC-modified-b09f435cf7fe7a8b4d976b921384c6176381cc7f.zip
Generalized utf8_icmp_n() and added cstr_icmp(), csview_icmp().
Diffstat (limited to 'include/stc/csview.h')
-rw-r--r--include/stc/csview.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/stc/csview.h b/include/stc/csview.h
index eebcb9b7..8508db4f 100644
--- a/include/stc/csview.h
+++ b/include/stc/csview.h
@@ -165,6 +165,9 @@ STC_INLINE bool cstr_ends_with_sv(cstr s, csview sub) {
STC_INLINE int csview_cmp(const csview* x, const csview* y)
{ return strcmp(x->str, y->str); }
+STC_INLINE int csview_icmp(const csview* x, const csview* y)
+ { return utf8_icmp_n(~(size_t)0, x->str, x->size, y->str, y->size); }
+
STC_INLINE bool csview_eq(const csview* x, const csview* y)
{ return x->size == y->size && !memcmp(x->str, y->str, x->size); }