| 1 |
|
| 2 |
|
| 3 |
open Bigarray |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
type pos = int |
| 9 |
|
| 10 |
|
| 11 |
type pos_ref = pos ref |
| 12 |
|
| 13 |
|
| 14 |
type buf = (char, int8_unsigned_elt, c_layout) Array1.t |
| 15 |
|
| 16 |
|
| 17 |
val create_buf : int -> buf |
| 18 |
|
| 19 |
|
| 20 |
val buf_len : buf -> int |
| 21 |
|
| 22 |
|
| 23 |
val assert_pos : pos -> unit |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
val check_pos : buf -> pos -> unit |
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
val check_next : buf -> pos -> unit |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
val safe_get_pos : buf -> pos_ref -> pos |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
val blit_string_buf : ?src_pos:int -> string -> ?dst_pos:int -> buf -> len:int -> unit |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
val blit_bytes_buf : ?src_pos:int -> bytes -> ?dst_pos:int -> buf -> len:int -> unit |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
val blit_buf_string : ?src_pos:int -> buf -> ?dst_pos:int -> bytes -> len:int -> unit |
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
val blit_buf_bytes : ?src_pos:int -> buf -> ?dst_pos:int -> bytes -> len:int -> unit |
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
val blit_buf : ?src_pos:int -> src:buf -> ?dst_pos:int -> dst:buf -> int -> unit |
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
exception Buffer_short |
| 81 |
|
| 82 |
|
| 83 |
exception No_variant_match |
| 84 |
|
| 85 |
module ReadError : sig |
| 86 |
type t = |
| 87 |
| Neg_int8 |
| 88 |
| Int_code |
| 89 |
| Int_overflow |
| 90 |
| Nat0_code |
| 91 |
| Nat0_overflow |
| 92 |
| Int32_code |
| 93 |
| Int64_code |
| 94 |
| Nativeint_code |
| 95 |
| Unit_code |
| 96 |
| Bool_code |
| 97 |
| Option_code |
| 98 |
| String_too_long |
| 99 |
| Variant_tag |
| 100 |
| Array_too_long |
| 101 |
| List_too_long of |
| 102 |
{ len : int |
| 103 |
; max_len : int |
| 104 |
} |
| 105 |
| Hashtbl_too_long |
| 106 |
| Sum_tag of string |
| 107 |
| Variant of string |
| 108 |
| Poly_rec_bound of string |
| 109 |
|
| 110 |
| Variant_wrong_type of string |
| 111 |
|
| 112 |
| Silly_type of string |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
|
| 117 |
| Empty_type of string |
| 118 |
|
| 119 |
|
| 120 |
val to_string : t -> string |
| 121 |
end |
| 122 |
|
| 123 |
|
| 124 |
exception Read_error of ReadError.t * pos |
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
|
| 129 |
exception Poly_rec_write of string |
| 130 |
|
| 131 |
|
| 132 |
|
| 133 |
exception Empty_type of string |
| 134 |
|
| 135 |
|
| 136 |
val raise_read_error : ReadError.t -> pos -> 'a |
| 137 |
|
| 138 |
|
| 139 |
val raise_variant_wrong_type : string -> pos -> 'a |
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
val raise_concurrent_modification : string -> 'a |
| 144 |
|
| 145 |
|
| 146 |
val array_bound_error : unit -> 'a |
| 147 |
|
| 148 |
|
| 149 |
|
| 150 |
type vec32 = (float, float32_elt, fortran_layout) Array1.t |
| 151 |
type vec64 = (float, float64_elt, fortran_layout) Array1.t |
| 152 |
type vec = vec64 |
| 153 |
type mat32 = (float, float32_elt, fortran_layout) Array2.t |
| 154 |
type mat64 = (float, float64_elt, fortran_layout) Array2.t |
| 155 |
type mat = mat64 |
| 156 |
|
| 157 |
|
| 158 |
|
| 159 |
|
| 160 |
|
| 161 |
val copy_htbl_list : ('a, 'b) Hashtbl.t -> ('a * 'b) list -> ('a, 'b) Hashtbl.t |
| 162 |
|
| 163 |
|
| 164 |
|
| 165 |
external unsafe_blit_buf |
| 166 |
: src_pos:int |
| 167 |
-> src:(buf[@local_opt]) |
| 168 |
-> dst_pos:int |
| 169 |
-> dst:buf |
| 170 |
-> len:int |
| 171 |
-> unit |
| 172 |
= "bin_prot_blit_buf_stub" |
| 173 |
|
| 174 |
external unsafe_blit_string_buf |
| 175 |
: src_pos:int |
| 176 |
-> (string[@local_opt]) |
| 177 |
-> dst_pos:int |
| 178 |
-> buf |
| 179 |
-> len:int |
| 180 |
-> unit |
| 181 |
= "bin_prot_blit_string_buf_stub" |
| 182 |
[@@noalloc] |
| 183 |
|
| 184 |
external unsafe_blit_bytes_buf |
| 185 |
: src_pos:int |
| 186 |
-> (bytes[@local_opt]) |
| 187 |
-> dst_pos:int |
| 188 |
-> buf |
| 189 |
-> len:int |
| 190 |
-> unit |
| 191 |
= "bin_prot_blit_bytes_buf_stub" |
| 192 |
[@@noalloc] |
| 193 |
|
| 194 |
external unsafe_blit_buf_string |
| 195 |
: src_pos:int |
| 196 |
-> buf |
| 197 |
-> dst_pos:int |
| 198 |
-> bytes |
| 199 |
-> len:int |
| 200 |
-> unit |
| 201 |
= "bin_prot_blit_buf_bytes_stub" |
| 202 |
[@@noalloc] |
| 203 |
|
| 204 |
external unsafe_blit_buf_bytes |
| 205 |
: src_pos:int |
| 206 |
-> buf |
| 207 |
-> dst_pos:int |
| 208 |
-> bytes |
| 209 |
-> len:int |
| 210 |
-> unit |
| 211 |
= "bin_prot_blit_buf_bytes_stub" |
| 212 |
[@@noalloc] |
| 213 |
|
| 214 |
external unsafe_blit_float_array_buf |
| 215 |
: src_pos:int |
| 216 |
-> (float array[@local_opt]) |
| 217 |
-> dst_pos:int |
| 218 |
-> buf |
| 219 |
-> len:int |
| 220 |
-> unit |
| 221 |
= "bin_prot_blit_float_array_buf_stub" |
| 222 |
[@@noalloc] |
| 223 |
|
| 224 |
external unsafe_blit_buf_float_array |
| 225 |
: src_pos:int |
| 226 |
-> buf |
| 227 |
-> dst_pos:int |
| 228 |
-> float array |
| 229 |
-> len:int |
| 230 |
-> unit |
| 231 |
= "bin_prot_blit_buf_float_array_stub" |
| 232 |
[@@noalloc] |
| 233 |
|
| 234 |
external unsafe_blit_floatarray_buf |
| 235 |
: src_pos:int |
| 236 |
-> (floatarray[@local_opt]) |
| 237 |
-> dst_pos:int |
| 238 |
-> buf |
| 239 |
-> len:int |
| 240 |
-> unit |
| 241 |
= "bin_prot_blit_float_array_buf_stub" |
| 242 |
[@@noalloc] |
| 243 |
|
| 244 |
external unsafe_blit_buf_floatarray |
| 245 |
: src_pos:int |
| 246 |
-> buf |
| 247 |
-> dst_pos:int |
| 248 |
-> floatarray |
| 249 |
-> len:int |
| 250 |
-> unit |
| 251 |
= "bin_prot_blit_buf_float_array_stub" |
| 252 |
[@@noalloc] |
| 253 |
|
| 254 |
val ( + ) : int -> int -> int |