support config in node_or
[protos/libecoli.git] / lib / ecoli_node_seq.c
index fa9eaac..ff0c5de 100644 (file)
@@ -164,6 +164,8 @@ static void ec_node_seq_free_priv(struct ec_node *gen_node)
        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_seq_subschema[] = {
@@ -171,6 +173,9 @@ static const struct ec_config_schema ec_node_seq_subschema[] = {
                .desc = "A child node which is part of the sequence.",
                .type = EC_CONFIG_TYPE_NODE,
        },
+       {
+               .type = EC_CONFIG_TYPE_NONE,
+       },
 };
 
 static const struct ec_config_schema ec_node_seq_schema[] = {
@@ -179,7 +184,9 @@ static const struct ec_config_schema ec_node_seq_schema[] = {
                .desc = "The list of children nodes, to be parsed in sequence.",
                .type = EC_CONFIG_TYPE_LIST,
                .subschema = ec_node_seq_subschema,
-               .subschema_len = EC_COUNT_OF(ec_node_seq_subschema),
+       },
+       {
+               .type = EC_CONFIG_TYPE_NONE,
        },
 };
 
@@ -236,7 +243,6 @@ ec_node_seq_get_child(const struct ec_node *gen_node, size_t i,
 static struct ec_node_type ec_node_seq_type = {
        .name = "seq",
        .schema = ec_node_seq_schema,
-       .schema_len = EC_COUNT_OF(ec_node_seq_schema),
        .set_config = ec_node_seq_set_config,
        .parse = ec_node_seq_parse,
        .complete = ec_node_seq_complete,