internal update
[s-roff.git] / tmac / tmac.doc.new
blobd72179401855eeed48094c6cee501f0c214ab758
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 `doc-no-space' isn't set.  The latter is active for
250 .    \" a closing/closing or opening/opening request.
251 .    if \n[doc-nesting-level] \
252 .      if !\n[doc-func-arg-count] \
253 .        if !\n[doc-no-space] \
254 .          as doc-out-string "\*[doc-curr-space]
256 .    nr doc-no-space 0
257 .    nr doc-is-opening 0
259 .    \" use space after last parameter as the current one
260 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
262 .    if \n[doc-debug] \{\
263 .      nr doc-reg-dpa1 1
265 .      ie \n[doc-inline-debug] \{\
266 .        nop MACRO REQUEST: \t.\*[doc-macro-name]
267 .        while (\n[doc-reg-dpa1] <= \n[doc-arg-limit]) \{\
268 .          nop "\*[doc-arg\n[doc-reg-dpa1]]"
269 .          nr doc-reg-dpa1 +1
270 .        \}
271 .        br
272 .        in \n[doc-reg-dpa]u
273 .      \}
274 .      el \{\
275 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
276 .        while (\n[doc-reg-dpa1] <= \n[doc-arg-limit]) \{\
277 .          tmc " "\*[doc-arg\n[doc-reg-dpa1]]"
278 .          nr doc-reg-dpa1 +1
279 .        \}
280 .        tm
281 .  \}\}\}
282 .  el \{\
283 .    shift
284 .    doc-parse-args \$@
285 .  \}
289 .\" NS doc-parse-arg-vector macro
290 .\" NS   parse argument vector (recursive)
291 .\" NS
292 .\" NS   cf. comments in doc-parse-args
293 .\" NS
294 .\" NS modifies:
295 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX, doc-arg-limit,
296 .\" NS   doc-num-args, doc-arg-ptr, doc-out-string, doc-curr-space
297 .\" NS
298 .\" NS local variables:
299 .\" NS   doc-str-dpav, doc-reg-dpav, doc-reg-dpav1
301 .de doc-parse-arg-vector
302 .  nr doc-arg-limit +1
304 .  if "\*[doc-arg\n[doc-arg-limit]]"|" \
305 .    ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
307 .  doc-get-arg-type* \n[doc-arg-limit]
308 .  nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
309 .  doc-set-spacing-\n[doc-arg-type]
311 .  if \n[doc-debug] \{\
312 .    ie (\n[doc-arg-type] == 1) \
313 .      ds doc-str-dpav macro
314 .    el \{\
315 .      ie (\n[doc-arg-type] == 2) \
316 .        ds doc-str-dpav string
317 .      el \{\
318 .        ie (\n[doc-arg-type] == 3) \
319 .          ds doc-str-dpav closing punctuation or suffix
320 .        el \
321 .          ds doc-str-dpav opening punctuation or prefix
322 .    \}\}
324 .    ie \n[doc-inline-debug] \{\
325 .      br
326 .      nr doc-reg-dpav \n[.i]u
327 .      in -\n[doc-reg-dpav]u
329 .      if (\n[doc-arg-limit] == 1) \{\
330 .        nop \f[B]DEBUG(doc-parse-arg-vector)
331 .        nop MACRO:\f[P] `.\*[doc-macro-name]'
332 .        nop \& \f[B]Line #:\f[P] \n[.c]
333 .      \}
334 .      nop \t\f[B]Argc:\f[P] \n[doc-arg-limit]
335 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-arg-limit]]'
336 .      nop \ \f[B]Length:\f[P] \n[doc-width]
337 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-arg-limit]]'
338 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpav]
339 .    \}
340 .    el \{\
341 .      if (\n[doc-arg-limit] == 1) \{\
342 .        tmc "DEBUG(doc-parse-arg-vector)
343 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
344 .      \}
345 .      tmc "  Argc: \n[doc-arg-limit]
346 .      tmc "  Argv: `\*[doc-arg\n[doc-arg-limit]]'
347 .      tm1 "  Length: \n[doc-width]
348 .      tmc "  Space: `\*[doc-space\n[doc-arg-limit]]'
349 .      tm1 "  Type: \*[doc-str-dpav]
350 .  \}\}
352 .  ie (\n[doc-num-args] == 1) \{\
353 .    nr doc-arg-ptr 0
355 .    if \n[doc-nesting-level] \
356 .      if !\n[doc-func-arg-count] \
357 .        if !\n[doc-no-space] \
358 .          as doc-out-string "\*[doc-curr-space]
360 .    nr doc-no-space 0
361 .    nr doc-is-opening 0
363 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
365 .    nr doc-num-args 0
367 .    if \n[doc-debug] \{\
368 .      nr doc-reg-dpav1 1
370 .      ie \n[doc-inline-debug] \{\
371 .        nop \tMACRO REQUEST: .\*[doc-macro-name]
372 .        while (\n[doc-reg-dpav1] <= \n[doc-arg-limit]) \{\
373 .          nop "\*[doc-arg\n[doc-reg-dpav1]]"
374 .          nr doc-reg-dpav1 +1
375 .        \}
376 .        br
377 .        in \n[doc-reg-dpav]u
378 .      \}
379 .      el \{\
380 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
381 .        while (\n[doc-reg-dpav1] <= \n[doc-arg-limit]) \{\
382 .          tmc " "\*[doc-arg\n[doc-reg-dpav1]]"
383 .          nr doc-reg-dpav1 +1
384 .        \}
385 .        tm
386 .  \}\}\}
387 .  el \{\
388 .    nr doc-num-args -1
389 .    doc-parse-arg-vector
390 .  \}
394 .\" NS doc-parse-space-vector macro
395 .\" NS   parse space vector (recursive)
396 .\" NS
397 .\" NS modifies:
398 .\" NS   doc-spaceXXX, doc-arg-limit, doc-num-args, doc-curr-space
400 .de doc-parse-space-vector
401 .  nr doc-arg-limit +1
403 .  doc-set-spacing-\n[doc-type\n[doc-arg-limit]]
405 .  ie (\n[doc-num-args] == 1) \{\
406 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
407 .    nr doc-num-args 0
408 .  \}
409 .  el \{\
410 .    nr doc-num-args -1
411 .    doc-parse-space-vector
412 .  \}
416 .\" NS doc-remaining-args macro
417 .\" NS   output remaining arguments as-is, separated by spaces (until
418 .\" NS   `doc-num-args' is exhausted), to `doc-out-string'
419 .\" NS
420 .\" NS modifies:
421 .\" NS   doc-num-args, doc-arg-ptr, doc-out-string
423 .de doc-remaining-args
424 .  nr doc-arg-ptr +1
425 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
427 .  ie (\n[doc-num-args] == 1) \{\
428 .    nr doc-arg-ptr 0
429 .    nr doc-num-args 0
430 .  \}
431 .  el \{\
432 .    as doc-out-string "\*[doc-space]
433 .    nr doc-num-args -1
434 .    doc-remaining-args
435 .  \}
439 .\" NS doc-have-append global register (bool)
440 .\" NS   whether an argument has been appended to the argument vector
442 .nr doc-have-append 0
445 .\" NS doc-append-arg macro
446 .\" NS   append one argument to argument vector:
447 .\" NS   `.doc-append-arg [arg] [type]'
448 .\" NS
449 .\" NS modifies:
450 .\" NS   doc-argXXX, doc-typeXXX, doc-arg-limit, doc-have-append
452 .de doc-append-arg
453 .  nr doc-arg-limit +1
454 .  ds doc-arg\n[doc-arg-limit] "\$1
455 .  nr doc-type\n[doc-arg-limit] \$2
456 .  doc-set-spacing-\$2
457 .  nr doc-have-append 1
461 .\" NS doc-print-and-reset macro
462 .\" NS   print doc-out-string and clean up argument vectors
464 .de doc-print-and-reset
465 .  doc-print-out-string
466 .  doc-reset-args
470 .\" NS doc-reset-args macro
471 .\" NS   reset argument counters
472 .\" NS
473 .\" NS modifies:
474 .\" NS   doc-arg-limit, doc-arg-ptr, doc-have-append
476 .de doc-reset-args
477 .  nr doc-arg-limit 0
478 .  nr doc-arg-ptr 0
479 .  nr doc-have-append 0
483 .\" NS doc-print-out-string macro
484 .\" NS   print `doc-out-string', enabling hyphenation afterwards
485 .\" NS
486 .\" NS modifies:
487 .\" NS   doc-out-string, doc-curr-space
489 .de doc-print-out-string
490 .  if !(\n[doc-in-list] : \n[doc-nesting-level]) \
491 .    if !\n[doc-no-printing] \{\
492 .      nop \&\*[doc-out-string]
493 .      ds doc-curr-space
494 .      ds doc-out-string
495 .    \}
497 .  hy
503 .\" NS doc-curr-font global register
504 .\" NS   saved current font
506 .nr doc-curr-font \n[.f]
509 .\" NS doc-curr-size global register
510 .\" NS   saved current font size
512 .nr doc-curr-size \n[.s]
517 .\" NS Fl user macro
518 .\" NS   handle flags (appends `-' and prints flags): `.Fl [arg ...]'
519 .\" NS
520 .\" NS modifies:
521 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
522 .\" NS   doc-curr-size
523 .\" NS
524 .\" NS local variables:
525 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
526 .\" NS
527 .\" NS width register `Fl' set in doc-common
529 .de Fl
530 .  as doc-out-string \*[doc-Fl-font]
532 .  if !\n[doc-arg-limit] \{\
533 .    ie \n[.$] \{\
534 .      ds doc-macro-name Fl
535 .      doc-parse-args \$@
536 .    \}
537 .    el \{\
538 .      \" no arguments
539 .      as doc-out-string \|\-\|\f[P]\s[0]
540 .      doc-print-out-string
541 .  \}\}
543 .  if \n[doc-arg-limit] \{\
544 .    nr doc-arg-ptr +1
545 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
546 .      \" last argument
547 .      as doc-out-string \|\-\f[P]\s[0]
548 .      doc-print-and-reset
549 .    \}
550 .    el \{\
551 .      ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
552 .        as doc-out-string \|\-\f[P]\s[0]
553 .        \*[doc-arg\n[doc-arg-ptr]]
554 .      \}
555 .      el \{\
556 .        nr doc-curr-font \n[.f]
557 .        nr doc-curr-size \n[.s]
559 .        if (\n[doc-type\n[doc-arg-ptr]] == 3) \
560 .          as doc-out-string \|\-\|
562 .        nr doc-reg-Fl 1
563 .        doc-flag-recursion
564 .  \}\}\}
568 .\" NS doc-flag-recursion macro
569 .\" NS   `Fl' flag recursion routine (special handling)
570 .\" NS
571 .\" NS modifies:
572 .\" NS   doc-arg-ptr, doc-out-string
573 .\" NS
574 .\" NS local variables:
575 .\" NS   doc-str-dfr, doc-reg-dfr, doc-reg-dfr1
577 .de doc-flag-recursion
578 .  nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
579 .  ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
581 .  hy 0
583 .  ie (\n[doc-reg-dfr1] == 1) \{\
584 .    as doc-out-string \f[P]\s[0]
585 .    \*[doc-str-dfr]
586 .  \}
587 .  el \{\
588 .    nr doc-reg-dfr \n[doc-arg-ptr]
590 .    ie (\n[doc-reg-dfr1] == 2) \{\
591 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
592 .      \" doc-flag-recursion only; we need this to make `.Fl | ...' work
593 .      \" correctly
594 .      ie "\*[doc-str-dfr]"\*[Ba]" \{\
595 .        if \n[doc-reg-Fl] \
596 .          as doc-out-string \|\-\*[doc-space]
597 .        as doc-out-string \&\*[Ba]
598 .      \}
599 .      el \{\
600 .        ie "\*[doc-str-dfr]"\f[R]|\f[P]" \{\
601 .          if \n[doc-reg-Fl] \
602 .            as doc-out-string \|\-\*[doc-space]
603 .          as doc-out-string \f[R]|\f[P]
604 .        \}
605 .        el \{\
606 .          \" two consecutive hyphen characters?
607 .          ie "\*[doc-str-dfr]"-" \
608 .            as doc-out-string \|\-\^\-\|
609 .          el \
610 .            as doc-out-string \|\-\*[doc-str-dfr]
611 .    \}\}\}
612 .    el \{\
613 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
614 .      as doc-out-string "\*[doc-str-dfr]\f[P]\s[0]
615 .    \}
617 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
618 .      \" last argument
619 .      if (\n[doc-reg-dfr1] == 4) \
620 .        as doc-out-string \|\-
621 .      as doc-out-string \f[P]\s[0]
622 .      doc-print-and-reset
623 .    \}
624 .    el \{\
625 .      nr doc-arg-ptr +1
626 .      ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
627 .        ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
628 .          as doc-out-string \|\-
629 .        el \
630 .          as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
631 .      \}
632 .      el \
633 .        as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
635 .      shift
636 .      nr doc-reg-Fl 0
637 .      doc-flag-recursion \$@
638 .  \}\}
642 .\" NS doc-print-recursive macro
643 .\" NS   general name recursion routine (print remaining arguments)
644 .\" NS
645 .\" NS   hyphenation is disabled
646 .\" NS
647 .\" NS modifies:
648 .\" NS   doc-arg-ptr, doc-out-string
649 .\" NS
650 .\" NS local variables:
651 .\" NS   doc-str-dpr, doc-reg-dpr, doc-reg-dpr1
653 .de doc-print-recursive
654 .  nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
655 .  ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
657 .  hy 0
659 .  ie (\n[doc-reg-dpr1] == 1) \{\
660 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
661 .    \*[doc-str-dpr]
662 .  \}
663 .  el \{\
664 .    nr doc-reg-dpr \n[doc-arg-ptr]
666 .    ie (\n[doc-reg-dpr1] == 2) \
667 .      as doc-out-string \&\*[doc-str-dpr]
668 .    el \{\
669 .      \" punctuation character
670 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
671 .      as doc-out-string "\*[doc-str-dpr]\f[P]\s[0]
672 .    \}
674 .    nr doc-arg-ptr +1
675 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
676 .      \" last argument
677 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
678 .      doc-print-and-reset
679 .    \}
680 .    el \{\
681 .      as doc-out-string "\*[doc-space\n[doc-reg-dpr]]
682 .      doc-print-recursive
683 .  \}\}
687 .\" NS Ar user macro
688 .\" NS   command line `argument' macro: `.Ar [args ...]'
689 .\" NS
690 .\" NS modifies:
691 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
692 .\" NS   doc-curr-size
693 .\" NS
694 .\" NS width register `Ar' set in doc-common
696 .de Ar
697 .  as doc-out-string \*[doc-Ar-font]
699 .  if !\n[doc-arg-limit] \{\
700 .    ie \n[.$] \{\
701 .      ds doc-macro-name Ar
702 .      doc-parse-args \$@
703 .    \}
704 .    el \{\
705 .      \" no argument
706 .      as doc-out-string \&file\ ...\f[P]\s[0]
707 .      doc-print-out-string
708 .  \}\}
710 .  if \n[doc-arg-limit] \{\
711 .    nr doc-arg-ptr +1
712 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
713 .      as doc-out-string \&file\ ...\f[P]\s[0]
714 .      doc-print-and-reset
715 .    \}
716 .    el \{\
717 .      ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
718 .        as doc-out-string \&file\ ...\f[P]\s[0]
719 .        \*[doc-arg\n[doc-arg-ptr]]
720 .      \}
721 .      el \{\
722 .        nr doc-curr-font \n[.f]
723 .        nr doc-curr-size \n[.s]
724 .        if (\n[doc-type\n[doc-arg-ptr]] == 3) \
725 .          as doc-out-string \&file\ ...
726 .        doc-print-recursive
727 .  \}\}\}
731 .\" NS Ad user macro
732 .\" NS   Addresses
733 .\" NS
734 .\" NS modifies:
735 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
736 .\" NS   doc-curr-size
737 .\" NS
738 .\" NS width register `Ad' set in doc-common
740 .de Ad
741 .  if !\n[doc-arg-limit] \{\
742 .    ie \n[.$] \{\
743 .      ds doc-macro-name Ad
744 .      doc-parse-args \$@
745 .    \}
746 .    el \
747 .      tm Usage: .Ad address ... \*[doc-punct-chars] (#\n[.c])
748 .  \}
750 .  nr doc-arg-ptr +1
751 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
752 .    as doc-out-string \*[doc-Ad-font]
753 .    nr doc-curr-font \n[.f]
754 .    nr doc-curr-size \n[.s]
755 .    doc-print-recursive
756 .  \}
760 .\" NS doc-in-synopsis-count global register
761 .\" NS   whether we have more than a single item in synopsis
763 .nr doc-in-synopsis-count 0
766 .\" NS doc-indent-synopsis global register
767 .\" NS   indentation in synopsis
769 .nr doc-indent-synopsis 0
772 .\" NS Cd user macro
773 .\" NS   Config declaration (for section 4 SYNOPSIS)
774 .\" NS
775 .\" NS   this function causes a break; it uses the `Nm' font
776 .\" NS
777 .\" NS modifies:
778 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
779 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis
780 .\" NS
781 .\" NS width register `Cd' set in doc-common
783 .\" needs work - not very translatable
785 .de Cd
786 .  if !\n[doc-arg-limit] \{\
787 .    ie \n[.$] \{\
788 .      ds doc-macro-name Cd
789 .      doc-parse-args \$@
790 .    \}
791 .    el \
792 .      tm Usage: .Cd Configuration file declaration (#\n[.c])
793 .  \}
795 .  br
797 .  nr doc-arg-ptr +1
798 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
799 .    as doc-out-string \*[doc-Nm-font]
800 .    nr doc-curr-font \n[.f]
801 .    nr doc-curr-size \n[.s]
803 .    ie \n[doc-in-synopsis-count] \{\
804 .      if "\*[doc-macro-name]"Cd" \{\
805 .        rs
806 .        ie (\n[doc-in-synopsis-count] > 1) \
807 .          br
808 .        el \{\
809 .          if !\n[doc-indent-synopsis] \
810 .            nr doc-indent-synopsis \n[doc-display-indent]u
811 .        \}
812 .        in +\n[doc-indent-synopsis]u
813 .        ti -\n[doc-indent-synopsis]u
814 .        nr doc-in-synopsis-count +1
815 .      \}
817 .      doc-print-recursive
818 .      in -\n[doc-indent-synopsis]u
819 .    \}
820 .    el \
821 .      doc-print-recursive
822 .  \}
826 .\" NS Cm user macro
827 .\" NS   Interactive command modifier (flag)
828 .\" NS
829 .\" NS modifies:
830 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
831 .\" NS   doc-curr-size
832 .\" NS
833 .\" NS width register `Cm' set in doc-common
835 .de Cm
836 .  if !\n[doc-arg-limit] \{\
837 .    ie \n[.$] \{\
838 .      ds doc-macro-name Cm
839 .      doc-parse-args \$@
840 .    \}
841 .    el \{\
842 .      tmc Usage: .Cm Interactive command modifier ...
843 .      tm1 " \*[doc-punct-chars] (#\n[.c])
844 .  \}\}
846 .  nr doc-arg-ptr +1
847 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
848 .    as doc-out-string \*[doc-Cm-font]
849 .    nr doc-curr-font \n[.f]
850 .    nr doc-curr-size \n[.s]
851 .    doc-print-recursive
852 .  \}
856 .\" NS Dv user macro
857 .\" NS   define variable
858 .\" NS
859 .\" NS   this function uses the `Er' font
860 .\" NS
861 .\" NS modifies:
862 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
863 .\" NS   doc-curr-size
864 .\" NS
865 .\" NS width register `Dv' set in doc-common
867 .de Dv
868 .  if !\n[doc-arg-limit] \{\
869 .    ie \n[.$] \{\
870 .      ds doc-macro-name Dv
871 .      doc-parse-args \$@
872 .    \}
873 .    el \
874 .      tm Usage: .Dv define_variable ... \*[doc-punct-chars] (#\n[.c])
875 .  \}
877 .  nr doc-arg-ptr +1
878 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
879 .    as doc-out-string \*[doc-Er-font]
880 .    nr doc-curr-font \n[.f]
881 .    nr doc-curr-size \n[.s]
882 .    doc-print-recursive
883 .  \}
887 .\" NS Em user macro
888 .\" NS   emphasis
889 .\" NS
890 .\" NS modifies:
891 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
892 .\" NS   doc-curr-size
893 .\" NS
894 .\" NS width register `Em' set in doc-common
896 .de Em
897 .  if !\n[doc-arg-limit] \{\
898 .    ie \n[.$] \{\
899 .      ds doc-macro-name Em
900 .      doc-parse-args \$@
901 .    \}
902 .    el \
903 .      tm Usage: .Em text ... \*[doc-punct-chars] (#\n[.c])
904 .  \}
906 .  nr doc-arg-ptr +1
907 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
908 .    as doc-out-string \*[doc-Em-font]
909 .    nr doc-curr-font \n[.f]
910 .    nr doc-curr-size \n[.s]
911 .    doc-print-recursive
912 .  \}
916 .\" NS Er user macro
917 .\" NS   errno type
918 .\" NS
919 .\" NS modifies:
920 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
921 .\" NS   doc-curr-size
922 .\" NS
923 .\" NS width register `Er' set in doc-common
925 .de Er
926 .  if !\n[doc-arg-limit] \{\
927 .    ie \n[.$] \{\
928 .      ds doc-macro-name Er
929 .      doc-parse-args \$@
930 .    \}
931 .    el \
932 .      tm Usage: .Er errno_type ... \*[doc-punct-chars] (#\n[.c])
933 .  \}
935 .  nr doc-arg-ptr +1
936 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
937 .    as doc-out-string \*[doc-Er-font]
938 .    nr doc-curr-font \n[.f]
939 .    nr doc-curr-size \n[.s]
940 .    doc-print-recursive
941 .  \}
945 .\" NS Ev user macro
946 .\" NS   environment variable
947 .\" NS
948 .\" NS modifies:
949 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
950 .\" NS   doc-curr-size
951 .\" NS
952 .\" NS width register `Ev' set in doc-common
954 .de Ev
955 .  if !\n[doc-arg-limit] \{\
956 .    ie \n[.$] \{\
957 .      ds doc-macro-name Ev
958 .      doc-parse-args \$@
959 .    \}
960 .    el \
961 .      tm Usage: .Ev enviroment_variable ... \*[doc-punct-chars] (#\n[.c])
962 .  \}
964 .  nr doc-arg-ptr +1
965 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
966 .    as doc-out-string \*[doc-Ev-font]
967 .    nr doc-curr-font \n[.f]
968 .    nr doc-curr-size \n[.s]
969 .    doc-print-recursive
970 .  \}
974 .\" NS doc-have-decl global register (bool)
975 .\" NS   subroutine test (in synopsis only)
977 .nr doc-have-decl 0
980 .\" NS doc-have-var global register (bool)
981 .\" NS   whether last type is a variable type
983 .nr doc-have-var 0
986 .\" NS doc-do-func-decl macro
987 .\" NS   do someting special while in SYNOPSIS
988 .\" NS
989 .\" NS modifies:
990 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
991 .\" NS   doc-have-var
993 .de doc-do-func-decl
994 .  if \n[doc-in-synopsis-count] \{\
995 .    \" if a variable type was the last thing given, want vertical space
996 .    if \n[doc-have-var] \{\
997 .      doc-paragraph
998 .      nr doc-have-var 0
999 .    \}
1000 .    \" if a subroutine was the last thing given, want vertical space
1001 .    if \n[doc-have-func] \{\
1002 .      ie \n[doc-have-decl] \
1003 .        br
1004 .      el \{\
1005 .        doc-paragraph
1006 .        rs
1007 .    \}\}
1008 .    nr doc-have-decl 1
1009 .  \}
1011 .  nr doc-curr-font \n[.f]
1012 .  nr doc-curr-size \n[.s]
1016 .\" NS Fd user macro
1017 .\" NS   function declaration -- not callable
1018 .\" NS
1019 .\" NS   this function causes a break
1020 .\" NS
1021 .\" NS width register `Fd' set in doc-common
1023 .de Fd
1024 .  ie \n[doc-arg-limit] \
1025 .    tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
1026 .  el \{\
1027 .    doc-do-func-decl
1028 .    nop \*[doc-Fd-font]\$*
1029 .    br
1030 .    ft \n[doc-curr-font]
1031 .    ps \n[doc-curr-size]
1032 .  \}
1036 .\" NS In user macro
1037 .\" NS   #include statement - not callable (& no err check)
1038 .\" NS
1039 .\" NS   this function causes a break; it uses the `Fd' font
1040 .\" NS
1041 .\" NS width register `In' set in doc-common
1043 .de In
1044 .  ie \n[doc-arg-limit] \
1045 .    tm Usage: .In #include_statement -- In is not callable (#\n[.c])
1046 .  el \{\
1047 .    doc-do-func-decl
1048 .    nop \*[doc-Fd-font]#include <\$1>
1049 .    br
1050 .    ft \n[doc-curr-font]
1051 .    ps \n[doc-curr-size]
1052 .  \}
1056 .\" NS Fr user macro
1057 .\" NS   function return value
1058 .\" NS
1059 .\" NS   this function uses the `Ar' font
1060 .\" NS
1061 .\" NS modifies:
1062 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1063 .\" NS   doc-curr-size
1064 .\" NS
1065 .\" NS width register `Fr' set in doc-common
1067 .de Fr
1068 .  if !\n[doc-arg-limit] \{\
1069 .    ie \n[.$] \{\
1070 .      ds doc-macro-name Fr
1071 .      doc-parse-args \$@
1072 .    \}
1073 .    el \
1074 .      tm Usage: .Fr Function_return_value... \*[doc-punct-chars] (#\n[.c])
1075 .  \}
1077 .  nr doc-arg-ptr +1
1078 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1079 .    as doc-out-string \*[doc-Ar-font]
1080 .    nr doc-curr-font \n[.f]
1081 .    nr doc-curr-size \n[.s]
1082 .    doc-print-recursive
1083 .  \}
1087 .\" NS Ic user macro
1088 .\" NS   interactive command
1089 .\" NS
1090 .\" NS modifies:
1091 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1092 .\" NS   doc-curr-size
1093 .\" NS
1094 .\" NS width register `Ic' set in doc-common
1096 .de Ic
1097 .  if !\n[doc-arg-limit] \{\
1098 .    ie \n[.$] \{\
1099 .      ds doc-macro-name Ic
1100 .      doc-parse-args \$@
1101 .    \}
1102 .    el \
1103 .      tm Usage: .Ic Interactive command ... \*[doc-punct-chars] (#\n[.c])
1104 .  \}
1106 .  nr doc-arg-ptr +1
1107 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1108 .    as doc-out-string \*[doc-Ic-font]
1109 .    nr doc-curr-font \n[.f]
1110 .    nr doc-curr-size \n[.s]
1111 .    doc-print-recursive
1112 .  \}
1116 .\" NS Li user macro
1117 .\" NS   literals
1118 .\" NS
1119 .\" NS modifies:
1120 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1121 .\" NS   doc-curr-size
1122 .\" NS
1123 .\" NS width register `Li' set in doc-common
1125 .de Li
1126 .  if !\n[doc-arg-limit] \{\
1127 .    ie \n[.$] \{\
1128 .      ds doc-macro-name Li
1129 .      doc-parse-args \$@
1130 .    \}
1131 .    el \
1132 .      tm Usage: .Li argument ... \*[doc-punct-chars] (#\n[.c])
1133 .  \}
1135 .  nr doc-arg-ptr +1
1136 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1137 .    as doc-out-string \*[doc-Li-font]
1138 .    nr doc-curr-font \n[.f]
1139 .    nr doc-curr-size \n[.s]
1140 .    doc-print-recursive
1141 .  \}
1145 .\" NS Or user macro
1146 .\" NS   pipe symbol (OR)
1147 .\" NS
1148 .\" NS modifies:
1149 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1150 .\" NS   doc-curr-size
1151 .\" NS
1152 .\" NS width register `Or' set in doc-common
1154 .\" XXX: What is this function good for?  It sets a font but does not print
1155 .\"      a pipe symbol.  And it isn't documented.
1157 .de Or
1158 .  if !\n[doc-arg-limit] \{\
1159 .    ie \n[.$] \{\
1160 .      ds doc-macro-name Or
1161 .      doc-parse-args \$@
1162 .    \}
1163 .    el \
1164 .      tm Usage: .Or ... \*[doc-punct-chars] (#\n[.c])
1165 .  \}
1167 .  nr doc-arg-ptr +1
1168 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1169 .    as doc-out-string \*[doc-Ic-font]
1170 .    nr doc-curr-font \n[.f]
1171 .    nr doc-curr-size \n[.s]
1172 .    doc-print-recursive
1173 .  \}
1177 .\" NS Ms user macro
1178 .\" NS   math symbol
1179 .\" NS
1180 .\" NS   this function uses the `Sy' font
1181 .\" NS
1182 .\" NS modifies:
1183 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1184 .\" NS   doc-curr-size
1185 .\" NS
1186 .\" NS width register `Ms' set in doc-common
1188 .de Ms
1189 .  if !\n[doc-arg-limit] \{\
1190 .    ie \n[.$] \{\
1191 .      ds doc-macro-name Ms
1192 .      doc-parse-args \$@
1193 .    \}
1194 .    el \
1195 .      tm Usage: .Ms Math symbol ... \*[doc-punct-chars] (#\n[.c])
1196 .  \}
1198 .  nr doc-arg-ptr +1
1199 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1200 .    as doc-out-string \*[doc-Sy-font]
1201 .    nr doc-curr-font \n[.f]
1202 .    nr doc-curr-size \n[.s]
1203 .    doc-print-recursive
1204 .  \}
1208 .\" NS doc-command-name global string
1209 .\" NS   save first invocation of .Nm
1211 .ds doc-command-name
1214 .\" NS Nm user macro
1215 .\" NS   name of command or page topic
1216 .\" NS
1217 .\" NS modifies:
1218 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1219 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
1220 .\" NS   doc-command-name
1221 .\" NS
1222 .\" NS width register `Nm' set in doc-common
1224 .de Nm
1225 .  if !\n[doc-arg-limit] \{\
1226 .    ds doc-macro-name Nm
1227 .    ie \n[.$] \
1228 .      doc-parse-args \$@
1229 .    el \{\
1230 .      ie "\*[doc-command-name]"" \
1231 .        tm Usage: .Nm Name ... \*[doc-punct-chars] (#\n[.c])
1232 .      el \
1233 .        doc-parse-args \*[doc-command-name]
1234 .  \}\}
1236 .  if \n[doc-arg-limit] \{\
1237 .    nr doc-arg-ptr +1
1238 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1239 .      \" last argument
1240 .      as doc-out-string \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1241 .      doc-print-and-reset
1242 .    \}
1243 .    el \{\
1244 .      as doc-out-string \*[doc-Nm-font]
1245 .      ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \
1246 .        as doc-out-string \&\*[doc-command-name]\f[P]\s[0]
1247 .      el \{\
1248 .        nr doc-curr-font \n[.f]
1249 .        nr doc-curr-size \n[.s]
1251 .        \" handle `.Nm ...' in SYNOPSIS
1252 .        if \n[doc-in-synopsis-count] \{\
1253 .          if "\*[doc-macro-name]"Nm" \{\
1254 .            rs
1255 .            in -\n[doc-indent-synopsis]u
1256 .            ie (\n[doc-in-synopsis-count] > 1) \
1257 .              br
1258 .            el \{\
1259 .              if !\n[doc-indent-synopsis] \{\
1260 .                doc-get-width "\*[doc-arg\n[doc-arg-ptr]]
1261 .                nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
1262 .            \}\}
1263 .            in +\n[doc-indent-synopsis]u
1264 .            ti -\n[doc-indent-synopsis]u
1265 .            nr doc-in-synopsis-count +1
1266 .        \}\}
1267 .        if "\*[doc-command-name]"" \
1268 .          ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
1269 .      \}
1270 .      doc-print-recursive
1271 .  \}\}
1275 .\" NS Pa user macro
1276 .\" NS   pathname: `.Pa [arg ...]'
1277 .\" NS
1278 .\" NS modifies:
1279 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1280 .\" NS   doc-curr-size
1281 .\" NS
1282 .\" NS width register `Pa' set in doc-common
1284 .de Pa
1285 .  if !\n[doc-arg-limit] \{\
1286 .    ie \n[.$] \{\
1287 .      ds doc-macro-name Pa
1288 .      doc-parse-args \$@
1289 .    \}
1290 .    el \{\
1291 .      \" default value
1292 .      nop \*[doc-Pa-font]~\f[P]\s[0]
1293 .  \}\}
1295 .  nr doc-arg-ptr +1
1296 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1297 .    as doc-out-string \*[doc-Pa-font]
1298 .    nr doc-curr-font \n[.f]
1299 .    nr doc-curr-size \n[.s]
1300 .    doc-print-recursive
1301 .  \}
1305 .\" NS Sy user macro
1306 .\" NS   symbolics
1307 .\" NS
1308 .\" NS modifies:
1309 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1310 .\" NS   doc-curr-size
1311 .\" NS
1312 .\" NS width register `Sy' set in doc-common
1314 .de Sy
1315 .  if !\n[doc-arg-limit] \{\
1316 .    ie \n[.$] \{\
1317 .      ds doc-macro-name Sy
1318 .      doc-parse-args \$@
1319 .    \}
1320 .    el \
1321 .      tm Usage: .Sy symbolic_text ... \*[doc-punct-chars] (#\n[.c])
1322 .  \}
1324 .  nr doc-arg-ptr +1
1325 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1326 .    as doc-out-string \*[doc-Sy-font]
1327 .    nr doc-curr-font \n[.f]
1328 .    nr doc-curr-size \n[.s]
1329 .    doc-print-recursive
1330 .  \}
1334 .\" NS Me user macro
1335 .\" NS   menu entries
1336 .\" NS
1337 .\" NS modifies:
1338 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1339 .\" NS   doc-curr-size
1340 .\" NS
1341 .\" NS width register `Me' set in doc-common
1343 .de Me
1344 .  if !\n[doc-arg-limit] \{\
1345 .    ie \n[.$] \{\
1346 .      ds doc-macro-name Me
1347 .      doc-parse-args \$@
1348 .    \}
1349 .    el \
1350 .      tm Usage: .Me menu_entry ... \*[doc-punct-chars] (#\n[.c])
1351 .  \}
1353 .  nr doc-arg-ptr +1
1354 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1355 .    as doc-out-string \*[doc-Me-font]
1356 .    nr doc-curr-font \n[.f]
1357 .    nr doc-curr-size \n[.s]
1358 .    doc-print-recursive
1359 .  \}
1363 .\" NS Tn user macro
1364 .\" NS   trade name
1365 .\" NS
1366 .\" NS modifies:
1367 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1368 .\" NS   doc-curr-size
1369 .\" NS
1370 .\" NS width register `Tn' set in doc-common
1372 .de Tn
1373 .  if !\n[doc-arg-limit] \{\
1374 .    ie \n[.$] \{\
1375 .      ds doc-macro-name Tn
1376 .      doc-parse-args \$@
1377 .    \}
1378 .    el \
1379 .      tm Usage: .Tn trade_name ... \*[doc-punct-chars] (#\n[.c])
1380 .  \}
1382 .  nr doc-arg-ptr +1
1383 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1384 .    as doc-out-string \&\*[doc-Tn-font-shape]\*[doc-Tn-font-size]
1385 .    nr doc-curr-font \n[.f]
1386 .    nr doc-curr-size \n[.s]
1387 .    doc-print-recursive
1388 .  \}
1392 .\" NS doc-reference-trademark macro
1393 .\" NS   .Tn for inside of references
1394 .\" NS
1395 .\" NS modifies:
1396 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1397 .\" NS   doc-curr-size
1398 .\" NS
1399 .\" NS   the code for references below checks for `Tn'!
1401 .de doc-reference-trademark
1402 .  if !\n[doc-arg-limit] \{\
1403 .    ie \n[.$] \{\
1404 .      ds doc-macro-name Tn
1405 .      doc-parse-args \$@
1406 .    \}
1407 .    el \
1408 .      tm Usage: .Tn trade_name ... \*[doc-punct-chars] (#\n[.c])
1409 .  \}
1411 .  nr doc-arg-ptr +1
1412 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1413 .    as doc-out-string \&\*[doc-Tn-font-size]
1414 .    nr doc-curr-font \n[.f]
1415 .    nr doc-curr-size \n[.s]
1416 .    doc-do-references
1417 .  \}
1421 .\" NS Va user macro
1422 .\" NS   variable name
1423 .\" NS
1424 .\" NS modifies:
1425 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1426 .\" NS   doc-curr-size
1427 .\" NS
1428 .\" NS width register `Va' set in doc-common
1430 .de Va
1431 .  if !\n[doc-arg-limit] \{\
1432 .    ie \n[.$] \{\
1433 .      ds doc-macro-name Va
1434 .      doc-parse-args \$@
1435 .    \}
1436 .    el \
1437 .      tm Usage: .Va variable_name ... \*[doc-punct-chars] (#\n[.c])
1438 .  \}
1440 .  nr doc-arg-ptr +1
1441 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1442 .    as doc-out-string \*[doc-Va-font]
1443 .    nr doc-curr-font \n[.f]
1444 .    nr doc-curr-size \n[.s]
1445 .    doc-print-recursive
1446 .  \}
1450 .\" NS No user macro
1451 .\" NS   normal text macro (default text style if mess up)
1452 .\" NS
1453 .\" NS modifies:
1454 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1455 .\" NS   doc-curr-size
1456 .\" NS
1457 .\" NS width register `No' set in doc-common
1459 .de No
1460 .  as doc-out-string \*[doc-No-font]
1462 .  if !\n[doc-arg-limit] \{\
1463 .    ie \n[.$] \{\
1464 .      ds doc-macro-name No
1465 .      doc-parse-args \$@
1466 .    \}
1467 .    el \
1468 .      tm Usage: .No normal_text ... \*[doc_punct_chars] (#\n[.c])
1469 .  \}
1471 .  nr doc-arg-ptr +1
1472 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1473 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \
1474 .      \*[doc-arg\n[doc-arg-ptr]]
1475 .    el \{\
1476 .      nr doc-curr-font \n[.f]
1477 .      nr doc-curr-size \n[.s]
1478 .      doc-print-recursive
1479 .  \}\}
1480 .  el \
1481 .    doc-print-and-reset
1485 .\" NS doc-quote-left global string
1486 .\" NS   left quotation character for `doc-enclose-string' and
1487 .\" NS   `doc-enclose-open'
1489 .ds doc-quote-left
1492 .\" NS doc-quote-right global string
1493 .\" NS   right quotation character for `doc-enclose-string' and
1494 .\" NS   `doc-enclose-close'
1496 .ds doc-quote-right
1499 .\" NS Op user macro
1500 .\" NS   option expression (i.e., enclose string in square brackets)
1501 .\" NS
1502 .\" NS modifies:
1503 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1504 .\" NS
1505 .\" NS width register `Op' set in doc-common
1507 .de Op
1508 .  if !\n[doc-arg-limit] \
1509 .    ds doc-macro-name Op
1511 .  ds doc-quote-left "\*[doc-left-bracket]
1512 .  ds doc-quote-right "\*[doc-right-bracket]
1514 .  doc-enclose-string \$@
1518 .\" NS Aq user macro
1519 .\" NS   enclose string in angle brackets
1520 .\" NS
1521 .\" NS modifies:
1522 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1523 .\" NS
1524 .\" NS width register `Aq' set in doc-common
1526 .de Aq
1527 .  if !\n[doc-arg-limit] \
1528 .    ds doc-macro-name Aq
1530 .  ds doc-quote-left <
1531 .  ds doc-quote-right >
1533 .  doc-enclose-string \$@
1537 .\" NS Bq user macro
1538 .\" NS   enclose string in square brackets
1539 .\" NS
1540 .\" NS modifies:
1541 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1542 .\" NS
1543 .\" NS width register `Bq' set in doc-common
1545 .de Bq
1546 .  if !\n[doc-arg-limit] \
1547 .    ds doc-macro-name Bq
1549 .  ds doc-quote-left "\*[doc-left-bracket]
1550 .  ds doc-quote-right "\*[doc-right-bracket]
1552 .  doc-enclose-string \$@
1556 .\" NS Brq user macro
1557 .\" NS   enclose string in braces
1558 .\" NS
1559 .\" NS modifies:
1560 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1561 .\" NS
1562 .\" NS width register `Brq' set in doc-common
1564 .de Brq
1565 .  if !\n[doc-arg-limit] \
1566 .    ds doc-macro-name Brq
1568 .  ds doc-quote-left {
1569 .  ds doc-quote-right }
1571 .  doc-enclose-string \$@
1575 .\" NS Dq user macro
1576 .\" NS   enclose string in double quotes
1577 .\" NS
1578 .\" NS modifies:
1579 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1580 .\" NS
1581 .\" NS width register `Dq' set in doc-common
1583 .de Dq
1584 .  if !\n[doc-arg-limit] \
1585 .    ds doc-macro-name Dq
1587 .  ds doc-quote-left "\*[Lq]
1588 .  ds doc-quote-right "\*[Rq]
1590 .  doc-enclose-string \$@
1594 .\" NS Eq user macro
1595 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1596 .\" NS
1597 .\" NS modifies:
1598 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1599 .\" NS
1600 .\" NS width register `Eq' set in doc-common
1602 .de Eq
1603 .  if !\n[doc-arg-limit] \
1604 .    ds doc-macro-name Eq
1606 .  ds doc-quote-left "\$1
1607 .  ds doc-quote-right "\$2
1609 .  shift 2
1610 .  doc-enclose-string \$@
1614 .\" NS Pq user macro
1615 .\" NS   enclose string in parentheses
1616 .\" NS
1617 .\" NS modifies:
1618 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1619 .\" NS
1620 .\" NS width register `Pq' set in doc-common
1622 .de Pq
1623 .  if !\n[doc-arg-limit] \
1624 .    ds doc-macro-name Pq
1626 .  ds doc-quote-left "\*[doc-left-parenthesis]
1627 .  ds doc-quote-right "\*[doc-right-parenthesis]
1629 .  doc-enclose-string \$@
1633 .\" NS Ql user macro
1634 .\" NS   quoted literal
1636 .\"   is in file doc-[dit|n]roff
1639 .\" NS Qq user macro
1640 .\" NS   enclose string in straight double quotes
1641 .\" NS
1642 .\" NS modifies:
1643 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1644 .\" NS
1645 .\" NS width register `Qq' set in doc-common
1647 .de Qq
1648 .  if !\n[doc-arg-limit] \
1649 .    ds doc-macro-name Qq
1651 .  ds doc-quote-left "\*[q]
1652 .  ds doc-quote-right "\*[q]
1654 .  doc-enclose-string \$@
1658 .\" NS Sq user macro
1659 .\" NS   enclose string in single quotes
1660 .\" NS
1661 .\" NS modifies:
1662 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1663 .\" NS
1664 .\" NS width register `Sq' set in doc-common
1666 .de Sq
1667 .  if !\n[doc-arg-limit] \
1668 .    ds doc-macro-name Sq
1670 .  ds doc-quote-left "\*[doc-left-singlequote]
1671 .  ds doc-quote-right "\*[doc-right-singlequote]
1673 .  doc-enclose-string \$@
1677 .\" NS Es user macro
1678 .\" NS   set up arguments (i.e., the left and right quotation character as
1679 .\" NS   first and second argument) for .En call
1680 .\" NS
1681 .\" NS modifies:
1682 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right, doc-arg-ptr
1684 .de Es
1685 .  if !\n[doc-arg-limit] \{\
1686 .    ie (\n[.$] > 2) \{\
1687 .        ds doc-macro-name Es
1688 .        doc-parse-args \$@
1689 .    \}
1690 .    el \{\
1691 .      ds doc-quote-left "\$1
1692 .      ds doc-quote-right "\$2
1693 .  \}\}
1695 .  if \n[doc-arg-limit] \{\
1696 .    nr doc-arg-ptr +1
1697 .    ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
1698 .    nr doc-arg-ptr +1
1699 .    ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
1700 .    nr doc-arg-ptr +1
1701 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
1702 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
1703 .    el \
1704 .      doc-print-and-reset
1705 .  \}
1709 .\" NS doc-is-opening global register (bool)
1710 .\" NS   whether current request emits an opening character
1712 .nr doc-is-opening 0
1715 .\" NS doc-enclose-string macro
1716 .\" NS   enclose string with given args (e.g. [ and ])
1717 .\" NS
1718 .\" NS modifies:
1719 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string
1720 .\" NS
1721 .\" NS local variables:
1722 .\" NS   doc-reg-des (for communication with doc-skip-punct-backwards)
1723 .\" NS
1724 .\" NS requires:
1725 .\" NS   doc-quote-left, doc-quote-right
1727 .de doc-enclose-string
1728 .  ie \n[doc-arg-limit] \
1729 .    as doc-out-string \&\*[doc-quote-left]
1730 .  el \{\
1731 .    ie \n[.$] \{\
1732 .      \" was the last request on the previous line an opening request?
1733 .      if \n[doc-is-opening] \
1734 .        nr doc-no-space 1
1735 .      doc-parse-args \$@
1736 .      as doc-out-string \&\*[doc-quote-left]
1737 .    \}
1738 .    el \{\
1739 .      \" no argument
1740 .      as doc-out-string \&\*[doc-quote-left]\*[doc-quote-right]
1741 .      doc-print-out-string
1742 .  \}\}
1744 .  if \n[doc-arg-limit] \{\
1745 .    nr doc-arg-ptr +1
1746 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1747 .      \" last argument
1748 .      as doc-out-string \&\*[doc-quote-right]
1749 .      doc-print-and-reset
1750 .    \}
1751 .    el \{\
1752 .      \" We test the last argument.  If it isn't a closing punctuation
1753 .      \" resp. suffix, we append one so that we have an anchor for
1754 .      \" prepending nested closing delimiters.
1755 .      ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
1756 .        nr doc-reg-des (\n[doc-arg-limit] - 1)
1757 .        doc-skip-punct-backwards
1758 .        nr doc-reg-des +1
1759 .        ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\&\*[doc-arg\n[doc-reg-des]]
1760 .        nr doc-reg-des 0
1761 .      \}
1762 .      el \
1763 .        doc-append-arg "\*[doc-quote-right]" 3
1765 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
1766 .  \}\}
1770 .\" NS En user macro
1771 .\" NS   enclose arguments with quotation characters set up with `.Es'
1773 .als En doc-enclose-string
1776 .\" NS doc-skip-punct-backwards macro
1777 .\" NS   vector routine (for `doc-enclose-string': trace backwards past
1778 .\" NS   trailing punctuation)
1779 .\" NS
1780 .\" NS requires:
1781 .\" NS   doc-reg-des
1783 .de doc-skip-punct-backwards
1784 .  if (\n[doc-type\n[doc-reg-des]] == 3) \{\
1785 .    nr doc-reg-des -1
1786 .    doc-skip-punct-backwards
1787 .  \}
1791 .\" NS Ao user macro
1792 .\" NS   angle open
1793 .\" NS
1794 .\" NS modifies:
1795 .\" NS   doc-macro-name, doc-quote-left
1796 .\" NS
1797 .\" NS width register `Ao' set in doc-common
1799 .de Ao
1800 .  if !\n[doc-arg-limit] \
1801 .    ds doc-macro-name Ao
1803 .  ds doc-quote-left <
1805 .  doc-enclose-open \$@
1809 .\" NS Ac user macro
1810 .\" NS   angle close
1811 .\" NS
1812 .\" NS modifies:
1813 .\" NS   doc-macro-name, doc-quote-right
1814 .\" NS
1815 .\" NS width register `Ac' set in doc-common
1817 .de Ac
1818 .  if !\n[doc-arg-limit] \
1819 .    ds doc-macro-name Ac
1821 .  ds doc-quote-right >
1823 .  doc-enclose-close \$@
1827 .\" NS Bo user macro
1828 .\" NS   bracket open
1829 .\" NS
1830 .\" NS modifies:
1831 .\" NS   doc-macro-name, doc-quote-left
1832 .\" NS
1833 .\" NS width register `Bo' set in doc-common
1835 .de Bo
1836 .  if !\n[doc-arg-limit] \
1837 .    ds doc-macro-name Bo
1839 .  ds doc-quote-left "\*[doc-left-bracket]
1841 .  doc-enclose-open \$@
1845 .\" NS Bc user macro
1846 .\" NS   bracket close
1847 .\" NS
1848 .\" NS modifies:
1849 .\" NS   doc-macro-name, doc-quote-right
1850 .\" NS
1851 .\" NS width register `Bc' set in doc-common
1853 .de Bc
1854 .  if !\n[doc-arg-limit] \
1855 .    ds doc-macro-name Bc
1857 .  ds doc-quote-right "\*[doc-right-bracket]
1859 .  doc-enclose-close \$@
1863 .\" NS Bro user macro
1864 .\" NS   brace open
1865 .\" NS
1866 .\" NS modifies:
1867 .\" NS   doc-macro-name, doc-quote-left
1868 .\" NS
1869 .\" NS width register `Bro' set in doc-common
1871 .de Bro
1872 .  if !\n[doc-arg-limit] \
1873 .    ds doc-macro-name Bo
1875 .  ds doc-quote-left {
1877 .  doc-enclose-open \$@
1881 .\" NS Brc user macro
1882 .\" NS   brace close
1883 .\" NS
1884 .\" NS modifies:
1885 .\" NS   doc-macro-name, doc-quote-right
1886 .\" NS
1887 .\" NS width register `Brc' set in doc-common
1889 .de Brc
1890 .  if !\n[doc-arg-limit] \
1891 .    ds doc-macro-name Bc
1893 .  ds doc-quote-right }
1895 .  doc-enclose-close \$@
1899 .\" NS Do user macro
1900 .\" NS   double quote open
1901 .\" NS
1902 .\" NS modifies:
1903 .\" NS   doc-macro-name, doc-quote-left
1904 .\" NS
1905 .\" NS width register `Do' set in doc-common
1907 .de Do
1908 .  if !\n[doc-arg-limit] \
1909 .    ds doc-macro-name Do
1911 .  ds doc-quote-left "\*[Lq]
1913 .  doc-enclose-open \$@
1917 .\" NS Dc user macro
1918 .\" NS   double quote close
1919 .\" NS
1920 .\" NS modifies:
1921 .\" NS   doc-macro-name, doc-quote-right
1922 .\" NS
1923 .\" NS width register `Dc' set in doc-common
1925 .de Dc
1926 .  if !\n[doc-arg-limit] \
1927 .    ds doc-macro-name Dc
1929 .  ds doc-quote-right "\*[Rq]
1931 .  doc-enclose-close \$@
1935 .\" NS Eo user macro
1936 .\" NS   enclose open (using first argument as beginning of enclosure)
1937 .\" NS
1938 .\" NS modifies:
1939 .\" NS   doc-macro-name, doc-quote-left
1940 .\" NS
1941 .\" NS width register `Eo' set in doc-common
1943 .de Eo
1944 .  if !\n[doc-arg-limit] \
1945 .    ds doc-macro-name Eo
1947 .  ds doc-quote-left "\$1
1949 .  shift
1950 .  doc-enclose-open \$@
1954 .\" NS Ec user macro
1955 .\" NS   enclose close (using first argument as end of enclosure)
1956 .\" NS
1957 .\" NS modifies:
1958 .\" NS   doc-macro-name, doc-quote-right
1959 .\" NS
1960 .\" NS width register `Ec' set in doc-common
1962 .de Ec
1963 .  if !\n[doc-arg-limit] \
1964 .    ds doc-macro-name Ec
1966 .  ds doc-quote-right "\$1
1968 .  shift
1969 .  doc-enclose-close \$@
1973 .\" NS Oo user macro
1974 .\" NS   option open
1975 .\" NS
1976 .\" NS modifies:
1977 .\" NS   doc-macro-name, doc-quote-left
1978 .\" NS
1979 .\" NS width register `Oo' set in doc-common
1981 .de Oo
1982 .  if !\n[doc-arg-limit] \
1983 .    ds doc-macro-name Oo
1985 .  ds doc-quote-left [
1987 .  doc-enclose-open \$@
1991 .\" NS Oc user macro
1992 .\" NS   option close
1993 .\" NS
1994 .\" NS modifies:
1995 .\" NS   doc-macro-name, doc-quote-right
1996 .\" NS
1997 .\" NS width register `Oc' set in doc-common
1999 .de Oc
2000 .  if !\n[doc-arg-limit] \
2001 .    ds doc-macro-name Oc
2003 .  ds doc-quote-right ]
2005 .  doc-enclose-close \$@
2009 .\" NS Po user macro
2010 .\" NS   parenthesis open
2011 .\" NS
2012 .\" NS modifies:
2013 .\" NS   doc-macro-name, doc-quote-left
2014 .\" NS
2015 .\" NS width register `Po' set in doc-common
2017 .de Po
2018 .  if !\n[doc-arg-limit] \
2019 .    ds doc-macro-name Po
2021 .  ds doc-quote-left "\*[doc-left-parenthesis]
2023 .  doc-enclose-open \$@
2027 .\" NS Pc user macro
2028 .\" NS   parenthesis close
2029 .\" NS
2030 .\" NS modifies:
2031 .\" NS   doc-macro-name, doc-quote-right
2032 .\" NS
2033 .\" NS width register `Pc' set in doc-common
2035 .de Pc
2036 .  if !\n[doc-arg-limit] \
2037 .    ds doc-macro-name Pc
2039 .  ds doc-quote-right "\*[doc-right-parenthesis]
2041 .  doc-enclose-close \$@
2045 .\" NS Qo user macro
2046 .\" NS   straight double quote open
2047 .\" NS
2048 .\" NS modifies:
2049 .\" NS   doc-macro-name, doc-quote-left
2050 .\" NS
2051 .\" NS width register `Qo' set in doc-common
2053 .de Qo
2054 .  if !\n[doc-arg-limit] \
2055 .    ds doc-macro-name Qo
2057 .  ds doc-quote-left "\*[q]
2059 .  doc-enclose-open \$@
2063 .\" NS Qc user macro
2064 .\" NS   straight double quote close
2065 .\" NS
2066 .\" NS modifies:
2067 .\" NS   doc-macro-name, doc-quote-right
2068 .\" NS
2069 .\" NS width register `Qc' set in doc-common
2071 .de Qc
2072 .  if !\n[doc-arg-limit] \
2073 .    ds doc-macro-name Qc
2075 .  ds doc-quote-right "\*[q]
2077 .  doc-enclose-close \$@
2081 .\" NS So user macro
2082 .\" NS   single quote open
2083 .\" NS
2084 .\" NS modifies:
2085 .\" NS   doc-macro-name, doc-quote-left
2086 .\" NS
2087 .\" NS width register `So' set in doc-common
2089 .de So
2090 .  if !\n[doc-arg-limit] \
2091 .    ds doc-macro-name So
2093 .  ds doc-quote-left "\*[doc-left-singlequote]
2095 .  doc-enclose-open \$@
2099 .\" NS Sc user macro
2100 .\" NS   single quote close
2101 .\" NS
2102 .\" NS modifies:
2103 .\" NS   doc-macro-name, doc-quote-right
2104 .\" NS
2105 .\" NS width register `Sc' set in doc-common
2107 .de Sc
2108 .  if !\n[doc-arg-limit] \
2109 .    ds doc-macro-name Sc
2111 .  ds doc-quote-right "\*[doc-right-singlequote]
2113 .  doc-enclose-close \$@
2117 .\" NS Xo user macro
2118 .\" NS   extend open
2119 .\" NS
2120 .\" NS modifies:
2121 .\" NS   doc-macro-name, doc-quote-left
2122 .\" NS
2123 .\" NS width register `Xo' set in doc-common
2125 .de Xo
2126 .  if !\n[doc-arg-limit] \
2127 .    ds doc-macro-name Xo
2129 .  ds doc-quote-left
2131 .  doc-enclose-open \$@
2135 .\" NS Xc user macro
2136 .\" NS   extend close
2137 .\" NS
2138 .\" NS modifies:
2139 .\" NS   doc-macro-name, doc-quote-right
2140 .\" NS
2141 .\" NS width register `Xc' set in doc-common
2143 .de Xc
2144 .  if !\n[doc-arg-limit] \
2145 .    ds doc-macro-name Xc
2147 .  ds doc-quote-right
2149 .  doc-enclose-close \$@
2153 .\" NS doc-nesting-level global register
2154 .\" NS   used by `doc-enclose-open' and `doc-enclose-close', `.Fo', and `.Fc'
2156 .nr doc-nesting-level 0
2159 .\" NS doc-in-list global register (bool)
2160 .\" NS   whether we are in (logical) .It
2162 .nr doc-in-list 0
2165 .\" NS doc-enclose-open macro
2166 .\" NS   enclose string open
2167 .\" NS
2168 .\" NS modifies:
2169 .\" NS   doc-arg-ptr, doc-out-string, doc-nesting-level
2171 .de doc-enclose-open
2172 .  nr doc-nesting-level +1
2174 .  ie \n[doc-arg-limit] \
2175 .    as doc-out-string \&\*[doc-quote-left]
2176 .  el \{\
2177 .    ie \n[.$] \{\
2178 .      \" was the last request on the previous line an opening request?
2179 .      if \n[doc-is-opening] \
2180 .        nr doc-no-space 1
2181 .      doc-parse-args \$@
2182 .      as doc-out-string \&\*[doc-quote-left]
2183 .    \}
2184 .    el \{\
2185 .      as doc-out-string \&\*[doc-quote-left]
2186 .      nr doc-is-opening 1
2187 .  \}\}
2189 .  if \n[doc-arg-limit] \{\
2190 .    \" the following code makes things like
2191 .    \"
2192 .    \"   .Op Ar foo Ns Xo
2193 .    \"   .Op Ar bar Xc
2194 .    \"
2195 .    \" work as expected -- the .Op macro possibly appends an argument
2196 .    \" which we must ignore here
2197 .    if ((\n[doc-arg-limit] - \n[doc-have-append]) == \n[doc-arg-ptr]) \
2198 .      nr doc-is-opening 1
2200 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
2201 .      \" last argument
2202 .      doc-reset-args
2203 .    \}
2204 .    el \{\
2205 .      nr doc-arg-ptr +1
2206 .      ie (\n[doc-type\n[doc-arg-ptr]] == 1) \
2207 .        \*[doc-arg\n[doc-arg-ptr]]
2208 .      el \{\
2209 .        nr doc-arg-ptr -1
2210 .        No
2211 .  \}\}\}
2215 .\" NS doc-enclose-close macro
2216 .\" NS   enclose string close
2217 .\" NS
2218 .\" NS modifies:
2219 .\" NS   doc-out-string, doc-nesting-level
2220 .\" NS
2221 .\" NS local variables:
2222 .\" NS   doc-str-dec
2224 .de doc-enclose-close
2225 .  nr doc-nesting-level -1
2227 .  as doc-out-string \&\*[doc-quote-right]
2229 .  if !\n[doc-arg-limit] \{\
2230 .    ie \n[.$] \{\
2231 .      nr doc-no-space 1
2232 .      doc-parse-args \$@
2233 .    \}
2234 .    el \
2235 .      doc-print-out-string
2236 .  \}
2238 .  if \n[doc-arg-limit] \{\
2239 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
2240 .      \" last argument
2241 .      ie \n[doc-nesting-level] \
2242 .        doc-reset-args
2243 .      el \
2244 .        doc-print-and-reset
2245 .    \}
2246 .    el \{\
2247 .      nr doc-str-dec (\n[doc-arg-ptr] + 1)
2248 .      if (\n[doc-type\n[doc-str-dec]] == 2) \
2249 .        as doc-out-string "\*[doc-space\n[doc-arg-limit]]
2250 .      No
2251 .  \}\}
2253 .  \" shall we finish .It request?
2254 .  if !"\*[doc-macro-name]"It" \
2255 .    if \n[doc-in-list] \
2256 .      if !\n[doc-nesting-level] \
2257 .        doc-\*[doc-list-type-stack\n[doc-list-depth]]
2261 .\" NS Pf user macro
2262 .\" NS   prefix: `.Pf prefix arg ...'
2263 .\" NS
2264 .\" NS modifies:
2265 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-quote-left
2266 .\" NS
2267 .\" NS width register `Pf' set in doc-common
2269 .de Pf
2270 .  if !\n[doc-arg-limit] \
2271 .    ds doc-macro-name Pf
2273 .  ds doc-quote-left "\$1
2275 .  shift
2277 .  ie \n[doc-arg-limit] \{\
2278 .    ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
2279 .      nr doc-arg-ptr +1
2280 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2281 .    \}
2282 .    el \
2283 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
2284 .  \}
2285 .  el \{\
2286 .    as doc-out-string \&\*[doc-quote-left]
2287 .    ie (\n[.$] < 2) \{\
2288 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
2289 .      doc-print-out-string
2290 .    \}
2291 .    el \
2292 .      doc-parse-args \$@
2293 .  \}
2295 .  if \n[doc-arg-limit] \{\
2296 .    nr doc-arg-ptr +1
2297 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
2298 .      doc-print-and-reset
2299 .    el \
2300 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
2301 .  \}
2305 .\" NS Ns user macro
2306 .\" NS   remove space (space removal done by `doc-parse-args')
2307 .\" NS
2308 .\" NS modifies:
2309 .\" NS   doc-macro-name
2310 .\" NS
2311 .\" NS width register `Ns' set in doc-common
2313 .de Ns
2314 .  if !\n[doc-arg-limit] \{\
2315 .    ds doc-macro-name Ns
2316 .    ie \n[.$] \
2317 .      doc-parse-args \$@
2318 .    el \
2319 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2320 .  \}
2322 .  No
2326 .\" NS Ap user macro
2327 .\" NS   append an apostrophe
2328 .\" NS
2329 .\" NS modifies:
2330 .\" NS   doc-out-string
2331 .\" NS
2332 .\" NS width register `Ap' set in doc-common
2334 .de Ap
2335 .  if !\n[doc-arg-limit] \
2336 .    tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2338 .  as doc-out-string \&'
2339 .  No
2343 .\" NS doc-space global string
2344 .\" NS   current inter-argument space
2346 .ds doc-space "\*[doc-soft-space]
2349 .\" NS doc-soft-space constant string
2350 .\" NS   soft (stretchable) space (defined in doc-common)
2353 .\" NS doc-hard-space constant string
2354 .\" NS   hard (unpaddable) space (defined in doc-common)
2357 .\" NS doc-set-hard-space macro
2358 .\" NS   set current space string to hard (unpaddable) space.
2359 .\" NS
2360 .\" NS modifies:
2361 .\" NS   doc-space
2363 .de doc-set-hard-space
2364 .  ds doc-space "\*[doc-hard-space]
2368 .\" NS doc-set-soft-space macro
2369 .\" NS   set current space string to soft space (troff limitation)
2370 .\" NS
2371 .\" NS modifies:
2372 .\" NS   doc-space
2374 .de doc-set-soft-space
2375 .  ds doc-space "\*[doc-soft-space]
2379 .\" NS doc-space-mode global register (bool)
2380 .\" NS   default is one (space mode on)
2382 .nr doc-space-mode 1
2385 .\" NS Sm user macro
2386 .\" NS   space mode (`.Sm'/`.Sm on'/`.Sm off')
2387 .\" NS
2388 .\" NS   without argument, toggle space mode
2389 .\" NS
2390 .\" NS modifies:
2391 .\" NS   doc-macro-name, doc-arg-limit, doc-num-args, doc-arg-ptr,
2392 .\" NS   doc-argXXX, doc-spaceXXX, doc-curr-space, doc-space-mode,
2393 .\" NS   doc-space
2394 .\" NS
2395 .\" NS width register `Sm' set in doc-common
2396 .\" NS
2397 .\" NS local variables:
2398 .\" NS   doc-reg-Sm
2400 .de Sm
2401 .  if !\n[doc-arg-limit] \{\
2402 .    ie \n[.$] \{\
2403 .      ds doc-macro-name Sm
2404 .      doc-parse-args \$@
2405 .    \}
2406 .    el \{\
2407 .      ie \n[doc-space-mode] \
2408 .        nr doc-space-mode 0
2409 .      el \
2410 .        nr doc-space-mode 1
2411 .  \}\}
2413 .  if \n[doc-arg-limit] \{\
2414 .    nr doc-arg-ptr +1
2416 .    \" avoid a warning message in case `Sm' is the last parameter
2417 .    if !d doc-arg\n[doc-arg-ptr] \
2418 .      ds doc-arg\n[doc-arg-ptr]
2420 .    ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2421 .      ds doc-space "\*[doc-soft-space]
2422 .      nr doc-space-mode 1
2423 .    \}
2424 .    el \{\
2425 .      ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2426 .        ds doc-space
2427 .        ds doc-curr-space
2428 .        nr doc-space-mode 0
2429 .      \}
2430 .      el \{\
2431 .        \" no argument for Sm
2432 .        nr doc-arg-ptr -1
2433 .        ie \n[doc-space-mode] \
2434 .          nr doc-space-mode 0
2435 .        el \
2436 .          nr doc-space-mode 1
2437 .    \}\}
2439 .    ie \n[doc-space-mode] \{\
2440 .      \" recompute space vector for remaining arguments
2441 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2442 .      nr doc-arg-limit \n[doc-arg-ptr]
2443 .      if \n[doc-num-args] \
2444 .        doc-parse-space-vector
2445 .    \}\}
2446 .    el \{\
2447 .      \" reset remaining space vector elements
2448 .      nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2449 .      while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2450 .        ds doc-space\n[doc-reg-Sm]
2451 .        nr doc-reg-Sm +1
2452 .        \" the body of a `while' request must end with the fitting `\}'!
2453 .      \}
2454 .    \}
2456 .    \" do we have parameters to print?
2457 .    ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2458 .      \" ignore `.Sm on' and `.Sm off' without additional parameters
2459 .      ie (\n[doc-arg-ptr] > 1) \
2460 .        doc-print-and-reset
2461 .      el \
2462 .        doc-reset-args
2463 .    \}
2464 .    el \{\
2465 .      \" skip `Sm' argument
2466 .      nr doc-arg-ptr +1
2467 .      doc-print-recursive
2468 .  \}\}
2472 .\" NS doc-arg-type immediate register
2473 .\" NS   argument type (macro=1, string=2, punctuation suffix=3,
2474 .\" NS   punctuation prefix=4)
2476 .nr doc-arg-type 0
2479 .\" NS doc-get-arg-type macro
2480 .\" NS   get argument type
2481 .\" NS
2482 .\" NS   this macro expects the width of the argument in `doc-width'
2483 .\" NS
2484 .\" NS modifies:
2485 .\" NS   doc-arg-type
2487 .de doc-get-arg-type
2488 .  nr doc-arg-type 2
2490 .  if ((\n[doc-width] < 4) & \A\a\$1\a) \{\
2491 .    ie (\n[doc-width] == 1) \{\
2492 .      if r doc-punct\$1 \
2493 .        nr doc-arg-type \n[doc-punct\$1]
2494 .    \}
2495 .    el \
2496 .      if r \$1 \
2497 .        if d \$1 \
2498 .          nr doc-arg-type 1
2499 .  \}
2503 .\" NS doc-get-arg-type* macro
2504 .\" NS   similar to as `doc-get-arg-type' but uses doc-argXXX strings
2505 .\" NS
2506 .\" NS   this macro sets the `doc-width' register using the `length' request
2507 .\" NS   to get the number of characters in a string literally
2508 .\" NS
2509 .\" NS modifies:
2510 .\" NS   doc-arg-type, doc-width
2512 .de doc-get-arg-type*
2513 .  nr doc-arg-type 2
2514 .  length doc-width "\*[doc-arg\$1]
2516 .  if ((\n[doc-width] < 4) & \A\a\*[doc-arg\$1]\a) \{\
2517 .    ie (\n[doc-width] == 1) \{\
2518 .      if r doc-punct\*[doc-arg\$1] \
2519 .        nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
2520 .    \}
2521 .    el \
2522 .      if r \*[doc-arg\$1] \
2523 .        if d \*[doc-arg\$1] \
2524 .          nr doc-arg-type 1
2525 .  \}
2529 .\" NS doc-set-spacing-1 macro
2530 .\" NS   set spacing for macros
2531 .\" NS
2532 .\" NS modifies:
2533 .\" NS   doc-spaceXXX
2534 .\" NS
2535 .\" NS local variables:
2536 .\" NS   doc-reg-dssfm, doc-reg-dssfm1
2538 .de doc-set-spacing-1
2539 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2541 .  \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2542 .  \" argument)
2543 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2544 .    nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2545 .    ds doc-space\n[doc-reg-dssfm]
2546 .    ds doc-space\n[doc-arg-limit] "\*[doc-space]
2547 .  \}
2548 .  el \{\
2549 .    \" macros like .Ap and .Ns have value 2 (remove space before and after
2550 .    \" argument)
2551 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2552 .      nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2553 .      ds doc-space\n[doc-reg-dssfm]
2554 .      ds doc-space\n[doc-arg-limit]
2555 .    \}
2556 .    el \
2557 .      ds doc-space\n[doc-arg-limit]
2558 .  \}
2562 .\" NS doc-set-spacing-2 macro
2563 .\" NS   set spacing for strings
2564 .\" NS
2565 .\" NS modifies:
2566 .\" NS   doc-spaceXXX
2568 .de doc-set-spacing-2
2569 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2573 .\" NS doc-set-spacing-3 macro
2574 .\" NS   set spacing for punctuation suffixes
2575 .\" NS
2576 .\" NS modifies:
2577 .\" NS   doc-spaceXXX
2578 .\" NS
2579 .\" NS local variables:
2580 .\" NS   doc-reg-dssfps
2582 .de doc-set-spacing-3
2583 .  if \n[doc-arg-limit] \{\
2584 .    nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2585 .    ds doc-space\n[doc-reg-dssfps]
2586 .  \}
2588 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2592 .\" NS doc-set-spacing-4 macro
2593 .\" NS   set spacing for punctuation prefixes
2594 .\" NS
2595 .\" NS modifies:
2596 .\" NS   doc-spaceXXX
2598 .de doc-set-spacing-4
2599 .  ds doc-space\n[doc-arg-limit]
2603 .\" type switches (on current argument doc-arg-ptr)
2606 .\" NS doc-do-1 macro
2607 .\" NS   call request if macro
2609 .de doc-do-1
2610 .  \*[doc-arg\n[doc-arg-ptr]]
2614 .\" NS doc-do-2 macro
2615 .\" NS   call .No if string
2616 .\" NS
2617 .\" NS modifies:
2618 .\" NS   doc-arg-ptr
2620 .de doc-do-2
2621 .  nr doc-arg-ptr -1
2622 .  No
2626 .\" NS doc-do-3 macro
2627 .\" NS   call .No if punctuation suffix
2628 .\" NS
2629 .\" NS modifies:
2630 .\" NS   doc-arg-ptr
2632 .de doc-do-3
2633 .  nr doc-arg-ptr -1
2634 .  No
2638 .\" NS doc-do-4 macro
2639 .\" NS   call .No if punctuation prefix
2640 .\" NS
2641 .\" NS modifies:
2642 .\" NS   doc-arg-ptr
2644 .de doc-do-4
2645 .  nr doc-arg-ptr -1
2646 .  No
2650 .\" NS doc-do-xref-1 macro
2651 .\" NS   ignore if macro
2653 .de doc-do-xref-1
2657 .\" NS doc-do-xref-2 macro
2658 .\" NS   ignore if string
2660 .de doc-do-xref-2
2664 .\" NS doc-do-xref-3 macro
2665 .\" NS   append if punctuation suffix
2666 .\" NS
2667 .\" NS modifies:
2668 .\" NS   doc-arg-ptr, doc-out-string
2670 .de doc-do-xref-3
2671 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2672 .  nr doc-arg-ptr +1
2673 .  \" XXX: ?
2674 .  n\\C\\n(aP
2678 .\" NS doc-do-xref-4 macro
2679 .\" NS   append if punctuation prefix
2680 .\" NS
2681 .\" NS modifies:
2682 .\" NS   doc-arg-ptr, doc-out-string
2684 .de doc-do-xref-4
2685 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2686 .  nr doc-arg-ptr +1
2687 .  \" XXX: ?
2688 .  n\\C\\n(aP
2692 .\" NS doc-curr-font-for-Ef global register
2693 .\" NS   saved current font from `Bf' request
2695 .nr doc-curr-font-for-Ef 0
2698 .\" NS doc-curr-size-for-Ef global register
2699 .\" NS   saved current size from `Bf' request
2701 .nr doc-curr-size-for-Ef 0
2704 .\" NS Bf user macro
2705 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2706 .\" NS
2707 .\" NS modifies:
2708 .\" NS   doc-macro-name, doc-curr-font-for-Ef, doc-curr-size-for-Ef
2709 .\" NS
2710 .\" NS width register `Bf' set in doc-common
2712 .de Bf
2713 .  ds doc-macro-name Bf
2715 .  ie \n[.$] \{\
2716 .    nr doc-curr-font-for-Ef \n[.f]
2717 .    nr doc-curr-size-for-Ef \n[.s]
2719 .    ie        "\$1"Em" \
2720 .      nop \*[doc-Em-font]\c
2721 .    el \{ .ie "\$1"Li" \
2722 .      nop \*[doc-Li-font]\c
2723 .    el \{ .ie "\$1"Sy" \
2724 .      nop \*[doc-Sy-font]\c
2725 .    el \{ .ie "\$1"-emphasis" \
2726 .      nop \*[doc-Em-font]\c
2727 .    el \{ .ie "\$1"-literal" \
2728 .      nop \*[doc-Li-font]\c
2729 .    el \{ .ie "\$1"-symbolic" \
2730 .      nop \*[doc-Sy-font]\c
2731 .    el \{\
2732 .      tmc mdoc warning: Unknown keyword `\$1' in .Bf request
2733 .      tm1 " (#\n[.c])
2734 .  \}\}\}\}\}\}\}
2735 .  el \
2736 .    tm Usage .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2740 .\" NS Ef user macro
2741 .\" NS   end font mode
2742 .\" NS
2743 .\" NS modifies:
2744 .\" NS   doc-macro-name
2745 .\" NS
2746 .\" NS width register `Ef' set in doc-common
2748 .de Ef
2749 .  ds doc-macro-name Ef
2751 .  ie \n[.$] \
2752 .    tm Usage .Ef (does not take arguments) (#\n[.c])
2753 .  el \
2754 .    nop \&\f[\n[doc-curr-font-for-Ef]]\s[\n[doc-curr-size-for-Ef]]
2758 .\" NS doc-keep-type global string
2759 .\" NS   current keep type
2761 .ds doc-keep-type
2764 .\" NS Bk user macro
2765 .\" NS   begin keep
2766 .\" NS
2767 .\" NS modifies:
2768 .\" NS   doc-macro-name, doc-keep-type
2769 .\" NS
2770 .\" NS width register `Bk' set in doc-common
2772 .de Bk
2773 .  ds doc-keep-type
2775 .  ds doc-macro-name Bk
2777 .  ie \n[.$] \{\
2778 .    if !"\*[doc-keep-type]"" \
2779 .      tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2780 .    ie "\$1"-lines" \
2781 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2782 .    el \{\
2783 .      ie "\$1"-words" \
2784 .        doc-set-hard-space
2785 .      el \
2786 .        tm mdoc warning: Unknown keyword `\$1' in .Bk request (#\n[.c])
2787 .    \}
2789 .    ds doc-keep-type \$1
2790 .  \}
2791 .  el \
2792 .    tm Usage: .Bk [-lines | -words] (#\n[.c])
2796 .\" NS Ek user macro
2797 .\" NS   end keep
2798 .\" NS
2799 .\" NS modifies:
2800 .\" NS   doc-macro-name
2801 .\" NS
2802 .\" NS width register `Ek' set in doc-common
2804 .de Ek
2805 .  ds doc-macro-name Ek
2807 .  ie \n[.$] \
2808 .    tm Usage .Ek (does not take arguments) (#\n[.c])
2809 .  el \{\
2810 .    ie "\*[doc-keep-type]"-words" \
2811 .      doc-set-soft-space
2812 .    el \
2813 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2814 .  \}
2818 .\" NS doc-display-depth global register
2819 .\" NS   display level
2821 .nr doc-display-depth 0
2824 .\" NS doc-is-compact global register (bool)
2825 .\" NS   set if the `compact' keyword is given
2827 .nr doc-is-compact 0
2830 .\" NS doc-display-type-stackXXX global string
2831 .\" NS   the display type stack
2832 .\" NS
2833 .\" NS   limit: doc-display-depth
2835 .ds doc-display-type-stack0
2838 .\" NS doc-display-indent-stackXXX global register
2839 .\" NS   stack of display indentation values
2840 .\" NS
2841 .\" NS   limit: doc-display-depth
2843 .nr doc-display-indent-stack0 0
2846 .\" NS Bd user macro
2847 .\" NS   begin display
2848 .\" NS
2849 .\" NS width register `Bd' set in doc-common
2850 .\" NS
2851 .\" NS modifies:
2852 .\" NS   doc-macro-name, doc-curr-font, doc-curr-size, doc-display-depth,
2853 .\" NS   doc-is-compact, doc-display-type-stackXXX,
2854 .\" NS   doc-display-indent-stackXXX
2855 .\" NS
2856 .\" NS local variables:
2857 .\" NS   doc-reg-Bd
2859 .de Bd
2860 .  ds doc-macro-name Bd
2862 .  ie \n[.$] \{\
2863 .    nr doc-is-compact 0
2864 .    nr doc-reg-Bd 1
2865 .    nr doc-display-depth +1
2867 .    ie        "\$1"-literal" \{\
2868 .      ds doc-display-type-stack\n[doc-display-depth] literal
2869 .      nr doc-curr-font \n[.f]
2870 .      nr doc-curr-size \n[.s]
2872 .      ie t \{\
2873 .        nop \*[doc-Li-font]\c
2874 '        ta T 9n
2875 .      \}
2876 .      el \
2877 '        ta T 8n
2878 .      nf
2879 .    \}
2880 .    el \{ .ie "\$1"-filled" \{\
2881 .      ds doc-display-type-stack\n[doc-display-depth] filled
2882 .      br
2883 .    \}
2884 .    el \{ .ie "\$1"-ragged" \{\
2885 .      ds doc-display-type-stack\n[doc-display-depth] ragged
2886 .      na
2887 .    \}
2888 .    el \{ .ie "\$1"-unfilled" \{\
2889 .      ds doc-display-type-stack\n[doc-display-depth] unfilled
2890 .      nf
2891 .    \}
2892 .    el \{\
2893 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2894 .      nr doc-reg-Bd 0
2895 .    \}\}\}\}
2897 .    \" have we seen an argument?
2898 .    if \n[doc-reg-Bd] \{\
2899 .      shift
2900 .      \" check other arguments
2901 .      if \n[.$] \
2902 .        doc-do-Bd-args \$@
2903 .    \}
2905 .    \" avoid warning about non-existent register
2906 .    if !r doc-display-indent-stack\n[doc-display-depth] \
2907 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2909 .    if \n[doc-display-indent-stack\n[doc-display-depth]] \
2910 '      in +\n[doc-display-indent-stack\n[doc-display-depth]]u
2912 .    if !\n[doc-is-compact] \{\
2913 .      if !\n[doc-in-synopsis-count] \{\
2914 .        ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2915 .          sp \n[doc-display-vertical]u
2916 .        el \
2917 '          sp \n[doc-display-vertical]u
2918 .    \}\}
2920 .    if !\n[cR] \
2921 .      ne 2v
2923 .    nr doc-is-compact 0
2924 .  \}
2925 .  el \{\
2926 .    tm1 "Usage: .Bd [-literal | -filled | -ragged | -unfilled]
2927 .    tm1 "           [-offset [string]] [-compact] (#\n[.c])
2928 .  \}
2932 .\" NS doc-do-Bd-args macro
2933 .\" NS   resolve remaining .Bd arguments
2934 .\" NS
2935 .\" NS modifies:
2936 .\" NS   doc-is-compact, doc-display-indent-stackXXX
2937 .\" NS
2938 .\" NS local variables:
2939 .\" NS   doc-str-ddBa, doc-reg-ddBa
2941 .de doc-do-Bd-args
2942 .  nr doc-reg-ddBa 1
2943 .  ds doc-str-ddBa
2945 .  ie        "\$1"-offset" \{\
2946 .    ds doc-str-ddBa "\$2
2947 .    nr doc-reg-ddBa 2
2949 .    ie        "\$2"left" \
2950 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2951 .    el \{ .ie "\$2"right" \
2952 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2953 .    el \{ .ie "\$2"center" \
2954 .      nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2955 .    el \{ .ie "\$2"indent" \
2956 .      nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2957 .    el \{ .ie "\$2"indent-two" \
2958 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2959 .    el \
2960 .      nr doc-reg-ddBa 1
2961 .    \}\}\}\}
2963 .    \" not a known keyword
2964 .    if (\n[doc-reg-ddBa] == 1) \{\
2965 .      nr doc-reg-ddBa 2
2966 .      \" test whether argument is a valid numeric expression
2967 .      ie \B\a\$2\a \
2968 .        nr doc-display-indent-stack\n[doc-display-depth] \$2
2969 .      el \{\
2970 .        doc-get-width "\$2"
2971 .        ie (\n[doc-width] == 2) \{\
2972 .          \" if the offset parameter is a macro, use the macro's
2973 .          \" width as specified in doc-common
2974 .          doc-get-arg-type "\$2"
2975 .          ie (\n[doc-arg-type] == 1) \
2976 .            nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
2977 .          el \
2978 .            nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2979 .        \}
2980 .        el \
2981 .          nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2982 .    \}\}
2983 .  \}
2984 .  el \{ .ie "\$1"-compact" \
2985 .    nr doc-is-compact 1
2986 .  el \
2987 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2988 .  \}
2990 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
2991 .    \" have we seen `-offset' or `-compact'?
2992 .    ie "\*[doc-str-ddBa]"" \{\
2993 .      shift
2994 .      doc-do-Bd-args \$@
2995 .    \}
2996 .    el \{\
2997 .      shift 2
2998 .      doc-do-Bd-args \$@
2999 .  \}\}
3003 .\" NS Ed user macro
3004 .\" NS   end display
3005 .\" NS
3006 .\" NS modifies:
3007 .\" NS   doc-macro-name, doc-display-depth, doc-display-type-stackXXX,
3008 .\" NS   doc-display-indent-stackXXX
3009 .\" NS
3010 .\" NS width register `Ed' set in doc-common
3012 .de Ed
3013 .  ds doc-macro-name Ed
3015 .  br
3017 .  if !\n[doc-display-depth] \
3018 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
3020 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
3021 .    ft \n[doc-curr-font]
3022 .    ps \n[doc-curr-size]
3023 .  \}
3025 .  in -\n[doc-display-indent-stack\n[doc-display-depth]]u
3027 .  nr doc-display-indent-stack\n[doc-display-depth] 0
3028 .  ds doc-display-type-stack\n[doc-display-depth]
3029 .  nr doc-display-depth -1
3031 .  fi
3032 .  if t \
3033 .    ad
3037 .\" NS doc-list-type-stackXXX global string
3038 .\" NS   stack of list types
3039 .\" NS
3040 .\" NS   limit: doc-list-depth
3042 .ds doc-list-type-stack1
3045 .\" NS doc-list-indent-stackXXX global register
3046 .\" NS   stack of list indentation values
3047 .\" NS
3048 .\" NS   limit: doc-list-depth
3050 .nr doc-list-indent-stack1 0
3053 .\" NS doc-have-indent global register (bool)
3054 .\" NS   an indentation value is active
3056 .nr doc-have-indent 0
3059 .\" NS Bl user macro
3060 .\" NS   begin list
3061 .\" NS
3062 .\" NS width register `Bl' set in doc-common
3063 .\" NS
3064 .\" NS modifies:
3065 .\" NS   doc-macro-name, doc-num-args, doc-arg-ptr, doc-argXXX,
3066 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX, doc-have-indent,
3067 .\" NS   doc-have-diag-list, doc-num-columns, doc-list-depth
3068 .\" NS
3069 .\" NS local variables:
3070 .\" NS   doc-reg-Bl
3072 .de Bl
3073 .  ie \n[.$] \{\
3074 .    ds doc-macro-name Bl
3075 .    nr doc-list-depth +1
3076 .    nr doc-arg-ptr 1
3078 .    ie        "\$1"-hang" \{\
3079 .      ds doc-list-type-stack\n[doc-list-depth] hang-list
3080 .      nr doc-list-indent-stack\n[doc-list-depth] 6n
3081 .      nr doc-have-indent 1
3082 .    \}
3083 .    el \{ .ie "\$1"-tag" \{\
3084 .      ds doc-list-type-stack\n[doc-list-depth] tag-list
3085 .      nr doc-have-indent 1
3086 .    \}
3087 .    el \{ .ie "\$1"-item" \{\
3088 .      ds doc-list-type-stack\n[doc-list-depth] item-list
3089 .      nr doc-have-indent 1
3090 .    \}
3091 .    el \{ .ie "\$1"-enum" \{\
3092 .      ds doc-list-type-stack\n[doc-list-depth] enum-list
3093 .      nr doc-list-indent-stack\n[doc-list-depth] 3n
3094 .      nr doc-have-indent 1
3095 .    \}
3096 .    el \{ .ie "\$1"-bullet" \{\
3097 .      ds doc-list-type-stack\n[doc-list-depth] bullet-list
3098 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3099 .      nr doc-have-indent 1
3100 .    \}
3101 .    el \{ .ie "\$1"-dash" \{\
3102 .      ds doc-list-type-stack\n[doc-list-depth] dash-list
3103 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3104 .      nr doc-have-indent 1
3105 .    \}
3106 .    el \{ .ie "\$1"-hyphen" \{\
3107 .      ds doc-list-type-stack\n[doc-list-depth] dash-list
3108 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3109 .      nr doc-have-indent 1
3110 .    \}
3111 .    el \{ .ie "\$1"-inset" \{\
3112 .      ds doc-list-type-stack\n[doc-list-depth] inset-list
3113 .      nr doc-have-indent 1
3114 .    \}
3115 .    el \{ .ie "\$1"-diag" \{\
3116 .      ds doc-list-type-stack\n[doc-list-depth] diag-list
3117 .      nr doc-have-diag-list 1
3118 .    \}
3119 .    el \{ .ie "\$1"-ohang" \{\
3120 .      ds doc-list-type-stack\n[doc-list-depth] ohang-list
3121 .      nr doc-have-indent 1
3122 .    \}
3123 .    el \{ .ie "\$1"-column" \
3124 .      ds doc-list-type-stack\n[doc-list-depth] column-list
3125 .    el \{\
3126 .      tm mdoc warning: Unknown list type `\$1' in .Bl request
3127 .      tm
3128 .      nr doc-arg-ptr 0
3129 .    \}\}\}\}\}\}\}\}\}\}\}
3131 .    \" we have seen a list type
3132 .    ie \n[doc-arg-ptr] \{\
3133 .      shift
3135 .      \" fill argument vector
3136 .      nr doc-reg-Bl 1
3137 .      while (\n[doc-reg-Bl] <= \n[.$]) \{\
3138 .        ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
3139 .        nr doc-reg-Bl +1
3140 .      \}
3142 .      doc-increment-list-stack
3144 .      if \n[.$] \{\
3145 .        nr doc-arg-limit \n[.$]
3146 .        nr doc-arg-ptr 0
3147 .        doc-do-Bl-args
3149 .        \" initialize column list
3150 .        if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3151 .          doc-set-column-tab \n[doc-num-columns]
3152 .          nr doc-list-indent-stack\n[doc-list-depth] 0
3153 '          in -\n[doc-column-indent-width]u
3154 .          if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3155 .            sp \n[doc-display-vertical]u
3157 .          nf
3158 .          nr doc-num-columns 0
3159 .    \}\}\}
3160 .    el \
3161 .      doc-Bl-usage
3163 .    doc-reset-args
3164 .  \}
3165 .  el \
3166 .    doc-Bl-usage
3170 .\" NS doc-Bl-usage macro
3172 .de doc-Bl-usage
3173 .  tm1 "Usage: .Bl [-hang | -ohang | -tag | -diag | -inset]
3174 .  tm1 "             [-width [string]] [-offset [string]] [-compact]
3175 .  tm1 "       .Bl [-column] [-offset [string]] [string1] [string2] ...
3176 .  tm1 "       .Bl [-item | -enum | -bullet | -hyphen | -dash]
3177 .  tm1 "             [-offset [string]] [-compact] (#\n[.c])
3181 .\" NS doc-have-tag-width global macro
3182 .\" NS   set if a tag width has been explicitly given
3184 .nr doc-have-tag-width 0
3187 .\" NS doc-do-Bl-args macro
3188 .\" NS   resolve remaining .Bl arguments
3189 .\" NS
3190 .\" NS modifies:
3191 .\" NS   doc-arg-ptr, doc-argXXX, doc-list-indent-stackXXX, doc-num-columns,
3192 .\" NS   doc-compact-list-stackXXX, doc-have-tag-width,
3193 .\" NS   doc-tag-width-stackXXX, doc-list-offset-stackXXX
3194 .\" NS
3195 .\" NS local variables:
3196 .\" NS   doc-str-dBla, doc-reg-dBla
3198 .de doc-do-Bl-args
3199 .  nr doc-arg-ptr +1
3200 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
3201 .    nr doc-reg-dBla 1
3203 .    ie        "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3204 .      nr doc-compact-list-stack\n[doc-list-depth] 1
3205 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3206 .      nr doc-arg-ptr +1
3207 .      \" XXX: this code should be modified to handle nested lists
3208 .      \"      of any type
3209 .      nr doc-have-tag-width 1
3210 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3211 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3213 .      \" test whether argument is a valid numeric expression
3214 .      ie \B\a\*[doc-str-dBla]\a \
3215 .        nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]
3216 .      el \{\
3217 .        doc-get-arg-width \n[doc-arg-ptr]
3218 .        ie (\n[doc-width] == 2) \{\
3219 .          \" if the width parameter is a macro, use the macro's
3220 .          \" width as specified in doc-common
3221 .          doc-get-arg-type \*[doc-str-dBla]
3222 .          ie (\n[doc-arg-type] == 1) \
3223 .            nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3224 .          el \
3225 .            nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3226 .        \}
3227 .        el \
3228 .          nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3229 .    \}\}
3230 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
3231 .      nr doc-arg-ptr +1
3232 .      \" XXX: this code should be modified to handle nested lists
3233 .      \"      of any type
3234 .      nr doc-have-tag-width 1
3235 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3237 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3238 .      substring doc-str-dBla 1 2
3239 .      if \a.\a\*[doc-str-dBla]\a \{\
3240 .        doc-save-global-vars
3241 .        ds doc-out-string
3242 .        doc-dry-execute "\*[doc-arg\n[doc-arg-ptr]]"
3243 .        \" save doc-out-string
3244 .        ds doc-str-dBla "\*[doc-out-string]
3245 .        doc-restore-global-vars
3246 .        doc-get-width "\*[doc-str-dBla]"
3247 .      \}
3248 .      nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3249 .    \}
3250 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3251 .      nr doc-arg-ptr +1
3253 .      ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3254 .        nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3255 .      el \{\
3256 .        ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3258 .        ie \B\a\*[doc-str-dBla]\a \
3259 .          nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3260 .        el \{\
3261 .          doc-get-arg-width \n[doc-arg-ptr]
3262 .          ie (\n[doc-width] == 2) \{\
3263 .            doc-get-arg-type \*[doc-str-dBla]
3264 .            ie (\n[doc-arg-type] == 1) \
3265 .              nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3266 .            el \
3267 .              nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3268 .          \}
3269 .          el \
3270 .            nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3271 .    \}\}\}
3272 .    el \
3273 .      nr doc-reg-dBla 0
3274 .    \}\}\}
3276 .    \" not a known keyword, so it specifies the width of the next column
3277 .    \" (if it is a column list)
3278 .    if !\n[doc-reg-dBla] \{\
3279 .      ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3280 .        nr doc-num-columns +1
3281 .        ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3282 .      \}
3283 .      el \{\
3284 .        tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3285 .        tm1 " in .Bl request (#\n[.c])
3286 .    \}\}
3288 .    if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3289 .      doc-do-Bl-args
3290 .  \}
3294 .\" NS doc-save-global-vars macro
3295 .\" NS   save all global variables
3296 .\" NS
3297 .\" NS local variables:
3298 .\" NS   doc-reg-dsgv
3300 .de doc-save-global-vars
3301 .  nr doc-debug-saved \n[doc-debug]
3302 .  ds doc-macro-name-saved "\*[doc-macro-name]
3303 .  nr doc-arg-limit-saved \n[doc-arg-limit]
3304 .  nr doc-num-args-saved \n[doc-num-args]
3305 .  nr doc-arg-ptr-saved \n[doc-arg-ptr]
3307 .  nr doc-reg-dsgv 1
3308 .  while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3309 .    ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3310 .    nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
3311 .    ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3312 .    nr doc-reg-dsgv +1
3313 .  \}
3315 .  ds doc-out-string-saved "\*[doc-out-string]
3316 .  ds doc-curr-space-saved "\*[doc-curr-space]
3317 .  nr doc-curr-font-saved \n[doc-curr-font]
3318 .  nr doc-curr-size-saved \n[doc-curr-size]
3319 .  nr doc-in-synopsis-count-saved \n[doc-in-synopsis-count]
3320 .  nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3321 .  nr doc-have-decl-saved \n[doc-have-decl]
3322 .  nr doc-have-var-saved \n[doc-have-var]
3323 .  ds doc-command-name-saved "\*[doc-command-name]
3324 .  ds doc-quote-left-saved "\*[doc-quote-left]
3325 .  ds doc-quote-right-saved "\*[doc-quote-right]
3326 .  nr doc-nesting-level-saved \n[doc-nesting-level]
3327 .  nr doc-no-space-saved \n[doc-no-space]
3328 .  nr doc-is-opening-saved \n[doc-is-opening]
3329 .  nr doc-have-append-saved \n[doc-have-append]
3330 .  nr doc-in-list-saved \n[doc-in-list]
3331 .  ds doc-space-saved "\*[doc-space]
3332 .  nr doc-space-mode-saved \n[doc-space-mode]
3333 .  nr doc-curr-font-for-Ef-saved \n[doc-curr-font-for-Ef]
3334 .  nr doc-curr-size-for-Ef-saved \n[doc-curr-size-for-Ef]
3335 .  ds doc-keep-type-saved "\*[doc-keep-type]
3336 .  nr doc-display-depth-saved \n[doc-display-depth]
3337 .  nr doc-is-compact-saved \n[doc-is-compact]
3339 .  nr doc-reg-dsgv 0
3340 .  while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3341 .    ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3342 .    nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3343 .    nr doc-reg-dsgv +1
3344 .  \}
3346 .  nr doc-list-depth-saved \n[doc-list-depth]
3348 .  nr doc-reg-dsgv 1
3349 .  while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3350 .    ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3351 .    nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3352 .    nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3353 .    ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3354 .    nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3355 .    nr doc-reg-dsgv +1
3356 .  \}
3358 .  nr doc-have-indent-saved \n[doc-have-indent]
3359 .  nr doc-have-tag-width-saved \n[doc-have-tag-width]
3360 .  nr doc-no-printing-saved \n[doc-no-printing]
3361 .  ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3362 .  nr doc-curr-type-saved \n[doc-curr-type]
3363 .  ds doc-curr-arg-saved "\*[doc-curr-arg]
3364 .  nr doc-enum-list-count-saved \n[doc-enum-list-count]
3365 .  nr doc-have-diag-list-saved \n[doc-have-diag-list]
3366 .  nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3367 .  nr doc-num-columns-saved \n[doc-num-columns]
3368 .  nr doc-next-list-depth-saved \n[doc-next-list-depth]
3369 .  nr doc-column-indent-width-saved \n[doc-column-indent-width]
3370 .  nr doc-is-func-saved \n[doc-is-func]
3371 .  nr doc-have-old-func-saved \n[doc-have-old-func]
3372 .  nr doc-func-arg-count-saved \n[doc-func-arg-count]
3373 .  ds doc-func-arg-saved "\*[doc-func-arg]
3374 .  nr doc-num-func-args-saved \n[doc-num-func-args]
3375 .  nr doc-func-args-processed-saved \n[doc-func-args-processed]
3376 .  nr doc-have-func-saved \n[doc-have-func]
3377 .  nr doc-is-reference-saved \n[doc-is-reference]
3378 .  nr doc-reference-count-saved \n[doc-reference-count]
3379 .  ds doc-reference-string-name-saved "\*[doc-reference-string-name]
3380 .  nr doc-authors-processed-saved \n[doc-authors-processed]
3381 .  nr doc-author-count-saved \n[doc-author-count]
3383 .  nr doc-reg-dsgv 0
3384 .  while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3385 .    ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3386 .    nr doc-reg-dsgv +1
3387 .  \}
3389 .  nr doc-book-count-saved \n[doc-book-count]
3390 .  ds doc-book-name-saved "\*[doc-book-name]
3391 .  nr doc-date-count-saved \n[doc-date-count]
3392 .  ds doc-date-saved "\*[doc-date]
3393 .  nr doc-publisher-count-saved \n[doc-publisher-count]
3394 .  ds doc-publisher-name-saved "\*[doc-publisher-name]
3395 .  nr doc-journal-count-saved \n[doc-journal-count]
3396 .  ds doc-journal-name-saved "\*[doc-journal-name]
3397 .  nr doc-issue-count-saved \n[doc-issue-count]
3398 .  ds doc-issue-name-saved "\*[doc-issue-name]
3399 .  nr doc-optional-count-saved \n[doc-optional-count]
3400 .  ds doc-optional-string-saved "\*[doc-optional-string]
3401 .  nr doc-page-number-count-saved \n[doc-page-number-count]
3402 .  ds doc-page-number-string-saved "\*[doc-page-number-string]
3403 .  nr doc-corporate-count-saved \n[doc-corporate-count]
3404 .  ds doc-corporate-name-saved "\*[doc-corporate-name]
3405 .  nr doc-report-count-saved \n[doc-report-count]
3406 .  ds doc-report-name-saved "\*[doc-report-name]
3407 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
3408 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3409 .  nr doc-volume-count-saved \n[doc-volume-count]
3410 .  ds doc-volume-name-saved "\*[doc-volume-name]
3411 .  nr doc-have-author-saved \n[doc-have-author]
3413 .  ds doc-document-title-saved "\*[doc-document-title]
3414 .  ds doc-volume-saved "\*[doc-volume]
3415 .  ds doc-section-saved "\*[doc-section]
3416 .  ds doc-operating-system-saved "\*[doc-operating-system]
3417 .  ds doc-date-string-saved "\*[doc-date-string]
3418 .  nr doc-header-space-saved \n[doc-header-space]
3419 .  nr doc-footer-space-saved \n[doc-footer-space]
3420 .  nr doc-display-vertical-saved \n[doc-display-vertical]
3421 .  ds doc-header-string-saved "\*[doc-header-string]
3422 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3423 .  nr doc-in-files-section-saved \n[doc-in-files-section]
3424 .  nr doc-in-authors-section-saved \n[doc-in-authors-section]
3428 .\" NS doc-restore-global-vars macro
3429 .\" NS   restore all global variables
3430 .\" NS
3431 .\" NS local variables:
3432 .\" NS   doc-reg-drgv
3434 .de doc-restore-global-vars
3435 .  nr doc-debug \n[doc-debug-saved]
3436 .  ds doc-macro-name "\*[doc-macro-name-saved]
3437 .  nr doc-arg-limit \n[doc-arg-limit-saved]
3438 .  nr doc-num-args \n[doc-num-args-saved]
3439 .  nr doc-arg-ptr \n[doc-arg-ptr-saved]
3441 .  nr doc-reg-drgv 1
3442 .  while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3443 .    ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3444 .    nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
3445 .    ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3446 .    nr doc-reg-drgv +1
3447 .  \}
3449 .  ds doc-out-string "\*[doc-out-string-saved]
3450 .  ds doc-curr-space "\*[doc-curr-space-saved]
3451 .  nr doc-curr-font \n[doc-curr-font-saved]
3452 .  nr doc-curr-size \n[doc-curr-size-saved]
3453 .  nr doc-in-synopsis-count \n[doc-in-synopsis-count-saved]
3454 .  nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3455 .  nr doc-have-decl \n[doc-have-decl-saved]
3456 .  nr doc-have-var \n[doc-have-var-saved]
3457 .  ds doc-command-name "\*[doc-command-name-saved]
3458 .  ds doc-quote-left "\*[doc-quote-left-saved]
3459 .  ds doc-quote-right "\*[doc-quote-right-saved]
3460 .  nr doc-nesting-level \n[doc-nesting-level-saved]
3461 .  nr doc-no-space \n[doc-no-space-saved]
3462 .  nr doc-is-opening \n[doc-is-opening-saved]
3463 .  nr doc-have-append \n[doc-have-append-saved]
3464 .  nr doc-in-list \n[doc-in-list-saved]
3465 .  ds doc-space "\*[doc-space-saved]
3466 .  nr doc-space-mode \n[doc-space-mode-saved]
3467 .  nr doc-curr-font-for-Ef \n[doc-curr-font-for-Ef-saved]
3468 .  nr doc-curr-size-for-Ef \n[doc-curr-size-for-Ef-saved]
3469 .  ds doc-keep-type "\*[doc-keep-type-saved]
3470 .  nr doc-display-depth \n[doc-display-depth-saved]
3471 .  nr doc-is-compact \n[doc-is-compact-saved]
3473 .  nr doc-reg-drgv 0
3474 .  while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3475 .    ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3476 .    nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3477 .    nr doc-reg-drgv +1
3478 .  \}
3480 .  nr doc-list-depth \n[doc-list-depth-saved]
3482 .  nr doc-reg-drgv 1
3483 .  while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3484 .    ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3485 .    nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3486 .    nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3487 .    ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3488 .    nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3489 .    nr doc-reg-drgv +1
3490 .  \}
3492 .  nr doc-have-indent \n[doc-have-indent-saved]
3493 .  nr doc-have-tag-width \n[doc-have-tag-width-saved]
3494 .  nr doc-no-printing \n[doc-no-printing-saved]
3495 .  ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3496 .  nr doc-curr-type \n[doc-curr-type-saved]
3497 .  ds doc-curr-arg "\*[doc-curr-arg-saved]
3498 .  nr doc-enum-list-count \n[doc-enum-list-count-saved]
3499 .  nr doc-have-diag-list \n[doc-have-diag-list-saved]
3500 .  nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3501 .  nr doc-num-columns \n[doc-num-columns-saved]
3502 .  nr doc-next-list-depth \n[doc-next-list-depth-saved]
3503 .  nr doc-column-indent-width \n[doc-column-indent-width-saved]
3504 .  nr doc-is-func \n[doc-is-func-saved]
3505 .  nr doc-have-old-func \n[doc-have-old-func-saved]
3506 .  nr doc-func-arg-count \n[doc-func-arg-count-saved]
3507 .  ds doc-func-arg "\*[doc-func-arg-saved]
3508 .  nr doc-num-func-args \n[doc-num-func-args-saved]
3509 .  nr doc-func-args-processed \n[doc-func-args-processed-saved]
3510 .  nr doc-have-func \n[doc-have-func-saved]
3511 .  nr doc-is-reference \n[doc-is-reference-saved]
3512 .  nr doc-reference-count \n[doc-reference-count-saved]
3513 .  ds doc-reference-string-name "\*[doc-reference-string-name-saved]
3514 .  nr doc-authors-processed \n[doc-authors-processed-saved]
3515 .  nr doc-author-count \n[doc-author-count-saved]
3517 .  nr doc-reg-drgv 0
3518 .  while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3519 .    ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3520 .    nr doc-reg-drgv +1
3521 .  \}
3523 .  nr doc-book-count \n[doc-book-count-saved]
3524 .  ds doc-book-name "\*[doc-book-name-saved]
3525 .  nr doc-date-count \n[doc-date-count-saved]
3526 .  ds doc-date "\*[doc-date-saved]
3527 .  nr doc-publisher-count \n[doc-publisher-count-saved]
3528 .  ds doc-publisher-name "\*[doc-publisher-name-saved]
3529 .  nr doc-journal-count \n[doc-journal-count-saved]
3530 .  ds doc-journal-name "\*[doc-journal-name-saved]
3531 .  nr doc-issue-count \n[doc-issue-count-saved]
3532 .  ds doc-issue-name "\*[doc-issue-name-saved]
3533 .  nr doc-optional-count \n[doc-optional-count-saved]
3534 .  ds doc-optional-string "\*[doc-optional-string-saved]
3535 .  nr doc-page-number-count \n[doc-page-number-count-saved]
3536 .  ds doc-page-number-string "\*[doc-page-number-string-saved]
3537 .  nr doc-corporate-count \n[doc-corporate-count-saved]
3538 .  ds doc-corporate-name "\*[doc-corporate-name-saved]
3539 .  nr doc-report-count \n[doc-report-count-saved]
3540 .  ds doc-report-name "\*[doc-report-name-saved]
3541 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
3542 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3543 .  nr doc-volume-count \n[doc-volume-count-saved]
3544 .  ds doc-volume-name "\*[doc-volume-name-saved]
3545 .  nr doc-have-author \n[doc-have-author-saved]
3547 .  ds doc-document-title "\*[doc-document-title-saved]
3548 .  ds doc-volume "\*[doc-volume-saved]
3549 .  ds doc-section "\*[doc-section-saved]
3550 .  ds doc-operating-system "\*[doc-operating-system-saved]
3551 .  ds doc-date-string "\*[doc-date-string-saved]
3552 .  nr doc-header-space \n[doc-header-space-saved]
3553 .  nr doc-footer-space \n[doc-footer-space-saved]
3554 .  nr doc-display-vertical \n[doc-display-vertical-saved]
3555 .  ds doc-header-string "\*[doc-header-string-saved]
3556 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3557 .  nr doc-in-files-section \n[doc-in-files-section-saved]
3558 .  nr doc-in-authors-section \n[doc-in-authors-section-saved]
3562 .\" NS doc-no-printing global register (bool)
3563 .\" NS   set if output is suppressed
3565 .nr doc-no-printing 0
3568 .\" NS doc-dry-execute macro
3569 .\" NS   execute a string (splitting one arg into multiple args) without
3570 .\" NS   output; this command must be surrounded by `doc-save-global-args'
3571 .\" NS   and `doc-restore-global-args'
3573 .de doc-dry-execute
3574 .  doc-reset-args
3575 .  nr doc-no-printing 1
3576 .  ds doc-str-de \$1
3577 .  shift
3578 .  nop \*[doc-str-de] \$@
3579 .  nr doc-no-printing 0
3583 .\" NS El user macro
3584 .\" NS   end list
3585 .\" NS
3586 .\" NS modifies:
3587 .\" NS   doc-macro-name, doc-have-diag-list, doc-enum-list-count,
3588 .\" NS   doc-list-depth
3589 .\" NS
3590 .\" NS local variables:
3591 .\" NS   doc-str-El
3592 .\" NS
3593 .\" NS width register `El' set in doc-common
3595 .de El
3596 .  ie \n[.$] \
3597 .    tm Usage: .El (does not take arguments) (#\n[.c])
3598 .  el \{\
3599 .    ds doc-macro-name El
3600 .    ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3602 .    ie        "\*[doc-str-El]"enum-list" \{\
3603 .      nr doc-enum-list-count 0
3604 .      doc-end-list 1
3605 .    \}
3606 .    el \{ .ie "\*[doc-str-El]"diag-list" \{\
3607 .      nr doc-have-diag-list 0
3608 .      doc-end-list 0
3609 .    \}
3610 .    el \{ .ie "\*[doc-str-El]"column-list" \
3611 .      doc-end-column-list
3612 .    el \{ .ie "\*[doc-str-El]"item-list" \
3613 .      doc-end-list 0
3614 .    el \{ .ie "\*[doc-str-El]"ohang-list" \
3615 .      doc-end-list 0
3616 .    el \{ .ie "\*[doc-str-El]"inset-list" \
3617 .      doc-end-list 0
3618 .    el \
3619 .      doc-end-list 1
3620 .    \}\}\}\}\}
3622 .    br
3623 .  \}
3627 .\" NS doc-saved-Pa-font global string
3628 .\" NS   saved doc-Pa-font string for section FILES (no underline if
3629 .\" NS   nroff)
3631 .ds doc-saved-Pa-font
3634 .\" NS doc-curr-type global register
3635 .\" NS   current argument type
3637 .nr doc-curr-type 0
3640 .\" NS doc-curr-arg global string
3641 .\" NS   current argument
3643 .ds doc-curr-arg
3646 .\" NS It user macro
3647 .\" NS   list item
3648 .\" NS
3649 .\" NS modifies:
3650 .\" NS   doc-macro-name, doc-num-args, doc-arg-ptr, doc-argXXX,
3651 .\" NS   doc-out-string, doc-in-list, doc-saved-Pa-font, doc-curr-type,
3652 .\" NS   doc-curr-arg
3653 .\" NS
3654 .\" NS width register `It' set in doc-common
3655 .\" NS
3656 .\" NS local variables:
3657 .\" NS   doc-str-It, doc-reg-It
3659 .de It
3660 .  ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3662 .  if "\*[doc-str-It]"" \
3663 .    tm mdoc error: .It without preceding .Bl (#\n[.c])
3665 .  if \n[doc-nesting-level] \{\
3666 .    tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
3667 .    tm1 " (#\n[.c])
3668 .  \}
3670 .  br
3671 .  if !\n[cR] \
3672 .    ne 3v
3674 .  ie \n[.$] \{\
3675 .    ds doc-macro-name It
3676 .    ds doc-out-string
3678 .    \" fill argument vector
3679 .    nr doc-reg-It 1
3680 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3681 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3682 .      nr doc-reg-It +1
3683 .    \}
3685 .    nr doc-num-args \n[.$]
3686 .    nr doc-arg-ptr 0
3687 .    nr doc-reg-It 1
3689 .    ie "\*[doc-str-It]"diag-list" \{\
3690 .      doc-remaining-args
3691 .      doc-diag-list
3692 .      nr doc-reg-It 0
3693 .    \}
3694 .    el \{\
3695 .      ie        "\*[doc-str-It]"column-list" \{\
3696 .        ds doc-out-string
3697 .        doc-column-list
3698 .        nr doc-reg-It 0
3699 .      \}
3700 .      el \{ .ie "\*[doc-str-It]"tag-list" \
3701 .        nr doc-reg-It 2
3702 .      el \{ .ie "\*[doc-str-It]"hang-list" \
3703 .        nr doc-reg-It 2
3704 .      el \{ .ie "\*[doc-str-It]"ohang-list" \
3705 .        nr doc-reg-It 2
3706 .      el \{ .if "\*[doc-str-It]"inset-list" \
3707 .        nr doc-reg-It 2
3708 .    \}\}\}\}\}
3710 .    if \n[doc-reg-It] \{\
3711 .      ie (\n[doc-reg-It] == 2) \{\
3712 .        \" handle list types with arguments
3713 .        doc-parse-arg-vector
3715 .        nr doc-in-list 1
3716 .        nr doc-arg-ptr 1
3717 .        nr doc-curr-type \n[doc-type1]
3718 .        ds doc-curr-arg "\*[doc-arg1]
3720 .        if \n[doc-in-files-section] \{\
3721 .          ds doc-saved-Pa-font "\*[doc-Pa-font]
3722 .          if n \
3723 .            ds doc-Pa-font "\*[doc-No-font]
3724 .        \}
3726 .        ie (\n[doc-type1] == 1) \
3727 .          \*[doc-arg1]
3728 .        el \{\
3729 .          nr doc-arg-ptr 0
3730 .          No
3731 .        \}
3733 .        \" the previous call of `.No' can contain calls to opening requests
3734 .        \" like `.Ac'; we then defer the call of `doc-xxx-list'
3735 .        if !\n[doc-nesting-level] \
3736 .          doc-\*[doc-str-It]
3737 .      \}
3738 .      el \{\
3739 .        tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3740 .        tm1 "              don't take arguments (#\n[.c])
3741 .        doc-\*[doc-str-It]
3742 .  \}\}\}
3743 .  el \
3744 .    doc-\*[doc-str-It]
3748 .\" NS doc-inset-list macro
3749 .\" NS   .It item of list-type inset
3750 .\" NS
3751 .\" NS modifies:
3752 .\" NS   doc-out-string, doc-in-list
3754 .de doc-inset-list
3755 .  doc-set-vertical-and-indent 0
3756 .  br
3757 .  nop \&\*[doc-out-string]
3759 .  nr doc-in-list 0
3760 .  ds doc-out-string
3761 .  doc-reset-args
3762 '  fi
3766 .\" NS doc-hang-list macro
3767 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3768 .\" NS
3769 .\" NS modifies:
3770 .\" NS   doc-out-string, doc-in-list
3771 .\" NS
3772 .\" NS local variables:
3773 .\" NS   doc-reg-dhl
3775 .de doc-hang-list
3776 .  doc-set-vertical-and-indent 1
3777 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3778 .  ti -\n[doc-reg-dhl]u
3780 .  ie (\w\a\*[doc-out-string]\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3781 .    nop \&\*[doc-out-string]
3782 .  el \
3783 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dhl]u'\c
3785 .  nr doc-in-list 0
3786 .  ds doc-out-string
3787 .  doc-reset-args
3788 '  fi
3792 .\" NS doc-ohang-list macro
3793 .\" NS   .It item of list-type overhanging tag
3794 .\" NS
3795 .\" NS modifies:
3796 .\" NS   doc-out-string, doc-in-list
3798 .de doc-ohang-list
3799 .  doc-set-vertical-and-indent 0
3800 .  nop \&\*[doc-out-string]
3801 .  br
3803 .  nr doc-in-list 0
3804 .  ds doc-out-string
3805 .  doc-reset-args
3806 '  fi
3810 .\" NS doc-item-list macro
3811 .\" NS   .It item of list-type [empty tag]
3813 .de doc-item-list
3814 .  doc-set-vertical-and-indent 0
3815 .  br
3817 .  doc-reset-args
3818 '  fi
3822 .\" NS doc-enum-list-count global register
3823 .\" NS   contains current enum count value
3825 .nr doc-enum-list-count 0
3828 .\" NS doc-enum-list macro
3829 .\" NS   enumerated list
3830 .\" NS
3831 .\" NS modifies:
3832 .\" NS   doc-out-string, doc-in-list, doc-enum-list-count
3834 .de doc-enum-list
3835 .  nr doc-in-list 1
3836 .  nr doc-enum-list-count +1
3837 .  ds doc-out-string \n[doc-enum-list-count].
3838 .  doc-do-list
3842 .\" NS doc-bullet-list macro
3843 .\" NS   bullet paragraph list
3844 .\" NS
3845 .\" NS modifies:
3846 .\" NS   doc-out-string, doc-in-list
3848 .de doc-bullet-list
3849 .  nr doc-in-list 1
3850 .  ds doc-out-string "\*[doc-Sy-font]\[bu]\f[P]
3851 .  doc-do-list
3855 .\" NS doc-dash-list macro
3856 .\" NS   hyphen paragraph list (sub bullet list)
3857 .\" NS
3858 .\" NS modifies:
3859 .\" NS   doc-out-string, doc-in-list
3861 .de doc-dash-list
3862 .  nr doc-in-list 1
3863 .  ds doc-out-string "\*[doc-Sy-font]\-\f[P]
3864 .  doc-do-list
3868 .\" NS doc-do-list macro
3869 .\" NS   .It item of list-type enum/bullet/hyphen
3871 .als doc-do-list doc-hang-list
3874 .\" NS doc-have-diag-list global register (bool)
3875 .\" NS   set if last item was a diag list
3877 .\" XXX: this should be modified to handle nested lists of any type
3879 .nr doc-have-diag-list 0
3882 .\" NS doc-diag-list-input-line-count global register
3883 .\" NS   saved line number to be checked in next diag-list item
3885 .nr doc-diag-list-input-line-count 0
3888 .\" NS doc-diag-list macro
3889 .\" NS   .It item of list-type diagnostic-message
3890 .\" NS
3891 .\" NS modifies:
3892 .\" NS   doc-out-string, doc-curr-font, doc-curr-size,
3893 .\" NS   doc-diag-list-input-line-count
3895 .de doc-diag-list
3896 .  nr doc-curr-font \n[.f]
3897 .  nr doc-curr-size \n[.s]
3899 .  ie \n[doc-have-diag-list] \{\
3900 .    ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \
3901 .      doc-paragraph
3902 .    el \
3903 .      br
3904 .  \}
3905 .  el \
3906 .    br
3907 .  nr doc-diag-list-input-line-count \n[.c]
3909 .  nop \*[doc-Sy-font]\*[doc-out-string]\c
3910 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\*[doc-digit-string]\c
3912 .  doc-reset-args
3913 .  ds doc-out-string
3914 '  fi
3918 .\" NS doc-tag-list macro
3919 .\" NS   .It item of list-type `tag'
3920 .\" NS
3921 .\" NS modifies:
3922 .\" NS   doc-out-string, doc-in-list
3923 .\" NS
3924 .\" NS local variables:
3925 .\" NS   doc-reg-dtl
3927 .de doc-tag-list
3928 .  if !\n[doc-have-tag-width] \
3929 .    doc-get-tag-width
3930 .  doc-set-vertical-and-indent 1
3931 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3932 .  ti -\n[doc-reg-dtl]u
3934 .  ie (\w\a\*[doc-out-string]\au > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3935 .    nop \&\*[doc-out-string]
3936 .    br
3937 .  \}
3938 .  el \
3939 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dtl]u'\c
3941 .  if \n[doc-in-files-section] \
3942 .    if n \
3943 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3945 .  nr doc-in-list 0
3946 .  ds doc-out-string
3947 .  doc-reset-args
3948 '  fi
3952 .\" NS doc-get-tag-width macro
3953 .\" NS   resolve unknown tag width (.Bl [inset | tag] only)
3954 .\" NS
3955 .\" NS modifies:
3956 .\" NS   doc-list-indent-stackXXX, doc-have-indent, doc-tag-width-stackXXX
3957 .\" NS
3958 .\" NS requires:
3959 .\" NS   doc-curr-type, doc-curr-arg
3961 .de doc-get-tag-width
3962 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3963 .    ie (\n[doc-curr-type] == 1) \{\
3964 .      ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
3965 .      nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
3966 .    \}
3967 .    el \{\
3968 .      ds doc-tag-width-stack\n[doc-list-depth] No
3969 .      nr doc-list-indent-stack\n[doc-list-depth] \n[No]
3970 .    \}
3971 .    nr doc-have-tag-width 1
3972 .  \}
3976 .\" NS doc-set-vertical-and-indent macro
3977 .\" NS   set up vertical spacing (if not compact) and indentation (with
3978 .\" NS   offset if argument is non-zero)
3979 .\" NS
3980 .\" NS modifies:
3981 .\" NS   doc-have-indent, doc-have-tag-width
3983 .de doc-set-vertical-and-indent
3984 .  ie \n[doc-have-indent] \{\
3985 .    nr doc-have-indent 0
3986 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3987 .      sp \n[doc-display-vertical]u
3988 .    in +\n[doc-list-offset-stack\n[doc-list-depth]]u
3989 .    if \$1 \
3990 .      in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3991 .  \}
3992 .  el \{\
3993 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3994 .      sp \n[doc-display-vertical]u
3995 .  \}
3997 .  if !\n[cR] \
3998 .    ne 2v
4002 .\" NS doc-list-depth global register
4003 .\" NS   list type stack counter
4005 .nr doc-list-depth 0
4008 .\" NS doc-num-columns global register
4009 .\" NS   number of columns
4011 .nr doc-num-columns 0
4014 .\" NS doc-compact-list-stackXXX global register (bool)
4015 .\" NS   stack of flags to indicate whether a particular list is compact
4016 .\" NS
4017 .\" NS   limit: doc-list-depth
4019 .nr doc-compact-list-stack1 0
4022 .\" NS doc-tag-width-stackXXX global string
4023 .\" NS   stack of strings indicating how to set up current element of
4024 .\" NS   doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
4025 .\" NS   directly; if it is a macro name, use the macro's width value;
4026 .\" NS   otherwise, `doc-get-tag-width' uses width value of `No'.
4027 .\" NS
4028 .\" NS   limit: doc-list-depth
4030 .ds doc-tag-width-stack0
4031 .ds doc-tag-width-stack1
4034 .\" NS doc-list-offset-stackXXX global register
4035 .\" NS   stack of list offsets
4036 .\" NS
4037 .\" NS   limit: doc-list-depth
4039 .nr doc-list-offset-stack1 0
4042 .\" NS doc-end-list macro
4043 .\" NS   list end function; resets indentation (and offset if argument is
4044 .\" NS   non-zero)
4045 .\" NS
4046 .\" NS modifies:
4047 .\" NS   doc-list-offset-stackXXX, doc-list-depth
4049 .de doc-end-list
4050 .  if \$1 \
4051 '    in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
4053 '  in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4054 .  nr doc-list-offset-stack\n[doc-list-depth] 0
4056 .  if (\n[doc-list-depth] <= 0) \
4057 .    tm mdoc warning: extraneous .El call (#\n[.c])
4059 .  doc-decrement-list-stack
4060 .  nr doc-list-depth -1
4061 .  doc-increment-list-stack
4063 .  nr doc-have-tag-width 0
4067 .\" NS doc-next-list-depth global register
4068 .\" NS   next possible doc-list-depth value
4070 .nr doc-next-list-depth 1
4073 .\" NS doc-increment-list-stack macro
4074 .\" NS   set up next block for list
4075 .\" NS
4076 .\" NS modifies:
4077 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX,
4078 .\" NS   doc-compact-list-stackXXX, doc-tag-width-stackXXX,
4079 .\" NS   doc-list-offset-stackXXX, doc-next-list-depth
4081 .de doc-increment-list-stack
4082 .  nr doc-next-list-depth (\n[doc-list-depth] + 1)
4083 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
4084 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
4085 .  ds doc-tag-width-stack\n[doc-next-list-depth] \*[doc-tag-width-stack\n[doc-list-depth]]
4086 .  ds doc-list-type-stack\n[doc-next-list-depth]
4087 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
4091 .\" NS doc-decrement-list-stack macro
4092 .\" NS   decrement stack
4093 .\" NS
4094 .\" NS modifies:
4095 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX,
4096 .\" NS   doc-compact-list-stackXXX, doc-tag-width-stackXXX,
4097 .\" NS   doc-list-offset-stackXXX, doc-next-list-depth
4099 .de doc-decrement-list-stack
4100 .  ds doc-list-type-stack\n[doc-next-list-depth]
4101 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
4102 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
4103 .  ds doc-tag-width-stack\n[doc-next-list-depth]
4104 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
4105 .  nr doc-next-list-depth -1
4109 .\" NS Xr user macro
4110 .\" NS   cross reference (man page only)
4111 .\" NS
4112 .\" NS modifies:
4113 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string
4114 .\" NS
4115 .\" NS width register `Xr' set in doc-common
4117 .de Xr
4118 .  if !\n[doc-arg-limit] \{\
4119 .    ie \n[.$] \{\
4120 .      ds doc-macro-name Xr
4121 .      doc-parse-args \$@
4122 .    \}
4123 .    el \
4124 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
4125 .  \}
4127 .  nr doc-arg-ptr +1
4128 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4129 .    ie (\n[doc-type\n[doc-arg-ptr]] == 1) \
4130 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
4131 .    el \{\
4132 .      ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4133 .        as doc-out-string \*[doc-Xr-font]
4134 .        as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4136 .        nr doc-arg-ptr +1
4137 .        if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4138 .          if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4139 .            as doc-out-string \&\*[lp]\*[doc-arg\n[doc-arg-ptr]]\*[rp]
4140 .            nr doc-arg-ptr +1
4141 .        \}\}
4142 .        ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4143 .          doc-do-\n[doc-type\n[doc-arg-ptr]]
4144 .        el \
4145 .          doc-print-and-reset
4146 .      \}
4147 .      el \
4148 .        doc-do-xref-\n[doc-type\n[doc-arg-ptr]]
4149 .  \}\}
4153 .\" NS Sx user macro
4154 .\" NS   cross section reference
4155 .\" NS
4156 .\" NS modifies:
4157 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4158 .\" NS   doc-curr-size
4159 .\" NS
4160 .\" NS width register `Sx' set in doc-common
4162 .de Sx
4163 .  if !\n[doc-arg-limit] \{\
4164 .    ie \n[.$] \{\
4165 .      ds doc-macro-name Sx
4166 .      doc-parse-args \$@
4167 .    \}
4168 .    el \
4169 .      tm Usage: .Sx section_header \*[doc-punct-chars] (#\n[.c])
4170 .  \}
4172 .  nr doc-arg-ptr +1
4173 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4174 .    as doc-out-string \*[doc-Sx-font]
4175 .    nr doc-curr-font \n[.f]
4176 .    nr doc-curr-size \n[.s]
4177 .    doc-print-recursive
4178 .  \}
4182 .\" NS doc-end-column-list macro
4183 .\" NS   column-list end-list
4184 .\" NS
4185 .\" NS modifies:
4186 .\" NS   doc-list-depth
4188 .de doc-end-column-list
4189 '  in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
4190 .  ta T .5i
4191 .  fi
4192 .  doc-decrement-list-stack
4193 .  nr doc-list-depth -1
4194 .  doc-increment-list-stack
4198 .\" NS doc-column-indent-width global register
4199 .\" NS   holds the indent width for a column list
4201 .nr doc-column-indent-width 0
4204 .\" NS doc-set-column-tab macro
4205 .\" NS   establish tabs for list-type column: `.doc-set-column-tab num_cols'
4206 .\" NS
4207 .\" NS local variables:
4208 .\" NS   doc-str-dsct, doc-str-dsct1, doc-reg-dsct, doc-column-indent-width
4210 .de doc-set-column-tab
4211 .  ds doc-str-dsct
4212 .  nr doc-reg-dsct 1
4213 .  nr doc-column-indent-width 0
4215 .  ie (\$1 < 5) \
4216 .    ds doc-str-dsct1 "    \"
4217 .  el \{\
4218 .    ie (\$1 == 5) \
4219 .      ds doc-str-dsct1 "   \"
4220 .    el \{\
4221 .      \" XXX: this is packed abnormally close -- intercolumn width
4222 .      \"      should be configurable
4223 .      ds doc-str-dsct1 " \"
4224 .  \}\}
4226 .  while (\n[doc-reg-dsct] <= \$1) \{\
4227 .    as doc-str-dsct " +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4228 .    nr doc-column-indent-width +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4229 .    nr doc-reg-dsct +1
4230 .  \}
4232 .  ta \*[doc-str-dsct]
4233 '  in +(\n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
4237 .\" NS doc-column-list macro
4238 .\" NS   column items
4239 .\" NS
4240 .\" NS modifies:
4241 .\" NS   doc-arg-ptr, doc-spaceXXX, doc-list-indent-stackXXX
4242 .\" NS
4243 .\" NS local variables:
4244 .\" NS   doc-reg-dcl
4246 .de doc-column-list
4247 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4248 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4249 .  if !\n[.u] \{\
4250 .    fi
4251 '    in +\n[doc-column-indent-width]u
4252 .  \}
4253 .  ti -\n[doc-column-indent-width]u
4255 .  doc-parse-arg-vector
4256 .  nr doc-arg-ptr +1
4258 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4259 .    if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4260 .      nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4261 .      ds doc-space\n[doc-reg-dcl]
4262 .    \}
4263 .    doc-do-\n[doc-type\n[doc-arg-ptr]]
4264 .  \}
4265 .  el \
4266 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4270 .\" NS Ta user macro
4271 .\" NS   append tab (\t)
4272 .\" NS
4273 .\" NS modifies:
4274 .\" NS   doc-arg-ptr, doc-out-string
4275 .\" NS
4276 .\" NS width register `Ta' set in doc-common
4278 .de Ta
4279 .  ie \n[doc-arg-limit] \{\
4280 .    nr doc-arg-ptr +1
4281 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4282 .      as doc-out-string \t
4283 .      doc-do-\n[doc-type\n[doc-arg-ptr]]
4284 .    \}
4285 .    el \{\
4286 .      as doc-out-string \t\c
4287 .      doc-print-and-reset
4288 .  \}\}
4289 .  el \{\
4290 .    tm1 "Usage: Ta must follow column entry: e.g. (#\n[.c])
4291 .    tm1 "         .It column_string [Ta [column_string ...]]
4292 .  \}
4296 .\" NS Dl user macro
4297 .\" NS   display (one line) literal
4298 .\" NS
4299 .\" NS modifies:
4300 .\" NS   doc-macro-name
4301 .\" NS
4302 .\" NS width register `Dl' set in doc-common
4304 .de Dl
4305 '  ta T .5i
4306 .  in +\n[doc-display-indent]u
4308 .  ie \n[doc-arg-limit] \
4309 .    tm Usage: .Dl not callable by other macros (#\n[.c])
4310 .  el \{\
4311 .    ie \n[.$] \{\
4312 .      ds doc-macro-name Dl
4313 .      doc-parse-args \$@
4314 .      Li
4315 .    \}
4316 .    el \
4317 .      tm Usage: .Dl argument ... (#\n[.c])
4318 .  \}
4320 .  in -\n[doc-display-indent]u
4324 .\" NS D1 user macro
4325 .\" NS   display (one line)
4326 .\" NS
4327 .\" NS modifies:
4328 .\" NS   doc-macro-name, doc-arg-ptr
4329 .\" NS
4330 .\" NS width register `D1' set in doc-common
4332 .de D1
4333 '  ta T .5i
4334 .  in +\n[doc-display-indent]u
4336 .  ie \n[doc-arg-limit] \
4337 .    tm Usage: .D1 not callable by other macros (#\n[.c])
4338 .  el \{\
4339 .    ie \n[.$] \{\
4340 .      ds doc-macro-name D1
4341 .      doc-parse-args \$@
4342 .      No
4343 .    \}
4344 .    el \
4345 .      tm Usage: .D1 argument ... (#\n[.c])
4346 .  \}
4348 .  in -\n[doc-display-indent]u
4352 .\" NS Ex user macro
4353 .\" NS   defunct
4355 .de Ex
4356 .  tm mdoc error: .Ex defunct, use .D1: \$@ (#\n[.c])
4360 .\" NS Vt user macro
4361 .\" NS   variable type (for forcing old style variable declarations);
4362 .\" NS   this is not done in the same manner as .Ot for fortrash --
4363 .\" NS   clean up later
4364 .\" NS
4365 .\" NS modifies:
4366 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
4367 .\" NS   doc-have-var
4368 .\" NS
4369 .\" NS width register `Vt' set in doc-common
4371 .de Vt
4372 .  \" if a function declaration was the last thing given, want vertical space
4373 .  if \n[doc-have-decl] \{\
4374 .    doc-paragraph
4375 .    nr doc-have-decl 0
4376 .  \}
4378 .  \" if a subroutine was the last thing given, want vertical space
4379 .  if \n[doc-have-func] \{\
4380 .    ie !\n[doc-have-var] \
4381 .      br
4382 .    el \{\
4383 .      doc-paragraph
4384 .      rs
4385 .  \}\}
4387 .  nr doc-have-var 1
4388 .  nr doc-curr-font \n[.f]
4389 .  nr doc-curr-size \n[.s]
4391 .  nop \*[doc-Ft-font]\$*
4393 .  ie \n[doc-have-old-func] \
4394 .    nop \&\*[doc-soft-space]
4395 .  el \
4396 .    br
4398 .  ft \n[doc-curr-font]
4399 .  ps \n[doc-curr-size]
4403 .\" NS doc-is-func global register (bool)
4404 .\" NS   set if subroutine (in synopsis only) (fortran only)
4406 .nr doc-is-func 0
4409 .\" NS Ft user macro
4410 .\" NS   function type
4411 .\" NS
4412 .\" NS modifies:
4413 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
4414 .\" NS   doc-have-var, doc-is-func
4415 .\" NS
4416 .\" NS width register `Ft' set in doc-common
4418 .de Ft
4419 .  if \n[doc-in-synopsis-count] \{\
4420 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4421 .      doc-paragraph
4422 .      nr doc-have-decl 0
4423 .      nr doc-have-var 0
4424 .    \}
4426 .    if \n[doc-have-var] \{\
4427 .      doc-paragraph
4428 .      nr doc-have-var 0
4429 .    \}
4431 .    nr doc-is-func 1
4432 .  \}
4434 .  nr doc-curr-font \n[.f]
4435 .  nr doc-curr-size \n[.s]
4437 .  nop \*[doc-Ft-font]\$*
4439 .  ft \n[doc-curr-font]
4440 .  ps \n[doc-curr-size]
4444 .\" NS doc-have-old-func global register (bool)
4445 .\" NS   set if `Ot' has been called
4447 .nr doc-have-old-func 0
4450 .\" NS Ot user macro
4451 .\" NS   old function type (fortran -- no newline)
4452 .\" NS
4453 .\" NS modifies:
4454 .\" NS   doc-out-string, doc-have-decl, doc-have-var,
4455 .\" NS   doc-is-func, doc-have-old-func
4456 .\" NS
4457 .\" NS width register `Ot' set in doc-common
4459 .de Ot
4460 .  nr doc-have-old-func 1
4462 .  if \n[doc-in-synopsis-count] \{\
4463 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4464 .      doc-paragraph
4465 .      nr doc-have-decl 0
4466 .      nr doc-have-var 0
4467 .    \}
4469 .    if \n[doc-have-var] \{\
4470 .      doc-paragraph
4471 .      nr doc-have-var 0
4472 .    \}
4474 .    nr doc-is-func 1
4475 .  \}
4477 .  if \n[.$] \
4478 .    as doc-out-string \*[doc-Ft-font]\$*
4479 .  as doc-out-string \ \f[P]
4483 .\" NS Fa user macro
4484 .\" NS   function arguments
4485 .\" NS
4486 .\" NS modifies:
4487 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4488 .\" NS   doc-curr-size
4489 .\" NS
4490 .\" NS width register `Fa' set in doc-common
4492 .de Fa
4493 .  if !\n[doc-arg-limit] \{\
4494 .    ie \n[.$] \{\
4495 .      ds doc-macro-name Fa
4496 .      doc-parse-args \$@
4497 .    \}
4498 .    el \
4499 .      tm Usage: .Fa function_arguments ... \*[doc-punct-chars] (#\n[.c])
4500 .  \}
4502 .  ie \n[doc-func-arg-count] \
4503 .    doc-do-func
4504 .  el \{\
4505 .    nr doc-arg-ptr +1
4506 .    if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4507 .      as doc-out-string \*[doc-Fa-font]
4508 .      nr doc-curr-font \n[.f]
4509 .      nr doc-curr-size \n[.s]
4510 .      doc-print-recursive
4512 .      if \n[doc-in-synopsis-count] \
4513 .        if \n[doc-have-func] \
4514 .          br
4515 .  \}\}
4519 .\" NS doc-func-arg-count global register
4520 .\" NS   how many function arguments have been processed so far
4522 .nr doc-func-arg-count 0
4525 .\" NS doc-func-arg global string
4526 .\" NS   work buffer for function name strings
4528 .ds doc-func-arg
4531 .\" NS doc-num-func-args global register
4532 .\" NS   number of function arguments
4534 .nr doc-num-func-args 0
4537 .\" NS doc-func-args-processed global register
4538 .\" NS   function arguments processed so far
4540 .nr doc-func-args-processed 0
4543 .\" NS doc-do-func macro
4544 .\" NS   internal .Fa for .Fc
4545 .\" NS
4546 .\" NS modifies:
4547 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string, doc-func-arg-count,
4548 .\" NS   doc-func-arg, doc-num-func-args, doc-func-args-processed
4550 .de doc-do-func
4551 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4552 .    nr doc-arg-ptr +1
4554 .    ds doc-func-arg
4555 .    nr doc-num-func-args 0
4556 .    nr doc-func-args-processed 0
4558 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4559 .    if (\n[doc-num-func-args] > 1) \
4560 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4562 .    if (\n[doc-func-arg-count] > 1) \{\
4563 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\|,
4564 .      as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]
4565 .      as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4566 .    \}
4568 .    if (\n[doc-func-arg-count] == 1) \{\
4569 .      as doc-out-string \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]
4570 .      as doc-out-string \f[P]\s[0]
4571 .    \}
4572 .    nr doc-func-arg-count +1
4573 .    doc-do-func
4574 .  \}
4575 .  el \
4576 .    doc-reset-args
4580 .\" NS doc-have-func global register (bool)
4581 .\" NS   whether we have more than one function in synopsis
4583 .nr doc-have-func 0
4586 .\" NS Fn user macro
4587 .\" NS   functions
4588 .\" NS
4589 .\" NS modifies:
4590 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4591 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
4592 .\" NS   doc-have-decl, doc-have-var, doc-have-func,
4593 .\" NS   doc-is-func
4594 .\" NS
4595 .\" NS width register `Fn' set in doc-common
4597 .de Fn
4598 .  hy 0
4600 .  if !\n[doc-arg-limit] \{\
4601 .    ie \n[.$] \{\
4602 .      ds doc-macro-name Fn
4603 .      doc-parse-args \$@
4604 .    \}
4605 .    el \{\
4606 .      tmc Usage: .Fn function_name function_arg(s) ... \*[doc-punct-chars]
4607 .      tm1 " (#\n[.c])
4608 .  \}\}
4610 .  if \n[doc-in-synopsis-count] \{\
4611 .    \" if there is/has been more than one subroutine declaration
4612 .    ie \n[doc-is-func] \{\
4613 .      br
4614 .      nr doc-have-var 0
4615 .      nr doc-have-decl 0
4616 .      nr doc-is-func 0
4617 .    \}
4618 .    el \{\
4619 .      if \n[doc-have-func] \{\
4620 .        doc-paragraph
4621 .        nr doc-have-var 0
4622 .        nr doc-have-decl 0
4623 .    \}\}
4625 .    if \n[doc-have-decl] \{\
4626 .      doc-paragraph
4627 .      nr doc-have-var 0
4628 .    \}
4630 .    if \n[doc-have-var] \{\
4631 .      doc-paragraph
4632 .      nr doc-have-decl 0
4633 .    \}
4635 .    nr doc-have-func 1
4636 .    nr doc-is-func 0
4637 .    rs
4639 .    ie (\n[doc-in-synopsis-count] > 1) \
4640 .      br
4641 .    el \{\
4642 .      if !\n[doc-indent-synopsis] \
4643 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4644 .    \}
4646 .    in +\n[doc-indent-synopsis]u
4647 .    ti -\n[doc-indent-synopsis]u
4648 .    nr doc-in-synopsis-count +1
4649 .  \}
4651 .  nr doc-arg-ptr +1
4652 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4653 .    nr doc-curr-font \n[.f]
4654 .    nr doc-curr-size \n[.s]
4655 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4656 .    as doc-out-string \f[P]\s[0]\*[lp]
4658 .    nr doc-arg-ptr +1
4659 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4660 .      as doc-out-string \*[doc-Fa-font]
4661 .      doc-do-func-\n[doc-type\n[doc-arg-ptr]]
4662 .    \}
4663 .    el \{\
4664 .      as doc-out-string \|\*[rp]
4665 .      doc-print-and-reset
4666 .    \}
4668 .    if \n[doc-in-synopsis-count] \
4669 .      in -\n[doc-indent-synopsis]u
4670 .  \}
4672 .  hy
4676 .\" NS doc-do-func-1 macro
4677 .\" NS   prepare `doc-out-string' and execute doc-argXXX
4678 .\" NS
4679 .\" NS modifies:
4680 .\" NS   doc-out-string
4682 .de doc-do-func-1
4683 .  ie \n[doc-in-synopsis-count] \{\
4684 .    as doc-out-string \&\*[rp]
4685 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4686 .  \}
4687 .  el \
4688 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4690 .  \*[doc-arg\n[doc-arg-ptr]]
4694 .\" NS doc-do-func-2 macro
4695 .\" NS   handle function arguments
4696 .\" NS
4697 .\" NS modifies:
4698 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string, doc-func-arg,
4699 .\" NS   doc-num-func-args, doc-func-args-processed
4700 .\" NS
4701 .\" NS local variables:
4702 .\" NS   doc-reg-ddfs
4704 .de doc-do-func-2
4705 .  if \n[doc-in-synopsis-count] \{\
4706 .    ds doc-func-arg
4707 .    nr doc-num-func-args 0
4708 .    nr doc-func-args-processed 0
4710 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4711 .    if (\n[doc-num-func-args] > 1) \
4712 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4713 .  \}
4715 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4717 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4718 .    nr doc-reg-ddfs \n[doc-arg-ptr]
4719 .    nr doc-arg-ptr +1
4720 .    if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
4721 .      as doc-out-string \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]],
4722 .      as doc-out-string "\*[doc-space\n[doc-reg-ddfs]]\f[P]\s[0]\|
4723 .    \}
4724 .    doc-do-func-\n[doc-type\n[doc-arg-ptr]]
4725 .  \}
4726 .  el \{\
4727 .    ie \n[doc-in-synopsis-count] \{\
4728 .      as doc-out-string \&\*[rp]
4729 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4730 .    \}
4731 .    el \
4732 .      as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4734 .    doc-print-and-reset
4735 .  \}
4739 .\" NS doc-do-func-3 macro
4740 .\" NS   handle punctuation suffixes in functions
4741 .\" NS
4742 .\" NS modifies:
4743 .\" NS   doc-out-string
4745 .de doc-do-func-3
4746 .  ie \n[doc-in-synopsis-count] \{\
4747 .    as doc-out-string \&\*[rp]
4748 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4749 .    as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4750 .  \}
4751 .  el \{\
4752 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4753 .    as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4754 .  \}
4756 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
4757 .    No
4758 .  el \
4759 .    doc-print-and-reset
4763 .\" NS doc-do-func-4 macro
4764 .\" NS   handle punctuation prefixes in functions
4765 .\" NS
4766 .\" NS modifies:
4767 .\" NS   doc-arg-ptr, doc-out-string
4769 .de doc-do-func-4
4770 .  ie \n[doc-in-synopsis-count] \{\
4771 .    as doc-out-string \&\*[rp]
4772 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4773 .    as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4774 .  \}
4775 .  el \{\
4776 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4777 .    as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4778 .  \}
4780 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4781 .    nr doc-arg-ptr +1
4782 .    No
4783 .  \}
4784 .  el \
4785 .    doc-print-and-reset
4789 .\" NS Fo user macro
4790 .\" NS   function open
4791 .\" NS
4792 .\" NS modifies:
4793 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4794 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
4795 .\" NS   doc-have-decl, doc-have-var, doc-have-func,
4796 .\" NS   doc-nesting-level, doc-is-func, doc-func-arg-count
4797 .\" NS
4798 .\" NS width register `Fo' set in doc-common
4800 .de Fo
4801 .  hy 0
4803 .  if !\n[doc-arg-limit] \{\
4804 .    ie \n[.$] \{\
4805 .      ds doc-macro-name Fo
4806 .      doc-parse-args \$@
4807 .    \}
4808 .    el \
4809 .      tm Usage: .Fo function_name (#\n[.c])
4810 .  \}
4812 .  if \n[doc-in-synopsis-count] \{\
4813 .    \" if there is/has been more than one subroutine declaration
4814 .    ie \n[doc-is-func] \{\
4815 .      br
4816 .      nr doc-have-var 0
4817 .      nr doc-have-decl 0
4818 .      nr doc-is-func 0
4819 .    \}
4820 .    el \{\
4821 .      if \n[doc-have-func] \{\
4822 .        doc-paragraph
4823 .        nr doc-have-var 0
4824 .        nr doc-have-decl 0
4825 .    \}\}
4827 .    if \n[doc-have-decl] \{\
4828 .      doc-paragraph
4829 .      nr doc-have-var 0
4830 .    \}
4832 .    if \n[doc-have-var] \{\
4833 .      doc-paragraph
4834 .      nr doc-have-decl 0
4835 .    \}
4837 .    nr doc-have-func 1
4838 .    nr doc-is-func 0
4839 .    rs
4841 .    ie (\n[doc-in-synopsis-count] > 1) \
4842 .      br
4843 .    el \{\
4844 .      if !\n[doc-indent-synopsis] \
4845 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4846 .    \}
4848 .    in +\n[doc-indent-synopsis]u
4849 .    ti -\n[doc-indent-synopsis]u
4850 .    nr doc-in-synopsis-count +1
4851 .  \}
4853 .  nr doc-arg-ptr +1
4854 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4855 .    nr doc-nesting-level +1
4856 .    nr doc-func-arg-count 1
4857 .    nr doc-curr-font \n[.f]
4858 .    nr doc-curr-size \n[.s]
4860 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4861 .    as doc-out-string \f[P]\s[0]\*[lp]
4862 .    doc-reset-args
4863 .  \}
4867 .\" NS Fc user macro
4868 .\" NS   function close
4869 .\" NS
4870 .\" NS modifies:
4871 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-nesting-level,
4872 .\" NS   doc-func-arg-count
4873 .\" NS
4874 .\" NS width register `Fc' set in doc-common
4876 .de Fc
4877 .  if !\n[doc-arg-limit] \{\
4878 .    if \n[.$] \{\
4879 .      ds doc-macro-name Fc
4880 .      doc-parse-args \$@
4881 .  \}\}
4883 .  nr doc-func-arg-count 0
4884 .  nr doc-nesting-level -1
4886 .  ie \n[doc-in-synopsis-count] \
4887 .    as doc-out-string \|\*[rp]
4888 .  el \
4889 .    as doc-out-string \|\*[rp]
4890 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4891 .    nr doc-arg-ptr +1
4892 .    \*[doc-arg\n[doc-arg-ptr]]
4893 .  \}
4894 .  el \
4895 .    doc-print-and-reset
4897 .  if \n[doc-in-synopsis-count] \
4898 .    in -\n[doc-indent-synopsis]u
4900 .  hy
4904 .\" NS doc-build-func-string macro
4905 .\" NS   collect function arguments and set hard spaces inbetween
4906 .\" NS
4907 .\" NS modifies:
4908 .\" NS   doc-func-arg, doc-num-func-args, doc-func-args-processed
4910 .de doc-build-func-string
4911 .  if !\n[doc-num-func-args] \{\
4912 .    nr doc-num-func-args \n[.$]
4913 .    nr doc-func-args-processed 0
4914 .    ds doc-func-arg
4915 .  \}
4917 .  nr doc-func-args-processed +1
4918 .  as doc-func-arg "\$1
4920 .  if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
4921 .    as doc-func-arg "\*[doc-hard-space]
4923 .    shift
4924 .    doc-build-func-string \$@
4925 .  \}
4929 .\" Very crude references, stash all reference info into strings (usual
4930 .\" use of doc-out-string, then doc-out-string contents copied to
4931 .\" string of retrievable naming convention), print out reference on .Re
4932 .\" request and clean up.  Ordering very limited, no fancy citations, but
4933 .\" can do articles, journals, and books -- need to add several missing
4934 .\" options (like city etc).  Should be able to grab a refer entry, massage
4935 .\" it a wee bit (prefix a `.' to the %[A-Z]) and not worry (ha!).
4938 .\" NS doc-is-reference global register (bool)
4939 .\" NS   set if in reference
4941 .nr doc-is-reference 0
4944 .\" NS doc-reference-count global register
4945 .\" NS   reference element counter
4947 .nr doc-reference-count 0
4950 .\" NS doc-reference-string-name global string
4951 .\" NS   contains current reference string name for handling in
4952 .\" NS   `doc-do-references'
4954 .ds doc-reference-string-name
4957 .\" NS Rs user macro
4958 .\" NS   reference start
4959 .\" NS
4960 .\" NS modifies:
4961 .\" NS   doc-is-reference, doc-reference-count
4962 .\" NS
4963 .\" NS width register `Rs' set in doc-common
4965 .de Rs
4966 .  nr doc-is-reference 1
4967 .  doc-reset-reference
4968 .  if \n[doc-in-see-also-section] \
4969 .    doc-paragraph
4970 .  nr doc-reference-count 0
4974 .\" NS Re user macro
4975 .\" NS   reference end
4976 .\" NS
4977 .\" NS modifies:
4978 .\" NS   doc-is-reference
4979 .\" NS
4980 .\" NS width register `Re' set in doc-common
4982 .de Re
4983 .  doc-print-reference
4984 .  doc-reset-reference
4985 .  nr doc-is-reference 0
4989 .\" NS doc-reset-reference macro
4990 .\" NS   reference cleanup
4991 .\" NS
4992 .\" NS modifies:
4993 .\" NS   doc-author-count, doc-journal-count, doc-issue-count,
4994 .\" NS   doc-optional-count, doc-corporate-count, doc-report-count,
4995 .\" NS   doc-reference-title-count, doc-volume-count, doc-date-count,
4996 .\" NS   doc-page-number-count, doc-book-count, doc-reference-string-name,
4997 .\" NS   doc-journal-name, doc-issue-name, doc-optional-string,
4998 .\" NS   doc-corporate-name, doc-report-name, doc-reference-title-name,
4999 .\" NS   doc-volume-name, doc-date, doc-page-number-string, doc-book-name
5001 .de doc-reset-reference
5002 .  while (\n[doc-author-count]) \{\
5003 .    ds doc-author-name\n[doc-author-count]
5004 .    nr doc-author-count -1
5005 .  \}
5006 .  nr doc-journal-count 0
5007 .  nr doc-issue-count 0
5008 .  nr doc-optional-count 0
5009 .  nr doc-corporate-count 0
5010 .  nr doc-report-count 0
5011 .  nr doc-reference-title-count 0
5012 .  nr doc-volume-count 0
5013 .  nr doc-date-count 0
5014 .  nr doc-page-number-count 0
5015 .  nr doc-book-count 0
5017 .  ds doc-reference-string-name
5019 .  ds doc-journal-name
5020 .  ds doc-issue-name
5021 .  ds doc-optional-string
5022 .  ds doc-corporate-name
5023 .  ds doc-report-name
5024 .  ds doc-reference-title-name
5025 .  ds doc-volume-name
5026 .  ds doc-date
5027 .  ds doc-page-number-string
5028 .  ds doc-book-name
5032 .\" NS doc-finish-reference macro
5033 .\" NS   auxiliary macro for doc-print-reference
5034 .\" NS
5035 .\" NS modifies:
5036 .\" NS   doc-reference-count
5038 .de doc-finish-reference
5039 .  nr doc-reference-count -1
5040 .  ie \n[doc-reference-count] \
5041 .    nop \&,
5042 .  el \
5043 .    nop \&.
5047 .\" NS doc-print-reference macro
5048 .\" NS   reference print
5049 .\" NS
5050 .\" NS modifies:
5051 .\" NS   doc-reference-count, doc-authors-processed
5053 .de doc-print-reference
5054 .  if \n[doc-author-count] \{\
5055 .    nop \&\*[doc-author-name1],
5056 .    nr doc-authors-processed 1
5057 .    if (\n[doc-author-count] > 1) \
5058 .      doc-print-reference-authors
5059 .    nr doc-reference-count -\n[doc-author-count]
5060 .  \}
5062 .  if \n[doc-reference-title-count] \{\
5063 .    ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5064 .      nop \&\*[q]\*[doc-reference-title-name]\*[q]\c
5065 .      doc-finish-reference
5066 .    \}
5067 .    el \{\
5068 .      nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font]\c
5069 .      doc-finish-reference
5070 .  \}\}
5072 .  if \n[doc-book-count] \{\
5073 .    nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font]\c
5074 .    doc-finish-reference
5075 .  \}
5077 .  if \n[doc-publisher-count] \{\
5078 .    nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font]\c
5079 .    doc-finish-reference
5080 .  \}
5082 .  if \n[doc-journal-count] \{\
5083 .    nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font]\c
5084 .    doc-finish-reference
5085 .  \}
5087 .  if \n[doc-report-count] \{\
5088 .    nop \&\*[doc-report-name]\c
5089 .    doc-finish-reference
5090 .  \}
5092 .  if \n[doc-issue-count] \{\
5093 .    nop \&\*[doc-issue-name]\c
5094 .    doc-finish-reference
5095 .  \}
5097 .  if \n[doc-volume-count] \{\
5098 .    nop \&\*[doc-volume-name]\c
5099 .    doc-finish-reference
5100 .  \}
5102 .  if \n[doc-page-number-count] \{\
5103 .    nop \&\*[doc-page-number-string]\c
5104 .    doc-finish-reference
5105 .  \}
5107 .  if \n[doc-corporate-count] \{\
5108 .    nop \&\*[doc-corporate-name]\c
5109 .    doc-finish-reference
5110 .  \}
5112 .  if \n[doc-date-count] \{\
5113 .    nop \&\*[doc-date]\c
5114 .    doc-finish-reference
5115 .  \}
5117 .  if \n[doc-optional-count] \{\
5118 .    nop \&\*[doc-optional-string]\c
5119 .    doc-finish-reference
5120 .  \}
5122 .  if \n[doc-reference-count] \
5123 .    tm mdoc warning: unresolved reference problem
5127 .\" NS doc-authors-processed global register
5128 .\" NS   author references processed so far
5130 .nr doc-authors-processed 0
5133 .\" NS doc-print-reference-authors macro
5134 .\" NS   print out reference authors
5135 .\" NS
5136 .\" NS modifies:
5137 .\" NS   doc-authors-processed
5139 .de doc-print-reference-authors
5140 .  nr doc-authors-processed +1
5141 .  ie (\n[doc-author-count] == \n[doc-authors-processed]) \
5142 .    nop \&and \*[doc-author-name\n[doc-authors-processed]],
5143 .  el \{\
5144 .    nop \&\*[doc-author-name\n[doc-authors-processed]],
5145 .    doc-print-reference-authors
5146 .  \}
5150 .\" NS doc-author-count global register
5151 .\" NS   counter of author references
5153 .nr doc-author-count 0
5156 .\" NS doc-author-nameXXX global string
5157 .\" NS   array of author names
5158 .\" NS
5159 .\" NS   limit: doc-author-count
5161 .ds doc-author-name0
5164 .\" NS %A user macro
5165 .\" NS   reference author(s)
5166 .\" NS
5167 .\" NS modifies:
5168 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5169 .\" MS   doc-reference-count, doc-author-count, doc-reference-string-name
5170 .\" NS
5171 .\" NS width register `%A' set in doc-common
5173 .de %A
5174 .  if !\n[doc-arg-limit] \{\
5175 .    ie \n[.$] \{\
5176 .      nr doc-author-count +1
5177 .      nr doc-reference-count +1
5178 .      ds doc-reference-string-name doc-author-name\n[doc-author-count]
5180 .      ds doc-macro-name %A
5181 .      doc-parse-args \$@
5182 .    \}
5183 .    el \
5184 .      tm Usage: .%A author_name (#\n[.c])
5185 .  \}
5187 .  nr doc-arg-ptr +1
5188 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5189 .    nr doc-curr-font \n[.f]
5190 .    nr doc-curr-size \n[.s]
5191 .    doc-do-references
5192 .  \}
5196 .\" NS doc-book-count global register
5197 .\" NS   counter of book references
5199 .nr doc-book-count 0
5202 .\" NS doc-book-name global string
5203 .\" NS   string of collected book references
5205 .ds doc-book-name
5208 .\" NS %B user macro
5209 .\" NS   [reference] book name
5210 .\" NS
5211 .\" NS modifies:
5212 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
5213 .\" NS   doc-curr-size, doc-reference-count, doc-book-count,
5214 .\" NS   doc-reference-string-name
5215 .\" NS
5216 .\" NS width register `%B' set in doc-common
5218 .de %B
5219 .  if !\n[doc-arg-limit] \{\
5220 .    ie \n[.$] \{\
5221 .      if \n[doc-is-reference] \{\
5222 .        nr doc-book-count +1
5223 .        nr doc-reference-count +1
5224 .        ds doc-reference-string-name doc-book-name
5225 .      \}
5227 .      ds doc-macro-name %B
5228 .      doc-parse-args \$@
5229 .    \}
5230 .    el \
5231 .      tm Usage: .%B book_name (#\n[.c])
5232 .  \}
5234 .  nr doc-arg-ptr +1
5235 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5236 .    nr doc-curr-font \n[.f]
5237 .    nr doc-curr-size \n[.s]
5239 .    ie !\n[doc-is-reference] \{\
5240 .      as doc-out-string \*[doc-Em-font]
5241 .      doc-print-recursive
5242 .    \}
5243 .    el \
5244 .      doc-do-references
5245 .  \}
5249 .\" NS doc-date-count global register
5250 .\" NS   counter of date references
5252 .nr doc-date-count 0
5255 .\" NS doc-date global string
5256 .\" NS   string of collected date references
5258 .ds doc-date
5261 .\" NS %D user macro
5262 .\" NS   [reference] date
5263 .\" NS
5264 .\" NS modifies:
5265 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5266 .\" NS   doc-reference-count, doc-date-count, doc-reference-string-name
5267 .\" NS
5268 .\" NS width register `%D' set in doc-common
5270 .de %D
5271 .  if !\n[doc-arg-limit] \{\
5272 .    ie \n[.$] \{\
5273 .      nr doc-date-count +1
5274 .      nr doc-reference-count +1
5275 .      ds doc-reference-string-name doc-date
5277 .      ds doc-macro-name %D
5278 .      doc-parse-args \$@
5279 .    \}
5280 .    el \
5281 .      tm Usage: .%D date (#\n[.c])
5282 .  \}
5284 .  nr doc-arg-ptr +1
5285 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5286 .    nr doc-curr-font \n[.f]
5287 .    nr doc-curr-size \n[.s]
5288 .    doc-do-references
5289 .  \}
5293 .\" NS doc-publisher-count global register
5294 .\" NS   counter of publisher references
5296 .nr doc-publisher-count 0
5299 .\" NS doc-publisher-name global string
5300 .\" NS   string of collected publisher references
5302 .ds doc-publisher-name
5305 .\" NS %I user macro
5306 .\" NS   [reference] issuer/publisher name
5307 .\" NS
5308 .\" NS modifies:
5309 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5310 .\" NS   doc-reference-count, doc-reference-string-name
5311 .\" NS
5312 .\" NS width register `%I' set in doc-common
5314 .de %I
5315 .  if !\n[doc-arg-limit] \{\
5316 .    ie \n[.$] \{\
5317 .      nr doc-publisher-count +1
5318 .      nr doc-reference-count +1
5319 .      ds doc-reference-string-name doc-publisher-name
5321 .      ds doc-macro-name %I
5322 .      doc-parse-args \$@
5323 .    \}
5324 .    el \
5325 .      tm Usage: .%I issuer/publisher_name (#\n[.c])
5326 .  \}
5328 .  nr doc-arg-ptr +1
5329 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5330 .    nr doc-curr-font \n[.f]
5331 .    nr doc-curr-size \n[.s]
5332 .    doc-do-references
5333 .  \}
5337 .\" NS doc-journal-count global register
5338 .\" NS   counter of journal references
5340 .nr doc-journal-count 0
5343 .\" NS doc-journal-name global string
5344 .\" NS   string of collected journal references
5346 .ds doc-journal-name
5349 .\" NS %J user macro
5350 .\" NS   [reference] Journal Name
5351 .\" NS
5352 .\" NS modifies:
5353 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5354 .\" NS   doc-reference-count, doc-journal-count, doc-reference-string-name
5355 .\" NS
5356 .\" NS width register `%J' set in doc-common
5358 .de %J
5359 .  if !\n[doc-arg-limit] \{\
5360 .    ie \n[.$] \{\
5361 .      nr doc-journal-count +1
5362 .      nr doc-reference-count +1
5363 .      ds doc-reference-string-name doc-journal-name
5365 .      ds doc-macro-name %J
5366 .      doc-parse-args \$@
5367 .    \}
5368 .    el \
5369 .      tm Usage: .%J journal_name (#\n[.c])
5370 .  \}
5372 .  nr doc-arg-ptr +1
5373 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5374 .    nr doc-curr-font \n[.f]
5375 .    nr doc-curr-size \n[.s]
5376 .    doc-do-references
5377 .  \}
5381 .\" NS doc-issue-count global register
5382 .\" NS   counter of issue number references
5384 .nr doc-issue-count 0
5387 .\" NS doc-issue-name global string
5388 .\" NS   string of collected issue number references
5390 .ds doc-issue-name
5393 .\" NS %N user macro
5394 .\" NS   [reference] issue number
5395 .\" NS
5396 .\" NS modifies:
5397 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5398 .\" NS   doc-reference-count, doc-issue-count, doc-reference-string-name
5399 .\" NS
5400 .\" NS width register `%N' set in doc-common
5402 .de %N
5403 .  if !\n[doc-arg-limit] \{\
5404 .    ie \n[.$] \{\
5405 .      nr doc-issue-count +1
5406 .      nr doc-reference-count +1
5407 .      ds doc-reference-string-name doc-issue-name
5409 .      ds doc-macro-name %N
5410 .      doc-parse-args \$@
5411 .    \}
5412 .    el \
5413 .      tm Usage: .%N issue_number (#\n[.c])
5414 .  \}
5416 .  nr doc-arg-ptr +1
5417 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5418 .    nr doc-curr-font \n[.f]
5419 .    nr doc-curr-size \n[.s]
5420 .    doc-do-references
5421 .  \}
5425 .\" NS doc-optional-count global register
5426 .\" NS   counter of optional information references
5428 .nr doc-optional-count 0
5431 .\" NS doc-optional-string global string
5432 .\" NS   string of collected optional information references
5434 .ds doc-optional-string
5437 .\" NS %O user macro
5438 .\" NS   [reference] optional information
5439 .\" NS
5440 .\" NS modifies:
5441 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5442 .\" NS   doc-reference-count, doc-optional-count, doc-reference-string-name
5443 .\" NS
5444 .\" NS width register `%O' set in doc-common
5446 .de %O
5447 .  if !\n[doc-arg-limit] \{\
5448 .    ie \n[.$] \{\
5449 .      nr doc-optional-count +1
5450 .      nr doc-reference-count +1
5451 .      ds doc-reference-string-name doc-optional-string
5453 .      ds doc-macro-name %O
5454 .      doc-parse-args \$@
5455 .    \}
5456 .    el \
5457 .      tm Usage: .%O optional_information ... \*[doc-punct-chars] (#\n[.c])
5458 .  \}
5460 .  nr doc-arg-ptr +1
5461 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5462 .    nr doc-curr-font \n[.f]
5463 .    nr doc-curr-size \n[.s]
5464 .    doc-do-references
5465 .  \}
5469 .\" NS doc-page-number-count global register
5470 .\" NS   counter of page number references
5472 .nr doc-page-number-count 0
5475 .\" NS doc-page-number-string global string
5476 .\" NS   string of collected page number references
5478 .ds doc-page-number-string
5481 .\" NS %P user macro
5482 .\" NS   [reference] page numbers
5483 .\" NS
5484 .\" NS modifies:
5485 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5486 .\" NS   doc-reference-count, doc-page-number-count, doc-reference-string-name
5487 .\" NS
5488 .\" NS width register `%P' set in doc-common
5490 .de %P
5491 .  if !\n[doc-arg-limit] \{\
5492 .    ie \n[.$] \{\
5493 .      nr doc-page-number-count +1
5494 .      nr doc-reference-count +1
5495 .      ds doc-reference-string-name doc-page-number-string
5497 .      ds doc-macro-name %P
5498 .      doc-parse-args \$@
5499 .    \}
5500 .    el \
5501 .      tm Usage: .%P page_numbers ... \*[doc-punct-chars] (#\n[.c])
5502 .  \}
5504 .  nr doc-arg-ptr +1
5505 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5506 .    nr doc-curr-font \n[.f]
5507 .    nr doc-curr-size \n[.s]
5508 .    doc-do-references
5509 .  \}
5513 .\" NS doc-corporate-count global register
5514 .\" NS   counter of corporate references
5516 .nr doc-corporate-count 0
5519 .\" NS doc-corporate-name global string
5520 .\" NS   string of collected corporate references
5522 .ds doc-corporate-name
5525 .\" NS %Q user macro
5526 .\" NS   corporate or foreign author
5527 .\" NS
5528 .\" NS modifies:
5529 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5530 .\" NS   doc-reference-count, doc-corporate-count, doc-reference-string-name
5531 .\" NS
5532 .\" NS width register `%Q' set in doc-common
5534 .de %Q
5535 .  if !\n[doc-arg-limit] \{\
5536 .    ie \n[.$] \{\
5537 .      nr doc-corporate-count +1
5538 .      nr doc-reference-count +1
5539 .      ds doc-reference-string-name doc-corporate-name
5541 .      ds doc-macro-name %Q
5542 .      doc-parse-args \$@
5543 .    \}
5544 .    el \
5545 .      tm Usage: .%Q corporate_or_foreign_author (#\n[.c])
5546 .  \}
5548 .  nr doc-arg-ptr +1
5549 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5550 .    nr doc-curr-font \n[.f]
5551 .    nr doc-curr-size \n[.s]
5552 .    doc-do-references
5553 .  \}
5557 .\" NS doc-report-count global register
5558 .\" NS   counter of report references
5560 .nr doc-report-count 0
5563 .\" NS doc-report-name global string
5564 .\" NS   string of collected report references
5566 .ds doc-report-name
5569 .\" NS %R user macro
5570 .\" NS   [reference] report name
5571 .\" NS
5572 .\" NS modifies:
5573 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5574 .\" NS   doc-reference-count, doc-report-count, doc-reference-string-name
5575 .\" NS
5576 .\" NS width register `%R' set in doc-common
5578 .de %R
5579 .  if !\n[doc-arg-limit] \{\
5580 .    ie \n[.$] \{\
5581 .      nr doc-report-count +1
5582 .      nr doc-reference-count +1
5583 .      ds doc-reference-string-name doc-report-name
5585 .      ds doc-macro-name %R
5586 .      doc-parse-args \$@
5587 .    \}
5588 .    el \
5589 .      tm Usage: .%R reference_report (#\n[.c])
5590 .  \}
5592 .  nr doc-arg-ptr +1
5593 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5594 .    nr doc-curr-font \n[.f]
5595 .    nr doc-curr-size \n[.s]
5596 .    doc-do-references
5597 .  \}
5601 .\" NS doc-reference-title-count global register
5602 .\" NS   counter of reference title references
5604 .nr doc-reference-title-count 0
5607 .\" NS doc-reference-title-name global string
5608 .\" NS   string of collected reference title references
5610 .ds doc-reference-title-name
5613 .\" NS %T user macro
5614 .\" NS   reference title
5615 .\" NS
5616 .\" NS modifies:
5617 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
5618 .\" NS   doc-curr-size, doc-reference-count, doc-reference-title-count,
5619 .\" NS   doc-reference-string-name
5620 .\" NS
5621 .\" NS width register `%T' set in doc-common
5623 .de %T
5624 .  if !\n[doc-arg-limit] \{\
5625 .    ie \n[.$] \{\
5626 .      if \n[doc-is-reference] \{\
5627 .        nr doc-reference-title-count +1
5628 .        nr doc-reference-count +1
5629 .        ds doc-reference-string-name doc-reference-title-name
5630 .      \}
5632 .      ds doc-macro-name %T
5633 .      doc-parse-args \$@
5634 .    \}
5635 .    el \
5636 .      tm Usage: .%T reference_title (#\n[.c])
5637 .  \}
5639 .  nr doc-arg-ptr +1
5640 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5641 .    nr doc-curr-font \n[.f]
5642 .    nr doc-curr-size \n[.s]
5643 .    ie \n[doc-is-reference] \
5644 .      doc-do-references
5645 .    el \{\
5646 .      as doc-out-string \*[doc-Em-font]
5647 .      doc-print-recursive
5648 .  \}\}
5652 .\" NS doc-volume-count global register
5653 .\" NS   counter of reference title references
5655 .nr doc-volume-count 0
5658 .\" NS doc-volume-name global string
5659 .\" NS   string of collected volume references
5661 .ds doc-volume-name
5664 .\" NS %V user macro
5665 .\" NS   reference volume
5666 .\" NS
5667 .\" NS modifies:
5668 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5669 .\" NS   doc-reference-count, doc-volume-count, doc-reference-string-name
5670 .\" NS
5671 .\" NS width register `%V' set in doc-common
5673 .de %V
5674 .  if !\n[doc-arg-limit] \{\
5675 .    ie \n[.$] \{\
5676 .      ds doc-macro-name %V
5677 .      nr doc-volume-count +1
5678 .      nr doc-reference-count +1
5679 .      ds doc-reference-string-name doc-volume-name
5680 .      doc-parse-args \$@
5681 .    \}
5682 .    el \
5683 .      tm Usage: .%V volume , ... \*[doc-punct-chars] (#\n[.c])
5684 .  \}
5686 .  nr doc-arg-ptr +1
5687 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5688 .    nr doc-curr-font \n[.f]
5689 .    nr doc-curr-size \n[.s]
5690 .    doc-do-references
5691 .  \}
5695 .\" NS doc-do-references macro
5696 .\" NS   reference recursion routine
5697 .\" NS
5698 .\" NS modifies:
5699 .\" NS   doc-arg-ptr, doc-out-string, doc-reference-string-name,
5700 .\" NS   doc-journal-name, doc-issue-name, doc-optional-string,
5701 .\" NS   doc-corporate-name, doc-report-name, doc-reference-title-name,
5702 .\" NS   doc-volume-name, doc-date, doc-page-number-string, doc-book-name
5703 .\" NS
5704 .\" NS local variables:
5705 .\" NS   doc-reg-ddr, doc-reg-ddr1
5707 .de doc-do-references
5708 .  hy 0
5710 .  nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
5712 .  ie (\n[doc-reg-ddr1] == 1) \{\
5713 .    \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
5714 .    ie "\*[doc-arg\n[doc-arg-ptr]]"Tn" \
5715 .      doc-reference-trademark
5716 .    el \{\
5717 .      doc-append-arg doc-do-references 1
5718 .      \*[doc-arg\n[doc-arg-ptr]]
5719 .  \}\}
5720 .  el \{\
5721 .    nr doc-reg-ddr \n[doc-arg-ptr]
5722 .    as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
5724 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
5725 .      as \*[doc-reference-string-name] \&\*[doc-out-string]
5726 .      ds doc-out-string
5727 .      ds doc-reference-string-name
5728 .      doc-reset-args
5729 .    \}
5730 .    el \{\
5731 .      nr doc-arg-ptr +1
5732 .      as doc-out-string "\*[doc-space\n[doc-reg-ddr]]
5733 .      doc-do-references
5734 .  \}\}
5738 .\" NS Hf user macro
5739 .\" NS   source include header files.
5740 .\" NS
5741 .\" NS modifies:
5742 .\" NS   doc-curr-font, doc-curr-size
5743 .\" NS
5744 .\" NS width register `Hf' set in doc-common
5746 .de Hf
5747 .  doc-paragraph
5748 .  nop File:
5749 .  Pa \$1
5750 .  doc-paragraph
5752 .  nr doc-curr-font \n[.f]
5753 .  nr doc-curr-size \n[.s]
5755 .  ie t \{\
5756 .    nop \*[doc-Li-font]
5757 .    br
5758 .    ta T 9n
5759 .  \}
5760 .  el \
5761 .    ta T 8n
5763 .  nf
5764 .  so \$1
5765 .  fi
5767 .  ft \n[doc-curr-font]
5768 .  ps \n[doc-curr-size]
5769 .  doc-paragraph
5773 .\" NS doc-have-author global register (bool)
5774 .\" NS   set in `An'
5776 .nr doc-have-author 0
5779 .\" NS An user macro
5780 .\" NS   author name
5781 .\" NS
5782 .\" NS modifies:
5783 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5784 .\" NS   doc-have-author
5785 .\" NS
5786 .\" NS width register `An' set in doc-common
5788 .de An
5789 .  if !\n[doc-arg-limit] \{\
5790 .    ie \n[.$] \{\
5791 .      ie        "\$1"-nosplit" \
5792 .        nr doc-in-authors-section 0
5793 .      el \{ .ie "\$1"-split" \
5794 .        nr doc-in-authors-section 1
5795 .      el \{\
5796 .        ds doc-macro-name An
5797 .        doc-parse-args \$@
5798 .    \}\}\}
5799 .    el \
5800 .      tm Usage: .An author_name ... \*[doc-punct-chars] (#\n[.c])
5801 .  \}
5803 .  if \n[doc-in-authors-section] \{\
5804 .    ie \n[doc-have-author] \
5805 .      br
5806 .    el \
5807 .      nr doc-have-author 1
5808 .  \}
5810 .  nr doc-arg-ptr +1
5811 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5812 .    nr doc-curr-font \n[.f]
5813 .    nr doc-curr-size \n[.s]
5814 .    doc-print-recursive
5815 .  \}
5819 .\" NS Sf user macro
5820 .\" NS   defunct
5821 .\" NS
5822 .\" NS width register `Sf' set in doc-common
5824 .de Sf
5825 .  tm mdoc error: .Sf defunct, use .Pf or .Ns (#\n[.c])
5829 .ds doc-func-error-string "function returns the value\~0 if successful;
5830 .as doc-func-error-string " otherwise the value\~-1 is returned and
5831 .as doc-func-error-string " the global variable \*[doc-Va-font]errno\f[P]
5832 .as doc-func-error-string " is set to indicate the error.
5835 .\" NS Rv user macro
5836 .\" NS   return values
5837 .\" NS
5838 .\" NS width register `Rv' set in doc-common
5839 .\" NS
5840 .\" NS local variables:
5841 .\" NS   doc-str-Rv
5843 .de Rv
5845 .\" XXX: what does this function without `-std'?
5847 .  ie !\n[.$] \
5848 .    tm Usage: .Rv [-std] (#\n[.c])
5849 .  el \{\
5850 .    \" .ds doc-macro-name Rv
5851 .    \" .nr doc-arg-ptr 0
5852 .    \" .nr lR +1
5853 .    \" .ds doc-arg1 \$2
5854 .    \" .ds doc-arg2 \$3
5855 .    \" .ds doc-arg3 \$4
5856 .    \" .ds doc-arg4 \$5
5857 .    \" .ds doc-arg5 \$6
5858 .    \" .ds doc-arg6 \$7
5859 .    \" .ds doc-arg7 \$8
5860 .    \" .ds doc-arg8 \$9
5861 .    \" .
5862 .    \" .nr doc-num-args (\n[.$] - 1)
5864 .    if "\$1"-std" \{\
5865 .      doc-reg-Rv \*[doc-section]
5866 .      if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
5867 .        tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
5868 .      br
5869 .      nop \&The
5870 .      Fn \$2
5871 .      nop \&\*[doc-func-error-string]
5872 .  \}\}
5876 .\" NS Mt user macro
5877 .\" NS   mailto (for conversion to HTML)
5879 .de Mt
5880 .  \" XXX: error handling missing
5881 .  Pa \$@
5885 .\" NS Lk user macro
5886 .\" NS   link (for conversion to HTML)
5887 .\" NS
5888 .\" NS local variables:
5889 .\" NS   doc-str-Lk, doc-reg-Lk
5891 .de Lk
5892 .  ds doc-str-Lk Sy \$@
5894 .  ie (\n[.$] > 1) \{\
5895 .    doc-get-arg-type \$2
5896 .    ie (\[doc-arg-type] < 3) \{\
5897 .      Em \&\$2:
5898 .      ds doc-str-Lk Sy "\$1"
5899 .      doc-get-width "\$1"
5900 .      shift 2
5901 .      if \n[.$] \
5902 .        as doc-str-Lk " \$@
5903 .    \}
5904 .    el \
5905 .      doc-get-width "\$1"
5906 .  \}
5907 .  el \
5908 .    doc-get-width "\$1"
5910 .  ie n \
5911 .    nr doc-reg-Lk 26
5912 .  el \
5913 .    nr doc-reg-Lk 38
5914 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
5915 .    D1 \*[doc-str-Lk]
5916 .  el \
5917 .    \*[doc-str-Lk]
5921 .rn em e@
5923 .de em
5924 .  tm mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
5925 .  ab Should this have been `.Em ...'?
5929 .\" NS doc-empty-line macro
5930 .\" NS   emit warning and print empty line
5932 .de doc-empty-line
5933 .  if !"\*[doc-macro-name]"Bd" \
5934 .    tm mdoc warning: Empty input line #\n[.c]!
5935 .  sp
5938 .blm doc-empty-line
5944 .\" load local modifications
5945 .mso mdoc.local
5947 .\" EOF