65#define YAZ_MARC_LINE 0
67#define YAZ_MARC_SIMPLEXML 1
69#define YAZ_MARC_OAIMARC 2
71#define YAZ_MARC_MARCXML 3
73#define YAZ_MARC_ISO2709 4
75#define YAZ_MARC_XCHANGE 5
77#define YAZ_MARC_CHECK 6
79#define YAZ_MARC_TURBOMARC 7
81#define YAZ_MARC_JSON 8
107 const char **result,
size_t *rsize);
130#define ISO2709_RS 035
132#define ISO2709_FS 036
134#define ISO2709_IDFS 037
146 const char *buf,
int bsize);
161 int (*getbyte)(
void *client_data),
162 void (*ungetbyte)(
int b,
void *client_data),
284 int *indicator_length,
285 int *identifier_length,
287 int *length_data_entry,
288 int *length_starting,
289 int *length_implementation);
313 const char *code_data,
size_t code_data_len);
324 const char *data,
size_t data_len);
335 const xmlNode *ptr_data);
344 const xmlNode *ptr_data);
355 const char *indicator,
size_t indicator_len);
366 const char *indicator,
size_t indicator_len);
449 const char *buf_in,
size_t size_in,
480 const char *marc_buf,
int sz);
ASCII to integer conversion.
int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
read ISO2709/MARC record from buffer
int yaz_marc_read_json_node(yaz_marc_t mt, struct json_node *n)
int yaz_marc_read_line(yaz_marc_t mt, int(*getbyte)(void *client_data), void(*ungetbyte)(int b, void *client_data), void *client_data)
read MARC lineformat from stream
int yaz_marc_read_xml(yaz_marc_t mt, const xmlNode *ptr)
parses MARCXML/MarcXchange/TurboMARC record from xmlNode pointer
int yaz_marc_leader_spec(yaz_marc_t mt, const char *leader_spec)
sets leader spec (for modifying bytes in 24 byte leader)
int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wr)
writes record in ISO2709 format
void yaz_marc_add_controlfield_xml(yaz_marc_t mt, const xmlNode *ptr_tag, const xmlNode *ptr_data)
adds controlfield to MARC structure using xml Nodes
void yaz_marc_cprintf(yaz_marc_t mt, const char *fmt,...)
adds MARC annotation - printf interface
int yaz_marc_check_marc21_coding(const char *charset, const char *marc_buf, int sz)
check if MARC21 is UTF-8 encoded
yaz_marc_t yaz_marc_create(void)
construct yaz_marc_t handle
int yaz_marc_write_line(yaz_marc_t mt, WRBUF wr)
writes record in line format
size_t yaz_marc_sizeof_char(yaz_marc_t mt, const char *buf)
void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd)
set iconv handle for character set conversion
void yaz_marc_xml(yaz_marc_t mt, int xmlmode)
set XML mode YAZ_MARC_LINE, YAZ_MARCXML, YAZ_MARC_ISO2709 ..
void yaz_marc_add_subfield(yaz_marc_t mt, const char *code_data, size_t code_data_len)
adds subfield to MARC structure
void yaz_marc_add_datafield_xml(yaz_marc_t mt, const xmlNode *ptr_tag, const char *indicator, size_t indicator_len)
adds datafield to MARC structure using xml Nodes
void yaz_marc_write_using_libxml2(yaz_marc_t mt, int enable)
Enables or disables writing of MARC XML records using Libxml2.
NMEM yaz_marc_get_nmem(yaz_marc_t mt)
returns memory for MARC handle
void yaz_marc_endline_str(yaz_marc_t mt, const char *s)
int yaz_marc_get_debug(yaz_marc_t mt)
gets debug level for MARC system
int yaz_marc_write_turbomarc(yaz_marc_t mt, WRBUF wr)
writes record in TurboMARC format
void yaz_marc_add_datafield(yaz_marc_t mt, const char *tag, const char *indicator, size_t indicator_len)
adds datafield to MARC structure using strings
void yaz_marc_add_datafield_xml2(yaz_marc_t mt, char *tag_value, char *indicators)
adds datafield to MARC structure using xml Nodes
void yaz_marc_modify_leader(yaz_marc_t mt, size_t off, const char *str)
modifies part of the MARC leader
int yaz_marc_write_xml(yaz_marc_t mt, xmlNode **root_ptr, const char *ns, const char *format, const char *type)
writes MARC record as libxml2 tree
int yaz_marc_decode_formatstr(const char *arg)
Converts MARC format type to format type(YAZ_MARC_..).
int yaz_marc_write_marcxml(yaz_marc_t mt, WRBUF wr)
writes record in MARCXML format
void yaz_marc_subfield_str(yaz_marc_t mt, const char *s)
yaz_iconv_t yaz_marc_get_iconv(yaz_marc_t mt)
supply iconv handle for character set conversion
void yaz_marc_destroy(yaz_marc_t mt)
destroy yaz_marc_t handle
void yaz_marc_set_leader(yaz_marc_t mt, const char *leader_c, int *indicator_length, int *identifier_length, int *base_address, int *length_data_entry, int *length_starting, int *length_implementation)
sets leader, validates it, and returns important values
void yaz_marc_add_controlfield_xml2(yaz_marc_t mt, char *tag, const xmlNode *ptr_data)
adds controlfield to MARC structure using xml Nodes for data
int yaz_marc_write_mode(yaz_marc_t mt, WRBUF wr)
writes record in mode - given by yaz_marc_xml mode
void yaz_marc_add_controlfield(yaz_marc_t mt, const char *tag, const char *data, size_t data_len)
adds controlfield to MARC structure
void yaz_marc_add_comment(yaz_marc_t mt, char *comment)
adds MARC comment string
void yaz_marc_reset(yaz_marc_t mt)
clears memory and MARC record
int yaz_marc_write_marcxchange(yaz_marc_t mt, WRBUF wr, const char *format, const char *type)
writes record in MarcXchange XML (ISO25577)
int yaz_marc_write_json(yaz_marc_t mt, WRBUF w)
writes MARC record in JSON represenation
void yaz_marc_enable_collection(yaz_marc_t mt)
enables record collection output
int yaz_marc_write_trailer(yaz_marc_t mt, WRBUF wr)
flushes records
int yaz_marc_decode_buf(yaz_marc_t mt, const char *buf, int bsize, const char **result, size_t *rsize)
decodes ISO2709 buffer using straight buffers
void yaz_marc_debug(yaz_marc_t mt, int level)
set debug level
int yaz_marc_decode_wrbuf(yaz_marc_t mt, const char *buf, int bsize, WRBUF wr)
decodes ISO2709/MARC buffer and stores result in WRBUF
struct yaz_marc_t_ * yaz_marc_t
a yaz_marc_t handle (private content)
Header for Nibble Memory functions.
struct nmem_control * NMEM
NMEM handle (an opaque pointer to memory).
int yaz_opac_check_marc21_coding(const char *charset, Z_OPACRecord *r)
void yaz_opac_decode_wrbuf(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf)
Performs "pretty" display of OPAC record to WRBUF using marc_t.
void yaz_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf, yaz_iconv_t cd2)
Performs "pretty" display of OPAC record to WRBUF using marc_t.
the internals of a yaz_marc_t handle
Header for WRBUF (growing buffer).
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)
Converts XML to OPAC.
Define xmlNode and xmlDocPtr if Libxml2 is present.
struct yaz_iconv_struct * yaz_iconv_t
yaz_iconv handle (similar to iconv_t)
Header with fundamental macros.
ASN.1 Module RecordSyntax-opac.