+static size_t a2width(const struct mdoc_argv *, int);
+static size_t a2height(const struct mdoc_node *);
+static size_t a2offs(const struct mdoc_argv *);
+
+static int arg_hasattr(int, const struct mdoc_node *);
+static int arg_getattrs(const int *, int *, size_t,
+ const struct mdoc_node *);
+static int arg_getattr(int, const struct mdoc_node *);
+static int arg_listtype(const struct mdoc_node *);
+static void print_bvspace(struct termp *,
+ const struct mdoc_node *,
+ const struct mdoc_node *);
+static void print_mdoc_node(DECL_ARGS);
+static void print_mdoc_head(DECL_ARGS);
+static void print_mdoc_nodelist(DECL_ARGS);
+static void print_foot(DECL_ARGS);
+
+static void termp____post(DECL_ARGS);
+static void termp_an_post(DECL_ARGS);
+static void termp_aq_post(DECL_ARGS);
+static void termp_bd_post(DECL_ARGS);
+static void termp_bl_post(DECL_ARGS);
+static void termp_bq_post(DECL_ARGS);
+static void termp_brq_post(DECL_ARGS);
+static void termp_bx_post(DECL_ARGS);
+static void termp_d1_post(DECL_ARGS);
+static void termp_dq_post(DECL_ARGS);
+static void termp_fd_post(DECL_ARGS);
+static void termp_fn_post(DECL_ARGS);
+static void termp_fo_post(DECL_ARGS);
+static void termp_ft_post(DECL_ARGS);
+static void termp_in_post(DECL_ARGS);
+static void termp_it_post(DECL_ARGS);
+static void termp_lb_post(DECL_ARGS);
+static void termp_op_post(DECL_ARGS);
+static void termp_pf_post(DECL_ARGS);
+static void termp_pq_post(DECL_ARGS);
+static void termp_qq_post(DECL_ARGS);
+static void termp_sh_post(DECL_ARGS);
+static void termp_sq_post(DECL_ARGS);
+static void termp_ss_post(DECL_ARGS);
+static void termp_vt_post(DECL_ARGS);
+
+static int termp_an_pre(DECL_ARGS);
+static int termp_ap_pre(DECL_ARGS);
+static int termp_aq_pre(DECL_ARGS);
+static int termp_bd_pre(DECL_ARGS);
+static int termp_bf_pre(DECL_ARGS);
+static int termp_bl_pre(DECL_ARGS);
+static int termp_bold_pre(DECL_ARGS);
+static int termp_bq_pre(DECL_ARGS);
+static int termp_brq_pre(DECL_ARGS);
+static int termp_bt_pre(DECL_ARGS);
+static int termp_cd_pre(DECL_ARGS);
+static int termp_d1_pre(DECL_ARGS);
+static int termp_dq_pre(DECL_ARGS);
+static int termp_ex_pre(DECL_ARGS);
+static int termp_fa_pre(DECL_ARGS);
+static int termp_fl_pre(DECL_ARGS);
+static int termp_fn_pre(DECL_ARGS);
+static int termp_fo_pre(DECL_ARGS);
+static int termp_ft_pre(DECL_ARGS);
+static int termp_in_pre(DECL_ARGS);
+static int termp_it_pre(DECL_ARGS);
+static int termp_li_pre(DECL_ARGS);
+static int termp_lk_pre(DECL_ARGS);
+static int termp_nd_pre(DECL_ARGS);
+static int termp_nm_pre(DECL_ARGS);
+static int termp_ns_pre(DECL_ARGS);
+static int termp_op_pre(DECL_ARGS);
+static int termp_pf_pre(DECL_ARGS);
+static int termp_pq_pre(DECL_ARGS);
+static int termp_qq_pre(DECL_ARGS);
+static int termp_rs_pre(DECL_ARGS);
+static int termp_rv_pre(DECL_ARGS);
+static int termp_sh_pre(DECL_ARGS);
+static int termp_sm_pre(DECL_ARGS);
+static int termp_sp_pre(DECL_ARGS);
+static int termp_sq_pre(DECL_ARGS);
+static int termp_ss_pre(DECL_ARGS);
+static int termp_under_pre(DECL_ARGS);
+static int termp_ud_pre(DECL_ARGS);
+static int termp_vt_pre(DECL_ARGS);
+static int termp_xr_pre(DECL_ARGS);
+static int termp_xx_pre(DECL_ARGS);
+
+static const struct termact termacts[MDOC_MAX] = {