X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=src%2Fecoli_node_dynamic.c;h=03bdd1c8a2bbc6fabcc1a48f946627f4dcd5579b;hb=331d87b8f34493ea7eb4db75fa9d90b2e3ed503b;hp=2b79f7ae8038114d6661f40ca002dfcf2f0ca7c0;hpb=376f5016e3979247bf0db515e47df49ba1eb82ac;p=protos%2Flibecoli.git diff --git a/src/ecoli_node_dynamic.c b/src/ecoli_node_dynamic.c index 2b79f7a..03bdd1c 100644 --- a/src/ecoli_node_dynamic.c +++ b/src/ecoli_node_dynamic.c @@ -30,7 +30,7 @@ struct ec_node_dynamic { static int ec_node_dynamic_parse(const struct ec_node *node, - struct ec_parse *parse, + struct ec_pnode *parse, const struct ec_strvec *strvec) { struct ec_node_dynamic *priv = ec_node_priv(node); @@ -46,14 +46,14 @@ ec_node_dynamic_parse(const struct ec_node *node, /* add the node pointer in the attributes, so it will be freed * when parse is freed */ snprintf(key, sizeof(key), "_dyn_%p", child); - ret = ec_dict_set(ec_parse_get_attrs(parse), key, child, + ret = ec_dict_set(ec_pnode_get_attrs(parse), key, child, (void *)node_free); if (ret < 0) { child = NULL; /* already freed */ goto fail; } - return ec_node_parse_child(child, parse, strvec); + return ec_parse_child(child, parse, strvec); fail: ec_node_free(child); @@ -66,13 +66,13 @@ ec_node_dynamic_complete(const struct ec_node *node, const struct ec_strvec *strvec) { struct ec_node_dynamic *priv = ec_node_priv(node); - struct ec_parse *parse; + struct ec_pnode *parse; struct ec_node *child = NULL; void (*node_free)(struct ec_node *) = ec_node_free; char key[64]; int ret = -1; - parse = ec_comp_get_state(comp); + parse = ec_comp_get_cur_pstate(comp); child = priv->build(parse, priv->opaque); if (child == NULL) goto fail; @@ -80,14 +80,14 @@ ec_node_dynamic_complete(const struct ec_node *node, /* add the node pointer in the attributes, so it will be freed * when parse is freed */ snprintf(key, sizeof(key), "_dyn_%p", child); - ret = ec_dict_set(comp->attrs, key, child, + ret = ec_dict_set(ec_comp_get_attrs(comp), key, child, (void *)node_free); if (ret < 0) { child = NULL; /* already freed */ goto fail; } - return ec_node_complete_child(child, comp, strvec); + return ec_complete_child(child, comp, strvec); fail: ec_node_free(child); @@ -131,18 +131,18 @@ fail: EC_NODE_TYPE_REGISTER(ec_node_dynamic_type); static struct ec_node * -build_counter(struct ec_parse *parse, void *opaque) +build_counter(struct ec_pnode *parse, void *opaque) { const struct ec_node *node; - struct ec_parse *root, *iter; + struct ec_pnode *root, *iter; unsigned int count = 0; char buf[32]; (void)opaque; - root = ec_parse_get_root(parse); + root = ec_pnode_get_root(parse); for (iter = root; iter != NULL; - iter = EC_PARSE_ITER_NEXT(root, iter, 1)) { - node = ec_parse_get_node(iter); + iter = EC_PNODE_ITER_NEXT(root, iter, 1)) { + node = ec_pnode_get_node(iter); if (!strcmp(ec_node_id(node), "my-id")) count++; } @@ -171,11 +171,11 @@ static int ec_node_dynamic_testcase(void) /* test completion */ testres |= EC_TEST_CHECK_COMPLETE(node, - "c", EC_NODE_ENDLIST, - "count-0", EC_NODE_ENDLIST); + "c", EC_VA_END, + "count-0", EC_VA_END); testres |= EC_TEST_CHECK_COMPLETE(node, - "count-0", "", EC_NODE_ENDLIST, - "count-1", EC_NODE_ENDLIST, + "count-0", "", EC_VA_END, + "count-1", EC_VA_END, "count-1"); ec_node_free(node);