System headerfiles gathered in yconfig
[yaz-moved-to-github.git] / client / client.c
index c7e336a..3c8a898 100644 (file)
@@ -4,7 +4,22 @@
  * Sebastian Hammer, Adam Dickmeiss
  *
  * $Log: client.c,v $
- * Revision 1.32  1996-03-15 11:05:33  adam
+ * Revision 1.37  1996-07-06 19:58:29  quinn
+ * System headerfiles gathered in yconfig
+ *
+ * Revision 1.36  1996/06/10  08:53:47  quinn
+ * Added Summary
+ *
+ * Revision 1.35  1996/06/03  09:45:50  quinn
+ * Added display of OIDs in the GRS routine.
+ *
+ * Revision 1.34  1996/05/09  07:26:49  quinn
+ * *** empty log message ***
+ *
+ * Revision 1.33  1996/05/09  07:25:22  quinn
+ * Small
+ *
+ * Revision 1.32  1996/03/15  11:05:33  adam
  * The user can set the preferred query type (prefix, ccl, ..) with the
  * querytype command.
  *
  * to illustrate the use of the YAZ service-level API.
  */
 
+#include <yconfig.h>
 #include <stdio.h>
 #include <stdlib.h>
-#ifdef WINDOWS
 #include <time.h>
-#else
-#include <sys/time.h>
-#endif
 #include <assert.h>
-#ifdef _AIX
-#include <sys/select.h>
-#endif
 
 #include <comstack.h>
 #include <tcpip.h>
@@ -378,6 +387,21 @@ static void display_grs1(Z_GenericRecord *r, int level)
             printf("%s\n", t->content->u.string);
         else if (t->content->which == Z_ElementData_numeric)
            printf("%d\n", *t->content->u.numeric);
+       else if (t->content->which == Z_ElementData_oid)
+       {
+           int *ip = t->content->u.oid;
+           oident *oent;
+
+           if ((oent = oid_getentbyoid(t->content->u.oid)))
+               printf("OID: %s\n", oent->desc);
+           else
+           {
+               printf("{");
+               while (ip && *ip >= 0)
+                   printf(" %d", *(ip++));
+               printf(" }\n");
+           }
+       }
        else if (t->content->which == Z_ElementData_noDataRequested)
            printf("[No data requested]\n");
        else if (t->content->which == Z_ElementData_elementEmpty)
@@ -508,7 +532,7 @@ static void display_diagrec(Z_DiagRec *p)
         printf("Missing or unknown diagset\n");
     printf("    [%d] %s", *r->condition, diagbib1_str(*r->condition));
     if (r->addinfo && *r->addinfo)
-        printf(" -- %s\n", r->addinfo);
+        printf(" -- '%s'\n", r->addinfo);
     else
         printf("\n");
 }
@@ -626,7 +650,7 @@ static int send_searchRequest(char *arg)
         assert((RPNquery = ccl_rpn_query(rpn)));
         bib1.proto = protocol;
         bib1.oclass = CLASS_ATTSET;
-        bib1.value = VAL_BIB1;
+        bib1.value = attributeset;
         RPNquery->attributeSetId = oid_getoidbyent(&bib1);
         query.u.type_1 = RPNquery;
         break;
@@ -754,6 +778,24 @@ static int send_presentRequest(char *arg)
         sprintf(setstring, "%d", setnumber);
         req->resultSetId = setstring;
     }
+
+
+#if 0
+    if (1)
+    {
+       static Z_Range range;
+       static Z_Range *rangep = &range;
+    req->num_ranges = 1;
+#endif
+
+
+
+
+
+
+
+
+
     req->resultSetStartPoint = &setno;
     req->numberOfRecordsRequested = &nos;
     prefsyn.proto = protocol;
@@ -951,6 +993,12 @@ int cmd_format(char *arg)
         recordsyntax = VAL_GRS1;
         return 1;
     }
+    else if (!strcmp(arg, "summary"))
+    {
+        printf("Preferred format is Summary\n");
+        recordsyntax = VAL_SUMMARY;
+        return 1;
+    }
     else if (!strcmp(arg, "explain"))
     {
         printf("Preferred format is Explain\n");