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 */
| 206 | * Pad with nil to allow other functions to simply check arg[i] |
| 207 | * to find whether an argument was provided */ |
| 208 | static 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 */ |
| 220 | static int json_integer_option(lua_State *l, int optindex, int *setting, |
no test coverage detected