GnuCOBOL  2.0
A free COBOL compiler
byteswap.h File Reference
#include <sys/types.h>
Include dependency graph for byteswap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define VB_BSWAP_16_CONSTANT(val)
 
#define VB_BSWAP_32_CONSTANT(val)
 
#define VB_BSWAP_64_CONSTANT(val)
 
#define VB_BSWAP_16(val)   (VB_BSWAP_16_CONSTANT (val))
 
#define VB_BSWAP_32(val)   (VB_BSWAP_32_CONSTANT (val))
 
#define VB_BSWAP_64(val)   (VB_BSWAP_64_CONSTANT (val))
 

Macro Definition Documentation

#define VB_BSWAP_16 (   val)    (VB_BSWAP_16_CONSTANT (val))

Definition at line 184 of file byteswap.h.

Referenced by inl_ldint(), inl_stint(), ldint(), and stint().

#define VB_BSWAP_16_CONSTANT (   val)
Value:
((unsigned short) ( \
(unsigned short) ((unsigned short) (val) >> 8) | \
(unsigned short) ((unsigned short) (val) << 8)))

Definition at line 33 of file byteswap.h.

#define VB_BSWAP_32 (   val)    (VB_BSWAP_32_CONSTANT (val))

Definition at line 185 of file byteswap.h.

Referenced by inl_ldlong(), inl_ldquad(), inl_stlong(), inl_stquad(), ldlong(), and stlong().

#define VB_BSWAP_32_CONSTANT (   val)
Value:
((unsigned int) ( \
(((unsigned int) (val) & (unsigned int) 0x000000ffU) << 24) | \
(((unsigned int) (val) & (unsigned int) 0x0000ff00U) << 8) | \
(((unsigned int) (val) & (unsigned int) 0x00ff0000U) >> 8) | \
(((unsigned int) (val) & (unsigned int) 0xff000000U) >> 24)))

Definition at line 37 of file byteswap.h.

#define VB_BSWAP_64 (   val)    (VB_BSWAP_64_CONSTANT (val))

Definition at line 186 of file byteswap.h.

Referenced by inl_ldquad(), and inl_stquad().

#define VB_BSWAP_64_CONSTANT (   val)
Value:
((unsigned long long) ( \
(((unsigned long long) (val) & \
(unsigned long long) 0x00000000000000ffULL) << 56) | \
(((unsigned long long) (val) & \
(unsigned long long) 0x000000000000ff00ULL) << 40) | \
(((unsigned long long) (val) & \
(unsigned long long) 0x0000000000ff0000ULL) << 24) | \
(((unsigned long long) (val) & \
(unsigned long long) 0x00000000ff000000ULL) << 8) | \
(((unsigned long long) (val) & \
(unsigned long long) 0x000000ff00000000ULL) >> 8) | \
(((unsigned long long) (val) & \
(unsigned long long) 0x0000ff0000000000ULL) >> 24) | \
(((unsigned long long) (val) & \
(unsigned long long) 0x00ff000000000000ULL) >> 40) | \
(((unsigned long long) (val) & \
(unsigned long long) 0xff00000000000000ULL) >> 56)))

Definition at line 43 of file byteswap.h.