Endian API

group Endian

Functions

uint16_t csp_hton16(uint16_t h16)

Convert 16-bit integer from host byte order to network byte order.

Parameters
  • h16: Host byte order 16-bit integer

uint16_t csp_ntoh16(uint16_t n16)

Convert 16-bit integer from host byte order to host byte order.

Parameters
  • n16: Network byte order 16-bit integer

uint32_t csp_hton32(uint32_t h32)

Convert 32-bit integer from host byte order to network byte order.

Parameters
  • h32: Host byte order 32-bit integer

uint32_t csp_ntoh32(uint32_t n32)

Convert 32-bit integer from host byte order to host byte order.

Parameters
  • n32: Network byte order 32-bit integer

uint64_t csp_hton64(uint64_t h64)

Convert 64-bit integer from host byte order to network byte order.

Parameters
  • h64: Host byte order 64-bit integer

uint64_t csp_ntoh64(uint64_t n64)

Convert 64-bit integer from host byte order to host byte order.

Parameters
  • n64: Network byte order 64-bit integer

uint16_t csp_htobe16(uint16_t h16)

Convert 16-bit integer from host byte order to big endian byte order.

Parameters
  • h16: Host byte order 16-bit integer

uint16_t csp_htole16(uint16_t h16)

Convert 16-bit integer from host byte order to little endian byte order.

Parameters
  • h16: Host byte order 16-bit integer

uint16_t csp_betoh16(uint16_t be16)

Convert 16-bit integer from big endian byte order to little endian byte order.

Parameters
  • be16: Big endian byte order 16-bit integer

uint16_t csp_letoh16(uint16_t le16)

Convert 16-bit integer from little endian byte order to host byte order.

Parameters
  • le16: Little endian byte order 16-bit integer

uint32_t csp_htobe32(uint32_t h32)

Convert 32-bit integer from host byte order to big endian byte order.

Parameters
  • h32: Host byte order 32-bit integer

uint32_t csp_htole32(uint32_t h32)

Convert 32-bit integer from little endian byte order to host byte order.

Parameters
  • h32: Host byte order 32-bit integer

uint32_t csp_betoh32(uint32_t be32)

Convert 32-bit integer from big endian byte order to host byte order.

Parameters
  • be32: Big endian byte order 32-bit integer

uint32_t csp_letoh32(uint32_t le32)

Convert 32-bit integer from little endian byte order to host byte order.

Parameters
  • le32: Little endian byte order 32-bit integer

uint64_t csp_htobe64(uint64_t h64)

Convert 64-bit integer from host byte order to big endian byte order.

Parameters
  • h64: Host byte order 64-bit integer

uint64_t csp_htole64(uint64_t h64)

Convert 64-bit integer from host byte order to little endian byte order.

Parameters
  • h64: Host byte order 64-bit integer

uint64_t csp_betoh64(uint64_t be64)

Convert 64-bit integer from big endian byte order to host byte order.

Parameters
  • be64: Big endian byte order 64-bit integer

uint64_t csp_letoh64(uint64_t le64)

Convert 64-bit integer from little endian byte order to host byte order.

Parameters
  • le64: Little endian byte order 64-bit integer

float csp_htonflt(float f)

Convert float from host to network byte order.

Return
Float in network order
Parameters
  • f: Float in host order

float csp_ntohflt(float f)

Convert float from network to host byte order.

Return
Float in host order
Parameters
  • f: Float in network order

double csp_htondbl(double d)

Convert double from host to network byte order.

Return
Double in network order
Parameters
  • d: Double in host order

double csp_ntohdbl(double d)

Convert double from network to host order.

Return
Double in host order
Parameters
  • d: Double in network order