diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-08 16:32:53 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-05-08 16:32:53 -0300 |
| commit | 11a70220670f25a9929439f0b27331f09f05235c (patch) | |
| tree | c4a962b5a3e53ac6df8894fb3ad2248c4a1256cb /lua.h | |
| parent | 35a6ed283881f313152457f24cc6c677122d5058 (diff) | |
| download | lua-11a70220670f25a9929439f0b27331f09f05235c.tar.gz lua-11a70220670f25a9929439f0b27331f09f05235c.tar.bz2 lua-11a70220670f25a9929439f0b27331f09f05235c.zip | |
global variables are stored in a Lua table
Diffstat (limited to 'lua.h')
| -rw-r--r-- | lua.h | 13 |
1 files changed, 8 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lua.h,v 1.47 2000/04/14 17:48:20 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.48 2000/04/17 19:23:12 roberto Exp roberto $ |
| 3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
| 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** TeCGraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
| 5 | ** e-mail: lua@tecgraf.puc-rio.br | 5 | ** e-mail: lua@tecgraf.puc-rio.br |
| @@ -54,6 +54,9 @@ int lua_callfunction (lua_State *L, lua_Object f); | |||
| 54 | void lua_beginblock (lua_State *L); | 54 | void lua_beginblock (lua_State *L); |
| 55 | void lua_endblock (lua_State *L); | 55 | void lua_endblock (lua_State *L); |
| 56 | 56 | ||
| 57 | void lua_pushglobaltable (lua_State *L); | ||
| 58 | void lua_setglobaltable (lua_State *L, lua_Object newtable); | ||
| 59 | |||
| 57 | lua_Object lua_lua2C (lua_State *L, int number); | 60 | lua_Object lua_lua2C (lua_State *L, int number); |
| 58 | #define lua_getparam lua_lua2C | 61 | #define lua_getparam lua_lua2C |
| 59 | #define lua_getresult lua_lua2C | 62 | #define lua_getresult lua_lua2C |
| @@ -88,8 +91,8 @@ void lua_pushobject (lua_State *L, lua_Object obj); | |||
| 88 | lua_Object lua_pop (lua_State *L); | 91 | lua_Object lua_pop (lua_State *L); |
| 89 | 92 | ||
| 90 | lua_Object lua_getglobal (lua_State *L, const char *name); | 93 | lua_Object lua_getglobal (lua_State *L, const char *name); |
| 91 | lua_Object lua_rawgetglobal (lua_State *L, const char *name); | ||
| 92 | void lua_setglobal (lua_State *L, const char *name); /* In: value */ | 94 | void lua_setglobal (lua_State *L, const char *name); /* In: value */ |
| 95 | lua_Object lua_rawgetglobal (lua_State *L, const char *name); | ||
| 93 | void lua_rawsetglobal (lua_State *L, const char *name);/* In: value */ | 96 | void lua_rawsetglobal (lua_State *L, const char *name);/* In: value */ |
| 94 | 97 | ||
| 95 | void lua_settable (lua_State *L); /* In: table, index, value */ | 98 | void lua_settable (lua_State *L); /* In: table, index, value */ |
| @@ -99,7 +102,6 @@ lua_Object lua_rawgettable (lua_State *L); /* In: table, index */ | |||
| 99 | 102 | ||
| 100 | int lua_tag (lua_State *L, lua_Object obj); | 103 | int lua_tag (lua_State *L, lua_Object obj); |
| 101 | 104 | ||
| 102 | const char *lua_nextvar (lua_State *L, const char *varname); /* Out: value */ | ||
| 103 | int lua_next (lua_State *L, lua_Object o, int i); | 105 | int lua_next (lua_State *L, lua_Object o, int i); |
| 104 | /* Out: ref, value */ | 106 | /* Out: ref, value */ |
| 105 | 107 | ||
| @@ -167,6 +169,8 @@ extern lua_State *lua_state; | |||
| 167 | #define lua_callfunction(f) (lua_callfunction)(lua_state, f) | 169 | #define lua_callfunction(f) (lua_callfunction)(lua_state, f) |
| 168 | #define lua_beginblock() (lua_beginblock)(lua_state) | 170 | #define lua_beginblock() (lua_beginblock)(lua_state) |
| 169 | #define lua_endblock() (lua_endblock)(lua_state) | 171 | #define lua_endblock() (lua_endblock)(lua_state) |
| 172 | #define lua_pushglobaltable() (lua_pushglobaltable)(lua_state) | ||
| 173 | #define lua_setglobaltable(t) (lua_setglobaltable)(lua_state, t) | ||
| 170 | #define lua_lua2C(number) (lua_lua2C)(lua_state, number) | 174 | #define lua_lua2C(number) (lua_lua2C)(lua_state, number) |
| 171 | #define lua_type(obj) (lua_type)(lua_state, obj) | 175 | #define lua_type(obj) (lua_type)(lua_state, obj) |
| 172 | #define lua_isnil(obj) (lua_isnil)(lua_state, obj) | 176 | #define lua_isnil(obj) (lua_isnil)(lua_state, obj) |
| @@ -190,15 +194,14 @@ extern lua_State *lua_state; | |||
| 190 | #define lua_pushobject(obj) (lua_pushobject)(lua_state, obj) | 194 | #define lua_pushobject(obj) (lua_pushobject)(lua_state, obj) |
| 191 | #define lua_pop() (lua_pop)(lua_state) | 195 | #define lua_pop() (lua_pop)(lua_state) |
| 192 | #define lua_getglobal(name) (lua_getglobal)(lua_state, name) | 196 | #define lua_getglobal(name) (lua_getglobal)(lua_state, name) |
| 193 | #define lua_rawgetglobal(name) (lua_rawgetglobal)(lua_state, name) | ||
| 194 | #define lua_setglobal(name) (lua_setglobal)(lua_state, name) | 197 | #define lua_setglobal(name) (lua_setglobal)(lua_state, name) |
| 198 | #define lua_rawgetglobal(name) (lua_rawgetglobal)(lua_state, name) | ||
| 195 | #define lua_rawsetglobal(name) (lua_rawsetglobal)(lua_state, name) | 199 | #define lua_rawsetglobal(name) (lua_rawsetglobal)(lua_state, name) |
| 196 | #define lua_settable() (lua_settable)(lua_state) | 200 | #define lua_settable() (lua_settable)(lua_state) |
| 197 | #define lua_rawsettable() (lua_rawsettable)(lua_state) | 201 | #define lua_rawsettable() (lua_rawsettable)(lua_state) |
| 198 | #define lua_gettable() (lua_gettable)(lua_state) | 202 | #define lua_gettable() (lua_gettable)(lua_state) |
| 199 | #define lua_rawgettable() (lua_rawgettable)(lua_state) | 203 | #define lua_rawgettable() (lua_rawgettable)(lua_state) |
| 200 | #define lua_tag(obj) (lua_tag)(lua_state, obj) | 204 | #define lua_tag(obj) (lua_tag)(lua_state, obj) |
| 201 | #define lua_nextvar(varname) (lua_nextvar)(lua_state, varname) | ||
| 202 | #define lua_next(o,i) (lua_next)(lua_state, o,i) | 205 | #define lua_next(o,i) (lua_next)(lua_state, o,i) |
| 203 | #define lua_ref(lock) (lua_ref)(lua_state, lock) | 206 | #define lua_ref(lock) (lua_ref)(lua_state, lock) |
| 204 | #define lua_getref(ref) (lua_getref)(lua_state, ref) | 207 | #define lua_getref(ref) (lua_getref)(lua_state, ref) |
