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

Function json_add_plugin_val

lightningd/plugin.c:2106–2119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2104}
2105
2106static 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
2121static void json_add_plugin_options(struct json_stream *stream,
2122 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