Starboard Module Reference: byte_swap.h

Specifies functions for swapping byte order. These functions are used to deal with endianness when performing I/O.

Macros

SB_HOST_TO_NET_S16

Note that this macro's definition varies depending on the values of one or more other variables.

SB_HOST_TO_NET_S32

Note that this macro's definition varies depending on the values of one or more other variables.

SB_HOST_TO_NET_S64

Note that this macro's definition varies depending on the values of one or more other variables.

SB_HOST_TO_NET_U16

Note that this macro's definition varies depending on the values of one or more other variables.

SB_HOST_TO_NET_U32

Note that this macro's definition varies depending on the values of one or more other variables.

SB_HOST_TO_NET_U64

Note that this macro's definition varies depending on the values of one or more other variables.

SB_NET_TO_HOST_S16

SB_NET_TO_HOST_S32

SB_NET_TO_HOST_S64

SB_NET_TO_HOST_U16

SB_NET_TO_HOST_U32

SB_NET_TO_HOST_U64

Functions

SbByteSwapS16

Description

Unconditionally swaps the byte order in signed 16-bit value.

Declaration

SB_EXPORT int16_t SbByteSwapS16(int16_t value);

Parameters

Parameters
int16_t
value
The value for which the byte order will be swapped.

SbByteSwapS32

Description

Unconditionally swaps the byte order in signed 32-bit value.

Declaration

SB_EXPORT int32_t SbByteSwapS32(int32_t value);

Parameters

Parameters
int32_t
value
The value for which the byte order will be swapped.

SbByteSwapS64

Description

Unconditionally swaps the byte order in signed 64-bit value.

Declaration

SB_EXPORT int64_t SbByteSwapS64(int64_t value);

Parameters

Parameters
int64_t
value
The value for which the byte order will be swapped.

SbByteSwapU16

Description

Unconditionally swaps the byte order in unsigned 16-bit value.

Declaration

SB_EXPORT uint16_t SbByteSwapU16(uint16_t value);

Parameters

Parameters
uint16_t
value
The value for which the byte order will be swapped.

SbByteSwapU32

Description

Unconditionally swaps the byte order in unsigned 32-bit value.

Declaration

SB_EXPORT uint32_t SbByteSwapU32(uint32_t value);

Parameters

Parameters
uint32_t
value
The value for which the byte order will be swapped.

SbByteSwapU64

Description

Unconditionally swaps the byte order in unsigned 64-bit value.

Declaration

SB_EXPORT uint64_t SbByteSwapU64(uint64_t value);

Parameters

Parameters
uint64_t
value
The value for which the byte order will be swapped.