X-Git-Url: http://lists.indexdata.dk/cgi-bin?a=blobdiff_plain;f=util%2Fiso27dis.c;h=437e497a49413381a59ffda603a84dc9bb82c117;hb=498946306c461b20d24308aae074bf43f6050698;hp=b0cfa109dd8aab26eecba6f9e38223520463bbdc;hpb=c225f9c0b0d280dedb06939fb68a1cb06c74a3c0;p=egate.git diff --git a/util/iso27dis.c b/util/iso27dis.c index b0cfa10..437e497 100644 --- a/util/iso27dis.c +++ b/util/iso27dis.c @@ -1,14 +1,20 @@ /* - Iso2709 record management - - Europagate, 1994-1995. - - $Log: iso27dis.c,v $ - Revision 1.1 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. - + * Iso2709 record management + * + * Europagate, 1994-1995. + * + * $Log: iso27dis.c,v $ + * Revision 1.4 1995/03/29 11:44:29 adam + * New functions: iso2709_a_.. for record manipulation. + * + * Revision 1.3 1995/02/22 21:32:36 adam + * Changed header. + * + * Revision 1.1 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. + * */ #include @@ -17,25 +23,32 @@ #include #include -#include +#include void iso2709_display (Iso2709Rec rec, FILE *out) { - struct iso2709_dir *dir; - - for (dir = rec->directory; dir; dir = dir->next) + Iso2709Anchor a; + char *tag; + char *indicator; + char *identifier; + char *data; + + a = iso2709_a_mk (rec); + do { - struct iso2709_field *field; - - fprintf (out, "%s", dir->tag); - if (dir->indicator) - fprintf (out, " %s", dir->indicator); - for (field = dir->fields; field; field = field->next) + if (!iso2709_a_info_line (a, &tag, &indicator)) + break; + fprintf (out, "%s", tag); + if (indicator) + fprintf (out, " %s", indicator); + do { - if (field->identifier) - fprintf (out, " $%s", field->identifier); - fprintf (out, " %s", field->data); - } + iso2709_a_info_field (a, NULL, NULL, &identifier, &data); + if (identifier) + fprintf (out, " $%s", identifier); + fprintf (out, " %s", data); + } while (iso2709_a_next_field (a)); fprintf (out, "\n"); - } + } while (iso2709_a_next_line(a)); } +