Module Cstruct_cap.LE

Little-endian Byte Order

val get_uint16 : 'a rd t -> int -> uint16

get_uint16 t i returns the two bytes in t starting at offset i, interpreted as an uint16. Sign extension is not interpreted.

raises Invalid_argument

if t is too small.

val get_uint32 : 'a rd t -> int -> uint32

get_uint32 t i returns the four bytes in t starting at offset i. t needs at least read-capability rd.

raises Invalid_argument

if t is too small.

val get_uint64 : 'a rd t -> int -> uint64

get_uint64 t i returns the eight bytes in t starting at offset i. t needs at least read-capability rd.

raises Invalid_argument

if t is too small.

val set_uint16 : 'a wr t -> int -> uint16 -> unit

set_uint16 t i v sets the two bytes in t starting at offset i to the value v. t needs at least write-capability wr.

raises Invalid_argument

if t is too small.

val set_uint32 : 'a wr t -> int -> uint32 -> unit

set_uint32 t i v sets the four bytes in t starting at offset i to the value v. t needs at least write-capability wr.

raises Invalid_argument

if t is too small.

val set_uint64 : 'a wr t -> int -> uint64 -> unit

set_uint64 t i v sets the eight bytes in t starting at offset i to the value v. t needs at least write-capability wr.

raises Invalid_argument

if t is too small.