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

global.h

Go to the documentation of this file.
00001 /*
00002  *      HT Editor
00003  *      global.h
00004  *
00005  *      Copyright (C) 1999-2002 Sebastian Biallas (sb@web-productions.de)
00006  *      Copyright (C) 1999-2002 Stefan Weyergraf (stefan@weyergraf.de)
00007  *
00008  *      This program is free software; you can redistribute it and/or modify
00009  *      it under the terms of the GNU General Public License version 2 as
00010  *      published by the Free Software Foundation.
00011  *
00012  *      This program is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU General Public License
00018  *      along with this program; if not, write to the Free Software
00019  *      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020  */
00021 
00022 #ifndef GLOBAL_H
00023 #define GLOBAL_H
00024 
00025 /*
00026  *      packed structures
00027  */
00028 
00029 #ifdef __cplusplus
00030 #ifdef __GNUC__
00031 #define HTPACKED __attribute__ ((packed))
00032 #else
00033 #error "you're not using the GNU C compiler :-) please add the macro and conditionals for your compiler"
00034 #define HTPACKED blabla
00035 #endif /* !__GNUC__ */
00036 #endif /* __cplusplus */
00037 
00038 /*
00039  *      types
00040  */
00041 
00042 #ifdef byte
00043 #       undef byte
00044 #endif
00045 #ifdef word
00046 #       undef word
00047 #endif
00048 #ifdef dword
00049 #       undef dword
00050 #endif
00051 
00052 typedef unsigned int uint;
00053 typedef unsigned int UINT;
00054 
00055 #define byte unsigned char
00056 #define word unsigned short
00057 #define dword unsigned int
00058 
00059 #define uint8 unsigned char
00060 #define uint16 unsigned short
00061 #define uint32 unsigned int
00062 
00063 #define sint8 signed char
00064 #define sint16 signed short
00065 #define sint32 signed int
00066 
00067 #include "qword.h"
00068 
00069 #ifndef NULL
00070 #       define NULL 0
00071 #endif
00072 
00073 #ifndef HAVE_FILEOFS
00074 #define HAVE_FILEOFS
00075 typedef UINT FILEOFS;
00076 #endif
00077 
00078 /* C++ specific */
00079 #ifdef __cplusplus
00080 
00081 #define DDECL_UINT(name)        dword name HTPACKED
00082 #define DDECL_PTR(type, name)   type *name HTPACKED
00083 
00084 typedef unsigned int ID;
00085 
00086 typedef unsigned int OBJECT_ID;
00087 
00088 /*
00089  *      steves strucs
00090  */
00091 
00092 struct bounds {
00093         int x, y, w, h;
00094 };
00095 
00096 #define BOUNDS_ASSIGN(b, X, Y, W, H) b.x=X; b.y=Y; b.w=W; b.h=H;
00097 
00098 union htmsg_param {
00099         int integer;
00100         void *ptr;
00101         char *str;
00102 };
00103 
00104 struct htmsg {
00105         int msg;
00106         int type;
00107         htmsg_param data1;
00108         htmsg_param data2;
00109 };
00110 
00111 /*
00112  *      macros
00113  */
00114 
00115 #define NEW_PTR(type, var) type *var = (type *) malloc(sizeof(type))
00116 #define NEW_OBJECT(instance, class, params...) \
00117 ((class *)(instance = new class()))->init(params)
00118 #define DELETE_OBJECT(obj) obj->done(); delete obj;
00119 #define DPRINTF(msg...)
00120 
00121 #endif /* __cplusplus */
00122 
00123 #endif
00124 

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