-__BEGIN_DECLS
-
-static int roff_Dd(ROFFCALL_ARGS); /* FIXME: deprecate. */
-static int roff_Dt(ROFFCALL_ARGS); /* FIXME: deprecate. */
-static int roff_Os(ROFFCALL_ARGS); /* FIXME: deprecate. */
-static int roff_Ns(ROFFCALL_ARGS); /* FIXME: deprecate. */
-static int roff_layout(ROFFCALL_ARGS);
-static int roff_text(ROFFCALL_ARGS);
-static int roff_noop(ROFFCALL_ARGS);
-static int roff_depr(ROFFCALL_ARGS);
-static int roff_ordered(ROFFCALL_ARGS);
-
-static const int roffarg_An[] = { ROFF_Split, ROFF_Nosplit,
- ROFF_ARGMAX };
-static const int roffarg_Bd[] = { ROFF_Ragged, ROFF_Unfilled,
- ROFF_Literal, ROFF_File, ROFF_Offset, ROFF_Filled, ROFF_Compact,
- ROFF_ARGMAX };
-static const int roffarg_Bk[] = { ROFF_Words, ROFF_ARGMAX };
-static const int roffarg_Ex[] = { ROFF_Std, ROFF_ARGMAX };
-static const int roffarg_Rv[] = { ROFF_Std, ROFF_ARGMAX };
-static const int roffarg_Bl[] = { ROFF_Bullet, ROFF_Dash, ROFF_Hyphen,
- ROFF_Item, ROFF_Enum, ROFF_Tag, ROFF_Diag, ROFF_Hang,
- ROFF_Ohang, ROFF_Inset, ROFF_Column, ROFF_Offset, ROFF_Width,
- ROFF_Compact, ROFF_ARGMAX };
-static const int roffarg_St[] = { ROFF_p1003_1_88, ROFF_p1003_1_90,
- ROFF_p1003_1_96, ROFF_p1003_1_2001, ROFF_p1003_1_2004,
- ROFF_p1003_1, ROFF_p1003_1b, ROFF_p1003_1b_93, ROFF_p1003_1c_95,
- ROFF_p1003_1g_2000, ROFF_p1003_2_92, ROFF_p1387_2_95,
- ROFF_p1003_2, ROFF_p1387_2, ROFF_isoC_90, ROFF_isoC_amd1,
- ROFF_isoC_tcor1, ROFF_isoC_tcor2, ROFF_isoC_99, ROFF_ansiC,
- ROFF_ansiC_89, ROFF_ansiC_99, ROFF_ieee754, ROFF_iso8802_3,
- ROFF_xpg3, ROFF_xpg4, ROFF_xpg4_2, ROFF_xpg4_3, ROFF_xbd5,
- ROFF_xcu5, ROFF_xsh5, ROFF_xns5, ROFF_xns5_2d2_0,
- ROFF_xcurses4_2, ROFF_susv2, ROFF_susv3, ROFF_svid4,
- ROFF_ARGMAX };
-
-static const int roffchild_Bl[] = { ROFF_It, ROFF_El, ROFF_MAX };
-static const int roffchild_Fo[] = { ROFF_Fa, ROFF_Fc, ROFF_MAX };
-static const int roffchild_Rs[] = { ROFF_Re, ROFF__A, ROFF__B, ROFF__D,
- ROFF__I, ROFF__J, ROFF__N, ROFF__O, ROFF__P, ROFF__R, ROFF__T,
- ROFF__V, ROFF_MAX };
-
-static const enum roffmsec roffmsec_Cd[] = { ROFF_MSEC_4,
- ROFF_MSEC_MAX };
-static const enum roffmsec roffmsec_Er[] = { ROFF_MSEC_2,
- ROFF_MSEC_MAX };
-static const enum roffmsec roffmsec_Ex[] = { ROFF_MSEC_1,
- ROFF_MSEC_6, ROFF_MSEC_8, ROFF_MSEC_MAX };
-static const enum roffmsec roffmsec_Rv[] = { ROFF_MSEC_2,
- ROFF_MSEC_3, ROFF_MSEC_MAX };
-
-static const int roffparent_El[] = { ROFF_Bl, ROFF_It, ROFF_MAX };
-static const int roffparent_Fc[] = { ROFF_Fo, ROFF_Fa, ROFF_MAX };
-static const int roffparent_Oc[] = { ROFF_Oo, ROFF_MAX };
-static const int roffparent_It[] = { ROFF_Bl, ROFF_It, ROFF_MAX };
-static const int roffparent_Re[] = { ROFF_Rs, ROFF_MAX };
-
-static const struct rofftok tokens[ROFF_MAX] = {
- { roff_noop, NULL, NULL, NULL, NULL, 0, ROFF_COMMENT, 0 }, /* \" */
- { roff_Dd, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Dd */
- { roff_Dt, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Dt */
- { roff_Os, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Os */
- { roff_layout, NULL, NULL, NULL, NULL, ROFF_Sh, ROFF_LAYOUT, 0 }, /* Sh */
- { roff_layout, NULL, NULL, NULL, NULL, ROFF_Ss, ROFF_LAYOUT, 0 }, /* Ss */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Pp */ /* XXX 0 args */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_LSCOPE }, /* D1 */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_LSCOPE }, /* Dl */
- { roff_layout, NULL, roffarg_Bd, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bd */
- { roff_noop, NULL, NULL, NULL, NULL, ROFF_Bd, ROFF_LAYOUT, 0 }, /* Ed */
- { roff_layout, NULL, roffarg_Bl, NULL, roffchild_Bl, 0, ROFF_LAYOUT, 0 }, /* Bl */
- { roff_noop, NULL, NULL, roffparent_El, NULL, ROFF_Bl, ROFF_LAYOUT, 0 }, /* El */
- { roff_layout, NULL, NULL, roffparent_It, NULL, ROFF_It, ROFF_LAYOUT, ROFF_PARSED | ROFF_SHALLOW }, /* It */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ad */ /* FIXME */
- { roff_text, NULL, roffarg_An, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* An */ /* FIXME: args/no-args, yech. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ar */
-/*Ok*/ { roff_text, roffmsec_Cd, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Cd */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Cm */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Dv */ /* XXX needs arg */
-/*Ok*/ { roff_text, roffmsec_Er, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Er */ /* XXX needs arg */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ev */ /* XXX needs arg */
-/*Ok*/ {roff_ordered, roffmsec_Ex, roffarg_Ex, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ex */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fa */ /* XXX needs arg */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Fd */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fl */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Fn */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ft */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ic */ /* FIXME: needs arg */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* In */ /* FIXME: section/linebreak. */
-/*OK*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Li */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Nd */ /* FIXME: section. */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Nm */ /* FIXME: sections. */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Op */
-/*Ok*/ { roff_depr, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ot */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Pa */
-/*Ok*/ {roff_ordered, roffmsec_Rv, roffarg_Rv, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Rv */
-/*Ok*/ {roff_ordered, NULL, roffarg_St, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* St */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Va */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Vt */ /* FIXME: section/linebreak. */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xr */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* %A */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %B */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %D */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %I */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE}, /* %J */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %N */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %O */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %P */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %R */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* %T */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* %V */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ac */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ao */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Aq */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* At */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Bc */
- { roff_layout, NULL, NULL, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bf */ /* FIXME */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Bo */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Bq */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Bsx */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Bx */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_SPECIAL, 0 }, /* Db */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Dc */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Do */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Dq */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ec */
- { roff_noop, NULL, NULL, NULL, NULL, ROFF_Bf, ROFF_LAYOUT, 0 }, /* Ef */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Em */ /* XXX needs arg */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Eo */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Fx */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ms */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* No */
-/*Ok*/ { roff_Ns, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ns */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Nx */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ox */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Pc */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Pf */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Po */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Pq */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Qc */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Ql */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Qo */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Qq */
- { roff_noop, NULL, NULL, roffparent_Re, NULL, ROFF_Rs, ROFF_LAYOUT, 0 }, /* Re */
- { roff_layout, NULL, NULL, NULL, roffchild_Rs, 0, ROFF_LAYOUT, 0 }, /* Rs */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sc */
- { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* So */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE | ROFF_LSCOPE }, /* Sq */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Sm */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sx */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Sy */
-/*Ok*/ { roff_text, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Tn */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED }, /* Ux */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xc */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, ROFF_PARSED | ROFF_CALLABLE }, /* Xo */
-/*Ok*/ { roff_layout, NULL, NULL, NULL, roffchild_Fo, 0, ROFF_LAYOUT, 0 }, /* Fo */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_noop, NULL, NULL, roffparent_Fc, NULL, ROFF_Fo, ROFF_LAYOUT, 0 }, /* Fc */ /* FIXME: section/linebreak. */
-/*Ok*/ { roff_layout, NULL, NULL, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Oo */
-/*Ok*/ { roff_noop, NULL, NULL, roffparent_Oc, NULL, ROFF_Oo, ROFF_LAYOUT, 0 }, /* Oc */
- { NULL, NULL, roffarg_Bk, NULL, NULL, 0, ROFF_LAYOUT, 0 }, /* Bk */
- { NULL, NULL, NULL, NULL, NULL, ROFF_Bk, ROFF_LAYOUT, 0 }, /* Ek */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Bt */
- { NULL, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Hf */
-/*Ok*/ { roff_depr, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Fr */
-/*Ok*/ {roff_ordered, NULL, NULL, NULL, NULL, 0, ROFF_TEXT, 0 }, /* Ud */
- };