Europagate, 1994-1995.
$Log: iso2709.h,v $
- Revision 1.2 1995/02/10 16:50:25 adam
- Indicator field moved to 'struct iso2709_dir' from 'struct
- iso2709_field'.
- Function iso2709_rm implemented - to delete a MARC record.
+ Revision 1.3 1995/02/10 17:05:14 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:25 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:12 adam
* Initial version of email gateway under CVS control.
*
char *iso2709_read (FILE *inf);
Iso2709Rec iso2709_cvt (const char *buf);
void iso2709_rm (Iso2709Rec rec);
+void iso2709_display (Iso2709Rec rec, FILE *out);
#endif
# Europagate, 1995
#
# $Log: Makefile,v $
-# Revision 1.1 1995/02/09 17:27:10 adam
-# Initial revision
+# Revision 1.2 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.1.1.1 1995/02/09 17:27:11 adam
+# Initial version of email gateway under CVS control.
#
SHELL=/bin/sh
INCLUDE=-I../include
CC=gcc
TPROG1=iso2709dump
LIB=../lib/util.a
-PO=iso2709.o
+PO=iso2709.o iso27dis.o
CPP=cc -E
DEFS=$(INCLUDE)
/*
- gw-res.c: Iso2709 record management
+ Iso2709 record management
Europagate, 1994-1995.
$Log: iso2709.c,v $
- Revision 1.2 1995/02/10 16:50:32 adam
- Indicator field moved to 'struct iso2709_dir' from 'struct
- iso2709_field'.
- Function iso2709_rm implemented - to delete a MARC record.
-
+ 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:32 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.
*
}
pos++;
/* deal with datafields */
-#if 0
- fprintf (stderr, "indicator_len=%d, identifier_len=%d\n",
- p->indicator_length, p->identifier_length);
-#endif
for (dp = p->directory; dp; dp = dp->next)
{
int tag00;
tag00 = 0;
else
tag00 = 1;
- fprintf (stderr, "%s", dp->tag);
- if (dp->indicator)
- fprintf (stderr, " %s", dp->indicator);
while (1)
{
int dpos_n;
strncpyx ((*fpp)->data, buf+dpos, dpos_n - dpos);
dpos = dpos_n;
- if ((*fpp)->identifier)
- fprintf (stderr, " *%s", (*fpp)->identifier);
- fprintf (stderr, " %s", (*fpp)->data);
if (buf[dpos] == ISO2709_FS)
break;
*fpp = malloc (sizeof(**fpp));
(*fpp)->next = NULL;
}
- fprintf (stderr, "\n");
}
return p;
}
/*
- gw-res.c: Iso2709 record management
+ 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.
+ 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.
*
while ((buf = iso2709_read (stdin)))
{
rec = iso2709_cvt (buf);
+ iso2709_display (rec, stderr);
free (buf);
iso2709_rm (rec);
}
--- /dev/null
+/*
+ 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.
+
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include <iso2709p.h>
+
+void iso2709_display (Iso2709Rec rec, FILE *out)
+{
+ struct iso2709_dir *dir;
+
+ for (dir = rec->directory; dir; dir = dir->next)
+ {
+ 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 (field->identifier)
+ fprintf (out, " $%s", field->identifier);
+ fprintf (out, " %s", field->data);
+ }
+ fprintf (out, "\n");
+ }
+}