+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);
+ if (r > 0)
+ {
+ if (result)
+ *result = wrbuf_buf(mt->m_wr);
+ if (rsize)
+ *rsize = wrbuf_len(mt->m_wr);
+ }
+ return r;
+}
+
+void yaz_marc_xml(yaz_marc_t mt, int xmlmode)
+{
+ if (mt)
+ mt->xml = xmlmode;
+}
+
+void yaz_marc_debug(yaz_marc_t mt, int level)
+{
+ if (mt)
+ mt->debug = level;
+}
+
+/* depricated */
+int yaz_marc_decode(const char *buf, WRBUF wr, int debug, int bsize, int xml)
+{
+ yaz_marc_t mt = yaz_marc_create();
+ int r;
+
+ mt->debug = debug;
+ mt->xml = xml;
+ r = yaz_marc_decode_wrbuf(mt, buf, bsize, wr);
+ yaz_marc_destroy(mt);
+ return r;
+}
+
+/* depricated */
+int marc_display_wrbuf (const char *buf, WRBUF wr, int debug, int bsize)
+{
+ return yaz_marc_decode(buf, wr, debug, bsize, 0);
+}
+
+/* depricated */
+int marc_display_exl (const char *buf, FILE *outf, int debug, int bsize)
+{
+ yaz_marc_t mt = yaz_marc_create();
+ int r;
+
+ mt->debug = debug;
+ r = yaz_marc_decode_wrbuf (mt, buf, bsize, mt->m_wr);
+ if (!outf)
+ outf = stdout;
+ if (r > 0)
+ fwrite (wrbuf_buf(mt->m_wr), 1, wrbuf_len(mt->m_wr), outf);
+ yaz_marc_destroy(mt);
+ return r;
+}
+
+/* depricated */
+int marc_display_ex (const char *buf, FILE *outf, int debug)
+{
+ return marc_display_exl (buf, outf, debug, -1);
+}
+
+/* depricated */
+int marc_display (const char *buf, FILE *outf)
+{
+ return marc_display_ex (buf, outf, 0);
+}
+