* tmac/doc.tmac (doc-do-func, doc-do-func-args): Don't print a comma
[s-roff.git] / tmac / doc-common
blob30f16bce7ce370dd8aff553c0a220bb717f6ee5e
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
19 .\"
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
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)doc-common  8.1 (Berkeley) 06/08/93
33 .\"
34 .\"     %beginstrip%
37 .\" Macro Identifiers.  For each user macro a corresponding register with
38 .\" the same name must exist.  Its value must not be zero.
40 .nr %A 1
41 .nr %B 1
42 .nr %D 1
43 .nr %I 1
44 .nr %J 1
45 .nr %N 1
46 .nr %O 1
47 .nr %P 1
48 .nr %Q 1
49 .nr %R 1
50 .nr %T 1
51 .nr %V 1
52 .nr Ac 3
53 .nr Ad 12n
54 .nr An 12n
55 .nr Ao 12n
56 .nr Ap 2
57 .nr Aq 12n
58 .nr Ar 12n
59 .nr At 1
60 .nr Bc 3
61 .nr Bf 8n\" ?
62 .nr Bk 8n\" ?
63 .nr Bl 1
64 .nr Bo 12n
65 .nr Bq 12n
66 .nr Brc 3
67 .nr Bro 12n
68 .nr Brq 12n
69 .nr Bsx 1
70 .nr Bt 8n\" ?
71 .nr Bx 1
72 .nr Cd 12n
73 .nr Cm 10n
74 .nr D1 8n\" ?
75 .nr Dc 3
76 .nr Dl 8n\" ?
77 .nr Dt 8n\" ?
78 .nr Do 12n
79 .nr Dq 12n
80 .nr Ds 6n\" many manpages still use this as a -width value
81 .nr Dv 12n
82 .nr Ec 3
83 .nr Ef 8n\" ?
84 .nr Ek 8n\" ?
85 .nr El 1
86 .nr Em 10n
87 .nr En 12n
88 .nr Eo 12n
89 .nr Eq 12n
90 .nr Er 17n
91 .nr Es 12n
92 .nr Ev 15n
93 .nr Ex 1
94 .nr Fa 12n
95 .nr Fc 3
96 .nr Fd 12n\" ?
97 .nr Fl 10n
98 .nr Fn 16n
99 .nr Fo 16n
100 .nr Fr 12n\" ?
101 .nr Ft 8n\" ?
102 .nr Fx 1
103 .nr Ic 10n
104 .nr In 12n
105 .nr It 8n\" ?
106 .nr Lb 11n
107 .nr Li 16n
108 .nr Lk 6n\" ?
109 .nr Lp 8n\" ?
110 .nr Me 6n
111 .nr Ms 6n
112 .nr Mt 6n\" ?
113 .nr Nd 8n\" ?
114 .nr Nm 10n
115 .nr No 12n
116 .nr Ns 2
117 .nr Nx 1
118 .nr Oc 3
119 .nr Oo 10n
120 .nr Op 14n
121 .nr Os 6n\" ?
122 .nr Ox 1
123 .nr Pa 32n
124 .nr Pc 3
125 .nr Pf 12n
126 .nr Po 12n
127 .nr Pp 8n\" ?
128 .nr Pq 12n
129 .nr Qc 3
130 .nr Ql 16n
131 .nr Qo 12n
132 .nr Qq 12n
133 .nr Rv 1
134 .nr Sc 3
135 .nr Sh 8n
136 .nr Sm 8n\" ?
137 .nr So 12n
138 .nr Sq 12n
139 .nr Ss 8n
140 .nr St 8n\" ?
141 .nr Sx 16n
142 .nr Sy 6n
143 .nr Ta 2
144 .nr Tn 10n
145 .nr Ud 8n\" ?
146 .nr Ux 1
147 .nr Va 12n
148 .nr Vt 8n\" ?
149 .nr Xc 3
150 .nr Xo 1
151 .nr Xr 10n
154 .\" macros which must be processed after the closing delimiter of `Op'
155 .\" and friends
156 .ds doc-after-Ao
157 .ds doc-after-Bo
158 .ds doc-after-Bro
159 .ds doc-after-Do
160 .ds doc-after-Eo
161 .ds doc-after-Fo
162 .ds doc-after-Ns
163 .ds doc-after-Oo
164 .ds doc-after-Po
165 .ds doc-after-Qo
166 .ds doc-after-So
167 .ds doc-after-Xo
170 .nr doc-display-indent 6n
173 .\" space strings
175 .ds doc-soft-space " \"
176 .ds doc-hard-space \~
177 .ds doc-tab \t
183 .\" punctuation values (suffix=3, prefix=4)
185 .nr doc-punct. 3
186 .nr doc-punct, 3
187 .nr doc-punct: 3
188 .nr doc-punct; 3
189 .nr doc-punct( 4
190 .nr doc-punct) 3
191 .nr doc-punct[ 4
192 .nr doc-punct] 3
193 .nr doc-punct? 3
194 .nr doc-punct! 3
197 .\" header assembly macros
199 .\" NS doc-document-title global string
200 .\" NS   the title of the manual page
202 .ds doc-document-title UNTITLED
205 .\" NS doc-volume global string
206 .\" NS   the volume where the manual page belongs to
208 .ds doc-volume LOCAL
211 .\" NS doc-section global string
212 .\" NS   the manual section
214 .ds doc-section Null
217 .\" NS Dt user macro (not parsed, not callable)
218 .\" NS   document title
219 .\" NS
220 .\" NS modifies:
221 .\" NS   doc-document-title
222 .\" NS   doc-section
223 .\" NS   doc-volume
224 .\" NS
225 .\" NS local variables:
226 .\" NS   doc-volume-as-XXX
227 .\" NS   doc-volume-ds-XXX
228 .\" NS
229 .\" NS width register `Dt' set above
231 .\" an alternative, more detailed scheme for naming the manual sections
233 .ds doc-volume-operating-system BSD
234 .nr doc-volume-operating-system-ateol 0
235 .ds doc-volume-ds-1 General Commands Manual
236 .ds doc-volume-ds-2 System Calls Manual
237 .ds doc-volume-ds-3 Library Functions Manual
238 .ds doc-volume-ds-4 Kernel Interfaces Manual
239 .ds doc-volume-ds-5 File Formats Manual
240 .ds doc-volume-ds-6 Games Manual
241 .ds doc-volume-ds-7 Miscellaneous Information Manual
242 .ds doc-volume-ds-8 System Manager's Manual
243 .ds doc-volume-ds-9 Kernel Developer's Manual
245 .ds doc-volume-ds-USD   User's Supplementary Documents
246 .ds doc-volume-ds-PS1   Programmer's Supplementary Documents
247 .ds doc-volume-ds-AMD   Ancestral Manual Documents
248 .ds doc-volume-ds-SMM   System Manager's Manual
249 .ds doc-volume-ds-URM   User's Reference Manual
250 .ds doc-volume-ds-PRM   Programmer's Manual
251 .ds doc-volume-ds-KM    Kernel Manual
252 .ds doc-volume-ds-IND   Manual Master Index
253 .ds doc-volume-ds-LOCAL Local Manual
254 .ds doc-volume-ds-CON   Contributed Software Manual
256 .als doc-volume-ds-MMI doc-volume-ds-IND
257 .als doc-volume-ds-LOC doc-volume-ds-LOCAL
259 .ds doc-volume-as-alpha    Alpha
260 .als doc-volume-as-Alpha doc-volume-as-alpha
261 .ds doc-volume-as-amiga    Amiga
262 .ds doc-volume-as-arc      Arc
263 .ds doc-volume-as-arm26    ARM26
264 .ds doc-volume-as-arm32    ARM32
265 .ds doc-volume-as-atari    Atari
266 .ds doc-volume-as-bebox    BEbox
267 .ds doc-volume-as-cobalt   Cobalt
268 .ds doc-volume-as-evbsh3   Evbsh3
269 .ds doc-volume-as-hp300    HP300
270 .ds doc-volume-as-hpcmips  HPcmips
271 .ds doc-volume-as-i386     i386
272 .ds doc-volume-as-luna68k  luna68k
273 .ds doc-volume-as-m68k     m68k
274 .ds doc-volume-as-mac68k   mac68k
275 .ds doc-volume-as-macppc   macppc
276 .ds doc-volume-as-mips     MIPS
277 .ds doc-volume-as-mmeye    mmeye
278 .ds doc-volume-as-mvme68k  mvme68k
279 .ds doc-volume-as-news68k  news68k
280 .ds doc-volume-as-newsmips newsmips
281 .ds doc-volume-as-next68k  next68k
282 .ds doc-volume-as-ofppc    ofppc
283 .ds doc-volume-as-pc532    pc532
284 .ds doc-volume-as-pmax     pmax
285 .ds doc-volume-as-powerpc  powerpc
286 .ds doc-volume-as-prep     prep
287 .ds doc-volume-as-sgimips  sgimips
288 .ds doc-volume-as-sh3      sh3
289 .ds doc-volume-as-sparc    SPARC
290 .ds doc-volume-as-sparc64  sparc64
291 .ds doc-volume-as-sun3     sun3
292 .ds doc-volume-as-tahoe    Tahoe
293 .ds doc-volume-as-vax      VAX
294 .ds doc-volume-as-x68k     x68k
296 .de Dt
297 .  \" reset default arguments
298 .  ds doc-document-title UNTITLED
299 .  ds doc-volume LOCAL
300 .  ds doc-section Null
302 .  if !"\$1"" \
303 .    ds doc-document-title "\$1
305 .  if !"\$2"" \{\
306 .    ds doc-section \$2
307 .    ie \B\a\$2\a \{\
308 .      if ((\$2 >= 1) & (\$2 <= 9)) \{\
309 .        ie \n[doc-volume-operating-system-ateol] \{\
310 .          ds doc-volume "\*[doc-volume-ds-\$2] \*[doc-volume-operating-system]
311 .          if \A\a\$3\a \{\
312 .            if d doc-volume-as-\$3 \
313 .              as doc-volume "/\*[doc-volume-as-\$3]
314 .        \}\}
315 .        el \{\
316 .          ds doc-volume "\*[doc-volume-operating-system]
317 .          if \A\a\$3\a \{\
318 .            if d doc-volume-as-\$3 \
319 .              as doc-volume "/\*[doc-volume-as-\$3]
320 .          \}
321 .          as doc-volume " \*[doc-volume-ds-\$2]
322 .    \}\}\}
323 .    el \{\
324 .      ie "\$2"unass" \
325 .        ds doc-volume DRAFT
326 .      el \{ .ie "\$2"draft" \
327 .        ds doc-volume DRAFT
328 .      el .if "\$2"paper" \
329 .        ds doc-volume UNTITLED
330 .      \}\}
331 .      if \A\a\$3\a \{\
332 .        if d doc-volume-ds-\$3 \
333 .          ds doc-volume "\*[doc-volume-ds-\$3]
334 .  \}\}\}
336 .  if !"\$3"" \
337 .    if "\*[doc-volume]"LOCAL" \
338 .      ds doc-volume \$3
342 .\" NS doc-operating-system global string
343 .\" NS   the exact version of the operating system
344 .\" NS
345 .\" NS override this in `mdoc.local', if necessary
347 .ds doc-operating-system BSD
350 .\" NS Os user macro (not parsed, not callable)
351 .\" NS   operating system
352 .\" NS
353 .\" NS modifies:
354 .\" NS   doc-operating-system
355 .\" NS
356 .\" NS local variables:
357 .\" NS   doc-operating-system-XXX-XXX
358 .\" NS
359 .\" NS width register `Os' set above
361 .ds doc-operating-system-ATT-7   7th\~Edition
362 .als doc-operating-system-ATT-7th doc-operating-system-ATT-7
363 .ds doc-operating-system-ATT-3   System\~III
364 .als doc-operating-system-ATT-III doc-operating-system-ATT-3
365 .ds doc-operating-system-ATT-V   System\~V
366 .ds doc-operating-system-ATT-V.2 System\~V Release\~2
367 .ds doc-operating-system-ATT-V.3 System\~V Release\~3
368 .ds doc-operating-system-ATT-V.4 System\~V Release\~4
370 .ds doc-operating-system-BSD-3    3rd\~Berkeley Distribution
371 .ds doc-operating-system-BSD-4    4th\~Berkeley Distribution
372 .ds doc-operating-system-BSD-4.1  4.1\~Berkeley Distribution
373 .ds doc-operating-system-BSD-4.2  4.2\~Berkeley Distribution
374 .ds doc-operating-system-BSD-4.3  4.3\~Berkeley Distribution
375 .ds doc-operating-system-BSD-4.3T 4.3-Tahoe Berkeley Distribution
376 .ds doc-operating-system-BSD-4.3R 4.3-Reno Berkeley Distribution
377 .als doc-operating-system-BSD-4.3t doc-operating-system-BSD-4.3T
378 .als doc-operating-system-BSD-4.3r doc-operating-system-BSD-4.3R
379 .ds doc-operating-system-BSD-4.4  4.4BSD
381 .ds doc-operating-system-NetBSD-0.8  0.8
382 .ds doc-operating-system-NetBSD-0.8a 0.8A
383 .ds doc-operating-system-NetBSD-0.9  0.9
384 .ds doc-operating-system-NetBSD-0.9a 0.9A
385 .ds doc-operating-system-NetBSD-1.0  1.0
386 .ds doc-operating-system-NetBSD-1.0a 1.0A
387 .ds doc-operating-system-NetBSD-1.1  1.1
388 .ds doc-operating-system-NetBSD-1.2  1.2
389 .ds doc-operating-system-NetBSD-1.2a 1.2A
390 .ds doc-operating-system-NetBSD-1.2b 1.2B
391 .ds doc-operating-system-NetBSD-1.2c 1.2C
392 .ds doc-operating-system-NetBSD-1.2d 1.2D
393 .ds doc-operating-system-NetBSD-1.2e 1.2E
394 .ds doc-operating-system-NetBSD-1.3  1.3
395 .ds doc-operating-system-NetBSD-1.3a 1.3A
396 .ds doc-operating-system-NetBSD-1.4  1.4
397 .ds doc-operating-system-NetBSD-1.5  1.5
398 .ds doc-operating-system-NetBSD-1.6  1.6
400 .ds doc-operating-system-FreeBSD-1.0     1.0
401 .ds doc-operating-system-FreeBSD-1.1     1.1
402 .ds doc-operating-system-FreeBSD-1.1.5   1.1.5
403 .ds doc-operating-system-FreeBSD-1.1.5.1 1.1.5.1
404 .ds doc-operating-system-FreeBSD-2.0     2.0
405 .ds doc-operating-system-FreeBSD-2.0.5   2.0.5
406 .ds doc-operating-system-FreeBSD-2.1     2.1
407 .ds doc-operating-system-FreeBSD-2.1.5   2.1.5
408 .ds doc-operating-system-FreeBSD-2.1.6   2.1.6
409 .ds doc-operating-system-FreeBSD-2.1.7   2.1.7
410 .ds doc-operating-system-FreeBSD-2.2     2.2
411 .ds doc-operating-system-FreeBSD-2.2.1   2.2.1
412 .ds doc-operating-system-FreeBSD-2.2.2   2.2.2
413 .ds doc-operating-system-FreeBSD-2.2.5   2.2.5
414 .ds doc-operating-system-FreeBSD-2.2.6   2.2.6
415 .ds doc-operating-system-FreeBSD-2.2.7   2.2.7
416 .ds doc-operating-system-FreeBSD-2.2.8   2.2.8
417 .ds doc-operating-system-FreeBSD-3.0     3.0
418 .ds doc-operating-system-FreeBSD-3.1     3.1
419 .ds doc-operating-system-FreeBSD-3.2     3.2
420 .ds doc-operating-system-FreeBSD-3.3     3.3
421 .ds doc-operating-system-FreeBSD-3.4     3.4
422 .ds doc-operating-system-FreeBSD-3.5     3.5
423 .ds doc-operating-system-FreeBSD-4.0     4.0
424 .ds doc-operating-system-FreeBSD-4.1     4.1
425 .ds doc-operating-system-FreeBSD-4.1.1   4.1.1
426 .ds doc-operating-system-FreeBSD-4.2     4.2
427 .ds doc-operating-system-FreeBSD-4.3     4.3
428 .ds doc-operating-system-FreeBSD-4.4     4.4
429 .ds doc-operating-system-FreeBSD-4.5     4.5
430 .ds doc-operating-system-FreeBSD-4.6     4.6
431 .ds doc-operating-system-FreeBSD-4.6.2   4.6.2
432 .ds doc-operating-system-FreeBSD-4.7     4.7
433 .ds doc-operating-system-FreeBSD-4.8     4.8
434 .ds doc-operating-system-FreeBSD-5.0     5.0
436 .de Os
437 .  if "\$1"" \
438 .    return
440 .  ie        "\$1"ATT" \{\
441 .    ds doc-operating-system AT&T
442 .    if \A\a\$2\a \{\
443 .      ie d doc-operating-system-ATT-\$2 \
444 .        as doc-operating-system " \*[doc-operating-system-ATT-\$2]
445 .      el \
446 .        as doc-operating-system " UNIX
447 .  \}\}
448 .  el \{ .ie "\$1"BSD" \{\
449 .    if \A\a\$2\a \{\
450 .      ie d doc-operating-system-BSD-\$2 \
451 .        ds doc-operating-system "\*[doc-operating-system-BSD-\$2]
452 .      el \
453 .        tm mdoc warning: .Os: Unknown BSD version `\$2' (#\n[.c])
454 .  \}\}
455 .  el \{ .ie "\$1"FreeBSD" \{\
456 .    ds doc-operating-system FreeBSD
457 .    if \A\a\$2\a \{\
458 .      ie d doc-operating-system-FreeBSD-\$2 \
459 .        as doc-operating-system \~\*[doc-operating-system-FreeBSD-\$2]
460 .      el \
461 .        tm mdoc warning: .Os: Unknown FreeBSD version `\$2' (#\n[.c])
462 .  \}\}
463 .  el \{ .ie "\$1"NetBSD" \{\
464 .    ds doc-operating-system NetBSD
465 .    if \A\a\$2\a \{\
466 .      ie d doc-operating-system-NetBSD-\$2 \
467 .        as doc-operating-system \~\*[doc-operating-system-NetBSD-\$2]
468 .      el \
469 .        tm mdoc warning: .Os: Unknown NetBSD version `\$2' (#\n[.c])
470 .  \}\}
471 .  el \{\
472 .    ds doc-operating-system \$1
473 .    if !"\$2"" \
474 .      as doc-operating-system " \$2
475 .  \}\}\}\}
479 .\" NS doc-date-string global string
480 .\" NS   the manual page date as set by `Dd'
482 .ds doc-date-string
485 .\" NS Dd user macro (not parsed, not callable)
486 .\" NS   set document date
487 .\" NS
488 .\" NS modifies:
489 .\" NS   doc-date-string
490 .\" NS
491 .\" NS local variables:
492 .\" NS   doc-date-XXX
493 .\" NS
494 .\" NS width register `Dd' set above
496 .ds doc-date-1  January
497 .ds doc-date-2  February
498 .ds doc-date-3  March
499 .ds doc-date-4  April
500 .ds doc-date-5  May
501 .ds doc-date-6  June
502 .ds doc-date-7  July
503 .ds doc-date-8  August
504 .ds doc-date-9  September
505 .ds doc-date-10 October
506 .ds doc-date-11 November
507 .ds doc-date-12 December
509 .de Dd
510 .  \" XXX: why do we need gX?
511 .  if "\*[doc-date-string]"" \
512 .    nr gX 1
514 .  ie \n[.$] \{\
515 .    ie (\n[.$] == 3) \
516 .      ds doc-date-string \$1\~\$2 \$3
517 .    el \{\
518 .      ds doc-date-string "\*[doc-date-\n[mo]]
519 .      as doc-date-string \~\n[dy], \n[year]
520 .    \}
521 .  \}
522 .  el \
523 .    ds doc-date-string Epoch
527 .\" NS doc-hyphen-flags global register
528 .\" NS   the parameter for the `.hy' request
529 .\" NS
530 .\" NS override this in `mdoc.local', if necessary.
532 .nr doc-hyphen-flags 12
535 .\" NS doc-header macro
536 .\" NS   print page header
537 .\" NS
538 .\" NS local variables:
539 .\" NS   doc-reg-dh
540 .\" NS   doc-reg-dh1
542 .de doc-header
543 .  ev doc-env-dh
544 .  doc-setup-page-layout
545 .  if !\n[cR] \
546 .    sp \n[doc-header-space]u
547 .  nr doc-reg-dh \w'\*[doc-caption-font]\*[doc-header-string]\f[]'
548 .  nr doc-reg-dh1 \w'\*[doc-caption-font2]\*[doc-volume]\f[]'
549 .  if (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\
550 .    while (\n[doc-reg-dh] + \n[doc-reg-dh1] + \n[doc-reg-dh] >= \n[.lt]) \{\
551 .      substring doc-header-string 0 -2
552 .      nr doc-reg-dh \w'\*[doc-caption-font]\*[doc-header-string]\|.\|.\|.\f[]'
553 .    \}
554 .    as doc-header-string "\|.\|.\|.
555 .  \}
556 .  tl \a\*[doc-caption-font]\*[doc-header-string]\f[]\a\*[doc-caption-font2]\*[doc-volume]\f[]\a\*[doc-caption-font]\*[doc-header-string]\f[]\a
557 .  ie !\n[cR] \
558 .    sp \n[doc-header-space]u
559 .  el \
560 .    sp 1v
561 .  ev
562 .  ns
566 .\" NS doc-footer macro
567 .\" NS   print page footer
569 .de doc-footer
570 .  ie \n[cR] \
571 .    br
572 .  el \{\
573 .    ev doc-caption-enviroment
574 .    doc-setup-page-layout
575 .    sp \n[doc-footer-space]u
576 .    ie \n[D] \{\
577 .      ie o \
578 .        tl \a%\a\*[doc-caption-font2]\*[doc-date-string]\f[]\a\*[doc-caption-font]\*[doc-operating-system]\f[]\a
579 .      el \
580 .        tl \a\*[doc-caption-font]\*[doc-operating-system]\f[]\a\*[doc-caption-font2]\*[doc-date-string]\f[]\a%\a
581 .    \}
582 .    el \
583 .      tl \a\*[doc-caption-font]\*[doc-operating-system]\f[]\a\*[doc-caption-font2]\*[doc-date-string]\f[]\a%\a
584 .    bp
585 .    ev
586 .  \}
590 .\" NS doc-check-depth macro
591 .\" NS   check paired macros
593 .de doc-check-depth
594 .  if \n[doc-list-depth] \{\
595 .    tm mdoc warning: A .Bl directive has no matching .El (#\n[.c])
596 .    nr doc-list-depth 0
597 .  \}
598 .  if \n[doc-display-depth] \{\
599 .    tm mdoc warning: A .Bd directive has no matching .Ed (#\n[.c])
600 .    nr doc-display-depth 0
601 .  \}
602 .  if \n[doc-fontmode-depth] \{\
603 .    tm mdoc warning: A .Bf directive has no matching .Ef (#\n[.c])
604 .    nr doc-fontmode-depth 0
605 .  \}
609 .\" NS doc-end-macro macro
610 .\" NS   finish output
612 .de doc-end-macro
613 .  \" We may still have a partial line in the environment.  If this is the
614 .  \" case, and we happen to be on the last line of the page, the `.fl'
615 .  \" request will cause the page to be ejected and troff will immediately
616 .  \" exit.  If we are in nroff mode, this would be unfortunate, since we
617 .  \" would never get a chance to output the footer.  So we fudge the page
618 .  \" length to make sure that the last page is never ejected until we want
619 .  \" it to be.
621 .  if \n[cR] \
622 .    pl +3v
623 .  fl
625 .  doc-check-depth
627 .  if \n[cR] \{\
628 .    sp
629 .    tl \a\*[doc-caption-font]\*[doc-operating-system]\f[]\a\*[doc-caption-font2]\*[doc-date-string]\f[]\a\*[doc-caption-font]\*[doc-operating-system]\f[]\a
630 .    \" suppress empty lines after the footer
631 .    pl \n[nl]u
632 .  \}
636 .\" NS doc-paragraph macro
637 .\" NS   insert a paragraph
639 .de doc-paragraph
640 .  sp \n[doc-paragraph-space]u
641 .  if !\n[cR] \
642 .    ne 2
643 .  ns
647 .\" NS Pp user macro (not parsed, not callable)
648 .\" NS   new paragraph
649 .\" NS
650 .\" NS width register `Pp' set above
652 .als Pp doc-paragraph
655 .\" NS Lp user macro (not parsed, not callable)
656 .\" NS   same as .Pp
657 .\" NS
658 .\" NS width register `Lp' set above
660 .als Lp doc-paragraph
663 .de LP
664 .  tm Not a \-mdoc command: .LP (#\n[.c])
668 .de PP
669 .  tm Not a \-mdoc command: .PP (#\n[.c])
673 .de pp
674 .  tm Not a \-mdoc command: .pp (#\n[.c])
678 .de SH
679 .  tm Not a \-mdoc command: .SH (#\n[.c])
683 .\" NS Nd user macro (not parsed, not callable)
684 .\" NS   print name description
685 .\" NS
686 .\" NS width register `Nd' set above
688 .de Nd
689 .  nop \[em] \$*
693 .\" NS doc-in-synopsis-section global register (bool)
694 .\" NS   whether we are in the `synopsis' section
696 .nr doc-in-synopsis-section 0
699 .\" NS doc-in-see-also-section global register (bool)
700 .\" NS   whether we are in the `see also' section
702 .nr doc-in-see-also-section 0
705 .\" NS doc-in-files-section global register (bool)
706 .\" NS   whether we are in the `files' section
708 .nr doc-in-files-section 0
711 .\" NS doc-in-authors-section global register (bool)
712 .\" NS   whether we are in the `authors' section
714 .nr doc-in-authors-section 0
717 .\" NS doc-first-parameter macro
718 .\" NS   return first parameter
719 .\" NS
720 .\" NS local variables:
721 .\" NS   doc-str-dfp
723 .de doc-first-parameter
724 .  ds doc-str-dfp "\$1
728 .\" NS Sh user macro (not callable)
729 .\" NS   section headers
730 .\" NS
731 .\" NS modifies:
732 .\" NS   doc-func-args-processed
733 .\" NS   doc-func-count
734 .\" NS   doc-in-authors-section
735 .\" NS   doc-in-files-section
736 .\" NS   doc-in-see-also-section
737 .\" NS   doc-in-synopsis-section
738 .\" NS   doc-indent-synopsis
739 .\" NS   doc-indent-synopsis-active
740 .\" NS   doc-is-func
741 .\" NS   doc-num-func-args
742 .\" NS
743 .\" NS local variables:
744 .\" NS   doc-reg-Sh
745 .\" NS   doc-reg-Sh1
746 .\" NS   doc-section-XXX
747 .\" NS
748 .\" NS width register `Sh' set in doc-common
750 .ds doc-section-name        NAME
751 .ds doc-section-synopsis    SYNOPSIS
752 .ds doc-section-description DESCRIPTION
753 .ds doc-section-see-also    SEE
754 .ds doc-section-files       FILES
755 .ds doc-section-authors     AUTHORS
757 .de Sh
758 .  ie \n[doc-arg-limit] \{\
759 .    \" we only allow `Sh' within `Sh'; it will change the font back to
760 .    \" `doc-Sh-font'
761 .    ie "\*[doc-macro-name]"Sh" \{\
762 .      nr doc-arg-ptr +1
763 .      ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
764 .        nr doc-curr-font \n[.f]
765 .        nr doc-curr-size \n[.ps]
766 .        nop \*[doc-Sh-font]\c
767 .        doc-print-recursive
768 .      \}
769 .      el \{\
770 .        tm Usage: .Sh section_name ... (#\n[.c])
771 .        doc-reset-args
772 .    \}\}
773 .    el \{\
774 .      tm Usage: .Sh not callable by other macros (#\n[.c])
775 .      doc-reset-args
776 .  \}\}
777 .  el \{\
778 .    if !\n[.$] \{\
779 .      tm Usage: .Sh section_name ... (#\n[.c])
780 .      return
781 .    \}
783 .    ds doc-macro-name Sh
784 .    doc-parse-args \$@
786 .    if t \
787 .      ad
789 .    \" this resolves e.g. `.Sh "SEE ALSO"'
790 .    doc-first-parameter \$*
792 .    ie "\*[doc-str-dfp]"\*[doc-section-name]" \{\
793 .      doc-setup-header
794 .      in 0
795 .    \}
796 .    el \{\
797 .      nr doc-in-synopsis-section 0
798 .      nr doc-in-see-also-section 0
799 .      nr doc-in-files-section 0
800 .      nr doc-in-authors-section 0
802 .      ie        "\*[doc-str-dfp]"\*[doc-section-synopsis]" \{\
803 .        if t \
804 .          na
805 .        nr doc-in-synopsis-section 1
806 .        nr doc-indent-synopsis 0
807 .        nr doc-indent-synopsis-active 0
808 .      \}
809 .      el \{ .ie "\*[doc-str-dfp]"\*[doc-section-description]" \{\
810 .        nr doc-is-func 0
811 .        nr doc-func-count 0
812 .        nr doc-func-args-processed 0
813 .        nr doc-num-func-args 0
814 .      \}
815 .      el \{ .ie "\*[doc-str-dfp]"\*[doc-section-see-also]" \{\
816 .        if t \
817 .          na
818 .        nr doc-in-see-also-section 1
819 .      \}
820 .      el \{ .ie "\*[doc-str-dfp]"\*[doc-section-files]" \
821 .        nr doc-in-files-section 1
822 .      el .if    "\*[doc-str-dfp]"\*[doc-section-authors]" \
823 .        nr doc-in-authors-section 1
824 .      \}\}\}
826 .      in 0
827 .      nr doc-have-author 0
828 .    \}
830 .    doc-setup-page-layout
831 .    sp
832 .    ns
833 .    ta T .5i
834 .    if !\n[cR] \
835 .      ne 3
836 .    fi
838 .    if t \{\
839 .      nr doc-reg-Sh \n[.ss]
840 .      nr doc-reg-Sh1 \n[.sss]
841 .      ss (\n[.ss] * 5 / 3) (\n[.sss] * 5 / 3)
842 .    \}
844 .    nr doc-arg-ptr +1
845 .    nr doc-curr-font \n[.f]
846 .    nr doc-curr-size \n[.ps]
847 .    nop \*[doc-Sh-font]\c
848 .    doc-print-recursive
850 .    if t \
851 .      ss \n[doc-reg-Sh] \n[doc-reg-Sh1]
853 .    in +\n[doc-subheader-indent]u
854 .    ns
856 .    doc-check-depth
857 .  \}
861 .\" NS Ss user macro (not callable)
862 .\" NS   subsection
863 .\" NS
864 .\" NS local variable:
865 .\" NS   doc-reg-Ss
866 .\" NS   doc-reg-Ss1
867 .\" NS
868 .\" NS width register `Ss' set above
870 .de Ss
871 .  ie \n[doc-arg-limit] \{\
872 .    \" we only allow `Ss' within `Ss'; it will change the font back to
873 .    \" `doc-Sh-font'
874 .    ie "\*[doc-macro-name]"Ss" \{\
875 .      nr doc-arg-ptr +1
876 .      ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
877 .        nr doc-curr-font \n[.f]
878 .        nr doc-curr-size \n[.ps]
879 .        nop \*[doc-Sh-font]\c
880 .        doc-print-recursive
881 .      \}
882 .      el \{\
883 .        tm Usage: .Ss subsection_name ... (#\n[.c])
884 .        doc-reset-args
885 .    \}\}
886 .    el \{\
887 .      tm Usage: .Ss not callable by other macros (#\n[.c])
888 .      doc-reset-args
889 .  \}\}
890 .  el \{\
891 .    if !\n[.$] \{\
892 .      tm Usage: .Ss subsection_name ... (#\n[.c])
893 .      return
894 .    \}
896 .    ds doc-macro-name Ss
897 .    doc-parse-args \$@
899 .    sp
900 .    if !\n[cR] \
901 .      ne 3
902 .    ti -.25i
904 .    nr doc-reg-Ss \n[.ss]
905 .    nr doc-reg-Ss1 \n[.sss]
906 .    ss (\n[.ss] * 5 / 4) (\n[.sss] * 5 / 4)
908 .    nr doc-arg-ptr +1
909 .    nr doc-curr-font \n[.f]
910 .    nr doc-curr-size \n[.ps]
911 .    nop \*[doc-Sh-font]\c
912 .    doc-print-recursive
914 .    ss \n[doc-reg-Ss] \n[doc-reg-Ss1]
916 .    ta T .5i
917 .    if !\n[cR] \
918 .      ne 2
919 .    br
920 .    ns
922 .    doc-check-depth
923 .  \}
927 .\" NS Rd macro (not parsed, not callable)
928 .\" NS   print global register dump to stderr
929 .\" NS
930 .\" NS local variables:
931 .\" NS   doc-reg-Rd
933 .de Rd
934 .  tm MDOC GLOBAL REGISTER DUMP
935 .  tm doc-macro-name == `\*[doc-macro-name]'
936 .  tm doc-arg-limit == \n[doc-arg-limit]
937 .  tm doc-num-args == \n[doc-num-args]
938 .  tm doc-arg-ptr == \n[doc-arg-ptr]
940 .  nr doc-reg-Rd 1
941 .  while (\n[doc-reg-Rd] <= \n[doc-arg-limit]) \{\
942 .    tm doc-arg\n[doc-reg-Rd] == `\*[doc-arg\n[doc-reg-Rd]]'
943 .    tm doc-type\n[doc-reg-Rd] == \n[doc-type\n[doc-reg-Rd]]
944 .    tm doc-space\n[doc-reg-Rd] == `\*[doc-space\n[doc-reg-Rd]]'
945 .    nr doc-reg-Rd +1
946 .  \}
948 .  tm doc-curr-font == \n[doc-curr-font]
949 .  tm doc-curr-size == \n[doc-curr-size]
950 .  tm doc-indent-synopsis == \n[doc-indent-synopsis]
951 .  tm doc-indent-synopsis-active == \n[doc-indent-synopsis-active]
952 .  tm doc-have-decl == \n[doc-have-decl]
953 .  tm doc-have-var == \n[doc-have-var]
954 .  tm doc-command-name == `\*[doc-command-name]'
955 .  tm doc-quote-left == `\*[doc-quote-left]'
956 .  tm doc-quote-right == `\*[doc-quote-right]'
957 .  tm doc-nesting-level == \n[doc-nesting-level]
958 .  tm doc-in-list == \n[doc-in-list]
959 .  tm doc-space == `\*[doc-space]'
960 .  tm doc-saved-space == `\*[doc-saved-space]'
961 .  tm doc-space-mode == \n[doc-space-mode]
962 .  tm doc-have-space == \n[doc-have-space]
963 .  tm doc-have-slot == \n[doc-have-slot]
964 .  tm doc-keep-type == \n[doc-keep-type]
965 .  tm doc-display-depth == \n[doc-display-depth]
966 .  tm doc-is-compact == \n[doc-is-compact]
968 .  nr doc-reg-Rd 0
969 .  while (\n[doc-reg-Rd] <= \n[doc-display-depth]) \{\
970 .    tm doc-display-type-stack\n[doc-reg-Rd] == `\*[doc-display-type-stack\n[doc-reg-Rd]]'
971 .    tm doc-display-indent-stack\n[doc-reg-Rd] == \n[doc-display-indent-stack\n[doc-reg-Rd]]
972 .    tm doc-display-ad-stack\n[doc-reg-Rd] == \n[doc-display-ad-stack\n[doc-reg-Rd]]
973 .    tm doc-display-fi-stack\n[doc-reg-Rd] == \n[doc-display-fi-stack\n[doc-reg-Rd]]
974 .    tm doc-display-ft-stack\n[doc-reg-Rd] == \n[doc-display-ft-stack\n[doc-reg-Rd]]
975 .    tm doc-display-ps-stack\n[doc-reg-Rd] == \n[doc-display-ps-stack\n[doc-reg-Rd]]
976 .    nr doc-reg-Rd +1
977 .  \}
979 .  tm doc-fontmode-depth == \n[doc-fontmode-depth]
981 .  nr doc-reg-Rd 1
982 .  while (\n[doc-reg-Rd] <= \n[doc-fontmode-depth]) \{\
983 .    tm doc-fontmode-font-stack\n[doc-reg-Rd] == `\n[doc-fontmode-font-stack\n[doc-reg-Rd]]'
984 .    tm doc-fontmode-size-stack\n[doc-reg-Rd] == `\n[doc-fontmode-size-stack\n[doc-reg-Rd]]'
985 .    nr doc-reg-Rd +1
986 .  \}
988 .  tm doc-list-depth == \n[doc-list-depth]
990 .  nr doc-reg-Rd 1
991 .  while (\n[doc-reg-Rd] <= \n[doc-list-depth]) \{\
992 .    tm doc-list-type-stack\n[doc-reg-Rd] == `\*[doc-list-type-stack\n[doc-reg-Rd]]'
993 .    tm doc-list-have-indent-stack\n[doc-reg-Rd] == \n[doc-list-have-indent-stack\n[doc-reg-Rd]]
994 .    tm doc-list-indent-stack\n[doc-reg-Rd] == \n[doc-list-indent-stack\n[doc-reg-Rd]]
995 .    tm doc-compact-list-stack\n[doc-reg-Rd] == \n[doc-compact-list-stack\n[doc-reg-Rd]]
996 .    tm doc-tag-prefix-stack\n[doc-reg-Rd] == `\*[doc-tag-prefix-stack\n[doc-reg-Rd]]'
997 .    tm doc-tag-width-stack\n[doc-reg-Rd] == `\*[doc-tag-width-stack\n[doc-reg-Rd]]'
998 .    tm doc-list-offset-stack\n[doc-reg-Rd] == \n[doc-list-offset-stack\n[doc-reg-Rd]]
999 .    tm doc-enum-list-count-stack\n[doc-reg-Rd] == \n[doc-enum-list-count-stack\n[doc-reg-Rd]]
1000 .    nr doc-reg-Rd +1
1001 .  \}
1003 .  tm doc-saved-Pa-font == `\*[doc-saved-Pa-font]'
1004 .  tm doc-curr-type == \n[doc-curr-type]
1005 .  tm doc-curr-arg == `\*[doc-curr-arg]'
1006 .  tm doc-diag-list-input-line-count == \n[doc-diag-list-input-line-count]
1007 .  tm doc-num-columns == \n[doc-num-columns]
1008 .  tm doc-column-indent-width == \n[doc-column-indent-width]
1009 .  tm doc-is-func == \n[doc-is-func]
1010 .  tm doc-have-old-func == \n[doc-have-old-func]
1011 .  tm doc-func-arg-count == \n[doc-func-arg-count]
1012 .  tm doc-func-arg == `\*[doc-func-arg]'
1013 .  tm doc-num-func-args == \n[doc-num-func-args]
1014 .  tm doc-func-args-processed == \n[doc-func-args-processed]
1015 .  tm doc-have-func == \n[doc-have-func]
1016 .  tm doc-is-reference == \n[doc-is-reference]
1017 .  tm doc-reference-count == \n[doc-reference-count]
1018 .  tm doc-author-count == \n[doc-author-count]
1020 .  nr doc-reg-Rd 0
1021 .  while (\n[doc-reg-Rd] <= \n[doc-author-count]) \{\
1022 .    tm doc-author-name\n[doc-reg-Rd] == `\*[doc-author-name\n[doc-reg-Rd]]'
1023 .    nr doc-reg-Rd +1
1024 .  \}
1026 .  tm doc-book-count == \n[doc-book-count]
1027 .  tm doc-book-name == `\*[doc-book-name]'
1028 .  tm doc-date-count == \n[doc-date-count]
1029 .  tm doc-date == `\*[doc-date]'
1030 .  tm doc-publisher-count == \n[doc-publisher-count]
1031 .  tm doc-publisher-name == `\*[doc-publisher-name]'
1032 .  tm doc-journal-count == \n[doc-journal-count]
1033 .  tm doc-journal-name == `\*[doc-journal-name]'
1034 .  tm doc-issue-count == \n[doc-issue-count]
1035 .  tm doc-issue-name == `\*[doc-issue-name]'
1036 .  tm doc-optional-count == \n[doc-optional-count]
1037 .  tm doc-optional-string == `\*[doc-optional-string]'
1038 .  tm doc-page-number-count == \n[doc-page-number-count]
1039 .  tm doc-page-number-string == `\*[doc-page-number-string]'
1040 .  tm doc-corporate-count == \n[doc-corporate-count]
1041 .  tm doc-corporate-name == `\*[doc-corporate-name]'
1042 .  tm doc-report-count == \n[doc-report-count]
1043 .  tm doc-report-name == `\*[doc-report-name]'
1044 .  tm doc-reference-title-count == \n[doc-reference-title-count]
1045 .  tm doc-reference-title-name == `\*[doc-reference-title-name]'
1046 .  tm doc-reference-title-name-for-book == `\*[doc-reference-title-name-for-book]'
1047 .  tm doc-volume-count == \n[doc-volume-count]
1048 .  tm doc-volume-name == `\*[doc-volume-name]'
1049 .  tm doc-have-author == \n[doc-have-author]
1051 .  tm doc-document-title == `\*[doc-document-title]'
1052 .  tm doc-volume == `\*[doc-volume]'
1053 .  tm doc-section == `\*[doc-section]'
1054 .  tm doc-operating-system == `\*[doc-operating-system]'
1055 .  tm doc-date-string == `\*[doc-date-string]'
1056 .  tm doc-header-space == \n[doc-header-space]
1057 .  tm doc-footer-space == \n[doc-footer-space]
1058 .  tm doc-display-vertical == \n[doc-display-vertical]
1059 .  tm doc-header-string == `\*[doc-header-string]'
1060 .  tm doc-in-synopsis-section == \n[doc-in-synopsis-section]
1061 .  tm doc-in-see-also-section == \n[doc-in-see-also-section]
1062 .  tm doc-in-files-section == \n[doc-in-files-section]
1063 .  tm doc-in-authors-section == \n[doc-in-authors-section]
1065 .  tm END OF GLOBAL REGISTER DUMP
1071 .\" EOF