X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=include%2Fyaz%2Fmarcdisp.h;h=0b2b66b1fd748bf638698375f74a966729335da8;hb=574ae68dc570706b4468b29e82681efe15bc7180;hp=e2f9e2111927f1106ed3c768024f76664139b318;hpb=5242cb5a8634bfa38b9333ff7f903e718ac6e292;p=yaz-moved-to-github.git diff --git a/include/yaz/marcdisp.h b/include/yaz/marcdisp.h index e2f9e21..0b2b66b 100644 --- a/include/yaz/marcdisp.h +++ b/include/yaz/marcdisp.h @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2012 Index Data. + * Copyright (C) 1995-2013 Index Data. * All rights reserved. * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -76,6 +76,8 @@ YAZ_EXPORT void yaz_marc_xml(yaz_marc_t mt, int xmlmode); #define YAZ_MARC_CHECK 6 /** \brief Output format: Turbo MARC Index Data format (XML based) */ #define YAZ_MARC_TURBOMARC 7 +/** \brief Output format: JSON */ +#define YAZ_MARC_JSON 8 /** \brief set iconv handle for character set conversion */ YAZ_EXPORT void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd); @@ -438,6 +440,24 @@ YAZ_EXPORT void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, YAZ_EXPORT void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf, yaz_iconv_t cd); +#if YAZ_HAVE_XML2 +/** \brief Converts XML to OPAC + \param mt marc handle + \param buf_in XML buffer + \param size_in size of XML buffer + \param dst Z39.50 OPAC result - allocated by NMEM on marc handle + \param cd iconv handle for the OPAC content (not ISO2709 part) + \param nmem memory for OPACRecord (if NULL, mt NMEM memory is used) + \param syntax OID for embedded MARC (if NULL, USMARC is used) + \retval 1 conversion OK + \retval 0 conversion NOT OK + \*/ +YAZ_EXPORT int yaz_xml_to_opac(yaz_marc_t mt, + const char *buf_in, size_t size_in, + Z_OPACRecord **dst, yaz_iconv_t cd, + NMEM nmem, const Odr_oid *syntax); +#endif + /** \brief flushes records \param mt handle \param wr WRBUF for output