]> git.droids-corp.org - protos/libecoli.git/blobdiff - lib/ecoli_node_many.c
get node children and refs in the same function
[protos/libecoli.git] / lib / ecoli_node_many.c
index 6a5f676890f4af46db18023074b92bb5ebf990e2..32e7ad59b0cc59d46319981492b5ce4bd477add6 100644 (file)
@@ -171,15 +171,18 @@ ec_node_many_get_children_count(const struct ec_node *gen_node)
        return 0;
 }
 
-static struct ec_node *
-ec_node_many_get_child(const struct ec_node *gen_node, size_t i)
+static int
+ec_node_many_get_child(const struct ec_node *gen_node, size_t i,
+               struct ec_node **child, unsigned int *refs)
 {
        struct ec_node_many *node = (struct ec_node_many *)gen_node;
 
        if (i >= 1)
-               return NULL;
+               return -1;
 
-       return node->child;
+       *child = node->child;
+       *refs = 1;
+       return 0;
 }
 
 static struct ec_node_type ec_node_many_type = {