diff options
Diffstat (limited to 'src/bindings/libunicode.nim')
-rw-r--r-- | src/bindings/libunicode.nim | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/bindings/libunicode.nim b/src/bindings/libunicode.nim index f501ae3f..13a36da4 100644 --- a/src/bindings/libunicode.nim +++ b/src/bindings/libunicode.nim @@ -16,14 +16,29 @@ type {.push header: "quickjs/libunicode.h", importc.} proc cr_init*(cr: ptr CharRange; mem_opaque: pointer; - realloc_func: DynBufReallocFunc) {.importc.} + realloc_func: DynBufReallocFunc) -proc cr_free*(cr: ptr CharRange) {.importc.} +proc cr_free*(cr: ptr CharRange) proc unicode_normalize*(pdst: ptr ptr uint32; src: ptr uint32; src_len: cint; n_type: UnicodeNormalizationEnum; opaque: pointer; - realloc_func: DynBufReallocFunc): cint {.importc.} + realloc_func: DynBufReallocFunc): cint +proc unicode_script*(cr: ptr CharRange; script_name: cstring; is_ext: cint): + cint {.importc, header: "quickjs/libunicode.h".} +proc unicode_prop*(cr: ptr CharRange; prop_name: cstring): cint proc unicode_general_category*(cr: ptr CharRange; gc_name: cstring): cint - {.importc.} + +const LRE_CC_RES_LEN_MAX* = 3 + +# conv_type: +# 0 = to upper +# 1 = to lower +# 2 = case folding +# res must be an array of LRE_CC_RES_LEN_MAX +proc lre_case_conv*(res: ptr UncheckedArray[uint32]; c: uint32; + conv_type: cint): cint + +proc lre_is_space*(c: uint32): cint + {.pop.} |