| 561 | } |
| 562 | |
| 563 | LUALIB_API int luaL_checkoption(lua_State *L, int idx, const char *def, |
| 564 | const char *const lst[]) |
| 565 | { |
| 566 | ptrdiff_t i; |
| 567 | const char *s = lua_tolstring(L, idx, NULL); |
| 568 | if (s == NULL && (s = def) == NULL) |
| 569 | lj_err_argt(L, idx, LUA_TSTRING); |
| 570 | for (i = 0; lst[i]; i++) |
| 571 | if (strcmp(lst[i], s) == 0) |
| 572 | return (int)i; |
| 573 | lj_err_argv(L, idx, LJ_ERR_INVOPTM, s); |
| 574 | } |
| 575 | |
| 576 | LUA_API size_t lua_objlen(lua_State *L, int idx) |
| 577 | { |
nothing calls this directly
no test coverage detected