64 #define YAZ_MARC_LINE 0
66 #define YAZ_MARC_SIMPLEXML 1
68 #define YAZ_MARC_OAIMARC 2
70 #define YAZ_MARC_MARCXML 3
72 #define YAZ_MARC_ISO2709 4
74 #define YAZ_MARC_XCHANGE 5
76 #define YAZ_MARC_CHECK 6
78 #define YAZ_MARC_TURBOMARC 7
80 #define YAZ_MARC_JSON 8
106 const char **result,
size_t *rsize);
133 YAZ_EXPORT
int atoi_n(
const char *buf,
int len);
146 #define ISO2709_RS 035
148 #define ISO2709_FS 036
150 #define ISO2709_IDFS 037
162 const char *buf,
int bsize);
177 int (*getbyte)(
void *client_data),
178 void (*ungetbyte)(
int b,
void *client_data),
300 int *indicator_length,
301 int *identifier_length,
303 int *length_data_entry,
304 int *length_starting,
305 int *length_implementation);
329 const char *code_data,
size_t code_data_len);
340 const char *data,
size_t data_len);
351 const xmlNode *ptr_data);
360 const xmlNode *ptr_data);
371 const char *indicator,
size_t indicator_len);
382 const char *indicator,
size_t indicator_len);
465 const char *buf_in,
size_t size_in,
496 const char *marc_buf,
int sz);
int yaz_marc_leader_spec(yaz_marc_t mt, const char *leader_spec)
sets leader spec (for modifying bytes in 24 byte leader)
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
int yaz_marc_read_iso2709(yaz_marc_t mt, const char *buf, int bsize)
read ISO2709/MARC record from buffer
int yaz_marc_write_mode(yaz_marc_t mt, WRBUF wrbuf)
writes record in mode - given by yaz_marc_xml mode
int atoi_n_check(const char *buf, int size, int *val)
like atoi_n but checks for proper formatting
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_read_xml(yaz_marc_t mt, const xmlNode *ptr)
parses MARCXML/MarcXchange/TurboMARC record from xmlNode pointer
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_opac_decode_wrbuf2(yaz_marc_t mt, Z_OPACRecord *r, WRBUF wrbuf, yaz_iconv_t cd)
Performs "pretty" display of OPAC record to WRBUF using marc_t.
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
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
int yaz_marc_write_iso2709(yaz_marc_t mt, WRBUF wrbuf)
writes record in ISO2709 format
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
void yaz_marc_set_leader(yaz_marc_t mt, const char *leader, 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_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_..)
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
int yaz_marc_read_json_node(yaz_marc_t mt, struct json_node *n)
int yaz_marc_decode_wrbuf(yaz_marc_t mt, const char *buf, int bsize, WRBUF wrbuf)
decodes ISO2709/MARC buffer and stores result in WRBUF
int yaz_marc_write_marcxml(yaz_marc_t mt, WRBUF wrbuf)
writes record in MARCXML format
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_turbomarc(yaz_marc_t mt, WRBUF wrbuf)
writes record in TurboMARC format
int yaz_opac_check_marc21_coding(const char *charset, Z_OPACRecord *r)
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
int yaz_marc_write_line(yaz_marc_t mt, WRBUF wrbuf)
writes record in line format
void yaz_marc_reset(yaz_marc_t mt)
clears memory and MARC record
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.
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 atoi_n(const char *buf, int len)
like atoi(3) except that it reads exactly len characters
int yaz_marc_write_trailer(yaz_marc_t mt, WRBUF wr)
flushes records
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.
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
struct yaz_marc_t_ * yaz_marc_t
a yaz_marc_t handle (private content)
void yaz_marc_debug(yaz_marc_t mt, int level)
set debug level
int yaz_marc_write_marcxchange(yaz_marc_t mt, WRBUF wrbuf, const char *format, const char *type)
writes record in MarcXchange XML (ISO25577)
Header for Nibble Memory functions.
the internals of a yaz_marc_t handle
Header for WRBUF (growing buffer)
Define xmlNode and xmlDocPtr if Libxml2 is present.
Header with fundamental macros.
ASN.1 Module RecordSyntax-opac.