From: Adam Dickmeiss Date: Wed, 4 Jun 2003 09:45:00 +0000 (+0000) Subject: Allow number of iterations to be specified for cql2pqf X-Git-Tag: YAZ.2.0.3~15 X-Git-Url: http://lists.indexdata.dk/?a=commitdiff_plain;h=9a8d8a211ddaa44211702d8cfcfefcdcbcf6276a;p=yaz-moved-to-github.git Allow number of iterations to be specified for cql2pqf --- diff --git a/cql/cql2pqf.c b/cql/cql2pqf.c index e5a3731..84d8948 100644 --- a/cql/cql2pqf.c +++ b/cql/cql2pqf.c @@ -1,4 +1,4 @@ -/* $Id: cql2pqf.c,v 1.1 2003-01-06 08:20:27 adam Exp $ +/* $Id: cql2pqf.c,v 1.2 2003-06-04 09:45:00 adam Exp $ Copyright (C) 2002-2003 Index Data Aps @@ -16,11 +16,12 @@ int main(int argc, char **argv) { cql_transform_t ct; int r; + int i, it = 1; CQL_parser cp = cql_parser_create(); if (argc < 2) { - fprintf (stderr, "usage\n cqltransform []\n"); + fprintf (stderr, "usage\n cqltransform [] [interations]\n"); exit (1); } ct = cql_transform_open_fname(argv[1]); @@ -29,10 +30,16 @@ int main(int argc, char **argv) fprintf (stderr, "failed to read properties %s\n", argv[1]); exit (1); } - if (argc == 3) + if (argc >= 4) + it = atoi(argv[3]); + + for (i = 0; i= 3) r = cql_parser_string(cp, argv[2]); else r = cql_parser_stdio(cp, stdin); + if (r) fprintf (stderr, "Syntax error\n"); else @@ -46,6 +53,7 @@ int main(int argc, char **argv) printf ("Transform error %d %s\n", r, addinfo ? addinfo : ""); } } + } cql_transform_close(ct); cql_parser_destroy(cp); return 0;