MCPcopy Create free account
hub / github.com/DFHack/dfhack / main

Function main

depends/lua/src/luac.c:192–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

190}
191
192int main(int argc, char* argv[])
193{
194 lua_State* L;
195 int i=doargs(argc,argv);
196 argc-=i; argv+=i;
197 if (argc<=0) usage("no input files given");
198 L=luaL_newstate();
199 if (L==NULL) fatal("cannot create state: not enough memory");
200 lua_pushcfunction(L,&pmain);
201 lua_pushinteger(L,argc);
202 lua_pushlightuserdata(L,argv);
203 if (lua_pcall(L,2,0,0)!=LUA_OK) fatal(lua_tostring(L,-1));
204 lua_close(L);
205 return EXIT_SUCCESS;
206}
207
208/*
209** $Id: luac.c,v 1.76 2018/06/19 01:32:02 lhf Exp $

Callers

nothing calls this directly

Calls 7

doargsFunction · 0.85
usageFunction · 0.85
luaL_newstateFunction · 0.85
fatalFunction · 0.85
lua_pushintegerFunction · 0.85
lua_pushlightuserdataFunction · 0.85
lua_closeFunction · 0.85

Tested by

no test coverage detected