First version of string-queue utility.
[egate.git] / util / iso2709dump.c
index 4a284bf..e8d82da 100644 (file)
@@ -1,14 +1,25 @@
 /*
-   gw-res.c: Iso2709 record management
-
-   Europagate, 1994-1995.
-
-   $Log: iso2709dump.c,v $
-   Revision 1.2  1995/02/10 16:50:33  adam
-   Indicator field moved to 'struct iso2709_dir' from 'struct
-   iso2709_field'.
-   Function iso2709_rm implemented - to delete a MARC record.
-
+ * Iso2709 record management
+ *
+ * Europagate, 1994-1995.
+ *
+ * $Log: iso2709dump.c,v $
+ * Revision 1.6  1995/03/27 12:52:18  adam
+ * A little more verbose in marc dump.
+ *
+ * Revision 1.5  1995/02/22  21:32:36  adam
+ * Changed header.
+ *
+ * Revision 1.3  1995/02/10  17:05:18  adam
+ * New function iso2709_display to display MARC records in a
+ * line-by-line format. The iso2709_cvt function no longer
+ * prints the record to stderr.
+ *
+ * Revision 1.2  1995/02/10  16:50:33  adam
+ * Indicator field moved to 'struct iso2709_dir' from 'struct
+ * iso2709_field'.
+ * Function iso2709_rm implemented - to delete a MARC record.
+ *
  * Revision 1.1.1.1  1995/02/09  17:27:11  adam
  * Initial version of email gateway under CVS control.
  *
@@ -23,12 +34,23 @@ int main (int argc, char **argv)
 {
     char *buf;
     Iso2709Rec rec;
+    int no = 0;
 
     while ((buf = iso2709_read (stdin)))
     {
         rec = iso2709_cvt (buf);
+        fprintf (stderr, "------- %d --------\n", ++no);
+        if (rec)
+        {
+            iso2709_display (rec, stderr);
+            iso2709_rm (rec);
+        }
+        else
+        {
+            fprintf (stderr, "Bad record\n");
+            break;
+        }
         free (buf);
-        iso2709_rm (rec);
     }
     return 0;
 }