+/* ARGSUSED */
+static void
+termp_bx_post(DECL_ARGS)
+{
+
+ if (node->child)
+ p->flags |= TERMP_NOSPACE;
+ word(p, "BSD");
+}
+
+
+/* ARGSUSED */
+static int
+termp_ox_pre(DECL_ARGS)
+{
+
+ word(p, "OpenBSD");
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_ux_pre(DECL_ARGS)
+{
+
+ word(p, "UNIX");
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_fx_pre(DECL_ARGS)
+{
+
+ word(p, "FreeBSD");
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_nx_pre(DECL_ARGS)
+{
+
+ word(p, "NetBSD");
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_sq_pre(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return(1);
+ word(p, "`");
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_sq_post(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return;
+ p->flags |= TERMP_NOSPACE;
+ word(p, "\'");
+}
+
+
+/* ARGSUSED */
+static int
+termp_pf_pre(DECL_ARGS)
+{
+
+ p->flags |= TERMP_IGNDELIM;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_pf_post(DECL_ARGS)
+{
+
+ p->flags &= ~TERMP_IGNDELIM;
+ p->flags |= TERMP_NOSPACE;
+}
+
+
+/* ARGSUSED */
+static int
+termp_ss_pre(DECL_ARGS)
+{
+
+ switch (node->type) {
+ case (MDOC_HEAD):
+ vspace(p);
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SSECTION]);
+ p->offset = INDENT / 2;
+ break;
+ default:
+ break;
+ }
+
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_ss_post(DECL_ARGS)
+{
+
+ switch (node->type) {
+ case (MDOC_HEAD):
+ newln(p);
+ p->offset = INDENT;
+ break;
+ default:
+ break;
+ }
+}
+
+
+/* ARGSUSED */
+static int
+termp_pa_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_FILE]);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_em_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_EMPH]);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_cd_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_CONFIG]);
+ newln(p);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_cm_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_CMD_FLAG]);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_ic_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_CMD]);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_in_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_INCLUDE]);
+ word(p, "#include");
+ word(p, "<");
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_in_post(DECL_ARGS)
+{
+
+ p->flags |= TERMP_NOSPACE;
+ word(p, ">");
+
+ newln(p);
+ if (SEC_SYNOPSIS != node->sec)
+ return;
+ if (node->next && MDOC_In != node->next->tok)
+ vspace(p);
+}
+
+
+/* ARGSUSED */
+static int
+termp_at_pre(DECL_ARGS)
+{
+ const char *att;
+
+ att = NULL;
+
+ if (node->child) {
+ if (MDOC_TEXT != node->child->type)
+ errx(1, "expected text line argument");
+ att = mdoc_a2att(node->child->string);
+ }
+
+ if (NULL == att)
+ att = "AT&T UNIX";
+
+ word(p, att);
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+termp_bq_pre(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return(1);
+ word(p, "[");
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_bq_post(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return;
+ word(p, "]");
+}
+
+
+/* ARGSUSED */
+static int
+termp_pq_pre(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return(1);
+ word(p, "\\&(");
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp_pq_post(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return;
+ word(p, ")");
+}
+
+
+/* ARGSUSED */
+static int
+termp_fo_pre(DECL_ARGS)
+{
+ const struct mdoc_node *n;
+
+ if (MDOC_BODY == node->type) {
+ word(p, "(");
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+ } else if (MDOC_HEAD != node->type)
+ return(1);
+
+ /* XXX - groff shows only first parameter */
+
+ p->flags |= ttypes[TTYPE_FUNC_NAME];
+ for (n = node->child; n; n = n->next) {
+ if (MDOC_TEXT != n->type)
+ errx(1, "expected text line argument");
+ word(p, n->string);
+ }
+ p->flags &= ~ttypes[TTYPE_FUNC_NAME];
+
+ return(0);
+}
+
+
+/* ARGSUSED */
+static void
+termp_fo_post(DECL_ARGS)
+{
+
+ if (MDOC_BODY != node->type)
+ return;
+ word(p, ")");
+ word(p, ";");
+ newln(p);
+}
+
+
+/* ARGSUSED */
+static int
+termp_bf_pre(DECL_ARGS)
+{
+ const struct mdoc_node *n;
+
+ if (MDOC_HEAD == node->type) {
+ return(0);
+ } else if (MDOC_BLOCK != node->type)
+ return(1);
+
+ if (NULL == (n = node->head->child)) {
+ if (arg_hasattr(MDOC_Emphasis, node))
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_EMPH]);
+ else if (arg_hasattr(MDOC_Symbolic, node))
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SYMB]);
+
+ return(1);
+ }
+
+ if (MDOC_TEXT != n->type)
+ errx(1, "expected text line arguments");
+
+ if (0 == strcmp("Em", n->string))
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_EMPH]);
+ else if (0 == strcmp("Sy", n->string))
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_EMPH]);
+
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_sy_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SYMB]);
+ return(1);
+}
+
+
+/* ARGSUSED */
+static int
+termp_ms_pre(DECL_ARGS)
+{
+
+ TERMPAIR_SETFLAG(p, pair, ttypes[TTYPE_SYMBOL]);
+ return(1);
+}
+
+
+
+/* ARGSUSED */
+static int
+termp_sm_pre(DECL_ARGS)
+{
+
+#if notyet
+ assert(node->child);
+ if (0 == strcmp("off", node->child->data.text.string)) {
+ p->flags &= ~TERMP_NONOSPACE;
+ p->flags &= ~TERMP_NOSPACE;
+ } else {
+ p->flags |= TERMP_NONOSPACE;
+ p->flags |= TERMP_NOSPACE;
+ }
+#endif
+
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
+termp__t_pre(DECL_ARGS)
+{
+
+ /* FIXME: titles are underlined. */
+ word(p, "\"");
+ p->flags |= TERMP_NOSPACE;
+ return(1);
+}
+
+
+/* ARGSUSED */
+static void
+termp__t_post(DECL_ARGS)
+{
+
+ p->flags |= TERMP_NOSPACE;
+ /* FIXME: titles are underlined. */
+ word(p, "\"");
+ word(p, node->next ? "," : ".");
+}
+
+
+/* ARGSUSED */
+static void
+termp____post(DECL_ARGS)
+{
+
+ p->flags |= TERMP_NOSPACE;
+ word(p, node->next ? "," : ".");
+}