-static int pwarn(struct mdoc *, int, int, enum mwarn);
-static int perr(struct mdoc *, int, int, enum merr);
-static int check_parent(PRE_ARGS, int, enum mdoc_type);
-static int check_msec(PRE_ARGS, ...);
-static int check_sec(PRE_ARGS, ...);
-static int check_stdarg(PRE_ARGS);
-static int check_text(struct mdoc *, int, int, const char *);
-static int check_argv(struct mdoc *,
- const struct mdoc_node *,
- const struct mdoc_argv *);
-static int check_args(struct mdoc *,
- const struct mdoc_node *);
-static int err_child_lt(struct mdoc *, const char *, int);
-static int warn_child_lt(struct mdoc *, const char *, int);
-static int err_child_gt(struct mdoc *, const char *, int);
-static int warn_child_gt(struct mdoc *, const char *, int);
-static int err_child_eq(struct mdoc *, const char *, int);
-static int warn_child_eq(struct mdoc *, const char *, int);
-static int warn_print(struct mdoc *, int, int);
-static int warn_count(struct mdoc *, const char *,
- int, const char *, int);
-static int err_count(struct mdoc *, const char *,
- int, const char *, int);
-static int pre_an(PRE_ARGS);
-static int pre_bd(PRE_ARGS);
-static int pre_bl(PRE_ARGS);
-static int pre_cd(PRE_ARGS);
-static int pre_dd(PRE_ARGS);
-static int pre_display(PRE_ARGS);
-static int pre_dt(PRE_ARGS);
-static int pre_er(PRE_ARGS);
-static int pre_ex(PRE_ARGS);
-static int pre_fd(PRE_ARGS);
-static int pre_it(PRE_ARGS);
-static int pre_lb(PRE_ARGS);
-static int pre_os(PRE_ARGS);
-static int pre_rv(PRE_ARGS);
-static int pre_sh(PRE_ARGS);
-static int pre_ss(PRE_ARGS);
-static int herr_ge1(POST_ARGS);
-static int hwarn_le1(POST_ARGS);
-static int herr_eq0(POST_ARGS);
-static int eerr_eq0(POST_ARGS);
-static int eerr_le2(POST_ARGS);
-static int eerr_eq1(POST_ARGS);
-static int eerr_ge1(POST_ARGS);
-static int ewarn_eq0(POST_ARGS);
-static int ewarn_eq1(POST_ARGS);
-static int bwarn_ge1(POST_ARGS);
-static int hwarn_eq1(POST_ARGS);
-static int ewarn_ge1(POST_ARGS);
-static int ebool(POST_ARGS);
-static int post_an(POST_ARGS);
-static int post_args(POST_ARGS);
-static int post_at(POST_ARGS);
-static int post_bf(POST_ARGS);
-static int post_bl(POST_ARGS);
-static int post_bl_head(POST_ARGS);
-static int post_it(POST_ARGS);
-static int post_nm(POST_ARGS);
-static int post_root(POST_ARGS);
-static int post_sh(POST_ARGS);
-static int post_sh_body(POST_ARGS);
-static int post_sh_head(POST_ARGS);
-static int post_st(POST_ARGS);
-
-#define vwarn(m, t) nwarn((m), (m)->last, (t))
-#define verr(m, t) nerr((m), (m)->last, (t))
-#define nwarn(m, n, t) pwarn((m), (n)->line, (n)->pos, (t))
-#define nerr(m, n, t) perr((m), (n)->line, (n)->pos, (t))
-
-static v_pre pres_an[] = { pre_an, NULL };
-static v_pre pres_bd[] = { pre_display, pre_bd, NULL };
-static v_pre pres_bl[] = { pre_bl, NULL };
-static v_pre pres_cd[] = { pre_cd, NULL };
-static v_pre pres_dd[] = { pre_dd, NULL };
-static v_pre pres_d1[] = { pre_display, NULL };
-static v_pre pres_dt[] = { pre_dt, NULL };
-static v_pre pres_er[] = { pre_er, NULL };
-static v_pre pres_ex[] = { pre_ex, NULL };
-static v_pre pres_fd[] = { pre_fd, NULL };
-static v_pre pres_it[] = { pre_it, NULL };
-static v_pre pres_lb[] = { pre_lb, NULL };
-static v_pre pres_os[] = { pre_os, NULL };
-static v_pre pres_rv[] = { pre_rv, NULL };
-static v_pre pres_sh[] = { pre_sh, NULL };
-static v_pre pres_ss[] = { pre_ss, NULL };
-static v_post posts_bool[] = { eerr_eq1, ebool, NULL };
-static v_post posts_bd[] = { herr_eq0, bwarn_ge1, NULL };
-static v_post posts_text[] = { eerr_ge1, NULL };
-static v_post posts_wtext[] = { ewarn_ge1, NULL };
-static v_post posts_notext[] = { eerr_eq0, NULL };
-static v_post posts_wline[] = { bwarn_ge1, herr_eq0, NULL };
-static v_post posts_sh[] = { herr_ge1, bwarn_ge1, post_sh, NULL };
-static v_post posts_bl[] = { bwarn_ge1, post_bl, NULL };
-static v_post posts_it[] = { post_it, NULL };
-static v_post posts_in[] = { ewarn_eq1, NULL };
-static v_post posts_ss[] = { herr_ge1, NULL };
-static v_post posts_pf[] = { eerr_eq1, NULL };
-static v_post posts_lb[] = { eerr_eq1, NULL };
-static v_post posts_st[] = { eerr_eq1, post_st, NULL };
-static v_post posts_pp[] = { ewarn_eq0, NULL };
-static v_post posts_ex[] = { eerr_eq0, post_args, NULL };
-static v_post posts_rv[] = { eerr_eq0, post_args, NULL };
-static v_post posts_an[] = { post_an, NULL };
-static v_post posts_at[] = { post_at, NULL };
-static v_post posts_xr[] = { eerr_ge1, eerr_le2, NULL };
-static v_post posts_nm[] = { post_nm, NULL };
-static v_post posts_bf[] = { hwarn_le1, post_bf, NULL };
-static v_post posts_fo[] = { hwarn_eq1, bwarn_ge1, NULL };
-
-const struct valids mdoc_valids[MDOC_MAX] = {
- { NULL, NULL }, /* Ap */
- { pres_dd, posts_text }, /* Dd */
- { pres_dt, NULL }, /* Dt */
- { pres_os, NULL }, /* Os */
- { pres_sh, posts_sh }, /* Sh */
- { pres_ss, posts_ss }, /* Ss */
- { NULL, posts_pp }, /* Pp */
- { pres_d1, posts_wline }, /* D1 */
- { pres_d1, posts_wline }, /* Dl */
- { pres_bd, posts_bd }, /* Bd */
- { NULL, NULL }, /* Ed */
- { pres_bl, posts_bl }, /* Bl */
- { NULL, NULL }, /* El */
- { pres_it, posts_it }, /* It */
- { NULL, posts_text }, /* Ad */
- { pres_an, posts_an }, /* An */
- { NULL, NULL }, /* Ar */
- { pres_cd, posts_text }, /* Cd */
- { NULL, NULL }, /* Cm */
- { NULL, NULL }, /* Dv */
- { pres_er, posts_text }, /* Er */
- { NULL, NULL }, /* Ev */
- { pres_ex, posts_ex }, /* Ex */
- { NULL, NULL }, /* Fa */
- { pres_fd, posts_wtext }, /* Fd */
- { NULL, NULL }, /* Fl */
- { NULL, posts_text }, /* Fn */
- { NULL, posts_wtext }, /* Ft */
- { NULL, posts_text }, /* Ic */
- { NULL, posts_in }, /* In */
- { NULL, NULL }, /* Li */
- { NULL, posts_wtext }, /* Nd */
- { NULL, posts_nm }, /* Nm */
- { NULL, posts_wline }, /* Op */
- { NULL, NULL }, /* Ot */
- { NULL, NULL }, /* Pa */
- { pres_rv, posts_rv }, /* Rv */
- { NULL, posts_st }, /* St */
- { NULL, NULL }, /* Va */
- { NULL, posts_text }, /* Vt */
- { NULL, posts_xr }, /* Xr */
- { NULL, posts_text }, /* %A */
- { NULL, posts_text }, /* %B */
- { NULL, posts_text }, /* %D */
- { NULL, posts_text }, /* %I */
- { NULL, posts_text }, /* %J */
- { NULL, posts_text }, /* %N */
- { NULL, posts_text }, /* %O */
- { NULL, posts_text }, /* %P */
- { NULL, posts_text }, /* %R */
- { NULL, posts_text }, /* %T */
- { NULL, posts_text }, /* %V */
- { NULL, NULL }, /* Ac */
- { NULL, NULL }, /* Ao */
- { NULL, posts_wline }, /* Aq */
- { NULL, posts_at }, /* At */
- { NULL, NULL }, /* Bc */
- { NULL, posts_bf }, /* Bf */
- { NULL, NULL }, /* Bo */
- { NULL, posts_wline }, /* Bq */
- { NULL, NULL }, /* Bsx */
- { NULL, NULL }, /* Bx */
- { NULL, posts_bool }, /* Db */
- { NULL, NULL }, /* Dc */
- { NULL, NULL }, /* Do */
- { NULL, posts_wline }, /* Dq */
- { NULL, NULL }, /* Ec */
- { NULL, NULL }, /* Ef */
- { NULL, NULL }, /* Em */
- { NULL, NULL }, /* Eo */
- { NULL, NULL }, /* Fx */
- { NULL, posts_text }, /* Ms */
- { NULL, posts_notext }, /* No */
- { NULL, posts_notext }, /* Ns */
- { NULL, NULL }, /* Nx */
- { NULL, NULL }, /* Ox */
- { NULL, NULL }, /* Pc */
- { NULL, posts_pf }, /* Pf */
- { NULL, NULL }, /* Po */
- { NULL, posts_wline }, /* Pq */
- { NULL, NULL }, /* Qc */
- { NULL, posts_wline }, /* Ql */
- { NULL, NULL }, /* Qo */
- { NULL, posts_wline }, /* Qq */
- { NULL, NULL }, /* Re */
- { NULL, posts_wline }, /* Rs */
- { NULL, NULL }, /* Sc */
- { NULL, NULL }, /* So */
- { NULL, posts_wline }, /* Sq */
- { NULL, posts_bool }, /* Sm */
- { NULL, posts_text }, /* Sx */
- { NULL, posts_text }, /* Sy */
- { NULL, posts_text }, /* Tn */
- { NULL, NULL }, /* Ux */
- { NULL, NULL }, /* Xc */
- { NULL, NULL }, /* Xo */
- { NULL, posts_fo }, /* Fo */
- { NULL, NULL }, /* Fc */
- { NULL, NULL }, /* Oo */
- { NULL, NULL }, /* Oc */
- { NULL, posts_wline }, /* Bk */
- { NULL, NULL }, /* Ek */
- { NULL, posts_notext }, /* Bt */
- { NULL, NULL }, /* Hf */
- { NULL, NULL }, /* Fr */
- { NULL, posts_notext }, /* Ud */
- { pres_lb, posts_lb }, /* Lb */
- { NULL, posts_pp }, /* Lp */
- { NULL, NULL }, /* Lk */
- { NULL, posts_text }, /* Mt */
- { NULL, posts_wline }, /* Brq */
- { NULL, NULL }, /* Bro */
- { NULL, NULL }, /* Brc */
- { NULL, posts_text }, /* %C */
- { NULL, NULL }, /* Es */
- { NULL, NULL }, /* En */
- { NULL, NULL }, /* Dx */
- { NULL, posts_text }, /* %Q */