summaryrefslogtreecommitdiffstats
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
commit58fb8b7dc007dbb0556480e6fe27825c26dc52bd (patch)
tree5f84222f0fdfc777e2c726e085e9d5ee41b3f3fe
parent31f620c338e4694ae72d96330057b88f2e65f394 (diff)
downloadmandoc-58fb8b7dc007dbb0556480e6fe27825c26dc52bd.tar.gz
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.75
-rw-r--r--mdoc.75
-rw-r--r--mdoc.h1
-rw-r--r--mdoc_validate.c3
4 files changed, 14 insertions, 0 deletions
diff --git a/man.7 b/man.7
index be2260ac..e72c27a7 100644
--- a/man.7
+++ b/man.7
@@ -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 5d20e7e2..7c004f0e 100644
--- a/mdoc.7
+++ b/mdoc.7
@@ -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 e4144406..daf02d1c 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -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 e659f4d4..6f78f7b2 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -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,