module LittleEndian:sig..end
Author: Goswin von Brederlow
val uint16_from_host : int -> intuint16_from_host u16 converts an unsigned 16bit integer from host to
little endian byte orderval int16_from_host : int -> intint16_from_host i16 converts a signed 16bit integer from host to
little endian byte orderval uint16_to_host : int -> intuint16_to_host u16 converts an unsigned 16bit integer from little
endian to host byte orderval int16_to_host : int -> intint16_to_host i16 converts a signed 16bit integer from little
endian to host byte orderval uint31_from_host : int -> intuint31_from_host u31 converts an unsigned 31bit integer from
host to little endian byte orderval int31_from_host : int -> intint31_from_host i31 converts a signed 31bit integer from host to
little endian byte orderval uint31_to_host : int -> intuint31_to_host u31 converts an unsigned 31bit integer from little
endian to host byte orderval int31_to_host : int -> intint31_to_host i31 converts a signed 31bit integer from little
endian to host byte orderval int32_from_host : int32 -> int32int32_from_host int32 converts a 32bit integer from host to little
endian byte orderval int32_to_host : int32 -> int32int32_to_host int32 converts a 32bit integer from little endian to
host byte orderval int64_from_host : int64 -> int64int64_from_host int64 converts a 64bit integer from host to little
endian byte orderval int64_to_host : int64 -> int64int64_to_host int64 converts a 64bit integer from little endian to
host byte orderval unsafe_get_uint8 : string -> int -> intunsafe_get_X str off extract integer of type X from string
str starting at offset off. Unsigned types are 0 extended
and signed types are sign extended to fill the ocaml type.
Bounds checking is not performed. Use with caution and only when
the program logic guarantees that the access is within bounds.
Note: The 31bit functions extract a 32bit integer and return it
as ocaml int. On 32bit platforms this can overflow as ocaml
integers are 31bit signed there. No error is reported if this
occurs. Use with care.
val unsafe_get_int8 : string -> int -> intval unsafe_get_uint16 : string -> int -> intval unsafe_get_int16 : string -> int -> intval unsafe_get_uint31 : string -> int -> intval unsafe_get_int31 : string -> int -> intval unsafe_get_int32 : string -> int -> int32val unsafe_get_int64 : string -> int -> int64val get_uint8 : string -> int -> intget_X str off same as unsafe_get_X but with bounds checking.val get_int8 : string -> int -> intval get_uint16 : string -> int -> intval get_int16 : string -> int -> intval get_uint31 : string -> int -> intval get_int31 : string -> int -> intval get_int32 : string -> int -> int32val get_int64 : string -> int -> int64val unsafe_set_uint8 : string -> int -> int -> unitunsafe_set_X str off v stores the integer v as type X in
string str starting at offset off. Bounds checking is not
performed. Use with caution and only when the program logic
guarantees that the access is within bounds.
Note: The 31bit functions store an ocaml int as 32bit
integer. On 32bit platforms ocaml integers are 31bit signed and
will be sign extended to 32bit first. Use with care.
val unsafe_set_int8 : string -> int -> int -> unitval unsafe_set_uint16 : string -> int -> int -> unitval unsafe_set_int16 : string -> int -> int -> unitval unsafe_set_uint31 : string -> int -> int -> unitval unsafe_set_int31 : string -> int -> int -> unitval unsafe_set_int32 : string -> int -> int32 -> unitval unsafe_set_int64 : string -> int -> int64 -> unitval set_uint8 : string -> int -> int -> unitset_X str off v same as unsafe_set_X but with bounds checking.val set_int8 : string -> int -> int -> unitval set_uint16 : string -> int -> int -> unitval set_int16 : string -> int -> int -> unitval set_uint31 : string -> int -> int -> unitval set_int31 : string -> int -> int -> unitval set_int32 : string -> int -> int32 -> unitval set_int64 : string -> int -> int64 -> unit