Get rid of the old texinfo.
[dragonfly.git] / contrib / groff / tmac / doc.tmac
1 .\" Copyright (c) 1991, 1993
2 .\"     The Regents of the University of California.  All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\"    must display the following acknowledgement:
14 .\"      This product includes software developed by the University of
15 .\"      California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\"    may be used to endorse or promote products derived from this software
18 .\"    without specific prior written permission.
19 .\"
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .\" SUCH DAMAGE.
31 .\"
32 .\"     @(#)doc 8.1 (Berkeley) 06/08/93
33 .\"
34 .\" Modified by jjc@jclark.com as follows: the doc-* files are assumed to be
35 .\" installed as mdoc/doc-* rather than tmac.doc-* (the filename
36 .\" `tmac.doc-common' would be too long); when using groff, the doc-* files
37 .\" are loaded using the `mso' request.
38 .\"
39 .\" Modified by
40 .\"
41 .\"   Werner LEMBERG <wl@gnu.org>      and
42 .\"   Ruslan Ermilov <ru@freebsd.org>
43 .\"
44 .\" to make it more readable: using long names and many groff features,
45 .\" updating and extending documentation, etc.
46 .\"
47 .\" %beginstrip%
48 .
49 .
50 .if !\n(.g \
51 .  ab This version of mdoc can be run with GNU troff only!
52 .
53 .
54 .do if d Dd .nx
55 .
56 .
57 .cp 0
58 .
59 .
60 .if (\n[.x]\n[.y] < 118) \
61 .  ab You need GNU troff version 1.18 or higher to run this version of mdoc!
62 .
63 .
64 .\" Load start-up files
65 .ie t \
66 .  mso mdoc/doc-ditroff
67 .el \
68 .  mso mdoc/doc-nroff
69 .
70 .mso mdoc/doc-common
71 .mso mdoc/doc-syms
72 .
73 .
74 .eo
75 .
76 .
77 .\" NS doc-macro-name global string
78 .\" NS   name of calling request (set in each user-requestable macro)
79 .
80 .ds doc-macro-name
81 .als doc-arg0 doc-macro-name
82 .
83 .
84 .\" NS doc-arg-limit global register
85 .\" NS   total number of arguments
86 .
87 .nr doc-arg-limit 0
88 .
89 .
90 .\" NS doc-num-args global register
91 .\" NS   number of arguments to handle (must be set to \n[.$] prior to
92 .\" NS   `doc-parse-arg-vector' request)
93 .
94 .nr doc-num-args 0
95 .
96 .
97 .\" NS doc-arg-ptr global register
98 .\" NS   argument pointer
99 .
100 .nr doc-arg-ptr 0
101 .
102 .
103 .\" NS doc-argXXX global string
104 .\" NS   argument vector
105 .\" NS
106 .\" NS limit:
107 .\" NS   doc-arg-limit
108 .
109 .ds doc-arg1
110 .
111 .
112 .\" NS doc-typeXXX global register
113 .\" NS   argument type vector (macro=1, string=2, punctuation suffix=3,
114 .\" NS   punctuation prefix=4)
115 .\" NS
116 .\" NS limit:
117 .\" NS   doc-arg-limit
118 .
119 .nr doc-type1 0
120 .
121 .
122 .\" NS doc-spaceXXX global string
123 .\" NS   space vector
124 .\" NS
125 .\" NS limit:
126 .\" NS   doc-arg-limit
127 .
128 .ds doc-space1
129 .
130 .
131 .\" NS doc-parse-args macro
132 .\" NS   parse arguments (recursively) (`.doc-parse-args arg ...')
133 .\" NS
134 .\" NS modifies:
135 .\" NS   doc-arg-limit
136 .\" NS   doc-arg-ptr
137 .\" NS   doc-argXXX
138 .\" NS   doc-spaceXXX
139 .\" NS   doc-typeXXX
140 .\" NS   doc-arg-ptr
141 .\" NS   doc-have-space
142 .\" NS
143 .\" NS local variables:
144 .\" NS   doc-reg-dpa
145 .\" NS   doc-reg-dpa1
146 .\" NS   doc-str-dpa
147 .
148 .de doc-parse-args
149 .  if !\n[doc-arg-limit] \
150 .    doc-set-spacing-1
151 .
152 .  nr doc-have-space 0
153 .
154 .  if !\n[.$] \
155 .    return
156 .
157 .  nr doc-arg-limit +1
158 .
159 .  \" handle `|' and `...' specially
160 .  ie        "\$1"|" \
161 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[]
162 .  el \{ .ie "\$1"..." \
163 .    ds doc-arg\n[doc-arg-limit] \|.\|.\|.
164 .  el \
165 .    ds doc-arg\n[doc-arg-limit] "\$1
166 .  \}
167 .
168 .  \" get argument type and set spacing
169 .  doc-get-arg-type* \n[doc-arg-limit]
170 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
171 .  doc-set-spacing-\n[doc-arg-type]
172 .
173 .  \" check whether we have processed the last parameter
174 .  ie (\n[.$] == 1) \
175 .    nr doc-arg-ptr 0
176 .  el \{\
177 .    shift
178 .    doc-parse-args \$@
179 .  \}
180 .
181 .  nh
182 ..
183 .
184 .
185 .\" NS doc-parse-arg-vector macro
186 .\" NS   parse argument vector (recursive)
187 .\" NS
188 .\" NS   cf. comments in doc-parse-args
189 .\" NS
190 .\" NS modifies:
191 .\" NS   doc-arg-limit
192 .\" NS   doc-arg-ptr
193 .\" NS   doc-argXXX
194 .\" NS   doc-num-args
195 .\" NS   doc-spaceXXX
196 .\" NS   doc-typeXXX
197 .\" NS
198 .\" NS local variables:
199 .\" NS   doc-reg-dpav
200 .\" NS   doc-reg-dpav1
201 .\" NS   doc-str-dpav
202 .
203 .de doc-parse-arg-vector
204 .  if !\n[doc-arg-limit] \
205 .    doc-set-spacing-1
206 .
207 .  nr doc-arg-limit +1
208 .
209 .  ie        "\*[doc-arg\n[doc-arg-limit]]"|" \
210 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[]
211 .  el \{ .if "\*[doc-arg\n[doc-arg-limit]]"..." \
212 .    ds doc-arg\n[doc-arg-limit] \|.\|.\|.
213 .  \}
214 .
215 .  doc-get-arg-type* \n[doc-arg-limit]
216 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
217 .  doc-set-spacing-\n[doc-arg-type]
218 .
219 .  ie (\n[doc-num-args] == 1) \{\
220 .    nr doc-arg-ptr 0
221 .    nr doc-num-args 0
222 .  \}
223 .  el \{\
224 .    nr doc-num-args -1
225 .    doc-parse-arg-vector
226 .  \}
227 .
228 .  nh
229 ..
230 .
231 .
232 .\" NS doc-parse-space-vector macro
233 .\" NS   parse space vector (recursive)
234 .\" NS
235 .\" NS modifies:
236 .\" NS   doc-arg-limit
237 .\" NS   doc-num-args
238 .\" NS   doc-spaceXXX
239 .
240 .de doc-parse-space-vector
241 .  nr doc-arg-limit +1
242 .
243 .  doc-set-spacing-\n[doc-type\n[doc-arg-limit]]
244 .
245 .  ie (\n[doc-num-args] == 1) \
246 .    nr doc-num-args 0
247 .  el \{\
248 .    nr doc-num-args -1
249 .    doc-parse-space-vector
250 .  \}
251 ..
252 .
253 .
254 .\" NS doc-remaining-args macro
255 .\" NS   output remaining arguments as-is, separated by spaces (until
256 .\" NS   `doc-num-args' is exhausted)
257 .\" NS
258 .\" NS modifies:
259 .\" NS   doc-arg-ptr
260 .\" NS   doc-num-args
261 .
262 .de doc-remaining-args
263 .  nr doc-arg-ptr +1
264 .  nop \)\*[doc-arg\n[doc-arg-ptr]]\c
265 .
266 .  ie (\n[doc-num-args] == 1) \{\
267 .    nr doc-arg-ptr 0
268 .    nr doc-num-args 0
269 .  \}
270 .  el \{\
271 .    nop \)\*[doc-space]\c
272 .    nr doc-num-args -1
273 .    doc-remaining-args
274 .  \}
275 ..
276 .
277 .
278 .\" NS doc-append-arg macro
279 .\" NS   append one argument to argument vector:
280 .\" NS   `.doc-append-arg [arg] [type]'
281 .\" NS
282 .\" NS modifies:
283 .\" NS   doc-arg-limit
284 .\" NS   doc-argXXX
285 .\" NS   doc-typeXXX
286 .
287 .de doc-append-arg
288 .  nr doc-arg-limit +1
289 .  ds doc-arg\n[doc-arg-limit] "\$1
290 .  nr doc-type\n[doc-arg-limit] \$2
291 .  doc-set-spacing-\$2
292 ..
293 .
294 .
295 .\" NS doc-print-and-reset macro
296 .\" NS   finish input line and clean up argument vectors
297 .
298 .de doc-print-and-reset
299 .  if \n[doc-space-mode] \
300 .    nop \)
301 .  doc-reset-args
302 ..
303 .
304 .
305 .\" NS doc-reset-args macro
306 .\" NS   reset argument counters
307 .\" NS
308 .\" NS modifies:
309 .\" NS   doc-arg-limit
310 .\" NS   doc-arg-ptr
311 .\" NS   doc-have-slot
312 .
313 .de doc-reset-args
314 .  nr doc-arg-limit 0
315 .  nr doc-arg-ptr 0
316 .  nr doc-have-slot 0
317 .
318 .  hy \n[doc-hyphen-flags]
319 ..
320 .
321 .
322 .ec
323 .
324 .\" NS doc-curr-font global register
325 .\" NS   saved current font
326 .
327 .nr doc-curr-font \n[.f]
328 .
329 .
330 .\" NS doc-curr-size global register
331 .\" NS   saved current font size
332 .
333 .nr doc-curr-size \n[.ps]
334 .
335 .eo
336 .
337 .
338 .\" NS Fl user macro
339 .\" NS   handle flags (appends `-' and prints flags): `.Fl [arg ...]'
340 .\" NS
341 .\" NS modifies:
342 .\" NS   doc-arg-ptr
343 .\" NS   doc-curr-font
344 .\" NS   doc-curr-size
345 .\" NS   doc-macro-name
346 .\" NS
347 .\" NS local variables:
348 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
349 .\" NS
350 .\" NS width register `Fl' set in doc-common
351 .
352 .de Fl
353 .  nr doc-curr-font \n[.f]
354 .  nr doc-curr-size \n[.ps]
355 .  nop \*[doc-Fl-font]\c
356 .
357 .  if !\n[doc-arg-limit] \{\
358 .    ds doc-macro-name Fl
359 .    doc-parse-args \$@
360 .
361 .    if !\n[.$] \{\
362 .      \" no arguments
363 .      nop \|\-\|\f[]\s[0]
364 .  \}\}
365 .
366 .  if !\n[doc-arg-limit] \
367 .    return
368 .
369 .  nr doc-arg-ptr +1
370 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
371 .    \" last argument
372 .    nop \|\-\f[]\s[0]\c
373 .    doc-print-and-reset
374 .  \}
375 .  el \{\
376 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
377 .      nop \|\-\f[]\s[0]\c
378 .      \*[doc-arg\n[doc-arg-ptr]]
379 .    \}
380 .    el \{\
381 .      if (\n[doc-type\n[doc-arg-ptr]] == 3) \
382 .        nop \|\-\|\c
383 .
384 .      nr doc-reg-Fl 1
385 .      doc-flag-recursion
386 .  \}\}
387 ..
388 .
389 .
390 .\" NS doc-flag-recursion macro
391 .\" NS   `Fl' flag recursion routine (special handling)
392 .\" NS
393 .\" NS modifies:
394 .\" NS   doc-arg-ptr
395 .\" NS
396 .\" NS local variables:
397 .\" NS   doc-reg-dfr
398 .\" NS   doc-reg-dfr1
399 .\" NS   doc-str-dfr
400 .
401 .de doc-flag-recursion
402 .  nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
403 .  ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
404 .
405 .  ie (\n[doc-reg-dfr1] == 1) \{\
406 .    nop \f[]\s[0]\c
407 .    \*[doc-str-dfr]
408 .  \}
409 .  el \{\
410 .    nr doc-reg-dfr \n[doc-arg-ptr]
411 .
412 .    ie (\n[doc-reg-dfr1] == 2) \{\
413 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
414 .      \" doc-flag-recursion only; we need this to make `.Fl | ...' work
415 .      \" correctly
416 .      ie "\*[doc-str-dfr]"\*[Ba]" \{\
417 .        if \n[doc-reg-Fl] \
418 .          nop \|\-\*[doc-space]\c
419 .        nop \)\*[Ba]\c
420 .      \}
421 .      el \{\
422 .        ie "\*[doc-str-dfr]"\f[R]|\f[]" \{\
423 .          if \n[doc-reg-Fl] \
424 .            nop \|\-\*[doc-space]\c
425 .          nop \f[R]|\f[]\c
426 .        \}
427 .        el \{\
428 .          \" two consecutive hyphen characters?
429 .          ie "\*[doc-str-dfr]"-" \
430 .            nop \|\-\^\-\|\c
431 .          el \
432 .            nop \|\%\-\*[doc-str-dfr]\&\c
433 .    \}\}\}
434 .    el \{\
435 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
436 .      nop \)\*[doc-str-dfr]\f[]\s[0]\c
437 .    \}
438 .
439 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
440 .      \" last argument
441 .      if (\n[doc-reg-dfr1] == 4) \
442 .        nop \|\-\c
443 .      nop \f[]\s[0]\c
444 .      doc-print-and-reset
445 .    \}
446 .    el \{\
447 .      nr doc-arg-ptr +1
448 .      ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
449 .        ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
450 .          nop \|\-\c
451 .        el \
452 .          nop \)\*[doc-space\n[doc-reg-dfr]]\c
453 .      \}
454 .      el \
455 .        nop \)\*[doc-space\n[doc-reg-dfr]]\c
456 .
457 .      shift
458 .      nr doc-reg-Fl 0
459 .      doc-flag-recursion \$@
460 .  \}\}
461 ..
462 .
463 .
464 .\" NS doc-print-recursive macro
465 .\" NS   general name recursion routine (print remaining arguments)
466 .\" NS
467 .\" NS modifies:
468 .\" NS   doc-arg-ptr
469 .\" NS
470 .\" NS local variables:
471 .\" NS   doc-reg-dpr
472 .\" NS   doc-reg-dpr1
473 .\" NS   doc-str-dpr
474 .
475 .de doc-print-recursive
476 .  nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
477 .  ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
478 .
479 .  ie (\n[doc-reg-dpr1] == 1) \{\
480 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
481 .    \*[doc-str-dpr]
482 .  \}
483 .  el \{\
484 .    nr doc-reg-dpr \n[doc-arg-ptr]
485 .
486 .    ie (\n[doc-reg-dpr1] == 2) \
487 .      \" the `\%' prevents hyphenation on a dash (`-')
488 .      nop \%\*[doc-str-dpr]\&\c
489 .    el \{\
490 .      \" punctuation character
491 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
492 .      nop \)\*[doc-str-dpr]\f[]\s[0]\c
493 .    \}
494 .
495 .    nr doc-arg-ptr +1
496 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
497 .      \" last argument
498 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
499 .      doc-print-and-reset
500 .    \}
501 .    el \{\
502 .      nop \)\*[doc-space\n[doc-reg-dpr]]\c
503 .      doc-print-recursive
504 .  \}\}
505 ..
506 .
507 .
508 .\" NS doc-print-prefixes macro
509 .\" NS   print leading prefixes
510 .\" NS
511 .\" NS modifies:
512 .\" NS   doc-arg-ptr
513 .
514 .de doc-print-prefixes
515 .  while (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
516 .    if !(\n[doc-type\n[doc-arg-ptr]] == 4) \
517 .      break
518 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
519 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\f[]\s[0]\c
520 .    nr doc-arg-ptr +1
521 .  \}
522 ..
523 .
524 .
525 .\" NS doc-generic-macro macro
526 .\" NS   this is the skeleton for most simple macros
527 .\" NS
528 .\" NS modifies:
529 .\" NS   doc-arg-ptr
530 .\" NS   doc-curr-font
531 .\" NS   doc-curr-size
532 .\" NS   doc-macro-name
533 .
534 .de doc-generic-macro
535 .  if !\n[doc-arg-limit] \{\
536 .    ie \n[.$] \{\
537 .      ds doc-macro-name \$0
538 .      doc-parse-args \$@
539 .    \}
540 .    el \
541 .      tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
542 .  \}
543 .
544 .  if !\n[doc-arg-limit] \
545 .    return
546 .
547 .  nr doc-arg-ptr +1
548 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
549 .    if (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
550 .      tmc mdoc warning: Using a macro as first argument
551 .      tm1 " cancels effect of .\$0 (#\n[.c])
552 .
553 .      \" the right action here would be to reset the argument counters
554 .      \" and bail out -- unfortunately, a small number of manual pages
555 .      \" (less than 2% for FreeBSD which has been used for testing)
556 .      \" relied on the old behaviour (silently ignore this error),
557 .      \" so it is commented out
558 .
559 .\"    doc-reset-args
560 .    \}
561 .\"  el \{\
562 .      nr doc-curr-font \n[.f]
563 .      nr doc-curr-size \n[.ps]
564 .      nop \*[doc-\$0-font]\c
565 .      doc-print-recursive
566 .\"  \}
567 .  \}
568 .  el \{\
569 .    tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
570 .    doc-reset-args
571 .  \}
572 ..
573 .
574 .
575 .\" NS Ar user macro
576 .\" NS   command line `argument' macro: `.Ar [args ...]'
577 .\" NS
578 .\" NS modifies:
579 .\" NS   doc-arg-ptr
580 .\" NS   doc-curr-font
581 .\" NS   doc-curr-size
582 .\" NS   doc-macro-name
583 .\" NS
584 .\" NS local variable:
585 .\" NS   doc-str-Ar-default
586 .\" NS
587 .\" NS width register `Ar' set in doc-common
588 .
589 .ds doc-str-Ar-default "file\ .\|.\|.
590 .
591 .de Ar
592 .  nr doc-curr-font \n[.f]
593 .  nr doc-curr-size \n[.ps]
594 .  nop \*[doc-Ar-font]\c
595 .
596 .  if !\n[doc-arg-limit] \{\
597 .    ds doc-macro-name Ar
598 .    doc-parse-args \$@
599 .
600 .    if !\n[.$] \{\
601 .      \" no argument
602 .      nop \)\*[doc-str-Ar-default]\&\f[]\s[0]
603 .  \}\}
604 .
605 .  if !\n[doc-arg-limit] \
606 .    return
607 .
608 .  nr doc-arg-ptr +1
609 .  doc-print-prefixes
610 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
611 .    nop \)\*[doc-str-Ar-default]\&\f[]\s[0]\c
612 .    doc-print-and-reset
613 .  \}
614 .  el \{\
615 .    if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
616 .      \" replace previous argument (Ar) with default value
617 .      nr doc-arg-ptr -1
618 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Ar-default]
619 .      nr doc-type\n[doc-arg-ptr] 2
620 .      ds doc-space\n[doc-arg-ptr] "\*[doc-space]
621 .
622 .      \" recompute space vector for remaining arguments
623 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
624 .      nr doc-arg-limit \n[doc-arg-ptr]
625 .      doc-parse-space-vector
626 .    \}
627 .    doc-print-recursive
628 .  \}
629 ..
630 .
631 .
632 .\" NS Ad user macro
633 .\" NS   Addresses
634 .\" NS
635 .\" NS width register `Ad' set in doc-common
636 .
637 .als Ad doc-generic-macro
638 .ds doc-Ad-usage address
639 .
640 .
641 .\" NS doc-indent-synopsis global register
642 .\" NS   indentation in synopsis
643 .
644 .nr doc-indent-synopsis 0
645 .
646 .
647 .\" NS doc-indent-synopsis-active global register (bool)
648 .\" NS   indentation in synopsis active
649 .
650 .nr doc-indent-synopsis-active 0
651 .
652 .
653 .\" NS Cd user macro
654 .\" NS   config declaration (for section 4 SYNOPSIS)
655 .\" NS
656 .\" NS   this function causes a break; it uses the `Nm' font
657 .\" NS
658 .\" NS modifies:
659 .\" NS   doc-arg-ptr
660 .\" NS   doc-curr-font
661 .\" NS   doc-curr-size
662 .\" NS   doc-indent-synopsis
663 .\" NS   doc-macro-name
664 .\" NS
665 .\" NS width register `Cd' set in doc-common
666 .
667 .de Cd
668 .  if !\n[doc-arg-limit] \{\
669 .    ie \n[.$] \{\
670 .      ds doc-macro-name Cd
671 .      doc-parse-args \$@
672 .    \}
673 .    el \
674 .      tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
675 .  \}
676 .
677 .  if !\n[doc-arg-limit] \
678 .    return
679 .
680 .  nr doc-arg-ptr +1
681 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
682 .    nr doc-curr-font \n[.f]
683 .    nr doc-curr-size \n[.ps]
684 .
685 .    ie \n[doc-in-synopsis-section] \{\
686 .      if "\*[doc-macro-name]"Cd" \{\
687 .        br
688 .        if !\n[doc-indent-synopsis] \
689 .          nr doc-indent-synopsis \n[doc-display-indent]u
690 .        if !\n[doc-indent-synopsis-active] \
691 .          in +\n[doc-indent-synopsis]u
692 .        ti -\n[doc-indent-synopsis]u
693 .        nop \*[doc-Nm-font]\c
694 .        doc-print-recursive
695 .        if !\n[doc-indent-synopsis-active] \
696 .          in -\n[doc-indent-synopsis]u
697 .    \}\}
698 .    el \{\
699 .      nop \*[doc-Nm-font]\c
700 .      doc-print-recursive
701 .  \}\}
702 .  el \{\
703 .    tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
704 .    doc-reset-args
705 .  \}
706 ..
707 .
708 .
709 .\" NS Cm user macro
710 .\" NS   interactive command modifier (flag)
711 .\" NS
712 .\" NS width register `Cm' set in doc-common
713 .
714 .als Cm doc-generic-macro
715 .ds doc-Cm-usage interactive_command_modifier
716 .
717 .
718 .\" NS Dv user macro
719 .\" NS   defined variable
720 .\" NS
721 .\" NS   this function uses the `Er' font
722 .\" NS
723 .\" NS width register `Dv' set in doc-common
724 .
725 .als Dv doc-generic-macro
726 .ds doc-Dv-usage defined_variable
727 .als doc-Dv-font doc-Er-font
728 .
729 .
730 .\" NS Em user macro
731 .\" NS   emphasis
732 .\" NS
733 .\" NS width register `Em' set in doc-common
734 .
735 .als Em doc-generic-macro
736 .ds doc-Em-usage text
737 .
738 .
739 .\" NS Er user macro
740 .\" NS   errno type
741 .\" NS
742 .\" NS width register `Er' set in doc-common
743 .
744 .als Er doc-generic-macro
745 .ds doc-Er-usage text
746 .
747 .
748 .\" NS Ev user macro
749 .\" NS   environment variable
750 .\" NS
751 .\" NS width register `Ev' set in doc-common
752 .
753 .als Ev doc-generic-macro
754 .ds doc-Ev-usage text
755 .
756 .
757 .\" NS doc-have-decl global register (bool)
758 .\" NS   subroutine test (in synopsis only)
759 .
760 .nr doc-have-decl 0
761 .
762 .
763 .\" NS doc-have-var global register (bool)
764 .\" NS   whether last type is a variable type
765 .
766 .nr doc-have-var 0
767 .
768 .
769 .\" NS doc-do-func-decl macro
770 .\" NS   do someting special while in SYNOPSIS
771 .\" NS
772 .\" NS modifies:
773 .\" NS   doc-curr-font
774 .\" NS   doc-curr-size
775 .\" NS   doc-have-decl
776 .\" NS   doc-have-var
777 .
778 .de doc-do-func-decl
779 .  if \n[doc-in-synopsis-section] \{\
780 .    \" if a variable type was the last thing given, want vertical space
781 .    if \n[doc-have-var] \{\
782 .      doc-paragraph
783 .      nr doc-have-var 0
784 .    \}
785 .    \" if a subroutine was the last thing given, want vertical space
786 .    if \n[doc-have-func] \{\
787 .      ie \n[doc-have-decl] \
788 .        br
789 .      el \
790 .        doc-paragraph
791 .    \}
792 .    nr doc-have-decl 1
793 .  \}
794 .
795 .  nr doc-curr-font \n[.f]
796 .  nr doc-curr-size \n[.ps]
797 ..
798 .
799 .
800 .\" NS Fd user macro
801 .\" NS   function declaration -- not callable
802 .\" NS
803 .\" NS   this function causes a break
804 .\" NS
805 .\" NS width register `Fd' set in doc-common
806 .
807 .de Fd
808 .  ie ((\n[.$] >= 1) & (\n[doc-arg-limit] == 0)) \{\
809 .    doc-do-func-decl
810 .    nop \*[doc-Fd-font]\$*
811 .    br
812 .    ft \n[doc-curr-font]
813 .    ps \n[doc-curr-size]u
814 .  \}
815 .  el \{\
816 .    tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
817 .    doc-reset-args
818 .  \}
819 ..
820 .
821 .
822 .\" NS In user macro
823 .\" NS   #include statement - not callable
824 .\" NS
825 .\" NS   this function causes a break; it uses the `Fd' font
826 .\" NS
827 .\" NS width register `In' set in doc-common
828 .
829 .de In
830 .  ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
831 .    doc-do-func-decl
832 .    nop \*[doc-Fd-font]#include <\$1>
833 .    br
834 .    ft \n[doc-curr-font]
835 .    ps \n[doc-curr-size]u
836 .  \}
837 .  el \{\
838 .    tm Usage: .In include_file -- In is not callable (#\n[.c])
839 .    doc-reset-args
840 .  \}
841 ..
842 .
843 .
844 .\" NS Fr user macro
845 .\" NS   function return value
846 .\" NS
847 .\" NS   this function uses the `Ar' font
848 .\" NS
849 .\" NS width register `Fr' set in doc-common
850 .
851 .als Fr doc-generic-macro
852 .ds doc-Fr-usage function_return_value
853 .als doc-Fr-font doc-Ar-font
854 .
855 .
856 .\" NS Ic user macro
857 .\" NS   interactive command
858 .\" NS
859 .\" NS width register `Ic' set in doc-common
860 .
861 .als Ic doc-generic-macro
862 .ds doc-Ic-usage interactive_command
863 .
864 .
865 .\" NS Li user macro
866 .\" NS   literals
867 .\" NS
868 .\" NS width register `Li' set in doc-common
869 .
870 .als Li doc-generic-macro
871 .ds doc-Li-usage argument
872 .
873 .
874 .\" NS Ms user macro
875 .\" NS   math symbol
876 .\" NS
877 .\" NS   this function uses the `Sy' font
878 .\" NS
879 .\" NS width register `Ms' set in doc-common
880 .
881 .als Ms doc-generic-macro
882 .ds doc-Ms-usage math_symbol
883 .als doc-Ms-font doc-Sy-font
884 .
885 .
886 .\" NS doc-command-name global string
887 .\" NS   save first invocation of .Nm
888 .
889 .ds doc-command-name
890 .
891 .
892 .\" NS Nm user macro
893 .\" NS   name of command or page topic
894 .\" NS
895 .\" NS modifies:
896 .\" NS   doc-arg-ptr
897 .\" NS   doc-command-name
898 .\" NS   doc-curr-font
899 .\" NS   doc-curr-size
900 .\" NS   doc-indent-synopsis
901 .\" NS   doc-indent-synopsis-active
902 .\" NS   doc-macro-name
903 .\" NS
904 .\" NS width register `Nm' set in doc-common
905 .
906 .de Nm
907 .  if !\n[doc-arg-limit] \{\
908 .    ds doc-macro-name Nm
909 .    ie \n[.$] \
910 .      doc-parse-args \$@
911 .    el \{\
912 .      ie "\*[doc-command-name]"" \
913 .        tm Usage: .Nm name ... (#\n[.c])
914 .      el \
915 .        doc-parse-args \*[doc-command-name]
916 .  \}\}
917 .
918 .  if !\n[doc-arg-limit] \
919 .    return
920 .
921 .  nr doc-arg-ptr +1
922 .  doc-print-prefixes
923 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
924 .    \" last argument
925 .    ie "\*[doc-command-name]"" \{\
926 .      tm Usage: .Nm name ... (#\n[.c])
927 .      doc-reset-args
928 .    \}
929 .    el \{\
930 .      nop \*[doc-Nm-font]\*[doc-command-name]\f[]\s[0]\c
931 .      doc-print-and-reset
932 .  \}\}
933 .  el \{\
934 .    nr doc-curr-font \n[.f]
935 .    nr doc-curr-size \n[.ps]
936 .
937 .    ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
938 .      ie "\*[doc-command-name]"" \
939 .        tm Usage: .Nm name ... (#\n[.c])
940 .      el \{\
941 .        \" replace previous argument (Nm) with default value
942 .        nr doc-arg-ptr -1
943 .        ds doc-arg\n[doc-arg-ptr] "\*[doc-Nm-font]\*[doc-command-name]\f[]\s[0]
944 .        nr doc-type\n[doc-arg-ptr] 2
945 .        ds doc-space\n[doc-arg-ptr] "\*[doc-space]
946 .
947 .        \" recompute space vector for remaining arguments
948 .        nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
949 .        nr doc-arg-limit \n[doc-arg-ptr]
950 .        doc-parse-space-vector
951 .    \}\}
952 .    el \{\
953 .      \" handle `.Nm ...' in SYNOPSIS
954 .      if \n[doc-in-synopsis-section] \{\
955 .        if "\*[doc-macro-name]"Nm" \{\
956 .          br
957 .          if !\n[doc-indent-synopsis] \{\
958 .            doc-get-width "\*[doc-arg\n[doc-arg-ptr]]"
959 .            nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
960 .          \}
961 .          if !\n[doc-indent-synopsis-active] \{\
962 .            in +\n[doc-indent-synopsis]u
963 .            nr doc-indent-synopsis-active 1
964 .          \}
965 .          ti -\n[doc-indent-synopsis]u
966 .      \}\}
967 .      if "\*[doc-command-name]"" \
968 .        ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
969 .
970 .      nop \*[doc-Nm-font]\c
971 .    \}
972 .    doc-print-recursive
973 .  \}
974 ..
975 .
976 .
977 .\" NS Pa user macro
978 .\" NS   pathname: `.Pa [arg ...]'
979 .\" NS
980 .\" NS modifies:
981 .\" NS   doc-arg-ptr
982 .\" NS   doc-curr-font
983 .\" NS   doc-curr-size
984 .\" NS   doc-macro-name
985 .\" NS
986 .\" NS width register `Pa' set in doc-common
987 .
988 .de Pa
989 .  if !\n[doc-arg-limit] \{\
990 .    ds doc-macro-name Pa
991 .    doc-parse-args \$@
992 .
993 .    if !\n[.$] \{\
994 .      \" default value
995 .      nop \*[doc-Pa-font]~\f[]\s[0]
996 .  \}\}
997 .
998 .  if !\n[doc-arg-limit] \
999 .    return
1000 .
1001 .  nr doc-arg-ptr +1
1002 .  doc-print-prefixes
1003 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1004 .    nr doc-curr-font \n[.f]
1005 .    nr doc-curr-size \n[.ps]
1006 .    nop \*[doc-Pa-font]\c
1007 .    if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
1008 .      \" replace previous argument (Pa) with default value
1009 .      nr doc-arg-ptr -1
1010 .      ds doc-arg\n[doc-arg-ptr] ~
1011 .      nr doc-type\n[doc-arg-ptr] 2
1012 .      ds doc-space\n[doc-arg-ptr] "\*[doc-space]
1013 .
1014 .      \" recompute space vector for remaining arguments
1015 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
1016 .      nr doc-arg-limit \n[doc-arg-ptr]
1017 .      doc-parse-space-vector
1018 .    \}
1019 .    doc-print-recursive
1020 .  \}
1021 .  el \{\
1022 .    nop \*[doc-Pa-font]~\f[]\s[0]\c
1023 .    doc-print-and-reset
1024 .  \}
1025 ..
1026 .
1027 .
1028 .\" NS Sy user macro
1029 .\" NS   symbolics
1030 .\" NS
1031 .\" NS width register `Sy' set in doc-common
1032 .
1033 .als Sy doc-generic-macro
1034 .ds doc-Sy-usage symbolic_text
1035 .
1036 .
1037 .\" NS Me user macro
1038 .\" NS   menu entries
1039 .\" NS
1040 .\" NS width register `Me' set in doc-common
1041 .
1042 .als Me doc-generic-macro
1043 .ds doc-Me-usage menu_entry
1044 .
1045 .
1046 .\" NS Tn user macro
1047 .\" NS   trade name
1048 .\" NS
1049 .\" NS modifies:
1050 .\" NS   doc-arg-ptr
1051 .\" NS   doc-curr-font
1052 .\" NS   doc-curr-size
1053 .\" NS   doc-macro-name
1054 .\" NS
1055 .\" NS width register `Tn' set in doc-common
1056 .
1057 .de Tn
1058 .  if !\n[doc-arg-limit] \{\
1059 .    ie \n[.$] \{\
1060 .      ds doc-macro-name Tn
1061 .      doc-parse-args \$@
1062 .    \}
1063 .    el \
1064 .      tm Usage: .Tn trade_name ... (#\n[.c])
1065 .  \}
1066 .
1067 .  if !\n[doc-arg-limit] \
1068 .    return
1069 .
1070 .  nr doc-arg-ptr +1
1071 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1072 .    nr doc-curr-font \n[.f]
1073 .    nr doc-curr-size \n[.ps]
1074 .    nop \)\*[doc-Tn-font-size]\c
1075 .    ie !\n[doc-is-reference] \{\
1076 .      nop \)\*[doc-Tn-font-shape]\c
1077 .      doc-print-recursive
1078 .    \}
1079 .    el \
1080 .      doc-do-references
1081 .  \}
1082 .  el \{\
1083 .    tm Usage: .Tn trade_name ... (#\n[.c])
1084 .    doc-reset-args
1085 .  \}
1086 ..
1087 .
1088 .
1089 .\" NS Va user macro
1090 .\" NS   variable name
1091 .\" NS
1092 .\" NS width register `Va' set in doc-common
1093 .
1094 .als Va doc-generic-macro
1095 .ds doc-Va-usage variable_name
1096 .
1097 .
1098 .\" NS No user macro
1099 .\" NS   normal text macro (default text style if mess up)
1100 .\" NS
1101 .\" NS width register `No' set in doc-common
1102 .
1103 .als No doc-generic-macro
1104 .ds doc-No-usage normal_text
1105 .
1106 .
1107 .\" NS doc-quote-left global string
1108 .\" NS   left quotation character for `doc-enclose-string' and
1109 .\" NS   `doc-enclose-open'
1110 .
1111 .ds doc-quote-left
1112 .
1113 .
1114 .\" NS doc-quote-right global string
1115 .\" NS   right quotation character for `doc-enclose-string' and
1116 .\" NS   `doc-enclose-close'
1117 .
1118 .ds doc-quote-right
1119 .
1120 .
1121 .\" NS Op user macro
1122 .\" NS   option expression (i.e., enclose string in square brackets)
1123 .\" NS
1124 .\" NS modifies:
1125 .\" NS   doc-macro-name
1126 .\" NS   doc-quote-left
1127 .\" NS   doc-quote-right
1128 .\" NS
1129 .\" NS width register `Op' set in doc-common
1130 .
1131 .de Op
1132 .  if !\n[doc-arg-limit] \
1133 .    ds doc-macro-name Op
1134 .
1135 .  ds doc-quote-left "\*[doc-left-bracket]
1136 .  ds doc-quote-right "\*[doc-right-bracket]
1137 .
1138 .  doc-enclose-string \$@
1139 ..
1140 .
1141 .
1142 .\" NS Aq user macro
1143 .\" NS   enclose string in angle brackets
1144 .\" NS
1145 .\" NS modifies:
1146 .\" NS   doc-macro-name
1147 .\" NS   doc-quote-left
1148 .\" NS   doc-quote-right
1149 .\" NS
1150 .\" NS width register `Aq' set in doc-common
1151 .
1152 .de Aq
1153 .  if !\n[doc-arg-limit] \
1154 .    ds doc-macro-name Aq
1155 .
1156 .  ds doc-quote-left \[la]
1157 .  ds doc-quote-right \[ra]
1158 .
1159 .  doc-enclose-string \$@
1160 ..
1161 .
1162 .
1163 .\" NS Bq user macro
1164 .\" NS   enclose string in square brackets
1165 .\" NS
1166 .\" NS modifies:
1167 .\" NS   doc-macro-name
1168 .\" NS   doc-quote-left
1169 .\" NS   doc-quote-right
1170 .\" NS
1171 .\" NS width register `Bq' set in doc-common
1172 .
1173 .de Bq
1174 .  if !\n[doc-arg-limit] \
1175 .    ds doc-macro-name Bq
1176 .
1177 .  ds doc-quote-left "\*[doc-left-bracket]
1178 .  ds doc-quote-right "\*[doc-right-bracket]
1179 .
1180 .  doc-enclose-string \$@
1181 ..
1182 .
1183 .
1184 .\" NS Brq user macro
1185 .\" NS   enclose string in braces
1186 .\" NS
1187 .\" NS modifies:
1188 .\" NS   doc-macro-name
1189 .\" NS   doc-quote-left
1190 .\" NS   doc-quote-right
1191 .\" NS
1192 .\" NS width register `Brq' set in doc-common
1193 .
1194 .de Brq
1195 .  if !\n[doc-arg-limit] \
1196 .    ds doc-macro-name Brq
1197 .
1198 .  ds doc-quote-left {
1199 .  ds doc-quote-right }
1200 .
1201 .  doc-enclose-string \$@
1202 ..
1203 .
1204 .
1205 .\" NS Dq user macro
1206 .\" NS   enclose string in double quotes
1207 .\" NS
1208 .\" NS modifies:
1209 .\" NS   doc-macro-name
1210 .\" NS   doc-quote-left
1211 .\" NS   doc-quote-right
1212 .\" NS
1213 .\" NS width register `Dq' set in doc-common
1214 .
1215 .de Dq
1216 .  if !\n[doc-arg-limit] \
1217 .    ds doc-macro-name Dq
1218 .
1219 .  ds doc-quote-left "\*[Lq]
1220 .  ds doc-quote-right "\*[Rq]
1221 .
1222 .  doc-enclose-string \$@
1223 ..
1224 .
1225 .
1226 .\" NS Eq user macro
1227 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1228 .\" NS
1229 .\" NS modifies:
1230 .\" NS   doc-macro-name
1231 .\" NS   doc-quote-left
1232 .\" NS   doc-quote-right
1233 .\" NS
1234 .\" NS width register `Eq' set in doc-common
1235 .
1236 .de Eq
1237 .  if !\n[doc-arg-limit] \
1238 .    ds doc-macro-name Eq
1239 .
1240 .  ds doc-quote-left "\$1
1241 .  ds doc-quote-right "\$2
1242 .
1243 .  shift 2
1244 .  doc-enclose-string \$@
1245 ..
1246 .
1247 .
1248 .\" NS Pq user macro
1249 .\" NS   enclose string in parentheses
1250 .\" NS
1251 .\" NS modifies:
1252 .\" NS   doc-macro-name
1253 .\" NS   doc-quote-left
1254 .\" NS   doc-quote-right
1255 .\" NS
1256 .\" NS width register `Pq' set in doc-common
1257 .
1258 .de Pq
1259 .  if !\n[doc-arg-limit] \
1260 .    ds doc-macro-name Pq
1261 .
1262 .  ds doc-quote-left "\*[doc-left-parenthesis]
1263 .  ds doc-quote-right "\*[doc-right-parenthesis]
1264 .
1265 .  doc-enclose-string \$@
1266 ..
1267 .
1268 .
1269 .\" NS Ql user macro
1270 .\" NS   quoted literal
1271 .\"
1272 .\"   is in file doc-[dit|n]roff
1273 .
1274 .
1275 .\" NS Qq user macro
1276 .\" NS   enclose string in straight double quotes
1277 .\" NS
1278 .\" NS modifies:
1279 .\" NS   doc-macro-name
1280 .\" NS   doc-quote-left
1281 .\" NS   doc-quote-right
1282 .\" NS
1283 .\" NS width register `Qq' set in doc-common
1284 .
1285 .de Qq
1286 .  if !\n[doc-arg-limit] \
1287 .    ds doc-macro-name Qq
1288 .
1289 .  ds doc-quote-left "\*[q]
1290 .  ds doc-quote-right "\*[q]
1291 .
1292 .  doc-enclose-string \$@
1293 ..
1294 .
1295 .
1296 .\" NS Sq user macro
1297 .\" NS   enclose string in single quotes
1298 .\" NS
1299 .\" NS modifies:
1300 .\" NS   doc-macro-name
1301 .\" NS   doc-quote-left
1302 .\" NS   doc-quote-right
1303 .\" NS
1304 .\" NS width register `Sq' set in doc-common
1305 .
1306 .de Sq
1307 .  if !\n[doc-arg-limit] \
1308 .    ds doc-macro-name Sq
1309 .
1310 .  ds doc-quote-left "\*[doc-left-singlequote]
1311 .  ds doc-quote-right "\*[doc-right-singlequote]
1312 .
1313 .  doc-enclose-string \$@
1314 ..
1315 .
1316 .
1317 .\" NS Es user macro
1318 .\" NS   set up arguments (i.e., the left and right quotation character as
1319 .\" NS   first and second argument) for .En call
1320 .\" NS
1321 .\" NS modifies:
1322 .\" NS   doc-arg-ptr
1323 .\" NS   doc-macro-name
1324 .\" NS   doc-quote-left
1325 .\" NS   doc-quote-right
1326 .
1327 .de Es
1328 .  if !\n[doc-arg-limit] \{\
1329 .    ie (\n[.$] > 2) \{\
1330 .      ds doc-macro-name Es
1331 .      doc-parse-args \$@
1332 .    \}
1333 .    el \{\
1334 .      ds doc-quote-left "\$1
1335 .      ds doc-quote-right "\$2
1336 .  \}\}
1337 .
1338 .  if !\n[doc-arg-limit] \
1339 .    return
1340 .
1341 .  nr doc-arg-ptr +1
1342 .  ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
1343 .  nr doc-arg-ptr +1
1344 .  ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
1345 .  nr doc-arg-ptr +1
1346 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1347 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
1348 .  el \
1349 .    doc-print-and-reset
1350 ..
1351 .
1352 .
1353 .\" NS doc-have-slot global register (bool)
1354 .\" NS   set if `doc-enclose-string' has created a slot for closing
1355 .\" NS   delimiter
1356 .
1357 .nr doc-have-slot 0
1358 .
1359 .
1360 .\" NS doc-enclose-string macro
1361 .\" NS   enclose string with given args (e.g. [ and ])
1362 .\" NS
1363 .\" NS modifies:
1364 .\" NS   doc-arg-ptr
1365 .\" NS   doc-argXXX
1366 .\" NS   doc-have-slot
1367 .\" NS
1368 .\" NS local variables:
1369 .\" NS   doc-reg-des
1370 .\" NS   doc-reg-des1
1371 .\" NS   doc-reg-des2
1372 .\" NS
1373 .\" NS requires:
1374 .\" NS   doc-quote-left
1375 .\" NS   doc-quote-right
1376 .
1377 .de doc-enclose-string
1378 .  if \n[doc-in-synopsis-section] \
1379 .    doc-set-hard-space
1380 .
1381 .  if !\n[doc-arg-limit] \{\
1382 .    ie \n[.$] \
1383 .      doc-parse-args \$@
1384 .    el \{\
1385 .      nop \)\*[doc-quote-left]\*[doc-quote-right]
1386 .  \}\}
1387 .
1388 .  if !\n[doc-arg-limit] \
1389 .    return
1390 .
1391 .  nr doc-curr-font \n[.f]
1392 .  nr doc-curr-size \n[.ps]
1393 .
1394 .  nr doc-arg-ptr +1
1395 .  doc-print-prefixes
1396 .  \" the final `\)' prevents hyphenation in case the next character is `\%'
1397 .  nop \)\*[doc-quote-left]\)\c
1398 .  ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1399 .    \" last argument
1400 .    nop \)\*[doc-quote-right]\)\c
1401 .    doc-print-and-reset
1402 .  \}
1403 .  el \{\
1404 .    \" test whether last arguments are of type closing punctuation
1405 .    \" resp. suffix
1406 .    ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
1407 .      nr doc-reg-des (\n[doc-arg-limit] - 1)
1408 .      while (\n[doc-type\n[doc-reg-des]] == 3) \
1409 .        nr doc-reg-des -1
1410 .
1411 .      \" prepend closing delimiter
1412 .      nr doc-reg-des +1
1413 .      ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1414 .    \}
1415 .    el \{\
1416 .      \" test whether last arguments are macros which continue the line
1417 .      \" logically
1418 .      nr doc-reg-des \n[doc-arg-limit]
1419 .      while (\n[doc-reg-des] >= \n[doc-arg-ptr]) \{\
1420 .        if !\A\a\*[doc-arg\n[doc-reg-des]]\a \
1421 .          break
1422 .        if !d doc-after-\*[doc-arg\n[doc-reg-des]] \
1423 .          break
1424 .        nr doc-reg-des -1
1425 .      \}
1426 .
1427 .      \" if there are no trailing macros to be skipped, append argument
1428 .      ie (\n[doc-reg-des] == \n[doc-arg-limit]) \
1429 .        doc-append-arg "\)\*[doc-quote-right]\)" 3
1430 .      el \{\
1431 .        \" if a previous call to `doc-enclose-string' has already created
1432 .        \" a slot, prepend argument
1433 .        ie \n[doc-have-slot] \
1434 .          ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
1435 .        el \{\
1436 .          \" we have to shift all arguments to the right
1437 .          nr doc-reg-des +1
1438 .          nr doc-reg-des1 \n[doc-arg-limit]
1439 .          nr doc-reg-des2 (\n[doc-arg-limit] + 1)
1440 .          while (\n[doc-reg-des1] >= \n[doc-reg-des]) \{\
1441 .            rn doc-arg\n[doc-reg-des1] doc-arg\n[doc-reg-des2]
1442 .            rnn doc-type\n[doc-reg-des1] doc-type\n[doc-reg-des2]
1443 .            rn doc-space\n[doc-reg-des1] doc-space\n[doc-reg-des2]
1444 .            nr doc-reg-des1 -1
1445 .            nr doc-reg-des2 -1
1446 .          \}
1447 .          nr doc-arg-limit +1
1448 .
1449 .          \" finally, insert closing delimiter into the freed slot and
1450 .          \" recompute spacing vector
1451 .          ds doc-arg\n[doc-reg-des] "\)\*[doc-quote-right]\)
1452 .          nr doc-type\n[doc-reg-des] 3
1453 .          nr doc-num-args (\n[doc-arg-limit] - \n[doc-reg-des] + 1)
1454 .          nr doc-arg-limit (\n[doc-reg-des] - 1)
1455 .          doc-parse-space-vector
1456 .          nr doc-have-slot 1
1457 .    \}\}\}
1458 .
1459 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
1460 .  \}
1461 .
1462 .  if \n[doc-in-synopsis-section] \
1463 .    doc-set-soft-space
1464 ..
1465 .
1466 .
1467 .\" NS En user macro
1468 .\" NS   enclose arguments with quotation characters set up with `.Es'
1469 .
1470 .als En doc-enclose-string
1471 .
1472 .
1473 .\" NS Ao user macro
1474 .\" NS   angle open
1475 .\" NS
1476 .\" NS modifies:
1477 .\" NS   doc-macro-name
1478 .\" NS   doc-quote-left
1479 .\" NS
1480 .\" NS width register `Ao' set in doc-common
1481 .
1482 .de Ao
1483 .  if !\n[doc-arg-limit] \
1484 .    ds doc-macro-name Ao
1485 .
1486 .  ds doc-quote-left \[la]
1487 .
1488 .  doc-enclose-open \$@
1489 ..
1490 .
1491 .
1492 .\" NS Ac user macro
1493 .\" NS   angle close
1494 .\" NS
1495 .\" NS modifies:
1496 .\" NS   doc-macro-name
1497 .\" NS   doc-quote-right
1498 .\" NS
1499 .\" NS width register `Ac' set in doc-common
1500 .
1501 .de Ac
1502 .  if !\n[doc-arg-limit] \
1503 .    ds doc-macro-name Ac
1504 .
1505 .  ds doc-quote-right \[ra]
1506 .
1507 .  doc-enclose-close \$@
1508 ..
1509 .
1510 .
1511 .\" NS Bo user macro
1512 .\" NS   bracket open
1513 .\" NS
1514 .\" NS modifies:
1515 .\" NS   doc-macro-name
1516 .\" NS   doc-quote-left
1517 .\" NS
1518 .\" NS width register `Bo' set in doc-common
1519 .
1520 .de Bo
1521 .  if !\n[doc-arg-limit] \
1522 .    ds doc-macro-name Bo
1523 .
1524 .  ds doc-quote-left "\*[doc-left-bracket]
1525 .
1526 .  doc-enclose-open \$@
1527 ..
1528 .
1529 .
1530 .\" NS Bc user macro
1531 .\" NS   bracket close
1532 .\" NS
1533 .\" NS modifies:
1534 .\" NS   doc-macro-name
1535 .\" NS   doc-quote-right
1536 .\" NS
1537 .\" NS width register `Bc' set in doc-common
1538 .
1539 .de Bc
1540 .  if !\n[doc-arg-limit] \
1541 .    ds doc-macro-name Bc
1542 .
1543 .  ds doc-quote-right "\*[doc-right-bracket]
1544 .
1545 .  doc-enclose-close \$@
1546 ..
1547 .
1548 .
1549 .\" NS Bro user macro
1550 .\" NS   brace open
1551 .\" NS
1552 .\" NS modifies:
1553 .\" NS   doc-macro-name
1554 .\" NS   doc-quote-left
1555 .\" NS
1556 .\" NS width register `Bro' set in doc-common
1557 .
1558 .de Bro
1559 .  if !\n[doc-arg-limit] \
1560 .    ds doc-macro-name Bo
1561 .
1562 .  ds doc-quote-left {
1563 .
1564 .  doc-enclose-open \$@
1565 ..
1566 .
1567 .
1568 .\" NS Brc user macro
1569 .\" NS   brace close
1570 .\" NS
1571 .\" NS modifies:
1572 .\" NS   doc-macro-name
1573 .\" NS   doc-quote-right
1574 .\" NS
1575 .\" NS width register `Brc' set in doc-common
1576 .
1577 .de Brc
1578 .  if !\n[doc-arg-limit] \
1579 .    ds doc-macro-name Bc
1580 .
1581 .  ds doc-quote-right }
1582 .
1583 .  doc-enclose-close \$@
1584 ..
1585 .
1586 .
1587 .\" NS Do user macro
1588 .\" NS   double quote open
1589 .\" NS
1590 .\" NS modifies:
1591 .\" NS   doc-macro-name
1592 .\" NS   doc-quote-left
1593 .\" NS
1594 .\" NS width register `Do' set in doc-common
1595 .
1596 .de Do
1597 .  if !\n[doc-arg-limit] \
1598 .    ds doc-macro-name Do
1599 .
1600 .  ds doc-quote-left "\*[Lq]
1601 .
1602 .  doc-enclose-open \$@
1603 ..
1604 .
1605 .
1606 .\" NS Dc user macro
1607 .\" NS   double quote close
1608 .\" NS
1609 .\" NS modifies:
1610 .\" NS   doc-macro-name
1611 .\" NS   doc-quote-right
1612 .\" NS
1613 .\" NS width register `Dc' set in doc-common
1614 .
1615 .de Dc
1616 .  if !\n[doc-arg-limit] \
1617 .    ds doc-macro-name Dc
1618 .
1619 .  ds doc-quote-right "\*[Rq]
1620 .
1621 .  doc-enclose-close \$@
1622 ..
1623 .
1624 .
1625 .\" NS Eo user macro
1626 .\" NS   enclose open (using first argument as beginning of enclosure)
1627 .\" NS
1628 .\" NS modifies:
1629 .\" NS   doc-macro-name
1630 .\" NS   doc-quote-left
1631 .\" NS
1632 .\" NS width register `Eo' set in doc-common
1633 .
1634 .de Eo
1635 .  if !\n[doc-arg-limit] \
1636 .    ds doc-macro-name Eo
1637 .
1638 .  ds doc-quote-left "\$1
1639 .
1640 .  shift
1641 .  doc-enclose-open \$@
1642 ..
1643 .
1644 .
1645 .\" NS Ec user macro
1646 .\" NS   enclose close (using first argument as end of enclosure)
1647 .\" NS
1648 .\" NS modifies:
1649 .\" NS   doc-macro-name
1650 .\" NS   doc-quote-right
1651 .\" NS
1652 .\" NS width register `Ec' set in doc-common
1653 .
1654 .de Ec
1655 .  if !\n[doc-arg-limit] \
1656 .    ds doc-macro-name Ec
1657 .
1658 .  ds doc-quote-right "\$1
1659 .
1660 .  shift
1661 .  doc-enclose-close \$@
1662 ..
1663 .
1664 .
1665 .\" NS Oo user macro
1666 .\" NS   option open
1667 .\" NS
1668 .\" NS modifies:
1669 .\" NS   doc-macro-name
1670 .\" NS   doc-quote-left
1671 .\" NS
1672 .\" NS width register `Oo' set in doc-common
1673 .
1674 .de Oo
1675 .  if !\n[doc-arg-limit] \
1676 .    ds doc-macro-name Oo
1677 .
1678 .  ds doc-quote-left [
1679 .
1680 .  doc-enclose-open \$@
1681 ..
1682 .
1683 .
1684 .\" NS Oc user macro
1685 .\" NS   option close
1686 .\" NS
1687 .\" NS modifies:
1688 .\" NS   doc-macro-name
1689 .\" NS   doc-quote-right
1690 .\" NS
1691 .\" NS width register `Oc' set in doc-common
1692 .
1693 .de Oc
1694 .  if !\n[doc-arg-limit] \
1695 .    ds doc-macro-name Oc
1696 .
1697 .  ds doc-quote-right ]
1698 .
1699 .  doc-enclose-close \$@
1700 ..
1701 .
1702 .
1703 .\" NS Po user macro
1704 .\" NS   parenthesis open
1705 .\" NS
1706 .\" NS modifies:
1707 .\" NS   doc-macro-name
1708 .\" NS   doc-quote-left
1709 .\" NS
1710 .\" NS width register `Po' set in doc-common
1711 .
1712 .de Po
1713 .  if !\n[doc-arg-limit] \
1714 .    ds doc-macro-name Po
1715 .
1716 .  ds doc-quote-left "\*[doc-left-parenthesis]
1717 .
1718 .  doc-enclose-open \$@
1719 ..
1720 .
1721 .
1722 .\" NS Pc user macro
1723 .\" NS   parenthesis close
1724 .\" NS
1725 .\" NS modifies:
1726 .\" NS   doc-macro-name
1727 .\" NS   doc-quote-right
1728 .\" NS
1729 .\" NS width register `Pc' set in doc-common
1730 .
1731 .de Pc
1732 .  if !\n[doc-arg-limit] \
1733 .    ds doc-macro-name Pc
1734 .
1735 .  ds doc-quote-right "\*[doc-right-parenthesis]
1736 .
1737 .  doc-enclose-close \$@
1738 ..
1739 .
1740 .
1741 .\" NS Qo user macro
1742 .\" NS   straight double quote open
1743 .\" NS
1744 .\" NS modifies:
1745 .\" NS   doc-macro-name
1746 .\" NS   doc-quote-left
1747 .\" NS
1748 .\" NS width register `Qo' set in doc-common
1749 .
1750 .de Qo
1751 .  if !\n[doc-arg-limit] \
1752 .    ds doc-macro-name Qo
1753 .
1754 .  ds doc-quote-left "\*[q]
1755 .
1756 .  doc-enclose-open \$@
1757 ..
1758 .
1759 .
1760 .\" NS Qc user macro
1761 .\" NS   straight double quote close
1762 .\" NS
1763 .\" NS modifies:
1764 .\" NS   doc-macro-name
1765 .\" NS   doc-quote-right
1766 .\" NS
1767 .\" NS width register `Qc' set in doc-common
1768 .
1769 .de Qc
1770 .  if !\n[doc-arg-limit] \
1771 .    ds doc-macro-name Qc
1772 .
1773 .  ds doc-quote-right "\*[q]
1774 .
1775 .  doc-enclose-close \$@
1776 ..
1777 .
1778 .
1779 .\" NS So user macro
1780 .\" NS   single quote open
1781 .\" NS
1782 .\" NS modifies:
1783 .\" NS   doc-macro-name
1784 .\" NS   doc-quote-left
1785 .\" NS
1786 .\" NS width register `So' set in doc-common
1787 .
1788 .de So
1789 .  if !\n[doc-arg-limit] \
1790 .    ds doc-macro-name So
1791 .
1792 .  ds doc-quote-left "\*[doc-left-singlequote]
1793 .
1794 .  doc-enclose-open \$@
1795 ..
1796 .
1797 .
1798 .\" NS Sc user macro
1799 .\" NS   single quote close
1800 .\" NS
1801 .\" NS modifies:
1802 .\" NS   doc-macro-name
1803 .\" NS   doc-quote-right
1804 .\" NS
1805 .\" NS width register `Sc' set in doc-common
1806 .
1807 .de Sc
1808 .  if !\n[doc-arg-limit] \
1809 .    ds doc-macro-name Sc
1810 .
1811 .  ds doc-quote-right "\*[doc-right-singlequote]
1812 .
1813 .  doc-enclose-close \$@
1814 ..
1815 .
1816 .
1817 .\" NS Xo user macro
1818 .\" NS   extend open
1819 .\" NS
1820 .\" NS modifies:
1821 .\" NS   doc-macro-name
1822 .\" NS   doc-quote-left
1823 .\" NS
1824 .\" NS width register `Xo' set in doc-common
1825 .
1826 .de Xo
1827 .  if !\n[doc-arg-limit] \
1828 .    ds doc-macro-name Xo
1829 .
1830 .  ds doc-quote-left
1831 .
1832 .  doc-enclose-open \$@
1833 ..
1834 .
1835 .
1836 .\" NS Xc user macro
1837 .\" NS   extend close
1838 .\" NS
1839 .\" NS modifies:
1840 .\" NS   doc-macro-name
1841 .\" NS   doc-quote-right
1842 .\" NS
1843 .\" NS width register `Xc' set in doc-common
1844 .
1845 .de Xc
1846 .  if !\n[doc-arg-limit] \
1847 .    ds doc-macro-name Xc
1848 .
1849 .  ds doc-quote-right
1850 .
1851 .  doc-enclose-close \$@
1852 ..
1853 .
1854 .
1855 .\" NS doc-nesting-level global register
1856 .\" NS   used by `doc-enclose-open' and `doc-enclose-close'
1857 .
1858 .nr doc-nesting-level 0
1859 .
1860 .
1861 .\" NS doc-in-list global register (bool)
1862 .\" NS   whether we are in (logical) .It
1863 .
1864 .nr doc-in-list 0
1865 .
1866 .
1867 .\" NS doc-enclose-open macro
1868 .\" NS   enclose string open
1869 .\" NS
1870 .\" NS modifies:
1871 .\" NS   doc-arg-ptr
1872 .\" NS   doc-nesting-level
1873 .
1874 .de doc-enclose-open
1875 .  if !\n[doc-arg-limit] \
1876 .    doc-parse-args \$@
1877 .
1878 .  nr doc-arg-ptr +1
1879 .  doc-print-prefixes
1880 .  nr doc-arg-ptr -1
1881 .
1882 .  nop \)\*[doc-quote-left]\)\c
1883 .
1884 .  \" start enclosure box
1885 .  box doc-enclosure-box\n[doc-nesting-level]
1886 .  ev doc-enclosure-env\n[doc-nesting-level]
1887 .  evc 0
1888 .  in 0
1889 .  nf
1890 .  \" we insert something to make .chop always work
1891 .  nop \&\c
1892 .
1893 .  \" increase nesting level *after* parsing of arguments
1894 .  nr doc-nesting-level +1
1895 .
1896 .  if \n[doc-arg-limit] \{\
1897 .    nr doc-arg-ptr +1
1898 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1899 .      doc-print-recursive
1900 .    el \
1901 .      doc-reset-args
1902 .  \}
1903 ..
1904 .
1905 .
1906 .\" NS doc-enclose-close macro
1907 .\" NS   enclose string close
1908 .\" NS
1909 .\" NS modifies:
1910 .\" NS   doc-nesting-level
1911 .
1912 .de doc-enclose-close
1913 .  nr doc-nesting-level -1
1914 .
1915 .  \" finish enclosure box
1916 .  br
1917 .  ev
1918 .  box
1919 .  chop doc-enclosure-box\n[doc-nesting-level]
1920 .  unformat doc-enclosure-box\n[doc-nesting-level]
1921 .
1922 .  nh
1923 .  nop \*[doc-enclosure-box\n[doc-nesting-level]]\c
1924 .  nop \)\*[doc-quote-right]\)\c
1925 .
1926 .  if !\n[doc-arg-limit] \{\
1927 .    doc-parse-args \$@
1928 .
1929 .    if !\n[.$] \
1930 .      doc-print-and-reset
1931 .  \}
1932 .
1933 .  if \n[doc-arg-limit] \{\
1934 .    ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
1935 .      nop \)\*[doc-space\n[doc-arg-ptr]]\c
1936 .      nr doc-arg-ptr +1
1937 .      doc-print-recursive
1938 .    \}
1939 .    el \
1940 .      doc-print-and-reset
1941 .  \}
1942 .
1943 .  \" shall we finish .It macro?
1944 .  if !"\*[doc-macro-name]"It" \
1945 .    if \n[doc-in-list] \
1946 .      if !\n[doc-nesting-level] \
1947 .        doc-\*[doc-list-type-stack\n[doc-list-depth]]
1948 ..
1949 .
1950 .
1951 .\" NS Pf user macro
1952 .\" NS   prefix: `.Pf prefix arg ...'
1953 .\" NS
1954 .\" NS modifies:
1955 .\" NS   doc-arg-ptr
1956 .\" NS   doc-macro-name
1957 .\" NS   doc-quote-left
1958 .\" NS
1959 .\" NS width register `Pf' set in doc-common
1960 .
1961 .de Pf
1962 .  if !\n[doc-arg-limit] \
1963 .    ds doc-macro-name Pf
1964 .
1965 .  ie \n[doc-arg-limit] \{\
1966 .    ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
1967 .      nr doc-arg-ptr +1
1968 .      nop \)\*[doc-arg\n[doc-arg-ptr]]\c
1969 .    \}
1970 .    el \
1971 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
1972 .  \}
1973 .  el \{\
1974 .    nop \)\$1\)\c
1975 .    shift
1976 .    ie \n[.$] \
1977 .      doc-parse-args \$@
1978 .    el \{\
1979 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
1980 .      nop \)
1981 .  \}\}
1982 .
1983 .  if \n[doc-arg-limit] \{\
1984 .    nr doc-arg-ptr +1
1985 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
1986 .      doc-print-and-reset
1987 .    el \
1988 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
1989 .  \}
1990 ..
1991 .
1992 .
1993 .\" NS Ns user macro
1994 .\" NS   remove space (space removal done by `doc-parse-args')
1995 .\" NS
1996 .\" NS modifies:
1997 .\" NS   doc-argXXX
1998 .\" NS   doc-macro-name
1999 .\" NS
2000 .\" NS width register `Ns' set in doc-common
2001 .
2002 .de Ns
2003 .  if !\n[doc-arg-limit] \{\
2004 .    ie \n[.$] \{\
2005 .      ds doc-macro-name Ns
2006 .      doc-parse-args \$@
2007 .    \}
2008 .    el \
2009 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2010 .  \}
2011 .
2012 .  if \n[doc-arg-limit] \{\
2013 .    nr doc-arg-ptr +1
2014 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2015 .      doc-print-recursive
2016 .    el \
2017 .      doc-reset-args
2018 .  \}
2019 ..
2020 .
2021 .
2022 .\" NS Ap user macro
2023 .\" NS   append an apostrophe
2024 .\" NS
2025 .\" NS width register `Ap' set in doc-common
2026 .
2027 .de Ap
2028 .  ie !\n[doc-arg-limit] \
2029 .    tm Usage: `Ap' cannot be first macro on a line (no `.Ap') (#\n[.c])
2030 .  el \{\
2031 .    nop \)'\)\c
2032 .    nr doc-arg-ptr +1
2033 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
2034 .      doc-print-recursive
2035 .    el \
2036 .      doc-reset-args
2037 .  \}
2038 ..
2039 .
2040 .
2041 .\" NS doc-space global string
2042 .\" NS   current inter-argument space
2043 .
2044 .ds doc-space "\*[doc-soft-space]
2045 .
2046 .
2047 .\" NS doc-soft-space constant string
2048 .\" NS   soft (stretchable) space (defined in doc-common)
2049 .
2050 .
2051 .\" NS doc-hard-space constant string
2052 .\" NS   hard (unpaddable) space (defined in doc-common)
2053 .
2054 .
2055 .\" NS doc-set-hard-space macro
2056 .\" NS   set current space string to hard (unpaddable) space.
2057 .\" NS
2058 .\" NS modifies:
2059 .\" NS   doc-saved-space
2060 .\" NS   doc-space
2061 .
2062 .de doc-set-hard-space
2063 .  ie "\*[doc-space]"" \
2064 .    ds doc-saved-space "\*[doc-hard-space]
2065 .  el \
2066 .    ds doc-space "\*[doc-hard-space]
2067 ..
2068 .
2069 .
2070 .\" NS doc-set-soft-space macro
2071 .\" NS   set current space string to soft space
2072 .\" NS
2073 .\" NS modifies:
2074 .\" NS   doc-saved-space
2075 .\" NS   doc-space
2076 .
2077 .de doc-set-soft-space
2078 .  ie "\*[doc-space]"" \
2079 .    ds doc-saved-space "\*[doc-soft-space]
2080 .  el \
2081 .    ds doc-space "\*[doc-soft-space]
2082 ..
2083 .
2084 .
2085 .\" NS doc-space-mode global register (bool)
2086 .\" NS   default is one (space mode on)
2087 .
2088 .nr doc-space-mode 1
2089 .
2090 .
2091 .\" NS doc-saved-space global string
2092 .\" NS   saved value of `doc-space'
2093 .
2094 .ds doc-saved-space "\*[doc-space]
2095 .
2096 .
2097 .\" NS doc-have-space global register (bool)
2098 .\" NS   set if last command was horizontal space
2099 .
2100 .nr doc-have-space 0
2101 .
2102 .
2103 .\" NS Sm user macro
2104 .\" NS   space mode (`.Sm'/`.Sm on'/`.Sm off')
2105 .\" NS
2106 .\" NS   without argument, toggle space mode
2107 .\" NS
2108 .\" NS modifies:
2109 .\" NS   doc-arg-limit
2110 .\" NS   doc-arg-ptr
2111 .\" NS   doc-argXXX
2112 .\" NS   doc-macro-name
2113 .\" NS   doc-num-args
2114 .\" NS   doc-saved-space
2115 .\" NS   doc-space
2116 .\" NS   doc-space-mode
2117 .\" NS   doc-spaceXXX
2118 .\" NS
2119 .\" NS local variables:
2120 .\" NS   doc-reg-Sm
2121 .\" NS
2122 .\" NS width register `Sm' set in doc-common
2123 .
2124 .de Sm
2125 .  ie \n[doc-have-space] \
2126 .    nr doc-reg-Sm 0
2127 .  el \
2128 .    nr doc-reg-Sm 1
2129 .
2130 .  if !\n[doc-arg-limit] \{\
2131 .    ie \n[.$] \{\
2132 .      ds doc-macro-name Sm
2133 .      doc-parse-args \$@
2134 .    \}
2135 .    el \{\
2136 .      ie \n[doc-space-mode] \
2137 .        nr doc-space-mode 0
2138 .      el \
2139 .        nr doc-space-mode 1
2140 .  \}\}
2141 .
2142 .  if !\n[doc-arg-limit] \
2143 .    return
2144 .
2145 .  nr doc-arg-ptr +1
2146 .
2147 .  \" avoid a warning message in case `Sm' is the last parameter
2148 .  if !d doc-arg\n[doc-arg-ptr] \
2149 .    ds doc-arg\n[doc-arg-ptr]
2150 .
2151 .  ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2152 .    ds doc-space "\*[doc-saved-space]
2153 .    nr doc-space-mode 1
2154 .  \}
2155 .  el \{\
2156 .    ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2157 .      ds doc-saved-space "\*[doc-space]
2158 .      ds doc-space
2159 .      nr doc-space-mode 0
2160 .    \}
2161 .    el \{\
2162 .      \" no argument for Sm
2163 .      nr doc-arg-ptr -1
2164 .      ie \n[doc-space-mode] \
2165 .        nr doc-space-mode 0
2166 .      el \
2167 .        nr doc-space-mode 1
2168 .  \}\}
2169 .
2170 .  ie \n[doc-space-mode] \{\
2171 .    \" recompute space vector for remaining arguments
2172 .    nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2173 .    nr doc-arg-limit \n[doc-arg-ptr]
2174 .    if \n[doc-num-args] \
2175 .      doc-parse-space-vector
2176 .
2177 .    \" finish line only if it is interrupted and `doc-have-space'
2178 .    \" isn't set
2179 .    if \n[doc-reg-Sm] \
2180 .      if \n[.int] \
2181 .        nop \)
2182 .  \}
2183 .  el \{\
2184 .    \" reset remaining space vector elements
2185 .    nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2186 .    while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2187 .      ds doc-space\n[doc-reg-Sm]
2188 .      nr doc-reg-Sm +1
2189 .      \" the body of a `while' request must end with the fitting `\}'!
2190 .    \}
2191 .  \}
2192 .
2193 .  \" do we have parameters to print?
2194 .  ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2195 .    \" ignore `.Sm on' and `.Sm off' without additional parameters
2196 .    ie (\n[doc-arg-ptr] > 1) \
2197 .      doc-print-and-reset
2198 .    el \
2199 .      doc-reset-args
2200 .  \}
2201 .  el \{\
2202 .    \" skip `Sm' argument
2203 .    nr doc-arg-ptr +1
2204 .    doc-print-recursive
2205 .  \}
2206 ..
2207 .
2208 .
2209 .\" NS doc-arg-type immediate register
2210 .\" NS   argument type (macro=1, string=2, punctuation suffix=3,
2211 .\" NS   punctuation prefix=4)
2212 .
2213 .nr doc-arg-type 0
2214 .
2215 .
2216 .\" NS doc-get-arg-type macro
2217 .\" NS   get argument type
2218 .\" NS
2219 .\" NS   this macro expects the width of the argument in `doc-width'
2220 .\" NS
2221 .\" NS modifies:
2222 .\" NS   doc-arg-type
2223 .
2224 .de doc-get-arg-type
2225 .  nr doc-arg-type 2
2226 .
2227 .  if ((\n[doc-width] < 4) & \A\a\$1\a) \{\
2228 .    ie (\n[doc-width] == 1) \{\
2229 .      if r doc-punct\$1 \
2230 .        nr doc-arg-type \n[doc-punct\$1]
2231 .    \}
2232 .    el \
2233 .      if r \$1 \
2234 .        if d \$1 \
2235 .          nr doc-arg-type 1
2236 .  \}
2237 ..
2238 .
2239 .
2240 .\" NS doc-get-arg-type* macro
2241 .\" NS   similar to as `doc-get-arg-type' but uses doc-argXXX strings
2242 .\" NS
2243 .\" NS   this macro sets the `doc-width' register using the `length' request
2244 .\" NS   to get the number of characters in a string literally
2245 .\" NS
2246 .\" NS modifies:
2247 .\" NS   doc-arg-type
2248 .\" NS   doc-width
2249 .
2250 .de doc-get-arg-type*
2251 .  nr doc-arg-type 2
2252 .  length doc-width "\*[doc-arg\$1]
2253 .
2254 .  if ((\n[doc-width] < 4) & \A\a\*[doc-arg\$1]\a) \{\
2255 .    ie (\n[doc-width] == 1) \{\
2256 .      if r doc-punct\*[doc-arg\$1] \
2257 .        nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
2258 .    \}
2259 .    el \
2260 .      if r \*[doc-arg\$1] \
2261 .        if d \*[doc-arg\$1] \
2262 .          nr doc-arg-type 1
2263 .  \}
2264 ..
2265 .
2266 .
2267 .\" NS doc-set-spacing-1 macro
2268 .\" NS   set spacing for macros
2269 .\" NS
2270 .\" NS modifies:
2271 .\" NS   doc-spaceXXX
2272 .\" NS
2273 .\" NS local variables:
2274 .\" NS   doc-reg-dssfm
2275 .\" NS   doc-reg-dssfm1
2276 .
2277 .de doc-set-spacing-1
2278 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2279 .
2280 .  \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2281 .  \" argument)
2282 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2283 .    if \n[doc-arg-limit] \{\
2284 .      nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2285 .      ds doc-space\n[doc-reg-dssfm]
2286 .    \}
2287 .    ds doc-space\n[doc-arg-limit] "\*[doc-space]
2288 .  \}
2289 .  el \{\
2290 .    \" macros like .Ap and .Ns have value 2 (remove space before and after
2291 .    \" argument)
2292 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2293 .      if \n[doc-arg-limit] \{\
2294 .        nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2295 .        ds doc-space\n[doc-reg-dssfm]
2296 .      \}
2297 .      ds doc-space\n[doc-arg-limit]
2298 .    \}
2299 .    el \
2300 .      ds doc-space\n[doc-arg-limit]
2301 .  \}
2302 ..
2303 .
2304 .
2305 .\" NS doc-set-spacing-2 macro
2306 .\" NS   set spacing for strings
2307 .\" NS
2308 .\" NS modifies:
2309 .\" NS   doc-spaceXXX
2310 .
2311 .de doc-set-spacing-2
2312 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2313 ..
2314 .
2315 .
2316 .\" NS doc-set-spacing-3 macro
2317 .\" NS   set spacing for punctuation suffixes
2318 .\" NS
2319 .\" NS modifies:
2320 .\" NS   doc-spaceXXX
2321 .\" NS
2322 .\" NS local variables:
2323 .\" NS   doc-reg-dssfps
2324 .
2325 .de doc-set-spacing-3
2326 .  if \n[doc-arg-limit] \{\
2327 .    nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2328 .    ds doc-space\n[doc-reg-dssfps]
2329 .  \}
2330 .
2331 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2332 ..
2333 .
2334 .
2335 .\" NS doc-set-spacing-4 macro
2336 .\" NS   set spacing for punctuation prefixes
2337 .\" NS
2338 .\" NS modifies:
2339 .\" NS   doc-spaceXXX
2340 .
2341 .de doc-set-spacing-4
2342 .  ds doc-space\n[doc-arg-limit]
2343 ..
2344 .
2345 .
2346 .\" type switches (on current argument doc-arg-ptr)
2347 .
2348 .
2349 .\" NS doc-do-1 macro
2350 .\" NS   call request if macro
2351 .
2352 .de doc-do-1
2353 .  \*[doc-arg\n[doc-arg-ptr]]
2354 ..
2355 .
2356 .
2357 .\" NS doc-do-2 macro
2358 .\" NS   call .doc-print-recursive if string
2359 .
2360 .als doc-do-2 doc-print-recursive
2361 .
2362 .
2363 .\" NS doc-do-3 macro
2364 .\" NS   call .doc-print-recursive if punctuation suffix
2365 .
2366 .als doc-do-3 doc-print-recursive
2367 .
2368 .
2369 .\" NS doc-do-4 macro
2370 .\" NS   call .doc-print-recursive if punctuation prefix
2371 .
2372 .als doc-do-4 doc-print-recursive
2373 .
2374 .
2375 .\" NS doc-fontmode-depth global register
2376 .\" NS   font mode level
2377 .
2378 .nr doc-fontmode-depth 0
2379 .
2380 .
2381 .\" NS doc-fontmode-font-stackXXX global register
2382 .\" NS   stack of saved current font values from `Bf' macro
2383 .\" NS
2384 .\" NS limit:
2385 .\" NS   doc-fontmode-depth
2386 .
2387 .nr doc-fontmode-font-stack0 0
2388 .
2389 .
2390 .\" NS doc-fontmode-size-stackXXX global register
2391 .\" NS   stack of saved current size values from `Bf' macro
2392 .\" NS
2393 .\" NS limit:
2394 .\" NS   doc-fontmode-depth
2395 .
2396 .nr doc-fontmode-size-stack0 0
2397 .
2398 .
2399 .\" NS Bf user macro
2400 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2401 .\" NS
2402 .\" NS modifies:
2403 .\" NS   doc-fontmode-depth
2404 .\" NS   doc-fontmode-font-stackXXX
2405 .\" NS   doc-fontmode-size-stackXXX
2406 .\" NS   doc-macro-name
2407 .\" NS
2408 .\" NS width register `Bf' set in doc-common
2409 .
2410 .de Bf
2411 .  ds doc-macro-name Bf
2412 .
2413 .  ie \n[.$] \{\
2414 .    nr doc-fontmode-depth +1
2415 .
2416 .    \" save current font and size
2417 .    nr doc-fontmode-font-stack\n[doc-fontmode-depth] \n[.f]
2418 .    nr doc-fontmode-size-stack\n[doc-fontmode-depth] \n[.ps]
2419 .
2420 .    ie        "\$1"Em" \
2421 .      nop \*[doc-Em-font]\c
2422 .    el \{ .ie "\$1"Li" \
2423 .      nop \*[doc-Li-font]\c
2424 .    el \{ .ie "\$1"Sy" \
2425 .      nop \*[doc-Sy-font]\c
2426 .    el \{ .ie "\$1"-emphasis" \
2427 .      nop \*[doc-Em-font]\c
2428 .    el \{ .ie "\$1"-literal" \
2429 .      nop \*[doc-Li-font]\c
2430 .    el \{ .ie "\$1"-symbolic" \
2431 .      nop \*[doc-Sy-font]\c
2432 .    el \{\
2433 .      tmc mdoc warning: Unknown keyword `\$1' in .Bf macro
2434 .      tm1 " (#\n[.c])
2435 .  \}\}\}\}\}\}\}
2436 .  el \
2437 .    tm Usage: .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2438 ..
2439 .
2440 .
2441 .\" NS Ef user macro
2442 .\" NS   end font mode
2443 .\" NS
2444 .\" NS modifies:
2445 .\" NS   doc-macro-name
2446 .\" NS
2447 .\" NS width register `Ef' set in doc-common
2448 .
2449 .de Ef
2450 .  ds doc-macro-name Ef
2451 .
2452 .  ie \n[doc-fontmode-depth] \{\
2453 .    \" restore saved font and size
2454 .    nop \)\f[\n[doc-fontmode-font-stack\n[doc-fontmode-depth]]]\c
2455 .    nop \)\s[\n[doc-fontmode-size-stack\n[doc-fontmode-depth]]u]\c
2456 .
2457 .    nr doc-fontmode-font-stack\n[doc-fontmode-depth] 0
2458 .    nr doc-fontmode-size-stack\n[doc-fontmode-depth] 0
2459 .    nr doc-fontmode-depth -1
2460 .  \}
2461 .  el \
2462 .    tm mdoc warning: Extraneous .Ef (#\n[.c])
2463 ..
2464 .
2465 .
2466 .\" NS doc-keep-type global register
2467 .\" NS   current keep type; 1 is `-words', 2 is `-lines', 3 is unknown
2468 .
2469 .nr doc-keep-type 0
2470 .
2471 .
2472 .\" NS Bk user macro
2473 .\" NS   begin keep
2474 .\" NS
2475 .\" NS modifies:
2476 .\" NS   doc-keep-type
2477 .\" NS   doc-macro-name
2478 .\" NS
2479 .\" NS width register `Bk' set in doc-common
2480 .
2481 .de Bk
2482 .  ds doc-macro-name Bk
2483 .
2484 .  if \n[doc-keep-type] \
2485 .    tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2486 .
2487 .  ie        "\$1"-lines" \{\
2488 .    nr doc-keep-type 2
2489 .    tm .Bk -lines: Not implemented yet. (#\n[.c])
2490 .  \}
2491 .  el \{ .ie "\$1"-words" \{\
2492 .    nr doc-keep-type 1
2493 .    doc-set-hard-space
2494 .  \}
2495 .  el \{ .ie "\$1"" \{\
2496 .    \" default
2497 .    nr doc-keep-type 1
2498 .    doc-set-hard-space
2499 .  \}
2500 .  el \{\
2501 .    tm mdoc warning: Unknown keyword `\$1' in .Bk macro (#\n[.c])
2502 .    nr doc-keep-type 3
2503 .  \}\}\}
2504 .
2505 \#.  nr doc-nesting-level +1
2506 ..
2507 .
2508 .
2509 .\" NS Ek user macro
2510 .\" NS   end keep
2511 .\" NS
2512 .\" NS modifies:
2513 .\" NS   doc-keep-type
2514 .\" NS   doc-macro-name
2515 .\" NS
2516 .\" NS width register `Ek' set in doc-common
2517 .
2518 .de Ek
2519 .  ds doc-macro-name Ek
2520 .
2521 \#.  nr doc-nesting-level -1
2522 .
2523 .  ie \n[.$] \
2524 .    tm Usage: .Ek (does not take arguments) (#\n[.c])
2525 .  el \{\
2526 .    if !\n[doc-keep-type] \
2527 .      tm mdoc warning: .Ek found without .Bk before (#\n[.c])
2528 .
2529 .    ie        (\n[doc-keep-type] == 1) \
2530 .      doc-set-soft-space
2531 .    el \{ .if (\n[doc-keep-type] == 2) \
2532 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2533 .  \}\}
2534 .
2535 .  nr doc-keep-type 0
2536 .
2537 \#.  if !"\*[doc-out-string]"" \
2538 \#.    doc-print-out-string
2539 ..
2540 .
2541 .
2542 .\" NS doc-display-depth global register
2543 .\" NS   display level
2544 .
2545 .nr doc-display-depth 0
2546 .
2547 .
2548 .\" NS doc-is-compact global register (bool)
2549 .\" NS   set if the `compact' keyword is given
2550 .
2551 .nr doc-is-compact 0
2552 .
2553 .
2554 .\" NS doc-display-type-stackXXX global string
2555 .\" NS   the display type stack
2556 .\" NS
2557 .\" NS limit:
2558 .\" NS   doc-display-depth
2559 .
2560 .ds doc-display-type-stack0
2561 .
2562 .
2563 .\" NS doc-display-indent-stackXXX global register
2564 .\" NS   stack of display indentation values
2565 .\" NS
2566 .\" NS limit:
2567 .\" NS   doc-display-depth
2568 .
2569 .nr doc-display-indent-stack0 0
2570 .
2571 .
2572 .\" NS doc-display-ad-stackXXX global register
2573 .\" NS   stack of saved adjustment modes
2574 .\" NS
2575 .\" NS limit:
2576 .\" NS   doc-display-depth
2577 .
2578 .nr doc-display-ad-stack0 0
2579 .
2580 .
2581 .\" NS doc-display-fi-stackXXX global register
2582 .\" NS   stack of saved fill modes
2583 .\" NS
2584 .\" NS limit:
2585 .\" NS   doc-display-depth
2586 .
2587 .nr doc-display-fi-stack0 0
2588 .
2589 .
2590 .\" NS doc-display-ft-stackXXX global register
2591 .\" NS   stack of saved fonts
2592 .\" NS
2593 .\" NS limit:
2594 .\" NS   doc-display-depth
2595 .
2596 .nr doc-display-ft-stack0 0
2597 .
2598 .
2599 .\" NS doc-display-ps-stackXXX global register
2600 .\" NS   stack of saved font sizes
2601 .\" NS
2602 .\" NS limit:
2603 .\" NS   doc-display-depth
2604 .
2605 .nr doc-display-ps-stack0 0
2606 .
2607 .
2608 .\" NS Bd user macro
2609 .\" NS   begin display
2610 .\" NS
2611 .\" NS width register `Bd' set in doc-common
2612 .\" NS
2613 .\" NS modifies:
2614 .\" NS   doc-curr-font
2615 .\" NS   doc-curr-size
2616 .\" NS   doc-display-depth
2617 .\" NS   doc-display-ad-stackXXX
2618 .\" NS   doc-display-fi-stackXXX
2619 .\" NS   doc-display-ft-stackXXX
2620 .\" NS   doc-display-ps-stackXXX
2621 .\" NS   doc-display-file
2622 .\" NS   doc-display-indent-stackXXX
2623 .\" NS   doc-display-type-stackXXX
2624 .\" NS   doc-is-compact
2625 .\" NS   doc-macro-name
2626 .\" NS
2627 .\" NS local variables:
2628 .\" NS   doc-reg-Bd
2629 .
2630 .de Bd
2631 .  ds doc-macro-name Bd
2632 .
2633 .  if !\n[.$] \{\
2634 .    tm1 "Usage: .Bd {-literal | -filled | -ragged | -centered | -unfilled}
2635 .    tm1 "           [-offset [string]] [-compact] [-file name] (#\n[.c])
2636 .    return
2637 .  \}
2638 .
2639 .  nr doc-is-compact 0
2640 .  ds doc-display-file
2641 .  nr doc-reg-Bd 1
2642 .  nr doc-display-depth +1
2643 .
2644 .  \" save current adjustment and fill modes
2645 .  nr doc-display-ad-stack\n[doc-display-depth] \n[.j]
2646 .  nr doc-display-fi-stack\n[doc-display-depth] \n[.u]
2647 .
2648 .  ie        "\$1"-literal" \{\
2649 .    ds doc-display-type-stack\n[doc-display-depth] literal
2650 .    nr doc-display-ft-stack\n[doc-display-depth] \n[.f]
2651 .    nr doc-display-ps-stack\n[doc-display-depth] \n[.ps]
2652 .
2653 .    ie t \{\
2654 .      nop \*[doc-Li-font]\c
2655 '      ta T 9n
2656 .    \}
2657 .    el \
2658 '      ta T 8n
2659 .    nf
2660 .  \}
2661 .  el \{ .ie "\$1"-filled" \{\
2662 .    ds doc-display-type-stack\n[doc-display-depth] filled
2663 .    ad b
2664 .    fi
2665 .  \}
2666 .  el \{ .ie "\$1"-ragged" \{\
2667 .    ds doc-display-type-stack\n[doc-display-depth] ragged
2668 .    na
2669 .    fi
2670 .  \}
2671 .  el \{ .ie "\$1"-centered" \{\
2672 .    ds doc-display-type-stack\n[doc-display-depth] centered
2673 .    ad c
2674 .    fi
2675 .  \}
2676 .  el \{ .ie "\$1"-unfilled" \{\
2677 .    ds doc-display-type-stack\n[doc-display-depth] unfilled
2678 .    nf
2679 .  \}
2680 .  el \{\
2681 .    tm1 "mdoc warning: Unknown keyword `\$1' (or missing display type)
2682 .    tm1 "              in .Bd macro (#\n[.c])
2683 .    nr doc-reg-Bd 0
2684 .  \}\}\}\}\}
2685 .
2686 .  \" have we seen an argument?
2687 .  if \n[doc-reg-Bd] \{\
2688 .    shift
2689 .    \" check other arguments
2690 .    if \n[.$] \
2691 .      doc-do-Bd-args \$@
2692 .  \}
2693 .
2694 .  \" avoid warning about non-existent register
2695 .  if !r doc-display-indent-stack\n[doc-display-depth] \
2696 .    nr doc-display-indent-stack\n[doc-display-depth] 0
2697 .
2698 .  if \n[doc-display-indent-stack\n[doc-display-depth]] \
2699 '    in +\n[doc-display-indent-stack\n[doc-display-depth]]u
2700 .
2701 .  if !\n[doc-is-compact] \{\
2702 .    ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2703 .      sp \n[doc-display-vertical]u
2704 .    el \
2705 '      sp \n[doc-display-vertical]u
2706 .  \}
2707 .
2708 .  if !\n[cR] \
2709 .    ne 2v
2710 .
2711 .  if !"\*[doc-display-file]"" \
2712 .    so \*[doc-display-file]
2713 .
2714 .  nr doc-is-compact 0
2715 .  ds doc-display-file
2716 ..
2717 .
2718 .
2719 .\" NS doc-do-Bd-args macro
2720 .\" NS   resolve remaining .Bd arguments
2721 .\" NS
2722 .\" NS modifies:
2723 .\" NS   doc-display-file
2724 .\" NS   doc-display-indent-stackXXX
2725 .\" NS   doc-is-compact
2726 .\" NS
2727 .\" NS local variables:
2728 .\" NS   doc-reg-ddBa
2729 .\" NS   doc-reg-ddBa1
2730 .\" NS   doc-reg-ddBa2
2731 .\" NS   doc-reg-ddBa3
2732 .\" NS   doc-reg-ddBa4
2733 .\" NS   doc-str-ddBa
2734 .
2735 .de doc-do-Bd-args
2736 .  nr doc-reg-ddBa 1
2737 .
2738 .  ie        "\$1"-offset" \{\
2739 .    nr doc-reg-ddBa 2
2740 .
2741 .    ie        "\$2"left" \
2742 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2743 .    el \{ .ie "\$2"right" \
2744 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2745 .    el \{ .ie "\$2"center" \
2746 .      nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2747 .    el \{ .ie "\$2"indent" \
2748 .      nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2749 .    el \{ .ie "\$2"indent-two" \
2750 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2751 .    el \
2752 .      nr doc-reg-ddBa 1
2753 .    \}\}\}\}
2754 .
2755 .    \" not a known keyword
2756 .    if (\n[doc-reg-ddBa] == 1) \{\
2757 .      nr doc-reg-ddBa 2
2758 .
2759 .      nr doc-reg-ddBa1 0
2760 .      if \B\a(\$2)\a \{\
2761 .        \" disable warnings related to scaling indicators (32)
2762 .        nr doc-reg-ddBa2 \n[.warn]
2763 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
2764 .
2765 .        \" values without a scaling indicator are taken as strings;
2766 .        \" we test whether the parameter string with and without the last
2767 .        \" character yields identical numerical results (ignoring the
2768 .        \" scaling indicator)
2769 .        ds doc-str-ddBa "\$2
2770 .        substring doc-str-ddBa 0 -2
2771 .        if \B\a(\*[doc-str-ddBa])\a \{\
2772 .          nr doc-reg-ddBa3 (;(\$2))
2773 .          nr doc-reg-ddBa4 (\*[doc-str-ddBa])
2774 .          if (\n[doc-reg-ddBa3] == \n[doc-reg-ddBa4]) \
2775 .            nr doc-reg-ddBa1 1
2776 .        \}
2777 .
2778 .        \" enable all warnings again
2779 .        warn \n[doc-reg-ddBa2]
2780 .      \}
2781 .
2782 .      ie \n[doc-reg-ddBa1] \
2783 .        nr doc-display-indent-stack\n[doc-display-depth] \$2
2784 .      el \{\
2785 .        doc-get-width "\$2"
2786 .        ie (\n[doc-width] <= 3) \{\
2787 .          \" if the offset parameter is a macro, use the macro's
2788 .          \" width as specified in doc-common
2789 .          doc-get-arg-type "\$2"
2790 .          ie (\n[doc-arg-type] == 1) \
2791 .            nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
2792 .          el \
2793 .            nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2794 .        \}
2795 .        el \
2796 .          nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2797 .    \}\}
2798 .  \}
2799 .  el \{ .ie "\$1"-compact" \
2800 .    nr doc-is-compact 1
2801 .  el \{ .ie "\$1"-file" \{\
2802 .    ie !"\$2"" \{\
2803 .      ds doc-display-file "\$2
2804 .      nr doc-reg-ddBa 2
2805 .    \}
2806 .    el \
2807 .      tm mdoc warning: .Bd `-file' keyword requires argument (#\n[.c])
2808 .  \}
2809 .  el \
2810 .      tm mdoc warning: Unknown keyword `\$1' in .Bd macro (#\n[.c])
2811 .  \}\}
2812 .
2813 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
2814 .    shift \n[doc-reg-ddBa]
2815 .    doc-do-Bd-args \$@
2816 .  \}
2817 ..
2818 .
2819 .
2820 .\" NS Ed user macro
2821 .\" NS   end display
2822 .\" NS
2823 .\" NS modifies:
2824 .\" NS   doc-display-depth
2825 .\" NS   doc-display-indent-stackXXX
2826 .\" NS   doc-display-type-stackXXX
2827 .\" NS   doc-macro-name
2828 .\" NS
2829 .\" NS width register `Ed' set in doc-common
2830 .
2831 .de Ed
2832 .  ds doc-macro-name Ed
2833 .
2834 .  br
2835 .
2836 .  if !\n[doc-display-depth] \{\
2837 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
2838 .    nr doc-display-depth 1
2839 .  \}
2840 .
2841 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2842 .    ft \n[doc-display-ft-stack\n[doc-display-depth]]
2843 .    ps \n[doc-display-ps-stack\n[doc-display-depth]]u
2844 .  \}
2845 .
2846 .  in -\n[doc-display-indent-stack\n[doc-display-depth]]u
2847 .
2848 .  \" restore saved adjustment and fill modes
2849 .  ie \n[doc-display-fi-stack\n[doc-display-depth]] \
2850 .    fi
2851 .  el \
2852 .    nf
2853 .  ad \n[doc-display-ad-stack\n[doc-display-depth]]
2854 .
2855 .  nr doc-display-indent-stack\n[doc-display-depth] 0
2856 .  ds doc-display-type-stack\n[doc-display-depth]
2857 .  nr doc-display-depth -1
2858 ..
2859 .
2860 .
2861 .\" NS doc-list-type-stackXXX global string
2862 .\" NS   stack of list types
2863 .\" NS
2864 .\" NS limit:
2865 .\" NS   doc-list-depth
2866 .
2867 .ds doc-list-type-stack1
2868 .
2869 .
2870 .\" NS doc-list-indent-stackXXX global register
2871 .\" NS   stack of list indentation values
2872 .\" NS
2873 .\" NS limit:
2874 .\" NS   doc-list-depth
2875 .
2876 .nr doc-list-indent-stack1 0
2877 .
2878 .
2879 .\" NS doc-list-have-indent-stackXXX global register (bool)
2880 .\" NS   an indentation value is active
2881 .\" NS
2882 .\" NS limit:
2883 .\" NS   doc-list-depth
2884 .
2885 .nr doc-list-have-indent-stack1 0
2886 .
2887 .
2888 .\" NS Bl user macro
2889 .\" NS   begin list
2890 .\" NS
2891 .\" NS width register `Bl' set in doc-common
2892 .\" NS
2893 .\" NS modifies:
2894 .\" NS   doc-arg-ptr
2895 .\" NS   doc-argXXX
2896 .\" NS   doc-list-depth
2897 .\" NS   doc-list-have-indent-stackXXX
2898 .\" NS   doc-list-indent-stackXXX
2899 .\" NS   doc-list-type-stackXXX
2900 .\" NS   doc-macro-name
2901 .\" NS   doc-num-args
2902 .\" NS   doc-num-columns
2903 .\" NS
2904 .\" NS local variables:
2905 .\" NS   doc-reg-Bl
2906 .
2907 .de Bl
2908 .  if !\n[.$] \{\
2909 .    doc-Bl-usage
2910 .    return
2911 .  \}
2912 .
2913 .  ds doc-macro-name Bl
2914 .  nr doc-list-depth +1
2915 .  nr doc-arg-ptr 1
2916 .
2917 .  ie        "\$1"-hang" \{\
2918 .    ds doc-list-type-stack\n[doc-list-depth] hang-list
2919 .    nr doc-list-indent-stack\n[doc-list-depth] 6n
2920 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2921 .  \}
2922 .  el \{ .ie "\$1"-tag" \{\
2923 .    ds doc-list-type-stack\n[doc-list-depth] tag-list
2924 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2925 .  \}
2926 .  el \{ .ie "\$1"-item" \{\
2927 .    ds doc-list-type-stack\n[doc-list-depth] item-list
2928 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2929 .  \}
2930 .  el \{ .ie "\$1"-enum" \{\
2931 .    ds doc-list-type-stack\n[doc-list-depth] enum-list
2932 .    nr doc-list-indent-stack\n[doc-list-depth] 3n
2933 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2934 .  \}
2935 .  el \{ .ie "\$1"-bullet" \{\
2936 .    ds doc-list-type-stack\n[doc-list-depth] bullet-list
2937 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2938 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2939 .  \}
2940 .  el \{ .ie "\$1"-dash" \{\
2941 .    ds doc-list-type-stack\n[doc-list-depth] dash-list
2942 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2943 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2944 .  \}
2945 .  el \{ .ie "\$1"-hyphen" \{\
2946 .    ds doc-list-type-stack\n[doc-list-depth] dash-list
2947 .    nr doc-list-indent-stack\n[doc-list-depth] 2n
2948 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2949 .  \}
2950 .  el \{ .ie "\$1"-inset" \{\
2951 .    ds doc-list-type-stack\n[doc-list-depth] inset-list
2952 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2953 .  \}
2954 .  el \{ .ie "\$1"-diag" \{\
2955 .    ds doc-list-type-stack\n[doc-list-depth] diag-list
2956 .  \}
2957 .  el \{ .ie "\$1"-ohang" \{\
2958 .    ds doc-list-type-stack\n[doc-list-depth] ohang-list
2959 .    nr doc-list-have-indent-stack\n[doc-list-depth] 1
2960 .  \}
2961 .  el \{ .ie "\$1"-column" \{\
2962 .    ds doc-list-type-stack\n[doc-list-depth] column-list
2963 .    linetabs 1
2964 .  \}
2965 .  el \{\
2966 .    tm1 "mdoc warning: Unknown list type `\$1' (or missing list type)
2967 .    tm1 "              in .Bl macro
2968 .    tm
2969 .    nr doc-arg-ptr 0
2970 .  \}\}\}\}\}\}\}\}\}\}\}
2971 .
2972 .  \" we have seen a list type
2973 .  if !\n[doc-arg-ptr] \{\
2974 .    doc-Bl-usage
2975 .    doc-reset-args
2976 .    nr doc-list-depth -1
2977 .    return
2978 .  \}
2979 .
2980 .  shift
2981 .
2982 .  \" fill argument vector
2983 .  nr doc-reg-Bl 1
2984 .  while (\n[doc-reg-Bl] <= \n[.$]) \{\
2985 .    ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
2986 .    \" dummy type and space so that doc-save-global-vars() doesn't warn
2987 .    nr doc-type\n[doc-reg-Bl] 0
2988 .    ds doc-space\n[doc-reg-Bl]
2989 .    nr doc-reg-Bl +1
2990 .  \}
2991 .
2992 .  doc-increment-list-stack
2993 .
2994 .  if \n[.$] \{\
2995 .    nr doc-arg-limit \n[.$]
2996 .    nr doc-arg-ptr 0
2997 .    doc-do-Bl-args
2998 .
2999 .    in +\n[doc-list-offset-stack\n[doc-list-depth]]u
3000 .
3001 .    \" initialize column list
3002 .    if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3003 .      doc-set-column-tab \n[doc-num-columns]
3004 '      in -\n[doc-column-indent-width]u
3005 .      if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3006 .        sp \n[doc-display-vertical]u
3007 .
3008 .      nf
3009 .      nr doc-num-columns 0
3010 .  \}\}
3011 .
3012 .  doc-reset-args
3013 ..
3014 .
3015 .
3016 .\" NS doc-Bl-usage macro
3017 .
3018 .de doc-Bl-usage
3019 .  tm1 "Usage: .Bl {-hang | -ohang | -tag | -diag | -inset}
3020 .  tm1 "             [-width <string>]
3021 .  tm1 "             [-offset <string>] [-compact]
3022 .  tm1 "       .Bl -column [-offset <string>] <string1> <string2> ...
3023 .  tm1 "       .Bl {-item | -enum [-nested] | -bullet | -hyphen | -dash}
3024 .  tm1 "             [-offset <string>] [-compact] (#\n[.c])
3025 ..
3026 .
3027 .
3028 .\" NS doc-do-Bl-args macro
3029 .\" NS   resolve remaining .Bl arguments
3030 .\" NS
3031 .\" NS modifies:
3032 .\" NS   doc-arg-ptr
3033 .\" NS   doc-argXXX
3034 .\" NS   doc-compact-list-stackXXX
3035 .\" NS   doc-list-indent-stackXXX
3036 .\" NS   doc-list-offset-stackXXX
3037 .\" NS   doc-num-columns
3038 .\" NS   doc-tag-prefix-stackXXX
3039 .\" NS   doc-tag-width-stackXXX
3040 .\" NS
3041 .\" NS local variables:
3042 .\" NS   doc-box-dBla
3043 .\" NS   doc-env-dBla
3044 .\" NS   doc-reg-dBla
3045 .\" NS   doc-reg-dBla1
3046 .\" NS   doc-reg-dBla2
3047 .\" NS   doc-reg-dBla3
3048 .\" NS   doc-reg-dBla4
3049 .\" NS   doc-str-dBla
3050 .\" NS   doc-str-dBla1
3051 .
3052 .de doc-do-Bl-args
3053 .  nr doc-arg-ptr +1
3054 .
3055 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
3056 .    return
3057 .
3058 .  \" avoid a warning message in case e.g. `-offset' has no parameter
3059 .  nr doc-reg-dBla (\n[doc-arg-ptr] + 1)
3060 .  if !d doc-arg\n[doc-reg-dBla] \
3061 .    ds doc-arg\n[doc-reg-dBla]
3062 .
3063 .  nr doc-reg-dBla 1
3064 .
3065 .  ie        "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3066 .    nr doc-compact-list-stack\n[doc-list-depth] 1
3067 .
3068 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-nested" \{\
3069 .    ie (\n[doc-list-depth] > 1) \{\
3070 .      nr doc-reg-dBla1 (\n[doc-list-depth] - 1)
3071 .      ds doc-tag-prefix-stack\n[doc-list-depth] "\*[doc-tag-prefix-stack\n[doc-reg-dBla1]]
3072 .      as doc-tag-prefix-stack\n[doc-list-depth] \n[doc-enum-list-count-stack\n[doc-reg-dBla1]].
3073 .      length doc-reg-dBla1 "\*[doc-tag-prefix-stack\n[doc-list-depth]]
3074 .      nr doc-list-indent-stack\n[doc-list-depth] +\n[doc-reg-dBla1]n
3075 .    \}
3076 .    el \
3077 .      tm mdoc warning: `-nested' allowed with nested .Bl macros only (#\n[.c])
3078 .  \}
3079 .
3080 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3081 .    nr doc-arg-ptr +1
3082 .    ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3083 .
3084 .    ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3085 .    substring doc-str-dBla 0 0
3086 .    ie \a.\a\*[doc-str-dBla]\a \{\
3087 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3088 .      substring doc-str-dBla 1
3089 .      doc-first-parameter \*[doc-str-dBla]
3090 .      doc-get-width "\*[doc-str-dfp]
3091 .      doc-get-arg-type "\*[doc-str-dfp]
3092 .      ie (\n[doc-arg-type] == 1) \
3093 .        nr doc-reg-dBla1 1
3094 .      el \
3095 .        nr doc-reg-dBla1 0
3096 .    \}
3097 .    el \
3098 .      nr doc-reg-dBla1 0
3099 .    ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3100 .
3101 .    ie \n[doc-reg-dBla1] \{\
3102 .      \" execute string in a box to get the width of the diversion
3103 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3104 .      doc-save-global-vars
3105 .      doc-reset-args
3106 .      box doc-box-dBla
3107 .      ev doc-env-dBla
3108 .      evc 0
3109 .      in 0
3110 .      nf
3111 .      nop \*[doc-str-dBla]
3112 .      br
3113 .      ev
3114 .      box
3115 .      doc-restore-global-vars
3116 .      doc-get-width \h'\n[dl]u'
3117 .      nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3118 .    \}
3119 .    el \{\
3120 .      \" test whether argument is a valid numeric expression
3121 .      nr doc-reg-dBla1 0
3122 .      if \B\a(\*[doc-str-dBla])\a \{\
3123 .        \" disable warnings related to scaling indicators (32)
3124 .        nr doc-reg-dBla2 \n[.warn]
3125 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3126 .
3127 .        \" values without a scaling indicator are taken as strings;
3128 .        \" we test whether the parameter string with and without the last
3129 .        \" character yields identical numerical results (ignoring the
3130 .        \" scaling indicator)
3131 .        ds doc-str-dBla1 "\*[doc-str-dBla]
3132 .        substring doc-str-dBla1 0 -2
3133 .        if \B\a(\*[doc-str-dBla1])\a \{\
3134 .          nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3135 .          nr doc-reg-dBla4 (\*[doc-str-dBla1])
3136 .          if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3137 .            nr doc-reg-dBla1 1
3138 .        \}
3139 .
3140 .        \" enable all warnings again
3141 .        warn \n[doc-reg-dBla2]
3142 .      \}
3143 .
3144 .      ie \n[doc-reg-dBla1] \
3145 .        nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
3146 .      el \{\
3147 .        doc-get-arg-width \n[doc-arg-ptr]
3148 .        ie (\n[doc-width] == 2) \{\
3149 .          \" if the width parameter is a macro, use the macro's
3150 .          \" width as specified in doc-common
3151 .          doc-get-arg-type \*[doc-str-dBla]
3152 .          ie (\n[doc-arg-type] == 1) \
3153 .            nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3154 .          el \
3155 .            nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3156 .        \}
3157 .        el \
3158 .          nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3159 .  \}\}\}
3160 .
3161 .  el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3162 .    nr doc-arg-ptr +1
3163 .
3164 .    ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3165 .      nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3166 .    el \{\
3167 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3168 .      nr doc-reg-dBla1 0
3169 .      if \B\a(\*[doc-str-dBla])\a \{\
3170 .        nr doc-reg-dBla2 \n[.warn]
3171 .        warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
3172 .
3173 .        ds doc-str-dBla1 "\*[doc-str-dBla]
3174 .        substring doc-str-dBla1 0 -2
3175 .        if \B\a(\*[doc-str-dBla1])\a \{\
3176 .          nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
3177 .          nr doc-reg-dBla4 (\*[doc-str-dBla1])
3178 .          if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
3179 .            nr doc-reg-dBla1 1
3180 .        \}
3181 .
3182 .        warn \n[doc-reg-dBla2]
3183 .      \}
3184 .
3185 .      ie \n[doc-reg-dBla1] \
3186 .        nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3187 .      el \{\
3188 .        doc-get-arg-width \n[doc-arg-ptr]
3189 .        ie (\n[doc-width] <= 3) \{\
3190 .          \" if the offset parameter is a macro, use the macro's
3191 .          \" width as specified in doc-common
3192 .          doc-get-arg-type \*[doc-str-dBla]
3193 .          ie (\n[doc-arg-type] == 1) \
3194 .            nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3195 .          el \
3196 .            nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3197 .        \}
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-reg-dBla 0
3203 .  \}\}\}
3204 .
3205 .  \" not a known keyword, so it specifies the width of the next column
3206 .  \" (if it is a column list)
3207 .  if !\n[doc-reg-dBla] \{\
3208 .    ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3209 .      nr doc-num-columns +1
3210 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3211 .      substring doc-str-dBla 0 0
3212 .      ie \a.\a\*[doc-str-dBla]\a \{\
3213 .        ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3214 .        substring doc-str-dBla 1
3215 .        doc-first-parameter \*[doc-str-dBla]
3216 .        doc-get-width "\*[doc-str-dfp]
3217 .        doc-get-arg-type "\*[doc-str-dfp]
3218 .        ie (\n[doc-arg-type] == 1) \
3219 .          nr doc-reg-dBla1 1
3220 .        el \
3221 .          nr doc-reg-dBla1 0
3222 .      \}
3223 .      el \
3224 .        nr doc-reg-dBla1 0
3225 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3226 .
3227 .      ie \n[doc-reg-dBla1] \{\
3228 .        \" execute string in a box to get the width of the diversion
3229 .        ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3230 .        doc-save-global-vars
3231 .        doc-reset-args
3232 .        box doc-box-dBla
3233 .        ev doc-env-dBla
3234 .        evc 0
3235 .        in 0
3236 .        nf
3237 .        nop \*[doc-str-dBla]
3238 .        br
3239 .        ev
3240 .        box
3241 .        doc-restore-global-vars
3242 .        ds doc-arg\n[doc-num-columns] "\h'\n[dl]u'
3243 .      \}
3244 .      el \
3245 .        ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3246 .    \}
3247 .    el \{\
3248 .      tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3249 .      tm1 " in .Bl macro (#\n[.c])
3250 .  \}\}
3251 .
3252 .  if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3253 .    doc-do-Bl-args
3254 ..
3255 .
3256 .
3257 .\" NS doc-save-global-vars macro
3258 .\" NS   save all global variables
3259 .\" NS
3260 .\" NS local variables:
3261 .\" NS   doc-reg-dsgv
3262 .
3263 .de doc-save-global-vars
3264 .  ds doc-macro-name-saved "\*[doc-macro-name]
3265 .  nr doc-arg-limit-saved \n[doc-arg-limit]
3266 .  nr doc-num-args-saved \n[doc-num-args]
3267 .  nr doc-arg-ptr-saved \n[doc-arg-ptr]
3268 .
3269 .  nr doc-reg-dsgv 1
3270 .  while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3271 .    ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3272 .    nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
3273 .    ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3274 .    nr doc-reg-dsgv +1
3275 .  \}
3276 .
3277 .  nr doc-curr-font-saved \n[doc-curr-font]
3278 .  nr doc-curr-size-saved \n[doc-curr-size]
3279 .  nr doc-in-synopsis-section-saved \n[doc-in-synopsis-section]
3280 .  nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3281 .  nr doc-indent-synopsis-active-saved \n[doc-indent-synopsis-active]
3282 .  nr doc-have-decl-saved \n[doc-have-decl]
3283 .  nr doc-have-var-saved \n[doc-have-var]
3284 .  ds doc-command-name-saved "\*[doc-command-name]
3285 .  ds doc-quote-left-saved "\*[doc-quote-left]
3286 .  ds doc-quote-right-saved "\*[doc-quote-right]
3287 .  nr doc-nesting-level-saved \n[doc-nesting-level]
3288 .  nr doc-in-list-saved \n[doc-in-list]
3289 .  ds doc-space-saved "\*[doc-space]
3290 .  ds doc-saved-space-saved "\*[doc-saved-space]
3291 .  nr doc-space-mode-saved \n[doc-space-mode]
3292 .  nr doc-have-space-saved \n[doc-have-space]
3293 .  nr doc-have-slot-saved \n[doc-have-slot]
3294 .  nr doc-keep-type-saved \n[doc-keep-type]
3295 .  nr doc-display-depth-saved \n[doc-display-depth]
3296 .  nr doc-is-compact-saved \n[doc-is-compact]
3297 .
3298 .  nr doc-reg-dsgv 0
3299 .  while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3300 .    ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3301 .    nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3302 .    nr doc-display-ad-stack\n[doc-reg-dsgv]-saved \n[doc-display-ad-stack\n[doc-reg-dsgv]]
3303 .    nr doc-display-fi-stack\n[doc-reg-dsgv]-saved \n[doc-display-fi-stack\n[doc-reg-dsgv]]
3304 .    nr doc-display-ft-stack\n[doc-reg-dsgv]-saved \n[doc-display-ft-stack\n[doc-reg-dsgv]]
3305 .    nr doc-display-ps-stack\n[doc-reg-dsgv]-saved \n[doc-display-ps-stack\n[doc-reg-dsgv]]
3306 .    nr doc-reg-dsgv +1
3307 .  \}
3308 .
3309 .  nr doc-fontmode-depth-saved \n[doc-fontmode-depth]
3310 .
3311 .  nr doc-reg-dsgv 1
3312 .  while (\n[doc-reg-dsgv] <= \n[doc-fontmode-depth]) \{\
3313 .    nr doc-fontmode-font-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-font-stack\n[doc-reg-dsgv]]
3314 .    nr doc-fontmode-size-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-size-stack\n[doc-reg-dsgv]]
3315 .    nr doc-reg-dsgv +1
3316 .  \}
3317 .
3318 .  nr doc-list-depth-saved \n[doc-list-depth]
3319 .
3320 .  nr doc-reg-dsgv 1
3321 .  while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3322 .    ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3323 .    nr doc-list-have-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-have-indent-stack\n[doc-reg-dsgv]]
3324 .    nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3325 .    nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3326 .    ds doc-tag-prefix-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-prefix-stack\n[doc-reg-dsgv]]
3327 .    ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3328 .    nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3329 .    nr doc-enum-list-count-stack\n[doc-reg-dsgv]-saved \n[doc-enum-list-count-stack\n[doc-reg-dsgv]]
3330 .    nr doc-reg-dsgv +1
3331 .  \}
3332 .
3333 .  ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3334 .  nr doc-curr-type-saved \n[doc-curr-type]
3335 .  ds doc-curr-arg-saved "\*[doc-curr-arg]
3336 .  nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3337 .  nr doc-num-columns-saved \n[doc-num-columns]
3338 .  nr doc-column-indent-width-saved \n[doc-column-indent-width]
3339 .  nr doc-is-func-saved \n[doc-is-func]
3340 .  nr doc-have-old-func-saved \n[doc-have-old-func]
3341 .  nr doc-func-arg-count-saved \n[doc-func-arg-count]
3342 .  ds doc-func-arg-saved "\*[doc-func-arg]
3343 .  nr doc-num-func-args-saved \n[doc-num-func-args]
3344 .  nr doc-func-args-processed-saved \n[doc-func-args-processed]
3345 .  nr doc-have-func-saved \n[doc-have-func]
3346 .  nr doc-is-reference-saved \n[doc-is-reference]
3347 .  nr doc-reference-count-saved \n[doc-reference-count]
3348 .  nr doc-author-count-saved \n[doc-author-count]
3349 .
3350 .  nr doc-reg-dsgv 0
3351 .  while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3352 .    ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3353 .    nr doc-reg-dsgv +1
3354 .  \}
3355 .
3356 .  nr doc-book-count-saved \n[doc-book-count]
3357 .  ds doc-book-name-saved "\*[doc-book-name]
3358 .  nr doc-date-count-saved \n[doc-date-count]
3359 .  ds doc-date-saved "\*[doc-date]
3360 .  nr doc-publisher-count-saved \n[doc-publisher-count]
3361 .  ds doc-publisher-name-saved "\*[doc-publisher-name]
3362 .  nr doc-journal-count-saved \n[doc-journal-count]
3363 .  ds doc-journal-name-saved "\*[doc-journal-name]
3364 .  nr doc-issue-count-saved \n[doc-issue-count]
3365 .  ds doc-issue-name-saved "\*[doc-issue-name]
3366 .  nr doc-optional-count-saved \n[doc-optional-count]
3367 .  ds doc-optional-string-saved "\*[doc-optional-string]
3368 .  nr doc-page-number-count-saved \n[doc-page-number-count]
3369 .  ds doc-page-number-string-saved "\*[doc-page-number-string]
3370 .  nr doc-corporate-count-saved \n[doc-corporate-count]
3371 .  ds doc-corporate-name-saved "\*[doc-corporate-name]
3372 .  nr doc-report-count-saved \n[doc-report-count]
3373 .  ds doc-report-name-saved "\*[doc-report-name]
3374 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
3375 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3376 .  ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
3377 .  nr doc-volume-count-saved \n[doc-volume-count]
3378 .  ds doc-volume-name-saved "\*[doc-volume-name]
3379 .  nr doc-have-author-saved \n[doc-have-author]
3380 .
3381 .  ds doc-document-title-saved "\*[doc-document-title]
3382 .  ds doc-volume-saved "\*[doc-volume]
3383 .  ds doc-section-saved "\*[doc-section]
3384 .  ds doc-operating-system-saved "\*[doc-operating-system]
3385 .  ds doc-date-string-saved "\*[doc-date-string]
3386 .  nr doc-header-space-saved \n[doc-header-space]
3387 .  nr doc-footer-space-saved \n[doc-footer-space]
3388 .  nr doc-display-vertical-saved \n[doc-display-vertical]
3389 .  ds doc-header-string-saved "\*[doc-header-string]
3390 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3391 .  nr doc-in-files-section-saved \n[doc-in-files-section]
3392 .  nr doc-in-authors-section-saved \n[doc-in-authors-section]
3393 ..
3394 .
3395 .
3396 .\" NS doc-restore-global-vars macro
3397 .\" NS   restore all global variables
3398 .\" NS
3399 .\" NS local variables:
3400 .\" NS   doc-reg-drgv
3401 .
3402 .de doc-restore-global-vars
3403 .  ds doc-macro-name "\*[doc-macro-name-saved]
3404 .  nr doc-arg-limit \n[doc-arg-limit-saved]
3405 .  nr doc-num-args \n[doc-num-args-saved]
3406 .  nr doc-arg-ptr \n[doc-arg-ptr-saved]
3407 .
3408 .  nr doc-reg-drgv 1
3409 .  while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3410 .    ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3411 .    nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
3412 .    ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3413 .    nr doc-reg-drgv +1
3414 .  \}
3415 .
3416 .  nr doc-curr-font \n[doc-curr-font-saved]
3417 .  nr doc-curr-size \n[doc-curr-size-saved]
3418 .  nr doc-in-synopsis-section \n[doc-in-synopsis-section-saved]
3419 .  nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3420 .  nr doc-indent-synopsis-active \n[doc-indent-synopsis-active-saved]
3421 .  nr doc-have-decl \n[doc-have-decl-saved]
3422 .  nr doc-have-var \n[doc-have-var-saved]
3423 .  ds doc-command-name "\*[doc-command-name-saved]
3424 .  ds doc-quote-left "\*[doc-quote-left-saved]
3425 .  ds doc-quote-right "\*[doc-quote-right-saved]
3426 .  nr doc-nesting-level \n[doc-nesting-level-saved]
3427 .  nr doc-in-list \n[doc-in-list-saved]
3428 .  ds doc-space "\*[doc-space-saved]
3429 .  ds doc-saved-space "\*[doc-saved-space-saved]
3430 .  nr doc-space-mode \n[doc-space-mode-saved]
3431 .  nr doc-have-space \n[doc-have-space-saved]
3432 .  nr doc-have-slot \n[doc-have-slot-saved]
3433 .  nr doc-keep-type \n[doc-keep-type-saved]
3434 .  nr doc-display-depth \n[doc-display-depth-saved]
3435 .  nr doc-is-compact \n[doc-is-compact-saved]
3436 .
3437 .  nr doc-reg-drgv 0
3438 .  while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3439 .    ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3440 .    nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3441 .    nr doc-display-ad-stack\n[doc-reg-drgv] \n[doc-display-ad-stack\n[doc-reg-drgv]-saved]
3442 .    nr doc-display-fi-stack\n[doc-reg-drgv] \n[doc-display-fi-stack\n[doc-reg-drgv]-saved]
3443 .    nr doc-display-ft-stack\n[doc-reg-drgv] \n[doc-display-ft-stack\n[doc-reg-drgv]-saved]
3444 .    nr doc-display-ps-stack\n[doc-reg-drgv] \n[doc-display-ps-stack\n[doc-reg-drgv]-saved]
3445 .    nr doc-reg-drgv +1
3446 .  \}
3447 .
3448 .  nr doc-fontmode-depth \n[doc-fontmode-depth-saved]
3449 .
3450 .  nr doc-reg-drgv 1
3451 .  while (\n[doc-reg-drgv] <= \n[doc-fontmode-depth]) \{\
3452 .    nr doc-fontmode-font-stack\n[doc-reg-drgv] \n[doc-fontmode-font-stack\n[doc-reg-drgv]]-saved
3453 .    nr doc-fontmode-size-stack\n[doc-reg-drgv] \n[doc-fontmode-size-stack\n[doc-reg-drgv]]-saved
3454 .    nr doc-reg-drgv +1
3455 .  \}
3456 .
3457 .  nr doc-list-depth \n[doc-list-depth-saved]
3458 .
3459 .  nr doc-reg-drgv 1
3460 .  while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3461 .    ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3462 .    nr doc-list-have-indent-stack\n[doc-reg-drgv] \n[doc-list-have-indent-stack\n[doc-reg-drgv]-saved]
3463 .    nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3464 .    nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3465 .    ds doc-tag-prefix-stack\n[doc-reg-drgv] "\*[doc-tag-prefix-stack\n[doc-reg-drgv]-saved]
3466 .    ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3467 .    nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3468 .    nr doc-enum-list-count-stack\n[doc-reg-drgv] \n[doc-enum-list-count-stack\n[doc-reg-drgv]-saved]
3469 .    nr doc-reg-drgv +1
3470 .  \}
3471 .
3472 .  ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3473 .  nr doc-curr-type \n[doc-curr-type-saved]
3474 .  ds doc-curr-arg "\*[doc-curr-arg-saved]
3475 .  nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3476 .  nr doc-num-columns \n[doc-num-columns-saved]
3477 .  nr doc-column-indent-width \n[doc-column-indent-width-saved]
3478 .  nr doc-is-func \n[doc-is-func-saved]
3479 .  nr doc-have-old-func \n[doc-have-old-func-saved]
3480 .  nr doc-func-arg-count \n[doc-func-arg-count-saved]
3481 .  ds doc-func-arg "\*[doc-func-arg-saved]
3482 .  nr doc-num-func-args \n[doc-num-func-args-saved]
3483 .  nr doc-func-args-processed \n[doc-func-args-processed-saved]
3484 .  nr doc-have-func \n[doc-have-func-saved]
3485 .  nr doc-is-reference \n[doc-is-reference-saved]
3486 .  nr doc-reference-count \n[doc-reference-count-saved]
3487 .  nr doc-author-count \n[doc-author-count-saved]
3488 .
3489 .  nr doc-reg-drgv 0
3490 .  while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3491 .    ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3492 .    nr doc-reg-drgv +1
3493 .  \}
3494 .
3495 .  nr doc-book-count \n[doc-book-count-saved]
3496 .  ds doc-book-name "\*[doc-book-name-saved]
3497 .  nr doc-date-count \n[doc-date-count-saved]
3498 .  ds doc-date "\*[doc-date-saved]
3499 .  nr doc-publisher-count \n[doc-publisher-count-saved]
3500 .  ds doc-publisher-name "\*[doc-publisher-name-saved]
3501 .  nr doc-journal-count \n[doc-journal-count-saved]
3502 .  ds doc-journal-name "\*[doc-journal-name-saved]
3503 .  nr doc-issue-count \n[doc-issue-count-saved]
3504 .  ds doc-issue-name "\*[doc-issue-name-saved]
3505 .  nr doc-optional-count \n[doc-optional-count-saved]
3506 .  ds doc-optional-string "\*[doc-optional-string-saved]
3507 .  nr doc-page-number-count \n[doc-page-number-count-saved]
3508 .  ds doc-page-number-string "\*[doc-page-number-string-saved]
3509 .  nr doc-corporate-count \n[doc-corporate-count-saved]
3510 .  ds doc-corporate-name "\*[doc-corporate-name-saved]
3511 .  nr doc-report-count \n[doc-report-count-saved]
3512 .  ds doc-report-name "\*[doc-report-name-saved]
3513 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
3514 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3515 .  ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
3516 .  nr doc-volume-count \n[doc-volume-count-saved]
3517 .  ds doc-volume-name "\*[doc-volume-name-saved]
3518 .  nr doc-have-author \n[doc-have-author-saved]
3519 .
3520 .  ds doc-document-title "\*[doc-document-title-saved]
3521 .  ds doc-volume "\*[doc-volume-saved]
3522 .  ds doc-section "\*[doc-section-saved]
3523 .  ds doc-operating-system "\*[doc-operating-system-saved]
3524 .  ds doc-date-string "\*[doc-date-string-saved]
3525 .  nr doc-header-space \n[doc-header-space-saved]
3526 .  nr doc-footer-space \n[doc-footer-space-saved]
3527 .  nr doc-display-vertical \n[doc-display-vertical-saved]
3528 .  ds doc-header-string "\*[doc-header-string-saved]
3529 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3530 .  nr doc-in-files-section \n[doc-in-files-section-saved]
3531 .  nr doc-in-authors-section \n[doc-in-authors-section-saved]
3532 ..
3533 .
3534 .
3535 .\" NS El user macro
3536 .\" NS   end list
3537 .\" NS
3538 .\" NS modifies:
3539 .\" NS   doc-list-depth
3540 .\" NS   doc-macro-name
3541 .\" NS
3542 .\" NS local variables:
3543 .\" NS   doc-str-El
3544 .\" NS
3545 .\" NS width register `El' set in doc-common
3546 .
3547 .de El
3548 .  if \n[.$] \{\
3549 .    tm Usage: .El (does not take arguments) (#\n[.c])
3550 .    return
3551 .  \}
3552 .
3553 .  ds doc-macro-name El
3554 .  ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3555 .
3556 .  ie        "\*[doc-str-El]"diag-list" \
3557 .    doc-end-list 0
3558 .  el \{ .ie "\*[doc-str-El]"column-list" \
3559 .    doc-end-column-list
3560 .  el \{ .ie "\*[doc-str-El]"item-list" \
3561 .    doc-end-list 0
3562 .  el \{ .ie "\*[doc-str-El]"ohang-list" \
3563 .    doc-end-list 0
3564 .  el \{ .ie "\*[doc-str-El]"inset-list" \
3565 .    doc-end-list 0
3566 .  el \
3567 .    doc-end-list 1
3568 .  \}\}\}\}
3569 .
3570 .  br
3571 ..
3572 .
3573 .
3574 .\" NS doc-saved-Pa-font global string
3575 .\" NS   saved doc-Pa-font string for section FILES (no underline if
3576 .\" NS   nroff)
3577 .
3578 .ds doc-saved-Pa-font
3579 .
3580 .
3581 .\" NS doc-curr-type global register
3582 .\" NS   current argument type
3583 .
3584 .nr doc-curr-type 0
3585 .
3586 .
3587 .\" NS doc-curr-arg global string
3588 .\" NS   current argument
3589 .
3590 .ds doc-curr-arg
3591 .
3592 .
3593 .\" NS doc-item-boxXXX global box
3594 .\" NS   item boxes associated list depth
3595 .\" NS
3596 .\" NS limit:
3597 .\" NS   doc-list-depth
3598 .
3599 .
3600 .\" NS It user macro
3601 .\" NS   list item
3602 .\" NS
3603 .\" NS modifies:
3604 .\" NS   doc-arg-ptr
3605 .\" NS   doc-argXXX
3606 .\" NS   doc-curr-arg
3607 .\" NS   doc-curr-type
3608 .\" NS   doc-in-list
3609 .\" NS   doc-macro-name
3610 .\" NS   doc-num-args
3611 .\" NS   doc-saved-Pa-font
3612 .\" NS
3613 .\" NS local variables:
3614 .\" NS   doc-reg-It
3615 .\" NS   doc-str-It
3616 .\" NS   doc-XXX-list-type
3617 .\" NS
3618 .\" NS width register `It' set in doc-common
3619 .
3620 .nr doc-bullet-list-type 1
3621 .nr doc-column-list-type 0
3622 .nr doc-dash-list-type 1
3623 .nr doc-diag-list-type 0
3624 .nr doc-enum-list-type 1
3625 .nr doc-hang-list-type 2
3626 .nr doc-inset-list-type 2
3627 .nr doc-item-list-type 1
3628 .nr doc-ohang-list-type 2
3629 .nr doc-tag-list-type 2
3630 .
3631 .de It
3632 .  ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3633 .
3634 .  if "\*[doc-str-It]"" \
3635 .    tm mdoc error: .It without preceding .Bl (#\n[.c])
3636 .
3637 .  if \n[doc-nesting-level] \{\
3638 .    tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
3639 .    tm1 " (#\n[.c])
3640 .  \}
3641 .
3642 .  br
3643 .  if !\n[cR] \
3644 .    ne 3v
3645 .
3646 .  if \n[.$] \{\
3647 .    ds doc-macro-name It
3648 .
3649 .    \" fill argument vector
3650 .    nr doc-reg-It 1
3651 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3652 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3653 .      nr doc-reg-It +1
3654 .    \}
3655 .
3656 .    nr doc-num-args \n[.$]
3657 .    nr doc-arg-ptr 0
3658 .  \}
3659 .
3660 .  nr doc-reg-It \n[doc-\*[doc-str-It]-type]
3661 .
3662 .  if \n[doc-reg-It] \{\
3663 .    \" start item box
3664 .    box doc-item-box\n[doc-list-depth]
3665 .    ev doc-item-env\n[doc-list-depth]
3666 .    evc 0
3667 .    in 0
3668 .    nf
3669 .  \}
3670 .
3671 .  ie (\n[doc-reg-It] == 1) \{\
3672 .    if \n[.$] \{\
3673 .      tm1 "mdoc warning: .It macros in lists of type `\*[doc-str-It]'
3674 .      tm1 "              don't take arguments (#\n[.c])
3675 .  \}\}
3676 .  el \{\
3677 .    ie \n[.$] \{\
3678 .      if (\n[doc-reg-It] == 2) \{\
3679 .        \" handle list types with arguments
3680 .        doc-parse-arg-vector
3681 .
3682 .        nr doc-in-list 1
3683 .        nr doc-arg-ptr 1
3684 .        nr doc-curr-type \n[doc-type1]
3685 .        ds doc-curr-arg "\*[doc-arg1]
3686 .
3687 .        if \n[doc-in-files-section] \{\
3688 .          ds doc-saved-Pa-font "\*[doc-Pa-font]
3689 .          if n \
3690 .            ds doc-Pa-font "\*[doc-No-font]
3691 .        \}
3692 .
3693 .        ie (\n[doc-type1] == 1) \
3694 .          \*[doc-arg1]
3695 .        el \{\
3696 .          nr doc-arg-ptr 1
3697 .          doc-print-recursive
3698 .    \}\}\}
3699 .    el \{\
3700 .      tm1 "mdoc warning: .It macros in lists of type `\*[doc-str-It]'
3701 .      tm1 "              require arguments (#\n[.c])
3702 .    \}
3703 .  \}
3704 .
3705 .  \" the previous call of `.doc-print-recursive' can contain calls to
3706 .  \" opening macros like `.Ao'; we then defer the call of `doc-xxx-list'
3707 .  if !\n[doc-nesting-level] \
3708 .    doc-\*[doc-str-It]
3709 ..
3710 .
3711 .
3712 .\" NS doc-inset-list macro
3713 .\" NS   .It item of list-type inset
3714 .\" NS
3715 .\" NS modifies:
3716 .\" NS   doc-in-list
3717 .
3718 .de doc-inset-list
3719 .  \" finish item box
3720 .  br
3721 .  ev
3722 .  box
3723 .  unformat doc-item-box\n[doc-list-depth]
3724 .
3725 .  doc-set-vertical-and-indent 0
3726 .  br
3727 .
3728 .  nh
3729 .  doc-item-box\n[doc-list-depth]
3730 .
3731 .  if \n[doc-in-files-section] \
3732 .    if n \
3733 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3734 .
3735 .  nr doc-in-list 0
3736 .  doc-reset-args
3737 ..
3738 .
3739 .
3740 .\" NS doc-hang-list macro
3741 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3742 .\" NS
3743 .\" NS modifies:
3744 .\" NS   doc-have-space
3745 .\" NS   doc-in-list
3746 .\" NS
3747 .\" NS local variables:
3748 .\" NS   doc-reg-dhl
3749 .\" NS   doc-reg-dhl1
3750 .
3751 .de doc-hang-list
3752 .  \" finish item box
3753 .  br
3754 .  ev
3755 .  box
3756 .  unformat doc-item-box\n[doc-list-depth]
3757 .
3758 .  doc-set-vertical-and-indent 1
3759 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3760 .  ti -\n[doc-reg-dhl]u
3761 .
3762 .  nh
3763 .  ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3764 .    doc-item-box\n[doc-list-depth]
3765 .  el \{\
3766 .    chop doc-item-box\n[doc-list-depth]
3767 .    nr doc-reg-dhl1 \n[.k]u
3768 .    nop \*[doc-item-box\n[doc-list-depth]]\c
3769 .    nop \h'|(\n[doc-reg-dhl1]u - \n[.k]u + \n[doc-reg-dhl]u)'\c
3770 .    nr doc-have-space 1
3771 .  \}
3772 .
3773 .  if \n[doc-in-files-section] \
3774 .    if n \
3775 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3776 .
3777 .  nr doc-in-list 0
3778 .  doc-reset-args
3779 ..
3780 .
3781 .
3782 .\" NS doc-ohang-list macro
3783 .\" NS   .It item of list-type overhanging tag
3784 .\" NS
3785 .\" NS modifies:
3786 .\" NS   doc-in-list
3787 .
3788 .de doc-ohang-list
3789 .  \" finish item box
3790 .  br
3791 .  ev
3792 .  box
3793 .  unformat doc-item-box\n[doc-list-depth]
3794 .
3795 .  doc-set-vertical-and-indent 0
3796 .  nh
3797 .  doc-item-box\n[doc-list-depth]
3798 .  br
3799 .
3800 .  if \n[doc-in-files-section] \
3801 .    if n \
3802 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3803 .
3804 .  nr doc-in-list 0
3805 .  doc-reset-args
3806 ..
3807 .
3808 .
3809 .\" NS doc-item-list macro
3810 .\" NS   .It item of list-type [empty tag]
3811 .
3812 .de doc-item-list
3813 .  \" finish (dummy) item box
3814 .  br
3815 .  ev
3816 .  box
3817 .
3818 .  doc-set-vertical-and-indent 0
3819 .  br
3820 .
3821 .  doc-reset-args
3822 ..
3823 .
3824 .
3825 .\" NS doc-enum-list-count-stackXXX global register
3826 .\" NS   stack of current enum count values
3827 .\" NS
3828 .\" NS limit:
3829 .\" NS   doc-list-depth
3830 .
3831 .nr doc-enum-list-count-stack1 0
3832 .
3833 .
3834 .\" NS doc-enum-list macro
3835 .\" NS   enumerated list
3836 .\" NS
3837 .\" NS modifies:
3838 .\" NS   doc-enum-list-count-stackXXX
3839 .\" NS   doc-in-list
3840 .
3841 .de doc-enum-list
3842 .  nr doc-in-list 1
3843 .  nr doc-enum-list-count-stack\n[doc-list-depth] +1
3844 \# XXX
3845 \#.ll \n[doc-list-indent-stack\n[doc-list-depth]]u
3846 \#.rj
3847 .  nop \*[doc-tag-prefix-stack\n[doc-list-depth]]\c
3848 .  nop \n[doc-enum-list-count-stack\n[doc-list-depth]].\&
3849 .  doc-do-list
3850 ..
3851 .
3852 .
3853 .\" NS doc-bullet-list macro
3854 .\" NS   bullet paragraph list
3855 .\" NS
3856 .\" NS modifies:
3857 .\" NS   doc-in-list
3858 .
3859 .de doc-bullet-list
3860 .  nr doc-in-list 1
3861 .  nop \)\*[doc-Sy-font]\[bu]\f[]
3862 .  doc-do-list
3863 ..
3864 .
3865 .
3866 .\" NS doc-dash-list macro
3867 .\" NS   hyphen paragraph list (sub bullet list)
3868 .\" NS
3869 .\" NS modifies:
3870 .\" NS   doc-in-list
3871 .
3872 .de doc-dash-list
3873 .  nr doc-in-list 1
3874 .  nop \)\*[doc-Sy-font]\-\f[]
3875 .  doc-do-list
3876 ..
3877 .
3878 .
3879 .\" NS doc-do-list macro
3880 .\" NS   .It item of list-type enum/bullet/hyphen
3881 .
3882 .als doc-do-list doc-hang-list
3883 .
3884 .
3885 .\" NS doc-diag-list-input-line-count global register
3886 .\" NS   saved line number to be checked in next diag-list item
3887 .
3888 .nr doc-diag-list-input-line-count 0
3889 .
3890 .
3891 .\" NS doc-diag-list macro
3892 .\" NS   .It item of list-type diagnostic-message
3893 .\" NS
3894 .\" NS modifies:
3895 .\" NS   doc-curr-font
3896 .\" NS   doc-curr-size
3897 .\" NS   doc-diag-list-input-line-count
3898 .
3899 .de doc-diag-list
3900 .  nr doc-curr-font \n[.f]
3901 .  nr doc-curr-size \n[.ps]
3902 .
3903 .  ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \{\
3904 .    ie !\n[doc-compact-list-stack\n[doc-list-depth]] \
3905 .      doc-paragraph
3906 .    el \
3907 .      br
3908 .  \}
3909 .  el \
3910 .    br
3911 .  nr doc-diag-list-input-line-count \n[.c]
3912 .
3913 .  nh
3914 .  nop \*[doc-Sy-font]\c
3915 .  if \n[doc-num-args] \
3916 .    doc-remaining-args
3917 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\*[doc-hard-space]\c
3918 .
3919 .  doc-print-and-reset
3920 ..
3921 .
3922 .
3923 .\" NS doc-tag-list macro
3924 .\" NS   .It item of list-type `tag'
3925 .\" NS
3926 .\" NS modifies:
3927 .\" NS   doc-have-space
3928 .\" NS   doc-in-list
3929 .\" NS
3930 .\" NS local variables:
3931 .\" NS   doc-box-dtl
3932 .\" NS   doc-reg-dtl
3933 .\" NS   doc-reg-dtl1
3934 .
3935 .de doc-tag-list
3936 .  \" finish item box
3937 .  br
3938 .  ev
3939 .  box
3940 .  unformat doc-item-box\n[doc-list-depth]
3941 .
3942 .  \" we use a box without `.nf' to compute the tag width (via `dl' register)
3943 .  box doc-box-dtl
3944 .  ev doc-env-dtl
3945 .  evc 0
3946 .  fi
3947 .  ad 0
3948 .  in 0
3949 .  doc-item-box\n[doc-list-depth]
3950 .  br
3951 .  ev
3952 .  box
3953 .
3954 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3955 .    if !\n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
3956 .      in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3957 .      nr doc-list-have-indent-stack\n[doc-list-depth] 1
3958 .    \}
3959 .    doc-get-tag-width
3960 .  \}
3961 .  doc-set-vertical-and-indent 1
3962 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3963 .  ti -\n[doc-reg-dtl]u
3964 .
3965 .  nh
3966 .  ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3967 .    doc-item-box\n[doc-list-depth]
3968 .    br
3969 .  \}
3970 .  el \{\
3971 .    chop doc-item-box\n[doc-list-depth]
3972 .    \" Using \Z prevents stretching of the spaces in the tag
3973 .    nop \Z'\*[doc-item-box\n[doc-list-depth]]'\c
3974 .    nop \h'\n[doc-reg-dtl]u'\c
3975 .    nr doc-have-space 1
3976 .  \}
3977 .
3978 .  if \n[doc-in-files-section] \
3979 .    if n \
3980 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3981 .
3982 .  nr doc-in-list 0
3983 .  doc-reset-args
3984 ..
3985 .
3986 .
3987 .\" NS doc-get-tag-width macro
3988 .\" NS   resolve unknown tag width (`tag' list-type only)
3989 .\" NS
3990 .\" NS modifies:
3991 .\" NS   doc-list-indent-stackXXX
3992 .\" NS   doc-tag-width-stackXXX
3993 .\" NS
3994 .\" NS requires:
3995 .\" NS   doc-curr-arg
3996 .\" NS   doc-curr-type
3997 .
3998 .de doc-get-tag-width
3999 .  ie (\n[doc-curr-type] == 1) \{\
4000 .    ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
4001 .    nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
4002 .  \}
4003 .  el \{\
4004 .    ds doc-tag-width-stack\n[doc-list-depth] No
4005 .    nr doc-list-indent-stack\n[doc-list-depth] \n[No]
4006 .  \}
4007 ..
4008 .
4009 .
4010 .\" NS doc-set-vertical-and-indent macro
4011 .\" NS   set up vertical spacing (if not compact) and indentation (with
4012 .\" NS   offset if argument is non-zero)
4013 .\" NS
4014 .\" NS modifies:
4015 .\" NS   doc-list-have-indent-stackXXX
4016 .
4017 .de doc-set-vertical-and-indent
4018 .  if !\n[doc-compact-list-stack\n[doc-list-depth]] \
4019 .    sp \n[doc-display-vertical]u
4020 .
4021 .  if \n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
4022 .    nr doc-list-have-indent-stack\n[doc-list-depth] 0
4023 .    if \$1 \
4024 .      in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4025 .  \}
4026 .
4027 .  if !\n[cR] \
4028 .    ne 2v
4029 ..
4030 .
4031 .
4032 .\" NS doc-list-depth global register
4033 .\" NS   list type stack counter
4034 .
4035 .nr doc-list-depth 0
4036 .
4037 .
4038 .\" NS doc-num-columns global register
4039 .\" NS   number of columns
4040 .
4041 .nr doc-num-columns 0
4042 .
4043 .
4044 .\" NS doc-compact-list-stackXXX global register (bool)
4045 .\" NS   stack of flags to indicate whether a particular list is compact
4046 .\" NS
4047 .\" NS limit:
4048 .\" NS   doc-list-depth
4049 .
4050 .nr doc-compact-list-stack1 0
4051 .
4052 .
4053 .\" NS doc-tag-prefix-stackXXX global string
4054 .\" NS   stack of tag prefixes (currently used for -nested -enum lists)
4055 .\" NS
4056 .\" NS limit:
4057 .\" NS   doc-list-depth
4058 .
4059 .ds doc-tag-prefix-stack1
4060 .
4061 .
4062 .\" NS doc-tag-width-stackXXX global string
4063 .\" NS   stack of strings indicating how to set up current element of
4064 .\" NS   doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
4065 .\" NS   directly; if it is a macro name, use the macro's width value;
4066 .\" NS   otherwise, `doc-get-tag-width' uses width value of `No'.
4067 .\" NS
4068 .\" NS limit:
4069 .\" NS   doc-list-depth
4070 .
4071 .ds doc-tag-width-stack0
4072 .ds doc-tag-width-stack1
4073 .
4074 .
4075 .\" NS doc-list-offset-stackXXX global register
4076 .\" NS   stack of list offsets
4077 .\" NS
4078 .\" NS limit:
4079 .\" NS   doc-list-depth
4080 .
4081 .nr doc-list-offset-stack1 0
4082 .
4083 .
4084 .\" NS doc-end-list macro
4085 .\" NS   list end function; resets indentation (and offset if argument is
4086 .\" NS   non-zero)
4087 .\" NS
4088 .\" NS modifies:
4089 .\" NS   doc-list-depth
4090 .\" NS   doc-list-offset-stackXXX
4091 .
4092 .de doc-end-list
4093 .  if \$1 \
4094 '    in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4095 .
4096 '  in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4097 .
4098 .  if (\n[doc-list-depth] <= 0) \
4099 .    tm mdoc warning: extraneous .El call (#\n[.c])
4100 .
4101 .  doc-decrement-list-stack
4102 .  nr doc-list-depth -1
4103 ..
4104 .
4105 .
4106 .\" NS doc-increment-list-stack macro
4107 .\" NS   set up next block for list
4108 .\" NS
4109 .\" NS modifies:
4110 .\" NS   doc-compact-list-stackXXX
4111 .\" NS   doc-list-have-indent-stackXXX
4112 .\" NS   doc-list-indent-stackXXX
4113 .\" NS   doc-list-offset-stackXXX
4114 .\" NS   doc-list-type-stackXXX
4115 .\" NS   doc-tag-prefix-stackXXX
4116 .\" NS   doc-tag-width-stackXXX
4117 .\" NS   doc-enum-list-count-stackXXX
4118 .\" NS
4119 .\" NS local variables:
4120 .\" NS   doc-reg-dils
4121 .
4122 .de doc-increment-list-stack
4123 .  nr doc-reg-dils (\n[doc-list-depth] + 1)
4124 .  nr doc-list-have-indent-stack\n[doc-reg-dils] 0
4125 .  nr doc-list-indent-stack\n[doc-reg-dils] 0
4126 .  nr doc-list-offset-stack\n[doc-reg-dils] 0
4127 .  ds doc-tag-prefix-stack\n[doc-reg-dils]
4128 .  ds doc-tag-width-stack\n[doc-reg-dils] \*[doc-tag-width-stack\n[doc-list-depth]]
4129 .  ds doc-list-type-stack\n[doc-reg-dils]
4130 .  nr doc-compact-list-stack\n[doc-reg-dils] 0
4131 .  nr doc-enum-list-count-stack\n[doc-reg-dils] 0
4132 ..
4133 .
4134 .
4135 .\" NS doc-decrement-list-stack macro
4136 .\" NS   decrement stack
4137 .\" NS
4138 .\" NS modifies:
4139 .\" NS   doc-compact-list-stackXXX
4140 .\" NS   doc-list-have-indent-stackXXX
4141 .\" NS   doc-list-indent-stackXXX
4142 .\" NS   doc-list-offset-stackXXX
4143 .\" NS   doc-list-type-stackXXX
4144 .\" NS   doc-tag-prefix-stackXXX
4145 .\" NS   doc-tag-width-stackXXX
4146 .\" NS   doc-enum-list-count-stackXXX
4147 .
4148 .de doc-decrement-list-stack
4149 .  ds doc-list-type-stack\n[doc-list-depth]
4150 .  nr doc-list-have-indent-stack\n[doc-list-depth] 0
4151 .  nr doc-list-indent-stack\n[doc-list-depth] 0
4152 .  nr doc-list-offset-stack\n[doc-list-depth] 0
4153 .  ds doc-tag-prefix-stack\n[doc-list-depth]
4154 .  ds doc-tag-width-stack\n[doc-list-depth]
4155 .  nr doc-compact-list-stack\n[doc-list-depth] 0
4156 .  nr doc-enum-list-count-stack\n[doc-list-depth] 0
4157 ..
4158 .
4159 .
4160 .\" NS Xr user macro
4161 .\" NS   cross reference (for man pages only)
4162 .\" NS
4163 .\" NS modifies:
4164 .\" NS   doc-arg-ptr
4165 .\" NS   doc-macro-name
4166 .\" NS
4167 .\" NS local variables:
4168 .\" NS   doc-reg-Xr
4169 .\" NS
4170 .\" NS width register `Xr' set in doc-common
4171 .
4172 .de Xr
4173 .  if !\n[doc-arg-limit] \{\
4174 .    ie \n[.$] \{\
4175 .      ds doc-macro-name Xr
4176 .      doc-parse-args \$@
4177 .    \}
4178 .    el \
4179 .      doc-Xr-usage
4180 .  \}
4181 .
4182 .  if !\n[doc-arg-limit] \
4183 .    return
4184 .
4185 .  nr doc-arg-ptr +1
4186 .  doc-print-prefixes
4187 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4188 .    \" first argument must be a string
4189 .    ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4190 .      nr doc-curr-font \n[.f]
4191 .      nr doc-curr-size \n[.ps]
4192 .      ds doc-arg\n[doc-arg-ptr] \*[doc-Xr-font]\*[doc-arg\n[doc-arg-ptr]]\f[]\s[0]
4193 .
4194 .      if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4195 .        nr doc-reg-Xr (\n[doc-arg-ptr] + 1)
4196 .        \" modify second argument if it is a string and
4197 .        \" remove space inbetween
4198 .        if (\n[doc-type\n[doc-reg-Xr]] == 2) \{\
4199 .          ds doc-arg\n[doc-reg-Xr] \*[lp]\*[doc-arg\n[doc-reg-Xr]]\*[rp]
4200 .          ds doc-space\n[doc-arg-ptr]
4201 .        \}
4202 .      \}
4203 .      doc-print-recursive
4204 .    \}
4205 .    el \
4206 .      doc-Xr-usage
4207 .  \}
4208 .  el \
4209 .    doc-Xr-usage
4210 ..
4211 .
4212 .
4213 .\" NS doc-Xr-usage macro
4214 .
4215 .de doc-Xr-usage
4216 .  tm Usage: .Xr manpage_name [section#] ... (#\n[.c])
4217 .  doc-reset-args
4218 ..
4219 .
4220 .
4221 .\" NS Sx user macro
4222 .\" NS   cross section reference
4223 .\" NS
4224 .\" NS width register `Sx' set in doc-common
4225 .
4226 .als Sx doc-generic-macro
4227 .ds doc-Sx-usage section_header
4228 .
4229 .
4230 .\" NS doc-end-column-list macro
4231 .\" NS   column-list end-list
4232 .\" NS
4233 .\" NS modifies:
4234 .\" NS   doc-list-depth
4235 .
4236 .de doc-end-column-list
4237 .  linetabs 0
4238 '  in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
4239 .  ta T .5i
4240 .  fi
4241 .  doc-decrement-list-stack
4242 .  nr doc-list-depth -1
4243 ..
4244 .
4245 .
4246 .\" NS doc-column-indent-width global register
4247 .\" NS   holds the indent width for a column list
4248 .
4249 .nr doc-column-indent-width 0
4250 .
4251 .
4252 .\" NS doc-set-column-tab macro
4253 .\" NS   establish tabs for list-type column: `.doc-set-column-tab num_cols'
4254 .\" NS
4255 .\" NS modifies:
4256 .\" NS   doc-column-indent-width
4257 .\" NS
4258 .\" NS local variables:
4259 .\" NS   doc-reg-dsct
4260 .\" NS   doc-str-dsct
4261 .\" NS   doc-str-dsct1
4262 .
4263 .de doc-set-column-tab
4264 .  ds doc-str-dsct
4265 .  nr doc-reg-dsct 1
4266 .  nr doc-column-indent-width 0
4267 .
4268 .  ie (\$1 < 5) \
4269 .    ds doc-str-dsct1 "    \"
4270 .  el \{\
4271 .    ie (\$1 == 5) \
4272 .      ds doc-str-dsct1 "   \"
4273 .    el \{\
4274 .      \" XXX: this is packed abnormally close -- intercolumn width
4275 .      \"      should be configurable
4276 .      ds doc-str-dsct1 " \"
4277 .  \}\}
4278 .
4279 .  while (\n[doc-reg-dsct] <= \$1) \{\
4280 .    as doc-str-dsct " +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4281 .    nr doc-column-indent-width +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4282 .    nr doc-reg-dsct +1
4283 .  \}
4284 .
4285 .  ta \*[doc-str-dsct]
4286 '  in +\n[doc-column-indent-width]u
4287 ..
4288 .
4289 .
4290 .\" NS doc-column-list macro
4291 .\" NS   column items
4292 .\" NS
4293 .\" NS modifies:
4294 .\" NS   doc-arg-ptr
4295 .\" NS   doc-list-indent-stackXXX
4296 .\" NS   doc-spaceXXX
4297 .\" NS
4298 .\" NS local variables:
4299 .\" NS   doc-reg-dcl
4300 .
4301 .de doc-column-list
4302 .  if \n[doc-num-args] \
4303 .    doc-parse-arg-vector
4304 .  nr doc-arg-ptr +1
4305 .
4306 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4307 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4308 .    return
4309 .  \}
4310 .
4311 .  if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4312 .    nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4313 .    ds doc-space\n[doc-reg-dcl]
4314 .  \}
4315 .
4316 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4317 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4318 .  if !\n[.u] \{\
4319 .    fi
4320 '    in +\n[doc-column-indent-width]u
4321 .  \}
4322 .  ti -\n[doc-column-indent-width]u
4323 .
4324 .  doc-do-\n[doc-type\n[doc-arg-ptr]]
4325 ..
4326 .
4327 .
4328 .\" NS Ta user macro
4329 .\" NS   append tab (\t)
4330 .\" NS
4331 .\" NS modifies:
4332 .\" NS   doc-arg-ptr
4333 .\" NS
4334 .\" NS width register `Ta' set in doc-common
4335 .
4336 .de Ta
4337 .  ie \n[doc-arg-limit] \{\
4338 .    nr doc-arg-ptr +1
4339 .    nop \*[doc-tab]\c
4340 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4341 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
4342 .    el \
4343 .      doc-reset-args
4344 .  \}
4345 .  el \{\
4346 .    tm1 "Usage: Ta must follow column entry: e.g.
4347 .    tm1 "         .It column_string [Ta [column_string ...]] (#\n[.c])
4348 .  \}
4349 ..
4350 .
4351 .
4352 .\" NS Dl user macro
4353 .\" NS   display (one line) literal
4354 .\" NS
4355 .\" NS   this function uses the `Li' font
4356 .\" NS
4357 .\" NS modifies:
4358 .\" NS   doc-arg-ptr
4359 .\" NS   doc-curr-font
4360 .\" NS   doc-curr-size
4361 .\" NS   doc-macro-name
4362 .\" NS
4363 .\" NS width register `Dl' set in doc-common
4364 .
4365 .de Dl
4366 '  ta T .5i
4367 .  in +\n[doc-display-indent]u
4368 .
4369 .  ie \n[doc-arg-limit] \{\
4370 .    tm Usage: .Dl not callable by other macros (#\n[.c])
4371 .    doc-reset-args
4372 .  \}
4373 .  el \{\
4374 .    ie \n[.$] \{\
4375 .      ds doc-macro-name Dl
4376 .      doc-parse-args \$@
4377 .      nr doc-arg-ptr 1
4378 .      nr doc-curr-font \n[.f]
4379 .      nr doc-curr-size \n[.ps]
4380 .      nop \*[doc-Li-font]\c
4381 .      doc-print-recursive
4382 .    \}
4383 .    el \
4384 .      tm Usage: .Dl argument ... (#\n[.c])
4385 .  \}
4386 .
4387 .  in -\n[doc-display-indent]u
4388 ..
4389 .
4390 .
4391 .\" NS D1 user macro
4392 .\" NS   display (one line)
4393 .\" NS
4394 .\" NS modifies:
4395 .\" NS   doc-arg-ptr
4396 .\" NS   doc-macro-name
4397 .\" NS
4398 .\" NS width register `D1' set in doc-common
4399 .
4400 .de D1
4401 '  ta T .5i
4402 .  in +\n[doc-display-indent]u
4403 .
4404 .  ie \n[doc-arg-limit] \{\
4405 .    tm Usage: .D1 not callable by other macros (#\n[.c])
4406 .    doc-reset-args
4407 .  \}
4408 .  el \{\
4409 .    ie \n[.$] \{\
4410 .      ds doc-macro-name D1
4411 .      doc-parse-args \$@
4412 .      nr doc-arg-ptr 1
4413 .      doc-print-recursive
4414 .    \}
4415 .    el \
4416 .      tm Usage: .D1 argument ... (#\n[.c])
4417 .  \}
4418 .
4419 .  in -\n[doc-display-indent]u
4420 ..
4421 .
4422 .
4423 .\" NS Vt user macro
4424 .\" NS   variable type (for forcing old style variable declarations);
4425 .\" NS   this is not done in the same manner as .Ot for fortrash --
4426 .\" NS   clean up later
4427 .\" NS
4428 .\" NS modifies:
4429 .\" NS   doc-curr-font
4430 .\" NS   doc-curr-size
4431 .\" NS   doc-have-decl
4432 .\" NS   doc-have-var
4433 .\" NS   doc-macro-name
4434 .\" NS
4435 .\" NS width register `Vt' set in doc-common
4436 .
4437 .de Vt
4438 .  if !\n[doc-arg-limit] \{\
4439 .    ie \n[.$] \{\
4440 .      ds doc-macro-name Vt
4441 .      doc-parse-args \$@
4442 .    \}
4443 .    el \
4444 .      tm Usage: .Vt variable_type ... (#\n[.c])
4445 .  \}
4446 .
4447 .  if !\n[doc-arg-limit] \
4448 .    return
4449 .
4450 .  nr doc-arg-ptr +1
4451 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4452 .    tm Usage: .Vt variable_type ... (#\n[.c])
4453 .    doc-reset-args
4454 .    return
4455 .  \}
4456 .
4457 .  if \n[doc-in-synopsis-section] \{\
4458 .    \" if a function declaration was the last thing given,
4459 .    \" want vertical space
4460 .    if \n[doc-have-decl] \{\
4461 .      doc-paragraph
4462 .      nr doc-have-decl 0
4463 .    \}
4464 .
4465 .    \" if a subroutine was the last thing given, want vertical space
4466 .    if \n[doc-have-func] \{\
4467 .      ie \n[doc-have-var] \
4468 .        br
4469 .      el \
4470 .        doc-paragraph
4471 .    \}
4472 .
4473 .    nr doc-have-var 1
4474 .  \}
4475 .
4476 .  nr doc-curr-font \n[.f]
4477 .  nr doc-curr-size \n[.ps]
4478 .  nop \*[doc-Ft-font]\c
4479 .  doc-print-recursive
4480 .
4481 .  if \n[doc-in-synopsis-section] \{\
4482 .    ie \n[doc-have-old-func] \
4483 .      nop \*[doc-soft-space]\c
4484 .    el \
4485 .      br
4486 .  \}
4487 ..
4488 .
4489 .
4490 .\" NS doc-is-func global register (bool)
4491 .\" NS   set if subroutine (in synopsis only) (fortran only)
4492 .
4493 .nr doc-is-func 0
4494 .
4495 .
4496 .\" NS Ft user macro
4497 .\" NS   function type
4498 .\" NS
4499 .\" NS modifies:
4500 .\" NS   doc-curr-font
4501 .\" NS   doc-curr-size
4502 .\" NS   doc-have-decl
4503 .\" NS   doc-have-var
4504 .\" NS   doc-is-func
4505 .\" NS   doc-macro-name
4506 .\" NS
4507 .\" NS width register `Ft' set in doc-common
4508 .
4509 .de Ft
4510 .  if !\n[doc-arg-limit] \{\
4511 .    ie \n[.$] \{\
4512 .      ds doc-macro-name Ft
4513 .      doc-parse-args \$@
4514 .    \}
4515 .    el \
4516 .      tm Usage: .Ft function_type ... (#\n[.c])
4517 .  \}
4518 .
4519 .  if !\n[doc-arg-limit] \
4520 .    return
4521 .
4522 .  nr doc-arg-ptr +1
4523 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4524 .    tm Usage: .Ft function_type ... (#\n[.c])
4525 .    doc-reset-args
4526 .    return
4527 .  \}
4528 .
4529 .  if \n[doc-in-synopsis-section] \{\
4530 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4531 .      doc-paragraph
4532 .      nr doc-have-decl 0
4533 .      nr doc-have-var 0
4534 .    \}
4535 .
4536 .    if \n[doc-have-var] \{\
4537 .      doc-paragraph
4538 .      nr doc-have-var 0
4539 .    \}
4540 .
4541 .    nr doc-is-func 1
4542 .  \}
4543 .
4544 .  nr doc-curr-font \n[.f]
4545 .  nr doc-curr-size \n[.ps]
4546 .  nop \*[doc-Ft-font]\c
4547 .  doc-print-recursive
4548 ..
4549 .
4550 .
4551 .\" NS doc-have-old-func global register (bool)
4552 .\" NS   set if `Ot' has been called
4553 .
4554 .nr doc-have-old-func 0
4555 .
4556 .
4557 .\" NS Ot user macro
4558 .\" NS   old function type (fortran -- no newline)
4559 .\" NS
4560 .\" NS modifies:
4561 .\" NS   doc-have-decl
4562 .\" NS   doc-have-old-func
4563 .\" NS   doc-have-var
4564 .\" NS   doc-is-func
4565 .\" NS
4566 .\" NS width register `Ot' set in doc-common
4567 .
4568 .de Ot
4569 .  nr doc-have-old-func 1
4570 .
4571 .  if \n[doc-in-synopsis-section] \{\
4572 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4573 .      doc-paragraph
4574 .      nr doc-have-decl 0
4575 .      nr doc-have-var 0
4576 .    \}
4577 .
4578 .    if \n[doc-have-var] \{\
4579 .      doc-paragraph
4580 .      nr doc-have-var 0
4581 .    \}
4582 .
4583 .    nr doc-is-func 1
4584 .  \}
4585 .
4586 .  if \n[.$] \
4587 .    nop \*[doc-Ft-font]\$*\c
4588 .  nop \ \f[]\c
4589 ..
4590 .
4591 .
4592 .\" NS Fa user macro
4593 .\" NS   function arguments
4594 .\" NS
4595 .\" NS modifies:
4596 .\" NS   doc-arg-ptr
4597 .\" NS   doc-curr-font
4598 .\" NS   doc-curr-size
4599 .\" NS   doc-macro-name
4600 .\" NS
4601 .\" NS width register `Fa' set in doc-common
4602 .
4603 .de Fa
4604 .  if !\n[doc-arg-limit] \{\
4605 .    ie \n[.$] \{\
4606 .      ds doc-macro-name Fa
4607 .      doc-parse-args \$@
4608 .    \}
4609 .    el \
4610 .      tm Usage: .Fa function_arguments ... (#\n[.c])
4611 .  \}
4612 .
4613 .  ie \n[doc-func-arg-count] \
4614 .    doc-do-func
4615 .  el \{\
4616 .    nr doc-arg-ptr +1
4617 .    if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4618 .      nr doc-curr-font \n[.f]
4619 .      nr doc-curr-size \n[.ps]
4620 .      nop \*[doc-Fa-font]\c
4621 .      doc-print-recursive
4622 .
4623 .      if \n[doc-in-synopsis-section] \
4624 .        if \n[doc-have-func] \
4625 .          br
4626 .  \}\}
4627 ..
4628 .
4629 .
4630 .\" NS doc-func-arg-count global register
4631 .\" NS   how many function arguments have been processed so far
4632 .
4633 .nr doc-func-arg-count 0
4634 .
4635 .
4636 .\" NS doc-func-arg global string
4637 .\" NS   work buffer for function name strings
4638 .
4639 .ds doc-func-arg
4640 .
4641 .
4642 .\" NS doc-num-func-args global register
4643 .\" NS   number of function arguments
4644 .
4645 .nr doc-num-func-args 0
4646 .
4647 .
4648 .\" NS doc-func-args-processed global register
4649 .\" NS   function arguments processed so far
4650 .
4651 .nr doc-func-args-processed 0
4652 .
4653 .
4654 .\" NS doc-do-func macro
4655 .\" NS   internal .Fa for .Fc
4656 .\" NS
4657 .\" NS modifies:
4658 .\" NS   doc-arg-ptr
4659 .\" NS   doc-argXXX
4660 .\" NS   doc-func-arg
4661 .\" NS   doc-func-arg-count
4662 .\" NS   doc-func-args-processed
4663 .\" NS   doc-num-func-args
4664 .
4665 .de doc-do-func
4666 .  if (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
4667 .    doc-reset-args
4668 .    return
4669 .  \}
4670 .
4671 .  nr doc-arg-ptr +1
4672 .
4673 .  ds doc-func-arg
4674 .  nr doc-num-func-args 0
4675 .  nr doc-func-args-processed 0
4676 .
4677 .  doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4678 .  if (\n[doc-num-func-args] > 1) \
4679 .    ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4680 .
4681 .  if (\n[doc-func-arg-count] > 1) \{\
4682 .    nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\|,\)\c
4683 .    nop \)\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]\c
4684 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\f[]\s[0]\c
4685 .  \}
4686 .
4687 .  if (\n[doc-func-arg-count] == 1) \{\
4688 .    nop \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]\c
4689 .    nop \f[]\s[0]\c
4690 .  \}
4691 .  nr doc-func-arg-count +1
4692 .  doc-do-func
4693 ..
4694 .
4695 .
4696 .\" NS doc-have-func global register (bool)
4697 .\" NS   whether we have more than one function in synopsis
4698 .
4699 .nr doc-have-func 0
4700 .
4701 .
4702 .\" NS Fn user macro
4703 .\" NS   functions
4704 .\" NS
4705 .\" NS modifies:
4706 .\" NS   doc-arg-ptr
4707 .\" NS   doc-curr-font
4708 .\" NS   doc-curr-size
4709 .\" NS   doc-have-decl
4710 .\" NS   doc-have-func
4711 .\" NS   doc-have-var
4712 .\" NS   doc-indent-synopsis
4713 .\" NS   doc-is-func
4714 .\" NS   doc-macro-name
4715 .\" NS
4716 .\" NS width register `Fn' set in doc-common
4717 .
4718 .de Fn
4719 .  if !\n[doc-arg-limit] \{\
4720 .    ie \n[.$] \{\
4721 .      ds doc-macro-name Fn
4722 .      doc-parse-args \$@
4723 .    \}
4724 .    el \
4725 .      tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4726 .  \}
4727 .
4728 .  if !\n[doc-arg-limit] \
4729 .    return
4730 .
4731 .  if \n[doc-in-synopsis-section] \{\
4732 .    \" if there is/has been more than one subroutine declaration
4733 .    ie \n[doc-is-func] \{\
4734 .      br
4735 .      nr doc-have-var 0
4736 .      nr doc-have-decl 0
4737 .      nr doc-is-func 0
4738 .    \}
4739 .    el \{\
4740 .      if \n[doc-have-func] \{\
4741 .        doc-paragraph
4742 .        nr doc-have-var 0
4743 .        nr doc-have-decl 0
4744 .    \}\}
4745 .
4746 .    if \n[doc-have-decl] \{\
4747 .      doc-paragraph
4748 .      nr doc-have-var 0
4749 .    \}
4750 .
4751 .    if \n[doc-have-var] \{\
4752 .      doc-paragraph
4753 .      nr doc-have-decl 0
4754 .    \}
4755 .
4756 .    nr doc-have-func 1
4757 .    nr doc-is-func 0
4758 .
4759 .    br
4760 .    if !\n[doc-indent-synopsis] \
4761 .      nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4762 .    if !\n[doc-indent-synopsis-active] \
4763 .      in +\n[doc-indent-synopsis]u
4764 .    ti -\n[doc-indent-synopsis]u
4765 .  \}
4766 .
4767 .  nr doc-arg-ptr +1
4768 .  doc-print-prefixes
4769 .  if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
4770 .    tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
4771 .    doc-reset-args
4772 .    return
4773 .  \}
4774 .
4775 .  nr doc-curr-font \n[.f]
4776 .  nr doc-curr-size \n[.ps]
4777 .  nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4778 .  nop \f[]\s[0]\*[lp]\)\c
4779 .
4780 .  nr doc-arg-ptr +1
4781 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4782 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4783 .      nop \*[doc-Fa-font]\c
4784 .      doc-do-func-args
4785 .      nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
4786 .  \}\}
4787 .
4788 .  nop \)\*[rp]\)\c
4789 .  if \n[doc-in-synopsis-section] \
4790 .    nop \);\)\c
4791 .
4792 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4793 .    \" output the space (if needed)
4794 .    nr doc-arg-ptr -1
4795 .    nop \)\*[doc-space\n[doc-arg-ptr]]\c
4796 .    nr doc-arg-ptr +1
4797 .
4798 .    doc-print-recursive
4799 .  \}
4800 .  el \
4801 .    doc-print-and-reset
4802 .
4803 .  if \n[doc-in-synopsis-section] \
4804 .    if !\n[doc-indent-synopsis-active] \
4805 .      in -\n[doc-indent-synopsis]u
4806 ..
4807 .
4808 .
4809 .\" NS doc-do-func-args macro
4810 .\" NS   handle function arguments
4811 .\" NS
4812 .\" NS modifies:
4813 .\" NS   doc-arg-ptr
4814 .\" NS   doc-argXXX
4815 .\" NS   doc-func-arg
4816 .\" NS   doc-func-args-processed
4817 .\" NS   doc-num-func-args
4818 .\" NS
4819 .\" NS local variables:
4820 .\" NS   doc-reg-ddfa
4821 .
4822 .de doc-do-func-args
4823 .  if \n[doc-in-synopsis-section] \{\
4824 .    ds doc-func-arg
4825 .    nr doc-num-func-args 0
4826 .    nr doc-func-args-processed 0
4827 .
4828 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4829 .    if (\n[doc-num-func-args] > 1) \
4830 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4831 .  \}
4832 .
4833 .  nop \)\*[doc-arg\n[doc-arg-ptr]]\c
4834 .  nr doc-arg-ptr +1
4835 .
4836 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4837 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4838 .      nr doc-reg-ddfa (\n[doc-arg-ptr] - 1)
4839 .      nop \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]u],\)\c
4840 .      nop \)\*[doc-space\n[doc-reg-ddfa]]\f[]\s[0]\|\c
4841 .      doc-do-func-args
4842 .  \}\}
4843 ..
4844 .
4845 .
4846 .\" NS doc-saved-nesting-level global register
4847 .
4848 .nr doc-saved-nesting-level 0
4849 .
4850 .
4851 .\" NS doc-in-func-enclosure global register (bool)
4852 .
4853 .nr doc-in-func-enclosure 0
4854 .
4855 .
4856 .\" NS Fo user macro
4857 .\" NS   function open
4858 .\" NS
4859 .\" NS modifies:
4860 .\" NS   doc-arg-ptr
4861 .\" NS   doc-curr-font
4862 .\" NS   doc-curr-size
4863 .\" NS   doc-func-arg-count
4864 .\" NS   doc-have-decl
4865 .\" NS   doc-have-func
4866 .\" NS   doc-have-var
4867 .\" NS   doc-in-func-enclosure
4868 .\" NS   doc-indent-synopsis
4869 .\" NS   doc-is-func
4870 .\" NS   doc-macro-name
4871 .\" NS   doc-saved-nesting-level
4872 .\" NS
4873 .\" NS width register `Fo' set in doc-common
4874 .
4875 .de Fo
4876 .  if (\n[doc-in-func-enclosure]) \{\
4877 .    tm mdoc error: .Fo/.Fc can't be nested (#\n[.c])
4878 .    return
4879 .  \}
4880 .
4881 .  nr doc-saved-nesting-level \n[doc-nesting-level]
4882 .  nr doc-in-func-enclosure 1
4883 .
4884 .  if !\n[doc-arg-limit] \{\
4885 .    ie \n[.$] \{\
4886 .      ds doc-macro-name Fo
4887 .      doc-parse-args \$@
4888 .    \}
4889 .    el \
4890 .      tm Usage: .Fo function_name (#\n[.c])
4891 .  \}
4892 .
4893 .  if \n[doc-in-synopsis-section] \{\
4894 .    \" if there is/has been more than one subroutine declaration
4895 .    ie \n[doc-is-func] \{\
4896 .      br
4897 .      nr doc-have-var 0
4898 .      nr doc-have-decl 0
4899 .      nr doc-is-func 0
4900 .    \}
4901 .    el \{\
4902 .      if \n[doc-have-func] \{\
4903 .        doc-paragraph
4904 .        nr doc-have-var 0
4905 .        nr doc-have-decl 0
4906 .    \}\}
4907 .
4908 .    if \n[doc-have-decl] \{\
4909 .      doc-paragraph
4910 .      nr doc-have-var 0
4911 .    \}
4912 .
4913 .    if \n[doc-have-var] \{\
4914 .      doc-paragraph
4915 .      nr doc-have-decl 0
4916 .    \}
4917 .
4918 .    nr doc-have-func 1
4919 .    nr doc-is-func 0
4920 .
4921 .    br
4922 .    if !\n[doc-indent-synopsis] \
4923 .      nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4924 .  \}
4925 .
4926 .  \" start function box
4927 .  box doc-func-box
4928 .  ev doc-func-env
4929 .  evc 0
4930 .  in 0
4931 .  nf
4932 .
4933 .  nr doc-arg-ptr +1
4934 .  doc-print-prefixes
4935 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4936 .    nr doc-func-arg-count 1
4937 .    nr doc-curr-font \n[.f]
4938 .    nr doc-curr-size \n[.ps]
4939 .
4940 .    nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
4941 .    nop \f[]\s[0]\*[lp]\)\c
4942 .    doc-reset-args
4943 .  \}
4944 ..
4945 .
4946 .
4947 .\" NS Fc user macro
4948 .\" NS   function close
4949 .\" NS
4950 .\" NS modifies:
4951 .\" NS   doc-arg-ptr
4952 .\" NS   doc-func-arg-count
4953 .\" NS   doc-in-func-enclosure
4954 .\" NS   doc-saved-nesting-level
4955 .\" NS   doc-macro-name
4956 .\" NS
4957 .\" NS width register `Fc' set in doc-common
4958 .
4959 .de Fc
4960 .  if !\n[doc-in-func-enclosure] \{\
4961 .    tm mdoc warning: Extraneous .Fc (#\n[.c])
4962 .    return
4963 .  \}
4964 .
4965 .  if \n[.$] \{\
4966 .    ds doc-macro-name Fc
4967 .    \" the first (dummy) argument is used to get the correct spacing
4968 .    doc-parse-args \) \$@
4969 .  \}
4970 .
4971 .  if !(\n[doc-saved-nesting-level] == \n[doc-nesting-level]) \
4972 .    tm mdoc warning: Unbalanced enclosure commands within .Fo/.Fc
4973 .
4974 .  nr doc-func-arg-count 0
4975 .  nr doc-in-func-enclosure 0
4976 .
4977 .  ie \n[doc-in-synopsis-section] \
4978 .    nop \|\*[rp];\)
4979 .  el \
4980 .    nop \|\*[rp]\)
4981 .
4982 .  \" finish function box
4983 .  br
4984 .  ev
4985 .  box
4986 .  chop doc-func-box
4987 .  unformat doc-func-box
4988 .
4989 .  if \n[doc-in-synopsis-section] \{\
4990 .    if !\n[doc-indent-synopsis-active] \
4991 .      in +\n[doc-indent-synopsis]u
4992 .    ti -\n[doc-indent-synopsis]u
4993 .  \}
4994 .
4995 .  nh
4996 .  nop \*[doc-func-box]\c
4997 .
4998 .  nr doc-arg-ptr +1
4999 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5000 .    nr doc-curr-font \n[.f]
5001 .    nr doc-curr-size \n[.ps]
5002 .    doc-print-recursive
5003 .  \}
5004 .  el \
5005 .    doc-print-and-reset
5006 .
5007 .  if \n[doc-in-synopsis-section] \
5008 .    if !\n[doc-indent-synopsis-active] \
5009 .      in -\n[doc-indent-synopsis]u
5010 ..
5011 .
5012 .
5013 .\" NS doc-build-func-string macro
5014 .\" NS   collect function arguments and set hard spaces inbetween
5015 .\" NS
5016 .\" NS modifies:
5017 .\" NS   doc-func-arg
5018 .\" NS   doc-func-args-processed
5019 .\" NS   doc-num-func-args
5020 .
5021 .de doc-build-func-string
5022 .  if !\n[doc-num-func-args] \{\
5023 .    nr doc-num-func-args \n[.$]
5024 .    nr doc-func-args-processed 0
5025 .    ds doc-func-arg
5026 .  \}
5027 .
5028 .  nr doc-func-args-processed +1
5029 .  as doc-func-arg "\$1
5030 .
5031 .  if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
5032 .    as doc-func-arg "\*[doc-hard-space]
5033 .
5034 .    shift
5035 .    doc-build-func-string \$@
5036 .  \}
5037 ..
5038 .
5039 .
5040 .\" Very crude references: Stash all reference info into boxes, print out
5041 .\" reference on .Re macro and clean up.  Ordering very limited, no fancy
5042 .\" citations, but can do articles, journals, and books -- need to add
5043 .\" several missing options (like city etc).  Should be able to grab a refer
5044 .\" entry, massage it a wee bit (prefix a `.' to the %[A-Z]) and not worry
5045 .\" (ha!).
5046 .
5047 .
5048 .\" NS doc-is-reference global register (bool)
5049 .\" NS   set if in reference
5050 .
5051 .nr doc-is-reference 0
5052 .
5053 .
5054 .\" NS doc-reference-count global register
5055 .\" NS   reference element counter
5056 .
5057 .nr doc-reference-count 0
5058 .
5059 .
5060 .\" NS Rs user macro
5061 .\" NS   reference start
5062 .\" NS
5063 .\" NS modifies:
5064 .\" NS   doc-is-reference
5065 .\" NS   doc-reference-count
5066 .\" NS
5067 .\" NS width register `Rs' set in doc-common
5068 .
5069 .de Rs
5070 .  ie \n[.$] \
5071 .    tm Usage: .Rs (does not take arguments) (#\n[.c])
5072 .  el \{\
5073 .    nr doc-is-reference 1
5074 .    doc-reset-reference
5075 .    if \n[doc-in-see-also-section] \
5076 .      doc-paragraph
5077 .    nr doc-reference-count 0
5078 .  \}
5079 ..
5080 .
5081 .
5082 .\" NS Re user macro
5083 .\" NS   reference end
5084 .\" NS
5085 .\" NS modifies:
5086 .\" NS   doc-is-reference
5087 .\" NS
5088 .\" NS width register `Re' set in doc-common
5089 .
5090 .de Re
5091 .  ie \n[.$] \
5092 .    tm Usage: .Re (does not take arguments) (#\n[.c])
5093 .  el \{\
5094 .    doc-print-reference
5095 .    doc-reset-reference
5096 .    nr doc-is-reference 0
5097 .  \}
5098 ..
5099 .
5100 .
5101 .\" NS doc-reset-reference macro
5102 .\" NS   reference cleanup
5103 .\" NS
5104 .\" NS modifies:
5105 .\" NS   doc-author-count
5106 .\" NS   doc-author-nameXXX
5107 .\" NS   doc-book-count
5108 .\" NS   doc-book-name
5109 .\" NS   doc-corporate-count
5110 .\" NS   doc-corporate-name
5111 .\" NS   doc-date
5112 .\" NS   doc-date-count
5113 .\" NS   doc-issue-count
5114 .\" NS   doc-issue-name
5115 .\" NS   doc-journal-count
5116 .\" NS   doc-journam-name
5117 .\" NS   doc-optional-count
5118 .\" NS   doc-optional-string
5119 .\" NS   doc-page-number-count
5120 .\" NS   doc-page-number-string
5121 .\" NS   doc-reference-title-count
5122 .\" NS   doc-reference-title-name
5123 .\" NS   doc-reference-title-name-for-book
5124 .\" NS   doc-report-count
5125 .\" NS   doc-report-name
5126 .\" NS   doc-volume-count
5127 .\" NS   doc-volume-name
5128 .
5129 .de doc-reset-reference
5130 .  while (\n[doc-author-count]) \{\
5131 .    ds doc-author-name\n[doc-author-count]
5132 .    nr doc-author-count -1
5133 .  \}
5134 .  nr doc-journal-count 0
5135 .  nr doc-issue-count 0
5136 .  nr doc-optional-count 0
5137 .  nr doc-corporate-count 0
5138 .  nr doc-report-count 0
5139 .  nr doc-reference-title-count 0
5140 .  nr doc-volume-count 0
5141 .  nr doc-date-count 0
5142 .  nr doc-page-number-count 0
5143 .  nr doc-book-count 0
5144 .
5145 .  ds doc-journal-name
5146 .  ds doc-issue-name
5147 .  ds doc-optional-string
5148 .  ds doc-corporate-name
5149 .  ds doc-report-name
5150 .  ds doc-reference-title-name
5151 .  ds doc-reference-title-name-for-book
5152 .  ds doc-volume-name
5153 .  ds doc-date
5154 .  ds doc-page-number-string
5155 .  ds doc-book-name
5156 ..
5157 .
5158 .
5159 .\" NS doc-finish-reference macro
5160 .\" NS   auxiliary macro for doc-print-reference
5161 .\" NS
5162 .\" NS modifies:
5163 .\" NS   doc-reference-count
5164 .
5165 .de doc-finish-reference
5166 .  nr doc-reference-count -1
5167 .  ie \n[doc-reference-count] \
5168 .    nop \),
5169 .  el \
5170 .    nop \).
5171 ..
5172 .
5173 .
5174 .\" NS doc-print-reference macro
5175 .\" NS   reference print
5176 .\" NS
5177 .\" NS modifies:
5178 .\" NS   doc-reference-count
5179 .
5180 .de doc-print-reference
5181 .
5182 .  nh
5183 .
5184 .  if \n[doc-author-count] \{\
5185 .    doc-print-reference-authors
5186 .    nr doc-reference-count -\n[doc-author-count]
5187 .  \}
5188 .
5189 .  if \n[doc-reference-title-count] \{\
5190 .    unformat doc-reference-title-name
5191 .    chop doc-reference-title-name
5192 .    unformat doc-reference-title-name-for-book
5193 .    chop doc-reference-title-name-for-book
5194 .    ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5195 .      nop \)\*[q]\)\*[doc-reference-title-name-for-book]\)\*[q]\c
5196 .      doc-finish-reference
5197 .    \}
5198 .    el \{\
5199 .      nop \*[doc-reference-title-name]\c
5200 .      doc-finish-reference
5201 .  \}\}
5202 .
5203 .  if \n[doc-book-count] \{\
5204 .    unformat doc-book-name
5205 .    chop doc-book-name
5206 .    nop \*[doc-book-name]\c
5207 .    doc-finish-reference
5208 .  \}
5209 .
5210 .  if \n[doc-publisher-count] \{\
5211 .    unformat doc-publisher-name
5212 .    chop doc-publisher-name
5213 .    nop \*[doc-publisher-name]\c
5214 .    doc-finish-reference
5215 .  \}
5216 .
5217 .  if \n[doc-journal-count] \{\
5218 .    unformat doc-journal-name
5219 .    chop doc-journal-name
5220 .    nop \*[doc-journal-name]\c
5221 .    doc-finish-reference
5222 .  \}
5223 .
5224 .  if \n[doc-report-count] \{\
5225 .    unformat doc-report-name
5226 .    chop doc-report-name
5227 .    nop \*[doc-report-name]\c
5228 .    doc-finish-reference
5229 .  \}
5230 .
5231 .  if \n[doc-issue-count] \{\
5232 .    unformat doc-issue-name
5233 .    chop doc-issue-name
5234 .    nop \*[doc-issue-name]\c
5235 .    doc-finish-reference
5236 .  \}
5237 .
5238 .  if \n[doc-volume-count] \{\
5239 .    unformat doc-volume-name
5240 .    chop doc-volume-name
5241 .    nop \*[doc-volume-name]\c
5242 .    doc-finish-reference
5243 .  \}
5244 .
5245 .  if \n[doc-page-number-count] \{\
5246 .    unformat doc-page-number-string
5247 .    chop doc-page-number-string
5248 .    nop \*[doc-page-number-string]\c
5249 .    doc-finish-reference
5250 .  \}
5251 .
5252 .  if \n[doc-corporate-count] \{\
5253 .    unformat doc-corporate-name
5254 .    chop doc-corporate-name
5255 .    nop \*[doc-corporate-name]\c
5256 .    doc-finish-reference
5257 .  \}
5258 .
5259 .  if \n[doc-date-count] \{\
5260 .    unformat doc-date
5261 .    chop doc-date
5262 .    nop \*[doc-date]\c
5263 .    doc-finish-reference
5264 .  \}
5265 .
5266 .  if \n[doc-optional-count] \{\
5267 .    unformat doc-optional-string
5268 .    chop doc-optional-string
5269 .    nop \*[doc-optional-string]\c
5270 .    doc-finish-reference
5271 .  \}
5272 .
5273 .  if \n[doc-reference-count] \
5274 .    tm mdoc warning: unresolved reference problem
5275 .
5276 .  hy \n[doc-hyphen-flags]
5277 ..
5278 .
5279 .
5280 .\" NS doc-print-reference-authors macro
5281 .\" NS   print out reference authors
5282 .\" NS
5283 .\" NS local variables:
5284 .\" NS   doc-reg-dpra
5285 .\" NS   doc-str-dpra
5286 .
5287 .ds doc-str-dpra "and
5288 .
5289 .de doc-print-reference-authors
5290 .  nr doc-reg-dpra 1
5291 .
5292 .  while (\n[doc-reg-dpra] < \n[doc-author-count]) \{\
5293 .    unformat doc-author-name\n[doc-reg-dpra]
5294 .    chop doc-author-name\n[doc-reg-dpra]
5295 .    ie (\n[doc-author-count] > 2) \
5296 .      nop \)\*[doc-author-name\n[doc-reg-dpra]],
5297 .    el \
5298 .      nop \)\*[doc-author-name\n[doc-reg-dpra]]
5299 .    nr doc-reg-dpra +1
5300 .  \}
5301 .
5302 .  unformat doc-author-name\n[doc-reg-dpra]
5303 .  chop doc-author-name\n[doc-reg-dpra]
5304 .  if (\n[doc-author-count] > 1) \
5305 .    nop \)\*[doc-str-dpra]
5306 .  nop \)\*[doc-author-name\n[doc-reg-dpra]],
5307 ..
5308 .
5309 .
5310 .\" NS doc-author-count global register
5311 .\" NS   counter of author references
5312 .
5313 .nr doc-author-count 0
5314 .
5315 .
5316 .\" NS doc-author-nameXXX global box
5317 .\" NS   array of author names
5318 .\" NS
5319 .\" NS limit:
5320 .\" NS   doc-author-count
5321 .
5322 .ds doc-author-name0
5323 .
5324 .
5325 .\" NS %A user macro
5326 .\" NS   reference author(s)
5327 .\" NS
5328 .\" NS modifies:
5329 .\" NS   doc-arg-ptr
5330 .\" NS   doc-author-count
5331 .\" NS   doc-curr-font
5332 .\" NS   doc-curr-size
5333 .\" NS   doc-macro-name
5334 .\" NS   doc-reference-count
5335 .\" NS
5336 .\" NS local variables:
5337 .\" NS   doc-env-%A
5338 .\" NS
5339 .\" NS width register `%A' set in doc-common
5340 .
5341 .de %A
5342 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5343 .    tm Usage: .%A author_name ... (#\n[.c])
5344 .    return
5345 .  \}
5346 .
5347 .  nr doc-author-count +1
5348 .  nr doc-reference-count +1
5349 .
5350 .  ds doc-macro-name %A
5351 .  doc-parse-args \$@
5352 .
5353 .  nr doc-arg-ptr +1
5354 .  nr doc-curr-font \n[.f]
5355 .  nr doc-curr-size \n[.ps]
5356 .
5357 .  \" save to reference box
5358 .  box doc-author-name\n[doc-author-count]
5359 .  ev doc-env-%A
5360 .  evc 0
5361 .  in 0
5362 .  nf
5363 .  doc-do-references
5364 ..
5365 .
5366 .
5367 .\" NS doc-book-count global register
5368 .\" NS   counter of book references
5369 .
5370 .nr doc-book-count 0
5371 .
5372 .
5373 .\" NS doc-book-name global box
5374 .\" NS   string of collected book references
5375 .
5376 .ds doc-book-name
5377 .
5378 .
5379 .\" NS %B user macro
5380 .\" NS   [reference] book name
5381 .\" NS
5382 .\" NS modifies:
5383 .\" NS   doc-arg-ptr
5384 .\" NS   doc-book-count
5385 .\" NS   doc-curr-font
5386 .\" NS   doc-curr-size
5387 .\" NS   doc-macro-name
5388 .\" NS   doc-reference-count
5389 .\" NS
5390 .\" NS local variables:
5391 .\" NS   doc-env-%B
5392 .\" NS
5393 .\" NS width register `%B' set in doc-common
5394 .
5395 .de %B
5396 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5397 .    tm Usage: .%B book_name ... (#\n[.c])
5398 .    return
5399 .  \}
5400 .
5401 .  if \n[doc-is-reference] \{\
5402 .    nr doc-book-count +1
5403 .    nr doc-reference-count +1
5404 .  \}
5405 .
5406 .  ds doc-macro-name %B
5407 .  doc-parse-args \$@
5408 .
5409 .  nr doc-arg-ptr +1
5410 .  nr doc-curr-font \n[.f]
5411 .  nr doc-curr-size \n[.ps]
5412 .
5413 .  ie \n[doc-is-reference] \{\
5414 .    \" append to reference box
5415 .    boxa doc-book-name
5416 .    ev doc-env-%B
5417 .    evc 0
5418 .    in 0
5419 .    nf
5420 .    nop \*[doc-Em-font]\c
5421 .    doc-do-references
5422 .  \}
5423 .  el \{\
5424 .    nop \*[doc-Em-font]\c
5425 .    doc-print-recursive
5426 .  \}
5427 ..
5428 .
5429 .
5430 .\" NS doc-date-count global register
5431 .\" NS   counter of date references
5432 .
5433 .nr doc-date-count 0
5434 .
5435 .
5436 .\" NS doc-date global box
5437 .\" NS   string of collected date references
5438 .
5439 .ds doc-date
5440 .
5441 .
5442 .\" NS %D user macro
5443 .\" NS   [reference] date
5444 .\" NS
5445 .\" NS modifies:
5446 .\" NS   doc-arg-ptr
5447 .\" NS   doc-curr-font
5448 .\" NS   doc-curr-size
5449 .\" NS   doc-date-count
5450 .\" NS   doc-macro-name
5451 .\" NS   doc-reference-count
5452 .\" NS
5453 .\" NS local variables:
5454 .\" NS   doc-env-%D
5455 .\" NS
5456 .\" NS width register `%D' set in doc-common
5457 .
5458 .de %D
5459 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5460 .    tm Usage: .%D date ... (#\n[.c])
5461 .    return
5462 .  \}
5463 .
5464 .  nr doc-date-count +1
5465 .  nr doc-reference-count +1
5466 .
5467 .  ds doc-macro-name %D
5468 .  doc-parse-args \$@
5469 .
5470 .  nr doc-arg-ptr +1
5471 .  nr doc-curr-font \n[.f]
5472 .  nr doc-curr-size \n[.ps]
5473 .
5474 .  \" append to reference box
5475 .  boxa doc-date
5476 .  ev doc-env-%D
5477 .  evc 0
5478 .  in 0
5479 .  nf
5480 .  doc-do-references
5481 ..
5482 .
5483 .
5484 .\" NS doc-publisher-count global register
5485 .\" NS   counter of publisher references
5486 .
5487 .nr doc-publisher-count 0
5488 .
5489 .
5490 .\" NS doc-publisher-name global box
5491 .\" NS   string of collected publisher references
5492 .
5493 .ds doc-publisher-name
5494 .
5495 .
5496 .\" NS %I user macro
5497 .\" NS   [reference] issuer/publisher name
5498 .\" NS
5499 .\" NS modifies:
5500 .\" NS   doc-arg-ptr
5501 .\" NS   doc-curr-font
5502 .\" NS   doc-curr-size
5503 .\" NS   doc-macro-name
5504 .\" NS   doc-publisher-count
5505 .\" NS   doc-reference-count
5506 .\" NS
5507 .\" NS local variables:
5508 .\" NS   doc-env-%I
5509 .\" NS
5510 .\" NS width register `%I' set in doc-common
5511 .
5512 .de %I
5513 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5514 .    tm Usage: .%I issuer/publisher_name ... (#\n[.c])
5515 .    return
5516 .  \}
5517 .
5518 .  nr doc-publisher-count +1
5519 .  nr doc-reference-count +1
5520 .
5521 .  ds doc-macro-name %I
5522 .  doc-parse-args \$@
5523 .
5524 .  nr doc-arg-ptr +1
5525 .  nr doc-curr-font \n[.f]
5526 .  nr doc-curr-size \n[.ps]
5527 .
5528 .  \" append to reference box
5529 .  boxa doc-publisher-name
5530 .  ev doc-env-%I
5531 .  evc 0
5532 .  in 0
5533 .  nf
5534 .  nop \*[doc-Em-font]\c
5535 .  doc-do-references
5536 ..
5537 .
5538 .
5539 .\" NS doc-journal-count global register
5540 .\" NS   counter of journal references
5541 .
5542 .nr doc-journal-count 0
5543 .
5544 .
5545 .\" NS doc-journal-name global box
5546 .\" NS   string of collected journal references
5547 .
5548 .ds doc-journal-name
5549 .
5550 .
5551 .\" NS %J user macro
5552 .\" NS   [reference] Journal Name
5553 .\" NS
5554 .\" NS modifies:
5555 .\" NS   doc-arg-ptr
5556 .\" NS   doc-curr-font
5557 .\" NS   doc-curr-size
5558 .\" NS   doc-journal-count
5559 .\" NS   doc-macro-name
5560 .\" NS   doc-reference-count
5561 .\" NS
5562 .\" NS local variables:
5563 .\" NS   doc-env-%J
5564 .\" NS
5565 .\" NS width register `%J' set in doc-common
5566 .
5567 .de %J
5568 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5569 .    tm Usage: .%J journal_name ... (#\n[.c])
5570 .    return
5571 .  \}
5572 .
5573 .  nr doc-journal-count +1
5574 .  nr doc-reference-count +1
5575 .
5576 .  ds doc-macro-name %J
5577 .  doc-parse-args \$@
5578 .
5579 .  nr doc-arg-ptr +1
5580 .  nr doc-curr-font \n[.f]
5581 .  nr doc-curr-size \n[.ps]
5582 .
5583 .  \" append to reference box
5584 .  boxa doc-journal-name
5585 .  ev doc-env-%J
5586 .  evc 0
5587 .  in 0
5588 .  nf
5589 .  nop \*[doc-Em-font]\c
5590 .  doc-do-references
5591 ..
5592 .
5593 .
5594 .\" NS doc-issue-count global register
5595 .\" NS   counter of issue number references
5596 .
5597 .nr doc-issue-count 0
5598 .
5599 .
5600 .\" NS doc-issue-name global box
5601 .\" NS   string of collected issue number references
5602 .
5603 .ds doc-issue-name
5604 .
5605 .
5606 .\" NS %N user macro
5607 .\" NS   [reference] issue number
5608 .\" NS
5609 .\" NS modifies:
5610 .\" NS   doc-arg-ptr
5611 .\" NS   doc-curr-font
5612 .\" NS   doc-curr-size
5613 .\" NS   doc-issue-count
5614 .\" NS   doc-macro-name
5615 .\" NS   doc-reference-count
5616 .\" NS
5617 .\" NS local variables:
5618 .\" NS   doc-env-%N
5619 .\" NS
5620 .\" NS width register `%N' set in doc-common
5621 .
5622 .de %N
5623 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5624 .    tm Usage: .%N issue_number ... (#\n[.c])
5625 .    return
5626 .  \}
5627 .
5628 .  nr doc-issue-count +1
5629 .  nr doc-reference-count +1
5630 .
5631 .  ds doc-macro-name %N
5632 .  doc-parse-args \$@
5633 .
5634 .  nr doc-arg-ptr +1
5635 .  nr doc-curr-font \n[.f]
5636 .  nr doc-curr-size \n[.ps]
5637 .
5638 .  \" append to reference box
5639 .  boxa doc-issue-name
5640 .  ev doc-env-%N
5641 .  evc 0
5642 .  in 0
5643 .  nf
5644 .  doc-do-references
5645 ..
5646 .
5647 .
5648 .\" NS doc-optional-count global register
5649 .\" NS   counter of optional information references
5650 .
5651 .nr doc-optional-count 0
5652 .
5653 .
5654 .\" NS doc-optional-string global box
5655 .\" NS   string of collected optional information references
5656 .
5657 .ds doc-optional-string
5658 .
5659 .
5660 .\" NS %O user macro
5661 .\" NS   [reference] optional information
5662 .\" NS
5663 .\" NS modifies:
5664 .\" NS   doc-arg-ptr
5665 .\" NS   doc-curr-font
5666 .\" NS   doc-curr-size
5667 .\" NS   doc-macro-name
5668 .\" NS   doc-optional-count
5669 .\" NS   doc-reference-count
5670 .\" NS
5671 .\" NS local variables:
5672 .\" NS   doc-env-%O
5673 .\" NS
5674 .\" NS width register `%O' set in doc-common
5675 .
5676 .de %O
5677 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5678 .    tm Usage: .%O optional_information ... (#\n[.c])
5679 .    return
5680 .  \}
5681 .
5682 .  nr doc-optional-count +1
5683 .  nr doc-reference-count +1
5684 .
5685 .  ds doc-macro-name %O
5686 .  doc-parse-args \$@
5687 .
5688 .  nr doc-arg-ptr +1
5689 .  nr doc-curr-font \n[.f]
5690 .  nr doc-curr-size \n[.ps]
5691 .
5692 .  \" append to reference box
5693 .  boxa doc-optional-string
5694 .  ev doc-env-%O
5695 .  evc 0
5696 .  in 0
5697 .  nf
5698 .  doc-do-references
5699 ..
5700 .
5701 .
5702 .\" NS doc-page-number-count global register
5703 .\" NS   counter of page number references
5704 .
5705 .nr doc-page-number-count 0
5706 .
5707 .
5708 .\" NS doc-page-number-string global box
5709 .\" NS   string of collected page number references
5710 .
5711 .ds doc-page-number-string
5712 .
5713 .
5714 .\" NS %P user macro
5715 .\" NS   [reference] page numbers
5716 .\" NS
5717 .\" NS modifies:
5718 .\" NS   doc-arg-ptr
5719 .\" NS   doc-curr-font
5720 .\" NS   doc-curr-size
5721 .\" NS   doc-macro-name
5722 .\" NS   doc-page-number-count
5723 .\" NS   doc-reference-count
5724 .\" NS
5725 .\" NS local variables:
5726 .\" NS   doc-env-%P
5727 .\" NS
5728 .\" NS width register `%P' set in doc-common
5729 .
5730 .de %P
5731 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5732 .    tm Usage: .%P page_number ... (#\n[.c])
5733 .    return
5734 .  \}
5735 .
5736 .  nr doc-page-number-count +1
5737 .  nr doc-reference-count +1
5738 .
5739 .  ds doc-macro-name %P
5740 .  doc-parse-args \$@
5741 .
5742 .  nr doc-arg-ptr +1
5743 .  nr doc-curr-font \n[.f]
5744 .  nr doc-curr-size \n[.ps]
5745 .
5746 .  \" append to reference box
5747 .  boxa doc-page-number-string
5748 .  ev doc-env-%P
5749 .  evc 0
5750 .  in 0
5751 .  nf
5752 .  doc-do-references
5753 ..
5754 .
5755 .
5756 .\" NS doc-corporate-count global register
5757 .\" NS   counter of corporate references
5758 .
5759 .nr doc-corporate-count 0
5760 .
5761 .
5762 .\" NS doc-corporate-name global box
5763 .\" NS   string of collected corporate references
5764 .
5765 .ds doc-corporate-name
5766 .
5767 .
5768 .\" NS %Q user macro
5769 .\" NS   corporate or foreign author
5770 .\" NS
5771 .\" NS modifies:
5772 .\" NS   doc-arg-ptr
5773 .\" NS   doc-corporate-count
5774 .\" NS   doc-curr-font
5775 .\" NS   doc-curr-size
5776 .\" NS   doc-macro-name
5777 .\" NS   doc-reference-count
5778 .\" NS
5779 .\" NS local variables:
5780 .\" NS   doc-env-%Q
5781 .\" NS
5782 .\" NS width register `%Q' set in doc-common
5783 .
5784 .de %Q
5785 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5786 .    tm Usage: .%Q corporate_or_foreign_author ... (#\n[.c])
5787 .    return
5788 .  \}
5789 .
5790 .  nr doc-corporate-count +1
5791 .  nr doc-reference-count +1
5792 .
5793 .  ds doc-macro-name %Q
5794 .  doc-parse-args \$@
5795 .
5796 .  nr doc-arg-ptr +1
5797 .  nr doc-curr-font \n[.f]
5798 .  nr doc-curr-size \n[.ps]
5799 .
5800 .  \" append to reference box
5801 .  boxa doc-corporate-name
5802 .  ev doc-env-%Q
5803 .  evc 0
5804 .  in 0
5805 .  nf
5806 .  doc-do-references
5807 ..
5808 .
5809 .
5810 .\" NS doc-report-count global register
5811 .\" NS   counter of report references
5812 .
5813 .nr doc-report-count 0
5814 .
5815 .
5816 .\" NS doc-report-name global box
5817 .\" NS   string of collected report references
5818 .
5819 .ds doc-report-name
5820 .
5821 .
5822 .\" NS %R user macro
5823 .\" NS   [reference] report name
5824 .\" NS
5825 .\" NS modifies:
5826 .\" NS   doc-arg-ptr
5827 .\" NS   doc-curr-font
5828 .\" NS   doc-curr-size
5829 .\" NS   doc-macro-name
5830 .\" NS   doc-reference-count
5831 .\" NS   doc-report-count
5832 .\" NS
5833 .\" NS local variables:
5834 .\" NS   doc-env-%R
5835 .\" NS
5836 .\" NS width register `%R' set in doc-common
5837 .
5838 .de %R
5839 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5840 .    tm Usage: .%R reference_report ... (#\n[.c])
5841 .    return
5842 .  \}
5843 .
5844 .  nr doc-report-count +1
5845 .  nr doc-reference-count +1
5846 .
5847 .  ds doc-macro-name %R
5848 .  doc-parse-args \$@
5849 .
5850 .  nr doc-arg-ptr +1
5851 .  nr doc-curr-font \n[.f]
5852 .  nr doc-curr-size \n[.ps]
5853 .
5854 .  \" append to reference box
5855 .  boxa doc-report-name
5856 .  ev doc-env-%R
5857 .  evc 0
5858 .  in 0
5859 .  nf
5860 .  doc-do-references
5861 ..
5862 .
5863 .
5864 .\" NS doc-reference-title-count global register
5865 .\" NS   counter of reference title references
5866 .
5867 .nr doc-reference-title-count 0
5868 .
5869 .
5870 .\" NS doc-reference-title-name global box
5871 .\" NS   string of collected reference title references
5872 .
5873 .ds doc-reference-title-name
5874 .
5875 .
5876 .\" NS doc-reference-title-name-for-book global box
5877 .\" NS   string of collected reference title references
5878 .\" NS   (saved with another font; this is a shortcoming of groff)
5879 .
5880 .ds doc-reference-title-name-for-book
5881 .
5882 .
5883 .\" NS %T user macro
5884 .\" NS   reference title
5885 .\" NS
5886 .\" NS modifies:
5887 .\" NS   doc-arg-ptr
5888 .\" NS   doc-curr-font
5889 .\" NS   doc-curr-size
5890 .\" NS   doc-macro-name
5891 .\" NS   doc-reference-title-count
5892 .\" NS   doc-report-count
5893 .\" NS
5894 .\" NS local variables:
5895 .\" NS   doc-env-%T
5896 .\" NS
5897 .\" NS width register `%T' set in doc-common
5898 .
5899 .de %T
5900 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5901 .    tm Usage: .%T reference_title ... (#\n[.c])
5902 .    return
5903 .  \}
5904 .
5905 .  if \n[doc-is-reference] \{\
5906 .    nr doc-reference-title-count +1
5907 .    nr doc-reference-count +1
5908 .  \}
5909 .
5910 .  ds doc-macro-name %T
5911 .  doc-parse-args \$@
5912 .
5913 .  nr doc-arg-ptr +1
5914 .  nr doc-curr-font \n[.f]
5915 .  nr doc-curr-size \n[.ps]
5916 .  ie \n[doc-is-reference] \{\
5917 .    \" append to reference box
5918 .    boxa doc-reference-title-name-for-book
5919 .    ev doc-env-%T
5920 .    evc 0
5921 .    in 0
5922 .    nf
5923 .    nop \*[doc-No-font]\c
5924 .    doc-do-references
5925 .
5926 .    \" do it a second time with another font
5927 .    ds doc-macro-name %T
5928 .    doc-parse-args \$@
5929 .
5930 .    nr doc-arg-ptr +1
5931 .    nr doc-curr-font \n[.f]
5932 .    nr doc-curr-size \n[.ps]
5933 .    boxa doc-reference-title-name
5934 .    ev doc-env-%T
5935 .    evc 0
5936 .    in 0
5937 .    nf
5938 .    nop \*[doc-Em-font]\c
5939 .    doc-do-references
5940 .  \}
5941 .  el \{\
5942 .    nop \*[doc-Em-font]\c
5943 .    doc-print-recursive
5944 .  \}
5945 ..
5946 .
5947 .
5948 .\" NS doc-volume-count global register
5949 .\" NS   counter of reference title references
5950 .
5951 .nr doc-volume-count 0
5952 .
5953 .
5954 .\" NS doc-volume-name global box
5955 .\" NS   string of collected volume references
5956 .
5957 .ds doc-volume-name
5958 .
5959 .
5960 .\" NS %V user macro
5961 .\" NS   reference volume
5962 .\" NS
5963 .\" NS modifies:
5964 .\" NS   doc-arg-ptr
5965 .\" NS   doc-curr-font
5966 .\" NS   doc-curr-size
5967 .\" NS   doc-macro-name
5968 .\" NS   doc-reference-title-count
5969 .\" NS   doc-volume-count
5970 .\" NS
5971 .\" NS local variables:
5972 .\" NS   doc-env-%V
5973 .\" NS
5974 .\" NS width register `%V' set in doc-common
5975 .
5976 .de %V
5977 .  if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
5978 .    tm Usage: .%V volume ... (#\n[.c])
5979 .    return
5980 .  \}
5981 .
5982 .  nr doc-volume-count +1
5983 .  nr doc-reference-count +1
5984 .
5985 .  ds doc-macro-name %V
5986 .  doc-parse-args \$@
5987 .
5988 .  nr doc-arg-ptr +1
5989 .  nr doc-curr-font \n[.f]
5990 .  nr doc-curr-size \n[.ps]
5991 .
5992 .  \" append to reference box
5993 .  boxa doc-volume-name
5994 .  ev doc-env-%V
5995 .  evc 0
5996 .  in 0
5997 .  nf
5998 .  doc-do-references
5999 ..
6000 .
6001 .
6002 .\" NS doc-do-references macro
6003 .\" NS   reference recursion routine
6004 .\" NS
6005 .\" NS modifies:
6006 .\" NS   doc-arg-ptr
6007 .\" NS
6008 .\" NS local variables:
6009 .\" NS   doc-reg-ddr
6010 .\" NS   doc-reg-ddr1
6011 .
6012 .de doc-do-references
6013 .  if !\n[doc-is-reference] \
6014 .    tm mdoc error: .\*[doc-macro-name] found outside of .Rs ... .Re (#\n[.c])
6015 .
6016 .  nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
6017 .
6018 .  ie (\n[doc-reg-ddr1] == 1) \{\
6019 .    \" .nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
6020 .    doc-append-arg \c 3
6021 .    \*[doc-arg\n[doc-arg-ptr]]
6022 .  \}
6023 .  el \{\
6024 .    nop \)\*[doc-arg\n[doc-arg-ptr]]\c
6025 .
6026 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
6027 .      \" finish reference box
6028 .      br
6029 .      ev
6030 .      boxa
6031 .
6032 .      doc-reset-args
6033 .    \}
6034 .    el \{\
6035 .      nr doc-reg-ddr \n[doc-arg-ptr]
6036 .      nr doc-arg-ptr +1
6037 .      nop \)\*[doc-space\n[doc-reg-ddr]]\c
6038 .      doc-do-references
6039 .  \}\}
6040 ..
6041 .
6042 .
6043 .\" NS Hf user macro
6044 .\" NS   source include header files.
6045 .\" NS
6046 .\" NS modifies:
6047 .\" NS   doc-curr-font
6048 .\" NS   doc-curr-size
6049 .\" NS
6050 .\" NS width register `Hf' set in doc-common
6051 .
6052 .de Hf
6053 .  ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
6054 .    doc-paragraph
6055 .    nop File:
6056 .    Pa \$1
6057 .
6058 .    Bd -literal
6059 .    so \$1
6060 .    Ed
6061 .
6062 .    doc-paragraph
6063 .  \}
6064 .  el \
6065 .    Usage: .Hf file (#\n[.c])
6066 ..
6067 .
6068 .
6069 .\" NS doc-have-author global register (bool)
6070 .\" NS   set in `An'
6071 .
6072 .nr doc-have-author 0
6073 .
6074 .
6075 .\" NS An user macro
6076 .\" NS   author name
6077 .\" NS
6078 .\" NS modifies:
6079 .\" NS   doc-arg-ptr
6080 .\" NS   doc-curr-font
6081 .\" NS   doc-curr-size
6082 .\" NS   doc-have-author
6083 .\" NS   doc-macro-name
6084 .\" NS
6085 .\" NS width register `An' set in doc-common
6086 .
6087 .de An
6088 .  if !\n[doc-arg-limit] \{\
6089 .    ie \n[.$] \{\
6090 .      ie        "\$1"-nosplit" \
6091 .        nr doc-in-authors-section 0
6092 .      el \{ .ie "\$1"-split" \
6093 .        nr doc-in-authors-section 1
6094 .      el \{\
6095 .        ds doc-macro-name An
6096 .        doc-parse-args \$@
6097 .    \}\}\}
6098 .    el \{\
6099 .      tm1 "Usage: .An {-nosplit | -split}
6100 .      tm1         .An author_name ... (#\n[.c])
6101 .  \}\}
6102 .
6103 .  if \n[doc-in-authors-section] \{\
6104 .    ie \n[doc-have-author] \
6105 .      br
6106 .    el \
6107 .      nr doc-have-author 1
6108 .  \}
6109 .
6110 .  if \n[doc-arg-limit] \{\
6111 .    nr doc-arg-ptr +1
6112 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
6113 .      nr doc-curr-font \n[.f]
6114 .      nr doc-curr-size \n[.ps]
6115 .      doc-print-recursive
6116 .    \}
6117 .    el \{\
6118 .      tm Usage: .An author_name ... (#\n[.c])
6119 .      doc-reset-args
6120 .  \}\}
6121 ..
6122 .
6123 .
6124 .\" NS Rv user macro
6125 .\" NS   return values
6126 .\" NS
6127 .\" NS width register `Rv' set in doc-common
6128 .\" NS
6129 .\" NS local variables:
6130 .\" NS   doc-str-Rv-std-prefix
6131 .\" NS   doc-str-Rv-std-suffix
6132 .\" NS   doc-str-Rv-stds-prefix
6133 .\" NS   doc-str-Rv-stds-and
6134 .\" NS   doc-str-Rv-stds-suffix
6135 .\" NS   doc-str-Rv-std0
6136 .
6137 .ds doc-str-Rv-std-prefix "The
6138 .ds doc-str-Rv-std-suffix "function returns the value\~0 if successful;
6139 .as doc-str-Rv-std-suffix " otherwise the value\~-1 is returned and
6140 .as doc-str-Rv-std-suffix " the global variable \*[doc-Va-font]errno\f[]
6141 .as doc-str-Rv-std-suffix " is set to indicate the error.
6142 .
6143 .ds doc-str-Rv-stds-prefix "The
6144 .ds doc-str-Rv-stds-and    "and
6145 .ds doc-str-Rv-stds-suffix "functions return the value\~0 if successful;
6146 .as doc-str-Rv-stds-suffix " otherwise the value\~-1 is returned and
6147 .as doc-str-Rv-stds-suffix " the global variable \*[doc-Va-font]errno\f[]
6148 .as doc-str-Rv-stds-suffix " is set to indicate the error.
6149 .
6150 .ds doc-str-Rv-std0 "Upon successful completion, the value\~0 is returned;
6151 .as doc-str-Rv-std0 " otherwise the value\~-1 is returned and
6152 .as doc-str-Rv-std0 " the global variable \*[doc-Va-font]errno\f[]
6153 .as doc-str-Rv-std0 " is set to indicate the error.
6154 .
6155 .de Rv
6156 .
6157 .\" XXX: what does this function without `-std'?
6158 .
6159 .  if \n[doc-arg-limit] \{\
6160 .    tm Usage: .Rv not callable by other macros (#\n[.c])
6161 .    doc-reset-args
6162 .    return
6163 .  \}
6164 .
6165 .  if !\n[.$] \{\
6166 .    tm Usage: .Rv [-std] [<function> ...] (#\n[.c])
6167 .    return
6168 .  \}
6169 .
6170 .  if "\$1"-std" \{\
6171 .    nr doc-reg-Rv \*[doc-section]
6172 .    if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
6173 .      tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
6174 .    br
6175 .    shift
6176 .    ie (\n[.$] > 1) \{\
6177 .      nop \)\*[doc-str-Rv-stds-prefix]
6178 .      nr doc-reg-Rv 1
6179 .      while (\n[doc-reg-Rv] < \n[.$]) \{\
6180 .        ie (\n[.$] > 2) \
6181 .          Fn \$\n[doc-reg-Rv] ,
6182 .        el \
6183 .          Fn \$\n[doc-reg-Rv]
6184 .        nr doc-reg-Rv +1
6185 .      \}
6186 .      nop \)\*[doc-str-Rv-stds-and]
6187 .      Fn \$\n[.$]
6188 .      nop \)\*[doc-str-Rv-stds-suffix]
6189 .    \}
6190 .    el \{ .ie (\n[.$] == 1) \{\
6191 .      nop \)\*[doc-str-Rv-std-prefix]
6192 .      Fn \$1
6193 .      nop \)\*[doc-str-Rv-std-suffix]
6194 .    \}
6195 .    el \{\
6196 .      nop \)\*[doc-str-Rv-std0]
6197 .  \}\}\}
6198 ..
6199 .
6200 .
6201 .\" NS Ex user macro
6202 .\" NS   exit status
6203 .\" NS
6204 .\" NS width register `Ex' set in doc-common
6205 .\" NS
6206 .\" NS local variables:
6207 .\" NS   doc-str-Ex-std-prefix
6208 .\" NS   doc-str-Ex-std-suffix
6209 .
6210 .ds doc-str-Ex-std-prefix "The
6211 .ds doc-str-Ex-std-suffix "utility exits\~0 on success,
6212 .as doc-str-Ex-std-suffix " and\~>0 if an error occurs.
6213 .
6214 .ds doc-str-Ex-stds-prefix "The
6215 .als doc-str-Ex-stds-and doc-str-Rv-stds-and
6216 .ds doc-str-Ex-stds-suffix "utilities exit\~0 on success,
6217 .as doc-str-Ex-stds-suffix " and\~>0 if an error occurs.
6218 .
6219 .de Ex
6220 .
6221 .\" XXX: what does this function without `-std'?
6222 .
6223 .  if \n[doc-arg-limit] \{\
6224 .    tm Usage: .Ex not callable by other macros (#\n[.c])
6225 .    doc-reset-args
6226 .    return
6227 .  \}
6228 .
6229 .  if !\n[.$] \{\
6230 .    tm Usage: .Ex [-std] [<utility> ...] (#\n[.c])
6231 .    return
6232 .  \}
6233 .
6234 .  if "\$1"-std" \{\
6235 .    nr doc-reg-Ex \*[doc-section]
6236 .    if !((\n[doc-reg-Ex] == 1) : (\n[doc-reg-Ex] == 6) : (\n[doc-reg-Ex] == 8)) \
6237 .      tm Usage: .Ex -std in sections 1, 6 and 8 only (#\n[.c])
6238 .    br
6239 .    shift
6240 .    ie (\n[.$] > 1) \{\
6241 .      nop \)\*[doc-str-Ex-stds-prefix]
6242 .      nr doc-reg-Ex 1
6243 .      while (\n[doc-reg-Ex] < \n[.$]) \{\
6244 .        ie (\n[.$] > 2) \
6245 .          Nm \$\n[doc-reg-Ex] ,
6246 .        el \
6247 .          Nm \$\n[doc-reg-Ex]
6248 .        nr doc-reg-Ex +1
6249 .      \}
6250 .      nop \)\*[doc-str-Ex-stds-and]
6251 .      Nm \$\n[.$]
6252 .      nop \)\*[doc-str-Ex-stds-suffix]
6253 .    \}
6254 .    el \{\
6255 .      nop \)\*[doc-str-Ex-std-prefix]
6256 .      Nm \$1
6257 .      nop \)\*[doc-str-Ex-std-suffix]
6258 .  \}\}
6259 ..
6260 .
6261 .
6262 .\" NS Mt user macro
6263 .\" NS   mailto (for conversion to HTML)
6264 .
6265 .de Mt
6266 .  \" XXX: error handling missing
6267 .  Pa \$@
6268 ..
6269 .
6270 .
6271 .\" NS Lk user macro
6272 .\" NS   link (for conversion to HTML)
6273 .\" NS
6274 .\" NS local variables:
6275 .\" NS   doc-reg-Lk
6276 .\" NS   doc-str-Lk
6277 .
6278 .de Lk
6279 .  ds doc-str-Lk Sy \$@
6280 .
6281 .  ie (\n[.$] > 1) \{\
6282 .    doc-get-arg-type \$2
6283 .    ie (\n[doc-arg-type] < 3) \{\
6284 .      Em \)\$2:
6285 .      ds doc-str-Lk Sy "\$1"
6286 .      doc-get-width "\$1"
6287 .      shift 2
6288 .      if \n[.$] \
6289 .        as doc-str-Lk " \$@
6290 .    \}
6291 .    el \
6292 .      doc-get-width "\$1"
6293 .  \}
6294 .  el \
6295 .    doc-get-width "\$1"
6296 .
6297 .  ie n \
6298 .    nr doc-reg-Lk 26
6299 .  el \
6300 .    nr doc-reg-Lk 38
6301 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
6302 .    D1 \*[doc-str-Lk]
6303 .  el \
6304 .    \*[doc-str-Lk]
6305 ..
6306 .
6307 .
6308 .\" NS doc-defunct-macro macro
6309 .\" NS   this is the skeleton for defunct macros
6310 .\" NS
6311 .
6312 .de doc-defunct-macro
6313 .  tmc mdoc error: .\$0 defunct
6314 .  if d doc-\$0-usage \
6315 .    tmc , \*[doc-\$0-usage]
6316 .  tm1 " (#\n[.c])
6317 ..
6318 .
6319 .
6320 .\" obsolete macros
6321 .
6322 .als Db doc-defunct-macro
6323 .
6324 .als Ds doc-defunct-macro
6325 .
6326 .als Or doc-defunct-macro
6327 .ds doc-Or-usage use `|'
6328 .
6329 .als Sf doc-defunct-macro
6330 .ds doc-Sf-usage use .Pf or .Ns
6331 .
6332 .
6333 .rn em e@
6334 .
6335 .de em
6336 .  tm1 "mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
6337 .  tm1 "            Should this have been `.Em ...'?
6338 .  ab
6339 ..
6340 .
6341 .
6342 .\" NS doc-empty-line macro
6343 .\" NS   emit warning and print empty line
6344 .
6345 .de doc-empty-line
6346 .  if !\n[doc-display-depth] \
6347 .    tm mdoc warning: Empty input line #\n[.c]
6348 .  sp
6349 ..
6350 .
6351 .blm doc-empty-line
6352 .
6353 .
6354 .ec
6355 .
6356 .
6357 .\" load local modifications
6358 .mso mdoc.local
6359 .
6360 .\" EOF