MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_add_plugin_val

Function json_add_plugin_val

lightningd/plugin.c:2094–2107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2092}
2093
2094static 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
2109static void json_add_plugin_options(struct json_stream *stream,
2110 const char *fieldname,

Callers 1

json_add_plugin_optionsFunction · 0.85

Calls 4

json_add_primitiveFunction · 0.85
json_add_boolFunction · 0.85
opt_canon_boolFunction · 0.85
json_add_stringFunction · 0.50

Tested by

no test coverage detected