Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

endian_types.h File Reference

#include <endian.h>
#include <sys/types.h>
#include <byteswap.h>

Include dependency graph for endian_types.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define le_to_cpu   cpu_to_le
#define be_to_cpu   cpu_to_be

Typedefs

typedef int8_t int8_ne_t
typedef int16_t int16_ne_t
typedef int32_t int32_ne_t
typedef int64_t int64_ne_t
typedef u_int8_t u_int8_ne_t
typedef u_int16_t u_int16_ne_t
typedef u_int32_t u_int32_ne_t
typedef u_int64_t u_int64_ne_t
typedef int8_ne_t int8_le_t
typedef int16_ne_t int16_le_t
typedef int32_ne_t int32_le_t
typedef int64_ne_t int64_le_t
typedef u_int8_ne_t u_int8_le_t
typedef u_int16_ne_t u_int16_le_t
typedef u_int32_ne_t u_int32_le_t
typedef u_int64_ne_t u_int64_le_t
typedef int8_t int8_be_t
typedef be_t< int16_t > int16_be_t
typedef be_t< int32_t > int32_be_t
typedef be_t< int64_t > int64_be_t
typedef u_int8_t u_int8_be_t
typedef be_t< u_int16_t > u_int16_be_t
typedef be_t< u_int32_t > u_int32_be_t
typedef be_t< u_int64_t > u_int64_be_t

Functions

static int8_t bswap (const int8_t &x)
static u_int8_t bswap (const u_int8_t &x)
static int16_t bswap (const int16_t &x)
static u_int16_t bswap (const u_int16_t &x)
static int32_t bswap (const int32_t &x)
static u_int32_t bswap (const u_int32_t &x)
static int64_t bswap (const int64_t &x)
static u_int64_t bswap (const u_int64_t &x)
template<class T>
static T cpu_to_le (const T &x)
template<class T>
static T cpu_to_be (const T &x)

Variables

le_t packed


Define Documentation

#define be_to_cpu   cpu_to_be
 

Definition at line 83 of file endian_types.h.

Referenced by be_t< T >::read().

#define le_to_cpu   cpu_to_le
 

Definition at line 82 of file endian_types.h.

Referenced by le_t< T >::read().


Typedef Documentation

typedef be_t<int16_t> int16_be_t
 

Definition at line 239 of file endian_types.h.

typedef int16_ne_t int16_le_t
 

Definition at line 231 of file endian_types.h.

typedef int16_t int16_ne_t
 

Definition at line 215 of file endian_types.h.

typedef be_t<int32_t> int32_be_t
 

Definition at line 240 of file endian_types.h.

typedef int32_ne_t int32_le_t
 

Definition at line 232 of file endian_types.h.

typedef int32_t int32_ne_t
 

Definition at line 216 of file endian_types.h.

typedef be_t<int64_t> int64_be_t
 

Definition at line 241 of file endian_types.h.

typedef int64_ne_t int64_le_t
 

Definition at line 233 of file endian_types.h.

typedef int64_t int64_ne_t
 

Definition at line 217 of file endian_types.h.

typedef int8_t int8_be_t
 

Definition at line 238 of file endian_types.h.

typedef int8_ne_t int8_le_t
 

Definition at line 230 of file endian_types.h.

typedef int8_t int8_ne_t
 

Definition at line 214 of file endian_types.h.

typedef be_t<u_int16_t> u_int16_be_t
 

Definition at line 243 of file endian_types.h.

typedef u_int16_ne_t u_int16_le_t
 

Definition at line 235 of file endian_types.h.

typedef u_int16_t u_int16_ne_t
 

Definition at line 219 of file endian_types.h.

typedef be_t<u_int32_t> u_int32_be_t
 

Definition at line 244 of file endian_types.h.

typedef u_int32_ne_t u_int32_le_t
 

Definition at line 236 of file endian_types.h.

typedef u_int32_t u_int32_ne_t
 

Definition at line 220 of file endian_types.h.

typedef be_t<u_int64_t> u_int64_be_t
 

Definition at line 245 of file endian_types.h.

typedef u_int64_ne_t u_int64_le_t
 

Definition at line 237 of file endian_types.h.

typedef u_int64_t u_int64_ne_t
 

Definition at line 221 of file endian_types.h.

typedef u_int8_t u_int8_be_t
 

Definition at line 242 of file endian_types.h.

typedef u_int8_ne_t u_int8_le_t
 

Definition at line 234 of file endian_types.h.

typedef u_int8_t u_int8_ne_t
 

Definition at line 218 of file endian_types.h.


Function Documentation

static u_int64_t bswap const u_int64_t &  x  )  [inline, static]
 

Definition at line 77 of file endian_types.h.

00078 {
00079     return bswap_64(x);
00080 }

static int64_t bswap const int64_t &  x  )  [inline, static]
 

Definition at line 72 of file endian_types.h.

00073 {
00074     return bswap_64(x);
00075 }

static u_int32_t bswap const u_int32_t &  x  )  [inline, static]
 

Definition at line 67 of file endian_types.h.

00068 {
00069     return bswap_32(x);
00070 }

static int32_t bswap const int32_t &  x  )  [inline, static]
 

Definition at line 62 of file endian_types.h.

00063 {
00064     return bswap_32(x);
00065 }

static u_int16_t bswap const u_int16_t &  x  )  [inline, static]
 

Definition at line 57 of file endian_types.h.

00058 {
00059     return bswap_16(x);
00060 }

static int16_t bswap const int16_t &  x  )  [inline, static]
 

Definition at line 52 of file endian_types.h.

00053 {
00054     return bswap_16(x);
00055 }

static u_int8_t bswap const u_int8_t &  x  )  [inline, static]
 

Definition at line 47 of file endian_types.h.

00048 {
00049     return x;
00050 }

static int8_t bswap const int8_t &  x  )  [inline, static]
 

Definition at line 42 of file endian_types.h.

Referenced by cpu_to_be(), and cpu_to_le().

00043 {
00044     return x;
00045 }

template<class T>
static T cpu_to_be const T &  x  )  [inline, static]
 

Definition at line 94 of file endian_types.h.

References bswap().

Referenced by be_t< T >::write().

00095 {
00096 #if BYTE_ORDER == LITTLE_ENDIAN
00097     return bswap(x);
00098 #else
00099     return x;
00100 #endif
00101 }

template<class T>
static T cpu_to_le const T &  x  )  [inline, static]
 

Definition at line 85 of file endian_types.h.

References bswap().

Referenced by le_t< T >::write().

00086 {
00087 #if BYTE_ORDER == LITTLE_ENDIAN
00088     return x;
00089 #else
00090     return bswap(x);
00091 #endif
00092 }


Variable Documentation

class be_t packed
 


Generated on Sun Mar 11 22:11:55 2007 for Kino by  doxygen 1.4.2