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