| 1830 | } |
| 1831 | |
| 1832 | static void json_add_plugin_opt(struct json_stream *stream, |
| 1833 | const char *name, |
| 1834 | const char *type, |
| 1835 | const struct plugin_opt_value *value) |
| 1836 | { |
| 1837 | if (streq(type, "flag")) { |
| 1838 | /* We don't include 'flag' types if they're not |
| 1839 | * flagged on */ |
| 1840 | if (value->as_bool) |
| 1841 | json_add_bool(stream, name, value->as_bool); |
| 1842 | } else if (streq(type, "bool")) { |
| 1843 | json_add_bool(stream, name, value->as_bool); |
| 1844 | } else if (streq(type, "string")) { |
| 1845 | json_add_string(stream, name, value->as_str); |
| 1846 | } else if (streq(type, "int")) { |
| 1847 | json_add_s64(stream, name, value->as_int); |
| 1848 | } |
| 1849 | } |
| 1850 | |
| 1851 | void |
| 1852 | plugin_populate_init_request(struct plugin *plugin, struct jsonrpc_request *req) |
no test coverage detected