CWB
|
globals.h checks whether endianness is well-defined. More...
#include <netinet/in.h>
Functions | |
int | cl_bswap32 (int x) |
Swaps the byte order of a integer. More... | |
globals.h checks whether endianness is well-defined.
The CWB uses network byte order (i.e. Most Significant Byte First) for 32-bit integers stored in its platform-independent disk files.
Conversion to and from processor-native byte order is handled by the BSD functions/macros htonl() and ntohl(), which must be available in the system library.
int cl_bswap32 | ( | int | x | ) |
Swaps the byte order of a integer.
This function is a portable bswap implementation allowing explicit conversion to little-endian format (by a combination of cl_bswap32() and htonl())
Note that this function will work correctly with 32bit and larger int data types.
x | The integer whose bytes are to be reordered. |
Referenced by process_fd().