1 .\" Copyright (c) 1991 The Regents of the University of California.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)doc-nroff 5.6 (Berkeley) 8/5/91
37 .\" use -rcR=0 to have multiple pages instead of a single, very long page
41 .\" the `doc-xx-font' strings must not be empty!
43 .ds doc-caption-font \f[R]
44 .ds doc-caption-font2 \f[R]
65 .ds doc-Tn-font-shape \f[R]
70 .ds doc-left-parenthesis \f[R](\f[P]
71 .ds doc-right-parenthesis \f[R])\f[P]
74 .ds doc-left-bracket \f[R][\f[P]
75 .ds doc-right-bracket \f[R]]\f[P]
78 .ds doc-punct-chars {. , : ; ( ) [ ]}
79 .nr doc-subheader-indent .5i
80 .nr doc-paragraph-space 1v
83 .ds doc-digit-string \0\0
84 .nr doc-digit-width \w'\0\0'u
85 .nr doc-fixed-width \w'0'
89 .\" NS doc-header-space global register
90 .\" NS the space between header and body
92 .nr doc-header-space 0
95 .\" NS doc-footer-space global register
96 .\" NS the space between body and footer
98 .nr doc-footer-space 0
101 .\" NS doc-display-vertical global register
102 .\" NS vertical space between list elements etc.
104 .nr doc-display-vertical 0
107 .\" NS doc-setup-page-layout macro
108 .\" NS set up page layout
111 .\" NS doc-header-space, doc-footer-space, doc-display-vertical
113 .de doc-setup-page-layout
115 . nr doc-header-space 0
117 . nr doc-header-space .5i
118 . nr doc-footer-space .5i
124 . nr doc-display-vertical 1v
133 .\" Lq and Rq are `official'
139 .ds doc-left-singlequote `
140 .ds doc-right-singlequote '
144 .\" math stuff -- all macro names are `official'
157 .\" NS doc-header-string global string
158 .\" NS the final string used for the manual page header
160 .ds doc-header-string
163 .\" NS doc-setup-header macro
164 .\" NS install and initialize header and footer support
167 .\" NS doc-header-string
171 . ds doc-header-string "\*[doc-document-title]
172 . if !"\*[doc-section]"Null" \
173 . as doc-header-string (\*[doc-section])
179 . wh -1.167i doc-footer
182 . if ((\n[nl] == 0) : (\n[nl] == -1)) \
189 .\" NS doc-get-width macro
190 .\" NS computes the width of a string as a multiple of `doc-fixed-width':
191 .\" NS `.doc-get-width string'
197 . nr doc-width \w
\a\$1
\a
198 . ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
199 . ie (\n[doc-width] % \n[doc-fixed-width]) \
200 . nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
202 . nr doc-width (\n[doc-width] / \n[doc-fixed-width])
209 .\" NS doc-get-arg-width macro
210 .\" NS computes the width of an argument as a multiple of
211 .\" NS `doc-fixed-width': `.doc-get-arg-width arg-index'
216 .de doc-get-arg-width
217 . nr doc-width \w
\a\*[doc-arg\$1]
\a
218 . ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
219 . ie (\n[doc-width] % \n[doc-fixed-width]) \
220 . nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
222 . nr doc-width (\n[doc-width] / \n[doc-fixed-width])
230 .\" NS quoted literal define
233 .\" NS doc-macro-name, doc-quote-left, doc-quote-right
235 .\" NS width register `Ql' set in doc-common
238 . if !\n[doc-arg-limit] \{\
240 . ds doc-macro-name Ql
242 . tm Usage: .Ql argument ... \*[doc-punct-chars] (#\n[.c])
245 . ds doc-quote-left "\*[doc-left-singlequote]
246 . ds doc-quote-right "\*[doc-right-singlequote]
248 . doc-enclose-string \$@
252 .\" NS doc-in-see-also-section global register (bool)
253 .\" NS whether we are in the `see also' section
255 .nr doc-in-see-also-section 0
258 .\" NS doc-in-files-section global register (bool)
259 .\" NS whether we are in the `files' section
261 .nr doc-in-files-section 0
264 .\" NS doc-in-authors-section global register (bool)
265 .\" NS whether we are in the `authors' section
267 .nr doc-in-authors-section 0
270 .\" NS Sh user macro (not parsed, not callable)
271 .\" NS section headers
274 .\" NS doc-in-synopsis-count, doc-indent-synopsis, doc-in-files-section,
275 .\" NS doc-in-see-also-section, doc-in-authors-section, doc-is-func,
276 .\" NS doc-func-count, doc-func-args-processed, doc-num-func-args,
279 .\" NS local variable:
282 .\" NS width register `Sh' set in doc-common
285 . nr doc-in-synopsis-count 0
286 . nr doc-indent-synopsis 0
293 . nr doc-in-see-also-section 0
294 . nr doc-in-files-section 0
295 . nr doc-in-authors-section 0
297 . if "\$1"SYNOPSIS" \
298 . nr doc-in-synopsis-count 1
299 . if "\$1"DESCRIPTION" \{\
301 . nr doc-func-count 0
302 . nr doc-func-args-processed 0
303 . nr doc-num-func-args 0
307 . nr doc-in-see-also-section 1
309 . nr doc-in-files-section 1
311 . nr doc-in-authors-section 1
314 . nr doc-have-author 0
317 . doc-setup-page-layout
326 . nop \*[doc-Sh-font]\$1\c
328 . while (\n[doc-reg-Sh] <= \n[.$]) \{\
329 . nop \& \$[\n[doc-reg-Sh]]\c
335 . tm Usage: .Sh section_name ... (#\n[.c])
337 . in (\n[.i]u + \n[doc-subheader-indent]u)