Mstdlib-1.24.0
Endian

Enumerations

enum  M_endian_t {
  M_ENDIAN_BIG ,
  M_ENDIAN_LITTLE
}
 

Functions

M_uint16 M_hton16 (M_uint16 h16) M_WARN_UNUSED_RESULT
 
M_uint32 M_hton32 (M_uint32 h32) M_WARN_UNUSED_RESULT
 
M_uint64 M_hton64 (M_uint64 h64) M_WARN_UNUSED_RESULT
 
M_uint16 M_htol16 (M_uint16 h16) M_WARN_UNUSED_RESULT
 
M_uint32 M_htol32 (M_uint32 h32) M_WARN_UNUSED_RESULT
 
M_uint64 M_htol64 (M_uint64 h64) M_WARN_UNUSED_RESULT
 
M_uint16 M_ntoh16 (M_uint16 be16) M_WARN_UNUSED_RESULT
 
M_uint32 M_ntoh32 (M_uint32 be32) M_WARN_UNUSED_RESULT
 
M_uint64 M_ntoh64 (M_uint64 be64) M_WARN_UNUSED_RESULT
 
M_uint16 M_ltoh16 (M_uint16 be16) M_WARN_UNUSED_RESULT
 
M_uint32 M_ltoh32 (M_uint32 be32) M_WARN_UNUSED_RESULT
 
M_uint64 M_ltoh64 (M_uint64 be64) M_WARN_UNUSED_RESULT
 

Detailed Description

Conversion between byte orders.

Enumeration Type Documentation

◆ M_endian_t

enum M_endian_t

Endianness

Enumerator
M_ENDIAN_BIG 
M_ENDIAN_LITTLE 

Function Documentation

◆ M_hton16()

M_uint16 M_hton16 ( M_uint16  h16)

Convert a 16-bit unsigned integer in host byte order to network byte order.

Parameters
[in]h1616-bit unsigned integer in host byte order.
Returns
16-bit unsigned integer in network byte order.

◆ M_hton32()

M_uint32 M_hton32 ( M_uint32  h32)

Convert a 32-bit unsigned integer in host byte order to network byte order.

Parameters
[in]h3232-bit unsigned integer in host byte order.
Returns
32-bit unsigned integer in network byte order.

◆ M_hton64()

M_uint64 M_hton64 ( M_uint64  h64)

Convert a 64-bit unsigned integer in host byte order to network byte order.

Parameters
[in]h6464-bit unsigned integer in host byte order.
Returns
64-bit unsigned integer in network byte order.

◆ M_htol16()

M_uint16 M_htol16 ( M_uint16  h16)

Convert a 16-bit unsigned integer in host byte order to little endian byte order.

Parameters
[in]h1616-bit unsigned integer in host byte order.
Returns
16-bit unsigned integer in little endian byte order.

◆ M_htol32()

M_uint32 M_htol32 ( M_uint32  h32)

Convert a 32-bit unsigned integer in host byte order to little endian byte order.

Parameters
[in]h3232-bit unsigned integer in host byte order.
Returns
32-bit unsigned integer in little endian byte order.

◆ M_htol64()

M_uint64 M_htol64 ( M_uint64  h64)

Convert a 64-bit unsigned integer in host byte order to little endian byte order.

Parameters
[in]h6464-bit unsigned integer in host byte order.
Returns
64-bit unsigned integer in little endian byte order.

◆ M_ntoh16()

M_uint16 M_ntoh16 ( M_uint16  be16)

Convert a 16-bit unsigned integer in network byte order to host byte order.

Parameters
[in]be1616-bit unsigned integer in network byte order.
Returns
16-bit unsigned integer in little host byte order.

◆ M_ntoh32()

M_uint32 M_ntoh32 ( M_uint32  be32)

Convert a 32-bit unsigned integer in network byte order to host byte order.

Parameters
[in]be3232-bit unsigned integer in network byte order.
Returns
32-bit unsigned integer in little host byte order.

◆ M_ntoh64()

M_uint64 M_ntoh64 ( M_uint64  be64)

Convert a 64-bit unsigned integer in network byte order to host byte order.

Parameters
[in]be6464-bit unsigned integer in network byte order.
Returns
64-bit unsigned integer in little host byte order.

◆ M_ltoh16()

M_uint16 M_ltoh16 ( M_uint16  be16)

Convert a 16-bit unsigned integer in little endian byte order to host byte order.

Parameters
[in]be1616-bit unsigned integer in little endian byte order.
Returns
16-bit unsigned integer in little host byte order.

◆ M_ltoh32()

M_uint32 M_ltoh32 ( M_uint32  be32)

Convert a 32-bit unsigned integer in little endian byte order to host byte order.

Parameters
[in]be3232-bit unsigned integer in little endian byte order.
Returns
32-bit unsigned integer in little host byte order.

◆ M_ltoh64()

M_uint64 M_ltoh64 ( M_uint64  be64)

Convert a 64-bit unsigned integer in little endian byte order to host byte order.

Parameters
[in]be6464-bit unsigned integer in little endian byte order.
Returns
64-bit unsigned integer in little host byte order.