Debian Codegraph @

src/write_intf.ml

raw symbols SCIP
1 module Definitions = struct
2 open Common
3
4 (** Type of writer functions for the binary protocol. They take a buffer,
5 a write position and a value, and return the next position after
6 writing out the value. *)
7 type 'a writer = buf -> pos:pos -> 'a -> pos
8
9 type ('a, 'b) writer1 = 'a writer -> 'b writer
10 type ('a, 'b, 'c) writer2 = 'a writer -> ('b, 'c) writer1
11 type ('a, 'b, 'c, 'd) writer3 = 'a writer -> ('b, 'c, 'd) writer2
12 type 'a writer_local = buf -> pos:pos -> 'a -> pos
13 type ('a, 'b) writer_local1 = 'a writer_local -> 'b writer_local
14 type ('a, 'b, 'c) writer_local2 = 'a writer_local -> ('b, 'c) writer_local1
15 type ('a, 'b, 'c, 'd) writer_local3 = 'a writer_local -> ('b, 'c, 'd) writer_local2
16 end
17
18 module type Write = sig
19 (** Writing values to the binary protocol using (mostly) OCaml. *)
20
21 open Common
22
23 include module type of struct
24 include Definitions
25 end
26
27 val bin_write_unit : unit writer
28 val bin_write_bool : bool writer
29 val bin_write_string : string writer
30 val bin_write_bytes : bytes writer
31 val bin_write_char : char writer
32 val bin_write_int : int writer
33 val bin_write_nat0 : Nat0.t writer
34 val bin_write_float : float writer
35 val bin_write_int32 : int32 writer
36 val bin_write_int64 : int64 writer
37 val bin_write_nativeint : nativeint writer
38 val bin_write_ref : ('a, 'a ref) writer1
39 val bin_write_lazy : ('a, 'a lazy_t) writer1
40 val bin_write_option : ('a, 'a option) writer1
41 val bin_write_pair : ('a, 'b, 'a * 'b) writer2
42 val bin_write_triple : ('a, 'b, 'c, 'a * 'b * 'c) writer3
43 val bin_write_list : ('a, 'a list) writer1
44 val bin_write_array : ('a, 'a array) writer1
45 val bin_write_hashtbl : ('a, 'b, ('a, 'b) Hashtbl.t) writer2
46 val bin_write_float32_vec : vec32 writer
47 val bin_write_float64_vec : vec64 writer
48 val bin_write_vec : vec writer
49 val bin_write_float32_mat : mat32 writer
50 val bin_write_float64_mat : mat64 writer
51 val bin_write_mat : mat writer
52 val bin_write_bigstring : buf writer
53 val bin_write_floatarray : floatarray writer
54 val bin_write_md5 : Md5_lib.t writer
55
56 (** [bin_write_variant_int] writes out the exact little-endian bit
57 representation of the variant tag of the given value (= 32 bits). *)
58 val bin_write_variant_int : int writer
59
60 (** [bin_write_int_8bit] writes out the exact little-endian bit representation
61 of the given [int] value using the lower 8 bits. *)
62 val bin_write_int_8bit : int writer
63
64 (** [bin_write_int_16bit] writes out the exact little-endian bit representation
65 of the given [int] value using the lower 16 bits. *)
66 val bin_write_int_16bit : int writer
67
68 (** [bin_write_int_32bit] writes out the exact little-endian bit representation
69 of the given [int] value using the lower 32 bits. *)
70 val bin_write_int_32bit : int writer
71
72 (** [bin_write_int_64bit] writes out the exact little-endian bit representation
73 of the given [int] value using all 64 bits. On 32bit platforms negative
74 numbers will be sign-extended in the 64bit representation. *)
75 val bin_write_int_64bit : int writer
76
77 (** [bin_write_int64_bits] writes out the exact little-endian bit
78 representation of the given [int64] value. *)
79 val bin_write_int64_bits : int64 writer
80
81 (** [bin_write_network16_int] writes out an integer in 16bit network
82 byte order (= big-endian). *)
83 val bin_write_network16_int : int writer
84
85 (** [bin_write_network32_int] writes out an integer in 32bit network
86 byte order (= big-endian). *)
87 val bin_write_network32_int : int writer
88
89 (** [bin_write_network32_int32] writes out a 32bit integer in 32bit
90 network byte order (= big-endian). *)
91 val bin_write_network32_int32 : int32 writer
92
93 (** [bin_write_network64_int] writes out an integer in 64bit network
94 byte order (= big-endian). *)
95 val bin_write_network64_int : int writer
96
97 (** [bin_write_network64_int64] writes out a 64bit integer in 64bit
98 network byte order (= big-endian). *)
99 val bin_write_network64_int64 : int64 writer
100
101 (* Local versions *)
102
103 val bin_write_unit__local : unit writer_local
104 val bin_write_bool__local : bool writer_local
105 val bin_write_string__local : string writer_local
106 val bin_write_bytes__local : bytes writer_local
107 val bin_write_char__local : char writer_local
108 val bin_write_int__local : int writer_local
109 val bin_write_nat0__local : Nat0.t writer_local
110 val bin_write_float__local : float writer_local
111 val bin_write_int32__local : int32 writer_local
112 val bin_write_int64__local : int64 writer_local
113 val bin_write_nativeint__local : nativeint writer_local
114 val bin_write_ref__local : ('a, 'a ref) writer_local1
115 val bin_write_lazy__local : ('a, 'a lazy_t) writer_local1
116 val bin_write_option__local : ('a, 'a option) writer_local1
117 val bin_write_pair__local : ('a, 'b, 'a * 'b) writer_local2
118 val bin_write_triple__local : ('a, 'b, 'c, 'a * 'b * 'c) writer_local3
119 val bin_write_list__local : ('a, 'a list) writer_local1
120 val bin_write_array__local : ('a, 'a array) writer_local1
121 val bin_write_float32_vec__local : vec32 writer_local
122 val bin_write_float64_vec__local : vec64 writer_local
123 val bin_write_vec__local : vec writer_local
124 val bin_write_float32_mat__local : mat32 writer_local
125 val bin_write_float64_mat__local : mat64 writer_local
126 val bin_write_mat__local : mat writer_local
127 val bin_write_bigstring__local : buf writer_local
128 val bin_write_floatarray__local : floatarray writer_local
129 val bin_write_md5__local : Md5_lib.t writer_local
130
131 (** [bin_write_variant_int__local] writes out the exact little-endian bit
132 representation of the variant tag of the given value (= 32 bits). *)
133 val bin_write_variant_int__local : int writer_local
134
135 (** [bin_write_int_8bit__local] writes out the exact little-endian bit representation
136 of the given [int] value using the lower 8 bits. *)
137 val bin_write_int_8bit__local : int writer_local
138
139 (** [bin_write_int_16bit__local] writes out the exact little-endian bit representation
140 of the given [int] value using the lower 16 bits. *)
141 val bin_write_int_16bit__local : int writer_local
142
143 (** [bin_write_int_32bit__local] writes out the exact little-endian bit representation
144 of the given [int] value using the lower 32 bits. *)
145 val bin_write_int_32bit__local : int writer_local
146
147 (** [bin_write_int_64bit__local] writes out the exact little-endian bit representation
148 of the given [int] value using all 64 bits. On 32bit platforms negative
149 numbers will be sign-extended in the 64bit representation. *)
150 val bin_write_int_64bit__local : int writer_local
151
152 (** [bin_write_int64_bits__local] writes out the exact little-endian bit
153 representation of the given [int64] value. *)
154 val bin_write_int64_bits__local : int64 writer_local
155
156 (** [bin_write_network16_int__local] writes out an integer in 16bit network
157 byte order (= big-endian). *)
158 val bin_write_network16_int__local : int writer_local
159
160 (** [bin_write_network32_int__local] writes out an integer in 32bit network
161 byte order (= big-endian). *)
162 val bin_write_network32_int__local : int writer_local
163
164 (** [bin_write_network32_int32__local] writes out a 32bit integer in 32bit
165 network byte order (= big-endian). *)
166 val bin_write_network32_int32__local : int32 writer_local
167
168 (** [bin_write_network64_int__local] writes out an integer in 64bit network
169 byte order (= big-endian). *)
170 val bin_write_network64_int__local : int writer_local
171
172 (** [bin_write_network64_int64__local] writes out a 64bit integer in 64bit
173 network byte order (= big-endian). *)
174 val bin_write_network64_int64__local : int64 writer_local
175 end