00001 // Copyright (C) 2006 Pablo Mejia 00002 00003 00004 #ifndef ENDIAN_H 00005 #define ENDIAN_H 00006 00007 00008 namespace endian 00009 { 00010 typedef unsigned char u8_t; 00011 typedef unsigned short u16_t; 00012 00013 template <typename T> T letoh (void const *f) 00014 { 00015 return (*((T *) f)); 00016 } 00017 }; 00018 00019 00020 #endif