X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fecoli_node.h;h=3501361c32db2abd753222f533a4f9cc810e5439;hb=833dc6c2a9c47b821548b197a1d1f96f60df7de8;hp=67652ab073fcd4c419170a053324a101b777d875;hpb=eaaf443bad651bd0b01f0bde3668a0f7d7f2dff0;p=protos%2Flibecoli.git diff --git a/lib/ecoli_node.h b/lib/ecoli_node.h index 67652ab..3501361 100644 --- a/lib/ecoli_node.h +++ b/lib/ecoli_node.h @@ -83,10 +83,8 @@ typedef const char * (*ec_node_desc_t)(const struct ec_node *); typedef int (*ec_node_init_priv_t)(struct ec_node *); 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); +typedef int (*ec_node_get_child_t)(const struct ec_node *, + size_t i, struct ec_node **child, unsigned int *refs); /** * A structure describing a node type. @@ -106,7 +104,6 @@ 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; }; /** @@ -159,7 +156,7 @@ struct ec_node { /* create a new node when the type is known, typically called from the node * code */ -struct ec_node *__ec_node(const struct ec_node_type *type, const char *id); +struct ec_node *ec_node_from_type(const struct ec_node_type *type, const char *id); /* create a new node */ struct ec_node *ec_node(const char *typename, const char *id); @@ -177,10 +174,9 @@ int ec_node_set_config(struct ec_node *node, struct ec_config *config); 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); -unsigned int -ec_node_get_child_refs(const struct ec_node *node, size_t i); +int +ec_node_get_child(const struct ec_node *node, size_t i, + struct ec_node **child, unsigned int *refs); /* XXX add more accessors */ const struct ec_node_type *ec_node_type(const struct ec_node *node);