common.h

changeset 1
f0c61c204bc8
parent 0
8dce9696d62d
child 2
bb2c45522eb6
equal deleted inserted replaced
0:8dce9696d62d 1:f0c61c204bc8
43 43
44 #include <stdarg.h> 44 #include <stdarg.h>
45 #include "bots.h" 45 #include "bots.h"
46 #include "str.h" 46 #include "str.h"
47 47
48 typedef unsigned long qbyte; 48 #define APPNAME "botc"
49 #define VERSION_MAJOR 0
50 #define VERSION_MINOR 0
51 #define VERSION_REVISION 999
49 52
50 #define CHECK_FILE(path,action) if (!fp) { \ 53 typedef unsigned long qbyte;
51 fprintf (stderr, "error: couldn't open %s for %s!\n", (char*)path, action); \ 54
52 exit (1); \ 55 #define CHECK_FILE(pointer,path,action) \
56 if (!pointer) { \
57 error ("couldn't open %s for %s!\n", (char*)path, action); \
58 exit (1); \
53 } 59 }
54 60
55 #define PERFORM_FORMAT(in, out) va_list v; \ 61 #define PERFORM_FORMAT(in, out) \
62 va_list v; \
56 va_start (v, in); \ 63 va_start (v, in); \
57 char* out = vdynformat (in, v, 256); \ 64 char* out = vdynformat (in, v, 256); \
58 va_end (v); 65 va_end (v);
59 66
60 void error (const char* text, ...); 67 void error (const char* text, ...);
61 68
62 struct EventDef { 69 struct EventDef {
63 str name; 70 str name;
64 }; 71 };
65 72
73 #ifndef __PARSER_CXX__
74 extern int g_NumStates;
75 extern int g_NumEvents;
76 extern int g_CurMode;
77 extern str g_CurState;
78 #endif
79
66 #endif // __COMMON_H__ 80 #endif // __COMMON_H__

mercurial