+/** \brief a yaz_marc_t handle (private content) */
+typedef struct yaz_marc_t_ *yaz_marc_t;
+
+/** \brief construct yaz_marc_t handle */
+YAZ_EXPORT yaz_marc_t yaz_marc_create(void);
+
+/** \brief destroy yaz_marc_t handle */
+YAZ_EXPORT void yaz_marc_destroy(yaz_marc_t mt);
+
+/** \brief set XML mode YAZ_MARC_LINE, YAZ_MARC_SIMPLEXML, ... */
+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 */
+#define YAZ_MARC_XCHANGE 5
+
+/** \brief supply iconv handle for character set conversion .. */
+YAZ_EXPORT void yaz_marc_iconv(yaz_marc_t mt, yaz_iconv_t cd);
+
+/** \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 (allocate before use!)
+ \param rsize size of result (set before calling)
+
+ 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,
+ char **result, int *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);
+
+/** \brief depricated */
+YAZ_EXPORT int marc_display(const char *buf, FILE *outf);
+/** \brief depricated */
+YAZ_EXPORT int marc_display_ex(const char *buf, FILE *outf, int debug);
+/** \brief depricated */
+YAZ_EXPORT int marc_display_exl(const char *buf, FILE *outf, int debug,
+ int length);
+/** \brief depricated */
+YAZ_EXPORT int marc_display_wrbuf(const char *buf, WRBUF wr, int debug,
+ int bsize);
+/** \brief depricated */
+YAZ_EXPORT int yaz_marc_decode(const char *buf, WRBUF wr,
+ int debug, int bsize, int xml);
+
+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 */
+YAZ_EXPORT int atoi_n(const char *buf, int len);