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