MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / luaB_load

Function luaB_load

Plugins/slua_unreal/External/lua/lbaselib.cpp:333–350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

331
332
333static int luaB_load (lua_State *L) {
334 int status;
335 size_t l;
336 const char *s = lua_tolstring(L, 1, &l);
337 const char *mode = luaL_optstring(L, 3, "bt");
338 int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */
339 if (s != NULL) { /* loading a string? */
340 const char *chunkname = luaL_optstring(L, 2, s);
341 status = luaL_loadbufferx(L, s, l, chunkname, mode);
342 }
343 else { /* loading from a reader function */
344 const char *chunkname = luaL_optstring(L, 2, "=(load)");
345 luaL_checktype(L, 1, LUA_TFUNCTION);
346 lua_settop(L, RESERVEDSLOT); /* create reserved slot */
347 status = lua_load(L, generic_reader, NULL, chunkname, mode);
348 }
349 return load_aux(L, status, env);
350}
351
352/* }====================================================== */
353

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