diff options
author | 2012-06-02 20:07:09 +0000 | |
---|---|---|
committer | 2012-06-02 20:07:09 +0000 | |
commit | 8d0fa220a9f3f8678da39a869f6716a46ae538b0 (patch) | |
tree | 595f60b77a7788b4c9bfa2d59f5b510d46a1d063 | |
parent | Add AMT ports to /etc/services so they're entered in net.inet.tcp.baddynamic (diff) | |
download | wireguard-openbsd-8d0fa220a9f3f8678da39a869f6716a46ae538b0.tar.xz wireguard-openbsd-8d0fa220a9f3f8678da39a869f6716a46ae538b0.zip |
Minimal implementation of .EX and .EE for GNU compatibility.
Do not use this, it is not portable and only defined in esr's man-ext.
For example, sox(1) wants these macros.
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/Makefile | 5 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/args.in | 12 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/args.out_ascii | 16 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/nested.in | 18 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/nested.out_ascii | 19 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/spacing.in | 35 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/EX/spacing.out_ascii | 27 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/Makefile | 4 | ||||
-rw-r--r-- | share/man/man7/man.7 | 16 | ||||
-rw-r--r-- | usr.bin/mandoc/man.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/man.h | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/man_html.c | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/man_macro.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 6 | ||||
-rw-r--r-- | usr.bin/mandoc/man_validate.c | 4 |
15 files changed, 167 insertions, 13 deletions
diff --git a/regress/usr.bin/mandoc/man/EX/Makefile b/regress/usr.bin/mandoc/man/EX/Makefile new file mode 100644 index 00000000000..8837c524e41 --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/Makefile @@ -0,0 +1,5 @@ +# $OpenBSD: Makefile,v 1.1 2012/06/02 20:07:09 schwarze Exp $ + +REGRESS_TARGETS=spacing nested args + +.include <bsd.regress.mk> diff --git a/regress/usr.bin/mandoc/man/EX/args.in b/regress/usr.bin/mandoc/man/EX/args.in new file mode 100644 index 00000000000..ac88a38ab8d --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/args.in @@ -0,0 +1,12 @@ +.TH EX-ARGS 1 "June 3, 2012" OpenBSD +.SH NAME +EX-args \- example macro with arguments +.SH DESCRIPTION +regular +text +.EX arg1 arg2 arg3 +literal +text +.EE arg1 arg2 arg3 +regular +text diff --git a/regress/usr.bin/mandoc/man/EX/args.out_ascii b/regress/usr.bin/mandoc/man/EX/args.out_ascii new file mode 100644 index 00000000000..4927655ed1d --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/args.out_ascii @@ -0,0 +1,16 @@ +EX-ARGS(1) OpenBSD Reference Manual EX-ARGS(1) + + + +NNAAMMEE + EX-args - example macro with arguments + +DDEESSCCRRIIPPTTIIOONN + regular text + literal + text + regular text + + + +OpenBSD June 3, 2012 EX-ARGS(1) diff --git a/regress/usr.bin/mandoc/man/EX/nested.in b/regress/usr.bin/mandoc/man/EX/nested.in new file mode 100644 index 00000000000..8ecf0ca2a59 --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/nested.in @@ -0,0 +1,18 @@ +.TH EX-NESTED 1 "June 3, 2012" OpenBSD +.SH NAME +EX-nested \- nested example macros +.SH DESCRIPTION +regular +text +.EX +outer +example +.EX +inner +example +.EE +outer +example +.EE +regular +text diff --git a/regress/usr.bin/mandoc/man/EX/nested.out_ascii b/regress/usr.bin/mandoc/man/EX/nested.out_ascii new file mode 100644 index 00000000000..2c7c8449366 --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/nested.out_ascii @@ -0,0 +1,19 @@ +EX-NESTED(1) OpenBSD Reference Manual EX-NESTED(1) + + + +NNAAMMEE + EX-nested - nested example macros + +DDEESSCCRRIIPPTTIIOONN + regular text + outer + example + inner + example + outer example + regular text + + + +OpenBSD June 3, 2012 EX-NESTED(1) diff --git a/regress/usr.bin/mandoc/man/EX/spacing.in b/regress/usr.bin/mandoc/man/EX/spacing.in new file mode 100644 index 00000000000..aa307d054f1 --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/spacing.in @@ -0,0 +1,35 @@ +.TH EX-SPACING 1 "June 3, 2012" OpenBSD +.SH NAME +EX-spacing \- spacing around the example macro +.SH DESCRIPTION +regular +text +.EX +example +text +.EE +regular +text +.nf +literal +text +.EX +example +text +.EE +regular +text +.PP +.EX +after PP, before nf +.EE +.nf +.EX +after nf, before fi +.EE +.fi +after fi, before PP +.EE +.PP +regular +text diff --git a/regress/usr.bin/mandoc/man/EX/spacing.out_ascii b/regress/usr.bin/mandoc/man/EX/spacing.out_ascii new file mode 100644 index 00000000000..23f655b8388 --- /dev/null +++ b/regress/usr.bin/mandoc/man/EX/spacing.out_ascii @@ -0,0 +1,27 @@ +EX-SPACING(1) OpenBSD Reference Manual EX-SPACING(1) + + + +NNAAMMEE + EX-spacing - spacing around the example macro + +DDEESSCCRRIIPPTTIIOONN + regular text + example + text + regular text + literal + text + example + text + regular text + + after PP, before nf + after nf, before fi + after fi, before PP + + regular text + + + +OpenBSD June 3, 2012 EX-SPACING(1) diff --git a/regress/usr.bin/mandoc/man/Makefile b/regress/usr.bin/mandoc/man/Makefile index eb997273270..a18574eaad3 100644 --- a/regress/usr.bin/mandoc/man/Makefile +++ b/regress/usr.bin/mandoc/man/Makefile @@ -1,6 +1,6 @@ -# $OpenBSD: Makefile,v 1.6 2011/11/17 16:28:45 schwarze Exp $ +# $OpenBSD: Makefile,v 1.7 2012/06/02 20:07:09 schwarze Exp $ -SUBDIR= nf BI IP PP TH TP +SUBDIR= nf BI EX IP PP TH TP ascii groff groff-clean obj-clean tman: _SUBDIRUSE diff --git a/share/man/man7/man.7 b/share/man/man7/man.7 index 356182a4497..22e306e51c8 100644 --- a/share/man/man7/man.7 +++ b/share/man/man7/man.7 @@ -1,4 +1,4 @@ -.\" $OpenBSD: man.7,v 1.27 2012/02/26 19:41:27 schwarze Exp $ +.\" $OpenBSD: man.7,v 1.28 2012/06/02 20:07:09 schwarze Exp $ .\" .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> .\" Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -15,7 +15,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: February 26 2012 $ +.Dd $Mdocdate: June 2 2012 $ .Dt MAN 7 .Os .Sh NAME @@ -339,6 +339,18 @@ and .Ss \&DT Has no effect. Included for compatibility. +.Ss \&EE +This is a non-standard GNU extension, included only for compatibility. +In +.Xr mandoc 1 , +it does the same as +.Sx \&fi . +.Ss \&EX +This is a non-standard GNU extension, included only for compatibility. +In +.Xr mandoc 1 , +it does the same as +.Sx \&nf . .Ss \&HP Begin a paragraph whose initial output line is left-justified, but subsequent output lines are indented, with the following syntax: diff --git a/usr.bin/mandoc/man.c b/usr.bin/mandoc/man.c index 8635e7b79e7..eefb4aa02b0 100644 --- a/usr.bin/mandoc/man.c +++ b/usr.bin/mandoc/man.c @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.65 2012/02/26 19:41:27 schwarze Exp $ */ +/* $Id: man.c,v 1.66 2012/06/02 20:07:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -36,7 +36,7 @@ const char *const __man_macronames[MAN_MAX] = { "RI", "na", "sp", "nf", "fi", "RE", "RS", "DT", "UC", "PD", "AT", "in", - "ft", "OP" + "ft", "OP", "EX", "EE" }; const char * const *man_macronames = __man_macronames; diff --git a/usr.bin/mandoc/man.h b/usr.bin/mandoc/man.h index c67ef8d3134..e06257f6f05 100644 --- a/usr.bin/mandoc/man.h +++ b/usr.bin/mandoc/man.h @@ -1,4 +1,4 @@ -/* $Id: man.h,v 1.39 2012/02/26 19:41:27 schwarze Exp $ */ +/* $Id: man.h,v 1.40 2012/06/02 20:07:09 schwarze Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -52,6 +52,8 @@ enum mant { MAN_in, MAN_ft, MAN_OP, + MAN_EX, + MAN_EE, MAN_MAX }; diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c index b799ed4c785..e79f976549b 100644 --- a/usr.bin/mandoc/man_html.c +++ b/usr.bin/mandoc/man_html.c @@ -1,4 +1,4 @@ -/* $Id: man_html.c,v 1.46 2012/02/26 19:41:27 schwarze Exp $ */ +/* $Id: man_html.c,v 1.47 2012/06/02 20:07:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -109,6 +109,8 @@ static const struct htmlman mans[MAN_MAX] = { { man_in_pre, NULL }, /* in */ { man_ign_pre, NULL }, /* ft */ { man_OP_pre, NULL }, /* OP */ + { man_literal_pre, NULL }, /* EX */ + { man_literal_pre, NULL }, /* EE */ }; /* @@ -634,7 +636,7 @@ static int man_literal_pre(MAN_ARGS) { - if (MAN_nf != n->tok) { + if (MAN_fi == n->tok || MAN_EE == n->tok) { print_otag(h, TAG_BR, 0, NULL); mh->fl &= ~MANH_LITERAL; } else diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c index 5a7ed353fe0..62e57feb5b6 100644 --- a/usr.bin/mandoc/man_macro.c +++ b/usr.bin/mandoc/man_macro.c @@ -1,4 +1,4 @@ -/* $Id: man_macro.c,v 1.34 2012/02/26 19:41:27 schwarze Exp $ */ +/* $Id: man_macro.c,v 1.35 2012/06/02 20:07:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -81,6 +81,8 @@ const struct man_macro __man_macros[MAN_MAX] = { { in_line_eoln, 0 }, /* in */ { in_line_eoln, 0 }, /* ft */ { in_line_eoln, 0 }, /* OP */ + { in_line_eoln, MAN_BSCOPE }, /* EX */ + { in_line_eoln, MAN_BSCOPE }, /* EE */ }; const struct man_macro * const man_macros = __man_macros; diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 7660ae8ef47..ba7ae8bfc5f 100644 --- a/usr.bin/mandoc/man_term.c +++ b/usr.bin/mandoc/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.82 2012/02/26 19:41:27 schwarze Exp $ */ +/* $Id: man_term.c,v 1.83 2012/06/02 20:07:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -123,6 +123,8 @@ static const struct termact termacts[MAN_MAX] = { { pre_in, NULL, MAN_NOTEXT }, /* in */ { pre_ft, NULL, MAN_NOTEXT }, /* ft */ { pre_OP, NULL, 0 }, /* OP */ + { pre_literal, NULL, 0 }, /* EX */ + { pre_literal, NULL, 0 }, /* EE */ }; @@ -239,7 +241,7 @@ pre_literal(DECL_ARGS) term_newln(p); - if (MAN_nf == n->tok) + if (MAN_nf == n->tok || MAN_EX == n->tok) mt->fl |= MANT_LITERAL; else mt->fl &= ~MANT_LITERAL; diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c index 9f898e9ecf3..674e92ffb72 100644 --- a/usr.bin/mandoc/man_validate.c +++ b/usr.bin/mandoc/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.52 2012/02/26 19:41:27 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.53 2012/06/02 20:07:09 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org> @@ -110,6 +110,8 @@ static const struct man_valid man_valids[MAN_MAX] = { { NULL, NULL }, /* in */ { NULL, posts_ft }, /* ft */ { NULL, posts_eq2 }, /* OP */ + { NULL, posts_nf }, /* EX */ + { NULL, posts_fi }, /* EE */ }; |