aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-31 01:05:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-31 01:05:32 +0000
commitb937567eadd652635bc2b6f42ca06e3679e4cd41 (patch)
tree1ed237e1172735ca2cd4fc636999791803fcf32f
parent910342c02ed6728e8edd08d68a1f3d32ded25b7c (diff)
downloadmandoc-b937567eadd652635bc2b6f42ca06e3679e4cd41.tar.gz
mandoc-b937567eadd652635bc2b6f42ca06e3679e4cd41.tar.zst
mandoc-b937567eadd652635bc2b6f42ca06e3679e4cd41.zip
Support the CONTEXT section for kernel manual pages found in Solaris and
OpenBSD manuals. It describes which contexts you can call functions in. from dlg@, ok jmc@ deraadt@
-rw-r--r--man.79
-rw-r--r--mdoc.79
-rw-r--r--mdoc.h3
-rw-r--r--mdoc_validate.c5
4 files changed, 20 insertions, 6 deletions
diff --git a/man.7 b/man.7
index 08f43dfb..62e04826 100644
--- a/man.7
+++ b/man.7
@@ -1,4 +1,4 @@
-.\" $Id: man.7,v 1.125 2014/03/17 06:57:48 schwarze Exp $
+.\" $Id: man.7,v 1.126 2014/03/31 01:05:32 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -16,7 +16,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: March 17 2014 $
+.Dd $Mdocdate: March 31 2014 $
.Dt MAN 7
.Os
.Sh NAME
@@ -106,6 +106,8 @@ file for a utility
\efBprogname\efR [\efB\e-options\efR] \efIfile ...\efR
\&.SH DESCRIPTION
The \efBfoo\efR utility processes files ...
+\&.\e\(dq .Sh CONTEXT
+\&.\e\(dq For section 9 functions only.
\&.\e\(dq .SH IMPLEMENTATION NOTES
\&.\e\(dq Not used in OpenBSD.
\&.\e\(dq .SH RETURN VALUES
@@ -171,6 +173,9 @@ This expands upon the brief, one-line description in
.Em NAME .
It usually contains a break-down of the options (if documenting a
command).
+.It Em CONTEXT
+This section lists the contexts in which functions can be called in section 9.
+The contexts are autoconf, process, or interrupt.
.It Em IMPLEMENTATION NOTES
Implementation-specific notes should be kept here.
This is useful when implementing standard functions that may have side
diff --git a/mdoc.7 b/mdoc.7
index 44a0717a..2b58495b 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -1,4 +1,4 @@
-.\" $Id: mdoc.7,v 1.227 2014/02/16 14:26:55 schwarze Exp $
+.\" $Id: mdoc.7,v 1.228 2014/03/31 01:05:32 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2010, 2011, 2013 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 16 2014 $
+.Dd $Mdocdate: March 31 2014 $
.Dt MDOC 7
.Os
.Sh NAME
@@ -135,6 +135,8 @@ file for a utility
The
\&.Nm
utility processes files ...
+\&.\e\(dq .Sh CONTEXT
+\&.\e\(dq For section 9 functions only.
\&.\e\(dq .Sh IMPLEMENTATION NOTES
\&.\e\(dq Not used in OpenBSD.
\&.\e\(dq .Sh RETURN VALUES
@@ -318,6 +320,9 @@ macro followed by a non-standard section name, and each having
several subsections, like in the present
.Nm
manual.
+.It Em CONTEXT
+This section lists the contexts in which functions can be called in section 9.
+The contexts are autoconf, process, or interrupt.
.It Em IMPLEMENTATION NOTES
Implementation-specific notes should be kept here.
This is useful when implementing standard functions that may have side
diff --git a/mdoc.h b/mdoc.h
index ac8bed8d..9d970a5b 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -1,4 +1,4 @@
-/* $Id: mdoc.h,v 1.127 2014/03/30 19:47:48 schwarze Exp $ */
+/* $Id: mdoc.h,v 1.128 2014/03/31 01:05:32 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -199,6 +199,7 @@ enum mdoc_sec {
SEC_LIBRARY, /* LIBRARY */
SEC_SYNOPSIS, /* SYNOPSIS */
SEC_DESCRIPTION, /* DESCRIPTION */
+ SEC_CONTEXT, /* CONTEXT */
SEC_IMPLEMENTATION, /* IMPLEMENTATION NOTES */
SEC_RETURN_VALUES, /* RETURN VALUES */
SEC_ENVIRONMENT, /* ENVIRONMENT */
diff --git a/mdoc_validate.c b/mdoc_validate.c
index ffe93e5b..ce5c6f27 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.207 2014/03/30 23:28:06 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.208 2014/03/31 01:05:32 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -332,6 +332,7 @@ static const char * const secnames[SEC__MAX] = {
"LIBRARY",
"SYNOPSIS",
"DESCRIPTION",
+ "CONTEXT",
"IMPLEMENTATION NOTES",
"RETURN VALUES",
"ENVIRONMENT",
@@ -2040,6 +2041,8 @@ post_sh_head(POST_ARGS)
break;
if (*mdoc->meta.msec == '3')
break;
+ /* FALLTHROUGH */
+ case (SEC_CONTEXT):
if (*mdoc->meta.msec == '9')
break;
mandoc_msg(MANDOCERR_SECMSEC, mdoc->parse,