sysdep.h
stdlib.h
stddef.h
stdint.h
stdbool.h
arpa/inet.h
sysdep.h
arpa/inet.h
stdbool.h
stddef.h
stdint.h
stdlib.h
__LITTLE_ENDIAN__
etf_byte_order_16
x
ntohs(x)
etf_byte_order_32
x
ntohl(x)
etf_byte_order_64
x
( ((((uint64_t)x) << 56) ) | \ ((((uint64_t)x) << 40) & 0x00ff000000000000ULL ) | \ ((((uint64_t)x) << 24) & 0x0000ff0000000000ULL ) | \ ((((uint64_t)x) << 8) & 0x000000ff00000000ULL ) | \ ((((uint64_t)x) >> 8) & 0x00000000ff000000ULL ) | \ ((((uint64_t)x) >> 24) & 0x0000000000ff0000ULL ) | \ ((((uint64_t)x) >> 40) & 0x000000000000ff00ULL ) | \ ((((uint64_t)x) >> 56) ) )
store_16_bits
to
num
do { uint16_t val = etf_byte_order_16(num); memcpy(to, &val, 2); } while(0)
store_32_bits
to
num
do { uint32_t val = etf_byte_order_32(num); memcpy(to, &val, 4); } while(0)
store_64_bits
to
num
do { uint64_t val = etf_byte_order_64(num); memcpy(to, &val, 8); } while(0)