/
ctypes.mli
60 lines (51 loc) · 1.28 KB
/
ctypes.mli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
type 'a typ
(* part 1 *)
val void : unit typ
val char : char typ
val schar : int typ
val short : int typ
val int : int typ
val long : long typ
val llong : llong typ
val nativeint : nativeint typ
val int8_t : int typ
val int16_t : int typ
val int32_t : int32 typ
val int64_t : int64 typ
val uchar : uchar typ
val uchar : uchar typ
val uint8_t : uint8 typ
val uint16_t : uint16 typ
val uint32_t : uint32 typ
val uint64_t : uint64 typ
val size_t : size_t typ
val ushort : ushort typ
val uint : uint typ
val ulong : ulong typ
val ullong : ullong typ
val float : float typ
val double : float typ
val complex32 : Complex.t typ
val complex64 : Complex.t typ
(* part 2 *)
val view :
read:('a -> 'b) ->
write:('b -> 'a) ->
'a typ -> 'b typ
(* part 3 *)
val string_of_char_ptr : char ptr -> string
val char_ptr_of_string : string -> char ptr
(* part 4 *)
val string : string.typ
(* part 5 *)
module Array : sig
type 'a t = 'a array
val get : 'a t -> int -> 'a
val set : 'a t -> int -> 'a -> unit
val of_list : 'a typ -> 'a list -> 'a t
val to_list : 'a t -> 'a list
val length : 'a t -> int
val start : 'a t -> 'a ptr
val from_ptr : 'a ptr -> int -> 'a t
val make : 'a typ -> ?initial:'a -> int -> 'a t
end