* Copyright (C) 1995-2005, Index Data ApS
* See the file LICENSE for details.
*
- * $Id: marcdisp.c,v 1.19 2005-03-06 21:27:09 adam Exp $
+ * $Id: marcdisp.c,v 1.22 2005-06-07 19:25:38 adam Exp $
*/
/**
{
char str[40];
- if (mt->xml)
- wrbuf_puts (wr, "<!--\n");
+ wrbuf_puts (wr, "<!--\n");
sprintf (str, "Record length %5d\n", record_length);
wrbuf_puts (wr, str);
sprintf (str, "Indicator length %5d\n", indicator_length);
wrbuf_puts (wr, str);
sprintf (str, "Length implementation %5d\n", length_implementation);
wrbuf_puts (wr, str);
- if (mt->xml)
- wrbuf_puts (wr, "-->\n");
+ wrbuf_puts (wr, "-->\n");
}
/* first pass. determine length of directory & base of data */
if (base_address != entry_p+1)
{
if (produce_warnings)
- wrbuf_printf (wr," <!-- Base address not at end of directory, "
+ wrbuf_printf (wr,"<!-- Base address not at end of directory, "
"base %d, end %d -->\n", base_address, entry_p+1);
}
if (mt->xml == YAZ_MARC_ISO2709)
switch(mt->xml)
{
case YAZ_MARC_LINE:
- if (mt->debug)
- wrbuf_puts (wr, "Tag: ");
wrbuf_puts (wr, tag);
wrbuf_puts (wr, " ");
break;
wrbuf_putc(wr, buf[i]);
break;
case YAZ_MARC_LINE:
- if (mt->debug)
- wrbuf_puts (wr, " Ind: ");
wrbuf_putc(wr, buf[i]);
break;
case YAZ_MARC_SIMPLEXML:
if (identifier_flag)
wrbuf_puts (wr, "\n");
}
- if (mt->xml == YAZ_MARC_LINE)
- {
- if (mt->debug)
- wrbuf_puts (wr, " Fields: ");
- }
if (identifier_flag)
{
while (i < end_offset &&
if (mt->xml == YAZ_MARC_LINE)
wrbuf_puts (wr, mt->endline_str);
if (i < end_offset)
- wrbuf_printf(wr, " <!-- separator but not at end of field length=%d-->\n", data_length);
+ wrbuf_printf(wr, "<!-- separator but not at end of field length=%d-->\n", data_length);
if (buf[i] != ISO2709_RS && buf[i] != ISO2709_FS)
- wrbuf_printf(wr, " <!-- no separator at end of field length=%d-->\n", data_length);
+ wrbuf_printf(wr, "<!-- no separator at end of field length=%d-->\n", data_length);
switch(mt->xml)
{
case YAZ_MARC_SIMPLEXML:
int yaz_marc_decode_buf (yaz_marc_t mt, const char *buf, int bsize,
char **result, int *rsize)
{
- int r = yaz_marc_decode_wrbuf(mt, buf, bsize, mt->m_wr);
+ int r;
+
+ wrbuf_rewind(mt->m_wr);
+ r = yaz_marc_decode_wrbuf(mt, buf, bsize, mt->m_wr);
if (result)
*result = wrbuf_buf(mt->m_wr);
if (rsize)