00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef GLOBAL_H
00023 #define GLOBAL_H
00024
00025
00026
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
00036 #endif
00037
00038
00039
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
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
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
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
00122
00123 #endif
00124