X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=marc.c;h=6322dc609049803cadcc864b49358edf478e129a;hb=ed6b88adb8132f4668c60113532d5c2da34523e7;hp=04d497fb16a5159d12524958849f3fc4545b7cba;hpb=06c9c5c547ac216c72d12b0d9b3539b9038d8a05;p=ir-tcl-moved-to-github.git diff --git a/marc.c b/marc.c index 04d497f..6322dc6 100644 --- a/marc.c +++ b/marc.c @@ -1,10 +1,18 @@ /* * IR toolkit for tcl/tk * (c) Index Data 1995 + * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: marc.c,v $ - * Revision 1.1 1995-05-26 08:54:19 adam + * Revision 1.3 1995-05-29 08:44:26 adam + * Work on delete of objects. + * + * Revision 1.2 1995/05/26 11:44:11 adam + * Bugs fixed. More work on MARC utilities and queries. Test + * client is up-to-date again. + * + * Revision 1.1 1995/05/26 08:54:19 adam * New MARC utilities. Uses prefix query. * */ @@ -20,7 +28,7 @@ #define ISO2709_FS 036 #define ISO2709_IDFS 037 -int atoi_n (const char *buf, int len) +static int atoi_n (const char *buf, int len) { int val = 0; @@ -49,8 +57,6 @@ static int marc_compare (const char *f, const char *p) return *f - *p; } -FILE *outf = stderr; - char *ir_tcl_fread_marc (FILE *inf, size_t *size) { char length[5]; @@ -84,11 +90,13 @@ int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf, int length_data_entry; int length_starting; int length_implementation; + char ptag[4]; int mode = 0; + *ptag = '\0'; if (!strcmp (argv[3], "field")) mode = 'f'; - else if (!strcmp (argv[3], "lines")) + else if (!strcmp (argv[3], "lines") || !strcmp (argv[3], "list")) mode = 'l'; else { @@ -142,9 +150,10 @@ int ir_tcl_get_marc (Tcl_Interp *interp, const char *buf, continue; while (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS && i < end_offset) { + int i0; + if (memcmp (tag, "00", 2) && identifier_length) { - int i0; i++; for (j = 1; j