MCPcopy Create free account
hub / github.com/defold/defold / json_arg_init

Function json_arg_init

engine/script/src/luacjson/lua_cjson.c:259–268  ·  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

257 * Pad with nil to allow other functions to simply check arg[i]
258 * to find whether an argument was provided */
259static json_config_t *json_arg_init(lua_State *l, int args)
260{
261 luaL_argcheck(l, lua_gettop(l) <= args, args + 1,
262 "found too many arguments");
263
264 while (lua_gettop(l) < args)
265 lua_pushnil(l);
266
267 return json_fetch_config(l);
268}
269
270/* Process integer options for configuration functions */
271static int json_integer_option(lua_State *l, int optindex, int *setting,

Calls 3

lua_gettopFunction · 0.85
lua_pushnilFunction · 0.85
json_fetch_configFunction · 0.85

Tested by

no test coverage detected