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 5.8 (Berkeley) 8/5/91
34 .\" Modified by jjc@jclark.com as follows: the doc-* files are assumed to be
35 .\" installed as mdoc/doc-* rather than tmac.doc-* (the filename
36 .\" `tmac.doc-common' would be too long); when using groff, the doc-* files
37 .\" are loaded using the `mso' request.
39 .\" Modified by wl@gnu.org to make it more readable: using long names and
40 .\" many groff features, updating and extending documentation.
44 . ab This version of mdoc can be run with groff only!
52 .\" Load start-up files
53 .ie t .mso mdoc/doc-ditroff.new
54 .el .mso mdoc/doc-nroff.new
56 .mso mdoc/doc-common.new
57 .mso mdoc/doc-syms.new
60 .\" NS doc-inline-debug register (bool)
61 .\" NS inline debug mode (inline if 1, to stderr if 0 (default))
63 .nr doc-inline-debug 0
66 .\" NS doc-debug register (bool)
67 .\" NS debug mode (1 if active, 0 otherwise (default))
73 .\" NS start/stop debug mode (`.Db'/`.Db on'/`.Db off')
75 .\" NS without argument, toggle debug status
93 . ie \n[doc-debug] \{\
105 .\" NS doc-macro-name string
106 .\" NS name of calling request (set in each user-requestable macro)
111 .\" NS doc-args-processed register
112 .\" NS arguments processed so far
114 .nr doc-args-processed 0
117 .\" NS doc-num-args register
118 .\" NS number of arguments (must be set to \n[.$] prior to
119 .\" NS doc-parse-arg-vector request)
124 .\" NS doc-arg-ptr register
125 .\" NS argument pointer
130 .\" NS doc-argXXX string
131 .\" NS argument vector
134 .\" NS doc-typeXXX string
135 .\" NS argument type vector (`macro', `string', `punct-suffix',
136 .\" NS `punct-prefix')
139 .\" NS doc-spaceXXX string
143 .\" NS doc-parse-args macro
144 .\" NS parse arguments (recursively) (`.doc-parse-args arg ...')
148 .\" NS doc-argXXX, doc-typeXXX, doc-spaceXXX
150 .\" NS local variables:
151 .\" NS doc-str-dpa, doc-reg-dpa, doc-reg-dpa1
154 . nr doc-args-processed +1
156 . \" handle `|' specially for some requests
158 . if "\*[doc-macro-name]"Op" \
159 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
160 . if "\*[doc-macro-name]"Ar" \
161 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
162 . if "\*[doc-macro-name]"Fl" \
163 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
164 . if "\*[doc-macro-name]"Cm" \
165 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
166 . if "\*[doc-macro-name]"It" \
167 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
170 . ds doc-arg\n[doc-args-processed] "\$1
172 . \" get argument type and set spacing
173 . doc-get-arg-type* \n[doc-args-processed]
174 . ds doc-type\n[doc-args-processed] \*[doc-arg-type]
175 . doc-set-spacing-for-\*[doc-arg-type]
177 . if \n[doc-debug] \{\
178 . if "\*[doc-arg-type]"macro" \
179 . ds doc-str-dpa macro
180 . if "\*[doc-arg-type]"string" \
181 . ds doc-str-dpa string
182 . if "\*[doc-arg-type]"punct-suffix" \
183 . ds doc-str-dpa closing punctuation or suffix
184 . if "\*[doc-arg-type]"punct-prefix" \
185 . ds doc-str-dpa opening punctuation or prefix
187 . ie \n[doc-inline-debug] \{\
189 . nr doc-reg-dpa \n[.i]u
190 . in -\n[doc-reg-dpa]u
192 . if (\n[doc-args-processed] == 1) \{\
193 . nop \f[B]DEBUG(doc-parse-args) MACRO:\f[P] `.\*[doc-macro-name]'
194 . nop \& \f[B]Line #:\f[P] \n[.c]
196 . nop \t\f[B]Argc:\f[P] \n[doc-args-processed]
197 . nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-args-processed]]'
198 . nop \ \f[B]Length:\f[P] \n[doc-width]
199 . nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-args-processed]]'
200 . nop \ \f[B]Type:\f[P] \*[doc-str-dpa]
203 . if (\n[doc-args-processed] == 1) \{\
204 . tmc "DEBUG (doc-parse-args)
205 . tm1 " MACRO: `.\*[doc-macro-name]' Line #: \n[.c]
207 . tmc " Argc: \n[doc-args-processed]
208 . tmc " Argv: `\*[doc-arg\n[doc-args-processed]]'
209 . tm1 " Length: \n[doc-width]
210 . tmc " Space: `\*[doc-space\n[doc-args-processed]]'
211 . tm1 " Type: \*[doc-str-dpa]
215 . \" check whether we have processed the last parameter
216 . ie (\n[.$] == 1) \{\
219 . ie \n[doc-in-diversion] \{\
220 . if (\n[doc-nesting-level] > 1) \
221 . as doc-out-string "\*[doc-curr-space]
224 . if \n[doc-nesting-level] \
225 . if !\n[doc-func-arg-count] \
226 . as doc-out-string "\*[doc-curr-space]
229 . \" use space after last parameter as the current one
230 . ds doc-curr-space "\*[doc-space\n[doc-args-processed]]
232 . if \n[doc-debug] \{\
235 . ie \n[doc-inline-debug] \{\
236 . nop MACRO REQUEST: \t.\*[doc-macro-name]
237 . while (\n[doc-reg-dpa1] <= \n[doc-args-processed]) \{\
238 . nop "\*[doc-arg\n[doc-reg-dpa1]]"
242 . in \n[doc-reg-dpa]u
245 . tmc " MACRO REQUEST: .\*[doc-macro-name]
246 . while (\n[doc-reg-dpa1] <= \n[doc-args-processed]) \{\
247 . tmc " "\*[doc-arg\n[doc-reg-dpa1]]"
261 .\" NS doc-parse-arg-vector macro
262 .\" NS parse argument vector (recursive)
266 .\" NS doc-argXXX, doc-typeXXX, doc-spaceXXX
268 .\" NS local variables:
269 .\" NS doc-str-dpav, doc-reg-dpav, doc-reg-dpav1
271 .de doc-parse-arg-vector
272 . nr doc-args-processed +1
274 . \" handle `|' specially for some requests
275 . if "\*[doc-arg\n[doc-args-processed]]"|" \{\
276 . if "\*[doc-macro-name]"Op" \
277 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
278 . if "\*[doc-macro-name]"Ar" \
279 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
280 . if "\*[doc-macro-name]"Fl" \
281 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
282 . if "\*[doc-macro-name]"Cm" \
283 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
284 . if "\*[doc-macro-name]"It" \
285 . ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
288 . \" get argument type and set spacing
289 . doc-get-arg-type* \n[doc-args-processed]
290 . ds doc-type\n[doc-args-processed] \*[doc-arg-type]
291 . doc-set-spacing-for-\*[doc-arg-type]
293 . if \n[doc-debug] \{\
294 . if "\*[doc-arg-type]"macro" \
295 . ds doc-str-dpav macro
296 . if "\*[doc-arg-type]"string" \
297 . ds doc-str-dpav string
298 . if "\*[doc-arg-type]"punct-suffix" \
299 . ds doc-str-dpav closing punctuation or suffix
300 . if "\*[doc-arg-type]"punct-prefix" \
301 . ds doc-str-dpav opening punctuation or prefix
303 . ie \n[doc-inline-debug] \{\
305 . nr doc-reg-dpav \n[.i]u
306 . in -\n[doc-reg-dpav]u
308 . if (\n[doc-args-processed] == 1) \{\
309 . nop \f[B]DEBUG(doc-parse-arg-vector)
310 . nop MACRO:\f[P] `.\*[doc-macro-name]'
311 . nop \& \f[B]Line #:\f[P] \n[.c]
313 . nop \t\f[B]Argc:\f[P] \n[doc-args-processed]
314 . nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-args-processed]]'
315 . nop \ \f[B]Length:\f[P] \n[doc-width]
316 . nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-args-processed]]'
317 . nop \ \f[B]Type:\f[P] \*[doc-str-dpav]
320 . if (\n[doc-args-processed] == 1) \{\
321 . tmc "DEBUG(doc-parse-arg-vector)
322 . tm1 " MACRO: `.\*[doc-macro-name]' Line #: \n[.c]
324 . tmc " Argc: \n[doc-args-processed]
325 . tmc " Argv: `\*[doc-arg\n[doc-args-processed]]'
326 . tm1 " Length: \n[doc-width]
327 . tmc " Space: `\*[doc-space\n[doc-args-processed]]'
328 . tm1 " Type: \*[doc-str-dpav]
332 . \" check whether we have processed the last parameter
333 . ie (\n[doc-num-args] == 1) \{\
336 . ie \n[doc-in-diversion] \{\
337 . if (\n[doc-nesting-level] > 1) \
338 . as doc-out-string "\*[doc-curr-space]
341 . if \n[doc-nesting-level] \
342 . if !\n[doc-func-arg-count] \
343 . as doc-out-string "\*[doc-curr-space]
346 . \" use space after last parameter as the current one
347 . ds doc-curr-space "\*[doc-space\n[doc-args-processed]]
351 . if \n[doc-debug] \{\
354 . ie \n[doc-inline-debug] \{\
355 . nop \tMACRO REQUEST: .\*[doc-macro-name]
356 . while (\n[doc-reg-dpav1] <= \n[doc-args-processed]) \{\
357 . nop "\*[doc-arg\n[doc-reg-dpav1]]"
358 . nr doc-reg-dpav1 +1
361 . in \n[doc-reg-dpav]u
364 . tmc " MACRO REQUEST: .\*[doc-macro-name]
365 . while (\n[doc-reg-dpav1] <= \n[doc-args-processed]) \{\
366 . tmc " "\*[doc-arg\n[doc-reg-dpav1]]"
367 . nr doc-reg-dpav1 +1
375 . doc-parse-arg-vector
380 .\" NS doc-remaining-args macro
381 .\" NS output remaining arguments as-is, separated by spaces (until
382 .\" NS `doc-num-args' is exhausted), to `doc-out-string'
384 .de doc-remaining-args
386 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
388 . ie (\n[doc-num-args] == 1) \{\
393 . as doc-out-string "\*[doc-space]
400 .\" NS doc-append-arg macro
401 .\" NS append one argument to argument vector:
402 .\" NS `.doc-append-arg [arg] [type]'
405 . nr doc-args-processed +1
406 . ds doc-arg\n[doc-args-processed] "\$1
407 . ds doc-type\n[doc-args-processed] \$2
408 . doc-set-spacing-for-\$2
412 .\" NS doc-print-and-reset macro
413 .\" NS print doc-out-string and clean up argument vectors
415 .de doc-print-and-reset
416 . doc-print-out-string
421 .\" NS doc-reset-args macro
422 .\" NS reset argument counters
425 . nr doc-args-processed 0
430 .\" NS doc-print-out-string macro
431 .\" NS print `doc-out-string', possibly ending a diversion, enabling
432 .\" NS hyphenation afterwards
434 .de doc-print-out-string
435 . ie \n[doc-in-diversion] \{\
436 . if (\n[doc-nesting-level] == 1) \{\
437 . nop \&\*[doc-out-string]
441 . if !\n[doc-nesting-level] \
442 . doc-end-diversion-and-print
445 . ie \n[doc-nesting-level] \{\
446 . if \n[doc-space-mode] \
447 . if !\n[doc-list-immediate] \
448 . doc-save-and-divert
451 . nop \&\*[doc-out-string]
461 .\" NS doc-diversion diversion
462 .\" NS diversion string
465 .\" NS doc-saved-out-string string
466 .\" NS saved doc-out-string
469 .\" NS doc-in-diversion register (bool)
470 .\" NS whether we are in a diversion
472 .nr doc-in-diversion 0
475 .\" NS doc-save-and-divert macro
476 .\" NS save doc-out-string, restore fill mode, and divert
478 .de doc-save-and-divert
479 . nr doc-in-diversion 1
480 . ds doc-saved-out-string "\*[doc-out-string]
482 . ev doc-divert-environment
488 .\" NS doc-end-diversion-and-print macro
489 .\" NS end diversion and print
491 .de doc-end-diversion-and-print
496 . \" insert diversion only if it contains printable stuff
498 . ds doc-str-dedap \&\*[doc-diversion]\c
499 . ds doc-out-string "\*[doc-saved-out-string]\*[doc-str-dedap]\*[doc-out-string]
502 . ds doc-out-string "\*[doc-saved-out-string]\*[doc-out-string]
504 . nop \&\*[doc-out-string]
507 . nr doc-in-diversion 0
511 .\" NS doc-curr-font register
512 .\" NS saved current font
513 .\" NS doc-curr-size register
514 .\" NS saved current font size
517 .nr doc-curr-font \n[.f]
518 .nr doc-curr-size \n[.s]
523 .\" NS handle flags (appends `-' and prints flags): `.Fl arg ...'
525 .\" NS width register `.Fl' set in doc-common
527 .\" NS local variable:
528 .\" NS doc-reg-Fl (for communication with doc-flag-recursion)
531 . as doc-out-string \*[doc-Fl-font]
533 . if !\n[doc-args-processed] \{\
535 . ds doc-macro-name Fl
540 . as doc-out-string \|\-\|\f[P]\s[0]
541 . doc-print-out-string
545 . if \n[doc-args-processed] \{\
547 . ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
549 . as doc-out-string \|\-\f[P]\s[0]
550 . doc-print-and-reset
553 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
554 . as doc-out-string \|\-\f[P]\s[0]
555 . \*[doc-arg\n[doc-arg-ptr]]
558 . nr doc-curr-font \n[.f]
559 . nr doc-curr-size \n[.s]
561 . if "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \
562 . as doc-out-string \|\-\|
572 .\" NS doc-flag-recursion macro
573 .\" NS `Fl' flag recursion routine (special handling)
575 .\" NS local variables:
576 .\" NS doc-str-dfr, doc-str-dfr1, doc-reg-dfr
578 .de doc-flag-recursion
579 . ds doc-str-dfr \*[doc-type\n[doc-arg-ptr]]
580 . ds doc-str-dfr1 "\*[doc-arg\n[doc-arg-ptr]]
584 . ie "\*[doc-str-dfr]"macro" \{\
585 . as doc-out-string \f[P]\s[0]
589 . nr doc-reg-dfr \n[doc-arg-ptr]
591 . ie "\*[doc-str-dfr]"string" \{\
592 . \" handle vertical bar -- doc-reg-Fl is set for the first call of
593 . \" doc-flag-recursion only; we need this to handle `.Fl | ...'
595 . ie "\*[doc-str-dfr1]"\*[Ba]" \{\
596 . if \n[doc-reg-Fl] \
597 . as doc-out-string \|\-\*[doc-space]
598 . as doc-out-string \&\*[Ba]
601 . ie "\*[doc-str-dfr1]"\f[R]|\f[P]" \{\
602 . if \n[doc-reg-Fl] \
603 . as doc-out-string \|\-\*[doc-space]
604 . as doc-out-string \f[R]|\f[P]
607 . \" two consecutive hyphen characters?
608 . ie "\*[doc-str-dfr1]"-" \
609 . as doc-out-string \|\-\^\-\|
611 . as doc-out-string \|\-\*[doc-str-dfr1]
616 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
617 . as doc-out-string "\*[doc-str-dfr1]\f[P]\s[0]
620 . ie (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
622 . if "\*[doc-str-dfr]"punct-prefix" \
623 . as doc-out-string \|\-
624 . as doc-out-string \f[P]\s[0]
625 . doc-print-and-reset
629 . ie "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \{\
630 . ie "\*[doc-type\n[doc-reg-dfr]]"punct-prefix" \
631 . as doc-out-string \|\-
633 . as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
636 . as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
640 . doc-flag-recursion \$@
646 .\" NS doc-print-recursive macro
647 .\" NS general name recursion routine (print remaining arguments)
649 .\" NS local variables:
650 .\" NS doc-str-dpr, doc-reg-dpr
652 .de doc-print-recursive
653 . ds doc-str-dpr \*[doc-type\n[doc-arg-ptr]]
657 . ie "\*[doc-str-dpr]"macro" \{\
658 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
659 . \*[doc-arg\n[doc-arg-ptr]]
662 . nr doc-reg-dpr \n[doc-arg-ptr]
664 . ie "\*[doc-str-dpr]"string" \
665 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
667 . \" punctuation character
668 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
669 . as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
673 . ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
674 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
675 . doc-print-and-reset
678 . as doc-out-string "\*[doc-space\n[doc-reg-dpr]]
679 . doc-print-recursive
686 .\" NS command line `argument' macro: `.Ar [args ...]'
688 .\" NS width register `.Ar' set in doc-common
691 . as doc-out-string \*[doc-Ar-font]
693 . if !\n[doc-args-processed] \{\
695 . ds doc-macro-name Ar
699 . as doc-out-string \&file\ ...\f[P]\s[0]
700 . doc-print-out-string
704 . if \n[doc-args-processed] \{\
706 . ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
707 . as doc-out-string \&file\ ...\f[P]\s[0]
708 . doc-print-and-reset
711 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
712 . as doc-out-string \&file\ ...\f[P]\s[0]
713 . \*[doc-arg\n[doc-arg-ptr]]
716 . nr doc-curr-font \n[.f]
717 . nr doc-curr-size \n[.s]
718 . if "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \
719 . as doc-out-string \&file\ ...
720 . doc-print-recursive
730 .\" NS width register `.Ad' set in doc-common
733 . if !\n[doc-args-processed] \{\
735 . tm Usage: .Ad address ... \*[doc-punct-chars] (#\n[.c])
737 . ds doc-macro-name Ad
743 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
744 . as doc-out-string \*[doc-Ad-font]
745 . nr doc-curr-font \n[.f]
746 . nr doc-curr-size \n[.s]
747 . doc-print-recursive
753 .\" NS Config declaration (for section 4 SYNOPSIS) (not callable)
755 .\" NS width register `.Cd' set in doc-common
757 .\" NS local variable:
760 .\" needs work - not very translatable
763 . if !\n[doc-args-processed] \{\
765 . tm Usage: .Cd Configuration file declaration (#\n[.c])
767 . ds doc-macro-name Cd
770 . while (\n[doc-reg-Cd] <= \n[.$]) \{\
771 . ds doc-arg\n[doc-reg-Cd] "\$[\n[doc-reg-Cd]]
775 . nr doc-num-args \n[.$]
776 . doc-parse-arg-vector
783 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
784 . as doc-out-string \*[doc-Nm-font]
785 . nr doc-curr-font \n[.f]
786 . nr doc-curr-size \n[.s]
788 . ie \n[doc-in-synopsis-section] \{\
789 . if "\*[doc-macro-name]"Cd" \{\
791 . ie (\n[doc-in-synopsis-section] > 1) \
794 . if !\n[doc-indent-synopsis] \
795 . nr doc-indent-synopsis \n[doc-display-indent]u
797 . in +\n[doc-indent-synopsis]u
798 . ti -\n[doc-indent-synopsis]u
799 . nr doc-in-synopsis-section +1
802 . doc-print-recursive
803 . in -\n[doc-indent-synopsis]u
806 . doc-print-recursive
812 .\" NS Interactive command modifier (flag)
814 .\" NS width register `.Cm' set in doc-common
816 .\" NS local variable:
820 . if !\n[doc-args-processed] \{\
822 . tmc Usage: .Cm Interactive command modifier ...
823 . tm1 " \*[doc-punct-chars] (#\n[.c])
826 . ds doc-macro-name Cm
829 . while (\n[doc-reg-Cm] <= \n[.$]) \{\
830 . ds doc-arg\n[doc-reg-Cm] "\$[\n[doc-reg-Cm]]
834 . nr doc-num-args \n[.$]
835 . doc-parse-arg-vector
840 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
841 . as doc-out-string \*[doc-Cm-font]
842 . nr doc-curr-font \n[.f]
843 . nr doc-curr-size \n[.s]
844 . doc-print-recursive
850 .\" NS define variable
852 .\" NS width register `.Dv' set in doc-common
855 . if !\n[doc-args-processed] \{\
857 . tm Usage: .Dv define_variable ... \*[doc-punct-chars] (#\n[.c])
859 . ds doc-macro-name Dv
865 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
866 . as doc-out-string \*[doc-Er-font]
867 . nr doc-curr-font \n[.f]
868 . nr doc-curr-size \n[.s]
869 . doc-print-recursive
877 .\" NS width register `.Em' set in doc-common
879 .\" NS local variable:
883 . if !\n[doc-args-processed] \{\
885 . tm Usage: .Em text ... \*[doc-punct-chars] (#\n[.c])
887 . ds doc-macro-name Em
890 . while (\n[doc-reg-Em] <= \n[.$]) \{\
891 . ds doc-arg\n[doc-reg-Em] "\$[\n[doc-reg-Em]]
895 . nr doc-num-args \n[.$]
896 . doc-parse-arg-vector
901 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
902 . as doc-out-string \*[doc-Em-font]
903 . nr doc-curr-font \n[.f]
904 . nr doc-curr-size \n[.s]
905 . doc-print-recursive
913 .\" NS width register `.Em' set in doc-common
916 . if !\n[doc-args-processed] \{\
918 . tm Usage: .Er ERRNOTYPE ... \*[doc-punct-chars] (#\n[.c])
920 . ds doc-macro-name Er
926 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
927 . as doc-out-string \*[doc-Er-font]
928 . nr doc-curr-font \n[.f]
929 . nr doc-curr-size \n[.s]
930 . doc-print-recursive
936 .\" NS environment variable
938 .\" NS width register `.Ev' set in doc-common
941 . if !\n[doc-args-processed] \{\
943 . tm Usage: .Ev ENVIRONMENT_VARIABLE ... \*[doc-punct-chars] (#\n[.c])
945 . ds doc-macro-name Ev
951 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
952 . as doc-out-string \*[doc-Ev-font]
953 . nr doc-curr-font \n[.f]
954 . nr doc-curr-size \n[.s]
955 . doc-print-recursive
960 .\" NS doc-declaration-count register
961 .\" NS subroutine test (in synopsis only)
963 .nr doc-declaration-count 0
966 .\" NS doc-do-function-declaration macro
968 .de doc-do-function-declaration
969 . ds doc-macro-name \$1
971 . if \n[doc-in-synopsis-section] \{\
972 . \" if a variable type was the last thing given, want vertical space
973 . if \n[doc-variable-type] \{\
975 . nr doc-variable-type 0
977 . \" if a subroutine was the last thing given, want vertical space
978 . if \n[doc-function-count] \{\
979 . ie !\n[doc-declaration-count] \{\
986 . nr doc-declaration-count +1
989 . nr doc-curr-font \n[.f]
990 . nr doc-curr-size \n[.s]
995 .\" NS function declaration - not callable (& no err check)
997 .\" NS width register `.Fd' set in doc-common
1000 . doc-do-function-declaration Fd
1001 . nop \*[doc-Fd-font]\$*
1003 . ft \n[doc-curr-font]
1004 . fs \n[doc-curr-size]
1008 .\" NS In user macro
1009 .\" NS #include statement - not callable (& no err check)
1011 .\" NS width register `.In' set in doc-common
1014 . doc-do-function-declaration In
1015 . nop \*[doc-Fd-font]#include <\$1>
1017 . ft \n[doc-curr-font]
1018 . fs \n[doc-curr-size]
1022 .\" NS Fr user macro
1023 .\" NS function return value - not callable (at the moment)
1025 .\" NS width register `.Fr' set in doc-common
1028 . if !\n[doc-args-processed] \{\
1030 . tm Usage: .Fr Function_return_value... \*[doc-punct-chars] (#\n[.c])
1032 . ds doc-macro-name Fr
1033 . doc-parse-args \$@
1038 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1039 . as doc-out-string \*[doc-Ar-font]
1040 . nr doc-curr-font \n[.f]
1041 . nr doc-curr-size \n[.s]
1042 . doc-print-recursive
1047 .\" NS Ic user macro
1048 .\" NS interactive command
1050 .\" NS width register `.Ic' set in doc-common
1053 . if !\n[doc-args-processed] \{\
1055 . tm Usage: .Ic Interactive command ... \*[doc-punct-chars] (#\n[.c])
1057 . ds doc-macro-name Ic
1058 . doc-parse-args \$@
1063 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1064 . as doc-out-string \*[doc-Ic-font]
1065 . nr doc-curr-font \n[.f]
1066 . nr doc-curr-size \n[.s]
1067 . doc-print-recursive
1072 .\" NS Li user macro
1075 .\" NS width register `.Li' set in doc-common
1077 .\" NS local variable:
1081 . if !\n[doc-args-processed] \{\
1083 . tm Usage .Li argument ... \*[doc-punct-chars] (#\n[.c])
1085 . ds doc-macro-name Li
1088 . while (\n[doc-reg-Li] <= \n[.$]) \{\
1089 . ds doc-arg\n[doc-reg-Li] "\$[\n[doc-reg-Li]]
1093 . nr doc-num-args \n[.$]
1094 . doc-parse-arg-vector
1099 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1100 . as doc-out-string \*[doc-Li-font]
1101 . nr doc-curr-font \n[.f]
1102 . nr doc-curr-size \n[.s]
1103 . doc-print-recursive
1108 .\" NS Or user macro
1109 .\" NS pipe symbol (OR)
1111 .\" NS width register `.Or' set in doc-common
1114 . if !\n[doc-args-processed] \{\
1116 . tm Usage: .Or ... \*[doc-punct-chars] (#\n[.c])
1118 . ds doc-macro-name Or
1119 . doc-parse-args \$@
1124 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1125 . as doc-out-string \*[doc-Ic-font]
1126 . nr doc-curr-font \n[.f]
1127 . nr doc-curr-size \n[.s]
1128 . doc-print-recursive
1133 .\" NS Ms user macro
1136 .\" NS width register `.Ms' set in doc-common
1139 . if !\n[doc-args-processed] \{\
1141 . tm Usage: .Ms Math symbol ... \*[doc-punct-chars] (#\n[.c])
1143 . ds doc-macro-name Ms
1144 . doc-parse-args \$@
1149 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1150 . as doc-out-string \*[doc-Sy-font]
1151 . nr doc-curr-font \n[.f]
1152 . nr doc-curr-size \n[.s]
1153 . doc-print-recursive
1158 .\" NS doc-command-name string
1159 .\" NS save first invocation of .Nm
1161 .ds doc-command-name
1164 .\" NS Nm user macro
1165 .\" NS name of command or page topic
1167 .\" NS width register `.Nm' set in doc-common
1169 .\" NS local variable:
1173 . if !\n[doc-args-processed] \{\
1175 . ie "\*[doc-command-name]"" \
1176 . tm Usage: .Nm Name(s) ... \*[doc-punct-chars] (#\n[.c])
1178 . nop \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1181 . ds doc-macro-name Nm
1184 . ds doc-arg1 "\*[doc-command-name]
1188 . while (\n[doc-reg-Nm] <= \n[.$]) \{\
1189 . ds doc-arg\n[doc-reg-Nm] "\$[\n[doc-reg-Nm]]
1193 . nr doc-num-args \n[.$]
1194 . doc-parse-arg-vector
1198 . if \n[doc-args-processed] \{\
1200 . ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
1201 . as doc-out-string \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1202 . doc-print-and-reset
1205 . as doc-out-string \*[doc-Nm-font]
1206 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
1207 . as doc-out-string \&\*[doc-command-name]\f[P]\s[0]
1208 . \*[doc-arg\n[doc-arg-ptr]]
1211 . nr doc-curr-font \n[.f]
1212 . nr doc-curr-size \n[.s]
1213 . if \n[doc-in-synopsis-section] \{\
1214 . if "\*[doc-macro-name]"Nm" \{\
1216 . in -\n[doc-indent-synopsis]u
1217 . ie (\n[doc-in-synopsis-section] > 1) \
1220 . if !\n[doc-indent-synopsis] \{\
1222 . nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
1225 . in +\n[doc-indent-synopsis]u
1226 . ti -\n[doc-indent-synopsis]u
1227 . nr doc-in-synopsis-section +1
1230 . if "\*[doc-command-name]"" \
1231 . ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
1232 . doc-print-recursive
1239 .\" NS Pa user macro
1240 .\" NS pathname: `.Pa [arg ...]'
1242 .\" NS width register `.Pa' set in doc-common
1245 . if !\n[doc-args-processed] \{\
1247 . nop \*[doc-Pa-font]~\f[P]\s[0]
1249 . ds doc-macro-name Pa
1250 . doc-parse-args \$@
1255 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1256 . as doc-out-string \*[doc-Pa-font]
1257 . nr doc-curr-font \n[.f]
1258 . nr doc-curr-size \n[.s]
1259 . doc-print-recursive
1264 .\" NS Sy user macro
1267 .\" NS width register `.Sy' set in doc-common
1269 .\" NS local variable:
1273 . if !\n[doc-args-processed] \{\
1275 . tm Usage: .Sy symbolic_text ... \*[doc-punct-chars] (#\n[.c])
1277 . ds doc-macro-name Sy
1280 . while (\n[doc-reg-Sy] <= \n[.$]) \{\
1281 . ds doc-arg\n[doc-reg-Sy] "\$[\n[doc-reg-Sy]]
1285 . nr doc-num-args \n[.$]
1286 . doc-parse-arg-vector
1291 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1292 . as doc-out-string \*[doc-Sy-font]
1293 . nr doc-curr-font \n[.f]
1294 . nr doc-curr-size \n[.s]
1295 . doc-print-recursive
1300 .\" NS Me user macro
1303 .\" NS width register `.Me' set in doc-common
1305 .\" NS local variable:
1309 . if !\n[doc-args-processed] \{\
1311 . tm Usage: .Me menu entry ... \*[doc-punct-chars] (#\n[.c])
1313 . ds doc-macro-name Me
1316 . while (\n[doc-reg-Me] <= \n[.$]) \{\
1317 . ds doc-arg\n[doc-reg-Me] "\$[\n[doc-reg-Me]]
1321 . nr doc-num-args \n[.$]
1322 . doc-parse-arg-vector
1327 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1328 . as doc-out-string \*[doc-Me-font]
1329 . nr doc-curr-font \n[.f]
1330 . nr doc-curr-size \n[.s]
1331 . doc-print-recursive
1336 .\" NS Tn user macro
1339 .\" NS width register `.Tn' set in doc-common
1342 . if !\n[doc-args-processed] \{\
1344 . tm Usage: .Tn Trade_name(s) ... \*[doc-punct-chars] (#\n[.c])
1346 . ds doc-macro-name Tn
1347 . doc-parse-args \$@
1352 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1353 . as doc-out-string \&\*[doc-Tn-font-shape]\*[doc-Tn-font-size]
1354 . nr doc-curr-font \n[.f]
1355 . nr doc-curr-size \n[.s]
1356 . doc-print-recursive
1361 .\" NS doc-reference-trademark macro
1362 .\" NS .Tn for inside of references
1364 .\" NS code for references checks for `Tn'!
1366 .de doc-reference-trademark
1367 . if !\n[doc-args-processed] \{\
1369 . tm Usage: .Tn Trade_name(s) ... \*[doc-punct-chars] (#\n[.c])
1371 . ds doc-macro-name Tn
1372 . doc-parse-args \$@
1377 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1378 . as doc-out-string \&\*[doc-Tn-font-size]
1379 . nr doc-curr-font \n[.f]
1380 . nr doc-curr-size \n[.s]
1386 .\" NS Va user macro
1387 .\" NS variable name
1389 .\" NS width register `.Va' set in doc-common
1392 . if !\n[doc-args-processed] \{\
1394 . tm Usage: .Va variable_name(s) ... \*[doc-punct-chars] (#\n[.c])
1396 . ds doc-macro-name Va
1397 . doc-parse-args \$@
1402 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1403 . as doc-out-string \*[doc-Va-font]
1404 . nr doc-curr-font \n[.f]
1405 . nr doc-curr-size \n[.s]
1406 . doc-print-recursive
1411 .\" NS No user macro
1412 .\" NS normal text macro (default text style if mess up)
1414 .\" NS width register `.No' set in doc-common
1417 . as doc-out-string \*[doc-No-font]
1419 . if !\n[doc-args-processed] \{\
1421 . ds doc-macro-name No
1422 . doc-parse-args \$@
1424 . tm Usage: .No must be called with arguments (#\n[.c])
1429 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1430 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
1431 . \*[doc-arg\n[doc-arg-ptr]]
1433 . nr doc-curr-font \n[.f]
1434 . nr doc-curr-size \n[.s]
1435 . doc-print-recursive
1441 .\" NS Op user macro
1442 .\" NS option expression
1444 .\" NS width register `.Op' set in doc-common
1447 . if !\n[doc-args-processed] \
1448 . ds doc-macro-name Op
1450 . ds doc-quote-left "\*[doc-left-bracket]
1451 . ds doc-quote-right "\*[doc-right-bracket]
1453 . doc-enclose-string \$@
1457 .\" NS Aq user macro
1458 .\" NS enclose string in angle brackets
1460 .\" NS width register `.Aq' set in doc-common
1463 . if !\n[doc-args-processed] \
1464 . ds doc-macro-name Aq
1466 . ds doc-quote-left <
1467 . ds doc-quote-right >
1469 . doc-enclose-string \$@
1473 .\" NS Bq user macro
1474 .\" NS enclose string in square brackets
1476 .\" NS width register `.Bq' set in doc-common
1479 . if !\n[doc-args-processed] \
1480 . ds doc-macro-name Bq
1482 . ds doc-quote-left "\*[doc-left-bracket]
1483 . ds doc-quote-right "\*[doc-right-bracket]
1485 . doc-enclose-string \$@
1489 .\" NS Dq user macro
1490 .\" NS enclose string in double quotes
1492 .\" NS width register `.Dq' set in doc-common
1495 . if !\n[doc-args-processed] \
1496 . ds doc-macro-name Dq
1498 . ds doc-quote-left "\*[Lq]
1499 . ds doc-quote-right "\*[Rq]
1501 . doc-enclose-string \$@
1505 .\" NS Eq user macro
1506 .\" NS enclose string in user-defined quotes (args 1 and 2)
1508 .\" NS width register `.Eq' set in doc-common
1511 . if !\n[doc-args-processed] \
1512 . ds doc-macro-name Eq
1514 . ds doc-quote-left "\$1
1515 . ds doc-quote-right "\$2
1518 . doc-enclose-string \$@
1522 .\" NS Pq user macro
1523 .\" NS enclose string in parentheses
1525 .\" NS width register `.Pq' set in doc-common
1528 . if !\n[doc-args-processed] \
1529 . ds doc-macro-name Pq
1531 . ds doc-quote-left "\*[doc-left-parenthesis]
1532 . ds doc-quote-right "\*[doc-right-parenthesis]
1534 . doc-enclose-string \$@
1538 .\" NS Ql user macro
1539 .\" NS quoted literal
1541 .\" is in file doc-[dit|n]roff (too large an if-else to carry along
1542 .\" recursively for `if n ...')
1545 .\" NS Qq user macro
1546 .\" NS enclose string in straight double quotes
1548 .\" NS width register `.Qq' set in doc-common
1551 . if !\n[doc-args-processed] \
1552 . ds doc-macro-name Qq
1554 . ds doc-quote-left "\*[q]
1555 . ds doc-quote-right "\*[q]
1557 . doc-enclose-string \$@
1561 .\" NS Sq user macro
1562 .\" NS enclose string in single quotes
1564 .\" NS width register `.Sq' set in doc-common
1567 . if !\n[doc-args-processed] \
1568 . ds doc-macro-name Sq
1570 . ds doc-quote-left "\*[doc-left-singlequote]
1571 . ds doc-quote-right "\*[doc-right-singlequote]
1573 . doc-enclose-string \$@
1577 .\" NS doc-temp-args-processed register
1578 .\" NS for data transfer to/from doc-skip-punct-backwards
1580 .nr doc-temp-args-processed 0
1583 .\" NS doc-enclose-string macro
1584 .\" NS enclose string with given args (e.g. [ and ])
1587 .\" NS doc-quote-left (to be set by calling macro)
1588 .\" NS doc-quote-right (to be set by calling macro)
1590 .de doc-enclose-string
1591 . \" .tm doc-enclose-string beg:
1592 . \" .tm1 " arg(doc-arg[\n[doc-arg-ptr]])==\*[doc-arg\n[doc-arg-ptr]]
1593 . \" .tm1 " doc-nesting-level==\n[doc-nesting-level]
1594 . \" .tm1 " doc-in-diversion==\n[doc-in-diversion]
1595 . \" .tm1 " doc-saved-list-immediate==\n[doc-saved-list-immediate]
1596 . \" .tm1 " doc-args-processed==\n[doc-args-processed]
1598 . ie !\n[doc-args-processed] \{\
1600 . as doc-out-string \&\*[doc-quote-left]\*[doc-quote-right]
1601 . doc-print-out-string
1604 . \".as doc-macro-name (doc-enclose-string)
1605 . doc-parse-args \$@
1606 . as doc-out-string \&\*[doc-quote-left]
1610 . as doc-out-string \&\*[doc-quote-left]
1612 . if \n[doc-args-processed] \{\
1614 . ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
1615 . as doc-out-string \&\*[doc-quote-right]
1616 . doc-print-and-reset
1619 . ie "\*[doc-type\n[doc-args-processed]]"punct-suffix" \{\
1620 . nr doc-temp-args-processed (\n[doc-args-processed] - 1)
1621 . doc-skip-punct-backwards
1622 . nr doc-temp-args-processed +1
1623 . ds doc-arg\n[doc-temp-args-processed] "\*[doc-quote-right]\&\*[doc-arg\n[doc-temp-args-processed]]
1624 . nr doc-temp-args-processed 0
1627 . doc-append-arg "\*[doc-quote-right]" punct-suffix
1628 . doc-do-\*[doc-type\n[doc-arg-ptr]]
1635 .\" NS doc-skip-punct-backwards macro
1636 .\" NS vector routine (for `doc-enclose-string': trace backwards past
1637 .\" NS trailing punctuation)
1639 .de doc-skip-punct-backwards
1640 . if "\*[doc-type\n[doc-temp-args-processed]]"punct-suffix" \{\
1641 . nr doc-temp-args-processed -1
1642 . doc-skip-punct-backwards
1647 .\" NS Ao user macro
1650 .\" NS width register `.Ao' set in doc-common
1653 . if !\n[doc-args-processed] \
1654 . ds doc-macro-name Ao
1656 . ds doc-quote-left <
1658 . doc-enclose-open \$@
1662 .\" NS Ac user macro
1665 .\" NS width register `.Ac' set in doc-common
1668 . if !\n[doc-args-processed] \
1669 . ds doc-macro-name Ac
1671 . ds doc-quote-right >
1673 . doc-enclose-close \$@
1677 .\" NS Bo user macro
1680 .\" NS width register `.Bo' set in doc-common
1683 . if !\n[doc-args-processed] \
1684 . ds doc-macro-name Bo
1686 . ds doc-quote-left [
1688 . doc-enclose-open \$@
1692 .\" NS Bc user macro
1693 .\" NS bracket close
1695 .\" NS width register `.Bc' set in doc-common
1698 . if !\n[doc-args-processed] \
1699 . ds doc-macro-name Bc
1701 . ds doc-quote-right ]
1703 . doc-enclose-close \$@
1707 .\" NS Do user macro
1708 .\" NS double quote open
1710 .\" NS width register `.Do' set in doc-common
1713 . if !\n[doc-args-processed] \
1714 . ds doc-macro-name Do
1716 . ds doc-quote-left "\*[Lq]
1718 . doc-enclose-open \$@
1722 .\" NS Dc user macro
1723 .\" NS double quote close
1725 .\" NS width register `.Dc' set in doc-common
1728 . if !\n[doc-args-processed] \
1729 . ds doc-macro-name Dc
1731 . ds doc-quote-right "\*[Rq]
1733 . doc-enclose-close \$@
1737 .\" NS Eo user macro
1738 .\" NS enclose open (using first argument as beginning of enclosion)
1740 .\" NS width register `.Eo' set in doc-common
1743 . if !\n[doc-args-processed] \
1744 . ds doc-macro-name Eo
1746 . ds doc-quote-left "\$1
1749 . doc-enclose-open \$@
1753 .\" NS Ec user macro
1754 .\" NS enclose close (using first argument as end of enclosion)
1756 .\" NS width register `.Ec' set in doc-common
1759 . if !\n[doc-args-processed] \
1760 . ds doc-macro-name Ec
1762 . ds doc-quote-right "\$1
1765 . doc-enclose-close \$@
1769 .\" NS Oo user macro
1772 .\" NS width register `.Oo' set in doc-common
1775 . if !\n[doc-args-processed] \
1776 . ds doc-macro-name Oo
1778 . ds doc-quote-left [
1780 . doc-enclose-open \$@
1784 .\" NS Oc user macro
1787 .\" NS width register `.Oc' set in doc-common
1790 . if !\n[doc-args-processed] \
1791 . ds doc-macro-name Oc
1793 . ds doc-quote-right ]
1795 . doc-enclose-close \$@
1799 .\" NS Po user macro
1800 .\" NS parenthesis open
1802 .\" NS width register `.Po' set in doc-common
1805 . if !\n[doc-args-processed] \
1806 . ds doc-macro-name Po
1808 . ds doc-quote-left (
1810 . doc-enclose-open \$@
1814 .\" NS Pc user macro
1815 .\" NS parenthesis close
1817 .\" NS width register `.Pc' set in doc-common
1820 . if !\n[doc-args-processed] \
1821 . ds doc-macro-name Pc
1823 . ds doc-quote-right )
1825 . doc-enclose-close \$@
1829 .\" NS Qo user macro
1830 .\" NS straight double quote open
1832 .\" NS width register `.Qo' set in doc-common
1835 . if !\n[doc-args-processed] \
1836 . ds doc-macro-name Qo
1838 . ds doc-quote-left "\*[q]
1840 . doc-enclose-open \$@
1844 .\" NS Qc user macro
1845 .\" NS straight double quote close
1847 .\" NS width register `.Qc' set in doc-common
1850 . if !\n[doc-args-processed] \
1851 . ds doc-macro-name Qc
1853 . ds doc-quote-right "\*[q]
1855 . doc-enclose-close \$@
1859 .\" NS So user macro
1860 .\" NS single quote open
1862 .\" NS width register `.So' set in doc-common
1865 . if !\n[doc-args-processed] \
1866 . ds doc-macro-name So
1868 . ds doc-quote-left "\*[doc-left-singlequote]
1870 . doc-enclose-open \$@
1874 .\" NS Sc user macro
1875 .\" NS single quote close
1877 .\" NS width register `.Sc' set in doc-common
1880 . if !\n[doc-args-processed] \
1881 . ds doc-macro-name Sc
1883 . ds doc-quote-right "\*[doc-right-singlequote]
1885 . doc-enclose-close \$@
1889 .\" NS Xo user macro
1892 .\" NS width register `.Xo' set in doc-common
1895 . if !\n[doc-args-processed] \
1896 . ds doc-macro-name Xo
1897 . \" .nr doc-in-macro 1
1901 . doc-enclose-open \$@
1905 .\" NS Xc user macro
1908 .\" NS width register `.Xc' set in doc-common
1911 . \" .nr doc-in-macro 0
1912 . if !\n[doc-args-processed] \
1913 . ds doc-macro-name Xc
1915 . ds doc-quote-right
1917 . doc-enclose-close \$@
1921 .\" NS doc-nesting-level register
1922 .\" NS (extension possible)
1924 .nr doc-nesting-level 0
1927 .\" NS doc-enclose-open macro
1928 .\" NS enclose string open
1930 .de doc-enclose-open
1931 . nr doc-nesting-level +1
1933 . \" .tm doc-enclose-open
1934 . \" .tmc " last arg==
1935 . \" .tm doc-arg[\n[doc-args-processed]]==\*[doc-arg\n[doc-args-processed]]
1936 . \" .tm1 " doc-arg-ptr==\n[doc-arg-ptr]
1937 . \" .tm1 " doc-nesting-level==\n[doc-nesting-level]
1938 . \" .tm1 " doc-in-diversion==\n[doc-in-diversion]
1940 . ie !\n[doc-args-processed] \{\
1942 . doc-parse-args \$@
1943 . as doc-out-string \&\*[doc-quote-left]
1946 . as doc-out-string \&\*[doc-quote-left]
1948 . if !\n[doc-in-diversion] \
1949 . if \n[doc-space-mode] \
1950 . doc-save-and-divert
1954 . as doc-out-string \&\*[doc-quote-left]
1956 . ie \n[doc-args-processed] \{\
1957 . if (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
1959 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
1960 . \*[doc-arg\n[doc-arg-ptr]]
1967 . if (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
1968 . if \n[doc-list-immediate] \{\
1969 . \" .tm SETTING doc-saved-list-immediate!
1970 . nr doc-saved-list-immediate 1
1972 . \" .\" .ds doc-curr-space
1973 . \" CHANGED .ds doc-curr-space "\*[doc-soft-space]
1978 . if (\n[doc-nesting-level] > 1) \
1979 . as doc-out-string "\*[doc-space]
1984 .ds doc-saved-list-type
1987 .\" NS doc-enclose-close macro
1988 .\" NS enclose string close
1990 .\" NS local variable:
1993 .de doc-enclose-close
1994 . nr doc-nesting-level -1
1996 . \" .tm doc-enclose-close
1997 . \" .tmc " last arg==
1998 . \" .tm doc-arg[\n[doc-args-processed]]==\*[doc-arg\n[doc-args-processed]]
1999 . \" .tm1 " doc-arg-ptr==\n[doc-arg-ptr]
2000 . \" .tm1 " doc-nesting-level==\n[doc-nesting-level]
2001 . \" .tm1 " doc-in-diversion==\n[doc-in-diversion]
2003 . as doc-out-string \&\*[doc-quote-right]
2005 . if !\n[doc-args-processed] \{\
2007 . doc-parse-args \$@
2009 . doc-print-out-string
2010 . if !"\*[doc-saved-list-type]"" \{\
2011 . doc-\*[doc-list-stack\n[doc-list-depth]]
2012 . nr doc-saved-list-immediate 0
2013 . ds doc-saved-list-type
2018 . if (\n[doc-args-processed] > 0) \{\
2019 . ie (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
2020 . ie !\n[doc-nesting-level] \
2021 . doc-print-and-reset
2026 . nr doc-str-dec (\n[doc-arg-ptr] + 1)
2027 . if "\*[doc-type\n[doc-str-dec]]"string" \
2028 . as doc-out-string "\*[doc-space\n[doc-args-processed]]
2031 . \" .tm1 " doc-arg-ptr==\*[doc-arg\n[doc-arg-ptr]]
2032 . \" .tm1 " ap+1==\*[doc-arg\n[doc-str-dec]]
2033 . \" .tm1 " doc-list-immediate==\n[doc-list-immediate]
2034 . \" .tm1 " doc-saved-list-immediate==\n[doc-saved-list-immediate]
2036 . if \n[doc-list-immediate] \{\
2037 . \" .tm UNSETTING doc-saved-list-immediate==\n[doc-saved-list-immediate]!
2038 . if \n[doc-saved-list-immediate] \
2039 . nr doc-saved-list-immediate 0
2040 . \" .tm NOW doc-saved-list-immediate==\n[doc-saved-list-immediate]!
2048 .\" NS Pf user macro
2049 .\" NS prefix (calls .doc-make-prefix): `.Pf prefix arg ...'
2051 .\" NS width register `.Pf' set in doc-common
2054 . if !\n[doc-args-processed] \
2055 . ds doc-macro-name Pf
2057 . ds doc-quote-left "\$1
2060 . doc-make-prefix \$@
2064 .\" NS doc-make-prefix macro
2065 .\" NS prefix (for prefixing open quotes, brackets, etc.)
2068 . ie !\n[doc-args-processed] \{\
2069 . as doc-out-string \&\*[doc-quote-left]
2070 . ie (\n[.$] < 2) \{\
2071 . tm mdoc warning: .Pf: missing arguments (#\n[.c])
2072 . doc-print-out-string
2075 . doc-parse-args \$@
2078 . ie ((\n[doc-args-processed] - \n[doc-arg-ptr]) > 1) \{\
2080 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2083 . tm mdoc warning: .Pf: trailing prefix (#\n[.c])
2086 . if \n[doc-args-processed] \{\
2088 . ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \
2089 . doc-print-and-reset
2091 . doc-do-\*[doc-type\n[doc-arg-ptr]]
2096 .\" NS Ns user macro
2097 .\" NS remove space (space removal done by .doc-parse-args or
2098 .\" NS .doc-parse-arg-vector)
2100 .\" NS width register `.Ns' set in doc-common
2103 . if !\n[doc-args-processed] \{\
2104 . ds doc-macro-name Ns
2106 . doc-parse-args \$@
2108 . tm Usage: .Ns must be called with arguments (#\n[.c])
2115 .\" NS Ap user macro
2116 .\" NS append an apostrophe
2118 .\" NS width register `.Ap' set in doc-common
2121 . if !\n[doc-args-processed] \
2122 . tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2124 . as doc-out-string \&'
2129 .\" NS doc-space string
2130 .\" NS current inter-argument space
2132 .ds doc-space "\*[doc-soft-space]
2135 .\" NS doc-soft-space string
2136 .\" NS soft (stretchable) space (defined in doc-common)
2138 .\" NS doc-hard-space string
2139 .\" NS hard (unpaddable) space (defined in doc-common)
2142 .\" NS doc-set-hard-space macro
2143 .\" NS set current space string to hard (unpaddable) space.
2145 .de doc-set-hard-space
2146 . ds doc-space "\*[doc-hard-space]
2150 .\" NS doc-set-soft-space macro
2151 .\" NS set current space string to soft space (troff limitation)
2153 .de doc-set-soft-space
2154 . ds doc-space "\*[doc-soft-space]
2158 .\" NS doc-space-mode register
2159 .\" NS default is one (space mode on)
2161 .nr doc-space-mode 1
2164 .\" NS Sm user macro
2167 .\" NS width register `.Sm' set in doc-common
2170 . if !\n[doc-args-processed] \{\
2172 . tm Usage: .Sm [off | on] (#\n[.c])
2174 . ds doc-macro-name Sm
2175 . doc-parse-args \$@
2179 . if \n[doc-args-processed] \{\
2181 . if "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2182 . ds doc-space "\*[doc-soft-space]
2183 . nr doc-space-mode 1
2185 . if "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2189 . rm doc-space1 doc-space2 doc-space3 doc-space4
2190 . rm doc-space5 doc-space6 doc-space7 doc-space8 doc-space9
2192 . nr doc-space-mode 0
2195 . ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \
2203 .\" NS doc-arg-type string
2204 .\" NS argument type
2209 .\" NS doc-get-arg-type macro
2210 .\" NS get argument type (`macro', `string', `punct-suffix', or
2211 .\" NS `punct-prefix')
2216 .de doc-get-arg-type
2218 . ie ((\n[doc-width] > 2) : (\A'\$1' == 0)) \
2219 . ds doc-arg-type string
2221 . if (\n[doc-width] == 1) \{\
2223 . ie "\*[z\$1]"punct-suffix" \
2224 . ds doc-arg-type punct-suffix
2226 . ie "\*[z\$1]"punct-prefix" \
2227 . ds doc-arg-type punct-prefix
2229 . ds doc-arg-type string
2233 . ds doc-arg-type string
2235 . if (\n[doc-width] == 2) \{\
2238 . ds doc-arg-type macro
2240 . ds doc-arg-type string
2243 . ds doc-arg-type string
2249 .\" NS doc-get-arg-type* macro
2250 .\" NS same as `.doc-get-arg-type' but uses doc-argXXX strings
2256 .de doc-get-arg-type*
2258 . doc-get-arg-width \$1
2260 . ie ((\n[doc-width] > 2) : (\A'\*[doc-arg\$1]' == 0)) \
2261 . ds doc-arg-type string
2263 . if (\n[doc-width] == 1) \{\
2264 . ie d z\*[doc-arg\$1] \{\
2265 . ie "\*[z\*[doc-arg\$1]]"punct-suffix" \
2266 . ds doc-arg-type punct-suffix
2268 . ie "\*[z\*[doc-arg\$1]]"punct-prefix" \
2269 . ds doc-arg-type punct-prefix
2271 . ds doc-arg-type string
2275 . ds doc-arg-type string
2277 . if (\n[doc-width] == 2) \{\
2278 . ie r \*[doc-arg\$1] \{\
2279 . ie \n[\*[doc-arg\$1]] \
2280 . ds doc-arg-type macro
2282 . ds doc-arg-type string
2285 . ds doc-arg-type string
2291 .\" NS doc-set-spacing-for- macro
2292 .\" NS catch errors (non-existent type)
2294 .de doc-set-spacing-for-
2295 . tmc mdoc error: bogus type (can't set space
2296 . tm1 " `\*[doc-arg\n[doc-args-processed]]') (#\n[.c])
2300 .\" NS doc-set-spacing-for-macro macro
2301 .\" NS set spacing for macros
2303 .\" NS local variable:
2304 .\" NS doc-reg-dssfm, doc-reg-dssfm1
2306 .de doc-set-spacing-for-macro
2307 . nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-args-processed]]]
2309 . \" closing macros like .Ac, Bc., etc. have value 3
2310 . ie (\n[doc-reg-dssfm1] == 3) \{\
2311 . nr doc-reg-dssfm (\n[doc-args-processed] - 1)
2312 . ds doc-space\n[doc-reg-dssfm]
2313 . ds doc-space\n[doc-args-processed] "\*[doc-space]
2316 . \" macros like .Ap and .Ns have value 2
2317 . ie (\n[doc-reg-dssfm1] == 2) \{\
2318 . nr doc-reg-dssfm (\n[doc-args-processed] - 1)
2319 . ds doc-space\n[doc-reg-dssfm]
2320 . ds doc-space\n[doc-args-processed]
2323 . ds doc-space\n[doc-args-processed]
2328 .\" NS doc-set-spacing-for-string macro
2329 .\" NS set spacing for strings
2331 .de doc-set-spacing-for-string
2332 . ds doc-space\n[doc-args-processed] "\*[doc-space]
2336 .\" NS doc-set-spacing-for-punct-suffix macro
2337 .\" NS set spacing for punctuation suffixes
2339 .\" NS local variable:
2340 .\" NS doc-reg-dssfps
2342 .de doc-set-spacing-for-punct-suffix
2343 . if (\n[doc-args-processed] > 1) \{\
2344 . nr doc-reg-dssfps (\n[doc-args-processed] - 1)
2345 . ds doc-space\n[doc-reg-dssfps]
2348 . ds doc-space\n[doc-args-processed] "\*[doc-space]
2352 .\" NS doc-set-spacing-for-punct-prefix macro
2353 .\" NS set spacing for punctuation prefixes
2355 .de doc-set-spacing-for-punct-prefix
2356 . ds doc-space\n[doc-args-processed]
2360 .\" type switches (on current argument doc-arg-ptr)
2362 .\" NS doc-do- macro
2363 .\" NS catch errors (non-existent type)
2366 . tmc mdoc error: bogus type (can't determine
2367 . tm1 " `\*[doc-arg\n[doc-args-processed]]') (#\n[.c])
2371 .\" NS doc-do-macro macro
2372 .\" NS call request if macro
2375 . \*[doc-arg\n[doc-arg-ptr]]
2379 .\" NS doc-do-string macro
2380 .\" NS call .No if string
2388 .\" NS doc-do-punct-suffix macro
2389 .\" NS call .No if punctuation suffix
2391 .de doc-do-punct-suffix
2397 .\" NS doc-do-punct-prefix macro
2398 .\" NS call .No if punctuation prefix
2400 .de doc-do-punct-prefix
2406 .\" NS doc-do-xref-macro macro
2407 .\" NS ignore if macro
2409 .de doc-do-xref-macro
2413 .\" NS doc-do-xref-string macro
2414 .\" NS ignore if string
2416 .de doc-do-xref-string
2420 .\" NS doc-do-xref-punct-suffix macro
2421 .\" NS append if punctuation suffix
2423 .de doc-do-xref-punct-suffix
2424 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2431 .\" NS doc-do-xref-punct-prefix macro
2432 .\" NS append if punctuation prefix
2434 .de doc-do-xref-punct-prefix
2435 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2442 .\" NS Bf user macro
2443 .\" NS begin font mode (will be begin-mode/end-mode in groff & TeX)
2445 .\" NS width register `.Bf' set in doc-common
2448 . ds doc-macro-name Bf
2451 . nr doc-curr-font-for-Ef \n[.f]
2452 . nr doc-curr-size-for-Ef \n[.s]
2454 . if "\$1"Em" \*[doc-Em-font]\c
2455 . if "\$1"Li" \*[doc-Li-font]\c
2456 . if "\$1"Sy" \*[doc-Sy-font]\c
2457 . if "\$1"-emphasis" \*[doc-Em-font]\c
2458 . if "\$1"-literal" \*[doc-Li-font]\c
2459 . if "\$1"-symbolic" \*[doc-Sy-font]\c
2462 . tm Usage .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2466 .\" NS Ef user macro
2467 .\" NS end font mode
2469 .\" NS width register `.Ef' set in doc-common
2472 . ds doc-macro-name Ef
2475 . tm Usage .Ef (does not take arguments) (#\n[.c])
2477 . nop \&\f[\n[doc-curr-font-for-Ef]]\s[\n[doc-curr-size-for-Ef]]
2481 .\" NS Bk user macro
2484 .\" NS width register `.Bk' set in doc-common
2489 . ds doc-macro-name Bk
2492 . tm Usage: .Bk [-lines | -words] (#\n[.c])
2494 . if !"\*[doc-keep-type]"" \
2495 . tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2497 . tm .Bk -lines: Not implemented yet. (#\n[.c])
2499 . doc-set-hard-space
2501 . ds doc-keep-type \$1
2506 .\" NS Ek user macro
2509 .\" NS width register `.Ek' set in doc-common
2512 . ds doc-macro-name Ek
2515 . tm Usage .Ek (does not take arguments) (#\n[.c])
2517 . if "\*[doc-keep-type]"-lines" \
2518 . tm .Bk -lines: Not implemented yet. (#\n[.c])
2519 . if "\*[doc-keep-type]"-words" \
2520 . doc-set-soft-space
2525 .\" NS Bd user macro
2526 .\" NS begin display
2528 .\" NS width register `.Bd' set in doc-common
2530 .\" NS local variable:
2533 .nr doc-display-depth 0
2536 . ds doc-macro-name Bd
2539 . tm1 "Usage: .Bd [-literal | -filled | -ragged | -unfilled]
2540 . tm1 " [-offset [string]] [-compact] (#\n[.c])
2543 . nr doc-is-compact 0
2545 . nr doc-display-depth +1
2547 .\" XXX how do avoid `if !r'?
2549 . if !r doc-indent-stack\n[doc-display-depth] \
2550 . nr doc-indent-stack\n[doc-display-depth] 0
2552 . if "\$1"-literal" \{\
2554 . ds doc-display-type-stack\n[doc-display-depth] literal
2555 . nr doc-curr-font \n[.f]
2556 . nr doc-curr-size \n[.s]
2559 . nop \*[doc-Li-font]\c
2567 . if "\$1"-filled" \{\
2569 . ds doc-display-type-stack\n[doc-display-depth] filled
2573 . if "\$1"-ragged" \{\
2575 . ds doc-display-type-stack\n[doc-display-depth] ragged
2579 . if "\$1"-unfilled" \{\
2581 . ds doc-display-type-stack\n[doc-display-depth] unfilled
2585 . \" .tm Here is argc: \n[.$] and here is doc-reg-Bd \n[doc-reg-Bd]
2586 . if ((\n[doc-reg-Bd] >= 1) & (\n[.$] > \n[doc-reg-Bd])) \{\
2588 . doc-do-Bv-args \$@
2591 . if \n[doc-indent-stack\n[doc-display-depth]] \
2592 ' in (\n[.i]u + \n[doc-indent-stack\n[doc-display-depth]]u)
2594 . if !\n[doc-is-compact] \{\
2595 . if !\n[doc-in-synopsis-section] \{\
2596 . ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2597 . sp \n[doc-display-vertical]u
2599 ' sp \n[doc-display-vertical]u
2606 . nr doc-is-compact 0
2611 .\" NS doc-do-Bv-args macro
2612 .\" NS resolve remaining .Bd arguments
2614 .\" NS local variables:
2615 .\" NS doc-str-ddBa, doc-reg-ddBa
2618 . \" .tm in doc-do-Bv-args with args: \$@
2623 . if "\$1"-offset" \{\
2624 . ds doc-str-ddBa \$2
2626 . if "\*[doc-str-ddBa]"left" \{\
2627 . nr doc-reg-ddBa +1
2628 . nr doc-indent-stack\n[doc-display-depth] 0
2631 . if "\*[doc-str-ddBa]"right" \{\
2632 . nr doc-reg-ddBa +1
2633 . nr doc-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2636 . if "\*[doc-str-ddBa]"center" \{\
2637 . nr doc-reg-ddBa +1
2638 . nr doc-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2641 . if "\*[doc-str-ddBa]"indent" \{\
2642 . nr doc-reg-ddBa +1
2643 . nr doc-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2646 . if "\*[doc-str-ddBa]"indent-two" \{\
2647 . nr doc-reg-ddBa +1
2648 . nr doc-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2651 . if (\n[doc-reg-ddBa] == 1) \{\
2652 . nr doc-reg-ddBa +1
2653 . doc-get-width "\*[doc-str-ddBa]"
2654 . ie (\n[doc-width] > 2) \{\
2655 . ie ((\*[doc-str-ddBa] > 9n) & (\*[doc-str-ddBa] < 100n)) \
2656 . nr doc-indent-stack\n[doc-display-depth] \*[doc-str-ddBa]
2658 . nr doc-indent-stack\n[doc-display-depth] (\n[doc-width] * \n[doc-fixed-width])
2661 . if (\n[doc-width] == 2) \
2662 . doc-get-arg-type \*[doc-str-ddBa]
2663 . ie "\*[doc-arg-type]"macro" \
2664 . nr doc-indent-stack\n[doc-display-depth] \n[\*[doc-str-ddBa]]
2666 . nr doc-indent-stack\n[doc-display-depth] \*[doc-str-ddBa]
2671 . if "\$1"-compact" \
2672 . nr doc-is-compact 1
2674 .\" XXX check number of arguments
2676 . if (\n[doc-reg-ddBa] < \n[.$]) \{\
2677 . ie "\*[doc-str-ddBa]"" \{\
2679 . doc-do-Bv-args \$@
2683 . doc-do-Bv-args \$@
2689 .\" NS Ed user macro
2692 .\" NS width register `.Ed' set in doc-common
2695 . ds doc-macro-name Ed
2699 . if !\n[doc-display-depth] \
2700 . tm mdoc warning: Extraneous .Ed (#\n[.c])
2702 . if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2703 . ft \n[doc-curr-font]
2704 . ps \n[doc-curr-size]
2707 . in (\n[.i]u - \n[doc-indent-stack\n[doc-display-depth]]u)
2709 . rr doc-indent-stack\n[doc-display-depth]
2710 . rm doc-display-type-stack\n[doc-display-depth]
2711 . nr doc-display-depth -1
2719 .\" NS Bl user macro
2722 .\" NS width register `.Bl' set in doc-common
2724 .\" NS local variable:
2725 .\" NS doc-str-Bl, doc-reg-Bl
2729 . tm1 "Usage: .Bl [[-hang | -tag] [-width]]
2730 . tm1 " [ -item | -enum | -bullet | -diag] (#\n[.c])
2733 . ds doc-macro-name Bl
2735 . ds doc-str-Bl "\$1
2737 . nr doc-list-depth +1
2741 . while (\n[doc-reg-Bl] <= \n[.$]) \{\
2742 . ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
2746 . nr doc-num-args \n[.$]
2748 . if "\*[doc-str-Bl]"-hang" \{\
2750 . ds doc-list-stack\n[doc-list-depth] hang-list
2751 . nr doc-list-indent-stack\n[doc-list-depth] 6n
2752 . nr doc-have-indent 1
2755 . if "\*[doc-str-Bl]"-tag" \{\
2757 . ds doc-list-stack\n[doc-list-depth] tag-list
2758 . nr doc-have-indent 1
2761 . if "\*[doc-str-Bl]"-item" \{\
2763 . ds doc-list-stack\n[doc-list-depth] item-list
2764 . nr doc-have-indent 1
2767 . if "\*[doc-str-Bl]"-enum" \{\
2769 . ds doc-list-stack\n[doc-list-depth] enum-list
2770 . nr doc-list-indent-stack\n[doc-list-depth] 3n
2771 . nr doc-have-indent 1
2774 . if "\*[doc-str-Bl]"-bullet" \{\
2776 . ds doc-list-stack\n[doc-list-depth] bullet-list
2777 . nr doc-list-indent-stack\n[doc-list-depth] 2n
2778 . nr doc-have-indent 1
2781 . if "\*[doc-str-Bl]"-dash" \{\
2783 . ds doc-list-stack\n[doc-list-depth] dash-list
2784 . nr doc-list-indent-stack\n[doc-list-depth] 2n
2785 . nr doc-have-indent 1
2788 . if "\*[doc-str-Bl]"-hyphen" \{\
2790 . ds doc-list-stack\n[doc-list-depth] dash-list
2791 . nr doc-list-indent-stack\n[doc-list-depth] 2n
2792 . nr doc-have-indent 1
2795 . if "\*[doc-str-Bl]"-inset" \{\
2797 . ds doc-list-stack\n[doc-list-depth] inset-list
2798 . nr doc-have-indent 1
2801 . if "\*[doc-str-Bl]"-diag" \{\
2803 . ds doc-list-stack\n[doc-list-depth] diag-list
2804 . nr doc-have-diag-list 1
2807 . if "\*[doc-str-Bl]"-ohang" \{\
2809 . ds doc-list-stack\n[doc-list-depth] ohang-list
2810 . nr doc-have-indent 1
2813 . if "\*[doc-str-Bl]"-column" \{\
2815 . ds doc-list-stack\n[doc-list-depth] column-list
2818 . ie !\n[doc-arg-ptr] \{\
2819 . tm1 "Usage: .Bl [[-hang | -tag] [-width]]
2820 . tm1 " [ -item | -enum | -bullet | -diag] (#\n[.c])
2823 . doc-increment-list-stack
2824 . if ((\n[doc-arg-ptr] == 1) & (\n[doc-arg-ptr] <= \n[.$])) \{\
2827 . if "\*[doc-list-stack\n[doc-list-depth]]"column-list" \{\
2828 . doc-set-column-tab\n[doc-column-depth]
2829 . nr doc-list-indent-stack\n[doc-list-depth] 0
2830 ' in -\n[doc-column-indent-width]u
2831 . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
2832 . sp \n[doc-display-vertical]u
2835 . nr doc-column-depth 0
2841 . \" .ds doc-out-string
2844 . \" .tm1 " doc-list-stack[\n[doc-list-depth]]==\*[doc-list-stack\n[doc-list-depth]]
2852 .while (\n[i] < 100) \{\
2853 . nr doc-width-\n[i]n 1
2860 .\" NS doc-do-Bl-args macro
2861 .\" NS resolve remaining .Bl arguments
2863 .\" NS local variable:
2864 .\" NS doc-str-dBla, doc-reg-dBla
2868 . if (\n[doc-num-args] >= \n[doc-arg-ptr]) \{\
2871 . if "\*[doc-arg\n[doc-arg-ptr]]"-compact" \{\
2873 . nr doc-compact-list-stack\n[doc-list-depth] 1
2876 . if "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
2879 . nr have-tag-width 1
2880 . ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
2881 . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
2883 . doc-get-arg-width \n[doc-arg-ptr]
2884 . ie (\n[doc-width] > 2) \{\
2885 . nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width] * \n[doc-fixed-width])
2886 . if (\n[doc-width] == 3) \
2887 . if \A'\*[doc-str-dBla]' \
2888 . if r doc-width-\*[doc-str-dBla] \
2889 . nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]
2892 . doc-get-arg-type \*[doc-str-dBla]
2893 . ie "\*[doc-arg-type]"macro" \
2894 . nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
2896 . nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]u
2900 . if "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
2904 . ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
2905 . nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
2907 . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
2909 . doc-get-arg-width \n[doc-arg-ptr]
2910 . ie (\n[doc-width] > 2) \{\
2911 . nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width] * \n[doc-fixed-width])
2912 . if \A'\*[doc-str-dBla]' \
2913 . if r doc-width-\*[doc-str-dBla] \
2914 . nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
2918 . doc-get-arg-type \*[doc-str-dBla]
2919 . ie "\*[doc-arg-type]"macro" \
2920 . nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
2922 . nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
2927 . if !\n[doc-reg-dBla] \{\
2928 . if "\*[doc-list-stack\n[doc-list-depth]]"column-list" \{\
2929 . nr doc-column-depth +1
2930 . ds doc-arg\n[doc-column-depth] "\*[doc-arg\n[doc-arg-ptr]]
2933 . if (\n[doc-num-args] > \n[doc-arg-ptr]) \
2939 .\" NS El user macro
2942 .\" NS width register `.El' set in doc-common
2944 .\" NS local variables:
2945 .\" NS doc-str-El, doc-reg-El
2949 . tm Usage: .El (#\n[.c])
2951 . ds doc-macro-name El
2953 . ds doc-str-El \*[doc-list-stack\n[doc-list-depth]]
2955 . if "\*[doc-str-El]"column-list" \{\
2957 . doc-do-end-column-list
2960 . if "\*[doc-str-El]"enum-list" \
2961 . nr doc-enum-list-count 0
2963 . if \n[doc-have-diag-list] \{\
2965 . nr doc-have-diag-list 0
2966 . doc-decrement-list-stack
2967 . nr doc-list-depth -1
2968 . doc-increment-list-stack
2971 . if "\*[doc-str-El]"item-list" \{\
2972 ' in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
2973 . doc-decrement-list-stack
2974 . nr doc-list-depth -1
2975 . doc-increment-list-stack
2979 . if "\*[doc-str-El]"ohang-list" \{\
2980 ' in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
2981 . doc-decrement-list-stack
2982 . nr doc-list-depth -1
2983 . doc-increment-list-stack
2987 . if "\*[doc-str-El]"inset-list" \{\
2988 ' in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
2989 . doc-decrement-list-stack
2990 . nr doc-list-depth -1
2991 . doc-increment-list-stack
2995 . if !\n[doc-reg-El] \
3003 .\" NS doc-save-Pa-font string
3004 .\" NS save doc-Pa-font font string for section FILES (no underline if
3008 .\" NS It user macro
3011 .\" NS width register `.It' set in doc-common
3013 .\" NS local variable:
3014 .\" NS doc-str-It, doc-reg-It
3017 . ds doc-str-It \*[doc-list-stack\n[doc-list-depth]]
3019 . if "\*[doc-str-It]"" \{\
3020 . tm mdoc error: .It without preceding .Bl
3021 . tmc Usage .It -list-type [-width [string] | -compact | -offset [string]]
3027 . \" .tm1 " doc-list-stack[\n[doc-list-depth]]==\*[doc-str-It]
3034 . ds doc-macro-name It
3038 . while (\n[doc-reg-It] <= \n[.$]) \{\
3039 . ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3044 . nr doc-num-args \n[.$]
3046 . if "\*[doc-str-It]"diag-list" \{\
3049 . doc-remaining-args
3053 . if "\*[doc-str-It]"column-list" \{\
3060 . if "\*[doc-str-It]"item-list" \{\
3066 . if !\n[doc-reg-It] \{\
3067 . doc-parse-arg-vector
3069 . \" tm1 "It list-type==\*[doc-str-It]
3070 . \" tm1 " doc-arg-ptr==\n[doc-arg-ptr]
3071 . \" tm1 " beg arg(doc-arg[1])==\*[doc-arg1]
3072 . \" tm1 " doc-nesting-level==\n[doc-nesting-level]
3073 . \" tm1 " doc-in-diversion==\n[doc-in-diversion]
3074 . \" tm1 " doc-saved-list-immediate==\n[doc-saved-list-immediate]
3075 . \" tm1 " doc-args-processed==\n[doc-args-processed]
3077 . nr doc-nesting-level +1
3078 . nr doc-list-immediate 1
3080 . ds doc-curr-type \*[doc-type\n[doc-arg-ptr]]
3081 . ds doc-curr-arg "\*[doc-arg\n[doc-arg-ptr]]
3083 . if \n[doc-in-files-section] \{\
3084 . ds doc-save-Pa-font "\*[doc-Pa-font]
3086 . ds doc-Pa-font "\*[doc-No-font]
3089 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
3090 . \*[doc-arg\n[doc-arg-ptr]]
3096 . \" tm1 "in It here is doc-out-string==\*[doc-out-string]
3097 . \" tm1 " arg(doc-arg[1])==\*[doc-arg1]
3098 . \" tm1 " doc-nesting-level==\n[doc-nesting-level]
3099 . \" tm1 " doc-in-diversion==\n[doc-in-diversion]
3100 . \" tm1 " doc-saved-list-immediate==\n[doc-saved-list-immediate]
3101 . \" tm1 " doc-args-processed==\n[doc-args-processed]
3103 . ie \n[doc-saved-list-immediate] \
3104 . ds doc-saved-list-type "\*[doc-str-It]
3106 . doc-\*[doc-str-It]
3110 . doc-\*[doc-str-It]
3114 .\" NS doc-inset-list macro
3115 .\" NS .It item of list-type inset
3118 . doc-set-vertical-and-indent
3120 . nop \&\*[doc-out-string]
3122 . nr doc-nesting-level -1
3123 . nr doc-list-immediate 0
3130 .\" NS doc-hang-list macro
3131 .\" NS .It item of list-type hanging tag (as opposed to tagged)
3133 .\" NS local variable:
3137 . doc-set-vertical-and-indent-and-offset
3138 . nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3139 . ti -\n[doc-reg-dhl]u
3141 . ie (\w
\a\*[doc-out-string]
\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3142 . nop \&\*[doc-out-string]
3144 . nop \&\*[doc-out-string]\h'|\n[doc-reg-dhl]u'\c
3146 . nr doc-nesting-level -1
3148 . nr doc-list-immediate 0
3154 .\" NS doc-ohang-list macro
3155 .\" NS .It item of list-type overhanging tag
3158 . doc-set-vertical-and-indent
3159 . nop \&\*[doc-out-string]
3162 . nr doc-nesting-level -1
3164 . nr doc-list-immediate 0
3170 .\" NS doc-item-list macro
3171 .\" NS .It item of list-type [empty tag]
3174 . doc-set-vertical-and-indent
3177 . \" .ds doc-out-string
3183 .\" NS doc-enum-list-count register
3184 .\" NS contains current enum count value
3186 .nr doc-enum-list-count 0
3189 .\" NS doc-enum-list macro
3190 .\" NS enumerated list
3193 . nr doc-nesting-level +1
3194 . nr doc-enum-list-count +1
3195 . ds doc-out-string "\n[doc-enum-list-count].
3200 .\" NS doc-bullet-list macro
3201 .\" NS bullet paragraph list
3204 . nr doc-nesting-level +1
3205 . ds doc-out-string "\*[doc-Sy-font]\[bu]\f[P]
3210 .\" NS doc-dash-list macro
3211 .\" NS hyphen paragraph list (sub bullet list)
3214 . nr doc-nesting-level +1
3215 . ds doc-out-string "\*[doc-Sy-font]\-\f[P]
3220 .\" NS doc-do-list macro
3221 .\" NS .It item of list-type enum/bullet/hyphen
3223 .\" NS local variable:
3227 . doc-set-vertical-and-indent-and-offset
3228 . nr doc-reg-ddl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3229 . ti -\n[doc-reg-ddl]u
3231 . ie (\w
\a\*[doc-out-string]
\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3232 . nop \&\*[doc-out-string]
3234 . nop \&\*[doc-out-string]\h'|\n[doc-reg-ddl]u'\c
3236 . nr doc-nesting-level -1
3237 . \" .nr doc-in-diversion 1
3239 . nr doc-list-immediate 0
3245 .\" NS doc-diag-list macro
3246 .\" NS .It item of list-type diagnostic-message
3248 .nr doc-have-diag-list 0
3249 .nr doc-diag-list-input-line-count 0
3252 . nr doc-curr-font \n[.f]
3253 . nr doc-curr-size \n[.s]
3255 . ie \n[doc-have-diag-list] \{\
3256 . ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \
3263 . nr doc-diag-list-input-line-count \n[.c]
3265 . nop \*[doc-Sy-font]\*[doc-out-string]\c
3266 . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\*[doc-digit-string]\c
3274 .\" NS doc-tag-list macro
3275 .\" NS .It item of list-type `tag'
3277 .\" NS local variable:
3281 . \" tm in doc-tag-list here is doc-out-string==\*[doc-out-string]
3282 . if !\n[have-tag-width] \
3284 . doc-set-vertical-and-indent-and-offset
3285 . nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3286 . ti -\n[doc-reg-dtl]u
3288 . ie (\w
\a\*[doc-out-string]
\au > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3289 . nop \&\*[doc-out-string]
3293 . nop \&\*[doc-out-string]\h'|\n[doc-reg-dtl]u'\c
3295 . if \n[doc-in-files-section] \
3297 . ds doc-Pa-font "\*[doc-save-Pa-font]
3299 . nr doc-nesting-level -1
3300 . nr doc-list-immediate 0
3301 . \" .nr doc-in-diversion 1
3308 .\" NS doc-get-tag-width macro
3309 .\" NS resolve unknown tag width (if .Bl [inset | tag] only)
3311 .de doc-get-tag-width
3312 . if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3313 . ie "\*[doc-curr-type]"macro" \{\
3315 .\" XXX what is `lN'?
3317 . ds doc-tag-width-stack\n[lN] \*[doc-curr-arg]
3318 . nr doc-list-indent-stack\n[lN] \n[\*[doc-curr-arg]]
3321 . ds doc-tag-width-stack\n[lN] No
3322 . nr doc-list-indent-stack\n[lN] \n[No]
3324 . if !"\*[doc-tag-width-stack\n[doc-list-depth]]"\*[doc-tag-width-stack\n[lN]]" \
3325 . nr doc-have-indent 1
3330 .\" NS doc-set-vertical-and-indent-and-offset macro
3331 .\" NS set up vertical spacing (if compact) and indent (with offset)
3333 .de doc-set-vertical-and-indent-and-offset
3334 . ie \n[doc-have-indent] \{\
3335 . nr doc-have-indent 0
3336 . nr have-tag-width 0
3337 . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3338 . sp \n[doc-display-vertical]u
3339 . in (\n[.i]u + \n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3342 . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3343 . sp \n[doc-display-vertical]u
3351 .\" NS doc-set-vertical-and-indent macro
3352 .\" NS set up vertical spacing (if compact) and indent (without offset)
3354 .de doc-set-vertical-and-indent
3355 . ie \n[doc-have-indent] \{\
3356 . nr doc-have-indent 0
3357 . nr have-tag-width 0
3358 . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3359 . sp \n[doc-display-vertical]u
3360 . in (\n[.i]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3363 . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3364 . sp \n[doc-display-vertical]u
3372 .\" NS doc-saved-list-immediate register (bool)
3373 .\" NS saved doc-list-immediate value
3375 .nr doc-saved-list-immediate 0
3378 .\" NS doc-list-depth register
3379 .\" NS list type stack counter
3381 .nr doc-list-depth 0
3384 .\" NS doc-list-immediate register (bool)
3385 .\" NS tag flag (for diversions)
3388 .nr doc-column-depth 0
3389 .nr doc-compact-list-stack1 0
3390 .ds doc-tag-width-stack0
3391 .ds doc-tag-width-stack1
3392 .nr doc-list-offset-stack1 0
3395 .\" NS doc-end-list macro
3396 .\" NS list end function
3399 . \" .tm in doc-list-depth:
3400 . \" .tm1 " doc-list-offset-stack[\n[doc-list-depth]]==\n[doc-list-offset-stack\n[doc-list-depth]]
3401 . \" .tm1 " doc-list-indent-stack[\n[doc-list-depth]]==\n[doc-list-indent-stack\n[doc-list-depth]]
3403 . ie (\n[doc-list-offset-stack\n[doc-list-depth]] > 0) \{\
3404 ' in (\n[.i]u - \n[doc-list-indent-stack\n[doc-list-depth]]u - \n[doc-list-offset-stack\n[doc-list-depth]]u - \n[doc-digit-width]u)
3405 . rr doc-list-offset-stack\n[doc-list-depth]
3408 ' in (\n[.i]u - \n[doc-list-indent-stack\n[doc-list-depth]]u - \n[doc-digit-width]u)
3410 . if (\n[doc-list-depth] <= 0) \
3411 . tm mdoc warning: extraneous .El call (#\n[.c])
3413 . doc-decrement-list-stack
3414 . nr doc-list-depth -1
3415 . doc-increment-list-stack
3419 .\" NS doc-next-list-depth register
3420 .\" NS next possible doc-list-depth value
3422 .nr doc-next-list-depth 1
3425 .\" NS doc-increment-list-stack macro
3426 .\" NS set up next block for list
3428 .de doc-increment-list-stack
3429 . nr doc-next-list-depth (\n[doc-list-depth] + 1)
3430 . nr doc-list-indent-stack\n[doc-next-list-depth] 0
3431 . nr doc-list-offset-stack\n[doc-next-list-depth] 0
3432 . ds doc-tag-width-stack\n[doc-next-list-depth] \*[doc-tag-width-stack\n[doc-list-depth]]
3433 . ds doc-list-stack\n[doc-next-list-depth]
3434 . nr doc-compact-list-stack\n[doc-next-list-depth] 0
3438 .\" NS doc-decrement-list-stack macro
3439 .\" NS decrement stack
3441 .de doc-decrement-list-stack
3442 . rm doc-list-stack\n[doc-next-list-depth]
3443 . rr doc-list-indent-stack\n[doc-next-list-depth]
3444 . rr doc-list-offset-stack\n[doc-next-list-depth]
3445 . rm doc-tag-width-stack\n[doc-next-list-depth]
3446 . rr doc-compact-list-stack\n[doc-next-list-depth]
3447 . nr doc-next-list-depth -1
3451 .\" NS Xr user macro
3452 .\" NS cross reference (man page only)
3454 .\" NS width register `.Xr' set in doc-common
3457 . if !\n[doc-args-processed] \{\
3459 . tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
3461 . ds doc-macro-name Xr
3462 . doc-parse-args \$@
3467 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3468 . ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
3469 . tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
3471 . ie !"\*[doc-type\n[doc-arg-ptr]]"string" \
3472 . doc-do-xref-\*[doc-type\n[doc-arg-ptr]]
3474 . as doc-out-string \*[doc-Xr-font]
3475 . as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
3477 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3478 . if "\*[doc-type\n[doc-arg-ptr]]"string" \{\
3479 . as doc-out-string \&\*[lp]\*[doc-arg\n[doc-arg-ptr]]\*[rp]
3483 . ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \
3484 . doc-do-\*[doc-type\n[doc-arg-ptr]]
3486 . doc-print-and-reset
3493 .\" NS Sx user macro
3494 .\" NS cross section reference
3496 .\" NS width register `.Sx' set in doc-common
3499 . if !\n[doc-args-processed] \{\
3501 . tm Usage: .Sx Section Header \*[doc-punct-chars] (#\n[.c])
3503 . ds doc-macro-name Sx
3504 . doc-parse-args \$@
3509 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3510 . as doc-out-string \*[doc-Sx-font]
3511 . nr doc-curr-font \n[.f]
3512 . nr doc-curr-size \n[.s]
3513 . doc-print-recursive
3519 .\" NS doc-do-end-column-list macro
3520 .\" NS column-list end-list
3522 .de doc-do-end-column-list
3523 ' in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u - \n[doc-list-indent-stack\n[doc-list-depth]]u)
3526 . doc-decrement-list-stack
3527 . nr doc-list-depth -1
3528 . doc-increment-list-stack
3532 .\" NS doc-set-column-tab[1-6] macro
3533 .\" NS establish tabs for list-type column
3535 .de doc-set-column-tab1
3536 . ta \w
\a\*[doc-arg1]
\au
3537 . nr doc-column-indent-width \w
\a\*[doc-arg1]
\au
3538 ' in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3542 .de doc-set-column-tab2
3543 . ta \w
\a\*[doc-arg1]
\au +\w
\a\*[doc-arg2]
\au
3544 . nr doc-column-indent-width (\w
\a\*[doc-arg1]
\au + \w
\a\*[doc-arg2]
\au)
3545 ' in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3549 .de doc-set-column-tab3
3550 . ta \w
\a\*[doc-arg1]
\au +\w
\a\*[doc-arg2]
\au +\w
\a\*[doc-arg3]
\au
3551 . nr doc-column-indent-width (\w
\a\*[doc-arg1]
\au + \w
\a\*[doc-arg2]
\au + \w
\a\*[doc-arg3]
\au)
3552 ' in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3556 .de doc-set-column-tab4
3557 . ta \w
\a\*[doc-arg1]
\au +\w
\a\*[doc-arg2]
\au +\w
\a\*[doc-arg3]
\au +\w
\a\*[doc-arg4]
\au
3558 . nr doc-column-indent-width (\w
\a\*[doc-arg1]
\au + \w
\a\*[doc-arg2]
\au + \w
\a\*[doc-arg3]
\au + \w
\a\*[doc-arg4]
\au)
3559 ' in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3563 .de doc-set-column-tab5
3564 . ta \w
\a\*[doc-arg1]
\au +\w
\a\*[doc-arg2]
\au +\w
\a\*[doc-arg3]
\au +\w
\a\*[doc-arg4]
\au +\w
\a\*[doc-arg5]
\au
3565 . nr doc-column-indent-width (\w
\a\*[doc-arg1]
\au + \w
\a\*[doc-arg2]
\au + \w
\a\*[doc-arg3]
\au + \w
\a\*[doc-arg4]
\au +\w
\a\*[doc-arg5]
\au)
3566 ' in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3570 .\" This is packed abnormally close; intercol width should be an option
3571 .de doc-set-column-tab6
3572 . ta \w
\a\*[doc-arg1]
\au +\w
\a\*[doc-arg2]
\au +\w
\a\*[doc-arg3]
\au +\w
\a\*[doc-arg4]
\au +\w
\a\*[doc-arg5]
\au +\w
\a\*[doc-arg6]
\au
3573 . nr doc-column-indent-width (\w
\a\*[doc-arg1]
\au + \w
\a\*[doc-arg2]
\au + \w
\a\*[doc-arg3]
\au + \w
\a\*[doc-arg4]
\au + \w
\a\*[doc-arg5]
\au + \w
\a\*[doc-arg6]
\au)
3574 ' in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3578 .\" NS doc-column-list macro
3581 .\" NS local variable:
3585 . if !\n[doc-list-indent-stack\n[doc-list-depth]] \
3586 . nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
3589 ' in (\n[.i]u + \n[doc-column-indent-width]u)
3591 . ti -\n[doc-column-indent-width]u
3593 . doc-parse-arg-vector
3596 . ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3597 . if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
3598 . nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
3599 . ds doc-space\n[doc-reg-dcl]
3601 . doc-do-\*[doc-type\n[doc-arg-ptr]]
3604 . tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
3608 .\" NS Ta user macro
3609 .\" NS append tab (\t)
3611 .\" NS width register `.Ta' set in doc-common
3613 .\" NS local variable:
3617 . ie \n[doc-args-processed] \{\
3619 . ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3620 . if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
3621 . nr doc-reg-Ta (\n[doc-arg-ptr] - 1)
3622 . ds doc-space\n[doc-reg-Ta]
3624 . as doc-out-string \t
3625 . doc-do-\*[doc-type\n[doc-arg-ptr]]
3628 . as doc-out-string \t\c
3629 . ds doc-space\n[doc-arg-ptr]
3630 . doc-print-out-string
3632 . \" .ds doc-out-string
3636 . tm1 "Usage: Ta must follow column entry: e.g. (#\n[.c])
3637 . tm1 " .It column_string [Ta [column_string ...] ]
3642 .\" NS Dl user macro
3643 .\" NS display (one line) literal
3645 .\" NS width register `.Dl' set in doc-common
3647 .\" NS local variable:
3652 . in (\n[.i]u + \n[doc-display-indent]u)
3654 . ie !\n[doc-args-processed] \{\
3656 . tm Usage: .Dl argument ... (#\n[.c])
3658 . ds doc-macro-name Dl
3661 . while (\n[doc-reg-Dl] <= \n[.$]) \{\
3662 . ds doc-arg\n[doc-reg-Dl] "\$[\n[doc-reg-Dl]]
3666 . nr doc-num-args \n[.$]
3667 . doc-parse-arg-vector
3672 . tm Usage: .Dl not callable by other macros (#\n[.c])
3674 . in (\n[.i]u - \n[doc-display-indent]u)
3678 .\" NS D1 user macro
3679 .\" NS display (one line)
3681 .\" NS width register `.D1' set in doc-common
3683 .\" NS local variable:
3688 . in (\n[.i]u + \n[doc-display-indent]u)
3690 . ie !\n[doc-args-processed] \{\
3692 . tm Usage: .D1 argument ... (#\n[.c])
3694 . ds doc-macro-name D1
3697 . while (\n[doc-reg-D1] <= \n[.$]) \{\
3698 . ds doc-arg\n[doc-reg-D1] "\$[\n[doc-reg-D1]]
3702 . nr doc-num-args \n[.$]
3703 . doc-parse-arg-vector
3709 . tm Usage: .D1 not callable by other macros (#\n[.c])
3711 . in (\n[.i]u - \n[doc-display-indent]u)
3715 .\" NS Ex user macro
3719 . tm mdoc error: .Ex defunct, use .D1: \$@
3723 .\" NS Vt user macro
3724 .\" NS variable type (for forcing old style variable declarations)
3725 .\" NS this is not done in the same manner as .Ot for fortrash --
3726 .\" NS clean up later
3728 .\" NS width register `.Vt' set in doc-common
3731 . \" if a function declaration was the last thing given, want vertical space
3732 . if \n[doc-declaration-count] \{\
3734 . nr doc-declaration-count 0
3737 . \" if a subroutine was the last thing given, want vertical space
3738 . if \n[doc-function-count] \{\
3739 . ie !\n[doc-variable-type] \{\
3747 . nr doc-variable-type +1
3748 . nr doc-curr-font \n[.f]
3749 . nr doc-curr-size \n[.s]
3750 . nop \*[doc-Ft-font]\$*
3752 . ie !\n[doc-have-old-function] \
3755 . nop \&\*[doc-soft-space]
3757 . ft \n[doc-curr-font]
3758 . fs \n[doc-curr-size]
3762 .\" NS doc-is-func-type register (bool)
3763 .\" NS set if subroutine (in synopsis only) (fortran only)
3765 .nr doc-is-func-type 0
3768 .\" NS Ft user macro
3769 .\" NS function type
3771 .\" NS width register `.Ft' set in doc-common
3774 . if \n[doc-in-synopsis-section] \{\
3775 . if \n[doc-function-count] \{\
3777 . nr doc-declaration-count 0
3778 . nr doc-variable-type 0
3781 . if \n[doc-declaration-count] \{\
3783 . nr doc-declaration-count 0
3784 . nr doc-variable-type 0
3787 . if \n[doc-variable-type] \{\
3789 . nr doc-variable-type 0
3792 . nr doc-is-func-type 1
3795 . nr doc-curr-font \n[.f]
3796 . nr doc-curr-size \n[.s]
3797 . nop \*[doc-Ft-font]\$*
3799 . ft \n[doc-curr-font]
3800 . ps \n[doc-curr-size]
3805 .\" NS doc-have-old-function register
3807 .nr doc-have-old-function 0
3810 .\" NS Ot user macro
3811 .\" NS old function type (fortran - no newline)
3813 .\" NS width register `.Ot' set in doc-common
3816 . nr doc-have-old-function 1
3818 . if \n[doc-in-synopsis-section] \{\
3819 . if \n[doc-function-count] \{\
3821 . nr doc-declaration-count 0
3822 . nr doc-variable-type 0
3825 . if \n[doc-declaration-count] \{\
3827 . nr doc-declaration-count 0
3828 . nr doc-variable-type 0
3831 . if \n[doc-variable-type] \{\
3833 . nr doc-variable-type 0
3836 . nr doc-is-func-type 1
3840 . as doc-out-string \*[doc-Ft-font]\$*
3841 . as doc-out-string \ \f[P]
3845 .\" NS Fa user macro
3846 .\" NS function arguments
3848 .\" NS width register `.Fa' set in doc-common
3850 .\" NS local variable:
3854 . if !\n[doc-args-processed] \{\
3856 . tm Usage: .Fa Function Arguments ... \*[doc-punct-chars] (#\n[.c])
3858 . ds doc-macro-name Fa
3861 . while (\n[doc-reg-Fa] <= \n[.$]) \{\
3862 . ds doc-arg\n[doc-reg-Fa] "\$[\n[doc-reg-Fa]]
3866 . nr doc-num-args \n[.$]
3867 . doc-parse-arg-vector
3871 . ie \n[doc-func-arg-count] \
3875 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3876 . as doc-out-string \*[doc-Fa-font]
3877 . nr doc-curr-font \n[.f]
3878 . nr doc-curr-size \n[.s]
3879 . doc-print-recursive
3881 . if \n[doc-in-synopsis-section] \
3882 . if \n[doc-function-count] \
3889 .\" NS doc-do-function macro
3890 .\" NS internal .Fa for .Fc
3892 .nr doc-func-arg-count 0
3895 . ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
3897 . \" .if \n[doc-in-synopsis-section] \{\
3898 . ds doc-function-arg
3899 . nr doc-num-function-args 0
3900 . nr doc-function-args-processed 0
3901 . doc-insert-hard-space \*[doc-arg\n[doc-arg-ptr]]
3902 . if (\n[doc-num-function-args] > 1) \
3903 . rn doc-function-arg doc-arg\n[doc-arg-ptr]
3906 . if (\n[doc-func-arg-count] > 1) \{\
3907 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\|,
3908 . as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]
3909 . as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
3912 . if (\n[doc-func-arg-count] == 1) \{\
3913 . as doc-out-string \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]
3914 . as doc-out-string \f[P]\s[0]
3916 . nr doc-func-arg-count +1
3924 .\" NS doc-function-count register
3925 .\" NS break a line if more than one function in a synopsis
3927 .nr doc-function-count 0
3930 .\" NS Fn user macro
3933 .\" NS width register `.Fn' set in doc-common
3935 .\" NS local variable:
3939 . if !\n[doc-args-processed] \{\
3941 . tmc Usage: .Fn function_name function_arg(s) ... \*[doc-punct-chars]
3945 . ds doc-macro-name Fn
3948 . while (\n[doc-reg-Fn] <= \n[.$]) \{\
3949 . ds doc-arg\n[doc-reg-Fn] "\$[\n[doc-reg-Fn]]
3953 . nr doc-num-args \n[.$]
3954 . doc-parse-arg-vector
3958 . if \n[doc-in-synopsis-section] \{\
3959 . \" if there is/has been more than one subroutine declaration
3960 . ie !\n[doc-is-func-type] \{\
3961 . if \n[doc-function-count] \{\
3963 . nr doc-variable-type 0
3964 . nr doc-declaration-count 0
3969 . nr doc-variable-type 0
3970 . nr doc-declaration-count 0
3971 . nr doc-is-func-type 0
3974 . if \n[doc-declaration-count] \{\
3976 . nr doc-variable-type 0
3979 . if \n[doc-variable-type] \{\
3981 . nr doc-declaration-count 0
3984 . nr doc-function-count +1
3985 . nr doc-is-func-type 0
3988 . ie (\n[doc-in-synopsis-section] > 1) \
3991 . if !\n[doc-indent-synopsis] \
3992 . nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
3995 . in +\n[doc-indent-synopsis]u
3996 . ti -\n[doc-indent-synopsis]u
3997 . nr doc-in-synopsis-section +1
4001 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4002 . nr doc-curr-font \n[.f]
4003 . nr doc-curr-size \n[.s]
4004 . as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4005 . as doc-out-string \f[P]\s[0]\*[lp]
4008 . ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4009 . as doc-out-string \*[doc-Fa-font]
4010 . doc-do-function-\*[doc-type\n[doc-arg-ptr]]
4013 . as doc-out-string \|\*[rp]
4014 . doc-print-and-reset
4017 . if \n[doc-in-synopsis-section] \
4018 . in -\n[doc-indent-synopsis]u
4023 .\" NS doc-do-function-macro macro
4025 .de doc-do-function-macro
4026 . ie \n[doc-in-synopsis-section] \{\
4027 . as doc-out-string \&\*[rp]\f[R];\f[P]
4028 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4031 . as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4033 . \*[doc-arg\n[doc-arg-ptr]]
4037 .\" NS doc-do-function-string macro
4038 .\" NS handle function arguments
4040 .\" NS local variable:
4043 .de doc-do-function-string
4044 . if \n[doc-in-synopsis-section] \{\
4045 . ds doc-function-arg
4046 . nr doc-num-function-args 0
4047 . nr doc-function-args-processed 0
4048 . doc-insert-hard-space \*[doc-arg\n[doc-arg-ptr]]
4049 . if (\n[doc-num-function-args] > 1) \
4050 . rn doc-function-arg doc-arg\n[doc-arg-ptr]
4053 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4055 . ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
4056 . nr doc-reg-ddfs \n[doc-arg-ptr]
4058 . if "\*[doc-type\n[doc-arg-ptr]]"string" \{\
4059 . as doc-out-string \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]],
4060 . as doc-out-string "\*[doc-space\n[doc-reg-ddfs]]\f[P]\s[0]\|
4062 . doc-do-function-\*[doc-type\n[doc-arg-ptr]]
4065 . ie \n[doc-in-synopsis-section] \{\
4066 . as doc-out-string \&\*[rp]\f[R];\f[P]
4067 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4070 . as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4071 . doc-print-and-reset
4076 .\" NS doc-do-function-punct-suffix macro
4078 .de doc-do-function-punct-suffix
4079 . ie \n[doc-in-synopsis-section] \{\
4080 . as doc-out-string \&\*[rp]\f[R];\f[P]
4081 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4082 . as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4085 . as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4086 . as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4089 . ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \
4092 . doc-print-and-reset
4096 .\" NS doc-do-function-punct-prefix macro
4097 .\" NS write out function
4099 .de doc-do-function-punct-prefix
4100 . ie \n[doc-in-synopsis-section] \{\
4101 . as doc-out-string \&\*[rp]\f[R];\f[P]
4102 . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4103 . as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4106 . as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4107 . as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4110 . ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
4115 . doc-print-and-reset
4119 .\" NS Fo user macro
4120 .\" NS function open
4122 .\" NS width register `.Fo' set in doc-common
4124 .\" NS local variable:
4130 . if (\n[doc-args-processed] == 0) \{\
4131 . ie (\n[.$] == 0) \
4132 . tm Usage: .Fo function_name (#\n[.c])
4134 . ds doc-macro-name Fo
4137 . while (\n[doc-reg-Fo] <= \n[.$]) \{\
4138 . ds doc-arg\n[doc-reg-Fo] "\$[\n[doc-reg-Fo]]
4142 . nr doc-num-args \n[.$]
4143 . doc-parse-arg-vector
4147 . if \n[doc-in-synopsis-section] \{\
4148 . \" if there is/has been more than one subroutine declaration
4149 . ie !\n[doc-is-func-type] \{\
4150 . if \n[doc-function-count] \{\
4152 . nr doc-variable-type 0
4153 . nr doc-declaration-count 0
4158 . nr doc-variable-type 0
4159 . nr doc-declaration-count 0
4160 . nr doc-is-func-type 0
4163 . if \n[doc-declaration-count] \{\
4165 . nr doc-variable-type 0
4168 . if \n[doc-variable-type] \{\
4170 . nr doc-declaration-count 0
4173 . nr doc-function-count +1
4174 . nr doc-is-func-type 0
4177 . ie (\n[doc-in-synopsis-section] > 1) \
4180 . if !\n[doc-indent-synopsis] \
4181 . nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4184 . in +\n[doc-indent-synopsis]u
4185 . ti -\n[doc-indent-synopsis]u
4186 . nr doc-in-synopsis-section +1
4190 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4191 . nr doc-nesting-level +1
4192 . nr doc-func-arg-count 1
4193 . nr doc-curr-font \n[.f]
4194 . nr doc-curr-size \n[.s]
4196 . as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4197 . as doc-out-string \f[P]\s[0]\*[lp]
4203 .\" NS Fc user macro
4204 .\" NS function close
4206 .\" NS width register `.Fc' set in doc-common
4208 .\" NS local variable:
4212 . if !\n[doc-args-processed] \{\
4214 . ds doc-macro-name Fc
4217 . while (\n[doc-reg-Fc] <= \n[.$]) \{\
4218 . ds doc-arg\n[doc-reg-Fc] "\$[\n[doc-reg-Fc]]
4222 . nr doc-num-args \n[.$]
4223 . doc-parse-arg-vector
4227 . nr doc-func-arg-count 0
4228 . nr doc-nesting-level -1
4230 . ie \n[doc-in-synopsis-section] \
4231 . as doc-out-string \|\*[rp]\f[R];\f[P]
4233 . as doc-out-string \|\*[rp]
4234 . ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
4236 . \*[doc-arg\n[doc-arg-ptr]]
4239 . doc-print-and-reset
4241 . if \n[doc-in-synopsis-section] \
4242 . in -\n[doc-indent-synopsis]u
4248 .\" NS doc-insert-hard-space macro
4249 .\" NS set hard space inbetween function arguments
4251 .de doc-insert-hard-space
4252 . \" .tm1 "doc-insert-hard-space:
4253 . \" .tm1 " doc-num-function-args==\n[doc-num-function-args]
4254 . \" .tm1 " doc-function-args-processed==\n[doc-function-args-processed]
4255 . \" .tm1 " args==\$@
4257 . if !\n[doc-num-function-args] \{\
4258 . nr doc-num-function-args \n[.$]
4259 . nr doc-function-args-processed 0
4260 . ds doc-function-arg
4263 . nr doc-function-args-processed +1
4264 . as doc-function-arg "\$1
4266 . if (\n[doc-function-args-processed] < \n[doc-num-function-args]) \{\
4267 . as doc-function-arg "\*[doc-hard-space]
4270 . doc-insert-hard-space \$@
4275 .\" Very crude references, stash all reference info into strings (usual
4276 .\" use of doc-out-string, then doc-out-string contents copied to
4277 .\" string of retrievable naming convention), print out reference on .Re
4278 .\" request and clean up. Ordering very limited, no fancy citations, but
4279 .\" can do articles, journals, and books -- need to add several missing
4280 .\" options (like city etc). Should be able to grab a refer entry, massage
4281 .\" it a wee bit (prefix a `.' to the %[A-Z]) and not worry (ha!).
4284 .\" NS Rs user macro
4285 .\" NS reference start
4287 .\" NS width register `.Rs' set in doc-common
4290 . nr doc-is-reference 1
4291 . doc-reset-reference
4292 . if \n[doc-in-see-also-section] \
4294 . nr doc-reference-count 0
4298 .\" NS Re user macro
4299 .\" NS reference end
4301 .\" NS width register `.Re' set in doc-common
4304 . doc-print-reference
4305 . doc-reset-reference
4306 . nr doc-is-reference 0
4310 .\" NS doc-reset-reference macro
4311 .\" NS reference cleanup
4313 .de doc-reset-reference
4314 . nr doc-author-count 0
4315 . nr doc-journal-count 0
4316 . nr doc-issue-count 0
4317 . nr doc-optional-count 0
4318 . nr doc-corporate-count 0
4319 . nr doc-report-count 0
4320 . nr doc-reference-title-count 0
4321 . nr doc-volume-count 0
4322 . nr doc-date-count 0
4323 . nr doc-page-number-count 0
4324 . nr doc-book-count 0
4325 . ds doc-reference-string-name
4326 . rm doc-journal-name doc-issue-name doc-optional-string doc-report-name doc-corporate-name doc-reference-title-name doc-volume-name doc-date-count doc-page-number-string doc-book-name
4330 .\" NS doc-print-reference macro
4331 .\" NS reference print
4333 .de doc-print-reference
4334 . if \n[doc-author-count] \{\
4335 . nop \&\*[doc-author-name1],
4336 . nr doc-authors-processed 1
4337 . if (\n[doc-author-count] > 1) \
4338 . doc-print-reference-authors
4339 . nr doc-reference-count -\n[doc-author-count]
4342 . if \n[doc-reference-title-count] \{\
4343 . nr doc-reference-count -1
4344 . ie !\n[doc-reference-count] \{\
4345 . ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \
4346 . nop \&\*[q]\*[doc-reference-title-name]\*[q].
4348 . nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font].
4351 . ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \
4352 . nop \&\*[q]\*[doc-reference-title-name]\*[q],
4354 . nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font],
4358 . if \n[doc-book-count] \{\
4359 . nr doc-reference-count -1
4360 . ie !\n[doc-reference-count] \
4361 . nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font].
4363 . nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font],
4366 . if \n[doc-publisher-count] \{\
4367 . nr doc-reference-count -1
4368 . ie !\n[doc-reference-count] \
4369 . nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font].
4371 . nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font],
4374 . if \n[doc-journal-count] \{\
4375 . nr doc-reference-count -1
4376 . ie !\n[doc-reference-count] \
4377 . nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font].
4379 . nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font],
4382 . if \n[doc-report-count] \{\
4383 . nr doc-reference-count -1
4384 . ie !\n[doc-reference-count] \
4385 . nop \&\*[doc-report-name].
4387 . nop \&\*[doc-report-name],
4390 . if \n[doc-issue-count] \{\
4391 . nr doc-reference-count -1
4392 . ie !\n[doc-reference-count] \
4393 . nop \&\*[doc-issue-name].
4395 . nop \&\*[doc-issue-name],
4398 . if \n[doc-volume-count] \{\
4399 . nr doc-reference-count -1
4400 . ie !\n[doc-reference-count] \
4401 . nop \&\*[doc-volume-name].
4403 . nop \&\*[doc-volume-name],
4406 . if \n[doc-page-number-count] \{\
4407 . nr doc-reference-count -1
4408 . ie !\n[doc-reference-count] \
4409 . nop \&\*[doc-page-number-string].
4411 . nop \&\*[doc-page-number-string],
4414 . if \n[doc-corporate-count] \{\
4415 . nr doc-reference-count -1
4416 . ie !\n[doc-reference-count] \
4417 . nop \&\*[doc-corporate-name].
4419 . nop \&\*[doc-corporate-name],
4422 . if \n[doc-date-count] \{\
4423 . nr doc-reference-count -1
4424 . ie !\n[doc-reference-count] \
4425 . nop \&\*[doc-date].
4427 . nop \&\*[doc-date],
4430 . if \n[doc-optional-count] \{\
4431 . nr doc-reference-count -1
4432 . ie !\n[doc-reference-count] \
4433 . nop \&\*[doc-optional-string].
4435 . nop \&\*[doc-optional-string],
4438 . if \n[doc-reference-count] \
4439 . tm mdoc warning: unresolved reference problem
4443 .\" NS doc-print-reference-authors macro
4444 .\" NS print out reference authors
4446 .de doc-print-reference-authors
4447 . nr doc-authors-processed +1
4448 . ie (\n[doc-author-count] == \n[doc-authors-processed]) \
4449 . nop \&and \*[doc-author-name\n[doc-authors-processed]],
4451 . nop \&\*[doc-author-name\n[doc-authors-processed]],
4452 . doc-print-reference-authors
4457 .\" NS %A user macro
4458 .\" NS reference author(s)
4460 .\" NS width register `.%A' set in doc-common
4463 . if !\n[doc-args-processed] \{\
4465 . tm Usage: .%A Author_name (#\n[.c])
4467 . nr doc-author-count +1
4468 . nr doc-reference-count +1
4469 . ds doc-reference-string-name doc-author-name\n[doc-author-count]
4471 . ds doc-macro-name %A
4472 . doc-parse-args \$@
4477 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4478 . nr doc-curr-font \n[.f]
4479 . nr doc-curr-size \n[.s]
4485 .\" NS %B user macro
4486 .\" NS [reference] Book Name
4488 .\" NS width register `.%B' set in doc-common
4490 .\" NS local variable:
4494 . if !\n[doc-args-processed] \{\
4496 . tm Usage: .%B Book Name (#\n[.c])
4498 . if \n[doc-is-reference] \{\
4499 . nr doc-book-count +1
4500 . nr doc-reference-count +1
4501 . ds doc-reference-string-name doc-book-name
4504 . ds doc-macro-name %B
4507 . while (\n[doc-reg-%B] <= \n[.$]) \{\
4508 . ds doc-arg\n[doc-reg-%B] "\$[\n[doc-reg-%B]]
4512 . nr doc-num-args \n[.$]
4513 . doc-parse-arg-vector
4518 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4519 . nr doc-curr-font \n[.f]
4520 . nr doc-curr-size \n[.s]
4522 . ie !\n[doc-is-reference] \{\
4523 . as doc-out-string \*[doc-Em-font]
4524 . doc-print-recursive
4532 .\" NS %D user macro
4533 .\" NS [reference] date
4535 .\" NS width register `.%D' set in doc-common
4537 .\" NS local variable:
4541 . if !\n[doc-args-processed] \{\
4543 . tm Usage: .%D Date (#\n[.c])
4545 . nr doc-date-count +1
4546 . nr doc-reference-count +1
4547 . ds doc-reference-string-name doc-date
4549 . ds doc-macro-name %D
4552 . while (\n[doc-reg-%D] <= \n[.$]) \{\
4553 . ds doc-arg\n[doc-reg-%D] "\$[\n[doc-reg-%D]]
4557 . nr doc-num-args \n[.$]
4558 . doc-parse-arg-vector
4563 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4564 . nr doc-curr-font \n[.f]
4565 . nr doc-curr-size \n[.s]
4571 .\" NS %I user macro
4572 .\" NS [reference] issuer/publisher name
4574 .\" NS width register `.%I' set in doc-common
4576 .\" NS local variable:
4580 . if !\n[doc-args-processed] \{\
4582 . tm Usage: .%I Issuer/Publisher Name (#\n[.c])
4584 . nr doc-publisher-count +1
4585 . nr doc-reference-count +1
4586 . ds doc-reference-string-name doc-publisher-name
4588 . ds doc-macro-name %I
4591 . while (\n[doc-reg-%I] <= \n[.$]) \{\
4592 . ds doc-arg\n[doc-reg-%I] "\$[\n[doc-reg-%I]]
4596 . nr doc-num-args \n[.$]
4597 . doc-parse-arg-vector
4602 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4603 . nr doc-curr-font \n[.f]
4604 . nr doc-curr-size \n[.s]
4610 .\" NS %J user macro
4611 .\" NS [reference] Journal Name
4613 .\" NS width register `.%J' set in doc-common
4615 .\" NS local variable:
4619 . if !\n[doc-args-processed] \{\
4621 . tm Usage: .%J Journal Name (#\n[.c])
4623 . ds doc-macro-name %J
4624 . nr doc-journal-count +1
4625 . ds doc-reference-string-name doc-journal-name
4626 . nr doc-reference-count +1
4629 . while (\n[doc-reg-%J] <= \n[.$]) \{\
4630 . ds doc-arg\n[doc-reg-%J] "\$[\n[doc-reg-%J]]
4634 . nr doc-num-args \n[.$]
4635 . doc-parse-arg-vector
4640 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4641 . nr doc-curr-font \n[.f]
4642 . nr doc-curr-size \n[.s]
4648 .\" NS %N user macro
4649 .\" NS [reference] issue number
4651 .\" NS width register `.%N' set in doc-common
4654 . if !\n[doc-args-processed] \{\
4656 . tm Usage: .%N issue number (#\n[.c])
4658 . nr doc-issue-count +1
4659 . nr doc-reference-count +1
4660 . ds doc-reference-string-name doc-issue-name
4662 . ds doc-macro-name %N
4663 . doc-parse-args \$@
4668 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4669 . nr doc-curr-font \n[.f]
4670 . nr doc-curr-size \n[.s]
4676 .\" NS %O user macro
4677 .\" NS [reference] optional information
4679 .\" NS width register `.%O' set in doc-common
4681 .\" NS local variable:
4685 . if !\n[doc-args-processed] \{\
4687 . tm Usage: .%O optional information ... \*[doc-punct-chars] (#\n[.c])
4689 . nr doc-optional-count +1
4690 . nr doc-reference-count +1
4691 . ds doc-reference-string-name doc-optional-string
4693 . ds doc-macro-name %O
4696 . while (\n[doc-reg-%O] <= \n[.$]) \{\
4697 . ds doc-arg\n[doc-reg-%O] "\$[\n[doc-reg-%O]]
4701 . nr doc-num-args \n[.$]
4702 . doc-parse-arg-vector
4707 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4708 . nr doc-curr-font \n[.f]
4709 . nr doc-curr-size \n[.s]
4715 .\" NS %P user macro
4716 .\" NS [reference] page numbers
4718 .\" NS width register `.%P' set in doc-common
4721 . if !\n[doc-args-processed] \{\
4723 . tm Usage: .%P page numbers ... \*[doc-punct-chars] (#\n[.c])
4725 . nr doc-page-number-count +1
4726 . nr doc-reference-count +1
4727 . ds doc-reference-string-name doc-page-number-string
4729 . ds doc-macro-name %P
4732 . while (\n[doc-reg-%P] <= \n[.$]) \{\
4733 . ds doc-arg\n[doc-reg-%P] "\$[\n[doc-reg-%P]]
4737 . nr doc-num-args \n[.$]
4738 . doc-parse-arg-vector
4743 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4744 . nr doc-curr-font \n[.f]
4745 . nr doc-curr-size \n[.s]
4751 .\" NS %Q user macro
4752 .\" NS corporate or foreign author
4754 .\" NS width register `.%Q' set in doc-common
4756 .\" NS local variable:
4760 . if !\n[doc-args-processed] \{\
4762 . tm Usage: .%Q Corporate or Foreign Author (#\n[.c])
4764 . nr doc-corporate-count +1
4765 . nr doc-reference-count +1
4766 . ds doc-reference-string-name doc-corporate-name
4768 . ds doc-macro-name %Q
4771 . while (\n[doc-reg-%Q] <= \n[.$]) \{\
4772 . ds doc-arg\n[doc-reg-%Q] "\$[\n[doc-reg-%Q]]
4776 . nr doc-num-args \n[.$]
4777 . doc-parse-arg-vector
4782 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4783 . nr doc-curr-font \n[.f]
4784 . nr doc-curr-size \n[.s]
4790 .\" NS %R user macro
4791 .\" NS [reference] report name
4793 .\" NS width register `.%R' set in doc-common
4795 .\" NS local variable:
4799 . if (\n[doc-args-processed] == 0) \{\
4800 . ie (\n[.$] == 0) \
4801 . tm Usage: .%R reference report (#\n[.c])
4803 . nr doc-report-count +1
4804 . nr doc-reference-count +1
4805 . ds doc-reference-string-name doc-report-name
4807 . ds doc-macro-name %R
4810 . while (\n[doc-reg-%R] <= \n[.$]) \{\
4811 . ds doc-arg\n[doc-reg-%R] "\$[\n[doc-reg-%R]]
4815 . nr doc-num-args \n[.$]
4816 . doc-parse-arg-vector
4821 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4822 . nr doc-curr-font \n[.f]
4823 . nr doc-curr-size \n[.s]
4829 .\" NS %T user macro
4830 .\" NS reference title
4832 .\" NS width register `.%T' set in doc-common
4834 .\" NS local variable:
4838 . if !\n[doc-args-processed] \{\
4840 . tm Usage: .%T reference title (#\n[.c])
4842 . if \n[doc-is-reference] \{\
4843 . nr doc-reference-title-count +1
4844 . nr doc-reference-count +1
4845 . ds doc-reference-string-name doc-reference-title-name
4848 . ds doc-macro-name %T
4851 . while (\n[doc-reg-%T] <= \n[.$]) \{\
4852 . ds doc-arg\n[doc-reg-%T] "\$[\n[doc-reg-%T]]
4856 . nr doc-num-args \n[.$]
4857 . doc-parse-arg-vector
4862 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4863 . nr doc-curr-font \n[.f]
4864 . nr doc-curr-size \n[.s]
4865 . ie !\n[doc-is-reference] \{\
4866 . as doc-out-string \*[doc-Em-font]
4867 . doc-print-recursive
4875 .\" NS %V user macro
4876 .\" NS reference volume
4878 .\" NS width register `.%V' set in doc-common
4881 . if !\n[doc-args-processed] \{\
4883 . tm Usage: .%V Volume , ... \*[doc-punct-chars] (#\n[.c])
4885 . ds doc-macro-name %V
4886 . nr doc-volume-count +1
4887 . nr doc-reference-count +1
4888 . ds doc-reference-string-name doc-volume-name
4889 . doc-parse-args \$@
4894 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4895 . nr doc-curr-font \n[.f]
4896 . nr doc-curr-size \n[.s]
4902 .\" NS doc-do-references macro
4903 .\" NS reference recursion routine
4905 .\" NS local variables:
4906 .\" NS doc-str-ddr, doc-reg-ddr
4908 .de doc-do-references
4911 . ds doc-str-ddr "\*[doc-type\n[doc-arg-ptr]]
4913 . ie "\*[doc-str-ddr]"macro" \{\
4914 . \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4915 . ie "\*[doc-arg\n[doc-arg-ptr]]"Tn" \
4916 . doc-reference-trademark
4918 . doc-append-arg doc-do-references macro
4919 . \*[doc-arg\n[doc-arg-ptr]]
4923 . nr doc-reg-ddr \n[doc-arg-ptr]
4924 . ie "\*[doc-str-ddr]"string" \
4925 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4927 . as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4929 . \" . as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4930 . \" . as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4932 . ie (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
4933 . \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4934 . as \*[doc-reference-string-name] \&\*[doc-out-string]
4936 . ds doc-reference-string-name
4941 . as doc-out-string "\*[doc-space\n[doc-reg-ddr]]
4948 .\" NS Hf user macro
4949 .\" NS source include header files.
4951 .\" NS width register `.Hf' set in doc-common
4959 . nr doc-curr-font \n[.f]
4960 . nr doc-curr-size \n[.s]
4963 . nop \*[doc-Li-font]
4974 . ft \n[doc-curr-font]
4975 . ps \n[doc-curr-size]
4980 .\" NS doc-have-author register
4982 .nr doc-have-author 0
4985 .\" NS An user macro
4988 .\" NS width register `.An' set in doc-common
4991 . if \n[doc-in-authors-section] \{\
4992 . ie \n[doc-have-author] \
4995 . nr doc-have-author 1
4998 . if !\n[doc-args-processed] \{\
5000 . tm Usage: .An author_name ... \*[doc-punct-chars] (#\n[.c])
5002 . ds doc-macro-name An
5003 . doc-parse-args \$@
5008 . if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
5009 . nr doc-curr-font \n[.f]
5010 . nr doc-curr-size \n[.s]
5011 . doc-print-recursive
5016 .\" NS Sf user macro
5019 .\" NS width register `.Sf' set in doc-common
5022 . tm mdoc error: .Sf defunct, use .Pf or .Ns
5026 .ds doc-func-error-string "function returns the value 0 if successful;
5027 .as doc-func-error-string " otherwise the value -1 is returned and
5028 .as doc-func-error-string " the global variable \*[doc-Va-font]errno\f[P]
5029 .as doc-func-error-string " is set to indicate the error.
5032 .\" NS Rv user macro
5033 .\" NS return values
5035 .\" NS width register `.Rv' set in doc-common
5037 .\" NS local variable:
5045 . tm Usage: .Rv [-std] (#\n[.c])
5047 . \" .ds doc-macro-name Rv
5048 . \" .nr doc-arg-ptr 0
5050 . \" .ds doc-arg1 \$2
5051 . \" .ds doc-arg2 \$3
5052 . \" .ds doc-arg3 \$4
5053 . \" .ds doc-arg4 \$5
5054 . \" .ds doc-arg5 \$6
5055 . \" .ds doc-arg6 \$7
5056 . \" .ds doc-arg7 \$8
5057 . \" .ds doc-arg8 \$9
5059 . \" .nr doc-num-args (\n[.$] - 1)
5062 . doc-reg-Rv \*[doc-section]
5063 . if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
5064 . tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
5068 . nop \&\*[doc-func-error-string]
5074 .\" NS Mt user macro
5075 .\" NS mailto (for conversion to HTML)
5082 .\" NS Lk user macro
5083 .\" NS link (for conversion to HTML)
5085 .\" NS local variables:
5086 .\" NS doc-str-Lk, doc-reg-Lk
5089 . ds doc-str-Lk Sy \$@
5091 . ie (\n[.$] >= 2) \{\
5092 . doc-get-arg-type \$2
5093 . ie (\[doc-arg-type] < 3) \{\
5095 . ds doc-str-Lk Sy "\$1"
5096 . doc-get-width "\$1"
5099 . as doc-str-Lk " \$@
5102 . doc-get-width "\$1"
5105 . doc-get-width "\$1"
5111 . ie (\n[doc-width] >= \n[doc-reg-Lk]) \
5121 . tm mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
5122 . ab Should this have been .Em ...?