summaryrefslogtreecommitdiff
path: root/src/util.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2014-12-16 13:03:02 +0100
committerEdward Thomson <ethomson@microsoft.com>2014-12-16 10:24:18 -0600
commit8e35527de25ac156f3600e2ce49b0c3483c258c4 (patch)
tree50bea03490fcdd44ced99b0e63f828610cf52abf /src/util.h
parent11d67b754d47967642570f796601e8850f001d73 (diff)
downloadlibgit2-8e35527de25ac156f3600e2ce49b0c3483c258c4.tar.gz
path: Use UTF8 iteration for HFS chars
Diffstat (limited to 'src/util.h')
-rw-r--r--src/util.h11
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.
*/