.desc = "The string to match.",
.type = EC_CONFIG_TYPE_STRING,
},
+ {
+ .type = EC_CONFIG_TYPE_NONE,
+ },
};
static int ec_node_str_set_config(struct ec_node *gen_node,
const struct ec_config *value = NULL;
char *s = NULL;
- value = ec_config_get(config, "string");
+ value = ec_config_dict_get(config, "string");
if (value == NULL) {
errno = EINVAL;
goto fail;
static struct ec_node_type ec_node_str_type = {
.name = "str",
.schema = ec_node_str_schema,
- .schema_len = EC_COUNT_OF(ec_node_str_schema),
.set_config = ec_node_str_set_config,
.parse = ec_node_str_parse,
.complete = ec_node_str_complete,
int ec_node_str_set_str(struct ec_node *gen_node, const char *str)
{
struct ec_config *config = NULL;
+ int ret;
if (ec_node_check_type(gen_node, &ec_node_str_type) < 0)
goto fail;
if (config == NULL)
goto fail;
- if (ec_config_dict_set(config, "string", ec_config_string(str)) < 0)
+ ret = ec_config_dict_set(config, "string", ec_config_string(str));
+ if (ret < 0)
goto fail;
- if (ec_node_set_config(gen_node, config) < 0)
+ ret = ec_node_set_config(gen_node, config);
+ config = NULL;
+ if (ret < 0)
goto fail;
return 0;
{
struct ec_node *gen_node = NULL;
- gen_node = __ec_node(&ec_node_str_type, id);
+ gen_node = ec_node_from_type(&ec_node_str_type, id);
if (gen_node == NULL)
goto fail;