Table Of Contents

Previous topic

Memory Allocation

Next topic

Math Functions

Byteswapping Functions

Declarations of byteswapping macros.

Summary

s_swap_le16 Swap a 16 bit little endian integer.
s_swap_le32 Swap a 32 bit little endian integer.
s_swap_le_flt Swap a little endian float data representation.
s_swap_le_dbl Swap a little endian double data representation.
s_swap_le_bytes Swap a s_byte array little endian data representation.
s_swap_le_bytes16 Swap a 16 bit little endian integer array.
s_swap_le_bytes32 Swap a 32 bit little endian integer array.
s_swap_be16 Swap a 16 bit big endian integer.
s_swap_be32 Swap a 32 bit big endian integer.
s_swap_be_flt Swap a big endian float data representation.
s_swap_be_dbl Swap a big endian double data representation.
s_swap_be_bytes Swap a s_byte array big endian data representation.
s_swap_be_bytes16 Swap a 16 bit big endian integer array.
s_swap_be_bytes32 Swap a 32 bit big endian integer array.

Little Endian

Values

macro s_swap_le16(SELF)

Swap a 16 bit little endian integer.

Parameters:
  • SELF

    The 16 bit little endian integer to swap.

Return:

A byte-swapped 16 bit integer.

macro s_swap_le32(SELF)

Swap a 32 bit little endian integer.

Parameters:
  • SELF

    The 32 bit little endian integer to swap.

Return:

A byte-swapped 32 bit integer.

macro s_swap_le_flt(SELF)

Swap a little endian float data representation.

Parameters:
  • SELF

    The little endian float data to swap.

Return:

A byte-swapped float.

macro s_swap_le_dbl(SELF)

Swap a little endian double data representation.

Parameters:
  • SELF

    The little endian double data to swap.

Return:

A byte-swapped double.

Arrays

macro s_swap_le_bytes(SELF, LENGTH, E)

Swap a s_byte array little endian data representation.

Parameters:
  • SELF

    The s_byte array little endian data to swap.

  • LENGTH

    The length of the s_byte array.

  • E

    s_erc Error code.

Return:

A byte-swapped s_byte array.

macro s_swap_le_bytes16(SELF, LENGTH, E)

Swap a 16 bit little endian integer array.

Parameters:
  • SELF

    The 16 bit little endian integer array to swap.

  • LENGTH

    The length of the array.

  • E

    s_erc Error code.

Return:

A byte-swapped 16 bit integer array.

macro s_swap_le_bytes32(SELF, LENGTH, E)

Swap a 32 bit little endian integer array.

Parameters:
  • SELF

    The 32 bit little endian integer array to swap.

  • LENGTH

    The length of the array.

  • E

    s_erc Error code.

Return:

A byte-swapped 32 bit integer array.

Big Endian

Values

macro s_swap_be16(SELF)

Swap a 16 bit big endian integer.

Parameters:
  • SELF

    The 16 bit big endian integer to swap.

Return:

A byte-swapped 16 bit integer.

macro s_swap_be32(SELF)

Swap a 32 bit big endian integer.

Parameters:
  • SELF

    The 32 bit big endian integer to swap.

Return:

A byte-swapped 32 bit integer.

macro s_swap_be_flt(SELF)

Swap a big endian float data representation.

Parameters:
  • SELF

    The big endian float data to swap.

Return:

A byte-swapped float.

macro s_swap_be_dbl(SELF)

Swap a big endian double data representation.

Parameters:
  • SELF

    The big endian double data to swap.

Return:

A byte-swapped double.

Arrays

macro s_swap_be_bytes(SELF, LENGTH, E)

Swap a s_byte array big endian data representation.

Parameters:
  • SELF

    The s_byte array big endian data to swap.

  • LENGTH

    The length of the s_byte array.

  • E

    s_erc Error code.

Return:

A byte-swapped s_byte array.

macro s_swap_be_bytes16(SELF, LENGTH, E)

Swap a 16 bit big endian integer array.

Parameters:
  • SELF

    The 16 bit big endian integer array to swap.

  • LENGTH

    The length of the array.

  • E

    s_erc Error code.

Return:

A byte-swapped 16 bit integer array.

macro s_swap_be_bytes32(SELF, LENGTH, E)

Swap a 32 bit big endian integer array.

Parameters:
  • SELF

    The 32 bit big endian integer array to swap.

  • LENGTH

    The length of the array.

  • E

    s_erc Error code.

Return:

A byte-swapped 32 bit integer array.