diff options
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. */ |
