MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / lua_setglobal

Function lua_setglobal

third-party/lua-5.2.4/src/lapi.c:734–744  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

732
733
734LUA_API void lua_setglobal (lua_State *L, const char *var) {
735 Table *reg = hvalue(&G(L)->l_registry);
736 const TValue *gt; /* global table */
737 lua_lock(L);
738 api_checknelems(L, 1);
739 gt = luaH_getint(reg, LUA_RIDX_GLOBALS);
740 setsvalue2s(L, L->top++, luaS_new(L, var));
741 luaV_settable(L, gt, L->top - 1, L->top - 2);
742 L->top -= 2; /* pop value and key */
743 lua_unlock(L);
744}
745
746
747LUA_API void lua_settable (lua_State *L, int idx) {

Callers 4

dolibraryFunction · 0.70
handle_scriptFunction · 0.70
luaL_requirefFunction · 0.70
luaopen_tableFunction · 0.70

Calls 3

luaH_getintFunction · 0.70
luaS_newFunction · 0.70
luaV_settableFunction · 0.70

Tested by

no test coverage detected