package ctypes-foreign

  1. Overview
  2. Docs

Dynamic function calls based on libffi

Parameters

Signature

val function_of_pointer : ?name:string -> abi:Libffi_abi.abi -> check_errno:bool -> release_runtime_lock:bool -> ('a -> 'b) Ctypes_static.fn -> ('a -> 'b) Ctypes_static.static_funptr -> 'a -> 'b

Build an OCaml function from a type specification and a pointer to a C function.

val pointer_of_function : abi:Libffi_abi.abi -> acquire_runtime_lock:bool -> thread_registration:bool -> ('a -> 'b) Ctypes_static.fn -> ('a -> 'b) -> ('a -> 'b) Ctypes_static.static_funptr

Build an C function from a type specification and an OCaml function.

The C function pointer returned is callable as long as the OCaml function value is live.

type 'a funptr
val free_funptr : _ funptr -> unit
val funptr_of_fun : abi:Libffi_abi.abi -> acquire_runtime_lock:bool -> thread_registration:bool -> ('a -> 'b) Ctypes_static.fn -> ('a -> 'b) -> ('a -> 'b) funptr
val funptr_of_static_funptr : ('a -> 'b) Ctypes_static.static_funptr -> ('a -> 'b) funptr
val funptr_to_static_funptr : ('a -> 'b) funptr -> ('a -> 'b) Ctypes_static.static_funptr
val report_leaked_funptr : (string -> unit) ref
OCaml

Innovation. Community. Security.