PLearn 0.1
Namespaces | Defines | Functions
byte_order.h File Reference
#include <stdlib.h>
Include dependency graph for byte_order.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  PLearn
 

< for swap


Defines

#define LITTLE_ENDIAN_ORDER   'L'
 WELCOME TO: LITTLE-ENDIAN / BIG-ENDIAN HELL...
#define BIG_ENDIAN_ORDER   'B'

Functions

char PLearn::byte_order ()
void PLearn::endianswap2 (void *ptr, int n)
 swaps endians for n 2-byte elements (such as short)
void PLearn::endianswap4 (void *ptr, int n)
 swaps endians for n 4-byte elements (such as int or float)
void PLearn::endianswap8 (void *ptr, int n)
 swaps endians for n 8-byte elements (such as double)
void PLearn::endianswap (void *ptr, int nelems, int elemsize)
 calls endianswap2, 4, or 8 depending on elemsize (an elemsize of 1 is also valid and does nothing)
template<class T >
void PLearn::endianswap (T *ptr, int n=1)

Define Documentation

#define BIG_ENDIAN_ORDER   'B'
#define LITTLE_ENDIAN_ORDER   'L'
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines