diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-10 20:09:51 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-10 20:09:51 -0200 |
commit | 9cd36059ad6f3f6750b8cff54c305ae347c6caca (patch) | |
tree | 6b71bb5dab3c7f1e8fec12bc03830b58cdc59fc0 /lua.h | |
parent | 592a309177edc52847b1196969ad6d49ba21f4fb (diff) | |
download | lua-9cd36059ad6f3f6750b8cff54c305ae347c6caca.tar.gz lua-9cd36059ad6f3f6750b8cff54c305ae347c6caca.tar.bz2 lua-9cd36059ad6f3f6750b8cff54c305ae347c6caca.zip |
new API functions lua_getstr/lua_setstr
Diffstat (limited to 'lua.h')
-rw-r--r-- | lua.h | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -146,7 +146,7 @@ LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n); | |||
146 | /* | 146 | /* |
147 | ** get functions (Lua -> stack) | 147 | ** get functions (Lua -> stack) |
148 | */ | 148 | */ |
149 | LUA_API void lua_getglobal (lua_State *L, const char *name); | 149 | LUA_API void lua_getstr (lua_State *L, int index, const char *name); |
150 | LUA_API void lua_gettable (lua_State *L, int index); | 150 | LUA_API void lua_gettable (lua_State *L, int index); |
151 | LUA_API void lua_rawget (lua_State *L, int index); | 151 | LUA_API void lua_rawget (lua_State *L, int index); |
152 | LUA_API void lua_rawgeti (lua_State *L, int index, int n); | 152 | LUA_API void lua_rawgeti (lua_State *L, int index, int n); |
@@ -158,7 +158,7 @@ LUA_API void lua_geteventtable (lua_State *L, int objindex); | |||
158 | /* | 158 | /* |
159 | ** set functions (stack -> Lua) | 159 | ** set functions (stack -> Lua) |
160 | */ | 160 | */ |
161 | LUA_API void lua_setglobal (lua_State *L, const char *name); | 161 | LUA_API void lua_setstr (lua_State *L, int index, const char *name); |
162 | LUA_API void lua_settable (lua_State *L, int index); | 162 | LUA_API void lua_settable (lua_State *L, int index); |
163 | LUA_API void lua_rawset (lua_State *L, int index); | 163 | LUA_API void lua_rawset (lua_State *L, int index); |
164 | LUA_API void lua_rawseti (lua_State *L, int index, int n); | 164 | LUA_API void lua_rawseti (lua_State *L, int index, int n); |
@@ -227,8 +227,10 @@ LUA_API int lua_getweakmode (lua_State *L, int index); | |||
227 | #define lua_pushliteral(L, s) lua_pushlstring(L, "" s, \ | 227 | #define lua_pushliteral(L, s) lua_pushlstring(L, "" s, \ |
228 | (sizeof(s)/sizeof(char))-1) | 228 | (sizeof(s)/sizeof(char))-1) |
229 | 229 | ||
230 | #define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX); | 230 | #define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) |
231 | #define lua_getglobals(L) lua_pushvalue(L, LUA_GLOBALSINDEX); | 231 | #define lua_getglobals(L) lua_pushvalue(L, LUA_GLOBALSINDEX) |
232 | #define lua_getglobal(L,s) lua_getstr(L, LUA_GLOBALSINDEX, s) | ||
233 | #define lua_setglobal(L,s) lua_setstr(L, LUA_GLOBALSINDEX, s) | ||
232 | 234 | ||
233 | 235 | ||
234 | 236 | ||