diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2012-01-03 15:16:24 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2012-01-03 15:16:24 +0000 |
commit | 4873b4380a189665bf89eaa8180a9fc5696c5f73 (patch) | |
tree | 29e035a9b0675bbee7fd00013cc57264156045f6 /man_term.c | |
parent | d807641d331b60b360442bd3bc4084baa0342b98 (diff) | |
download | mandoc-4873b4380a189665bf89eaa8180a9fc5696c5f73.tar.gz |
Add support for `OP', one of the extended man macros. This also requires
some man(7) changes to accomodate for the an-ext compatibility.
Diffstat (limited to 'man_term.c')
-rw-r--r-- | man_term.c | 29 |
1 files changed, 27 insertions, 2 deletions
@@ -68,21 +68,22 @@ static void print_man_foot(struct termp *, const void *); static void print_bvspace(struct termp *, const struct man_node *); -static int pre_alternate(DECL_ARGS); static int pre_B(DECL_ARGS); static int pre_HP(DECL_ARGS); static int pre_I(DECL_ARGS); static int pre_IP(DECL_ARGS); +static int pre_OP(DECL_ARGS); static int pre_PP(DECL_ARGS); static int pre_RS(DECL_ARGS); static int pre_SH(DECL_ARGS); static int pre_SS(DECL_ARGS); static int pre_TP(DECL_ARGS); +static int pre_alternate(DECL_ARGS); +static int pre_ft(DECL_ARGS); static int pre_ign(DECL_ARGS); 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); @@ -125,6 +126,7 @@ static const struct termact termacts[MAN_MAX] = { { pre_ign, NULL, 0 }, /* AT */ { pre_in, NULL, MAN_NOTEXT }, /* in */ { pre_ft, NULL, MAN_NOTEXT }, /* ft */ + { pre_OP, NULL, 0 }, /* OP */ }; @@ -324,6 +326,29 @@ pre_B(DECL_ARGS) /* ARGSUSED */ static int +pre_OP(DECL_ARGS) +{ + + term_word(p, "["); + p->flags |= TERMP_NOSPACE; + + if (NULL != (n = n->child)) { + term_fontrepl(p, TERMFONT_BOLD); + term_word(p, n->string); + } + if (NULL != n && NULL != n->next) { + term_fontrepl(p, TERMFONT_UNDER); + term_word(p, n->next->string); + } + + term_fontrepl(p, TERMFONT_NONE); + p->flags |= TERMP_NOSPACE; + term_word(p, "]"); + return(0); +} + +/* ARGSUSED */ +static int pre_ft(DECL_ARGS) { const char *cp; |