Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

htendian.h

Go to the documentation of this file.
00001 /* 
00002  *      HT Editor
00003  *      htendian.h
00004  *
00005  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
00006  *
00007  *      This program is free software; you can redistribute it and/or modify
00008  *      it under the terms of the GNU General Public License version 2 as
00009  *      published by the Free Software Foundation.
00010  *
00011  *      This program is distributed in the hope that it will be useful,
00012  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *      GNU General Public License for more details.
00015  *
00016  *      You should have received a copy of the GNU General Public License
00017  *      along with this program; if not, write to the Free Software
00018  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
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 /* __HTENDIAN_H__ */
00040 

Generated on Fri May 7 21:15:33 2004 by doxygen 1.3.5