MCPcopy Create free account
hub / github.com/DFHack/dfhack / luaL_checkoption

Function luaL_checkoption

depends/lua/src/lauxlib.c:348–358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346*/
347
348LUALIB_API int luaL_checkoption (lua_State *L, int arg, const char *def,
349 const char *const lst[]) {
350 const char *name = (def) ? luaL_optstring(L, arg, def) :
351 luaL_checkstring(L, arg);
352 int i;
353 for (i=0; lst[i]; i++)
354 if (strcmp(lst[i], name) == 0)
355 return i;
356 return luaL_argerror(L, arg,
357 lua_pushfstring(L, "invalid option '%s'", name));
358}
359
360
361/*

Callers 8

dfhack_timeoutFunction · 0.85
dfhack_pen_newindexFunction · 0.85
get_object_identityMethod · 0.85
luaB_collectgarbageFunction · 0.85
os_setlocaleFunction · 0.85
f_seekFunction · 0.85
f_setvbufFunction · 0.85
paintFunction · 0.85

Calls 2

luaL_argerrorFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by

no test coverage detected