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

Function main

src/Chain/libraries/glua/single_glua_src/main.cpp:688–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686
687
688int main(int argc, char **argv) {
689 /*
690 argc = 2;
691 argv = (char**)malloc(sizeof(char*) * 2);
692 argv[0] = "lua";
693 argv[1] = "sample.bytes";
694 */
695 int status, result;
696 thinkyoung::lua::lib::GluaStateScope scope;
697 scope.add_system_extra_libs();
698 lua_State *L = scope.L();
699 if (!L) {
700 l_message(argv[0], "cannot create state: not enough memory");
701 return EXIT_FAILURE;
702 }
703 lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */
704 lua_pushinteger(L, argc); /* 1st argument */
705 lua_pushlightuserdata(L, argv); /* 2nd argument */
706 status = lua_pcall(L, 2, 1, 0); /* do the call */
707 result = lua_toboolean(L, -1); /* get result */
708 report(L, status);
709 return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE;
710}

Callers

nothing calls this directly

Calls 7

lua_pushintegerFunction · 0.85
lua_pushlightuserdataFunction · 0.85
lua_tobooleanFunction · 0.85
add_system_extra_libsMethod · 0.80
LMethod · 0.80
l_messageFunction · 0.70
reportFunction · 0.70

Tested by

no test coverage detected