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