* doc/groff.texinfo: More info on conditionals.
[s-roff.git] / tmac / doc.tmac
blob815e3d465b402b5c06a407e4bf7b92e6fd77e5da
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"      This product includes software developed by the University of
15 .\"      California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)doc 8.1 (Berkeley) 06/08/93
33 .\"
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.
38 .\"
39 .\" Modified by
40 .\"
41 .\"   Werner LEMBERG <wl@gnu.org>      and
42 .\"   Ruslan Ermilov <ru@freebsd.org>
43 .\"
44 .\" to make it more readable: using long names and many groff features,
45 .\" updating and extending documentation, etc.
46 .\"
47 .\" %beginstrip%
50 .if !\n(.g \
51 .  ab This version of mdoc can be run with GNU troff only!
54 .cp 0
57 .if ((\n[.x] == 0) : ((\n[.x] == 1) & (\n[.y] < 17))) \
58 .  ab You need GNU troff version 1.17 or higher to run this version of mdoc!
61 .\" Load start-up files
62 .ie t \
63 .  mso mdoc/doc-ditroff
64 .el \
65 .  mso mdoc/doc-nroff
67 .mso mdoc/doc-common
68 .mso mdoc/doc-syms
71 .eo
74 .\" NS doc-macro-name global string
75 .\" NS   name of calling request (set in each user-requestable macro)
77 .ds doc-macro-name
78 .als doc-arg0 doc-macro-name
81 .\" NS doc-arg-limit global register
82 .\" NS   total number of arguments
84 .nr doc-arg-limit 0
87 .\" NS doc-num-args global register
88 .\" NS   number of arguments to handle (must be set to \n[.$] prior to
89 .\" NS   `doc-parse-arg-vector' request)
91 .nr doc-num-args 0
94 .\" NS doc-arg-ptr global register
95 .\" NS   argument pointer
97 .nr doc-arg-ptr 0
100 .\" NS doc-argXXX global string
101 .\" NS   argument vector
102 .\" NS
103 .\" NS limit:
104 .\" NS   doc-arg-limit
106 .ds doc-arg1
109 .\" NS doc-typeXXX global register
110 .\" NS   argument type vector (macro=1, string=2, punctuation suffix=3,
111 .\" NS   punctuation prefix=4)
112 .\" NS
113 .\" NS limit:
114 .\" NS   doc-arg-limit
116 .nr doc-type1 0
119 .\" NS doc-spaceXXX global string
120 .\" NS   space vector
121 .\" NS
122 .\" NS limit:
123 .\" NS   doc-arg-limit
125 .ds doc-space1
128 .\" NS doc-parse-args macro
129 .\" NS   parse arguments (recursively) (`.doc-parse-args arg ...')
130 .\" NS
131 .\" NS modifies:
132 .\" NS   doc-arg-limit
133 .\" NS   doc-arg-ptr
134 .\" NS   doc-argXXX
135 .\" NS   doc-spaceXXX
136 .\" NS   doc-typeXXX
137 .\" NS   doc-arg-ptr
138 .\" NS   doc-have-space
139 .\" NS
140 .\" NS local variables:
141 .\" NS   doc-reg-dpa
142 .\" NS   doc-reg-dpa1
143 .\" NS   doc-str-dpa
145 .de doc-parse-args
146 .  if !\n[doc-arg-limit] \
147 .    doc-set-spacing-1
149 .  nr doc-have-space 0
151 .  if !\n[.$] \
152 .    return
154 .  nr doc-arg-limit +1
156 .  \" handle `|' and `...' specially
157 .  ie        "\$1"|" \
158 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
159 .  el \{ .ie "\$1"..." \
160 .    ds doc-arg\n[doc-arg-limit] \|.\|.\|.
161 .  el \
162 .    ds doc-arg\n[doc-arg-limit] "\$1
163 .  \}
165 .  \" get argument type and set spacing
166 .  doc-get-arg-type* \n[doc-arg-limit]
167 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
168 .  doc-set-spacing-\n[doc-arg-type]
170 .  \" check whether we have processed the last parameter
171 .  ie (\n[.$] == 1) \
172 .    nr doc-arg-ptr 0
173 .  el \{\
174 .    shift
175 .    doc-parse-args \$@
176 .  \}
178 .  nh
182 .\" NS doc-parse-arg-vector macro
183 .\" NS   parse argument vector (recursive)
184 .\" NS
185 .\" NS   cf. comments in doc-parse-args
186 .\" NS
187 .\" NS modifies:
188 .\" NS   doc-arg-limit
189 .\" NS   doc-arg-ptr
190 .\" NS   doc-argXXX
191 .\" NS   doc-num-args
192 .\" NS   doc-spaceXXX
193 .\" NS   doc-typeXXX
194 .\" NS
195 .\" NS local variables:
196 .\" NS   doc-reg-dpav
197 .\" NS   doc-reg-dpav1
198 .\" NS   doc-str-dpav
200 .de doc-parse-arg-vector
201 .  if !\n[doc-arg-limit] \
202 .    doc-set-spacing-1
204 .  nr doc-arg-limit +1
206 .  ie        "\*[doc-arg\n[doc-arg-limit]]"|" \
207 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
208 .  el \{ .if "\*[doc-arg\n[doc-arg-limit]]"..." \
209 .    ds doc-arg\n[doc-arg-limit] \|.\|.\|.
210 .  \}
212 .  doc-get-arg-type* \n[doc-arg-limit]
213 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
214 .  doc-set-spacing-\n[doc-arg-type]
216 .  ie (\n[doc-num-args] == 1) \{\
217 .    nr doc-arg-ptr 0
218 .    nr doc-num-args 0
219 .  \}
220 .  el \{\
221 .    nr doc-num-args -1
222 .    doc-parse-arg-vector
223 .  \}
225 .  nh
229 .\" NS doc-parse-space-vector macro
230 .\" NS   parse space vector (recursive)
231 .\" NS
232 .\" NS modifies:
233 .\" NS   doc-arg-limit
234 .\" NS   doc-num-args
235 .\" NS   doc-spaceXXX
237 .de doc-parse-space-vector
238 .  nr doc-arg-limit +1
240 .  doc-set-spacing-\n[doc-type\n[doc-arg-limit]]
242 .  ie (\n[doc-num-args] == 1) \
243 .    nr doc-num-args 0
244 .  el \{\
245 .    nr doc-num-args -1
246 .    doc-parse-space-vector
247 .  \}
251 .\" NS doc-remaining-args macro
252 .\" NS   output remaining arguments as-is, separated by spaces (until
253 .\" NS   `doc-num-args' is exhausted)
254 .\" NS
255 .\" NS modifies:
256 .\" NS   doc-arg-ptr
257 .\" NS   doc-num-args
259 .de doc-remaining-args
260 .  nr doc-arg-ptr +1
261 .  nop \)\*[doc-arg\n[doc-arg-ptr]]\c
263 .  ie (\n[doc-num-args] == 1) \{\
264 .    nr doc-arg-ptr 0
265 .    nr doc-num-args 0
266 .  \}
267 .  el \{\
268 .    nop \)\*[doc-space]\c
269 .    nr doc-num-args -1
270 .    doc-remaining-args
271 .  \}
275 .\" NS doc-append-arg macro
276 .\" NS   append one argument to argument vector:
277 .\" NS   `.doc-append-arg [arg] [type]'
278 .\" NS
279 .\" NS modifies:
280 .\" NS   doc-arg-limit
281 .\" NS   doc-argXXX
282 .\" NS   doc-typeXXX
284 .de doc-append-arg
285 .  nr doc-arg-limit +1
286 .  ds doc-arg\n[doc-arg-limit] "\$1
287 .  nr doc-type\n[doc-arg-limit] \$2
288 .  doc-set-spacing-\$2
292 .\" NS doc-print-and-reset macro
293 .\" NS   finish input line and clean up argument vectors
295 .de doc-print-and-reset
296 .  if \n[doc-space-mode] \
297 .    nop \)
298 .  doc-reset-args
302 .\" NS doc-reset-args macro
303 .\" NS   reset argument counters
304 .\" NS
305 .\" NS modifies:
306 .\" NS   doc-arg-limit
307 .\" NS   doc-arg-ptr
308 .\" NS   doc-have-slot
310 .de doc-reset-args
311 .  nr doc-arg-limit 0
312 .  nr doc-arg-ptr 0
313 .  nr doc-have-slot 0
315 .  hy \n[doc-hyphen-flags]
321 .\" NS doc-curr-font global register
322 .\" NS   saved current font
324 .nr doc-curr-font \n[.f]
327 .\" NS doc-curr-size global register
328 .\" NS   saved current font size
330 .nr doc-curr-size \n[.ps]
335 .\" NS Fl user macro
336 .\" NS   handle flags (appends `-' and prints flags): `.Fl [arg ...]'
337 .\" NS
338 .\" NS modifies:
339 .\" NS   doc-arg-ptr
340 .\" NS   doc-curr-font
341 .\" NS   doc-curr-size
342 .\" NS   doc-macro-name
343 .\" NS
344 .\" NS local variables:
345 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
346 .\" NS
347 .\" NS width register `Fl' set in doc-common
349 .de Fl
350 .  nr doc-curr-font \n[.f]
351 .  nr doc-curr-size \n[.ps]
352 .  nop \*[doc-Fl-font]\c
354 .  if !\n[doc-arg-limit] \{\
355 .    ds doc-macro-name Fl
356 .    doc-parse-args \$@
358 .    if !\n[.$] \{\
359 .      \" no arguments
360 .      nop \|\-\|\f[P]\s[0]
361 .  \}\}
363 .  if !\n[doc-arg-limit] \
364 .    return
366 .  nr doc-arg-ptr +1
367 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
368 .    \" last argument
369 .    nop \|\-\f[P]\s[0]\c
370 .    doc-print-and-reset
371 .  \}
372 .  el \{\
373 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
374 .      nop \|\-\f[P]\s[0]\c
375 .      \*[doc-arg\n[doc-arg-ptr]]
376 .    \}
377 .    el \{\
378 .      if (\n[doc-type\n[doc-arg-ptr]] == 3) \
379 .        nop \|\-\|\c
381 .      nr doc-reg-Fl 1
382 .      doc-flag-recursion
383 .  \}\}
387 .\" NS doc-flag-recursion macro
388 .\" NS   `Fl' flag recursion routine (special handling)
389 .\" NS
390 .\" NS modifies:
391 .\" NS   doc-arg-ptr
392 .\" NS
393 .\" NS local variables:
394 .\" NS   doc-reg-dfr
395 .\" NS   doc-reg-dfr1
396 .\" NS   doc-str-dfr
398 .de doc-flag-recursion
399 .  nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
400 .  ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
402 .  ie (\n[doc-reg-dfr1] == 1) \{\
403 .    nop \f[P]\s[0]\c
404 .    \*[doc-str-dfr]
405 .  \}
406 .  el \{\
407 .    nr doc-reg-dfr \n[doc-arg-ptr]
409 .    ie (\n[doc-reg-dfr1] == 2) \{\
410 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
411 .      \" doc-flag-recursion only; we need this to make `.Fl | ...' work
412 .      \" correctly
413 .      ie "\*[doc-str-dfr]"\*[Ba]" \{\
414 .        if \n[doc-reg-Fl] \
415 .          nop \|\-\*[doc-space]\c
416 .        nop \)\*[Ba]\c
417 .      \}
418 .      el \{\
419 .        ie "\*[doc-str-dfr]"\f[R]|\f[P]" \{\
420 .          if \n[doc-reg-Fl] \
421 .            nop \|\-\*[doc-space]\c
422 .          nop \f[R]|\f[P]\c
423 .        \}
424 .        el \{\
425 .          \" two consecutive hyphen characters?
426 .          ie "\*[doc-str-dfr]"-" \
427 .            nop \|\-\^\-\|\c
428 .          el \
429 .            nop \|\%\-\*[doc-str-dfr]\c
430 .    \}\}\}
431 .    el \{\
432 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
433 .      nop \)\*[doc-str-dfr]\f[P]\s[0]\c
434 .    \}
436 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
437 .      \" last argument
438 .      if (\n[doc-reg-dfr1] == 4) \
439 .        nop \|\-\c
440 .      nop \f[P]\s[0]\c
441 .      doc-print-and-reset
442 .    \}
443 .    el \{\
444 .      nr doc-arg-ptr +1
445 .      ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
446 .        ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
447 .          nop \|\-\c
448 .        el \
449 .          nop \)\*[doc-space\n[doc-reg-dfr]]\c
450 .      \}
451 .      el \
452 .        nop \)\*[doc-space\n[doc-reg-dfr]]\c
454 .      shift
455 .      nr doc-reg-Fl 0
456 .      doc-flag-recursion \$@
457 .  \}\}
461 .\" NS doc-print-recursive macro
462 .\" NS   general name recursion routine (print remaining arguments)
463 .\" NS
464 .\" NS modifies:
465 .\" NS   doc-arg-ptr
466 .\" NS
467 .\" NS local variables:
468 .\" NS   doc-reg-dpr
469 .\" NS   doc-reg-dpr1
470 .\" NS   doc-str-dpr
472 .de doc-print-recursive
473 .  nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
474 .  ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
476 .  ie (\n[doc-reg-dpr1] == 1) \{\
477 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
478 .    \*[doc-str-dpr]
479 .  \}
480 .  el \{\
481 .    nr doc-reg-dpr \n[doc-arg-ptr]
483 .    ie (\n[doc-reg-dpr1] == 2) \
484 .      \" the `\%' prevents hyphenation on a dash (`-')
485 .      nop \%\*[doc-str-dpr]\&\c
486 .    el \{\
487 .      \" punctuation character
488 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
489 .      nop \)\*[doc-str-dpr]\f[P]\s[0]\c
490 .    \}
492 .    nr doc-arg-ptr +1
493 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
494 .      \" last argument
495 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
496 .      doc-print-and-reset
497 .    \}
498 .    el \{\
499 .      nop \)\*[doc-space\n[doc-reg-dpr]]\c
500 .      doc-print-recursive
501 .  \}\}
505 .\" NS doc-print-prefixes macro
506 .\" NS   print leading prefixes
507 .\" NS
508 .\" NS modifies:
509 .\" NS   doc-arg-ptr
511 .de doc-print-prefixes
512 .  while (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
513 .    if !(\n[doc-type\n[doc-arg-ptr]] == 4) \
514 .      break
515 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
516 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]\c
517 .    nr doc-arg-ptr +1
518 .  \}
522 .\" NS doc-generic-macro macro
523 .\" NS   this is the skeleton for most simple macros
524 .\" NS
525 .\" NS modifies:
526 .\" NS   doc-arg-ptr
527 .\" NS   doc-curr-font
528 .\" NS   doc-curr-size
529 .\" NS   doc-macro-name
531 .de doc-generic-macro
532 .  if !\n[doc-arg-limit] \{\
533 .    ie \n[.$] \{\
534 .      ds doc-macro-name \$0
535 .      doc-parse-args \$@
536 .    \}
537 .    el \
538 .      tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
539 .  \}
541 .  if !\n[doc-arg-limit] \
542 .    return
544 .  nr doc-arg-ptr +1
545 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
546 .    if (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
547 .      tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
549 .      \" the right action here would be to reset the argument counters
550 .      \" and bail out -- unfortunately, a small number of manual pages
551 .      \" (less than 2% for FreeBSD which has been used for testing)
552 .      \" relied on the old behaviour (silently ignore this error),
553 .      \" so it is commented out
555 .\"    doc-reset-args
556 .    \}
557 .\"  el \{\
558 .      nr doc-curr-font \n[.f]
559 .      nr doc-curr-size \n[.ps]
560 .      nop \*[doc-\$0-font]\c
561 .      doc-print-recursive
562 .\"  \}
563 .  \}
564 .  el \{\
565 .    tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
566 .    doc-reset-args
567 .  \}
571 .\" NS Ar user macro
572 .\" NS   command line `argument' macro: `.Ar [args ...]'
573 .\" NS
574 .\" NS modifies:
575 .\" NS   doc-arg-ptr
576 .\" NS   doc-curr-font
577 .\" NS   doc-curr-size
578 .\" NS   doc-macro-name
579 .\" NS
580 .\" NS local variable:
581 .\" NS   doc-str-Ar-default
582 .\" NS
583 .\" NS width register `Ar' set in doc-common
585 .ds doc-str-Ar-default "file\ .\|.\|.
587 .de Ar
588 .  nr doc-curr-font \n[.f]
589 .  nr doc-curr-size \n[.ps]
590 .  nop \*[doc-Ar-font]\c
592 .  if !\n[doc-arg-limit] \{\
593 .    ds doc-macro-name Ar
594 .    doc-parse-args \$@
596 .    if !\n[.$] \{\
597 .      \" no argument
598 .      nop \)\*[doc-str-Ar-default]\&\f[P]\s[0]
599 .  \}\}
601 .  if !\n[doc-arg-limit] \
602 .    return
604 .  nr doc-arg-ptr +1
605 .  doc-print-prefixes
606 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
607 .    nop \)\*[doc-str-Ar-default]\&\f[P]\s[0]\c
608 .    doc-print-and-reset
609 .  \}
610 .  el \{\
611 .    if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
612 .      \" replace previous argument (Ar) with default value
613 .      nr doc-arg-ptr -1
614 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Ar-default]
615 .      nr doc-type\n[doc-arg-ptr] 2
616 .      ds doc-space\n[doc-arg-ptr] "\*[doc-space]
618 .      \" recompute space vector for remaining arguments
619 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
620 .      nr doc-arg-limit \n[doc-arg-ptr]
621 .      doc-parse-space-vector
622 .    \}
623 .    doc-print-recursive
624 .  \}
628 .\" NS Ad user macro
629 .\" NS   Addresses
630 .\" NS
631 .\" NS width register `Ad' set in doc-common
633 .als Ad doc-generic-macro
634 .ds doc-Ad-usage address
637 .\" NS doc-indent-synopsis global register
638 .\" NS   indentation in synopsis
640 .nr doc-indent-synopsis 0
643 .\" NS doc-indent-synopsis-active global register (bool)
644 .\" NS   indentation in synopsis active
646 .nr doc-indent-synopsis-active 0
649 .\" NS Cd user macro
650 .\" NS   config declaration (for section 4 SYNOPSIS)
651 .\" NS
652 .\" NS   this function causes a break; it uses the `Nm' font
653 .\" NS
654 .\" NS modifies:
655 .\" NS   doc-arg-ptr
656 .\" NS   doc-curr-font
657 .\" NS   doc-curr-size
658 .\" NS   doc-indent-synopsis
659 .\" NS   doc-macro-name
660 .\" NS
661 .\" NS width register `Cd' set in doc-common
663 .de Cd
664 .  if !\n[doc-arg-limit] \{\
665 .    ie \n[.$] \{\
666 .      ds doc-macro-name Cd
667 .      doc-parse-args \$@
668 .    \}
669 .    el \
670 .      tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
671 .  \}
673 .  if !\n[doc-arg-limit] \
674 .    return
676 .  nr doc-arg-ptr +1
677 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
678 .    nr doc-curr-font \n[.f]
679 .    nr doc-curr-size \n[.ps]
681 .    ie \n[doc-in-synopsis-section] \{\
682 .      if "\*[doc-macro-name]"Cd" \{\
683 .        br
684 .        if !\n[doc-indent-synopsis] \
685 .          nr doc-indent-synopsis \n[doc-display-indent]u
686 .        if !\n[doc-indent-synopsis-active] \
687 .          in +\n[doc-indent-synopsis]u
688 .        ti -\n[doc-indent-synopsis]u
689 .        nop \*[doc-Nm-font]\c
690 .        doc-print-recursive
691 .        if !\n[doc-indent-synopsis-active] \
692 .          in -\n[doc-indent-synopsis]u
693 .    \}\}
694 .    el \{\
695 .      nop \*[doc-Nm-font]\c
696 .      doc-print-recursive
697 .  \}\}
698 .  el \{\
699 .    tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
700 .    doc-reset-args
701 .  \}
705 .\" NS Cm user macro
706 .\" NS   interactive command modifier (flag)
707 .\" NS
708 .\" NS width register `Cm' set in doc-common
710 .als Cm doc-generic-macro
711 .ds doc-Cm-usage interactive_command_modifier
714 .\" NS Dv user macro
715 .\" NS   defined variable
716 .\" NS
717 .\" NS   this function uses the `Er' font
718 .\" NS
719 .\" NS width register `Dv' set in doc-common
721 .als Dv doc-generic-macro
722 .ds doc-Dv-usage defined_variable
723 .als doc-Dv-font doc-Er-font
726 .\" NS Em user macro
727 .\" NS   emphasis
728 .\" NS
729 .\" NS width register `Em' set in doc-common
731 .als Em doc-generic-macro
732 .ds doc-Em-usage text
735 .\" NS Er user macro
736 .\" NS   errno type
737 .\" NS
738 .\" NS width register `Er' set in doc-common
740 .als Er doc-generic-macro
741 .ds doc-Er-usage text
744 .\" NS Ev user macro
745 .\" NS   environment variable
746 .\" NS
747 .\" NS width register `Ev' set in doc-common
749 .als Ev doc-generic-macro
750 .ds doc-Ev-usage text
753 .\" NS doc-have-decl global register (bool)
754 .\" NS   subroutine test (in synopsis only)
756 .nr doc-have-decl 0
759 .\" NS doc-have-var global register (bool)
760 .\" NS   whether last type is a variable type
762 .nr doc-have-var 0
765 .\" NS doc-do-func-decl macro
766 .\" NS   do someting special while in SYNOPSIS
767 .\" NS
768 .\" NS modifies:
769 .\" NS   doc-curr-font
770 .\" NS   doc-curr-size
771 .\" NS   doc-have-decl
772 .\" NS   doc-have-var
774 .de doc-do-func-decl
775 .  if \n[doc-in-synopsis-section] \{\
776 .    \" if a variable type was the last thing given, want vertical space
777 .    if \n[doc-have-var] \{\
778 .      doc-paragraph
779 .      nr doc-have-var 0
780 .    \}
781 .    \" if a subroutine was the last thing given, want vertical space
782 .    if \n[doc-have-func] \{\
783 .      ie \n[doc-have-decl] \
784 .        br
785 .      el \
786 .        doc-paragraph
787 .    \}
788 .    nr doc-have-decl 1
789 .  \}
791 .  nr doc-curr-font \n[.f]
792 .  nr doc-curr-size \n[.ps]
796 .\" NS Fd user macro
797 .\" NS   function declaration -- not callable
798 .\" NS
799 .\" NS   this function causes a break
800 .\" NS
801 .\" NS width register `Fd' set in doc-common
803 .de Fd
804 .  ie ((\n[.$] >= 1) & (\n[doc-arg-limit] == 0)) \{\
805 .    doc-do-func-decl
806 .    nop \*[doc-Fd-font]\$*
807 .    br
808 .    ft \n[doc-curr-font]
809 .    ps \n[doc-curr-size]u
810 .  \}
811 .  el \{\
812 .    tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
813 .    doc-reset-args
814 .  \}
818 .\" NS In user macro
819 .\" NS   #include statement - not callable
820 .\" NS
821 .\" NS   this function causes a break; it uses the `Fd' font
822 .\" NS
823 .\" NS width register `In' set in doc-common
825 .de In
826 .  ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
827 .    doc-do-func-decl
828 .    nop \*[doc-Fd-font]#include <\$1>
829 .    br
830 .    ft \n[doc-curr-font]
831 .    ps \n[doc-curr-size]u
832 .  \}
833 .  el \{\
834 .    tm Usage: .In include_file -- In is not callable (#\n[.c])
835 .    doc-reset-args
836 .  \}
840 .\" NS Fr user macro
841 .\" NS   function return value
842 .\" NS
843 .\" NS   this function uses the `Ar' font
844 .\" NS
845 .\" NS width register `Fr' set in doc-common
847 .als Fr doc-generic-macro
848 .ds doc-Fr-usage function_return_value
849 .als doc-Fr-font doc-Ar-font
852 .\" NS Ic user macro
853 .\" NS   interactive command
854 .\" NS
855 .\" NS width register `Ic' set in doc-common
857 .als Ic doc-generic-macro
858 .ds doc-Ic-usage interactive_command
861 .\" NS Li user macro
862 .\" NS   literals
863 .\" NS
864 .\" NS width register `Li' set in doc-common
866 .als Li doc-generic-macro
867 .ds doc-Li-usage argument
870 .\" NS Ms user macro
871 .\" NS   math symbol
872 .\" NS
873 .\" NS   this function uses the `Sy' font
874 .\" NS
875 .\" NS width register `Ms' set in doc-common
877 .als Ms doc-generic-macro
878 .ds doc-Ms-usage math_symbol
879 .als doc-Ms-font doc-Sy-font
882 .\" NS doc-command-name global string
883 .\" NS   save first invocation of .Nm
885 .ds doc-command-name
888 .\" NS Nm user macro
889 .\" NS   name of command or page topic
890 .\" NS
891 .\" NS modifies:
892 .\" NS   doc-arg-ptr
893 .\" NS   doc-command-name
894 .\" NS   doc-curr-font
895 .\" NS   doc-curr-size
896 .\" NS   doc-indent-synopsis
897 .\" NS   doc-indent-synopsis-active
898 .\" NS   doc-macro-name
899 .\" NS
900 .\" NS width register `Nm' set in doc-common
902 .de Nm
903 .  if !\n[doc-arg-limit] \{\
904 .    ds doc-macro-name Nm
905 .    ie \n[.$] \
906 .      doc-parse-args \$@
907 .    el \{\
908 .      ie "\*[doc-command-name]"" \
909 .        tm Usage: .Nm name ... (#\n[.c])
910 .      el \
911 .        doc-parse-args \*[doc-command-name]
912 .  \}\}
914 .  if !\n[doc-arg-limit] \
915 .    return
917 .  nr doc-arg-ptr +1
918 .  doc-print-prefixes
919 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
920 .    \" last argument
921 .    ie "\*[doc-command-name]"" \{\
922 .      tm Usage: .Nm name ... (#\n[.c])
923 .      doc-reset-args
924 .    \}
925 .    el \{\
926 .      nop \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]\c
927 .      doc-print-and-reset
928 .  \}\}
929 .  el \{\
930 .    nr doc-curr-font \n[.f]
931 .    nr doc-curr-size \n[.ps]
933 .    ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
934 .      ie "\*[doc-command-name]"" \
935 .        tm Usage: .Nm name ... (#\n[.c])
936 .      el \{\
937 .        \" replace previous argument (Nm) with default value
938 .        nr doc-arg-ptr -1
939 .        ds doc-arg\n[doc-arg-ptr] "\*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
940 .        nr doc-type\n[doc-arg-ptr] 2
941 .        ds doc-space\n[doc-arg-ptr] "\*[doc-space]
943 .        \" recompute space vector for remaining arguments
944 .        nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
945 .        nr doc-arg-limit \n[doc-arg-ptr]
946 .        doc-parse-space-vector
947 .    \}\}
948 .    el \{\
949 .      \" handle `.Nm ...' in SYNOPSIS
950 .      if \n[doc-in-synopsis-section] \{\
951 .        if "\*[doc-macro-name]"Nm" \{\
952 .          br
953 .          if !\n[doc-indent-synopsis] \{\
954 .            doc-get-width "\*[doc-arg\n[doc-arg-ptr]]"
955 .            nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
956 .          \}
957 .          if !\n[doc-indent-synopsis-active] \{\
958 .            in +\n[doc-indent-synopsis]u
959 .            nr doc-indent-synopsis-active 1
960 .          \}
961 .          ti -\n[doc-indent-synopsis]u
962 .      \}\}
963 .      if "\*[doc-command-name]"" \
964 .        ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
966 .      nop \*[doc-Nm-font]\c
967 .    \}
968 .    doc-print-recursive
969 .  \}
973 .\" NS Pa user macro
974 .\" NS   pathname: `.Pa [arg ...]'
975 .\" NS
976 .\" NS modifies:
977 .\" NS   doc-arg-ptr
978 .\" NS   doc-curr-font
979 .\" NS   doc-curr-size
980 .\" NS   doc-macro-name
981 .\" NS
982 .\" NS width register `Pa' set in doc-common
984 .de Pa
985 .  if !\n[doc-arg-limit] \{\
986 .    ds doc-macro-name Pa
987 .    doc-parse-args \$@
989 .    if !\n[.$] \{\
990 .      \" default value
991 .      nop \*[doc-Pa-font]~\f[P]\s[0]
992 .  \}\}
994 .  if !\n[doc-arg-limit] \
995 .    return
997 .  nr doc-arg-ptr +1
998 .  doc-print-prefixes
999 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1000 .    nr doc-curr-font \n[.f]
1001 .    nr doc-curr-size \n[.ps]
1002 .    nop \*[doc-Pa-font]\c
1003 .    if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
1004 .      \" replace previous argument (Pa) with default value
1005 .      nr doc-arg-ptr -1
1006 .      ds doc-arg\n[doc-arg-ptr] ~
1007 .      nr doc-type\n[doc-arg-ptr] 2
1008 .      ds doc-space\n[doc-arg-ptr] "\*[doc-space]
1010 .      \" recompute space vector for remaining arguments
1011 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
1012 .      nr doc-arg-limit \n[doc-arg-ptr]
1013 .      doc-parse-space-vector
1014 .    \}
1015 .    doc-print-recursive
1016 .  \}
1017 .  el \{\
1018 .    nop \*[doc-Pa-font]~\f[P]\s[0]\c
1019 .    doc-print-and-reset
1020 .  \}
1024 .\" NS Sy user macro
1025 .\" NS   symbolics
1026 .\" NS
1027 .\" NS width register `Sy' set in doc-common
1029 .als Sy doc-generic-macro
1030 .ds doc-Sy-usage symbolic_text
1033 .\" NS Me user macro
1034 .\" NS   menu entries
1035 .\" NS
1036 .\" NS width register `Me' set in doc-common
1038 .als Me doc-generic-macro
1039 .ds doc-Me-usage menu_entry
1042 .\" NS Tn user macro
1043 .\" NS   trade name
1044 .\" NS
1045 .\" NS modifies:
1046 .\" NS   doc-arg-ptr
1047 .\" NS   doc-curr-font
1048 .\" NS   doc-curr-size
1049 .\" NS   doc-macro-name
1050 .\" NS
1051 .\" NS width register `Tn' set in doc-common
1053 .de Tn
1054 .  if !\n[doc-arg-limit] \{\
1055 .    ie \n[.$] \{\
1056 .      ds doc-macro-name Tn
1057 .      doc-parse-args \$@
1058 .    \}
1059 .    el \
1060 .      tm Usage: .Tn trade_name ... (#\n[.c])
1061 .  \}
1063 .  if !\n[doc-arg-limit] \
1064 .    return
1066 .  nr doc-arg-ptr +1
1067 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1068 .    nr doc-curr-font \n[.f]
1069 .    nr doc-curr-size \n[.ps]
1070 .    nop \)\*[doc-Tn-font-size]\c
1071 .    ie !\n[doc-is-reference] \{\
1072 .      nop \)\*[doc-Tn-font-shape]\c
1073 .      doc-print-recursive
1074 .    \}
1075 .    el \
1076 .      doc-do-references
1077 .  \}
1078 .  el \{\
1079 .    tm Usage: .Tn trade_name ... (#\n[.c])
1080 .    doc-reset-args
1081 .  \}
1085 .\" NS Va user macro
1086 .\" NS   variable name
1087 .\" NS
1088 .\" NS width register `Va' set in doc-common
1090 .als Va doc-generic-macro
1091 .ds doc-Va-usage variable_name
1094 .\" NS No user macro
1095 .\" NS   normal text macro (default text style if mess up)
1096 .\" NS
1097 .\" NS width register `No' set in doc-common
1099 .als No doc-generic-macro
1100 .ds doc-No-usage normal_text
1103 .\" NS doc-quote-left global string
1104 .\" NS   left quotation character for `doc-enclose-string' and
1105 .\" NS   `doc-enclose-open'
1107 .ds doc-quote-left
1110 .\" NS doc-quote-right global string
1111 .\" NS   right quotation character for `doc-enclose-string' and
1112 .\" NS   `doc-enclose-close'
1114 .ds doc-quote-right
1117 .\" NS Op user macro
1118 .\" NS   option expression (i.e., enclose string in square brackets)
1119 .\" NS
1120 .\" NS modifies:
1121 .\" NS   doc-macro-name
1122 .\" NS   doc-quote-left
1123 .\" NS   doc-quote-right
1124 .\" NS
1125 .\" NS width register `Op' set in doc-common
1127 .de Op
1128 .  if !\n[doc-arg-limit] \
1129 .    ds doc-macro-name Op
1131 .  ds doc-quote-left "\*[doc-left-bracket]
1132 .  ds doc-quote-right "\*[doc-right-bracket]
1134 .  doc-enclose-string \$@
1138 .\" NS Aq user macro
1139 .\" NS   enclose string in angle brackets
1140 .\" NS
1141 .\" NS modifies:
1142 .\" NS   doc-macro-name
1143 .\" NS   doc-quote-left
1144 .\" NS   doc-quote-right
1145 .\" NS
1146 .\" NS width register `Aq' set in doc-common
1148 .de Aq
1149 .  if !\n[doc-arg-limit] \
1150 .    ds doc-macro-name Aq
1152 .  ds doc-quote-left \[la]
1153 .  ds doc-quote-right \[ra]
1155 .  doc-enclose-string \$@
1159 .\" NS Bq user macro
1160 .\" NS   enclose string in square brackets
1161 .\" NS
1162 .\" NS modifies:
1163 .\" NS   doc-macro-name
1164 .\" NS   doc-quote-left
1165 .\" NS   doc-quote-right
1166 .\" NS
1167 .\" NS width register `Bq' set in doc-common
1169 .de Bq
1170 .  if !\n[doc-arg-limit] \
1171 .    ds doc-macro-name Bq
1173 .  ds doc-quote-left "\*[doc-left-bracket]
1174 .  ds doc-quote-right "\*[doc-right-bracket]
1176 .  doc-enclose-string \$@
1180 .\" NS Brq user macro
1181 .\" NS   enclose string in braces
1182 .\" NS
1183 .\" NS modifies:
1184 .\" NS   doc-macro-name
1185 .\" NS   doc-quote-left
1186 .\" NS   doc-quote-right
1187 .\" NS
1188 .\" NS width register `Brq' set in doc-common
1190 .de Brq
1191 .  if !\n[doc-arg-limit] \
1192 .    ds doc-macro-name Brq
1194 .  ds doc-quote-left {
1195 .  ds doc-quote-right }
1197 .  doc-enclose-string \$@
1201 .\" NS Dq user macro
1202 .\" NS   enclose string in double quotes
1203 .\" NS
1204 .\" NS modifies:
1205 .\" NS   doc-macro-name
1206 .\" NS   doc-quote-left
1207 .\" NS   doc-quote-right
1208 .\" NS
1209 .\" NS width register `Dq' set in doc-common
1211 .de Dq
1212 .  if !\n[doc-arg-limit] \
1213 .    ds doc-macro-name Dq
1215 .  ds doc-quote-left "\*[Lq]
1216 .  ds doc-quote-right "\*[Rq]
1218 .  doc-enclose-string \$@
1222 .\" NS Eq user macro
1223 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1224 .\" NS
1225 .\" NS modifies:
1226 .\" NS   doc-macro-name
1227 .\" NS   doc-quote-left
1228 .\" NS   doc-quote-right
1229 .\" NS
1230 .\" NS width register `Eq' set in doc-common
1232 .de Eq
1233 .  if !\n[doc-arg-limit] \
1234 .    ds doc-macro-name Eq
1236 .  ds doc-quote-left "\$1
1237 .  ds doc-quote-right "\$2
1239 .  shift 2
1240 .  doc-enclose-string \$@
1244 .\" NS Pq user macro
1245 .\" NS   enclose string in parentheses
1246 .\" NS
1247 .\" NS modifies:
1248 .\" NS   doc-macro-name
1249 .\" NS   doc-quote-left
1250 .\" NS   doc-quote-right
1251 .\" NS
1252 .\" NS width register `Pq' set in doc-common
1254 .de Pq
1255 .  if !\n[doc-arg-limit] \
1256 .    ds doc-macro-name Pq
1258 .  ds doc-quote-left "\*[doc-left-parenthesis]
1259 .  ds doc-quote-right "\*[doc-right-parenthesis]
1261 .  doc-enclose-string \$@
1265 .\" NS Ql user macro
1266 .\" NS   quoted literal
1268 .\"   is in file doc-[dit|n]roff
1271 .\" NS Qq user macro
1272 .\" NS   enclose string in straight double quotes
1273 .\" NS
1274 .\" NS modifies:
1275 .\" NS   doc-macro-name
1276 .\" NS   doc-quote-left
1277 .\" NS   doc-quote-right
1278 .\" NS
1279 .\" NS width register `Qq' set in doc-common
1281 .de Qq
1282 .  if !\n[doc-arg-limit] \
1283 .    ds doc-macro-name Qq
1285 .  ds doc-quote-left "\*[q]
1286 .  ds doc-quote-right "\*[q]
1288 .  doc-enclose-string \$@
1292 .\" NS Sq user macro
1293 .\" NS   enclose string in single quotes
1294 .\" NS
1295 .\" NS modifies:
1296 .\" NS   doc-macro-name
1297 .\" NS   doc-quote-left
1298 .\" NS   doc-quote-right
1299 .\" NS
1300 .\" NS width register `Sq' set in doc-common
1302 .de Sq
1303 .  if !\n[doc-arg-limit] \
1304 .    ds doc-macro-name Sq
1306 .  ds doc-quote-left "\*[doc-left-singlequote]
1307 .  ds doc-quote-right "\*[doc-right-singlequote]
1309 .  doc-enclose-string \$@
1313 .\" NS Es user macro
1314 .\" NS   set up arguments (i.e., the left and right quotation character as
1315 .\" NS   first and second argument) for .En call
1316 .\" NS
1317 .\" NS modifies:
1318 .\" NS   doc-arg-ptr
1319 .\" NS   doc-macro-name
1320 .\" NS   doc-quote-left
1321 .\" NS   doc-quote-right
1323 .de Es
1324 .  if !\n[doc-arg-limit] \{\
1325 .    ie (\n[.$] > 2) \{\
1326 .      ds doc-macro-name Es
1327 .      doc-parse-args \$@
1328 .    \}
1329 .    el \{\
1330 .      ds doc-quote-left "\$1
1331 .      ds doc-quote-right "\$2
1332 .  \}\}
1334 .  if !\n[doc-arg-limit] \
1335 .    return
1337 .  nr doc-arg-ptr +1
1338 .  ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
1339 .  nr doc-arg-ptr +1
1340 .  ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
1341 .  nr doc-arg-ptr +1
1342 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1343 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
1344 .  el \
1345 .    doc-print-and-reset
1349 .\" NS doc-have-slot global register (bool)
1350 .\" NS   set if `doc-enclose-string' has created a slot for closing
1351 .\" NS   delimiter
1353 .nr doc-have-slot 0
1356 .\" NS doc-enclose-string macro
1357 .\" NS   enclose string with given args (e.g. [ and ])
1358 .\" NS
1359 .\" NS modifies:
1360 .\" NS   doc-arg-ptr
1361 .\" NS   doc-argXXX
1362 .\" NS   doc-have-slot
1363 .\" NS
1364 .\" NS local variables:
1365 .\" NS   doc-reg-des
1366 .\" NS   doc-reg-des1
1367 .\" NS   doc-reg-des2
1368 .\" NS
1369 .\" NS requires:
1370 .\" NS   doc-quote-left
1371 .\" NS   doc-quote-right
1373 .de doc-enclose-string
1374 .  if \n[doc-in-synopsis-section] \
1375 .    doc-set-hard-space
1377 .  if !\n[doc-arg-limit] \{\
1378 .    ie \n[.$] \
1379 .      doc-parse-args \$@
1380 .    el \{\
1381 .      nop \)\*[doc-quote-left]\*[doc-quote-right]
1382 .  \}\}
1384 .  if !\n[doc-arg-limit] \
1385 .    return
1387 .  nr doc-curr-font \n[.f]
1388 .  nr doc-curr-size \n[.ps]
1390 .  nr doc-arg-ptr +1
1391 .  doc-print-prefixes
1392 .  \" the final `\)' prevents hyphenation in case the next character is `\%'
1393 .  nop \)\*[doc-quote-left]\)\c
1394 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1395 .    \" last argument
1396 .    nop \)\*[doc-quote-right]\)\c
1397 .    doc-print-and-reset
1398 .  \}
1399 .  el \{\
1400 .    \" test whether last arguments are of type closing punctuation
1401 .    \" resp. suffix
1402 .    ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
1403 .      nr doc-reg-des (\n[doc-arg-limit] - 1)
1404 .      while (\n[doc-type\n[doc-reg-des]] == 3) \
1405 .        nr doc-reg-des -1
1407 .      \" prepend closing delimiter
1408 .      nr doc-reg-des +1
1409 .      ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1410 .    \}
1411 .    el \{\
1412 .      \" test whether last arguments are macros which continue the line
1413 .      \" logically
1414 .      nr doc-reg-des \n[doc-arg-limit]
1415 .      while (\n[doc-reg-des] >= \n[doc-arg-ptr]) \{\
1416 .        if !\A\a\*[doc-arg\n[doc-reg-des]]\a \
1417 .          break
1418 .        if !d doc-after-\*[doc-arg\n[doc-reg-des]] \
1419 .          break
1420 .        nr doc-reg-des -1
1421 .      \}
1423 .      \" if there are no trailing macros to be skipped, append argument
1424 .      ie (\n[doc-reg-des] == \n[doc-arg-limit]) \
1425 .        doc-append-arg "\)\*[doc-quote-right]\)" 3
1426 .      el \{\
1427 .        \" if a previous call to `doc-enclose-string' has already created
1428 .        \" a slot, prepend argument
1429 .        ie \n[doc-have-slot] \
1430 .          ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1431 .        el \{\
1432 .          \" we have to shift all arguments to the right
1433 .          nr doc-reg-des +1
1434 .          nr doc-reg-des1 \n[doc-arg-limit]
1435 .          nr doc-reg-des2 (\n[doc-arg-limit] + 1)
1436 .          while (\n[doc-reg-des1] >= \n[doc-reg-des]) \{\
1437 .            rn doc-arg\n[doc-reg-des1] doc-arg\n[doc-reg-des2]
1438 .            rnn doc-type\n[doc-reg-des1] doc-type\n[doc-reg-des2]
1439 .            rn doc-space\n[doc-reg-des1] doc-space\n[doc-reg-des2]
1440 .            nr doc-reg-des1 -1
1441 .            nr doc-reg-des2 -1
1442 .          \}
1443 .          nr doc-arg-limit +1
1445 .          \" finally, insert closing delimiter into the freed slot and
1446 .          \" recompute spacing vector
1447 .          ds doc-arg\n[doc-reg-des] "\)\*[doc-quote-right]\)
1448 .          nr doc-type\n[doc-reg-des] 3
1449 .          nr doc-num-args (\n[doc-arg-limit] - \n[doc-reg-des] + 1)
1450 .          nr doc-arg-limit (\n[doc-reg-des] - 1)
1451 .          doc-parse-space-vector
1452 .          nr doc-have-slot 1
1453 .    \}\}\}
1455 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
1456 .  \}
1458 .  if \n[doc-in-synopsis-section] \
1459 .    doc-set-soft-space
1463 .\" NS En user macro
1464 .\" NS   enclose arguments with quotation characters set up with `.Es'
1466 .als En doc-enclose-string
1469 .\" NS Ao user macro
1470 .\" NS   angle open
1471 .\" NS
1472 .\" NS modifies:
1473 .\" NS   doc-macro-name
1474 .\" NS   doc-quote-left
1475 .\" NS
1476 .\" NS width register `Ao' set in doc-common
1478 .de Ao
1479 .  if !\n[doc-arg-limit] \
1480 .    ds doc-macro-name Ao
1482 .  ds doc-quote-left \[la]
1484 .  doc-enclose-open \$@
1488 .\" NS Ac user macro
1489 .\" NS   angle close
1490 .\" NS
1491 .\" NS modifies:
1492 .\" NS   doc-macro-name
1493 .\" NS   doc-quote-right
1494 .\" NS
1495 .\" NS width register `Ac' set in doc-common
1497 .de Ac
1498 .  if !\n[doc-arg-limit] \
1499 .    ds doc-macro-name Ac
1501 .  ds doc-quote-right \[ra]
1503 .  doc-enclose-close \$@
1507 .\" NS Bo user macro
1508 .\" NS   bracket open
1509 .\" NS
1510 .\" NS modifies:
1511 .\" NS   doc-macro-name
1512 .\" NS   doc-quote-left
1513 .\" NS
1514 .\" NS width register `Bo' set in doc-common
1516 .de Bo
1517 .  if !\n[doc-arg-limit] \
1518 .    ds doc-macro-name Bo
1520 .  ds doc-quote-left "\*[doc-left-bracket]
1522 .  doc-enclose-open \$@
1526 .\" NS Bc user macro
1527 .\" NS   bracket close
1528 .\" NS
1529 .\" NS modifies:
1530 .\" NS   doc-macro-name
1531 .\" NS   doc-quote-right
1532 .\" NS
1533 .\" NS width register `Bc' set in doc-common
1535 .de Bc
1536 .  if !\n[doc-arg-limit] \
1537 .    ds doc-macro-name Bc
1539 .  ds doc-quote-right "\*[doc-right-bracket]
1541 .  doc-enclose-close \$@
1545 .\" NS Bro user macro
1546 .\" NS   brace open
1547 .\" NS
1548 .\" NS modifies:
1549 .\" NS   doc-macro-name
1550 .\" NS   doc-quote-left
1551 .\" NS
1552 .\" NS width register `Bro' set in doc-common
1554 .de Bro
1555 .  if !\n[doc-arg-limit] \
1556 .    ds doc-macro-name Bo
1558 .  ds doc-quote-left {
1560 .  doc-enclose-open \$@
1564 .\" NS Brc user macro
1565 .\" NS   brace close
1566 .\" NS
1567 .\" NS modifies:
1568 .\" NS   doc-macro-name
1569 .\" NS   doc-quote-right
1570 .\" NS
1571 .\" NS width register `Brc' set in doc-common
1573 .de Brc
1574 .  if !\n[doc-arg-limit] \
1575 .    ds doc-macro-name Bc
1577 .  ds doc-quote-right }
1579 .  doc-enclose-close \$@
1583 .\" NS Do user macro
1584 .\" NS   double quote open
1585 .\" NS
1586 .\" NS modifies:
1587 .\" NS   doc-macro-name
1588 .\" NS   doc-quote-left
1589 .\" NS
1590 .\" NS width register `Do' set in doc-common
1592 .de Do
1593 .  if !\n[doc-arg-limit] \
1594 .    ds doc-macro-name Do
1596 .  ds doc-quote-left "\*[Lq]
1598 .  doc-enclose-open \$@
1602 .\" NS Dc user macro
1603 .\" NS   double quote close
1604 .\" NS
1605 .\" NS modifies:
1606 .\" NS   doc-macro-name
1607 .\" NS   doc-quote-right
1608 .\" NS
1609 .\" NS width register `Dc' set in doc-common
1611 .de Dc
1612 .  if !\n[doc-arg-limit] \
1613 .    ds doc-macro-name Dc
1615 .  ds doc-quote-right "\*[Rq]
1617 .  doc-enclose-close \$@
1621 .\" NS Eo user macro
1622 .\" NS   enclose open (using first argument as beginning of enclosure)
1623 .\" NS
1624 .\" NS modifies:
1625 .\" NS   doc-macro-name
1626 .\" NS   doc-quote-left
1627 .\" NS
1628 .\" NS width register `Eo' set in doc-common
1630 .de Eo
1631 .  if !\n[doc-arg-limit] \
1632 .    ds doc-macro-name Eo
1634 .  ds doc-quote-left "\$1
1636 .  shift
1637 .  doc-enclose-open \$@
1641 .\" NS Ec user macro
1642 .\" NS   enclose close (using first argument as end of enclosure)
1643 .\" NS
1644 .\" NS modifies:
1645 .\" NS   doc-macro-name
1646 .\" NS   doc-quote-right
1647 .\" NS
1648 .\" NS width register `Ec' set in doc-common
1650 .de Ec
1651 .  if !\n[doc-arg-limit] \
1652 .    ds doc-macro-name Ec
1654 .  ds doc-quote-right "\$1
1656 .  shift
1657 .  doc-enclose-close \$@
1661 .\" NS Oo user macro
1662 .\" NS   option open
1663 .\" NS
1664 .\" NS modifies:
1665 .\" NS   doc-macro-name
1666 .\" NS   doc-quote-left
1667 .\" NS
1668 .\" NS width register `Oo' set in doc-common
1670 .de Oo
1671 .  if !\n[doc-arg-limit] \
1672 .    ds doc-macro-name Oo
1674 .  ds doc-quote-left [
1676 .  doc-enclose-open \$@
1680 .\" NS Oc user macro
1681 .\" NS   option close
1682 .\" NS
1683 .\" NS modifies:
1684 .\" NS   doc-macro-name
1685 .\" NS   doc-quote-right
1686 .\" NS
1687 .\" NS width register `Oc' set in doc-common
1689 .de Oc
1690 .  if !\n[doc-arg-limit] \
1691 .    ds doc-macro-name Oc
1693 .  ds doc-quote-right ]
1695 .  doc-enclose-close \$@
1699 .\" NS Po user macro
1700 .\" NS   parenthesis open
1701 .\" NS
1702 .\" NS modifies:
1703 .\" NS   doc-macro-name
1704 .\" NS   doc-quote-left
1705 .\" NS
1706 .\" NS width register `Po' set in doc-common
1708 .de Po
1709 .  if !\n[doc-arg-limit] \
1710 .    ds doc-macro-name Po
1712 .  ds doc-quote-left "\*[doc-left-parenthesis]
1714 .  doc-enclose-open \$@
1718 .\" NS Pc user macro
1719 .\" NS   parenthesis close
1720 .\" NS
1721 .\" NS modifies:
1722 .\" NS   doc-macro-name
1723 .\" NS   doc-quote-right
1724 .\" NS
1725 .\" NS width register `Pc' set in doc-common
1727 .de Pc
1728 .  if !\n[doc-arg-limit] \
1729 .    ds doc-macro-name Pc
1731 .  ds doc-quote-right "\*[doc-right-parenthesis]
1733 .  doc-enclose-close \$@
1737 .\" NS Qo user macro
1738 .\" NS   straight double quote open
1739 .\" NS
1740 .\" NS modifies:
1741 .\" NS   doc-macro-name
1742 .\" NS   doc-quote-left
1743 .\" NS
1744 .\" NS width register `Qo' set in doc-common
1746 .de Qo
1747 .  if !\n[doc-arg-limit] \
1748 .    ds doc-macro-name Qo
1750 .  ds doc-quote-left "\*[q]
1752 .  doc-enclose-open \$@
1756 .\" NS Qc user macro
1757 .\" NS   straight double quote close
1758 .\" NS
1759 .\" NS modifies:
1760 .\" NS   doc-macro-name
1761 .\" NS   doc-quote-right
1762 .\" NS
1763 .\" NS width register `Qc' set in doc-common
1765 .de Qc
1766 .  if !\n[doc-arg-limit] \
1767 .    ds doc-macro-name Qc
1769 .  ds doc-quote-right "\*[q]
1771 .  doc-enclose-close \$@
1775 .\" NS So user macro
1776 .\" NS   single quote open
1777 .\" NS
1778 .\" NS modifies:
1779 .\" NS   doc-macro-name
1780 .\" NS   doc-quote-left
1781 .\" NS
1782 .\" NS width register `So' set in doc-common
1784 .de So
1785 .  if !\n[doc-arg-limit] \
1786 .    ds doc-macro-name So
1788 .  ds doc-quote-left "\*[doc-left-singlequote]
1790 .  doc-enclose-open \$@
1794 .\" NS Sc user macro
1795 .\" NS   single quote close
1796 .\" NS
1797 .\" NS modifies:
1798 .\" NS   doc-macro-name
1799 .\" NS   doc-quote-right
1800 .\" NS
1801 .\" NS width register `Sc' set in doc-common
1803 .de Sc
1804 .  if !\n[doc-arg-limit] \
1805 .    ds doc-macro-name Sc
1807 .  ds doc-quote-right "\*[doc-right-singlequote]
1809 .  doc-enclose-close \$@
1813 .\" NS Xo user macro
1814 .\" NS   extend open
1815 .\" NS
1816 .\" NS modifies:
1817 .\" NS   doc-macro-name
1818 .\" NS   doc-quote-left
1819 .\" NS
1820 .\" NS width register `Xo' set in doc-common
1822 .de Xo
1823 .  if !\n[doc-arg-limit] \
1824 .    ds doc-macro-name Xo
1826 .  ds doc-quote-left
1828 .  doc-enclose-open \$@
1832 .\" NS Xc user macro
1833 .\" NS   extend close
1834 .\" NS
1835 .\" NS modifies:
1836 .\" NS   doc-macro-name
1837 .\" NS   doc-quote-right
1838 .\" NS
1839 .\" NS width register `Xc' set in doc-common
1841 .de Xc
1842 .  if !\n[doc-arg-limit] \
1843 .    ds doc-macro-name Xc
1845 .  ds doc-quote-right
1847 .  doc-enclose-close \$@
1851 .\" NS doc-nesting-level global register
1852 .\" NS   used by `doc-enclose-open' and `doc-enclose-close'
1854 .nr doc-nesting-level 0
1857 .\" NS doc-in-list global register (bool)
1858 .\" NS   whether we are in (logical) .It
1860 .nr doc-in-list 0
1863 .\" NS doc-enclose-open macro
1864 .\" NS   enclose string open
1865 .\" NS
1866 .\" NS modifies:
1867 .\" NS   doc-arg-ptr
1868 .\" NS   doc-nesting-level
1870 .de doc-enclose-open
1871 .  if !\n[doc-arg-limit] \
1872 .    doc-parse-args \$@
1874 .  nr doc-arg-ptr +1
1875 .  doc-print-prefixes
1876 .  nr doc-arg-ptr -1
1878 .  nop \)\*[doc-quote-left]\)\c
1880 .  \" start enclosure box
1881 .  box doc-enclosure-box\n[doc-nesting-level]
1882 .  ev doc-enclosure-env\n[doc-nesting-level]
1883 .  evc 0
1884 .  in 0
1885 .  nf
1886 .  \" we insert something to make .chop always work
1887 .  nop \&\c
1889 .  \" increase nesting level *after* parsing of arguments
1890 .  nr doc-nesting-level +1
1892 .  if \n[doc-arg-limit] \{\
1893 .    nr doc-arg-ptr +1
1894 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1895 .      doc-print-recursive
1896 .    el \
1897 .      doc-reset-args
1898 .  \}
1902 .\" NS doc-enclose-close macro
1903 .\" NS   enclose string close
1904 .\" NS
1905 .\" NS modifies:
1906 .\" NS   doc-nesting-level
1908 .de doc-enclose-close
1909 .  nr doc-nesting-level -1
1911 .  \" finish enclosure box
1912 .  br
1913 .  ev
1914 .  box
1915 .  chop doc-enclosure-box\n[doc-nesting-level]
1916 .  unformat doc-enclosure-box\n[doc-nesting-level]
1918 .  nh
1919 .  nop \*[doc-enclosure-box\n[doc-nesting-level]]\c
1920 .  nop \)\*[doc-quote-right]\)\c
1922 .  if !\n[doc-arg-limit] \{\
1923 .    doc-parse-args \$@
1925 .    if !\n[.$] \
1926 .      doc-print-and-reset
1927 .  \}
1929 .  if \n[doc-arg-limit] \{\
1930 .    ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
1931 .      nop \)\*[doc-space\n[doc-arg-ptr]]\c
1932 .      nr doc-arg-ptr +1
1933 .      doc-print-recursive
1934 .    \}
1935 .    el \
1936 .      doc-print-and-reset
1937 .  \}
1939 .  \" shall we finish .It request?
1940 .  if !"\*[doc-macro-name]"It" \
1941 .    if \n[doc-in-list] \
1942 .      if !\n[doc-nesting-level] \
1943 .        doc-\*[doc-list-type-stack\n[doc-list-depth]]
1947 .\" NS Pf user macro
1948 .\" NS   prefix: `.Pf prefix arg ...'
1949 .\" NS
1950 .\" NS modifies:
1951 .\" NS   doc-arg-ptr
1952 .\" NS   doc-macro-name
1953 .\" NS   doc-quote-left
1954 .\" NS
1955 .\" NS width register `Pf' set in doc-common
1957 .de Pf
1958 .  if !\n[doc-arg-limit] \
1959 .    ds doc-macro-name Pf
1961 .  ie \n[doc-arg-limit] \{\
1962 .    ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
1963 .      nr doc-arg-ptr +1
1964 .      nop \)\*[doc-arg\n[doc-arg-ptr]]\c
1965 .    \}
1966 .    el \
1967 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
1968 .  \}
1969 .  el \{\
1970 .    nop \)\$1\)\c
1971 .    shift
1972 .    ie \n[.$] \
1973 .      doc-parse-args \$@
1974 .    el \{\
1975 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
1976 .      nop \)
1977 .  \}\}
1979 .  if \n[doc-arg-limit] \{\
1980 .    nr doc-arg-ptr +1
1981 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
1982 .      doc-print-and-reset
1983 .    el \
1984 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
1985 .  \}
1989 .\" NS Ns user macro
1990 .\" NS   remove space (space removal done by `doc-parse-args')
1991 .\" NS
1992 .\" NS modifies:
1993 .\" NS   doc-argXXX
1994 .\" NS   doc-macro-name
1995 .\" NS
1996 .\" NS width register `Ns' set in doc-common
1998 .de Ns
1999 .  if !\n[doc-arg-limit] \{\
2000 .    ie \n[.$] \{\
2001 .      ds doc-macro-name Ns
2002 .      doc-parse-args \$@
2003 .    \}
2004 .    el \
2005 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2006 .  \}
2008 .  if \n[doc-arg-limit] \{\
2009 .    nr doc-arg-ptr +1
2010 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2011 .      doc-print-recursive
2012 .    el \
2013 .      doc-reset-args
2014 .  \}
2018 .\" NS Ap user macro
2019 .\" NS   append an apostrophe
2020 .\" NS
2021 .\" NS width register `Ap' set in doc-common
2023 .de Ap
2024 .  ie !\n[doc-arg-limit] \
2025 .    tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2026 .  el \{\
2027 .    nop \)'\)\c
2028 .    nr doc-arg-ptr +1
2029 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2030 .      doc-print-recursive
2031 .    el \
2032 .      doc-reset-args
2033 .  \}
2037 .\" NS doc-space global string
2038 .\" NS   current inter-argument space
2040 .ds doc-space "\*[doc-soft-space]
2043 .\" NS doc-soft-space constant string
2044 .\" NS   soft (stretchable) space (defined in doc-common)
2047 .\" NS doc-hard-space constant string
2048 .\" NS   hard (unpaddable) space (defined in doc-common)
2051 .\" NS doc-set-hard-space macro
2052 .\" NS   set current space string to hard (unpaddable) space.
2053 .\" NS
2054 .\" NS modifies:
2055 .\" NS   doc-saved-space
2056 .\" NS   doc-space
2058 .de doc-set-hard-space
2059 .  ie "\*[doc-space]"" \
2060 .    ds doc-saved-space "\*[doc-hard-space]
2061 .  el \
2062 .    ds doc-space "\*[doc-hard-space]
2066 .\" NS doc-set-soft-space macro
2067 .\" NS   set current space string to soft space
2068 .\" NS
2069 .\" NS modifies:
2070 .\" NS   doc-saved-space
2071 .\" NS   doc-space
2073 .de doc-set-soft-space
2074 .  ie "\*[doc-space]"" \
2075 .    ds doc-saved-space "\*[doc-soft-space]
2076 .  el \
2077 .    ds doc-space "\*[doc-soft-space]
2081 .\" NS doc-space-mode global register (bool)
2082 .\" NS   default is one (space mode on)
2084 .nr doc-space-mode 1
2087 .\" NS doc-saved-space global string
2088 .\" NS   saved value of `doc-space'
2090 .ds doc-saved-space "\*[doc-space]
2093 .\" NS doc-have-space global register (bool)
2094 .\" NS   set if last command was horizontal space
2096 .nr doc-have-space 0
2099 .\" NS Sm user macro
2100 .\" NS   space mode (`.Sm'/`.Sm on'/`.Sm off')
2101 .\" NS
2102 .\" NS   without argument, toggle space mode
2103 .\" NS
2104 .\" NS modifies:
2105 .\" NS   doc-arg-limit
2106 .\" NS   doc-arg-ptr
2107 .\" NS   doc-argXXX
2108 .\" NS   doc-macro-name
2109 .\" NS   doc-num-args
2110 .\" NS   doc-saved-space
2111 .\" NS   doc-space
2112 .\" NS   doc-space-mode
2113 .\" NS   doc-spaceXXX
2114 .\" NS
2115 .\" NS local variables:
2116 .\" NS   doc-reg-Sm
2117 .\" NS
2118 .\" NS width register `Sm' set in doc-common
2120 .de Sm
2121 .  ie \n[doc-have-space] \
2122 .    nr doc-reg-Sm 0
2123 .  el \
2124 .    nr doc-reg-Sm 1
2126 .  if !\n[doc-arg-limit] \{\
2127 .    ie \n[.$] \{\
2128 .      ds doc-macro-name Sm
2129 .      doc-parse-args \$@
2130 .    \}
2131 .    el \{\
2132 .      ie \n[doc-space-mode] \
2133 .        nr doc-space-mode 0
2134 .      el \
2135 .        nr doc-space-mode 1
2136 .  \}\}
2138 .  if !\n[doc-arg-limit] \
2139 .    return
2141 .  nr doc-arg-ptr +1
2143 .  \" avoid a warning message in case `Sm' is the last parameter
2144 .  if !d doc-arg\n[doc-arg-ptr] \
2145 .    ds doc-arg\n[doc-arg-ptr]
2147 .  ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2148 .    ds doc-space "\*[doc-saved-space]
2149 .    nr doc-space-mode 1
2150 .  \}
2151 .  el \{\
2152 .    ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2153 .      ds doc-saved-space "\*[doc-space]
2154 .      ds doc-space
2155 .      nr doc-space-mode 0
2156 .    \}
2157 .    el \{\
2158 .      \" no argument for Sm
2159 .      nr doc-arg-ptr -1
2160 .      ie \n[doc-space-mode] \
2161 .        nr doc-space-mode 0
2162 .      el \
2163 .        nr doc-space-mode 1
2164 .  \}\}
2166 .  ie \n[doc-space-mode] \{\
2167 .    \" recompute space vector for remaining arguments
2168 .    nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2169 .    nr doc-arg-limit \n[doc-arg-ptr]
2170 .    if \n[doc-num-args] \
2171 .      doc-parse-space-vector
2173 .    \" finish line only if it is interrupted and `doc-have-space'
2174 .    \" isn't set
2175 .    if \n[doc-reg-Sm] \
2176 .      if \n[.int] \
2177 .        nop \)
2178 .  \}
2179 .  el \{\
2180 .    \" reset remaining space vector elements
2181 .    nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2182 .    while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2183 .      ds doc-space\n[doc-reg-Sm]
2184 .      nr doc-reg-Sm +1
2185 .      \" the body of a `while' request must end with the fitting `\}'!
2186 .    \}
2187 .  \}
2189 .  \" do we have parameters to print?
2190 .  ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2191 .    \" ignore `.Sm on' and `.Sm off' without additional parameters
2192 .    ie (\n[doc-arg-ptr] > 1) \
2193 .      doc-print-and-reset
2194 .    el \
2195 .      doc-reset-args
2196 .  \}
2197 .  el \{\
2198 .    \" skip `Sm' argument
2199 .    nr doc-arg-ptr +1
2200 .    doc-print-recursive
2201 .  \}
2205 .\" NS doc-arg-type immediate register
2206 .\" NS   argument type (macro=1, string=2, punctuation suffix=3,
2207 .\" NS   punctuation prefix=4)
2209 .nr doc-arg-type 0
2212 .\" NS doc-get-arg-type macro
2213 .\" NS   get argument type
2214 .\" NS
2215 .\" NS   this macro expects the width of the argument in `doc-width'
2216 .\" NS
2217 .\" NS modifies:
2218 .\" NS   doc-arg-type
2220 .de doc-get-arg-type
2221 .  nr doc-arg-type 2
2223 .  if ((\n[doc-width] < 4) & \A\a\$1\a) \{\
2224 .    ie (\n[doc-width] == 1) \{\
2225 .      if r doc-punct\$1 \
2226 .        nr doc-arg-type \n[doc-punct\$1]
2227 .    \}
2228 .    el \
2229 .      if r \$1 \
2230 .        if d \$1 \
2231 .          nr doc-arg-type 1
2232 .  \}
2236 .\" NS doc-get-arg-type* macro
2237 .\" NS   similar to as `doc-get-arg-type' but uses doc-argXXX strings
2238 .\" NS
2239 .\" NS   this macro sets the `doc-width' register using the `length' request
2240 .\" NS   to get the number of characters in a string literally
2241 .\" NS
2242 .\" NS modifies:
2243 .\" NS   doc-arg-type
2244 .\" NS   doc-width
2246 .de doc-get-arg-type*
2247 .  nr doc-arg-type 2
2248 .  length doc-width "\*[doc-arg\$1]
2250 .  if ((\n[doc-width] < 4) & \A\a\*[doc-arg\$1]\a) \{\
2251 .    ie (\n[doc-width] == 1) \{\
2252 .      if r doc-punct\*[doc-arg\$1] \
2253 .        nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
2254 .    \}
2255 .    el \
2256 .      if r \*[doc-arg\$1] \
2257 .        if d \*[doc-arg\$1] \
2258 .          nr doc-arg-type 1
2259 .  \}
2263 .\" NS doc-set-spacing-1 macro
2264 .\" NS   set spacing for macros
2265 .\" NS
2266 .\" NS modifies:
2267 .\" NS   doc-spaceXXX
2268 .\" NS
2269 .\" NS local variables:
2270 .\" NS   doc-reg-dssfm
2271 .\" NS   doc-reg-dssfm1
2273 .de doc-set-spacing-1
2274 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2276 .  \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2277 .  \" argument)
2278 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2279 .    if \n[doc-arg-limit] \{\
2280 .      nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2281 .      ds doc-space\n[doc-reg-dssfm]
2282 .    \}
2283 .    ds doc-space\n[doc-arg-limit] "\*[doc-space]
2284 .  \}
2285 .  el \{\
2286 .    \" macros like .Ap and .Ns have value 2 (remove space before and after
2287 .    \" argument)
2288 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2289 .      if \n[doc-arg-limit] \{\
2290 .        nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2291 .        ds doc-space\n[doc-reg-dssfm]
2292 .      \}
2293 .      ds doc-space\n[doc-arg-limit]
2294 .    \}
2295 .    el \
2296 .      ds doc-space\n[doc-arg-limit]
2297 .  \}
2301 .\" NS doc-set-spacing-2 macro
2302 .\" NS   set spacing for strings
2303 .\" NS
2304 .\" NS modifies:
2305 .\" NS   doc-spaceXXX
2307 .de doc-set-spacing-2
2308 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2312 .\" NS doc-set-spacing-3 macro
2313 .\" NS   set spacing for punctuation suffixes
2314 .\" NS
2315 .\" NS modifies:
2316 .\" NS   doc-spaceXXX
2317 .\" NS
2318 .\" NS local variables:
2319 .\" NS   doc-reg-dssfps
2321 .de doc-set-spacing-3
2322 .  if \n[doc-arg-limit] \{\
2323 .    nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2324 .    ds doc-space\n[doc-reg-dssfps]
2325 .  \}
2327 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2331 .\" NS doc-set-spacing-4 macro
2332 .\" NS   set spacing for punctuation prefixes
2333 .\" NS
2334 .\" NS modifies:
2335 .\" NS   doc-spaceXXX
2337 .de doc-set-spacing-4
2338 .  ds doc-space\n[doc-arg-limit]
2342 .\" type switches (on current argument doc-arg-ptr)
2345 .\" NS doc-do-1 macro
2346 .\" NS   call request if macro
2348 .de doc-do-1
2349 .  \*[doc-arg\n[doc-arg-ptr]]
2353 .\" NS doc-do-2 macro
2354 .\" NS   call .doc-print-recursive if string
2356 .als doc-do-2 doc-print-recursive
2359 .\" NS doc-do-3 macro
2360 .\" NS   call .doc-print-recursive if punctuation suffix
2362 .als doc-do-3 doc-print-recursive
2365 .\" NS doc-do-4 macro
2366 .\" NS   call .doc-print-recursive if punctuation prefix
2368 .als doc-do-4 doc-print-recursive
2371 .\" NS doc-fontmode-depth global register
2372 .\" NS   font mode level
2374 .nr doc-fontmode-depth 0
2377 .\" NS doc-fontmode-font-stackXXX global register
2378 .\" NS   stack of saved current font values from `Bf' request
2379 .\" NS
2380 .\" NS limit:
2381 .\" NS   doc-fontmode-depth
2383 .nr doc-fontmode-font-stack0 0
2386 .\" NS doc-fontmode-size-stackXXX global register
2387 .\" NS   stack of saved current size values from `Bf' request
2388 .\" NS
2389 .\" NS limit:
2390 .\" NS   doc-fontmode-depth
2392 .nr doc-fontmode-size-stack0 0
2395 .\" NS Bf user macro
2396 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2397 .\" NS
2398 .\" NS modifies:
2399 .\" NS   doc-fontmode-depth
2400 .\" NS   doc-fontmode-font-stackXXX
2401 .\" NS   doc-fontmode-size-stackXXX
2402 .\" NS   doc-macro-name
2403 .\" NS
2404 .\" NS width register `Bf' set in doc-common
2406 .de Bf
2407 .  ds doc-macro-name Bf
2409 .  ie \n[.$] \{\
2410 .    nr doc-fontmode-depth +1
2412 .    \" save current font and size
2413 .    nr doc-fontmode-font-stack\n[doc-fontmode-depth] \n[.f]
2414 .    nr doc-fontmode-size-stack\n[doc-fontmode-depth] \n[.ps]
2416 .    ie        "\$1"Em" \
2417 .      nop \*[doc-Em-font]\c
2418 .    el \{ .ie "\$1"Li" \
2419 .      nop \*[doc-Li-font]\c
2420 .    el \{ .ie "\$1"Sy" \
2421 .      nop \*[doc-Sy-font]\c
2422 .    el \{ .ie "\$1"-emphasis" \
2423 .      nop \*[doc-Em-font]\c
2424 .    el \{ .ie "\$1"-literal" \
2425 .      nop \*[doc-Li-font]\c
2426 .    el \{ .ie "\$1"-symbolic" \
2427 .      nop \*[doc-Sy-font]\c
2428 .    el \{\
2429 .      tmc mdoc warning: Unknown keyword `\$1' in .Bf request
2430 .      tm1 " (#\n[.c])
2431 .  \}\}\}\}\}\}\}
2432 .  el \
2433 .    tm Usage: .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2437 .\" NS Ef user macro
2438 .\" NS   end font mode
2439 .\" NS
2440 .\" NS modifies:
2441 .\" NS   doc-macro-name
2442 .\" NS
2443 .\" NS width register `Ef' set in doc-common
2445 .de Ef
2446 .  ds doc-macro-name Ef
2448 .  ie \n[doc-fontmode-depth] \{\
2449 .    \" restore saved font and size
2450 .    nop \)\f[\n[doc-fontmode-font-stack\n[doc-fontmode-depth]]]\c
2451 .    nop \)\s[\n[doc-fontmode-size-stack\n[doc-fontmode-depth]]u]\c
2453 .    nr doc-fontmode-font-stack\n[doc-fontmode-depth] 0
2454 .    nr doc-fontmode-size-stack\n[doc-fontmode-depth] 0
2455 .    nr doc-fontmode-depth -1
2456 .  \}
2457 .  el \
2458 .    tm mdoc warning: Extraneous .Ef (#\n[.c])
2462 .\" NS doc-keep-type global register
2463 .\" NS   current keep type; 1 is `-words', 2 is `-lines', 3 is unknown
2465 .nr doc-keep-type 0
2468 .\" NS Bk user macro
2469 .\" NS   begin keep
2470 .\" NS
2471 .\" NS modifies:
2472 .\" NS   doc-keep-type
2473 .\" NS   doc-macro-name
2474 .\" NS
2475 .\" NS width register `Bk' set in doc-common
2477 .de Bk
2478 .  ds doc-macro-name Bk
2480 .  if \n[doc-keep-type] \
2481 .    tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2483 .  ie        "\$1"-lines" \{\
2484 .    nr doc-keep-type 2
2485 .    tm .Bk -lines: Not implemented yet. (#\n[.c])
2486 .  \}
2487 .  el \{ .ie "\$1"-words" \{\
2488 .    nr doc-keep-type 1
2489 .    doc-set-hard-space
2490 .  \}
2491 .  el \{ .ie "\$1"" \{\
2492 .    \" default
2493 .    nr doc-keep-type 1
2494 .    doc-set-hard-space
2495 .  \}
2496 .  el \{\
2497 .    tm mdoc warning: Unknown keyword `\$1' in .Bk request (#\n[.c])
2498 .    nr doc-keep-type 3
2499 .  \}\}\}
2501 \#.  nr doc-nesting-level +1
2505 .\" NS Ek user macro
2506 .\" NS   end keep
2507 .\" NS
2508 .\" NS modifies:
2509 .\" NS   doc-keep-type
2510 .\" NS   doc-macro-name
2511 .\" NS
2512 .\" NS width register `Ek' set in doc-common
2514 .de Ek
2515 .  ds doc-macro-name Ek
2517 \#.  nr doc-nesting-level -1
2519 .  ie \n[.$] \
2520 .    tm Usage: .Ek (does not take arguments) (#\n[.c])
2521 .  el \{\
2522 .    if !\n[doc-keep-type] \
2523 .      tm mdoc warning: .Ek found without .Bk before (#\n[.c])
2525 .    ie        (\n[doc-keep-type] == 1) \
2526 .      doc-set-soft-space
2527 .    el \{ .if (\n[doc-keep-type] == 2) \
2528 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2529 .  \}\}
2531 .  nr doc-keep-type 0
2533 \#.  if !"\*[doc-out-string]"" \
2534 \#.    doc-print-out-string
2538 .\" NS doc-display-depth global register
2539 .\" NS   display level
2541 .nr doc-display-depth 0
2544 .\" NS doc-is-compact global register (bool)
2545 .\" NS   set if the `compact' keyword is given
2547 .nr doc-is-compact 0
2550 .\" NS doc-display-type-stackXXX global string
2551 .\" NS   the display type stack
2552 .\" NS
2553 .\" NS limit:
2554 .\" NS   doc-display-depth
2556 .ds doc-display-type-stack0
2559 .\" NS doc-display-indent-stackXXX global register
2560 .\" NS   stack of display indentation values
2561 .\" NS
2562 .\" NS limit:
2563 .\" NS   doc-display-depth
2565 .nr doc-display-indent-stack0 0
2568 .\" NS doc-display-ad-stackXXX global register
2569 .\" NS   stack of saved adjustment modes
2570 .\" NS
2571 .\" NS limit:
2572 .\" NS   doc-display-depth
2574 .nr doc-display-ad-stack0 0
2577 .\" NS doc-display-fi-stackXXX global register
2578 .\" NS   stack of saved fill modes
2579 .\" NS
2580 .\" NS limit:
2581 .\" NS   doc-display-depth
2583 .nr doc-display-fi-stack0 0
2586 .\" NS Bd user macro
2587 .\" NS   begin display
2588 .\" NS
2589 .\" NS width register `Bd' set in doc-common
2590 .\" NS
2591 .\" NS modifies:
2592 .\" NS   doc-curr-font
2593 .\" NS   doc-curr-size
2594 .\" NS   doc-display-depth
2595 .\" NS   doc-display-ad-stackXXX
2596 .\" NS   doc-display-fi-stackXXX
2597 .\" NS   doc-display-file
2598 .\" NS   doc-display-indent-stackXXX
2599 .\" NS   doc-display-type-stackXXX
2600 .\" NS   doc-is-compact
2601 .\" NS   doc-macro-name
2602 .\" NS
2603 .\" NS local variables:
2604 .\" NS   doc-reg-Bd
2606 .de Bd
2607 .  ds doc-macro-name Bd
2609 .  if !\n[.$] \{\
2610 .    tm1 "Usage: .Bd {-literal | -filled | -ragged | -centered | -unfilled}
2611 .    tm1 "           [-offset [string]] [-compact] [-file name] (#\n[.c])
2612 .    return
2613 .  \}
2615 .  nr doc-is-compact 0
2616 .  ds doc-display-file
2617 .  nr doc-reg-Bd 1
2618 .  nr doc-display-depth +1
2620 .  \" save current adjustment and fill modes
2621 .  nr doc-display-ad-stack\n[doc-display-depth] \n[.j]
2622 .  nr doc-display-fi-stack\n[doc-display-depth] \n[.u]
2624 .  ie        "\$1"-literal" \{\
2625 .    ds doc-display-type-stack\n[doc-display-depth] literal
2626 .    nr doc-curr-font \n[.f]
2627 .    nr doc-curr-size \n[.ps]
2629 .    ie t \{\
2630 .      nop \*[doc-Li-font]\c
2631 '      ta T 9n
2632 .    \}
2633 .    el \
2634 '      ta T 8n
2635 .    nf
2636 .  \}
2637 .  el \{ .ie "\$1"-filled" \{\
2638 .    ds doc-display-type-stack\n[doc-display-depth] filled
2639 .    ad b
2640 .    fi
2641 .  \}
2642 .  el \{ .ie "\$1"-ragged" \{\
2643 .    ds doc-display-type-stack\n[doc-display-depth] ragged
2644 .    na
2645 .    fi
2646 .  \}
2647 .  el \{ .ie "\$1"-centered" \{\
2648 .    ds doc-display-type-stack\n[doc-display-depth] centered
2649 .    ad c
2650 .    fi
2651 .  \}
2652 .  el \{ .ie "\$1"-unfilled" \{\
2653 .    ds doc-display-type-stack\n[doc-display-depth] unfilled
2654 .    nf
2655 .  \}
2656 .  el \{\
2657 .    tm1 "mdoc warning: Unknown keyword `\$1' (or missing display type)
2658 .    tm1 "              in .Bd request (#\n[.c])
2659 .    nr doc-reg-Bd 0
2660 .  \}\}\}\}\}
2662 .  \" have we seen an argument?
2663 .  if \n[doc-reg-Bd] \{\
2664 .    shift
2665 .    \" check other arguments
2666 .    if \n[.$] \
2667 .      doc-do-Bd-args \$@
2668 .  \}
2670 .  \" avoid warning about non-existent register
2671 .  if !r doc-display-indent-stack\n[doc-display-depth] \
2672 .    nr doc-display-indent-stack\n[doc-display-depth] 0
2674 .  if \n[doc-display-indent-stack\n[doc-display-depth]] \
2675 '    in +\n[doc-display-indent-stack\n[doc-display-depth]]u
2677 .  if !\n[doc-is-compact] \{\
2678 .    if !\n[doc-in-synopsis-section] \{\
2679 .      ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2680 .        sp \n[doc-display-vertical]u
2681 .      el \
2682 '        sp \n[doc-display-vertical]u
2683 .  \}\}
2685 .  if !\n[cR] \
2686 .    ne 2v
2688 .  if !"\*[doc-display-file]"" \
2689 .    so \*[doc-display-file]
2691 .  nr doc-is-compact 0
2692 .  ds doc-display-file
2696 .\" NS doc-do-Bd-args macro
2697 .\" NS   resolve remaining .Bd arguments
2698 .\" NS
2699 .\" NS modifies:
2700 .\" NS   doc-display-file
2701 .\" NS   doc-display-indent-stackXXX
2702 .\" NS   doc-is-compact
2703 .\" NS
2704 .\" NS local variables:
2705 .\" NS   doc-reg-ddBa
2706 .\" NS   doc-reg-ddBa1
2707 .\" NS   doc-reg-ddBa2
2708 .\" NS   doc-reg-ddBa3
2709 .\" NS   doc-reg-ddBa4
2710 .\" NS   doc-str-ddBa
2712 .de doc-do-Bd-args
2713 .  nr doc-reg-ddBa 1
2715 .  ie        "\$1"-offset" \{\
2716 .    nr doc-reg-ddBa 2
2718 .    ie        "\$2"left" \
2719 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2720 .    el \{ .ie "\$2"right" \
2721 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2722 .    el \{ .ie "\$2"center" \
2723 .      nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2724 .    el \{ .ie "\$2"indent" \
2725 .      nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2726 .    el \{ .ie "\$2"indent-two" \
2727 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2728 .    el \
2729 .      nr doc-reg-ddBa 1
2730 .    \}\}\}\}
2732 .    \" not a known keyword
2733 .    if (\n[doc-reg-ddBa] == 1) \{\
2734 .      nr doc-reg-ddBa 2
2736 .      nr doc-reg-ddBa1 0
2737 .      if \B\a(\$2)\a \{\
2738 .        \" disable warnings related to scaling indicators (32)
2739 .        nr doc-reg-ddBa2 \n[.warn]
2740 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
2742 .        \" values without a scaling indicator are taken as strings;
2743 .        \" we test whether the parameter string with and without the last
2744 .        \" character yields identical numerical results (ignoring the
2745 .        \" scaling indicator)
2746 .        ds doc-str-ddBa "\$2
2747 .        substring doc-str-ddBa 1 -1
2748 .        if \B\a(\*[doc-str-ddBa])\a \{\
2749 .          nr doc-reg-ddBa3 (;(\$2))
2750 .          nr doc-reg-ddBa4 (\*[doc-str-ddBa])
2751 .          if (\n[doc-reg-ddBa3] == \n[doc-reg-ddBa4]) \
2752 .            nr doc-reg-ddBa1 1
2753 .        \}
2755 .        \" enable all warnings again
2756 .        warn \n[doc-reg-ddBa2]
2757 .      \}
2759 .      ie \n[doc-reg-ddBa1] \
2760 .        nr doc-display-indent-stack\n[doc-display-depth] \$2
2761 .      el \{\
2762 .        doc-get-width "\$2"
2763 .        ie (\n[doc-width] <= 3) \{\
2764 .          \" if the offset parameter is a macro, use the macro's
2765 .          \" width as specified in doc-common
2766 .          doc-get-arg-type "\$2"
2767 .          ie (\n[doc-arg-type] == 1) \
2768 .            nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
2769 .          el \
2770 .            nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2771 .        \}
2772 .        el \
2773 .          nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2774 .    \}\}
2775 .  \}
2776 .  el \{ .ie "\$1"-compact" \
2777 .    nr doc-is-compact 1
2778 .  el \{ .ie "\$1"-file" \{\
2779 .    ie !"\$2"" \{\
2780 .      ds doc-display-file "\$2
2781 .      nr doc-reg-ddBa 2
2782 .    \}
2783 .    el \
2784 .      tm mdoc warning: .Bd `-file' keyword requires argument (#\n[.c])
2785 .  \}
2786 .  el \
2787 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2788 .  \}\}
2790 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
2791 .    shift \n[doc-reg-ddBa]
2792 .    doc-do-Bd-args \$@
2793 .  \}
2797 .\" NS Ed user macro
2798 .\" NS   end display
2799 .\" NS
2800 .\" NS modifies:
2801 .\" NS   doc-display-depth
2802 .\" NS   doc-display-indent-stackXXX
2803 .\" NS   doc-display-type-stackXXX
2804 .\" NS   doc-macro-name
2805 .\" NS
2806 .\" NS width register `Ed' set in doc-common
2808 .de Ed
2809 .  ds doc-macro-name Ed
2811 .  br
2813 .  if !\n[doc-display-depth] \{\
2814 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
2815 .    nr doc-display-depth 1
2816 .  \}
2818 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2819 .    ft \n[doc-curr-font]
2820 .    ps \n[doc-curr-size]u
2821 .  \}
2823 .  in -\n[doc-display-indent-stack\n[doc-display-depth]]u
2825 .  \" restore saved adjustment and fill modes
2826 .  ie \n[doc-display-fi-stack\n[doc-display-depth]] \
2827 .    fi
2828 .  el \
2829 .    nf
2830 .  ad \n[doc-display-ad-stack\n[doc-display-depth]]
2832 .  nr doc-display-indent-stack\n[doc-display-depth] 0
2833 .  ds doc-display-type-stack\n[doc-display-depth]
2834 .  nr doc-display-depth -1
2838 .\" NS doc-list-type-stackXXX global string
2839 .\" NS   stack of list types
2840 .\" NS
2841 .\" NS limit:
2842 .\" NS   doc-list-depth
2844 .ds doc-list-type-stack1
2847 .\" NS doc-list-indent-stackXXX global register
2848 .\" NS   stack of list indentation values
2849 .\" NS
2850 .\" NS limit:
2851 .\" NS   doc-list-depth
2853 .nr doc-list-indent-stack1 0
2856 .\" NS doc-list-have-indent-stackXXX global register (bool)
2857 .\" NS   an indentation value is active
2858 .\" NS
2859 .\" NS limit:
2860 .\" NS   doc-list-depth
2862 .nr doc-list-have-indent-stack1 0
2865 .\" NS Bl user macro
2866 .\" NS   begin list
2867 .\" NS
2868 .\" NS width register `Bl' set in doc-common
2869 .\" NS
2870 .\" NS modifies:
2871 .\" NS   doc-arg-ptr
2872 .\" NS   doc-argXXX
2873 .\" NS   doc-list-depth
2874 .\" NS   doc-list-have-indent-stackXXX
2875 .\" NS   doc-list-indent-stackXXX
2876 .\" NS   doc-list-type-stackXXX
2877 .\" NS   doc-macro-name
2878 .\" NS   doc-num-args
2879 .\" NS   doc-num-columns
2880 .\" NS
2881 .\" NS local variables:
2882 .\" NS   doc-reg-Bl
2884 .de Bl
2885 .  if !\n[.$] \{\
2886 .    doc-Bl-usage
2887 .    return
2888 .  \}
2890 .  ds doc-macro-name Bl
2891 .  nr doc-list-depth +1
2892 .  nr doc-arg-ptr 1
2894 .  ie        "\$1"-hang" \{\
2895 .    ds doc-list-type-stack\n[doc-list-depth] hang-list
2896 .    nr doc-list-indent-stack\n[doc-list-depth] 6n
2897 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2898 .  \}
2899 .  el \{ .ie "\$1"-tag" \{\
2900 .    ds doc-list-type-stack\n[doc-list-depth] tag-list
2901 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2902 .  \}
2903 .  el \{ .ie "\$1"-item" \{\
2904 .    ds doc-list-type-stack\n[doc-list-depth] item-list
2905 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2906 .  \}
2907 .  el \{ .ie "\$1"-enum" \{\
2908 .    ds doc-list-type-stack\n[doc-list-depth] enum-list
2909 .    nr doc-list-indent-stack\n[doc-list-depth] 3n
2910 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2911 .  \}
2912 .  el \{ .ie "\$1"-bullet" \{\
2913 .    ds doc-list-type-stack\n[doc-list-depth] bullet-list
2914 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2915 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2916 .  \}
2917 .  el \{ .ie "\$1"-dash" \{\
2918 .    ds doc-list-type-stack\n[doc-list-depth] dash-list
2919 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2920 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2921 .  \}
2922 .  el \{ .ie "\$1"-hyphen" \{\
2923 .    ds doc-list-type-stack\n[doc-list-depth] dash-list
2924 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2925 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2926 .  \}
2927 .  el \{ .ie "\$1"-inset" \{\
2928 .    ds doc-list-type-stack\n[doc-list-depth] inset-list
2929 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2930 .  \}
2931 .  el \{ .ie "\$1"-diag" \{\
2932 .    ds doc-list-type-stack\n[doc-list-depth] diag-list
2933 .  \}
2934 .  el \{ .ie "\$1"-ohang" \{\
2935 .    ds doc-list-type-stack\n[doc-list-depth] ohang-list
2936 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2937 .  \}
2938 .  el \{ .ie "\$1"-column" \{\
2939 .    ds doc-list-type-stack\n[doc-list-depth] column-list
2940 .    linetabs 1
2941 .  \}
2942 .  el \{\
2943 .    tm1 "mdoc warning: Unknown list type `\$1' (or missing list type)
2944 .    tm1 "              in .Bl request
2945 .    tm
2946 .    nr doc-arg-ptr 0
2947 .  \}\}\}\}\}\}\}\}\}\}\}
2949 .  \" we have seen a list type
2950 .  if !\n[doc-arg-ptr] \{\
2951 .    doc-Bl-usage
2952 .    doc-reset-args
2953 .    nr doc-list-depth -1
2954 .    return
2955 .  \}
2957 .  shift
2959 .  \" fill argument vector
2960 .  nr doc-reg-Bl 1
2961 .  while (\n[doc-reg-Bl] <= \n[.$]) \{\
2962 .    ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
2963 .    nr doc-reg-Bl +1
2964 .  \}
2966 .  doc-increment-list-stack
2968 .  if \n[.$] \{\
2969 .    nr doc-arg-limit \n[.$]
2970 .    nr doc-arg-ptr 0
2971 .    doc-do-Bl-args
2973 .    in +\n[doc-list-offset-stack\n[doc-list-depth]]u
2975 .    \" initialize column list
2976 .    if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
2977 .      doc-set-column-tab \n[doc-num-columns]
2978 '      in -\n[doc-column-indent-width]u
2979 .      if !\n[doc-compact-list-stack\n[doc-list-depth]] \
2980 .        sp \n[doc-display-vertical]u
2982 .      nf
2983 .      nr doc-num-columns 0
2984 .  \}\}
2986 .  doc-reset-args
2990 .\" NS doc-Bl-usage macro
2992 .de doc-Bl-usage
2993 .  tm1 "Usage: .Bl {-hang | -ohang | -tag | -diag | -inset}
2994 .  tm1 "             [-width <string>] [-xwidth <command>]
2995 .  tm1 "             [-offset <string>] [-compact]
2996 .  tm1 "       .Bl -column [-offset <string>] <string1> <string2> ...
2997 .  tm1 "       .Bl {-item | -enum [-nested] | -bullet | -hyphen | -dash}
2998 .  tm1 "             [-offset <string>] [-compact] (#\n[.c])
3002 .\" NS doc-do-Bl-args macro
3003 .\" NS   resolve remaining .Bl arguments
3004 .\" NS
3005 .\" NS modifies:
3006 .\" NS   doc-arg-ptr
3007 .\" NS   doc-argXXX
3008 .\" NS   doc-compact-list-stackXXX
3009 .\" NS   doc-list-indent-stackXXX
3010 .\" NS   doc-list-offset-stackXXX
3011 .\" NS   doc-num-columns
3012 .\" NS   doc-tag-prefix-stackXXX
3013 .\" NS   doc-tag-width-stackXXX
3014 .\" NS
3015 .\" NS local variables:
3016 .\" NS   doc-box-dBla
3017 .\" NS   doc-env-dBla
3018 .\" NS   doc-reg-dBla
3019 .\" NS   doc-reg-dBla1
3020 .\" NS   doc-reg-dBla2
3021 .\" NS   doc-reg-dBla3
3022 .\" NS   doc-reg-dBla4
3023 .\" NS   doc-str-dBla
3024 .\" NS   doc-str-dBla1
3026 .de doc-do-Bl-args
3027 .  nr doc-arg-ptr +1
3029 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
3030 .    return
3032 .  \" avoid a warning message in case e.g. `-offset' has no parameter
3033 .  nr doc-reg-dBla (\n[doc-arg-ptr] + 1)
3034 .  if !d doc-arg\n[doc-reg-dBla] \
3035 .    ds doc-arg\n[doc-reg-dBla]
3037 .  nr doc-reg-dBla 1
3039 .  ie        "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3040 .    nr doc-compact-list-stack\n[doc-list-depth] 1
3042 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-nested" \{\
3043 .    ie (\n[doc-list-depth] > 1) \{\
3044 .      nr doc-reg-dBla1 (\n[doc-list-depth] - 1)
3045 .      ds doc-tag-prefix-stack\n[doc-list-depth] "\*[doc-tag-prefix-stack\n[doc-reg-dBla1]]
3046 .      as doc-tag-prefix-stack\n[doc-list-depth] \n[doc-enum-list-count-stack\n[doc-reg-dBla1]].
3047 .      length doc-reg-dBla1 "\*[doc-tag-prefix-stack\n[doc-list-depth]]
3048 .      nr doc-list-indent-stack\n[doc-list-depth] +\n[doc-reg-dBla1]n
3049 .    \}
3050 .    el \
3051 .      tm mdoc warning: `-nested' allowed with nested .Bl requests only (#\n[.c])
3052 .  \}
3054 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3055 .    nr doc-arg-ptr +1
3056 .    ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3057 .    ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3059 .    \" test whether argument is a valid numeric expression
3060 .    nr doc-reg-dBla1 0
3061 .    if \B\a(\*[doc-str-dBla])\a \{\
3062 .      \" disable warnings related to scaling indicators (32)
3063 .      nr doc-reg-dBla2 \n[.warn]
3064 .      warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3066 .      \" values without a scaling indicator are taken as strings;
3067 .      \" we test whether the parameter string with and without the last
3068 .      \" character yields identical numerical results (ignoring the
3069 .      \" scaling indicator)
3070 .      ds doc-str-dBla1 "\*[doc-str-dBla]
3071 .      substring doc-str-dBla1 1 -1
3072 .      if \B\a(\*[doc-str-dBla1])\a \{\
3073 .        nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3074 .        nr doc-reg-dBla4 (\*[doc-str-dBla1])
3075 .        if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3076 .          nr doc-reg-dBla1 1
3077 .      \}
3079 .      \" enable all warnings again
3080 .      warn \n[doc-reg-dBla2]
3081 .    \}
3083 .    ie \n[doc-reg-dBla1] \
3084 .      nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
3085 .    el \{\
3086 .      doc-get-arg-width \n[doc-arg-ptr]
3087 .      ie (\n[doc-width] == 2) \{\
3088 .        \" if the width parameter is a macro, use the macro's
3089 .        \" width as specified in doc-common
3090 .        doc-get-arg-type \*[doc-str-dBla]
3091 .        ie (\n[doc-arg-type] == 1) \
3092 .          nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3093 .        el \
3094 .          nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3095 .      \}
3096 .      el \
3097 .        nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3098 .  \}\}
3100 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
3101 .    nr doc-arg-ptr +1
3102 .    ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3104 .    ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3105 .    substring doc-str-dBla 1 2
3106 .    if \a.\a\*[doc-str-dBla]\a \{\
3107 .      \" execute string in a box to get the width of the diversion
3108 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3109 .      doc-save-global-vars
3110 .      doc-reset-args
3111 .      box doc-box-dBla
3112 .      ev doc-env-dBla
3113 .      evc 0
3114 .      in 0
3115 .      nf
3116 .      nop \*[doc-str-dBla]
3117 .      br
3118 .      ev
3119 .      box
3120 .      doc-restore-global-vars
3121 .      doc-get-width \h'\n[dl]u'
3122 .    \}
3123 .    nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3124 .  \}
3126 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3127 .    nr doc-arg-ptr +1
3129 .    ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3130 .      nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3131 .    el \{\
3132 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3133 .      nr doc-reg-dBla1 0
3134 .      if \B\a(\*[doc-str-dBla])\a \{\
3135 .        nr doc-reg-dBla2 \n[.warn]
3136 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3138 .        ds doc-str-dBla1 "\*[doc-str-dBla]
3139 .        substring doc-str-dBla1 1 -1
3140 .        if \B\a(\*[doc-str-dBla1])\a \{\
3141 .          nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3142 .          nr doc-reg-dBla4 (\*[doc-str-dBla1])
3143 .          if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3144 .            nr doc-reg-dBla1 1
3145 .        \}
3147 .        warn \n[doc-reg-dBla2]
3148 .      \}
3150 .      ie \n[doc-reg-dBla1] \
3151 .        nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3152 .      el \{\
3153 .        doc-get-arg-width \n[doc-arg-ptr]
3154 .        ie (\n[doc-width] <= 3) \{\
3155 .          \" if the offset parameter is a macro, use the macro's
3156 .          \" width as specified in doc-common
3157 .          doc-get-arg-type \*[doc-str-dBla]
3158 .          ie (\n[doc-arg-type] == 1) \
3159 .            nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3160 .          el \
3161 .            nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3162 .        \}
3163 .        el \
3164 .          nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3165 .  \}\}\}
3166 .  el \
3167 .    nr doc-reg-dBla 0
3168 .  \}\}\}\}
3170 .  \" not a known keyword, so it specifies the width of the next column
3171 .  \" (if it is a column list)
3172 .  if !\n[doc-reg-dBla] \{\
3173 .    ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3174 .      nr doc-num-columns +1
3175 .      ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3176 .    \}
3177 .    el \{\
3178 .      tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3179 .      tm1 " in .Bl request (#\n[.c])
3180 .  \}\}
3182 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3183 .    doc-do-Bl-args
3187 .\" NS doc-save-global-vars macro
3188 .\" NS   save all global variables
3189 .\" NS
3190 .\" NS local variables:
3191 .\" NS   doc-reg-dsgv
3193 .de doc-save-global-vars
3194 .  ds doc-macro-name-saved "\*[doc-macro-name]
3195 .  nr doc-arg-limit-saved \n[doc-arg-limit]
3196 .  nr doc-num-args-saved \n[doc-num-args]
3197 .  nr doc-arg-ptr-saved \n[doc-arg-ptr]
3199 .  nr doc-reg-dsgv 1
3200 .  while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3201 .    ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3202 .    nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
3203 .    ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3204 .    nr doc-reg-dsgv +1
3205 .  \}
3207 .  nr doc-curr-font-saved \n[doc-curr-font]
3208 .  nr doc-curr-size-saved \n[doc-curr-size]
3209 .  nr doc-in-synopsis-section-saved \n[doc-in-synopsis-section]
3210 .  nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3211 .  nr doc-indent-synopsis-active-saved \n[doc-indent-synopsis-active]
3212 .  nr doc-have-decl-saved \n[doc-have-decl]
3213 .  nr doc-have-var-saved \n[doc-have-var]
3214 .  ds doc-command-name-saved "\*[doc-command-name]
3215 .  ds doc-quote-left-saved "\*[doc-quote-left]
3216 .  ds doc-quote-right-saved "\*[doc-quote-right]
3217 .  nr doc-nesting-level-saved \n[doc-nesting-level]
3218 .  nr doc-in-list-saved \n[doc-in-list]
3219 .  ds doc-space-saved "\*[doc-space]
3220 .  ds doc-saved-space-saved "\*[doc-saved-space]
3221 .  nr doc-space-mode-saved \n[doc-space-mode]
3222 .  nr doc-have-space-saved \n[doc-have-space]
3223 .  nr doc-have-slot-saved \n[doc-have-slot]
3224 .  nr doc-keep-type-saved \n[doc-keep-type]
3225 .  nr doc-display-depth-saved \n[doc-display-depth]
3226 .  nr doc-is-compact-saved \n[doc-is-compact]
3228 .  nr doc-reg-dsgv 0
3229 .  while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3230 .    ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3231 .    nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3232 .    nr doc-display-ad-stack\n[doc-reg-dsgv]-saved \n[doc-display-ad-stack\n[doc-reg-dsgv]]
3233 .    nr doc-display-fi-stack\n[doc-reg-dsgv]-saved \n[doc-display-fi-stack\n[doc-reg-dsgv]]
3234 .    nr doc-reg-dsgv +1
3235 .  \}
3237 .  nr doc-fontmode-depth-saved \n[doc-fontmode-depth]
3239 .  nr doc-reg-dsgv 1
3240 .  while (\n[doc-reg-dsgv] <= \n[doc-fontmode-depth]) \{\
3241 .    nr doc-fontmode-font-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-font-stack\n[doc-reg-dsgv]]
3242 .    nr doc-fontmode-size-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-size-stack\n[doc-reg-dsgv]]
3243 .    nr doc-reg-dsgv +1
3244 .  \}
3246 .  nr doc-list-depth-saved \n[doc-list-depth]
3248 .  nr doc-reg-dsgv 1
3249 .  while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3250 .    ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3251 .    nr doc-list-have-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-have-indent-stack\n[doc-reg-dsgv]]
3252 .    nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3253 .    nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3254 .    ds doc-tag-prefix-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-prefix-stack\n[doc-reg-dsgv]]
3255 .    ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3256 .    nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3257 .    nr doc-enum-list-count-stack\n[doc-reg-dsgv]-saved \n[doc-enum-list-count-stack\n[doc-reg-dsgv]]
3258 .    nr doc-reg-dsgv +1
3259 .  \}
3261 .  ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3262 .  nr doc-curr-type-saved \n[doc-curr-type]
3263 .  ds doc-curr-arg-saved "\*[doc-curr-arg]
3264 .  nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3265 .  nr doc-num-columns-saved \n[doc-num-columns]
3266 .  nr doc-column-indent-width-saved \n[doc-column-indent-width]
3267 .  nr doc-is-func-saved \n[doc-is-func]
3268 .  nr doc-have-old-func-saved \n[doc-have-old-func]
3269 .  nr doc-func-arg-count-saved \n[doc-func-arg-count]
3270 .  ds doc-func-arg-saved "\*[doc-func-arg]
3271 .  nr doc-num-func-args-saved \n[doc-num-func-args]
3272 .  nr doc-func-args-processed-saved \n[doc-func-args-processed]
3273 .  nr doc-have-func-saved \n[doc-have-func]
3274 .  nr doc-is-reference-saved \n[doc-is-reference]
3275 .  nr doc-reference-count-saved \n[doc-reference-count]
3276 .  nr doc-author-count-saved \n[doc-author-count]
3278 .  nr doc-reg-dsgv 0
3279 .  while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3280 .    ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3281 .    nr doc-reg-dsgv +1
3282 .  \}
3284 .  nr doc-book-count-saved \n[doc-book-count]
3285 .  ds doc-book-name-saved "\*[doc-book-name]
3286 .  nr doc-date-count-saved \n[doc-date-count]
3287 .  ds doc-date-saved "\*[doc-date]
3288 .  nr doc-publisher-count-saved \n[doc-publisher-count]
3289 .  ds doc-publisher-name-saved "\*[doc-publisher-name]
3290 .  nr doc-journal-count-saved \n[doc-journal-count]
3291 .  ds doc-journal-name-saved "\*[doc-journal-name]
3292 .  nr doc-issue-count-saved \n[doc-issue-count]
3293 .  ds doc-issue-name-saved "\*[doc-issue-name]
3294 .  nr doc-optional-count-saved \n[doc-optional-count]
3295 .  ds doc-optional-string-saved "\*[doc-optional-string]
3296 .  nr doc-page-number-count-saved \n[doc-page-number-count]
3297 .  ds doc-page-number-string-saved "\*[doc-page-number-string]
3298 .  nr doc-corporate-count-saved \n[doc-corporate-count]
3299 .  ds doc-corporate-name-saved "\*[doc-corporate-name]
3300 .  nr doc-report-count-saved \n[doc-report-count]
3301 .  ds doc-report-name-saved "\*[doc-report-name]
3302 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
3303 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3304 .  ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
3305 .  nr doc-volume-count-saved \n[doc-volume-count]
3306 .  ds doc-volume-name-saved "\*[doc-volume-name]
3307 .  nr doc-have-author-saved \n[doc-have-author]
3309 .  ds doc-document-title-saved "\*[doc-document-title]
3310 .  ds doc-volume-saved "\*[doc-volume]
3311 .  ds doc-section-saved "\*[doc-section]
3312 .  ds doc-operating-system-saved "\*[doc-operating-system]
3313 .  ds doc-date-string-saved "\*[doc-date-string]
3314 .  nr doc-header-space-saved \n[doc-header-space]
3315 .  nr doc-footer-space-saved \n[doc-footer-space]
3316 .  nr doc-display-vertical-saved \n[doc-display-vertical]
3317 .  ds doc-header-string-saved "\*[doc-header-string]
3318 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3319 .  nr doc-in-files-section-saved \n[doc-in-files-section]
3320 .  nr doc-in-authors-section-saved \n[doc-in-authors-section]
3324 .\" NS doc-restore-global-vars macro
3325 .\" NS   restore all global variables
3326 .\" NS
3327 .\" NS local variables:
3328 .\" NS   doc-reg-drgv
3330 .de doc-restore-global-vars
3331 .  ds doc-macro-name "\*[doc-macro-name-saved]
3332 .  nr doc-arg-limit \n[doc-arg-limit-saved]
3333 .  nr doc-num-args \n[doc-num-args-saved]
3334 .  nr doc-arg-ptr \n[doc-arg-ptr-saved]
3336 .  nr doc-reg-drgv 1
3337 .  while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3338 .    ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3339 .    nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
3340 .    ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3341 .    nr doc-reg-drgv +1
3342 .  \}
3344 .  nr doc-curr-font \n[doc-curr-font-saved]
3345 .  nr doc-curr-size \n[doc-curr-size-saved]
3346 .  nr doc-in-synopsis-section \n[doc-in-synopsis-section-saved]
3347 .  nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3348 .  nr doc-indent-synopsis-active \n[doc-indent-synopsis-active-saved]
3349 .  nr doc-have-decl \n[doc-have-decl-saved]
3350 .  nr doc-have-var \n[doc-have-var-saved]
3351 .  ds doc-command-name "\*[doc-command-name-saved]
3352 .  ds doc-quote-left "\*[doc-quote-left-saved]
3353 .  ds doc-quote-right "\*[doc-quote-right-saved]
3354 .  nr doc-nesting-level \n[doc-nesting-level-saved]
3355 .  nr doc-in-list \n[doc-in-list-saved]
3356 .  ds doc-space "\*[doc-space-saved]
3357 .  ds doc-saved-space "\*[doc-saved-space-saved]
3358 .  nr doc-space-mode \n[doc-space-mode-saved]
3359 .  nr doc-have-space \n[doc-have-space-saved]
3360 .  nr doc-have-slot \n[doc-have-slot-saved]
3361 .  nr doc-keep-type \n[doc-keep-type-saved]
3362 .  nr doc-display-depth \n[doc-display-depth-saved]
3363 .  nr doc-is-compact \n[doc-is-compact-saved]
3365 .  nr doc-reg-drgv 0
3366 .  while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3367 .    ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3368 .    nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3369 .    nr doc-display-ad-stack\n[doc-reg-drgv] \n[doc-display-ad-stack\n[doc-reg-drgv]-saved]
3370 .    nr doc-display-fi-stack\n[doc-reg-drgv] \n[doc-display-fi-stack\n[doc-reg-drgv]-saved]
3371 .    nr doc-reg-drgv +1
3372 .  \}
3374 .  nr doc-fontmode-depth \n[doc-fontmode-depth-saved]
3376 .  nr doc-reg-drgv 1
3377 .  while (\n[doc-reg-drgv] <= \n[doc-fontmode-depth]) \{\
3378 .    nr doc-fontmode-font-stack\n[doc-reg-drgv] \n[doc-fontmode-font-stack\n[doc-reg-drgv]]-saved
3379 .    nr doc-fontmode-size-stack\n[doc-reg-drgv] \n[doc-fontmode-size-stack\n[doc-reg-drgv]]-saved
3380 .    nr doc-reg-drgv +1
3381 .  \}
3383 .  nr doc-list-depth \n[doc-list-depth-saved]
3385 .  nr doc-reg-drgv 1
3386 .  while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3387 .    ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3388 .    nr doc-list-have-indent-stack\n[doc-reg-drgv] \n[doc-list-have-indent-stack\n[doc-reg-drgv]-saved]
3389 .    nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3390 .    nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3391 .    ds doc-tag-prefix-stack\n[doc-reg-drgv] "\*[doc-tag-prefix-stack\n[doc-reg-drgv]-saved]
3392 .    ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3393 .    nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3394 .    nr doc-enum-list-count-stack\n[doc-reg-drgv] \n[doc-enum-list-count-stack\n[doc-reg-drgv]-saved]
3395 .    nr doc-reg-drgv +1
3396 .  \}
3398 .  ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3399 .  nr doc-curr-type \n[doc-curr-type-saved]
3400 .  ds doc-curr-arg "\*[doc-curr-arg-saved]
3401 .  nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3402 .  nr doc-num-columns \n[doc-num-columns-saved]
3403 .  nr doc-column-indent-width \n[doc-column-indent-width-saved]
3404 .  nr doc-is-func \n[doc-is-func-saved]
3405 .  nr doc-have-old-func \n[doc-have-old-func-saved]
3406 .  nr doc-func-arg-count \n[doc-func-arg-count-saved]
3407 .  ds doc-func-arg "\*[doc-func-arg-saved]
3408 .  nr doc-num-func-args \n[doc-num-func-args-saved]
3409 .  nr doc-func-args-processed \n[doc-func-args-processed-saved]
3410 .  nr doc-have-func \n[doc-have-func-saved]
3411 .  nr doc-is-reference \n[doc-is-reference-saved]
3412 .  nr doc-reference-count \n[doc-reference-count-saved]
3413 .  nr doc-author-count \n[doc-author-count-saved]
3415 .  nr doc-reg-drgv 0
3416 .  while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3417 .    ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3418 .    nr doc-reg-drgv +1
3419 .  \}
3421 .  nr doc-book-count \n[doc-book-count-saved]
3422 .  ds doc-book-name "\*[doc-book-name-saved]
3423 .  nr doc-date-count \n[doc-date-count-saved]
3424 .  ds doc-date "\*[doc-date-saved]
3425 .  nr doc-publisher-count \n[doc-publisher-count-saved]
3426 .  ds doc-publisher-name "\*[doc-publisher-name-saved]
3427 .  nr doc-journal-count \n[doc-journal-count-saved]
3428 .  ds doc-journal-name "\*[doc-journal-name-saved]
3429 .  nr doc-issue-count \n[doc-issue-count-saved]
3430 .  ds doc-issue-name "\*[doc-issue-name-saved]
3431 .  nr doc-optional-count \n[doc-optional-count-saved]
3432 .  ds doc-optional-string "\*[doc-optional-string-saved]
3433 .  nr doc-page-number-count \n[doc-page-number-count-saved]
3434 .  ds doc-page-number-string "\*[doc-page-number-string-saved]
3435 .  nr doc-corporate-count \n[doc-corporate-count-saved]
3436 .  ds doc-corporate-name "\*[doc-corporate-name-saved]
3437 .  nr doc-report-count \n[doc-report-count-saved]
3438 .  ds doc-report-name "\*[doc-report-name-saved]
3439 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
3440 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3441 .  ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
3442 .  nr doc-volume-count \n[doc-volume-count-saved]
3443 .  ds doc-volume-name "\*[doc-volume-name-saved]
3444 .  nr doc-have-author \n[doc-have-author-saved]
3446 .  ds doc-document-title "\*[doc-document-title-saved]
3447 .  ds doc-volume "\*[doc-volume-saved]
3448 .  ds doc-section "\*[doc-section-saved]
3449 .  ds doc-operating-system "\*[doc-operating-system-saved]
3450 .  ds doc-date-string "\*[doc-date-string-saved]
3451 .  nr doc-header-space \n[doc-header-space-saved]
3452 .  nr doc-footer-space \n[doc-footer-space-saved]
3453 .  nr doc-display-vertical \n[doc-display-vertical-saved]
3454 .  ds doc-header-string "\*[doc-header-string-saved]
3455 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3456 .  nr doc-in-files-section \n[doc-in-files-section-saved]
3457 .  nr doc-in-authors-section \n[doc-in-authors-section-saved]
3461 .\" NS El user macro
3462 .\" NS   end list
3463 .\" NS
3464 .\" NS modifies:
3465 .\" NS   doc-list-depth
3466 .\" NS   doc-macro-name
3467 .\" NS
3468 .\" NS local variables:
3469 .\" NS   doc-str-El
3470 .\" NS
3471 .\" NS width register `El' set in doc-common
3473 .de El
3474 .  if \n[.$] \{\
3475 .    tm Usage: .El (does not take arguments) (#\n[.c])
3476 .    return
3477 .  \}
3479 .  ds doc-macro-name El
3480 .  ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3482 .  ie        "\*[doc-str-El]"diag-list" \
3483 .    doc-end-list 0
3484 .  el \{ .ie "\*[doc-str-El]"column-list" \
3485 .    doc-end-column-list
3486 .  el \{ .ie "\*[doc-str-El]"item-list" \
3487 .    doc-end-list 0
3488 .  el \{ .ie "\*[doc-str-El]"ohang-list" \
3489 .    doc-end-list 0
3490 .  el \{ .ie "\*[doc-str-El]"inset-list" \
3491 .    doc-end-list 0
3492 .  el \
3493 .    doc-end-list 1
3494 .  \}\}\}\}
3496 .  br
3500 .\" NS doc-saved-Pa-font global string
3501 .\" NS   saved doc-Pa-font string for section FILES (no underline if
3502 .\" NS   nroff)
3504 .ds doc-saved-Pa-font
3507 .\" NS doc-curr-type global register
3508 .\" NS   current argument type
3510 .nr doc-curr-type 0
3513 .\" NS doc-curr-arg global string
3514 .\" NS   current argument
3516 .ds doc-curr-arg
3519 .\" NS doc-item-boxXXX global box
3520 .\" NS   item boxes associated list depth
3521 .\" NS
3522 .\" NS limit:
3523 .\" NS   doc-list-depth
3526 .\" NS It user macro
3527 .\" NS   list item
3528 .\" NS
3529 .\" NS modifies:
3530 .\" NS   doc-arg-ptr
3531 .\" NS   doc-argXXX
3532 .\" NS   doc-curr-arg
3533 .\" NS   doc-curr-type
3534 .\" NS   doc-in-list
3535 .\" NS   doc-macro-name
3536 .\" NS   doc-num-args
3537 .\" NS   doc-saved-Pa-font
3538 .\" NS
3539 .\" NS local variables:
3540 .\" NS   doc-reg-It
3541 .\" NS   doc-str-It
3542 .\" NS   doc-XXX-list-type
3543 .\" NS
3544 .\" NS width register `It' set in doc-common
3546 .nr doc-bullet-list-type 1
3547 .nr doc-column-list-type 0
3548 .nr doc-dash-list-type 1
3549 .nr doc-diag-list-type 0
3550 .nr doc-enum-list-type 1
3551 .nr doc-hang-list-type 2
3552 .nr doc-inset-list-type 2
3553 .nr doc-item-list-type 1
3554 .nr doc-ohang-list-type 2
3555 .nr doc-tag-list-type 2
3557 .de It
3558 .  ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3560 .  if "\*[doc-str-It]"" \
3561 .    tm mdoc error: .It without preceding .Bl (#\n[.c])
3563 .  if \n[doc-nesting-level] \{\
3564 .    tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
3565 .    tm1 " (#\n[.c])
3566 .  \}
3568 .  br
3569 .  if !\n[cR] \
3570 .    ne 3v
3572 .  if \n[.$] \{\
3573 .    ds doc-macro-name It
3575 .    \" fill argument vector
3576 .    nr doc-reg-It 1
3577 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3578 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3579 .      nr doc-reg-It +1
3580 .    \}
3582 .    nr doc-num-args \n[.$]
3583 .    nr doc-arg-ptr 0
3584 .  \}
3586 .  nr doc-reg-It \n[doc-\*[doc-str-It]-type]
3588 .  if \n[doc-reg-It] \{\
3589 .    \" start item box
3590 .    box doc-item-box\n[doc-list-depth]
3591 .    ev doc-item-env\n[doc-list-depth]
3592 .    evc 0
3593 .    in 0
3594 .    nf
3595 .  \}
3597 .  ie (\n[doc-reg-It] == 1) \{\
3598 .    if \n[.$] \{\
3599 .      tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3600 .      tm1 "              don't take arguments (#\n[.c])
3601 .  \}\}
3602 .  el \{\
3603 .    ie \n[.$] \{\
3604 .      if (\n[doc-reg-It] == 2) \{\
3605 .        \" handle list types with arguments
3606 .        doc-parse-arg-vector
3608 .        nr doc-in-list 1
3609 .        nr doc-arg-ptr 1
3610 .        nr doc-curr-type \n[doc-type1]
3611 .        ds doc-curr-arg "\*[doc-arg1]
3613 .        if \n[doc-in-files-section] \{\
3614 .          ds doc-saved-Pa-font "\*[doc-Pa-font]
3615 .          if n \
3616 .            ds doc-Pa-font "\*[doc-No-font]
3617 .        \}
3619 .        ie (\n[doc-type1] == 1) \
3620 .          \*[doc-arg1]
3621 .        el \{\
3622 .          nr doc-arg-ptr 1
3623 .          doc-print-recursive
3624 .    \}\}\}
3625 .    el \{\
3626 .      tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3627 .      tm1 "              require arguments (#\n[.c])
3628 .    \}
3629 .  \}
3631 .  \" the previous call of `.doc-print-recursive' can contain calls to
3632 .  \" opening requests like `.Ao'; we then defer the call of `doc-xxx-list'
3633 .  if !\n[doc-nesting-level] \
3634 .    doc-\*[doc-str-It]
3638 .\" NS doc-inset-list macro
3639 .\" NS   .It item of list-type inset
3640 .\" NS
3641 .\" NS modifies:
3642 .\" NS   doc-in-list
3644 .de doc-inset-list
3645 .  \" finish item box
3646 .  br
3647 .  ev
3648 .  box
3649 .  unformat doc-item-box\n[doc-list-depth]
3651 .  doc-set-vertical-and-indent 0
3652 .  br
3654 .  nh
3655 .  doc-item-box\n[doc-list-depth]
3657 .  nr doc-in-list 0
3658 .  doc-reset-args
3662 .\" NS doc-hang-list macro
3663 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3664 .\" NS
3665 .\" NS modifies:
3666 .\" NS   doc-have-space
3667 .\" NS   doc-in-list
3668 .\" NS
3669 .\" NS local variables:
3670 .\" NS   doc-reg-dhl
3671 .\" NS   doc-reg-dhl1
3673 .de doc-hang-list
3674 .  \" finish item box
3675 .  br
3676 .  ev
3677 .  box
3678 .  unformat doc-item-box\n[doc-list-depth]
3680 .  doc-set-vertical-and-indent 1
3681 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3682 .  ti -\n[doc-reg-dhl]u
3684 .  nh
3685 .  ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3686 .    doc-item-box\n[doc-list-depth]
3687 .  el \{\
3688 .    chop doc-item-box\n[doc-list-depth]
3689 .    nr doc-reg-dhl1 \n[.k]u
3690 .    nop \*[doc-item-box\n[doc-list-depth]]\c
3691 .    nop \h'|(\n[doc-reg-dhl1]u - \n[.k]u + \n[doc-reg-dhl]u)'\c
3692 .    nr doc-have-space 1
3693 .  \}
3695 .  nr doc-in-list 0
3696 .  doc-reset-args
3700 .\" NS doc-ohang-list macro
3701 .\" NS   .It item of list-type overhanging tag
3702 .\" NS
3703 .\" NS modifies:
3704 .\" NS   doc-in-list
3706 .de doc-ohang-list
3707 .  \" finish item box
3708 .  br
3709 .  ev
3710 .  box
3711 .  unformat doc-item-box\n[doc-list-depth]
3713 .  doc-set-vertical-and-indent 0
3714 .  nh
3715 .  doc-item-box\n[doc-list-depth]
3716 .  br
3718 .  nr doc-in-list 0
3719 .  doc-reset-args
3723 .\" NS doc-item-list macro
3724 .\" NS   .It item of list-type [empty tag]
3726 .de doc-item-list
3727 .  \" finish (dummy) item box
3728 .  br
3729 .  ev
3730 .  box
3732 .  doc-set-vertical-and-indent 0
3733 .  br
3735 .  doc-reset-args
3739 .\" NS doc-enum-list-count-stackXXX global register
3740 .\" NS   stack of current enum count values
3741 .\" NS
3742 .\" NS limit:
3743 .\" NS   doc-list-depth
3745 .nr doc-enum-list-count-stack1 0
3748 .\" NS doc-enum-list macro
3749 .\" NS   enumerated list
3750 .\" NS
3751 .\" NS modifies:
3752 .\" NS   doc-enum-list-count-stackXXX
3753 .\" NS   doc-in-list
3755 .de doc-enum-list
3756 .  nr doc-in-list 1
3757 .  nr doc-enum-list-count-stack\n[doc-list-depth] +1
3758 \# XXX
3759 \#.ll \n[doc-list-indent-stack\n[doc-list-depth]]u
3760 \#.rj
3761 .  nop \*[doc-tag-prefix-stack\n[doc-list-depth]]\c
3762 .  nop \n[doc-enum-list-count-stack\n[doc-list-depth]].\&
3763 .  doc-do-list
3767 .\" NS doc-bullet-list macro
3768 .\" NS   bullet paragraph list
3769 .\" NS
3770 .\" NS modifies:
3771 .\" NS   doc-in-list
3773 .de doc-bullet-list
3774 .  nr doc-in-list 1
3775 .  nop \)\*[doc-Sy-font]\[bu]\f[P]
3776 .  doc-do-list
3780 .\" NS doc-dash-list macro
3781 .\" NS   hyphen paragraph list (sub bullet list)
3782 .\" NS
3783 .\" NS modifies:
3784 .\" NS   doc-in-list
3786 .de doc-dash-list
3787 .  nr doc-in-list 1
3788 .  nop \)\*[doc-Sy-font]\-\f[P]
3789 .  doc-do-list
3793 .\" NS doc-do-list macro
3794 .\" NS   .It item of list-type enum/bullet/hyphen
3796 .als doc-do-list doc-hang-list
3799 .\" NS doc-diag-list-input-line-count global register
3800 .\" NS   saved line number to be checked in next diag-list item
3802 .nr doc-diag-list-input-line-count 0
3805 .\" NS doc-diag-list macro
3806 .\" NS   .It item of list-type diagnostic-message
3807 .\" NS
3808 .\" NS modifies:
3809 .\" NS   doc-curr-font
3810 .\" NS   doc-curr-size
3811 .\" NS   doc-diag-list-input-line-count
3813 .de doc-diag-list
3814 .  nr doc-curr-font \n[.f]
3815 .  nr doc-curr-size \n[.ps]
3817 .  ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \{\
3818 .    ie !\n[doc-compact-list-stack\n[doc-list-depth]] \
3819 .      doc-paragraph
3820 .    el \
3821 .      br
3822 .  \}
3823 .  el \
3824 .    br
3825 .  nr doc-diag-list-input-line-count \n[.c]
3827 .  nh
3828 .  nop \*[doc-Sy-font]\c
3829 .  if \n[doc-num-args] \
3830 .    doc-remaining-args
3831 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\*[doc-hard-space]\c
3833 .  doc-print-and-reset
3837 .\" NS doc-tag-list macro
3838 .\" NS   .It item of list-type `tag'
3839 .\" NS
3840 .\" NS modifies:
3841 .\" NS   doc-have-space
3842 .\" NS   doc-in-list
3843 .\" NS
3844 .\" NS local variables:
3845 .\" NS   doc-box-dtl
3846 .\" NS   doc-reg-dtl
3847 .\" NS   doc-reg-dtl1
3849 .de doc-tag-list
3850 .  \" finish item box
3851 .  br
3852 .  ev
3853 .  box
3854 .  unformat doc-item-box\n[doc-list-depth]
3856 .  \" we use a box without `.nf' to compute the tag width (via `dl' register)
3857 .  box doc-box-dtl
3858 .  ev doc-env-dtl
3859 .  evc 0
3860 .  fi
3861 .  ad 0
3862 .  in 0
3863 .  doc-item-box\n[doc-list-depth]
3864 .  br
3865 .  ev
3866 .  box
3868 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3869 .    if !\n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3870 .      in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3871 .      nr doc-list-have-indent-stack\n[doc-list-depth] 1
3872 .    \}
3873 .    doc-get-tag-width
3874 .  \}
3875 .  doc-set-vertical-and-indent 1
3876 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3877 .  ti -\n[doc-reg-dtl]u
3879 .  nh
3880 .  ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3881 .    doc-item-box\n[doc-list-depth]
3882 .    br
3883 .  \}
3884 .  el \{\
3885 .    chop doc-item-box\n[doc-list-depth]
3886 .    nr doc-reg-dtl1 \n[.k]u
3887 .    nop \*[doc-item-box\n[doc-list-depth]]\c
3888 .    nop \h'|(\n[doc-reg-dtl1]u - \n[.k]u + \n[doc-reg-dtl]u)'\c
3889 .    nr doc-have-space 1
3890 .  \}
3892 .  if \n[doc-in-files-section] \
3893 .    if n \
3894 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3896 .  nr doc-in-list 0
3897 .  doc-reset-args
3901 .\" NS doc-get-tag-width macro
3902 .\" NS   resolve unknown tag width (`tag' list-type only)
3903 .\" NS
3904 .\" NS modifies:
3905 .\" NS   doc-list-indent-stackXXX
3906 .\" NS   doc-tag-width-stackXXX
3907 .\" NS
3908 .\" NS requires:
3909 .\" NS   doc-curr-arg
3910 .\" NS   doc-curr-type
3912 .de doc-get-tag-width
3913 .  ie (\n[doc-curr-type] == 1) \{\
3914 .    ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
3915 .    nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
3916 .  \}
3917 .  el \{\
3918 .    ds doc-tag-width-stack\n[doc-list-depth] No
3919 .    nr doc-list-indent-stack\n[doc-list-depth] \n[No]
3920 .  \}
3924 .\" NS doc-set-vertical-and-indent macro
3925 .\" NS   set up vertical spacing (if not compact) and indentation (with
3926 .\" NS   offset if argument is non-zero)
3927 .\" NS
3928 .\" NS modifies:
3929 .\" NS   doc-list-have-indent-stackXXX
3931 .de doc-set-vertical-and-indent
3932 .  if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3933 .    sp \n[doc-display-vertical]u
3935 .  if \n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3936 .    nr doc-list-have-indent-stack\n[doc-list-depth] 0
3937 .    if \$1 \
3938 .      in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3939 .  \}
3941 .  if !\n[cR] \
3942 .    ne 2v
3946 .\" NS doc-list-depth global register
3947 .\" NS   list type stack counter
3949 .nr doc-list-depth 0
3952 .\" NS doc-num-columns global register
3953 .\" NS   number of columns
3955 .nr doc-num-columns 0
3958 .\" NS doc-compact-list-stackXXX global register (bool)
3959 .\" NS   stack of flags to indicate whether a particular list is compact
3960 .\" NS
3961 .\" NS limit:
3962 .\" NS   doc-list-depth
3964 .nr doc-compact-list-stack1 0
3967 .\" NS doc-tag-prefix-stackXXX global string
3968 .\" NS   stack of tag prefixes (currently used for -nested -enum lists)
3969 .\" NS
3970 .\" NS limit:
3971 .\" NS   doc-list-depth
3973 .ds doc-tag-prefix-stack1
3976 .\" NS doc-tag-width-stackXXX global string
3977 .\" NS   stack of strings indicating how to set up current element of
3978 .\" NS   doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
3979 .\" NS   directly; if it is a macro name, use the macro's width value;
3980 .\" NS   otherwise, `doc-get-tag-width' uses width value of `No'.
3981 .\" NS
3982 .\" NS limit:
3983 .\" NS   doc-list-depth
3985 .ds doc-tag-width-stack0
3986 .ds doc-tag-width-stack1
3989 .\" NS doc-list-offset-stackXXX global register
3990 .\" NS   stack of list offsets
3991 .\" NS
3992 .\" NS limit:
3993 .\" NS   doc-list-depth
3995 .nr doc-list-offset-stack1 0
3998 .\" NS doc-end-list macro
3999 .\" NS   list end function; resets indentation (and offset if argument is
4000 .\" NS   non-zero)
4001 .\" NS
4002 .\" NS modifies:
4003 .\" NS   doc-list-depth
4004 .\" NS   doc-list-offset-stackXXX
4006 .de doc-end-list
4007 .  if \$1 \
4008 '    in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4010 '  in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4012 .  if (\n[doc-list-depth] <= 0) \
4013 .    tm mdoc warning: extraneous .El call (#\n[.c])
4015 .  doc-decrement-list-stack
4016 .  nr doc-list-depth -1
4020 .\" NS doc-increment-list-stack macro
4021 .\" NS   set up next block for list
4022 .\" NS
4023 .\" NS modifies:
4024 .\" NS   doc-compact-list-stackXXX
4025 .\" NS   doc-list-have-indent-stackXXX
4026 .\" NS   doc-list-indent-stackXXX
4027 .\" NS   doc-list-offset-stackXXX
4028 .\" NS   doc-list-type-stackXXX
4029 .\" NS   doc-tag-prefix-stackXXX
4030 .\" NS   doc-tag-width-stackXXX
4031 .\" NS   doc-enum-list-count-stackXXX
4032 .\" NS
4033 .\" NS local variables:
4034 .\" NS   doc-reg-dils
4036 .de doc-increment-list-stack
4037 .  nr doc-reg-dils (\n[doc-list-depth] + 1)
4038 .  nr doc-list-have-indent-stack\n[doc-reg-dils] 0
4039 .  nr doc-list-indent-stack\n[doc-reg-dils] 0
4040 .  nr doc-list-offset-stack\n[doc-reg-dils] 0
4041 .  ds doc-tag-prefix-stack\n[doc-reg-dils]
4042 .  ds doc-tag-width-stack\n[doc-reg-dils] \*[doc-tag-width-stack\n[doc-list-depth]]
4043 .  ds doc-list-type-stack\n[doc-reg-dils]
4044 .  nr doc-compact-list-stack\n[doc-reg-dils] 0
4045 .  nr doc-enum-list-count-stack\n[doc-reg-dils] 0
4049 .\" NS doc-decrement-list-stack macro
4050 .\" NS   decrement stack
4051 .\" NS
4052 .\" NS modifies:
4053 .\" NS   doc-compact-list-stackXXX
4054 .\" NS   doc-list-have-indent-stackXXX
4055 .\" NS   doc-list-indent-stackXXX
4056 .\" NS   doc-list-offset-stackXXX
4057 .\" NS   doc-list-type-stackXXX
4058 .\" NS   doc-tag-prefix-stackXXX
4059 .\" NS   doc-tag-width-stackXXX
4060 .\" NS   doc-enum-list-count-stackXXX
4062 .de doc-decrement-list-stack
4063 .  ds doc-list-type-stack\n[doc-list-depth]
4064 .  nr doc-list-have-indent-stack\n[doc-list-depth] 0
4065 .  nr doc-list-indent-stack\n[doc-list-depth] 0
4066 .  nr doc-list-offset-stack\n[doc-list-depth] 0
4067 .  ds doc-tag-prefix-stack\n[doc-list-depth]
4068 .  ds doc-tag-width-stack\n[doc-list-depth]
4069 .  nr doc-compact-list-stack\n[doc-list-depth] 0
4070 .  nr doc-enum-list-count-stack\n[doc-list-depth] 0
4074 .\" NS Xr user macro
4075 .\" NS   cross reference (for man pages only)
4076 .\" NS
4077 .\" NS modifies:
4078 .\" NS   doc-arg-ptr
4079 .\" NS   doc-macro-name
4080 .\" NS
4081 .\" NS local variables:
4082 .\" NS   doc-reg-Xr
4083 .\" NS
4084 .\" NS width register `Xr' set in doc-common
4086 .de Xr
4087 .  if !\n[doc-arg-limit] \{\
4088 .    ie \n[.$] \{\
4089 .      ds doc-macro-name Xr
4090 .      doc-parse-args \$@
4091 .    \}
4092 .    el \
4093 .      doc-Xr-usage
4094 .  \}
4096 .  if !\n[doc-arg-limit] \
4097 .    return
4099 .  nr doc-arg-ptr +1
4100 .  doc-print-prefixes
4101 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4102 .    \" first argument must be a string
4103 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4104 .      nr doc-curr-font \n[.f]
4105 .      nr doc-curr-size \n[.ps]
4106 .      ds doc-arg\n[doc-arg-ptr] \*[doc-Xr-font]\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4108 .      if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4109 .        nr doc-reg-Xr (\n[doc-arg-ptr] + 1)
4110 .        \" modify second argument if it is a string and
4111 .        \" remove space inbetween
4112 .        if (\n[doc-type\n[doc-reg-Xr]] == 2) \{\
4113 .          ds doc-arg\n[doc-reg-Xr] \*[lp]\*[doc-arg\n[doc-reg-Xr]]\*[rp]
4114 .          ds doc-space\n[doc-arg-ptr]
4115 .        \}
4116 .      \}
4117 .      doc-print-recursive
4118 .    \}
4119 .    el \
4120 .      doc-Xr-usage
4121 .  \}
4122 .  el \
4123 .    doc-Xr-usage
4127 .\" NS doc-Xr-usage macro
4129 .de doc-Xr-usage
4130 .  tm Usage: .Xr manpage_name [section#] ... (#\n[.c])
4131 .  doc-reset-args
4135 .\" NS Sx user macro
4136 .\" NS   cross section reference
4137 .\" NS
4138 .\" NS width register `Sx' set in doc-common
4140 .als Sx doc-generic-macro
4141 .ds doc-Sx-usage section_header
4144 .\" NS doc-end-column-list macro
4145 .\" NS   column-list end-list
4146 .\" NS
4147 .\" NS modifies:
4148 .\" NS   doc-list-depth
4150 .de doc-end-column-list
4151 .  linetabs 0
4152 '  in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
4153 .  ta T .5i
4154 .  fi
4155 .  doc-decrement-list-stack
4156 .  nr doc-list-depth -1
4160 .\" NS doc-column-indent-width global register
4161 .\" NS   holds the indent width for a column list
4163 .nr doc-column-indent-width 0
4166 .\" NS doc-set-column-tab macro
4167 .\" NS   establish tabs for list-type column: `.doc-set-column-tab num_cols'
4168 .\" NS
4169 .\" NS modifies:
4170 .\" NS   doc-column-indent-width
4171 .\" NS
4172 .\" NS local variables:
4173 .\" NS   doc-reg-dsct
4174 .\" NS   doc-str-dsct
4175 .\" NS   doc-str-dsct1
4177 .de doc-set-column-tab
4178 .  ds doc-str-dsct
4179 .  nr doc-reg-dsct 1
4180 .  nr doc-column-indent-width 0
4182 .  ie (\$1 < 5) \
4183 .    ds doc-str-dsct1 "    \"
4184 .  el \{\
4185 .    ie (\$1 == 5) \
4186 .      ds doc-str-dsct1 "   \"
4187 .    el \{\
4188 .      \" XXX: this is packed abnormally close -- intercolumn width
4189 .      \"      should be configurable
4190 .      ds doc-str-dsct1 " \"
4191 .  \}\}
4193 .  while (\n[doc-reg-dsct] <= \$1) \{\
4194 .    as doc-str-dsct " +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4195 .    nr doc-column-indent-width +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4196 .    nr doc-reg-dsct +1
4197 .  \}
4199 .  ta \*[doc-str-dsct]
4200 '  in +\n[doc-column-indent-width]u
4204 .\" NS doc-column-list macro
4205 .\" NS   column items
4206 .\" NS
4207 .\" NS modifies:
4208 .\" NS   doc-arg-ptr
4209 .\" NS   doc-list-indent-stackXXX
4210 .\" NS   doc-spaceXXX
4211 .\" NS
4212 .\" NS local variables:
4213 .\" NS   doc-reg-dcl
4215 .de doc-column-list
4216 .  if \n[doc-num-args] \
4217 .    doc-parse-arg-vector
4218 .  nr doc-arg-ptr +1
4220 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4221 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4222 .    return
4223 .  \}
4225 .  if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4226 .    nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4227 .    ds doc-space\n[doc-reg-dcl]
4228 .  \}
4230 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4231 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4232 .  if !\n[.u] \{\
4233 .    fi
4234 '    in +\n[doc-column-indent-width]u
4235 .  \}
4236 .  ti -\n[doc-column-indent-width]u
4238 .  doc-do-\n[doc-type\n[doc-arg-ptr]]
4242 .\" NS Ta user macro
4243 .\" NS   append tab (\t)
4244 .\" NS
4245 .\" NS modifies:
4246 .\" NS   doc-arg-ptr
4247 .\" NS
4248 .\" NS width register `Ta' set in doc-common
4250 .de Ta
4251 .  ie \n[doc-arg-limit] \{\
4252 .    nr doc-arg-ptr +1
4253 .    nop \*[doc-tab]\c
4254 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4255 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
4256 .    el \
4257 .      doc-reset-args
4258 .  \}
4259 .  el \{\
4260 .    tm1 "Usage: Ta must follow column entry: e.g.
4261 .    tm1 "         .It column_string [Ta [column_string ...]] (#\n[.c])
4262 .  \}
4266 .\" NS Dl user macro
4267 .\" NS   display (one line) literal
4268 .\" NS
4269 .\" NS   this function uses the `Li' font
4270 .\" NS
4271 .\" NS modifies:
4272 .\" NS   doc-arg-ptr
4273 .\" NS   doc-curr-font
4274 .\" NS   doc-curr-size
4275 .\" NS   doc-macro-name
4276 .\" NS
4277 .\" NS width register `Dl' set in doc-common
4279 .de Dl
4280 '  ta T .5i
4281 .  in +\n[doc-display-indent]u
4283 .  ie \n[doc-arg-limit] \{\
4284 .    tm Usage: .Dl not callable by other macros (#\n[.c])
4285 .    doc-reset-args
4286 .  \}
4287 .  el \{\
4288 .    ie \n[.$] \{\
4289 .      ds doc-macro-name Dl
4290 .      doc-parse-args \$@
4291 .      nr doc-arg-ptr 1
4292 .      nr doc-curr-font \n[.f]
4293 .      nr doc-curr-size \n[.ps]
4294 .      nop \*[doc-Li-font]\c
4295 .      doc-print-recursive
4296 .    \}
4297 .    el \
4298 .      tm Usage: .Dl argument ... (#\n[.c])
4299 .  \}
4301 .  in -\n[doc-display-indent]u
4305 .\" NS D1 user macro
4306 .\" NS   display (one line)
4307 .\" NS
4308 .\" NS modifies:
4309 .\" NS   doc-arg-ptr
4310 .\" NS   doc-macro-name
4311 .\" NS
4312 .\" NS width register `D1' set in doc-common
4314 .de D1
4315 '  ta T .5i
4316 .  in +\n[doc-display-indent]u
4318 .  ie \n[doc-arg-limit] \{\
4319 .    tm Usage: .D1 not callable by other macros (#\n[.c])
4320 .    doc-reset-args
4321 .  \}
4322 .  el \{\
4323 .    ie \n[.$] \{\
4324 .      ds doc-macro-name D1
4325 .      doc-parse-args \$@
4326 .      nr doc-arg-ptr 1
4327 .      doc-print-recursive
4328 .    \}
4329 .    el \
4330 .      tm Usage: .D1 argument ... (#\n[.c])
4331 .  \}
4333 .  in -\n[doc-display-indent]u
4337 .\" NS Vt user macro
4338 .\" NS   variable type (for forcing old style variable declarations);
4339 .\" NS   this is not done in the same manner as .Ot for fortrash --
4340 .\" NS   clean up later
4341 .\" NS
4342 .\" NS modifies:
4343 .\" NS   doc-curr-font
4344 .\" NS   doc-curr-size
4345 .\" NS   doc-have-decl
4346 .\" NS   doc-have-var
4347 .\" NS   doc-macro-name
4348 .\" NS
4349 .\" NS width register `Vt' set in doc-common
4351 .de Vt
4352 .  if !\n[doc-arg-limit] \{\
4353 .    ie \n[.$] \{\
4354 .      ds doc-macro-name Vt
4355 .      doc-parse-args \$@
4356 .    \}
4357 .    el \
4358 .      tm Usage: .Vt variable_type ... (#\n[.c])
4359 .  \}
4361 .  if !\n[doc-arg-limit] \
4362 .    return
4364 .  nr doc-arg-ptr +1
4365 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4366 .    tm Usage: .Vt variable_type ... (#\n[.c])
4367 .    doc-reset-args
4368 .    return
4369 .  \}
4371 .  if \n[doc-in-synopsis-section] \{\
4372 .    \" if a function declaration was the last thing given,
4373 .    \" want vertical space
4374 .    if \n[doc-have-decl] \{\
4375 .      doc-paragraph
4376 .      nr doc-have-decl 0
4377 .    \}
4379 .    \" if a subroutine was the last thing given, want vertical space
4380 .    if \n[doc-have-func] \{\
4381 .      ie \n[doc-have-var] \
4382 .        br
4383 .      el \
4384 .        doc-paragraph
4385 .    \}
4387 .    nr doc-have-var 1
4388 .  \}
4390 .  nr doc-curr-font \n[.f]
4391 .  nr doc-curr-size \n[.ps]
4392 .  nop \*[doc-Ft-font]\c
4393 .  doc-print-recursive
4395 .  if \n[doc-in-synopsis-section] \{\
4396 .    ie \n[doc-have-old-func] \
4397 .      nop \*[doc-soft-space]\c
4398 .    el \
4399 .      br
4400 .  \}
4404 .\" NS doc-is-func global register (bool)
4405 .\" NS   set if subroutine (in synopsis only) (fortran only)
4407 .nr doc-is-func 0
4410 .\" NS Ft user macro
4411 .\" NS   function type
4412 .\" NS
4413 .\" NS modifies:
4414 .\" NS   doc-curr-font
4415 .\" NS   doc-curr-size
4416 .\" NS   doc-have-decl
4417 .\" NS   doc-have-var
4418 .\" NS   doc-is-func
4419 .\" NS   doc-macro-name
4420 .\" NS
4421 .\" NS width register `Ft' set in doc-common
4423 .de Ft
4424 .  if !\n[doc-arg-limit] \{\
4425 .    ie \n[.$] \{\
4426 .      ds doc-macro-name Ft
4427 .      doc-parse-args \$@
4428 .    \}
4429 .    el \
4430 .      tm Usage: .Ft function_type ... (#\n[.c])
4431 .  \}
4433 .  if !\n[doc-arg-limit] \
4434 .    return
4436 .  nr doc-arg-ptr +1
4437 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4438 .    tm Usage: .Ft function_type ... (#\n[.c])
4439 .    doc-reset-args
4440 .    return
4441 .  \}
4443 .  if \n[doc-in-synopsis-section] \{\
4444 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4445 .      doc-paragraph
4446 .      nr doc-have-decl 0
4447 .      nr doc-have-var 0
4448 .    \}
4450 .    if \n[doc-have-var] \{\
4451 .      doc-paragraph
4452 .      nr doc-have-var 0
4453 .    \}
4455 .    nr doc-is-func 1
4456 .  \}
4458 .  nr doc-curr-font \n[.f]
4459 .  nr doc-curr-size \n[.ps]
4460 .  nop \*[doc-Ft-font]\c
4461 .  doc-print-recursive
4465 .\" NS doc-have-old-func global register (bool)
4466 .\" NS   set if `Ot' has been called
4468 .nr doc-have-old-func 0
4471 .\" NS Ot user macro
4472 .\" NS   old function type (fortran -- no newline)
4473 .\" NS
4474 .\" NS modifies:
4475 .\" NS   doc-have-decl
4476 .\" NS   doc-have-old-func
4477 .\" NS   doc-have-var
4478 .\" NS   doc-is-func
4479 .\" NS
4480 .\" NS width register `Ot' set in doc-common
4482 .de Ot
4483 .  nr doc-have-old-func 1
4485 .  if \n[doc-in-synopsis-section] \{\
4486 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4487 .      doc-paragraph
4488 .      nr doc-have-decl 0
4489 .      nr doc-have-var 0
4490 .    \}
4492 .    if \n[doc-have-var] \{\
4493 .      doc-paragraph
4494 .      nr doc-have-var 0
4495 .    \}
4497 .    nr doc-is-func 1
4498 .  \}
4500 .  if \n[.$] \
4501 .    nop \*[doc-Ft-font]\$*\c
4502 .  nop \ \f[P]\c
4506 .\" NS Fa user macro
4507 .\" NS   function arguments
4508 .\" NS
4509 .\" NS modifies:
4510 .\" NS   doc-arg-ptr
4511 .\" NS   doc-curr-font
4512 .\" NS   doc-curr-size
4513 .\" NS   doc-macro-name
4514 .\" NS
4515 .\" NS width register `Fa' set in doc-common
4517 .de Fa
4518 .  if !\n[doc-arg-limit] \{\
4519 .    ie \n[.$] \{\
4520 .      ds doc-macro-name Fa
4521 .      doc-parse-args \$@
4522 .    \}
4523 .    el \
4524 .      tm Usage: .Fa function_arguments ... (#\n[.c])
4525 .  \}
4527 .  ie \n[doc-func-arg-count] \
4528 .    doc-do-func
4529 .  el \{\
4530 .    nr doc-arg-ptr +1
4531 .    if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4532 .      nr doc-curr-font \n[.f]
4533 .      nr doc-curr-size \n[.ps]
4534 .      nop \*[doc-Fa-font]\c
4535 .      doc-print-recursive
4537 .      if \n[doc-in-synopsis-section] \
4538 .        if \n[doc-have-func] \
4539 .          br
4540 .  \}\}
4544 .\" NS doc-func-arg-count global register
4545 .\" NS   how many function arguments have been processed so far
4547 .nr doc-func-arg-count 0
4550 .\" NS doc-func-arg global string
4551 .\" NS   work buffer for function name strings
4553 .ds doc-func-arg
4556 .\" NS doc-num-func-args global register
4557 .\" NS   number of function arguments
4559 .nr doc-num-func-args 0
4562 .\" NS doc-func-args-processed global register
4563 .\" NS   function arguments processed so far
4565 .nr doc-func-args-processed 0
4568 .\" NS doc-do-func macro
4569 .\" NS   internal .Fa for .Fc
4570 .\" NS
4571 .\" NS modifies:
4572 .\" NS   doc-arg-ptr
4573 .\" NS   doc-argXXX
4574 .\" NS   doc-func-arg
4575 .\" NS   doc-func-arg-count
4576 .\" NS   doc-func-args-processed
4577 .\" NS   doc-num-func-args
4579 .de doc-do-func
4580 .  if (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
4581 .    doc-reset-args
4582 .    return
4583 .  \}
4585 .  nr doc-arg-ptr +1
4587 .  ds doc-func-arg
4588 .  nr doc-num-func-args 0
4589 .  nr doc-func-args-processed 0
4591 .  doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4592 .  if (\n[doc-num-func-args] > 1) \
4593 .    ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4595 .  if (\n[doc-func-arg-count] > 1) \{\
4596 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\|,\)\c
4597 .    nop \)\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]\c
4598 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]\c
4599 .  \}
4601 .  if (\n[doc-func-arg-count] == 1) \{\
4602 .    nop \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]\c
4603 .    nop \f[P]\s[0]\c
4604 .  \}
4605 .  nr doc-func-arg-count +1
4606 .  doc-do-func
4610 .\" NS doc-have-func global register (bool)
4611 .\" NS   whether we have more than one function in synopsis
4613 .nr doc-have-func 0
4616 .\" NS Fn user macro
4617 .\" NS   functions
4618 .\" NS
4619 .\" NS modifies:
4620 .\" NS   doc-arg-ptr
4621 .\" NS   doc-curr-font
4622 .\" NS   doc-curr-size
4623 .\" NS   doc-have-decl
4624 .\" NS   doc-have-func
4625 .\" NS   doc-have-var
4626 .\" NS   doc-indent-synopsis
4627 .\" NS   doc-is-func
4628 .\" NS   doc-macro-name
4629 .\" NS
4630 .\" NS width register `Fn' set in doc-common
4632 .de Fn
4633 .  if !\n[doc-arg-limit] \{\
4634 .    ie \n[.$] \{\
4635 .      ds doc-macro-name Fn
4636 .      doc-parse-args \$@
4637 .    \}
4638 .    el \
4639 .      tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4640 .  \}
4642 .  if !\n[doc-arg-limit] \
4643 .    return
4645 .  if \n[doc-in-synopsis-section] \{\
4646 .    \" if there is/has been more than one subroutine declaration
4647 .    ie \n[doc-is-func] \{\
4648 .      br
4649 .      nr doc-have-var 0
4650 .      nr doc-have-decl 0
4651 .      nr doc-is-func 0
4652 .    \}
4653 .    el \{\
4654 .      if \n[doc-have-func] \{\
4655 .        doc-paragraph
4656 .        nr doc-have-var 0
4657 .        nr doc-have-decl 0
4658 .    \}\}
4660 .    if \n[doc-have-decl] \{\
4661 .      doc-paragraph
4662 .      nr doc-have-var 0
4663 .    \}
4665 .    if \n[doc-have-var] \{\
4666 .      doc-paragraph
4667 .      nr doc-have-decl 0
4668 .    \}
4670 .    nr doc-have-func 1
4671 .    nr doc-is-func 0
4673 .    br
4674 .    if !\n[doc-indent-synopsis] \
4675 .      nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4676 .    if !\n[doc-indent-synopsis-active] \
4677 .      in +\n[doc-indent-synopsis]u
4678 .    ti -\n[doc-indent-synopsis]u
4679 .  \}
4681 .  nr doc-arg-ptr +1
4682 .  doc-print-prefixes
4683 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4684 .    tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4685 .    doc-reset-args
4686 .    return
4687 .  \}
4689 .  nr doc-curr-font \n[.f]
4690 .  nr doc-curr-size \n[.ps]
4691 .  nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4692 .  nop \f[P]\s[0]\*[lp]\)\c
4694 .  nr doc-arg-ptr +1
4695 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4696 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4697 .      nop \*[doc-Fa-font]\c
4698 .      doc-do-func-args
4699 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
4700 .  \}\}
4702 .  nop \)\*[rp]\)\c
4703 .  if \n[doc-in-synopsis-section] \
4704 .    nop \);\)\c
4706 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4707 .    \" output the space (if needed)
4708 .    nr doc-arg-ptr -1
4709 .    nop \)\*[doc-space\n[doc-arg-ptr]]\c
4710 .    nr doc-arg-ptr +1
4712 .    doc-print-recursive
4713 .  \}
4714 .  el \
4715 .    doc-print-and-reset
4717 .  if \n[doc-in-synopsis-section] \
4718 .    if !\n[doc-indent-synopsis-active] \
4719 .      in -\n[doc-indent-synopsis]u
4723 .\" NS doc-do-func-args macro
4724 .\" NS   handle function arguments
4725 .\" NS
4726 .\" NS modifies:
4727 .\" NS   doc-arg-ptr
4728 .\" NS   doc-argXXX
4729 .\" NS   doc-func-arg
4730 .\" NS   doc-func-args-processed
4731 .\" NS   doc-num-func-args
4732 .\" NS
4733 .\" NS local variables:
4734 .\" NS   doc-reg-ddfa
4736 .de doc-do-func-args
4737 .  if \n[doc-in-synopsis-section] \{\
4738 .    ds doc-func-arg
4739 .    nr doc-num-func-args 0
4740 .    nr doc-func-args-processed 0
4742 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4743 .    if (\n[doc-num-func-args] > 1) \
4744 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4745 .  \}
4747 .  nop \)\*[doc-arg\n[doc-arg-ptr]]\c
4748 .  nr doc-arg-ptr +1
4750 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4751 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4752 .      nr doc-reg-ddfa (\n[doc-arg-ptr] - 1)
4753 .      nop \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]u],\)\c
4754 .      nop \)\*[doc-space\n[doc-reg-ddfa]]\f[P]\s[0]\|\c
4755 .      doc-do-func-args
4756 .  \}\}
4760 .\" NS doc-saved-nesting-level global register
4762 .nr doc-saved-nesting-level 0
4765 .\" NS doc-in-func-enclosure global register (bool)
4767 .nr doc-in-func-enclosure 0
4770 .\" NS Fo user macro
4771 .\" NS   function open
4772 .\" NS
4773 .\" NS modifies:
4774 .\" NS   doc-arg-ptr
4775 .\" NS   doc-curr-font
4776 .\" NS   doc-curr-size
4777 .\" NS   doc-func-arg-count
4778 .\" NS   doc-have-decl
4779 .\" NS   doc-have-func
4780 .\" NS   doc-have-var
4781 .\" NS   doc-in-func-enclosure
4782 .\" NS   doc-indent-synopsis
4783 .\" NS   doc-is-func
4784 .\" NS   doc-macro-name
4785 .\" NS   doc-saved-nesting-level
4786 .\" NS
4787 .\" NS width register `Fo' set in doc-common
4789 .de Fo
4790 .  if (\n[doc-in-func-enclosure]) \{\
4791 .    tm mdoc error: .Fo/.Fc can't be nested (#\n[.c])
4792 .    return
4793 .  \}
4795 .  nr doc-saved-nesting-level \n[doc-nesting-level]
4796 .  nr doc-in-func-enclosure 1
4798 .  if !\n[doc-arg-limit] \{\
4799 .    ie \n[.$] \{\
4800 .      ds doc-macro-name Fo
4801 .      doc-parse-args \$@
4802 .    \}
4803 .    el \
4804 .      tm Usage: .Fo function_name (#\n[.c])
4805 .  \}
4807 .  if \n[doc-in-synopsis-section] \{\
4808 .    \" if there is/has been more than one subroutine declaration
4809 .    ie \n[doc-is-func] \{\
4810 .      br
4811 .      nr doc-have-var 0
4812 .      nr doc-have-decl 0
4813 .      nr doc-is-func 0
4814 .    \}
4815 .    el \{\
4816 .      if \n[doc-have-func] \{\
4817 .        doc-paragraph
4818 .        nr doc-have-var 0
4819 .        nr doc-have-decl 0
4820 .    \}\}
4822 .    if \n[doc-have-decl] \{\
4823 .      doc-paragraph
4824 .      nr doc-have-var 0
4825 .    \}
4827 .    if \n[doc-have-var] \{\
4828 .      doc-paragraph
4829 .      nr doc-have-decl 0
4830 .    \}
4832 .    nr doc-have-func 1
4833 .    nr doc-is-func 0
4835 .    br
4836 .    if !\n[doc-indent-synopsis] \
4837 .      nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4838 .  \}
4840 .  \" start function box
4841 .  box doc-func-box
4842 .  ev doc-func-env
4843 .  evc 0
4844 .  in 0
4845 .  nf
4847 .  nr doc-arg-ptr +1
4848 .  doc-print-prefixes
4849 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4850 .    nr doc-func-arg-count 1
4851 .    nr doc-curr-font \n[.f]
4852 .    nr doc-curr-size \n[.ps]
4854 .    nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4855 .    nop \f[P]\s[0]\*[lp]\)\c
4856 .    doc-reset-args
4857 .  \}
4861 .\" NS Fc user macro
4862 .\" NS   function close
4863 .\" NS
4864 .\" NS modifies:
4865 .\" NS   doc-arg-ptr
4866 .\" NS   doc-func-arg-count
4867 .\" NS   doc-in-func-enclosure
4868 .\" NS   doc-saved-nesting-level
4869 .\" NS   doc-macro-name
4870 .\" NS
4871 .\" NS width register `Fc' set in doc-common
4873 .de Fc
4874 .  if !\n[doc-in-func-enclosure] \{\
4875 .    tm mdoc warning: Extraneous .Fc (#\n[.c])
4876 .    return
4877 .  \}
4879 .  if \n[.$] \{\
4880 .    ds doc-macro-name Fc
4881 .    \" the first (dummy) argument is used to get the correct spacing
4882 .    doc-parse-args \) \$@
4883 .  \}
4885 .  if !(\n[doc-saved-nesting-level] == \n[doc-nesting-level]) \
4886 .    tm mdoc warning: Unbalanced enclosure commands within .Fo/.Fc
4888 .  nr doc-func-arg-count 0
4889 .  nr doc-in-func-enclosure 0
4891 .  ie \n[doc-in-synopsis-section] \
4892 .    nop \|\*[rp];\)
4893 .  el \
4894 .    nop \|\*[rp]\)
4896 .  \" finish function box
4897 .  br
4898 .  ev
4899 .  box
4900 .  chop doc-func-box
4901 .  unformat doc-func-box
4903 .  if \n[doc-in-synopsis-section] \{\
4904 .    if !\n[doc-indent-synopsis-active] \
4905 .      in +\n[doc-indent-synopsis]u
4906 .    ti -\n[doc-indent-synopsis]u
4907 .  \}
4909 .  nh
4910 .  nop \*[doc-func-box]\c
4912 .  nr doc-arg-ptr +1
4913 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4914 .    nr doc-curr-font \n[.f]
4915 .    nr doc-curr-size \n[.ps]
4916 .    doc-print-recursive
4917 .  \}
4918 .  el \
4919 .    doc-print-and-reset
4921 .  if \n[doc-in-synopsis-section] \
4922 .    if !\n[doc-indent-synopsis-active] \
4923 .      in -\n[doc-indent-synopsis]u
4927 .\" NS doc-build-func-string macro
4928 .\" NS   collect function arguments and set hard spaces inbetween
4929 .\" NS
4930 .\" NS modifies:
4931 .\" NS   doc-func-arg
4932 .\" NS   doc-func-args-processed
4933 .\" NS   doc-num-func-args
4935 .de doc-build-func-string
4936 .  if !\n[doc-num-func-args] \{\
4937 .    nr doc-num-func-args \n[.$]
4938 .    nr doc-func-args-processed 0
4939 .    ds doc-func-arg
4940 .  \}
4942 .  nr doc-func-args-processed +1
4943 .  as doc-func-arg "\$1
4945 .  if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
4946 .    as doc-func-arg "\*[doc-hard-space]
4948 .    shift
4949 .    doc-build-func-string \$@
4950 .  \}
4954 .\" Very crude references: Stash all reference info into boxes, print out
4955 .\" reference on .Re request and clean up.  Ordering very limited, no fancy
4956 .\" citations, but can do articles, journals, and books -- need to add
4957 .\" several missing options (like city etc).  Should be able to grab a refer
4958 .\" entry, massage it a wee bit (prefix a `.' to the %[A-Z]) and not worry
4959 .\" (ha!).
4962 .\" NS doc-is-reference global register (bool)
4963 .\" NS   set if in reference
4965 .nr doc-is-reference 0
4968 .\" NS doc-reference-count global register
4969 .\" NS   reference element counter
4971 .nr doc-reference-count 0
4974 .\" NS Rs user macro
4975 .\" NS   reference start
4976 .\" NS
4977 .\" NS modifies:
4978 .\" NS   doc-is-reference
4979 .\" NS   doc-reference-count
4980 .\" NS
4981 .\" NS width register `Rs' set in doc-common
4983 .de Rs
4984 .  ie \n[.$] \
4985 .    tm Usage: .Rs (does not take arguments) (#\n[.c])
4986 .  el \{\
4987 .    nr doc-is-reference 1
4988 .    doc-reset-reference
4989 .    if \n[doc-in-see-also-section] \
4990 .      doc-paragraph
4991 .    nr doc-reference-count 0
4992 .  \}
4996 .\" NS Re user macro
4997 .\" NS   reference end
4998 .\" NS
4999 .\" NS modifies:
5000 .\" NS   doc-is-reference
5001 .\" NS
5002 .\" NS width register `Re' set in doc-common
5004 .de Re
5005 .  ie \n[.$] \
5006 .    tm Usage: .Re (does not take arguments) (#\n[.c])
5007 .  el \{\
5008 .    doc-print-reference
5009 .    doc-reset-reference
5010 .    nr doc-is-reference 0
5011 .  \}
5015 .\" NS doc-reset-reference macro
5016 .\" NS   reference cleanup
5017 .\" NS
5018 .\" NS modifies:
5019 .\" NS   doc-author-count
5020 .\" NS   doc-author-nameXXX
5021 .\" NS   doc-book-count
5022 .\" NS   doc-book-name
5023 .\" NS   doc-corporate-count
5024 .\" NS   doc-corporate-name
5025 .\" NS   doc-date
5026 .\" NS   doc-date-count
5027 .\" NS   doc-issue-count
5028 .\" NS   doc-issue-name
5029 .\" NS   doc-journal-count
5030 .\" NS   doc-journam-name
5031 .\" NS   doc-optional-count
5032 .\" NS   doc-optional-string
5033 .\" NS   doc-page-number-count
5034 .\" NS   doc-page-number-string
5035 .\" NS   doc-reference-title-count
5036 .\" NS   doc-reference-title-name
5037 .\" NS   doc-reference-title-name-for-book
5038 .\" NS   doc-report-count
5039 .\" NS   doc-report-name
5040 .\" NS   doc-volume-count
5041 .\" NS   doc-volume-name
5043 .de doc-reset-reference
5044 .  while (\n[doc-author-count]) \{\
5045 .    ds doc-author-name\n[doc-author-count]
5046 .    nr doc-author-count -1
5047 .  \}
5048 .  nr doc-journal-count 0
5049 .  nr doc-issue-count 0
5050 .  nr doc-optional-count 0
5051 .  nr doc-corporate-count 0
5052 .  nr doc-report-count 0
5053 .  nr doc-reference-title-count 0
5054 .  nr doc-volume-count 0
5055 .  nr doc-date-count 0
5056 .  nr doc-page-number-count 0
5057 .  nr doc-book-count 0
5059 .  ds doc-journal-name
5060 .  ds doc-issue-name
5061 .  ds doc-optional-string
5062 .  ds doc-corporate-name
5063 .  ds doc-report-name
5064 .  ds doc-reference-title-name
5065 .  ds doc-reference-title-name-for-book
5066 .  ds doc-volume-name
5067 .  ds doc-date
5068 .  ds doc-page-number-string
5069 .  ds doc-book-name
5073 .\" NS doc-finish-reference macro
5074 .\" NS   auxiliary macro for doc-print-reference
5075 .\" NS
5076 .\" NS modifies:
5077 .\" NS   doc-reference-count
5079 .de doc-finish-reference
5080 .  nr doc-reference-count -1
5081 .  ie \n[doc-reference-count] \
5082 .    nop \),
5083 .  el \
5084 .    nop \).
5088 .\" NS doc-print-reference macro
5089 .\" NS   reference print
5090 .\" NS
5091 .\" NS modifies:
5092 .\" NS   doc-reference-count
5094 .de doc-print-reference
5096 .  nh
5098 .  if \n[doc-author-count] \{\
5099 .    doc-print-reference-authors
5100 .    nr doc-reference-count -\n[doc-author-count]
5101 .  \}
5103 .  if \n[doc-reference-title-count] \{\
5104 .    unformat doc-reference-title-name
5105 .    chop doc-reference-title-name
5106 .    unformat doc-reference-title-name-for-book
5107 .    chop doc-reference-title-name-for-book
5108 .    ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5109 .      nop \)\*[q]\)\*[doc-reference-title-name-for-book]\)\*[q]\c
5110 .      doc-finish-reference
5111 .    \}
5112 .    el \{\
5113 .      nop \*[doc-reference-title-name]\c
5114 .      doc-finish-reference
5115 .  \}\}
5117 .  if \n[doc-book-count] \{\
5118 .    unformat doc-book-name
5119 .    chop doc-book-name
5120 .    nop \*[doc-book-name]\c
5121 .    doc-finish-reference
5122 .  \}
5124 .  if \n[doc-publisher-count] \{\
5125 .    unformat doc-publisher-name
5126 .    chop doc-publisher-name
5127 .    nop \*[doc-publisher-name]\c
5128 .    doc-finish-reference
5129 .  \}
5131 .  if \n[doc-journal-count] \{\
5132 .    unformat doc-journal-name
5133 .    chop doc-journal-name
5134 .    nop \*[doc-journal-name]\c
5135 .    doc-finish-reference
5136 .  \}
5138 .  if \n[doc-report-count] \{\
5139 .    unformat doc-report-name
5140 .    chop doc-report-name
5141 .    nop \*[doc-report-name]\c
5142 .    doc-finish-reference
5143 .  \}
5145 .  if \n[doc-issue-count] \{\
5146 .    unformat doc-issue-name
5147 .    chop doc-issue-name
5148 .    nop \*[doc-issue-name]\c
5149 .    doc-finish-reference
5150 .  \}
5152 .  if \n[doc-volume-count] \{\
5153 .    unformat doc-volume-name
5154 .    chop doc-volume-name
5155 .    nop \*[doc-volume-name]\c
5156 .    doc-finish-reference
5157 .  \}
5159 .  if \n[doc-page-number-count] \{\
5160 .    unformat doc-page-number-string
5161 .    chop doc-page-number-string
5162 .    nop \*[doc-page-number-string]\c
5163 .    doc-finish-reference
5164 .  \}
5166 .  if \n[doc-corporate-count] \{\
5167 .    unformat doc-corporate-name
5168 .    chop doc-corporate-name
5169 .    nop \*[doc-corporate-name]\c
5170 .    doc-finish-reference
5171 .  \}
5173 .  if \n[doc-date-count] \{\
5174 .    unformat doc-date
5175 .    chop doc-date
5176 .    nop \*[doc-date]\c
5177 .    doc-finish-reference
5178 .  \}
5180 .  if \n[doc-optional-count] \{\
5181 .    unformat doc-optional-string
5182 .    chop doc-optional-string
5183 .    nop \*[doc-optional-string]\c
5184 .    doc-finish-reference
5185 .  \}
5187 .  if \n[doc-reference-count] \
5188 .    tm mdoc warning: unresolved reference problem
5190 .  hy \n[doc-hyphen-flags]
5194 .\" NS doc-print-reference-authors macro
5195 .\" NS   print out reference authors
5196 .\" NS
5197 .\" NS local variables:
5198 .\" NS   doc-reg-dpra
5199 .\" NS   doc-str-dpra
5201 .ds doc-str-dpra "and
5203 .de doc-print-reference-authors
5204 .  nr doc-reg-dpra 1
5206 .  while (\n[doc-reg-dpra] < \n[doc-author-count]) \{\
5207 .    unformat doc-author-name\n[doc-reg-dpra]
5208 .    chop doc-author-name\n[doc-reg-dpra]
5209 .    ie (\n[doc-author-count] > 2) \
5210 .      nop \)\*[doc-author-name\n[doc-reg-dpra]],
5211 .    el \
5212 .      nop \)\*[doc-author-name\n[doc-reg-dpra]]
5213 .    nr doc-reg-dpra +1
5214 .  \}
5216 .  unformat doc-author-name\n[doc-reg-dpra]
5217 .  chop doc-author-name\n[doc-reg-dpra]
5218 .  if (\n[doc-author-count] > 1) \
5219 .    nop \)\*[doc-str-dpra]
5220 .  nop \)\*[doc-author-name\n[doc-reg-dpra]],
5224 .\" NS doc-author-count global register
5225 .\" NS   counter of author references
5227 .nr doc-author-count 0
5230 .\" NS doc-author-nameXXX global box
5231 .\" NS   array of author names
5232 .\" NS
5233 .\" NS limit:
5234 .\" NS   doc-author-count
5236 .ds doc-author-name0
5239 .\" NS %A user macro
5240 .\" NS   reference author(s)
5241 .\" NS
5242 .\" NS modifies:
5243 .\" NS   doc-arg-ptr
5244 .\" NS   doc-author-count
5245 .\" NS   doc-curr-font
5246 .\" NS   doc-curr-size
5247 .\" NS   doc-macro-name
5248 .\" NS   doc-reference-count
5249 .\" NS
5250 .\" NS local variables:
5251 .\" NS   doc-env-%A
5252 .\" NS
5253 .\" NS width register `%A' set in doc-common
5255 .de %A
5256 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5257 .    tm Usage: .%A author_name ... (#\n[.c])
5258 .    return
5259 .  \}
5261 .  nr doc-author-count +1
5262 .  nr doc-reference-count +1
5264 .  ds doc-macro-name %A
5265 .  doc-parse-args \$@
5267 .  nr doc-arg-ptr +1
5268 .  nr doc-curr-font \n[.f]
5269 .  nr doc-curr-size \n[.ps]
5271 .  \" save to reference box
5272 .  box doc-author-name\n[doc-author-count]
5273 .  ev doc-env-%A
5274 .  evc 0
5275 .  in 0
5276 .  nf
5277 .  doc-do-references
5281 .\" NS doc-book-count global register
5282 .\" NS   counter of book references
5284 .nr doc-book-count 0
5287 .\" NS doc-book-name global box
5288 .\" NS   string of collected book references
5290 .ds doc-book-name
5293 .\" NS %B user macro
5294 .\" NS   [reference] book name
5295 .\" NS
5296 .\" NS modifies:
5297 .\" NS   doc-arg-ptr
5298 .\" NS   doc-book-count
5299 .\" NS   doc-curr-font
5300 .\" NS   doc-curr-size
5301 .\" NS   doc-macro-name
5302 .\" NS   doc-reference-count
5303 .\" NS
5304 .\" NS local variables:
5305 .\" NS   doc-env-%B
5306 .\" NS
5307 .\" NS width register `%B' set in doc-common
5309 .de %B
5310 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5311 .    tm Usage: .%B book_name ... (#\n[.c])
5312 .    return
5313 .  \}
5315 .  if \n[doc-is-reference] \{\
5316 .    nr doc-book-count +1
5317 .    nr doc-reference-count +1
5318 .  \}
5320 .  ds doc-macro-name %B
5321 .  doc-parse-args \$@
5323 .  nr doc-arg-ptr +1
5324 .  nr doc-curr-font \n[.f]
5325 .  nr doc-curr-size \n[.ps]
5327 .  ie \n[doc-is-reference] \{\
5328 .    \" append to reference box
5329 .    boxa doc-book-name
5330 .    ev doc-env-%B
5331 .    evc 0
5332 .    in 0
5333 .    nf
5334 .    nop \*[doc-Em-font]\c
5335 .    doc-do-references
5336 .  \}
5337 .  el \{\
5338 .    nop \*[doc-Em-font]\c
5339 .    doc-print-recursive
5340 .  \}
5344 .\" NS doc-date-count global register
5345 .\" NS   counter of date references
5347 .nr doc-date-count 0
5350 .\" NS doc-date global box
5351 .\" NS   string of collected date references
5353 .ds doc-date
5356 .\" NS %D user macro
5357 .\" NS   [reference] date
5358 .\" NS
5359 .\" NS modifies:
5360 .\" NS   doc-arg-ptr
5361 .\" NS   doc-curr-font
5362 .\" NS   doc-curr-size
5363 .\" NS   doc-date-count
5364 .\" NS   doc-macro-name
5365 .\" NS   doc-reference-count
5366 .\" NS
5367 .\" NS local variables:
5368 .\" NS   doc-env-%D
5369 .\" NS
5370 .\" NS width register `%D' set in doc-common
5372 .de %D
5373 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5374 .    tm Usage: .%D date ... (#\n[.c])
5375 .    return
5376 .  \}
5378 .  nr doc-date-count +1
5379 .  nr doc-reference-count +1
5381 .  ds doc-macro-name %D
5382 .  doc-parse-args \$@
5384 .  nr doc-arg-ptr +1
5385 .  nr doc-curr-font \n[.f]
5386 .  nr doc-curr-size \n[.ps]
5388 .  \" append to reference box
5389 .  boxa doc-date
5390 .  ev doc-env-%D
5391 .  evc 0
5392 .  in 0
5393 .  nf
5394 .  doc-do-references
5398 .\" NS doc-publisher-count global register
5399 .\" NS   counter of publisher references
5401 .nr doc-publisher-count 0
5404 .\" NS doc-publisher-name global box
5405 .\" NS   string of collected publisher references
5407 .ds doc-publisher-name
5410 .\" NS %I user macro
5411 .\" NS   [reference] issuer/publisher name
5412 .\" NS
5413 .\" NS modifies:
5414 .\" NS   doc-arg-ptr
5415 .\" NS   doc-curr-font
5416 .\" NS   doc-curr-size
5417 .\" NS   doc-macro-name
5418 .\" NS   doc-publisher-count
5419 .\" NS   doc-reference-count
5420 .\" NS
5421 .\" NS local variables:
5422 .\" NS   doc-env-%I
5423 .\" NS
5424 .\" NS width register `%I' set in doc-common
5426 .de %I
5427 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5428 .    tm Usage: .%I issuer/publisher_name ... (#\n[.c])
5429 .    return
5430 .  \}
5432 .  nr doc-publisher-count +1
5433 .  nr doc-reference-count +1
5435 .  ds doc-macro-name %I
5436 .  doc-parse-args \$@
5438 .  nr doc-arg-ptr +1
5439 .  nr doc-curr-font \n[.f]
5440 .  nr doc-curr-size \n[.ps]
5442 .  \" append to reference box
5443 .  boxa doc-publisher-name
5444 .  ev doc-env-%I
5445 .  evc 0
5446 .  in 0
5447 .  nf
5448 .  nop \*[doc-Em-font]\c
5449 .  doc-do-references
5453 .\" NS doc-journal-count global register
5454 .\" NS   counter of journal references
5456 .nr doc-journal-count 0
5459 .\" NS doc-journal-name global box
5460 .\" NS   string of collected journal references
5462 .ds doc-journal-name
5465 .\" NS %J user macro
5466 .\" NS   [reference] Journal Name
5467 .\" NS
5468 .\" NS modifies:
5469 .\" NS   doc-arg-ptr
5470 .\" NS   doc-curr-font
5471 .\" NS   doc-curr-size
5472 .\" NS   doc-journal-count
5473 .\" NS   doc-macro-name
5474 .\" NS   doc-reference-count
5475 .\" NS
5476 .\" NS local variables:
5477 .\" NS   doc-env-%J
5478 .\" NS
5479 .\" NS width register `%J' set in doc-common
5481 .de %J
5482 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5483 .    tm Usage: .%J journal_name ... (#\n[.c])
5484 .    return
5485 .  \}
5487 .  nr doc-journal-count +1
5488 .  nr doc-reference-count +1
5490 .  ds doc-macro-name %J
5491 .  doc-parse-args \$@
5493 .  nr doc-arg-ptr +1
5494 .  nr doc-curr-font \n[.f]
5495 .  nr doc-curr-size \n[.ps]
5497 .  \" append to reference box
5498 .  boxa doc-journal-name
5499 .  ev doc-env-%J
5500 .  evc 0
5501 .  in 0
5502 .  nf
5503 .  nop \*[doc-Em-font]\c
5504 .  doc-do-references
5508 .\" NS doc-issue-count global register
5509 .\" NS   counter of issue number references
5511 .nr doc-issue-count 0
5514 .\" NS doc-issue-name global box
5515 .\" NS   string of collected issue number references
5517 .ds doc-issue-name
5520 .\" NS %N user macro
5521 .\" NS   [reference] issue number
5522 .\" NS
5523 .\" NS modifies:
5524 .\" NS   doc-arg-ptr
5525 .\" NS   doc-curr-font
5526 .\" NS   doc-curr-size
5527 .\" NS   doc-issue-count
5528 .\" NS   doc-macro-name
5529 .\" NS   doc-reference-count
5530 .\" NS
5531 .\" NS local variables:
5532 .\" NS   doc-env-%N
5533 .\" NS
5534 .\" NS width register `%N' set in doc-common
5536 .de %N
5537 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5538 .    tm Usage: .%N issue_number ... (#\n[.c])
5539 .    return
5540 .  \}
5542 .  nr doc-issue-count +1
5543 .  nr doc-reference-count +1
5545 .  ds doc-macro-name %N
5546 .  doc-parse-args \$@
5548 .  nr doc-arg-ptr +1
5549 .  nr doc-curr-font \n[.f]
5550 .  nr doc-curr-size \n[.ps]
5552 .  \" append to reference box
5553 .  boxa doc-issue-name
5554 .  ev doc-env-%N
5555 .  evc 0
5556 .  in 0
5557 .  nf
5558 .  doc-do-references
5562 .\" NS doc-optional-count global register
5563 .\" NS   counter of optional information references
5565 .nr doc-optional-count 0
5568 .\" NS doc-optional-string global box
5569 .\" NS   string of collected optional information references
5571 .ds doc-optional-string
5574 .\" NS %O user macro
5575 .\" NS   [reference] optional information
5576 .\" NS
5577 .\" NS modifies:
5578 .\" NS   doc-arg-ptr
5579 .\" NS   doc-curr-font
5580 .\" NS   doc-curr-size
5581 .\" NS   doc-macro-name
5582 .\" NS   doc-optional-count
5583 .\" NS   doc-reference-count
5584 .\" NS
5585 .\" NS local variables:
5586 .\" NS   doc-env-%O
5587 .\" NS
5588 .\" NS width register `%O' set in doc-common
5590 .de %O
5591 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5592 .    tm Usage: .%O optional_information ... (#\n[.c])
5593 .    return
5594 .  \}
5596 .  nr doc-optional-count +1
5597 .  nr doc-reference-count +1
5599 .  ds doc-macro-name %O
5600 .  doc-parse-args \$@
5602 .  nr doc-arg-ptr +1
5603 .  nr doc-curr-font \n[.f]
5604 .  nr doc-curr-size \n[.ps]
5606 .  \" append to reference box
5607 .  boxa doc-optional-string
5608 .  ev doc-env-%O
5609 .  evc 0
5610 .  in 0
5611 .  nf
5612 .  doc-do-references
5616 .\" NS doc-page-number-count global register
5617 .\" NS   counter of page number references
5619 .nr doc-page-number-count 0
5622 .\" NS doc-page-number-string global box
5623 .\" NS   string of collected page number references
5625 .ds doc-page-number-string
5628 .\" NS %P user macro
5629 .\" NS   [reference] page numbers
5630 .\" NS
5631 .\" NS modifies:
5632 .\" NS   doc-arg-ptr
5633 .\" NS   doc-curr-font
5634 .\" NS   doc-curr-size
5635 .\" NS   doc-macro-name
5636 .\" NS   doc-page-number-count
5637 .\" NS   doc-reference-count
5638 .\" NS
5639 .\" NS local variables:
5640 .\" NS   doc-env-%P
5641 .\" NS
5642 .\" NS width register `%P' set in doc-common
5644 .de %P
5645 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5646 .    tm Usage: .%P page_number ... (#\n[.c])
5647 .    return
5648 .  \}
5650 .  nr doc-page-number-count +1
5651 .  nr doc-reference-count +1
5653 .  ds doc-macro-name %P
5654 .  doc-parse-args \$@
5656 .  nr doc-arg-ptr +1
5657 .  nr doc-curr-font \n[.f]
5658 .  nr doc-curr-size \n[.ps]
5660 .  \" append to reference box
5661 .  boxa doc-page-number-string
5662 .  ev doc-env-%P
5663 .  evc 0
5664 .  in 0
5665 .  nf
5666 .  doc-do-references
5670 .\" NS doc-corporate-count global register
5671 .\" NS   counter of corporate references
5673 .nr doc-corporate-count 0
5676 .\" NS doc-corporate-name global box
5677 .\" NS   string of collected corporate references
5679 .ds doc-corporate-name
5682 .\" NS %Q user macro
5683 .\" NS   corporate or foreign author
5684 .\" NS
5685 .\" NS modifies:
5686 .\" NS   doc-arg-ptr
5687 .\" NS   doc-corporate-count
5688 .\" NS   doc-curr-font
5689 .\" NS   doc-curr-size
5690 .\" NS   doc-macro-name
5691 .\" NS   doc-reference-count
5692 .\" NS
5693 .\" NS local variables:
5694 .\" NS   doc-env-%Q
5695 .\" NS
5696 .\" NS width register `%Q' set in doc-common
5698 .de %Q
5699 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5700 .    tm Usage: .%Q corporate_or_foreign_author ... (#\n[.c])
5701 .    return
5702 .  \}
5704 .  nr doc-corporate-count +1
5705 .  nr doc-reference-count +1
5707 .  ds doc-macro-name %Q
5708 .  doc-parse-args \$@
5710 .  nr doc-arg-ptr +1
5711 .  nr doc-curr-font \n[.f]
5712 .  nr doc-curr-size \n[.ps]
5714 .  \" append to reference box
5715 .  boxa doc-corporate-name
5716 .  ev doc-env-%Q
5717 .  evc 0
5718 .  in 0
5719 .  nf
5720 .  doc-do-references
5724 .\" NS doc-report-count global register
5725 .\" NS   counter of report references
5727 .nr doc-report-count 0
5730 .\" NS doc-report-name global box
5731 .\" NS   string of collected report references
5733 .ds doc-report-name
5736 .\" NS %R user macro
5737 .\" NS   [reference] report name
5738 .\" NS
5739 .\" NS modifies:
5740 .\" NS   doc-arg-ptr
5741 .\" NS   doc-curr-font
5742 .\" NS   doc-curr-size
5743 .\" NS   doc-macro-name
5744 .\" NS   doc-reference-count
5745 .\" NS   doc-report-count
5746 .\" NS
5747 .\" NS local variables:
5748 .\" NS   doc-env-%R
5749 .\" NS
5750 .\" NS width register `%R' set in doc-common
5752 .de %R
5753 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5754 .    tm Usage: .%R reference_report ... (#\n[.c])
5755 .    return
5756 .  \}
5758 .  nr doc-report-count +1
5759 .  nr doc-reference-count +1
5761 .  ds doc-macro-name %R
5762 .  doc-parse-args \$@
5764 .  nr doc-arg-ptr +1
5765 .  nr doc-curr-font \n[.f]
5766 .  nr doc-curr-size \n[.ps]
5768 .  \" append to reference box
5769 .  boxa doc-report-name
5770 .  ev doc-env-%R
5771 .  evc 0
5772 .  in 0
5773 .  nf
5774 .  doc-do-references
5778 .\" NS doc-reference-title-count global register
5779 .\" NS   counter of reference title references
5781 .nr doc-reference-title-count 0
5784 .\" NS doc-reference-title-name global box
5785 .\" NS   string of collected reference title references
5787 .ds doc-reference-title-name
5790 .\" NS doc-reference-title-name-for-book global box
5791 .\" NS   string of collected reference title references
5792 .\" NS   (saved with another font; this is a shortcoming of groff)
5794 .ds doc-reference-title-name-for-book
5797 .\" NS %T user macro
5798 .\" NS   reference title
5799 .\" NS
5800 .\" NS modifies:
5801 .\" NS   doc-arg-ptr
5802 .\" NS   doc-curr-font
5803 .\" NS   doc-curr-size
5804 .\" NS   doc-macro-name
5805 .\" NS   doc-reference-title-count
5806 .\" NS   doc-report-count
5807 .\" NS
5808 .\" NS local variables:
5809 .\" NS   doc-env-%T
5810 .\" NS
5811 .\" NS width register `%T' set in doc-common
5813 .de %T
5814 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5815 .    tm Usage: .%T reference_title ... (#\n[.c])
5816 .    return
5817 .  \}
5819 .  if \n[doc-is-reference] \{\
5820 .    nr doc-reference-title-count +1
5821 .    nr doc-reference-count +1
5822 .  \}
5824 .  ds doc-macro-name %T
5825 .  doc-parse-args \$@
5827 .  nr doc-arg-ptr +1
5828 .  nr doc-curr-font \n[.f]
5829 .  nr doc-curr-size \n[.ps]
5830 .  ie \n[doc-is-reference] \{\
5831 .    \" append to reference box
5832 .    boxa doc-reference-title-name-for-book
5833 .    ev doc-env-%T
5834 .    evc 0
5835 .    in 0
5836 .    nf
5837 .    nop \*[doc-No-font]\c
5838 .    doc-do-references
5840 .    \" do it a second time with another font
5841 .    ds doc-macro-name %T
5842 .    doc-parse-args \$@
5844 .    nr doc-arg-ptr +1
5845 .    nr doc-curr-font \n[.f]
5846 .    nr doc-curr-size \n[.ps]
5847 .    boxa doc-reference-title-name
5848 .    ev doc-env-%T
5849 .    evc 0
5850 .    in 0
5851 .    nf
5852 .    nop \*[doc-Em-font]\c
5853 .    doc-do-references
5854 .  \}
5855 .  el \{\
5856 .    nop \*[doc-Em-font]\c
5857 .    doc-print-recursive
5858 .  \}
5862 .\" NS doc-volume-count global register
5863 .\" NS   counter of reference title references
5865 .nr doc-volume-count 0
5868 .\" NS doc-volume-name global box
5869 .\" NS   string of collected volume references
5871 .ds doc-volume-name
5874 .\" NS %V user macro
5875 .\" NS   reference volume
5876 .\" NS
5877 .\" NS modifies:
5878 .\" NS   doc-arg-ptr
5879 .\" NS   doc-curr-font
5880 .\" NS   doc-curr-size
5881 .\" NS   doc-macro-name
5882 .\" NS   doc-reference-title-count
5883 .\" NS   doc-volume-count
5884 .\" NS
5885 .\" NS local variables:
5886 .\" NS   doc-env-%V
5887 .\" NS
5888 .\" NS width register `%V' set in doc-common
5890 .de %V
5891 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5892 .    tm Usage: .%V volume ... (#\n[.c])
5893 .    return
5894 .  \}
5896 .  nr doc-volume-count +1
5897 .  nr doc-reference-count +1
5899 .  ds doc-macro-name %V
5900 .  doc-parse-args \$@
5902 .  nr doc-arg-ptr +1
5903 .  nr doc-curr-font \n[.f]
5904 .  nr doc-curr-size \n[.ps]
5906 .  \" append to reference box
5907 .  boxa doc-volume-name
5908 .  ev doc-env-%V
5909 .  evc 0
5910 .  in 0
5911 .  nf
5912 .  doc-do-references
5916 .\" NS doc-do-references macro
5917 .\" NS   reference recursion routine
5918 .\" NS
5919 .\" NS modifies:
5920 .\" NS   doc-arg-ptr
5921 .\" NS
5922 .\" NS local variables:
5923 .\" NS   doc-reg-ddr
5924 .\" NS   doc-reg-ddr1
5926 .de doc-do-references
5927 .  if !\n[doc-is-reference] \
5928 .    tm mdoc error: .\*[doc-macro-name] found outside of .Rs ... .Re (#\n[.c])
5930 .  nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
5932 .  ie (\n[doc-reg-ddr1] == 1) \{\
5933 .    \" .nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
5934 .    doc-append-arg \c 3
5935 .    \*[doc-arg\n[doc-arg-ptr]]
5936 .  \}
5937 .  el \{\
5938 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\c
5940 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
5941 .      \" finish reference box
5942 .      br
5943 .      ev
5944 .      boxa
5946 .      doc-reset-args
5947 .    \}
5948 .    el \{\
5949 .      nr doc-reg-ddr \n[doc-arg-ptr]
5950 .      nr doc-arg-ptr +1
5951 .      nop \)\*[doc-space\n[doc-reg-ddr]]\c
5952 .      doc-do-references
5953 .  \}\}
5957 .\" NS Hf user macro
5958 .\" NS   source include header files.
5959 .\" NS
5960 .\" NS modifies:
5961 .\" NS   doc-curr-font
5962 .\" NS   doc-curr-size
5963 .\" NS
5964 .\" NS width register `Hf' set in doc-common
5966 .de Hf
5967 .  ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
5968 .    doc-paragraph
5969 .    nop File:
5970 .    Pa \$1
5972 .    Bd -literal
5973 .    so \$1
5974 .    Ed
5976 .    doc-paragraph
5977 .  \}
5978 .  el \
5979 .    Usage: .Hf file (#\n[.c])
5983 .\" NS doc-have-author global register (bool)
5984 .\" NS   set in `An'
5986 .nr doc-have-author 0
5989 .\" NS An user macro
5990 .\" NS   author name
5991 .\" NS
5992 .\" NS modifies:
5993 .\" NS   doc-arg-ptr
5994 .\" NS   doc-curr-font
5995 .\" NS   doc-curr-size
5996 .\" NS   doc-have-author
5997 .\" NS   doc-macro-name
5998 .\" NS
5999 .\" NS width register `An' set in doc-common
6001 .de An
6002 .  if !\n[doc-arg-limit] \{\
6003 .    ie \n[.$] \{\
6004 .      ie        "\$1"-nosplit" \
6005 .        nr doc-in-authors-section 0
6006 .      el \{ .ie "\$1"-split" \
6007 .        nr doc-in-authors-section 1
6008 .      el \{\
6009 .        ds doc-macro-name An
6010 .        doc-parse-args \$@
6011 .    \}\}\}
6012 .    el \{\
6013 .      tm1 "Usage: .An {-nosplit | -split}
6014 .      tm1         .An author_name ... (#\n[.c])
6015 .  \}\}
6017 .  if \n[doc-in-authors-section] \{\
6018 .    ie \n[doc-have-author] \
6019 .      br
6020 .    el \
6021 .      nr doc-have-author 1
6022 .  \}
6024 .  if \n[doc-arg-limit] \{\
6025 .    nr doc-arg-ptr +1
6026 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
6027 .      nr doc-curr-font \n[.f]
6028 .      nr doc-curr-size \n[.ps]
6029 .      doc-print-recursive
6030 .    \}
6031 .    el \{\
6032 .      tm Usage: .An author_name ... (#\n[.c])
6033 .      doc-reset-args
6034 .  \}\}
6038 .\" NS Rv user macro
6039 .\" NS   return values
6040 .\" NS
6041 .\" NS width register `Rv' set in doc-common
6042 .\" NS
6043 .\" NS local variables:
6044 .\" NS   doc-str-Rv-prefix
6045 .\" NS   doc-str-Rv-suffix
6047 .ds doc-str-Rv-prefix "The
6048 .ds doc-str-Rv-suffix "function returns the value\~0 if successful;
6049 .as doc-str-Rv-suffix " otherwise the value\~-1 is returned and
6050 .as doc-str-Rv-suffix " the global variable \*[doc-Va-font]errno\f[P]
6051 .as doc-str-Rv-suffix " is set to indicate the error.
6053 .de Rv
6055 .\" XXX: what does this function without `-std'?
6057 .  if !\n[.$] \{\
6058 .    tm Usage: .Rv [-std] (#\n[.c])
6059 .    return
6060 .  \}
6062 .  \" .ds doc-macro-name Rv
6063 .  \" .nr doc-arg-ptr 0
6064 .  \" .nr lR +1
6065 .  \" .ds doc-arg1 \$2
6066 .  \" .ds doc-arg2 \$3
6067 .  \" .ds doc-arg3 \$4
6068 .  \" .ds doc-arg4 \$5
6069 .  \" .ds doc-arg5 \$6
6070 .  \" .ds doc-arg6 \$7
6071 .  \" .ds doc-arg7 \$8
6072 .  \" .ds doc-arg8 \$9
6073 .  \" .
6074 .  \" .nr doc-num-args (\n[.$] - 1)
6076 .  if "\$1"-std" \{\
6077 .    nr doc-reg-Rv \*[doc-section]
6078 .    if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
6079 .      tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
6080 .    br
6081 .    nop \)\*[doc-str-Rv-prefix]
6082 .    Fn \$2
6083 .    nop \)\*[doc-str-Rv-suffix]
6084 .  \}
6088 .\" NS Mt user macro
6089 .\" NS   mailto (for conversion to HTML)
6091 .de Mt
6092 .  \" XXX: error handling missing
6093 .  Pa \$@
6097 .\" NS Lk user macro
6098 .\" NS   link (for conversion to HTML)
6099 .\" NS
6100 .\" NS local variables:
6101 .\" NS   doc-reg-Lk
6102 .\" NS   doc-str-Lk
6104 .de Lk
6105 .  ds doc-str-Lk Sy \$@
6107 .  ie (\n[.$] > 1) \{\
6108 .    doc-get-arg-type \$2
6109 .    ie (\n[doc-arg-type] < 3) \{\
6110 .      Em \)\$2:
6111 .      ds doc-str-Lk Sy "\$1"
6112 .      doc-get-width "\$1"
6113 .      shift 2
6114 .      if \n[.$] \
6115 .        as doc-str-Lk " \$@
6116 .    \}
6117 .    el \
6118 .      doc-get-width "\$1"
6119 .  \}
6120 .  el \
6121 .    doc-get-width "\$1"
6123 .  ie n \
6124 .    nr doc-reg-Lk 26
6125 .  el \
6126 .    nr doc-reg-Lk 38
6127 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
6128 .    D1 \*[doc-str-Lk]
6129 .  el \
6130 .    \*[doc-str-Lk]
6134 .\" NS doc-defunct-macro macro
6135 .\" NS   this is the skeleton for defunct macros
6136 .\" NS
6138 .de doc-defunct-macro
6139 .  tmc mdoc error: .\$0 defunct
6140 .  if d doc-\$0-usage \
6141 .    tmc , \*[doc-\$0-usage]
6142 .  tm1 " (#\n[.c])
6146 .\" obsolete macros
6148 .als Db doc-defunct-macro
6150 .als Ds doc-defunct-macro
6152 .als Ex doc-defunct-macro
6153 .ds doc-Ex-usage use .D1
6155 .als Or doc-defunct-macro
6156 .ds doc-Or-usage use `|'
6158 .als Sf doc-defunct-macro
6159 .ds doc-Sf-usage use .Pf or .Ns
6162 .rn em e@
6164 .de em
6165 .  tm1 "mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
6166 .  tm1 "            Should this have been `.Em ...'?
6167 .  ab
6171 .\" NS doc-empty-line macro
6172 .\" NS   emit warning and print empty line
6174 .de doc-empty-line
6175 .  if !\n[doc-display-depth] \
6176 .    tm mdoc warning: Empty input line #\n[.c]
6177 .  sp
6180 .blm doc-empty-line
6186 .\" load local modifications
6187 .mso mdoc.local
6189 .\" EOF