New function marc_display_exl - used by YAZ client. Server returns
[yaz-moved-to-github.git] / client / client.c
index 774a08b..315b5b8 100644 (file)
@@ -2,15 +2,10 @@
  * Copyright (c) 1995-2001, Index Data
  * See the file LICENSE for details.
  *
- * $Id: client.c,v 1.127 2001-08-08 19:35:06 adam Exp $
+ * $Id: client.c,v 1.129 2001-10-29 09:17:19 adam Exp $
  *
  */
 
-/*
- * This is the obligatory little toy client, whose primary purpose is
- * to illustrate the use of the YAZ service-level API.
- */
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
@@ -494,7 +489,8 @@ static void display_record(Z_DatabaseRecord *p)
         }
     }
     if (ent && ent->value == VAL_SOIF)
-        print_record((const unsigned char *) r->u.octet_aligned->buf, r->u.octet_aligned->len);
+        print_record((const unsigned char *) r->u.octet_aligned->buf,
+                     r->u.octet_aligned->len);
     else if (r->which == Z_External_octet && p->u.octet_aligned->len)
     {
         const char *octet_buf = (char*)p->u.octet_aligned->buf;
@@ -504,7 +500,9 @@ static void display_record(Z_DatabaseRecord *p)
                          p->u.octet_aligned->len);
         else
         {
-            if (marc_display (octet_buf, NULL) <= 0)
+            if (marc_display_exl (octet_buf, NULL, 0 /* debug */,
+                                  p->u.octet_aligned->len)
+                <= 0)
             {
                 printf ("ISO2709 decoding failed, dumping record as is:\n");
                 print_record((const unsigned char*) octet_buf,
@@ -1919,7 +1917,6 @@ static void initialize(void)
 #if YAZ_MODULE_ccl
     FILE *inf;
 #endif
-    nmem_init();
     if (!(out = odr_createmem(ODR_ENCODE)) ||
         !(in = odr_createmem(ODR_DECODE)) ||
         !(print = odr_createmem(ODR_PRINT)))