aboutsummaryrefslogtreecommitdiff
path: root/sys/libutf/vendor/common.h
blob: 62f6c5b84910de450c2a42e7d70cb48c6839c7f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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);