-struct htmlpair {
- enum htmlattr key;
- char *val;
-};
-
-struct tag {
- enum htmltag tag;
- SLIST_ENTRY(tag) entry;
-};
-
-struct ord {
- int pos;
- const void *cookie;
- SLIST_ENTRY(ord) entry;
-};
-
-SLIST_HEAD(tagq, tag);
-SLIST_HEAD(ordq, ord);
-
-struct html {
- int flags;
-#define HTML_NOSPACE (1 << 0)
-#define HTML_NEWLINE (1 << 1)
- struct tagq tags;
- struct ordq ords;
- void *symtab;
-};
-
-#define MDOC_ARGS const struct mdoc_meta *m, \
- const struct mdoc_node *n, \
- struct html *h
-#define MAN_ARGS const struct man_meta *m, \
- const struct man_node *n, \
- struct html *h
-struct htmlmdoc {
- int (*pre)(MDOC_ARGS);
- void (*post)(MDOC_ARGS);
-};
-
-static void print_gen_doctype(struct html *);
-static void print_gen_head(struct html *);
-static void print_mdoc(MDOC_ARGS);
-static void print_mdoc_head(MDOC_ARGS);
-static void print_mdoc_title(MDOC_ARGS);
-static void print_mdoc_node(MDOC_ARGS);
-static void print_man(MAN_ARGS);
-static void print_man_head(MAN_ARGS);
-static void print_man_body(MAN_ARGS);
-static struct tag *print_otag(struct html *, enum htmltag,
- int, const struct htmlpair *);
-static void print_tagq(struct html *, const struct tag *);
-static void print_stagq(struct html *, const struct tag *);
-static void print_ctag(struct html *, enum htmltag);
-static void print_encode(struct html *, const char *);
-static void print_escape(struct html *, const char **);
-static void print_text(struct html *, const char *);
-static void print_res(struct html *, const char *, int);
-static void print_spec(struct html *, const char *, int);
-
-static int a2width(const char *);
-static int a2offs(const char *);
-static int a2list(const struct mdoc_node *);
-
-static int mdoc_root_pre(MDOC_ARGS);
-static int mdoc_tbl_pre(MDOC_ARGS, int);
-static int mdoc_tbl_block_pre(MDOC_ARGS, int, int, int, int);
-static int mdoc_tbl_body_pre(MDOC_ARGS, int, int);
-static int mdoc_tbl_head_pre(MDOC_ARGS, int, int);
-
-static void mdoc_aq_post(MDOC_ARGS);
-static int mdoc_aq_pre(MDOC_ARGS);
-static int mdoc_ar_pre(MDOC_ARGS);
-static void mdoc_bl_post(MDOC_ARGS);
-static int mdoc_bl_pre(MDOC_ARGS);
-static int mdoc_d1_pre(MDOC_ARGS);
-static void mdoc_dq_post(MDOC_ARGS);
-static int mdoc_dq_pre(MDOC_ARGS);
-static int mdoc_fl_pre(MDOC_ARGS);
-static int mdoc_em_pre(MDOC_ARGS);
-static int mdoc_ex_pre(MDOC_ARGS);
-static int mdoc_it_pre(MDOC_ARGS);
-static int mdoc_nd_pre(MDOC_ARGS);
-static int mdoc_nm_pre(MDOC_ARGS);
-static int mdoc_ns_pre(MDOC_ARGS);
-static void mdoc_op_post(MDOC_ARGS);
-static int mdoc_op_pre(MDOC_ARGS);
-static int mdoc_pp_pre(MDOC_ARGS);
-static void mdoc_pq_post(MDOC_ARGS);
-static int mdoc_pq_pre(MDOC_ARGS);
-static int mdoc_sh_pre(MDOC_ARGS);
-static void mdoc_sq_post(MDOC_ARGS);
-static int mdoc_sq_pre(MDOC_ARGS);
-static int mdoc_ss_pre(MDOC_ARGS);
-static int mdoc_sx_pre(MDOC_ARGS);
-static int mdoc_xr_pre(MDOC_ARGS);
-static int mdoc_xx_pre(MDOC_ARGS);
-