MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaL_checkoption

Function luaL_checkoption

freebsd/contrib/openzfs/module/lua/lauxlib.c:280–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278*/
279
280LUALIB_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
293LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) {

Callers 1

luaB_collectgarbageFunction · 0.70

Calls 3

strcmpFunction · 0.85
luaL_argerrorFunction · 0.70
lua_pushfstringFunction · 0.70

Tested by

no test coverage detected