Sets *ret to false if it doesn't appear, otherwise, sets to value */
| 962 | |
| 963 | /* Sets *ret to false if it doesn't appear, otherwise, sets to value */ |
| 964 | static char *bool_setting(tal_t *ctx, |
| 965 | const char *optname, |
| 966 | const char *buffer, |
| 967 | const jsmntok_t *opt, |
| 968 | const char *tokname, |
| 969 | bool *ret) |
| 970 | { |
| 971 | const jsmntok_t *tok = json_get_member(buffer, opt, tokname); |
| 972 | if (!tok) { |
| 973 | *ret = false; |
| 974 | return NULL; |
| 975 | } |
| 976 | if (!json_to_bool(buffer, tok, ret)) |
| 977 | return tal_fmt(ctx, |
| 978 | "%s: invalid \"%s\" field %.*s", |
| 979 | optname, tokname, |
| 980 | tok->end - tok->start, |
| 981 | buffer + tok->start); |
| 982 | return NULL; |
| 983 | } |
| 984 | |
| 985 | /* Parse deprecated field, as either bool or an array of strings */ |
| 986 | static const char *json_parse_deprecated(const tal_t *ctx, |
no test coverage detected