Print this page
Latest round of fixes per RM and AL.  Fix bugs found in man.c.

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man5/mdoc.5
          +++ new/usr/src/man/man5/mdoc.5
↓ open down ↓ 9 lines elided ↑ open up ↑
  10   10  .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  11   11  .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  12   12  .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  13   13  .\"
  14   14  .\"
  15   15  .\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  16   16  .\" Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
  17   17  .\" Copyright 2012 Nexenta Systems, Inc. All rights reserved.
  18   18  .\" Copyright 2014 Garrett D'Amore <garrett@dmaore.org>
  19   19  .\"
  20      -.Dd Jul 16, 2014
       20 +.Dd Jul 19, 2014
  21   21  .Dt MDOC 5
  22   22  .Os
  23   23  .Sh NAME
  24   24  .Nm mdoc
  25   25  .Nd semantic markup language for formatting manual pages
  26   26  .Sh DESCRIPTION
  27   27  The
  28   28  .Nm mdoc
  29   29  language supports authoring of manual pages for the
  30   30  .Xr man 1
↓ open down ↓ 102 lines elided ↑ open up ↑
 133  133  \&.Op Fl options
 134  134  \&.Ar
 135  135  \&.Sh DESCRIPTION
 136  136  The
 137  137  \&.Nm
 138  138  utility processes files ...
 139  139  \&.\e\(dq .Sh IMPLEMENTATION NOTES
 140  140  \&.\e\(dq .Sh RETURN VALUES
 141  141  \&.\e\(dq For sections 2, 3, & 9 only.
 142  142  \&.\e\(dq .Sh ENVIRONMENT
 143      -\&.\e\(dq For sections 1, 1M, 5, & 6 only.
      143 +\&.\e\(dq For sections 1, 1M, and 5.
 144  144  \&.\e\(dq .Sh FILES
 145  145  \&.\e\(dq .Sh EXIT STATUS
 146      -\&.\e\(dq For sections 1, 1M, & 6 only.
      146 +\&.\e\(dq For sections 1, 1M, and 5.
 147  147  \&.\e\(dq .Sh EXAMPLES
 148  148  \&.\e\(dq .Sh DIAGNOSTICS
 149      -\&.\e\(dq For sections 1, 1M, 5, 6, & 7 only.
 150  149  \&.\e\(dq .Sh ERRORS
 151  150  \&.\e\(dq For sections 2, 3, & 9 only.
 152  151  \&.\e\(dq .Sh ARCHITECTURE
 153  152  \&.\e\(dq .Sh CODE SET INDEPENDENCE
 154  153  \&.\e\(dq For sections 1, 1M, & 3 only.
 155  154  \&.\e\(dq .Sh INTERFACE STABILITY
 156  155  \&.\e\(dq .Sh MT-LEVEL
 157  156  \&.\e\(dq For sections 2 & 3 only.
      157 +\&.\e\(dq .Sh SECURITY
 158  158  \&.\e\(dq .Sh SEE ALSO
 159  159  \&.\e\(dq .Xr foobar 1
 160  160  \&.\e\(dq .Sh STANDARDS
 161  161  \&.\e\(dq .Sh HISTORY
 162  162  \&.\e\(dq .Sh AUTHORS
 163  163  \&.\e\(dq .Sh CAVEATS
 164  164  \&.\e\(dq .Sh BUGS
 165      -\&.\e\(dq .Sh SECURITY CONSIDERATIONS
 166      -\&.\e\(dq Not used in OpenBSD.
 167  165  .Ed
 168  166  .Pp
 169  167  The sections in an
 170  168  .Nm
 171  169  document are conventionally ordered as they appear above.
 172  170  Sections should be composed as follows:
 173  171  .Bl -ohang -offset Ds
 174  172  .It Em NAME
 175  173  The name(s) and a one line description of the documented material.
 176  174  The syntax for this as follows:
↓ open down ↓ 25 lines elided ↑ open up ↑
 202  200  .Bd -literal -offset indent
 203  201  \&.Lb libarm
 204  202  .Ed
 205  203  .Pp
 206  204  See
 207  205  .Sx \&Lb .
 208  206  .It Em SYNOPSIS
 209  207  Documents the utility invocation syntax, function call syntax, or device
 210  208  configuration.
 211  209  .Pp
 212      -For the first, utilities (sections 1, 1M, and 6), this is
      210 +For the first, utilities (sections 1 and 1M), this is
 213  211  generally structured as follows:
 214  212  .Bd -literal -offset indent
 215  213  \&.Nm bar
 216  214  \&.Op Fl v
 217  215  \&.Op Fl o Ar file
 218  216  \&.Op Ar
 219  217  \&.Nm foo
 220  218  \&.Op Fl v
 221  219  \&.Op Fl o Ar file
 222  220  \&.Op Ar
 223  221  .Ed
 224  222  .Pp
 225  223  Commands should be ordered alphabetically.
 226  224  .Pp
 227      -For the second, function calls (sections 2, 3, 9):
      225 +For the second, function calls (sections 2, 3, 7I, 7P, 9):
 228  226  .Bd -literal -offset indent
 229  227  \&.In header.h
 230  228  \&.Vt extern const char *global;
 231  229  \&.Ft "char *"
 232  230  \&.Fn foo "const char *src"
 233  231  \&.Ft "char *"
 234  232  \&.Fn bar "const char *src"
 235  233  .Ed
 236  234  .Pp
 237  235  Ordering of
 238  236  .Sx \&In ,
 239  237  .Sx \&Vt ,
 240  238  .Sx \&Fn ,
 241  239  and
 242  240  .Sx \&Fo
 243  241  macros should follow C header-file conventions.
 244  242  .Pp
 245      -And for the third, configurations (section 7):
      243 +And for the third, configurations (section 7D):
 246  244  .Bd -literal -offset indent
 247      -\&.Cd \(dqit* at isa? port 0x2e\(dq
 248      -\&.Cd \(dqit* at isa? port 0x4e\(dq
      245 +\&.Pa /dev/device_node
 249  246  .Ed
 250  247  .Pp
 251  248  Manuals not in these sections generally don't need a
 252  249  .Em SYNOPSIS .
 253  250  .Pp
 254  251  Some macros are displayed differently in the
 255  252  .Em SYNOPSIS
 256  253  section, particularly
 257  254  .Sx \&Nm ,
 258  255  .Sx \&Cd ,
↓ open down ↓ 86 lines elided ↑ open up ↑
 345  342  .Sx \&Ev .
 346  343  .It Em FILES
 347  344  Documents files used.
 348  345  It's helpful to document both the file name and a short description of how
 349  346  the file is used (created, modified, etc.).
 350  347  .Pp
 351  348  See
 352  349  .Sx \&Pa .
 353  350  .It Em EXIT STATUS
 354  351  This section documents the
 355      -command exit status for section 1, 6, and 8 utilities.
      352 +command exit status for sections 1 and 1M.
 356  353  Historically, this information was described in
 357  354  .Em DIAGNOSTICS ,
 358  355  a practise that is now discouraged.
 359  356  .Pp
 360  357  See
 361  358  .Sx \&Ex .
 362  359  .It Em EXAMPLES
 363  360  Example usages.
 364  361  This often contains snippets of well-formed, well-tested invocations.
 365  362  Make sure that examples work properly!
 366  363  .It Em DIAGNOSTICS
 367      -Documents error conditions.
 368      -This is most useful in section 4 manuals.
 369      -Historically, this section was used in place of
      364 +Documents error and diagnostic messages displayed to the user or
      365 +sent to logs. Note that exit
      366 +status and return values should be documented in the
 370  367  .Em EXIT STATUS
 371      -for manuals in sections 1, 6, and 8; however, this practise is
 372      -discouraged.
      368 +and
      369 +.Em RETURN VALUES
      370 +sections.
 373  371  .Pp
 374  372  See
 375  373  .Sx \&Bl
 376  374  .Fl diag .
 377  375  .It Em ERRORS
 378  376  Documents error handling in sections 2, 3, and 9.
 379  377  .Pp
 380  378  See
 381  379  .Sx \&Er .
 382  380  .It Em ARCHITECTURE
↓ open down ↓ 101 lines elided ↑ open up ↑
 484  482  by ensuring that it blocks signals when acquiring locks.
 485  483  .It Nm Safe with Exections
 486  484  As for
 487  485  .Nm Safe
 488  486  but with specific exceptions noted.
 489  487  .It Nm MT-Safe with Exections
 490  488  As for
 491  489  .Nm MT-Safe
 492  490  but with specific exceptions noted.
 493  491  .El
      492 +.It Em SECURITY
      493 +Documents any security precautions that operators should consider.
 494  494  .It Em SEE ALSO
 495  495  References other manuals with related topics.
 496  496  This section should exist for most manuals.
 497  497  Cross-references should conventionally be ordered first by section, then
 498  498  alphabetically.
 499  499  .Pp
 500  500  References to other documentation concerning the topic of the manual page,
 501  501  for example authoritative books or journal articles, may also be
 502  502  provided in this section.
 503  503  .Pp
↓ open down ↓ 17 lines elided ↑ open up ↑
 521  521  Authors should generally be noted by both name and email address.
 522  522  .Pp
 523  523  See
 524  524  .Sx \&An .
 525  525  .It Em CAVEATS
 526  526  Common misuses and misunderstandings should be explained
 527  527  in this section.
 528  528  .It Em BUGS
 529  529  Known bugs, limitations, and work-arounds should be described
 530  530  in this section.
 531      -.It Em SECURITY CONSIDERATIONS
 532      -Documents any security precautions that operators should consider.
 533  531  .El
 534  532  .Sh MACRO OVERVIEW
 535  533  This overview is sorted such that macros of similar purpose are listed
 536  534  together, to help find the best macro for any given purpose.
 537  535  Deprecated macros are not included in the overview, but can be found below
 538  536  in the alphabetical
 539  537  .Sx MACRO REFERENCE .
 540  538  .Ss Document preamble and NAME section macros
 541  539  .Bl -column "Brq, Bro, Brc" description
 542  540  .It Sx \&Dd Ta document date: Ar month day , year
↓ open down ↓ 695 lines elided ↑ open up ↑
1238 1236  See also
1239 1237  .Sx \&At ,
1240 1238  .Sx \&Bsx ,
1241 1239  .Sx \&Dx ,
1242 1240  .Sx \&Fx ,
1243 1241  .Sx \&Nx ,
1244 1242  .Sx \&Ox ,
1245 1243  and
1246 1244  .Sx \&Ux .
1247 1245  .Ss \&Cd
1248      -Kernel configuration declaration.
1249      -This denotes strings accepted by
1250      -.Xr config 8 .
1251      -It is most often used in section 4 manual pages.
     1246 +Kernel configuration declaration.  It is found in pages for
     1247 +.Bx
     1248 +and not used here.
1252 1249  .Pp
1253 1250  Examples:
1254 1251  .Dl \&.Cd device le0 at scode?
1255 1252  .Pp
1256 1253  .Em Remarks :
1257 1254  this macro is commonly abused by using quoted literals to retain
1258 1255  whitespace and align consecutive
1259 1256  .Sx \&Cd
1260 1257  declarations.
1261 1258  This practise is discouraged.
↓ open down ↓ 280 lines elided ↑ open up ↑
1542 1539  Examples:
1543 1540  .Dl \&.Ev DISPLAY
1544 1541  .Dl \&.Ev PATH
1545 1542  .Pp
1546 1543  See also
1547 1544  .Sx \&Dv
1548 1545  for general constants.
1549 1546  .Ss \&Ex
1550 1547  Insert a standard sentence regarding command exit values of 0 on success
1551 1548  and >0 on failure.
1552      -This is most often used in section 1, 6, and 8 manual pages.
     1549 +This is most often used in section 1 and 1M manual pages.
1553 1550  Its syntax is as follows:
1554 1551  .Pp
1555 1552  .D1 Pf \. Sx \&Ex Fl std Op Ar utility ...
1556 1553  .Pp
1557 1554  If
1558 1555  .Ar utility
1559 1556  is not specified, the document's name set by
1560 1557  .Sx \&Nm
1561 1558  is used.
1562 1559  Multiple
↓ open down ↓ 395 lines elided ↑ open up ↑
1958 1955  .Sx \&Sh
1959 1956  invocation.
1960 1957  Do not assume this behaviour: some
1961 1958  .Xr whatis 1
1962 1959  database generators are not smart enough to parse more than the line
1963 1960  arguments and will display macros verbatim.
1964 1961  .Pp
1965 1962  See also
1966 1963  .Sx \&Nm .
1967 1964  .Ss \&Nm
1968      -The name of the manual page, or \(em in particular in section 1, 6,
1969      -and 8 pages \(em of an additional command or feature documented in
     1965 +The name of the manual page, or \(em in particular in section 1
     1966 +and 1M pages \(em of an additional command or feature documented in
1970 1967  the manual page.
1971 1968  When first invoked, the
1972 1969  .Sx \&Nm
1973 1970  macro expects a single argument, the name of the manual page.
1974 1971  Usually, the first invocation happens in the
1975 1972  .Em NAME
1976 1973  section of the page.
1977 1974  The specified name will be remembered and used whenever the macro is
1978 1975  called again without arguments later in the page.
1979 1976  The
↓ open down ↓ 96 lines elided ↑ open up ↑
2076 2073  .Bd -literal -offset indent -compact
2077 2074  \&.Oo
2078 2075  \&.Op Fl flag Ns Ar value
2079 2076  \&.Oc
2080 2077  .Ed
2081 2078  .Ss \&Op
2082 2079  Optional part of a command line.
2083 2080  Prints the argument(s) in brackets.
2084 2081  This is most often used in the
2085 2082  .Em SYNOPSIS
2086      -section of section 1 and 8 manual pages.
     2083 +section of section 1 and 1M manual pages.
2087 2084  .Pp
2088 2085  Examples:
2089 2086  .Dl \&.Op \&Fl a \&Ar b
2090 2087  .Dl \&.Op \&Ar a | b
2091 2088  .Pp
2092 2089  See also
2093 2090  .Sx \&Oo .
2094 2091  .Ss \&Os
2095 2092  Document operating system version.
2096 2093  This is the mandatory third macro of
↓ open down ↓ 1098 lines elided ↑ open up ↑
3195 3192  The
3196 3193  .Nm
3197 3194  language first appeared as a troff macro package in
3198 3195  .Bx 4.4 .
3199 3196  It was later significantly updated by Werner Lemberg and Ruslan Ermilov
3200 3197  in groff-1.17.
3201 3198  The standalone implementation that is part of the
3202 3199  .Xr mandoc 1
3203 3200  utility written by Kristaps Dzonsons appeared in
3204 3201  .Ox 4.6 .
3205      -in July, 2014.
3206 3202  .Sh AUTHORS
3207 3203  The
3208 3204  .Nm
3209 3205  reference was written by
3210 3206  .An Kristaps Dzonsons ,
3211 3207  .Mt kristaps@bsd.lv .
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX