Loading...
Searching...
No Matches
endian conversions as provided by most libcs

This module provides architecture-independent access to architecture details. More...

Detailed Description

This module provides architecture-independent access to architecture details.

Files

file  endian.h
 libc header for endian conversion
 

Macros

#define LITTLE_ENDIAN   magic-number
 A numeric constant representing little endian byte order.
 
#define BIG_ENDIAN   magic-number
 A numeric constant representing big endian byte order.
 
#define PDP_ENDIAN   magic-number
 A numeric constant representing PDP endian byte order.
 
#define BYTE_ORDER   <LITTLE_ENDIAN or BIG_ENDIAN>
 The byte order of this machines indicated by the constant BIG_ENDIAN or LITTLE_ENDIAN.
 

Functions

uint16_t htobe16 (uint16_t host_16bits)
 host to big endian, 16 bit
 
uint16_t htole16 (uint16_t host_16bits)
 host to little endian, 16 bit
 
uint16_t be16toh (uint16_t big_endian_16bits)
 big endian to host, 16 bit
 
uint16_t le16toh (uint16_t little_endian_16bits)
 little endian to host, 16 bit
 
uint32_t htobe32 (uint32_t host_32bits)
 host to big endian, 32 bit
 
uint32_t htole32 (uint32_t host_32bits)
 host to little endian, 32 bit
 
uint32_t be32toh (uint32_t big_endian_32bits)
 big endian to host, 32 bit
 
uint32_t le32toh (uint32_t little_endian_32bits)
 little endian to host, 32 bit
 
uint64_t htobe64 (uint64_t host_64bits)
 host to big endian, 64 bit
 
uint64_t htole64 (uint64_t host_64bits)
 host to little endian, 64 bit
 
uint64_t be64toh (uint64_t big_endian_64bits)
 big endian to host, 64 bit
 
uint64_t le64toh (uint64_t little_endian_64bits)
 little endian to host, 64 bit
 

Macro Definition Documentation

◆ BIG_ENDIAN

#define BIG_ENDIAN   magic-number

A numeric constant representing big endian byte order.

Definition at line 41 of file endian.h.

◆ BYTE_ORDER

#define BYTE_ORDER   <LITTLE_ENDIAN or BIG_ENDIAN>

The byte order of this machines indicated by the constant BIG_ENDIAN or LITTLE_ENDIAN.

Note
This numeric constant is available at preprocessor time, so you can compare this to BIG_ENDIAN or LITTLE_ENDIAN in #if directives.

Definition at line 56 of file endian.h.

◆ LITTLE_ENDIAN

#define LITTLE_ENDIAN   magic-number

A numeric constant representing little endian byte order.

Definition at line 36 of file endian.h.

◆ PDP_ENDIAN

#define PDP_ENDIAN   magic-number

A numeric constant representing PDP endian byte order.

Definition at line 46 of file endian.h.