437e497a49413381a59ffda603a84dc9bb82c117
[egate.git] / util / iso27dis.c
1 /*
2  * Iso2709 record management
3  *
4  * Europagate, 1994-1995.
5  *
6  * $Log: iso27dis.c,v $
7  * Revision 1.4  1995/03/29 11:44:29  adam
8  * New functions: iso2709_a_.. for record manipulation.
9  *
10  * Revision 1.3  1995/02/22  21:32:36  adam
11  * Changed header.
12  *
13  * Revision 1.1  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  */
19
20 #include <stdlib.h>
21 #include <string.h>
22 #include <stdio.h>
23 #include <assert.h>
24 #include <ctype.h>
25
26 #include <iso2709.h>
27
28 void iso2709_display (Iso2709Rec rec, FILE *out)
29 {
30     Iso2709Anchor a;
31     char *tag;
32     char *indicator;
33     char *identifier;
34     char *data;
35     
36     a = iso2709_a_mk (rec);
37     do
38     {
39         if (!iso2709_a_info_line (a, &tag, &indicator))
40             break;
41         fprintf (out, "%s", tag);
42         if (indicator)
43             fprintf (out, " %s", indicator);
44         do
45         {
46             iso2709_a_info_field (a, NULL, NULL, &identifier, &data);
47             if (identifier)
48                 fprintf (out, " $%s", identifier);
49             fprintf (out, " %s", data);
50         } while (iso2709_a_next_field (a));
51         fprintf (out, "\n");
52     } while (iso2709_a_next_line(a));
53 }
54