From 6db99f51209ebde97311df3aac081f82589319cb Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Fri, 29 Oct 2021 11:10:29 -0700 Subject: implemented functionality to compute rune widths from unicode data --- sys/libunicode/vendor/common.h | 46 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sys/libunicode/vendor/common.h (limited to 'sys/libunicode/vendor/common.h') diff --git a/sys/libunicode/vendor/common.h b/sys/libunicode/vendor/common.h new file mode 100644 index 0000000..17cb113 --- /dev/null +++ b/sys/libunicode/vendor/common.h @@ -0,0 +1,46 @@ +#pragma once + +#include +#include +#include + +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); -- cgit v1.2.1