| 278 | */ |
| 279 | |
| 280 | LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, |
| 281 | const char *const lst[]) { |
| 282 | const char *name = (def) ? luaL_optstring(L, narg, def) : |
| 283 | luaL_checkstring(L, narg); |
| 284 | int i; |
| 285 | for (i=0; lst[i]; i++) |
| 286 | if (strcmp(lst[i], name) == 0) |
| 287 | return i; |
| 288 | return luaL_argerror(L, narg, |
| 289 | lua_pushfstring(L, "invalid option " LUA_QS, name)); |
| 290 | } |
| 291 | |
| 292 | |
| 293 | LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) { |
no test coverage detected