+ This function ONLY affects yaz_marc_write_mode, yaz_marc_write_trailer.
+*/
+YAZ_EXPORT void yaz_marc_xml(yaz_marc_t mt, int xmlmode);
+
+/** \brief Output format: Line-format */
+#define YAZ_MARC_LINE 0
+/** \brief Output format: simplexml (no longer supported) */
+#define YAZ_MARC_SIMPLEXML 1
+/** \brief Output format: OAI-MARC (no longer supported) */
+#define YAZ_MARC_OAIMARC 2
+/** \brief Output format: MARCXML */
+#define YAZ_MARC_MARCXML 3
+/** \brief Output format: ISO2709 */
+#define YAZ_MARC_ISO2709 4
+/** \brief Output format: MarcXchange (ISO25577) */
+#define YAZ_MARC_XCHANGE 5
+/** \brief Output format: check only (no marc output) */
+#define YAZ_MARC_CHECK 6
+/** \brief Output format: Turbo MARC Index Data format (XML based) */
+#define YAZ_MARC_TURBOMARC 7
+
+/** \brief set iconv handle for character set conversion */
+YAZ_EXPORT void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd);
+
+/** \brief supply iconv handle for character set conversion */
+YAZ_EXPORT yaz_iconv_t yaz_marc_get_iconv(yaz_marc_t mt);
+
+/** \brief set debug level
+ \param mt handle
+ \param level level, where 0=lowest, 1 more debug, 2 even more
+*/
+YAZ_EXPORT void yaz_marc_debug(yaz_marc_t mt, int level);
+
+/** \brief decodes ISO2709 buffer using straight buffers
+ \param mt marc handle
+ \param buf input buffer
+ \param bsize size of buffer or (-1 if "any size")
+ \param result result to be stored here
+ \param rsize size of result (memory "owned" by yaz_marc_mt handle)
+
+ Decodes MARC in buf of size bsize.
+ On success, result in *result with size *rsize.
+ Returns -1 on error, or size of input record (>0) if OK
+*/
+YAZ_EXPORT int yaz_marc_decode_buf(yaz_marc_t mt, const char *buf, int bsize,
+ const char **result, size_t *rsize);
+
+/** \brief decodes ISO2709/MARC buffer and stores result in WRBUF
+ \param mt handle
+ \param buf input buffer
+ \param bsize size of buffer (-1 if "any size")
+ \param wrbuf WRBUF for output
+
+ Decodes MARC in buf of size bsize.
+ On success, result in wrbuf
+ Returns -1 on error, or size of input record (>0) if OK
+*/
+YAZ_EXPORT int yaz_marc_decode_wrbuf(yaz_marc_t mt, const char *buf,
+ int bsize, WRBUF wrbuf);
+
+YAZ_EXPORT void yaz_marc_subfield_str(yaz_marc_t mt, const char *s);
+YAZ_EXPORT void yaz_marc_endline_str(yaz_marc_t mt, const char *s);
+
+/** \brief modifies part of the MARC leader */
+YAZ_EXPORT void yaz_marc_modify_leader(yaz_marc_t mt, size_t off,
+ const char *str);
+
+/** \brief like atoi(3) except that it reads exactly len characters
+ \param buf buffer to read
+ \param len number of bytes to consider (being digits)
+ \returns value
+ */
+YAZ_EXPORT int atoi_n(const char *buf, int len);
+
+/** \brief like atoi_n but checks for proper formatting
+ \param buf buffer to read values from
+ \param size size of buffer
+ \param val value of decimal number (if successful)
+ \retval 0 no value found (non-digits found)
+ \retval 1 value found and *val holds value
+*/
+YAZ_EXPORT
+int atoi_n_check(const char *buf, int size, int *val);
+
+/** \brief MARC control char: record separator (29 Dec, 1D Hex) */