internal update
[s-roff.git] / tmac / tmac.doc.new
blobf5bf6c96f9e95ac009e41ab1552c894792f210ec
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 wl@gnu.org to make it more readable: using long names and
40 .\" many groff features, updating and extending documentation.
41 .\"
42 .\" %beginstrip%
45 .if !\n(.g \
46 .  ab This version of mdoc can be run with groff only!
49 .cp 0
51 .eo
54 .\" Load start-up files
55 .ie t .mso mdoc/doc-ditroff.new
56 .el   .mso mdoc/doc-nroff.new
58 .mso mdoc/doc-common.new
59 .mso mdoc/doc-syms.new
62 .\" NS doc-inline-debug user register (bool)
63 .\" NS   inline debug mode (inline if 1, to stderr if 0 (default))
65 .if !r doc-inline-debug .nr doc-inline-debug 0
68 .\" NS doc-debug global register (bool)
69 .\" NS   debug mode (1 if active, 0 otherwise (default))
71 .nr doc-debug 0
74 .\" NS Db macro
75 .\" NS   start/stop debug mode (`.Db'/`.Db on'/`.Db off')
76 .\" NS
77 .\" NS   without argument, toggle debug status
78 .\" NS
79 .\" NS modifies:
80 .\" NS   doc-debug
82 .de Db
83 .  ie \n[.$] \{\
84 .    ie "\$1"on" \{\
85 .      tm DEBUGGING ON
86 .      nr doc-debug 1
87 .    \}
88 .    el \{\
89 .      ie "\$1"off" \{\
90 .        tm DEBUGGING OFF
91 .        nr doc-debug 0
92 .      \}
93 .      el \
94 .        tm Usage: .Db [on | off] (#\n[.c])
95 .  \}\}
96 .  el \{\
97 .    ie \n[doc-debug] \{\
98 .      tm DEBUGGING OFF
99 .      nr doc-debug 0
100 .    \}
101 .    el \{\
102 .      tm DEBUGGING ON
103 .      nr doc-debug 1
104 .  \}\}
108 .\" NS doc-macro-name global string
109 .\" NS   name of calling request (set in each user-requestable macro)
111 .ds doc-macro-name
114 .\" NS doc-arg-limit global register
115 .\" NS   total number of arguments
117 .nr doc-arg-limit 0
120 .\" NS doc-num-args global register
121 .\" NS   number of arguments to handle (must be set to \n[.$] prior to
122 .\" NS   `doc-parse-arg-vector' request)
124 .nr doc-num-args 0
127 .\" NS doc-arg-ptr global register
128 .\" NS   argument pointer
130 .nr doc-arg-ptr 0
133 .\" NS doc-argXXX global string
134 .\" NS   argument vector
135 .\" NS
136 .\" NS   limit: doc-arg-limit
138 .ds doc-arg1
141 .\" NS doc-typeXXX global register
142 .\" NS   argument type vector (macro=1, string=2, punctuation suffix=3,
143 .\" NS   punctuation prefix=4)
144 .\" NS
145 .\" NS   limit: doc-arg-limit
147 .nr doc-type1 0
150 .\" NS doc-spaceXXX global string
151 .\" NS   space vector
152 .\" NS
153 .\" NS   limit: doc-arg-limit
155 .ds doc-space1
158 .\" NS doc-out-string global string
159 .\" NS   main working buffer
161 .ds doc-out-string
164 .\" NS doc-curr-space global string
165 .\" NS   current space string
167 .ds doc-curr-space
170 .\" NS doc-no-space global register (bool)
171 .\" NS   whether no space shall be inserted
173 .nr doc-no-space 0
176 .\" NS doc-parse-args macro
177 .\" NS   parse arguments (recursively) (`.doc-parse-args arg ...')
178 .\" NS
179 .\" NS modifies:
180 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX, doc-arg-limit,
181 .\" NS   doc-arg-ptr, doc-out-string, doc-curr-space
182 .\" NS
183 .\" NS local variables:
184 .\" NS   doc-str-dpa, doc-reg-dpa, doc-reg-dpa1
186 .de doc-parse-args
187 .  nr doc-arg-limit +1
189 .  \" handle `|' specially
190 .  ie "\$1"|" \
191 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
192 .  el \
193 .    ds doc-arg\n[doc-arg-limit] "\$1
195 .  \" get argument type and set spacing
196 .  doc-get-arg-type* \n[doc-arg-limit]
197 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
198 .  doc-set-spacing-\n[doc-arg-type]
200 .  if \n[doc-debug] \{\
201 .    ie (\n[doc-arg-type] == 1) \
202 .      ds doc-str-dpa macro
203 .    el \{\
204 .      ie (\n[doc-arg-type] == 2) \
205 .        ds doc-str-dpa string
206 .      el \{\
207 .        ie (\n[doc-arg-type] == 3) \
208 .          ds doc-str-dpa closing punctuation or suffix
209 .        el \
210 .          ds doc-str-dpa opening punctuation or prefix
211 .    \}\}
213 .    ie \n[doc-inline-debug] \{\
214 .      br
215 .      nr doc-reg-dpa \n[.i]u
216 .      in -\n[doc-reg-dpa]u
218 .      if (\n[doc-arg-limit] == 1) \{\
219 .        nop \f[B]DEBUG(doc-parse-args) MACRO:\f[P] `.\*[doc-macro-name]'
220 .        nop \& \f[B]Line #:\f[P] \n[.c]
221 .      \}
222 .      nop \t\f[B]Argc:\f[P] \n[doc-arg-limit]
223 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-arg-limit]]'
224 .      nop \ \f[B]Length:\f[P] \n[doc-width]
225 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-arg-limit]]'
226 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpa]
227 .    \}
228 .    el \{\
229 .      if (\n[doc-arg-limit] == 1) \{\
230 .        tmc "DEBUG (doc-parse-args)
231 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
232 .      \}
233 .      tmc "  Argc: \n[doc-arg-limit]
234 .      tmc "  Argv: `\*[doc-arg\n[doc-arg-limit]]'
235 .      tm1 "  Length: \n[doc-width]
236 .      tmc "  Space: `\*[doc-space\n[doc-arg-limit]]'
237 .      tm1 "  Type: \*[doc-str-dpa]
238 .  \}\}
240 .  \" check whether we have processed the last parameter
241 .  ie (\n[.$] == 1) \{\
242 .    nr doc-arg-ptr 0
244 .    \" Usually, an mdoc macro will call `doc-print-out-string' to print
245 .    \" `doc-out-string'.  This causes the insertion of a space since
246 .    \" `.nop' is used.  But if we are in an enclosure, no printing occurs
247 .    \" until we have left the outermost enclosure (i.e.,
248 .    \" `doc-nesting-level' is zero again), so spaces must be explicitly
249 .    \" inserted -- if we are neither in an diversion nor `doc-no-space'
250 .    \" is set.  The latter is active for a closing/closing or
251 .    \" opening/opening request.
252 .    if \n[doc-nesting-level] \
253 .      if !\n[doc-in-diversion] \
254 .        if !\n[doc-func-arg-count] \
255 .          if !\n[doc-no-space] \
256 .            as doc-out-string "\*[doc-curr-space]
258 .    nr doc-no-space 0
259 .    nr doc-is-opening 0
261 .    \" use space after last parameter as the current one
262 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
264 .    if \n[doc-debug] \{\
265 .      nr doc-reg-dpa1 1
267 .      ie \n[doc-inline-debug] \{\
268 .        nop MACRO REQUEST: \t.\*[doc-macro-name]
269 .        while (\n[doc-reg-dpa1] <= \n[doc-arg-limit]) \{\
270 .          nop "\*[doc-arg\n[doc-reg-dpa1]]"
271 .          nr doc-reg-dpa1 +1
272 .        \}
273 .        br
274 .        in \n[doc-reg-dpa]u
275 .      \}
276 .      el \{\
277 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
278 .        while (\n[doc-reg-dpa1] <= \n[doc-arg-limit]) \{\
279 .          tmc " "\*[doc-arg\n[doc-reg-dpa1]]"
280 .          nr doc-reg-dpa1 +1
281 .        \}
282 .        tm
283 .  \}\}\}
284 .  el \{\
285 .    shift
286 .    doc-parse-args \$@
287 .  \}
291 .\" NS doc-parse-arg-vector macro
292 .\" NS   parse argument vector (recursive)
293 .\" NS
294 .\" NS   cf. comments in doc-parse-args
295 .\" NS
296 .\" NS modifies:
297 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX, doc-arg-limit,
298 .\" NS   doc-num-args, doc-arg-ptr, doc-out-string, doc-curr-space
299 .\" NS
300 .\" NS local variables:
301 .\" NS   doc-str-dpav, doc-reg-dpav, doc-reg-dpav1
303 .de doc-parse-arg-vector
304 .  nr doc-arg-limit +1
306 .  if "\*[doc-arg\n[doc-arg-limit]]"|" \
307 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
309 .  doc-get-arg-type* \n[doc-arg-limit]
310 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
311 .  doc-set-spacing-\n[doc-arg-type]
313 .  if \n[doc-debug] \{\
314 .    ie (\n[doc-arg-type] == 1) \
315 .      ds doc-str-dpav macro
316 .    el \{\
317 .      ie (\n[doc-arg-type] == 2) \
318 .        ds doc-str-dpav string
319 .      el \{\
320 .        ie (\n[doc-arg-type] == 3) \
321 .          ds doc-str-dpav closing punctuation or suffix
322 .        el \
323 .          ds doc-str-dpav opening punctuation or prefix
324 .    \}\}
326 .    ie \n[doc-inline-debug] \{\
327 .      br
328 .      nr doc-reg-dpav \n[.i]u
329 .      in -\n[doc-reg-dpav]u
331 .      if (\n[doc-arg-limit] == 1) \{\
332 .        nop \f[B]DEBUG(doc-parse-arg-vector)
333 .        nop MACRO:\f[P] `.\*[doc-macro-name]'
334 .        nop \& \f[B]Line #:\f[P] \n[.c]
335 .      \}
336 .      nop \t\f[B]Argc:\f[P] \n[doc-arg-limit]
337 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-arg-limit]]'
338 .      nop \ \f[B]Length:\f[P] \n[doc-width]
339 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-arg-limit]]'
340 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpav]
341 .    \}
342 .    el \{\
343 .      if (\n[doc-arg-limit] == 1) \{\
344 .        tmc "DEBUG(doc-parse-arg-vector)
345 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
346 .      \}
347 .      tmc "  Argc: \n[doc-arg-limit]
348 .      tmc "  Argv: `\*[doc-arg\n[doc-arg-limit]]'
349 .      tm1 "  Length: \n[doc-width]
350 .      tmc "  Space: `\*[doc-space\n[doc-arg-limit]]'
351 .      tm1 "  Type: \*[doc-str-dpav]
352 .  \}\}
354 .  ie (\n[doc-num-args] == 1) \{\
355 .    nr doc-arg-ptr 0
357 .    if \n[doc-nesting-level] \
358 .      if !\n[doc-in-diversion] \
359 .        if !\n[doc-func-arg-count] \
360 .          if !\n[doc-no-space] \
361 .            as doc-out-string "\*[doc-curr-space]
363 .    nr doc-no-space 0
364 .    nr doc-is-opening 0
366 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
368 .    nr doc-num-args 0
370 .    if \n[doc-debug] \{\
371 .      nr doc-reg-dpav1 1
373 .      ie \n[doc-inline-debug] \{\
374 .        nop \tMACRO REQUEST: .\*[doc-macro-name]
375 .        while (\n[doc-reg-dpav1] <= \n[doc-arg-limit]) \{\
376 .          nop "\*[doc-arg\n[doc-reg-dpav1]]"
377 .          nr doc-reg-dpav1 +1
378 .        \}
379 .        br
380 .        in \n[doc-reg-dpav]u
381 .      \}
382 .      el \{\
383 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
384 .        while (\n[doc-reg-dpav1] <= \n[doc-arg-limit]) \{\
385 .          tmc " "\*[doc-arg\n[doc-reg-dpav1]]"
386 .          nr doc-reg-dpav1 +1
387 .        \}
388 .        tm
389 .  \}\}\}
390 .  el \{\
391 .    nr doc-num-args -1
392 .    doc-parse-arg-vector
393 .  \}
397 .\" NS doc-remaining-args macro
398 .\" NS   output remaining arguments as-is, separated by spaces (until
399 .\" NS   `doc-num-args' is exhausted), to `doc-out-string'
400 .\" NS
401 .\" NS modifies:
402 .\" NS   doc-num-args, doc-arg-ptr, doc-out-string
404 .de doc-remaining-args
405 .  nr doc-arg-ptr +1
406 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
408 .  ie (\n[doc-num-args] == 1) \{\
409 .    nr doc-arg-ptr 0
410 .    nr doc-num-args 0
411 .  \}
412 .  el \{\
413 .    as doc-out-string "\*[doc-space]
414 .    nr doc-num-args -1
415 .    doc-remaining-args
416 .  \}
420 .\" NS doc-append-arg macro
421 .\" NS   append one argument to argument vector:
422 .\" NS   `.doc-append-arg [arg] [type]'
423 .\" NS
424 .\" NS modifies:
425 .\" NS   doc-argXXX, doc-typeXXX, doc-arg-limit
427 .de doc-append-arg
428 .  nr doc-arg-limit +1
429 .  ds doc-arg\n[doc-arg-limit] "\$1
430 .  nr doc-type\n[doc-arg-limit] \$2
431 .  doc-set-spacing-\$2
435 .\" NS doc-print-and-reset macro
436 .\" NS   print doc-out-string and clean up argument vectors
438 .de doc-print-and-reset
439 .  doc-print-out-string
440 .  doc-reset-args
444 .\" NS doc-reset-args macro
445 .\" NS   reset argument counters
446 .\" NS
447 .\" NS modifies:
448 .\" NS   doc-arg-limit, doc-arg-ptr
450 .de doc-reset-args
451 .  nr doc-arg-limit 0
452 .  nr doc-arg-ptr 0
456 .\" NS doc-print-out-string macro
457 .\" NS   print `doc-out-string', possibly ending a diversion, enabling
458 .\" NS   hyphenation afterwards
459 .\" NS
460 .\" NS modifies:
461 .\" NS   doc-out-string, doc-curr-space
463 .de doc-print-out-string
464 .  ie \n[doc-in-diversion] \{\
465 .    ie (\n[doc-in-list] : \n[doc-nesting-level]) \{\
466 .      if !\n[doc-no-printing] \{\
467 .        if !\n[doc-space-mode] \
468 .          as doc-out-string \c
469 .        nop \&\*[doc-out-string]
470 .        ds doc-curr-space
471 .        ds doc-out-string
472 .    \}\}
473 .    el \
474 .      doc-end-diversion-and-print
475 .  \}
476 .  el \{\
477 .    ie (\n[doc-in-list] : \n[doc-nesting-level]) \{\
478 .      if \n[doc-space-mode] \
479 .        if !\n[doc-list-immediate] \
480 .          doc-save-and-divert
481 .    \}
482 .    el \{\
483 .      if !\n[doc-no-printing] \{\
484 .        nop \&\*[doc-out-string]
485 .        ds doc-curr-space
486 .        ds doc-out-string
487 .  \}\}\}
489 .  hy
493 .\" NS doc-diversion diversion
494 .\" NS   diversion string
497 .\" NS doc-saved-out-string global string
498 .\" NS   saved doc-out-string
500 .ds doc-saved-out-string
503 .\" NS doc-in-diversion global register (bool)
504 .\" NS   whether we are in a diversion
506 .nr doc-in-diversion 0
509 .\" NS doc-save-and-divert macro
510 .\" NS   save doc-out-string, restore fill mode, and divert
511 .\" NS
512 .\" NS modifies:
513 .\" NS   doc-out-string, doc-saved-out-string, doc-diversion,
514 .\" NS   doc-in-diversion
516 .de doc-save-and-divert
517 .  nr doc-in-diversion 1
518 .  ds doc-saved-out-string "\*[doc-out-string]
519 .  ds doc-out-string
520 .  ev doc-divert-environment
521 .  fi
523 .  if \n[doc-debug] \
524 .    tm begin of `doc-diversion' at line #\n[.c]
525 .  di doc-diversion
529 .\" NS doc-end-diversion-and-print macro
530 .\" NS   end diversion and print
531 .\" NS
532 .\" NS modifies:
533 .\" NS   doc-out-string, doc-in-diversion
534 .\" NS
535 .\" NS local variables:
536 .\" NS   doc-str-dedap
538 .de doc-end-diversion-and-print
539 .  br
540 .  di
541 .  ev
543 .  \" insert diversion only if it contains printable stuff
544 .  ie \n[dn] \{\
545 .    ds doc-str-dedap \&\*[doc-diversion]\c
546 .    ds doc-out-string "\*[doc-saved-out-string]\*[doc-str-dedap]\*[doc-out-string]
547 .  \}
548 .  el \
549 .    ds doc-out-string "\*[doc-saved-out-string]\*[doc-out-string]
551 .  nop \&\*[doc-out-string]
553 .  ds doc-out-string
554 .  nr doc-in-diversion 0
560 .\" NS doc-curr-font global register
561 .\" NS   saved current font
563 .nr doc-curr-font \n[.f]
566 .\" NS doc-curr-size global register
567 .\" NS   saved current font size
569 .nr doc-curr-size \n[.s]
574 .\" NS Fl user macro
575 .\" NS   handle flags (appends `-' and prints flags): `.Fl [arg ...]'
576 .\" NS
577 .\" NS modifies:
578 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
579 .\" NS   doc-curr-size
580 .\" NS
581 .\" NS local variables:
582 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
583 .\" NS
584 .\" NS width register `Fl' set in doc-common
586 .de Fl
587 .  as doc-out-string \*[doc-Fl-font]
589 .  if !\n[doc-arg-limit] \{\
590 .    ie \n[.$] \{\
591 .      ds doc-macro-name Fl
592 .      doc-parse-args \$@
593 .    \}
594 .    el \{\
595 .      \" no arguments
596 .      as doc-out-string \|\-\|\f[P]\s[0]
597 .      doc-print-out-string
598 .  \}\}
600 .  if \n[doc-arg-limit] \{\
601 .    nr doc-arg-ptr +1
602 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
603 .      \" last argument
604 .      as doc-out-string \|\-\f[P]\s[0]
605 .      doc-print-and-reset
606 .    \}
607 .    el \{\
608 .      ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
609 .        as doc-out-string \|\-\f[P]\s[0]
610 .        \*[doc-arg\n[doc-arg-ptr]]
611 .      \}
612 .      el \{\
613 .        nr doc-curr-font \n[.f]
614 .        nr doc-curr-size \n[.s]
616 .        if (\n[doc-type\n[doc-arg-ptr]] == 3) \
617 .          as doc-out-string \|\-\|
619 .        nr doc-reg-Fl 1
620 .        doc-flag-recursion
621 .  \}\}\}
625 .\" NS doc-flag-recursion macro
626 .\" NS   `Fl' flag recursion routine (special handling)
627 .\" NS
628 .\" NS modifies:
629 .\" NS   doc-arg-ptr, doc-out-string
630 .\" NS
631 .\" NS local variables:
632 .\" NS   doc-str-dfr, doc-reg-dfr, doc-reg-dfr1
634 .de doc-flag-recursion
635 .  nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
636 .  ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
638 .  hy 0
640 .  ie (\n[doc-reg-dfr1] == 1) \{\
641 .    as doc-out-string \f[P]\s[0]
642 .    \*[doc-str-dfr]
643 .  \}
644 .  el \{\
645 .    nr doc-reg-dfr \n[doc-arg-ptr]
647 .    ie (\n[doc-reg-dfr1] == 2) \{\
648 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
649 .      \" doc-flag-recursion only; we need this to make `.Fl | ...' work
650 .      \" correctly
651 .      ie "\*[doc-str-dfr]"\*[Ba]" \{\
652 .        if \n[doc-reg-Fl] \
653 .          as doc-out-string \|\-\*[doc-space]
654 .        as doc-out-string \&\*[Ba]
655 .      \}
656 .      el \{\
657 .        ie "\*[doc-str-dfr]"\f[R]|\f[P]" \{\
658 .          if \n[doc-reg-Fl] \
659 .            as doc-out-string \|\-\*[doc-space]
660 .          as doc-out-string \f[R]|\f[P]
661 .        \}
662 .        el \{\
663 .          \" two consecutive hyphen characters?
664 .          ie "\*[doc-str-dfr]"-" \
665 .            as doc-out-string \|\-\^\-\|
666 .          el \
667 .            as doc-out-string \|\-\*[doc-str-dfr]
668 .    \}\}\}
669 .    el \{\
670 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
671 .      as doc-out-string "\*[doc-str-dfr]\f[P]\s[0]
672 .    \}
674 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
675 .      \" last argument
676 .      if (\n[doc-reg-dfr1] == 4) \
677 .        as doc-out-string \|\-
678 .      as doc-out-string \f[P]\s[0]
679 .      doc-print-and-reset
680 .    \}
681 .    el \{\
682 .      nr doc-arg-ptr +1
683 .      ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
684 .        ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
685 .          as doc-out-string \|\-
686 .        el \
687 .          as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
688 .      \}
689 .      el \
690 .        as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
692 .      shift
693 .      nr doc-reg-Fl 0
694 .      doc-flag-recursion \$@
695 .  \}\}
699 .\" NS doc-print-recursive macro
700 .\" NS   general name recursion routine (print remaining arguments)
701 .\" NS
702 .\" NS   hyphenation is disabled
703 .\" NS
704 .\" NS modifies:
705 .\" NS   doc-arg-ptr, doc-out-string
706 .\" NS
707 .\" NS local variables:
708 .\" NS   doc-str-dpr, doc-reg-dpr, doc-reg-dpr1
710 .de doc-print-recursive
711 .  nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
712 .  ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
714 .  hy 0
716 .  ie (\n[doc-reg-dpr1] == 1) \{\
717 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
718 .    \*[doc-str-dpr]
719 .  \}
720 .  el \{\
721 .    nr doc-reg-dpr \n[doc-arg-ptr]
723 .    ie (\n[doc-reg-dpr1] == 2) \
724 .      as doc-out-string \&\*[doc-str-dpr]
725 .    el \{\
726 .      \" punctuation character
727 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
728 .      as doc-out-string "\*[doc-str-dpr]\f[P]\s[0]
729 .    \}
731 .    nr doc-arg-ptr +1
732 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
733 .      \" last argument
734 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
735 .      doc-print-and-reset
736 .    \}
737 .    el \{\
738 .      as doc-out-string "\*[doc-space\n[doc-reg-dpr]]
739 .      doc-print-recursive
740 .  \}\}
744 .\" NS Ar user macro
745 .\" NS   command line `argument' macro: `.Ar [args ...]'
746 .\" NS
747 .\" NS modifies:
748 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
749 .\" NS   doc-curr-size
750 .\" NS
751 .\" NS width register `Ar' set in doc-common
753 .de Ar
754 .  as doc-out-string \*[doc-Ar-font]
756 .  if !\n[doc-arg-limit] \{\
757 .    ie \n[.$] \{\
758 .      ds doc-macro-name Ar
759 .      doc-parse-args \$@
760 .    \}
761 .    el \{\
762 .      \" no argument
763 .      as doc-out-string \&file\ ...\f[P]\s[0]
764 .      doc-print-out-string
765 .  \}\}
767 .  if \n[doc-arg-limit] \{\
768 .    nr doc-arg-ptr +1
769 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
770 .      as doc-out-string \&file\ ...\f[P]\s[0]
771 .      doc-print-and-reset
772 .    \}
773 .    el \{\
774 .      ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
775 .        as doc-out-string \&file\ ...\f[P]\s[0]
776 .        \*[doc-arg\n[doc-arg-ptr]]
777 .      \}
778 .      el \{\
779 .        nr doc-curr-font \n[.f]
780 .        nr doc-curr-size \n[.s]
781 .        if (\n[doc-type\n[doc-arg-ptr]] == 3) \
782 .          as doc-out-string \&file\ ...
783 .        doc-print-recursive
784 .  \}\}\}
788 .\" NS Ad user macro
789 .\" NS   Addresses
790 .\" NS
791 .\" NS modifies:
792 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
793 .\" NS   doc-curr-size
794 .\" NS
795 .\" NS width register `Ad' set in doc-common
797 .de Ad
798 .  if !\n[doc-arg-limit] \{\
799 .    ie \n[.$] \{\
800 .      ds doc-macro-name Ad
801 .      doc-parse-args \$@
802 .    \}
803 .    el \
804 .      tm Usage: .Ad address ... \*[doc-punct-chars] (#\n[.c])
805 .  \}
807 .  nr doc-arg-ptr +1
808 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
809 .    as doc-out-string \*[doc-Ad-font]
810 .    nr doc-curr-font \n[.f]
811 .    nr doc-curr-size \n[.s]
812 .    doc-print-recursive
813 .  \}
817 .\" NS doc-in-synopsis-count global register
818 .\" NS   whether we have more than a single item in synopsis
820 .nr doc-in-synopsis-count 0
823 .\" NS doc-indent-synopsis global register
824 .\" NS   indentation in synopsis
826 .nr doc-indent-synopsis 0
829 .\" NS Cd user macro
830 .\" NS   Config declaration (for section 4 SYNOPSIS)
831 .\" NS
832 .\" NS   this function causes a break; it uses the `Nm' font
833 .\" NS
834 .\" NS modifies:
835 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
836 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis
837 .\" NS
838 .\" NS width register `Cd' set in doc-common
840 .\" needs work - not very translatable
842 .de Cd
843 .  if !\n[doc-arg-limit] \{\
844 .    ie \n[.$] \{\
845 .      ds doc-macro-name Cd
846 .      doc-parse-args \$@
847 .    \}
848 .    el \
849 .      tm Usage: .Cd Configuration file declaration (#\n[.c])
850 .  \}
852 .  br
854 .  nr doc-arg-ptr +1
855 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
856 .    as doc-out-string \*[doc-Nm-font]
857 .    nr doc-curr-font \n[.f]
858 .    nr doc-curr-size \n[.s]
860 .    ie \n[doc-in-synopsis-count] \{\
861 .      if "\*[doc-macro-name]"Cd" \{\
862 .        rs
863 .        ie (\n[doc-in-synopsis-count] > 1) \
864 .          br
865 .        el \{\
866 .          if !\n[doc-indent-synopsis] \
867 .            nr doc-indent-synopsis \n[doc-display-indent]u
868 .        \}
869 .        in +\n[doc-indent-synopsis]u
870 .        ti -\n[doc-indent-synopsis]u
871 .        nr doc-in-synopsis-count +1
872 .      \}
874 .      doc-print-recursive
875 .      in -\n[doc-indent-synopsis]u
876 .    \}
877 .    el \
878 .      doc-print-recursive
879 .  \}
883 .\" NS Cm user macro
884 .\" NS   Interactive command modifier (flag)
885 .\" NS
886 .\" NS modifies:
887 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
888 .\" NS   doc-curr-size
889 .\" NS
890 .\" NS width register `Cm' set in doc-common
892 .de Cm
893 .  if !\n[doc-arg-limit] \{\
894 .    ie \n[.$] \{\
895 .      ds doc-macro-name Cm
896 .      doc-parse-args \$@
897 .    \}
898 .    el \{\
899 .      tmc Usage: .Cm Interactive command modifier ...
900 .      tm1 " \*[doc-punct-chars] (#\n[.c])
901 .  \}\}
903 .  nr doc-arg-ptr +1
904 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
905 .    as doc-out-string \*[doc-Cm-font]
906 .    nr doc-curr-font \n[.f]
907 .    nr doc-curr-size \n[.s]
908 .    doc-print-recursive
909 .  \}
913 .\" NS Dv user macro
914 .\" NS   define variable
915 .\" NS
916 .\" NS   this function uses the `Er' font
917 .\" NS
918 .\" NS modifies:
919 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
920 .\" NS   doc-curr-size
921 .\" NS
922 .\" NS width register `Dv' set in doc-common
924 .de Dv
925 .  if !\n[doc-arg-limit] \{\
926 .    ie \n[.$] \{\
927 .      ds doc-macro-name Dv
928 .      doc-parse-args \$@
929 .    \}
930 .    el \
931 .      tm Usage: .Dv define_variable ... \*[doc-punct-chars] (#\n[.c])
932 .  \}
934 .  nr doc-arg-ptr +1
935 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
936 .    as doc-out-string \*[doc-Er-font]
937 .    nr doc-curr-font \n[.f]
938 .    nr doc-curr-size \n[.s]
939 .    doc-print-recursive
940 .  \}
944 .\" NS Em user macro
945 .\" NS   emphasis
946 .\" NS
947 .\" NS modifies:
948 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
949 .\" NS   doc-curr-size
950 .\" NS
951 .\" NS width register `Em' set in doc-common
953 .de Em
954 .  if !\n[doc-arg-limit] \{\
955 .    ie \n[.$] \{\
956 .      ds doc-macro-name Em
957 .      doc-parse-args \$@
958 .    \}
959 .    el \
960 .      tm Usage: .Em text ... \*[doc-punct-chars] (#\n[.c])
961 .  \}
963 .  nr doc-arg-ptr +1
964 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
965 .    as doc-out-string \*[doc-Em-font]
966 .    nr doc-curr-font \n[.f]
967 .    nr doc-curr-size \n[.s]
968 .    doc-print-recursive
969 .  \}
973 .\" NS Er user macro
974 .\" NS   errno type
975 .\" NS
976 .\" NS modifies:
977 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
978 .\" NS   doc-curr-size
979 .\" NS
980 .\" NS width register `Er' set in doc-common
982 .de Er
983 .  if !\n[doc-arg-limit] \{\
984 .    ie \n[.$] \{\
985 .      ds doc-macro-name Er
986 .      doc-parse-args \$@
987 .    \}
988 .    el \
989 .      tm Usage: .Er errno_type ... \*[doc-punct-chars] (#\n[.c])
990 .  \}
992 .  nr doc-arg-ptr +1
993 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
994 .    as doc-out-string \*[doc-Er-font]
995 .    nr doc-curr-font \n[.f]
996 .    nr doc-curr-size \n[.s]
997 .    doc-print-recursive
998 .  \}
1002 .\" NS Ev user macro
1003 .\" NS   environment variable
1004 .\" NS
1005 .\" NS modifies:
1006 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1007 .\" NS   doc-curr-size
1008 .\" NS
1009 .\" NS width register `Ev' set in doc-common
1011 .de Ev
1012 .  if !\n[doc-arg-limit] \{\
1013 .    ie \n[.$] \{\
1014 .      ds doc-macro-name Ev
1015 .      doc-parse-args \$@
1016 .    \}
1017 .    el \
1018 .      tm Usage: .Ev enviroment_variable ... \*[doc-punct-chars] (#\n[.c])
1019 .  \}
1021 .  nr doc-arg-ptr +1
1022 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1023 .    as doc-out-string \*[doc-Ev-font]
1024 .    nr doc-curr-font \n[.f]
1025 .    nr doc-curr-size \n[.s]
1026 .    doc-print-recursive
1027 .  \}
1031 .\" NS doc-have-decl global register (bool)
1032 .\" NS   subroutine test (in synopsis only)
1034 .nr doc-have-decl 0
1037 .\" NS doc-have-var global register (bool)
1038 .\" NS   whether last type is a variable type
1040 .nr doc-have-var 0
1043 .\" NS doc-do-func-decl macro
1044 .\" NS   do someting special while in SYNOPSIS
1045 .\" NS
1046 .\" NS modifies:
1047 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
1048 .\" NS   doc-have-var
1050 .de doc-do-func-decl
1051 .  if \n[doc-in-synopsis-count] \{\
1052 .    \" if a variable type was the last thing given, want vertical space
1053 .    if \n[doc-have-var] \{\
1054 .      doc-paragraph
1055 .      nr doc-have-var 0
1056 .    \}
1057 .    \" if a subroutine was the last thing given, want vertical space
1058 .    if \n[doc-have-func] \{\
1059 .      ie \n[doc-have-decl] \
1060 .        br
1061 .      el \{\
1062 .        doc-paragraph
1063 .        rs
1064 .    \}\}
1065 .    nr doc-have-decl 1
1066 .  \}
1068 .  nr doc-curr-font \n[.f]
1069 .  nr doc-curr-size \n[.s]
1073 .\" NS Fd user macro
1074 .\" NS   function declaration -- not callable
1075 .\" NS
1076 .\" NS   this function causes a break
1077 .\" NS
1078 .\" NS width register `Fd' set in doc-common
1080 .de Fd
1081 .  ie \n[doc-arg-limit] \
1082 .    tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
1083 .  el \{\
1084 .    doc-do-func-decl
1085 .    nop \*[doc-Fd-font]\$*
1086 .    br
1087 .    ft \n[doc-curr-font]
1088 .    ps \n[doc-curr-size]
1089 .  \}
1093 .\" NS In user macro
1094 .\" NS   #include statement - not callable (& no err check)
1095 .\" NS
1096 .\" NS   this function causes a break; it uses the `Fd' font
1097 .\" NS
1098 .\" NS width register `In' set in doc-common
1100 .de In
1101 .  ie \n[doc-arg-limit] \
1102 .    tm Usage: .In #include_statement -- In is not callable (#\n[.c])
1103 .  el \{\
1104 .    doc-do-func-decl
1105 .    nop \*[doc-Fd-font]#include <\$1>
1106 .    br
1107 .    ft \n[doc-curr-font]
1108 .    ps \n[doc-curr-size]
1109 .  \}
1113 .\" NS Fr user macro
1114 .\" NS   function return value
1115 .\" NS
1116 .\" NS   this function uses the `Ar' font
1117 .\" NS
1118 .\" NS modifies:
1119 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1120 .\" NS   doc-curr-size
1121 .\" NS
1122 .\" NS width register `Fr' set in doc-common
1124 .de Fr
1125 .  if !\n[doc-arg-limit] \{\
1126 .    ie \n[.$] \{\
1127 .      ds doc-macro-name Fr
1128 .      doc-parse-args \$@
1129 .    \}
1130 .    el \
1131 .      tm Usage: .Fr Function_return_value... \*[doc-punct-chars] (#\n[.c])
1132 .  \}
1134 .  nr doc-arg-ptr +1
1135 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1136 .    as doc-out-string \*[doc-Ar-font]
1137 .    nr doc-curr-font \n[.f]
1138 .    nr doc-curr-size \n[.s]
1139 .    doc-print-recursive
1140 .  \}
1144 .\" NS Ic user macro
1145 .\" NS   interactive command
1146 .\" NS
1147 .\" NS modifies:
1148 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1149 .\" NS   doc-curr-size
1150 .\" NS
1151 .\" NS width register `Ic' set in doc-common
1153 .de Ic
1154 .  if !\n[doc-arg-limit] \{\
1155 .    ie \n[.$] \{\
1156 .      ds doc-macro-name Ic
1157 .      doc-parse-args \$@
1158 .    \}
1159 .    el \
1160 .      tm Usage: .Ic Interactive command ... \*[doc-punct-chars] (#\n[.c])
1161 .  \}
1163 .  nr doc-arg-ptr +1
1164 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1165 .    as doc-out-string \*[doc-Ic-font]
1166 .    nr doc-curr-font \n[.f]
1167 .    nr doc-curr-size \n[.s]
1168 .    doc-print-recursive
1169 .  \}
1173 .\" NS Li user macro
1174 .\" NS   literals
1175 .\" NS
1176 .\" NS modifies:
1177 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1178 .\" NS   doc-curr-size
1179 .\" NS
1180 .\" NS width register `Li' set in doc-common
1182 .de Li
1183 .  if !\n[doc-arg-limit] \{\
1184 .    ie \n[.$] \{\
1185 .      ds doc-macro-name Li
1186 .      doc-parse-args \$@
1187 .    \}
1188 .    el \
1189 .      tm Usage: .Li argument ... \*[doc-punct-chars] (#\n[.c])
1190 .  \}
1192 .  nr doc-arg-ptr +1
1193 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1194 .    as doc-out-string \*[doc-Li-font]
1195 .    nr doc-curr-font \n[.f]
1196 .    nr doc-curr-size \n[.s]
1197 .    doc-print-recursive
1198 .  \}
1202 .\" NS Or user macro
1203 .\" NS   pipe symbol (OR)
1204 .\" NS
1205 .\" NS modifies:
1206 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1207 .\" NS   doc-curr-size
1208 .\" NS
1209 .\" NS width register `Or' set in doc-common
1211 .\" XXX: What is this function good for?  It sets a font but does not print
1212 .\"      a pipe symbol.  And it isn't documented.
1214 .de Or
1215 .  if !\n[doc-arg-limit] \{\
1216 .    ie \n[.$] \{\
1217 .      ds doc-macro-name Or
1218 .      doc-parse-args \$@
1219 .    \}
1220 .    el \
1221 .      tm Usage: .Or ... \*[doc-punct-chars] (#\n[.c])
1222 .  \}
1224 .  nr doc-arg-ptr +1
1225 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1226 .    as doc-out-string \*[doc-Ic-font]
1227 .    nr doc-curr-font \n[.f]
1228 .    nr doc-curr-size \n[.s]
1229 .    doc-print-recursive
1230 .  \}
1234 .\" NS Ms user macro
1235 .\" NS   math symbol
1236 .\" NS
1237 .\" NS   this function uses the `Sy' font
1238 .\" NS
1239 .\" NS modifies:
1240 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1241 .\" NS   doc-curr-size
1242 .\" NS
1243 .\" NS width register `Ms' set in doc-common
1245 .de Ms
1246 .  if !\n[doc-arg-limit] \{\
1247 .    ie \n[.$] \{\
1248 .      ds doc-macro-name Ms
1249 .      doc-parse-args \$@
1250 .    \}
1251 .    el \
1252 .      tm Usage: .Ms Math symbol ... \*[doc-punct-chars] (#\n[.c])
1253 .  \}
1255 .  nr doc-arg-ptr +1
1256 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1257 .    as doc-out-string \*[doc-Sy-font]
1258 .    nr doc-curr-font \n[.f]
1259 .    nr doc-curr-size \n[.s]
1260 .    doc-print-recursive
1261 .  \}
1265 .\" NS doc-command-name global string
1266 .\" NS   save first invocation of .Nm
1268 .ds doc-command-name
1271 .\" NS Nm user macro
1272 .\" NS   name of command or page topic
1273 .\" NS
1274 .\" NS modifies:
1275 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1276 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
1277 .\" NS   doc-command-name
1278 .\" NS
1279 .\" NS width register `Nm' set in doc-common
1281 .de Nm
1282 .  if !\n[doc-arg-limit] \{\
1283 .    ds doc-macro-name Nm
1284 .    ie \n[.$] \
1285 .      doc-parse-args \$@
1286 .    el \{\
1287 .      ie "\*[doc-command-name]"" \
1288 .        tm Usage: .Nm Name ... \*[doc-punct-chars] (#\n[.c])
1289 .      el \
1290 .        doc-parse-args \*[doc-command-name]
1291 .  \}\}
1293 .  if \n[doc-arg-limit] \{\
1294 .    nr doc-arg-ptr +1
1295 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1296 .      \" last argument
1297 .      as doc-out-string \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1298 .      doc-print-and-reset
1299 .    \}
1300 .    el \{\
1301 .      as doc-out-string \*[doc-Nm-font]
1302 .      ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \
1303 .        as doc-out-string \&\*[doc-command-name]\f[P]\s[0]
1304 .      el \{\
1305 .        nr doc-curr-font \n[.f]
1306 .        nr doc-curr-size \n[.s]
1308 .        \" handle `.Nm ...' in SYNOPSIS
1309 .        if \n[doc-in-synopsis-count] \{\
1310 .          if "\*[doc-macro-name]"Nm" \{\
1311 .            rs
1312 .            in -\n[doc-indent-synopsis]u
1313 .            ie (\n[doc-in-synopsis-count] > 1) \
1314 .              br
1315 .            el \{\
1316 .              if !\n[doc-indent-synopsis] \{\
1317 .                doc-get-width "\*[doc-arg\n[doc-arg-ptr]]
1318 .                nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
1319 .            \}\}
1320 .            in +\n[doc-indent-synopsis]u
1321 .            ti -\n[doc-indent-synopsis]u
1322 .            nr doc-in-synopsis-count +1
1323 .        \}\}
1324 .        if "\*[doc-command-name]"" \
1325 .          ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
1326 .      \}
1327 .      doc-print-recursive
1328 .  \}\}
1332 .\" NS Pa user macro
1333 .\" NS   pathname: `.Pa [arg ...]'
1334 .\" NS
1335 .\" NS modifies:
1336 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1337 .\" NS   doc-curr-size
1338 .\" NS
1339 .\" NS width register `Pa' set in doc-common
1341 .de Pa
1342 .  if !\n[doc-arg-limit] \{\
1343 .    ie \n[.$] \{\
1344 .      ds doc-macro-name Pa
1345 .      doc-parse-args \$@
1346 .    \}
1347 .    el \{\
1348 .      \" default value
1349 .      nop \*[doc-Pa-font]~\f[P]\s[0]
1350 .  \}\}
1352 .  nr doc-arg-ptr +1
1353 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1354 .    as doc-out-string \*[doc-Pa-font]
1355 .    nr doc-curr-font \n[.f]
1356 .    nr doc-curr-size \n[.s]
1357 .    doc-print-recursive
1358 .  \}
1362 .\" NS Sy user macro
1363 .\" NS   symbolics
1364 .\" NS
1365 .\" NS modifies:
1366 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1367 .\" NS   doc-curr-size
1368 .\" NS
1369 .\" NS width register `Sy' set in doc-common
1371 .de Sy
1372 .  if !\n[doc-arg-limit] \{\
1373 .    ie \n[.$] \{\
1374 .      ds doc-macro-name Sy
1375 .      doc-parse-args \$@
1376 .    \}
1377 .    el \
1378 .      tm Usage: .Sy symbolic_text ... \*[doc-punct-chars] (#\n[.c])
1379 .  \}
1381 .  nr doc-arg-ptr +1
1382 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1383 .    as doc-out-string \*[doc-Sy-font]
1384 .    nr doc-curr-font \n[.f]
1385 .    nr doc-curr-size \n[.s]
1386 .    doc-print-recursive
1387 .  \}
1391 .\" NS Me user macro
1392 .\" NS   menu entries
1393 .\" NS
1394 .\" NS modifies:
1395 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1396 .\" NS   doc-curr-size
1397 .\" NS
1398 .\" NS width register `Me' set in doc-common
1400 .de Me
1401 .  if !\n[doc-arg-limit] \{\
1402 .    ie \n[.$] \{\
1403 .      ds doc-macro-name Me
1404 .      doc-parse-args \$@
1405 .    \}
1406 .    el \
1407 .      tm Usage: .Me menu_entry ... \*[doc-punct-chars] (#\n[.c])
1408 .  \}
1410 .  nr doc-arg-ptr +1
1411 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1412 .    as doc-out-string \*[doc-Me-font]
1413 .    nr doc-curr-font \n[.f]
1414 .    nr doc-curr-size \n[.s]
1415 .    doc-print-recursive
1416 .  \}
1420 .\" NS Tn user macro
1421 .\" NS   trade name
1422 .\" NS
1423 .\" NS modifies:
1424 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1425 .\" NS   doc-curr-size
1426 .\" NS
1427 .\" NS width register `Tn' set in doc-common
1429 .de Tn
1430 .  if !\n[doc-arg-limit] \{\
1431 .    ie \n[.$] \{\
1432 .      ds doc-macro-name Tn
1433 .      doc-parse-args \$@
1434 .    \}
1435 .    el \
1436 .      tm Usage: .Tn trade_name ... \*[doc-punct-chars] (#\n[.c])
1437 .  \}
1439 .  nr doc-arg-ptr +1
1440 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1441 .    as doc-out-string \&\*[doc-Tn-font-shape]\*[doc-Tn-font-size]
1442 .    nr doc-curr-font \n[.f]
1443 .    nr doc-curr-size \n[.s]
1444 .    doc-print-recursive
1445 .  \}
1449 .\" NS doc-reference-trademark macro
1450 .\" NS   .Tn for inside of references
1451 .\" NS
1452 .\" NS modifies:
1453 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1454 .\" NS   doc-curr-size
1455 .\" NS
1456 .\" NS   the code for references below checks for `Tn'!
1458 .de doc-reference-trademark
1459 .  if !\n[doc-arg-limit] \{\
1460 .    ie \n[.$] \{\
1461 .      ds doc-macro-name Tn
1462 .      doc-parse-args \$@
1463 .    \}
1464 .    el \
1465 .      tm Usage: .Tn trade_name ... \*[doc-punct-chars] (#\n[.c])
1466 .  \}
1468 .  nr doc-arg-ptr +1
1469 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1470 .    as doc-out-string \&\*[doc-Tn-font-size]
1471 .    nr doc-curr-font \n[.f]
1472 .    nr doc-curr-size \n[.s]
1473 .    doc-do-references
1474 .  \}
1478 .\" NS Va user macro
1479 .\" NS   variable name
1480 .\" NS
1481 .\" NS modifies:
1482 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1483 .\" NS   doc-curr-size
1484 .\" NS
1485 .\" NS width register `Va' set in doc-common
1487 .de Va
1488 .  if !\n[doc-arg-limit] \{\
1489 .    ie \n[.$] \{\
1490 .      ds doc-macro-name Va
1491 .      doc-parse-args \$@
1492 .    \}
1493 .    el \
1494 .      tm Usage: .Va variable_name ... \*[doc-punct-chars] (#\n[.c])
1495 .  \}
1497 .  nr doc-arg-ptr +1
1498 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1499 .    as doc-out-string \*[doc-Va-font]
1500 .    nr doc-curr-font \n[.f]
1501 .    nr doc-curr-size \n[.s]
1502 .    doc-print-recursive
1503 .  \}
1507 .\" NS No user macro
1508 .\" NS   normal text macro (default text style if mess up)
1509 .\" NS
1510 .\" NS modifies:
1511 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1512 .\" NS   doc-curr-size
1513 .\" NS
1514 .\" NS width register `No' set in doc-common
1516 .de No
1517 .  as doc-out-string \*[doc-No-font]
1519 .  if !\n[doc-arg-limit] \{\
1520 .    ie \n[.$] \{\
1521 .      ds doc-macro-name No
1522 .      doc-parse-args \$@
1523 .    \}
1524 .    el \
1525 .      tm Usage: .No normal_text ... \*[doc_punct_chars] (#\n[.c])
1526 .  \}
1528 .  nr doc-arg-ptr +1
1529 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1530 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \
1531 .      \*[doc-arg\n[doc-arg-ptr]]
1532 .    el \{\
1533 .      nr doc-curr-font \n[.f]
1534 .      nr doc-curr-size \n[.s]
1535 .      doc-print-recursive
1536 .  \}\}
1537 .  el \
1538 .    doc-print-and-reset
1542 .\" NS doc-quote-left global string
1543 .\" NS   left quotation character for `doc-enclose-string' and
1544 .\" NS   `doc-enclose-open'
1546 .ds doc-quote-left
1549 .\" NS doc-quote-right global string
1550 .\" NS   right quotation character for `doc-enclose-string' and
1551 .\" NS   `doc-enclose-close'
1553 .ds doc-quote-right
1556 .\" NS Op user macro
1557 .\" NS   option expression (i.e., enclose string in square brackets)
1558 .\" NS
1559 .\" NS modifies:
1560 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1561 .\" NS
1562 .\" NS width register `Op' set in doc-common
1564 .de Op
1565 .  if !\n[doc-arg-limit] \
1566 .    ds doc-macro-name Op
1568 .  ds doc-quote-left "\*[doc-left-bracket]
1569 .  ds doc-quote-right "\*[doc-right-bracket]
1571 .  doc-enclose-string \$@
1575 .\" NS Aq user macro
1576 .\" NS   enclose string in angle brackets
1577 .\" NS
1578 .\" NS modifies:
1579 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1580 .\" NS
1581 .\" NS width register `Aq' set in doc-common
1583 .de Aq
1584 .  if !\n[doc-arg-limit] \
1585 .    ds doc-macro-name Aq
1587 .  ds doc-quote-left <
1588 .  ds doc-quote-right >
1590 .  doc-enclose-string \$@
1594 .\" NS Bq user macro
1595 .\" NS   enclose string in square brackets
1596 .\" NS
1597 .\" NS modifies:
1598 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1599 .\" NS
1600 .\" NS width register `Bq' set in doc-common
1602 .de Bq
1603 .  if !\n[doc-arg-limit] \
1604 .    ds doc-macro-name Bq
1606 .  ds doc-quote-left "\*[doc-left-bracket]
1607 .  ds doc-quote-right "\*[doc-right-bracket]
1609 .  doc-enclose-string \$@
1613 .\" NS Brq user macro
1614 .\" NS   enclose string in braces
1615 .\" NS
1616 .\" NS modifies:
1617 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1618 .\" NS
1619 .\" NS width register `Brq' set in doc-common
1621 .de Brq
1622 .  if !\n[doc-arg-limit] \
1623 .    ds doc-macro-name Brq
1625 .  ds doc-quote-left {
1626 .  ds doc-quote-right }
1628 .  doc-enclose-string \$@
1632 .\" NS Dq user macro
1633 .\" NS   enclose string in double quotes
1634 .\" NS
1635 .\" NS modifies:
1636 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1637 .\" NS
1638 .\" NS width register `Dq' set in doc-common
1640 .de Dq
1641 .  if !\n[doc-arg-limit] \
1642 .    ds doc-macro-name Dq
1644 .  ds doc-quote-left "\*[Lq]
1645 .  ds doc-quote-right "\*[Rq]
1647 .  doc-enclose-string \$@
1651 .\" NS Eq user macro
1652 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1653 .\" NS
1654 .\" NS modifies:
1655 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1656 .\" NS
1657 .\" NS width register `Eq' set in doc-common
1659 .de Eq
1660 .  if !\n[doc-arg-limit] \
1661 .    ds doc-macro-name Eq
1663 .  ds doc-quote-left "\$1
1664 .  ds doc-quote-right "\$2
1666 .  shift 2
1667 .  doc-enclose-string \$@
1671 .\" NS Pq user macro
1672 .\" NS   enclose string in parentheses
1673 .\" NS
1674 .\" NS modifies:
1675 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1676 .\" NS
1677 .\" NS width register `Pq' set in doc-common
1679 .de Pq
1680 .  if !\n[doc-arg-limit] \
1681 .    ds doc-macro-name Pq
1683 .  ds doc-quote-left "\*[doc-left-parenthesis]
1684 .  ds doc-quote-right "\*[doc-right-parenthesis]
1686 .  doc-enclose-string \$@
1690 .\" NS Ql user macro
1691 .\" NS   quoted literal
1693 .\"   is in file doc-[dit|n]roff
1696 .\" NS Qq user macro
1697 .\" NS   enclose string in straight double quotes
1698 .\" NS
1699 .\" NS modifies:
1700 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1701 .\" NS
1702 .\" NS width register `Qq' set in doc-common
1704 .de Qq
1705 .  if !\n[doc-arg-limit] \
1706 .    ds doc-macro-name Qq
1708 .  ds doc-quote-left "\*[q]
1709 .  ds doc-quote-right "\*[q]
1711 .  doc-enclose-string \$@
1715 .\" NS Sq user macro
1716 .\" NS   enclose string in single quotes
1717 .\" NS
1718 .\" NS modifies:
1719 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1720 .\" NS
1721 .\" NS width register `Sq' set in doc-common
1723 .de Sq
1724 .  if !\n[doc-arg-limit] \
1725 .    ds doc-macro-name Sq
1727 .  ds doc-quote-left "\*[doc-left-singlequote]
1728 .  ds doc-quote-right "\*[doc-right-singlequote]
1730 .  doc-enclose-string \$@
1734 .\" NS Es user macro
1735 .\" NS   set up arguments (i.e., the left and right quotation character as
1736 .\" NS   first and second argument) for .En call
1737 .\" NS
1738 .\" NS modifies:
1739 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right, doc-arg-ptr
1741 .de Es
1742 .  if !\n[doc-arg-limit] \{\
1743 .    ie (\n[.$] > 2) \{\
1744 .        ds doc-macro-name Es
1745 .        doc-parse-args \$@
1746 .    \}
1747 .    el \{\
1748 .      ds doc-quote-left "\$1
1749 .      ds doc-quote-right "\$2
1750 .  \}\}
1752 .  if \n[doc-arg-limit] \{\
1753 .    nr doc-arg-ptr +1
1754 .    ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
1755 .    nr doc-arg-ptr +1
1756 .    ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
1757 .    nr doc-arg-ptr +1
1758 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1759 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
1760 .    el \
1761 .      doc-print-and-reset
1762 .  \}
1766 .\" NS doc-is-opening global register (bool)
1767 .\" NS   whether current request emits an opening character
1769 .nr doc-is-opening 0
1772 .\" NS doc-enclose-string macro
1773 .\" NS   enclose string with given args (e.g. [ and ])
1774 .\" NS
1775 .\" NS modifies:
1776 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string
1777 .\" NS
1778 .\" NS local variables:
1779 .\" NS   doc-reg-des (for communication with doc-skip-punct-backwards)
1780 .\" NS
1781 .\" NS requires:
1782 .\" NS   doc-quote-left, doc-quote-right
1784 .de doc-enclose-string
1785 .  ie \n[doc-arg-limit] \
1786 .    as doc-out-string \&\*[doc-quote-left]
1787 .  el \{\
1788 .    ie \n[.$] \{\
1789 .      \" was the last request on the previous line an opening request?
1790 .      if \n[doc-is-opening] \
1791 .        nr doc-no-space 1
1792 .      doc-parse-args \$@
1793 .      as doc-out-string \&\*[doc-quote-left]
1794 .    \}
1795 .    el \{\
1796 .      \" no argument
1797 .      as doc-out-string \&\*[doc-quote-left]\*[doc-quote-right]
1798 .      doc-print-out-string
1799 .  \}\}
1801 .  if \n[doc-arg-limit] \{\
1802 .    nr doc-arg-ptr +1
1803 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1804 .      \" last argument
1805 .      as doc-out-string \&\*[doc-quote-right]
1806 .      doc-print-and-reset
1807 .    \}
1808 .    el \{\
1809 .      ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
1810 .        nr doc-reg-des (\n[doc-arg-limit] - 1)
1811 .        doc-skip-punct-backwards
1812 .        nr doc-reg-des +1
1813 .        ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\&\*[doc-arg\n[doc-reg-des]]
1814 .        nr doc-reg-des 0
1815 .      \}
1816 .      el \
1817 .        doc-append-arg "\*[doc-quote-right]" 3
1819 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
1820 .  \}\}
1824 .\" NS En user macro
1825 .\" NS   enclose arguments with quotation characters set up with `.Es'
1827 .als En doc-enclose-string
1830 .\" NS doc-skip-punct-backwards macro
1831 .\" NS   vector routine (for `doc-enclose-string': trace backwards past
1832 .\" NS   trailing punctuation)
1833 .\" NS
1834 .\" NS requires:
1835 .\" NS   doc-reg-des
1837 .de doc-skip-punct-backwards
1838 .  if (\n[doc-type\n[doc-reg-des]] == 3) \{\
1839 .    nr doc-reg-des -1
1840 .    doc-skip-punct-backwards
1841 .  \}
1845 .\" NS Ao user macro
1846 .\" NS   angle open
1847 .\" NS
1848 .\" NS modifies:
1849 .\" NS   doc-macro-name, doc-quote-left
1850 .\" NS
1851 .\" NS width register `Ao' set in doc-common
1853 .de Ao
1854 .  if !\n[doc-arg-limit] \
1855 .    ds doc-macro-name Ao
1857 .  ds doc-quote-left <
1859 .  doc-enclose-open \$@
1863 .\" NS Ac user macro
1864 .\" NS   angle close
1865 .\" NS
1866 .\" NS modifies:
1867 .\" NS   doc-macro-name, doc-quote-right
1868 .\" NS
1869 .\" NS width register `Ac' set in doc-common
1871 .de Ac
1872 .  if !\n[doc-arg-limit] \
1873 .    ds doc-macro-name Ac
1875 .  ds doc-quote-right >
1877 .  doc-enclose-close \$@
1881 .\" NS Bo user macro
1882 .\" NS   bracket open
1883 .\" NS
1884 .\" NS modifies:
1885 .\" NS   doc-macro-name, doc-quote-left
1886 .\" NS
1887 .\" NS width register `Bo' set in doc-common
1889 .de Bo
1890 .  if !\n[doc-arg-limit] \
1891 .    ds doc-macro-name Bo
1893 .  ds doc-quote-left "\*[doc-left-bracket]
1895 .  doc-enclose-open \$@
1899 .\" NS Bc user macro
1900 .\" NS   bracket close
1901 .\" NS
1902 .\" NS modifies:
1903 .\" NS   doc-macro-name, doc-quote-right
1904 .\" NS
1905 .\" NS width register `Bc' set in doc-common
1907 .de Bc
1908 .  if !\n[doc-arg-limit] \
1909 .    ds doc-macro-name Bc
1911 .  ds doc-quote-right "\*[doc-right-bracket]
1913 .  doc-enclose-close \$@
1917 .\" NS Bro user macro
1918 .\" NS   brace open
1919 .\" NS
1920 .\" NS modifies:
1921 .\" NS   doc-macro-name, doc-quote-left
1922 .\" NS
1923 .\" NS width register `Bro' set in doc-common
1925 .de Bro
1926 .  if !\n[doc-arg-limit] \
1927 .    ds doc-macro-name Bo
1929 .  ds doc-quote-left {
1931 .  doc-enclose-open \$@
1935 .\" NS Brc user macro
1936 .\" NS   brace close
1937 .\" NS
1938 .\" NS modifies:
1939 .\" NS   doc-macro-name, doc-quote-right
1940 .\" NS
1941 .\" NS width register `Brc' set in doc-common
1943 .de Brc
1944 .  if !\n[doc-arg-limit] \
1945 .    ds doc-macro-name Bc
1947 .  ds doc-quote-right }
1949 .  doc-enclose-close \$@
1953 .\" NS Do user macro
1954 .\" NS   double quote open
1955 .\" NS
1956 .\" NS modifies:
1957 .\" NS   doc-macro-name, doc-quote-left
1958 .\" NS
1959 .\" NS width register `Do' set in doc-common
1961 .de Do
1962 .  if !\n[doc-arg-limit] \
1963 .    ds doc-macro-name Do
1965 .  ds doc-quote-left "\*[Lq]
1967 .  doc-enclose-open \$@
1971 .\" NS Dc user macro
1972 .\" NS   double quote close
1973 .\" NS
1974 .\" NS modifies:
1975 .\" NS   doc-macro-name, doc-quote-right
1976 .\" NS
1977 .\" NS width register `Dc' set in doc-common
1979 .de Dc
1980 .  if !\n[doc-arg-limit] \
1981 .    ds doc-macro-name Dc
1983 .  ds doc-quote-right "\*[Rq]
1985 .  doc-enclose-close \$@
1989 .\" NS Eo user macro
1990 .\" NS   enclose open (using first argument as beginning of enclosure)
1991 .\" NS
1992 .\" NS modifies:
1993 .\" NS   doc-macro-name, doc-quote-left
1994 .\" NS
1995 .\" NS width register `Eo' set in doc-common
1997 .de Eo
1998 .  if !\n[doc-arg-limit] \
1999 .    ds doc-macro-name Eo
2001 .  ds doc-quote-left "\$1
2003 .  shift
2004 .  doc-enclose-open \$@
2008 .\" NS Ec user macro
2009 .\" NS   enclose close (using first argument as end of enclosure)
2010 .\" NS
2011 .\" NS modifies:
2012 .\" NS   doc-macro-name, doc-quote-right
2013 .\" NS
2014 .\" NS width register `Ec' set in doc-common
2016 .de Ec
2017 .  if !\n[doc-arg-limit] \
2018 .    ds doc-macro-name Ec
2020 .  ds doc-quote-right "\$1
2022 .  shift
2023 .  doc-enclose-close \$@
2027 .\" NS Oo user macro
2028 .\" NS   option open
2029 .\" NS
2030 .\" NS modifies:
2031 .\" NS   doc-macro-name, doc-quote-left
2032 .\" NS
2033 .\" NS width register `Oo' set in doc-common
2035 .de Oo
2036 .  if !\n[doc-arg-limit] \
2037 .    ds doc-macro-name Oo
2039 .  ds doc-quote-left [
2041 .  doc-enclose-open \$@
2045 .\" NS Oc user macro
2046 .\" NS   option close
2047 .\" NS
2048 .\" NS modifies:
2049 .\" NS   doc-macro-name, doc-quote-right
2050 .\" NS
2051 .\" NS width register `Oc' set in doc-common
2053 .de Oc
2054 .  if !\n[doc-arg-limit] \
2055 .    ds doc-macro-name Oc
2057 .  ds doc-quote-right ]
2059 .  doc-enclose-close \$@
2063 .\" NS Po user macro
2064 .\" NS   parenthesis open
2065 .\" NS
2066 .\" NS modifies:
2067 .\" NS   doc-macro-name, doc-quote-left
2068 .\" NS
2069 .\" NS width register `Po' set in doc-common
2071 .de Po
2072 .  if !\n[doc-arg-limit] \
2073 .    ds doc-macro-name Po
2075 .  ds doc-quote-left "\*[doc-left-parenthesis]
2077 .  doc-enclose-open \$@
2081 .\" NS Pc user macro
2082 .\" NS   parenthesis close
2083 .\" NS
2084 .\" NS modifies:
2085 .\" NS   doc-macro-name, doc-quote-right
2086 .\" NS
2087 .\" NS width register `Pc' set in doc-common
2089 .de Pc
2090 .  if !\n[doc-arg-limit] \
2091 .    ds doc-macro-name Pc
2093 .  ds doc-quote-right "\*[doc-right-parenthesis]
2095 .  doc-enclose-close \$@
2099 .\" NS Qo user macro
2100 .\" NS   straight double quote open
2101 .\" NS
2102 .\" NS modifies:
2103 .\" NS   doc-macro-name, doc-quote-left
2104 .\" NS
2105 .\" NS width register `Qo' set in doc-common
2107 .de Qo
2108 .  if !\n[doc-arg-limit] \
2109 .    ds doc-macro-name Qo
2111 .  ds doc-quote-left "\*[q]
2113 .  doc-enclose-open \$@
2117 .\" NS Qc user macro
2118 .\" NS   straight double quote close
2119 .\" NS
2120 .\" NS modifies:
2121 .\" NS   doc-macro-name, doc-quote-right
2122 .\" NS
2123 .\" NS width register `Qc' set in doc-common
2125 .de Qc
2126 .  if !\n[doc-arg-limit] \
2127 .    ds doc-macro-name Qc
2129 .  ds doc-quote-right "\*[q]
2131 .  doc-enclose-close \$@
2135 .\" NS So user macro
2136 .\" NS   single quote open
2137 .\" NS
2138 .\" NS modifies:
2139 .\" NS   doc-macro-name, doc-quote-left
2140 .\" NS
2141 .\" NS width register `So' set in doc-common
2143 .de So
2144 .  if !\n[doc-arg-limit] \
2145 .    ds doc-macro-name So
2147 .  ds doc-quote-left "\*[doc-left-singlequote]
2149 .  doc-enclose-open \$@
2153 .\" NS Sc user macro
2154 .\" NS   single quote close
2155 .\" NS
2156 .\" NS modifies:
2157 .\" NS   doc-macro-name, doc-quote-right
2158 .\" NS
2159 .\" NS width register `Sc' set in doc-common
2161 .de Sc
2162 .  if !\n[doc-arg-limit] \
2163 .    ds doc-macro-name Sc
2165 .  ds doc-quote-right "\*[doc-right-singlequote]
2167 .  doc-enclose-close \$@
2171 .\" NS Xo user macro
2172 .\" NS   extend open
2173 .\" NS
2174 .\" NS modifies:
2175 .\" NS   doc-macro-name, doc-quote-left
2176 .\" NS
2177 .\" NS width register `Xo' set in doc-common
2179 .de Xo
2180 .  if !\n[doc-arg-limit] \
2181 .    ds doc-macro-name Xo
2183 .  ds doc-quote-left
2185 .  doc-enclose-open \$@
2189 .\" NS Xc user macro
2190 .\" NS   extend close
2191 .\" NS
2192 .\" NS modifies:
2193 .\" NS   doc-macro-name, doc-quote-right
2194 .\" NS
2195 .\" NS width register `Xc' set in doc-common
2197 .de Xc
2198 .  if !\n[doc-arg-limit] \
2199 .    ds doc-macro-name Xc
2201 .  ds doc-quote-right
2203 .  doc-enclose-close \$@
2207 .\" NS doc-nesting-level global register
2208 .\" NS   used by `doc-enclose-open' and `doc-enclose-close', `.Fo', and `.Fc'
2210 .nr doc-nesting-level 0
2213 .\" NS doc-in-list global register (bool)
2214 .\" NS   whether we are in (logical) .It
2216 .nr doc-in-list 0
2219 .\" NS doc-enclose-open macro
2220 .\" NS   enclose string open
2221 .\" NS
2222 .\" NS modifies:
2223 .\" NS   doc-arg-ptr, doc-out-string, doc-nesting-level
2225 .de doc-enclose-open
2226 .  nr doc-nesting-level +1
2228 .  ie \n[doc-arg-limit] \
2229 .    as doc-out-string \&\*[doc-quote-left]
2230 .  el \{\
2231 .    ie \n[.$] \{\
2232 .      \" was the last request on the previous line an opening request?
2233 .      if \n[doc-is-opening] \
2234 .        nr doc-no-space 1
2235 .      doc-parse-args \$@
2236 .      as doc-out-string \&\*[doc-quote-left]
2237 .    \}
2238 .    el \{\
2239 .      as doc-out-string \&\*[doc-quote-left]
2241 .      if !\n[doc-in-diversion] \
2242 .        if !(\n[doc-in-list] & \n[doc-nesting-level]) \
2243 .          if \n[doc-space-mode] \
2244 .            doc-save-and-divert
2245 .      nr doc-is-opening 1
2246 .  \}\}
2248 .  if \n[doc-arg-limit] \{\
2249 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
2250 .      \" last argument
2251 .      doc-reset-args
2252 .      nr doc-is-opening 1
2253 .    \}
2254 .    el \{\
2255 .      nr doc-arg-ptr +1
2256 .      ie (\n[doc-type\n[doc-arg-ptr]] == 1) \
2257 .        \*[doc-arg\n[doc-arg-ptr]]
2258 .      el \{\
2259 .        nr doc-arg-ptr -1
2260 .        No
2261 .  \}\}\}
2265 .\" NS doc-enclose-close macro
2266 .\" NS   enclose string close
2267 .\" NS
2268 .\" NS modifies:
2269 .\" NS   doc-out-string, doc-nesting-level
2270 .\" NS
2271 .\" NS local variables:
2272 .\" NS   doc-str-dec
2274 .de doc-enclose-close
2275 .  nr doc-nesting-level -1
2277 .  as doc-out-string \&\*[doc-quote-right]
2279 .  if !\n[doc-arg-limit] \{\
2280 .    ie \n[.$] \{\
2281 .      nr doc-no-space 1
2282 .      doc-parse-args \$@
2283 .    \}
2284 .    el \
2285 .      doc-print-out-string
2286 .  \}
2288 .  if \n[doc-arg-limit] \{\
2289 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
2290 .      \" last argument
2291 .      ie \n[doc-nesting-level] \
2292 .        doc-reset-args
2293 .      el \
2294 .        doc-print-and-reset
2295 .    \}
2296 .    el \{\
2297 .      nr doc-str-dec (\n[doc-arg-ptr] + 1)
2298 .      if (\n[doc-type\n[doc-str-dec]] == 2) \
2299 .        as doc-out-string "\*[doc-space\n[doc-arg-limit]]
2300 .      No
2301 .  \}\}
2303 .  \" shall we finish .It request?
2304 .  if !"\*[doc-macro-name]"It" \
2305 .    if \n[doc-in-list] \
2306 .      if !\n[doc-nesting-level] \
2307 .        doc-\*[doc-list-type-stack\n[doc-list-depth]]
2311 .\" NS Pf user macro
2312 .\" NS   prefix: `.Pf prefix arg ...'
2313 .\" NS
2314 .\" NS modifies:
2315 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-quote-left
2316 .\" NS
2317 .\" NS width register `Pf' set in doc-common
2319 .de Pf
2320 .  if !\n[doc-arg-limit] \
2321 .    ds doc-macro-name Pf
2323 .  ds doc-quote-left "\$1
2325 .  shift
2327 .  ie \n[doc-arg-limit] \{\
2328 .    ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
2329 .      nr doc-arg-ptr +1
2330 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2331 .    \}
2332 .    el \
2333 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
2334 .  \}
2335 .  el \{\
2336 .    as doc-out-string \&\*[doc-quote-left]
2337 .    ie (\n[.$] < 2) \{\
2338 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
2339 .      doc-print-out-string
2340 .    \}
2341 .    el \
2342 .      doc-parse-args \$@
2343 .  \}
2345 .  if \n[doc-arg-limit] \{\
2346 .    nr doc-arg-ptr +1
2347 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
2348 .      doc-print-and-reset
2349 .    el \
2350 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
2351 .  \}
2355 .\" NS Ns user macro
2356 .\" NS   remove space (space removal done by `doc-parse-args')
2357 .\" NS
2358 .\" NS modifies:
2359 .\" NS   doc-macro-name
2360 .\" NS
2361 .\" NS width register `Ns' set in doc-common
2363 .de Ns
2364 .  if !\n[doc-arg-limit] \{\
2365 .    ds doc-macro-name Ns
2366 .    ie \n[.$] \
2367 .      doc-parse-args \$@
2368 .    el \
2369 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2370 .  \}
2372 .  No
2376 .\" NS Ap user macro
2377 .\" NS   append an apostrophe
2378 .\" NS
2379 .\" NS modifies:
2380 .\" NS   doc-out-string
2381 .\" NS
2382 .\" NS width register `Ap' set in doc-common
2384 .de Ap
2385 .  if !\n[doc-arg-limit] \
2386 .    tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2388 .  as doc-out-string \&'
2389 .  No
2393 .\" NS doc-space global string
2394 .\" NS   current inter-argument space
2396 .ds doc-space "\*[doc-soft-space]
2399 .\" NS doc-soft-space constant string
2400 .\" NS   soft (stretchable) space (defined in doc-common)
2403 .\" NS doc-hard-space constant string
2404 .\" NS   hard (unpaddable) space (defined in doc-common)
2407 .\" NS doc-set-hard-space macro
2408 .\" NS   set current space string to hard (unpaddable) space.
2409 .\" NS
2410 .\" NS modifies:
2411 .\" NS   doc-space
2413 .de doc-set-hard-space
2414 .  ds doc-space "\*[doc-hard-space]
2418 .\" NS doc-set-soft-space macro
2419 .\" NS   set current space string to soft space (troff limitation)
2420 .\" NS
2421 .\" NS modifies:
2422 .\" NS   doc-space
2424 .de doc-set-soft-space
2425 .  ds doc-space "\*[doc-soft-space]
2429 .\" NS doc-space-mode global register (bool)
2430 .\" NS   default is one (space mode on)
2432 .nr doc-space-mode 1
2435 .\" NS Sm user macro
2436 .\" NS   space mode (`.Sm'/`.Sm on'/`.Sm off')
2437 .\" NS
2438 .\" NS   without argument, toggle space mode
2439 .\" NS
2440 .\" NS modifies:
2441 .\" NS   doc-macro-name, doc-arg-limit, doc-num-args, doc-arg-ptr,
2442 .\" NS   doc-argXXX, doc-spaceXXX, doc-curr-space, doc-space-mode,
2443 .\" NS   doc-space
2444 .\" NS
2445 .\" NS width register `Sm' set in doc-common
2446 .\" NS
2447 .\" NS local variables:
2448 .\" NS   doc-reg-Sm
2450 .de Sm
2451 .  if !\n[doc-arg-limit] \{\
2452 .    ie \n[.$] \{\
2453 .      ds doc-macro-name Sm
2454 .      doc-parse-args \$@
2455 .    \}
2456 .    el \{\
2457 .      ie \n[doc-space-mode] \
2458 .        nr doc-space-mode 0
2459 .      el \
2460 .        nr doc-space-mode 1
2461 .  \}\}
2463 .  if \n[doc-arg-limit] \{\
2464 .    nr doc-arg-ptr +1
2466 .    \" avoid a warning message in case `Sm' is the last parameter
2467 .    if !d doc-arg\n[doc-arg-ptr] \
2468 .      ds doc-arg\n[doc-arg-ptr]
2470 .    ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2471 .      ds doc-space "\*[doc-soft-space]
2472 .      nr doc-space-mode 1
2473 .    \}
2474 .    el \{\
2475 .      ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2476 .        ds doc-space
2477 .        ds doc-curr-space
2478 .        nr doc-space-mode 0
2479 .      \}
2480 .      el \{\
2481 .        \" no argument for Sm
2482 .        nr doc-arg-ptr -1
2483 .        ie \n[doc-space-mode] \
2484 .          nr doc-space-mode 0
2485 .        el \
2486 .          nr doc-space-mode 1
2487 .    \}\}
2489 .    ie \n[doc-space-mode] \{\
2490 .      \" recompute space vector for remaining arguments
2491 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2492 .      nr doc-arg-limit \n[doc-arg-ptr]
2493 .      nr doc-reg-Sm \n[doc-arg-ptr]
2494 .      if \n[doc-num-args] \{\
2495 .        doc-parse-arg-vector
2496 .        nr doc-arg-ptr \n[doc-reg-Sm]
2497 .    \}\}
2498 .    el \{\
2499 .      \" reset remaining space vector elements
2500 .      nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2501 .      while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2502 .        ds doc-space\n[doc-reg-Sm]
2503 .        nr doc-reg-Sm +1
2504 .        \" the body of a `while' request must end with the fitting `\}'!
2505 .      \}
2506 .    \}
2508 .    \" do we have parameters to print?
2509 .    ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2510 .      \" ignore `.Sm on' and `.Sm off' without additional parameters
2511 .      ie (\n[doc-arg-ptr] > 1) \
2512 .        doc-print-and-reset
2513 .      el \
2514 .        doc-reset-args
2515 .    \}
2516 .    el \{\
2517 .      \" skip `Sm' argument
2518 .      nr doc-arg-ptr +1
2519 .      doc-print-recursive
2520 .  \}\}
2524 .\" NS doc-arg-type immediate register
2525 .\" NS   argument type (macro=1, string=2, punctuation suffix=3,
2526 .\" NS   punctuation prefix=4)
2528 .nr doc-arg-type 0
2531 .\" NS doc-get-arg-type macro
2532 .\" NS   get argument type
2533 .\" NS
2534 .\" NS   this macro expects the width of the argument in `doc-width'
2535 .\" NS
2536 .\" NS modifies:
2537 .\" NS   doc-arg-type
2539 .de doc-get-arg-type
2540 .  nr doc-arg-type 2
2542 .  if ((\n[doc-width] < 4) & \A\a\$1\a) \{\
2543 .    ie (\n[doc-width] == 1) \{\
2544 .      if r doc-punct\$1 \
2545 .        nr doc-arg-type \n[doc-punct\$1]
2546 .    \}
2547 .    el \
2548 .      if r \$1 \
2549 .        if d \$1 \
2550 .          nr doc-arg-type 1
2551 .  \}
2555 .\" NS doc-get-arg-type* macro
2556 .\" NS   similar to as `doc-get-arg-type' but uses doc-argXXX strings
2557 .\" NS
2558 .\" NS   this macro sets the `doc-width' register using the `length' request
2559 .\" NS   to get the number of characters in a string literally
2560 .\" NS
2561 .\" NS modifies:
2562 .\" NS   doc-arg-type, doc-width
2564 .de doc-get-arg-type*
2565 .  nr doc-arg-type 2
2566 .  length doc-width "\*[doc-arg\$1]
2568 .  if ((\n[doc-width] < 4) & \A\a\*[doc-arg\$1]\a) \{\
2569 .    ie (\n[doc-width] == 1) \{\
2570 .      if r doc-punct\*[doc-arg\$1] \
2571 .        nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
2572 .    \}
2573 .    el \
2574 .      if r \*[doc-arg\$1] \
2575 .        if d \*[doc-arg\$1] \
2576 .          nr doc-arg-type 1
2577 .  \}
2581 .\" NS doc-set-spacing-1 macro
2582 .\" NS   set spacing for macros
2583 .\" NS
2584 .\" NS modifies:
2585 .\" NS   doc-spaceXXX
2586 .\" NS
2587 .\" NS local variables:
2588 .\" NS   doc-reg-dssfm, doc-reg-dssfm1
2590 .de doc-set-spacing-1
2591 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2593 .  \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2594 .  \" argument)
2595 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2596 .    nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2597 .    ds doc-space\n[doc-reg-dssfm]
2598 .    ds doc-space\n[doc-arg-limit] "\*[doc-space]
2599 .  \}
2600 .  el \{\
2601 .    \" macros like .Ap and .Ns have value 2 (remove space before and after
2602 .    \" argument)
2603 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2604 .      nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2605 .      ds doc-space\n[doc-reg-dssfm]
2606 .      ds doc-space\n[doc-arg-limit]
2607 .    \}
2608 .    el \
2609 .      ds doc-space\n[doc-arg-limit]
2610 .  \}
2614 .\" NS doc-set-spacing-2 macro
2615 .\" NS   set spacing for strings
2616 .\" NS
2617 .\" NS modifies:
2618 .\" NS   doc-spaceXXX
2620 .de doc-set-spacing-2
2621 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2625 .\" NS doc-set-spacing-3 macro
2626 .\" NS   set spacing for punctuation suffixes
2627 .\" NS
2628 .\" NS modifies:
2629 .\" NS   doc-spaceXXX
2630 .\" NS
2631 .\" NS local variables:
2632 .\" NS   doc-reg-dssfps
2634 .de doc-set-spacing-3
2635 .  if \n[doc-arg-limit] \{\
2636 .    nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2637 .    ds doc-space\n[doc-reg-dssfps]
2638 .  \}
2640 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2644 .\" NS doc-set-spacing-4 macro
2645 .\" NS   set spacing for punctuation prefixes
2646 .\" NS
2647 .\" NS modifies:
2648 .\" NS   doc-spaceXXX
2650 .de doc-set-spacing-4
2651 .  ds doc-space\n[doc-arg-limit]
2655 .\" type switches (on current argument doc-arg-ptr)
2658 .\" NS doc-do-1 macro
2659 .\" NS   call request if macro
2661 .de doc-do-1
2662 .  \*[doc-arg\n[doc-arg-ptr]]
2666 .\" NS doc-do-2 macro
2667 .\" NS   call .No if string
2668 .\" NS
2669 .\" NS modifies:
2670 .\" NS   doc-arg-ptr
2672 .de doc-do-2
2673 .  nr doc-arg-ptr -1
2674 .  No
2678 .\" NS doc-do-3 macro
2679 .\" NS   call .No if punctuation suffix
2680 .\" NS
2681 .\" NS modifies:
2682 .\" NS   doc-arg-ptr
2684 .de doc-do-3
2685 .  nr doc-arg-ptr -1
2686 .  No
2690 .\" NS doc-do-4 macro
2691 .\" NS   call .No if punctuation prefix
2692 .\" NS
2693 .\" NS modifies:
2694 .\" NS   doc-arg-ptr
2696 .de doc-do-4
2697 .  nr doc-arg-ptr -1
2698 .  No
2702 .\" NS doc-do-xref-1 macro
2703 .\" NS   ignore if macro
2705 .de doc-do-xref-1
2709 .\" NS doc-do-xref-2 macro
2710 .\" NS   ignore if string
2712 .de doc-do-xref-2
2716 .\" NS doc-do-xref-3 macro
2717 .\" NS   append if punctuation suffix
2718 .\" NS
2719 .\" NS modifies:
2720 .\" NS   doc-arg-ptr, doc-out-string
2722 .de doc-do-xref-3
2723 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2724 .  nr doc-arg-ptr +1
2725 .  \" XXX: ?
2726 .  n\\C\\n(aP
2730 .\" NS doc-do-xref-4 macro
2731 .\" NS   append if punctuation prefix
2732 .\" NS
2733 .\" NS modifies:
2734 .\" NS   doc-arg-ptr, doc-out-string
2736 .de doc-do-xref-4
2737 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2738 .  nr doc-arg-ptr +1
2739 .  \" XXX: ?
2740 .  n\\C\\n(aP
2744 .\" NS doc-curr-font-for-Ef global register
2745 .\" NS   saved current font from `Bf' request
2747 .nr doc-curr-font-for-Ef 0
2750 .\" NS doc-curr-size-for-Ef global register
2751 .\" NS   saved current size from `Bf' request
2753 .nr doc-curr-size-for-Ef 0
2756 .\" NS Bf user macro
2757 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2758 .\" NS
2759 .\" NS modifies:
2760 .\" NS   doc-macro-name, doc-curr-font-for-Ef, doc-curr-size-for-Ef
2761 .\" NS
2762 .\" NS width register `Bf' set in doc-common
2764 .de Bf
2765 .  ds doc-macro-name Bf
2767 .  ie \n[.$] \{\
2768 .    nr doc-curr-font-for-Ef \n[.f]
2769 .    nr doc-curr-size-for-Ef \n[.s]
2771 .    ie        "\$1"Em" \
2772 .      nop \*[doc-Em-font]\c
2773 .    el \{ .ie "\$1"Li" \
2774 .      nop \*[doc-Li-font]\c
2775 .    el \{ .ie "\$1"Sy" \
2776 .      nop \*[doc-Sy-font]\c
2777 .    el \{ .ie "\$1"-emphasis" \
2778 .      nop \*[doc-Em-font]\c
2779 .    el \{ .ie "\$1"-literal" \
2780 .      nop \*[doc-Li-font]\c
2781 .    el \{ .ie "\$1"-symbolic" \
2782 .      nop \*[doc-Sy-font]\c
2783 .    el \{\
2784 .      tmc mdoc warning: Unknown keyword `\$1' in .Bf request
2785 .      tm1 " (#\n[.c])
2786 .  \}\}\}\}\}\}\}
2787 .  el \
2788 .    tm Usage .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2792 .\" NS Ef user macro
2793 .\" NS   end font mode
2794 .\" NS
2795 .\" NS modifies:
2796 .\" NS   doc-macro-name
2797 .\" NS
2798 .\" NS width register `Ef' set in doc-common
2800 .de Ef
2801 .  ds doc-macro-name Ef
2803 .  ie \n[.$] \
2804 .    tm Usage .Ef (does not take arguments) (#\n[.c])
2805 .  el \
2806 .    nop \&\f[\n[doc-curr-font-for-Ef]]\s[\n[doc-curr-size-for-Ef]]
2810 .\" NS doc-keep-type global string
2811 .\" NS   current keep type
2813 .ds doc-keep-type
2816 .\" NS Bk user macro
2817 .\" NS   begin keep
2818 .\" NS
2819 .\" NS modifies:
2820 .\" NS   doc-macro-name, doc-keep-type
2821 .\" NS
2822 .\" NS width register `Bk' set in doc-common
2824 .de Bk
2825 .  ds doc-keep-type
2827 .  ds doc-macro-name Bk
2829 .  ie \n[.$] \{\
2830 .    if !"\*[doc-keep-type]"" \
2831 .      tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2832 .    ie "\$1"-lines" \
2833 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2834 .    el \{\
2835 .      ie "\$1"-words" \
2836 .        doc-set-hard-space
2837 .      el \
2838 .        tm mdoc warning: Unknown keyword `\$1' in .Bk request (#\n[.c])
2839 .    \}
2841 .    ds doc-keep-type \$1
2842 .  \}
2843 .  el \
2844 .    tm Usage: .Bk [-lines | -words] (#\n[.c])
2848 .\" NS Ek user macro
2849 .\" NS   end keep
2850 .\" NS
2851 .\" NS modifies:
2852 .\" NS   doc-macro-name
2853 .\" NS
2854 .\" NS width register `Ek' set in doc-common
2856 .de Ek
2857 .  ds doc-macro-name Ek
2859 .  ie \n[.$] \
2860 .    tm Usage .Ek (does not take arguments) (#\n[.c])
2861 .  el \{\
2862 .    ie "\*[doc-keep-type]"-words" \
2863 .      doc-set-soft-space
2864 .    el \
2865 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2866 .  \}
2870 .\" NS doc-display-depth global register
2871 .\" NS   display level
2873 .nr doc-display-depth 0
2876 .\" NS doc-is-compact global register (bool)
2877 .\" NS   set if the `compact' keyword is given
2879 .nr doc-is-compact 0
2882 .\" NS doc-display-type-stackXXX global string
2883 .\" NS   the display type stack
2884 .\" NS
2885 .\" NS   limit: doc-display-depth
2887 .ds doc-display-type-stack0
2890 .\" NS doc-display-indent-stackXXX global register
2891 .\" NS   stack of display indentation values
2892 .\" NS
2893 .\" NS   limit: doc-display-depth
2895 .nr doc-display-indent-stack0 0
2898 .\" NS Bd user macro
2899 .\" NS   begin display
2900 .\" NS
2901 .\" NS width register `Bd' set in doc-common
2902 .\" NS
2903 .\" NS modifies:
2904 .\" NS   doc-macro-name, doc-curr-font, doc-curr-size, doc-display-depth,
2905 .\" NS   doc-is-compact, doc-display-type-stackXXX,
2906 .\" NS   doc-display-indent-stackXXX
2907 .\" NS
2908 .\" NS local variables:
2909 .\" NS   doc-reg-Bd
2911 .de Bd
2912 .  ds doc-macro-name Bd
2914 .  ie \n[.$] \{\
2915 .    nr doc-is-compact 0
2916 .    nr doc-reg-Bd 1
2917 .    nr doc-display-depth +1
2919 .    ie        "\$1"-literal" \{\
2920 .      ds doc-display-type-stack\n[doc-display-depth] literal
2921 .      nr doc-curr-font \n[.f]
2922 .      nr doc-curr-size \n[.s]
2924 .      ie t \{\
2925 .        nop \*[doc-Li-font]\c
2926 '        ta T 9n
2927 .      \}
2928 .      el \
2929 '        ta T 8n
2930 .      nf
2931 .    \}
2932 .    el \{ .ie "\$1"-filled" \{\
2933 .      ds doc-display-type-stack\n[doc-display-depth] filled
2934 .      br
2935 .    \}
2936 .    el \{ .ie "\$1"-ragged" \{\
2937 .      ds doc-display-type-stack\n[doc-display-depth] ragged
2938 .      na
2939 .    \}
2940 .    el \{ .ie "\$1"-unfilled" \{\
2941 .      ds doc-display-type-stack\n[doc-display-depth] unfilled
2942 .      nf
2943 .    \}
2944 .    el \{\
2945 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2946 .      nr doc-reg-Bd 0
2947 .    \}\}\}\}
2949 .    \" have we seen an argument?
2950 .    if \n[doc-reg-Bd] \{\
2951 .      shift
2952 .      \" check other arguments
2953 .      if \n[.$] \
2954 .        doc-do-Bd-args \$@
2955 .    \}
2957 .    \" avoid warning about non-existent register
2958 .    if !r doc-display-indent-stack\n[doc-display-depth] \
2959 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2961 .    if \n[doc-display-indent-stack\n[doc-display-depth]] \
2962 '      in +\n[doc-display-indent-stack\n[doc-display-depth]]u
2964 .    if !\n[doc-is-compact] \{\
2965 .      if !\n[doc-in-synopsis-count] \{\
2966 .        ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2967 .          sp \n[doc-display-vertical]u
2968 .        el \
2969 '          sp \n[doc-display-vertical]u
2970 .    \}\}
2972 .    if !\n[cR] \
2973 .      ne 2v
2975 .    nr doc-is-compact 0
2976 .  \}
2977 .  el \{\
2978 .    tm1 "Usage: .Bd [-literal | -filled | -ragged | -unfilled]
2979 .    tm1 "           [-offset [string]] [-compact] (#\n[.c])
2980 .  \}
2984 .\" NS doc-do-Bd-args macro
2985 .\" NS   resolve remaining .Bd arguments
2986 .\" NS
2987 .\" NS modifies:
2988 .\" NS   doc-is-compact, doc-display-indent-stackXXX
2989 .\" NS
2990 .\" NS local variables:
2991 .\" NS   doc-str-ddBa, doc-reg-ddBa
2993 .de doc-do-Bd-args
2994 .  nr doc-reg-ddBa 1
2995 .  ds doc-str-ddBa
2997 .  ie        "\$1"-offset" \{\
2998 .    ds doc-str-ddBa "\$2
2999 .    nr doc-reg-ddBa 2
3001 .    ie        "\$2"left" \
3002 .      nr doc-display-indent-stack\n[doc-display-depth] 0
3003 .    el \{ .ie "\$2"right" \
3004 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
3005 .    el \{ .ie "\$2"center" \
3006 .      nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
3007 .    el \{ .ie "\$2"indent" \
3008 .      nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
3009 .    el \{ .ie "\$2"indent-two" \
3010 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
3011 .    el \
3012 .      nr doc-reg-ddBa 1
3013 .    \}\}\}\}
3015 .    \" not a known keyword
3016 .    if (\n[doc-reg-ddBa] == 1) \{\
3017 .      nr doc-reg-ddBa 2
3018 .      \" test whether argument is a valid numeric expression
3019 .      ie \B\a\$2\a \
3020 .        nr doc-display-indent-stack\n[doc-display-depth] \$2
3021 .      el \{\
3022 .        doc-get-width "\$2"
3023 .        ie (\n[doc-width] == 2) \{\
3024 .          \" if the offset parameter is a macro, use the macro's
3025 .          \" width as specified in doc-common
3026 .          doc-get-arg-type "\$2"
3027 .          ie (\n[doc-arg-type] == 1) \
3028 .            nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
3029 .          el \
3030 .            nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3031 .        \}
3032 .        el \
3033 .          nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3034 .    \}\}
3035 .  \}
3036 .  el \{ .ie "\$1"-compact" \
3037 .    nr doc-is-compact 1
3038 .  el \
3039 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
3040 .  \}
3042 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
3043 .    \" have we seen `-offset' or `-compact'?
3044 .    ie "\*[doc-str-ddBa]"" \{\
3045 .      shift
3046 .      doc-do-Bd-args \$@
3047 .    \}
3048 .    el \{\
3049 .      shift 2
3050 .      doc-do-Bd-args \$@
3051 .  \}\}
3055 .\" NS Ed user macro
3056 .\" NS   end display
3057 .\" NS
3058 .\" NS modifies:
3059 .\" NS   doc-macro-name, doc-display-depth, doc-display-type-stackXXX,
3060 .\" NS   doc-display-indent-stackXXX
3061 .\" NS
3062 .\" NS width register `Ed' set in doc-common
3064 .de Ed
3065 .  ds doc-macro-name Ed
3067 .  br
3069 .  if !\n[doc-display-depth] \
3070 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
3072 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
3073 .    ft \n[doc-curr-font]
3074 .    ps \n[doc-curr-size]
3075 .  \}
3077 .  in -\n[doc-display-indent-stack\n[doc-display-depth]]u
3079 .  nr doc-display-indent-stack\n[doc-display-depth] 0
3080 .  ds doc-display-type-stack\n[doc-display-depth]
3081 .  nr doc-display-depth -1
3083 .  fi
3084 .  if t \
3085 .    ad
3089 .\" NS doc-list-type-stackXXX global string
3090 .\" NS   stack of list types
3091 .\" NS
3092 .\" NS   limit: doc-list-depth
3094 .ds doc-list-type-stack1
3097 .\" NS doc-list-indent-stackXXX global register
3098 .\" NS   stack of list indentation values
3099 .\" NS
3100 .\" NS   limit: doc-list-depth
3102 .nr doc-list-indent-stack1 0
3105 .\" NS doc-have-indent global register (bool)
3106 .\" NS   an indentation value is active
3108 .nr doc-have-indent 0
3111 .\" NS Bl user macro
3112 .\" NS   begin list
3113 .\" NS
3114 .\" NS width register `Bl' set in doc-common
3115 .\" NS
3116 .\" NS modifies:
3117 .\" NS   doc-macro-name, doc-num-args, doc-arg-ptr, doc-argXXX,
3118 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX, doc-have-indent,
3119 .\" NS   doc-have-diag-list, doc-num-columns, doc-list-depth
3120 .\" NS
3121 .\" NS local variables:
3122 .\" NS   doc-reg-Bl
3124 .de Bl
3125 .  ie \n[.$] \{\
3126 .    ds doc-macro-name Bl
3127 .    nr doc-list-depth +1
3128 .    nr doc-arg-ptr 1
3130 .    ie        "\$1"-hang" \{\
3131 .      ds doc-list-type-stack\n[doc-list-depth] hang-list
3132 .      nr doc-list-indent-stack\n[doc-list-depth] 6n
3133 .      nr doc-have-indent 1
3134 .    \}
3135 .    el \{ .ie "\$1"-tag" \{\
3136 .      ds doc-list-type-stack\n[doc-list-depth] tag-list
3137 .      nr doc-have-indent 1
3138 .    \}
3139 .    el \{ .ie "\$1"-item" \{\
3140 .      ds doc-list-type-stack\n[doc-list-depth] item-list
3141 .      nr doc-have-indent 1
3142 .    \}
3143 .    el \{ .ie "\$1"-enum" \{\
3144 .      ds doc-list-type-stack\n[doc-list-depth] enum-list
3145 .      nr doc-list-indent-stack\n[doc-list-depth] 3n
3146 .      nr doc-have-indent 1
3147 .    \}
3148 .    el \{ .ie "\$1"-bullet" \{\
3149 .      ds doc-list-type-stack\n[doc-list-depth] bullet-list
3150 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3151 .      nr doc-have-indent 1
3152 .    \}
3153 .    el \{ .ie "\$1"-dash" \{\
3154 .      ds doc-list-type-stack\n[doc-list-depth] dash-list
3155 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3156 .      nr doc-have-indent 1
3157 .    \}
3158 .    el \{ .ie "\$1"-hyphen" \{\
3159 .      ds doc-list-type-stack\n[doc-list-depth] dash-list
3160 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3161 .      nr doc-have-indent 1
3162 .    \}
3163 .    el \{ .ie "\$1"-inset" \{\
3164 .      ds doc-list-type-stack\n[doc-list-depth] inset-list
3165 .      nr doc-have-indent 1
3166 .    \}
3167 .    el \{ .ie "\$1"-diag" \{\
3168 .      ds doc-list-type-stack\n[doc-list-depth] diag-list
3169 .      nr doc-have-diag-list 1
3170 .    \}
3171 .    el \{ .ie "\$1"-ohang" \{\
3172 .      ds doc-list-type-stack\n[doc-list-depth] ohang-list
3173 .      nr doc-have-indent 1
3174 .    \}
3175 .    el \{ .ie "\$1"-column" \
3176 .      ds doc-list-type-stack\n[doc-list-depth] column-list
3177 .    el \{\
3178 .      tm mdoc warning: Unknown list type `\$1' in .Bl request
3179 .      tm
3180 .      nr doc-arg-ptr 0
3181 .    \}\}\}\}\}\}\}\}\}\}\}
3183 .    \" we have seen a list type
3184 .    ie \n[doc-arg-ptr] \{\
3185 .      shift
3187 .      \" fill argument vector
3188 .      nr doc-reg-Bl 1
3189 .      while (\n[doc-reg-Bl] <= \n[.$]) \{\
3190 .        ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
3191 .        nr doc-reg-Bl +1
3192 .      \}
3194 .      doc-increment-list-stack
3196 .      if \n[.$] \{\
3197 .        nr doc-arg-limit \n[.$]
3198 .        nr doc-arg-ptr 0
3199 .        doc-do-Bl-args
3201 .        \" initialize column list
3202 .        if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3203 .          doc-set-column-tab \n[doc-num-columns]
3204 .          nr doc-list-indent-stack\n[doc-list-depth] 0
3205 '          in -\n[doc-column-indent-width]u
3206 .          if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3207 .            sp \n[doc-display-vertical]u
3209 .          nf
3210 .          nr doc-num-columns 0
3211 .    \}\}\}
3212 .    el \
3213 .      doc-Bl-usage
3215 .    doc-reset-args
3216 .  \}
3217 .  el \
3218 .    doc-Bl-usage
3222 .\" NS doc-Bl-usage macro
3224 .de doc-Bl-usage
3225 .  tm1 "Usage: .Bl [-hang | -ohang | -tag | -diag | -inset]
3226 .  tm1 "             [-width [string]] [-offset [string]] [-compact]
3227 .  tm1 "       .Bl [-column] [-offset [string]] [string1] [string2] ...
3228 .  tm1 "       .Bl [-item | -enum | -bullet | -hyphen | -dash]
3229 .  tm1 "             [-offset [string]] [-compact] (#\n[.c])
3233 .\" NS doc-have-tag-width global macro
3234 .\" NS   set if a tag width has been explicitly given
3236 .nr doc-have-tag-width 0
3239 .\" NS doc-do-Bl-args macro
3240 .\" NS   resolve remaining .Bl arguments
3241 .\" NS
3242 .\" NS modifies:
3243 .\" NS   doc-arg-ptr, doc-argXXX, doc-list-indent-stackXXX, doc-num-columns,
3244 .\" NS   doc-compact-list-stackXXX, doc-have-tag-width,
3245 .\" NS   doc-tag-width-stackXXX, doc-list-offset-stackXXX
3246 .\" NS
3247 .\" NS local variables:
3248 .\" NS   doc-str-dBla, doc-reg-dBla
3250 .de doc-do-Bl-args
3251 .  nr doc-arg-ptr +1
3252 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
3253 .    nr doc-reg-dBla 1
3255 .    ie        "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3256 .      nr doc-compact-list-stack\n[doc-list-depth] 1
3257 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3258 .      nr doc-arg-ptr +1
3259 .      \" XXX: this code should be modified to handle nested lists
3260 .      \"      of any type
3261 .      nr doc-have-tag-width 1
3262 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3263 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3265 .      \" test whether argument is a valid numeric expression
3266 .      ie \B\a\*[doc-str-dBla]\a \
3267 .        nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]
3268 .      el \{\
3269 .        doc-get-arg-width \n[doc-arg-ptr]
3270 .        ie (\n[doc-width] == 2) \{\
3271 .          \" if the width parameter is a macro, use the macro's
3272 .          \" width as specified in doc-common
3273 .          doc-get-arg-type \*[doc-str-dBla]
3274 .          ie (\n[doc-arg-type] == 1) \
3275 .            nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3276 .          el \
3277 .            nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3278 .        \}
3279 .        el \
3280 .          nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3281 .    \}\}
3282 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
3283 .      nr doc-arg-ptr +1
3284 .      \" XXX: this code should be modified to handle nested lists
3285 .      \"      of any type
3286 .      nr doc-have-tag-width 1
3287 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3289 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3290 .      substring doc-str-dBla 1 2
3291 .      if \a.\a\*[doc-str-dBla]\a \{\
3292 .        doc-save-global-vars
3293 .        nr doc-in-diversion 0
3294 .        ds doc-out-string
3295 .        doc-dry-execute "\*[doc-arg\n[doc-arg-ptr]]"
3296 .        \" save doc-out-string
3297 .        ds doc-str-dBla "\*[doc-out-string]
3298 .        doc-restore-global-vars
3299 .        doc-get-width "\*[doc-str-dBla]"
3300 .      \}
3301 .      nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3302 .    \}
3303 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3304 .      nr doc-arg-ptr +1
3306 .      ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3307 .        nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3308 .      el \{\
3309 .        ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3311 .        ie \B\a\*[doc-str-dBla]\a \
3312 .          nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3313 .        el \{\
3314 .          doc-get-arg-width \n[doc-arg-ptr]
3315 .          ie (\n[doc-width] == 2) \{\
3316 .            doc-get-arg-type \*[doc-str-dBla]
3317 .            ie (\n[doc-arg-type] == 1) \
3318 .              nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3319 .            el \
3320 .              nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3321 .          \}
3322 .          el \
3323 .            nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3324 .    \}\}\}
3325 .    el \
3326 .      nr doc-reg-dBla 0
3327 .    \}\}\}
3329 .    \" not a known keyword, so it specifies the width of the next column
3330 .    \" (if it is a column list)
3331 .    if !\n[doc-reg-dBla] \{\
3332 .      ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3333 .        nr doc-num-columns +1
3334 .        ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3335 .      \}
3336 .      el \{\
3337 .        tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3338 .        tm1 " in .Bl request (#\n[.c])
3339 .    \}\}
3341 .    if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3342 .      doc-do-Bl-args
3343 .  \}
3347 .\" NS doc-save-global-vars macro
3348 .\" NS   save all global variables
3349 .\" NS
3350 .\" NS local variables:
3351 .\" NS   doc-reg-dsgv
3353 .de doc-save-global-vars
3354 .  nr doc-debug-saved \n[doc-debug]
3355 .  ds doc-macro-name-saved "\*[doc-macro-name]
3356 .  nr doc-arg-limit-saved \n[doc-arg-limit]
3357 .  nr doc-num-args-saved \n[doc-num-args]
3358 .  nr doc-arg-ptr-saved \n[doc-arg-ptr]
3360 .  nr doc-reg-dsgv 1
3361 .  while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3362 .    ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3363 .    nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
3364 .    ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3365 .    nr doc-reg-dsgv +1
3366 .  \}
3368 .  ds doc-out-string-saved "\*[doc-out-string]
3369 .  ds doc-curr-space-saved "\*[doc-curr-space]
3370 .  ds doc-saved-out-string-saved "\*[doc-saved-out-string]
3371 .  nr doc-in-diversion-saved \n[doc-in-diversion]
3372 .  nr doc-curr-font-saved \n[doc-curr-font]
3373 .  nr doc-curr-size-saved \n[doc-curr-size]
3374 .  nr doc-in-synopsis-count-saved \n[doc-in-synopsis-count]
3375 .  nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3376 .  nr doc-have-decl-saved \n[doc-have-decl]
3377 .  nr doc-have-var-saved \n[doc-have-var]
3378 .  ds doc-command-name-saved "\*[doc-command-name]
3379 .  ds doc-quote-left-saved "\*[doc-quote-left]
3380 .  ds doc-quote-right-saved "\*[doc-quote-right]
3381 .  nr doc-nesting-level-saved \n[doc-nesting-level]
3382 .  nr doc-no-space-saved \n[doc-no-space]
3383 .  nr doc-is-opening-saved \n[doc-is-opening]
3384 .  nr doc-in-list-saved \n[doc-in-list]
3385 .  ds doc-space-saved "\*[doc-space]
3386 .  nr doc-space-mode-saved \n[doc-space-mode]
3387 .  nr doc-curr-font-for-Ef-saved \n[doc-curr-font-for-Ef]
3388 .  nr doc-curr-size-for-Ef-saved \n[doc-curr-size-for-Ef]
3389 .  ds doc-keep-type-saved "\*[doc-keep-type]
3390 .  nr doc-display-depth-saved \n[doc-display-depth]
3391 .  nr doc-is-compact-saved \n[doc-is-compact]
3393 .  nr doc-reg-dsgv 0
3394 .  while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3395 .    ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3396 .    nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3397 .    nr doc-reg-dsgv +1
3398 .  \}
3400 .  nr doc-list-depth-saved \n[doc-list-depth]
3402 .  nr doc-reg-dsgv 1
3403 .  while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3404 .    ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3405 .    nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3406 .    nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3407 .    ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3408 .    nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3409 .    nr doc-reg-dsgv +1
3410 .  \}
3412 .  nr doc-have-indent-saved \n[doc-have-indent]
3413 .  nr doc-have-tag-width-saved \n[doc-have-tag-width]
3414 .  nr doc-no-printing-saved \n[doc-no-printing]
3415 .  ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3416 .  nr doc-curr-type-saved \n[doc-curr-type]
3417 .  ds doc-curr-arg-saved "\*[doc-curr-arg]
3418 .  nr doc-enum-list-count-saved \n[doc-enum-list-count]
3419 .  nr doc-have-diag-list-saved \n[doc-have-diag-list]
3420 .  nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3421 .  nr doc-list-immediate-saved \n[doc-list-immediate]
3422 .  nr doc-num-columns-saved \n[doc-num-columns]
3423 .  nr doc-next-list-depth-saved \n[doc-next-list-depth]
3424 .  nr doc-column-indent-width-saved \n[doc-column-indent-width]
3425 .  nr doc-is-func-saved \n[doc-is-func]
3426 .  nr doc-have-old-func-saved \n[doc-have-old-func]
3427 .  nr doc-func-arg-count-saved \n[doc-func-arg-count]
3428 .  ds doc-func-arg-saved "\*[doc-func-arg]
3429 .  nr doc-num-func-args-saved \n[doc-num-func-args]
3430 .  nr doc-func-args-processed-saved \n[doc-func-args-processed]
3431 .  nr doc-have-func-saved \n[doc-have-func]
3432 .  nr doc-is-reference-saved \n[doc-is-reference]
3433 .  nr doc-reference-count-saved \n[doc-reference-count]
3434 .  ds doc-reference-string-name-saved "\*[doc-reference-string-name]
3435 .  nr doc-authors-processed-saved \n[doc-authors-processed]
3436 .  nr doc-author-count-saved \n[doc-author-count]
3438 .  nr doc-reg-dsgv 0
3439 .  while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3440 .    ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3441 .    nr doc-reg-dsgv +1
3442 .  \}
3444 .  nr doc-book-count-saved \n[doc-book-count]
3445 .  ds doc-book-name-saved "\*[doc-book-name]
3446 .  nr doc-date-count-saved \n[doc-date-count]
3447 .  ds doc-date-saved "\*[doc-date]
3448 .  nr doc-publisher-count-saved \n[doc-publisher-count]
3449 .  ds doc-publisher-name-saved "\*[doc-publisher-name]
3450 .  nr doc-journal-count-saved \n[doc-journal-count]
3451 .  ds doc-journal-name-saved "\*[doc-journal-name]
3452 .  nr doc-issue-count-saved \n[doc-issue-count]
3453 .  ds doc-issue-name-saved "\*[doc-issue-name]
3454 .  nr doc-optional-count-saved \n[doc-optional-count]
3455 .  ds doc-optional-string-saved "\*[doc-optional-string]
3456 .  nr doc-page-number-count-saved \n[doc-page-number-count]
3457 .  ds doc-page-number-string-saved "\*[doc-page-number-string]
3458 .  nr doc-corporate-count-saved \n[doc-corporate-count]
3459 .  ds doc-corporate-name-saved "\*[doc-corporate-name]
3460 .  nr doc-report-count-saved \n[doc-report-count]
3461 .  ds doc-report-name-saved "\*[doc-report-name]
3462 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
3463 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3464 .  nr doc-volume-count-saved \n[doc-volume-count]
3465 .  ds doc-volume-name-saved "\*[doc-volume-name]
3466 .  nr doc-have-author-saved \n[doc-have-author]
3468 .  ds doc-document-title-saved "\*[doc-document-title]
3469 .  ds doc-volume-saved "\*[doc-volume]
3470 .  ds doc-section-saved "\*[doc-section]
3471 .  ds doc-operating-system-saved "\*[doc-operating-system]
3472 .  ds doc-date-string-saved "\*[doc-date-string]
3473 .  nr doc-header-space-saved \n[doc-header-space]
3474 .  nr doc-footer-space-saved \n[doc-footer-space]
3475 .  nr doc-display-vertical-saved \n[doc-display-vertical]
3476 .  ds doc-header-string-saved "\*[doc-header-string]
3477 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3478 .  nr doc-in-files-section-saved \n[doc-in-files-section]
3479 .  nr doc-in-authors-section-saved \n[doc-in-authors-section]
3483 .\" NS doc-restore-global-vars macro
3484 .\" NS   restore all global variables
3485 .\" NS
3486 .\" NS local variables:
3487 .\" NS   doc-reg-drgv
3489 .de doc-restore-global-vars
3490 .  nr doc-debug \n[doc-debug-saved]
3491 .  ds doc-macro-name "\*[doc-macro-name-saved]
3492 .  nr doc-arg-limit \n[doc-arg-limit-saved]
3493 .  nr doc-num-args \n[doc-num-args-saved]
3494 .  nr doc-arg-ptr \n[doc-arg-ptr-saved]
3496 .  nr doc-reg-drgv 1
3497 .  while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3498 .    ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3499 .    nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
3500 .    ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3501 .    nr doc-reg-drgv +1
3502 .  \}
3504 .  ds doc-out-string "\*[doc-out-string-saved]
3505 .  ds doc-curr-space "\*[doc-curr-space-saved]
3506 .  ds doc-saved-out-string "\*[doc-saved-out-string-saved]
3507 .  nr doc-in-diversion \n[doc-in-diversion-saved]
3508 .  nr doc-curr-font \n[doc-curr-font-saved]
3509 .  nr doc-curr-size \n[doc-curr-size-saved]
3510 .  nr doc-in-synopsis-count \n[doc-in-synopsis-count-saved]
3511 .  nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3512 .  nr doc-have-decl \n[doc-have-decl-saved]
3513 .  nr doc-have-var \n[doc-have-var-saved]
3514 .  ds doc-command-name "\*[doc-command-name-saved]
3515 .  ds doc-quote-left "\*[doc-quote-left-saved]
3516 .  ds doc-quote-right "\*[doc-quote-right-saved]
3517 .  nr doc-nesting-level \n[doc-nesting-level-saved]
3518 .  nr doc-no-space \n[doc-no-space-saved]
3519 .  nr doc-is-opening \n[doc-is-opening-saved]
3520 .  nr doc-in-list \n[doc-in-list-saved]
3521 .  ds doc-space "\*[doc-space-saved]
3522 .  nr doc-space-mode \n[doc-space-mode-saved]
3523 .  nr doc-curr-font-for-Ef \n[doc-curr-font-for-Ef-saved]
3524 .  nr doc-curr-size-for-Ef \n[doc-curr-size-for-Ef-saved]
3525 .  ds doc-keep-type "\*[doc-keep-type-saved]
3526 .  nr doc-display-depth \n[doc-display-depth-saved]
3527 .  nr doc-is-compact \n[doc-is-compact-saved]
3529 .  nr doc-reg-drgv 0
3530 .  while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3531 .    ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3532 .    nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3533 .    nr doc-reg-drgv +1
3534 .  \}
3536 .  nr doc-list-depth \n[doc-list-depth-saved]
3538 .  nr doc-reg-drgv 1
3539 .  while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3540 .    ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3541 .    nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3542 .    nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3543 .    ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3544 .    nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3545 .    nr doc-reg-drgv +1
3546 .  \}
3548 .  nr doc-have-indent \n[doc-have-indent-saved]
3549 .  nr doc-have-tag-width \n[doc-have-tag-width-saved]
3550 .  nr doc-no-printing \n[doc-no-printing-saved]
3551 .  ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3552 .  nr doc-curr-type \n[doc-curr-type-saved]
3553 .  ds doc-curr-arg "\*[doc-curr-arg-saved]
3554 .  nr doc-enum-list-count \n[doc-enum-list-count-saved]
3555 .  nr doc-have-diag-list \n[doc-have-diag-list-saved]
3556 .  nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3557 .  nr doc-list-immediate \n[doc-list-immediate-saved]
3558 .  nr doc-num-columns \n[doc-num-columns-saved]
3559 .  nr doc-next-list-depth \n[doc-next-list-depth-saved]
3560 .  nr doc-column-indent-width \n[doc-column-indent-width-saved]
3561 .  nr doc-is-func \n[doc-is-func-saved]
3562 .  nr doc-have-old-func \n[doc-have-old-func-saved]
3563 .  nr doc-func-arg-count \n[doc-func-arg-count-saved]
3564 .  ds doc-func-arg "\*[doc-func-arg-saved]
3565 .  nr doc-num-func-args \n[doc-num-func-args-saved]
3566 .  nr doc-func-args-processed \n[doc-func-args-processed-saved]
3567 .  nr doc-have-func \n[doc-have-func-saved]
3568 .  nr doc-is-reference \n[doc-is-reference-saved]
3569 .  nr doc-reference-count \n[doc-reference-count-saved]
3570 .  ds doc-reference-string-name "\*[doc-reference-string-name-saved]
3571 .  nr doc-authors-processed \n[doc-authors-processed-saved]
3572 .  nr doc-author-count \n[doc-author-count-saved]
3574 .  nr doc-reg-drgv 0
3575 .  while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3576 .    ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3577 .    nr doc-reg-drgv +1
3578 .  \}
3580 .  nr doc-book-count \n[doc-book-count-saved]
3581 .  ds doc-book-name "\*[doc-book-name-saved]
3582 .  nr doc-date-count \n[doc-date-count-saved]
3583 .  ds doc-date "\*[doc-date-saved]
3584 .  nr doc-publisher-count \n[doc-publisher-count-saved]
3585 .  ds doc-publisher-name "\*[doc-publisher-name-saved]
3586 .  nr doc-journal-count \n[doc-journal-count-saved]
3587 .  ds doc-journal-name "\*[doc-journal-name-saved]
3588 .  nr doc-issue-count \n[doc-issue-count-saved]
3589 .  ds doc-issue-name "\*[doc-issue-name-saved]
3590 .  nr doc-optional-count \n[doc-optional-count-saved]
3591 .  ds doc-optional-string "\*[doc-optional-string-saved]
3592 .  nr doc-page-number-count \n[doc-page-number-count-saved]
3593 .  ds doc-page-number-string "\*[doc-page-number-string-saved]
3594 .  nr doc-corporate-count \n[doc-corporate-count-saved]
3595 .  ds doc-corporate-name "\*[doc-corporate-name-saved]
3596 .  nr doc-report-count \n[doc-report-count-saved]
3597 .  ds doc-report-name "\*[doc-report-name-saved]
3598 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
3599 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3600 .  nr doc-volume-count \n[doc-volume-count-saved]
3601 .  ds doc-volume-name "\*[doc-volume-name-saved]
3602 .  nr doc-have-author \n[doc-have-author-saved]
3604 .  ds doc-document-title "\*[doc-document-title-saved]
3605 .  ds doc-volume "\*[doc-volume-saved]
3606 .  ds doc-section "\*[doc-section-saved]
3607 .  ds doc-operating-system "\*[doc-operating-system-saved]
3608 .  ds doc-date-string "\*[doc-date-string-saved]
3609 .  nr doc-header-space \n[doc-header-space-saved]
3610 .  nr doc-footer-space \n[doc-footer-space-saved]
3611 .  nr doc-display-vertical \n[doc-display-vertical-saved]
3612 .  ds doc-header-string "\*[doc-header-string-saved]
3613 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3614 .  nr doc-in-files-section \n[doc-in-files-section-saved]
3615 .  nr doc-in-authors-section \n[doc-in-authors-section-saved]
3619 .\" NS doc-no-printing global register (bool)
3620 .\" NS   set if output is suppressed
3622 .nr doc-no-printing 0
3625 .\" NS doc-dry-execute macro
3626 .\" NS   execute a string (splitting one arg into multiple args) without
3627 .\" NS   output; this command must be surrounded by `doc-save-global-args'
3628 .\" NS   and `doc-restore-global-args'
3630 .de doc-dry-execute
3631 .  doc-reset-args
3632 .  nr doc-no-printing 1
3633 .  ds doc-str-de \$1
3634 .  shift
3635 .  nop \*[doc-str-de] \$@
3636 .  nr doc-no-printing 0
3640 .\" NS El user macro
3641 .\" NS   end list
3642 .\" NS
3643 .\" NS modifies:
3644 .\" NS   doc-macro-name, doc-have-diag-list, doc-enum-list-count,
3645 .\" NS   doc-list-depth
3646 .\" NS
3647 .\" NS local variables:
3648 .\" NS   doc-str-El
3649 .\" NS
3650 .\" NS width register `El' set in doc-common
3652 .de El
3653 .  ie \n[.$] \
3654 .    tm Usage: .El (does not take arguments) (#\n[.c])
3655 .  el \{\
3656 .    ds doc-macro-name El
3657 .    ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3659 .    ie        "\*[doc-str-El]"enum-list" \{\
3660 .      nr doc-enum-list-count 0
3661 .      doc-end-list 1
3662 .    \}
3663 .    el \{ .ie "\*[doc-str-El]"diag-list" \{\
3664 .      nr doc-have-diag-list 0
3665 .      doc-end-list 0
3666 .    \}
3667 .    el \{ .ie "\*[doc-str-El]"column-list" \
3668 .      doc-end-column-list
3669 .    el \{ .ie "\*[doc-str-El]"item-list" \
3670 .      doc-end-list 0
3671 .    el \{ .ie "\*[doc-str-El]"ohang-list" \
3672 .      doc-end-list 0
3673 .    el \{ .ie "\*[doc-str-El]"inset-list" \
3674 .      doc-end-list 0
3675 .    el \
3676 .      doc-end-list 1
3677 .    \}\}\}\}\}
3679 .    br
3680 .  \}
3684 .\" NS doc-saved-Pa-font global string
3685 .\" NS   saved doc-Pa-font string for section FILES (no underline if
3686 .\" NS   nroff)
3688 .ds doc-saved-Pa-font
3691 .\" NS doc-curr-type global register
3692 .\" NS   current argument type
3694 .nr doc-curr-type 0
3697 .\" NS doc-curr-arg global string
3698 .\" NS   current argument
3700 .ds doc-curr-arg
3703 .\" NS It user macro
3704 .\" NS   list item
3705 .\" NS
3706 .\" NS modifies:
3707 .\" NS   doc-macro-name, doc-num-args, doc-arg-ptr, doc-argXXX,
3708 .\" NS   doc-out-string, doc-in-list, doc-list-immediate,
3709 .\" NS   doc-saved-Pa-font, doc-curr-type, doc-curr-arg
3710 .\" NS
3711 .\" NS width register `It' set in doc-common
3712 .\" NS
3713 .\" NS local variables:
3714 .\" NS   doc-str-It, doc-reg-It
3716 .de It
3717 .  ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3719 .  if "\*[doc-str-It]"" \
3720 .    tm mdoc error: .It without preceding .Bl (#\n[.c])
3722 .  if \n[doc-nesting-level] \{\
3723 .    tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
3724 .    tm1 " (#\n[.c])
3725 .  \}
3727 .  br
3728 .  if !\n[cR] \
3729 .    ne 3v
3731 .  ie \n[.$] \{\
3732 .    ds doc-macro-name It
3733 .    ds doc-out-string
3735 .    \" fill argument vector
3736 .    nr doc-reg-It 1
3737 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3738 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3739 .      nr doc-reg-It +1
3740 .    \}
3742 .    nr doc-num-args \n[.$]
3743 .    nr doc-arg-ptr 0
3744 .    nr doc-reg-It 1
3746 .    ie "\*[doc-str-It]"diag-list" \{\
3747 .      doc-remaining-args
3748 .      doc-diag-list
3749 .      nr doc-reg-It 0
3750 .    \}
3751 .    el \{\
3752 .      ie        "\*[doc-str-It]"column-list" \{\
3753 .        ds doc-out-string
3754 .        doc-column-list
3755 .        nr doc-reg-It 0
3756 .      \}
3757 .      el \{ .ie "\*[doc-str-It]"tag-list" \
3758 .        nr doc-reg-It 2
3759 .      el \{ .ie "\*[doc-str-It]"hang-list" \
3760 .        nr doc-reg-It 2
3761 .      el \{ .ie "\*[doc-str-It]"ohang-list" \
3762 .        nr doc-reg-It 2
3763 .      el \{ .if "\*[doc-str-It]"inset-list" \
3764 .        nr doc-reg-It 2
3765 .    \}\}\}\}\}
3767 .    if \n[doc-reg-It] \{\
3768 .      ie (\n[doc-reg-It] == 2) \{\
3769 .        \" handle list types with arguments
3770 .        doc-parse-arg-vector
3772 .        nr doc-in-list 1
3773 .        nr doc-list-immediate 1
3774 .        nr doc-arg-ptr 1
3775 .        nr doc-curr-type \n[doc-type1]
3776 .        ds doc-curr-arg "\*[doc-arg1]
3778 .        if \n[doc-in-files-section] \{\
3779 .          ds doc-saved-Pa-font "\*[doc-Pa-font]
3780 .          if n \
3781 .            ds doc-Pa-font "\*[doc-No-font]
3782 .        \}
3784 .        ie (\n[doc-type1] == 1) \
3785 .          \*[doc-arg1]
3786 .        el \{\
3787 .          nr doc-arg-ptr 0
3788 .          No
3789 .        \}
3791 .        \" the previous call of `.No' can contain calls to opening requests
3792 .        \" like `.Ac'; we then defer the call of `doc-xxx-list'
3793 .        if !\n[doc-nesting-level] \
3794 .          doc-\*[doc-str-It]
3795 .      \}
3796 .      el \{\
3797 .        tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3798 .        tm1 "              don't take arguments (#\n[.c])
3799 .        doc-\*[doc-str-It]
3800 .  \}\}\}
3801 .  el \
3802 .    doc-\*[doc-str-It]
3806 .\" NS doc-inset-list macro
3807 .\" NS   .It item of list-type inset
3808 .\" NS
3809 .\" NS modifies:
3810 .\" NS   doc-out-string, doc-in-list, doc-list-immediate
3812 .de doc-inset-list
3813 .  doc-set-vertical-and-indent 0
3814 .  br
3815 .  nop \&\*[doc-out-string]
3817 .  nr doc-in-list 0
3818 .  nr doc-list-immediate 0
3819 .  ds doc-out-string
3820 .  doc-reset-args
3821 '  fi
3825 .\" NS doc-hang-list macro
3826 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3827 .\" NS
3828 .\" NS modifies:
3829 .\" NS   doc-out-string, doc-in-list, doc-list-immediate
3830 .\" NS
3831 .\" NS local variables:
3832 .\" NS   doc-reg-dhl
3834 .de doc-hang-list
3835 .  doc-set-vertical-and-indent 1
3836 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3837 .  ti -\n[doc-reg-dhl]u
3839 .  ie (\w\a\*[doc-out-string]\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3840 .    nop \&\*[doc-out-string]
3841 .  el \
3842 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dhl]u'\c
3844 .  nr doc-in-list 0
3845 .  ds doc-out-string
3846 .  nr doc-list-immediate 0
3847 .  doc-reset-args
3848 '  fi
3852 .\" NS doc-ohang-list macro
3853 .\" NS   .It item of list-type overhanging tag
3854 .\" NS
3855 .\" NS modifies:
3856 .\" NS   doc-out-string, doc-in-list, doc-list-immediate
3858 .de doc-ohang-list
3859 .  doc-set-vertical-and-indent 0
3860 .  nop \&\*[doc-out-string]
3861 .  br
3863 .  nr doc-in-list 0
3864 .  ds doc-out-string
3865 .  nr doc-list-immediate 0
3866 .  doc-reset-args
3867 '  fi
3871 .\" NS doc-item-list macro
3872 .\" NS   .It item of list-type [empty tag]
3874 .de doc-item-list
3875 .  doc-set-vertical-and-indent 0
3876 .  br
3878 .  doc-reset-args
3879 '  fi
3883 .\" NS doc-enum-list-count global register
3884 .\" NS   contains current enum count value
3886 .nr doc-enum-list-count 0
3889 .\" NS doc-enum-list macro
3890 .\" NS   enumerated list
3891 .\" NS
3892 .\" NS modifies:
3893 .\" NS   doc-out-string, doc-in-list, doc-enum-list-count
3895 .de doc-enum-list
3896 .  nr doc-in-list 1
3897 .  nr doc-enum-list-count +1
3898 .  ds doc-out-string \n[doc-enum-list-count].
3899 .  doc-do-list
3903 .\" NS doc-bullet-list macro
3904 .\" NS   bullet paragraph list
3905 .\" NS
3906 .\" NS modifies:
3907 .\" NS   doc-out-string, doc-in-list
3909 .de doc-bullet-list
3910 .  nr doc-in-list 1
3911 .  ds doc-out-string "\*[doc-Sy-font]\[bu]\f[P]
3912 .  doc-do-list
3916 .\" NS doc-dash-list macro
3917 .\" NS   hyphen paragraph list (sub bullet list)
3918 .\" NS
3919 .\" NS modifies:
3920 .\" NS   doc-out-string, doc-in-list
3922 .de doc-dash-list
3923 .  nr doc-in-list 1
3924 .  ds doc-out-string "\*[doc-Sy-font]\-\f[P]
3925 .  doc-do-list
3929 .\" NS doc-do-list macro
3930 .\" NS   .It item of list-type enum/bullet/hyphen
3932 .als doc-do-list doc-hang-list
3935 .\" NS doc-have-diag-list global register (bool)
3936 .\" NS   set if last item was a diag list
3938 .\" XXX: this should be modified to handle nested lists of any type
3940 .nr doc-have-diag-list 0
3943 .\" NS doc-diag-list-input-line-count global register
3944 .\" NS   saved line number to be checked in next diag-list item
3946 .nr doc-diag-list-input-line-count 0
3949 .\" NS doc-diag-list macro
3950 .\" NS   .It item of list-type diagnostic-message
3951 .\" NS
3952 .\" NS modifies:
3953 .\" NS   doc-out-string, doc-curr-font, doc-curr-size,
3954 .\" NS   doc-diag-list-input-line-count
3956 .de doc-diag-list
3957 .  nr doc-curr-font \n[.f]
3958 .  nr doc-curr-size \n[.s]
3960 .  ie \n[doc-have-diag-list] \{\
3961 .    ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \
3962 .      doc-paragraph
3963 .    el \
3964 .      br
3965 .  \}
3966 .  el \
3967 .    br
3968 .  nr doc-diag-list-input-line-count \n[.c]
3970 .  nop \*[doc-Sy-font]\*[doc-out-string]\c
3971 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\*[doc-digit-string]\c
3973 .  doc-reset-args
3974 .  ds doc-out-string
3975 '  fi
3979 .\" NS doc-tag-list macro
3980 .\" NS   .It item of list-type `tag'
3981 .\" NS
3982 .\" NS modifies:
3983 .\" NS   doc-out-string, doc-in-list, doc-list-immediate
3984 .\" NS
3985 .\" NS local variables:
3986 .\" NS   doc-reg-dtl
3988 .de doc-tag-list
3989 .  if !\n[doc-have-tag-width] \
3990 .    doc-get-tag-width
3991 .  doc-set-vertical-and-indent 1
3992 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3993 .  ti -\n[doc-reg-dtl]u
3995 .  ie (\w\a\*[doc-out-string]\au > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3996 .    nop \&\*[doc-out-string]
3997 .    br
3998 .  \}
3999 .  el \
4000 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dtl]u'\c
4002 .  if \n[doc-in-files-section] \
4003 .    if n \
4004 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
4006 .  nr doc-in-list 0
4007 .  nr doc-list-immediate 0
4008 .  ds doc-out-string
4009 .  doc-reset-args
4010 '  fi
4014 .\" NS doc-get-tag-width macro
4015 .\" NS   resolve unknown tag width (.Bl [inset | tag] only)
4016 .\" NS
4017 .\" NS modifies:
4018 .\" NS   doc-list-indent-stackXXX, doc-have-indent, doc-tag-width-stackXXX
4019 .\" NS
4020 .\" NS requires:
4021 .\" NS   doc-curr-type, doc-curr-arg
4023 .de doc-get-tag-width
4024 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
4025 .    ie (\n[doc-curr-type] == 1) \{\
4026 .      ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
4027 .      nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
4028 .    \}
4029 .    el \{\
4030 .      ds doc-tag-width-stack\n[doc-list-depth] No
4031 .      nr doc-list-indent-stack\n[doc-list-depth] \n[No]
4032 .    \}
4033 .    nr doc-have-tag-width 1
4034 .  \}
4038 .\" NS doc-set-vertical-and-indent macro
4039 .\" NS   set up vertical spacing (if not compact) and indentation (with
4040 .\" NS   offset if argument is non-zero)
4041 .\" NS
4042 .\" NS modifies:
4043 .\" NS   doc-have-indent, doc-have-tag-width
4045 .de doc-set-vertical-and-indent
4046 .  ie \n[doc-have-indent] \{\
4047 .    nr doc-have-indent 0
4048 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
4049 .      sp \n[doc-display-vertical]u
4050 .    in +\n[doc-list-offset-stack\n[doc-list-depth]]u
4051 .    if \$1 \
4052 .      in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4053 .  \}
4054 .  el \{\
4055 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
4056 .      sp \n[doc-display-vertical]u
4057 .  \}
4059 .  if !\n[cR] \
4060 .    ne 2v
4064 .\" NS doc-list-depth global register
4065 .\" NS   list type stack counter
4067 .nr doc-list-depth 0
4070 .\" NS doc-list-immediate global register (bool)
4071 .\" NS   tag flag (for diversions)
4073 .nr doc-list-immediate 0
4076 .\" NS doc-num-columns global register
4077 .\" NS   number of columns
4079 .nr doc-num-columns 0
4082 .\" NS doc-compact-list-stackXXX global register (bool)
4083 .\" NS   stack of flags to indicate whether a particular list is compact
4084 .\" NS
4085 .\" NS   limit: doc-list-depth
4087 .nr doc-compact-list-stack1 0
4090 .\" NS doc-tag-width-stackXXX global string
4091 .\" NS   stack of strings indicating how to set up current element of
4092 .\" NS   doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
4093 .\" NS   directly; if it is a macro name, use the macro's width value;
4094 .\" NS   otherwise, `doc-get-tag-width' uses width value of `No'.
4095 .\" NS
4096 .\" NS   limit: doc-list-depth
4098 .ds doc-tag-width-stack0
4099 .ds doc-tag-width-stack1
4102 .\" NS doc-list-offset-stackXXX global register
4103 .\" NS   stack of list offsets
4104 .\" NS
4105 .\" NS   limit: doc-list-depth
4107 .nr doc-list-offset-stack1 0
4110 .\" NS doc-end-list macro
4111 .\" NS   list end function; resets indentation (and offset if argument is
4112 .\" NS   non-zero)
4113 .\" NS
4114 .\" NS modifies:
4115 .\" NS   doc-list-offset-stackXXX, doc-list-depth
4117 .de doc-end-list
4118 .  if \$1 \
4119 '    in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4121 '  in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4122 .  nr doc-list-offset-stack\n[doc-list-depth] 0
4124 .  if (\n[doc-list-depth] <= 0) \
4125 .    tm mdoc warning: extraneous .El call (#\n[.c])
4127 .  doc-decrement-list-stack
4128 .  nr doc-list-depth -1
4129 .  doc-increment-list-stack
4131 .  nr doc-have-tag-width 0
4135 .\" NS doc-next-list-depth global register
4136 .\" NS   next possible doc-list-depth value
4138 .nr doc-next-list-depth 1
4141 .\" NS doc-increment-list-stack macro
4142 .\" NS   set up next block for list
4143 .\" NS
4144 .\" NS modifies:
4145 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX,
4146 .\" NS   doc-compact-list-stackXXX, doc-tag-width-stackXXX,
4147 .\" NS   doc-list-offset-stackXXX, doc-next-list-depth
4149 .de doc-increment-list-stack
4150 .  nr doc-next-list-depth (\n[doc-list-depth] + 1)
4151 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
4152 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
4153 .  ds doc-tag-width-stack\n[doc-next-list-depth] \*[doc-tag-width-stack\n[doc-list-depth]]
4154 .  ds doc-list-type-stack\n[doc-next-list-depth]
4155 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
4159 .\" NS doc-decrement-list-stack macro
4160 .\" NS   decrement stack
4161 .\" NS
4162 .\" NS modifies:
4163 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX,
4164 .\" NS   doc-compact-list-stackXXX, doc-tag-width-stackXXX,
4165 .\" NS   doc-list-offset-stackXXX, doc-next-list-depth
4167 .de doc-decrement-list-stack
4168 .  ds doc-list-type-stack\n[doc-next-list-depth]
4169 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
4170 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
4171 .  ds doc-tag-width-stack\n[doc-next-list-depth]
4172 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
4173 .  nr doc-next-list-depth -1
4177 .\" NS Xr user macro
4178 .\" NS   cross reference (man page only)
4179 .\" NS
4180 .\" NS modifies:
4181 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string
4182 .\" NS
4183 .\" NS width register `Xr' set in doc-common
4185 .de Xr
4186 .  if !\n[doc-arg-limit] \{\
4187 .    ie \n[.$] \{\
4188 .      ds doc-macro-name Xr
4189 .      doc-parse-args \$@
4190 .    \}
4191 .    el \
4192 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
4193 .  \}
4195 .  nr doc-arg-ptr +1
4196 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4197 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \
4198 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
4199 .    el \{\
4200 .      ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4201 .        as doc-out-string \*[doc-Xr-font]
4202 .        as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4204 .        nr doc-arg-ptr +1
4205 .        if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4206 .          if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4207 .            as doc-out-string \&\*[lp]\*[doc-arg\n[doc-arg-ptr]]\*[rp]
4208 .            nr doc-arg-ptr +1
4209 .        \}\}
4210 .        ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4211 .          doc-do-\n[doc-type\n[doc-arg-ptr]]
4212 .        el \
4213 .          doc-print-and-reset
4214 .      \}
4215 .      el \
4216 .        doc-do-xref-\n[doc-type\n[doc-arg-ptr]]
4217 .  \}\}
4221 .\" NS Sx user macro
4222 .\" NS   cross section reference
4223 .\" NS
4224 .\" NS modifies:
4225 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4226 .\" NS   doc-curr-size
4227 .\" NS
4228 .\" NS width register `Sx' set in doc-common
4230 .de Sx
4231 .  if !\n[doc-arg-limit] \{\
4232 .    ie \n[.$] \{\
4233 .      ds doc-macro-name Sx
4234 .      doc-parse-args \$@
4235 .    \}
4236 .    el \
4237 .      tm Usage: .Sx section_header \*[doc-punct-chars] (#\n[.c])
4238 .  \}
4240 .  nr doc-arg-ptr +1
4241 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4242 .    as doc-out-string \*[doc-Sx-font]
4243 .    nr doc-curr-font \n[.f]
4244 .    nr doc-curr-size \n[.s]
4245 .    doc-print-recursive
4246 .  \}
4250 .\" NS doc-end-column-list macro
4251 .\" NS   column-list end-list
4252 .\" NS
4253 .\" NS modifies:
4254 .\" NS   doc-list-depth
4256 .de doc-end-column-list
4257 '  in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
4258 .  ta T .5i
4259 .  fi
4260 .  doc-decrement-list-stack
4261 .  nr doc-list-depth -1
4262 .  doc-increment-list-stack
4266 .\" NS doc-column-indent-width global register
4267 .\" NS   holds the indent width for a column list
4269 .nr doc-column-indent-width 0
4272 .\" NS doc-set-column-tab macro
4273 .\" NS   establish tabs for list-type column: `.doc-set-column-tab num_cols'
4274 .\" NS
4275 .\" NS local variables:
4276 .\" NS   doc-str-dsct, doc-str-dsct1, doc-reg-dsct, doc-column-indent-width
4278 .de doc-set-column-tab
4279 .  ds doc-str-dsct
4280 .  nr doc-reg-dsct 1
4281 .  nr doc-column-indent-width 0
4283 .  ie (\$1 < 5) \
4284 .    ds doc-str-dsct1 "    \"
4285 .  el \{\
4286 .    ie (\$1 == 5) \
4287 .      ds doc-str-dsct1 "   \"
4288 .    el \{\
4289 .      \" XXX: this is packed abnormally close -- intercolumn width
4290 .      \"      should be configurable
4291 .      ds doc-str-dsct1 " \"
4292 .  \}\}
4294 .  while (\n[doc-reg-dsct] <= \$1) \{\
4295 .    as doc-str-dsct " +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4296 .    nr doc-column-indent-width +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4297 .    nr doc-reg-dsct +1
4298 .  \}
4300 .  ta \*[doc-str-dsct]
4301 '  in +(\n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
4305 .\" NS doc-column-list macro
4306 .\" NS   column items
4307 .\" NS
4308 .\" NS modifies:
4309 .\" NS   doc-arg-ptr, doc-spaceXXX, doc-list-indent-stackXXX
4310 .\" NS
4311 .\" NS local variables:
4312 .\" NS   doc-reg-dcl
4314 .de doc-column-list
4315 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4316 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4317 .  if !\n[.u] \{\
4318 .    fi
4319 '    in +\n[doc-column-indent-width]u
4320 .  \}
4321 .  ti -\n[doc-column-indent-width]u
4323 .  doc-parse-arg-vector
4324 .  nr doc-arg-ptr +1
4326 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4327 .    if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4328 .      nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4329 .      ds doc-space\n[doc-reg-dcl]
4330 .    \}
4331 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
4332 .  \}
4333 .  el \
4334 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4338 .\" NS Ta user macro
4339 .\" NS   append tab (\t)
4340 .\" NS
4341 .\" NS modifies:
4342 .\" NS   doc-arg-ptr, doc-out-string
4343 .\" NS
4344 .\" NS width register `Ta' set in doc-common
4346 .de Ta
4347 .  ie \n[doc-arg-limit] \{\
4348 .    nr doc-arg-ptr +1
4349 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4350 .      as doc-out-string \t
4351 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
4352 .    \}
4353 .    el \{\
4354 .      as doc-out-string \t\c
4355 .      doc-print-and-reset
4356 .  \}\}
4357 .  el \{\
4358 .    tm1 "Usage: Ta must follow column entry: e.g. (#\n[.c])
4359 .    tm1 "         .It column_string [Ta [column_string ...]]
4360 .  \}
4364 .\" NS Dl user macro
4365 .\" NS   display (one line) literal
4366 .\" NS
4367 .\" NS modifies:
4368 .\" NS   doc-macro-name
4369 .\" NS
4370 .\" NS width register `Dl' set in doc-common
4372 .de Dl
4373 '  ta T .5i
4374 .  in +\n[doc-display-indent]u
4376 .  ie \n[doc-arg-limit] \
4377 .    tm Usage: .Dl not callable by other macros (#\n[.c])
4378 .  el \{\
4379 .    ie \n[.$] \{\
4380 .      ds doc-macro-name Dl
4381 .      doc-parse-args \$@
4382 .      Li
4383 .    \}
4384 .    el \
4385 .      tm Usage: .Dl argument ... (#\n[.c])
4386 .  \}
4388 .  in -\n[doc-display-indent]u
4392 .\" NS D1 user macro
4393 .\" NS   display (one line)
4394 .\" NS
4395 .\" NS modifies:
4396 .\" NS   doc-macro-name, doc-arg-ptr
4397 .\" NS
4398 .\" NS width register `D1' set in doc-common
4400 .de D1
4401 '  ta T .5i
4402 .  in +\n[doc-display-indent]u
4404 .  ie \n[doc-arg-limit] \
4405 .    tm Usage: .D1 not callable by other macros (#\n[.c])
4406 .  el \{\
4407 .    ie \n[.$] \{\
4408 .      ds doc-macro-name D1
4409 .      doc-parse-args \$@
4410 .      No
4411 .    \}
4412 .    el \
4413 .      tm Usage: .D1 argument ... (#\n[.c])
4414 .  \}
4416 .  in -\n[doc-display-indent]u
4420 .\" NS Ex user macro
4421 .\" NS   defunct
4423 .de Ex
4424 .  tm mdoc error: .Ex defunct, use .D1: \$@ (#\n[.c])
4428 .\" NS Vt user macro
4429 .\" NS   variable type (for forcing old style variable declarations);
4430 .\" NS   this is not done in the same manner as .Ot for fortrash --
4431 .\" NS   clean up later
4432 .\" NS
4433 .\" NS modifies:
4434 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
4435 .\" NS   doc-have-var
4436 .\" NS
4437 .\" NS width register `Vt' set in doc-common
4439 .de Vt
4440 .  \" if a function declaration was the last thing given, want vertical space
4441 .  if \n[doc-have-decl] \{\
4442 .    doc-paragraph
4443 .    nr doc-have-decl 0
4444 .  \}
4446 .  \" if a subroutine was the last thing given, want vertical space
4447 .  if \n[doc-have-func] \{\
4448 .    ie !\n[doc-have-var] \
4449 .      br
4450 .    el \{\
4451 .      doc-paragraph
4452 .      rs
4453 .  \}\}
4455 .  nr doc-have-var 1
4456 .  nr doc-curr-font \n[.f]
4457 .  nr doc-curr-size \n[.s]
4459 .  nop \*[doc-Ft-font]\$*
4461 .  ie \n[doc-have-old-func] \
4462 .    nop \&\*[doc-soft-space]
4463 .  el \
4464 .    br
4466 .  ft \n[doc-curr-font]
4467 .  ps \n[doc-curr-size]
4471 .\" NS doc-is-func global register (bool)
4472 .\" NS   set if subroutine (in synopsis only) (fortran only)
4474 .nr doc-is-func 0
4477 .\" NS Ft user macro
4478 .\" NS   function type
4479 .\" NS
4480 .\" NS modifies:
4481 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
4482 .\" NS   doc-have-var, doc-is-func
4483 .\" NS
4484 .\" NS width register `Ft' set in doc-common
4486 .de Ft
4487 .  if \n[doc-in-synopsis-count] \{\
4488 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4489 .      doc-paragraph
4490 .      nr doc-have-decl 0
4491 .      nr doc-have-var 0
4492 .    \}
4494 .    if \n[doc-have-var] \{\
4495 .      doc-paragraph
4496 .      nr doc-have-var 0
4497 .    \}
4499 .    nr doc-is-func 1
4500 .  \}
4502 .  nr doc-curr-font \n[.f]
4503 .  nr doc-curr-size \n[.s]
4505 .  nop \*[doc-Ft-font]\$*
4507 .  ft \n[doc-curr-font]
4508 .  ps \n[doc-curr-size]
4512 .\" NS doc-have-old-func global register (bool)
4513 .\" NS   set if `Ot' has been called
4515 .nr doc-have-old-func 0
4518 .\" NS Ot user macro
4519 .\" NS   old function type (fortran -- no newline)
4520 .\" NS
4521 .\" NS modifies:
4522 .\" NS   doc-out-string, doc-have-decl, doc-have-var,
4523 .\" NS   doc-is-func, doc-have-old-func
4524 .\" NS
4525 .\" NS width register `Ot' set in doc-common
4527 .de Ot
4528 .  nr doc-have-old-func 1
4530 .  if \n[doc-in-synopsis-count] \{\
4531 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4532 .      doc-paragraph
4533 .      nr doc-have-decl 0
4534 .      nr doc-have-var 0
4535 .    \}
4537 .    if \n[doc-have-var] \{\
4538 .      doc-paragraph
4539 .      nr doc-have-var 0
4540 .    \}
4542 .    nr doc-is-func 1
4543 .  \}
4545 .  if \n[.$] \
4546 .    as doc-out-string \*[doc-Ft-font]\$*
4547 .  as doc-out-string \ \f[P]
4551 .\" NS Fa user macro
4552 .\" NS   function arguments
4553 .\" NS
4554 .\" NS modifies:
4555 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4556 .\" NS   doc-curr-size
4557 .\" NS
4558 .\" NS width register `Fa' set in doc-common
4560 .de Fa
4561 .  if !\n[doc-arg-limit] \{\
4562 .    ie \n[.$] \{\
4563 .      ds doc-macro-name Fa
4564 .      doc-parse-args \$@
4565 .    \}
4566 .    el \
4567 .      tm Usage: .Fa function_arguments ... \*[doc-punct-chars] (#\n[.c])
4568 .  \}
4570 .  ie \n[doc-func-arg-count] \
4571 .    doc-do-func
4572 .  el \{\
4573 .    nr doc-arg-ptr +1
4574 .    if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4575 .      as doc-out-string \*[doc-Fa-font]
4576 .      nr doc-curr-font \n[.f]
4577 .      nr doc-curr-size \n[.s]
4578 .      doc-print-recursive
4580 .      if \n[doc-in-synopsis-count] \
4581 .        if \n[doc-have-func] \
4582 .          br
4583 .  \}\}
4587 .\" NS doc-func-arg-count global register
4588 .\" NS   how many function arguments have been processed so far
4590 .nr doc-func-arg-count 0
4593 .\" NS doc-func-arg global string
4594 .\" NS   work buffer for function name strings
4596 .ds doc-func-arg
4599 .\" NS doc-num-func-args global register
4600 .\" NS   number of function arguments
4602 .nr doc-num-func-args 0
4605 .\" NS doc-func-args-processed global register
4606 .\" NS   function arguments processed so far
4608 .nr doc-func-args-processed 0
4611 .\" NS doc-do-func macro
4612 .\" NS   internal .Fa for .Fc
4613 .\" NS
4614 .\" NS modifies:
4615 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string, doc-func-arg-count,
4616 .\" NS   doc-func-arg, doc-num-func-args, doc-func-args-processed
4618 .de doc-do-func
4619 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4620 .    nr doc-arg-ptr +1
4622 .    ds doc-func-arg
4623 .    nr doc-num-func-args 0
4624 .    nr doc-func-args-processed 0
4626 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4627 .    if (\n[doc-num-func-args] > 1) \
4628 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4630 .    if (\n[doc-func-arg-count] > 1) \{\
4631 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\|,
4632 .      as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]
4633 .      as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4634 .    \}
4636 .    if (\n[doc-func-arg-count] == 1) \{\
4637 .      as doc-out-string \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]
4638 .      as doc-out-string \f[P]\s[0]
4639 .    \}
4640 .    nr doc-func-arg-count +1
4641 .    doc-do-func
4642 .  \}
4643 .  el \
4644 .    doc-reset-args
4648 .\" NS doc-have-func global register (bool)
4649 .\" NS   whether we have more than one function in synopsis
4651 .nr doc-have-func 0
4654 .\" NS Fn user macro
4655 .\" NS   functions
4656 .\" NS
4657 .\" NS modifies:
4658 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4659 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
4660 .\" NS   doc-have-decl, doc-have-var, doc-have-func,
4661 .\" NS   doc-is-func
4662 .\" NS
4663 .\" NS width register `Fn' set in doc-common
4665 .de Fn
4666 .  hy 0
4668 .  if !\n[doc-arg-limit] \{\
4669 .    ie \n[.$] \{\
4670 .      ds doc-macro-name Fn
4671 .      doc-parse-args \$@
4672 .    \}
4673 .    el \{\
4674 .      tmc Usage: .Fn function_name function_arg(s) ... \*[doc-punct-chars]
4675 .      tm1 " (#\n[.c])
4676 .  \}\}
4678 .  if \n[doc-in-synopsis-count] \{\
4679 .    \" if there is/has been more than one subroutine declaration
4680 .    ie \n[doc-is-func] \{\
4681 .      br
4682 .      nr doc-have-var 0
4683 .      nr doc-have-decl 0
4684 .      nr doc-is-func 0
4685 .    \}
4686 .    el \{\
4687 .      if \n[doc-have-func] \{\
4688 .        doc-paragraph
4689 .        nr doc-have-var 0
4690 .        nr doc-have-decl 0
4691 .    \}\}
4693 .    if \n[doc-have-decl] \{\
4694 .      doc-paragraph
4695 .      nr doc-have-var 0
4696 .    \}
4698 .    if \n[doc-have-var] \{\
4699 .      doc-paragraph
4700 .      nr doc-have-decl 0
4701 .    \}
4703 .    nr doc-have-func 1
4704 .    nr doc-is-func 0
4705 .    rs
4707 .    ie (\n[doc-in-synopsis-count] > 1) \
4708 .      br
4709 .    el \{\
4710 .      if !\n[doc-indent-synopsis] \
4711 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4712 .    \}
4714 .    in +\n[doc-indent-synopsis]u
4715 .    ti -\n[doc-indent-synopsis]u
4716 .    nr doc-in-synopsis-count +1
4717 .  \}
4719 .  nr doc-arg-ptr +1
4720 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4721 .    nr doc-curr-font \n[.f]
4722 .    nr doc-curr-size \n[.s]
4723 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4724 .    as doc-out-string \f[P]\s[0]\*[lp]
4726 .    nr doc-arg-ptr +1
4727 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4728 .      as doc-out-string \*[doc-Fa-font]
4729 .      doc-do-func-\n[doc-type\n[doc-arg-ptr]]
4730 .    \}
4731 .    el \{\
4732 .      as doc-out-string \|\*[rp]
4733 .      doc-print-and-reset
4734 .    \}
4736 .    if \n[doc-in-synopsis-count] \
4737 .      in -\n[doc-indent-synopsis]u
4738 .  \}
4740 .  hy
4744 .\" NS doc-do-func-1 macro
4745 .\" NS   prepare `doc-out-string' and execute doc-argXXX
4746 .\" NS
4747 .\" NS modifies:
4748 .\" NS   doc-out-string
4750 .de doc-do-func-1
4751 .  ie \n[doc-in-synopsis-count] \{\
4752 .    as doc-out-string \&\*[rp]
4753 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4754 .  \}
4755 .  el \
4756 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4758 .  \*[doc-arg\n[doc-arg-ptr]]
4762 .\" NS doc-do-func-2 macro
4763 .\" NS   handle function arguments
4764 .\" NS
4765 .\" NS modifies:
4766 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string, doc-func-arg,
4767 .\" NS   doc-num-func-args, doc-func-args-processed
4768 .\" NS
4769 .\" NS local variables:
4770 .\" NS   doc-reg-ddfs
4772 .de doc-do-func-2
4773 .  if \n[doc-in-synopsis-count] \{\
4774 .    ds doc-func-arg
4775 .    nr doc-num-func-args 0
4776 .    nr doc-func-args-processed 0
4778 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4779 .    if (\n[doc-num-func-args] > 1) \
4780 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4781 .  \}
4783 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4785 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4786 .    nr doc-reg-ddfs \n[doc-arg-ptr]
4787 .    nr doc-arg-ptr +1
4788 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4789 .      as doc-out-string \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]],
4790 .      as doc-out-string "\*[doc-space\n[doc-reg-ddfs]]\f[P]\s[0]\|
4791 .    \}
4792 .    doc-do-func-\n[doc-type\n[doc-arg-ptr]]
4793 .  \}
4794 .  el \{\
4795 .    ie \n[doc-in-synopsis-count] \{\
4796 .      as doc-out-string \&\*[rp]
4797 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4798 .    \}
4799 .    el \
4800 .      as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4802 .    doc-print-and-reset
4803 .  \}
4807 .\" NS doc-do-func-3 macro
4808 .\" NS   handle punctuation suffixes in functions
4809 .\" NS
4810 .\" NS modifies:
4811 .\" NS   doc-out-string
4813 .de doc-do-func-3
4814 .  ie \n[doc-in-synopsis-count] \{\
4815 .    as doc-out-string \&\*[rp]
4816 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4817 .    as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4818 .  \}
4819 .  el \{\
4820 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4821 .    as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4822 .  \}
4824 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
4825 .    No
4826 .  el \
4827 .    doc-print-and-reset
4831 .\" NS doc-do-func-4 macro
4832 .\" NS   handle punctuation prefixes in functions
4833 .\" NS
4834 .\" NS modifies:
4835 .\" NS   doc-arg-ptr, doc-out-string
4837 .de doc-do-func-4
4838 .  ie \n[doc-in-synopsis-count] \{\
4839 .    as doc-out-string \&\*[rp]
4840 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4841 .    as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4842 .  \}
4843 .  el \{\
4844 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4845 .    as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4846 .  \}
4848 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4849 .    nr doc-arg-ptr +1
4850 .    No
4851 .  \}
4852 .  el \
4853 .    doc-print-and-reset
4857 .\" NS Fo user macro
4858 .\" NS   function open
4859 .\" NS
4860 .\" NS modifies:
4861 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4862 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
4863 .\" NS   doc-have-decl, doc-have-var, doc-have-func,
4864 .\" NS   doc-nesting-level, doc-is-func, doc-func-arg-count
4865 .\" NS
4866 .\" NS width register `Fo' set in doc-common
4868 .de Fo
4869 .  hy 0
4871 .  if !\n[doc-arg-limit] \{\
4872 .    ie \n[.$] \{\
4873 .      ds doc-macro-name Fo
4874 .      doc-parse-args \$@
4875 .    \}
4876 .    el \
4877 .      tm Usage: .Fo function_name (#\n[.c])
4878 .  \}
4880 .  if \n[doc-in-synopsis-count] \{\
4881 .    \" if there is/has been more than one subroutine declaration
4882 .    ie \n[doc-is-func] \{\
4883 .      br
4884 .      nr doc-have-var 0
4885 .      nr doc-have-decl 0
4886 .      nr doc-is-func 0
4887 .    \}
4888 .    el \{\
4889 .      if \n[doc-have-func] \{\
4890 .        doc-paragraph
4891 .        nr doc-have-var 0
4892 .        nr doc-have-decl 0
4893 .    \}\}
4895 .    if \n[doc-have-decl] \{\
4896 .      doc-paragraph
4897 .      nr doc-have-var 0
4898 .    \}
4900 .    if \n[doc-have-var] \{\
4901 .      doc-paragraph
4902 .      nr doc-have-decl 0
4903 .    \}
4905 .    nr doc-have-func 1
4906 .    nr doc-is-func 0
4907 .    rs
4909 .    ie (\n[doc-in-synopsis-count] > 1) \
4910 .      br
4911 .    el \{\
4912 .      if !\n[doc-indent-synopsis] \
4913 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4914 .    \}
4916 .    in +\n[doc-indent-synopsis]u
4917 .    ti -\n[doc-indent-synopsis]u
4918 .    nr doc-in-synopsis-count +1
4919 .  \}
4921 .  nr doc-arg-ptr +1
4922 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4923 .    nr doc-nesting-level +1
4924 .    nr doc-func-arg-count 1
4925 .    nr doc-curr-font \n[.f]
4926 .    nr doc-curr-size \n[.s]
4928 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4929 .    as doc-out-string \f[P]\s[0]\*[lp]
4930 .    doc-reset-args
4931 .  \}
4935 .\" NS Fc user macro
4936 .\" NS   function close
4937 .\" NS
4938 .\" NS modifies:
4939 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-nesting-level,
4940 .\" NS   doc-func-arg-count
4941 .\" NS
4942 .\" NS width register `Fc' set in doc-common
4944 .de Fc
4945 .  if !\n[doc-arg-limit] \{\
4946 .    if \n[.$] \{\
4947 .      ds doc-macro-name Fc
4948 .      doc-parse-args \$@
4949 .  \}\}
4951 .  nr doc-func-arg-count 0
4952 .  nr doc-nesting-level -1
4954 .  ie \n[doc-in-synopsis-count] \
4955 .    as doc-out-string \|\*[rp]
4956 .  el \
4957 .    as doc-out-string \|\*[rp]
4958 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4959 .    nr doc-arg-ptr +1
4960 .    \*[doc-arg\n[doc-arg-ptr]]
4961 .  \}
4962 .  el \
4963 .    doc-print-and-reset
4965 .  if \n[doc-in-synopsis-count] \
4966 .    in -\n[doc-indent-synopsis]u
4968 .  hy
4972 .\" NS doc-build-func-string macro
4973 .\" NS   collect function arguments and set hard spaces inbetween
4974 .\" NS
4975 .\" NS modifies:
4976 .\" NS   doc-func-arg, doc-num-func-args, doc-func-args-processed
4978 .de doc-build-func-string
4979 .  if !\n[doc-num-func-args] \{\
4980 .    nr doc-num-func-args \n[.$]
4981 .    nr doc-func-args-processed 0
4982 .    ds doc-func-arg
4983 .  \}
4985 .  nr doc-func-args-processed +1
4986 .  as doc-func-arg "\$1
4988 .  if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
4989 .    as doc-func-arg "\*[doc-hard-space]
4991 .    shift
4992 .    doc-build-func-string \$@
4993 .  \}
4997 .\" Very crude references, stash all reference info into strings (usual
4998 .\" use of doc-out-string, then doc-out-string contents copied to
4999 .\" string of retrievable naming convention), print out reference on .Re
5000 .\" request and clean up.  Ordering very limited, no fancy citations, but
5001 .\" can do articles, journals, and books -- need to add several missing
5002 .\" options (like city etc).  Should be able to grab a refer entry, massage
5003 .\" it a wee bit (prefix a `.' to the %[A-Z]) and not worry (ha!).
5006 .\" NS doc-is-reference global register (bool)
5007 .\" NS   set if in reference
5009 .nr doc-is-reference 0
5012 .\" NS doc-reference-count global register
5013 .\" NS   reference element counter
5015 .nr doc-reference-count 0
5018 .\" NS doc-reference-string-name global string
5019 .\" NS   contains current reference string name for handling in
5020 .\" NS   `doc-do-references'
5022 .ds doc-reference-string-name
5025 .\" NS Rs user macro
5026 .\" NS   reference start
5027 .\" NS
5028 .\" NS modifies:
5029 .\" NS   doc-is-reference, doc-reference-count
5030 .\" NS
5031 .\" NS width register `Rs' set in doc-common
5033 .de Rs
5034 .  nr doc-is-reference 1
5035 .  doc-reset-reference
5036 .  if \n[doc-in-see-also-section] \
5037 .    doc-paragraph
5038 .  nr doc-reference-count 0
5042 .\" NS Re user macro
5043 .\" NS   reference end
5044 .\" NS
5045 .\" NS modifies:
5046 .\" NS   doc-is-reference
5047 .\" NS
5048 .\" NS width register `Re' set in doc-common
5050 .de Re
5051 .  doc-print-reference
5052 .  doc-reset-reference
5053 .  nr doc-is-reference 0
5057 .\" NS doc-reset-reference macro
5058 .\" NS   reference cleanup
5059 .\" NS
5060 .\" NS modifies:
5061 .\" NS   doc-author-count, doc-journal-count, doc-issue-count,
5062 .\" NS   doc-optional-count, doc-corporate-count, doc-report-count,
5063 .\" NS   doc-reference-title-count, doc-volume-count, doc-date-count,
5064 .\" NS   doc-page-number-count, doc-book-count, doc-reference-string-name,
5065 .\" NS   doc-journal-name, doc-issue-name, doc-optional-string,
5066 .\" NS   doc-corporate-name, doc-report-name, doc-reference-title-name,
5067 .\" NS   doc-volume-name, doc-date, doc-page-number-string, doc-book-name
5069 .de doc-reset-reference
5070 .  while (\n[doc-author-count]) \{\
5071 .    ds doc-author-name\n[doc-author-count]
5072 .    nr doc-author-count -1
5073 .  \}
5074 .  nr doc-journal-count 0
5075 .  nr doc-issue-count 0
5076 .  nr doc-optional-count 0
5077 .  nr doc-corporate-count 0
5078 .  nr doc-report-count 0
5079 .  nr doc-reference-title-count 0
5080 .  nr doc-volume-count 0
5081 .  nr doc-date-count 0
5082 .  nr doc-page-number-count 0
5083 .  nr doc-book-count 0
5085 .  ds doc-reference-string-name
5087 .  ds doc-journal-name
5088 .  ds doc-issue-name
5089 .  ds doc-optional-string
5090 .  ds doc-corporate-name
5091 .  ds doc-report-name
5092 .  ds doc-reference-title-name
5093 .  ds doc-volume-name
5094 .  ds doc-date
5095 .  ds doc-page-number-string
5096 .  ds doc-book-name
5100 .\" NS doc-finish-reference macro
5101 .\" NS   auxiliary macro for doc-print-reference
5102 .\" NS
5103 .\" NS modifies:
5104 .\" NS   doc-reference-count
5106 .de doc-finish-reference
5107 .  nr doc-reference-count -1
5108 .  ie \n[doc-reference-count] \
5109 .    nop \&,
5110 .  el \
5111 .    nop \&.
5115 .\" NS doc-print-reference macro
5116 .\" NS   reference print
5117 .\" NS
5118 .\" NS modifies:
5119 .\" NS   doc-reference-count, doc-authors-processed
5121 .de doc-print-reference
5122 .  if \n[doc-author-count] \{\
5123 .    nop \&\*[doc-author-name1],
5124 .    nr doc-authors-processed 1
5125 .    if (\n[doc-author-count] > 1) \
5126 .      doc-print-reference-authors
5127 .    nr doc-reference-count -\n[doc-author-count]
5128 .  \}
5130 .  if \n[doc-reference-title-count] \{\
5131 .    ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5132 .      nop \&\*[q]\*[doc-reference-title-name]\*[q]\c
5133 .      doc-finish-reference
5134 .    \}
5135 .    el \{\
5136 .      nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font]\c
5137 .      doc-finish-reference
5138 .  \}\}
5140 .  if \n[doc-book-count] \{\
5141 .    nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font]\c
5142 .    doc-finish-reference
5143 .  \}
5145 .  if \n[doc-publisher-count] \{\
5146 .    nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font]\c
5147 .    doc-finish-reference
5148 .  \}
5150 .  if \n[doc-journal-count] \{\
5151 .    nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font]\c
5152 .    doc-finish-reference
5153 .  \}
5155 .  if \n[doc-report-count] \{\
5156 .    nop \&\*[doc-report-name]\c
5157 .    doc-finish-reference
5158 .  \}
5160 .  if \n[doc-issue-count] \{\
5161 .    nop \&\*[doc-issue-name]\c
5162 .    doc-finish-reference
5163 .  \}
5165 .  if \n[doc-volume-count] \{\
5166 .    nop \&\*[doc-volume-name]\c
5167 .    doc-finish-reference
5168 .  \}
5170 .  if \n[doc-page-number-count] \{\
5171 .    nop \&\*[doc-page-number-string]\c
5172 .    doc-finish-reference
5173 .  \}
5175 .  if \n[doc-corporate-count] \{\
5176 .    nop \&\*[doc-corporate-name]\c
5177 .    doc-finish-reference
5178 .  \}
5180 .  if \n[doc-date-count] \{\
5181 .    nop \&\*[doc-date]\c
5182 .    doc-finish-reference
5183 .  \}
5185 .  if \n[doc-optional-count] \{\
5186 .    nop \&\*[doc-optional-string]\c
5187 .    doc-finish-reference
5188 .  \}
5190 .  if \n[doc-reference-count] \
5191 .    tm mdoc warning: unresolved reference problem
5195 .\" NS doc-authors-processed global register
5196 .\" NS   author references processed so far
5198 .nr doc-authors-processed 0
5201 .\" NS doc-print-reference-authors macro
5202 .\" NS   print out reference authors
5203 .\" NS
5204 .\" NS modifies:
5205 .\" NS   doc-authors-processed
5207 .de doc-print-reference-authors
5208 .  nr doc-authors-processed +1
5209 .  ie (\n[doc-author-count] == \n[doc-authors-processed]) \
5210 .    nop \&and \*[doc-author-name\n[doc-authors-processed]],
5211 .  el \{\
5212 .    nop \&\*[doc-author-name\n[doc-authors-processed]],
5213 .    doc-print-reference-authors
5214 .  \}
5218 .\" NS doc-author-count global register
5219 .\" NS   counter of author references
5221 .nr doc-author-count 0
5224 .\" NS doc-author-nameXXX global string
5225 .\" NS   array of author names
5226 .\" NS
5227 .\" NS   limit: doc-author-count
5229 .ds doc-author-name0
5232 .\" NS %A user macro
5233 .\" NS   reference author(s)
5234 .\" NS
5235 .\" NS modifies:
5236 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5237 .\" MS   doc-reference-count, doc-author-count, doc-reference-string-name
5238 .\" NS
5239 .\" NS width register `%A' set in doc-common
5241 .de %A
5242 .  if !\n[doc-arg-limit] \{\
5243 .    ie \n[.$] \{\
5244 .      nr doc-author-count +1
5245 .      nr doc-reference-count +1
5246 .      ds doc-reference-string-name doc-author-name\n[doc-author-count]
5248 .      ds doc-macro-name %A
5249 .      doc-parse-args \$@
5250 .    \}
5251 .    el \
5252 .      tm Usage: .%A author_name (#\n[.c])
5253 .  \}
5255 .  nr doc-arg-ptr +1
5256 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5257 .    nr doc-curr-font \n[.f]
5258 .    nr doc-curr-size \n[.s]
5259 .    doc-do-references
5260 .  \}
5264 .\" NS doc-book-count global register
5265 .\" NS   counter of book references
5267 .nr doc-book-count 0
5270 .\" NS doc-book-name global string
5271 .\" NS   string of collected book references
5273 .ds doc-book-name
5276 .\" NS %B user macro
5277 .\" NS   [reference] book name
5278 .\" NS
5279 .\" NS modifies:
5280 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
5281 .\" NS   doc-curr-size, doc-reference-count, doc-book-count,
5282 .\" NS   doc-reference-string-name
5283 .\" NS
5284 .\" NS width register `%B' set in doc-common
5286 .de %B
5287 .  if !\n[doc-arg-limit] \{\
5288 .    ie \n[.$] \{\
5289 .      if \n[doc-is-reference] \{\
5290 .        nr doc-book-count +1
5291 .        nr doc-reference-count +1
5292 .        ds doc-reference-string-name doc-book-name
5293 .      \}
5295 .      ds doc-macro-name %B
5296 .      doc-parse-args \$@
5297 .    \}
5298 .    el \
5299 .      tm Usage: .%B book_name (#\n[.c])
5300 .  \}
5302 .  nr doc-arg-ptr +1
5303 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5304 .    nr doc-curr-font \n[.f]
5305 .    nr doc-curr-size \n[.s]
5307 .    ie !\n[doc-is-reference] \{\
5308 .      as doc-out-string \*[doc-Em-font]
5309 .      doc-print-recursive
5310 .    \}
5311 .    el \
5312 .      doc-do-references
5313 .  \}
5317 .\" NS doc-date-count global register
5318 .\" NS   counter of date references
5320 .nr doc-date-count 0
5323 .\" NS doc-date global string
5324 .\" NS   string of collected date references
5326 .ds doc-date
5329 .\" NS %D user macro
5330 .\" NS   [reference] date
5331 .\" NS
5332 .\" NS modifies:
5333 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5334 .\" NS   doc-reference-count, doc-date-count, doc-reference-string-name
5335 .\" NS
5336 .\" NS width register `%D' set in doc-common
5338 .de %D
5339 .  if !\n[doc-arg-limit] \{\
5340 .    ie \n[.$] \{\
5341 .      nr doc-date-count +1
5342 .      nr doc-reference-count +1
5343 .      ds doc-reference-string-name doc-date
5345 .      ds doc-macro-name %D
5346 .      doc-parse-args \$@
5347 .    \}
5348 .    el \
5349 .      tm Usage: .%D date (#\n[.c])
5350 .  \}
5352 .  nr doc-arg-ptr +1
5353 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5354 .    nr doc-curr-font \n[.f]
5355 .    nr doc-curr-size \n[.s]
5356 .    doc-do-references
5357 .  \}
5361 .\" NS doc-publisher-count global register
5362 .\" NS   counter of publisher references
5364 .nr doc-publisher-count 0
5367 .\" NS doc-publisher-name global string
5368 .\" NS   string of collected publisher references
5370 .ds doc-publisher-name
5373 .\" NS %I user macro
5374 .\" NS   [reference] issuer/publisher name
5375 .\" NS
5376 .\" NS modifies:
5377 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5378 .\" NS   doc-reference-count, doc-reference-string-name
5379 .\" NS
5380 .\" NS width register `%I' set in doc-common
5382 .de %I
5383 .  if !\n[doc-arg-limit] \{\
5384 .    ie \n[.$] \{\
5385 .      nr doc-publisher-count +1
5386 .      nr doc-reference-count +1
5387 .      ds doc-reference-string-name doc-publisher-name
5389 .      ds doc-macro-name %I
5390 .      doc-parse-args \$@
5391 .    \}
5392 .    el \
5393 .      tm Usage: .%I issuer/publisher_name (#\n[.c])
5394 .  \}
5396 .  nr doc-arg-ptr +1
5397 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5398 .    nr doc-curr-font \n[.f]
5399 .    nr doc-curr-size \n[.s]
5400 .    doc-do-references
5401 .  \}
5405 .\" NS doc-journal-count global register
5406 .\" NS   counter of journal references
5408 .nr doc-journal-count 0
5411 .\" NS doc-journal-name global string
5412 .\" NS   string of collected journal references
5414 .ds doc-journal-name
5417 .\" NS %J user macro
5418 .\" NS   [reference] Journal Name
5419 .\" NS
5420 .\" NS modifies:
5421 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5422 .\" NS   doc-reference-count, doc-journal-count, doc-reference-string-name
5423 .\" NS
5424 .\" NS width register `%J' set in doc-common
5426 .de %J
5427 .  if !\n[doc-arg-limit] \{\
5428 .    ie \n[.$] \{\
5429 .      nr doc-journal-count +1
5430 .      nr doc-reference-count +1
5431 .      ds doc-reference-string-name doc-journal-name
5433 .      ds doc-macro-name %J
5434 .      doc-parse-args \$@
5435 .    \}
5436 .    el \
5437 .      tm Usage: .%J journal_name (#\n[.c])
5438 .  \}
5440 .  nr doc-arg-ptr +1
5441 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5442 .    nr doc-curr-font \n[.f]
5443 .    nr doc-curr-size \n[.s]
5444 .    doc-do-references
5445 .  \}
5449 .\" NS doc-issue-count global register
5450 .\" NS   counter of issue number references
5452 .nr doc-issue-count 0
5455 .\" NS doc-issue-name global string
5456 .\" NS   string of collected issue number references
5458 .ds doc-issue-name
5461 .\" NS %N user macro
5462 .\" NS   [reference] issue number
5463 .\" NS
5464 .\" NS modifies:
5465 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5466 .\" NS   doc-reference-count, doc-issue-count, doc-reference-string-name
5467 .\" NS
5468 .\" NS width register `%N' set in doc-common
5470 .de %N
5471 .  if !\n[doc-arg-limit] \{\
5472 .    ie \n[.$] \{\
5473 .      nr doc-issue-count +1
5474 .      nr doc-reference-count +1
5475 .      ds doc-reference-string-name doc-issue-name
5477 .      ds doc-macro-name %N
5478 .      doc-parse-args \$@
5479 .    \}
5480 .    el \
5481 .      tm Usage: .%N issue_number (#\n[.c])
5482 .  \}
5484 .  nr doc-arg-ptr +1
5485 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5486 .    nr doc-curr-font \n[.f]
5487 .    nr doc-curr-size \n[.s]
5488 .    doc-do-references
5489 .  \}
5493 .\" NS doc-optional-count global register
5494 .\" NS   counter of optional information references
5496 .nr doc-optional-count 0
5499 .\" NS doc-optional-string global string
5500 .\" NS   string of collected optional information references
5502 .ds doc-optional-string
5505 .\" NS %O user macro
5506 .\" NS   [reference] optional information
5507 .\" NS
5508 .\" NS modifies:
5509 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5510 .\" NS   doc-reference-count, doc-optional-count, doc-reference-string-name
5511 .\" NS
5512 .\" NS width register `%O' set in doc-common
5514 .de %O
5515 .  if !\n[doc-arg-limit] \{\
5516 .    ie \n[.$] \{\
5517 .      nr doc-optional-count +1
5518 .      nr doc-reference-count +1
5519 .      ds doc-reference-string-name doc-optional-string
5521 .      ds doc-macro-name %O
5522 .      doc-parse-args \$@
5523 .    \}
5524 .    el \
5525 .      tm Usage: .%O optional_information ... \*[doc-punct-chars] (#\n[.c])
5526 .  \}
5528 .  nr doc-arg-ptr +1
5529 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5530 .    nr doc-curr-font \n[.f]
5531 .    nr doc-curr-size \n[.s]
5532 .    doc-do-references
5533 .  \}
5537 .\" NS doc-page-number-count global register
5538 .\" NS   counter of page number references
5540 .nr doc-page-number-count 0
5543 .\" NS doc-page-number-string global string
5544 .\" NS   string of collected page number references
5546 .ds doc-page-number-string
5549 .\" NS %P user macro
5550 .\" NS   [reference] page numbers
5551 .\" NS
5552 .\" NS modifies:
5553 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5554 .\" NS   doc-reference-count, doc-page-number-count, doc-reference-string-name
5555 .\" NS
5556 .\" NS width register `%P' set in doc-common
5558 .de %P
5559 .  if !\n[doc-arg-limit] \{\
5560 .    ie \n[.$] \{\
5561 .      nr doc-page-number-count +1
5562 .      nr doc-reference-count +1
5563 .      ds doc-reference-string-name doc-page-number-string
5565 .      ds doc-macro-name %P
5566 .      doc-parse-args \$@
5567 .    \}
5568 .    el \
5569 .      tm Usage: .%P page_numbers ... \*[doc-punct-chars] (#\n[.c])
5570 .  \}
5572 .  nr doc-arg-ptr +1
5573 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5574 .    nr doc-curr-font \n[.f]
5575 .    nr doc-curr-size \n[.s]
5576 .    doc-do-references
5577 .  \}
5581 .\" NS doc-corporate-count global register
5582 .\" NS   counter of corporate references
5584 .nr doc-corporate-count 0
5587 .\" NS doc-corporate-name global string
5588 .\" NS   string of collected corporate references
5590 .ds doc-corporate-name
5593 .\" NS %Q user macro
5594 .\" NS   corporate or foreign author
5595 .\" NS
5596 .\" NS modifies:
5597 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5598 .\" NS   doc-reference-count, doc-corporate-count, doc-reference-string-name
5599 .\" NS
5600 .\" NS width register `%Q' set in doc-common
5602 .de %Q
5603 .  if !\n[doc-arg-limit] \{\
5604 .    ie \n[.$] \{\
5605 .      nr doc-corporate-count +1
5606 .      nr doc-reference-count +1
5607 .      ds doc-reference-string-name doc-corporate-name
5609 .      ds doc-macro-name %Q
5610 .      doc-parse-args \$@
5611 .    \}
5612 .    el \
5613 .      tm Usage: .%Q corporate_or_foreign_author (#\n[.c])
5614 .  \}
5616 .  nr doc-arg-ptr +1
5617 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5618 .    nr doc-curr-font \n[.f]
5619 .    nr doc-curr-size \n[.s]
5620 .    doc-do-references
5621 .  \}
5625 .\" NS doc-report-count global register
5626 .\" NS   counter of report references
5628 .nr doc-report-count 0
5631 .\" NS doc-report-name global string
5632 .\" NS   string of collected report references
5634 .ds doc-report-name
5637 .\" NS %R user macro
5638 .\" NS   [reference] report name
5639 .\" NS
5640 .\" NS modifies:
5641 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5642 .\" NS   doc-reference-count, doc-report-count, doc-reference-string-name
5643 .\" NS
5644 .\" NS width register `%R' set in doc-common
5646 .de %R
5647 .  if !\n[doc-arg-limit] \{\
5648 .    ie \n[.$] \{\
5649 .      nr doc-report-count +1
5650 .      nr doc-reference-count +1
5651 .      ds doc-reference-string-name doc-report-name
5653 .      ds doc-macro-name %R
5654 .      doc-parse-args \$@
5655 .    \}
5656 .    el \
5657 .      tm Usage: .%R reference_report (#\n[.c])
5658 .  \}
5660 .  nr doc-arg-ptr +1
5661 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5662 .    nr doc-curr-font \n[.f]
5663 .    nr doc-curr-size \n[.s]
5664 .    doc-do-references
5665 .  \}
5669 .\" NS doc-reference-title-count global register
5670 .\" NS   counter of reference title references
5672 .nr doc-reference-title-count 0
5675 .\" NS doc-reference-title-name global string
5676 .\" NS   string of collected reference title references
5678 .ds doc-reference-title-name
5681 .\" NS %T user macro
5682 .\" NS   reference title
5683 .\" NS
5684 .\" NS modifies:
5685 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
5686 .\" NS   doc-curr-size, doc-reference-count, doc-reference-title-count,
5687 .\" NS   doc-reference-string-name
5688 .\" NS
5689 .\" NS width register `%T' set in doc-common
5691 .de %T
5692 .  if !\n[doc-arg-limit] \{\
5693 .    ie \n[.$] \{\
5694 .      if \n[doc-is-reference] \{\
5695 .        nr doc-reference-title-count +1
5696 .        nr doc-reference-count +1
5697 .        ds doc-reference-string-name doc-reference-title-name
5698 .      \}
5700 .      ds doc-macro-name %T
5701 .      doc-parse-args \$@
5702 .    \}
5703 .    el \
5704 .      tm Usage: .%T reference_title (#\n[.c])
5705 .  \}
5707 .  nr doc-arg-ptr +1
5708 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5709 .    nr doc-curr-font \n[.f]
5710 .    nr doc-curr-size \n[.s]
5711 .    ie \n[doc-is-reference] \
5712 .      doc-do-references
5713 .    el \{\
5714 .      as doc-out-string \*[doc-Em-font]
5715 .      doc-print-recursive
5716 .  \}\}
5720 .\" NS doc-volume-count global register
5721 .\" NS   counter of reference title references
5723 .nr doc-volume-count 0
5726 .\" NS doc-volume-name global string
5727 .\" NS   string of collected volume references
5729 .ds doc-volume-name
5732 .\" NS %V user macro
5733 .\" NS   reference volume
5734 .\" NS
5735 .\" NS modifies:
5736 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5737 .\" NS   doc-reference-count, doc-volume-count, doc-reference-string-name
5738 .\" NS
5739 .\" NS width register `%V' set in doc-common
5741 .de %V
5742 .  if !\n[doc-arg-limit] \{\
5743 .    ie \n[.$] \{\
5744 .      ds doc-macro-name %V
5745 .      nr doc-volume-count +1
5746 .      nr doc-reference-count +1
5747 .      ds doc-reference-string-name doc-volume-name
5748 .      doc-parse-args \$@
5749 .    \}
5750 .    el \
5751 .      tm Usage: .%V volume , ... \*[doc-punct-chars] (#\n[.c])
5752 .  \}
5754 .  nr doc-arg-ptr +1
5755 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5756 .    nr doc-curr-font \n[.f]
5757 .    nr doc-curr-size \n[.s]
5758 .    doc-do-references
5759 .  \}
5763 .\" NS doc-do-references macro
5764 .\" NS   reference recursion routine
5765 .\" NS
5766 .\" NS modifies:
5767 .\" NS   doc-arg-ptr, doc-out-string, doc-reference-string-name,
5768 .\" NS   doc-journal-name, doc-issue-name, doc-optional-string,
5769 .\" NS   doc-corporate-name, doc-report-name, doc-reference-title-name,
5770 .\" NS   doc-volume-name, doc-date, doc-page-number-string, doc-book-name
5771 .\" NS
5772 .\" NS local variables:
5773 .\" NS   doc-reg-ddr, doc-reg-ddr1
5775 .de doc-do-references
5776 .  hy 0
5778 .  nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
5780 .  ie (\n[doc-reg-ddr1] == 1) \{\
5781 .    \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
5782 .    ie "\*[doc-arg\n[doc-arg-ptr]]"Tn" \
5783 .      doc-reference-trademark
5784 .    el \{\
5785 .      doc-append-arg doc-do-references 1
5786 .      \*[doc-arg\n[doc-arg-ptr]]
5787 .  \}\}
5788 .  el \{\
5789 .    nr doc-reg-ddr \n[doc-arg-ptr]
5790 .    as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
5792 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
5793 .      as \*[doc-reference-string-name] \&\*[doc-out-string]
5794 .      ds doc-out-string
5795 .      ds doc-reference-string-name
5796 .      doc-reset-args
5797 .    \}
5798 .    el \{\
5799 .      nr doc-arg-ptr +1
5800 .      as doc-out-string "\*[doc-space\n[doc-reg-ddr]]
5801 .      doc-do-references
5802 .  \}\}
5806 .\" NS Hf user macro
5807 .\" NS   source include header files.
5808 .\" NS
5809 .\" NS modifies:
5810 .\" NS   doc-curr-font, doc-curr-size
5811 .\" NS
5812 .\" NS width register `Hf' set in doc-common
5814 .de Hf
5815 .  doc-paragraph
5816 .  nop File:
5817 .  Pa \$1
5818 .  doc-paragraph
5820 .  nr doc-curr-font \n[.f]
5821 .  nr doc-curr-size \n[.s]
5823 .  ie t \{\
5824 .    nop \*[doc-Li-font]
5825 .    br
5826 .    ta T 9n
5827 .  \}
5828 .  el \
5829 .    ta T 8n
5831 .  nf
5832 .  so \$1
5833 .  fi
5835 .  ft \n[doc-curr-font]
5836 .  ps \n[doc-curr-size]
5837 .  doc-paragraph
5841 .\" NS doc-have-author global register (bool)
5842 .\" NS   set in `An'
5844 .nr doc-have-author 0
5847 .\" NS An user macro
5848 .\" NS   author name
5849 .\" NS
5850 .\" NS modifies:
5851 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5852 .\" NS   doc-have-author
5853 .\" NS
5854 .\" NS width register `An' set in doc-common
5856 .de An
5857 .  if !\n[doc-arg-limit] \{\
5858 .    ie \n[.$] \{\
5859 .      ie        "\$1"-nosplit" \
5860 .        nr doc-in-authors-section 0
5861 .      el \{ .ie "\$1"-split" \
5862 .        nr doc-in-authors-section 1
5863 .      el \{\
5864 .        ds doc-macro-name An
5865 .        doc-parse-args \$@
5866 .    \}\}\}
5867 .    el \
5868 .      tm Usage: .An author_name ... \*[doc-punct-chars] (#\n[.c])
5869 .  \}
5871 .  if \n[doc-in-authors-section] \{\
5872 .    ie \n[doc-have-author] \
5873 .      br
5874 .    el \
5875 .      nr doc-have-author 1
5876 .  \}
5878 .  nr doc-arg-ptr +1
5879 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5880 .    nr doc-curr-font \n[.f]
5881 .    nr doc-curr-size \n[.s]
5882 .    doc-print-recursive
5883 .  \}
5887 .\" NS Sf user macro
5888 .\" NS   defunct
5889 .\" NS
5890 .\" NS width register `Sf' set in doc-common
5892 .de Sf
5893 .  tm mdoc error: .Sf defunct, use .Pf or .Ns (#\n[.c])
5897 .ds doc-func-error-string "function returns the value\~0 if successful;
5898 .as doc-func-error-string " otherwise the value\~-1 is returned and
5899 .as doc-func-error-string " the global variable \*[doc-Va-font]errno\f[P]
5900 .as doc-func-error-string " is set to indicate the error.
5903 .\" NS Rv user macro
5904 .\" NS   return values
5905 .\" NS
5906 .\" NS width register `Rv' set in doc-common
5907 .\" NS
5908 .\" NS local variables:
5909 .\" NS   doc-str-Rv
5911 .de Rv
5913 .\" XXX: what does this function without `-std'?
5915 .  ie !\n[.$] \
5916 .    tm Usage: .Rv [-std] (#\n[.c])
5917 .  el \{\
5918 .    \" .ds doc-macro-name Rv
5919 .    \" .nr doc-arg-ptr 0
5920 .    \" .nr lR +1
5921 .    \" .ds doc-arg1 \$2
5922 .    \" .ds doc-arg2 \$3
5923 .    \" .ds doc-arg3 \$4
5924 .    \" .ds doc-arg4 \$5
5925 .    \" .ds doc-arg5 \$6
5926 .    \" .ds doc-arg6 \$7
5927 .    \" .ds doc-arg7 \$8
5928 .    \" .ds doc-arg8 \$9
5929 .    \" .
5930 .    \" .nr doc-num-args (\n[.$] - 1)
5932 .    if "\$1"-std" \{\
5933 .      doc-reg-Rv \*[doc-section]
5934 .      if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
5935 .        tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
5936 .      br
5937 .      nop \&The
5938 .      Fn \$2
5939 .      nop \&\*[doc-func-error-string]
5940 .  \}\}
5944 .\" NS Mt user macro
5945 .\" NS   mailto (for conversion to HTML)
5947 .de Mt
5948 .  \" XXX: error handling missing
5949 .  Pa \$@
5953 .\" NS Lk user macro
5954 .\" NS   link (for conversion to HTML)
5955 .\" NS
5956 .\" NS local variables:
5957 .\" NS   doc-str-Lk, doc-reg-Lk
5959 .de Lk
5960 .  ds doc-str-Lk Sy \$@
5962 .  ie (\n[.$] > 1) \{\
5963 .    doc-get-arg-type \$2
5964 .    ie (\[doc-arg-type] < 3) \{\
5965 .      Em \&\$2:
5966 .      ds doc-str-Lk Sy "\$1"
5967 .      doc-get-width "\$1"
5968 .      shift 2
5969 .      if \n[.$] \
5970 .        as doc-str-Lk " \$@
5971 .    \}
5972 .    el \
5973 .      doc-get-width "\$1"
5974 .  \}
5975 .  el \
5976 .    doc-get-width "\$1"
5978 .  ie n \
5979 .    nr doc-reg-Lk 26
5980 .  el \
5981 .    nr doc-reg-Lk 38
5982 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
5983 .    D1 \*[doc-str-Lk]
5984 .  el \
5985 .    \*[doc-str-Lk]
5989 .rn em e@
5991 .de em
5992 .  tm mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
5993 .  ab Should this have been `.Em ...'?
5997 .\" NS doc-empty-line macro
5998 .\" NS   emit warning and print empty line
6000 .de doc-empty-line
6001 .  if !\n[doc-in-diversion] \
6002 .    if !"\*[doc-macro-name]"Bd" \
6003 .      tm mdoc warning: Empty input line #\n[.c]!
6004 .  sp
6007 .blm doc-empty-line
6013 .\" load local modifications
6014 .mso mdoc.local
6016 .\" EOF