Conversions between the CPU byte order (always little-endian) and fixed byte orders.
More...
|
| static uint16_t | pbl_be16_to_cpu (uint16_t v) |
| | Convert a big-endian 16-bit value to CPU order.
|
| |
| static uint16_t | pbl_cpu_to_be16 (uint16_t v) |
| | Convert a 16-bit value in CPU order to big-endian.
|
| |
| static uint32_t | pbl_be32_to_cpu (uint32_t v) |
| | Convert a big-endian 32-bit value to CPU order.
|
| |
| static uint32_t | pbl_cpu_to_be32 (uint32_t v) |
| | Convert a 32-bit value in CPU order to big-endian.
|
| |
| static uint64_t | pbl_be64_to_cpu (uint64_t v) |
| | Convert a big-endian 64-bit value to CPU order.
|
| |
| static uint64_t | pbl_cpu_to_be64 (uint64_t v) |
| | Convert a 64-bit value in CPU order to big-endian.
|
| |
| static uint16_t | pbl_le16_to_cpu (uint16_t v) |
| | Convert a little-endian 16-bit value to CPU order.
|
| |
| static uint16_t | pbl_cpu_to_le16 (uint16_t v) |
| | Convert a 16-bit value in CPU order to little-endian.
|
| |
| static uint32_t | pbl_le32_to_cpu (uint32_t v) |
| | Convert a little-endian 32-bit value to CPU order.
|
| |
| static uint32_t | pbl_cpu_to_le32 (uint32_t v) |
| | Convert a 32-bit value in CPU order to little-endian.
|
| |
| static uint64_t | pbl_le64_to_cpu (uint64_t v) |
| | Convert a little-endian 64-bit value to CPU order.
|
| |
| static uint64_t | pbl_cpu_to_le64 (uint64_t v) |
| | Convert a 64-bit value in CPU order to little-endian.
|
| |
| static uint16_t | pbl_be16_get (pbl_be16_t be) |
| | Read a wrapped big-endian 16-bit value.
|
| |
| static pbl_be16_t | pbl_be16_make (uint16_t v) |
| | Wrap a 16-bit value as big-endian.
|
| |
| static uint16_t | pbl_get_le16 (const void *src) |
| | Read a little-endian 16-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_le16 (uint16_t val, void *dst) |
| | Write a 16-bit value as little-endian to a possibly unaligned buffer.
|
| |
| static uint16_t | pbl_get_be16 (const void *src) |
| | Read a big-endian 16-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_be16 (uint16_t val, void *dst) |
| | Write a 16-bit value as big-endian to a possibly unaligned buffer.
|
| |
| static uint32_t | pbl_get_le24 (const void *src) |
| | Read a little-endian 24-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_le24 (uint32_t val, void *dst) |
| | Write a 24-bit value as little-endian to a possibly unaligned buffer.
|
| |
| static uint32_t | pbl_get_be24 (const void *src) |
| | Read a big-endian 24-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_be24 (uint32_t val, void *dst) |
| | Write a 24-bit value as big-endian to a possibly unaligned buffer.
|
| |
| static uint32_t | pbl_get_le32 (const void *src) |
| | Read a little-endian 32-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_le32 (uint32_t val, void *dst) |
| | Write a 32-bit value as little-endian to a possibly unaligned buffer.
|
| |
| static uint32_t | pbl_get_be32 (const void *src) |
| | Read a big-endian 32-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_be32 (uint32_t val, void *dst) |
| | Write a 32-bit value as big-endian to a possibly unaligned buffer.
|
| |
| static uint64_t | pbl_get_le64 (const void *src) |
| | Read a little-endian 64-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_le64 (uint64_t val, void *dst) |
| | Write a 64-bit value as little-endian to a possibly unaligned buffer.
|
| |
| static uint64_t | pbl_get_be64 (const void *src) |
| | Read a big-endian 64-bit value from a possibly unaligned buffer.
|
| |
| static void | pbl_put_be64 (uint64_t val, void *dst) |
| | Write a 64-bit value as big-endian to a possibly unaligned buffer.
|
| |
Conversions between the CPU byte order (always little-endian) and fixed byte orders.
} hdr;
#define PBL_PACKED
Lay out the struct/union without padding.
Definition compiler.h:80
Big-endian 16-bit value, wrapped so it cannot be used without conversion.
Definition byteorder.h:33
static uint16_t pbl_be16_get(pbl_be16_t be)
Read a wrapped big-endian 16-bit value.
Definition byteorder.h:164
static pbl_be16_t pbl_be16_make(uint16_t v)
Wrap a 16-bit value as big-endian.
Definition byteorder.h:174
static void pbl_put_be16(uint16_t val, void *dst)
Write a 16-bit value as big-endian to a possibly unaligned buffer.
Definition byteorder.h:224
static uint32_t pbl_get_le32(const void *src)
Read a little-endian 32-bit value from a possibly unaligned buffer.
Definition byteorder.h:288