endian.h (355B)
1 #ifndef LASH_ENDIAN_H_ 2 #define LASH_ENDIAN_H_ 3 4 #define CONVERT_BIGENDIAN 0x00 5 #define CONVERT_LITTLEENDIAN 0x01 6 #define CONVERT_PLATFORM is_le() 7 8 union le { 9 short *s; 10 int *i; 11 long long *ll; 12 char *c; 13 }; 14 15 int le(int l, void *n); 16 int is_le(); 17 int to_endian(char direction, int l, void *n); 18 void flip_endian(int l, union le *n); 19 20 #endif // LASH_ENDIAN_H_