-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 mdoc_list_pre(MDOC_ARGS);
-static int mdoc_root_pre(MDOC_ARGS);
-static int mdoc_hang_pre(MDOC_ARGS);
-
-static int mdoc_ar_pre(MDOC_ARGS);
-static int mdoc_bl_pre(MDOC_ARGS);
-static int mdoc_fl_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 int mdoc_op_pre(MDOC_ARGS);
-static void mdoc_op_post(MDOC_ARGS);
-static int mdoc_pp_pre(MDOC_ARGS);
-static int mdoc_sh_pre(MDOC_ARGS);
-static int mdoc_ss_pre(MDOC_ARGS);
-static int mdoc_xr_pre(MDOC_ARGS);
-static int mdoc_xx_pre(MDOC_ARGS);
-
-#ifdef __linux__
-extern size_t strlcpy(char *, const char *, size_t);
-extern size_t strlcat(char *, const char *, size_t);
-#endif
+static void bufncat(struct html *, const char *, size_t);
+static void print_ctag(struct html *, enum htmltag);
+static int print_encode(struct html *, const char *, int);
+static void print_metaf(struct html *, enum mandoc_esc);
+static void print_attr(struct html *, const char *, const char *);
+static void *ml_alloc(char *, enum htmltype);