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

Byte-order related macros. More...

#include <kos/cdefs.h>
#include <machine/endian.h>

Go to the source code of this file.

Macros

#define BYTE_ORDER   LITTLE_ENDIAN
 Define the byte-order of the platform in use.
 

Functions

 arch_swap16 () is deprecated
 Swap the byte order of a 16-bit integer.
 
use __builtin_bswap16 ().") static inline uint16_t arch_swap16(uint16_t x)
 
 arch_swap32 () is deprecated
 Swap the byte order of a 32-bit integer.
 
use __builtin_bswap32 ().") static inline uint32_t arch_swap32(uint32_t x)
 
 arch_ntohs () is deprecated
 Convert network-to-host short.
 
use ntohs () from< arpa/inet.h >") static inline uint16_t arch_ntohs(uint16_t x)
 
 arch_ntohl () is deprecated
 Convert network-to-host long.
 
use ntohl () from< arpa/inet.h >") static inline uint32_t arch_ntohl(uint32_t x)
 
 arch_htons () is deprecated
 Convert host-to-network short.
 
use htons () from< arpa/inet.h >") static inline uint16_t arch_htons(uint16_t x)
 
 arch_htonl () is deprecated
 Convert host-to-network long.
 
use htonl () from< arpa/inet.h >") static inline uint32_t arch_htonl(uint32_t x)
 

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