aboutsummaryrefslogtreecommitdiff
path: root/sys/libutf/vendor/common.h
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-11 17:07:44 -0800
committerNicholas <nbnoll@eml.cc>2021-11-11 17:07:44 -0800
commitb375f3cdedb5b0e08745d100b40e38d2f8396a58 (patch)
treea51d5763646ff482c26e79bfc1dcebccbe4812a7 /sys/libutf/vendor/common.h
parent44b30ea0883af2827e618a45d472b47cf041a842 (diff)
parent9695ea005d4af93dcd60f74f10fd3c54499a182f (diff)
chore: merge master into laptop
Diffstat (limited to 'sys/libutf/vendor/common.h')
-rw-r--r--sys/libutf/vendor/common.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/sys/libutf/vendor/common.h b/sys/libutf/vendor/common.h
new file mode 100644
index 0000000..62f6c5b
--- /dev/null
+++ b/sys/libutf/vendor/common.h
@@ -0,0 +1,46 @@
+#pragma once
+
+#include <u.h>
+#include <base.h>
+#include <libutf.h>
+
+enum
+{
+ // Fields inside UnicodeData.txt
+ Fcode,
+ Fname,
+ Fcategory,
+ Fcombine,
+ Fbidir,
+ Fdecomp,
+ Fdecimal,
+ Fdigit,
+ Fnumeric,
+ Fmirror,
+ Foldname,
+ Fcomment,
+ Fupper,
+ Flower,
+ Ftitle,
+
+ NumFields,
+ NumRunes = 1 << 21,
+};
+
+/* input functions */
+enum
+{
+ ParseEOF,
+ ParseOK,
+ ParseSkip,
+};
+
+int parse(io·Stream *io, int nfield, char **field, int len, char *line);
+int codepoint(char *s);
+void codepointrange(io·Stream *utf8, char *field[NumFields], int *start, int *stop);
+
+/* output functions */
+void putsearch(void);
+int putrange(char *ident, char *prop, int force);
+int putpair(char *ident, char *prop);
+int putsingle(char *ident, char *prop);