Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
AG_BYTESWAP(3)	       FreeBSD Library Functions Manual		AG_BYTESWAP(3)

NAME
     AG_ByteSwap -- agar byte swapping macros

SYNOPSIS
     #include <agar/core/byteswap.h>

DESCRIPTION
     These macros swap the order of bytes in integers and floating-point
     types.  They are useful when reading or writing data of a specific	endi-
     anness.

     Uint16 AG_Swap16(Uint16 value)

     Uint32 AG_Swap32(Uint32 value)

     Uint64 AG_Swap64(Uint64 value)

     float AG_SwapFLT(float value)

     double AG_SwapDBL(double value)

     long double AG_SwapLDBL(long double value)

     Uint16 AG_SwapLE16(Uint16 value)

     Uint32 AG_SwapLE32(Uint32 value)

     Uint64 AG_SwapLE64(Uint64 value)

     float AG_SwapLEFLT(float value)

     double AG_SwapLEDBL(double	value)

     long double AG_SwapLELDBL(long double value)

     Uint16 AG_SwapBE16(Uint16 value)

     Uint32 AG_SwapBE32(Uint32 value)

     Uint64 AG_SwapBE64(Uint64 value)

     float AG_SwapBEFLT(float value)

     double AG_SwapBEDBL(double	value)

     long double AG_SwapBELDBL(long double value)

     The functions AG_Swap16(),	AG_Swap32(), AG_Swap64(), AG_SwapFLT(),
     AG_SwapDBL() and AG_SwapLDBL() return the given value with	the byte order
     reversed.

     AG_SwapLE16(), AG_SwapLE32(), AG_SwapLE64(), AG_SwapLEFLT(),
     AG_SwapLEDBL() and	AG_SwapLELDBL()	returns	the given value	with the byte
     order reversed if the current architecture	is big-endian.	On little-en-
     dian machines, these functions return the value unchanged.

     AG_SwapBE16(), AG_SwapBE32(), AG_SwapBE64(), AG_SwapBEFLT(),
     AG_SwapBEDBL() and	AG_SwapBELDBL()	returns	the given value	with the byte
     order reversed if the current architecture	is little-endian.  On big-en-
     dian machines, these functions return the value unchanged.

     If	64-bit types are not supported,	AG_Swap64(), AG_SwapLE64() and
     AG_SwapBE64() are not defined.  If	quad-precision arithmetic is not sup-
     ported, AG_SwapLDBL(), AG_SwapLELDBL() and	AG_SwapBELDBL()	are not	de-
     fined.

SEE ALSO
     AG_DataSource(3), AG_Intro(3)

HISTORY
     The AG_ByteSwap macros first appeared in Agar 1.3

FreeBSD	13.0		       November	16, 2007		  FreeBSD 13.0

NAME | SYNOPSIS | DESCRIPTION | SEE ALSO | HISTORY

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=AG_ByteSwap&sektion=3&manpath=FreeBSD+12.2-RELEASE+and+Ports>

home | help