MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / handle_luainit

Function handle_luainit

xrepo/packages/l/lua/port/lua/src/lua.c:355–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353
354
355static int handle_luainit (lua_State *L) {
356 const char *name = "=" LUA_INITVARVERSION;
357 const char *init = getenv(name + 1);
358 if (init == NULL) {
359 name = "=" LUA_INIT_VAR;
360 init = getenv(name + 1); /* try alternative name */
361 }
362 if (init == NULL) return LUA_OK;
363 else if (init[0] == '@')
364 return dofile(L, init+1);
365 else
366 return dostring(L, init, name);
367}
368
369
370/*

Callers 1

pmainFunction · 0.85

Calls 2

dofileFunction · 0.85
dostringFunction · 0.85

Tested by

no test coverage detected