Fixes from Ruslan. See ChangeLog.
[s-roff.git] / tmac / doc.tmac
blob861c74b489b7f10a13bebef84e414ab675175a96
1 .\" Copyright (c) 1991 The Regents of the University of California.
2 .\" 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 5.8 (Berkeley) 8/5/91
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 Db macro
75 .\" NS   defunct
77 .de Db
78 .  tm mdoc error: .Db defunct (#\n[.c])
82 .\" NS doc-macro-name global string
83 .\" NS   name of calling request (set in each user-requestable macro)
85 .ds doc-macro-name
86 .als doc-arg0 doc-macro-name
89 .\" NS doc-arg-limit global register
90 .\" NS   total number of arguments
92 .nr doc-arg-limit 0
95 .\" NS doc-num-args global register
96 .\" NS   number of arguments to handle (must be set to \n[.$] prior to
97 .\" NS   `doc-parse-arg-vector' request)
99 .nr doc-num-args 0
102 .\" NS doc-arg-ptr global register
103 .\" NS   argument pointer
105 .nr doc-arg-ptr 0
108 .\" NS doc-argXXX global string
109 .\" NS   argument vector
110 .\" NS
111 .\" NS limit:
112 .\" NS   doc-arg-limit
114 .ds doc-arg1
117 .\" NS doc-typeXXX global register
118 .\" NS   argument type vector (macro=1, string=2, punctuation suffix=3,
119 .\" NS   punctuation prefix=4)
120 .\" NS
121 .\" NS limit:
122 .\" NS   doc-arg-limit
124 .nr doc-type1 0
127 .\" NS doc-spaceXXX global string
128 .\" NS   space vector
129 .\" NS
130 .\" NS limit:
131 .\" NS   doc-arg-limit
133 .ds doc-space1
136 .\" NS doc-parse-args macro
137 .\" NS   parse arguments (recursively) (`.doc-parse-args arg ...')
138 .\" NS
139 .\" NS modifies:
140 .\" NS   doc-arg-limit
141 .\" NS   doc-arg-ptr
142 .\" NS   doc-argXXX
143 .\" NS   doc-spaceXXX
144 .\" NS   doc-typeXXX
145 .\" NS   doc-arg-ptr
146 .\" NS   doc-have-space
147 .\" NS
148 .\" NS local variables:
149 .\" NS   doc-reg-dpa
150 .\" NS   doc-reg-dpa1
151 .\" NS   doc-str-dpa
153 .de doc-parse-args
154 .  if !\n[doc-arg-limit] \
155 .    doc-set-spacing-1
157 .  nr doc-have-space 0
159 .  if !\n[.$] \
160 .    return
162 .  nr doc-arg-limit +1
164 .  \" handle `|' and `...' specially
165 .  ie        "\$1"|" \
166 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
167 .  el \{ .ie "\$1"..." \
168 .    ds doc-arg\n[doc-arg-limit] \|.\|.\|.
169 .  el \
170 .    ds doc-arg\n[doc-arg-limit] "\$1
171 .  \}
173 .  \" get argument type and set spacing
174 .  doc-get-arg-type* \n[doc-arg-limit]
175 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
176 .  doc-set-spacing-\n[doc-arg-type]
178 .  \" check whether we have processed the last parameter
179 .  ie (\n[.$] == 1) \
180 .    nr doc-arg-ptr 0
181 .  el \{\
182 .    shift
183 .    doc-parse-args \$@
184 .  \}
186 .  nh
190 .\" NS doc-parse-arg-vector macro
191 .\" NS   parse argument vector (recursive)
192 .\" NS
193 .\" NS   cf. comments in doc-parse-args
194 .\" NS
195 .\" NS modifies:
196 .\" NS   doc-arg-limit
197 .\" NS   doc-arg-ptr
198 .\" NS   doc-argXXX
199 .\" NS   doc-num-args
200 .\" NS   doc-spaceXXX
201 .\" NS   doc-typeXXX
202 .\" NS
203 .\" NS local variables:
204 .\" NS   doc-reg-dpav
205 .\" NS   doc-reg-dpav1
206 .\" NS   doc-str-dpav
208 .de doc-parse-arg-vector
209 .  if !\n[doc-arg-limit] \
210 .    doc-set-spacing-1
212 .  nr doc-arg-limit +1
214 .  ie        "\*[doc-arg\n[doc-arg-limit]]"|" \
215 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
216 .  el \{ .if "\*[doc-arg\n[doc-arg-limit]]"..." \
217 .    ds doc-arg\n[doc-arg-limit] \|.\|.\|.
218 .  \}
220 .  doc-get-arg-type* \n[doc-arg-limit]
221 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
222 .  doc-set-spacing-\n[doc-arg-type]
224 .  ie (\n[doc-num-args] == 1) \{\
225 .    nr doc-arg-ptr 0
226 .    nr doc-num-args 0
227 .  \}
228 .  el \{\
229 .    nr doc-num-args -1
230 .    doc-parse-arg-vector
231 .  \}
233 .  nh
237 .\" NS doc-parse-space-vector macro
238 .\" NS   parse space vector (recursive)
239 .\" NS
240 .\" NS modifies:
241 .\" NS   doc-arg-limit
242 .\" NS   doc-num-args
243 .\" NS   doc-spaceXXX
245 .de doc-parse-space-vector
246 .  nr doc-arg-limit +1
248 .  doc-set-spacing-\n[doc-type\n[doc-arg-limit]]
250 .  ie (\n[doc-num-args] == 1) \
251 .    nr doc-num-args 0
252 .  el \{\
253 .    nr doc-num-args -1
254 .    doc-parse-space-vector
255 .  \}
259 .\" NS doc-remaining-args macro
260 .\" NS   output remaining arguments as-is, separated by spaces (until
261 .\" NS   `doc-num-args' is exhausted)
262 .\" NS
263 .\" NS modifies:
264 .\" NS   doc-arg-ptr
265 .\" NS   doc-num-args
267 .de doc-remaining-args
268 .  nr doc-arg-ptr +1
269 .  nop \)\*[doc-arg\n[doc-arg-ptr]]\c
271 .  ie (\n[doc-num-args] == 1) \{\
272 .    nr doc-arg-ptr 0
273 .    nr doc-num-args 0
274 .  \}
275 .  el \{\
276 .    nop \)\*[doc-space]\c
277 .    nr doc-num-args -1
278 .    doc-remaining-args
279 .  \}
283 .\" NS doc-append-arg macro
284 .\" NS   append one argument to argument vector:
285 .\" NS   `.doc-append-arg [arg] [type]'
286 .\" NS
287 .\" NS modifies:
288 .\" NS   doc-arg-limit
289 .\" NS   doc-argXXX
290 .\" NS   doc-typeXXX
292 .de doc-append-arg
293 .  nr doc-arg-limit +1
294 .  ds doc-arg\n[doc-arg-limit] "\$1
295 .  nr doc-type\n[doc-arg-limit] \$2
296 .  doc-set-spacing-\$2
300 .\" NS doc-print-and-reset macro
301 .\" NS   finish input line and clean up argument vectors
303 .de doc-print-and-reset
304 .  if \n[doc-space-mode] \
305 .    nop \)
306 .  doc-reset-args
310 .\" NS doc-reset-args macro
311 .\" NS   reset argument counters
312 .\" NS
313 .\" NS modifies:
314 .\" NS   doc-arg-limit
315 .\" NS   doc-arg-ptr
316 .\" NS   doc-have-slot
318 .de doc-reset-args
319 .  nr doc-arg-limit 0
320 .  nr doc-arg-ptr 0
321 .  nr doc-have-slot 0
323 .  hy \n[doc-hyphen-flags]
329 .\" NS doc-curr-font global register
330 .\" NS   saved current font
332 .nr doc-curr-font \n[.f]
335 .\" NS doc-curr-size global register
336 .\" NS   saved current font size
338 .nr doc-curr-size \n[.ps]
343 .\" NS Fl user macro
344 .\" NS   handle flags (appends `-' and prints flags): `.Fl [arg ...]'
345 .\" NS
346 .\" NS modifies:
347 .\" NS   doc-arg-ptr
348 .\" NS   doc-curr-font
349 .\" NS   doc-curr-size
350 .\" NS   doc-macro-name
351 .\" NS
352 .\" NS local variables:
353 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
354 .\" NS
355 .\" NS width register `Fl' set in doc-common
357 .de Fl
358 .  nr doc-curr-font \n[.f]
359 .  nr doc-curr-size \n[.ps]
360 .  nop \*[doc-Fl-font]\c
362 .  if !\n[doc-arg-limit] \{\
363 .    ds doc-macro-name Fl
364 .    doc-parse-args \$@
366 .    if !\n[.$] \{\
367 .      \" no arguments
368 .      nop \|\-\|\f[P]\s[0]
369 .  \}\}
371 .  if !\n[doc-arg-limit] \
372 .    return
374 .  nr doc-arg-ptr +1
375 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
376 .    \" last argument
377 .    nop \|\-\f[P]\s[0]\c
378 .    doc-print-and-reset
379 .  \}
380 .  el \{\
381 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
382 .      nop \|\-\f[P]\s[0]\c
383 .      \*[doc-arg\n[doc-arg-ptr]]
384 .    \}
385 .    el \{\
386 .      if (\n[doc-type\n[doc-arg-ptr]] == 3) \
387 .        nop \|\-\|\c
389 .      nr doc-reg-Fl 1
390 .      doc-flag-recursion
391 .  \}\}
395 .\" NS doc-flag-recursion macro
396 .\" NS   `Fl' flag recursion routine (special handling)
397 .\" NS
398 .\" NS modifies:
399 .\" NS   doc-arg-ptr
400 .\" NS
401 .\" NS local variables:
402 .\" NS   doc-reg-dfr
403 .\" NS   doc-reg-dfr1
404 .\" NS   doc-str-dfr
406 .de doc-flag-recursion
407 .  nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
408 .  ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
410 .  ie (\n[doc-reg-dfr1] == 1) \{\
411 .    nop \f[P]\s[0]\c
412 .    \*[doc-str-dfr]
413 .  \}
414 .  el \{\
415 .    nr doc-reg-dfr \n[doc-arg-ptr]
417 .    ie (\n[doc-reg-dfr1] == 2) \{\
418 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
419 .      \" doc-flag-recursion only; we need this to make `.Fl | ...' work
420 .      \" correctly
421 .      ie "\*[doc-str-dfr]"\*[Ba]" \{\
422 .        if \n[doc-reg-Fl] \
423 .          nop \|\-\*[doc-space]\c
424 .        nop \)\*[Ba]\c
425 .      \}
426 .      el \{\
427 .        ie "\*[doc-str-dfr]"\f[R]|\f[P]" \{\
428 .          if \n[doc-reg-Fl] \
429 .            nop \|\-\*[doc-space]\c
430 .          nop \f[R]|\f[P]\c
431 .        \}
432 .        el \{\
433 .          \" two consecutive hyphen characters?
434 .          ie "\*[doc-str-dfr]"-" \
435 .            nop \|\-\^\-\|\c
436 .          el \
437 .            nop \|\%\-\*[doc-str-dfr]\c
438 .    \}\}\}
439 .    el \{\
440 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
441 .      nop \)\*[doc-str-dfr]\f[P]\s[0]\c
442 .    \}
444 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
445 .      \" last argument
446 .      if (\n[doc-reg-dfr1] == 4) \
447 .        nop \|\-\c
448 .      nop \f[P]\s[0]\c
449 .      doc-print-and-reset
450 .    \}
451 .    el \{\
452 .      nr doc-arg-ptr +1
453 .      ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
454 .        ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
455 .          nop \|\-\c
456 .        el \
457 .          nop \)\*[doc-space\n[doc-reg-dfr]]\c
458 .      \}
459 .      el \
460 .        nop \)\*[doc-space\n[doc-reg-dfr]]\c
462 .      shift
463 .      nr doc-reg-Fl 0
464 .      doc-flag-recursion \$@
465 .  \}\}
469 .\" NS doc-print-recursive macro
470 .\" NS   general name recursion routine (print remaining arguments)
471 .\" NS
472 .\" NS modifies:
473 .\" NS   doc-arg-ptr
474 .\" NS
475 .\" NS local variables:
476 .\" NS   doc-reg-dpr
477 .\" NS   doc-reg-dpr1
478 .\" NS   doc-str-dpr
480 .de doc-print-recursive
481 .  nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
482 .  ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
484 .  ie (\n[doc-reg-dpr1] == 1) \{\
485 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
486 .    \*[doc-str-dpr]
487 .  \}
488 .  el \{\
489 .    nr doc-reg-dpr \n[doc-arg-ptr]
491 .    ie (\n[doc-reg-dpr1] == 2) \
492 .      \" the `\%' prevents hyphenation on a dash (`-')
493 .      nop \%\*[doc-str-dpr]\&\c
494 .    el \{\
495 .      \" punctuation character
496 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
497 .      nop \)\*[doc-str-dpr]\f[P]\s[0]\c
498 .    \}
500 .    nr doc-arg-ptr +1
501 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
502 .      \" last argument
503 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
504 .      doc-print-and-reset
505 .    \}
506 .    el \{\
507 .      nop \)\*[doc-space\n[doc-reg-dpr]]\c
508 .      doc-print-recursive
509 .  \}\}
513 .\" NS doc-print-prefixes macro
514 .\" NS   print leading prefixes
515 .\" NS
516 .\" NS modifies:
517 .\" NS   doc-arg-ptr
519 .de doc-print-prefixes
520 .  while (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
521 .    if !(\n[doc-type\n[doc-arg-ptr]] == 4) \
522 .      break
523 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
524 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]\c
525 .    nr doc-arg-ptr +1
526 .  \}
530 .\" NS doc-generic-macro macro
531 .\" NS   this is the skeleton for most simple macros
532 .\" NS
533 .\" NS modifies:
534 .\" NS   doc-arg-ptr
535 .\" NS   doc-curr-font
536 .\" NS   doc-curr-size
537 .\" NS   doc-macro-name
539 .de doc-generic-macro
540 .  if !\n[doc-arg-limit] \{\
541 .    ie \n[.$] \{\
542 .      ds doc-macro-name \$0
543 .      doc-parse-args \$@
544 .    \}
545 .    el \
546 .      tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
547 .  \}
549 .  if !\n[doc-arg-limit] \
550 .    return
552 .  nr doc-arg-ptr +1
553 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
554 .    if (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
555 .      tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
557 .      \" the right action here would be to reset the argument counters
558 .      \" and bail out -- unfortunately, a small number of manual pages
559 .      \" (less than 2% for FreeBSD which has been used for testing)
560 .      \" relied on the old behaviour (silently ignore this error),
561 .      \" so it is commented out
563 .\"    doc-reset-args
564 .    \}
565 .\"  el \{\
566 .      nr doc-curr-font \n[.f]
567 .      nr doc-curr-size \n[.ps]
568 .      nop \*[doc-\$0-font]\c
569 .      doc-print-recursive
570 .\"  \}
571 .  \}
572 .  el \{\
573 .    tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
574 .    doc-reset-args
575 .  \}
579 .\" NS Ar user macro
580 .\" NS   command line `argument' macro: `.Ar [args ...]'
581 .\" NS
582 .\" NS modifies:
583 .\" NS   doc-arg-ptr
584 .\" NS   doc-curr-font
585 .\" NS   doc-curr-size
586 .\" NS   doc-macro-name
587 .\" NS
588 .\" NS local variable:
589 .\" NS   doc-str-Ar-default
590 .\" NS
591 .\" NS width register `Ar' set in doc-common
593 .ds doc-str-Ar-default "file\ .\|.\|.
595 .de Ar
596 .  nr doc-curr-font \n[.f]
597 .  nr doc-curr-size \n[.ps]
598 .  nop \*[doc-Ar-font]\c
600 .  if !\n[doc-arg-limit] \{\
601 .    ds doc-macro-name Ar
602 .    doc-parse-args \$@
604 .    if !\n[.$] \{\
605 .      \" no argument
606 .      nop \)\*[doc-str-Ar-default]\&\f[P]\s[0]
607 .  \}\}
609 .  if !\n[doc-arg-limit] \
610 .    return
612 .  nr doc-arg-ptr +1
613 .  doc-print-prefixes
614 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
615 .    nop \)\*[doc-str-Ar-default]\&\f[P]\s[0]\c
616 .    doc-print-and-reset
617 .  \}
618 .  el \{\
619 .    if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
620 .      \" replace previous argument (Ar) with default value
621 .      nr doc-arg-ptr -1
622 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Ar-default]
623 .      nr doc-type\n[doc-arg-ptr] 2
624 .      ds doc-space\n[doc-arg-ptr] "\*[doc-space]
626 .      \" recompute space vector for remaining arguments
627 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
628 .      nr doc-arg-limit \n[doc-arg-ptr]
629 .      doc-parse-space-vector
630 .    \}
631 .    doc-print-recursive
632 .  \}
636 .\" NS Ad user macro
637 .\" NS   Addresses
638 .\" NS
639 .\" NS width register `Ad' set in doc-common
641 .als Ad doc-generic-macro
642 .ds doc-Ad-usage address
645 .\" NS doc-in-synopsis-count global register
646 .\" NS   whether we have more than a single item in synopsis
648 .nr doc-in-synopsis-count 0
651 .\" NS doc-indent-synopsis global register
652 .\" NS   indentation in synopsis
654 .nr doc-indent-synopsis 0
657 .\" NS Cd user macro
658 .\" NS   config declaration (for section 4 SYNOPSIS)
659 .\" NS
660 .\" NS   this function causes a break; it uses the `Nm' font
661 .\" NS
662 .\" NS modifies:
663 .\" NS   doc-arg-ptr
664 .\" NS   doc-curr-font
665 .\" NS   doc-curr-size
666 .\" NS   doc-in-synopsis-count
667 .\" NS   doc-indent-synopsis
668 .\" NS   doc-macro-name
669 .\" NS
670 .\" NS width register `Cd' set in doc-common
672 .\" needs work - not very translatable
674 .de Cd
675 .  if !\n[doc-arg-limit] \{\
676 .    ie \n[.$] \{\
677 .      ds doc-macro-name Cd
678 .      doc-parse-args \$@
679 .    \}
680 .    el \
681 .      tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
682 .  \}
684 .  br
686 .  if !\n[doc-arg-limit] \
687 .    return
689 .  nr doc-arg-ptr +1
690 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
691 .    nr doc-curr-font \n[.f]
692 .    nr doc-curr-size \n[.ps]
694 .    ie \n[doc-in-synopsis-count] \{\
695 .      if "\*[doc-macro-name]"Cd" \{\
696 .        rs
697 .        ie (\n[doc-in-synopsis-count] > 1) \
698 .          br
699 .        el \{\
700 .          if !\n[doc-indent-synopsis] \
701 .            nr doc-indent-synopsis \n[doc-display-indent]u
702 .        \}
703 .        in +\n[doc-indent-synopsis]u
704 .        ti -\n[doc-indent-synopsis]u
705 .        nr doc-in-synopsis-count +1
706 .      \}
708 .      nop \*[doc-Nm-font]\c
709 .      doc-print-recursive
710 .      in -\n[doc-indent-synopsis]u
711 .    \}
712 .    el \{\
713 .      nop \*[doc-Nm-font]\c
714 .      doc-print-recursive
715 .  \}\}
716 .  el \{\
717 .    tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
718 .    doc-reset-args
719 .  \}
723 .\" NS Cm user macro
724 .\" NS   interactive command modifier (flag)
725 .\" NS
726 .\" NS width register `Cm' set in doc-common
728 .als Cm doc-generic-macro
729 .ds doc-Cm-usage interactive_command_modifier
732 .\" NS Dv user macro
733 .\" NS   defined variable
734 .\" NS
735 .\" NS   this function uses the `Er' font
736 .\" NS
737 .\" NS width register `Dv' set in doc-common
739 .als Dv doc-generic-macro
740 .ds doc-Dv-usage defined_variable
741 .als doc-Dv-font doc-Er-font
744 .\" NS Em user macro
745 .\" NS   emphasis
746 .\" NS
747 .\" NS width register `Em' set in doc-common
749 .als Em doc-generic-macro
750 .ds doc-Em-usage text
753 .\" NS Er user macro
754 .\" NS   errno type
755 .\" NS
756 .\" NS width register `Er' set in doc-common
758 .als Er doc-generic-macro
759 .ds doc-Er-usage text
762 .\" NS Ev user macro
763 .\" NS   environment variable
764 .\" NS
765 .\" NS width register `Ev' set in doc-common
767 .als Ev doc-generic-macro
768 .ds doc-Ev-usage text
771 .\" NS doc-have-decl global register (bool)
772 .\" NS   subroutine test (in synopsis only)
774 .nr doc-have-decl 0
777 .\" NS doc-have-var global register (bool)
778 .\" NS   whether last type is a variable type
780 .nr doc-have-var 0
783 .\" NS doc-do-func-decl macro
784 .\" NS   do someting special while in SYNOPSIS
785 .\" NS
786 .\" NS modifies:
787 .\" NS   doc-curr-font
788 .\" NS   doc-curr-size
789 .\" NS   doc-have-decl
790 .\" NS   doc-have-var
792 .de doc-do-func-decl
793 .  if \n[doc-in-synopsis-count] \{\
794 .    \" if a variable type was the last thing given, want vertical space
795 .    if \n[doc-have-var] \{\
796 .      doc-paragraph
797 .      nr doc-have-var 0
798 .    \}
799 .    \" if a subroutine was the last thing given, want vertical space
800 .    if \n[doc-have-func] \{\
801 .      ie \n[doc-have-decl] \
802 .        br
803 .      el \{\
804 .        doc-paragraph
805 .        rs
806 .    \}\}
807 .    nr doc-have-decl 1
808 .  \}
810 .  nr doc-curr-font \n[.f]
811 .  nr doc-curr-size \n[.ps]
815 .\" NS Fd user macro
816 .\" NS   function declaration -- not callable
817 .\" NS
818 .\" NS   this function causes a break
819 .\" NS
820 .\" NS width register `Fd' set in doc-common
822 .de Fd
823 .  ie ((\n[.$] >= 1) & (\n[doc-arg-limit] == 0)) \{\
824 .    doc-do-func-decl
825 .    nop \*[doc-Fd-font]\$*
826 .    br
827 .    ft \n[doc-curr-font]
828 .    ps \n[doc-curr-size]u
829 .  \}
830 .  el \{\
831 .    tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
832 .    doc-reset-args
833 .  \}
837 .\" NS In user macro
838 .\" NS   #include statement - not callable
839 .\" NS
840 .\" NS   this function causes a break; it uses the `Fd' font
841 .\" NS
842 .\" NS width register `In' set in doc-common
844 .de In
845 .  ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
846 .    doc-do-func-decl
847 .    nop \*[doc-Fd-font]#include <\$1>
848 .    br
849 .    ft \n[doc-curr-font]
850 .    ps \n[doc-curr-size]u
851 .  \}
852 .  el \{\
853 .    tm Usage: .In include_file -- In is not callable (#\n[.c])
854 .    doc-reset-args
855 .  \}
859 .\" NS Fr user macro
860 .\" NS   function return value
861 .\" NS
862 .\" NS   this function uses the `Ar' font
863 .\" NS
864 .\" NS width register `Fr' set in doc-common
866 .als Fr doc-generic-macro
867 .ds doc-Fr-usage function_return_value
868 .als doc-Fr-font doc-Ar-font
871 .\" NS Ic user macro
872 .\" NS   interactive command
873 .\" NS
874 .\" NS width register `Ic' set in doc-common
876 .als Ic doc-generic-macro
877 .ds doc-Ic-usage interactive_command
880 .\" NS Li user macro
881 .\" NS   literals
882 .\" NS
883 .\" NS width register `Li' set in doc-common
885 .als Li doc-generic-macro
886 .ds doc-Li-usage argument
889 .\" NS Or user macro
890 .\" NS   pipe symbol (OR)
891 .\" NS
892 .\" NS   this function uses the `Ic' font
893 .\" NS
894 .\" NS width register `Or' set in doc-common
896 .\" XXX: What is this function good for?  It sets a font but does not print
897 .\"      a pipe symbol.  And it isn't documented.
899 .als Or doc-generic-macro
900 .ds doc-Or-usage
901 .als doc-Or-font doc-Ic-font
904 .\" NS Ms user macro
905 .\" NS   math symbol
906 .\" NS
907 .\" NS   this function uses the `Sy' font
908 .\" NS
909 .\" NS width register `Ms' set in doc-common
911 .als Ms doc-generic-macro
912 .ds doc-Ms-usage math_symbol
913 .als doc-Ms-font doc-Sy-font
916 .\" NS doc-command-name global string
917 .\" NS   save first invocation of .Nm
919 .ds doc-command-name
922 .\" NS Nm user macro
923 .\" NS   name of command or page topic
924 .\" NS
925 .\" NS modifies:
926 .\" NS   doc-arg-ptr
927 .\" NS   doc-command-name
928 .\" NS   doc-curr-font
929 .\" NS   doc-curr-size
930 .\" NS   doc-in-synopsis-count
931 .\" NS   doc-indent-synopsis,
932 .\" NS   doc-macro-name
933 .\" NS
934 .\" NS width register `Nm' set in doc-common
936 .de Nm
937 .  if !\n[doc-arg-limit] \{\
938 .    ds doc-macro-name Nm
939 .    ie \n[.$] \
940 .      doc-parse-args \$@
941 .    el \{\
942 .      ie "\*[doc-command-name]"" \
943 .        tm Usage: .Nm name ... (#\n[.c])
944 .      el \
945 .        doc-parse-args \*[doc-command-name]
946 .  \}\}
948 .  if !\n[doc-arg-limit] \
949 .    return
951 .  nr doc-arg-ptr +1
952 .  doc-print-prefixes
953 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
954 .    \" last argument
955 .    ie "\*[doc-command-name]"" \{\
956 .      tm Usage: .Nm name ... (#\n[.c])
957 .      doc-reset-args
958 .    \}
959 .    el \{\
960 .      nop \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]\c
961 .      doc-print-and-reset
962 .  \}\}
963 .  el \{\
964 .    nr doc-curr-font \n[.f]
965 .    nr doc-curr-size \n[.ps]
967 .    rs
969 .    ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
970 .      ie "\*[doc-command-name]"" \
971 .        tm Usage: .Nm name ... (#\n[.c])
972 .      el \{\
973 .        \" replace previous argument (Nm) with default value
974 .        nr doc-arg-ptr -1
975 .        ds doc-arg\n[doc-arg-ptr] "\*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
976 .        nr doc-type\n[doc-arg-ptr] 2
977 .        ds doc-space\n[doc-arg-ptr] "\*[doc-space]
979 .        \" recompute space vector for remaining arguments
980 .        nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
981 .        nr doc-arg-limit \n[doc-arg-ptr]
982 .        doc-parse-space-vector
983 .    \}\}
984 .    el \{\
985 .      \" handle `.Nm ...' in SYNOPSIS
986 .      if \n[doc-in-synopsis-count] \{\
987 .        if "\*[doc-macro-name]"Nm" \{\
988 .          in -\n[doc-indent-synopsis]u
989 .          ie (\n[doc-in-synopsis-count] > 1) \
990 .            br
991 .          el \{\
992 .            if !\n[doc-indent-synopsis] \{\
993 .              doc-get-width "\*[doc-arg\n[doc-arg-ptr]]"
994 .              nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
995 .          \}\}
997 .          in +\n[doc-indent-synopsis]u
998 .          ti -\n[doc-indent-synopsis]u
999 .          nr doc-in-synopsis-count +1
1000 .      \}\}
1001 .      if "\*[doc-command-name]"" \
1002 .        ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
1004 .      nop \*[doc-Nm-font]\c
1005 .    \}
1006 .    doc-print-recursive
1007 .  \}
1011 .\" NS Pa user macro
1012 .\" NS   pathname: `.Pa [arg ...]'
1013 .\" NS
1014 .\" NS modifies:
1015 .\" NS   doc-arg-ptr
1016 .\" NS   doc-curr-font
1017 .\" NS   doc-curr-size
1018 .\" NS   doc-macro-name
1019 .\" NS
1020 .\" NS width register `Pa' set in doc-common
1022 .de Pa
1023 .  if !\n[doc-arg-limit] \{\
1024 .    ds doc-macro-name Pa
1025 .    doc-parse-args \$@
1027 .    if !\n[.$] \{\
1028 .      \" default value
1029 .      nop \*[doc-Pa-font]~\f[P]\s[0]
1030 .  \}\}
1032 .  if !\n[doc-arg-limit] \
1033 .    return
1035 .  nr doc-arg-ptr +1
1036 .  doc-print-prefixes
1037 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1038 .    nr doc-curr-font \n[.f]
1039 .    nr doc-curr-size \n[.ps]
1040 .    nop \*[doc-Pa-font]\c
1041 .    if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
1042 .      \" replace previous argument (Pa) with default value
1043 .      nr doc-arg-ptr -1
1044 .      ds doc-arg\n[doc-arg-ptr] ~
1045 .      nr doc-type\n[doc-arg-ptr] 2
1046 .      ds doc-space\n[doc-arg-ptr] "\*[doc-space]
1048 .      \" recompute space vector for remaining arguments
1049 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
1050 .      nr doc-arg-limit \n[doc-arg-ptr]
1051 .      doc-parse-space-vector
1052 .    \}
1053 .    doc-print-recursive
1054 .  \}
1055 .  el \{\
1056 .    nop \*[doc-Pa-font]~\f[P]\s[0]\c
1057 .    doc-print-and-reset
1058 .  \}
1062 .\" NS Sy user macro
1063 .\" NS   symbolics
1064 .\" NS
1065 .\" NS width register `Sy' set in doc-common
1067 .als Sy doc-generic-macro
1068 .ds doc-Sy-usage symbolic_text
1071 .\" NS Me user macro
1072 .\" NS   menu entries
1073 .\" NS
1074 .\" NS width register `Me' set in doc-common
1076 .als Me doc-generic-macro
1077 .ds doc-Me-usage menu_entry
1080 .\" NS Tn user macro
1081 .\" NS   trade name
1082 .\" NS
1083 .\" NS modifies:
1084 .\" NS   doc-arg-ptr
1085 .\" NS   doc-curr-font
1086 .\" NS   doc-curr-size
1087 .\" NS   doc-macro-name
1088 .\" NS
1089 .\" NS width register `Tn' set in doc-common
1091 .de Tn
1092 .  if !\n[doc-arg-limit] \{\
1093 .    ie \n[.$] \{\
1094 .      ds doc-macro-name Tn
1095 .      doc-parse-args \$@
1096 .    \}
1097 .    el \
1098 .      tm Usage: .Tn trade_name ... (#\n[.c])
1099 .  \}
1101 .  if !\n[doc-arg-limit] \
1102 .    return
1104 .  nr doc-arg-ptr +1
1105 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1106 .    nr doc-curr-font \n[.f]
1107 .    nr doc-curr-size \n[.ps]
1108 .    nop \)\*[doc-Tn-font-size]\c
1109 .    ie !\n[doc-is-reference] \{\
1110 .      nop \)\*[doc-Tn-font-shape]\c
1111 .      doc-print-recursive
1112 .    \}
1113 .    el \
1114 .      doc-do-references
1115 .  \}
1116 .  el \{\
1117 .    tm Usage: .Tn trade_name ... (#\n[.c])
1118 .    doc-reset-args
1119 .  \}
1123 .\" NS Va user macro
1124 .\" NS   variable name
1125 .\" NS
1126 .\" NS width register `Va' set in doc-common
1128 .als Va doc-generic-macro
1129 .ds doc-Va-usage variable_name
1132 .\" NS No user macro
1133 .\" NS   normal text macro (default text style if mess up)
1134 .\" NS
1135 .\" NS width register `No' set in doc-common
1137 .als No doc-generic-macro
1138 .ds doc-No-usage normal_text
1141 .\" NS doc-quote-left global string
1142 .\" NS   left quotation character for `doc-enclose-string' and
1143 .\" NS   `doc-enclose-open'
1145 .ds doc-quote-left
1148 .\" NS doc-quote-right global string
1149 .\" NS   right quotation character for `doc-enclose-string' and
1150 .\" NS   `doc-enclose-close'
1152 .ds doc-quote-right
1155 .\" NS Op user macro
1156 .\" NS   option expression (i.e., enclose string in square brackets)
1157 .\" NS
1158 .\" NS modifies:
1159 .\" NS   doc-macro-name
1160 .\" NS   doc-quote-left
1161 .\" NS   doc-quote-right
1162 .\" NS
1163 .\" NS width register `Op' set in doc-common
1165 .de Op
1166 .  if !\n[doc-arg-limit] \
1167 .    ds doc-macro-name Op
1169 .  ds doc-quote-left "\*[doc-left-bracket]
1170 .  ds doc-quote-right "\*[doc-right-bracket]
1172 .  doc-enclose-string \$@
1176 .\" NS Aq user macro
1177 .\" NS   enclose string in angle brackets
1178 .\" NS
1179 .\" NS modifies:
1180 .\" NS   doc-macro-name
1181 .\" NS   doc-quote-left
1182 .\" NS   doc-quote-right
1183 .\" NS
1184 .\" NS width register `Aq' set in doc-common
1186 .de Aq
1187 .  if !\n[doc-arg-limit] \
1188 .    ds doc-macro-name Aq
1190 .  ds doc-quote-left \[la]
1191 .  ds doc-quote-right \[ra]
1193 .  doc-enclose-string \$@
1197 .\" NS Bq user macro
1198 .\" NS   enclose string in square brackets
1199 .\" NS
1200 .\" NS modifies:
1201 .\" NS   doc-macro-name
1202 .\" NS   doc-quote-left
1203 .\" NS   doc-quote-right
1204 .\" NS
1205 .\" NS width register `Bq' set in doc-common
1207 .de Bq
1208 .  if !\n[doc-arg-limit] \
1209 .    ds doc-macro-name Bq
1211 .  ds doc-quote-left "\*[doc-left-bracket]
1212 .  ds doc-quote-right "\*[doc-right-bracket]
1214 .  doc-enclose-string \$@
1218 .\" NS Brq user macro
1219 .\" NS   enclose string in braces
1220 .\" NS
1221 .\" NS modifies:
1222 .\" NS   doc-macro-name
1223 .\" NS   doc-quote-left
1224 .\" NS   doc-quote-right
1225 .\" NS
1226 .\" NS width register `Brq' set in doc-common
1228 .de Brq
1229 .  if !\n[doc-arg-limit] \
1230 .    ds doc-macro-name Brq
1232 .  ds doc-quote-left {
1233 .  ds doc-quote-right }
1235 .  doc-enclose-string \$@
1239 .\" NS Dq user macro
1240 .\" NS   enclose string in double quotes
1241 .\" NS
1242 .\" NS modifies:
1243 .\" NS   doc-macro-name
1244 .\" NS   doc-quote-left
1245 .\" NS   doc-quote-right
1246 .\" NS
1247 .\" NS width register `Dq' set in doc-common
1249 .de Dq
1250 .  if !\n[doc-arg-limit] \
1251 .    ds doc-macro-name Dq
1253 .  ds doc-quote-left "\*[Lq]
1254 .  ds doc-quote-right "\*[Rq]
1256 .  doc-enclose-string \$@
1260 .\" NS Eq user macro
1261 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1262 .\" NS
1263 .\" NS modifies:
1264 .\" NS   doc-macro-name
1265 .\" NS   doc-quote-left
1266 .\" NS   doc-quote-right
1267 .\" NS
1268 .\" NS width register `Eq' set in doc-common
1270 .de Eq
1271 .  if !\n[doc-arg-limit] \
1272 .    ds doc-macro-name Eq
1274 .  ds doc-quote-left "\$1
1275 .  ds doc-quote-right "\$2
1277 .  shift 2
1278 .  doc-enclose-string \$@
1282 .\" NS Pq user macro
1283 .\" NS   enclose string in parentheses
1284 .\" NS
1285 .\" NS modifies:
1286 .\" NS   doc-macro-name
1287 .\" NS   doc-quote-left
1288 .\" NS   doc-quote-right
1289 .\" NS
1290 .\" NS width register `Pq' set in doc-common
1292 .de Pq
1293 .  if !\n[doc-arg-limit] \
1294 .    ds doc-macro-name Pq
1296 .  ds doc-quote-left "\*[doc-left-parenthesis]
1297 .  ds doc-quote-right "\*[doc-right-parenthesis]
1299 .  doc-enclose-string \$@
1303 .\" NS Ql user macro
1304 .\" NS   quoted literal
1306 .\"   is in file doc-[dit|n]roff
1309 .\" NS Qq user macro
1310 .\" NS   enclose string in straight double quotes
1311 .\" NS
1312 .\" NS modifies:
1313 .\" NS   doc-macro-name
1314 .\" NS   doc-quote-left
1315 .\" NS   doc-quote-right
1316 .\" NS
1317 .\" NS width register `Qq' set in doc-common
1319 .de Qq
1320 .  if !\n[doc-arg-limit] \
1321 .    ds doc-macro-name Qq
1323 .  ds doc-quote-left "\*[q]
1324 .  ds doc-quote-right "\*[q]
1326 .  doc-enclose-string \$@
1330 .\" NS Sq user macro
1331 .\" NS   enclose string in single quotes
1332 .\" NS
1333 .\" NS modifies:
1334 .\" NS   doc-macro-name
1335 .\" NS   doc-quote-left
1336 .\" NS   doc-quote-right
1337 .\" NS
1338 .\" NS width register `Sq' set in doc-common
1340 .de Sq
1341 .  if !\n[doc-arg-limit] \
1342 .    ds doc-macro-name Sq
1344 .  ds doc-quote-left "\*[doc-left-singlequote]
1345 .  ds doc-quote-right "\*[doc-right-singlequote]
1347 .  doc-enclose-string \$@
1351 .\" NS Es user macro
1352 .\" NS   set up arguments (i.e., the left and right quotation character as
1353 .\" NS   first and second argument) for .En call
1354 .\" NS
1355 .\" NS modifies:
1356 .\" NS   doc-arg-ptr
1357 .\" NS   doc-macro-name
1358 .\" NS   doc-quote-left
1359 .\" NS   doc-quote-right
1361 .de Es
1362 .  if !\n[doc-arg-limit] \{\
1363 .    ie (\n[.$] > 2) \{\
1364 .      ds doc-macro-name Es
1365 .      doc-parse-args \$@
1366 .    \}
1367 .    el \{\
1368 .      ds doc-quote-left "\$1
1369 .      ds doc-quote-right "\$2
1370 .  \}\}
1372 .  if !\n[doc-arg-limit] \
1373 .    return
1375 .  nr doc-arg-ptr +1
1376 .  ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
1377 .  nr doc-arg-ptr +1
1378 .  ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
1379 .  nr doc-arg-ptr +1
1380 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1381 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
1382 .  el \
1383 .    doc-print-and-reset
1387 .\" NS doc-have-slot global register (bool)
1388 .\" NS   set if `doc-enclose-string' has created a slot for closing
1389 .\" NS   delimiter
1391 .nr doc-have-slot 0
1394 .\" NS doc-enclose-string macro
1395 .\" NS   enclose string with given args (e.g. [ and ])
1396 .\" NS
1397 .\" NS modifies:
1398 .\" NS   doc-arg-ptr
1399 .\" NS   doc-argXXX
1400 .\" NS   doc-have-slot
1401 .\" NS
1402 .\" NS local variables:
1403 .\" NS   doc-reg-des
1404 .\" NS   doc-reg-des1
1405 .\" NS   doc-reg-des2
1406 .\" NS
1407 .\" NS requires:
1408 .\" NS   doc-quote-left
1409 .\" NS   doc-quote-right
1411 .de doc-enclose-string
1412 .  if \n[doc-in-synopsis-count] \
1413 .    doc-set-hard-space
1415 .  if !\n[doc-arg-limit] \{\
1416 .    ie \n[.$] \
1417 .      doc-parse-args \$@
1418 .    el \{\
1419 .      nop \)\*[doc-quote-left]\*[doc-quote-right]
1420 .  \}\}
1422 .  if !\n[doc-arg-limit] \
1423 .    return
1425 .  nr doc-curr-font \n[.f]
1426 .  nr doc-curr-size \n[.ps]
1428 .  nr doc-arg-ptr +1
1429 .  doc-print-prefixes
1430 .  \" the final `\)' prevents hyphenation in case the next character is `\%'
1431 .  nop \)\*[doc-quote-left]\)\c
1432 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1433 .    \" last argument
1434 .    nop \)\*[doc-quote-right]\)\c
1435 .    doc-print-and-reset
1436 .  \}
1437 .  el \{\
1438 .    \" test whether last arguments are of type closing punctuation
1439 .    \" resp. suffix
1440 .    ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
1441 .      nr doc-reg-des (\n[doc-arg-limit] - 1)
1442 .      while (\n[doc-type\n[doc-reg-des]] == 3) \
1443 .        nr doc-reg-des -1
1445 .      \" prepend closing delimiter
1446 .      nr doc-reg-des +1
1447 .      ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1448 .    \}
1449 .    el \{\
1450 .      \" test whether last arguments are macros which continue the line
1451 .      \" logically
1452 .      nr doc-reg-des \n[doc-arg-limit]
1453 .      while (\n[doc-reg-des] >= \n[doc-arg-ptr]) \{\
1454 .        if !\A\a\*[doc-arg\n[doc-reg-des]]\a \
1455 .          break
1456 .        if !d doc-after-\*[doc-arg\n[doc-reg-des]] \
1457 .          break
1458 .        nr doc-reg-des -1
1459 .      \}
1461 .      \" if there are no trailing macros to be skipped, append argument
1462 .      ie (\n[doc-reg-des] == \n[doc-arg-limit]) \
1463 .        doc-append-arg "\)\*[doc-quote-right]\)" 3
1464 .      el \{\
1465 .        \" if a previous call to `doc-enclose-string' has already created
1466 .        \" a slot, prepend argument
1467 .        ie \n[doc-have-slot] \
1468 .          ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1469 .        el \{\
1470 .          \" we have to shift all arguments to the right
1471 .          nr doc-reg-des +1
1472 .          nr doc-reg-des1 \n[doc-arg-limit]
1473 .          nr doc-reg-des2 (\n[doc-arg-limit] + 1)
1474 .          while (\n[doc-reg-des1] >= \n[doc-reg-des]) \{\
1475 .            rn doc-arg\n[doc-reg-des1] doc-arg\n[doc-reg-des2]
1476 .            rnn doc-type\n[doc-reg-des1] doc-type\n[doc-reg-des2]
1477 .            rn doc-space\n[doc-reg-des1] doc-space\n[doc-reg-des2]
1478 .            nr doc-reg-des1 -1
1479 .            nr doc-reg-des2 -1
1480 .          \}
1481 .          nr doc-arg-limit +1
1483 .          \" finally, insert closing delimiter into the freed slot and
1484 .          \" recompute spacing vector
1485 .          ds doc-arg\n[doc-reg-des] "\)\*[doc-quote-right]\)
1486 .          nr doc-type\n[doc-reg-des] 3
1487 .          nr doc-num-args (\n[doc-arg-limit] - \n[doc-reg-des] + 1)
1488 .          nr doc-arg-limit (\n[doc-reg-des] - 1)
1489 .          doc-parse-space-vector
1490 .          nr doc-have-slot 1
1491 .    \}\}\}
1493 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
1494 .  \}
1496 .  if \n[doc-in-synopsis-count] \
1497 .    doc-set-soft-space
1501 .\" NS En user macro
1502 .\" NS   enclose arguments with quotation characters set up with `.Es'
1504 .als En doc-enclose-string
1507 .\" NS Ao user macro
1508 .\" NS   angle open
1509 .\" NS
1510 .\" NS modifies:
1511 .\" NS   doc-macro-name
1512 .\" NS   doc-quote-left
1513 .\" NS
1514 .\" NS width register `Ao' set in doc-common
1516 .de Ao
1517 .  if !\n[doc-arg-limit] \
1518 .    ds doc-macro-name Ao
1520 .  ds doc-quote-left \[la]
1522 .  doc-enclose-open \$@
1526 .\" NS Ac user macro
1527 .\" NS   angle close
1528 .\" NS
1529 .\" NS modifies:
1530 .\" NS   doc-macro-name
1531 .\" NS   doc-quote-right
1532 .\" NS
1533 .\" NS width register `Ac' set in doc-common
1535 .de Ac
1536 .  if !\n[doc-arg-limit] \
1537 .    ds doc-macro-name Ac
1539 .  ds doc-quote-right \[ra]
1541 .  doc-enclose-close \$@
1545 .\" NS Bo user macro
1546 .\" NS   bracket open
1547 .\" NS
1548 .\" NS modifies:
1549 .\" NS   doc-macro-name
1550 .\" NS   doc-quote-left
1551 .\" NS
1552 .\" NS width register `Bo' set in doc-common
1554 .de Bo
1555 .  if !\n[doc-arg-limit] \
1556 .    ds doc-macro-name Bo
1558 .  ds doc-quote-left "\*[doc-left-bracket]
1560 .  doc-enclose-open \$@
1564 .\" NS Bc user macro
1565 .\" NS   bracket close
1566 .\" NS
1567 .\" NS modifies:
1568 .\" NS   doc-macro-name
1569 .\" NS   doc-quote-right
1570 .\" NS
1571 .\" NS width register `Bc' set in doc-common
1573 .de Bc
1574 .  if !\n[doc-arg-limit] \
1575 .    ds doc-macro-name Bc
1577 .  ds doc-quote-right "\*[doc-right-bracket]
1579 .  doc-enclose-close \$@
1583 .\" NS Bro user macro
1584 .\" NS   brace open
1585 .\" NS
1586 .\" NS modifies:
1587 .\" NS   doc-macro-name
1588 .\" NS   doc-quote-left
1589 .\" NS
1590 .\" NS width register `Bro' set in doc-common
1592 .de Bro
1593 .  if !\n[doc-arg-limit] \
1594 .    ds doc-macro-name Bo
1596 .  ds doc-quote-left {
1598 .  doc-enclose-open \$@
1602 .\" NS Brc user macro
1603 .\" NS   brace close
1604 .\" NS
1605 .\" NS modifies:
1606 .\" NS   doc-macro-name
1607 .\" NS   doc-quote-right
1608 .\" NS
1609 .\" NS width register `Brc' set in doc-common
1611 .de Brc
1612 .  if !\n[doc-arg-limit] \
1613 .    ds doc-macro-name Bc
1615 .  ds doc-quote-right }
1617 .  doc-enclose-close \$@
1621 .\" NS Do user macro
1622 .\" NS   double quote open
1623 .\" NS
1624 .\" NS modifies:
1625 .\" NS   doc-macro-name
1626 .\" NS   doc-quote-left
1627 .\" NS
1628 .\" NS width register `Do' set in doc-common
1630 .de Do
1631 .  if !\n[doc-arg-limit] \
1632 .    ds doc-macro-name Do
1634 .  ds doc-quote-left "\*[Lq]
1636 .  doc-enclose-open \$@
1640 .\" NS Dc user macro
1641 .\" NS   double quote close
1642 .\" NS
1643 .\" NS modifies:
1644 .\" NS   doc-macro-name
1645 .\" NS   doc-quote-right
1646 .\" NS
1647 .\" NS width register `Dc' set in doc-common
1649 .de Dc
1650 .  if !\n[doc-arg-limit] \
1651 .    ds doc-macro-name Dc
1653 .  ds doc-quote-right "\*[Rq]
1655 .  doc-enclose-close \$@
1659 .\" NS Eo user macro
1660 .\" NS   enclose open (using first argument as beginning of enclosure)
1661 .\" NS
1662 .\" NS modifies:
1663 .\" NS   doc-macro-name
1664 .\" NS   doc-quote-left
1665 .\" NS
1666 .\" NS width register `Eo' set in doc-common
1668 .de Eo
1669 .  if !\n[doc-arg-limit] \
1670 .    ds doc-macro-name Eo
1672 .  ds doc-quote-left "\$1
1674 .  shift
1675 .  doc-enclose-open \$@
1679 .\" NS Ec user macro
1680 .\" NS   enclose close (using first argument as end of enclosure)
1681 .\" NS
1682 .\" NS modifies:
1683 .\" NS   doc-macro-name
1684 .\" NS   doc-quote-right
1685 .\" NS
1686 .\" NS width register `Ec' set in doc-common
1688 .de Ec
1689 .  if !\n[doc-arg-limit] \
1690 .    ds doc-macro-name Ec
1692 .  ds doc-quote-right "\$1
1694 .  shift
1695 .  doc-enclose-close \$@
1699 .\" NS Oo user macro
1700 .\" NS   option open
1701 .\" NS
1702 .\" NS modifies:
1703 .\" NS   doc-macro-name
1704 .\" NS   doc-quote-left
1705 .\" NS
1706 .\" NS width register `Oo' set in doc-common
1708 .de Oo
1709 .  if !\n[doc-arg-limit] \
1710 .    ds doc-macro-name Oo
1712 .  ds doc-quote-left [
1714 .  doc-enclose-open \$@
1718 .\" NS Oc user macro
1719 .\" NS   option close
1720 .\" NS
1721 .\" NS modifies:
1722 .\" NS   doc-macro-name
1723 .\" NS   doc-quote-right
1724 .\" NS
1725 .\" NS width register `Oc' set in doc-common
1727 .de Oc
1728 .  if !\n[doc-arg-limit] \
1729 .    ds doc-macro-name Oc
1731 .  ds doc-quote-right ]
1733 .  doc-enclose-close \$@
1737 .\" NS Po user macro
1738 .\" NS   parenthesis open
1739 .\" NS
1740 .\" NS modifies:
1741 .\" NS   doc-macro-name
1742 .\" NS   doc-quote-left
1743 .\" NS
1744 .\" NS width register `Po' set in doc-common
1746 .de Po
1747 .  if !\n[doc-arg-limit] \
1748 .    ds doc-macro-name Po
1750 .  ds doc-quote-left "\*[doc-left-parenthesis]
1752 .  doc-enclose-open \$@
1756 .\" NS Pc user macro
1757 .\" NS   parenthesis close
1758 .\" NS
1759 .\" NS modifies:
1760 .\" NS   doc-macro-name
1761 .\" NS   doc-quote-right
1762 .\" NS
1763 .\" NS width register `Pc' set in doc-common
1765 .de Pc
1766 .  if !\n[doc-arg-limit] \
1767 .    ds doc-macro-name Pc
1769 .  ds doc-quote-right "\*[doc-right-parenthesis]
1771 .  doc-enclose-close \$@
1775 .\" NS Qo user macro
1776 .\" NS   straight double quote open
1777 .\" NS
1778 .\" NS modifies:
1779 .\" NS   doc-macro-name
1780 .\" NS   doc-quote-left
1781 .\" NS
1782 .\" NS width register `Qo' set in doc-common
1784 .de Qo
1785 .  if !\n[doc-arg-limit] \
1786 .    ds doc-macro-name Qo
1788 .  ds doc-quote-left "\*[q]
1790 .  doc-enclose-open \$@
1794 .\" NS Qc user macro
1795 .\" NS   straight double quote close
1796 .\" NS
1797 .\" NS modifies:
1798 .\" NS   doc-macro-name
1799 .\" NS   doc-quote-right
1800 .\" NS
1801 .\" NS width register `Qc' set in doc-common
1803 .de Qc
1804 .  if !\n[doc-arg-limit] \
1805 .    ds doc-macro-name Qc
1807 .  ds doc-quote-right "\*[q]
1809 .  doc-enclose-close \$@
1813 .\" NS So user macro
1814 .\" NS   single quote open
1815 .\" NS
1816 .\" NS modifies:
1817 .\" NS   doc-macro-name
1818 .\" NS   doc-quote-left
1819 .\" NS
1820 .\" NS width register `So' set in doc-common
1822 .de So
1823 .  if !\n[doc-arg-limit] \
1824 .    ds doc-macro-name So
1826 .  ds doc-quote-left "\*[doc-left-singlequote]
1828 .  doc-enclose-open \$@
1832 .\" NS Sc user macro
1833 .\" NS   single quote close
1834 .\" NS
1835 .\" NS modifies:
1836 .\" NS   doc-macro-name
1837 .\" NS   doc-quote-right
1838 .\" NS
1839 .\" NS width register `Sc' set in doc-common
1841 .de Sc
1842 .  if !\n[doc-arg-limit] \
1843 .    ds doc-macro-name Sc
1845 .  ds doc-quote-right "\*[doc-right-singlequote]
1847 .  doc-enclose-close \$@
1851 .\" NS Xo user macro
1852 .\" NS   extend open
1853 .\" NS
1854 .\" NS modifies:
1855 .\" NS   doc-macro-name
1856 .\" NS   doc-quote-left
1857 .\" NS
1858 .\" NS width register `Xo' set in doc-common
1860 .de Xo
1861 .  if !\n[doc-arg-limit] \
1862 .    ds doc-macro-name Xo
1864 .  ds doc-quote-left
1866 .  doc-enclose-open \$@
1870 .\" NS Xc user macro
1871 .\" NS   extend close
1872 .\" NS
1873 .\" NS modifies:
1874 .\" NS   doc-macro-name
1875 .\" NS   doc-quote-right
1876 .\" NS
1877 .\" NS width register `Xc' set in doc-common
1879 .de Xc
1880 .  if !\n[doc-arg-limit] \
1881 .    ds doc-macro-name Xc
1883 .  ds doc-quote-right
1885 .  doc-enclose-close \$@
1889 .\" NS doc-nesting-level global register
1890 .\" NS   used by `doc-enclose-open' and `doc-enclose-close'
1892 .nr doc-nesting-level 0
1895 .\" NS doc-in-list global register (bool)
1896 .\" NS   whether we are in (logical) .It
1898 .nr doc-in-list 0
1901 .\" NS doc-enclose-open macro
1902 .\" NS   enclose string open
1903 .\" NS
1904 .\" NS modifies:
1905 .\" NS   doc-arg-ptr
1906 .\" NS   doc-nesting-level
1908 .de doc-enclose-open
1909 .  if !\n[doc-arg-limit] \
1910 .    doc-parse-args \$@
1912 .  nr doc-arg-ptr +1
1913 .  doc-print-prefixes
1914 .  nr doc-arg-ptr -1
1916 .  nop \)\*[doc-quote-left]\)\c
1918 .  \" start enclosure box
1919 .  box doc-enclosure-box\n[doc-nesting-level]
1920 .  ev doc-enclosure-env\n[doc-nesting-level]
1921 .  evc 0
1922 .  in 0
1923 .  nf
1924 .  \" we insert something to make .chop always work
1925 .  nop \&\c
1927 .  \" increase nesting level *after* parsing of arguments
1928 .  nr doc-nesting-level +1
1930 .  if \n[doc-arg-limit] \{\
1931 .    nr doc-arg-ptr +1
1932 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1933 .      doc-print-recursive
1934 .    el \
1935 .      doc-reset-args
1936 .  \}
1940 .\" NS doc-enclose-close macro
1941 .\" NS   enclose string close
1942 .\" NS
1943 .\" NS modifies:
1944 .\" NS   doc-nesting-level
1946 .de doc-enclose-close
1947 .  nr doc-nesting-level -1
1949 .  \" finish enclosure box
1950 .  br
1951 .  ev
1952 .  box
1953 .  chop doc-enclosure-box\n[doc-nesting-level]
1954 .  unformat doc-enclosure-box\n[doc-nesting-level]
1956 .  nh
1957 .  nop \*[doc-enclosure-box\n[doc-nesting-level]]\c
1958 .  nop \)\*[doc-quote-right]\)\c
1960 .  if !\n[doc-arg-limit] \{\
1961 .    doc-parse-args \$@
1963 .    if !\n[.$] \
1964 .      doc-print-and-reset
1965 .  \}
1967 .  if \n[doc-arg-limit] \{\
1968 .    ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
1969 .      nop \)\*[doc-space\n[doc-arg-ptr]]\c
1970 .      nr doc-arg-ptr +1
1971 .      doc-print-recursive
1972 .    \}
1973 .    el \
1974 .      doc-print-and-reset
1975 .  \}
1977 .  \" shall we finish .It request?
1978 .  if !"\*[doc-macro-name]"It" \
1979 .    if \n[doc-in-list] \
1980 .      if !\n[doc-nesting-level] \
1981 .        doc-\*[doc-list-type-stack\n[doc-list-depth]]
1985 .\" NS Pf user macro
1986 .\" NS   prefix: `.Pf prefix arg ...'
1987 .\" NS
1988 .\" NS modifies:
1989 .\" NS   doc-arg-ptr
1990 .\" NS   doc-macro-name
1991 .\" NS   doc-quote-left
1992 .\" NS
1993 .\" NS width register `Pf' set in doc-common
1995 .de Pf
1996 .  if !\n[doc-arg-limit] \
1997 .    ds doc-macro-name Pf
1999 .  ie \n[doc-arg-limit] \{\
2000 .    ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
2001 .      nr doc-arg-ptr +1
2002 .      nop \)\*[doc-arg\n[doc-arg-ptr]]\c
2003 .    \}
2004 .    el \
2005 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
2006 .  \}
2007 .  el \{\
2008 .    nop \)\$1\)\c
2009 .    shift
2010 .    ie \n[.$] \
2011 .      doc-parse-args \$@
2012 .    el \{\
2013 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
2014 .      nop \)
2015 .  \}\}
2017 .  if \n[doc-arg-limit] \{\
2018 .    nr doc-arg-ptr +1
2019 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
2020 .      doc-print-and-reset
2021 .    el \
2022 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
2023 .  \}
2027 .\" NS Ns user macro
2028 .\" NS   remove space (space removal done by `doc-parse-args')
2029 .\" NS
2030 .\" NS modifies:
2031 .\" NS   doc-argXXX
2032 .\" NS   doc-macro-name
2033 .\" NS
2034 .\" NS width register `Ns' set in doc-common
2036 .de Ns
2037 .  if !\n[doc-arg-limit] \{\
2038 .    ie \n[.$] \{\
2039 .      ds doc-macro-name Ns
2040 .      doc-parse-args \$@
2041 .    \}
2042 .    el \
2043 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2044 .  \}
2046 .  if \n[doc-arg-limit] \{\
2047 .    nr doc-arg-ptr +1
2048 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2049 .      doc-print-recursive
2050 .    el \
2051 .      doc-reset-args
2052 .  \}
2056 .\" NS Ap user macro
2057 .\" NS   append an apostrophe
2058 .\" NS
2059 .\" NS width register `Ap' set in doc-common
2061 .de Ap
2062 .  ie !\n[doc-arg-limit] \
2063 .    tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2064 .  el \{\
2065 .    nop \)'\)\c
2066 .    nr doc-arg-ptr +1
2067 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2068 .      doc-print-recursive
2069 .    el \
2070 .      doc-reset-args
2071 .  \}
2075 .\" NS doc-space global string
2076 .\" NS   current inter-argument space
2078 .ds doc-space "\*[doc-soft-space]
2081 .\" NS doc-soft-space constant string
2082 .\" NS   soft (stretchable) space (defined in doc-common)
2085 .\" NS doc-hard-space constant string
2086 .\" NS   hard (unpaddable) space (defined in doc-common)
2089 .\" NS doc-set-hard-space macro
2090 .\" NS   set current space string to hard (unpaddable) space.
2091 .\" NS
2092 .\" NS modifies:
2093 .\" NS   doc-saved-space
2094 .\" NS   doc-space
2096 .de doc-set-hard-space
2097 .  ie "\*[doc-space]"" \
2098 .    ds doc-saved-space "\*[doc-hard-space]
2099 .  el \
2100 .    ds doc-space "\*[doc-hard-space]
2104 .\" NS doc-set-soft-space macro
2105 .\" NS   set current space string to soft space
2106 .\" NS
2107 .\" NS modifies:
2108 .\" NS   doc-saved-space
2109 .\" NS   doc-space
2111 .de doc-set-soft-space
2112 .  ie "\*[doc-space]"" \
2113 .    ds doc-saved-space "\*[doc-soft-space]
2114 .  el \
2115 .    ds doc-space "\*[doc-soft-space]
2119 .\" NS doc-space-mode global register (bool)
2120 .\" NS   default is one (space mode on)
2122 .nr doc-space-mode 1
2125 .\" NS doc-saved-space global string
2126 .\" NS   saved value of `doc-space'
2128 .ds doc-saved-space "\*[doc-space]
2131 .\" NS doc-have-space global register (bool)
2132 .\" NS   set if last command was horizontal space
2134 .nr doc-have-space 0
2137 .\" NS Sm user macro
2138 .\" NS   space mode (`.Sm'/`.Sm on'/`.Sm off')
2139 .\" NS
2140 .\" NS   without argument, toggle space mode
2141 .\" NS
2142 .\" NS modifies:
2143 .\" NS   doc-arg-limit
2144 .\" NS   doc-arg-ptr
2145 .\" NS   doc-argXXX
2146 .\" NS   doc-macro-name
2147 .\" NS   doc-num-args
2148 .\" NS   doc-saved-space
2149 .\" NS   doc-space
2150 .\" NS   doc-space-mode
2151 .\" NS   doc-spaceXXX
2152 .\" NS
2153 .\" NS local variables:
2154 .\" NS   doc-reg-Sm
2155 .\" NS
2156 .\" NS width register `Sm' set in doc-common
2158 .de Sm
2159 .  ie \n[doc-have-space] \
2160 .    nr doc-reg-Sm 0
2161 .  el \
2162 .    nr doc-reg-Sm 1
2164 .  if !\n[doc-arg-limit] \{\
2165 .    ie \n[.$] \{\
2166 .      ds doc-macro-name Sm
2167 .      doc-parse-args \$@
2168 .    \}
2169 .    el \{\
2170 .      ie \n[doc-space-mode] \
2171 .        nr doc-space-mode 0
2172 .      el \
2173 .        nr doc-space-mode 1
2174 .  \}\}
2176 .  if !\n[doc-arg-limit] \
2177 .    return
2179 .  nr doc-arg-ptr +1
2181 .  \" avoid a warning message in case `Sm' is the last parameter
2182 .  if !d doc-arg\n[doc-arg-ptr] \
2183 .    ds doc-arg\n[doc-arg-ptr]
2185 .  ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2186 .    ds doc-space "\*[doc-saved-space]
2187 .    nr doc-space-mode 1
2188 .  \}
2189 .  el \{\
2190 .    ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2191 .      ds doc-saved-space "\*[doc-space]
2192 .      ds doc-space
2193 .      nr doc-space-mode 0
2194 .    \}
2195 .    el \{\
2196 .      \" no argument for Sm
2197 .      nr doc-arg-ptr -1
2198 .      ie \n[doc-space-mode] \
2199 .        nr doc-space-mode 0
2200 .      el \
2201 .        nr doc-space-mode 1
2202 .  \}\}
2204 .  ie \n[doc-space-mode] \{\
2205 .    \" recompute space vector for remaining arguments
2206 .    nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2207 .    nr doc-arg-limit \n[doc-arg-ptr]
2208 .    if \n[doc-num-args] \
2209 .      doc-parse-space-vector
2211 .    \" finish line only if it is interrupted and `doc-have-space'
2212 .    \" isn't set
2213 .    if \n[doc-reg-Sm] \
2214 .      if \n[.int] \
2215 .        nop \)
2216 .  \}
2217 .  el \{\
2218 .    \" reset remaining space vector elements
2219 .    nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2220 .    while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2221 .      ds doc-space\n[doc-reg-Sm]
2222 .      nr doc-reg-Sm +1
2223 .      \" the body of a `while' request must end with the fitting `\}'!
2224 .    \}
2225 .  \}
2227 .  \" do we have parameters to print?
2228 .  ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2229 .    \" ignore `.Sm on' and `.Sm off' without additional parameters
2230 .    ie (\n[doc-arg-ptr] > 1) \
2231 .      doc-print-and-reset
2232 .    el \
2233 .      doc-reset-args
2234 .  \}
2235 .  el \{\
2236 .    \" skip `Sm' argument
2237 .    nr doc-arg-ptr +1
2238 .    doc-print-recursive
2239 .  \}
2243 .\" NS doc-arg-type immediate register
2244 .\" NS   argument type (macro=1, string=2, punctuation suffix=3,
2245 .\" NS   punctuation prefix=4)
2247 .nr doc-arg-type 0
2250 .\" NS doc-get-arg-type macro
2251 .\" NS   get argument type
2252 .\" NS
2253 .\" NS   this macro expects the width of the argument in `doc-width'
2254 .\" NS
2255 .\" NS modifies:
2256 .\" NS   doc-arg-type
2258 .de doc-get-arg-type
2259 .  nr doc-arg-type 2
2261 .  if ((\n[doc-width] < 4) & \A\a\$1\a) \{\
2262 .    ie (\n[doc-width] == 1) \{\
2263 .      if r doc-punct\$1 \
2264 .        nr doc-arg-type \n[doc-punct\$1]
2265 .    \}
2266 .    el \
2267 .      if r \$1 \
2268 .        if d \$1 \
2269 .          nr doc-arg-type 1
2270 .  \}
2274 .\" NS doc-get-arg-type* macro
2275 .\" NS   similar to as `doc-get-arg-type' but uses doc-argXXX strings
2276 .\" NS
2277 .\" NS   this macro sets the `doc-width' register using the `length' request
2278 .\" NS   to get the number of characters in a string literally
2279 .\" NS
2280 .\" NS modifies:
2281 .\" NS   doc-arg-type
2282 .\" NS   doc-width
2284 .de doc-get-arg-type*
2285 .  nr doc-arg-type 2
2286 .  length doc-width "\*[doc-arg\$1]
2288 .  if ((\n[doc-width] < 4) & \A\a\*[doc-arg\$1]\a) \{\
2289 .    ie (\n[doc-width] == 1) \{\
2290 .      if r doc-punct\*[doc-arg\$1] \
2291 .        nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
2292 .    \}
2293 .    el \
2294 .      if r \*[doc-arg\$1] \
2295 .        if d \*[doc-arg\$1] \
2296 .          nr doc-arg-type 1
2297 .  \}
2301 .\" NS doc-set-spacing-1 macro
2302 .\" NS   set spacing for macros
2303 .\" NS
2304 .\" NS modifies:
2305 .\" NS   doc-spaceXXX
2306 .\" NS
2307 .\" NS local variables:
2308 .\" NS   doc-reg-dssfm
2309 .\" NS   doc-reg-dssfm1
2311 .de doc-set-spacing-1
2312 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2314 .  \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2315 .  \" argument)
2316 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2317 .    if \n[doc-arg-limit] \{\
2318 .      nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2319 .      ds doc-space\n[doc-reg-dssfm]
2320 .    \}
2321 .    ds doc-space\n[doc-arg-limit] "\*[doc-space]
2322 .  \}
2323 .  el \{\
2324 .    \" macros like .Ap and .Ns have value 2 (remove space before and after
2325 .    \" argument)
2326 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2327 .      if \n[doc-arg-limit] \{\
2328 .        nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2329 .        ds doc-space\n[doc-reg-dssfm]
2330 .      \}
2331 .      ds doc-space\n[doc-arg-limit]
2332 .    \}
2333 .    el \
2334 .      ds doc-space\n[doc-arg-limit]
2335 .  \}
2339 .\" NS doc-set-spacing-2 macro
2340 .\" NS   set spacing for strings
2341 .\" NS
2342 .\" NS modifies:
2343 .\" NS   doc-spaceXXX
2345 .de doc-set-spacing-2
2346 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2350 .\" NS doc-set-spacing-3 macro
2351 .\" NS   set spacing for punctuation suffixes
2352 .\" NS
2353 .\" NS modifies:
2354 .\" NS   doc-spaceXXX
2355 .\" NS
2356 .\" NS local variables:
2357 .\" NS   doc-reg-dssfps
2359 .de doc-set-spacing-3
2360 .  if \n[doc-arg-limit] \{\
2361 .    nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2362 .    ds doc-space\n[doc-reg-dssfps]
2363 .  \}
2365 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2369 .\" NS doc-set-spacing-4 macro
2370 .\" NS   set spacing for punctuation prefixes
2371 .\" NS
2372 .\" NS modifies:
2373 .\" NS   doc-spaceXXX
2375 .de doc-set-spacing-4
2376 .  ds doc-space\n[doc-arg-limit]
2380 .\" type switches (on current argument doc-arg-ptr)
2383 .\" NS doc-do-1 macro
2384 .\" NS   call request if macro
2386 .de doc-do-1
2387 .  \*[doc-arg\n[doc-arg-ptr]]
2391 .\" NS doc-do-2 macro
2392 .\" NS   call .doc-print-recursive if string
2394 .als doc-do-2 doc-print-recursive
2397 .\" NS doc-do-3 macro
2398 .\" NS   call .doc-print-recursive if punctuation suffix
2400 .als doc-do-3 doc-print-recursive
2403 .\" NS doc-do-4 macro
2404 .\" NS   call .doc-print-recursive if punctuation prefix
2406 .als doc-do-4 doc-print-recursive
2409 .\" NS doc-fontmode-depth global register
2410 .\" NS   font mode level
2412 .nr doc-fontmode-depth 0
2415 .\" NS doc-fontmode-font-stackXXX global register
2416 .\" NS   stack of saved current font values from `Bf' request
2417 .\" NS
2418 .\" NS limit:
2419 .\" NS   doc-fontmode-depth
2421 .nr doc-fontmode-font-stack0 0
2424 .\" NS doc-fontmode-size-stackXXX global register
2425 .\" NS   stack of saved current size values from `Bf' request
2426 .\" NS
2427 .\" NS limit:
2428 .\" NS   doc-fontmode-depth
2430 .nr doc-fontmode-size-stack0 0
2433 .\" NS Bf user macro
2434 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2435 .\" NS
2436 .\" NS modifies:
2437 .\" NS   doc-fontmode-depth
2438 .\" NS   doc-fontmode-font-stackXXX
2439 .\" NS   doc-fontmode-size-stackXXX
2440 .\" NS   doc-macro-name
2441 .\" NS
2442 .\" NS width register `Bf' set in doc-common
2444 .de Bf
2445 .  ds doc-macro-name Bf
2447 .  ie \n[.$] \{\
2448 .    nr doc-fontmode-depth +1
2450 .    \" save current font and size
2451 .    nr doc-fontmode-font-stack\n[doc-fontmode-depth] \n[.f]
2452 .    nr doc-fontmode-size-stack\n[doc-fontmode-depth] \n[.ps]
2454 .    ie        "\$1"Em" \
2455 .      nop \*[doc-Em-font]\c
2456 .    el \{ .ie "\$1"Li" \
2457 .      nop \*[doc-Li-font]\c
2458 .    el \{ .ie "\$1"Sy" \
2459 .      nop \*[doc-Sy-font]\c
2460 .    el \{ .ie "\$1"-emphasis" \
2461 .      nop \*[doc-Em-font]\c
2462 .    el \{ .ie "\$1"-literal" \
2463 .      nop \*[doc-Li-font]\c
2464 .    el \{ .ie "\$1"-symbolic" \
2465 .      nop \*[doc-Sy-font]\c
2466 .    el \{\
2467 .      tmc mdoc warning: Unknown keyword `\$1' in .Bf request
2468 .      tm1 " (#\n[.c])
2469 .  \}\}\}\}\}\}\}
2470 .  el \
2471 .    tm Usage: .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2475 .\" NS Ef user macro
2476 .\" NS   end font mode
2477 .\" NS
2478 .\" NS modifies:
2479 .\" NS   doc-macro-name
2480 .\" NS
2481 .\" NS width register `Ef' set in doc-common
2483 .de Ef
2484 .  ds doc-macro-name Ef
2486 .  ie \n[doc-fontmode-depth] \{\
2487 .    \" restore saved font and size
2488 .    nop \)\f[\n[doc-fontmode-font-stack\n[doc-fontmode-depth]]]\c
2489 .    nop \)\s[\n[doc-fontmode-size-stack\n[doc-fontmode-depth]]u]\c
2491 .    nr doc-fontmode-font-stack\n[doc-fontmode-depth] 0
2492 .    nr doc-fontmode-size-stack\n[doc-fontmode-depth] 0
2493 .    nr doc-fontmode-depth -1
2494 .  \}
2495 .  el \
2496 .    tm mdoc warning: Extraneous .Ef (#\n[.c])
2500 .\" NS doc-keep-type global register
2501 .\" NS   current keep type; 1 is `-words', 2 is `-lines', 3 is unknown
2503 .nr doc-keep-type 0
2506 .\" NS Bk user macro
2507 .\" NS   begin keep
2508 .\" NS
2509 .\" NS modifies:
2510 .\" NS   doc-keep-type
2511 .\" NS   doc-macro-name
2512 .\" NS
2513 .\" NS width register `Bk' set in doc-common
2515 .de Bk
2516 .  ds doc-macro-name Bk
2518 .  if \n[doc-keep-type] \
2519 .    tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2521 .  ie        "\$1"-lines" \{\
2522 .    nr doc-keep-type 2
2523 .    tm .Bk -lines: Not implemented yet. (#\n[.c])
2524 .  \}
2525 .  el \{ .ie "\$1"-words" \{\
2526 .    nr doc-keep-type 1
2527 .    doc-set-hard-space
2528 .  \}
2529 .  el \{ .ie "\$1"" \{\
2530 .    \" default
2531 .    nr doc-keep-type 1
2532 .    doc-set-hard-space
2533 .  \}
2534 .  el \{\
2535 .    tm mdoc warning: Unknown keyword `\$1' in .Bk request (#\n[.c])
2536 .    nr doc-keep-type 3
2537 .  \}\}\}
2539 \#.  nr doc-nesting-level +1
2543 .\" NS Ek user macro
2544 .\" NS   end keep
2545 .\" NS
2546 .\" NS modifies:
2547 .\" NS   doc-keep-type
2548 .\" NS   doc-macro-name
2549 .\" NS
2550 .\" NS width register `Ek' set in doc-common
2552 .de Ek
2553 .  ds doc-macro-name Ek
2555 \#.  nr doc-nesting-level -1
2557 .  ie \n[.$] \
2558 .    tm Usage: .Ek (does not take arguments) (#\n[.c])
2559 .  el \{\
2560 .    if !\n[doc-keep-type] \
2561 .      tm mdoc warning: .Ek found without .Bk before (#\n[.c])
2563 .    ie        (\n[doc-keep-type] == 1) \
2564 .      doc-set-soft-space
2565 .    el \{ .if (\n[doc-keep-type] == 2) \
2566 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2567 .  \}\}
2569 .  nr doc-keep-type 0
2571 \#.  if !"\*[doc-out-string]"" \
2572 \#.    doc-print-out-string
2576 .\" NS doc-display-depth global register
2577 .\" NS   display level
2579 .nr doc-display-depth 0
2582 .\" NS doc-is-compact global register (bool)
2583 .\" NS   set if the `compact' keyword is given
2585 .nr doc-is-compact 0
2588 .\" NS doc-display-type-stackXXX global string
2589 .\" NS   the display type stack
2590 .\" NS
2591 .\" NS limit:
2592 .\" NS   doc-display-depth
2594 .ds doc-display-type-stack0
2597 .\" NS doc-display-indent-stackXXX global register
2598 .\" NS   stack of display indentation values
2599 .\" NS
2600 .\" NS limit:
2601 .\" NS   doc-display-depth
2603 .nr doc-display-indent-stack0 0
2606 .\" NS doc-display-ad-stackXXX global register
2607 .\" NS   stack of saved adjustment modes
2608 .\" NS
2609 .\" NS limit:
2610 .\" NS   doc-display-depth
2612 .nr doc-display-ad-stack0 0
2615 .\" NS doc-display-fi-stackXXX global register
2616 .\" NS   stack of saved fill modes
2617 .\" NS
2618 .\" NS limit:
2619 .\" NS   doc-display-depth
2621 .nr doc-display-fi-stack0 0
2624 .\" NS Bd user macro
2625 .\" NS   begin display
2626 .\" NS
2627 .\" NS width register `Bd' set in doc-common
2628 .\" NS
2629 .\" NS modifies:
2630 .\" NS   doc-curr-font
2631 .\" NS   doc-curr-size
2632 .\" NS   doc-display-depth
2633 .\" NS   doc-display-ad-stackXXX
2634 .\" NS   doc-display-fi-stackXXX
2635 .\" NS   doc-display-file
2636 .\" NS   doc-display-indent-stackXXX
2637 .\" NS   doc-display-type-stackXXX
2638 .\" NS   doc-is-compact
2639 .\" NS   doc-macro-name
2640 .\" NS
2641 .\" NS local variables:
2642 .\" NS   doc-reg-Bd
2644 .de Bd
2645 .  ds doc-macro-name Bd
2647 .  if !\n[.$] \{\
2648 .    tm1 "Usage: .Bd {-literal | -filled | -ragged | -centered | -unfilled}
2649 .    tm1 "           [-offset [string]] [-compact] [-file name] (#\n[.c])
2650 .    return
2651 .  \}
2653 .  nr doc-is-compact 0
2654 .  ds doc-display-file
2655 .  nr doc-reg-Bd 1
2656 .  nr doc-display-depth +1
2658 .  \" save current adjustment and fill modes
2659 .  nr doc-display-ad-stack\n[doc-display-depth] \n[.j]
2660 .  nr doc-display-fi-stack\n[doc-display-depth] \n[.u]
2662 .  ie        "\$1"-literal" \{\
2663 .    ds doc-display-type-stack\n[doc-display-depth] literal
2664 .    nr doc-curr-font \n[.f]
2665 .    nr doc-curr-size \n[.ps]
2667 .    ie t \{\
2668 .      nop \*[doc-Li-font]\c
2669 '      ta T 9n
2670 .    \}
2671 .    el \
2672 '      ta T 8n
2673 .    nf
2674 .  \}
2675 .  el \{ .ie "\$1"-filled" \{\
2676 .    ds doc-display-type-stack\n[doc-display-depth] filled
2677 .    ad b
2678 .    fi
2679 .  \}
2680 .  el \{ .ie "\$1"-ragged" \{\
2681 .    ds doc-display-type-stack\n[doc-display-depth] ragged
2682 .    na
2683 .    fi
2684 .  \}
2685 .  el \{ .ie "\$1"-centered" \{\
2686 .    ds doc-display-type-stack\n[doc-display-depth] centered
2687 .    ad c
2688 .    fi
2689 .  \}
2690 .  el \{ .ie "\$1"-unfilled" \{\
2691 .    ds doc-display-type-stack\n[doc-display-depth] unfilled
2692 .    nf
2693 .  \}
2694 .  el \{\
2695 .    tm1 "mdoc warning: Unknown keyword `\$1' (or missing display type)
2696 .    tm1 "              in .Bd request (#\n[.c])
2697 .    nr doc-reg-Bd 0
2698 .  \}\}\}\}\}
2700 .  \" have we seen an argument?
2701 .  if \n[doc-reg-Bd] \{\
2702 .    shift
2703 .    \" check other arguments
2704 .    if \n[.$] \
2705 .      doc-do-Bd-args \$@
2706 .  \}
2708 .  \" avoid warning about non-existent register
2709 .  if !r doc-display-indent-stack\n[doc-display-depth] \
2710 .    nr doc-display-indent-stack\n[doc-display-depth] 0
2712 .  if \n[doc-display-indent-stack\n[doc-display-depth]] \
2713 '    in +\n[doc-display-indent-stack\n[doc-display-depth]]u
2715 .  if !\n[doc-is-compact] \{\
2716 .    if !\n[doc-in-synopsis-count] \{\
2717 .      ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2718 .        sp \n[doc-display-vertical]u
2719 .      el \
2720 '        sp \n[doc-display-vertical]u
2721 .  \}\}
2723 .  if !\n[cR] \
2724 .    ne 2v
2726 .  if !"\*[doc-display-file]"" \
2727 .    so \*[doc-display-file]
2729 .  nr doc-is-compact 0
2730 .  ds doc-display-file
2734 .\" NS doc-do-Bd-args macro
2735 .\" NS   resolve remaining .Bd arguments
2736 .\" NS
2737 .\" NS modifies:
2738 .\" NS   doc-display-file
2739 .\" NS   doc-display-indent-stackXXX
2740 .\" NS   doc-is-compact
2741 .\" NS
2742 .\" NS local variables:
2743 .\" NS   doc-reg-ddBa
2744 .\" NS   doc-reg-ddBa1
2745 .\" NS   doc-reg-ddBa2
2746 .\" NS   doc-reg-ddBa3
2747 .\" NS   doc-reg-ddBa4
2748 .\" NS   doc-str-ddBa
2750 .de doc-do-Bd-args
2751 .  nr doc-reg-ddBa 1
2753 .  ie        "\$1"-offset" \{\
2754 .    nr doc-reg-ddBa 2
2756 .    ie        "\$2"left" \
2757 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2758 .    el \{ .ie "\$2"right" \
2759 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2760 .    el \{ .ie "\$2"center" \
2761 .      nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2762 .    el \{ .ie "\$2"indent" \
2763 .      nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2764 .    el \{ .ie "\$2"indent-two" \
2765 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2766 .    el \
2767 .      nr doc-reg-ddBa 1
2768 .    \}\}\}\}
2770 .    \" not a known keyword
2771 .    if (\n[doc-reg-ddBa] == 1) \{\
2772 .      nr doc-reg-ddBa 2
2774 .      nr doc-reg-ddBa1 0
2775 .      if \B\a(\$2)\a \{\
2776 .        \" disable warnings related to scaling indicators (32)
2777 .        nr doc-reg-ddBa2 \n[.warn]
2778 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
2780 .        \" values without a scaling indicator are taken as strings;
2781 .        \" we test whether the parameter string with and without the last
2782 .        \" character yields identical numerical results (ignoring the
2783 .        \" scaling indicator)
2784 .        ds doc-str-ddBa "\$2
2785 .        substring doc-str-ddBa 1 -1
2786 .        if \B\a(\*[doc-str-ddBa])\a \{\
2787 .          nr doc-reg-ddBa3 (;(\$2))
2788 .          nr doc-reg-ddBa4 (\*[doc-str-ddBa])
2789 .          if (\n[doc-reg-ddBa3] == \n[doc-reg-ddBa4]) \
2790 .            nr doc-reg-ddBa1 1
2791 .        \}
2793 .        \" enable all warnings again
2794 .        warn \n[doc-reg-ddBa2]
2795 .      \}
2797 .      ie \n[doc-reg-ddBa1] \
2798 .        nr doc-display-indent-stack\n[doc-display-depth] \$2
2799 .      el \{\
2800 .        doc-get-width "\$2"
2801 .        ie (\n[doc-width] <= 3) \{\
2802 .          \" if the offset parameter is a macro, use the macro's
2803 .          \" width as specified in doc-common
2804 .          doc-get-arg-type "\$2"
2805 .          ie (\n[doc-arg-type] == 1) \
2806 .            nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
2807 .          el \
2808 .            nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2809 .        \}
2810 .        el \
2811 .          nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2812 .    \}\}
2813 .  \}
2814 .  el \{ .ie "\$1"-compact" \
2815 .    nr doc-is-compact 1
2816 .  el \{ .ie "\$1"-file" \{\
2817 .    ie !"\$2"" \{\
2818 .      ds doc-display-file "\$2
2819 .      nr doc-reg-ddBa 2
2820 .    \}
2821 .    el \
2822 .      tm mdoc warning: .Bd `-file' keyword requires argument (#\n[.c])
2823 .  \}
2824 .  el \
2825 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2826 .  \}\}
2828 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
2829 .    shift \n[doc-reg-ddBa]
2830 .    doc-do-Bd-args \$@
2831 .  \}
2835 .\" NS Ed user macro
2836 .\" NS   end display
2837 .\" NS
2838 .\" NS modifies:
2839 .\" NS   doc-display-depth
2840 .\" NS   doc-display-indent-stackXXX
2841 .\" NS   doc-display-type-stackXXX
2842 .\" NS   doc-macro-name
2843 .\" NS
2844 .\" NS width register `Ed' set in doc-common
2846 .de Ed
2847 .  ds doc-macro-name Ed
2849 .  br
2851 .  if !\n[doc-display-depth] \{\
2852 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
2853 .    nr doc-display-depth 1
2854 .  \}
2856 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2857 .    ft \n[doc-curr-font]
2858 .    ps \n[doc-curr-size]u
2859 .  \}
2861 .  in -\n[doc-display-indent-stack\n[doc-display-depth]]u
2863 .  \" restore saved adjustment and fill modes
2864 .  ie \n[doc-display-fi-stack\n[doc-display-depth]] \
2865 .    fi
2866 .  el \
2867 .    nf
2868 .  ad \n[doc-display-ad-stack\n[doc-display-depth]]
2870 .  nr doc-display-indent-stack\n[doc-display-depth] 0
2871 .  ds doc-display-type-stack\n[doc-display-depth]
2872 .  nr doc-display-depth -1
2876 .\" NS doc-list-type-stackXXX global string
2877 .\" NS   stack of list types
2878 .\" NS
2879 .\" NS limit:
2880 .\" NS   doc-list-depth
2882 .ds doc-list-type-stack1
2885 .\" NS doc-list-indent-stackXXX global register
2886 .\" NS   stack of list indentation values
2887 .\" NS
2888 .\" NS limit:
2889 .\" NS   doc-list-depth
2891 .nr doc-list-indent-stack1 0
2894 .\" NS doc-list-have-indent-stackXXX global register (bool)
2895 .\" NS   an indentation value is active
2896 .\" NS
2897 .\" NS limit:
2898 .\" NS   doc-list-depth
2900 .nr doc-list-have-indent-stack1 0
2903 .\" NS Bl user macro
2904 .\" NS   begin list
2905 .\" NS
2906 .\" NS width register `Bl' set in doc-common
2907 .\" NS
2908 .\" NS modifies:
2909 .\" NS   doc-arg-ptr
2910 .\" NS   doc-argXXX
2911 .\" NS   doc-list-depth
2912 .\" NS   doc-list-have-indent-stackXXX
2913 .\" NS   doc-list-indent-stackXXX
2914 .\" NS   doc-list-type-stackXXX
2915 .\" NS   doc-macro-name
2916 .\" NS   doc-num-args
2917 .\" NS   doc-num-columns
2918 .\" NS
2919 .\" NS local variables:
2920 .\" NS   doc-reg-Bl
2922 .de Bl
2923 .  if !\n[.$] \{\
2924 .    doc-Bl-usage
2925 .    return
2926 .  \}
2928 .  ds doc-macro-name Bl
2929 .  nr doc-list-depth +1
2930 .  nr doc-arg-ptr 1
2932 .  ie        "\$1"-hang" \{\
2933 .    ds doc-list-type-stack\n[doc-list-depth] hang-list
2934 .    nr doc-list-indent-stack\n[doc-list-depth] 6n
2935 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2936 .  \}
2937 .  el \{ .ie "\$1"-tag" \{\
2938 .    ds doc-list-type-stack\n[doc-list-depth] tag-list
2939 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2940 .  \}
2941 .  el \{ .ie "\$1"-item" \{\
2942 .    ds doc-list-type-stack\n[doc-list-depth] item-list
2943 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2944 .  \}
2945 .  el \{ .ie "\$1"-enum" \{\
2946 .    ds doc-list-type-stack\n[doc-list-depth] enum-list
2947 .    nr doc-list-indent-stack\n[doc-list-depth] 3n
2948 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2949 .  \}
2950 .  el \{ .ie "\$1"-bullet" \{\
2951 .    ds doc-list-type-stack\n[doc-list-depth] bullet-list
2952 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2953 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2954 .  \}
2955 .  el \{ .ie "\$1"-dash" \{\
2956 .    ds doc-list-type-stack\n[doc-list-depth] dash-list
2957 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2958 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2959 .  \}
2960 .  el \{ .ie "\$1"-hyphen" \{\
2961 .    ds doc-list-type-stack\n[doc-list-depth] dash-list
2962 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2963 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2964 .  \}
2965 .  el \{ .ie "\$1"-inset" \{\
2966 .    ds doc-list-type-stack\n[doc-list-depth] inset-list
2967 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2968 .  \}
2969 .  el \{ .ie "\$1"-diag" \{\
2970 .    ds doc-list-type-stack\n[doc-list-depth] diag-list
2971 .  \}
2972 .  el \{ .ie "\$1"-ohang" \{\
2973 .    ds doc-list-type-stack\n[doc-list-depth] ohang-list
2974 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2975 .  \}
2976 .  el \{ .ie "\$1"-column" \{\
2977 .    ds doc-list-type-stack\n[doc-list-depth] column-list
2978 .    linetabs 1
2979 .  \}
2980 .  el \{\
2981 .    tm1 "mdoc warning: Unknown list type `\$1' (or missing list type)
2982 .    tm1 "              in .Bl request
2983 .    tm
2984 .    nr doc-arg-ptr 0
2985 .  \}\}\}\}\}\}\}\}\}\}\}
2987 .  \" we have seen a list type
2988 .  if !\n[doc-arg-ptr] \{\
2989 .    doc-Bl-usage
2990 .    doc-reset-args
2991 .    nr doc-list-depth -1
2992 .    return
2993 .  \}
2995 .  shift
2997 .  \" fill argument vector
2998 .  nr doc-reg-Bl 1
2999 .  while (\n[doc-reg-Bl] <= \n[.$]) \{\
3000 .    ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
3001 .    nr doc-reg-Bl +1
3002 .  \}
3004 .  doc-increment-list-stack
3006 .  if \n[.$] \{\
3007 .    nr doc-arg-limit \n[.$]
3008 .    nr doc-arg-ptr 0
3009 .    doc-do-Bl-args
3011 .    in +\n[doc-list-offset-stack\n[doc-list-depth]]u
3013 .    \" initialize column list
3014 .    if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3015 .      doc-set-column-tab \n[doc-num-columns]
3016 '      in -\n[doc-column-indent-width]u
3017 .      if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3018 .        sp \n[doc-display-vertical]u
3020 .      nf
3021 .      nr doc-num-columns 0
3022 .  \}\}
3024 .  doc-reset-args
3028 .\" NS doc-Bl-usage macro
3030 .de doc-Bl-usage
3031 .  tm1 "Usage: .Bl {-hang | -ohang | -tag | -diag | -inset}
3032 .  tm1 "             [-width <string>] [-xwidth <command>]
3033 .  tm1 "             [-offset <string>] [-compact]
3034 .  tm1 "       .Bl -column [-offset <string>] <string1> <string2> ...
3035 .  tm1 "       .Bl {-item | -enum [-nested] | -bullet | -hyphen | -dash}
3036 .  tm1 "             [-offset <string>] [-compact] (#\n[.c])
3040 .\" NS doc-do-Bl-args macro
3041 .\" NS   resolve remaining .Bl arguments
3042 .\" NS
3043 .\" NS modifies:
3044 .\" NS   doc-arg-ptr
3045 .\" NS   doc-argXXX
3046 .\" NS   doc-compact-list-stackXXX
3047 .\" NS   doc-list-indent-stackXXX
3048 .\" NS   doc-list-offset-stackXXX
3049 .\" NS   doc-num-columns
3050 .\" NS   doc-tag-prefix-stackXXX
3051 .\" NS   doc-tag-width-stackXXX
3052 .\" NS
3053 .\" NS local variables:
3054 .\" NS   doc-box-dBla
3055 .\" NS   doc-env-dBla
3056 .\" NS   doc-reg-dBla
3057 .\" NS   doc-reg-dBla1
3058 .\" NS   doc-reg-dBla2
3059 .\" NS   doc-reg-dBla3
3060 .\" NS   doc-reg-dBla4
3061 .\" NS   doc-str-dBla
3062 .\" NS   doc-str-dBla1
3064 .de doc-do-Bl-args
3065 .  nr doc-arg-ptr +1
3067 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
3068 .    return
3070 .  \" avoid a warning message in case e.g. `-offset' has no parameter
3071 .  nr doc-reg-dBla (\n[doc-arg-ptr] + 1)
3072 .  if !d doc-arg\n[doc-reg-dBla] \
3073 .    ds doc-arg\n[doc-reg-dBla]
3075 .  nr doc-reg-dBla 1
3077 .  ie        "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3078 .    nr doc-compact-list-stack\n[doc-list-depth] 1
3080 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-nested" \{\
3081 .    ie (\n[doc-list-depth] > 1) \{\
3082 .      nr doc-reg-dBla1 (\n[doc-list-depth] - 1)
3083 .      ds doc-tag-prefix-stack\n[doc-list-depth] "\*[doc-tag-prefix-stack\n[doc-reg-dBla1]]
3084 .      as doc-tag-prefix-stack\n[doc-list-depth] \n[doc-enum-list-count-stack\n[doc-reg-dBla1]].
3085 .      length doc-reg-dBla1 "\*[doc-tag-prefix-stack\n[doc-list-depth]]
3086 .      nr doc-list-indent-stack\n[doc-list-depth] +\n[doc-reg-dBla1]n
3087 .    \}
3088 .    el \
3089 .      tm mdoc warning: `-nested' allowed with nested .Bl requests only (#\n[.c])
3090 .  \}
3092 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3093 .    nr doc-arg-ptr +1
3094 .    ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3095 .    ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3097 .    \" test whether argument is a valid numeric expression
3098 .    nr doc-reg-dBla1 0
3099 .    if \B\a(\*[doc-str-dBla])\a \{\
3100 .      \" disable warnings related to scaling indicators (32)
3101 .      nr doc-reg-dBla2 \n[.warn]
3102 .      warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3104 .      \" values without a scaling indicator are taken as strings;
3105 .      \" we test whether the parameter string with and without the last
3106 .      \" character yields identical numerical results (ignoring the
3107 .      \" scaling indicator)
3108 .      ds doc-str-dBla1 "\*[doc-str-dBla]
3109 .      substring doc-str-dBla1 1 -1
3110 .      if \B\a(\*[doc-str-dBla1])\a \{\
3111 .        nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3112 .        nr doc-reg-dBla4 (\*[doc-str-dBla1])
3113 .        if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3114 .          nr doc-reg-dBla1 1
3115 .      \}
3117 .      \" enable all warnings again
3118 .      warn \n[doc-reg-dBla2]
3119 .    \}
3121 .    ie \n[doc-reg-dBla1] \
3122 .      nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
3123 .    el \{\
3124 .      doc-get-arg-width \n[doc-arg-ptr]
3125 .      ie (\n[doc-width] == 2) \{\
3126 .        \" if the width parameter is a macro, use the macro's
3127 .        \" width as specified in doc-common
3128 .        doc-get-arg-type \*[doc-str-dBla]
3129 .        ie (\n[doc-arg-type] == 1) \
3130 .          nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3131 .        el \
3132 .          nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3133 .      \}
3134 .      el \
3135 .        nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3136 .  \}\}
3138 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
3139 .    nr doc-arg-ptr +1
3140 .    ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3142 .    ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3143 .    substring doc-str-dBla 1 2
3144 .    if \a.\a\*[doc-str-dBla]\a \{\
3145 .      \" execute string in a box to get the width of the diversion
3146 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3147 .      doc-save-global-vars
3148 .      doc-reset-args
3149 .      box doc-box-dBla
3150 .      ev doc-env-dBla
3151 .      evc 0
3152 .      in 0
3153 .      nf
3154 .      nop \*[doc-str-dBla]
3155 .      br
3156 .      ev
3157 .      box
3158 .      doc-restore-global-vars
3159 .      doc-get-width \h'\n[dl]u'
3160 .    \}
3161 .    nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3162 .  \}
3164 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3165 .    nr doc-arg-ptr +1
3167 .    ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3168 .      nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3169 .    el \{\
3170 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3171 .      nr doc-reg-dBla1 0
3172 .      if \B\a(\*[doc-str-dBla])\a \{\
3173 .        nr doc-reg-dBla2 \n[.warn]
3174 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3176 .        ds doc-str-dBla1 "\*[doc-str-dBla]
3177 .        substring doc-str-dBla1 1 -1
3178 .        if \B\a(\*[doc-str-dBla1])\a \{\
3179 .          nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3180 .          nr doc-reg-dBla4 (\*[doc-str-dBla1])
3181 .          if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3182 .            nr doc-reg-dBla1 1
3183 .        \}
3185 .        warn \n[doc-reg-dBla2]
3186 .      \}
3188 .      ie \n[doc-reg-dBla1] \
3189 .        nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3190 .      el \{\
3191 .        doc-get-arg-width \n[doc-arg-ptr]
3192 .        ie (\n[doc-width] <= 3) \{\
3193 .          \" if the offset parameter is a macro, use the macro's
3194 .          \" width as specified in doc-common
3195 .          doc-get-arg-type \*[doc-str-dBla]
3196 .          ie (\n[doc-arg-type] == 1) \
3197 .            nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3198 .          el \
3199 .            nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3200 .        \}
3201 .        el \
3202 .          nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3203 .  \}\}\}
3204 .  el \
3205 .    nr doc-reg-dBla 0
3206 .  \}\}\}\}
3208 .  \" not a known keyword, so it specifies the width of the next column
3209 .  \" (if it is a column list)
3210 .  if !\n[doc-reg-dBla] \{\
3211 .    ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3212 .      nr doc-num-columns +1
3213 .      ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3214 .    \}
3215 .    el \{\
3216 .      tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3217 .      tm1 " in .Bl request (#\n[.c])
3218 .  \}\}
3220 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3221 .    doc-do-Bl-args
3225 .\" NS doc-save-global-vars macro
3226 .\" NS   save all global variables
3227 .\" NS
3228 .\" NS local variables:
3229 .\" NS   doc-reg-dsgv
3231 .de doc-save-global-vars
3232 .  ds doc-macro-name-saved "\*[doc-macro-name]
3233 .  nr doc-arg-limit-saved \n[doc-arg-limit]
3234 .  nr doc-num-args-saved \n[doc-num-args]
3235 .  nr doc-arg-ptr-saved \n[doc-arg-ptr]
3237 .  nr doc-reg-dsgv 1
3238 .  while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3239 .    ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3240 .    nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
3241 .    ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3242 .    nr doc-reg-dsgv +1
3243 .  \}
3245 .  nr doc-curr-font-saved \n[doc-curr-font]
3246 .  nr doc-curr-size-saved \n[doc-curr-size]
3247 .  nr doc-in-synopsis-count-saved \n[doc-in-synopsis-count]
3248 .  nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3249 .  nr doc-have-decl-saved \n[doc-have-decl]
3250 .  nr doc-have-var-saved \n[doc-have-var]
3251 .  ds doc-command-name-saved "\*[doc-command-name]
3252 .  ds doc-quote-left-saved "\*[doc-quote-left]
3253 .  ds doc-quote-right-saved "\*[doc-quote-right]
3254 .  nr doc-nesting-level-saved \n[doc-nesting-level]
3255 .  nr doc-in-list-saved \n[doc-in-list]
3256 .  ds doc-space-saved "\*[doc-space]
3257 .  ds doc-saved-space-saved "\*[doc-saved-space]
3258 .  nr doc-space-mode-saved \n[doc-space-mode]
3259 .  nr doc-have-space-saved \n[doc-have-space]
3260 .  nr doc-have-slot-saved \n[doc-have-slot]
3261 .  nr doc-keep-type-saved \n[doc-keep-type]
3262 .  nr doc-display-depth-saved \n[doc-display-depth]
3263 .  nr doc-is-compact-saved \n[doc-is-compact]
3265 .  nr doc-reg-dsgv 0
3266 .  while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3267 .    ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3268 .    nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3269 .    nr doc-display-ad-stack\n[doc-reg-dsgv]-saved \n[doc-display-ad-stack\n[doc-reg-dsgv]]
3270 .    nr doc-display-fi-stack\n[doc-reg-dsgv]-saved \n[doc-display-fi-stack\n[doc-reg-dsgv]]
3271 .    nr doc-reg-dsgv +1
3272 .  \}
3274 .  nr doc-fontmode-depth-saved \n[doc-fontmode-depth]
3276 .  nr doc-reg-dsgv 1
3277 .  while (\n[doc-reg-dsgv] <= \n[doc-fontmode-depth]) \{\
3278 .    nr doc-fontmode-font-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-font-stack\n[doc-reg-dsgv]]
3279 .    nr doc-fontmode-size-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-size-stack\n[doc-reg-dsgv]]
3280 .    nr doc-reg-dsgv +1
3281 .  \}
3283 .  nr doc-list-depth-saved \n[doc-list-depth]
3285 .  nr doc-reg-dsgv 1
3286 .  while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3287 .    ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3288 .    nr doc-list-have-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-have-indent-stack\n[doc-reg-dsgv]]
3289 .    nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3290 .    nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3291 .    ds doc-tag-prefix-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-prefix-stack\n[doc-reg-dsgv]]
3292 .    ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3293 .    nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3294 .    nr doc-enum-list-count-stack\n[doc-reg-dsgv]-saved \n[doc-enum-list-count-stack\n[doc-reg-dsgv]]
3295 .    nr doc-reg-dsgv +1
3296 .  \}
3298 .  ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3299 .  nr doc-curr-type-saved \n[doc-curr-type]
3300 .  ds doc-curr-arg-saved "\*[doc-curr-arg]
3301 .  nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3302 .  nr doc-num-columns-saved \n[doc-num-columns]
3303 .  nr doc-column-indent-width-saved \n[doc-column-indent-width]
3304 .  nr doc-is-func-saved \n[doc-is-func]
3305 .  nr doc-have-old-func-saved \n[doc-have-old-func]
3306 .  nr doc-func-arg-count-saved \n[doc-func-arg-count]
3307 .  ds doc-func-arg-saved "\*[doc-func-arg]
3308 .  nr doc-num-func-args-saved \n[doc-num-func-args]
3309 .  nr doc-func-args-processed-saved \n[doc-func-args-processed]
3310 .  nr doc-have-func-saved \n[doc-have-func]
3311 .  nr doc-is-reference-saved \n[doc-is-reference]
3312 .  nr doc-reference-count-saved \n[doc-reference-count]
3313 .  nr doc-author-count-saved \n[doc-author-count]
3315 .  nr doc-reg-dsgv 0
3316 .  while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3317 .    ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3318 .    nr doc-reg-dsgv +1
3319 .  \}
3321 .  nr doc-book-count-saved \n[doc-book-count]
3322 .  ds doc-book-name-saved "\*[doc-book-name]
3323 .  nr doc-date-count-saved \n[doc-date-count]
3324 .  ds doc-date-saved "\*[doc-date]
3325 .  nr doc-publisher-count-saved \n[doc-publisher-count]
3326 .  ds doc-publisher-name-saved "\*[doc-publisher-name]
3327 .  nr doc-journal-count-saved \n[doc-journal-count]
3328 .  ds doc-journal-name-saved "\*[doc-journal-name]
3329 .  nr doc-issue-count-saved \n[doc-issue-count]
3330 .  ds doc-issue-name-saved "\*[doc-issue-name]
3331 .  nr doc-optional-count-saved \n[doc-optional-count]
3332 .  ds doc-optional-string-saved "\*[doc-optional-string]
3333 .  nr doc-page-number-count-saved \n[doc-page-number-count]
3334 .  ds doc-page-number-string-saved "\*[doc-page-number-string]
3335 .  nr doc-corporate-count-saved \n[doc-corporate-count]
3336 .  ds doc-corporate-name-saved "\*[doc-corporate-name]
3337 .  nr doc-report-count-saved \n[doc-report-count]
3338 .  ds doc-report-name-saved "\*[doc-report-name]
3339 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
3340 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3341 .  ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
3342 .  nr doc-volume-count-saved \n[doc-volume-count]
3343 .  ds doc-volume-name-saved "\*[doc-volume-name]
3344 .  nr doc-have-author-saved \n[doc-have-author]
3346 .  ds doc-document-title-saved "\*[doc-document-title]
3347 .  ds doc-volume-saved "\*[doc-volume]
3348 .  ds doc-section-saved "\*[doc-section]
3349 .  ds doc-operating-system-saved "\*[doc-operating-system]
3350 .  ds doc-date-string-saved "\*[doc-date-string]
3351 .  nr doc-header-space-saved \n[doc-header-space]
3352 .  nr doc-footer-space-saved \n[doc-footer-space]
3353 .  nr doc-display-vertical-saved \n[doc-display-vertical]
3354 .  ds doc-header-string-saved "\*[doc-header-string]
3355 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3356 .  nr doc-in-files-section-saved \n[doc-in-files-section]
3357 .  nr doc-in-authors-section-saved \n[doc-in-authors-section]
3361 .\" NS doc-restore-global-vars macro
3362 .\" NS   restore all global variables
3363 .\" NS
3364 .\" NS local variables:
3365 .\" NS   doc-reg-drgv
3367 .de doc-restore-global-vars
3368 .  ds doc-macro-name "\*[doc-macro-name-saved]
3369 .  nr doc-arg-limit \n[doc-arg-limit-saved]
3370 .  nr doc-num-args \n[doc-num-args-saved]
3371 .  nr doc-arg-ptr \n[doc-arg-ptr-saved]
3373 .  nr doc-reg-drgv 1
3374 .  while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3375 .    ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3376 .    nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
3377 .    ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3378 .    nr doc-reg-drgv +1
3379 .  \}
3381 .  nr doc-curr-font \n[doc-curr-font-saved]
3382 .  nr doc-curr-size \n[doc-curr-size-saved]
3383 .  nr doc-in-synopsis-count \n[doc-in-synopsis-count-saved]
3384 .  nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3385 .  nr doc-have-decl \n[doc-have-decl-saved]
3386 .  nr doc-have-var \n[doc-have-var-saved]
3387 .  ds doc-command-name "\*[doc-command-name-saved]
3388 .  ds doc-quote-left "\*[doc-quote-left-saved]
3389 .  ds doc-quote-right "\*[doc-quote-right-saved]
3390 .  nr doc-nesting-level \n[doc-nesting-level-saved]
3391 .  nr doc-in-list \n[doc-in-list-saved]
3392 .  ds doc-space "\*[doc-space-saved]
3393 .  ds doc-saved-space "\*[doc-saved-space-saved]
3394 .  nr doc-space-mode \n[doc-space-mode-saved]
3395 .  nr doc-have-space \n[doc-have-space-saved]
3396 .  nr doc-have-slot \n[doc-have-slot-saved]
3397 .  nr doc-keep-type \n[doc-keep-type-saved]
3398 .  nr doc-display-depth \n[doc-display-depth-saved]
3399 .  nr doc-is-compact \n[doc-is-compact-saved]
3401 .  nr doc-reg-drgv 0
3402 .  while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3403 .    ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3404 .    nr doc-display-have-indent-stack\n[doc-reg-drgv] \n[doc-display-have-indent-stack\n[doc-reg-drgv]-saved]
3405 .    nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3406 .    nr doc-display-ad-stack\n[doc-reg-drgv] \n[doc-display-ad-stack\n[doc-reg-drgv]-saved]
3407 .    nr doc-display-fi-stack\n[doc-reg-drgv] \n[doc-display-fi-stack\n[doc-reg-drgv]-saved]
3408 .    nr doc-reg-drgv +1
3409 .  \}
3411 .  nr doc-fontmode-depth \n[doc-fontmode-depth-saved]
3413 .  nr doc-reg-drgv 1
3414 .  while (\n[doc-reg-drgv] <= \n[doc-fontmode-depth]) \{\
3415 .    nr doc-fontmode-font-stack\n[doc-reg-drgv] \n[doc-fontmode-font-stack\n[doc-reg-drgv]]-saved
3416 .    nr doc-fontmode-size-stack\n[doc-reg-drgv] \n[doc-fontmode-size-stack\n[doc-reg-drgv]]-saved
3417 .    nr doc-reg-drgv +1
3418 .  \}
3420 .  nr doc-list-depth \n[doc-list-depth-saved]
3422 .  nr doc-reg-drgv 1
3423 .  while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3424 .    ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3425 .    nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3426 .    nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3427 .    ds doc-tag-prefix-stack\n[doc-reg-drgv] "\*[doc-tag-prefix-stack\n[doc-reg-drgv]-saved]
3428 .    ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3429 .    nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3430 .    nr doc-enum-list-count-stack\n[doc-reg-drgv] \n[doc-enum-list-count-stack\n[doc-reg-drgv]-saved]
3431 .    nr doc-reg-drgv +1
3432 .  \}
3434 .  ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3435 .  nr doc-curr-type \n[doc-curr-type-saved]
3436 .  ds doc-curr-arg "\*[doc-curr-arg-saved]
3437 .  nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3438 .  nr doc-num-columns \n[doc-num-columns-saved]
3439 .  nr doc-column-indent-width \n[doc-column-indent-width-saved]
3440 .  nr doc-is-func \n[doc-is-func-saved]
3441 .  nr doc-have-old-func \n[doc-have-old-func-saved]
3442 .  nr doc-func-arg-count \n[doc-func-arg-count-saved]
3443 .  ds doc-func-arg "\*[doc-func-arg-saved]
3444 .  nr doc-num-func-args \n[doc-num-func-args-saved]
3445 .  nr doc-func-args-processed \n[doc-func-args-processed-saved]
3446 .  nr doc-have-func \n[doc-have-func-saved]
3447 .  nr doc-is-reference \n[doc-is-reference-saved]
3448 .  nr doc-reference-count \n[doc-reference-count-saved]
3449 .  nr doc-author-count \n[doc-author-count-saved]
3451 .  nr doc-reg-drgv 0
3452 .  while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3453 .    ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3454 .    nr doc-reg-drgv +1
3455 .  \}
3457 .  nr doc-book-count \n[doc-book-count-saved]
3458 .  ds doc-book-name "\*[doc-book-name-saved]
3459 .  nr doc-date-count \n[doc-date-count-saved]
3460 .  ds doc-date "\*[doc-date-saved]
3461 .  nr doc-publisher-count \n[doc-publisher-count-saved]
3462 .  ds doc-publisher-name "\*[doc-publisher-name-saved]
3463 .  nr doc-journal-count \n[doc-journal-count-saved]
3464 .  ds doc-journal-name "\*[doc-journal-name-saved]
3465 .  nr doc-issue-count \n[doc-issue-count-saved]
3466 .  ds doc-issue-name "\*[doc-issue-name-saved]
3467 .  nr doc-optional-count \n[doc-optional-count-saved]
3468 .  ds doc-optional-string "\*[doc-optional-string-saved]
3469 .  nr doc-page-number-count \n[doc-page-number-count-saved]
3470 .  ds doc-page-number-string "\*[doc-page-number-string-saved]
3471 .  nr doc-corporate-count \n[doc-corporate-count-saved]
3472 .  ds doc-corporate-name "\*[doc-corporate-name-saved]
3473 .  nr doc-report-count \n[doc-report-count-saved]
3474 .  ds doc-report-name "\*[doc-report-name-saved]
3475 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
3476 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3477 .  ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
3478 .  nr doc-volume-count \n[doc-volume-count-saved]
3479 .  ds doc-volume-name "\*[doc-volume-name-saved]
3480 .  nr doc-have-author \n[doc-have-author-saved]
3482 .  ds doc-document-title "\*[doc-document-title-saved]
3483 .  ds doc-volume "\*[doc-volume-saved]
3484 .  ds doc-section "\*[doc-section-saved]
3485 .  ds doc-operating-system "\*[doc-operating-system-saved]
3486 .  ds doc-date-string "\*[doc-date-string-saved]
3487 .  nr doc-header-space \n[doc-header-space-saved]
3488 .  nr doc-footer-space \n[doc-footer-space-saved]
3489 .  nr doc-display-vertical \n[doc-display-vertical-saved]
3490 .  ds doc-header-string "\*[doc-header-string-saved]
3491 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3492 .  nr doc-in-files-section \n[doc-in-files-section-saved]
3493 .  nr doc-in-authors-section \n[doc-in-authors-section-saved]
3497 .\" NS El user macro
3498 .\" NS   end list
3499 .\" NS
3500 .\" NS modifies:
3501 .\" NS   doc-list-depth
3502 .\" NS   doc-macro-name
3503 .\" NS
3504 .\" NS local variables:
3505 .\" NS   doc-str-El
3506 .\" NS
3507 .\" NS width register `El' set in doc-common
3509 .de El
3510 .  if \n[.$] \{\
3511 .    tm Usage: .El (does not take arguments) (#\n[.c])
3512 .    return
3513 .  \}
3515 .  ds doc-macro-name El
3516 .  ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3518 .  ie        "\*[doc-str-El]"diag-list" \
3519 .    doc-end-list 0
3520 .  el \{ .ie "\*[doc-str-El]"column-list" \
3521 .    doc-end-column-list
3522 .  el \{ .ie "\*[doc-str-El]"item-list" \
3523 .    doc-end-list 0
3524 .  el \{ .ie "\*[doc-str-El]"ohang-list" \
3525 .    doc-end-list 0
3526 .  el \{ .ie "\*[doc-str-El]"inset-list" \
3527 .    doc-end-list 0
3528 .  el \
3529 .    doc-end-list 1
3530 .  \}\}\}\}
3532 .  br
3536 .\" NS doc-saved-Pa-font global string
3537 .\" NS   saved doc-Pa-font string for section FILES (no underline if
3538 .\" NS   nroff)
3540 .ds doc-saved-Pa-font
3543 .\" NS doc-curr-type global register
3544 .\" NS   current argument type
3546 .nr doc-curr-type 0
3549 .\" NS doc-curr-arg global string
3550 .\" NS   current argument
3552 .ds doc-curr-arg
3555 .\" NS doc-item-boxXXX global box
3556 .\" NS   item boxes associated list depth
3557 .\" NS
3558 .\" NS limit:
3559 .\" NS   doc-list-depth
3562 .\" NS It user macro
3563 .\" NS   list item
3564 .\" NS
3565 .\" NS modifies:
3566 .\" NS   doc-arg-ptr
3567 .\" NS   doc-argXXX
3568 .\" NS   doc-curr-arg
3569 .\" NS   doc-curr-type
3570 .\" NS   doc-in-list
3571 .\" NS   doc-macro-name
3572 .\" NS   doc-num-args
3573 .\" NS   doc-saved-Pa-font
3574 .\" NS
3575 .\" NS local variables:
3576 .\" NS   doc-reg-It
3577 .\" NS   doc-str-It
3578 .\" NS   doc-XXX-list-type
3579 .\" NS
3580 .\" NS width register `It' set in doc-common
3582 .nr doc-bullet-list-type 1
3583 .nr doc-column-list-type 0
3584 .nr doc-dash-list-type 1
3585 .nr doc-diag-list-type 0
3586 .nr doc-enum-list-type 1
3587 .nr doc-hang-list-type 2
3588 .nr doc-inset-list-type 2
3589 .nr doc-item-list-type 1
3590 .nr doc-ohang-list-type 2
3591 .nr doc-tag-list-type 2
3593 .de It
3594 .  ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3596 .  if "\*[doc-str-It]"" \
3597 .    tm mdoc error: .It without preceding .Bl (#\n[.c])
3599 .  if \n[doc-nesting-level] \{\
3600 .    tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
3601 .    tm1 " (#\n[.c])
3602 .  \}
3604 .  br
3605 .  if !\n[cR] \
3606 .    ne 3v
3608 .  if \n[.$] \{\
3609 .    ds doc-macro-name It
3611 .    \" fill argument vector
3612 .    nr doc-reg-It 1
3613 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3614 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3615 .      nr doc-reg-It +1
3616 .    \}
3618 .    nr doc-num-args \n[.$]
3619 .    nr doc-arg-ptr 0
3620 .  \}
3622 .  nr doc-reg-It \n[doc-\*[doc-str-It]-type]
3624 .  if \n[doc-reg-It] \{\
3625 .    \" start item box
3626 .    box doc-item-box\n[doc-list-depth]
3627 .    ev doc-item-env\n[doc-list-depth]
3628 .    evc 0
3629 .    in 0
3630 .    nf
3631 .  \}
3633 .  ie (\n[doc-reg-It] == 1) \{\
3634 .    if \n[.$] \{\
3635 .      tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3636 .      tm1 "              don't take arguments (#\n[.c])
3637 .  \}\}
3638 .  el \{\
3639 .    ie \n[.$] \{\
3640 .      if (\n[doc-reg-It] == 2) \{\
3641 .        \" handle list types with arguments
3642 .        doc-parse-arg-vector
3644 .        nr doc-in-list 1
3645 .        nr doc-arg-ptr 1
3646 .        nr doc-curr-type \n[doc-type1]
3647 .        ds doc-curr-arg "\*[doc-arg1]
3649 .        if \n[doc-in-files-section] \{\
3650 .          ds doc-saved-Pa-font "\*[doc-Pa-font]
3651 .          if n \
3652 .            ds doc-Pa-font "\*[doc-No-font]
3653 .        \}
3655 .        ie (\n[doc-type1] == 1) \
3656 .          \*[doc-arg1]
3657 .        el \{\
3658 .          nr doc-arg-ptr 1
3659 .          doc-print-recursive
3660 .    \}\}\}
3661 .    el \{\
3662 .      tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3663 .      tm1 "              require arguments (#\n[.c])
3664 .    \}
3665 .  \}
3667 .  \" the previous call of `.doc-print-recursive' can contain calls to
3668 .  \" opening requests like `.Ao'; we then defer the call of `doc-xxx-list'
3669 .  if !\n[doc-nesting-level] \
3670 .    doc-\*[doc-str-It]
3674 .\" NS doc-inset-list macro
3675 .\" NS   .It item of list-type inset
3676 .\" NS
3677 .\" NS modifies:
3678 .\" NS   doc-in-list
3680 .de doc-inset-list
3681 .  \" finish item box
3682 .  br
3683 .  ev
3684 .  box
3685 .  unformat doc-item-box\n[doc-list-depth]
3687 .  doc-set-vertical-and-indent 0
3688 .  br
3690 .  nh
3691 .  doc-item-box\n[doc-list-depth]
3693 .  nr doc-in-list 0
3694 .  doc-reset-args
3698 .\" NS doc-hang-list macro
3699 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3700 .\" NS
3701 .\" NS modifies:
3702 .\" NS   doc-have-space
3703 .\" NS   doc-in-list
3704 .\" NS
3705 .\" NS local variables:
3706 .\" NS   doc-reg-dhl
3707 .\" NS   doc-reg-dhl1
3709 .de doc-hang-list
3710 .  \" finish item box
3711 .  br
3712 .  ev
3713 .  box
3714 .  unformat doc-item-box\n[doc-list-depth]
3716 .  doc-set-vertical-and-indent 1
3717 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3718 .  ti -\n[doc-reg-dhl]u
3720 .  nh
3721 .  ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3722 .    doc-item-box\n[doc-list-depth]
3723 .  el \{\
3724 .    chop doc-item-box\n[doc-list-depth]
3725 .    nr doc-reg-dhl1 \n[.k]u
3726 .    nop \*[doc-item-box\n[doc-list-depth]]\c
3727 .    nop \h'|(\n[doc-reg-dhl1]u - \n[.k]u + \n[doc-reg-dhl]u)'\c
3728 .    nr doc-have-space 1
3729 .  \}
3731 .  nr doc-in-list 0
3732 .  doc-reset-args
3736 .\" NS doc-ohang-list macro
3737 .\" NS   .It item of list-type overhanging tag
3738 .\" NS
3739 .\" NS modifies:
3740 .\" NS   doc-in-list
3742 .de doc-ohang-list
3743 .  \" finish item box
3744 .  br
3745 .  ev
3746 .  box
3747 .  unformat doc-item-box\n[doc-list-depth]
3749 .  doc-set-vertical-and-indent 0
3750 .  nh
3751 .  doc-item-box\n[doc-list-depth]
3752 .  br
3754 .  nr doc-in-list 0
3755 .  doc-reset-args
3759 .\" NS doc-item-list macro
3760 .\" NS   .It item of list-type [empty tag]
3762 .de doc-item-list
3763 .  \" finish (dummy) item box
3764 .  br
3765 .  ev
3766 .  box
3768 .  doc-set-vertical-and-indent 0
3769 .  br
3771 .  doc-reset-args
3775 .\" NS doc-enum-list-count-stackXXX global register
3776 .\" NS   stack of current enum count values
3777 .\" NS
3778 .\" NS limit:
3779 .\" NS   doc-list-depth
3781 .nr doc-enum-list-count-stack1 0
3784 .\" NS doc-enum-list macro
3785 .\" NS   enumerated list
3786 .\" NS
3787 .\" NS modifies:
3788 .\" NS   doc-enum-list-count-stackXXX
3789 .\" NS   doc-in-list
3791 .de doc-enum-list
3792 .  nr doc-in-list 1
3793 .  nr doc-enum-list-count-stack\n[doc-list-depth] +1
3794 \# XXX
3795 \#.ll \n[doc-list-indent-stack\n[doc-list-depth]]u
3796 \#.rj
3797 .  nop \*[doc-tag-prefix-stack\n[doc-list-depth]]\c
3798 .  nop \n[doc-enum-list-count-stack\n[doc-list-depth]].\&
3799 .  doc-do-list
3803 .\" NS doc-bullet-list macro
3804 .\" NS   bullet paragraph list
3805 .\" NS
3806 .\" NS modifies:
3807 .\" NS   doc-in-list
3809 .de doc-bullet-list
3810 .  nr doc-in-list 1
3811 .  nop \)\*[doc-Sy-font]\[bu]\f[P]
3812 .  doc-do-list
3816 .\" NS doc-dash-list macro
3817 .\" NS   hyphen paragraph list (sub bullet list)
3818 .\" NS
3819 .\" NS modifies:
3820 .\" NS   doc-in-list
3822 .de doc-dash-list
3823 .  nr doc-in-list 1
3824 .  nop \)\*[doc-Sy-font]\-\f[P]
3825 .  doc-do-list
3829 .\" NS doc-do-list macro
3830 .\" NS   .It item of list-type enum/bullet/hyphen
3832 .als doc-do-list doc-hang-list
3835 .\" NS doc-diag-list-input-line-count global register
3836 .\" NS   saved line number to be checked in next diag-list item
3838 .nr doc-diag-list-input-line-count 0
3841 .\" NS doc-diag-list macro
3842 .\" NS   .It item of list-type diagnostic-message
3843 .\" NS
3844 .\" NS modifies:
3845 .\" NS   doc-curr-font
3846 .\" NS   doc-curr-size
3847 .\" NS   doc-diag-list-input-line-count
3849 .de doc-diag-list
3850 .  nr doc-curr-font \n[.f]
3851 .  nr doc-curr-size \n[.ps]
3853 .  ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \{\
3854 .    ie !\n[doc-compact-list-stack\n[doc-list-depth]] \
3855 .      doc-paragraph
3856 .    el \
3857 .      br
3858 .  \}
3859 .  el \
3860 .    br
3861 .  nr doc-diag-list-input-line-count \n[.c]
3863 .  nh
3864 .  nop \*[doc-Sy-font]\c
3865 .  if \n[doc-num-args] \
3866 .    doc-remaining-args
3867 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\*[doc-hard-space]\c
3869 .  doc-print-and-reset
3873 .\" NS doc-tag-list macro
3874 .\" NS   .It item of list-type `tag'
3875 .\" NS
3876 .\" NS modifies:
3877 .\" NS   doc-have-space
3878 .\" NS   doc-in-list
3879 .\" NS
3880 .\" NS local variables:
3881 .\" NS   doc-box-dtl
3882 .\" NS   doc-reg-dtl
3883 .\" NS   doc-reg-dtl1
3885 .de doc-tag-list
3886 .  \" finish item box
3887 .  br
3888 .  ev
3889 .  box
3890 .  unformat doc-item-box\n[doc-list-depth]
3892 .  \" we use a box without `.nf' to compute the tag width (via `dl' register)
3893 .  box doc-box-dtl
3894 .  ev doc-env-dtl
3895 .  evc 0
3896 .  fi
3897 .  ad 0
3898 .  in 0
3899 .  doc-item-box\n[doc-list-depth]
3900 .  br
3901 .  ev
3902 .  box
3904 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3905 .    if !\n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3906 .      in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3907 .      nr doc-list-have-indent-stack\n[doc-list-depth] 1
3908 .    \}
3909 .    doc-get-tag-width
3910 .  \}
3911 .  doc-set-vertical-and-indent 1
3912 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3913 .  ti -\n[doc-reg-dtl]u
3915 .  nh
3916 .  ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3917 .    doc-item-box\n[doc-list-depth]
3918 .    br
3919 .  \}
3920 .  el \{\
3921 .    chop doc-item-box\n[doc-list-depth]
3922 .    nr doc-reg-dtl1 \n[.k]u
3923 .    nop \*[doc-item-box\n[doc-list-depth]]\c
3924 .    nop \h'|(\n[doc-reg-dtl1]u - \n[.k]u + \n[doc-reg-dtl]u)'\c
3925 .    nr doc-have-space 1
3926 .  \}
3928 .  if \n[doc-in-files-section] \
3929 .    if n \
3930 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3932 .  nr doc-in-list 0
3933 .  doc-reset-args
3937 .\" NS doc-get-tag-width macro
3938 .\" NS   resolve unknown tag width (`tag' list-type only)
3939 .\" NS
3940 .\" NS modifies:
3941 .\" NS   doc-list-indent-stackXXX
3942 .\" NS   doc-tag-width-stackXXX
3943 .\" NS
3944 .\" NS requires:
3945 .\" NS   doc-curr-arg
3946 .\" NS   doc-curr-type
3948 .de doc-get-tag-width
3949 .  ie (\n[doc-curr-type] == 1) \{\
3950 .    ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
3951 .    nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
3952 .  \}
3953 .  el \{\
3954 .    ds doc-tag-width-stack\n[doc-list-depth] No
3955 .    nr doc-list-indent-stack\n[doc-list-depth] \n[No]
3956 .  \}
3960 .\" NS doc-set-vertical-and-indent macro
3961 .\" NS   set up vertical spacing (if not compact) and indentation (with
3962 .\" NS   offset if argument is non-zero)
3963 .\" NS
3964 .\" NS modifies:
3965 .\" NS   doc-list-have-indent-stackXXX
3967 .de doc-set-vertical-and-indent
3968 .  if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3969 .    sp \n[doc-display-vertical]u
3971 .  if \n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3972 .    nr doc-list-have-indent-stack\n[doc-list-depth] 0
3973 .    if \$1 \
3974 .      in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3975 .  \}
3977 .  if !\n[cR] \
3978 .    ne 2v
3982 .\" NS doc-list-depth global register
3983 .\" NS   list type stack counter
3985 .nr doc-list-depth 0
3988 .\" NS doc-num-columns global register
3989 .\" NS   number of columns
3991 .nr doc-num-columns 0
3994 .\" NS doc-compact-list-stackXXX global register (bool)
3995 .\" NS   stack of flags to indicate whether a particular list is compact
3996 .\" NS
3997 .\" NS limit:
3998 .\" NS   doc-list-depth
4000 .nr doc-compact-list-stack1 0
4003 .\" NS doc-tag-prefix-stackXXX global string
4004 .\" NS   stack of tag prefixes (currently used for -nested -enum lists)
4005 .\" NS
4006 .\" NS limit:
4007 .\" NS   doc-list-depth
4009 .ds doc-tag-prefix-stack1
4012 .\" NS doc-tag-width-stackXXX global string
4013 .\" NS   stack of strings indicating how to set up current element of
4014 .\" NS   doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
4015 .\" NS   directly; if it is a macro name, use the macro's width value;
4016 .\" NS   otherwise, `doc-get-tag-width' uses width value of `No'.
4017 .\" NS
4018 .\" NS limit:
4019 .\" NS   doc-list-depth
4021 .ds doc-tag-width-stack0
4022 .ds doc-tag-width-stack1
4025 .\" NS doc-list-offset-stackXXX global register
4026 .\" NS   stack of list offsets
4027 .\" NS
4028 .\" NS limit:
4029 .\" NS   doc-list-depth
4031 .nr doc-list-offset-stack1 0
4034 .\" NS doc-end-list macro
4035 .\" NS   list end function; resets indentation (and offset if argument is
4036 .\" NS   non-zero)
4037 .\" NS
4038 .\" NS modifies:
4039 .\" NS   doc-list-depth
4040 .\" NS   doc-list-offset-stackXXX
4042 .de doc-end-list
4043 .  if \$1 \
4044 '    in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4046 '  in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4048 .  if (\n[doc-list-depth] <= 0) \
4049 .    tm mdoc warning: extraneous .El call (#\n[.c])
4051 .  doc-decrement-list-stack
4052 .  nr doc-list-depth -1
4056 .\" NS doc-increment-list-stack macro
4057 .\" NS   set up next block for list
4058 .\" NS
4059 .\" NS modifies:
4060 .\" NS   doc-compact-list-stackXXX
4061 .\" NS   doc-list-have-indent-stackXXX
4062 .\" NS   doc-list-indent-stackXXX
4063 .\" NS   doc-list-offset-stackXXX
4064 .\" NS   doc-list-type-stackXXX
4065 .\" NS   doc-tag-prefix-stackXXX
4066 .\" NS   doc-tag-width-stackXXX
4067 .\" NS   doc-enum-list-count-stackXXX
4068 .\" NS
4069 .\" NS local variables:
4070 .\" NS   doc-reg-dils
4072 .de doc-increment-list-stack
4073 .  nr doc-reg-dils (\n[doc-list-depth] + 1)
4074 .  nr doc-list-have-indent-stack\n[doc-reg-dils] 0
4075 .  nr doc-list-indent-stack\n[doc-reg-dils] 0
4076 .  nr doc-list-offset-stack\n[doc-reg-dils] 0
4077 .  ds doc-tag-prefix-stack\n[doc-reg-dils]
4078 .  ds doc-tag-width-stack\n[doc-reg-dils] \*[doc-tag-width-stack\n[doc-list-depth]]
4079 .  ds doc-list-type-stack\n[doc-reg-dils]
4080 .  nr doc-compact-list-stack\n[doc-reg-dils] 0
4081 .  nr doc-enum-list-count-stack\n[doc-reg-dils] 0
4085 .\" NS doc-decrement-list-stack macro
4086 .\" NS   decrement stack
4087 .\" NS
4088 .\" NS modifies:
4089 .\" NS   doc-compact-list-stackXXX
4090 .\" NS   doc-list-have-indent-stackXXX
4091 .\" NS   doc-list-indent-stackXXX
4092 .\" NS   doc-list-offset-stackXXX
4093 .\" NS   doc-list-type-stackXXX
4094 .\" NS   doc-tag-prefix-stackXXX
4095 .\" NS   doc-tag-width-stackXXX
4096 .\" NS   doc-enum-list-count-stackXXX
4098 .de doc-decrement-list-stack
4099 .  ds doc-list-type-stack\n[doc-list-depth]
4100 .  nr doc-list-have-indent-stack\n[doc-list-depth] 0
4101 .  nr doc-list-indent-stack\n[doc-list-depth] 0
4102 .  nr doc-list-offset-stack\n[doc-list-depth] 0
4103 .  ds doc-tag-prefix-stack\n[doc-list-depth]
4104 .  ds doc-tag-width-stack\n[doc-list-depth]
4105 .  nr doc-compact-list-stack\n[doc-list-depth] 0
4106 .  nr doc-enum-list-count-stack\n[doc-list-depth] 0
4110 .\" NS Xr user macro
4111 .\" NS   cross reference (for man pages only)
4112 .\" NS
4113 .\" NS modifies:
4114 .\" NS   doc-arg-ptr
4115 .\" NS   doc-macro-name
4116 .\" NS
4117 .\" NS local variables:
4118 .\" NS   doc-reg-Xr
4119 .\" NS
4120 .\" NS width register `Xr' set in doc-common
4122 .de Xr
4123 .  if !\n[doc-arg-limit] \{\
4124 .    ie \n[.$] \{\
4125 .      ds doc-macro-name Xr
4126 .      doc-parse-args \$@
4127 .    \}
4128 .    el \
4129 .      doc-Xr-usage
4130 .  \}
4132 .  if !\n[doc-arg-limit] \
4133 .    return
4135 .  nr doc-arg-ptr +1
4136 .  doc-print-prefixes
4137 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4138 .    \" first argument must be a string
4139 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4140 .      nr doc-curr-font \n[.f]
4141 .      nr doc-curr-size \n[.ps]
4142 .      ds doc-arg\n[doc-arg-ptr] \*[doc-Xr-font]\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4144 .      if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4145 .        nr doc-reg-Xr (\n[doc-arg-ptr] + 1)
4146 .        \" modify second argument if it is a string and
4147 .        \" remove space inbetween
4148 .        if (\n[doc-type\n[doc-reg-Xr]] == 2) \{\
4149 .          ds doc-arg\n[doc-reg-Xr] \*[lp]\*[doc-arg\n[doc-reg-Xr]]\*[rp]
4150 .          ds doc-space\n[doc-arg-ptr]
4151 .        \}
4152 .      \}
4153 .      doc-print-recursive
4154 .    \}
4155 .    el \
4156 .      doc-Xr-usage
4157 .  \}
4158 .  el \
4159 .    doc-Xr-usage
4163 .\" NS doc-Xr-usage macro
4165 .de doc-Xr-usage
4166 .  tm Usage: .Xr manpage_name [section#] ... (#\n[.c])
4167 .  doc-reset-args
4171 .\" NS Sx user macro
4172 .\" NS   cross section reference
4173 .\" NS
4174 .\" NS width register `Sx' set in doc-common
4176 .als Sx doc-generic-macro
4177 .ds doc-Sx-usage section_header
4180 .\" NS doc-end-column-list macro
4181 .\" NS   column-list end-list
4182 .\" NS
4183 .\" NS modifies:
4184 .\" NS   doc-list-depth
4186 .de doc-end-column-list
4187 .  linetabs 0
4188 '  in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
4189 .  ta T .5i
4190 .  fi
4191 .  doc-decrement-list-stack
4192 .  nr doc-list-depth -1
4196 .\" NS doc-column-indent-width global register
4197 .\" NS   holds the indent width for a column list
4199 .nr doc-column-indent-width 0
4202 .\" NS doc-set-column-tab macro
4203 .\" NS   establish tabs for list-type column: `.doc-set-column-tab num_cols'
4204 .\" NS
4205 .\" NS modifies:
4206 .\" NS   doc-column-indent-width
4207 .\" NS
4208 .\" NS local variables:
4209 .\" NS   doc-reg-dsct
4210 .\" NS   doc-str-dsct
4211 .\" NS   doc-str-dsct1
4213 .de doc-set-column-tab
4214 .  ds doc-str-dsct
4215 .  nr doc-reg-dsct 1
4216 .  nr doc-column-indent-width 0
4218 .  ie (\$1 < 5) \
4219 .    ds doc-str-dsct1 "    \"
4220 .  el \{\
4221 .    ie (\$1 == 5) \
4222 .      ds doc-str-dsct1 "   \"
4223 .    el \{\
4224 .      \" XXX: this is packed abnormally close -- intercolumn width
4225 .      \"      should be configurable
4226 .      ds doc-str-dsct1 " \"
4227 .  \}\}
4229 .  while (\n[doc-reg-dsct] <= \$1) \{\
4230 .    as doc-str-dsct " +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4231 .    nr doc-column-indent-width +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4232 .    nr doc-reg-dsct +1
4233 .  \}
4235 .  ta \*[doc-str-dsct]
4236 '  in +\n[doc-column-indent-width]u
4240 .\" NS doc-column-list macro
4241 .\" NS   column items
4242 .\" NS
4243 .\" NS modifies:
4244 .\" NS   doc-arg-ptr
4245 .\" NS   doc-list-indent-stackXXX
4246 .\" NS   doc-spaceXXX
4247 .\" NS
4248 .\" NS local variables:
4249 .\" NS   doc-reg-dcl
4251 .de doc-column-list
4252 .  if \n[doc-num-args] \
4253 .    doc-parse-arg-vector
4254 .  nr doc-arg-ptr +1
4256 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4257 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4258 .    return
4259 .  \}
4261 .  if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4262 .    nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4263 .    ds doc-space\n[doc-reg-dcl]
4264 .  \}
4266 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4267 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4268 .  if !\n[.u] \{\
4269 .    fi
4270 '    in +\n[doc-column-indent-width]u
4271 .  \}
4272 .  ti -\n[doc-column-indent-width]u
4274 .  doc-do-\n[doc-type\n[doc-arg-ptr]]
4278 .\" NS Ta user macro
4279 .\" NS   append tab (\t)
4280 .\" NS
4281 .\" NS modifies:
4282 .\" NS   doc-arg-ptr
4283 .\" NS
4284 .\" NS width register `Ta' set in doc-common
4286 .de Ta
4287 .  ie \n[doc-arg-limit] \{\
4288 .    nr doc-arg-ptr +1
4289 .    nop \*[doc-tab]\c
4290 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4291 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
4292 .    el \
4293 .      doc-reset-args
4294 .  \}
4295 .  el \{\
4296 .    tm1 "Usage: Ta must follow column entry: e.g.
4297 .    tm1 "         .It column_string [Ta [column_string ...]] (#\n[.c])
4298 .  \}
4302 .\" NS Dl user macro
4303 .\" NS   display (one line) literal
4304 .\" NS
4305 .\" NS   this function uses the `Li' font
4306 .\" NS
4307 .\" NS modifies:
4308 .\" NS   doc-arg-ptr
4309 .\" NS   doc-curr-font
4310 .\" NS   doc-curr-size
4311 .\" NS   doc-macro-name
4312 .\" NS
4313 .\" NS width register `Dl' set in doc-common
4315 .de Dl
4316 '  ta T .5i
4317 .  in +\n[doc-display-indent]u
4319 .  ie \n[doc-arg-limit] \{\
4320 .    tm Usage: .Dl not callable by other macros (#\n[.c])
4321 .    doc-reset-args
4322 .  \}
4323 .  el \{\
4324 .    ie \n[.$] \{\
4325 .      ds doc-macro-name Dl
4326 .      doc-parse-args \$@
4327 .      nr doc-arg-ptr 1
4328 .      nr doc-curr-font \n[.f]
4329 .      nr doc-curr-size \n[.ps]
4330 .      nop \*[doc-Li-font]\c
4331 .      doc-print-recursive
4332 .    \}
4333 .    el \
4334 .      tm Usage: .Dl argument ... (#\n[.c])
4335 .  \}
4337 .  in -\n[doc-display-indent]u
4341 .\" NS D1 user macro
4342 .\" NS   display (one line)
4343 .\" NS
4344 .\" NS modifies:
4345 .\" NS   doc-arg-ptr
4346 .\" NS   doc-macro-name
4347 .\" NS
4348 .\" NS width register `D1' set in doc-common
4350 .de D1
4351 '  ta T .5i
4352 .  in +\n[doc-display-indent]u
4354 .  ie \n[doc-arg-limit] \{\
4355 .    tm Usage: .D1 not callable by other macros (#\n[.c])
4356 .    doc-reset-args
4357 .  \}
4358 .  el \{\
4359 .    ie \n[.$] \{\
4360 .      ds doc-macro-name D1
4361 .      doc-parse-args \$@
4362 .      nr doc-arg-ptr 1
4363 .      doc-print-recursive
4364 .    \}
4365 .    el \
4366 .      tm Usage: .D1 argument ... (#\n[.c])
4367 .  \}
4369 .  in -\n[doc-display-indent]u
4373 .\" NS Ex user macro
4374 .\" NS   defunct
4376 .de Ex
4377 .  tm mdoc error: .Ex defunct, use .D1: \$@ (#\n[.c])
4381 .\" NS Vt user macro
4382 .\" NS   variable type (for forcing old style variable declarations);
4383 .\" NS   this is not done in the same manner as .Ot for fortrash --
4384 .\" NS   clean up later
4385 .\" NS
4386 .\" NS modifies:
4387 .\" NS   doc-curr-font
4388 .\" NS   doc-curr-size
4389 .\" NS   doc-have-decl
4390 .\" NS   doc-have-var
4391 .\" NS   doc-macro-name
4392 .\" NS
4393 .\" NS width register `Vt' set in doc-common
4395 .de Vt
4396 .  if !\n[doc-arg-limit] \{\
4397 .    ie \n[.$] \{\
4398 .      ds doc-macro-name Vt
4399 .      doc-parse-args \$@
4400 .    \}
4401 .    el \
4402 .      tm Usage: .Vt variable_type ... (#\n[.c])
4403 .  \}
4405 .  if !\n[doc-arg-limit] \
4406 .    return
4408 .  nr doc-arg-ptr +1
4409 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4410 .    tm Usage: .Vt variable_type ... (#\n[.c])
4411 .    doc-reset-args
4412 .    return
4413 .  \}
4415 .  if \n[doc-in-synopsis-count] \{\
4416 .    \" if a function declaration was the last thing given,
4417 .    \" want vertical space
4418 .    if \n[doc-have-decl] \{\
4419 .      doc-paragraph
4420 .      nr doc-have-decl 0
4421 .    \}
4423 .    \" if a subroutine was the last thing given, want vertical space
4424 .    if \n[doc-have-func] \{\
4425 .      ie \n[doc-have-var] \
4426 .        br
4427 .      el \{\
4428 .        doc-paragraph
4429 .        rs
4430 .    \}\}
4432 .    nr doc-have-var 1
4433 .  \}
4435 .  nr doc-curr-font \n[.f]
4436 .  nr doc-curr-size \n[.ps]
4437 .  nop \*[doc-Ft-font]\c
4438 .  doc-print-recursive
4440 .  if \n[doc-in-synopsis-count] \{\
4441 .    ie \n[doc-have-old-func] \
4442 .      nop \*[doc-soft-space]\c
4443 .    el \
4444 .      br
4445 .  \}
4449 .\" NS doc-is-func global register (bool)
4450 .\" NS   set if subroutine (in synopsis only) (fortran only)
4452 .nr doc-is-func 0
4455 .\" NS Ft user macro
4456 .\" NS   function type
4457 .\" NS
4458 .\" NS modifies:
4459 .\" NS   doc-curr-font
4460 .\" NS   doc-curr-size
4461 .\" NS   doc-have-decl
4462 .\" NS   doc-have-var
4463 .\" NS   doc-is-func
4464 .\" NS   doc-macro-name
4465 .\" NS
4466 .\" NS width register `Ft' set in doc-common
4468 .de Ft
4469 .  if !\n[doc-arg-limit] \{\
4470 .    ie \n[.$] \{\
4471 .      ds doc-macro-name Ft
4472 .      doc-parse-args \$@
4473 .    \}
4474 .    el \
4475 .      tm Usage: .Ft function_type ... (#\n[.c])
4476 .  \}
4478 .  if !\n[doc-arg-limit] \
4479 .    return
4481 .  nr doc-arg-ptr +1
4482 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4483 .    tm Usage: .Ft function_type ... (#\n[.c])
4484 .    doc-reset-args
4485 .    return
4486 .  \}
4488 .  if \n[doc-in-synopsis-count] \{\
4489 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4490 .      doc-paragraph
4491 .      nr doc-have-decl 0
4492 .      nr doc-have-var 0
4493 .    \}
4495 .    if \n[doc-have-var] \{\
4496 .      doc-paragraph
4497 .      nr doc-have-var 0
4498 .    \}
4500 .    nr doc-is-func 1
4501 .  \}
4503 .  nr doc-curr-font \n[.f]
4504 .  nr doc-curr-size \n[.ps]
4505 .  nop \*[doc-Ft-font]\c
4506 .  doc-print-recursive
4510 .\" NS doc-have-old-func global register (bool)
4511 .\" NS   set if `Ot' has been called
4513 .nr doc-have-old-func 0
4516 .\" NS Ot user macro
4517 .\" NS   old function type (fortran -- no newline)
4518 .\" NS
4519 .\" NS modifies:
4520 .\" NS   doc-have-decl
4521 .\" NS   doc-have-old-func
4522 .\" NS   doc-have-var
4523 .\" NS   doc-is-func
4524 .\" NS
4525 .\" NS width register `Ot' set in doc-common
4527 .de Ot
4528 .  nr doc-have-old-func 1
4530 .  if \n[doc-in-synopsis-count] \{\
4531 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4532 .      doc-paragraph
4533 .      nr doc-have-decl 0
4534 .      nr doc-have-var 0
4535 .    \}
4537 .    if \n[doc-have-var] \{\
4538 .      doc-paragraph
4539 .      nr doc-have-var 0
4540 .    \}
4542 .    nr doc-is-func 1
4543 .  \}
4545 .  if \n[.$] \
4546 .    nop \*[doc-Ft-font]\$*\c
4547 .  nop \ \f[P]\c
4551 .\" NS Fa user macro
4552 .\" NS   function arguments
4553 .\" NS
4554 .\" NS modifies:
4555 .\" NS   doc-arg-ptr
4556 .\" NS   doc-curr-font
4557 .\" NS   doc-curr-size
4558 .\" NS   doc-macro-name
4559 .\" NS
4560 .\" NS width register `Fa' set in doc-common
4562 .de Fa
4563 .  if !\n[doc-arg-limit] \{\
4564 .    ie \n[.$] \{\
4565 .      ds doc-macro-name Fa
4566 .      doc-parse-args \$@
4567 .    \}
4568 .    el \
4569 .      tm Usage: .Fa function_arguments ... (#\n[.c])
4570 .  \}
4572 .  ie \n[doc-func-arg-count] \
4573 .    doc-do-func
4574 .  el \{\
4575 .    nr doc-arg-ptr +1
4576 .    if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4577 .      nr doc-curr-font \n[.f]
4578 .      nr doc-curr-size \n[.ps]
4579 .      nop \*[doc-Fa-font]\c
4580 .      doc-print-recursive
4582 .      if \n[doc-in-synopsis-count] \
4583 .        if \n[doc-have-func] \
4584 .          br
4585 .  \}\}
4589 .\" NS doc-func-arg-count global register
4590 .\" NS   how many function arguments have been processed so far
4592 .nr doc-func-arg-count 0
4595 .\" NS doc-func-arg global string
4596 .\" NS   work buffer for function name strings
4598 .ds doc-func-arg
4601 .\" NS doc-num-func-args global register
4602 .\" NS   number of function arguments
4604 .nr doc-num-func-args 0
4607 .\" NS doc-func-args-processed global register
4608 .\" NS   function arguments processed so far
4610 .nr doc-func-args-processed 0
4613 .\" NS doc-do-func macro
4614 .\" NS   internal .Fa for .Fc
4615 .\" NS
4616 .\" NS modifies:
4617 .\" NS   doc-arg-ptr
4618 .\" NS   doc-argXXX
4619 .\" NS   doc-func-arg
4620 .\" NS   doc-func-arg-count
4621 .\" NS   doc-func-args-processed
4622 .\" NS   doc-num-func-args
4624 .de doc-do-func
4625 .  if (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
4626 .    doc-reset-args
4627 .    return
4628 .  \}
4630 .  nr doc-arg-ptr +1
4632 .  ds doc-func-arg
4633 .  nr doc-num-func-args 0
4634 .  nr doc-func-args-processed 0
4636 .  doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4637 .  if (\n[doc-num-func-args] > 1) \
4638 .    ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4640 .  if (\n[doc-func-arg-count] > 1) \{\
4641 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\|,\)\c
4642 .    nop \)\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]\c
4643 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]\c
4644 .  \}
4646 .  if (\n[doc-func-arg-count] == 1) \{\
4647 .    nop \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]\c
4648 .    nop \f[P]\s[0]\c
4649 .  \}
4650 .  nr doc-func-arg-count +1
4651 .  doc-do-func
4655 .\" NS doc-have-func global register (bool)
4656 .\" NS   whether we have more than one function in synopsis
4658 .nr doc-have-func 0
4661 .\" NS Fn user macro
4662 .\" NS   functions
4663 .\" NS
4664 .\" NS modifies:
4665 .\" NS   doc-arg-ptr
4666 .\" NS   doc-curr-font
4667 .\" NS   doc-curr-size
4668 .\" NS   doc-have-decl
4669 .\" NS   doc-have-func
4670 .\" NS   doc-have-var
4671 .\" NS   doc-in-synopsis-count
4672 .\" NS   doc-indent-synopsis
4673 .\" NS   doc-is-func
4674 .\" NS   doc-macro-name
4675 .\" NS
4676 .\" NS width register `Fn' set in doc-common
4678 .de Fn
4679 .  if !\n[doc-arg-limit] \{\
4680 .    ie \n[.$] \{\
4681 .      ds doc-macro-name Fn
4682 .      doc-parse-args \$@
4683 .    \}
4684 .    el \
4685 .      tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4686 .  \}
4688 .  if \n[doc-in-synopsis-count] \{\
4689 .    \" if there is/has been more than one subroutine declaration
4690 .    ie \n[doc-is-func] \{\
4691 .      br
4692 .      nr doc-have-var 0
4693 .      nr doc-have-decl 0
4694 .      nr doc-is-func 0
4695 .    \}
4696 .    el \{\
4697 .      if \n[doc-have-func] \{\
4698 .        doc-paragraph
4699 .        nr doc-have-var 0
4700 .        nr doc-have-decl 0
4701 .    \}\}
4703 .    if \n[doc-have-decl] \{\
4704 .      doc-paragraph
4705 .      nr doc-have-var 0
4706 .    \}
4708 .    if \n[doc-have-var] \{\
4709 .      doc-paragraph
4710 .      nr doc-have-decl 0
4711 .    \}
4713 .    nr doc-have-func 1
4714 .    nr doc-is-func 0
4715 .    rs
4717 .    ie (\n[doc-in-synopsis-count] > 1) \
4718 .      br
4719 .    el \{\
4720 .      if !\n[doc-indent-synopsis] \
4721 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4722 .    \}
4724 .    in +\n[doc-indent-synopsis]u
4725 .    ti -\n[doc-indent-synopsis]u
4726 .    nr doc-in-synopsis-count +1
4727 .  \}
4729 .  if !\n[doc-arg-limit] \
4730 .    return
4732 .  nr doc-arg-ptr +1
4733 .  doc-print-prefixes
4734 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4735 .    tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4736 .    doc-reset-args
4737 .    return
4738 .  \}
4740 .  nr doc-curr-font \n[.f]
4741 .  nr doc-curr-size \n[.ps]
4742 .  nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4743 .  nop \f[P]\s[0]\*[lp]\)\c
4745 .  nr doc-arg-ptr +1
4746 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4747 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4748 .      nop \*[doc-Fa-font]\c
4749 .      doc-do-func-args
4750 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
4751 .  \}\}
4753 .  nop \)\*[rp]\)\c
4755 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4756 .    \" output the space (if needed)
4757 .    nr doc-arg-ptr -1
4758 .    nop \)\*[doc-space\n[doc-arg-ptr]]\c
4759 .    nr doc-arg-ptr +1
4761 .    doc-print-recursive
4762 .  \}
4763 .  el \
4764 .    doc-print-and-reset
4766 .  if \n[doc-in-synopsis-count] \
4767 .    in -\n[doc-indent-synopsis]u
4771 .\" NS doc-do-func-args macro
4772 .\" NS   handle function arguments
4773 .\" NS
4774 .\" NS modifies:
4775 .\" NS   doc-arg-ptr
4776 .\" NS   doc-argXXX
4777 .\" NS   doc-func-arg
4778 .\" NS   doc-func-args-processed
4779 .\" NS   doc-num-func-args
4780 .\" NS
4781 .\" NS local variables:
4782 .\" NS   doc-reg-ddfa
4784 .de doc-do-func-args
4785 .  if \n[doc-in-synopsis-count] \{\
4786 .    ds doc-func-arg
4787 .    nr doc-num-func-args 0
4788 .    nr doc-func-args-processed 0
4790 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4791 .    if (\n[doc-num-func-args] > 1) \
4792 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4793 .  \}
4795 .  nop \)\*[doc-arg\n[doc-arg-ptr]]\c
4796 .  nr doc-arg-ptr +1
4798 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4799 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4800 .      nr doc-reg-ddfa (\n[doc-arg-ptr] - 1)
4801 .      nop \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]u],\)\c
4802 .      nop \)\*[doc-space\n[doc-reg-ddfa]]\f[P]\s[0]\|\c
4803 .      doc-do-func-args
4804 .  \}\}
4808 .\" NS doc-saved-nesting-level global register
4810 .nr doc-saved-nesting-level 0
4813 .\" NS doc-in-func-enclosure global register (bool)
4815 .nr doc-in-func-enclosure 0
4818 .\" NS Fo user macro
4819 .\" NS   function open
4820 .\" NS
4821 .\" NS modifies:
4822 .\" NS   doc-arg-ptr
4823 .\" NS   doc-curr-font
4824 .\" NS   doc-curr-size
4825 .\" NS   doc-func-arg-count
4826 .\" NS   doc-have-decl
4827 .\" NS   doc-have-func
4828 .\" NS   doc-have-var
4829 .\" NS   doc-in-func-enclosure
4830 .\" NS   doc-in-synopsis-count
4831 .\" NS   doc-indent-synopsis
4832 .\" NS   doc-is-func
4833 .\" NS   doc-macro-name
4834 .\" NS   doc-saved-nesting-level
4835 .\" NS
4836 .\" NS width register `Fo' set in doc-common
4838 .de Fo
4839 .  if (\n[doc-in-func-enclosure]) \{\
4840 .    tm mdoc error: .Fo/.Fc can't be nested (#\n[.c])
4841 .    return
4842 .  \}
4844 .  nr doc-saved-nesting-level \n[doc-nesting-level]
4845 .  nr doc-in-func-enclosure 1
4847 .  if !\n[doc-arg-limit] \{\
4848 .    ie \n[.$] \{\
4849 .      ds doc-macro-name Fo
4850 .      doc-parse-args \$@
4851 .    \}
4852 .    el \
4853 .      tm Usage: .Fo function_name (#\n[.c])
4854 .  \}
4856 .  if \n[doc-in-synopsis-count] \{\
4857 .    \" if there is/has been more than one subroutine declaration
4858 .    ie \n[doc-is-func] \{\
4859 .      br
4860 .      nr doc-have-var 0
4861 .      nr doc-have-decl 0
4862 .      nr doc-is-func 0
4863 .    \}
4864 .    el \{\
4865 .      if \n[doc-have-func] \{\
4866 .        doc-paragraph
4867 .        nr doc-have-var 0
4868 .        nr doc-have-decl 0
4869 .    \}\}
4871 .    if \n[doc-have-decl] \{\
4872 .      doc-paragraph
4873 .      nr doc-have-var 0
4874 .    \}
4876 .    if \n[doc-have-var] \{\
4877 .      doc-paragraph
4878 .      nr doc-have-decl 0
4879 .    \}
4881 .    nr doc-have-func 1
4882 .    nr doc-is-func 0
4883 .    rs
4885 .    ie (\n[doc-in-synopsis-count] > 1) \
4886 .      br
4887 .    el \{\
4888 .      if !\n[doc-indent-synopsis] \
4889 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4890 .    \}
4892 .    nr doc-in-synopsis-count +1
4893 .  \}
4895 .  \" start function box
4896 .  box doc-func-box
4897 .  ev doc-func-env
4898 .  evc 0
4899 .  in 0
4900 .  nf
4902 .  nr doc-arg-ptr +1
4903 .  doc-print-prefixes
4904 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4905 .    nr doc-func-arg-count 1
4906 .    nr doc-curr-font \n[.f]
4907 .    nr doc-curr-size \n[.ps]
4909 .    nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4910 .    nop \f[P]\s[0]\*[lp]\)\c
4911 .    doc-reset-args
4912 .  \}
4916 .\" NS Fc user macro
4917 .\" NS   function close
4918 .\" NS
4919 .\" NS modifies:
4920 .\" NS   doc-arg-ptr
4921 .\" NS   doc-func-arg-count
4922 .\" NS   doc-in-func-enclosure
4923 .\" NS   doc-saved-nesting-level
4924 .\" NS   doc-macro-name
4925 .\" NS
4926 .\" NS width register `Fc' set in doc-common
4928 .de Fc
4929 .  if !\n[doc-in-func-enclosure] \{\
4930 .    tm mdoc warning: Extraneous .Fc (#\n[.c])
4931 .    return
4932 .  \}
4934 .  if \n[.$] \{\
4935 .    ds doc-macro-name Fc
4936 .    \" the first (dummy) argument is used to get the correct spacing
4937 .    doc-parse-args \) \$@
4938 .  \}
4940 .  if !(\n[doc-saved-nesting-level] == \n[doc-nesting-level]) \
4941 .    tm mdoc warning: Unbalanced enclosure commands within .Fo/.Fc
4943 .  nr doc-func-arg-count 0
4944 .  nr doc-in-func-enclosure 0
4946 .  nop \|\*[rp]\)
4948 .  \" finish function box
4949 .  br
4950 .  ev
4951 .  box
4952 .  chop doc-func-box
4953 .  unformat doc-func-box
4955 .  if \n[doc-in-synopsis-count] \{\
4956 .    in +\n[doc-indent-synopsis]u
4957 .    ti -\n[doc-indent-synopsis]u
4958 .  \}
4960 .  nh
4961 .  nop \*[doc-func-box]\c
4963 .  nr doc-arg-ptr +1
4964 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4965 .    nr doc-curr-font \n[.f]
4966 .    nr doc-curr-size \n[.ps]
4967 .    doc-print-recursive
4968 .  \}
4969 .  el \
4970 .    doc-print-and-reset
4972 .  if \n[doc-in-synopsis-count] \
4973 .    in -\n[doc-indent-synopsis]u
4977 .\" NS doc-build-func-string macro
4978 .\" NS   collect function arguments and set hard spaces inbetween
4979 .\" NS
4980 .\" NS modifies:
4981 .\" NS   doc-func-arg
4982 .\" NS   doc-func-args-processed
4983 .\" NS   doc-num-func-args
4985 .de doc-build-func-string
4986 .  if !\n[doc-num-func-args] \{\
4987 .    nr doc-num-func-args \n[.$]
4988 .    nr doc-func-args-processed 0
4989 .    ds doc-func-arg
4990 .  \}
4992 .  nr doc-func-args-processed +1
4993 .  as doc-func-arg "\$1
4995 .  if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
4996 .    as doc-func-arg "\*[doc-hard-space]
4998 .    shift
4999 .    doc-build-func-string \$@
5000 .  \}
5004 .\" Very crude references: Stash all reference info into boxes, print out
5005 .\" reference on .Re request and clean up.  Ordering very limited, no fancy
5006 .\" citations, but can do articles, journals, and books -- need to add
5007 .\" several missing options (like city etc).  Should be able to grab a refer
5008 .\" entry, massage it a wee bit (prefix a `.' to the %[A-Z]) and not worry
5009 .\" (ha!).
5012 .\" NS doc-is-reference global register (bool)
5013 .\" NS   set if in reference
5015 .nr doc-is-reference 0
5018 .\" NS doc-reference-count global register
5019 .\" NS   reference element counter
5021 .nr doc-reference-count 0
5024 .\" NS Rs user macro
5025 .\" NS   reference start
5026 .\" NS
5027 .\" NS modifies:
5028 .\" NS   doc-is-reference
5029 .\" NS   doc-reference-count
5030 .\" NS
5031 .\" NS width register `Rs' set in doc-common
5033 .de Rs
5034 .  ie \n[.$] \
5035 .    tm Usage: .Rs (does not take arguments) (#\n[.c])
5036 .  el \{\
5037 .    nr doc-is-reference 1
5038 .    doc-reset-reference
5039 .    if \n[doc-in-see-also-section] \
5040 .      doc-paragraph
5041 .    nr doc-reference-count 0
5042 .  \}
5046 .\" NS Re user macro
5047 .\" NS   reference end
5048 .\" NS
5049 .\" NS modifies:
5050 .\" NS   doc-is-reference
5051 .\" NS
5052 .\" NS width register `Re' set in doc-common
5054 .de Re
5055 .  ie \n[.$] \
5056 .    tm Usage: .Re (does not take arguments) (#\n[.c])
5057 .  el \{\
5058 .    doc-print-reference
5059 .    doc-reset-reference
5060 .    nr doc-is-reference 0
5061 .  \}
5065 .\" NS doc-reset-reference macro
5066 .\" NS   reference cleanup
5067 .\" NS
5068 .\" NS modifies:
5069 .\" NS   doc-author-count
5070 .\" NS   doc-author-nameXXX
5071 .\" NS   doc-book-count
5072 .\" NS   doc-book-name
5073 .\" NS   doc-corporate-count
5074 .\" NS   doc-corporate-name
5075 .\" NS   doc-date
5076 .\" NS   doc-date-count
5077 .\" NS   doc-issue-count
5078 .\" NS   doc-issue-name
5079 .\" NS   doc-journal-count
5080 .\" NS   doc-journam-name
5081 .\" NS   doc-optional-count
5082 .\" NS   doc-optional-string
5083 .\" NS   doc-page-number-count
5084 .\" NS   doc-page-number-string
5085 .\" NS   doc-reference-title-count
5086 .\" NS   doc-reference-title-name
5087 .\" NS   doc-reference-title-name-for-book
5088 .\" NS   doc-report-count
5089 .\" NS   doc-report-name
5090 .\" NS   doc-volume-count
5091 .\" NS   doc-volume-name
5093 .de doc-reset-reference
5094 .  while (\n[doc-author-count]) \{\
5095 .    ds doc-author-name\n[doc-author-count]
5096 .    nr doc-author-count -1
5097 .  \}
5098 .  nr doc-journal-count 0
5099 .  nr doc-issue-count 0
5100 .  nr doc-optional-count 0
5101 .  nr doc-corporate-count 0
5102 .  nr doc-report-count 0
5103 .  nr doc-reference-title-count 0
5104 .  nr doc-volume-count 0
5105 .  nr doc-date-count 0
5106 .  nr doc-page-number-count 0
5107 .  nr doc-book-count 0
5109 .  ds doc-journal-name
5110 .  ds doc-issue-name
5111 .  ds doc-optional-string
5112 .  ds doc-corporate-name
5113 .  ds doc-report-name
5114 .  ds doc-reference-title-name
5115 .  ds doc-reference-title-name-for-book
5116 .  ds doc-volume-name
5117 .  ds doc-date
5118 .  ds doc-page-number-string
5119 .  ds doc-book-name
5123 .\" NS doc-finish-reference macro
5124 .\" NS   auxiliary macro for doc-print-reference
5125 .\" NS
5126 .\" NS modifies:
5127 .\" NS   doc-reference-count
5129 .de doc-finish-reference
5130 .  nr doc-reference-count -1
5131 .  ie \n[doc-reference-count] \
5132 .    nop \),
5133 .  el \
5134 .    nop \).
5138 .\" NS doc-print-reference macro
5139 .\" NS   reference print
5140 .\" NS
5141 .\" NS modifies:
5142 .\" NS   doc-reference-count
5144 .de doc-print-reference
5146 .  nh
5148 .  if \n[doc-author-count] \{\
5149 .    doc-print-reference-authors
5150 .    nr doc-reference-count -\n[doc-author-count]
5151 .  \}
5153 .  if \n[doc-reference-title-count] \{\
5154 .    unformat doc-reference-title-name
5155 .    chop doc-reference-title-name
5156 .    unformat doc-reference-title-name-for-book
5157 .    chop doc-reference-title-name-for-book
5158 .    ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5159 .      nop \)\*[q]\)\*[doc-reference-title-name-for-book]\)\*[q]\c
5160 .      doc-finish-reference
5161 .    \}
5162 .    el \{\
5163 .      nop \*[doc-reference-title-name]\c
5164 .      doc-finish-reference
5165 .  \}\}
5167 .  if \n[doc-book-count] \{\
5168 .    unformat doc-book-name
5169 .    chop doc-book-name
5170 .    nop \*[doc-book-name]\c
5171 .    doc-finish-reference
5172 .  \}
5174 .  if \n[doc-publisher-count] \{\
5175 .    unformat doc-publisher-name
5176 .    chop doc-publisher-name
5177 .    nop \*[doc-publisher-name]\c
5178 .    doc-finish-reference
5179 .  \}
5181 .  if \n[doc-journal-count] \{\
5182 .    unformat doc-journal-name
5183 .    chop doc-journal-name
5184 .    nop \*[doc-journal-name]\c
5185 .    doc-finish-reference
5186 .  \}
5188 .  if \n[doc-report-count] \{\
5189 .    unformat doc-report-name
5190 .    chop doc-report-name
5191 .    nop \*[doc-report-name]\c
5192 .    doc-finish-reference
5193 .  \}
5195 .  if \n[doc-issue-count] \{\
5196 .    unformat doc-issue-name
5197 .    chop doc-issue-name
5198 .    nop \*[doc-issue-name]\c
5199 .    doc-finish-reference
5200 .  \}
5202 .  if \n[doc-volume-count] \{\
5203 .    unformat doc-volume-name
5204 .    chop doc-volume-name
5205 .    nop \*[doc-volume-name]\c
5206 .    doc-finish-reference
5207 .  \}
5209 .  if \n[doc-page-number-count] \{\
5210 .    unformat doc-page-number-string
5211 .    chop doc-page-number-string
5212 .    nop \*[doc-page-number-string]\c
5213 .    doc-finish-reference
5214 .  \}
5216 .  if \n[doc-corporate-count] \{\
5217 .    unformat doc-corporate-name
5218 .    chop doc-corporate-name
5219 .    nop \*[doc-corporate-name]\c
5220 .    doc-finish-reference
5221 .  \}
5223 .  if \n[doc-date-count] \{\
5224 .    unformat doc-date
5225 .    chop doc-date
5226 .    nop \*[doc-date]\c
5227 .    doc-finish-reference
5228 .  \}
5230 .  if \n[doc-optional-count] \{\
5231 .    unformat doc-optional-string
5232 .    chop doc-optional-string
5233 .    nop \*[doc-optional-string]\c
5234 .    doc-finish-reference
5235 .  \}
5237 .  if \n[doc-reference-count] \
5238 .    tm mdoc warning: unresolved reference problem
5240 .  hy \n[doc-hyphen-flags]
5244 .\" NS doc-print-reference-authors macro
5245 .\" NS   print out reference authors
5246 .\" NS
5247 .\" NS local variables:
5248 .\" NS   doc-reg-dpra
5249 .\" NS   doc-str-dpra
5251 .ds doc-str-dpra "and
5253 .de doc-print-reference-authors
5254 .  nr doc-reg-dpra 1
5256 .  while (\n[doc-reg-dpra] < \n[doc-author-count]) \{\
5257 .    unformat doc-author-name\n[doc-reg-dpra]
5258 .    chop doc-author-name\n[doc-reg-dpra]
5259 .    ie (\n[doc-author-count] > 2) \
5260 .      nop \)\*[doc-author-name\n[doc-reg-dpra]],
5261 .    el \
5262 .      nop \)\*[doc-author-name\n[doc-reg-dpra]]
5263 .    nr doc-reg-dpra +1
5264 .  \}
5266 .  unformat doc-author-name\n[doc-reg-dpra]
5267 .  chop doc-author-name\n[doc-reg-dpra]
5268 .  if (\n[doc-author-count] > 1) \
5269 .    nop \)\*[doc-str-dpra]
5270 .  nop \)\*[doc-author-name\n[doc-reg-dpra]],
5274 .\" NS doc-author-count global register
5275 .\" NS   counter of author references
5277 .nr doc-author-count 0
5280 .\" NS doc-author-nameXXX global box
5281 .\" NS   array of author names
5282 .\" NS
5283 .\" NS limit:
5284 .\" NS   doc-author-count
5286 .ds doc-author-name0
5289 .\" NS %A user macro
5290 .\" NS   reference author(s)
5291 .\" NS
5292 .\" NS modifies:
5293 .\" NS   doc-arg-ptr
5294 .\" NS   doc-author-count
5295 .\" NS   doc-curr-font
5296 .\" NS   doc-curr-size
5297 .\" NS   doc-macro-name
5298 .\" NS   doc-reference-count
5299 .\" NS
5300 .\" NS local variables:
5301 .\" NS   doc-env-%A
5302 .\" NS
5303 .\" NS width register `%A' set in doc-common
5305 .de %A
5306 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5307 .    tm Usage: .%A author_name ... (#\n[.c])
5308 .    return
5309 .  \}
5311 .  nr doc-author-count +1
5312 .  nr doc-reference-count +1
5314 .  ds doc-macro-name %A
5315 .  doc-parse-args \$@
5317 .  nr doc-arg-ptr +1
5318 .  nr doc-curr-font \n[.f]
5319 .  nr doc-curr-size \n[.ps]
5321 .  \" save to reference box
5322 .  box doc-author-name\n[doc-author-count]
5323 .  ev doc-env-%A
5324 .  evc 0
5325 .  in 0
5326 .  nf
5327 .  doc-do-references
5331 .\" NS doc-book-count global register
5332 .\" NS   counter of book references
5334 .nr doc-book-count 0
5337 .\" NS doc-book-name global box
5338 .\" NS   string of collected book references
5340 .ds doc-book-name
5343 .\" NS %B user macro
5344 .\" NS   [reference] book name
5345 .\" NS
5346 .\" NS modifies:
5347 .\" NS   doc-arg-ptr
5348 .\" NS   doc-book-count
5349 .\" NS   doc-curr-font
5350 .\" NS   doc-curr-size
5351 .\" NS   doc-macro-name
5352 .\" NS   doc-reference-count
5353 .\" NS
5354 .\" NS local variables:
5355 .\" NS   doc-env-%B
5356 .\" NS
5357 .\" NS width register `%B' set in doc-common
5359 .de %B
5360 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5361 .    tm Usage: .%B book_name ... (#\n[.c])
5362 .    return
5363 .  \}
5365 .  if \n[doc-is-reference] \{\
5366 .    nr doc-book-count +1
5367 .    nr doc-reference-count +1
5368 .  \}
5370 .  ds doc-macro-name %B
5371 .  doc-parse-args \$@
5373 .  nr doc-arg-ptr +1
5374 .  nr doc-curr-font \n[.f]
5375 .  nr doc-curr-size \n[.ps]
5377 .  ie \n[doc-is-reference] \{\
5378 .    \" append to reference box
5379 .    boxa doc-book-name
5380 .    ev doc-env-%B
5381 .    evc 0
5382 .    in 0
5383 .    nf
5384 .    nop \*[doc-Em-font]\c
5385 .    doc-do-references
5386 .  \}
5387 .  el \{\
5388 .    nop \*[doc-Em-font]\c
5389 .    doc-print-recursive
5390 .  \}
5394 .\" NS doc-date-count global register
5395 .\" NS   counter of date references
5397 .nr doc-date-count 0
5400 .\" NS doc-date global box
5401 .\" NS   string of collected date references
5403 .ds doc-date
5406 .\" NS %D user macro
5407 .\" NS   [reference] date
5408 .\" NS
5409 .\" NS modifies:
5410 .\" NS   doc-arg-ptr
5411 .\" NS   doc-curr-font
5412 .\" NS   doc-curr-size
5413 .\" NS   doc-date-count
5414 .\" NS   doc-macro-name
5415 .\" NS   doc-reference-count
5416 .\" NS
5417 .\" NS local variables:
5418 .\" NS   doc-env-%D
5419 .\" NS
5420 .\" NS width register `%D' set in doc-common
5422 .de %D
5423 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5424 .    tm Usage: .%D date ... (#\n[.c])
5425 .    return
5426 .  \}
5428 .  nr doc-date-count +1
5429 .  nr doc-reference-count +1
5431 .  ds doc-macro-name %D
5432 .  doc-parse-args \$@
5434 .  nr doc-arg-ptr +1
5435 .  nr doc-curr-font \n[.f]
5436 .  nr doc-curr-size \n[.ps]
5438 .  \" append to reference box
5439 .  boxa doc-date
5440 .  ev doc-env-%D
5441 .  evc 0
5442 .  in 0
5443 .  nf
5444 .  doc-do-references
5448 .\" NS doc-publisher-count global register
5449 .\" NS   counter of publisher references
5451 .nr doc-publisher-count 0
5454 .\" NS doc-publisher-name global box
5455 .\" NS   string of collected publisher references
5457 .ds doc-publisher-name
5460 .\" NS %I user macro
5461 .\" NS   [reference] issuer/publisher name
5462 .\" NS
5463 .\" NS modifies:
5464 .\" NS   doc-arg-ptr
5465 .\" NS   doc-curr-font
5466 .\" NS   doc-curr-size
5467 .\" NS   doc-macro-name
5468 .\" NS   doc-publisher-count
5469 .\" NS   doc-reference-count
5470 .\" NS
5471 .\" NS local variables:
5472 .\" NS   doc-env-%I
5473 .\" NS
5474 .\" NS width register `%I' set in doc-common
5476 .de %I
5477 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5478 .    tm Usage: .%I issuer/publisher_name ... (#\n[.c])
5479 .    return
5480 .  \}
5482 .  nr doc-publisher-count +1
5483 .  nr doc-reference-count +1
5485 .  ds doc-macro-name %I
5486 .  doc-parse-args \$@
5488 .  nr doc-arg-ptr +1
5489 .  nr doc-curr-font \n[.f]
5490 .  nr doc-curr-size \n[.ps]
5492 .  \" append to reference box
5493 .  boxa doc-publisher-name
5494 .  ev doc-env-%I
5495 .  evc 0
5496 .  in 0
5497 .  nf
5498 .  nop \*[doc-Em-font]\c
5499 .  doc-do-references
5503 .\" NS doc-journal-count global register
5504 .\" NS   counter of journal references
5506 .nr doc-journal-count 0
5509 .\" NS doc-journal-name global box
5510 .\" NS   string of collected journal references
5512 .ds doc-journal-name
5515 .\" NS %J user macro
5516 .\" NS   [reference] Journal Name
5517 .\" NS
5518 .\" NS modifies:
5519 .\" NS   doc-arg-ptr
5520 .\" NS   doc-curr-font
5521 .\" NS   doc-curr-size
5522 .\" NS   doc-journal-count
5523 .\" NS   doc-macro-name
5524 .\" NS   doc-reference-count
5525 .\" NS
5526 .\" NS local variables:
5527 .\" NS   doc-env-%J
5528 .\" NS
5529 .\" NS width register `%J' set in doc-common
5531 .de %J
5532 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5533 .    tm Usage: .%J journal_name ... (#\n[.c])
5534 .    return
5535 .  \}
5537 .  nr doc-journal-count +1
5538 .  nr doc-reference-count +1
5540 .  ds doc-macro-name %J
5541 .  doc-parse-args \$@
5543 .  nr doc-arg-ptr +1
5544 .  nr doc-curr-font \n[.f]
5545 .  nr doc-curr-size \n[.ps]
5547 .  \" append to reference box
5548 .  boxa doc-journal-name
5549 .  ev doc-env-%J
5550 .  evc 0
5551 .  in 0
5552 .  nf
5553 .  nop \*[doc-Em-font]\c
5554 .  doc-do-references
5558 .\" NS doc-issue-count global register
5559 .\" NS   counter of issue number references
5561 .nr doc-issue-count 0
5564 .\" NS doc-issue-name global box
5565 .\" NS   string of collected issue number references
5567 .ds doc-issue-name
5570 .\" NS %N user macro
5571 .\" NS   [reference] issue number
5572 .\" NS
5573 .\" NS modifies:
5574 .\" NS   doc-arg-ptr
5575 .\" NS   doc-curr-font
5576 .\" NS   doc-curr-size
5577 .\" NS   doc-issue-count
5578 .\" NS   doc-macro-name
5579 .\" NS   doc-reference-count
5580 .\" NS
5581 .\" NS local variables:
5582 .\" NS   doc-env-%N
5583 .\" NS
5584 .\" NS width register `%N' set in doc-common
5586 .de %N
5587 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5588 .    tm Usage: .%N issue_number ... (#\n[.c])
5589 .    return
5590 .  \}
5592 .  nr doc-issue-count +1
5593 .  nr doc-reference-count +1
5595 .  ds doc-macro-name %N
5596 .  doc-parse-args \$@
5598 .  nr doc-arg-ptr +1
5599 .  nr doc-curr-font \n[.f]
5600 .  nr doc-curr-size \n[.ps]
5602 .  \" append to reference box
5603 .  boxa doc-issue-name
5604 .  ev doc-env-%N
5605 .  evc 0
5606 .  in 0
5607 .  nf
5608 .  doc-do-references
5612 .\" NS doc-optional-count global register
5613 .\" NS   counter of optional information references
5615 .nr doc-optional-count 0
5618 .\" NS doc-optional-string global box
5619 .\" NS   string of collected optional information references
5621 .ds doc-optional-string
5624 .\" NS %O user macro
5625 .\" NS   [reference] optional information
5626 .\" NS
5627 .\" NS modifies:
5628 .\" NS   doc-arg-ptr
5629 .\" NS   doc-curr-font
5630 .\" NS   doc-curr-size
5631 .\" NS   doc-macro-name
5632 .\" NS   doc-optional-count
5633 .\" NS   doc-reference-count
5634 .\" NS
5635 .\" NS local variables:
5636 .\" NS   doc-env-%O
5637 .\" NS
5638 .\" NS width register `%O' set in doc-common
5640 .de %O
5641 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5642 .    tm Usage: .%O optional_information ... (#\n[.c])
5643 .    return
5644 .  \}
5646 .  nr doc-optional-count +1
5647 .  nr doc-reference-count +1
5649 .  ds doc-macro-name %O
5650 .  doc-parse-args \$@
5652 .  nr doc-arg-ptr +1
5653 .  nr doc-curr-font \n[.f]
5654 .  nr doc-curr-size \n[.ps]
5656 .  \" append to reference box
5657 .  boxa doc-optional-string
5658 .  ev doc-env-%O
5659 .  evc 0
5660 .  in 0
5661 .  nf
5662 .  doc-do-references
5666 .\" NS doc-page-number-count global register
5667 .\" NS   counter of page number references
5669 .nr doc-page-number-count 0
5672 .\" NS doc-page-number-string global box
5673 .\" NS   string of collected page number references
5675 .ds doc-page-number-string
5678 .\" NS %P user macro
5679 .\" NS   [reference] page numbers
5680 .\" NS
5681 .\" NS modifies:
5682 .\" NS   doc-arg-ptr
5683 .\" NS   doc-curr-font
5684 .\" NS   doc-curr-size
5685 .\" NS   doc-macro-name
5686 .\" NS   doc-page-number-count
5687 .\" NS   doc-reference-count
5688 .\" NS
5689 .\" NS local variables:
5690 .\" NS   doc-env-%P
5691 .\" NS
5692 .\" NS width register `%P' set in doc-common
5694 .de %P
5695 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5696 .    tm Usage: .%P page_number ... (#\n[.c])
5697 .    return
5698 .  \}
5700 .  nr doc-page-number-count +1
5701 .  nr doc-reference-count +1
5703 .  ds doc-macro-name %P
5704 .  doc-parse-args \$@
5706 .  nr doc-arg-ptr +1
5707 .  nr doc-curr-font \n[.f]
5708 .  nr doc-curr-size \n[.ps]
5710 .  \" append to reference box
5711 .  boxa doc-page-number-string
5712 .  ev doc-env-%P
5713 .  evc 0
5714 .  in 0
5715 .  nf
5716 .  doc-do-references
5720 .\" NS doc-corporate-count global register
5721 .\" NS   counter of corporate references
5723 .nr doc-corporate-count 0
5726 .\" NS doc-corporate-name global box
5727 .\" NS   string of collected corporate references
5729 .ds doc-corporate-name
5732 .\" NS %Q user macro
5733 .\" NS   corporate or foreign author
5734 .\" NS
5735 .\" NS modifies:
5736 .\" NS   doc-arg-ptr
5737 .\" NS   doc-corporate-count
5738 .\" NS   doc-curr-font
5739 .\" NS   doc-curr-size
5740 .\" NS   doc-macro-name
5741 .\" NS   doc-reference-count
5742 .\" NS
5743 .\" NS local variables:
5744 .\" NS   doc-env-%Q
5745 .\" NS
5746 .\" NS width register `%Q' set in doc-common
5748 .de %Q
5749 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5750 .    tm Usage: .%Q corporate_or_foreign_author ... (#\n[.c])
5751 .    return
5752 .  \}
5754 .  nr doc-corporate-count +1
5755 .  nr doc-reference-count +1
5757 .  ds doc-macro-name %Q
5758 .  doc-parse-args \$@
5760 .  nr doc-arg-ptr +1
5761 .  nr doc-curr-font \n[.f]
5762 .  nr doc-curr-size \n[.ps]
5764 .  \" append to reference box
5765 .  boxa doc-corporate-name
5766 .  ev doc-env-%Q
5767 .  evc 0
5768 .  in 0
5769 .  nf
5770 .  doc-do-references
5774 .\" NS doc-report-count global register
5775 .\" NS   counter of report references
5777 .nr doc-report-count 0
5780 .\" NS doc-report-name global box
5781 .\" NS   string of collected report references
5783 .ds doc-report-name
5786 .\" NS %R user macro
5787 .\" NS   [reference] report name
5788 .\" NS
5789 .\" NS modifies:
5790 .\" NS   doc-arg-ptr
5791 .\" NS   doc-curr-font
5792 .\" NS   doc-curr-size
5793 .\" NS   doc-macro-name
5794 .\" NS   doc-reference-count
5795 .\" NS   doc-report-count
5796 .\" NS
5797 .\" NS local variables:
5798 .\" NS   doc-env-%R
5799 .\" NS
5800 .\" NS width register `%R' set in doc-common
5802 .de %R
5803 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5804 .    tm Usage: .%R reference_report ... (#\n[.c])
5805 .    return
5806 .  \}
5808 .  nr doc-report-count +1
5809 .  nr doc-reference-count +1
5811 .  ds doc-macro-name %R
5812 .  doc-parse-args \$@
5814 .  nr doc-arg-ptr +1
5815 .  nr doc-curr-font \n[.f]
5816 .  nr doc-curr-size \n[.ps]
5818 .  \" append to reference box
5819 .  boxa doc-report-name
5820 .  ev doc-env-%R
5821 .  evc 0
5822 .  in 0
5823 .  nf
5824 .  doc-do-references
5828 .\" NS doc-reference-title-count global register
5829 .\" NS   counter of reference title references
5831 .nr doc-reference-title-count 0
5834 .\" NS doc-reference-title-name global box
5835 .\" NS   string of collected reference title references
5837 .ds doc-reference-title-name
5840 .\" NS doc-reference-title-name-for-book global box
5841 .\" NS   string of collected reference title references
5842 .\" NS   (saved with another font; this is a shortcoming of groff)
5844 .ds doc-reference-title-name-for-book
5847 .\" NS %T user macro
5848 .\" NS   reference title
5849 .\" NS
5850 .\" NS modifies:
5851 .\" NS   doc-arg-ptr
5852 .\" NS   doc-curr-font
5853 .\" NS   doc-curr-size
5854 .\" NS   doc-macro-name
5855 .\" NS   doc-reference-title-count
5856 .\" NS   doc-report-count
5857 .\" NS
5858 .\" NS local variables:
5859 .\" NS   doc-env-%T
5860 .\" NS
5861 .\" NS width register `%T' set in doc-common
5863 .de %T
5864 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5865 .    tm Usage: .%T reference_title ... (#\n[.c])
5866 .    return
5867 .  \}
5869 .  if \n[doc-is-reference] \{\
5870 .    nr doc-reference-title-count +1
5871 .    nr doc-reference-count +1
5872 .  \}
5874 .  ds doc-macro-name %T
5875 .  doc-parse-args \$@
5877 .  nr doc-arg-ptr +1
5878 .  nr doc-curr-font \n[.f]
5879 .  nr doc-curr-size \n[.ps]
5880 .  ie \n[doc-is-reference] \{\
5881 .    \" append to reference box
5882 .    boxa doc-reference-title-name-for-book
5883 .    ev doc-env-%T
5884 .    evc 0
5885 .    in 0
5886 .    nf
5887 .    nop \*[doc-No-font]\c
5888 .    doc-do-references
5890 .    \" do it a second time with another font
5891 .    ds doc-macro-name %T
5892 .    doc-parse-args \$@
5894 .    nr doc-arg-ptr +1
5895 .    nr doc-curr-font \n[.f]
5896 .    nr doc-curr-size \n[.ps]
5897 .    boxa doc-reference-title-name
5898 .    ev doc-env-%T
5899 .    evc 0
5900 .    in 0
5901 .    nf
5902 .    nop \*[doc-Em-font]\c
5903 .    doc-do-references
5904 .  \}
5905 .  el \{\
5906 .    nop \*[doc-Em-font]\c
5907 .    doc-print-recursive
5908 .  \}
5912 .\" NS doc-volume-count global register
5913 .\" NS   counter of reference title references
5915 .nr doc-volume-count 0
5918 .\" NS doc-volume-name global box
5919 .\" NS   string of collected volume references
5921 .ds doc-volume-name
5924 .\" NS %V user macro
5925 .\" NS   reference volume
5926 .\" NS
5927 .\" NS modifies:
5928 .\" NS   doc-arg-ptr
5929 .\" NS   doc-curr-font
5930 .\" NS   doc-curr-size
5931 .\" NS   doc-macro-name
5932 .\" NS   doc-reference-title-count
5933 .\" NS   doc-volume-count
5934 .\" NS
5935 .\" NS local variables:
5936 .\" NS   doc-env-%V
5937 .\" NS
5938 .\" NS width register `%V' set in doc-common
5940 .de %V
5941 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5942 .    tm Usage: .%V volume ... (#\n[.c])
5943 .    return
5944 .  \}
5946 .  nr doc-volume-count +1
5947 .  nr doc-reference-count +1
5949 .  ds doc-macro-name %V
5950 .  doc-parse-args \$@
5952 .  nr doc-arg-ptr +1
5953 .  nr doc-curr-font \n[.f]
5954 .  nr doc-curr-size \n[.ps]
5956 .  \" append to reference box
5957 .  boxa doc-volume-name
5958 .  ev doc-env-%V
5959 .  evc 0
5960 .  in 0
5961 .  nf
5962 .  doc-do-references
5966 .\" NS doc-do-references macro
5967 .\" NS   reference recursion routine
5968 .\" NS
5969 .\" NS modifies:
5970 .\" NS   doc-arg-ptr
5971 .\" NS
5972 .\" NS local variables:
5973 .\" NS   doc-reg-ddr
5974 .\" NS   doc-reg-ddr1
5976 .de doc-do-references
5977 .  if !\n[doc-is-reference] \
5978 .    tm mdoc error: .\*[doc-macro-name] found outside of .Rs ... .Re (#\n[.c])
5980 .  nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
5982 .  ie (\n[doc-reg-ddr1] == 1) \{\
5983 .    \" .nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
5984 .    doc-append-arg \c 3
5985 .    \*[doc-arg\n[doc-arg-ptr]]
5986 .  \}
5987 .  el \{\
5988 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\c
5990 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
5991 .      \" finish reference box
5992 .      br
5993 .      ev
5994 .      boxa
5996 .      doc-reset-args
5997 .    \}
5998 .    el \{\
5999 .      nr doc-reg-ddr \n[doc-arg-ptr]
6000 .      nr doc-arg-ptr +1
6001 .      nop \)\*[doc-space\n[doc-reg-ddr]]\c
6002 .      doc-do-references
6003 .  \}\}
6007 .\" NS Hf user macro
6008 .\" NS   source include header files.
6009 .\" NS
6010 .\" NS modifies:
6011 .\" NS   doc-curr-font
6012 .\" NS   doc-curr-size
6013 .\" NS
6014 .\" NS width register `Hf' set in doc-common
6016 .de Hf
6017 .  ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
6018 .    doc-paragraph
6019 .    nop File:
6020 .    Pa \$1
6022 .    Bd -literal
6023 .    so \$1
6024 .    Ed
6026 .    doc-paragraph
6027 .  \}
6028 .  el \
6029 .    Usage: .Hf file (#\n[.c])
6033 .\" NS doc-have-author global register (bool)
6034 .\" NS   set in `An'
6036 .nr doc-have-author 0
6039 .\" NS An user macro
6040 .\" NS   author name
6041 .\" NS
6042 .\" NS modifies:
6043 .\" NS   doc-arg-ptr
6044 .\" NS   doc-curr-font
6045 .\" NS   doc-curr-size
6046 .\" NS   doc-have-author
6047 .\" NS   doc-macro-name
6048 .\" NS
6049 .\" NS width register `An' set in doc-common
6051 .de An
6052 .  if !\n[doc-arg-limit] \{\
6053 .    ie \n[.$] \{\
6054 .      ie        "\$1"-nosplit" \
6055 .        nr doc-in-authors-section 0
6056 .      el \{ .ie "\$1"-split" \
6057 .        nr doc-in-authors-section 1
6058 .      el \{\
6059 .        ds doc-macro-name An
6060 .        doc-parse-args \$@
6061 .    \}\}\}
6062 .    el \{\
6063 .      tm1 "Usage: .An {-nosplit | -split}
6064 .      tm1         .An author_name ... (#\n[.c])
6065 .  \}\}
6067 .  if \n[doc-in-authors-section] \{\
6068 .    ie \n[doc-have-author] \
6069 .      br
6070 .    el \
6071 .      nr doc-have-author 1
6072 .  \}
6074 .  if \n[doc-arg-limit] \{\
6075 .    nr doc-arg-ptr +1
6076 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
6077 .      nr doc-curr-font \n[.f]
6078 .      nr doc-curr-size \n[.ps]
6079 .      doc-print-recursive
6080 .    \}
6081 .    el \{\
6082 .      tm Usage: .An author_name ... (#\n[.c])
6083 .      doc-reset-args
6084 .  \}\}
6088 .\" NS Sf user macro
6089 .\" NS   defunct
6090 .\" NS
6091 .\" NS width register `Sf' set in doc-common
6093 .de Sf
6094 .  tm mdoc error: .Sf defunct, use .Pf or .Ns (#\n[.c])
6098 .\" NS Rv user macro
6099 .\" NS   return values
6100 .\" NS
6101 .\" NS width register `Rv' set in doc-common
6102 .\" NS
6103 .\" NS local variables:
6104 .\" NS   doc-str-Rv-prefix
6105 .\" NS   doc-str-Rv-suffix
6107 .ds doc-str-Rv-prefix "The
6108 .ds doc-str-Rv-suffix "function returns the value\~0 if successful;
6109 .as doc-str-Rv-suffix " otherwise the value\~-1 is returned and
6110 .as doc-str-Rv-suffix " the global variable \*[doc-Va-font]errno\f[P]
6111 .as doc-str-Rv-suffix " is set to indicate the error.
6113 .de Rv
6115 .\" XXX: what does this function without `-std'?
6117 .  if !\n[.$] \{\
6118 .    tm Usage: .Rv [-std] (#\n[.c])
6119 .    return
6120 .  \}
6122 .  \" .ds doc-macro-name Rv
6123 .  \" .nr doc-arg-ptr 0
6124 .  \" .nr lR +1
6125 .  \" .ds doc-arg1 \$2
6126 .  \" .ds doc-arg2 \$3
6127 .  \" .ds doc-arg3 \$4
6128 .  \" .ds doc-arg4 \$5
6129 .  \" .ds doc-arg5 \$6
6130 .  \" .ds doc-arg6 \$7
6131 .  \" .ds doc-arg7 \$8
6132 .  \" .ds doc-arg8 \$9
6133 .  \" .
6134 .  \" .nr doc-num-args (\n[.$] - 1)
6136 .  if "\$1"-std" \{\
6137 .    nr doc-reg-Rv \*[doc-section]
6138 .    if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
6139 .      tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
6140 .    br
6141 .    nop \)\*[doc-str-Rv-prefix]
6142 .    Fn \$2
6143 .    nop \)\*[doc-str-Rv-suffix]
6144 .  \}
6148 .\" NS Mt user macro
6149 .\" NS   mailto (for conversion to HTML)
6151 .de Mt
6152 .  \" XXX: error handling missing
6153 .  Pa \$@
6157 .\" NS Lk user macro
6158 .\" NS   link (for conversion to HTML)
6159 .\" NS
6160 .\" NS local variables:
6161 .\" NS   doc-reg-Lk
6162 .\" NS   doc-str-Lk
6164 .de Lk
6165 .  ds doc-str-Lk Sy \$@
6167 .  ie (\n[.$] > 1) \{\
6168 .    doc-get-arg-type \$2
6169 .    ie (\n[doc-arg-type] < 3) \{\
6170 .      Em \)\$2:
6171 .      ds doc-str-Lk Sy "\$1"
6172 .      doc-get-width "\$1"
6173 .      shift 2
6174 .      if \n[.$] \
6175 .        as doc-str-Lk " \$@
6176 .    \}
6177 .    el \
6178 .      doc-get-width "\$1"
6179 .  \}
6180 .  el \
6181 .    doc-get-width "\$1"
6183 .  ie n \
6184 .    nr doc-reg-Lk 26
6185 .  el \
6186 .    nr doc-reg-Lk 38
6187 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
6188 .    D1 \*[doc-str-Lk]
6189 .  el \
6190 .    \*[doc-str-Lk]
6194 .rn em e@
6196 .de em
6197 .  tm1 "mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
6198 .  tm1 "            Should this have been `.Em ...'?
6199 .  ab
6203 .\" NS doc-empty-line macro
6204 .\" NS   emit warning and print empty line
6206 .de doc-empty-line
6207 .  if !"\*[doc-macro-name]"Bd" \
6208 .    tm mdoc warning: Empty input line #\n[.c]
6209 .  sp
6212 .blm doc-empty-line
6218 .\" load local modifications
6219 .mso mdoc.local
6221 .\" EOF