P99
Macros | Typedefs | Enumerations | Functions

Help to handle endianess problems of different kind. More...

+ Collaboration diagram for Endianess:

Macros

#define P99_ENDIANNESS   ((p99_endianness)P99_HTON(4, UINT32_C(0x01020304)))
 Return the platform endianness in terms of a value of type p99_endianness. More...
 
#define P99_HTON(N, X)   (((P99_PASTE2(p00_endian_, N) const)P99_HTON_INITIALIZER(N, X)).p00_i)
 host to network transformation of integers according to the endianness of the platform More...
 
#define P99_HTON_INITIALIZER(N, X)   { .p00_c = { P00_HTON(N, X) } }
 
#define P99_HTONL(X)   P99_HTON(4, X)
 host to network transformation of integers according to the endianness of the platform More...
 
#define P99_HTONS(X)   P99_HTON(2, X)
 host to network transformation of integers according to the endianness of the platform More...
 
#define P99_NTOH(N, X)   (P99_PASTE2(p00_uint_byte_, N) const)P00_NTOH(N, X, ((P99_PASTE2(p00_endian_, N) const)P99_NTOH_INITIALIZER(N, X)))
 network to host transformation of integers according to the endianness of the platform More...
 
#define P99_NTOH_INITIALIZER(N, X)   { .p00_i = (X) }
 
#define P99_NTOHL(X)   P99_NTOH(4, X)
 network to host transformation of integers according to the endianness of the platform More...
 
#define P99_NTOHS(X)   P99_NTOH(2, X)
 network to host transformation of integers according to the endianness of the platform More...
 

Typedefs

typedef enum p99_endianness p99_endianness
 Classify platforms according to their endianness. More...
 

Enumerations

enum  p99_endianness { p99_big_endian = 0x01020304u, p99_little_endian = 0x04030201u, p99_pdp_endian = 0x02010403u }
 Classify platforms according to their endianness. More...
 

Functions

char const * p99_endianness_getname (p99_endianness p00_x)
 Get a string with the name of constant p00_x of type :: p99_endianness
More...
 

Detailed Description

Help to handle endianess problems of different kind.