common.h

changeset 68
588cc27e84bb
parent 67
0a202714eea4
child 69
29a3e669d648
equal deleted inserted replaced
67:0a202714eea4 68:588cc27e84bb
65 MODE_MAINLOOP, // inside mainloop 65 MODE_MAINLOOP, // inside mainloop
66 MODE_ONENTER, // inside onenter 66 MODE_ONENTER, // inside onenter
67 MODE_ONEXIT, // inside onexit 67 MODE_ONEXIT, // inside onexit
68 }; 68 };
69 69
70 enum type_e {
71 TYPE_UNKNOWN = 0,
72 TYPE_VOID,
73 TYPE_INT,
74 TYPE_STRING,
75 TYPE_FLOAT,
76 TYPE_BOOL,
77
78 };
79
70 #define CHECK_FILE(pointer,path,action) \ 80 #define CHECK_FILE(pointer,path,action) \
71 if (!pointer) { \ 81 if (!pointer) { \
72 error ("couldn't open %s for %s!\n", (char*)path, action); \ 82 error ("couldn't open %s for %s!\n", (char*)path, action); \
73 exit (1); \ 83 exit (1); \
74 } 84 }
87 #define ZERO(obj) memset (&obj, 0, sizeof (obj)); 97 #define ZERO(obj) memset (&obj, 0, sizeof (obj));
88 98
89 void error (const char* text, ...); 99 void error (const char* text, ...);
90 char* ObjectFileName (str s); 100 char* ObjectFileName (str s);
91 bool fexists (char* path); 101 bool fexists (char* path);
102 type_e GetTypeByName (str token);
103 str GetTypeName (type_e type);
92 104
93 // Make the parser's variables globally available 105 // Make the parser's variables globally available
94 extern int g_NumStates; 106 extern int g_NumStates;
95 extern int g_NumEvents; 107 extern int g_NumEvents;
96 extern parsermode_e g_CurMode; 108 extern parsermode_e g_CurMode;

mercurial