Bigarrays
Type for mutable windows on top of bigarrays, with bounds automatically updated when values are read/write in the buffer.
Return the offset corresponding to the first occurence of the character in the given string.
Parse error
Print an error message, the buffer contents and raise a exception
Print an error message and raise an exception
CUSTOM(Basic) IO operations
Get/set big-endian integers of various sizes.
get_uint16 buf
is the 16 bit long big-endian unsigned integer
stored in buf
.
get_uint32 buf
is the 32 bit long big-endian unsigned integer
stored in buf
.
get_uint64 buf
is the 64 bit long big-endian unsigned integer
stored in buf
.
pick_string buf len
looks for the string of size len
in the
buffer, without consuming it. Return None
if the buffer is
bigger than len
.
get_string_delim buf c
returns the string appearing between the
start of the buffer buf
and ending at the first occurence of the
character c
. Return None
if c
does not appear in buf
.
set_uint16 buf i
writes the 16 bit long big-endian unsigned
integer i
in buf
.
set_uint32 buf i
writes the 32 bit long big-endian unsigned
integer i
in buf
.
set_uint64 buf i
writes the 64 bit long big-endian unsigned
integer i
in buf
.
get_uint16 buf
is the 16 bit long little-endian unsigned integer
stored in buf
.
get_uint32 buf
is the 32 bit long little-endian unsigned integer
stored in buf
.
get_uint64 buf
is the 64 bit long little-endian unsigned integer
stored in buf
.
set_uint16 buf i
writes the 16 bit long little-endian unsigned
integer i
in buf
.
set_uint32 buf i
writes the 32 bit long little-endian unsigned
integer i
in buf
.
set_uint64 buf i
writes the 64 bit long little-endian unsigned
integer i
in buf
.