| 641 | |
| 642 | |
| 643 | int main (int argc, char **argv) { |
| 644 | int status, result; |
| 645 | lua_State *L = luaL_newstate(); /* create state */ |
| 646 | if (L == NULL) { |
| 647 | l_message(argv[0], "cannot create state: not enough memory"); |
| 648 | return EXIT_FAILURE; |
| 649 | } |
| 650 | lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ |
| 651 | lua_pushinteger(L, argc); /* 1st argument */ |
| 652 | lua_pushlightuserdata(L, argv); /* 2nd argument */ |
| 653 | status = lua_pcall(L, 2, 1, 0); /* do the call */ |
| 654 | result = lua_toboolean(L, -1); /* get result */ |
| 655 | report(L, status); |
| 656 | lua_close(L); |
| 657 | return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; |
| 658 | } |
| 659 |
nothing calls this directly
no test coverage detected