MCPcopy Create free account
hub / github.com/F-Stack/f-stack / lua_setglobal

Function lua_setglobal

freebsd/contrib/openzfs/module/lua/lapi.c:731–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 12

zcp_evalFunction · 0.85
zcp_load_errno_globalsFunction · 0.85
luaL_requirefFunction · 0.85
luaopen_tableFunction · 0.85
scriptingInitFunction · 0.85
luaSetGlobalArrayFunction · 0.85
handle_scriptFunction · 0.85
base_openFunction · 0.85
luaopen_cjsonFunction · 0.85
lua_cmsgpack.cFile · 0.85
luaopen_cmsgpack_safeFunction · 0.85

Calls 3

luaH_getintFunction · 0.85
luaS_newFunction · 0.85
luaV_settableFunction · 0.70

Tested by

no test coverage detected