Module Olm.Helpers
module YoJs = Yojson_helpersmodule ResultInfix : sig ... endval allocate_buf : ?finalise:(char Ctypes.ptr -> unit) -> int -> char Ctypes.ptrallocate_buf ?finalise n_bytesCreate char buffer of size
n_byteswith optionalfinalisefor the garbage collector.
val finaliser : 'a Ctypes.typ -> ('a Ctypes_static.ptr -> 'b) -> char Ctypes_static.ptr -> unitfinaliser t clear char_ptrCreate a finalisation closure (accepting the
char_ptrto finalise) fort, usingclear. Simply performing the necessary coersion between the originally allocated char buffer and the actual typet.
val allocate_bytes_void : int -> unit Ctypes.ptrallocate_bytes_void n_bytesAllocate
n_bytesof memory and return a void pointer to it.
val size_of_int : int -> Unsigned.size_tval size_to_int : Unsigned.size_t -> intval olm_error : intolm_errorInteger representation of the return value of
C.Funcs.error(olm_error () in the C headers.). Return values of libolm functions are checked against this to determine whether an error occurred and thelast_errorof the relevant Olm object needs to be checked.
val size_to_result : Unsigned.size_t -> (int, [> `OlmError ]) Core.resultsize_to_result sizeMaps libolm return
sizeto an integer in the Result monad if not equal toolm_error, otherwise`OlmError.
val zero_bytes : 'a Ctypes.typ -> length:int -> 'a Ctypes_static.ptr -> unitzero_bytes ctyp ~length pZero out the memory backing the
pof sizelengthand typectyp.
val string_of_ptr : 'a Ctypes.typ -> length:int -> 'a Ctypes_static.ptr -> stringstring_of_ptr ctyp ~length pMap
pof sizelengthand typectypto string.
val string_of_ptr_clr : 'a Ctypes.typ -> length:int -> 'a Ctypes_static.ptr -> stringstring_of_ptr_clr ctyp ~length pstring_of_ptr, but runzero_bytesonpafterwards.
val string_to_ptr : 'a Ctypes.typ -> string -> 'a Ctypes_static.ptrstring_to_ptr ctyp sMap
sto a pointer of typectyp.
val string_to_sized_buff : 'a Ctypes.typ -> string -> 'a Ctypes_static.ptr * Unsigned.size_tstring_to_sized_buff ctyp sstring_of_ptr, but also returning the size of the resulting buffer along with the pointer in a tuple.
val non_empty_string : ?label:string -> string -> (string, [> `ValueError of string ]) Core.resultnon_empty_string ?label sMap
sinto the Result monad, returning a`ValueError msgif it is empty. Iflabelis provided, it is added to the error message to make it more specific.
module UTF8 : sig ... end