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

Function json_arg_init

app/redis-6.2.6/deps/lua/src/lua_cjson.c:208–217  ·  view source on GitHub ↗

Ensure the correct number of arguments have been provided. * Pad with nil to allow other functions to simply check arg[i] * to find whether an argument was provided */

Source from the content-addressed store, hash-verified

206 * Pad with nil to allow other functions to simply check arg[i]
207 * to find whether an argument was provided */
208static json_config_t *json_arg_init(lua_State *l, int args)
209{
210 luaL_argcheck(l, lua_gettop(l) <= args, args + 1,
211 "found too many arguments");
212
213 while (lua_gettop(l) < args)
214 lua_pushnil(l);
215
216 return json_fetch_config(l);
217}
218
219/* Process integer options for configuration functions */
220static int json_integer_option(lua_State *l, int optindex, int *setting,

Calls 3

json_fetch_configFunction · 0.85
lua_gettopFunction · 0.70
lua_pushnilFunction · 0.70

Tested by

no test coverage detected