| 478 | |
| 479 | |
| 480 | int main (int argc, char **argv) { |
| 481 | int status, result; |
| 482 | lua_State *L = luaL_newstate(); /* create state */ |
| 483 | if (L == NULL) { |
| 484 | l_message(argv[0], "cannot create state: not enough memory"); |
| 485 | return EXIT_FAILURE; |
| 486 | } |
| 487 | /* call 'pmain' in protected mode */ |
| 488 | lua_pushcfunction(L, &pmain); |
| 489 | lua_pushinteger(L, argc); /* 1st argument */ |
| 490 | lua_pushlightuserdata(L, argv); /* 2nd argument */ |
| 491 | status = lua_pcall(L, 2, 1, 0); |
| 492 | result = lua_toboolean(L, -1); /* get result */ |
| 493 | finalreport(L, status); |
| 494 | lua_close(L); |
| 495 | return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; |
| 496 | } |
| 497 |
nothing calls this directly
no test coverage detected