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

Function add_table_object

plugins/sql.c:2010–2033  ·  view source on GitHub ↗

tok is the JSON schema member for an object */

Source from the content-addressed store, hash-verified

2008
2009/* tok is the JSON schema member for an object */
2010static void add_table_object(tablemap *tablemap,
2011 struct table_desc *td, const jsmntok_t *tok)
2012{
2013 const jsmntok_t *t, *properties, *allof, *cond;
2014 size_t i;
2015
2016 /* This might not exist inside allOf, for example */
2017 properties = json_get_member(schemas, tok, "properties");
2018 if (properties)
2019 add_table_properties(tablemap, td, properties);
2020
2021 allof = json_get_member(schemas, tok, "allOf");
2022 if (allof) {
2023 json_for_each_arr(i, t, allof)
2024 add_table_object(tablemap, td, t);
2025 }
2026 /* We often find interesting things in then and else branches! */
2027 cond = json_get_member(schemas, tok, "then");
2028 if (cond)
2029 add_table_object(tablemap, td, cond);
2030 cond = json_get_member(schemas, tok, "else");
2031 if (cond)
2032 add_table_object(tablemap, td, cond);
2033}
2034
2035/* plugin is NULL if we're just doing --print-docs */
2036static void init_tablemap(struct plugin *plugin, tablemap *tablemap)

Callers 2

add_table_propertiesFunction · 0.85
init_tablemapFunction · 0.85

Calls 2

json_get_memberFunction · 0.85
add_table_propertiesFunction · 0.85

Tested by

no test coverage detected