api documentation for ec_parse
[protos/libecoli.git] / src / ecoli_node_file.c
index 9c4f4f5..933b997 100644 (file)
@@ -36,11 +36,11 @@ struct ec_node_file {
 
 static int
 ec_node_file_parse(const struct ec_node *node,
-               struct ec_parse *state,
+               struct ec_pnode *pstate,
                const struct ec_strvec *strvec)
 {
        (void)node;
-       (void)state;
+       (void)pstate;
 
        if (ec_strvec_len(strvec) == 0)
                return EC_PARSE_NOMATCH;
@@ -210,8 +210,8 @@ ec_node_file_complete(const struct ec_node *node,
                        if (ec_asprintf(&disp_str, "%s", de->d_name) < 0)
                                goto fail;
                }
-               if (ec_comp_add_item(comp, node, &item,
-                                               type, input, comp_str) < 0)
+               item = ec_comp_add_item(comp, node, type, input, comp_str);
+               if (item == NULL)
                        goto out;
 
                /* fix the display string: we don't want to display the full
@@ -394,20 +394,20 @@ static int ec_node_file_testcase(void)
 
        /* test completion */
        testres |= EC_TEST_CHECK_COMPLETE(node,
-               EC_NODE_ENDLIST,
-               EC_NODE_ENDLIST);
+               EC_VA_END,
+               EC_VA_END);
        testres |= EC_TEST_CHECK_COMPLETE(node,
-               "/tmp/toto/t", EC_NODE_ENDLIST,
-               EC_NODE_ENDLIST);
+               "/tmp/toto/t", EC_VA_END,
+               EC_VA_END);
        testres |= EC_TEST_CHECK_COMPLETE_PARTIAL(node,
-               "/tmp/toto/t", EC_NODE_ENDLIST,
-               "/tmp/toto/titi/", "/tmp/toto/tutu/", EC_NODE_ENDLIST);
+               "/tmp/toto/t", EC_VA_END,
+               "/tmp/toto/titi/", "/tmp/toto/tutu/", EC_VA_END);
        testres |= EC_TEST_CHECK_COMPLETE(node,
-               "/tmp/toto/f", EC_NODE_ENDLIST,
-               "/tmp/toto/foo", EC_NODE_ENDLIST);
+               "/tmp/toto/f", EC_VA_END,
+               "/tmp/toto/foo", EC_VA_END);
        testres |= EC_TEST_CHECK_COMPLETE(node,
-               "/tmp/toto/b", EC_NODE_ENDLIST,
-               "/tmp/toto/bar", "/tmp/toto/bar2", EC_NODE_ENDLIST);
+               "/tmp/toto/b", EC_VA_END,
+               "/tmp/toto/bar", "/tmp/toto/bar2", EC_VA_END);
 
        ec_node_free(node);