| 2104 | } |
| 2105 | |
| 2106 | static void json_add_plugin_val(struct json_stream *stream, |
| 2107 | const struct opt_table *ot, |
| 2108 | const char *name, |
| 2109 | const char *val) |
| 2110 | { |
| 2111 | if ((ot->type & OPT_SHOWINT) || (ot->type & OPT_SHOWMSATS)) { |
| 2112 | json_add_primitive(stream, name, val); |
| 2113 | } else if (ot->type & OPT_SHOWBOOL) { |
| 2114 | /* We allow variants here. Json-ize */ |
| 2115 | json_add_bool(stream, name, opt_canon_bool(val)); |
| 2116 | } else { |
| 2117 | json_add_string(stream, name, val); |
| 2118 | } |
| 2119 | } |
| 2120 | |
| 2121 | static void json_add_plugin_options(struct json_stream *stream, |
| 2122 | const char *fieldname, |
no test coverage detected