add get_child_refs, tests are ok
[protos/libecoli.git] / lib / ecoli_node.h
index 9bf459d..67652ab 100644 (file)
@@ -85,6 +85,8 @@ typedef void (*ec_node_free_priv_t)(struct ec_node *);
 typedef size_t (*ec_node_get_children_count_t)(const struct ec_node *);
 typedef struct ec_node * (*ec_node_get_child_t)(const struct ec_node *,
                                                size_t i);
+typedef unsigned int (*ec_node_get_child_refs_t)(const struct ec_node *,
+                                               size_t i);
 
 /**
  * A structure describing a node type.
@@ -104,6 +106,7 @@ struct ec_node_type {
        ec_node_free_priv_t free_priv;
        ec_node_get_children_count_t get_children_count;
        ec_node_get_child_t get_child;
+       ec_node_get_child_refs_t get_child_refs;
 };
 
 /**
@@ -176,8 +179,8 @@ const struct ec_config *ec_node_get_config(struct ec_node *node);
 size_t ec_node_get_children_count(const struct ec_node *node);
 struct ec_node *
 ec_node_get_child(const struct ec_node *node, size_t i);
-int ec_node_add_child(struct ec_node *node, struct ec_node *child);
-int ec_node_del_child(struct ec_node *node, struct ec_node *child);
+unsigned int
+ec_node_get_child_refs(const struct ec_node *node, size_t i);
 
 /* XXX add more accessors */
 const struct ec_node_type *ec_node_type(const struct ec_node *node);