MstructSourceMutable byte windows on top of Cstruct 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
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.
get_string buf len is the string of size len 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_delim buf c fn builds a subwindow of buf by looking at the first occurence of the character c. Once the window is built, apply fn on the resulting buffer. Return None if c does not appear in the current buffer.
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_char buf off c write the character c in buf at offset off.
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.
of_bigarray ~off ~len b is the mstruct contained in b starting at off, of length len.
Accessor. Return the underlying bigarray.