diff options
Diffstat (limited to 'subversion/include/private/svn_utf_private.h')
-rw-r--r-- | subversion/include/private/svn_utf_private.h | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/subversion/include/private/svn_utf_private.h b/subversion/include/private/svn_utf_private.h index 4584944fb47c6..473e731141bfb 100644 --- a/subversion/include/private/svn_utf_private.h +++ b/subversion/include/private/svn_utf_private.h @@ -150,6 +150,40 @@ svn_utf__normalize(const char **result, const char *str, apr_size_t len, svn_membuf_t *buf); +/* Transform the UTF-8 string to a shape suitable for comparison with + * strcmp(). The tranformation is defined by CASE_INSENSITIVE and + * ACCENT_INSENSITIVE arguments. If CASE_INSENSITIVE is non-zero, + * remove case distinctions from the string. If ACCENT_INSENSITIVE + * is non-zero, remove diacritical marks from the string. + * + * Use BUF as a temporary storage. If LEN is SVN_UTF__UNKNOWN_LENGTH, + * assume STR is null-terminated; otherwise, consider the string only + * up to the given length. Place the tranformed string in *RESULT, which + * shares storage with BUF and is valid only until the next time BUF is + * modified. + * + * A returned error may indicate that STRING contains invalid UTF-8 or + * invalid Unicode codepoints. + */ +svn_error_t * +svn_utf__xfrm(const char **result, + const char *str, apr_size_t len, + svn_boolean_t case_insensitive, + svn_boolean_t accent_insensitive, + svn_membuf_t *buf); + +/* Return TRUE if S matches any of the const char * glob patterns in + * PATTERNS. + * + * S will internally be normalized to lower-case and accents removed + * using svn_utf__xfrm. To get a match, the PATTERNS must have been + * normalized accordingly before calling this function. + */ +svn_boolean_t +svn_utf__fuzzy_glob_match(const char *str, + const apr_array_header_t *patterns, + svn_membuf_t *buf); + /* Check if STRING is a valid, NFC-normalized UTF-8 string. Note that * a FALSE return value may indicate that STRING is not valid UTF-8 at * all. @@ -176,7 +210,7 @@ svn_utf__encode_ucs4_string(svn_membuf_t *buffer, apr_size_t length, apr_size_t *result_length); -/* Pattern matching similar to the the SQLite LIKE and GLOB +/* Pattern matching similar to the SQLite LIKE and GLOB * operators. PATTERN, KEY and ESCAPE must all point to UTF-8 * strings. Furthermore, ESCAPE, if provided, must be a character from * the ASCII subset. |