Embedded Artistry Framework
Embedded Systems C++ Framework
Macros
endian.h File Reference
#include <_endian.h>
#include <stdint.h>
Include dependency graph for endian.h:

Macros

#define __LITTLE_ENDIAN   1234
 
#define __BIG_ENDIAN   4321
 
#define __PDP_ENDIAN   3412
 
#define BIG_ENDIAN   __BIG_ENDIAN
 
#define LITTLE_ENDIAN   __LITTLE_ENDIAN
 
#define PDP_ENDIAN   __PDP_ENDIAN
 
#define BYTE_ORDER   __BYTE_ORDER
 
#define __bswap16(x)   ((uint16_t)((((uint16_t)(x)&0xff00) >> 8) | (((uint16_t)(x)&0x00ff) << 8)))
 
#define __bswap32(x)
 
#define __bswap64(x)
 
#define htobe16(x)   __bswap16(x)
 
#define be16toh(x)   __bswap16(x)
 
#define betoh16(x)   __bswap16(x)
 
#define htobe32(x)   __bswap32(x)
 
#define be32toh(x)   __bswap32(x)
 
#define betoh32(x)   __bswap32(x)
 
#define htobe64(x)   __bswap64(x)
 
#define be64toh(x)   __bswap64(x)
 
#define betoh64(x)   __bswap64(x)
 
#define htole16(x)   (uint16_t)(x)
 
#define le16toh(x)   (uint16_t)(x)
 
#define letoh16(x)   (uint16_t)(x)
 
#define htole32(x)   (uint32_t)(x)
 
#define le32toh(x)   (uint32_t)(x)
 
#define letoh32(x)   (uint32_t)(x)
 
#define htole64(x)   (uint64_t)(x)
 
#define le64toh(x)   (uint64_t)(x)
 
#define letoh64(x)   (uint64_t)(x)
 
#define ntohs(x)   __bswap16(x)
 
#define htons(x)   __bswap16(x)
 
#define ntohl(x)   __bswap32(x)
 
#define htonl(x)   __bswap32(x)
 
#define ntohll(x)   __bswap64(x)
 
#define htonll(x)   __bswap64(x)
 
#define NTOHL(x)   (x) = ntohl((uint32_t)x)
 
#define NTOHS(x)   (x) = ntohs((uint16_t)x)
 
#define NTOHLL(x)   (x) = ntohll((uint64_t)x)
 
#define HTONL(x)   (x) = htonl((uint32_t)x)
 
#define HTONS(x)   (x) = htons((uint16_t)x)
 
#define HTONLL(x)   (x) = htonll((uint64_t)x)
 

Macro Definition Documentation

◆ __BIG_ENDIAN

#define __BIG_ENDIAN   4321

◆ __bswap16

#define __bswap16 (   x)    ((uint16_t)((((uint16_t)(x)&0xff00) >> 8) | (((uint16_t)(x)&0x00ff) << 8)))

◆ __bswap32

#define __bswap32 (   x)
Value:
((uint32_t)((((uint32_t)(x)&0xff000000) >> 24) | (((uint32_t)(x)&0x00ff0000) >> 8) | \
(((uint32_t)(x)&0x0000ff00) << 8) | (((uint32_t)(x)&0x000000ff) << 24)))
unsigned int uint32_t
Definition: _uint32_t.h:4

◆ __bswap64

#define __bswap64 (   x)
Value:
((uint64_t)((((uint64_t)(x)&0xff00000000000000ULL) >> 56) | \
(((uint64_t)(x)&0x00ff000000000000ULL) >> 40) | \
(((uint64_t)(x)&0x0000ff0000000000ULL) >> 24) | \
(((uint64_t)(x)&0x000000ff00000000ULL) >> 8) | \
(((uint64_t)(x)&0x00000000ff000000ULL) << 8) | \
(((uint64_t)(x)&0x0000000000ff0000ULL) << 24) | \
(((uint64_t)(x)&0x000000000000ff00ULL) << 40) | \
(((uint64_t)(x)&0x00000000000000ffULL) << 56)))
unsigned long uint64_t
Definition: _uint64_t.h:4

◆ __LITTLE_ENDIAN

#define __LITTLE_ENDIAN   1234

◆ __PDP_ENDIAN

#define __PDP_ENDIAN   3412

◆ be16toh

#define be16toh (   x)    __bswap16(x)

◆ be32toh

#define be32toh (   x)    __bswap32(x)

◆ be64toh

#define be64toh (   x)    __bswap64(x)

◆ betoh16

#define betoh16 (   x)    __bswap16(x)

◆ betoh32

#define betoh32 (   x)    __bswap32(x)

◆ betoh64

#define betoh64 (   x)    __bswap64(x)

◆ BIG_ENDIAN

#define BIG_ENDIAN   __BIG_ENDIAN

◆ BYTE_ORDER

#define BYTE_ORDER   __BYTE_ORDER

◆ htobe16

#define htobe16 (   x)    __bswap16(x)

◆ htobe32

#define htobe32 (   x)    __bswap32(x)

◆ htobe64

#define htobe64 (   x)    __bswap64(x)

◆ htole16

#define htole16 (   x)    (uint16_t)(x)

◆ htole32

#define htole32 (   x)    (uint32_t)(x)

◆ htole64

#define htole64 (   x)    (uint64_t)(x)

◆ htonl

#define htonl (   x)    __bswap32(x)

◆ HTONL

#define HTONL (   x)    (x) = htonl((uint32_t)x)

◆ htonll

#define htonll (   x)    __bswap64(x)

◆ HTONLL

#define HTONLL (   x)    (x) = htonll((uint64_t)x)

◆ htons

#define htons (   x)    __bswap16(x)

◆ HTONS

#define HTONS (   x)    (x) = htons((uint16_t)x)

◆ le16toh

#define le16toh (   x)    (uint16_t)(x)

◆ le32toh

#define le32toh (   x)    (uint32_t)(x)

◆ le64toh

#define le64toh (   x)    (uint64_t)(x)

◆ letoh16

#define letoh16 (   x)    (uint16_t)(x)

◆ letoh32

#define letoh32 (   x)    (uint32_t)(x)

◆ letoh64

#define letoh64 (   x)    (uint64_t)(x)

◆ LITTLE_ENDIAN

#define LITTLE_ENDIAN   __LITTLE_ENDIAN

◆ ntohl

#define ntohl (   x)    __bswap32(x)

◆ NTOHL

#define NTOHL (   x)    (x) = ntohl((uint32_t)x)

◆ ntohll

#define ntohll (   x)    __bswap64(x)

◆ NTOHLL

#define NTOHLL (   x)    (x) = ntohll((uint64_t)x)

◆ ntohs

#define ntohs (   x)    __bswap16(x)

◆ NTOHS

#define NTOHS (   x)    (x) = ntohs((uint16_t)x)

◆ PDP_ENDIAN

#define PDP_ENDIAN   __PDP_ENDIAN