blob: f501ae3f14186051e2704de1605a84c25dcf4e5b (
plain) (
blame)
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
|
type
DynBufReallocFunc = proc(opaque, p: pointer; size: csize_t): pointer {.cdecl.}
CharRange* = object
len*: cint # in points, always even
size*: cint
points*: ptr uint32 # points sorted by increasing value
mem_opaque*: pointer
realloc_func*: DynBufReallocFunc
UnicodeNormalizationEnum* {.size: sizeof(cint).} = enum
UNICODE_NFC, UNICODE_NFD, UNICODE_NKFC, UNICODE_NKFD
{.passc: "-Ilib/".}
{.push header: "quickjs/libunicode.h", importc.}
proc cr_init*(cr: ptr CharRange; mem_opaque: pointer;
realloc_func: DynBufReallocFunc) {.importc.}
proc cr_free*(cr: ptr CharRange) {.importc.}
proc unicode_normalize*(pdst: ptr ptr uint32; src: ptr uint32; src_len: cint;
n_type: UnicodeNormalizationEnum; opaque: pointer;
realloc_func: DynBufReallocFunc): cint {.importc.}
proc unicode_general_category*(cr: ptr CharRange; gc_name: cstring): cint
{.importc.}
{.pop.}
|