ByteOrder.h File Reference


Detailed Description

Definitions and routines for managing byte order differences.

#include <support/SupportDefs.h>
#include <support/TypeConstants.h>

Go to the source code of this file.

Byte Order Functions and Macros

#define B_BENDIAN_TO_HOST_DOUBLE(arg)   _swap_double(arg)
#define B_BENDIAN_TO_HOST_FLOAT(arg)   _swap_float(arg)
#define B_BENDIAN_TO_HOST_INT16(arg)   _swap_int16(arg)
#define B_BENDIAN_TO_HOST_INT32(arg)   _swap_int32(arg)
#define B_BENDIAN_TO_HOST_INT64(arg)   _swap_int64(arg)
#define B_BYTE_SWAP_DOUBLE(arg)   _swap_double(arg)
#define B_BYTE_SWAP_FLOAT(arg)   _swap_float(arg)
#define B_BYTE_SWAP_INT16(arg)   _swap_int16(arg)
#define B_BYTE_SWAP_INT32(arg)   _swap_int32(arg)
#define B_BYTE_SWAP_INT64(arg)   _swap_int64(arg)
#define B_HOST_IS_BENDIAN   0
#define B_HOST_IS_LENDIAN   1
#define B_HOST_TO_BENDIAN_DOUBLE(arg)   _swap_double(arg)
#define B_HOST_TO_BENDIAN_FLOAT(arg)   _swap_float(arg)
#define B_HOST_TO_BENDIAN_INT16(arg)   _swap_int16(arg)
#define B_HOST_TO_BENDIAN_INT32(arg)   _swap_int32(arg)
#define B_HOST_TO_BENDIAN_INT64(arg)   _swap_int64(arg)
#define B_HOST_TO_LENDIAN_DOUBLE(arg)   (double)(arg)
#define B_HOST_TO_LENDIAN_FLOAT(arg)   (float)(arg)
#define B_HOST_TO_LENDIAN_INT16(arg)   (uint16_t)(arg)
#define B_HOST_TO_LENDIAN_INT32(arg)   (uint32_t)(arg)
#define B_HOST_TO_LENDIAN_INT64(arg)   (uint64_t)(arg)
#define B_LENDIAN_TO_HOST_DOUBLE(arg)   (double)(arg)
#define B_LENDIAN_TO_HOST_FLOAT(arg)   (float)(arg)
#define B_LENDIAN_TO_HOST_INT16(arg)   (uint16_t)(arg)
#define B_LENDIAN_TO_HOST_INT32(arg)   (uint32_t)(arg)
#define B_LENDIAN_TO_HOST_INT64(arg)   (uint64_t)(arg)
#define B_SWAP_DOUBLE(arg)   _swap_double(arg)
#define B_SWAP_FLOAT(arg)   _swap_float(arg)
#define B_SWAP_INT16(arg)   _swap_int16(arg)
#define B_SWAP_INT32(arg)   _swap_int32(arg)
#define B_SWAP_INT64(arg)   _swap_int64(arg)
enum  swap_action {
  B_SWAP_HOST_TO_LENDIAN, B_SWAP_HOST_TO_BENDIAN, B_SWAP_LENDIAN_TO_HOST, B_SWAP_BENDIAN_TO_HOST,
  B_SWAP_ALWAYS
}
double _swap_double (double arg)
float _swap_float (float arg)
INLINE_FNC uint16_t _swap_int16 (uint16_t uarg)
uint32_t _swap_int32 (uint32_t uarg)
uint64_t _swap_int64 (uint64_t uarg)
_IMPEXP_SUPPORT int is_type_swapped (type_code type)
_IMPEXP_SUPPORT status_t swap_data (type_code type, void *data, size_t length, swap_action action)

Defines

#define _BYTEORDER_H


Define Documentation

#define _BYTEORDER_H
 

#define B_BENDIAN_TO_HOST_DOUBLE arg   )     _swap_double(arg)
 

#define B_BENDIAN_TO_HOST_FLOAT arg   )     _swap_float(arg)
 

#define B_BENDIAN_TO_HOST_INT16 arg   )     _swap_int16(arg)
 

#define B_BENDIAN_TO_HOST_INT32 arg   )     _swap_int32(arg)
 

#define B_BENDIAN_TO_HOST_INT64 arg   )     _swap_int64(arg)
 

#define B_BYTE_SWAP_DOUBLE arg   )     _swap_double(arg)
 

#define B_BYTE_SWAP_FLOAT arg   )     _swap_float(arg)
 

#define B_BYTE_SWAP_INT16 arg   )     _swap_int16(arg)
 

#define B_BYTE_SWAP_INT32 arg   )     _swap_int32(arg)
 

#define B_BYTE_SWAP_INT64 arg   )     _swap_int64(arg)
 

#define B_HOST_IS_BENDIAN   0
 

#define B_HOST_IS_LENDIAN   1
 

#define B_HOST_TO_BENDIAN_DOUBLE arg   )     _swap_double(arg)
 

#define B_HOST_TO_BENDIAN_FLOAT arg   )     _swap_float(arg)
 

#define B_HOST_TO_BENDIAN_INT16 arg   )     _swap_int16(arg)
 

#define B_HOST_TO_BENDIAN_INT32 arg   )     _swap_int32(arg)
 

#define B_HOST_TO_BENDIAN_INT64 arg   )     _swap_int64(arg)
 

#define B_HOST_TO_LENDIAN_DOUBLE arg   )     (double)(arg)
 

#define B_HOST_TO_LENDIAN_FLOAT arg   )     (float)(arg)
 

#define B_HOST_TO_LENDIAN_INT16 arg   )     (uint16_t)(arg)
 

#define B_HOST_TO_LENDIAN_INT32 arg   )     (uint32_t)(arg)
 

#define B_HOST_TO_LENDIAN_INT64 arg   )     (uint64_t)(arg)
 

#define B_LENDIAN_TO_HOST_DOUBLE arg   )     (double)(arg)
 

#define B_LENDIAN_TO_HOST_FLOAT arg   )     (float)(arg)
 

#define B_LENDIAN_TO_HOST_INT16 arg   )     (uint16_t)(arg)
 

#define B_LENDIAN_TO_HOST_INT32 arg   )     (uint32_t)(arg)
 

#define B_LENDIAN_TO_HOST_INT64 arg   )     (uint64_t)(arg)
 

#define B_SWAP_DOUBLE arg   )     _swap_double(arg)
 

#define B_SWAP_FLOAT arg   )     _swap_float(arg)
 

#define B_SWAP_INT16 arg   )     _swap_int16(arg)
 

#define B_SWAP_INT32 arg   )     _swap_int32(arg)
 

#define B_SWAP_INT64 arg   )     _swap_int64(arg)
 


Enumeration Type Documentation

enum swap_action
 

Enumerator:
B_SWAP_HOST_TO_LENDIAN 
B_SWAP_HOST_TO_BENDIAN 
B_SWAP_LENDIAN_TO_HOST 
B_SWAP_BENDIAN_TO_HOST 
B_SWAP_ALWAYS 


Function Documentation

double _swap_double double  arg  ) 
 

float _swap_float float  arg  ) 
 

INLINE_FNC uint16_t _swap_int16 uint16_t  uarg  ) 
 

uint32_t _swap_int32 uint32_t  uarg  ) 
 

uint64_t _swap_int64 uint64_t  uarg  ) 
 

_IMPEXP_SUPPORT int is_type_swapped type_code  type  ) 
 

_IMPEXP_SUPPORT status_t swap_data type_code  type,
void *  data,
size_t  length,
swap_action  action