mirror of
https://github.com/lua/lua
synced 2026-09-27 00:28:25 +03:00
lua_(set)getglobal are ok to use
This commit is contained in:
parent
1e944de6cb
commit
fa198197a0
6 changed files with 16 additions and 14 deletions
7
lua.h
7
lua.h
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lua.h,v 1.183 2003/10/20 12:25:23 roberto Exp roberto $
|
||||
** $Id: lua.h,v 1.184 2003/10/21 10:58:58 roberto Exp roberto $
|
||||
** Lua - An Extensible Extension Language
|
||||
** Tecgraf: Computer Graphics Technology Group, PUC-Rio, Brazil
|
||||
** http://www.lua.org mailto:info@lua.org
|
||||
|
|
@ -277,6 +277,9 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud);
|
|||
#define lua_pushliteral(L, s) \
|
||||
lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1)
|
||||
|
||||
#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s)
|
||||
#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -286,8 +289,6 @@ LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud);
|
|||
#define lua_open() luaL_newstate()
|
||||
|
||||
#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX)
|
||||
#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, s)
|
||||
#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, s)
|
||||
|
||||
|
||||
/* compatibility with ref system */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue