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

Function json_add_source

lightningd/configs.c:18–47  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16#include <unistd.h>
17
18static void json_add_source(struct json_stream *result,
19 const char *fieldname,
20 const struct configvar *cv)
21{
22 const char *source;
23
24 if (!cv) {
25 source = "default";
26 } else {
27 source = NULL;
28 switch (cv->src) {
29 case CONFIGVAR_CMDLINE:
30 case CONFIGVAR_CMDLINE_SHORT:
31 source = "cmdline";
32 break;
33 case CONFIGVAR_EXPLICIT_CONF:
34 case CONFIGVAR_BASE_CONF:
35 case CONFIGVAR_NETWORK_CONF:
36 source = tal_fmt(tmpctx, "%s:%u", cv->file, cv->linenum);
37 break;
38 case CONFIGVAR_PLUGIN_START:
39 source = "pluginstart";
40 break;
41 case CONFIGVAR_SETCONFIG_TRANSIENT:
42 source = "setconfig transient";
43 break;
44 }
45 }
46 json_add_string(result, fieldname, source);
47}
48
49static const char *configval_fieldname(const struct opt_table *ot)
50{

Callers 1

json_add_configFunction · 0.85

Calls 1

json_add_stringFunction · 0.50

Tested by

no test coverage detected