diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-31 01:05:32 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-31 01:05:32 +0000 |
commit | 58fb8b7dc007dbb0556480e6fe27825c26dc52bd (patch) | |
tree | 5f84222f0fdfc777e2c726e085e9d5ee41b3f3fe | |
parent | 31f620c338e4694ae72d96330057b88f2e65f394 (diff) | |
download | mandoc-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.7 | 5 | ||||
-rw-r--r-- | mdoc.7 | 5 | ||||
-rw-r--r-- | mdoc.h | 1 | ||||
-rw-r--r-- | mdoc_validate.c | 3 |
4 files changed, 14 insertions, 0 deletions
@@ -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 @@ -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 @@ -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, |