-/* $Id: man_term.c,v 1.88 2010/12/06 14:04:11 kristaps Exp $ */
+/* $Id: man_term.c,v 1.93 2011/01/03 15:30:25 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
static int pre_in(DECL_ARGS);
static int pre_literal(DECL_ARGS);
static int pre_sp(DECL_ARGS);
+static int pre_ft(DECL_ARGS);
static void post_IP(DECL_ARGS);
static void post_HP(DECL_ARGS);
{ pre_alternate, NULL, 0 }, /* IR */
{ pre_alternate, NULL, 0 }, /* RI */
{ NULL, NULL, MAN_NOTEXT }, /* na */
- { pre_I, NULL, 0 }, /* i */
{ pre_sp, NULL, MAN_NOTEXT }, /* sp */
{ pre_literal, NULL, 0 }, /* nf */
{ pre_literal, NULL, 0 }, /* fi */
- { NULL, NULL, 0 }, /* r */
{ NULL, NULL, 0 }, /* RE */
{ pre_RS, post_RS, 0 }, /* RS */
{ pre_ign, NULL, 0 }, /* DT */
{ pre_ign, NULL, 0 }, /* PD */
{ pre_ign, NULL, 0 }, /* AT */
{ pre_in, NULL, MAN_NOTEXT }, /* in */
+ { pre_ft, NULL, MAN_NOTEXT }, /* ft */
};
return(1);
}
+/* ARGSUSED */
+static int
+pre_ft(DECL_ARGS)
+{
+ const char *cp;
+
+ if (NULL == n->child) {
+ term_fontlast(p);
+ return(0);
+ }
+
+ cp = n->child->string;
+ switch (*cp) {
+ case ('4'):
+ /* FALLTHROUGH */
+ case ('3'):
+ /* FALLTHROUGH */
+ case ('B'):
+ term_fontrepl(p, TERMFONT_BOLD);
+ break;
+ case ('2'):
+ /* FALLTHROUGH */
+ case ('I'):
+ term_fontrepl(p, TERMFONT_UNDER);
+ break;
+ case ('P'):
+ term_fontlast(p);
+ break;
+ case ('1'):
+ /* FALLTHROUGH */
+ case ('C'):
+ /* FALLTHROUGH */
+ case ('R'):
+ term_fontrepl(p, TERMFONT_NONE);
+ break;
+ default:
+ break;
+ }
+ return(0);
+}
+
/* ARGSUSED */
static int
pre_in(DECL_ARGS)
p->maxrmargin = rmax;
}
break;
+ case (MAN_TBL):
+ if (TBL_SPAN_FIRST & n->span->flags)
+ term_newln(p);
+ term_tbl(p, n->span);
+ break;
default:
if ( ! (MAN_NOTEXT & termacts[n->tok].flags))
term_fontrepl(p, TERMFONT_NONE);
if (c && n->child)
print_man_nodelist(p, mt, n->child, m);
- if (MAN_TEXT != n->type) {
+ switch (n->type) {
+ case (MAN_TEXT):
+ /* FALLTHROUGH */
+ case (MAN_TBL):
+ break;
+ default:
if (termacts[n->tok].post)
(*termacts[n->tok].post)(p, mt, n, m);
if ( ! (MAN_NOTEXT & termacts[n->tok].flags))
term_fontrepl(p, TERMFONT_NONE);
+ break;
}
if (MAN_EOS & n->flags)