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-ditroff 5.8 (Berkeley) 8/5/91
37 .\" use -rC=1 to number pages continuously
41 .\" use -rcR=1 to force the creation of a single, very long page
48 .\" the `doc-xx-font' strings must not be empty!
50 .ds doc-caption-font \f[R]\s[\n[.s]]
51 .ds doc-caption-font2 \f[R]\s[\n[.s]]
52 .ds doc-Ad-font \f[I]\s[\n[.s]]
53 .ds doc-Ar-font \f[CO]\s[\n[.s]]
54 .ds doc-Cm-font \f[CB]\s[\n[.s]]
55 .ds doc-Em-font \f[I]\s[\n[.s]]
56 .ds doc-Er-font \f[C]\s[\n[.s]]
57 .ds doc-Ev-font \f[C]\s[\n[.s]]
58 .ds doc-Fa-font \f[CO]\s[\n[.s]]
59 .ds doc-Fd-font \f[CB]\s[\n[.s]]
60 .ds doc-Fl-font \f[CB]\s[\n[.s]]
61 .ds doc-Fn-font \f[CB]\s[\n[.s]]
62 .ds doc-Ft-font \f[CO]\s[\n[.s]]
63 .ds doc-Ic-font \f[CB]\s[\n[.s]]
65 .ds doc-Me-font \f[B]\s[\n[.s]]
66 .ds doc-Nm-font \f[CB]\s[\n[.s]]
67 .ds doc-No-font \f[R]\s[\n[.s]]
68 .ds doc-Pa-font \f[C]\s[\n[.s]]
69 .ds doc-Sh-font \f[B]\s[\n[.s]]
70 .ds doc-Sy-font \f[B]\s[\n[.s]]
71 .ds doc-Sx-font \f[B]\s[\n[.s]]
72 .ds doc-Tn-font-shape \f[R]
73 .ds doc-Tn-font-size \s[(\n[.s] - 1)]
74 .ds doc-Va-font \f[I]\s[\n[.s]]
75 .ds doc-Xr-font \f[C]\s[\n[.s]]
77 .ds doc-left-parenthesis \f[R]\|(\|\f[P]\s[\n[.s]]
78 .ds doc-right-parenthesis \f[R]\|)\|\f[P]\s[\n[.s]]
79 .ds lp \f[R](\f[P]\s[\n[.s]]
80 .ds rp \f[R])\f[P]\s[\n[.s]]
81 .ds doc-left-bracket \f[R]\^[\^\f[P]\s[\n[.s]]
82 .ds doc-right-bracket \f[R]\^]\f[P]\s[\n[.s]]
86 .ds doc-punct-chars \f[R]{\ .\ ,\ :\ ;\ (\ )\ [\ ]\ \f[R]}
87 .nr doc-subheader-indent (\w
\a\f[C],
\au * 5u)
88 .nr doc-paragraph-space .5v
90 .ds doc-digit-string \0
91 .nr doc-digit-width \w'\0'u
92 .nr doc-fixed-width \w
\a\f[C]0
\a
97 .\" NS doc-header-space global register
98 .\" NS the space between header and body
100 .nr doc-header-space 0
103 .\" NS doc-footer-space global register
104 .\" NS the space between body and footer
106 .nr doc-footer-space 0
109 .\" NS doc-display-vertical global register
110 .\" NS vertical space between list elements etc.
112 .nr doc-display-vertical 0
115 .\" NS doc-setup-page-layout macro
116 .\" NS set up page layout
119 .\" NS doc-header-space, doc-footer-space, doc-display-vertical
121 .de doc-setup-page-layout
122 . nr doc-header-space .5i
123 . nr doc-footer-space .5i
129 . nr doc-display-vertical .5v
136 .\" Lq and Rq are `official'
142 .ds doc-right-singlequote \&'
143 .ds doc-left-singlequote \&`
147 .\" math stuff -- all macro names are `official'
162 .\" NS doc-header-string global string
163 .\" NS the final string used for the manual page header
165 .ds doc-header-string
168 .\" NS doc-setup-header macro
169 .\" NS install and initialize header and footer support
172 .\" NS doc-header-string
175 . ds doc-header-string "\*[doc-document-title]
176 . if !"\*[doc-section]"Null" \
177 . as doc-header-string \|(\|\*[doc-section]\|)
180 . wh -1.25i doc-footer
184 . ds doc-command-name
188 . \" Don't set the page number if this is the first page,
189 . \" in case the user has used -n.
199 .\" NS doc-get-width macro
200 .\" NS computes the width of a string as a multiple of `doc-fixed-width':
201 .\" NS `.doc-get-width string'
207 . nr doc-width \w
\a\f[C]\$1
\a
208 . ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
209 . ie (\n[doc-width] % \n[doc-fixed-width]) \
210 . nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
212 . nr doc-width (\n[doc-width] / \n[doc-fixed-width])
223 .\" NS doc-get-arg-width macro
224 .\" NS computes the width of an argument as a multiple of
225 .\" NS `doc-fixed-width': `.doc-get-arg-width arg-index'
230 .de doc-get-arg-width
231 . nr doc-width \w
\a\f[C]\*[doc-arg\$1]
\a
232 . ie (\n[doc-width] >= \n[doc-fixed-width]) \{\
233 . ie (\n[doc-width] % \n[doc-fixed-width]) \
234 . nr doc-width ((\n[doc-width] / \n[doc-fixed-width]) + 1)
236 . nr doc-width (\n[doc-width] / \n[doc-fixed-width])
248 .\" NS quoted literal define
251 .\" NS doc-macro-name, doc-argXXX, doc-arg-ptr, doc-typeXXX, doc-spaceXXX,
252 .\" NS doc-quote-right, doc-quote-left, doc-arg-limit
254 .\" NS local variables:
255 .\" NS doc-reg-Ql, doc-reg-Ql1
257 .\" NS width register `Ql' set in doc-common
260 . if !\n[doc-arg-limit] \{\
262 . ds doc-macro-name Ql
266 . tm Usage: .Ql argument ... \*[doc-punct-chars] (#\n[.c])
269 . nr doc-reg-Ql (\n[doc-arg-ptr] + 1)
270 . doc-get-arg-width \n[doc-reg-Ql]
272 . ie (\n[doc-width] > 2) \
275 . ie \n[doc-arg-ptr] \{\
276 . \" we replace `Ql' with `Li'
277 . ds doc-arg\n[doc-arg-ptr] Li
281 . \" if .Ql has been called directly, we must shift all elements in
282 . \" the argument vector to the right so that we can insert `Li'
283 . nr doc-reg-Ql \n[doc-arg-limit]
284 . nr doc-reg-Ql1 (\n[doc-arg-limit] + 1)
285 . while \n[doc-reg-Ql] \{\
286 . rn doc-arg\n[doc-reg-Ql] doc-arg\n[doc-reg-Ql1]
287 . rn doc-type\n[doc-reg-Ql] doc-type\n[doc-reg-Ql1]
288 . rn doc-space\n[doc-reg-Ql] doc-space\n[doc-reg-Ql1]
295 . nr doc-arg-limit +1
298 . ds doc-quote-left "\*[doc-left-singlequote]
299 . ds doc-quote-right "\*[doc-right-singlequote]
305 .\" NS doc-in-see-also-section global register (bool)
306 .\" NS whether we are in the `see also' section
308 .nr doc-in-see-also-section 0
311 .\" NS doc-in-files-section global register (bool)
312 .\" NS whether we are in the `files' section
314 .nr doc-in-files-section 0
317 .\" NS doc-in-authors-section global register (bool)
318 .\" NS whether we are in the `authors' section
320 .nr doc-in-authors-section 0
324 .\" NS section headers
327 .\" NS doc-in-synopsis-count, doc-indent-synopsis, doc-in-see-also-section,
328 .\" NS doc-in-files-section, doc-in-authors-section, doc-have-author,
329 .\" NS doc-is-func, doc-func-count, doc-func-args-processed,
330 .\" NS doc-num-func-args, doc-func-arg
332 .\" NS local variable:
335 .\" NS width register `Sh' set in doc-common
338 . nr doc-in-synopsis-count 0
339 . nr doc-indent-synopsis 0
348 . nr doc-in-see-also-section 0
349 . nr doc-in-files-section 0
350 . nr doc-in-authors-section 0
352 . if "\$1"SYNOPSIS" \{\
354 . nr doc-in-synopsis-count 1
356 . if "\$1"DESCRIPTION" \{\
358 . nr doc-func-count 0
359 . nr doc-func-args-processed 0
360 . nr doc-num-func-args 0
364 . nr doc-in-see-also-section 1
368 . nr doc-in-files-section 1
370 . nr doc-in-authors-section 1
373 . nr doc-have-author 0
376 . doc-setup-page-layout
385 . nop \*[doc-Sh-font]\$1\c
387 . while (\n[doc-reg-Sh] <= \n[.$]) \{\
388 . nop \& \|\$[\n[doc-reg-Sh]]\c
394 . tm Usage: .Sh section_name ... (#\n[.c])
396 . in (\n[.i]u + \n[doc-subheader-indent]u)