diff options
Diffstat (limited to 'src/base/utf/vendor/common.h')
-rw-r--r-- | src/base/utf/vendor/common.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/base/utf/vendor/common.h b/src/base/utf/vendor/common.h new file mode 100644 index 0000000..51a53bd --- /dev/null +++ b/src/base/utf/vendor/common.h @@ -0,0 +1,45 @@ +#pragma once + +#include <u.h> +#include <base.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); |