| 354 | */ |
| 355 | |
| 356 | LUALIB_API int luaL_checkoption(lua_State *L, int arg, const char *def, |
| 357 | const char *const lst[]) { |
| 358 | const char *name = (def) ? luaL_optstring(L, arg, def) : |
| 359 | luaL_checkstring(L, arg); |
| 360 | int i; |
| 361 | for (i = 0; lst[i]; i++) |
| 362 | if (strcmp(lst[i], name) == 0) |
| 363 | return i; |
| 364 | return luaL_argerror(L, arg, |
| 365 | lua_pushfstring(L, "invalid option '%s'", name)); |
| 366 | } |
| 367 | |
| 368 | |
| 369 | LUALIB_API void luaL_checkstack(lua_State *L, int space, const char *msg) { |
no test coverage detected