-
-#define MAXINDENT 8
-#define COLUMNS 72
-
-#ifdef __linux__ /* FIXME */
-#define strlcat strncat
-#endif
-
-enum md_ns {
- MD_NS_BLOCK,
- MD_NS_INLINE,
- MD_NS_DEFAULT
-};
-
-enum md_tok {
- MD_BLKIN,
- MD_BLKOUT,
- MD_IN,
- MD_OUT,
- MD_TEXT,
- MD_OVERRIDE
-};
-
-struct md_xml {
- const struct md_args *args;
- const struct md_rbuf *rbuf;
-
- struct md_mbuf *mbuf;
- struct rofftree *tree;
- size_t indent;
- size_t pos;
- enum md_tok last;
- int flags;
-#define MD_LITERAL (1 << 0) /* FIXME */
-};
-
-static void roffmsg(void *arg, enum roffmsg,
- const char *, const char *, char *);
-static int roffhead(void *);
-static int rofftail(void *);
-static int roffin(void *, int, int *, char **);
-static int roffdata(void *, int, char *);
-static int roffout(void *, int);
-static int roffblkin(void *, int, int *, char **);
-static int roffblkout(void *, int);
-static int roffspecial(void *, int);
-
-static int mbuf_newline(struct md_xml *);
-static int mbuf_indent(struct md_xml *);
-static int mbuf_data(struct md_xml *, int, char *);
-static int mbuf_putstring(struct md_xml *,
- const char *);
-static int mbuf_nputstring(struct md_xml *,
+#include "ml.h"
+
+
+static int xml_alloc(void **);
+static void xml_free(void *);
+static ssize_t xml_endtag(struct md_mbuf *, void *,
+ const struct md_args *,
+ enum md_ns, int);
+static ssize_t xml_begintag(struct md_mbuf *, void *,
+ const struct md_args *,
+ enum md_ns, int,
+ const int *, const char **);
+static ssize_t xml_beginstring(struct md_mbuf *,
+ const struct md_args *,