KallistiOS git master
Independent SDK for the Sega Dreamcast
Loading...
Searching...
No Matches
byteorder.h File Reference

Byte-order related macros. More...

#include <sys/cdefs.h>
#include <sys/_types.h>

Go to the source code of this file.

Macros

#define BYTE_ORDER   LITTLE_ENDIAN
 Define the byte-order of the platform in use.
 
#define arch_swap16(x)
 Swap the byte order of a 16-bit integer.
 
#define arch_swap32(x)
 Swap the byte order of a 32-bit integer.
 
#define arch_ntohs(x)   arch_swap16(x)
 Convert network-to-host short.
 
#define arch_ntohl(x)   arch_swap32(x)
 Convert network-to-host long.
 
#define arch_htons(x)   arch_swap16(x)
 Convert host-to-network short.
 
#define arch_htonl(x)   arch_swap32(x)
 Convert host-to-network long.
 

Detailed Description

Byte-order related macros.

This file contains architecture-specific byte-order related macros and/or functions. Each platform should define six macros/functions in this file: arch_swap16, arch_swap32, arch_ntohs, arch_ntohl, arch_htons, and arch_htonl. The first two of these swap the byte order of 16-bit and 32-bit integers, respectively. The other four macros will be used by the kernel to implement the network-related byte order functions.

Author
Lawrence Sebald