5 #include <ctu_endian_api.h> 
   18 #   define CT_BIG_ENDIAN REG_DWORD_BIG_ENDIAN 
   19 #   define CT_LITTLE_ENDIAN REG_DWORD_LITTLE_ENDIAN 
   20 #   define CT_BYTE_ORDER REG_DWORD 
   25 #      include <machine/endian.h> 
   27 #   define CT_BIG_ENDIAN __ORDER_BIG_ENDIAN__ 
   28 #   define CT_LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ 
   29 #   define CT_BYTE_ORDER __BYTE_ORDER__ 
   44 #define ENDIAN(id, name, v) id = (v), 
#define CT_NODISCARD
mark a function as returning a value that must be used
 
#define IN_DOMAIN(cmp, it)
annotate a parameter as being bounded by the expression of cmp and it
 
#define CT_CONSTFN
mark a function as const, has no side effects and always returns the same value for the same argument...
 
CT_NODISCARD CT_CONSTFN CT_ENDIAN_API uint16_t endian_swap16(uint16_t value)
swap the endianess of a 16-bit value
 
CT_NODISCARD CT_CONSTFN CT_ENDIAN_API uint64_t endian_swap64(uint64_t value)
swap the endianess of a 64-bit value
 
CT_NODISCARD CT_CONSTFN CT_ENDIAN_API uint64_t native_order64(uint64_t value, endian_t order)
convert a 64-bit value of a given endianess to the native endianess
 
CT_NODISCARD CT_CONSTFN CT_ENDIAN_API uint32_t endian_swap32(uint32_t value)
swap the endianess of a 32-bit value
 
CT_NODISCARD CT_CONSTFN CT_ENDIAN_API uint16_t native_order16(uint16_t value, endian_t order)
convert a 16-bit value of a given endianess to the native endianess
 
CT_NODISCARD CT_CONSTFN CT_ENDIAN_API uint32_t native_order32(uint32_t value, endian_t order)
convert a 32-bit value of a given endianess to the native endianess