MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaL_checkoption

Function luaL_checkoption

3rd/lua-5.4.3/src/lauxlib.c:360–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 4

luaB_collectgarbageFunction · 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

no test coverage detected