MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / main

Function main

third-party/lua-5.2.4/src/lua.c:480–496  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

478
479
480int main (int argc, char **argv) {
481 int status, result;
482 lua_State *L = luaL_newstate(); /* create state */
483 if (L == NULL) {
484 l_message(argv[0], "cannot create state: not enough memory");
485 return EXIT_FAILURE;
486 }
487 /* call 'pmain' in protected mode */
488 lua_pushcfunction(L, &pmain);
489 lua_pushinteger(L, argc); /* 1st argument */
490 lua_pushlightuserdata(L, argv); /* 2nd argument */
491 status = lua_pcall(L, 2, 1, 0);
492 result = lua_toboolean(L, -1); /* get result */
493 finalreport(L, status);
494 lua_close(L);
495 return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
496}
497

Callers

nothing calls this directly

Calls 8

finalreportFunction · 0.85
luaL_newstateFunction · 0.70
l_messageFunction · 0.70
lua_pushintegerFunction · 0.70
lua_pushlightuserdataFunction · 0.70
lua_tobooleanFunction · 0.70
lua_closeFunction · 0.70
lua_pcallFunction · 0.50

Tested by

no test coverage detected