00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __HTENDIAN_H__
00022 #define __HTENDIAN_H__
00023
00024 #include "global.h"
00025
00026 #define STRUCT_ENDIAN_BYTE 1
00027 #define STRUCT_ENDIAN_WORD 2
00028 #define STRUCT_ENDIAN_DWORD 4
00029 #define STRUCT_ENDIAN_QWORD 8
00030 #define STRUCT_ENDIAN_HOST 128
00031
00032 enum endianess {big_endian, little_endian};
00033 void create_foreign_int(void *buf, int i, int size, endianess to_endianess);
00034 void create_foreign_int64(void *buf, const qword i, int size, endianess to_endianess);
00035 int create_host_int(const void *buf, int size, endianess from_endianess);
00036 qword create_host_int64(const void *buf, endianess from_endianess);
00037 void create_host_struct(void *buf, const byte *table, endianess from);
00038
00039 #endif
00040