Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/yaz
[yaz-moved-to-github.git] / src / opacdisp.c
index ad8113e..807ca2b 100644 (file)
@@ -1,11 +1,14 @@
 /* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2009 Index Data
+ * Copyright (C) 1995-2011 Index Data
  * See the file LICENSE for details.
  */
 /**
  * \file opacdisp.c
  * \brief Implements OPAC record display
  */
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
 
 #include <stdio.h>
 #include <string.h>
@@ -49,10 +52,10 @@ static void opac_element_bool(WRBUF wrbuf, int l, const char *elem, int *data)
     }
 }
 
-void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf)
+void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf,
+                            yaz_iconv_t cd)
 {
     int i;
-    yaz_iconv_t cd = yaz_marc_get_iconv(mt);
 
     wrbuf_puts(wrbuf, "<opacRecord>\n");
     if (r->bibliographicRecord)
@@ -160,18 +163,15 @@ void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf)
     wrbuf_puts(wrbuf, "</opacRecord>\n");
 }
 
-void yaz_display_OPAC(WRBUF wrbuf, Z_OPACRecord *opac_rec, int flags)
+void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf)
 {
-    yaz_marc_t mt = yaz_marc_create();
-
-    yaz_marc_xml(mt, YAZ_MARC_MARCXML);
-    yaz_opac_decode_wrbuf(mt, opac_rec, wrbuf);
-    yaz_marc_destroy(mt);
+    yaz_opac_decode_wrbuf2(mt, r, wrbuf, yaz_marc_get_iconv(mt));
 }
 
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab