1 /* This file is part of the YAZ toolkit.
2 * Copyright (C) 1995-2013 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] [-S] [infile]\n", prog);
22 int main(int argc, char **argv)
26 const char *fname = 0;
29 int convert_to_ccl = 0;
35 while ((ret = options("cn:sS", argv, argc, &arg)) != YAZ_OPTIONS_EOF)
46 iterations = atoi(arg);
59 cp = cql_parser_create();
60 cql_parser_strict(cp, do_strict);
64 for (i = 0; i<iterations; i++)
65 r = cql_parser_string(cp, fname);
68 r = cql_parser_stdio(cp, stdin);
70 fprintf (stderr, "Syntax error\n");
75 cql_to_ccl_stdio(cql_parser_result(cp), stdout);
79 cql_to_xml_stdio(cql_parser_result(cp), stdout);
82 WRBUF w = wrbuf_alloc();
83 r = cql_sortby_to_sortkeys(cql_parser_result(cp),
86 printf("sortkeys: %s\n", wrbuf_cstr(w));
88 fprintf(stderr, "failed to generate sortkeys\n");
92 cql_parser_destroy(cp);
98 * c-file-style: "Stroustrup"
99 * indent-tabs-mode: nil
101 * vim: shiftwidth=4 tabstop=8 expandtab