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

Function plugin_opt_set

lightningd/plugin.c:861–881  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

859}
860
861char *plugin_opt_set(const char *arg, struct plugin_opt *popt)
862{
863 struct plugin_opt_value *v;
864
865 /* Warn them that this is deprecated */
866 if (popt->deprecated && !deprecated_apis)
867 return tal_fmt(tmpctx, "deprecated option (will be removed!)");
868
869 if (!popt->multi) {
870 tal_free(popt->values);
871 popt->values = tal_arr(popt, struct plugin_opt_value *, 0);
872 }
873
874 v = plugin_opt_value(popt->values, popt->type, arg);
875 if (!v)
876 return tal_fmt(tmpctx, "%s does not parse as type %s",
877 arg, popt->type);
878 tal_arr_expand(&popt->values, v);
879
880 return NULL;
881}
882
883/* Returns true if "name" was already registered and now overwritten. */
884static bool plugin_opt_register(struct plugin_opt *popt)

Callers 1

plugin_add_paramsFunction · 0.85

Calls 2

tal_freeFunction · 0.85
plugin_opt_valueFunction · 0.70

Tested by

no test coverage detected