Module Bin_prot.CommonSource
Common definitions used by binary protocol converters
Buffers
Position within buffers
Reference to a position within buffers
type buf =
(char, Stdlib.Bigarray.int8_unsigned_elt, Stdlib.Bigarray.c_layout)
Stdlib.Bigarray.Array1.tBuffers
create_buf n creates a buffer of size n.
buf_len buf returns the length of buf.
assert_pos pos
check_pos buf pos
check_next buf pos
safe_get_pos buf pos_ref
val blit_string_buf :
?src_pos:int ->
string ->
?dst_pos:int ->
Bin_prot.Common.buf ->
len:int ->
unitblit_string_buf ?src_pos src ?dst_pos dst ~len blits len bytes of the source string src starting at position src_pos to buffer dst starting at position dst_pos.
val blit_bytes_buf :
?src_pos:int ->
bytes ->
?dst_pos:int ->
Bin_prot.Common.buf ->
len:int ->
unitblit_bytes_buf ?src_pos src ?dst_pos dst ~len blits len bytes of the source byte sequence src starting at position src_pos to buffer dst starting at position dst_pos.
val blit_buf_string :
?src_pos:int ->
Bin_prot.Common.buf ->
?dst_pos:int ->
bytes ->
len:int ->
unitblit_buf_string ?src_pos src ?dst_pos dst ~len blits len bytes of the source buffer src starting at position src_pos to string dst starting at position dst_pos.
val blit_buf_bytes :
?src_pos:int ->
Bin_prot.Common.buf ->
?dst_pos:int ->
bytes ->
len:int ->
unitblit_buf_bytes ?src_pos src ?dst_pos dst ~len blits len bytes of the source buffer src starting at position src_pos to byte sequence dst starting at position dst_pos.
val blit_buf :
?src_pos:int ->
src:Bin_prot.Common.buf ->
?dst_pos:int ->
dst:Bin_prot.Common.buf ->
int ->
unitblit_buf ?src_pos ~src ?dst_pos ~dst len blits len bytes of the source buffer src starting at position src_pos to destination buffer dst starting at position dst_pos.
Errors and exceptions
Buffer too short for read/write operation
Used internally for backtracking
ReadError (err, err_pos)
PolyRecWrite type gets raised when the user attempts to write or estimate the size of a value of a type that is bound through a polymorphic record field in type definition type.
EmptyType gets raised when the user attempts to write or estimate the size of a value of an empty type, which would not make sense.
raise_read_error err pos
raise_variant_wrong_type name pos
raise_concurrent_modification loc
array_bound_error ()
Bigarrays
type vec32 =
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.fortran_layout)
Stdlib.Bigarray.Array1.ttype vec64 =
(float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.fortran_layout)
Stdlib.Bigarray.Array1.ttype mat32 =
(float, Stdlib.Bigarray.float32_elt, Stdlib.Bigarray.fortran_layout)
Stdlib.Bigarray.Array2.ttype mat64 =
(float, Stdlib.Bigarray.float64_elt, Stdlib.Bigarray.fortran_layout)
Stdlib.Bigarray.Array2.tMiscellaneous
copy_htbl_list htbl lst adds all (key, value) pairs in lst to hash table htbl.
NOTE: unsafe functions!!!
val unsafe_blit_buf :
src_pos:int ->
src:Bin_prot.Common.buf ->
dst_pos:int ->
dst:Bin_prot.Common.buf ->
len:int ->
unitval unsafe_blit_string_buf :
src_pos:int ->
string ->
dst_pos:int ->
Bin_prot.Common.buf ->
len:int ->
unitval unsafe_blit_bytes_buf :
src_pos:int ->
bytes ->
dst_pos:int ->
Bin_prot.Common.buf ->
len:int ->
unitval unsafe_blit_buf_string :
src_pos:int ->
Bin_prot.Common.buf ->
dst_pos:int ->
bytes ->
len:int ->
unitval unsafe_blit_buf_bytes :
src_pos:int ->
Bin_prot.Common.buf ->
dst_pos:int ->
bytes ->
len:int ->
unitval unsafe_blit_float_array_buf :
src_pos:int ->
float array ->
dst_pos:int ->
Bin_prot.Common.buf ->
len:int ->
unitval unsafe_blit_buf_float_array :
src_pos:int ->
Bin_prot.Common.buf ->
dst_pos:int ->
float array ->
len:int ->
unitval unsafe_blit_floatarray_buf :
src_pos:int ->
floatarray ->
dst_pos:int ->
Bin_prot.Common.buf ->
len:int ->
unitval unsafe_blit_buf_floatarray :
src_pos:int ->
Bin_prot.Common.buf ->
dst_pos:int ->
floatarray ->
len:int ->
unit