1 /* $Id: cql2pqf.c,v 1.3 2004-03-11 09:34:42 adam Exp $
2 Copyright (C) 2002-2004
5 This file is part of the YAZ toolkit.
17 fprintf (stderr, "usage\n cql2pqf [-n <n>] <properties> [<query>]\n");
21 int main(int argc, char **argv)
25 int i, iterations = 1;
26 CQL_parser cp = cql_parser_create();
33 while ((ret = options("n:", argv, argc, &arg)) != -2)
44 iterations = atoi(arg);
52 ct = cql_transform_open_fname(fname);
55 fprintf (stderr, "failed to read properties %s\n", fname);
61 for (i = 0; i<iterations; i++)
62 r = cql_parser_string(cp, query);
65 r = cql_parser_stdio(cp, stdin);
68 fprintf (stderr, "Syntax error\n");
71 r = cql_transform_FILE(ct, cql_parser_result(cp), stdout);
76 cql_transform_error(ct, &addinfo);
77 printf ("Transform error %d %s\n", r, addinfo ? addinfo : "");
81 FILE *null = fopen("/dev/null", "w");
82 for (i = 1; i<iterations; i++)
83 cql_transform_FILE(ct, cql_parser_result(cp), null);
87 cql_transform_close(ct);
88 cql_parser_destroy(cp);