size_t i;
ec_free(node->cmd_str);
+ node->cmd_str = NULL;
ec_node_free(node->expr);
+ node->expr = NULL;
ec_node_free(node->parser);
+ node->parser = NULL;
ec_node_free(node->cmd);
+ node->cmd = NULL;
for (i = 0; i < node->len; i++)
ec_node_free(node->table[i]);
ec_free(node->table);
+ node->table = NULL;
+ node->len = 0;
}
static const struct ec_config_schema ec_node_cmd_subschema[] = {
.desc = "A child node whose id is referenced in the expression.",
.type = EC_CONFIG_TYPE_NODE,
},
+ {
+ .type = EC_CONFIG_TYPE_NONE,
+ },
};
static const struct ec_config_schema ec_node_cmd_schema[] = {
.desc = "The list of children nodes.",
.type = EC_CONFIG_TYPE_LIST,
.subschema = ec_node_cmd_subschema,
- .subschema_len = EC_COUNT_OF(ec_node_cmd_subschema),
+ },
+ {
+ .type = EC_CONFIG_TYPE_NONE,
},
};
static struct ec_node_type ec_node_cmd_type = {
.name = "cmd",
.schema = ec_node_cmd_schema,
- .schema_len = EC_COUNT_OF(ec_node_cmd_schema),
.set_config = ec_node_cmd_set_config,
.parse = ec_node_cmd_parse,
.complete = ec_node_cmd_complete,
if (children == NULL)
goto fail;
- gen_node = __ec_node(&ec_node_cmd_type, id);
+ gen_node = ec_node_from_type(&ec_node_cmd_type, id);
if (gen_node == NULL)
goto fail;
node = (struct ec_node_cmd *)gen_node;