More consistent ICU info. Update URLs to ICU info
[yaz-moved-to-github.git] / util / cql2pqf.c
index 55bea5d..9f76c3a 100644 (file)
@@ -1,7 +1,10 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2008 Index Data
+ * Copyright (C) 1995-2010 Index Data
  * See the file LICENSE for details.
  */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdlib.h>
 #include <stdio.h>
@@ -39,6 +42,7 @@ int main(int argc, char **argv)
             break;
         case 'r':
             reverse = 1;
+            break;
         case 'n':
             iterations = atoi(arg);
             break;
@@ -48,7 +52,10 @@ int main(int argc, char **argv)
     }
     if (!fname)
         usage();
-    ct = cql_transform_open_fname(fname);
+    if (!strcmp(fname, "-"))
+        ct = cql_transform_create();
+    else
+        ct = cql_transform_open_fname(fname);
     if (!ct)
     {
         fprintf(stderr, "failed to read properties %s\n", fname);
@@ -70,7 +77,8 @@ int main(int argc, char **argv)
             }
             else 
             {
-                int ret = cql_transform_rpn2cql(ct, cql_fputs, stdout, rpn);
+                int ret = cql_transform_rpn2cql_stream(ct, cql_fputs,
+                                                       stdout, rpn);
                 
                 if (ret)
                 {
@@ -126,6 +134,7 @@ int main(int argc, char **argv)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab