package ctypes

  1. Overview
  2. Docs
type voidp = Ctypes_ptr.voidp
type managed_buffer = Ctypes_memory_stubs.managed_buffer
type ('m, 'a) fatptr = ('m, 'a Ctypes.typ) Ctypes_ptr.Fat.t
type ('m, 'a) fatfunptr = ('m, 'a Ctypes.fn) Ctypes_ptr.Fat.t
val make_structured : ('a, 's) Ctypes.structured Ctypes.typ -> managed_buffer -> ('a, 's) Ctypes.structured
val make_ptr : 'a Ctypes.typ -> voidp -> 'a Ctypes.ptr
val make_fun_ptr : 'a Ctypes.fn -> voidp -> 'a Ctypes_static.static_funptr
type !'a ocaml_type = 'a Ctypes_static.ocaml_type =
  1. | String : string ocaml_type
  2. | Bytes : bytes ocaml_type
  3. | FloatArray : float array ocaml_type
type !'a typ = 'a Ctypes_static.typ =
  1. | Void : unit typ
  2. | Primitive : 'a0 Ctypes_primitive_types.prim -> 'a0 typ
  3. | Pointer : 'a1 typ -> 'a1 ptr typ
  4. | Funptr : 'a2 Ctypes.fn -> 'a2 static_funptr typ
  5. | Struct : 'a3 Ctypes_static.structure_type -> 'a3 Ctypes_static.structure typ
  6. | Union : 'a4 Ctypes_static.union_type -> 'a4 Ctypes_static.union typ
  7. | Abstract : Ctypes_static.abstract_type -> 'a5 Ctypes_static.abstract typ
  8. | View : ('a6, 'b) view -> 'a6 typ
  9. | Array : 'a7 typ * int -> 'a7 Ctypes_static.carray typ
  10. | Bigarray : ('c, 'a8, 'd) Ctypes_bigarray.t -> 'a8 typ
  11. | OCaml : 'a9 ocaml_type -> 'a9 ocaml typ
and (!'a, !'b) pointer = ('a, 'b) Ctypes_static.pointer =
  1. | CPointer : (Stdlib.Obj.t option, 'a0 typ) Ctypes_ptr.Fat.t -> ('a0, [ `C ]) pointer
  2. | OCamlRef : int * 'a1 * 'a1 ocaml_type -> ('a1, [ `OCaml ]) pointer
and !'a ptr = ('a, [ `C ]) pointer
and !'a ocaml = ('a, [ `OCaml ]) pointer
and !'a static_funptr = 'a Ctypes_static.static_funptr =
  1. | Static_funptr : (Stdlib.Obj.t option, 'a0 Ctypes.fn) Ctypes_ptr.Fat.t -> 'a0 static_funptr
and (!'a, !'b) view = ('a, 'b) Ctypes_static.view = {
  1. read : 'b -> 'a;
  2. write : 'a -> 'b;
  3. format_typ : ((Stdlib.Format.formatter -> unit) -> Stdlib.Format.formatter -> unit) option;
  4. format : (Stdlib.Format.formatter -> 'a -> unit) option;
  5. ty : 'b typ;
}
type !'a fn = 'a Ctypes_static.fn =
  1. | Returns : 'a0 typ -> 'a0 fn
  2. | Function : 'a1 typ * 'b fn -> ('a1 -> 'b) fn
type !'a prim = 'a Ctypes_primitive_types.prim =
  1. | Char : char prim
  2. | Schar : int prim
  3. | Uchar : Unsigned.uchar prim
  4. | Bool : bool prim
  5. | Short : int prim
  6. | Int : int prim
  7. | Long : Signed.long prim
  8. | Llong : Signed.llong prim
  9. | Ushort : Unsigned.ushort prim
  10. | Sint : Signed.sint prim
  11. | Uint : Unsigned.uint prim
  12. | Ulong : Unsigned.ulong prim
  13. | Ullong : Unsigned.ullong prim
  14. | Size_t : Unsigned.size_t prim
  15. | Int8_t : int prim
  16. | Int16_t : int prim
  17. | Int32_t : int32 prim
  18. | Int64_t : int64 prim
  19. | Uint8_t : Unsigned.uint8 prim
  20. | Uint16_t : Unsigned.uint16 prim
  21. | Uint32_t : Unsigned.uint32 prim
  22. | Uint64_t : Unsigned.uint64 prim
  23. | Camlint : int prim
  24. | Nativeint : nativeint prim
  25. | Float : float prim
  26. | Double : float prim
  27. | LDouble : LDouble.t prim
  28. | Complex32 : Stdlib.Complex.t prim
  29. | Complex64 : Stdlib.Complex.t prim
  30. | Complexld : ComplexL.t prim
val build_enum_type : string -> Ctypes_static.arithmetic -> ?typedef:bool -> ?unexpected:(int64 -> 'a) -> ('a * int64) list -> 'a typ
val use_value : 'a -> unit