| 616 | |
| 617 | |
| 618 | int main (int argc, char **argv) { |
| 619 | int status, result; |
| 620 | lua_State *L = luaL_newstate(); /* create state */ |
| 621 | if (L == NULL) { |
| 622 | l_message(argv[0], "cannot create state: not enough memory"); |
| 623 | return EXIT_FAILURE; |
| 624 | } |
| 625 | lua_pushcfunction(L, &pmain); /* to call 'pmain' in protected mode */ |
| 626 | lua_pushinteger(L, argc); /* 1st argument */ |
| 627 | lua_pushlightuserdata(L, argv); /* 2nd argument */ |
| 628 | status = lua_pcall(L, 2, 1, 0); /* do the call */ |
| 629 | result = lua_toboolean(L, -1); /* get result */ |
| 630 | report(L, status); |
| 631 | lua_close(L); |
| 632 | return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; |
| 633 | } |
| 634 |
nothing calls this directly
no test coverage detected