#ifndef CFBYTEORDER_H
#define CFBYTEORDER__H

#if defined(__i386) && !defined(__LITTLE_ENDIAN__)
    #define __LITTLE_ENDIAN__ 1
#endif

#if !defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
#error Do not know the endianess of this architecture
#endif

#include <CoreFoundation/CFBase.h>

#if defined(__cplusplus)
extern "C" {
#endif

/*CFSwapInt32BigToHost

Converts a 32-bit integer from big-endian format to the host’s native byte order.

uint32_t CFSwapInt32BigToHost (
   uint32_t arg
);
Parameters
arg

The integer whose bytes should be swapped.
Return Value

The integer with its bytes swapped. If the host is big-endian, this function returns arg unchanged.
Availability
Available in Mac OS X v10.0 and later.*/
uint32_t CFSwapInt32BigToHost (
   uint32_t arg
);

/*CFSwapInt32HostToBig

Converts a 32-bit integer from the host’s native byte order to big-endian format.

uint32_t CFSwapInt32HostToBig (
   uint32_t arg
);
Parameters
arg

The integer whose bytes should be swapped.
Return Value

The integer with its bytes swapped. If the host is big-endian, this function returns arg unchanged.
Availability
Available in Mac OS X v10.0 and later.*/

uint32_t CFSwapInt32HostToBig (
   uint32_t arg
);


#ifdef __cplusplus
}
#endif

#endif