#include <stddef.h>
#include <yaz/wrbuf.h>
#include <yaz/yconfig.h>
#include <yaz/xmltypes.h>
#include <yaz/z-opac.h>
Go to the source code of this file.
Typedefs | |
| typedef struct yaz_record_conv_struct * | yaz_record_conv_t |
Functions | |
| yaz_record_conv_t | yaz_record_conv_create (void) |
| void | yaz_record_conv_destroy (yaz_record_conv_t p) |
| int | yaz_record_conv_configure (yaz_record_conv_t p, const xmlNode *node) |
| int | yaz_record_conv_record (yaz_record_conv_t p, const char *input_record_buf, size_t input_record_len, WRBUF output_record) |
| int | yaz_record_conv_opac_record (yaz_record_conv_t p, Z_OPACRecord *input_record, WRBUF output_record) |
| const char * | yaz_record_conv_get_error (yaz_record_conv_t p) |
| void | yaz_record_conv_set_path (yaz_record_conv_t p, const char *path) |
Definition in file record_conv.h.
| typedef struct yaz_record_conv_struct* yaz_record_conv_t |
record conversion handle
Definition at line 45 of file record_conv.h.
| int yaz_record_conv_configure | ( | yaz_record_conv_t | p, | |
| const xmlNode * | node | |||
| ) |
configures record conversion
| p | record conversion handle | |
| node | xmlNode pointer (root element of XML config) |
| 0 | success | |
| -1 | failure |
<backend syntax='xml'>
<xslt stylesheet="dc2marcxml.xsl"/>
<marc inputformat="xml" outputformat="marcxml" outputcharset="marc-8"/>
</backend>
<backend syntax='usmarc' name='F'>
<marc inputformat="marc" outputformat="marcxml" inputcharset="marc-8"/>
<xslt stylesheet="marcxml2mods.xsl"/>
<xslt stylesheet="mods2dc.xsl"/>
</backend>
Definition at line 360 of file record_conv.c.
References yaz_record_conv_struct::wr_error, and wrbuf_printf().
| yaz_record_conv_t yaz_record_conv_create | ( | void | ) |
creates record handle
Definition at line 106 of file record_conv.c.
References yaz_record_conv_struct::nmem, nmem_create(), yaz_record_conv_struct::path, yaz_record_conv_struct::rules, yaz_record_conv_struct::wr_error, wrbuf_alloc(), and xmalloc.
| void yaz_record_conv_destroy | ( | yaz_record_conv_t | p | ) |
destroys record handle
| p | record conversion handle |
Definition at line 121 of file record_conv.c.
References yaz_record_conv_struct::nmem, nmem_destroy(), yaz_record_conv_struct::path, yaz_record_conv_struct::wr_error, wrbuf_destroy(), and xfree.
| const char* yaz_record_conv_get_error | ( | yaz_record_conv_t | p | ) |
returns error string (for last error)
| p | record conversion handle |
Definition at line 562 of file record_conv.c.
References yaz_record_conv_struct::wr_error, and wrbuf_cstr().
| int yaz_record_conv_opac_record | ( | yaz_record_conv_t | p, | |
| Z_OPACRecord * | input_record, | |||
| WRBUF | output_record | |||
| ) |
performs record conversion on OPAC record
| p | record conversion handle | |
| input_record | Z39.50 OPAC record | |
| output_record | resultint record (WRBUF string) |
| 0 | success | |
| -1 | failure |
Definition at line 396 of file record_conv.c.
References yaz_record_conv_rule::marc, yaz_record_conv_rule::next, yaz_record_conv_struct::rules, yaz_record_conv_rule::u, yaz_record_conv_rule::which, yaz_record_conv_struct::wr_error, wrbuf_alloc(), wrbuf_buf, wrbuf_destroy(), wrbuf_len, wrbuf_rewind(), yaz_iconv_close(), yaz_iconv_open(), yaz_marc_create(), yaz_marc_destroy(), yaz_marc_iconv(), yaz_marc_xml(), yaz_opac_decode_wrbuf(), and YAZ_RECORD_CONV_RULE_MARC.
| int yaz_record_conv_record | ( | yaz_record_conv_t | p, | |
| const char * | input_record_buf, | |||
| size_t | input_record_len, | |||
| WRBUF | output_record | |||
| ) |
performs record conversion on record buffer (OCTET aligned)
| p | record conversion handle | |
| input_record_buf | input record buffer | |
| input_record_len | length of input record buffer | |
| output_record | resultint record (WRBUF string) |
| 0 | success | |
| -1 | failure |
Definition at line 432 of file record_conv.c.
References yaz_record_conv_struct::rules.
| void yaz_record_conv_set_path | ( | yaz_record_conv_t | p, | |
| const char * | path | |||
| ) |
set path for opening stylesheets etc.
| p | record conversion handle | |
| path | file path (UNIX style with : / Windows with ;) |
Definition at line 567 of file record_conv.c.
References yaz_record_conv_struct::path, xfree, and xstrdup.
1.5.6