variables.h

changeset 24
7dcc8419dbdb
parent 23
ba351235688e
child 67
0a202714eea4
equal deleted inserted replaced
23:ba351235688e 24:7dcc8419dbdb
42 #define __VARIABLES_H__ 42 #define __VARIABLES_H__
43 #include "str.h" 43 #include "str.h"
44 #include "scriptreader.h" 44 #include "scriptreader.h"
45 45
46 struct ScriptVar { 46 struct ScriptVar {
47 int type;
48 str name; 47 str name;
49 str statename; 48 str statename;
50 str value; 49 int value;
51 unsigned int index; 50 unsigned int index;
52 ScriptVar* next; 51 ScriptVar* next;
53 }; 52 };
54 53
55 #ifndef __VARIABLES_CXX__ 54 #ifndef __VARIABLES_CXX__
60 #define ITERATE_GLOBAL_VARS(u) \ 59 #define ITERATE_GLOBAL_VARS(u) \
61 for (u = 0; u < MAX_SCRIPT_VARIABLES; u++) 60 for (u = 0; u < MAX_SCRIPT_VARIABLES; u++)
62 #define ITERATE_SCRIPT_VARS(g) \ 61 #define ITERATE_SCRIPT_VARS(g) \
63 for (g = g_ScriptVariable; g != NULL; g = g->next) 62 for (g = g_ScriptVariable; g != NULL; g = g->next)
64 63
65 ScriptVar* DeclareGlobalVariable (ScriptReader* r, str name, int type); 64 ScriptVar* DeclareGlobalVariable (ScriptReader* r, str name);
66 unsigned int CountGlobalVars (); 65 unsigned int CountGlobalVars ();
67 void InitVariables (); 66 void InitVariables ();
67 ScriptVar* FindGlobalVariable (str name);
68 68
69 #endif // __VARIABLES_H__ 69 #endif // __VARIABLES_H__

mercurial