MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaB_load

Function luaB_load

src/Chain/libraries/glua/lbaselib.cpp:447–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

445
446
447static int luaB_load(lua_State *L) {
448 int status;
449 size_t l;
450 const char *s = lua_tolstring(L, 1, &l);
451 const char *mode = luaL_optstring(L, 3, "bt");
452 int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */
453 if (s != nullptr) { /* loading a string? */
454 const char *chunkname = luaL_optstring(L, 2, s);
455 status = luaL_loadbufferx(L, s, l, chunkname, mode);
456 }
457 else { /* loading from a reader function */
458 const char *chunkname = luaL_optstring(L, 2, "=(load)");
459 luaL_checktype(L, 1, LUA_TFUNCTION);
460 lua_settop(L, RESERVEDSLOT); /* create reserved slot */
461 status = lua_load(L, generic_reader, nullptr, chunkname, mode);
462 }
463 return load_aux(L, status, env);
464}
465
466/* }====================================================== */
467

Callers

nothing calls this directly

Calls 6

lua_tolstringFunction · 0.85
luaL_loadbufferxFunction · 0.85
luaL_checktypeFunction · 0.85
lua_settopFunction · 0.85
lua_loadFunction · 0.85
load_auxFunction · 0.85

Tested by

no test coverage detected