| 2092 | } |
| 2093 | |
| 2094 | static void json_add_plugin_val(struct json_stream *stream, |
| 2095 | const struct opt_table *ot, |
| 2096 | const char *name, |
| 2097 | const char *val) |
| 2098 | { |
| 2099 | if ((ot->type & OPT_SHOWINT) || (ot->type & OPT_SHOWMSATS)) { |
| 2100 | json_add_primitive(stream, name, val); |
| 2101 | } else if (ot->type & OPT_SHOWBOOL) { |
| 2102 | /* We allow variants here. Json-ize */ |
| 2103 | json_add_bool(stream, name, opt_canon_bool(val)); |
| 2104 | } else { |
| 2105 | json_add_string(stream, name, val); |
| 2106 | } |
| 2107 | } |
| 2108 | |
| 2109 | static void json_add_plugin_options(struct json_stream *stream, |
| 2110 | const char *fieldname, |
no test coverage detected