MCPcopy Create free account
hub / github.com/Overload-Technologies/Overload / luaL_checkoption

Function luaL_checkoption

Dependencies/lua/src/lauxlib.c:363–373  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

361*/
362
363LUALIB_API int luaL_checkoption (lua_State *L, int arg, const char *def,
364 const char *const lst[]) {
365 const char *name = (def) ? luaL_optstring(L, arg, def) :
366 luaL_checkstring(L, arg);
367 int i;
368 for (i=0; lst[i]; i++)
369 if (strcmp(lst[i], name) == 0)
370 return i;
371 return luaL_argerror(L, arg,
372 lua_pushfstring(L, "invalid option '%s'", name));
373}
374
375
376/*

Callers 5

luaB_collectgarbageFunction · 0.85
gc_stateFunction · 0.85
os_setlocaleFunction · 0.85
f_seekFunction · 0.85
f_setvbufFunction · 0.85

Calls 2

luaL_argerrorFunction · 0.85
lua_pushfstringFunction · 0.85

Tested by 1

gc_stateFunction · 0.68