Module Function_description.FunctionsSource

Parameters

module F : Ctypes.FOREIGN

Signature

Sourceval (@->) : 'a Ctypes.typ -> 'b F.fn -> ('a -> 'b) F.fn

Compile 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.

Execute 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

Sourceval lre_bytecode_free : (Unsigned.uint8 Ctypes_static.ptr -> unit F.return) F.result

Free a bytecode buffer returned by lre_compile

Sourceval lre_now_ms : (unit -> float F.return) F.result

Monotonic clock in milliseconds; basis for lre_exec deadlines

Sourceval lre_get_capture_count : (Unsigned.uint8 Ctypes_static.ptr -> int F.return) F.result

Get number of capture groups (including group 0 for full match)

Get pointer to null-terminated group names (via shim)

Get flags from compiled bytecode

Sourceval lre_is_cased : (Unsigned.uint32 -> bool F.return) F.result

Check if character has uppercase/lowercase variants (Cased property)

Sourceval lre_is_case_ignorable : (Unsigned.uint32 -> bool F.return) F.result

Check if character is ignored during case mapping (Case_Ignorable)

Sourceval lre_is_id_start : (Unsigned.uint32 -> bool F.return) F.result

Check if character can start an identifier (ID_Start)

Sourceval lre_is_id_continue : (Unsigned.uint32 -> bool F.return) F.result

Check if character can continue an identifier (ID_Continue)

Sourceval lre_is_space : (int -> bool F.return) F.result

Check if character is whitespace per ECMA-262 (WhiteSpace or LineTerminator; matches regexp \s, String.prototype.trim and the whitespace skipped by parseInt/parseFloat)

Convert character case. conv_type: 0 = uppercase, 1 = lowercase, 2 = case folding Returns number of output codepoints (1-3)

Sourceval lre_canonicalize : (Unsigned.uint32 -> bool -> int F.return) F.result

Canonicalize character for case-insensitive regex matching. is_unicode: true = full Unicode folding, false = ASCII only

Normalize 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

Sourceval unicode_normalize_free : (Unsigned.uint32 Ctypes_static.ptr -> unit F.return) F.result

Free buffer allocated by unicode_normalize_shim

Sourceval unicode_char_range_shim : (int -> string -> Unsigned.uint32 Ctypes_static.ptr Ctypes_static.ptr -> int F.return) F.result

Look 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.

Sourceval unicode_char_range_free : (Unsigned.uint32 Ctypes_static.ptr -> unit F.return) F.result

Free buffer allocated by unicode_char_range_shim

Sourceval js_dtoa_max_len : (float -> int -> int -> int -> int F.return) F.result

Calculate maximum buffer size needed for js_dtoa

Sourceval js_dtoa : (char Ctypes_static.ptr -> float -> int -> int -> int -> unit Ctypes_static.ptr -> int F.return) F.result

Convert double to string with JS semantics. Flags: JS_DTOA_FORMAT_* | JS_DTOA_EXP_* | JS_DTOA_MINUS_ZERO Returns actual string length

Sourceval js_atod : (string -> int Ctypes_static.ptr -> int -> int -> unit Ctypes_static.ptr -> float F.return) F.result

Parse 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

Convert unsigned 64-bit integer to string in given radix (2-36)

Sourceval i64toa_radix : (char Ctypes_static.ptr -> int64 -> int -> Unsigned.size_t F.return) F.result

Convert signed 64-bit integer to string in given radix (2-36)