X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=util%2Fcql2pqf.c;h=ac2a4577091f2a928c082114873d469ffe6172e3;hb=dedba382ec4773d8abdf244290020f3da42113b6;hp=9a11bbc5d89de6d4c557e00bcd86113c29584ec2;hpb=08c3a57c9782652a28ca9a2a9966e3f75e943415;p=yaz-moved-to-github.git diff --git a/util/cql2pqf.c b/util/cql2pqf.c index 9a11bbc..ac2a457 100644 --- a/util/cql2pqf.c +++ b/util/cql2pqf.c @@ -1,18 +1,15 @@ -/* $Id: cql2pqf.c,v 1.3 2004-03-11 09:34:42 adam Exp $ - Copyright (C) 2002-2004 - Index Data Aps - -This file is part of the YAZ toolkit. - -See the file LICENSE. -*/ +/* This file is part of the YAZ toolkit. + * Copyright (C) 1995-2008 Index Data + * See the file LICENSE for details. + */ #include #include #include +#include -static void usage() +static void usage(void) { fprintf (stderr, "usage\n cql2pqf [-n ] []\n"); exit (1); @@ -21,7 +18,7 @@ static void usage() int main(int argc, char **argv) { cql_transform_t ct; - int r; + int r = 0; int i, iterations = 1; CQL_parser cp = cql_parser_create(); char *query = 0; @@ -35,20 +32,20 @@ int main(int argc, char **argv) switch (ret) { case 0: - if (!fname) - fname = arg; - else - query = arg; + if (!fname) + fname = arg; + else + query = arg; break; - case 'n': - iterations = atoi(arg); - break; - default: - usage(); - } + case 'n': + iterations = atoi(arg); + break; + default: + usage(); + } } if (!fname) - usage(); + usage(); ct = cql_transform_open_fname(fname); if (!ct) { @@ -58,33 +55,41 @@ int main(int argc, char **argv) if (query) { - for (i = 0; i