Usermode - Moved UTF-8 handling into a library
[tpg/acess2.git] / Usermode / Libraries / libunicode.so_src / include_exp / unicode.h
diff --git a/Usermode/Libraries/libunicode.so_src/include_exp/unicode.h b/Usermode/Libraries/libunicode.so_src/include_exp/unicode.h
new file mode 100644 (file)
index 0000000..495c8cf
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * Acess2 "libunicode" UTF Parser
+ * - By John Hodge (thePowersGang)
+ *
+ * unicode.h
+ * - Main header
+ */
+#ifndef _LIBUNICODE__UNICODE_H_
+#define _LIBUNICODE__UNICODE_H_
+
+#include <stdint.h>
+
+/**
+ * \breif Read a single codepoint from  a UTF-8 stream
+ * \return Number of bytes read
+ */
+extern int     ReadUTF8(const char *Input, uint32_t *Val);
+/**
+ * \brief Read backwards in the stream
+ */
+extern int     ReadUTF8Rev(const char *Base, int Offset, uint32_t *Val);
+/**
+ * \breif Write a single codepoint to a UTF-8 stream
+ */
+extern int     WriteUTF8(char *buf, uint32_t Val);
+
+#endif
+

UCC git Repository :: git.ucc.asn.au