#include <ecoli_malloc.h>
#include <ecoli_test.h>
#include <ecoli_strvec.h>
-#include <ecoli_keyval.h>
+#include <ecoli_dict.h>
#include <ecoli_node.h>
#include <ecoli_parse.h>
#include <ecoli_complete.h>
/* 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_keyval_set(ec_parse_get_attrs(parse), key, child,
+ ret = ec_dict_set(ec_parse_get_attrs(parse), key, child,
(void *)node_free);
if (ret < 0) {
child = NULL; /* already freed */
/* 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_keyval_set(comp->attrs, key, child,
+ ret = ec_dict_set(comp->attrs, key, child,
(void *)node_free);
if (ret < 0) {
child = NULL; /* already freed */
build_counter(struct ec_parse *parse, void *opaque)
{
const struct ec_node *node;
- struct ec_parse *iter;
+ struct ec_parse *root, *iter;
unsigned int count = 0;
char buf[32];
(void)opaque;
- for (iter = ec_parse_get_root(parse); iter != NULL;
- iter = ec_parse_iter_next(iter)) {
+ root = ec_parse_get_root(parse);
+ for (iter = root; iter != NULL;
+ iter = EC_PARSE_ITER_NEXT(root, iter, 1)) {
node = ec_parse_get_node(iter);
if (node->id && !strcmp(node->id, "my-id"))
count++;