On Unix, zebra/z'mbol uses automake.
[idzebra-moved-to-github.git] / index / apitest.c
index 98eab1a..69574e4 100644 (file)
@@ -1,8 +1,8 @@
 
 #include <stdio.h>
 
-#include <log.h>
-#include <pquery.h>
+#include <yaz/log.h>
+#include <yaz/pquery.h>
 #include "zebraapi.h"
 
 /* Small routine to display GRS-1 record variants ... */
@@ -109,6 +109,8 @@ int main (int argc, char **argv)
 
     nmem_init ();
 
+    log_init_file("apitest.log");
+
     odr_input = odr_createmem (ODR_DECODE);    
     odr_output = odr_createmem (ODR_ENCODE);    
     
@@ -145,9 +147,27 @@ int main (int argc, char **argv)
            odr_reset (odr_input);
            continue;
        }
+       else
+       {
+           char out_str[100];
+           int r;
+#if 1
+           r = zebra_string_norm (zh, 'w',
+                                  argv[argno], strlen(argv[argno]),
+                                  out_str, sizeof(out_str));
+           if (r >= 0)
+           {
+               printf ("norm: '%s'\n", out_str);
+           }
+           else
+           {
+               printf ("norm fail: %d\n", r);
+           }
+#endif
 
+       }
        /* result set name will be called 1,2, etc */
-       sprintf (setname, "%d", i);
+       sprintf (setname, "%d", argno);
 
        /* fire up the search */
        zebra_search_rpn (zh, odr_input, odr_output, query, 1, &base, setname);