CWB
Functions
endian.c File Reference

Provides the definition of the cl_bswap32() function, which was used as a portable implementation of the ntohl() and htonl() macros in earlier CWB versions; still needed for explicit conversion to little-endian format. More...

#include "globals.h"
#include "endian.h"

Functions

int cl_bswap32 (int x)
 Swaps the byte order of a integer. More...
 

Detailed Description

Provides the definition of the cl_bswap32() function, which was used as a portable implementation of the ntohl() and htonl() macros in earlier CWB versions; still needed for explicit conversion to little-endian format.

Function Documentation

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.

Parameters
xThe integer whose bytes are to be reordered.
Returns
The reordered integer.

Referenced by process_fd().