Function_description.FunctionsSourcemodule F : Ctypes.FOREIGNval lre_compile :
(int Ctypes_static.ptr ->
char Ctypes_static.ptr ->
int ->
string Ctypes_static.ocaml ->
Unsigned.size_t ->
int ->
unit Ctypes_static.ptr ->
Unsigned.uint8 Ctypes_static.ptr F.return)
F.resultCompile a regular expression pattern into bytecode (via shim that arms the C-stack guard). The returned buffer must be released with lre_bytecode_free. Returns NULL on error with message in error_msg.
val lre_exec :
(Unsigned.uint8 Ctypes_static.ptr Ctypes_static.ptr ->
Unsigned.uint8 Ctypes_static.ptr ->
Unsigned.uint8 Ctypes_static.ptr ->
int ->
int ->
int ->
float Ctypes_static.ptr option ->
int F.return)
F.resultExecute a compiled regex against input string (via shim that arms the C-stack guard and threads an optional deadline). Returns: 1 = match, 0 = no match, -1 = LRE_RET_MEMORY_ERROR, -2 = LRE_RET_TIMEOUT
Free a bytecode buffer returned by lre_compile
Monotonic clock in milliseconds; basis for lre_exec deadlines
Get number of capture groups (including group 0 for full match)
val lre_get_groupnames :
(Unsigned.uint8 Ctypes_static.ptr ->
char Ctypes_static.ptr option F.return)
F.resultGet pointer to null-terminated group names (via shim)
Get flags from compiled bytecode
Check if character has uppercase/lowercase variants (Cased property)
Check if character is ignored during case mapping (Case_Ignorable)
Check if character can start an identifier (ID_Start)
Check if character can continue an identifier (ID_Continue)
Check if character is whitespace per ECMA-262 (WhiteSpace or LineTerminator; matches regexp \s, String.prototype.trim and the whitespace skipped by parseInt/parseFloat)
val lre_case_conv :
(Unsigned.uint32 Ctypes_static.ptr ->
Unsigned.uint32 ->
int ->
int F.return)
F.resultConvert character case. conv_type: 0 = uppercase, 1 = lowercase, 2 = case folding Returns number of output codepoints (1-3)
Canonicalize character for case-insensitive regex matching. is_unicode: true = full Unicode folding, false = ASCII only
val unicode_normalize_shim :
(Unsigned.uint32 Ctypes_static.ptr ->
int ->
int ->
Unsigned.uint32 Ctypes_static.ptr Ctypes_static.ptr ->
int F.return)
F.resultNormalize Unicode string (via C shim that handles allocation). n_type: 0 = NFC, 1 = NFD, 2 = NFKC, 3 = NFKD Returns length of output, or -1 on error
Free buffer allocated by unicode_normalize_shim
val unicode_char_range_shim :
(int ->
string ->
Unsigned.uint32 Ctypes_static.ptr Ctypes_static.ptr ->
int F.return)
F.resultLook up a Unicode character range table by name (via C shim). kind: 0 = Script, 1 = Script_Extensions, 2 = General_Category, 3 = binary property. On success returns the number of points (always even) with the buffer in *out_points (half-open intervals points[2i], points[2i+1])). Returns -1 on memory error, -2 when the name is unknown.
Free buffer allocated by unicode_char_range_shim
Calculate maximum buffer size needed for js_dtoa
val js_dtoa :
(char Ctypes_static.ptr ->
float ->
int ->
int ->
int ->
unit Ctypes_static.ptr ->
int F.return)
F.resultConvert double to string with JS semantics. Flags: JS_DTOA_FORMAT_* | JS_DTOA_EXP_* | JS_DTOA_MINUS_ZERO Returns actual string length
val js_atod :
(string ->
int Ctypes_static.ptr ->
int ->
int ->
unit Ctypes_static.ptr ->
float F.return)
F.resultParse string to double with JS semantics (via shim). Flags: JS_ATOD_INT_ONLY | JS_ATOD_ACCEPT_BIN_OCT | etc. Sets *poffset to the number of bytes consumed (0 when parsing failed). Returns NaN when nothing could be parsed.
Convert unsigned 32-bit integer to decimal string
Convert signed 32-bit integer to decimal string
Convert unsigned 64-bit integer to decimal string
Convert signed 64-bit integer to decimal string
val u64toa_radix :
(char Ctypes_static.ptr ->
Unsigned.uint64 ->
Unsigned.uint ->
Unsigned.size_t F.return)
F.resultConvert unsigned 64-bit integer to string in given radix (2-36)
val i64toa_radix :
(char Ctypes_static.ptr -> int64 -> int -> Unsigned.size_t F.return) F.resultConvert signed 64-bit integer to string in given radix (2-36)