summaryrefslogtreecommitdiffstats
path: root/utf8.h
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2018-09-27 23:16:48 +0200
committerpgen <p.gen.progs@gmail.com>2018-10-01 19:36:56 +0200
commitf07e9d15916ac14721c9819c6d245a28f685f42b (patch)
tree20bf5c45117afcfeacf0e4f66d19ccf68c9e3d4f /utf8.h
parent1b52c4c75422742f04363048dda64999adb8402c (diff)
Create utf8.[ch] and change code accordingly
Change multibyte to utf8 to specify that we only support UTF-8 encoding.
Diffstat (limited to 'utf8.h')
-rw-r--r--utf8.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/utf8.h b/utf8.h
new file mode 100644
index 0000000..4234b76
--- /dev/null
+++ b/utf8.h
@@ -0,0 +1,47 @@
+#ifndef UTF8_H
+#define UTF8_H
+
+typedef struct langinfo_s langinfo_t;
+
+/* Locale informations */
+/* """"""""""""""""""" */
+struct langinfo_s
+{
+ int utf8; /* charset is UTF-8 */
+ int bits; /* number of bits in the charset */
+};
+
+int
+utf8_get_length(unsigned char c);
+
+size_t
+utf8_offset(char *, size_t);
+
+char *
+utf8_strprefix(char * d, char * s, long n, long * pos);
+
+size_t
+utf8_strlen(char * str);
+
+wchar_t *
+utf8_strtowcs(char * s);
+
+void
+utf8_sanitize(char * s);
+
+void
+utf8_interpret(char * s, langinfo_t * langinfo);
+
+int
+utf8_validate(const char * str, size_t length);
+
+char *
+utf8_prev(const char * str, const char * p);
+
+char *
+utf8_next(char * p);
+
+void
+utf8_strtolower(char * dst, char * src);
+
+#endif