diff options
| author | Vicent Marti <tanoku@gmail.com> | 2014-12-16 13:03:02 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2014-12-16 10:24:18 -0600 |
| commit | 8e35527de25ac156f3600e2ce49b0c3483c258c4 (patch) | |
| tree | 50bea03490fcdd44ced99b0e63f828610cf52abf /src/util.h | |
| parent | 11d67b754d47967642570f796601e8850f001d73 (diff) | |
| download | libgit2-8e35527de25ac156f3600e2ce49b0c3483c258c4.tar.gz | |
path: Use UTF8 iteration for HFS chars
Diffstat (limited to 'src/util.h')
| -rw-r--r-- | src/util.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/util.h b/src/util.h index 17cc08987..7cfc0d644 100644 --- a/src/util.h +++ b/src/util.h @@ -368,6 +368,17 @@ extern int git__date_rfc2822_fmt(char *out, size_t len, const git_time *date); extern size_t git__unescape(char *str); /* + * Iterate through an UTF-8 string, yielding one + * codepoint at a time. + * + * @param str current position in the string + * @param str_len size left in the string; -1 if the string is NULL-terminated + * @param dst pointer where to store the current codepoint + * @return length in bytes of the read codepoint; -1 if the codepoint was invalid + */ +extern int git__utf8_iterate(const uint8_t *str, int str_len, int32_t *dst); + +/* * Safely zero-out memory, making sure that the compiler * doesn't optimize away the operation. */ |
