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