MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaopen_base

Function luaopen_base

ThirdParty/lua/lua/lbaselib.c:502–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

500
501
502LUAMOD_API int luaopen_base (lua_State *L) {
503 int i;
504 /* open lib into global table */
505 lua_pushglobaltable(L);
506 luaL_setfuncs(L, base_funcs, 0);
507 /* set global _G */
508 lua_pushvalue(L, -1);
509 lua_setfield(L, -2, "_G");
510 /* set global _VERSION */
511 lua_pushliteral(L, LUA_VERSION);
512 lua_setfield(L, -2, "_VERSION");
513 /* set function 'type' with proper upvalues */
514 for (i = 0; i < LUA_NUMTAGS; i++) /* push all type names as upvalues */
515 lua_pushstring(L, lua_typename(L, i));
516 lua_pushcclosure(L, luaB_type, LUA_NUMTAGS);
517 lua_setfield(L, -2, "type");
518 return 1;
519}
520

Callers

nothing calls this directly

Calls 6

luaL_setfuncsFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfieldFunction · 0.85
lua_pushstringFunction · 0.85
lua_typenameFunction · 0.85
lua_pushcclosureFunction · 0.85

Tested by

no test coverage detected