Skip to content
ZstrCompareIgnoreCase

ZstrCompareIgnoreCase

Description

Compare two strings lexicographically, ignoring ASCII case. Non-ASCII bytes are compared as-is (no Unicode case folding).

Success

Returns 0 if equal under ASCII-case folding, <0 if lowered s1 < lowered s2, >0 otherwise.

Failure

Function cannot fail if strings are valid.

Usage example (Cross-references)

Usage examples (Cross-references)
    }
    
    i32 ZstrCompareIgnoreCase(const char *s1, const char *s2) {
        if (!s1 || !s2) {
            LOG_FATAL("Invalid arguments");
    /// bytes are compared verbatim; there is no Unicode case folding.
    ///
    #define StrCmpIgnoreCase(str, ostr)               ZstrCompareIgnoreCase((str)->data, (ostr)->data)
    #define StrCmpZstrIgnoreCase(str, zstr)           ZstrCompareIgnoreCase((str)->data, (zstr))
    #define StrCmpCstrIgnoreCase(str, cstr, cstr_len) ZstrCompareNIgnoreCase((str)->data, (cstr), (cstr_len))
    ///
    #define StrCmpIgnoreCase(str, ostr)               ZstrCompareIgnoreCase((str)->data, (ostr)->data)
    #define StrCmpZstrIgnoreCase(str, zstr)           ZstrCompareIgnoreCase((str)->data, (zstr))
    #define StrCmpCstrIgnoreCase(str, cstr, cstr_len) ZstrCompareNIgnoreCase((str)->data, (cstr), (cstr_len))
Last updated on