* See the file LICENSE for details.
*
* $Log: marcdisp.c,v $
- * Revision 1.13 2001-10-15 19:36:48 adam
+ * Revision 1.16 2002-01-22 10:54:46 adam
+ * MARC decode fix. Attribute set fix for scan in server. Prox logging.
+ *
+ * Revision 1.15 2001/10/29 09:17:19 adam
+ * New function marc_display_exl - used by YAZ client. Server returns
+ * bad record on position 98 (for testing).
+ *
+ * Revision 1.14 2001/10/23 21:00:20 adam
+ * Old Z39.50 codecs gone. Added ZOOM. WRBUF MARC display util.
+ *
+ * Revision 1.13 2001/10/15 19:36:48 adam
* New function marc_display_wrbuf.
*
* Revision 1.12 2000/10/02 11:07:44 adam
#include <yaz/wrbuf.h>
#include <yaz/yaz-util.h>
-int marc_display_wrbuf (const char *buf, WRBUF wr, int debug)
+int marc_display_wrbuf (const char *buf, WRBUF wr, int debug,
+ int bsize)
{
int entry_p;
int record_length;
}
return -1;
}
+ /* ballout if bsize is known and record_length is than that */
+ if (bsize != -1 && record_length > bsize)
+ return -1;
if (isdigit(buf[10]))
indicator_length = atoi_n (buf+10, 1);
else
identifier_length = atoi_n (buf+11, 1);
else
identifier_length = 2;
- base_address = atoi_n (buf+12, 4);
+ base_address = atoi_n (buf+12, 5);
length_data_entry = atoi_n (buf+20, 1);
length_starting = atoi_n (buf+21, 1);
return record_length;
}
-int marc_display_ex (const char *buf, FILE *outf, int debug)
+int marc_display_exl (const char *buf, FILE *outf, int debug, int length)
{
int record_length;
WRBUF wrbuf = wrbuf_alloc ();
- record_length = marc_display_wrbuf (buf, wrbuf, debug);
+ record_length = marc_display_wrbuf (buf, wrbuf, debug, length);
if (!outf)
outf = stdout;
if (record_length > 0)
return record_length;
}
+
+int marc_display_ex (const char *buf, FILE *outf, int debug)
+{
+ return marc_display_exl (buf, outf, debug, -1);
+}
+
int marc_display (const char *buf, FILE *outf)
{
return marc_display_ex (buf, outf, 0);