aboutsummaryrefslogtreecommitdiff
path: root/tests/gcfenum.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gcfenum.c')
-rw-r--r--tests/gcfenum.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/gcfenum.c b/tests/gcfenum.c
index e36dbac..e0eac48 100644
--- a/tests/gcfenum.c
+++ b/tests/gcfenum.c
@@ -1,4 +1,4 @@
1/* grecs - Gray's Extensible Configuration System 1/* argot - Gray's Extensible Configuration System
2 Copyright (C) 2007-2016 Sergey Poznyakoff 2 Copyright (C) 2007-2016 Sergey Poznyakoff
3 3
4 Grecs is free software; you can redistribute it and/or modify it 4 Grecs is free software; you can redistribute it and/or modify it
@@ -20,7 +20,7 @@
20#include <string.h> 20#include <string.h>
21#include <errno.h> 21#include <errno.h>
22#include <stdlib.h> 22#include <stdlib.h>
23#include "grecs.h" 23#include "argot.h"
24 24
25static void 25static void
26usage(const char *arg, FILE *fp, int code) 26usage(const char *arg, FILE *fp, int code)
@@ -36,15 +36,15 @@ main(int argc, char **argv)
36{ 36{
37 char *progname = argv[0]; 37 char *progname = argv[0];
38 char *file = NULL; 38 char *file = NULL;
39 struct grecs_node *tree, *node; 39 struct argot_node *tree, *node;
40 int flags = GRECS_NODE_FLAG_QUOTE| 40 int flags = ARGOT_NODE_FLAG_QUOTE|
41 GRECS_NODE_FLAG_PATH; 41 ARGOT_NODE_FLAG_PATH;
42 int reduce = 0; 42 int reduce = 0;
43 43
44 while (--argc) { 44 while (--argc) {
45 char *arg = *++argv; 45 char *arg = *++argv;
46 if (strcmp(arg, "-locus") == 0) 46 if (strcmp(arg, "-locus") == 0)
47 flags |= GRECS_NODE_FLAG_LOCUS; 47 flags |= ARGOT_NODE_FLAG_LOCUS;
48 else if (strncmp(arg, "-delim=", 7) == 0) 48 else if (strncmp(arg, "-delim=", 7) == 0)
49 flags |= arg[7]; 49 flags |= arg[7];
50 else if (strcmp(arg, "-reduce") == 0) 50 else if (strcmp(arg, "-reduce") == 0)
@@ -60,18 +60,18 @@ main(int argc, char **argv)
60 if (!file || argc) 60 if (!file || argc)
61 usage(progname, stderr, 1); 61 usage(progname, stderr, 1);
62 62
63 tree = grecs_parse(file); 63 tree = argot_parse(file);
64 if (!tree) 64 if (!tree)
65 exit(1); 65 exit(1);
66 if (reduce) 66 if (reduce)
67 grecs_tree_reduce(tree, NULL, 0); 67 argot_tree_reduce(tree, NULL, 0);
68 68
69 for (node = grecs_tree_first_node(tree); node; 69 for (node = argot_tree_first_node(tree); node;
70 node = grecs_next_node(node)) { 70 node = argot_next_node(node)) {
71 grecs_print_node(node, flags, stdout); 71 argot_print_node(node, flags, stdout);
72 fputc('\n', stdout); 72 fputc('\n', stdout);
73 } 73 }
74 grecs_tree_free(tree); 74 argot_tree_free(tree);
75 exit(0); 75 exit(0);
76} 76}
77 77

Return to:

Send suggestions and report system problems to the System administrator.