A little more verbose in marc dump.
[egate.git] / util / iso2709dump.c
1 /*
2  * Iso2709 record management
3  *
4  * Europagate, 1994-1995.
5  *
6  * $Log: iso2709dump.c,v $
7  * Revision 1.6  1995/03/27 12:52:18  adam
8  * A little more verbose in marc dump.
9  *
10  * Revision 1.5  1995/02/22  21:32:36  adam
11  * Changed header.
12  *
13  * Revision 1.3  1995/02/10  17:05:18  adam
14  * New function iso2709_display to display MARC records in a
15  * line-by-line format. The iso2709_cvt function no longer
16  * prints the record to stderr.
17  *
18  * Revision 1.2  1995/02/10  16:50:33  adam
19  * Indicator field moved to 'struct iso2709_dir' from 'struct
20  * iso2709_field'.
21  * Function iso2709_rm implemented - to delete a MARC record.
22  *
23  * Revision 1.1.1.1  1995/02/09  17:27:11  adam
24  * Initial version of email gateway under CVS control.
25  *
26  */
27
28 #include <stdio.h>
29 #include <stdlib.h>
30
31 #include <iso2709.h>
32
33 int main (int argc, char **argv)
34 {
35     char *buf;
36     Iso2709Rec rec;
37     int no = 0;
38
39     while ((buf = iso2709_read (stdin)))
40     {
41         rec = iso2709_cvt (buf);
42         fprintf (stderr, "------- %d --------\n", ++no);
43         if (rec)
44         {
45             iso2709_display (rec, stderr);
46             iso2709_rm (rec);
47         }
48         else
49         {
50             fprintf (stderr, "Bad record\n");
51             break;
52         }
53         free (buf);
54     }
55     return 0;
56 }