1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2012 Index Data
3 * See the file LICENSE for details.
13 #include <yaz/wrbuf.h>
14 #include <yaz/options.h>
16 static void usage(const char *prog)
18 fprintf(stderr, "%s: [-c] [-n iterations] [-s] [infile]\n", prog);
22 int main(int argc, char **argv)
26 const char *fname = 0;
29 int convert_to_ccl = 0;
34 while ((ret = options("cn:s", argv, argc, &arg)) != YAZ_OPTIONS_EOF)
45 iterations = atoi(arg);
55 cp = cql_parser_create();
59 for (i = 0; i<iterations; i++)
60 r = cql_parser_string(cp, fname);
63 r = cql_parser_stdio(cp, stdin);
65 fprintf (stderr, "Syntax error\n");
70 cql_to_ccl_stdio(cql_parser_result(cp), stdout);
74 cql_to_xml_stdio(cql_parser_result(cp), stdout);
77 WRBUF w = wrbuf_alloc();
78 r = cql_sortby_to_sortkeys(cql_parser_result(cp),
81 printf("sortkeys: %s\n", wrbuf_cstr(w));
83 fprintf(stderr, "failed to generate sortkeys\n");
87 cql_parser_destroy(cp);
93 * c-file-style: "Stroustrup"
94 * indent-tabs-mode: nil
96 * vim: shiftwidth=4 tabstop=8 expandtab