diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-07-07 20:34:21 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2012-07-07 20:34:21 +0000 |
commit | 6cf7fea4e70a610dea5225c8fbb198002544393a (patch) | |
tree | 72474cedabfae1d5c9d381ce3816a5bbe5e5e112 /usr.bin/mandoc | |
parent | 1b38299b6666f307c1cb4971daf837c72a843d83 (diff) |
basic support for -Tman .In
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r-- | usr.bin/mandoc/mdoc_man.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c index 3414de161ca..16928d91e3d 100644 --- a/usr.bin/mandoc/mdoc_man.c +++ b/usr.bin/mandoc/mdoc_man.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.11 2012/07/07 14:04:39 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.12 2012/07/07 20:34:20 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org> * @@ -49,6 +49,7 @@ static void post_bd(DECL_ARGS); static void post_bk(DECL_ARGS); static void post_dl(DECL_ARGS); static void post_enc(DECL_ARGS); +static void post_in(DECL_ARGS); static void post_lb(DECL_ARGS); static void post_nm(DECL_ARGS); static void post_percent(DECL_ARGS); @@ -62,6 +63,7 @@ static int pre_br(DECL_ARGS); static int pre_bx(DECL_ARGS); static int pre_dl(DECL_ARGS); static int pre_enc(DECL_ARGS); +static int pre_in(DECL_ARGS); static int pre_it(DECL_ARGS); static int pre_nm(DECL_ARGS); static int pre_ns(DECL_ARGS); @@ -107,7 +109,7 @@ static const struct manact manacts[MDOC_MAX + 1] = { { NULL, NULL, NULL, NULL, NULL }, /* _Fn */ { NULL, NULL, NULL, NULL, NULL }, /* _Ft */ { NULL, pre_enc, post_enc, "\\fB", "\\fP" }, /* Ic */ - { NULL, NULL, NULL, NULL, NULL }, /* _In */ + { NULL, pre_in, post_in, NULL, NULL }, /* In */ { NULL, pre_enc, post_enc, "\\fR", "\\fP" }, /* Li */ { cond_head, pre_enc, NULL, "\\- ", NULL }, /* Nd */ { NULL, pre_nm, post_nm, NULL, NULL }, /* Nm */ @@ -582,6 +584,35 @@ post_dl(DECL_ARGS) } static int +pre_in(DECL_ARGS) +{ + + if (MDOC_SYNPRETTY & n->flags) { + mm->need_nl = 1; + print_word(mm, ".br"); + mm->need_nl = 1; + print_word(mm, "\\fB#include <"); + } else + print_word(mm, "<\\fI"); + mm->need_space = 0; + return(1); +} + +static void +post_in(DECL_ARGS) +{ + + mm->need_space = 0; + if (MDOC_SYNPRETTY & n->flags) { + print_word(mm, ">\\fP"); + mm->need_nl = 1; + print_word(mm, ".br"); + mm->need_nl = 1; + } else + print_word(mm, "\\fP>"); +} + +static int pre_it(DECL_ARGS) { const struct mdoc_node *bln; |