MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / disable_global_variables

Function disable_global_variables

lua/sp.c:1312–1323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1310}
1311
1312static int disable_global_variables(lua_State *lua)
1313{
1314 lua_createtable(lua, 0, 2);
1315 lua_pushliteral(lua, "__newindex");
1316 lua_pushcfunction(lua, l_global_undef);
1317 lua_rawset(lua, -3);
1318 lua_pushliteral(lua, "__index");
1319 lua_pushcfunction(lua, l_global_undef);
1320 lua_rawset(lua, -3);
1321 lua_setmetatable(lua, LUA_GLOBALSINDEX);
1322 return 0;
1323}
1324
1325/*
1326** This returns dbrow or nil on end of result set. There is no way to signal

Callers 1

create_sp_intFunction · 0.85

Calls 3

lua_createtableFunction · 0.85
lua_rawsetFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected