| 594 | |
| 595 | |
| 596 | int main (int argc, char **argv) { |
| 597 | int status, result; |
| 598 | lua_State *L = luaL_newstate(); /* create state */ |
| 599 | if (L == NULL) { |
| 600 | l_message(argv[0], "cannot create state: not enough memory"); |
| 601 | return EXIT_FAILURE; |
| 602 | } |
| 603 | lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ |
| 604 | lua_pushinteger(L, argc); /* 1st argument */ |
| 605 | lua_pushlightuserdata(L, argv); /* 2nd argument */ |
| 606 | status = lua_pcall(L, 2, 1, 0); /* do the call */ |
| 607 | result = lua_toboolean(L, -1); /* get result */ |
| 608 | report(L, status); |
| 609 | lua_close(L); |
| 610 | return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; |
| 611 | } |
| 612 |
nothing calls this directly
no test coverage detected