internal update
[s-roff.git] / tmac / tmac.doc.new
blobbf9e2cab7338cba303f12d45ca47330befd8a789
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.
43 .if !\n(.g \
44 .  ab This version of mdoc can be run with groff only!
47 .cp 0
49 .eo
52 .\" Load start-up files
53 .ie t .mso mdoc/doc-ditroff.new
54 .el   .mso mdoc/doc-nroff.new
56 .mso mdoc/doc-common.new
57 .mso mdoc/doc-syms.new
60 .\" NS doc-inline-debug user register (bool)
61 .\" NS   inline debug mode (inline if 1, to stderr if 0 (default))
63 .if !r doc-inline-debug .nr doc-inline-debug 0
66 .\" NS doc-debug global register (bool)
67 .\" NS   debug mode (1 if active, 0 otherwise (default))
69 .nr doc-debug 0
72 .\" NS Db macro
73 .\" NS   start/stop debug mode (`.Db'/`.Db on'/`.Db off')
74 .\" NS
75 .\" NS   without argument, toggle debug status
76 .\" NS
77 .\" NS modifies:
78 .\" NS   doc-debug
80 .de Db
81 .  ie \n[.$] \{\
82 .    ie "\$1"on" \{\
83 .      tm DEBUGGING ON
84 .      nr doc-debug 1
85 .    \}
86 .    el \{\
87 .      ie "\$1"off" \{\
88 .        tm DEBUGGING OFF
89 .        nr doc-debug 0
90 .      \}
91 .      el \
92 .        tm Usage: .Db [on | off] (#\n[.c])
93 .  \}\}
94 .  el \{\
95 .    ie \n[doc-debug] \{\
96 .      tm DEBUGGING OFF
97 .      nr doc-debug 0
98 .    \}
99 .    el \{\
100 .      tm DEBUGGING ON
101 .      nr doc-debug 1
102 .  \}\}
106 .\" NS doc-macro-name global string
107 .\" NS   name of calling request (set in each user-requestable macro)
109 .ds doc-macro-name
112 .\" NS doc-arg-limit global register
113 .\" NS   total number of arguments
115 .nr doc-arg-limit 0
118 .\" NS doc-num-args global register
119 .\" NS   number of arguments to handle (must be set to \n[.$] prior to
120 .\" NS   `doc-parse-arg-vector' request)
122 .nr doc-num-args 0
125 .\" NS doc-arg-ptr global register
126 .\" NS   argument pointer
128 .nr doc-arg-ptr 0
131 .\" NS doc-argXXX global string
132 .\" NS   argument vector
133 .\" NS
134 .\" NS   limit: doc-arg-limit
136 .ds doc-arg1
139 .\" NS doc-typeXXX global string
140 .\" NS   argument type vector (`macro', `string', `punct-suffix',
141 .\" NS   `punct-prefix')
142 .\" NS
143 .\" NS   limit: doc-arg-limit
145 .ds doc-type1
148 .\" NS doc-spaceXXX global string
149 .\" NS   space vector
150 .\" NS
151 .\" NS   limit: doc-arg-limit
153 .ds doc-space1
156 .\" NS doc-out-string global string
157 .\" NS   main working buffer
159 .ds doc-out-string
162 .\" NS doc-curr-space global string
163 .\" NS   current space string
165 .ds doc-curr-space
168 .\" NS doc-parse-args macro
169 .\" NS   parse arguments (recursively) (`.doc-parse-args arg ...')
170 .\" NS
171 .\" NS modifies:
172 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX, doc-arg-limit,
173 .\" NS   doc-arg-ptr, doc-out-string, doc-curr-space
174 .\" NS
175 .\" NS local variables:
176 .\" NS   doc-str-dpa, doc-reg-dpa, doc-reg-dpa1
178 .de doc-parse-args
179 .  nr doc-arg-limit +1
181 .  \" handle `|' specially for some requests
182 .  ie "\$1"|" \{\
183 .    ie        "\*[doc-macro-name]"Op" \
184 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
185 .    el \{ .ie "\*[doc-macro-name]"Ar" \
186 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
187 .    el \{ .ie "\*[doc-macro-name]"Fl" \
188 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
189 .    el \{ .ie "\*[doc-macro-name]"Cm" \
190 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
191 .    el \{ .ie "\*[doc-macro-name]"It" \
192 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
193 .    el \
194 .      ds doc-arg\n[doc-arg-limit] |
195 .  \}\}\}\}\}
196 .  el \
197 .    ds doc-arg\n[doc-arg-limit] "\$1
199 .  \" get argument type and set spacing
200 .  doc-get-arg-type* \n[doc-arg-limit]
201 .  ds doc-type\n[doc-arg-limit] \*[doc-arg-type]
202 .  doc-set-spacing-for-\*[doc-arg-type]
204 .  if \n[doc-debug] \{\
205 .    ie "\*[doc-arg-type]"macro" \
206 .      ds doc-str-dpa macro
207 .    el \{\
208 .      ie "\*[doc-arg-type]"string" \
209 .        ds doc-str-dpa string
210 .      el \{\
211 .        ie "\*[doc-arg-type]"punct-suffix" \
212 .          ds doc-str-dpa closing punctuation or suffix
213 .        el \
214 .          ds doc-str-dpa opening punctuation or prefix
215 .    \}\}
217 .    ie \n[doc-inline-debug] \{\
218 .      br
219 .      nr doc-reg-dpa \n[.i]u
220 .      in -\n[doc-reg-dpa]u
222 .      if (\n[doc-arg-limit] == 1) \{\
223 .        nop \f[B]DEBUG(doc-parse-args) MACRO:\f[P] `.\*[doc-macro-name]'
224 .        nop \& \f[B]Line #:\f[P] \n[.c]
225 .      \}
226 .      nop \t\f[B]Argc:\f[P] \n[doc-arg-limit]
227 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-arg-limit]]'
228 .      nop \ \f[B]Length:\f[P] \n[doc-width]
229 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-arg-limit]]'
230 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpa]
231 .    \}
232 .    el \{\
233 .      if (\n[doc-arg-limit] == 1) \{\
234 .        tmc "DEBUG (doc-parse-args)
235 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
236 .      \}
237 .      tmc "  Argc: \n[doc-arg-limit]
238 .      tmc "  Argv: `\*[doc-arg\n[doc-arg-limit]]'
239 .      tm1 "  Length: \n[doc-width]
240 .      tmc "  Space: `\*[doc-space\n[doc-arg-limit]]'
241 .      tm1 "  Type: \*[doc-str-dpa]
242 .  \}\}
244 .  \" check whether we have processed the last parameter
245 .  ie (\n[.$] == 1) \{\
246 .    nr doc-arg-ptr 0
248 .    ie \n[doc-in-diversion] \{\
249 .      if (\n[doc-nesting-level] > 1) \
250 .        as doc-out-string "\*[doc-curr-space]
251 .    \}
252 .    el \{\
253 .      if \n[doc-nesting-level] \
254 .        if !\n[doc-func-arg-count] \
255 .          as doc-out-string "\*[doc-curr-space]
256 .    \}
258 .    \" use space after last parameter as the current one
259 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
261 .    if \n[doc-debug] \{\
262 .      nr doc-reg-dpa1 1
264 .      ie \n[doc-inline-debug] \{\
265 .        nop MACRO REQUEST: \t.\*[doc-macro-name]
266 .        while (\n[doc-reg-dpa1] <= \n[doc-arg-limit]) \{\
267 .          nop "\*[doc-arg\n[doc-reg-dpa1]]"
268 .          nr doc-reg-dpa1 +1
269 .        \}
270 .        br
271 .        in \n[doc-reg-dpa]u
272 .      \}
273 .      el \{\
274 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
275 .        while (\n[doc-reg-dpa1] <= \n[doc-arg-limit]) \{\
276 .          tmc " "\*[doc-arg\n[doc-reg-dpa1]]"
277 .          nr doc-reg-dpa1 +1
278 .        \}
279 .        tm
280 .  \}\}\}
281 .  el \{\
282 .    shift
283 .    doc-parse-args \$@
284 .  \}
288 .\" NS doc-parse-arg-vector macro
289 .\" NS   parse argument vector (recursive)
290 .\" NS
291 .\" NS modifies:
292 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX, doc-arg-limit,
293 .\" NS   doc-num-args, doc-arg-ptr, doc-out-string, doc-curr-space
294 .\" NS
295 .\" NS local variables:
296 .\" NS   doc-str-dpav, doc-reg-dpav, doc-reg-dpav1
298 .de doc-parse-arg-vector
299 .  nr doc-arg-limit +1
301 .  \" handle `|' specially for some requests
302 .  if "\*[doc-arg\n[doc-arg-limit]]"|" \{\
303 .    ie        "\*[doc-macro-name]"Op" \
304 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
305 .    el \{ .ie "\*[doc-macro-name]"Ar" \
306 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
307 .    el \{ .ie "\*[doc-macro-name]"Fl" \
308 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
309 .    el \{ .ie "\*[doc-macro-name]"Cm" \
310 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
311 .    el \{ .if "\*[doc-macro-name]"It" \
312 .      ds doc-arg\n[doc-arg-limit] \f[R]|\f[P]
313 .  \}\}\}\}\}
315 .  \" get argument type and set spacing
316 .  doc-get-arg-type* \n[doc-arg-limit]
317 .  ds doc-type\n[doc-arg-limit] \*[doc-arg-type]
318 .  doc-set-spacing-for-\*[doc-arg-type]
320 .  if \n[doc-debug] \{\
321 .    ie "\*[doc-arg-type]"macro" \
322 .      ds doc-str-dpav macro
323 .    el \{\
324 .      ie "\*[doc-arg-type]"string" \
325 .        ds doc-str-dpav string
326 .      el \{\
327 .        ie "\*[doc-arg-type]"punct-suffix" \
328 .          ds doc-str-dpav closing punctuation or suffix
329 .        el \
330 .          ds doc-str-dpav opening punctuation or prefix
331 .    \}\}
333 .    ie \n[doc-inline-debug] \{\
334 .      br
335 .      nr doc-reg-dpav \n[.i]u
336 .      in -\n[doc-reg-dpav]u
338 .      if (\n[doc-arg-limit] == 1) \{\
339 .        nop \f[B]DEBUG(doc-parse-arg-vector)
340 .        nop MACRO:\f[P] `.\*[doc-macro-name]'
341 .        nop \& \f[B]Line #:\f[P] \n[.c]
342 .      \}
343 .      nop \t\f[B]Argc:\f[P] \n[doc-arg-limit]
344 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-arg-limit]]'
345 .      nop \ \f[B]Length:\f[P] \n[doc-width]
346 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-arg-limit]]'
347 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpav]
348 .    \}
349 .    el \{\
350 .      if (\n[doc-arg-limit] == 1) \{\
351 .        tmc "DEBUG(doc-parse-arg-vector)
352 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
353 .      \}
354 .      tmc "  Argc: \n[doc-arg-limit]
355 .      tmc "  Argv: `\*[doc-arg\n[doc-arg-limit]]'
356 .      tm1 "  Length: \n[doc-width]
357 .      tmc "  Space: `\*[doc-space\n[doc-arg-limit]]'
358 .      tm1 "  Type: \*[doc-str-dpav]
359 .  \}\}
361 .  \" check whether we have processed the last parameter
362 .  ie (\n[doc-num-args] == 1) \{\
363 .    nr doc-arg-ptr 0
365 .    ie \n[doc-in-diversion] \{\
366 .      if (\n[doc-nesting-level] > 1) \
367 .        as doc-out-string "\*[doc-curr-space]
368 .    \}
369 .    el \{\
370 .      if \n[doc-nesting-level] \
371 .        if !\n[doc-func-arg-count] \
372 .          as doc-out-string "\*[doc-curr-space]
373 .    \}
375 .    \" use space after last parameter as the current one
376 .    ds doc-curr-space "\*[doc-space\n[doc-arg-limit]]
378 .    nr doc-num-args 0
380 .    if \n[doc-debug] \{\
381 .      nr doc-reg-dpav1 1
383 .      ie \n[doc-inline-debug] \{\
384 .        nop \tMACRO REQUEST: .\*[doc-macro-name]
385 .        while (\n[doc-reg-dpav1] <= \n[doc-arg-limit]) \{\
386 .          nop "\*[doc-arg\n[doc-reg-dpav1]]"
387 .          nr doc-reg-dpav1 +1
388 .        \}
389 .        br
390 .        in \n[doc-reg-dpav]u
391 .      \}
392 .      el \{\
393 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
394 .        while (\n[doc-reg-dpav1] <= \n[doc-arg-limit]) \{\
395 .          tmc " "\*[doc-arg\n[doc-reg-dpav1]]"
396 .          nr doc-reg-dpav1 +1
397 .        \}
398 .        tm
399 .  \}\}\}
400 .  el \{\
401 .    nr doc-num-args -1
402 .    doc-parse-arg-vector
403 .  \}
407 .\" NS doc-remaining-args macro
408 .\" NS   output remaining arguments as-is, separated by spaces (until
409 .\" NS   `doc-num-args' is exhausted), to `doc-out-string'
410 .\" NS
411 .\" NS modifies:
412 .\" NS   doc-num-args, doc-arg-ptr, doc-out-string
414 .de doc-remaining-args
415 .  nr doc-arg-ptr +1
416 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
418 .  ie (\n[doc-num-args] == 1) \{\
419 .    nr doc-arg-ptr 0
420 .    nr doc-num-args 0
421 .  \}
422 .  el \{\
423 .    as doc-out-string "\*[doc-space]
424 .    nr doc-num-args -1
425 .    doc-remaining-args
426 .  \}
430 .\" NS doc-append-arg macro
431 .\" NS   append one argument to argument vector:
432 .\" NS   `.doc-append-arg [arg] [type]'
433 .\" NS
434 .\" NS modifies:
435 .\" NS   doc-argXXX, doc-typeXXX, doc-arg-limit
437 .de doc-append-arg
438 .  nr doc-arg-limit +1
439 .  ds doc-arg\n[doc-arg-limit] "\$1
440 .  ds doc-type\n[doc-arg-limit] \$2
441 .  doc-set-spacing-for-\$2
445 .\" NS doc-print-and-reset macro
446 .\" NS   print doc-out-string and clean up argument vectors
448 .de doc-print-and-reset
449 .  doc-print-out-string
450 .  doc-reset-args
454 .\" NS doc-reset-args macro
455 .\" NS   reset argument counters
456 .\" NS
457 .\" NS modifies:
458 .\" NS   doc-arg-limit, doc-arg-ptr
460 .de doc-reset-args
461 .  nr doc-arg-limit 0
462 .  nr doc-arg-ptr 0
466 .\" NS doc-print-out-string macro
467 .\" NS   print `doc-out-string', possibly ending a diversion, enabling
468 .\" NS   hyphenation afterwards
469 .\" NS
470 .\" NS modifies:
471 .\" NS   doc-out-string, doc-curr-space
473 .de doc-print-out-string
474 .  ie \n[doc-in-diversion] \{\
475 .    if (\n[doc-nesting-level] == 1) \{\
476 .      if !\n[doc-no-printing] \{\
477 .        nop \&\*[doc-out-string]
478 .        ds doc-curr-space
479 .        ds doc-out-string
480 .    \}\}
481 .    if !\n[doc-nesting-level] \
482 .      doc-end-diversion-and-print
483 .  \}
484 .  el \{\
485 .    ie \n[doc-nesting-level] \{\
486 .      if \n[doc-space-mode] \
487 .        if !\n[doc-list-immediate] \
488 .          doc-save-and-divert
489 .    \}
490 .    el \{\
491 .      if !\n[doc-no-printing] \{\
492 .        nop \&\*[doc-out-string]
493 .        ds doc-curr-space
494 .        ds doc-out-string
495 .  \}\}\}
497 .  hy
501 .\" NS doc-diversion diversion
502 .\" NS   diversion string
505 .\" NS doc-saved-out-string global string
506 .\" NS   saved doc-out-string
508 .ds doc-saved-out-string
511 .\" NS doc-in-diversion global register (bool)
512 .\" NS   whether we are in a diversion
514 .nr doc-in-diversion 0
517 .\" NS doc-save-and-divert macro
518 .\" NS   save doc-out-string, restore fill mode, and divert
519 .\" NS
520 .\" NS modifies:
521 .\" NS   doc-out-string, doc-saved-out-string, doc-diversion,
522 .\" NS   doc-in-diversion
524 .de doc-save-and-divert
525 .  nr doc-in-diversion 1
526 .  ds doc-saved-out-string "\*[doc-out-string]
527 .  ds doc-out-string
528 .  ev doc-divert-environment
529 .  fi
531 .  if \n[doc-debug] \
532 .    tm begin of `doc-diversion' at line #\n[.c]
533 .  di doc-diversion
537 .\" NS doc-end-diversion-and-print macro
538 .\" NS   end diversion and print
539 .\" NS
540 .\" NS modifies:
541 .\" NS   doc-out-string, doc-in-diversion
542 .\" NS
543 .\" NS local variables:
544 .\" NS   doc-str-dedap
546 .de doc-end-diversion-and-print
547 .  br
548 .  di
549 .  ev
551 .  \" insert diversion only if it contains printable stuff
552 .  ie \n[dn] \{\
553 .    ds doc-str-dedap \&\*[doc-diversion]\c
554 .    ds doc-out-string "\*[doc-saved-out-string]\*[doc-str-dedap]\*[doc-out-string]
555 .  \}
556 .  el \
557 .    ds doc-out-string "\*[doc-saved-out-string]\*[doc-out-string]
559 .  nop \&\*[doc-out-string]
561 .  ds doc-out-string
562 .  nr doc-in-diversion 0
568 .\" NS doc-curr-font global register
569 .\" NS   saved current font
571 .nr doc-curr-font \n[.f]
574 .\" NS doc-curr-size global register
575 .\" NS   saved current font size
577 .nr doc-curr-size \n[.s]
582 .\" NS Fl user macro
583 .\" NS   handle flags (appends `-' and prints flags): `.Fl [arg ...]'
584 .\" NS
585 .\" NS modifies:
586 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
587 .\" NS   doc-curr-size
588 .\" NS
589 .\" NS local variables:
590 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
591 .\" NS
592 .\" NS width register `Fl' set in doc-common
594 .de Fl
595 .  as doc-out-string \*[doc-Fl-font]
597 .  if !\n[doc-arg-limit] \{\
598 .    ie \n[.$] \{\
599 .      ds doc-macro-name Fl
600 .      doc-parse-args \$@
601 .    \}
602 .    el \{\
603 .      \" no arguments
604 .      as doc-out-string \|\-\|\f[P]\s[0]
605 .      doc-print-out-string
606 .  \}\}
608 .  if \n[doc-arg-limit] \{\
609 .    nr doc-arg-ptr +1
610 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
611 .      \" last argument
612 .      as doc-out-string \|\-\f[P]\s[0]
613 .      doc-print-and-reset
614 .    \}
615 .    el \{\
616 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
617 .        as doc-out-string \|\-\f[P]\s[0]
618 .        \*[doc-arg\n[doc-arg-ptr]]
619 .      \}
620 .      el \{\
621 .        nr doc-curr-font \n[.f]
622 .        nr doc-curr-size \n[.s]
624 .        if "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \
625 .          as doc-out-string \|\-\|
627 .        nr doc-reg-Fl 1
628 .        doc-flag-recursion
629 .  \}\}\}
633 .\" NS doc-flag-recursion macro
634 .\" NS   `Fl' flag recursion routine (special handling)
635 .\" NS
636 .\" NS modifies:
637 .\" NS   doc-arg-ptr, doc-out-string
638 .\" NS
639 .\" NS local variables:
640 .\" NS   doc-str-dfr, doc-str-dfr1, doc-reg-dfr
642 .de doc-flag-recursion
643 .  ds doc-str-dfr \*[doc-type\n[doc-arg-ptr]]
644 .  ds doc-str-dfr1 "\*[doc-arg\n[doc-arg-ptr]]
646 .  hy 0
648 .  ie "\*[doc-str-dfr]"macro" \{\
649 .    as doc-out-string \f[P]\s[0]
650 .    \*[doc-str-dfr1]
651 .  \}
652 .  el \{\
653 .    nr doc-reg-dfr \n[doc-arg-ptr]
655 .    ie "\*[doc-str-dfr]"string" \{\
656 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
657 .      \" doc-flag-recursion only; we need this to make `.Fl | ...' work
658 .      \" correctly
659 .      ie "\*[doc-str-dfr1]"\*[Ba]" \{\
660 .        if \n[doc-reg-Fl] \
661 .          as doc-out-string \|\-\*[doc-space]
662 .        as doc-out-string \&\*[Ba]
663 .      \}
664 .      el \{\
665 .        ie "\*[doc-str-dfr1]"\f[R]|\f[P]" \{\
666 .          if \n[doc-reg-Fl] \
667 .            as doc-out-string \|\-\*[doc-space]
668 .          as doc-out-string \f[R]|\f[P]
669 .        \}
670 .        el \{\
671 .          \" two consecutive hyphen characters?
672 .          ie "\*[doc-str-dfr1]"-" \
673 .            as doc-out-string \|\-\^\-\|
674 .          el \
675 .            as doc-out-string \|\-\*[doc-str-dfr1]
676 .    \}\}\}
677 .    el \{\
678 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
679 .      as doc-out-string "\*[doc-str-dfr1]\f[P]\s[0]
680 .    \}
682 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
683 .      \" last argument
684 .      if "\*[doc-str-dfr]"punct-prefix" \
685 .        as doc-out-string \|\-
686 .      as doc-out-string \f[P]\s[0]
687 .      doc-print-and-reset
688 .    \}
689 .    el \{\
690 .      nr doc-arg-ptr +1
691 .      ie "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \{\
692 .        ie "\*[doc-type\n[doc-reg-dfr]]"punct-prefix" \
693 .          as doc-out-string \|\-
694 .        el \
695 .          as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
696 .      \}
697 .      el \
698 .        as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
700 .      shift
701 .      nr doc-reg-Fl 0
702 .      doc-flag-recursion \$@
703 .  \}\}
707 .\" NS doc-print-recursive macro
708 .\" NS   general name recursion routine (print remaining arguments)
709 .\" NS
710 .\" NS   hyphenation is disabled
711 .\" NS
712 .\" NS modifies:
713 .\" NS   doc-arg-ptr, doc-out-string
714 .\" NS
715 .\" NS local variables:
716 .\" NS   doc-str-dpr, doc-str-dpr1, doc-reg-dpr
718 .de doc-print-recursive
719 .  ds doc-str-dpr \*[doc-type\n[doc-arg-ptr]]
720 .  ds doc-str-dpr1 "\*[doc-arg\n[doc-arg-ptr]]
722 .  hy 0
724 .  ie "\*[doc-str-dpr]"macro" \{\
725 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
726 .    \*[doc-str-dpr1]
727 .  \}
728 .  el \{\
729 .    nr doc-reg-dpr \n[doc-arg-ptr]
731 .    ie "\*[doc-str-dpr]"string" \
732 .      as doc-out-string \&\*[doc-str-dpr1]
733 .    el \{\
734 .      \" punctuation character
735 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
736 .      as doc-out-string "\*[doc-str-dpr1]\f[P]\s[0]
737 .    \}
739 .    nr doc-arg-ptr +1
740 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
741 .      \" last argument
742 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
743 .      doc-print-and-reset
744 .    \}
745 .    el \{\
746 .      as doc-out-string "\*[doc-space\n[doc-reg-dpr]]
747 .      doc-print-recursive
748 .  \}\}
752 .\" NS Ar user macro
753 .\" NS   command line `argument' macro: `.Ar [args ...]'
754 .\" NS
755 .\" NS modifies:
756 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
757 .\" NS   doc-curr-size
758 .\" NS
759 .\" NS width register `Ar' set in doc-common
761 .de Ar
762 .  as doc-out-string \*[doc-Ar-font]
764 .  if !\n[doc-arg-limit] \{\
765 .    ie \n[.$] \{\
766 .      ds doc-macro-name Ar
767 .      doc-parse-args \$@
768 .    \}
769 .    el \{\
770 .      \" no argument
771 .      as doc-out-string \&file\ ...\f[P]\s[0]
772 .      doc-print-out-string
773 .  \}\}
775 .  if \n[doc-arg-limit] \{\
776 .    nr doc-arg-ptr +1
777 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
778 .      as doc-out-string \&file\ ...\f[P]\s[0]
779 .      doc-print-and-reset
780 .    \}
781 .    el \{\
782 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
783 .        as doc-out-string \&file\ ...\f[P]\s[0]
784 .        \*[doc-arg\n[doc-arg-ptr]]
785 .      \}
786 .      el \{\
787 .        nr doc-curr-font \n[.f]
788 .        nr doc-curr-size \n[.s]
789 .        if "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \
790 .          as doc-out-string \&file\ ...
791 .        doc-print-recursive
792 .  \}\}\}
796 .\" NS Ad user macro
797 .\" NS   Addresses
798 .\" NS
799 .\" NS modifies:
800 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
801 .\" NS   doc-curr-size
802 .\" NS
803 .\" NS width register `Ad' set in doc-common
805 .de Ad
806 .  if !\n[doc-arg-limit] \{\
807 .    ie \n[.$] \{\
808 .      ds doc-macro-name Ad
809 .      doc-parse-args \$@
810 .    \}
811 .    el \
812 .      tm Usage: .Ad address ... \*[doc-punct-chars] (#\n[.c])
813 .  \}
815 .  nr doc-arg-ptr +1
816 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
817 .    as doc-out-string \*[doc-Ad-font]
818 .    nr doc-curr-font \n[.f]
819 .    nr doc-curr-size \n[.s]
820 .    doc-print-recursive
821 .  \}
825 .\" NS doc-in-synopsis-count global register
826 .\" NS   whether we have more than a single item in synopsis
828 .nr doc-in-synopsis-count 0
831 .\" NS doc-indent-synopsis global register
832 .\" NS   indentation in synopsis
834 .nr doc-indent-synopsis 0
837 .\" NS Cd user macro
838 .\" NS   Config declaration (for section 4 SYNOPSIS)
839 .\" NS
840 .\" NS   this function causes a break; it uses the `Nm' font
841 .\" NS
842 .\" NS modifies:
843 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
844 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis
845 .\" NS
846 .\" NS width register `Cd' set in doc-common
848 .\" needs work - not very translatable
850 .de Cd
851 .  if !\n[doc-arg-limit] \{\
852 .    ie \n[.$] \{\
853 .      ds doc-macro-name Cd
854 .      doc-parse-args \$@
855 .    \}
856 .    el \
857 .      tm Usage: .Cd Configuration file declaration (#\n[.c])
858 .  \}
860 .  br
862 .  nr doc-arg-ptr +1
863 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
864 .    as doc-out-string \*[doc-Nm-font]
865 .    nr doc-curr-font \n[.f]
866 .    nr doc-curr-size \n[.s]
868 .    ie \n[doc-in-synopsis-count] \{\
869 .      if "\*[doc-macro-name]"Cd" \{\
870 .        rs
871 .        ie (\n[doc-in-synopsis-count] > 1) \
872 .          br
873 .        el \{\
874 .          if !\n[doc-indent-synopsis] \
875 .            nr doc-indent-synopsis \n[doc-display-indent]u
876 .        \}
877 .        in +\n[doc-indent-synopsis]u
878 .        ti -\n[doc-indent-synopsis]u
879 .        nr doc-in-synopsis-count +1
880 .      \}
882 .      doc-print-recursive
883 .      in -\n[doc-indent-synopsis]u
884 .    \}
885 .    el \
886 .      doc-print-recursive
887 .  \}
891 .\" NS Cm user macro
892 .\" NS   Interactive command modifier (flag)
893 .\" NS
894 .\" NS modifies:
895 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
896 .\" NS   doc-curr-size
897 .\" NS
898 .\" NS width register `Cm' set in doc-common
900 .de Cm
901 .  if !\n[doc-arg-limit] \{\
902 .    ie \n[.$] \{\
903 .      ds doc-macro-name Cm
904 .      doc-parse-args \$@
905 .    \}
906 .    el \{\
907 .      tmc Usage: .Cm Interactive command modifier ...
908 .      tm1 " \*[doc-punct-chars] (#\n[.c])
909 .  \}\}
911 .  nr doc-arg-ptr +1
912 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
913 .    as doc-out-string \*[doc-Cm-font]
914 .    nr doc-curr-font \n[.f]
915 .    nr doc-curr-size \n[.s]
916 .    doc-print-recursive
917 .  \}
921 .\" NS Dv user macro
922 .\" NS   define variable
923 .\" NS
924 .\" NS   this function uses the `Er' font
925 .\" NS
926 .\" NS modifies:
927 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
928 .\" NS   doc-curr-size
929 .\" NS
930 .\" NS width register `Dv' set in doc-common
932 .de Dv
933 .  if !\n[doc-arg-limit] \{\
934 .    ie \n[.$] \{\
935 .      ds doc-macro-name Dv
936 .      doc-parse-args \$@
937 .    \}
938 .    el \
939 .      tm Usage: .Dv define_variable ... \*[doc-punct-chars] (#\n[.c])
940 .  \}
942 .  nr doc-arg-ptr +1
943 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
944 .    as doc-out-string \*[doc-Er-font]
945 .    nr doc-curr-font \n[.f]
946 .    nr doc-curr-size \n[.s]
947 .    doc-print-recursive
948 .  \}
952 .\" NS Em user macro
953 .\" NS   emphasis
954 .\" NS
955 .\" NS modifies:
956 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
957 .\" NS   doc-curr-size
958 .\" NS
959 .\" NS width register `Em' set in doc-common
961 .de Em
962 .  if !\n[doc-arg-limit] \{\
963 .    ie \n[.$] \{\
964 .      ds doc-macro-name Em
965 .      doc-parse-args \$@
966 .    \}
967 .    el \
968 .      tm Usage: .Em text ... \*[doc-punct-chars] (#\n[.c])
969 .  \}
971 .  nr doc-arg-ptr +1
972 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
973 .    as doc-out-string \*[doc-Em-font]
974 .    nr doc-curr-font \n[.f]
975 .    nr doc-curr-size \n[.s]
976 .    doc-print-recursive
977 .  \}
981 .\" NS Er user macro
982 .\" NS   errno type
983 .\" NS
984 .\" NS modifies:
985 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
986 .\" NS   doc-curr-size
987 .\" NS
988 .\" NS width register `Er' set in doc-common
990 .de Er
991 .  if !\n[doc-arg-limit] \{\
992 .    ie \n[.$] \{\
993 .      ds doc-macro-name Er
994 .      doc-parse-args \$@
995 .    \}
996 .    el \
997 .      tm Usage: .Er errno_type ... \*[doc-punct-chars] (#\n[.c])
998 .  \}
1000 .  nr doc-arg-ptr +1
1001 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1002 .    as doc-out-string \*[doc-Er-font]
1003 .    nr doc-curr-font \n[.f]
1004 .    nr doc-curr-size \n[.s]
1005 .    doc-print-recursive
1006 .  \}
1010 .\" NS Ev user macro
1011 .\" NS   environment variable
1012 .\" NS
1013 .\" NS modifies:
1014 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1015 .\" NS   doc-curr-size
1016 .\" NS
1017 .\" NS width register `Ev' set in doc-common
1019 .de Ev
1020 .  if !\n[doc-arg-limit] \{\
1021 .    ie \n[.$] \{\
1022 .      ds doc-macro-name Ev
1023 .      doc-parse-args \$@
1024 .    \}
1025 .    el \
1026 .      tm Usage: .Ev enviroment_variable ... \*[doc-punct-chars] (#\n[.c])
1027 .  \}
1029 .  nr doc-arg-ptr +1
1030 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1031 .    as doc-out-string \*[doc-Ev-font]
1032 .    nr doc-curr-font \n[.f]
1033 .    nr doc-curr-size \n[.s]
1034 .    doc-print-recursive
1035 .  \}
1039 .\" NS doc-have-decl global register (bool)
1040 .\" NS   subroutine test (in synopsis only)
1042 .nr doc-have-decl 0
1045 .\" NS doc-have-var global register (bool)
1046 .\" NS   whether last type is a variable type
1048 .nr doc-have-var 0
1051 .\" NS doc-do-func-decl macro
1052 .\" NS   do someting special while in SYNOPSIS
1053 .\" NS
1054 .\" NS modifies:
1055 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
1056 .\" NS   doc-have-var
1058 .de doc-do-func-decl
1059 .  if \n[doc-in-synopsis-count] \{\
1060 .    \" if a variable type was the last thing given, want vertical space
1061 .    if \n[doc-have-var] \{\
1062 .      doc-paragraph
1063 .      nr doc-have-var 0
1064 .    \}
1065 .    \" if a subroutine was the last thing given, want vertical space
1066 .    if \n[doc-have-func] \{\
1067 .      ie \n[doc-have-decl] \
1068 .        br
1069 .      el \{\
1070 .        doc-paragraph
1071 .        rs
1072 .    \}\}
1073 .    nr doc-have-decl 1
1074 .  \}
1076 .  nr doc-curr-font \n[.f]
1077 .  nr doc-curr-size \n[.s]
1081 .\" NS Fd user macro
1082 .\" NS   function declaration -- not callable
1083 .\" NS
1084 .\" NS   this function causes a break
1085 .\" NS
1086 .\" NS width register `Fd' set in doc-common
1088 .de Fd
1089 .  ie \n[doc-arg-limit] \
1090 .    tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
1091 .  el \{\
1092 .    doc-do-func-decl
1093 .    nop \*[doc-Fd-font]\$*
1094 .    br
1095 .    ft \n[doc-curr-font]
1096 .    ps \n[doc-curr-size]
1097 .  \}
1101 .\" NS In user macro
1102 .\" NS   #include statement - not callable (& no err check)
1103 .\" NS
1104 .\" NS   this function causes a break; it uses the `Fd' font
1105 .\" NS
1106 .\" NS width register `In' set in doc-common
1108 .de In
1109 .  ie \n[doc-arg-limit] \
1110 .    tm Usage: .In #include_statement -- In is not callable (#\n[.c])
1111 .  el \{\
1112 .    doc-do-func-decl
1113 .    nop \*[doc-Fd-font]#include <\$1>
1114 .    br
1115 .    ft \n[doc-curr-font]
1116 .    ps \n[doc-curr-size]
1117 .  \}
1121 .\" NS Fr user macro
1122 .\" NS   function return value
1123 .\" NS
1124 .\" NS   this function uses the `Ar' font
1125 .\" NS
1126 .\" NS modifies:
1127 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1128 .\" NS   doc-curr-size
1129 .\" NS
1130 .\" NS width register `Fr' set in doc-common
1132 .de Fr
1133 .  if !\n[doc-arg-limit] \{\
1134 .    ie \n[.$] \{\
1135 .      ds doc-macro-name Fr
1136 .      doc-parse-args \$@
1137 .    \}
1138 .    el \
1139 .      tm Usage: .Fr Function_return_value... \*[doc-punct-chars] (#\n[.c])
1140 .  \}
1142 .  nr doc-arg-ptr +1
1143 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1144 .    as doc-out-string \*[doc-Ar-font]
1145 .    nr doc-curr-font \n[.f]
1146 .    nr doc-curr-size \n[.s]
1147 .    doc-print-recursive
1148 .  \}
1152 .\" NS Ic user macro
1153 .\" NS   interactive command
1154 .\" NS
1155 .\" NS modifies:
1156 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1157 .\" NS   doc-curr-size
1158 .\" NS
1159 .\" NS width register `Ic' set in doc-common
1161 .de Ic
1162 .  if !\n[doc-arg-limit] \{\
1163 .    ie \n[.$] \{\
1164 .      ds doc-macro-name Ic
1165 .      doc-parse-args \$@
1166 .    \}
1167 .    el \
1168 .      tm Usage: .Ic Interactive command ... \*[doc-punct-chars] (#\n[.c])
1169 .  \}
1171 .  nr doc-arg-ptr +1
1172 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1173 .    as doc-out-string \*[doc-Ic-font]
1174 .    nr doc-curr-font \n[.f]
1175 .    nr doc-curr-size \n[.s]
1176 .    doc-print-recursive
1177 .  \}
1181 .\" NS Li user macro
1182 .\" NS   literals
1183 .\" NS
1184 .\" NS modifies:
1185 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1186 .\" NS   doc-curr-size
1187 .\" NS
1188 .\" NS width register `Li' set in doc-common
1190 .de Li
1191 .  if !\n[doc-arg-limit] \{\
1192 .    ie \n[.$] \{\
1193 .      ds doc-macro-name Li
1194 .      doc-parse-args \$@
1195 .    \}
1196 .    el \
1197 .      tm Usage: .Li argument ... \*[doc-punct-chars] (#\n[.c])
1198 .  \}
1200 .  nr doc-arg-ptr +1
1201 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1202 .    as doc-out-string \*[doc-Li-font]
1203 .    nr doc-curr-font \n[.f]
1204 .    nr doc-curr-size \n[.s]
1205 .    doc-print-recursive
1206 .  \}
1210 .\" NS Or user macro
1211 .\" NS   pipe symbol (OR)
1212 .\" NS
1213 .\" NS modifies:
1214 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1215 .\" NS   doc-curr-size
1216 .\" NS
1217 .\" NS width register `Or' set in doc-common
1219 .\" XXX: What is this function good for?  It sets a font but does not print
1220 .\"      a pipe symbol.  And it isn't documented.
1222 .de Or
1223 .  if !\n[doc-arg-limit] \{\
1224 .    ie \n[.$] \{\
1225 .      ds doc-macro-name Or
1226 .      doc-parse-args \$@
1227 .    \}
1228 .    el \
1229 .      tm Usage: .Or ... \*[doc-punct-chars] (#\n[.c])
1230 .  \}
1232 .  nr doc-arg-ptr +1
1233 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1234 .    as doc-out-string \*[doc-Ic-font]
1235 .    nr doc-curr-font \n[.f]
1236 .    nr doc-curr-size \n[.s]
1237 .    doc-print-recursive
1238 .  \}
1242 .\" NS Ms user macro
1243 .\" NS   math symbol
1244 .\" NS
1245 .\" NS   this function uses the `Sy' font
1246 .\" NS
1247 .\" NS modifies:
1248 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1249 .\" NS   doc-curr-size
1250 .\" NS
1251 .\" NS width register `Ms' set in doc-common
1253 .de Ms
1254 .  if !\n[doc-arg-limit] \{\
1255 .    ie \n[.$] \{\
1256 .      ds doc-macro-name Ms
1257 .      doc-parse-args \$@
1258 .    \}
1259 .    el \
1260 .      tm Usage: .Ms Math symbol ... \*[doc-punct-chars] (#\n[.c])
1261 .  \}
1263 .  nr doc-arg-ptr +1
1264 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1265 .    as doc-out-string \*[doc-Sy-font]
1266 .    nr doc-curr-font \n[.f]
1267 .    nr doc-curr-size \n[.s]
1268 .    doc-print-recursive
1269 .  \}
1273 .\" NS doc-command-name global string
1274 .\" NS   save first invocation of .Nm
1276 .ds doc-command-name
1279 .\" NS Nm user macro
1280 .\" NS   name of command or page topic
1281 .\" NS
1282 .\" NS modifies:
1283 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1284 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
1285 .\" NS   doc-command-name
1286 .\" NS
1287 .\" NS local variables:
1288 .\" NS   doc-str-Nm
1289 .\" NS
1290 .\" NS width register `Nm' set in doc-common
1292 .de Nm
1293 .  if !\n[doc-arg-limit] \{\
1294 .    ie \n[.$] \{\
1295 .      ds doc-macro-name Nm
1297 .      \" handle empty first parameter
1298 .      ie "\$1"" \
1299 .        ds doc-str-Nm "\*[doc-command-name]
1300 .      el \
1301 .        ds doc-str-Nm "\$1
1302 .      shift
1303 .      doc-parse-args "\*[doc-str-Nm]" \$@
1304 .    \}
1305 .    el \{\
1306 .      ie "\*[doc-command-name]"" \
1307 .        tm Usage: .Nm Name ... \*[doc-punct-chars] (#\n[.c])
1308 .      el \
1309 .        nop \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1310 .  \}\}
1312 .  if \n[doc-arg-limit] \{\
1313 .    nr doc-arg-ptr +1
1314 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1315 .      \" last argument
1316 .      as doc-out-string \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1317 .      doc-print-and-reset
1318 .    \}
1319 .    el \{\
1320 .      as doc-out-string \*[doc-Nm-font]
1321 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
1322 .        as doc-out-string \&\*[doc-command-name]\f[P]\s[0]
1323 .        \*[doc-arg\n[doc-arg-ptr]]
1324 .      \}
1325 .      el \{\
1326 .        nr doc-curr-font \n[.f]
1327 .        nr doc-curr-size \n[.s]
1329 .        \" handle `.Nm ...' in SYNOPSIS
1330 .        if \n[doc-in-synopsis-count] \{\
1331 .          if "\*[doc-macro-name]"Nm" \{\
1332 .            rs
1333 .            in -\n[doc-indent-synopsis]u
1334 .            ie (\n[doc-in-synopsis-count] > 1) \
1335 .              br
1336 .            el \{\
1337 .              if !\n[doc-indent-synopsis] \{\
1338 .                doc-get-width \$1
1339 .                nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
1340 .            \}\}
1341 .            in +\n[doc-indent-synopsis]u
1342 .            ti -\n[doc-indent-synopsis]u
1343 .            nr doc-in-synopsis-count +1
1344 .        \}\}
1345 .        if "\*[doc-command-name]"" \
1346 .          ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
1347 .        doc-print-recursive
1348 .  \}\}\}
1352 .\" NS Pa user macro
1353 .\" NS   pathname: `.Pa [arg ...]'
1354 .\" NS
1355 .\" NS modifies:
1356 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1357 .\" NS   doc-curr-size
1358 .\" NS
1359 .\" NS width register `Pa' set in doc-common
1361 .de Pa
1362 .  if !\n[doc-arg-limit] \{\
1363 .    ie \n[.$] \{\
1364 .      ds doc-macro-name Pa
1365 .      doc-parse-args \$@
1366 .    \}
1367 .    el \{\
1368 .      \" default value
1369 .      nop \*[doc-Pa-font]~\f[P]\s[0]
1370 .  \}\}
1372 .  nr doc-arg-ptr +1
1373 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1374 .    as doc-out-string \*[doc-Pa-font]
1375 .    nr doc-curr-font \n[.f]
1376 .    nr doc-curr-size \n[.s]
1377 .    doc-print-recursive
1378 .  \}
1382 .\" NS Sy user macro
1383 .\" NS   symbolics
1384 .\" NS
1385 .\" NS modifies:
1386 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1387 .\" NS   doc-curr-size
1388 .\" NS
1389 .\" NS width register `Sy' set in doc-common
1391 .de Sy
1392 .  if !\n[doc-arg-limit] \{\
1393 .    ie \n[.$] \{\
1394 .      ds doc-macro-name Sy
1395 .      doc-parse-args \$@
1396 .    \}
1397 .    el \
1398 .      tm Usage: .Sy symbolic_text ... \*[doc-punct-chars] (#\n[.c])
1399 .  \}
1401 .  nr doc-arg-ptr +1
1402 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1403 .    as doc-out-string \*[doc-Sy-font]
1404 .    nr doc-curr-font \n[.f]
1405 .    nr doc-curr-size \n[.s]
1406 .    doc-print-recursive
1407 .  \}
1411 .\" NS Me user macro
1412 .\" NS   menu entries
1413 .\" NS
1414 .\" NS modifies:
1415 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1416 .\" NS   doc-curr-size
1417 .\" NS
1418 .\" NS width register `Me' set in doc-common
1420 .de Me
1421 .  if !\n[doc-arg-limit] \{\
1422 .    ie \n[.$] \{\
1423 .      ds doc-macro-name Me
1424 .      doc-parse-args \$@
1425 .    \}
1426 .    el \
1427 .      tm Usage: .Me menu_entry ... \*[doc-punct-chars] (#\n[.c])
1428 .  \}
1430 .  nr doc-arg-ptr +1
1431 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1432 .    as doc-out-string \*[doc-Me-font]
1433 .    nr doc-curr-font \n[.f]
1434 .    nr doc-curr-size \n[.s]
1435 .    doc-print-recursive
1436 .  \}
1440 .\" NS Tn user macro
1441 .\" NS   trade name
1442 .\" NS
1443 .\" NS modifies:
1444 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1445 .\" NS   doc-curr-size
1446 .\" NS
1447 .\" NS width register `Tn' set in doc-common
1449 .de Tn
1450 .  if !\n[doc-arg-limit] \{\
1451 .    ie \n[.$] \{\
1452 .      ds doc-macro-name Tn
1453 .      doc-parse-args \$@
1454 .    \}
1455 .    el \
1456 .      tm Usage: .Tn trade_name ... \*[doc-punct-chars] (#\n[.c])
1457 .  \}
1459 .  nr doc-arg-ptr +1
1460 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1461 .    as doc-out-string \&\*[doc-Tn-font-shape]\*[doc-Tn-font-size]
1462 .    nr doc-curr-font \n[.f]
1463 .    nr doc-curr-size \n[.s]
1464 .    doc-print-recursive
1465 .  \}
1469 .\" NS doc-reference-trademark macro
1470 .\" NS   .Tn for inside of references
1471 .\" NS
1472 .\" NS modifies:
1473 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1474 .\" NS   doc-curr-size
1475 .\" NS
1476 .\" NS   the code for references below checks for `Tn'!
1478 .de doc-reference-trademark
1479 .  if !\n[doc-arg-limit] \{\
1480 .    ie \n[.$] \{\
1481 .      ds doc-macro-name Tn
1482 .      doc-parse-args \$@
1483 .    \}
1484 .    el \
1485 .      tm Usage: .Tn trade_name ... \*[doc-punct-chars] (#\n[.c])
1486 .  \}
1488 .  nr doc-arg-ptr +1
1489 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1490 .    as doc-out-string \&\*[doc-Tn-font-size]
1491 .    nr doc-curr-font \n[.f]
1492 .    nr doc-curr-size \n[.s]
1493 .    doc-do-references
1494 .  \}
1498 .\" NS Va user macro
1499 .\" NS   variable name
1500 .\" NS
1501 .\" NS modifies:
1502 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1503 .\" NS   doc-curr-size
1504 .\" NS
1505 .\" NS width register `Va' set in doc-common
1507 .de Va
1508 .  if !\n[doc-arg-limit] \{\
1509 .    ie \n[.$] \{\
1510 .      ds doc-macro-name Va
1511 .      doc-parse-args \$@
1512 .    \}
1513 .    el \
1514 .      tm Usage: .Va variable_name ... \*[doc-punct-chars] (#\n[.c])
1515 .  \}
1517 .  nr doc-arg-ptr +1
1518 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1519 .    as doc-out-string \*[doc-Va-font]
1520 .    nr doc-curr-font \n[.f]
1521 .    nr doc-curr-size \n[.s]
1522 .    doc-print-recursive
1523 .  \}
1527 .\" NS No user macro
1528 .\" NS   normal text macro (default text style if mess up)
1529 .\" NS
1530 .\" NS modifies:
1531 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
1532 .\" NS   doc-curr-size
1533 .\" NS
1534 .\" NS width register `No' set in doc-common
1536 .de No
1537 .  as doc-out-string \*[doc-No-font]
1539 .  if !\n[doc-arg-limit] \{\
1540 .    ie \n[.$] \{\
1541 .      ds doc-macro-name No
1542 .      doc-parse-args \$@
1543 .    \}
1544 .    el \
1545 .      tm Usage: .No normal_text ... \*[doc_punct_chars] (#\n[.c])
1546 .  \}
1548 .  nr doc-arg-ptr +1
1549 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
1550 .    ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
1551 .      \*[doc-arg\n[doc-arg-ptr]]
1552 .    el \{\
1553 .      nr doc-curr-font \n[.f]
1554 .      nr doc-curr-size \n[.s]
1555 .      doc-print-recursive
1556 .  \}\}
1560 .\" NS doc-quote-left global string
1561 .\" NS   left quotation character for `doc-enclose-string' and
1562 .\" NS   `doc-enclose-open'
1564 .ds doc-quote-left
1567 .\" NS doc-quote-right global string
1568 .\" NS   right quotation character for `doc-enclose-string' and
1569 .\" NS   `doc-enclose-close'
1571 .ds doc-quote-right
1574 .\" NS Op user macro
1575 .\" NS   option expression (i.e., enclose string in square brackets)
1576 .\" NS
1577 .\" NS modifies:
1578 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1579 .\" NS
1580 .\" NS width register `Op' set in doc-common
1582 .de Op
1583 .  if !\n[doc-arg-limit] \
1584 .    ds doc-macro-name Op
1586 .  ds doc-quote-left "\*[doc-left-bracket]
1587 .  ds doc-quote-right "\*[doc-right-bracket]
1589 .  doc-enclose-string \$@
1593 .\" NS Aq user macro
1594 .\" NS   enclose string in angle brackets
1595 .\" NS
1596 .\" NS modifies:
1597 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1598 .\" NS
1599 .\" NS width register `Aq' set in doc-common
1601 .de Aq
1602 .  if !\n[doc-arg-limit] \
1603 .    ds doc-macro-name Aq
1605 .  ds doc-quote-left <
1606 .  ds doc-quote-right >
1608 .  doc-enclose-string \$@
1612 .\" NS Bq user macro
1613 .\" NS   enclose string in square brackets
1614 .\" NS
1615 .\" NS modifies:
1616 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1617 .\" NS
1618 .\" NS width register `Bq' set in doc-common
1620 .de Bq
1621 .  if !\n[doc-arg-limit] \
1622 .    ds doc-macro-name Bq
1624 .  ds doc-quote-left "\*[doc-left-bracket]
1625 .  ds doc-quote-right "\*[doc-right-bracket]
1627 .  doc-enclose-string \$@
1631 .\" NS Dq user macro
1632 .\" NS   enclose string in double quotes
1633 .\" NS
1634 .\" NS modifies:
1635 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1636 .\" NS
1637 .\" NS width register `Dq' set in doc-common
1639 .de Dq
1640 .  if !\n[doc-arg-limit] \
1641 .    ds doc-macro-name Dq
1643 .  ds doc-quote-left "\*[Lq]
1644 .  ds doc-quote-right "\*[Rq]
1646 .  doc-enclose-string \$@
1650 .\" NS Eq user macro
1651 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1652 .\" NS
1653 .\" NS modifies:
1654 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1655 .\" NS
1656 .\" NS width register `Eq' set in doc-common
1658 .de Eq
1659 .  if !\n[doc-arg-limit] \
1660 .    ds doc-macro-name Eq
1662 .  ds doc-quote-left "\$1
1663 .  ds doc-quote-right "\$2
1665 .  shift 2
1666 .  doc-enclose-string \$@
1670 .\" NS Pq user macro
1671 .\" NS   enclose string in parentheses
1672 .\" NS
1673 .\" NS modifies:
1674 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1675 .\" NS
1676 .\" NS width register `Pq' set in doc-common
1678 .de Pq
1679 .  if !\n[doc-arg-limit] \
1680 .    ds doc-macro-name Pq
1682 .  ds doc-quote-left "\*[doc-left-parenthesis]
1683 .  ds doc-quote-right "\*[doc-right-parenthesis]
1685 .  doc-enclose-string \$@
1689 .\" NS Ql user macro
1690 .\" NS   quoted literal
1692 .\"   is in file doc-[dit|n]roff
1695 .\" NS Qq user macro
1696 .\" NS   enclose string in straight double quotes
1697 .\" NS
1698 .\" NS modifies:
1699 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1700 .\" NS
1701 .\" NS width register `Qq' set in doc-common
1703 .de Qq
1704 .  if !\n[doc-arg-limit] \
1705 .    ds doc-macro-name Qq
1707 .  ds doc-quote-left "\*[q]
1708 .  ds doc-quote-right "\*[q]
1710 .  doc-enclose-string \$@
1714 .\" NS Sq user macro
1715 .\" NS   enclose string in single quotes
1716 .\" NS
1717 .\" NS modifies:
1718 .\" NS   doc-macro-name, doc-quote-left, doc-quote-right
1719 .\" NS
1720 .\" NS width register `Sq' set in doc-common
1722 .de Sq
1723 .  if !\n[doc-arg-limit] \
1724 .    ds doc-macro-name Sq
1726 .  ds doc-quote-left "\*[doc-left-singlequote]
1727 .  ds doc-quote-right "\*[doc-right-singlequote]
1729 .  doc-enclose-string \$@
1733 .\" NS doc-enclose-string macro
1734 .\" NS   enclose string with given args (e.g. [ and ])
1735 .\" NS
1736 .\" NS modifies:
1737 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string
1738 .\" NS
1739 .\" NS local variables:
1740 .\" NS   doc-register-des (for communication with doc-skip-punct-backwards)
1741 .\" NS
1742 .\" NS requires:
1743 .\" NS   doc-quote-left, doc-quote-right
1745 .de doc-enclose-string
1746 .  ie \n[doc-arg-limit] \
1747 .    as doc-out-string \&\*[doc-quote-left]
1748 .  el \{\
1749 .    ie \n[.$] \{\
1750 .      doc-parse-args \$@
1751 .      as doc-out-string \&\*[doc-quote-left]
1752 .    \}
1753 .    el \{\
1754 .      \" no argument
1755 .      as doc-out-string \&\*[doc-quote-left]\*[doc-quote-right]
1756 .      doc-print-out-string
1757 .  \}\}
1759 .  if \n[doc-arg-limit] \{\
1760 .    nr doc-arg-ptr +1
1761 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
1762 .      \" last argument
1763 .      as doc-out-string \&\*[doc-quote-right]
1764 .      doc-print-and-reset
1765 .    \}
1766 .    el \{\
1767 .      ie "\*[doc-type\n[doc-arg-limit]]"punct-suffix" \{\
1768 .        nr doc-register-des (\n[doc-arg-limit] - 1)
1769 .        doc-skip-punct-backwards
1770 .        nr doc-register-des +1
1771 .        ds doc-arg\n[doc-register-des] "\*[doc-quote-right]\&\*[doc-arg\n[doc-register-des]]
1772 .        nr doc-register-des 0
1773 .      \}
1774 .      el \
1775 .        doc-append-arg "\*[doc-quote-right]" punct-suffix
1777 .      doc-do-\*[doc-type\n[doc-arg-ptr]]
1778 .  \}\}
1782 .\" NS doc-skip-punct-backwards macro
1783 .\" NS   vector routine (for `doc-enclose-string': trace backwards past
1784 .\" NS   trailing punctuation)
1786 .de doc-skip-punct-backwards
1787 .  if "\*[doc-type\n[doc-register-des]]"punct-suffix" \{\
1788 .    nr doc-register-des -1
1789 .    doc-skip-punct-backwards
1790 .  \}
1794 .\" NS Ao user macro
1795 .\" NS   angle open
1796 .\" NS
1797 .\" NS modifies:
1798 .\" NS   doc-macro-name, doc-quote-left
1799 .\" NS
1800 .\" NS width register `Ao' set in doc-common
1802 .de Ao
1803 .  if !\n[doc-arg-limit] \
1804 .    ds doc-macro-name Ao
1806 .  ds doc-quote-left <
1808 .  doc-enclose-open \$@
1812 .\" NS Ac user macro
1813 .\" NS   angle close
1814 .\" NS
1815 .\" NS modifies:
1816 .\" NS   doc-macro-name, doc-quote-right
1817 .\" NS
1818 .\" NS width register `Ac' set in doc-common
1820 .de Ac
1821 .  if !\n[doc-arg-limit] \
1822 .    ds doc-macro-name Ac
1824 .  ds doc-quote-right >
1826 .  doc-enclose-close \$@
1830 .\" NS Bo user macro
1831 .\" NS   bracket open
1832 .\" NS
1833 .\" NS modifies:
1834 .\" NS   doc-macro-name, doc-quote-left
1835 .\" NS
1836 .\" NS width register `Bo' set in doc-common
1838 .de Bo
1839 .  if !\n[doc-arg-limit] \
1840 .    ds doc-macro-name Bo
1842 .  ds doc-quote-left [
1844 .  doc-enclose-open \$@
1848 .\" NS Bc user macro
1849 .\" NS   bracket close
1850 .\" NS
1851 .\" NS modifies:
1852 .\" NS   doc-macro-name, doc-quote-right
1853 .\" NS
1854 .\" NS width register `Bc' set in doc-common
1856 .de Bc
1857 .  if !\n[doc-arg-limit] \
1858 .    ds doc-macro-name Bc
1860 .  ds doc-quote-right ]
1862 .  doc-enclose-close \$@
1866 .\" NS Do user macro
1867 .\" NS   double quote open
1868 .\" NS
1869 .\" NS modifies:
1870 .\" NS   doc-macro-name, doc-quote-left
1871 .\" NS
1872 .\" NS width register `Do' set in doc-common
1874 .de Do
1875 .  if !\n[doc-arg-limit] \
1876 .    ds doc-macro-name Do
1878 .  ds doc-quote-left "\*[Lq]
1880 .  doc-enclose-open \$@
1884 .\" NS Dc user macro
1885 .\" NS   double quote close
1886 .\" NS
1887 .\" NS modifies:
1888 .\" NS   doc-macro-name, doc-quote-right
1889 .\" NS
1890 .\" NS width register `Dc' set in doc-common
1892 .de Dc
1893 .  if !\n[doc-arg-limit] \
1894 .    ds doc-macro-name Dc
1896 .  ds doc-quote-right "\*[Rq]
1898 .  doc-enclose-close \$@
1902 .\" NS Eo user macro
1903 .\" NS   enclose open (using first argument as beginning of enclosure)
1904 .\" NS
1905 .\" NS modifies:
1906 .\" NS   doc-macro-name, doc-quote-left
1907 .\" NS
1908 .\" NS width register `Eo' set in doc-common
1910 .de Eo
1911 .  if !\n[doc-arg-limit] \
1912 .    ds doc-macro-name Eo
1914 .  ds doc-quote-left "\$1
1916 .  shift
1917 .  doc-enclose-open \$@
1921 .\" NS Ec user macro
1922 .\" NS   enclose close (using first argument as end of enclosure)
1923 .\" NS
1924 .\" NS modifies:
1925 .\" NS   doc-macro-name, doc-quote-right
1926 .\" NS
1927 .\" NS width register `Ec' set in doc-common
1929 .de Ec
1930 .  if !\n[doc-arg-limit] \
1931 .    ds doc-macro-name Ec
1933 .  ds doc-quote-right "\$1
1935 .  shift
1936 .  doc-enclose-close \$@
1940 .\" NS Oo user macro
1941 .\" NS   option open
1942 .\" NS
1943 .\" NS modifies:
1944 .\" NS   doc-macro-name, doc-quote-left
1945 .\" NS
1946 .\" NS width register `Oo' set in doc-common
1948 .de Oo
1949 .  if !\n[doc-arg-limit] \
1950 .    ds doc-macro-name Oo
1952 .  ds doc-quote-left [
1954 .  doc-enclose-open \$@
1958 .\" NS Oc user macro
1959 .\" NS   option close
1960 .\" NS
1961 .\" NS modifies:
1962 .\" NS   doc-macro-name, doc-quote-right
1963 .\" NS
1964 .\" NS width register `Oc' set in doc-common
1966 .de Oc
1967 .  if !\n[doc-arg-limit] \
1968 .    ds doc-macro-name Oc
1970 .  ds doc-quote-right ]
1972 .  doc-enclose-close \$@
1976 .\" NS Po user macro
1977 .\" NS   parenthesis open
1978 .\" NS
1979 .\" NS modifies:
1980 .\" NS   doc-macro-name, doc-quote-left
1981 .\" NS
1982 .\" NS width register `Po' set in doc-common
1984 .de Po
1985 .  if !\n[doc-arg-limit] \
1986 .    ds doc-macro-name Po
1988 .  ds doc-quote-left (
1990 .  doc-enclose-open \$@
1994 .\" NS Pc user macro
1995 .\" NS   parenthesis close
1996 .\" NS
1997 .\" NS modifies:
1998 .\" NS   doc-macro-name, doc-quote-right
1999 .\" NS
2000 .\" NS width register `Pc' set in doc-common
2002 .de Pc
2003 .  if !\n[doc-arg-limit] \
2004 .    ds doc-macro-name Pc
2006 .  ds doc-quote-right )
2008 .  doc-enclose-close \$@
2012 .\" NS Qo user macro
2013 .\" NS   straight double quote open
2014 .\" NS
2015 .\" NS modifies:
2016 .\" NS   doc-macro-name, doc-quote-left
2017 .\" NS
2018 .\" NS width register `Qo' set in doc-common
2020 .de Qo
2021 .  if !\n[doc-arg-limit] \
2022 .    ds doc-macro-name Qo
2024 .  ds doc-quote-left "\*[q]
2026 .  doc-enclose-open \$@
2030 .\" NS Qc user macro
2031 .\" NS   straight double quote close
2032 .\" NS
2033 .\" NS modifies:
2034 .\" NS   doc-macro-name, doc-quote-right
2035 .\" NS
2036 .\" NS width register `Qc' set in doc-common
2038 .de Qc
2039 .  if !\n[doc-arg-limit] \
2040 .    ds doc-macro-name Qc
2042 .  ds doc-quote-right "\*[q]
2044 .  doc-enclose-close \$@
2048 .\" NS So user macro
2049 .\" NS   single quote open
2050 .\" NS
2051 .\" NS modifies:
2052 .\" NS   doc-macro-name, doc-quote-left
2053 .\" NS
2054 .\" NS width register `So' set in doc-common
2056 .de So
2057 .  if !\n[doc-arg-limit] \
2058 .    ds doc-macro-name So
2060 .  ds doc-quote-left "\*[doc-left-singlequote]
2062 .  doc-enclose-open \$@
2066 .\" NS Sc user macro
2067 .\" NS   single quote close
2068 .\" NS
2069 .\" NS modifies:
2070 .\" NS   doc-macro-name, doc-quote-right
2071 .\" NS
2072 .\" NS width register `Sc' set in doc-common
2074 .de Sc
2075 .  if !\n[doc-arg-limit] \
2076 .    ds doc-macro-name Sc
2078 .  ds doc-quote-right "\*[doc-right-singlequote]
2080 .  doc-enclose-close \$@
2084 .\" NS Xo user macro
2085 .\" NS   extend open
2086 .\" NS
2087 .\" NS modifies:
2088 .\" NS   doc-macro-name, doc-quote-left
2089 .\" NS
2090 .\" NS width register `Xo' set in doc-common
2092 .de Xo
2093 .  if !\n[doc-arg-limit] \
2094 .    ds doc-macro-name Xo
2096 .  ds doc-quote-left
2098 .  doc-enclose-open \$@
2102 .\" NS Xc user macro
2103 .\" NS   extend close
2104 .\" NS
2105 .\" NS modifies:
2106 .\" NS   doc-macro-name, doc-quote-right
2107 .\" NS
2108 .\" NS width register `Xc' set in doc-common
2110 .de Xc
2111 .  if !\n[doc-arg-limit] \
2112 .    ds doc-macro-name Xc
2114 .  ds doc-quote-right
2116 .  doc-enclose-close \$@
2120 .\" NS doc-nesting-level global register
2121 .\" NS   (extension possible)
2123 .nr doc-nesting-level 0
2126 .\" NS doc-enclose-open macro
2127 .\" NS   enclose string open
2128 .\" NS
2129 .\" NS modifies:
2130 .\" NS   doc-arg-ptr, doc-out-string, doc-nesting-level,
2131 .\" NS   doc-saved-list-immediate
2133 .de doc-enclose-open
2134 .  nr doc-nesting-level +1
2136 .  ie \n[doc-arg-limit] \
2137 .    as doc-out-string \&\*[doc-quote-left]
2138 .  el \{\
2139 .    ie \n[.$] \{\
2140 .      doc-parse-args \$@
2141 .      as doc-out-string \&\*[doc-quote-left]
2142 .    \}
2143 .    el \{\
2144 .      as doc-out-string \&\*[doc-quote-left]
2146 .      if !\n[doc-in-diversion] \
2147 .        if \n[doc-space-mode] \
2148 .          doc-save-and-divert
2149 .  \}\}
2151 .  ie \n[doc-arg-limit] \{\
2152 .    if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
2153 .      nr doc-arg-ptr +1
2154 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
2155 .        \*[doc-arg\n[doc-arg-ptr]]
2156 .      el \{\
2157 .        nr doc-arg-ptr -1
2158 .        No
2159 .    \}\}
2161 .    if (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
2162 .      if \n[doc-list-immediate] \{\
2163 .        \" .tm SETTING doc-saved-list-immediate!
2164 .        nr doc-saved-list-immediate 1
2165 .      \}
2166 .      doc-reset-args
2167 .  \}\}
2168 .  el \{\
2169 .    if (\n[doc-nesting-level] > 1) \
2170 .      as doc-out-string "\*[doc-space]
2171 .  \}
2175 .\" NS doc-saved-list-type global string
2176 .\" NS   saved list type
2178 .ds doc-saved-list-type
2181 .\" NS doc-enclose-close macro
2182 .\" NS   enclose string close
2183 .\" NS
2184 .\" NS modifies:
2185 .\" NS   doc-out-string, doc-nesting-level, doc-saved-list-immediate,
2186 .\" NS   doc-saved-list-type
2187 .\" NS
2188 .\" NS local variables:
2189 .\" NS   doc-str-dec
2191 .de doc-enclose-close
2192 .  nr doc-nesting-level -1
2194 .  as doc-out-string \&\*[doc-quote-right]
2196 .  if !\n[doc-arg-limit] \{\
2197 .    ie \n[.$] \
2198 .      doc-parse-args \$@
2199 .    el \{\
2200 .      doc-print-out-string
2201 .      if !"\*[doc-saved-list-type]"" \{\
2202 .        doc-\*[doc-list-type-stack\n[doc-list-depth]]
2203 .        nr doc-saved-list-immediate 0
2204 .        ds doc-saved-list-type
2205 .  \}\}\}
2207 .  if \n[doc-arg-limit] \{\
2208 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
2209 .      ie \n[doc-nesting-level] \
2210 .        doc-reset-args
2211 .      el \
2212 .        doc-print-and-reset
2213 .    \}
2214 .    el \{\
2215 .      nr doc-str-dec (\n[doc-arg-ptr] + 1)
2216 .      if "\*[doc-type\n[doc-str-dec]]"string" \
2217 .        as doc-out-string "\*[doc-space\n[doc-arg-limit]]
2219 .      if \n[doc-list-immediate] \{\
2220 .        \" .tm UNSETTING doc-saved-list-immediate==\n[doc-saved-list-immediate]!
2221 .        if \n[doc-saved-list-immediate] \
2222 .          nr doc-saved-list-immediate 0
2223 .      \}
2224 .      No
2225 .  \}\}
2229 .\" NS Pf user macro
2230 .\" NS   prefix: `.Pf prefix arg ...'
2231 .\" NS
2232 .\" NS modifies:
2233 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-quote-left
2234 .\" NS
2235 .\" NS width register `Pf' set in doc-common
2237 .de Pf
2238 .  if !\n[doc-arg-limit] \
2239 .    ds doc-macro-name Pf
2241 .  ds doc-quote-left "\$1
2243 .  shift
2245 .  ie \n[doc-arg-limit] \{\
2246 .    ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
2247 .      nr doc-arg-ptr +1
2248 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2249 .    \}
2250 .    el \
2251 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
2252 .  \}
2253 .  el \{\
2254 .    as doc-out-string \&\*[doc-quote-left]
2255 .    ie (\n[.$] < 2) \{\
2256 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
2257 .      doc-print-out-string
2258 .    \}
2259 .    el \
2260 .      doc-parse-args \$@
2261 .  \}
2263 .  if \n[doc-arg-limit] \{\
2264 .    nr doc-arg-ptr +1
2265 .    ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
2266 .      doc-print-and-reset
2267 .    el \
2268 .      doc-do-\*[doc-type\n[doc-arg-ptr]]
2269 .  \}
2273 .\" NS Ns user macro
2274 .\" NS   remove space (space removal done by `doc-parse-args')
2275 .\" NS
2276 .\" NS modifies:
2277 .\" NS   doc-macro-name
2278 .\" NS
2279 .\" NS width register `Ns' set in doc-common
2281 .de Ns
2282 .  if !\n[doc-arg-limit] \{\
2283 .    ds doc-macro-name Ns
2284 .    ie \n[.$] \
2285 .      doc-parse-args \$@
2286 .    el \
2287 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2288 .  \}
2290 .  No
2294 .\" NS Ap user macro
2295 .\" NS   append an apostrophe
2296 .\" NS
2297 .\" NS modifies:
2298 .\" NS   doc-out-string
2299 .\" NS
2300 .\" NS width register `Ap' set in doc-common
2302 .de Ap
2303 .  if !\n[doc-arg-limit] \
2304 .    tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2306 .  as doc-out-string \&'
2307 .  No
2311 .\" NS doc-space global string
2312 .\" NS   current inter-argument space
2314 .ds doc-space "\*[doc-soft-space]
2317 .\" NS doc-soft-space constant string
2318 .\" NS   soft (stretchable) space (defined in doc-common)
2321 .\" NS doc-hard-space constant string
2322 .\" NS   hard (unpaddable) space (defined in doc-common)
2325 .\" NS doc-set-hard-space macro
2326 .\" NS   set current space string to hard (unpaddable) space.
2327 .\" NS
2328 .\" NS modifies:
2329 .\" NS   doc-space
2331 .de doc-set-hard-space
2332 .  ds doc-space "\*[doc-hard-space]
2336 .\" NS doc-set-soft-space macro
2337 .\" NS   set current space string to soft space (troff limitation)
2338 .\" NS
2339 .\" NS modifies:
2340 .\" NS   doc-space
2342 .de doc-set-soft-space
2343 .  ds doc-space "\*[doc-soft-space]
2347 .\" NS doc-space-mode global register (bool)
2348 .\" NS   default is one (space mode on)
2350 .nr doc-space-mode 1
2353 .\" NS Sm user macro
2354 .\" NS   space mode (`.Sm'/`.Sm on'/`.Sm off')
2355 .\" NS
2356 .\" NS   without argument, toggle space mode
2357 .\" NS
2358 .\" NS modifies:
2359 .\" NS   doc-macro-name, doc-arg-limit, doc-num-args, doc-arg-ptr,
2360 .\" NS   doc-argXXX, doc-spaceXXX, doc-curr-space, doc-space-mode,
2361 .\" NS   doc-space
2362 .\" NS
2363 .\" NS width register `Sm' set in doc-common
2364 .\" NS
2365 .\" NS local variables:
2366 .\" NS   doc-reg-Sm
2368 .de Sm
2369 .  if !\n[doc-arg-limit] \{\
2370 .    ie \n[.$] \{\
2371 .      ds doc-macro-name Sm
2372 .      doc-parse-args \$@
2373 .    \}
2374 .    el \{\
2375 .      ie \n[doc-space-mode] \
2376 .        nr doc-space-mode 0
2377 .      el \
2378 .        nr doc-space-mode 1
2379 .  \}\}
2381 .  if \n[doc-arg-limit] \{\
2382 .    nr doc-arg-ptr +1
2384 .    \" avoid a warning message in case `Sm' is the last parameter
2385 .    if !d doc-arg\n[doc-arg-ptr] \
2386 .      ds doc-arg\n[doc-arg-ptr]
2388 .    ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2389 .      ds doc-space "\*[doc-soft-space]
2390 .      nr doc-space-mode 1
2391 .    \}
2392 .    el \{\
2393 .      ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2394 .        ds doc-space
2395 .        ds doc-curr-space
2396 .        nr doc-space-mode 0
2397 .      \}
2398 .      el \{\
2399 .        \" no argument for Sm
2400 .        nr doc-arg-ptr -1
2401 .        ie \n[doc-space-mode] \
2402 .          nr doc-space-mode 0
2403 .        el \
2404 .          nr doc-space-mode 1
2405 .    \}\}
2407 .    ie \n[doc-space-mode] \{\
2408 .      \" recompute space vector for remaining arguments
2409 .      nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
2410 .      nr doc-arg-limit \n[doc-arg-ptr]
2411 .      nr doc-reg-Sm \n[doc-arg-ptr]
2412 .      if \n[doc-num-args] \{\
2413 .        doc-parse-arg-vector
2414 .        nr doc-arg-ptr \n[doc-reg-Sm]
2415 .    \}\}
2416 .    el \{\
2417 .      \" reset remaining space vector elements
2418 .      nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
2419 .      while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
2420 .        ds doc-space\n[doc-reg-Sm]
2421 .        nr doc-reg-Sm +1
2422 .        \" the body of a `while' request must end with the fitting `\}'!
2423 .      \}
2424 .    \}
2426 .    \" do we have parameters to print?
2427 .    ie (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
2428 .      \" ignore `.Sm on' and `.Sm off' without additional parameters
2429 .      ie (\n[doc-arg-ptr] > 1) \
2430 .        doc-print-and-reset
2431 .      el \
2432 .        doc-reset-args
2433 .    \}
2434 .    el \{\
2435 .      \" skip `Sm' argument
2436 .      nr doc-arg-ptr +1
2437 .      doc-print-recursive
2438 .  \}\}
2442 .\" NS doc-arg-type immediate string
2443 .\" NS   argument type
2445 .ds doc-arg-type
2448 .\" NS doc-get-arg-type macro
2449 .\" NS   get argument type (`macro', `string', `punct-suffix', or
2450 .\" NS   `punct-prefix')
2451 .\" NS
2452 .\" NS   this macro expects the width of the argument in `doc-width'
2453 .\" NS
2454 .\" NS modifies:
2455 .\" NS   doc-arg-type
2457 .de doc-get-arg-type
2458 .  ds doc-arg-type string
2460 .  if ((\n[doc-width] < 3) & \A\a\$1\a) \{\
2461 .    ie (\n[doc-width] == 1) \{\
2462 .      if d doc-punct\$1 \
2463 .        ds doc-arg-type \*[doc-punct\$1]
2464 .    \}
2465 .    el \{\
2466 .      if r \$1 \
2467 .        if \n[\$1] \
2468 .          ds doc-arg-type macro
2469 .  \}\}
2473 .\" NS doc-get-arg-type* macro
2474 .\" NS   similar to as `doc-get-arg-type' but uses doc-argXXX strings
2475 .\" NS
2476 .\" NS   this macro sets the `doc-width' register using the `length' request
2477 .\" NS   to get the number of characters in a string literally
2478 .\" NS
2479 .\" NS modifies:
2480 .\" NS   doc-arg-type, doc-width
2482 .de doc-get-arg-type*
2483 .  ds doc-arg-type string
2484 .  length doc-width "\*[doc-arg\$1]
2486 .  if ((\n[doc-width] < 3) & \A\a\*[doc-arg\$1]\a) \{\
2487 .    ie (\n[doc-width] == 1) \{\
2488 .      if d doc-punct\*[doc-arg\$1] \
2489 .        ds doc-arg-type \*[doc-punct\*[doc-arg\$1]]
2490 .    \}
2491 .    el \{\
2492 .      if r \*[doc-arg\$1] \
2493 .        if \n[\*[doc-arg\$1]] \
2494 .          ds doc-arg-type macro
2495 .  \}\}
2499 .\" NS doc-set-spacing-for-macro macro
2500 .\" NS   set spacing for macros
2501 .\" NS
2502 .\" NS modifies:
2503 .\" NS   doc-spaceXXX
2504 .\" NS
2505 .\" NS local variables:
2506 .\" NS   doc-reg-dssfm, doc-reg-dssfm1
2508 .de doc-set-spacing-for-macro
2509 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
2511 .  \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
2512 .  \" argument)
2513 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2514 .    nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2515 .    ds doc-space\n[doc-reg-dssfm]
2516 .    ds doc-space\n[doc-arg-limit] "\*[doc-space]
2517 .  \}
2518 .  el \{\
2519 .    \" macros like .Ap and .Ns have value 2 (remove space before and after
2520 .    \" argument)
2521 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2522 .      nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
2523 .      ds doc-space\n[doc-reg-dssfm]
2524 .      ds doc-space\n[doc-arg-limit]
2525 .    \}
2526 .    el \
2527 .      ds doc-space\n[doc-arg-limit]
2528 .  \}
2532 .\" NS doc-set-spacing-for-string macro
2533 .\" NS   set spacing for strings
2534 .\" NS
2535 .\" NS modifies:
2536 .\" NS   doc-spaceXXX
2538 .de doc-set-spacing-for-string
2539 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2543 .\" NS doc-set-spacing-for-punct-suffix macro
2544 .\" NS   set spacing for punctuation suffixes
2545 .\" NS
2546 .\" NS modifies:
2547 .\" NS   doc-spaceXXX
2548 .\" NS
2549 .\" NS local variables:
2550 .\" NS   doc-reg-dssfps
2552 .de doc-set-spacing-for-punct-suffix
2553 .  if \n[doc-arg-limit] \{\
2554 .    nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
2555 .    ds doc-space\n[doc-reg-dssfps]
2556 .  \}
2558 .  ds doc-space\n[doc-arg-limit] "\*[doc-space]
2562 .\" NS doc-set-spacing-for-punct-prefix macro
2563 .\" NS   set spacing for punctuation prefixes
2564 .\" NS
2565 .\" NS modifies:
2566 .\" NS   doc-spaceXXX
2568 .de doc-set-spacing-for-punct-prefix
2569 .  ds doc-space\n[doc-arg-limit]
2573 .\" type switches (on current argument doc-arg-ptr)
2576 .\" NS doc-do-macro macro
2577 .\" NS   call request if macro
2579 .de doc-do-macro
2580 .  \*[doc-arg\n[doc-arg-ptr]]
2584 .\" NS doc-do-string macro
2585 .\" NS   call .No if string
2586 .\" NS
2587 .\" NS modifies:
2588 .\" NS   doc-arg-ptr
2590 .de doc-do-string
2591 .  nr doc-arg-ptr -1
2592 .  No
2596 .\" NS doc-do-punct-suffix macro
2597 .\" NS   call .No if punctuation suffix
2598 .\" NS
2599 .\" NS modifies:
2600 .\" NS   doc-arg-ptr
2602 .de doc-do-punct-suffix
2603 .  nr doc-arg-ptr -1
2604 .  No
2608 .\" NS doc-do-punct-prefix macro
2609 .\" NS   call .No if punctuation prefix
2610 .\" NS
2611 .\" NS modifies:
2612 .\" NS   doc-arg-ptr
2614 .de doc-do-punct-prefix
2615 .  nr doc-arg-ptr -1
2616 .  No
2620 .\" NS doc-do-xref-macro macro
2621 .\" NS   ignore if macro
2623 .de doc-do-xref-macro
2627 .\" NS doc-do-xref-string macro
2628 .\" NS   ignore if string
2630 .de doc-do-xref-string
2634 .\" NS doc-do-xref-punct-suffix macro
2635 .\" NS   append if punctuation suffix
2636 .\" NS
2637 .\" NS modifies:
2638 .\" NS   doc-arg-ptr, doc-out-string
2640 .de doc-do-xref-punct-suffix
2641 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2642 .  nr doc-arg-ptr +1
2643 .  \" XXX: ?
2644 .  n\\C\\n(aP
2648 .\" NS doc-do-xref-punct-prefix macro
2649 .\" NS   append if punctuation prefix
2650 .\" NS
2651 .\" NS modifies:
2652 .\" NS   doc-arg-ptr, doc-out-string
2654 .de doc-do-xref-punct-prefix
2655 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2656 .  nr doc-arg-ptr +1
2657 .  \" XXX: ?
2658 .  n\\C\\n(aP
2662 .\" NS doc-curr-font-for-Ef global register
2663 .\" NS   saved current font from `Bf' request
2665 .nr doc-curr-font-for-Ef 0
2668 .\" NS doc-curr-size-for-Ef global register
2669 .\" NS   saved current size from `Bf' request
2671 .nr doc-curr-size-for-Ef 0
2674 .\" NS Bf user macro
2675 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2676 .\" NS
2677 .\" NS modifies:
2678 .\" NS   doc-macro-name, doc-curr-font-for-Ef, doc-curr-size-for-Ef
2679 .\" NS
2680 .\" NS width register `Bf' set in doc-common
2682 .de Bf
2683 .  ds doc-macro-name Bf
2685 .  ie \n[.$] \{\
2686 .    nr doc-curr-font-for-Ef \n[.f]
2687 .    nr doc-curr-size-for-Ef \n[.s]
2689 .    ie        "\$1"Em" \
2690 .      nop \*[doc-Em-font]\c
2691 .    el \{ .ie "\$1"Li" \
2692 .      nop \*[doc-Li-font]\c
2693 .    el \{ .ie "\$1"Sy" \
2694 .      nop \*[doc-Sy-font]\c
2695 .    el \{ .ie "\$1"-emphasis" \
2696 .      nop \*[doc-Em-font]\c
2697 .    el \{ .ie "\$1"-literal" \
2698 .      nop \*[doc-Li-font]\c
2699 .    el \{ .ie "\$1"-symbolic" \
2700 .      nop \*[doc-Sy-font]\c
2701 .    el \{\
2702 .      tmc mdoc warning: Unknown keyword `\$1' in .Bf request
2703 .      tm1 " (#\n[.c])
2704 .  \}\}\}\}\}\}\}
2705 .  el \
2706 .    tm Usage .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2710 .\" NS Ef user macro
2711 .\" NS   end font mode
2712 .\" NS
2713 .\" NS modifies:
2714 .\" NS   doc-macro-name
2715 .\" NS
2716 .\" NS width register `Ef' set in doc-common
2718 .de Ef
2719 .  ds doc-macro-name Ef
2721 .  ie \n[.$] \
2722 .    tm Usage .Ef (does not take arguments) (#\n[.c])
2723 .  el \
2724 .    nop \&\f[\n[doc-curr-font-for-Ef]]\s[\n[doc-curr-size-for-Ef]]
2728 .\" NS doc-keep-type global string
2729 .\" NS   current keep type
2731 .ds doc-keep-type
2734 .\" NS Bk user macro
2735 .\" NS   begin keep
2736 .\" NS
2737 .\" NS modifies:
2738 .\" NS   doc-macro-name, doc-keep-type
2739 .\" NS
2740 .\" NS width register `Bk' set in doc-common
2742 .de Bk
2743 .  ds doc-keep-type
2745 .  ds doc-macro-name Bk
2747 .  ie \n[.$] \{\
2748 .    if !"\*[doc-keep-type]"" \
2749 .      tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2750 .    ie "\$1"-lines" \
2751 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2752 .    el \{\
2753 .      ie "\$1"-words" \
2754 .        doc-set-hard-space
2755 .      el \
2756 .        tm mdoc warning: Unknown keyword `\$1' in .Bk request (#\n[.c])
2757 .    \}
2759 .    ds doc-keep-type \$1
2760 .  \}
2761 .  el \
2762 .    tm Usage: .Bk [-lines | -words] (#\n[.c])
2766 .\" NS Ek user macro
2767 .\" NS   end keep
2768 .\" NS
2769 .\" NS modifies:
2770 .\" NS   doc-macro-name
2771 .\" NS
2772 .\" NS width register `Ek' set in doc-common
2774 .de Ek
2775 .  ds doc-macro-name Ek
2777 .  ie \n[.$] \
2778 .    tm Usage .Ek (does not take arguments) (#\n[.c])
2779 .  el \{\
2780 .    ie "\*[doc-keep-type]"-words" \
2781 .      doc-set-soft-space
2782 .    el \
2783 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2784 .  \}
2788 .\" NS doc-display-depth global register
2789 .\" NS   display level
2791 .nr doc-display-depth 0
2794 .\" NS doc-is-compact global register (bool)
2795 .\" NS   set if the `compact' keyword is given
2797 .nr doc-is-compact 0
2800 .\" NS doc-display-type-stackXXX global string
2801 .\" NS   the display type stack
2802 .\" NS
2803 .\" NS   limit: doc-display-depth
2805 .ds doc-display-type-stack0
2808 .\" NS doc-display-indent-stackXXX global register
2809 .\" NS   stack of display indentation values
2810 .\" NS
2811 .\" NS   limit: doc-display-depth
2813 .nr doc-display-indent-stack0 0
2816 .\" NS Bd user macro
2817 .\" NS   begin display
2818 .\" NS
2819 .\" NS width register `Bd' set in doc-common
2820 .\" NS
2821 .\" NS modifies:
2822 .\" NS   doc-macro-name, doc-curr-font, doc-curr-size, doc-display-depth,
2823 .\" NS   doc-is-compact, doc-display-type-stackXXX,
2824 .\" NS   doc-display-indent-stackXXX
2825 .\" NS
2826 .\" NS local variables:
2827 .\" NS   doc-reg-Bd
2829 .de Bd
2830 .  ds doc-macro-name Bd
2832 .  ie \n[.$] \{\
2833 .    nr doc-is-compact 0
2834 .    nr doc-reg-Bd 1
2835 .    nr doc-display-depth +1
2837 .    ie        "\$1"-literal" \{\
2838 .      ds doc-display-type-stack\n[doc-display-depth] literal
2839 .      nr doc-curr-font \n[.f]
2840 .      nr doc-curr-size \n[.s]
2842 .      ie t \{\
2843 .        nop \*[doc-Li-font]\c
2844 '        ta T 9n
2845 .      \}
2846 .      el \
2847 '        ta T 8n
2848 .      nf
2849 .    \}
2850 .    el \{ .ie "\$1"-filled" \{\
2851 .      ds doc-display-type-stack\n[doc-display-depth] filled
2852 .      br
2853 .    \}
2854 .    el \{ .ie "\$1"-ragged" \{\
2855 .      ds doc-display-type-stack\n[doc-display-depth] ragged
2856 .      na
2857 .    \}
2858 .    el \{ .ie "\$1"-unfilled" \{\
2859 .      ds doc-display-type-stack\n[doc-display-depth] unfilled
2860 .      nf
2861 .    \}
2862 .    el \{\
2863 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2864 .      nr doc-reg-Bd 0
2865 .    \}\}\}\}
2867 .    \" have we seen an argument?
2868 .    if \n[doc-reg-Bd] \{\
2869 .      shift
2870 .      \" check other arguments
2871 .      if \n[.$] \
2872 .        doc-do-Bd-args \$@
2873 .    \}
2875 .    \" avoid warning about non-existent register
2876 .    if !r doc-display-indent-stack\n[doc-display-depth] \
2877 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2879 .    if \n[doc-display-indent-stack\n[doc-display-depth]] \
2880 '      in (\n[.i]u + \n[doc-display-indent-stack\n[doc-display-depth]]u)
2882 .    if !\n[doc-is-compact] \{\
2883 .      if !\n[doc-in-synopsis-count] \{\
2884 .        ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2885 .          sp \n[doc-display-vertical]u
2886 .        el \
2887 '          sp \n[doc-display-vertical]u
2888 .    \}\}
2890 .    if !\n[cR] \
2891 .      ne 2v
2893 .    nr doc-is-compact 0
2894 .  \}
2895 .  el \{\
2896 .    tm1 "Usage: .Bd [-literal | -filled | -ragged | -unfilled]
2897 .    tm1 "           [-offset [string]] [-compact] (#\n[.c])
2898 .  \}
2902 .\" NS doc-do-Bd-args macro
2903 .\" NS   resolve remaining .Bd arguments
2904 .\" NS
2905 .\" NS modifies:
2906 .\" NS   doc-is-compact, doc-display-indent-stackXXX
2907 .\" NS
2908 .\" NS local variables:
2909 .\" NS   doc-str-ddBa, doc-reg-ddBa
2911 .de doc-do-Bd-args
2912 .  nr doc-reg-ddBa 1
2913 .  ds doc-str-ddBa
2915 .  ie        "\$1"-offset" \{\
2916 .    ds doc-str-ddBa "\$2
2917 .    nr doc-reg-ddBa 2
2919 .    ie        "\$2"left" \
2920 .      nr doc-display-indent-stack\n[doc-display-depth] 0
2921 .    el \{ .ie "\$2"right" \
2922 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2923 .    el \{ .ie "\$2"center" \
2924 .      nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2925 .    el \{ .ie "\$2"indent" \
2926 .      nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2927 .    el \{ .ie "\$2"indent-two" \
2928 .      nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2929 .    el \
2930 .      nr doc-reg-ddBa 1
2931 .    \}\}\}\}
2933 .    \" not a known keyword
2934 .    if (\n[doc-reg-ddBa] == 1) \{\
2935 .      nr doc-reg-ddBa 2
2936 .      \" test whether argument is a valid numeric expression
2937 .      ie \B\a\$2\a \
2938 .        nr doc-display-indent-stack\n[doc-display-depth] \$2
2939 .      el \{\
2940 .        doc-get-width "\$2"
2941 .        ie (\n[doc-width] == 2) \{\
2942 .          \" if the offset parameter is a macro, use the macro's
2943 .          \" width as specified in doc-common
2944 .          doc-get-arg-type "\$2"
2945 .          ie "\*[doc-arg-type]"macro" \
2946 .            nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
2947 .          el \
2948 .            nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2949 .        \}
2950 .        el \
2951 .          nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
2952 .    \}\}
2953 .  \}
2954 .  el \{ .ie "\$1"-compact" \
2955 .    nr doc-is-compact 1
2956 .  el \
2957 .      tm mdoc warning: Unknown keyword `\$1' in .Bd request (#\n[.c])
2958 .  \}
2960 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
2961 .    \" have we seen `-offset' or `-compact'?
2962 .    ie "\*[doc-str-ddBa]"" \{\
2963 .      shift
2964 .      doc-do-Bd-args \$@
2965 .    \}
2966 .    el \{\
2967 .      shift 2
2968 .      doc-do-Bd-args \$@
2969 .  \}\}
2973 .\" NS Ed user macro
2974 .\" NS   end display
2975 .\" NS
2976 .\" NS modifies:
2977 .\" NS   doc-macro-name, doc-display-depth, doc-display-type-stackXXX,
2978 .\" NS   doc-display-indent-stackXXX
2979 .\" NS
2980 .\" NS width register `Ed' set in doc-common
2982 .de Ed
2983 .  ds doc-macro-name Ed
2985 .  br
2987 .  if !\n[doc-display-depth] \
2988 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
2990 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2991 .    ft \n[doc-curr-font]
2992 .    ps \n[doc-curr-size]
2993 .  \}
2995 .  in (\n[.i]u - \n[doc-display-indent-stack\n[doc-display-depth]]u)
2997 .  nr doc-display-indent-stack\n[doc-display-depth] 0
2998 .  ds doc-display-type-stack\n[doc-display-depth]
2999 .  nr doc-display-depth -1
3001 .  fi
3002 .  if t \
3003 .    ad
3007 .\" NS doc-list-type-stackXXX global string
3008 .\" NS   stack of list types
3009 .\" NS
3010 .\" NS   limit: doc-list-depth
3012 .ds doc-list-type-stack1
3015 .\" NS doc-list-indent-stackXXX global register
3016 .\" NS   stack of list indentation values
3017 .\" NS
3018 .\" NS   limit: doc-list-depth
3020 .nr doc-list-indent-stack1 0
3023 .\" NS doc-have-indent global register (bool)
3024 .\" NS   an indentation value is active
3026 .nr doc-have-indent 0
3029 .\" NS Bl user macro
3030 .\" NS   begin list
3031 .\" NS
3032 .\" NS width register `Bl' set in doc-common
3033 .\" NS
3034 .\" NS modifies:
3035 .\" NS   doc-macro-name, doc-num-args, doc-arg-ptr, doc-argXXX,
3036 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX, doc-have-indent,
3037 .\" NS   doc-have-diag-list, doc-num-columns, doc-list-depth
3038 .\" NS
3039 .\" NS local variables:
3040 .\" NS   doc-reg-Bl
3042 .de Bl
3043 .  ie \n[.$] \{\
3044 .    ds doc-macro-name Bl
3045 .    nr doc-list-depth +1
3046 .    nr doc-arg-ptr 1
3048 .    ie        "\$1"-hang" \{\
3049 .      ds doc-list-type-stack\n[doc-list-depth] hang-list
3050 .      nr doc-list-indent-stack\n[doc-list-depth] 6n
3051 .      nr doc-have-indent 1
3052 .    \}
3053 .    el \{ .ie "\$1"-tag" \{\
3054 .      ds doc-list-type-stack\n[doc-list-depth] tag-list
3055 .      nr doc-have-indent 1
3056 .    \}
3057 .    el \{ .ie "\$1"-item" \{\
3058 .      ds doc-list-type-stack\n[doc-list-depth] item-list
3059 .      nr doc-have-indent 1
3060 .    \}
3061 .    el \{ .ie "\$1"-enum" \{\
3062 .      ds doc-list-type-stack\n[doc-list-depth] enum-list
3063 .      nr doc-list-indent-stack\n[doc-list-depth] 3n
3064 .      nr doc-have-indent 1
3065 .    \}
3066 .    el \{ .ie "\$1"-bullet" \{\
3067 .      ds doc-list-type-stack\n[doc-list-depth] bullet-list
3068 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3069 .      nr doc-have-indent 1
3070 .    \}
3071 .    el \{ .ie "\$1"-dash" \{\
3072 .      ds doc-list-type-stack\n[doc-list-depth] dash-list
3073 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3074 .      nr doc-have-indent 1
3075 .    \}
3076 .    el \{ .ie "\$1"-hyphen" \{\
3077 .      ds doc-list-type-stack\n[doc-list-depth] dash-list
3078 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
3079 .      nr doc-have-indent 1
3080 .    \}
3081 .    el \{ .ie "\$1"-inset" \{\
3082 .      ds doc-list-type-stack\n[doc-list-depth] inset-list
3083 .      nr doc-have-indent 1
3084 .    \}
3085 .    el \{ .ie "\$1"-diag" \{\
3086 .      ds doc-list-type-stack\n[doc-list-depth] diag-list
3087 .      nr doc-have-diag-list 1
3088 .    \}
3089 .    el \{ .ie "\$1"-ohang" \{\
3090 .      ds doc-list-type-stack\n[doc-list-depth] ohang-list
3091 .      nr doc-have-indent 1
3092 .    \}
3093 .    el \{ .ie "\$1"-column" \
3094 .      ds doc-list-type-stack\n[doc-list-depth] column-list
3095 .    el \{\
3096 .      tm mdoc warning: Unknown list type `\$1' in .Bl request
3097 .      tm
3098 .      nr doc-arg-ptr 0
3099 .    \}\}\}\}\}\}\}\}\}\}\}
3101 .    \" we have seen a list type
3102 .    ie \n[doc-arg-ptr] \{\
3103 .      shift
3105 .      \" fill argument vector
3106 .      nr doc-reg-Bl 1
3107 .      while (\n[doc-reg-Bl] <= \n[.$]) \{\
3108 .        ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
3109 .        nr doc-reg-Bl +1
3110 .      \}
3112 .      doc-increment-list-stack
3114 .      if \n[.$] \{\
3115 .        nr doc-arg-limit \n[.$]
3116 .        nr doc-arg-ptr 0
3117 .        doc-do-Bl-args
3119 .        \" initialize column list
3120 .        if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3121 .          doc-set-column-tab \n[doc-num-columns]
3122 .          nr doc-list-indent-stack\n[doc-list-depth] 0
3123 '          in -\n[doc-column-indent-width]u
3124 .          if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3125 .            sp \n[doc-display-vertical]u
3127 .          nf
3128 .          nr doc-num-columns 0
3129 .    \}\}\}
3130 .    el \
3131 .      doc-Bl-usage
3133 .    doc-reset-args
3134 .  \}
3135 .  el \
3136 .    doc-Bl-usage
3140 .\" NS doc-Bl-usage macro
3142 .de doc-Bl-usage
3143 .  tm1 "Usage: .Bl [-hang | -ohang | -tag | -diag | -inset]
3144 .  tm1 "             [-width [string]] [-offset [string]] [-compact]
3145 .  tm1 "       .Bl [-column] [-offset [string]] [string1] [string2] ...
3146 .  tm1 "       .Bl [-item | -enum | -bullet | -hyphen | -dash]
3147 .  tm1 "             [-offset [string]] [-compact] (#\n[.c])
3151 .\" NS doc-have-tag-width global macro
3152 .\" NS   set if a tag width has been explicitly given
3154 .nr doc-have-tag-width 0
3157 .\" NS doc-do-Bl-args macro
3158 .\" NS   resolve remaining .Bl arguments
3159 .\" NS
3160 .\" NS modifies:
3161 .\" NS   doc-arg-ptr, doc-argXXX, doc-list-indent-stackXXX, doc-num-columns,
3162 .\" NS   doc-compact-list-stackXXX, doc-have-tag-width,
3163 .\" NS   doc-tag-width-stackXXX, doc-list-offset-stackXXX
3164 .\" NS
3165 .\" NS local variables:
3166 .\" NS   doc-str-dBla, doc-reg-dBla
3168 .de doc-do-Bl-args
3169 .  nr doc-arg-ptr +1
3170 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
3171 .    nr doc-reg-dBla 1
3173 .    ie        "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
3174 .      nr doc-compact-list-stack\n[doc-list-depth] 1
3175 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
3176 .      nr doc-arg-ptr +1
3177 .      \" XXX: this code should be modified to handle nested lists
3178 .      \"      of any type
3179 .      nr doc-have-tag-width 1
3180 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3181 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3183 .      \" test whether argument is a valid numeric expression
3184 .      ie \B\a\*[doc-str-dBla]\a \
3185 .        nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]
3186 .      el \{\
3187 .        doc-get-arg-width \n[doc-arg-ptr]
3188 .        ie (\n[doc-width] == 2) \{\
3189 .          \" if the width parameter is a macro, use the macro's
3190 .          \" width as specified in doc-common
3191 .          doc-get-arg-type \*[doc-str-dBla]
3192 .          ie "\*[doc-arg-type]"macro" \
3193 .            nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3194 .          el \
3195 .            nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3196 .        \}
3197 .        el \
3198 .          nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3199 .    \}\}
3200 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-xwidth" \{\
3201 .      nr doc-arg-ptr +1
3202 .      \" XXX: this code should be modified to handle nested lists
3203 .      \"      of any type
3204 .      nr doc-have-tag-width 1
3205 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
3207 .      ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
3208 .      substring doc-str-dBla 1 2
3209 .      if \a.\a\*[doc-str-dBla]\a \{\
3210 .        doc-save-global-vars
3211 .        nr doc-in-diversion 0
3212 .        nr doc-nesting-level 0
3213 .        ds doc-out-string
3214 .        doc-dry-execute "\*[doc-arg\n[doc-arg-ptr]]"
3215 .        \" save doc-out-string
3216 .        ds doc-str-dBla "\*[doc-out-string]
3217 .        doc-restore-global-vars
3218 .        doc-get-width "\*[doc-str-dBla]"
3219 .      \}
3220 .      nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3221 .    \}
3222 .    el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
3223 .      nr doc-arg-ptr +1
3225 .      ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
3226 .        nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
3227 .      el \{\
3228 .        ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
3230 .        ie \B\a\*[doc-str-dBla]\a \
3231 .          nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
3232 .        el \{\
3233 .          doc-get-arg-width \n[doc-arg-ptr]
3234 .          ie (\n[doc-width] == 2) \{\
3235 .            doc-get-arg-type \*[doc-str-dBla]
3236 .            ie "\*[doc-arg-type]"macro" \
3237 .              nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
3238 .            el \
3239 .              nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3240 .          \}
3241 .          el \
3242 .            nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
3243 .    \}\}\}
3244 .    el \
3245 .      nr doc-reg-dBla 0
3246 .    \}\}\}
3248 .    \" not a known keyword, so it specifies the width of the next column
3249 .    \" (if it is a column list)
3250 .    if !\n[doc-reg-dBla] \{\
3251 .      ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
3252 .        nr doc-num-columns +1
3253 .        ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
3254 .      \}
3255 .      el \{\
3256 .        tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
3257 .        tm1 " in .Bl request (#\n[.c])
3258 .    \}\}
3260 .    if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
3261 .      doc-do-Bl-args
3262 .  \}
3266 .\" NS doc-save-global-vars macro
3267 .\" NS   save all global variables
3268 .\" NS
3269 .\" NS local variables:
3270 .\" NS   doc-reg-dsgv
3272 .de doc-save-global-vars
3273 .  nr doc-debug-saved \n[doc-debug]
3274 .  ds doc-macro-name-saved "\*[doc-macro-name]
3275 .  nr doc-arg-limit-saved \n[doc-arg-limit]
3276 .  nr doc-num-args-saved \n[doc-num-args]
3277 .  nr doc-arg-ptr-saved \n[doc-arg-ptr]
3279 .  nr doc-reg-dsgv 1
3280 .  while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
3281 .    ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
3282 .    ds doc-type\n[doc-reg-dsgv]-saved "\*[doc-type\n[doc-reg-dsgv]]
3283 .    ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
3284 .    nr doc-reg-dsgv +1
3285 .  \}
3287 .  ds doc-out-string-saved "\*[doc-out-string]
3288 .  ds doc-curr-space-saved "\*[doc-curr-space]
3289 .  ds doc-saved-out-string-saved "\*[doc-saved-out-string]
3290 .  nr doc-in-diversion-saved \n[doc-in-diversion]
3291 .  nr doc-curr-font-saved \n[doc-curr-font]
3292 .  nr doc-curr-size-saved \n[doc-curr-size]
3293 .  nr doc-in-synopsis-count-saved \n[doc-in-synopsis-count]
3294 .  nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
3295 .  nr doc-have-decl-saved \n[doc-have-decl]
3296 .  nr doc-have-var-saved \n[doc-have-var]
3297 .  ds doc-command-name-saved "\*[doc-command-name]
3298 .  ds doc-quote-left-saved "\*[doc-quote-left]
3299 .  ds doc-quote-right-saved "\*[doc-quote-right]
3300 .  nr doc-nesting-level-saved \n[doc-nesting-level]
3301 .  ds doc-saved-list-type-saved "\*[doc-saved-list-type]
3302 .  ds doc-space-saved "\*[doc-space]
3303 .  nr doc-space-mode-saved \n[doc-space-mode]
3304 .  nr doc-curr-font-for-Ef-saved \n[doc-curr-font-for-Ef]
3305 .  nr doc-curr-size-for-Ef-saved \n[doc-curr-size-for-Ef]
3306 .  ds doc-keep-type-saved "\*[doc-keep-type]
3307 .  nr doc-display-depth-saved \n[doc-display-depth]
3308 .  nr doc-is-compact-saved \n[doc-is-compact]
3310 .  nr doc-reg-dsgv 0
3311 .  while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
3312 .    ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
3313 .    nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
3314 .    nr doc-reg-dsgv +1
3315 .  \}
3317 .  nr doc-list-depth-saved \n[doc-list-depth]
3319 .  nr doc-reg-dsgv 1
3320 .  while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
3321 .    ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
3322 .    nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
3323 .    nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
3324 .    ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
3325 .    nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
3326 .    nr doc-reg-dsgv +1
3327 .  \}
3329 .  nr doc-have-indent-saved \n[doc-have-indent]
3330 .  nr doc-have-tag-width-saved \n[doc-have-tag-width]
3331 .  nr doc-no-printing-saved \n[doc-no-printing]
3332 .  ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
3333 .  ds doc-curr-type-saved "\*[doc-curr-type]
3334 .  ds doc-curr-arg-saved "\*[doc-curr-arg]
3335 .  nr doc-enum-list-count-saved \n[doc-enum-list-count]
3336 .  nr doc-have-diag-list-saved \n[doc-have-diag-list]
3337 .  nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
3338 .  nr doc-saved-list-immediate-saved \n[doc-saved-list-immediate]
3339 .  nr doc-list-immediate-saved \n[doc-list-immediate]
3340 .  nr doc-num-columns-saved \n[doc-num-columns]
3341 .  nr doc-next-list-depth-saved \n[doc-next-list-depth]
3342 .  nr doc-column-indent-width-saved \n[doc-column-indent-width]
3343 .  nr doc-is-func-saved \n[doc-is-func]
3344 .  nr doc-have-old-func-saved \n[doc-have-old-func]
3345 .  nr doc-func-arg-count-saved \n[doc-func-arg-count]
3346 .  ds doc-func-arg-saved "\*[doc-func-arg]
3347 .  nr doc-num-func-args-saved \n[doc-num-func-args]
3348 .  nr doc-func-args-processed-saved \n[doc-func-args-processed]
3349 .  nr doc-have-func-saved \n[doc-have-func]
3350 .  nr doc-is-reference-saved \n[doc-is-reference]
3351 .  nr doc-reference-count-saved \n[doc-reference-count]
3352 .  ds doc-reference-string-name-saved "\*[doc-reference-string-name]
3353 .  nr doc-authors-processed-saved \n[doc-authors-processed]
3354 .  nr doc-author-count-saved \n[doc-author-count]
3356 .  nr doc-reg-dsgv 0
3357 .  while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
3358 .    ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
3359 .    nr doc-reg-dsgv +1
3360 .  \}
3362 .  nr doc-book-count-saved \n[doc-book-count]
3363 .  ds doc-book-name-saved "\*[doc-book-name]
3364 .  nr doc-date-count-saved \n[doc-date-count]
3365 .  ds doc-date-saved "\*[doc-date]
3366 .  nr doc-publisher-count-saved \n[doc-publisher-count]
3367 .  ds doc-publisher-name-saved "\*[doc-publisher-name]
3368 .  nr doc-journal-count-saved \n[doc-journal-count]
3369 .  ds doc-journal-name-saved "\*[doc-journal-name]
3370 .  nr doc-issue-count-saved \n[doc-issue-count]
3371 .  ds doc-issue-name-saved "\*[doc-issue-name]
3372 .  nr doc-optional-count-saved \n[doc-optional-count]
3373 .  ds doc-optional-string-saved "\*[doc-optional-string]
3374 .  nr doc-page-number-count-saved \n[doc-page-number-count]
3375 .  ds doc-page-number-string-saved "\*[doc-page-number-string]
3376 .  nr doc-corporate-count-saved \n[doc-corporate-count]
3377 .  ds doc-corporate-name-saved "\*[doc-corporate-name]
3378 .  nr doc-report-count-saved \n[doc-report-count]
3379 .  ds doc-report-name-saved "\*[doc-report-name]
3380 .  nr doc-reference-title-count-saved \n[doc-reference-title-count]
3381 .  ds doc-reference-title-name-saved "\*[doc-reference-title-name]
3382 .  nr doc-volume-count-saved \n[doc-volume-count]
3383 .  ds doc-volume-name-saved "\*[doc-volume-name]
3384 .  nr doc-have-author-saved \n[doc-have-author]
3386 .  ds doc-document-title-saved "\*[doc-document-title]
3387 .  ds doc-volume-saved "\*[doc-volume]
3388 .  ds doc-section-saved "\*[doc-section]
3389 .  ds doc-operating-system-saved "\*[doc-operating-system]
3390 .  ds doc-date-string-saved "\*[doc-date-string]
3391 .  nr doc-header-space-saved \n[doc-header-space]
3392 .  nr doc-footer-space-saved \n[doc-footer-space]
3393 .  nr doc-display-vertical-saved \n[doc-display-vertical]
3394 .  ds doc-header-string-saved "\*[doc-header-string]
3395 .  nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
3396 .  nr doc-in-files-section-saved \n[doc-in-files-section]
3397 .  nr doc-in-authors-section-saved \n[doc-in-authors-section]
3401 .\" NS doc-restore-global-vars macro
3402 .\" NS   restore all global variables
3403 .\" NS
3404 .\" NS local variables:
3405 .\" NS   doc-reg-drgv
3407 .de doc-restore-global-vars
3408 .  nr doc-debug \n[doc-debug-saved]
3409 .  ds doc-macro-name "\*[doc-macro-name-saved]
3410 .  nr doc-arg-limit \n[doc-arg-limit-saved]
3411 .  nr doc-num-args \n[doc-num-args-saved]
3412 .  nr doc-arg-ptr \n[doc-arg-ptr-saved]
3414 .  nr doc-reg-drgv 1
3415 .  while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
3416 .    ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
3417 .    ds doc-type\n[doc-reg-drgv] "\*[doc-type\n[doc-reg-drgv]-saved]
3418 .    ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
3419 .    nr doc-reg-drgv +1
3420 .  \}
3422 .  ds doc-out-string "\*[doc-out-string-saved]
3423 .  ds doc-curr-space "\*[doc-curr-space-saved]
3424 .  ds doc-saved-out-string "\*[doc-saved-out-string-saved]
3425 .  nr doc-in-diversion \n[doc-in-diversion-saved]
3426 .  nr doc-curr-font \n[doc-curr-font-saved]
3427 .  nr doc-curr-size \n[doc-curr-size-saved]
3428 .  nr doc-in-synopsis-count \n[doc-in-synopsis-count-saved]
3429 .  nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
3430 .  nr doc-have-decl \n[doc-have-decl-saved]
3431 .  nr doc-have-var \n[doc-have-var-saved]
3432 .  ds doc-command-name "\*[doc-command-name-saved]
3433 .  ds doc-quote-left "\*[doc-quote-left-saved]
3434 .  ds doc-quote-right "\*[doc-quote-right-saved]
3435 .  nr doc-nesting-level \n[doc-nesting-level-saved]
3436 .  ds doc-saved-list-type "\*[doc-saved-list-type-saved]
3437 .  ds doc-space "\*[doc-space-saved]
3438 .  nr doc-space-mode \n[doc-space-mode-saved]
3439 .  nr doc-curr-font-for-Ef \n[doc-curr-font-for-Ef-saved]
3440 .  nr doc-curr-size-for-Ef \n[doc-curr-size-for-Ef-saved]
3441 .  ds doc-keep-type "\*[doc-keep-type-saved]
3442 .  nr doc-display-depth \n[doc-display-depth-saved]
3443 .  nr doc-is-compact \n[doc-is-compact-saved]
3445 .  nr doc-reg-drgv 0
3446 .  while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
3447 .    ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
3448 .    nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
3449 .    nr doc-reg-drgv +1
3450 .  \}
3452 .  nr doc-list-depth \n[doc-list-depth-saved]
3454 .  nr doc-reg-drgv 1
3455 .  while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
3456 .    ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
3457 .    nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
3458 .    nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
3459 .    ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
3460 .    nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
3461 .    nr doc-reg-drgv +1
3462 .  \}
3464 .  nr doc-have-indent \n[doc-have-indent-saved]
3465 .  nr doc-have-tag-width \n[doc-have-tag-width-saved]
3466 .  nr doc-no-printing \n[doc-no-printing-saved]
3467 .  ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
3468 .  ds doc-curr-type "\*[doc-curr-type-saved]
3469 .  ds doc-curr-arg "\*[doc-curr-arg-saved]
3470 .  nr doc-enum-list-count \n[doc-enum-list-count-saved]
3471 .  nr doc-have-diag-list \n[doc-have-diag-list-saved]
3472 .  nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
3473 .  nr doc-saved-list-immediate \n[doc-saved-list-immediate-saved]
3474 .  nr doc-list-immediate \n[doc-list-immediate-saved]
3475 .  nr doc-num-columns \n[doc-num-columns-saved]
3476 .  nr doc-next-list-depth \n[doc-next-list-depth-saved]
3477 .  nr doc-column-indent-width \n[doc-column-indent-width-saved]
3478 .  nr doc-is-func \n[doc-is-func-saved]
3479 .  nr doc-have-old-func \n[doc-have-old-func-saved]
3480 .  nr doc-func-arg-count \n[doc-func-arg-count-saved]
3481 .  ds doc-func-arg "\*[doc-func-arg-saved]
3482 .  nr doc-num-func-args \n[doc-num-func-args-saved]
3483 .  nr doc-func-args-processed \n[doc-func-args-processed-saved]
3484 .  nr doc-have-func \n[doc-have-func-saved]
3485 .  nr doc-is-reference \n[doc-is-reference-saved]
3486 .  nr doc-reference-count \n[doc-reference-count-saved]
3487 .  ds doc-reference-string-name "\*[doc-reference-string-name-saved]
3488 .  nr doc-authors-processed \n[doc-authors-processed-saved]
3489 .  nr doc-author-count \n[doc-author-count-saved]
3491 .  nr doc-reg-drgv 0
3492 .  while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
3493 .    ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
3494 .    nr doc-reg-drgv +1
3495 .  \}
3497 .  nr doc-book-count \n[doc-book-count-saved]
3498 .  ds doc-book-name "\*[doc-book-name-saved]
3499 .  nr doc-date-count \n[doc-date-count-saved]
3500 .  ds doc-date "\*[doc-date-saved]
3501 .  nr doc-publisher-count \n[doc-publisher-count-saved]
3502 .  ds doc-publisher-name "\*[doc-publisher-name-saved]
3503 .  nr doc-journal-count \n[doc-journal-count-saved]
3504 .  ds doc-journal-name "\*[doc-journal-name-saved]
3505 .  nr doc-issue-count \n[doc-issue-count-saved]
3506 .  ds doc-issue-name "\*[doc-issue-name-saved]
3507 .  nr doc-optional-count \n[doc-optional-count-saved]
3508 .  ds doc-optional-string "\*[doc-optional-string-saved]
3509 .  nr doc-page-number-count \n[doc-page-number-count-saved]
3510 .  ds doc-page-number-string "\*[doc-page-number-string-saved]
3511 .  nr doc-corporate-count \n[doc-corporate-count-saved]
3512 .  ds doc-corporate-name "\*[doc-corporate-name-saved]
3513 .  nr doc-report-count \n[doc-report-count-saved]
3514 .  ds doc-report-name "\*[doc-report-name-saved]
3515 .  nr doc-reference-title-count \n[doc-reference-title-count-saved]
3516 .  ds doc-reference-title-name "\*[doc-reference-title-name-saved]
3517 .  nr doc-volume-count \n[doc-volume-count-saved]
3518 .  ds doc-volume-name "\*[doc-volume-name-saved]
3519 .  nr doc-have-author \n[doc-have-author-saved]
3521 .  ds doc-document-title "\*[doc-document-title-saved]
3522 .  ds doc-volume "\*[doc-volume-saved]
3523 .  ds doc-section "\*[doc-section-saved]
3524 .  ds doc-operating-system "\*[doc-operating-system-saved]
3525 .  ds doc-date-string "\*[doc-date-string-saved]
3526 .  nr doc-header-space \n[doc-header-space-saved]
3527 .  nr doc-footer-space \n[doc-footer-space-saved]
3528 .  nr doc-display-vertical \n[doc-display-vertical-saved]
3529 .  ds doc-header-string "\*[doc-header-string-saved]
3530 .  nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
3531 .  nr doc-in-files-section \n[doc-in-files-section-saved]
3532 .  nr doc-in-authors-section \n[doc-in-authors-section-saved]
3536 .\" NS doc-no-printing global register (bool)
3537 .\" NS   set if output is suppressed
3539 .nr doc-no-printing 0
3542 .\" NS doc-dry-execute macro
3543 .\" NS   execute a string (splitting one arg into multiple args) without
3544 .\" NS   output; this command must be surrounded by `doc-save-global-args'
3545 .\" NS   and `doc-restore-global-args'
3547 .de doc-dry-execute
3548 .  doc-reset-args
3549 .  nr doc-no-printing 1
3550 .  ds doc-str-de \$1
3551 .  shift
3552 .  nop \*[doc-str-de] \$@
3553 .  nr doc-no-printing 0
3557 .\" NS El user macro
3558 .\" NS   end list
3559 .\" NS
3560 .\" NS modifies:
3561 .\" NS   doc-macro-name, doc-have-diag-list, doc-enum-list-count,
3562 .\" NS   doc-list-depth
3563 .\" NS
3564 .\" NS local variables:
3565 .\" NS   doc-str-El, doc-reg-El
3566 .\" NS
3567 .\" NS width register `El' set in doc-common
3569 .de El
3570 .  ie \n[.$] \
3571 .    tm Usage: .El (does not take arguments) (#\n[.c])
3572 .  el \{\
3573 .    ds doc-macro-name El
3574 .    nr doc-reg-El 0
3575 .    ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
3577 .    ie        "\*[doc-str-El]"enum-list" \
3578 .      nr doc-enum-list-count 0
3579 .    el \{ .ie "\*[doc-str-El]"column-list" \{\
3580 .      nr doc-reg-El 1
3581 .      doc-do-end-column-list
3582 .    \}
3583 .    el \{ .ie "\*[doc-str-El]"item-list" \{\
3584 .      nr doc-reg-El 1
3585 '      in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
3586 .      doc-decrement-list-stack
3587 .      nr doc-list-depth -1
3588 .      doc-increment-list-stack
3589 .    \}
3590 .    el \{ .ie "\*[doc-str-El]"ohang-list" \{\
3591 .      nr doc-reg-El 1
3592 '      in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
3593 .      doc-decrement-list-stack
3594 .      nr doc-list-depth -1
3595 .      doc-increment-list-stack
3596 .    \}
3597 .    el \{ .if "\*[doc-str-El]"inset-list" \{\
3598 .      nr doc-reg-El 1
3599 '      in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
3600 .      doc-decrement-list-stack
3601 .      nr doc-list-depth -1
3602 .      doc-increment-list-stack
3603 .    \}\}\}\}\}
3605 .    \" XXX: this code should be modified to handle nested lists of any type
3606 .    if \n[doc-have-diag-list] \
3607 .      nr doc-have-diag-list 0
3609 .    if !\n[doc-reg-El] \
3610 .      doc-end-list
3612 .    br
3613 .  \}
3617 .\" NS doc-saved-Pa-font global string
3618 .\" NS   saved doc-Pa-font string for section FILES (no underline if
3619 .\" NS   nroff)
3621 .ds doc-saved-Pa-font
3624 .\" NS doc-curr-type global string
3625 .\" NS   current argument type
3627 .ds doc-curr-type
3630 .\" NS doc-curr-arg global string
3631 .\" NS   current argument
3633 .ds doc-curr-arg
3636 .\" NS It user macro
3637 .\" NS   list item
3638 .\" NS
3639 .\" NS modifies:
3640 .\" NS   doc-macro-name, doc-num-args, doc-arg-ptr, doc-argXXX,
3641 .\" NS   doc-out-string, doc-nesting-level, doc-list-immediate,
3642 .\" NS   doc-saved-list-type, doc-saved-Pa-font, doc-curr-type, doc-curr-arg,
3643 .\" NS
3644 .\" NS width register `It' set in doc-common
3645 .\" NS
3646 .\" NS local variables:
3647 .\" NS   doc-str-It, doc-reg-It
3649 .de It
3650 .  ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
3652 .  if "\*[doc-str-It]"" \
3653 .    tm mdoc error: .It without preceding .Bl (#\n[.c])
3655 .  br
3656 .  if !\n[cR] \
3657 .    ne 3v
3659 .  ie \n[.$] \{\
3660 .    ds doc-macro-name It
3661 .    ds doc-out-string
3663 .    \" fill argument vector
3664 .    nr doc-reg-It 1
3665 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3666 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3667 .      nr doc-reg-It +1
3668 .    \}
3670 .    nr doc-num-args \n[.$]
3671 .    nr doc-arg-ptr 0
3672 .    nr doc-reg-It 1
3674 .    ie "\*[doc-str-It]"diag-list" \{\
3675 .      doc-remaining-args
3676 .      doc-diag-list
3677 .      nr doc-reg-It 0
3678 .    \}
3679 .    el \{\
3680 .      ie        "\*[doc-str-It]"column-list" \{\
3681 .        ds doc-out-string
3682 .        doc-column-list
3683 .        nr doc-reg-It 0
3684 .      \}
3685 .      el \{ .ie "\*[doc-str-It]"tag-list" \
3686 .        nr doc-reg-It 2
3687 .      el \{ .ie "\*[doc-str-It]"hang-list" \
3688 .        nr doc-reg-It 2
3689 .      el \{ .ie "\*[doc-str-It]"ohang-list" \
3690 .        nr doc-reg-It 2
3691 .      el \{ .if "\*[doc-str-It]"inset-list" \
3692 .        nr doc-reg-It 2
3693 .    \}\}\}\}\}
3695 .    if \n[doc-reg-It] \{\
3696 .      ie (\n[doc-reg-It] == 2) \{\
3697 .        \" handle remaining list types with arguments
3698 .        doc-parse-arg-vector
3700 .        nr doc-nesting-level +1
3701 .        nr doc-list-immediate 1
3702 .        nr doc-arg-ptr 1
3703 .        ds doc-curr-type \*[doc-type1]
3704 .        ds doc-curr-arg "\*[doc-arg1]
3706 .        if \n[doc-in-files-section] \{\
3707 .          ds doc-saved-Pa-font "\*[doc-Pa-font]
3708 .          if n \
3709 .            ds doc-Pa-font "\*[doc-No-font]
3710 .        \}
3712 .        ie "\*[doc-type1]"macro" \
3713 .          \*[doc-arg1]
3714 .        el \{\
3715 .          nr doc-arg-ptr 0
3716 .          No
3717 .        \}
3719 .        ie \n[doc-saved-list-immediate] \
3720 .          ds doc-saved-list-type "\*[doc-str-It]
3721 .        el \
3722 .          doc-\*[doc-str-It]
3723 .      \}
3724 .      el \{\
3725 .        .tm1 "mdoc warning: .It requests in lists of type `\*[doc-str-It]'
3726 .        .tm1 "              don't take arguments (#\n[.c])
3727 .        doc-\*[doc-str-It]
3728 .  \}\}\}
3729 .  el \
3730 .    doc-\*[doc-str-It]
3734 .\" NS doc-inset-list macro
3735 .\" NS   .It item of list-type inset
3736 .\" NS
3737 .\" NS modifies:
3738 .\" NS   doc-out-string, doc-nesting-level, doc-list-immediate
3740 .de doc-inset-list
3741 .  doc-set-vertical-and-indent 0
3742 .  br
3743 .  nop \&\*[doc-out-string]
3745 .  nr doc-nesting-level -1
3746 .  nr doc-list-immediate 0
3747 .  ds doc-out-string
3748 .  doc-reset-args
3749 '  fi
3753 .\" NS doc-hang-list macro
3754 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3755 .\" NS
3756 .\" NS modifies:
3757 .\" NS   doc-out-string, doc-nesting-level, doc-list-immediate
3758 .\" NS
3759 .\" NS local variables:
3760 .\" NS   doc-reg-dhl
3762 .de doc-hang-list
3763 .  doc-set-vertical-and-indent 1
3764 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3765 .  ti -\n[doc-reg-dhl]u
3767 .  ie (\w\a\*[doc-out-string]\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3768 .    nop \&\*[doc-out-string]
3769 .  el \
3770 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dhl]u'\c
3772 .  nr doc-nesting-level -1
3773 .  ds doc-out-string
3774 .  nr doc-list-immediate 0
3775 .  doc-reset-args
3776 '  fi
3780 .\" NS doc-ohang-list macro
3781 .\" NS   .It item of list-type overhanging tag
3782 .\" NS
3783 .\" NS modifies:
3784 .\" NS   doc-out-string, doc-nesting-level, doc-list-immediate
3786 .de doc-ohang-list
3787 .  doc-set-vertical-and-indent 0
3788 .  nop \&\*[doc-out-string]
3789 .  br
3791 .  nr doc-nesting-level -1
3792 .  ds doc-out-string
3793 .  nr doc-list-immediate 0
3794 .  doc-reset-args
3795 '  fi
3799 .\" NS doc-item-list macro
3800 .\" NS   .It item of list-type [empty tag]
3802 .de doc-item-list
3803 .  doc-set-vertical-and-indent 0
3804 .  br
3806 .  doc-reset-args
3807 '  fi
3811 .\" NS doc-enum-list-count global register
3812 .\" NS   contains current enum count value
3814 .nr doc-enum-list-count 0
3817 .\" NS doc-enum-list macro
3818 .\" NS   enumerated list
3819 .\" NS
3820 .\" NS modifies:
3821 .\" NS   doc-out-string, doc-nesting-level, doc-enum-list-count
3823 .de doc-enum-list
3824 .  nr doc-nesting-level +1
3825 .  nr doc-enum-list-count +1
3826 .  ds doc-out-string "\n[doc-enum-list-count].
3827 .  doc-do-list
3831 .\" NS doc-bullet-list macro
3832 .\" NS   bullet paragraph list
3833 .\" NS
3834 .\" NS modifies:
3835 .\" NS   doc-out-string, doc-nesting-level
3837 .de doc-bullet-list
3838 .  nr doc-nesting-level +1
3839 .  ds doc-out-string "\*[doc-Sy-font]\[bu]\f[P]
3840 .  doc-do-list
3844 .\" NS doc-dash-list macro
3845 .\" NS   hyphen paragraph list (sub bullet list)
3846 .\" NS
3847 .\" NS modifies:
3848 .\" NS   doc-out-string, doc-nesting-level
3850 .de doc-dash-list
3851 .  nr doc-nesting-level +1
3852 .  ds doc-out-string "\*[doc-Sy-font]\-\f[P]
3853 .  doc-do-list
3857 .\" NS doc-do-list macro
3858 .\" NS   .It item of list-type enum/bullet/hyphen
3860 .als doc-do-list doc-hang-list
3863 .\" NS doc-have-diag-list global register (bool)
3864 .\" NS   set if last item was a diag list
3866 .nr doc-have-diag-list 0
3869 .\" NS doc-diag-list-input-line-count global register
3870 .\" NS   saved line number to be checked in next diag-list item
3872 .nr doc-diag-list-input-line-count 0
3875 .\" NS doc-diag-list macro
3876 .\" NS   .It item of list-type diagnostic-message
3877 .\" NS
3878 .\" NS modifies:
3879 .\" NS   doc-out-string, doc-curr-font, doc-curr-size,
3880 .\" NS   doc-diag-list-input-line-count
3882 .de doc-diag-list
3883 .  nr doc-curr-font \n[.f]
3884 .  nr doc-curr-size \n[.s]
3886 .  ie \n[doc-have-diag-list] \{\
3887 .    ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \
3888 .      doc-paragraph
3889 .    el \
3890 .      br
3891 .  \}
3892 .  el \
3893 .    br
3894 .  nr doc-diag-list-input-line-count \n[.c]
3896 .  nop \*[doc-Sy-font]\*[doc-out-string]\c
3897 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\*[doc-digit-string]\c
3899 .  doc-reset-args
3900 .  ds doc-out-string
3901 '  fi
3905 .\" NS doc-tag-list macro
3906 .\" NS   .It item of list-type `tag'
3907 .\" NS
3908 .\" NS modifies:
3909 .\" NS   doc-out-string, doc-nesting-level, doc-list-immediate
3910 .\" NS
3911 .\" NS local variables:
3912 .\" NS   doc-reg-dtl
3914 .de doc-tag-list
3915 .  if !\n[doc-have-tag-width] \
3916 .    doc-get-tag-width
3917 .  doc-set-vertical-and-indent 1
3918 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3919 .  ti -\n[doc-reg-dtl]u
3921 .  ie (\w\a\*[doc-out-string]\au > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3922 .    nop \&\*[doc-out-string]
3923 .    br
3924 .  \}
3925 .  el \
3926 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dtl]u'\c
3928 .  if \n[doc-in-files-section] \
3929 .    if n \
3930 .      ds doc-Pa-font "\*[doc-saved-Pa-font]
3932 .  nr doc-nesting-level -1
3933 .  nr doc-list-immediate 0
3934 .  ds doc-out-string
3935 .  doc-reset-args
3936 '  fi
3940 .\" NS doc-get-tag-width macro
3941 .\" NS   resolve unknown tag width (.Bl [inset | tag] only)
3942 .\" NS
3943 .\" NS modifies:
3944 .\" NS   doc-list-indent-stackXXX, doc-have-indent, doc-tag-width-stackXXX
3945 .\" NS
3946 .\" NS requires:
3947 .\" NS   doc-curr-type, doc-curr-arg
3949 .de doc-get-tag-width
3950 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3951 .    ie "\*[doc-curr-type]"macro" \{\
3953 .\" XXX: what is `lN'?
3955 .      ds doc-tag-width-stack\n[lN] \*[doc-curr-arg]
3956 .      nr doc-list-indent-stack\n[lN] \n[\*[doc-curr-arg]]
3957 .    \}
3958 .    el \{\
3959 .      ds doc-tag-width-stack\n[lN] No
3960 .      nr doc-list-indent-stack\n[lN] \n[No]
3961 .    \}
3962 .    if !"\*[doc-tag-width-stack\n[doc-list-depth]]"\*[doc-tag-width-stack\n[lN]]" \
3963 .      nr doc-have-indent 1
3964 .  \}
3968 .\" NS doc-set-vertical-and-indent macro
3969 .\" NS   set up vertical spacing (if not compact) and indent (with offset if
3970 .\" NS   argument is non-zero)
3971 .\" NS
3972 .\" NS modifies:
3973 .\" NS   doc-have-indent, doc-have-tag-width
3975 .de doc-set-vertical-and-indent
3976 .  ie \n[doc-have-indent] \{\
3977 .    nr doc-have-indent 0
3978 .    nr doc-have-tag-width 0
3979 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3980 .      sp \n[doc-display-vertical]u
3981 .    in (\n[.i]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3982 .    if \$1 \
3983 .      in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3984 .  \}
3985 .  el \{\
3986 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3987 .      sp \n[doc-display-vertical]u
3988 .  \}
3990 .  if !\n[cR] \
3991 .    ne 2v
3995 .\" NS doc-saved-list-immediate global register (bool)
3996 .\" NS   saved `doc-list-immediate' value
3998 .nr doc-saved-list-immediate 0
4001 .\" NS doc-list-depth global register
4002 .\" NS   list type stack counter
4004 .nr doc-list-depth 0
4007 .\" NS doc-list-immediate global register (bool)
4008 .\" NS   tag flag (for diversions)
4010 .nr doc-list-immediate 0
4013 .\" NS doc-num-columns global register
4014 .\" NS   number of columns
4016 .nr doc-num-columns 0
4019 .\" NS doc-compact-list-stackXXX global register (bool)
4020 .\" NS   stack of flags to indicate whether a particular list is compact
4021 .\" NS
4022 .\" NS   limit: doc-list-depth
4024 .nr doc-compact-list-stack1 0
4027 .\" NS doc-tag-width-stackXXX global string
4028 .\" NS   stack of strings indicating how to set up current element of
4029 .\" NS   doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
4030 .\" NS   directly; if it is a macro name, use the macro's width value;
4031 .\" NS   otherwise, `doc-get-tag-width' uses width value of `No'.
4032 .\" NS
4033 .\" NS   limit: doc-list-depth
4035 .ds doc-tag-width-stack0
4036 .ds doc-tag-width-stack1
4039 .\" NS doc-list-offset-stackXXX global register
4040 .\" NS   stack of list offsets
4041 .\" NS
4042 .\" NS   limit: doc-list-depth
4044 .nr doc-list-offset-stack1 0
4047 .\" NS doc-end-list macro
4048 .\" NS   list end function
4049 .\" NS
4050 .\" NS modifies:
4051 .\" NS   doc-list-offset-stackXXX, doc-list-depth
4053 .de doc-end-list
4054 '  in (\n[.i]u - \n[doc-list-indent-stack\n[doc-list-depth]]u - \n[doc-digit-width]u)
4056 .  if \n[doc-list-offset-stack\n[doc-list-depth]] \{\
4057 '    in -\n[doc-list-offset-stack\n[doc-list-depth]]u
4058 .    nr doc-list-offset-stack\n[doc-list-depth] 0
4059 .  \}
4061 .  if (\n[doc-list-depth] <= 0) \
4062 .    tm mdoc warning: extraneous .El call (#\n[.c])
4064 .  doc-decrement-list-stack
4065 .  nr doc-list-depth -1
4066 .  doc-increment-list-stack
4070 .\" NS doc-next-list-depth global register
4071 .\" NS   next possible doc-list-depth value
4073 .nr doc-next-list-depth 1
4076 .\" NS doc-increment-list-stack macro
4077 .\" NS   set up next block for list
4078 .\" NS
4079 .\" NS modifies:
4080 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX,
4081 .\" NS   doc-compact-list-stackXXX, doc-tag-width-stackXXX,
4082 .\" NS   doc-list-offset-stackXXX, doc-next-list-depth
4084 .de doc-increment-list-stack
4085 .  nr doc-next-list-depth (\n[doc-list-depth] + 1)
4086 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
4087 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
4088 .  ds doc-tag-width-stack\n[doc-next-list-depth] \*[doc-tag-width-stack\n[doc-list-depth]]
4089 .  ds doc-list-type-stack\n[doc-next-list-depth]
4090 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
4094 .\" NS doc-decrement-list-stack macro
4095 .\" NS   decrement stack
4096 .\" NS
4097 .\" NS modifies:
4098 .\" NS   doc-list-type-stackXXX, doc-list-indent-stackXXX,
4099 .\" NS   doc-compact-list-stackXXX, doc-tag-width-stackXXX,
4100 .\" NS   doc-list-offset-stackXXX, doc-next-list-depth
4102 .de doc-decrement-list-stack
4103 .  ds doc-list-type-stack\n[doc-next-list-depth]
4104 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
4105 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
4106 .  ds doc-tag-width-stack\n[doc-next-list-depth]
4107 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
4108 .  nr doc-next-list-depth -1
4112 .\" NS Xr user macro
4113 .\" NS   cross reference (man page only)
4114 .\" NS
4115 .\" NS modifies:
4116 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string
4117 .\" NS
4118 .\" NS width register `Xr' set in doc-common
4120 .de Xr
4121 .  if !\n[doc-arg-limit] \{\
4122 .    ie \n[.$] \{\
4123 .      ds doc-macro-name Xr
4124 .      doc-parse-args \$@
4125 .    \}
4126 .    el \
4127 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
4128 .  \}
4130 .  nr doc-arg-ptr +1
4131 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4132 .    ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
4133 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
4134 .    el \{\
4135 .      ie "\*[doc-type\n[doc-arg-ptr]]"string" \{\
4136 .        as doc-out-string \*[doc-Xr-font]
4137 .        as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4139 .        nr doc-arg-ptr +1
4140 .        if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4141 .          if "\*[doc-type\n[doc-arg-ptr]]"string" \{\
4142 .            as doc-out-string \&\*[lp]\*[doc-arg\n[doc-arg-ptr]]\*[rp]
4143 .            nr doc-arg-ptr +1
4144 .        \}\}
4145 .        ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
4146 .          doc-do-\*[doc-type\n[doc-arg-ptr]]
4147 .        el \
4148 .          doc-print-and-reset
4149 .      \}
4150 .      el \
4151 .        doc-do-xref-\*[doc-type\n[doc-arg-ptr]]
4152 .  \}\}
4156 .\" NS Sx user macro
4157 .\" NS   cross section reference
4158 .\" NS
4159 .\" NS modifies:
4160 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4161 .\" NS   doc-curr-size
4162 .\" NS
4163 .\" NS width register `Sx' set in doc-common
4165 .de Sx
4166 .  if !\n[doc-arg-limit] \{\
4167 .    ie \n[.$] \{\
4168 .      ds doc-macro-name Sx
4169 .      doc-parse-args \$@
4170 .    \}
4171 .    el \
4172 .      tm Usage: .Sx section_header \*[doc-punct-chars] (#\n[.c])
4173 .  \}
4175 .  nr doc-arg-ptr +1
4176 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4177 .    as doc-out-string \*[doc-Sx-font]
4178 .    nr doc-curr-font \n[.f]
4179 .    nr doc-curr-size \n[.s]
4180 .    doc-print-recursive
4181 .  \}
4185 .\" NS doc-do-end-column-list macro
4186 .\" NS   column-list end-list
4187 .\" NS
4188 .\" NS modifies:
4189 .\" NS   doc-list-depth
4191 .de doc-do-end-column-list
4192 '  in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u - \n[doc-list-indent-stack\n[doc-list-depth]]u)
4193 .  ta T .5i
4194 .  fi
4195 .  doc-decrement-list-stack
4196 .  nr doc-list-depth -1
4197 .  doc-increment-list-stack
4201 .\" NS doc-column-indent-width global register
4202 .\" NS   holds the indent width for a column list
4204 .nr doc-column-indent-width 0
4207 .\" NS doc-set-column-tab macro
4208 .\" NS   establish tabs for list-type column: `.doc-set-column-tab num_cols'
4209 .\" NS
4210 .\" NS local variables:
4211 .\" NS   doc-str-dsct, doc-str-dsct1, doc-reg-dsct, doc-column-indent-width
4213 .de doc-set-column-tab
4214 .  ds doc-str-dsct
4215 .  nr doc-reg-dsct 1
4216 .  nr doc-column-indent-width 0
4218 .  ie (\$1 < 5) \
4219 .    ds doc-str-dsct1 "    \"
4220 .  el \{\
4221 .    ie (\$1 == 5) \
4222 .      ds doc-str-dsct1 "   \"
4223 .    el \{\
4224 .      \" XXX: this is packed abnormally close -- intercolumn width
4225 .      \"      should be configurable
4226 .      ds doc-str-dsct1 " \"
4227 .  \}\}
4229 .  while (\n[doc-reg-dsct] <= \$1) \{\
4230 .    as doc-str-dsct " +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4231 .    nr doc-column-indent-width +\w\a\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]\au
4232 .    nr doc-reg-dsct +1
4233 .  \}
4235 .  ta \*[doc-str-dsct]
4236 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
4240 .\" NS doc-column-list macro
4241 .\" NS   column items
4242 .\" NS
4243 .\" NS modifies:
4244 .\" NS   doc-arg-ptr, doc-spaceXXX, doc-list-indent-stackXXX
4245 .\" NS
4246 .\" NS local variables:
4247 .\" NS   doc-reg-dcl
4249 .de doc-column-list
4250 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
4251 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
4252 .  if !\n[.u] \{\
4253 .    fi
4254 '    in (\n[.i]u + \n[doc-column-indent-width]u)
4255 .  \}
4256 .  ti -\n[doc-column-indent-width]u
4258 .  doc-parse-arg-vector
4259 .  nr doc-arg-ptr +1
4261 .  ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4262 .    if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
4263 .      nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
4264 .      ds doc-space\n[doc-reg-dcl]
4265 .    \}
4266 .    doc-do-\*[doc-type\n[doc-arg-ptr]]
4267 .  \}
4268 .  el \
4269 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
4273 .\" NS Ta user macro
4274 .\" NS   append tab (\t)
4275 .\" NS
4276 .\" NS modifies:
4277 .\" NS   doc-arg-ptr, doc-out-string
4278 .\" NS
4279 .\" NS width register `Ta' set in doc-common
4281 .de Ta
4282 .  ie \n[doc-arg-limit] \{\
4283 .    nr doc-arg-ptr +1
4284 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4285 .      as doc-out-string \t
4286 .      doc-do-\*[doc-type\n[doc-arg-ptr]]
4287 .    \}
4288 .    el \{\
4289 .      as doc-out-string \t\c
4290 .      doc-print-and-reset
4291 .  \}\}
4292 .  el \{\
4293 .    tm1 "Usage: Ta must follow column entry: e.g. (#\n[.c])
4294 .    tm1 "         .It column_string [Ta [column_string ...]]
4295 .  \}
4299 .\" NS Dl user macro
4300 .\" NS   display (one line) literal
4301 .\" NS
4302 .\" NS modifies:
4303 .\" NS   doc-macro-name
4304 .\" NS
4305 .\" NS width register `Dl' set in doc-common
4307 .de Dl
4308 '  ta T .5i
4309 .  in (\n[.i]u + \n[doc-display-indent]u)
4311 .  ie \n[doc-arg-limit] \
4312 .    tm Usage: .Dl not callable by other macros (#\n[.c])
4313 .  el \{\
4314 .    ie \n[.$] \{\
4315 .      ds doc-macro-name Dl
4316 .      doc-parse-args \$@
4317 .      Li
4318 .    \}
4319 .    el \
4320 .      tm Usage: .Dl argument ... (#\n[.c])
4321 .  \}
4323 .  in (\n[.i]u - \n[doc-display-indent]u)
4327 .\" NS D1 user macro
4328 .\" NS   display (one line)
4329 .\" NS
4330 .\" NS modifies:
4331 .\" NS   doc-macro-name, doc-arg-ptr
4332 .\" NS
4333 .\" NS width register `D1' set in doc-common
4335 .de D1
4336 '  ta T .5i
4337 .  in (\n[.i]u + \n[doc-display-indent]u)
4339 .  ie \n[doc-arg-limit] \
4340 .    tm Usage: .D1 not callable by other macros (#\n[.c])
4341 .  el \{\
4342 .    ie \n[.$] \{\
4343 .      ds doc-macro-name D1
4344 .      doc-parse-args \$@
4345 .      nr doc-arg-ptr +1
4346 .      No
4347 .    \}
4348 .    el \
4349 .      tm Usage: .D1 argument ... (#\n[.c])
4350 .  \}
4352 .  in (\n[.i]u - \n[doc-display-indent]u)
4356 .\" NS Ex user macro
4357 .\" NS   defunct
4359 .de Ex
4360 .  tm mdoc error: .Ex defunct, use .D1: \$@ (#\n[.c])
4364 .\" NS Vt user macro
4365 .\" NS   variable type (for forcing old style variable declarations);
4366 .\" NS   this is not done in the same manner as .Ot for fortrash --
4367 .\" NS   clean up later
4368 .\" NS
4369 .\" NS modifies:
4370 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
4371 .\" NS   doc-have-var
4372 .\" NS
4373 .\" NS width register `Vt' set in doc-common
4375 .de Vt
4376 .  \" if a function declaration was the last thing given, want vertical space
4377 .  if \n[doc-have-decl] \{\
4378 .    doc-paragraph
4379 .    nr doc-have-decl 0
4380 .  \}
4382 .  \" if a subroutine was the last thing given, want vertical space
4383 .  if \n[doc-have-func] \{\
4384 .    ie !\n[doc-have-var] \
4385 .      br
4386 .    el \{\
4387 .      doc-paragraph
4388 .      rs
4389 .  \}\}
4391 .  nr doc-have-var 1
4392 .  nr doc-curr-font \n[.f]
4393 .  nr doc-curr-size \n[.s]
4395 .  nop \*[doc-Ft-font]\$*
4397 .  ie \n[doc-have-old-func] \
4398 .    nop \&\*[doc-soft-space]
4399 .  el \
4400 .    br
4402 .  ft \n[doc-curr-font]
4403 .  ps \n[doc-curr-size]
4407 .\" NS doc-is-func global register (bool)
4408 .\" NS   set if subroutine (in synopsis only) (fortran only)
4410 .nr doc-is-func 0
4413 .\" NS Ft user macro
4414 .\" NS   function type
4415 .\" NS
4416 .\" NS modifies:
4417 .\" NS   doc-curr-font, doc-curr-size, doc-have-decl,
4418 .\" NS   doc-have-var, doc-is-func
4419 .\" NS
4420 .\" NS width register `Ft' set in doc-common
4422 .de Ft
4423 .  if \n[doc-in-synopsis-count] \{\
4424 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4425 .      doc-paragraph
4426 .      nr doc-have-decl 0
4427 .      nr doc-have-var 0
4428 .    \}
4430 .    if \n[doc-have-var] \{\
4431 .      doc-paragraph
4432 .      nr doc-have-var 0
4433 .    \}
4435 .    nr doc-is-func 1
4436 .  \}
4438 .  nr doc-curr-font \n[.f]
4439 .  nr doc-curr-size \n[.s]
4441 .  nop \*[doc-Ft-font]\$*
4443 .  ft \n[doc-curr-font]
4444 .  ps \n[doc-curr-size]
4448 .\" NS doc-have-old-func global register (bool)
4449 .\" NS   set if `Ot' has been called
4451 .nr doc-have-old-func 0
4454 .\" NS Ot user macro
4455 .\" NS   old function type (fortran -- no newline)
4456 .\" NS
4457 .\" NS modifies:
4458 .\" NS   doc-out-string, doc-have-decl, doc-have-var,
4459 .\" NS   doc-is-func, doc-have-old-func
4460 .\" NS
4461 .\" NS width register `Ot' set in doc-common
4463 .de Ot
4464 .  nr doc-have-old-func 1
4466 .  if \n[doc-in-synopsis-count] \{\
4467 .    if (\n[doc-have-func] : \n[doc-have-decl]) \{\
4468 .      doc-paragraph
4469 .      nr doc-have-decl 0
4470 .      nr doc-have-var 0
4471 .    \}
4473 .    if \n[doc-have-var] \{\
4474 .      doc-paragraph
4475 .      nr doc-have-var 0
4476 .    \}
4478 .    nr doc-is-func 1
4479 .  \}
4481 .  if \n[.$] \
4482 .    as doc-out-string \*[doc-Ft-font]\$*
4483 .  as doc-out-string \ \f[P]
4487 .\" NS Fa user macro
4488 .\" NS   function arguments
4489 .\" NS
4490 .\" NS modifies:
4491 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4492 .\" NS   doc-curr-size
4493 .\" NS
4494 .\" NS width register `Fa' set in doc-common
4496 .de Fa
4497 .  if !\n[doc-arg-limit] \{\
4498 .    ie \n[.$] \{\
4499 .      ds doc-macro-name Fa
4500 .      doc-parse-args \$@
4501 .    \}
4502 .    el \
4503 .      tm Usage: .Fa function_arguments ... \*[doc-punct-chars] (#\n[.c])
4504 .  \}
4506 .  ie \n[doc-func-arg-count] \
4507 .    doc-do-func
4508 .  el \{\
4509 .    nr doc-arg-ptr +1
4510 .    if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4511 .      as doc-out-string \*[doc-Fa-font]
4512 .      nr doc-curr-font \n[.f]
4513 .      nr doc-curr-size \n[.s]
4514 .      doc-print-recursive
4516 .      if \n[doc-in-synopsis-count] \
4517 .        if \n[doc-have-func] \
4518 .          br
4519 .  \}\}
4523 .\" NS doc-func-arg-count global register
4524 .\" NS   how many function arguments have been processed so far
4526 .nr doc-func-arg-count 0
4529 .\" NS doc-func-arg global string
4530 .\" NS   work buffer for function name strings
4532 .ds doc-func-arg
4535 .\" NS doc-num-func-args global register
4536 .\" NS   number of function arguments
4538 .nr doc-num-func-args 0
4541 .\" NS doc-func-args-processed global register
4542 .\" NS   function arguments processed so far
4544 .nr doc-func-args-processed 0
4547 .\" NS doc-do-func macro
4548 .\" NS   internal .Fa for .Fc
4549 .\" NS
4550 .\" NS modifies:
4551 .\" NS   doc-arg-ptr, doc-argXXX, doc-out-string, doc-func-arg-count,
4552 .\" NS   doc-func-arg, doc-num-func-args, doc-func-args-processed
4554 .de doc-do-func
4555 .  ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
4556 .    nr doc-arg-ptr +1
4558 .    ds doc-func-arg
4559 .    nr doc-num-func-args 0
4560 .    nr doc-func-args-processed 0
4562 .    doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
4563 .    if (\n[doc-num-func-args] > 1) \
4564 .      ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
4566 .    if (\n[doc-func-arg-count] > 1) \{\
4567 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\|,
4568 .      as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]
4569 .      as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4570 .    \}
4572 .    if (\n[doc-func-arg-count] == 1) \{\
4573 .      as doc-out-string \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]
4574 .      as doc-out-string \f[P]\s[0]
4575 .    \}
4576 .    nr doc-func-arg-count +1
4577 .    doc-do-func
4578 .  \}
4579 .  el \
4580 .    doc-reset-args
4584 .\" NS doc-have-func global register (bool)
4585 .\" NS   whether we have more than one function in synopsis
4587 .nr doc-have-func 0
4590 .\" NS Fn user macro
4591 .\" NS   functions
4592 .\" NS
4593 .\" NS modifies:
4594 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
4595 .\" NS   doc-curr-size, doc-in-synopsis-count, doc-indent-synopsis,
4596 .\" NS   doc-have-decl, doc-have-var, doc-have-func,
4597 .\" NS   doc-is-func
4598 .\" NS
4599 .\" NS width register `Fn' set in doc-common
4601 .de Fn
4602 .  if !\n[doc-arg-limit] \{\
4603 .    ie \n[.$] \{\
4604 .      ds doc-macro-name Fn
4605 .      doc-parse-args \$@
4606 .    \}
4607 .    el \{\
4608 .      tmc Usage: .Fn function_name function_arg(s) ... \*[doc-punct-chars]
4609 .      tm1 " (#\n[.c])
4610 .  \}\}
4612 .  if \n[doc-in-synopsis-count] \{\
4613 .    \" if there is/has been more than one subroutine declaration
4614 .    ie \n[doc-is-func] \{\
4615 .      br
4616 .      nr doc-have-var 0
4617 .      nr doc-have-decl 0
4618 .      nr doc-is-func 0
4619 .    \}
4620 .    el \{\
4621 .      if \n[doc-have-func] \{\
4622 .        doc-paragraph
4623 .        nr doc-have-var 0
4624 .        nr doc-have-decl 0
4625 .    \}\}
4627 .    if \n[doc-have-decl] \{\
4628 .      doc-paragraph
4629 .      nr doc-have-var 0
4630 .    \}
4632 .    if \n[doc-have-var] \{\
4633 .      doc-paragraph
4634 .      nr doc-have-decl 0
4635 .    \}
4637 .    nr doc-have-func 1
4638 .    nr doc-is-func 0
4639 .    rs
4641 .    ie (\n[doc-in-synopsis-count] > 1) \
4642 .      br
4643 .    el \{\
4644 .      if !\n[doc-indent-synopsis] \
4645 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4646 .    \}
4648 .    in +\n[doc-indent-synopsis]u
4649 .    ti -\n[doc-indent-synopsis]u
4650 .    nr doc-in-synopsis-count +1
4651 .  \}
4653 .  nr doc-arg-ptr +1
4654 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4655 .    nr doc-curr-font \n[.f]
4656 .    nr doc-curr-size \n[.s]
4657 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4658 .    as doc-out-string \f[P]\s[0]\*[lp]
4660 .    nr doc-arg-ptr +1
4661 .    ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
4662 .      as doc-out-string \*[doc-Fa-font]
4663 .      doc-do-func-\*[doc-type\n[doc-arg-ptr]]
4664 .    \}
4665 .    el \{\
4666 .      as doc-out-string \|\*[rp]
4667 .      doc-print-and-reset
4668 .    \}
4670 .    if \n[doc-in-synopsis-count] \
4671 .      in -\n[doc-indent-synopsis]u
4672 .  \}
4676 .\" NS doc-do-func-macro 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-macro
4683 .  ie \n[doc-in-synopsis-count] \{\
4684 .    as doc-out-string \&\*[rp]\f[R];\f[P]
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-string 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-string
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 "\*[doc-type\n[doc-arg-ptr]]"string" \{\
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-\*[doc-type\n[doc-arg-ptr]]
4725 .  \}
4726 .  el \{\
4727 .    ie \n[doc-in-synopsis-count] \{\
4728 .      as doc-out-string \&\*[rp]\f[R];\f[P]
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-punct-suffix macro
4740 .\" NS   handle punctuation suffixes in functions
4741 .\" NS
4742 .\" NS modifies:
4743 .\" NS   doc-out-string
4745 .de doc-do-func-punct-suffix
4746 .  ie \n[doc-in-synopsis-count] \{\
4747 .    as doc-out-string \&\*[rp]\f[R];\f[P]
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-punct-prefix 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-punct-prefix
4770 .  ie \n[doc-in-synopsis-count] \{\
4771 .    as doc-out-string \&\*[rp]\f[R];\f[P]
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]\f[R];\f[P]
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 .  nr doc-author-count 0
5003 .  nr doc-journal-count 0
5004 .  nr doc-issue-count 0
5005 .  nr doc-optional-count 0
5006 .  nr doc-corporate-count 0
5007 .  nr doc-report-count 0
5008 .  nr doc-reference-title-count 0
5009 .  nr doc-volume-count 0
5010 .  nr doc-date-count 0
5011 .  nr doc-page-number-count 0
5012 .  nr doc-book-count 0
5014 .  ds doc-reference-string-name
5016 .  ds doc-journal-name
5017 .  ds doc-issue-name
5018 .  ds doc-optional-string
5019 .  ds doc-corporate-name
5020 .  ds doc-report-name
5021 .  ds doc-reference-title-name
5022 .  ds doc-volume-name
5023 .  ds doc-date
5024 .  ds doc-page-number-string
5025 .  ds doc-book-name
5029 .\" NS doc-finish-reference macro
5030 .\" NS   auxiliary macro for doc-print-reference
5031 .\" NS
5032 .\" NS modifies:
5033 .\" NS   doc-reference-count
5035 .de doc-finish-reference
5036 .  nr doc-reference-count -1
5037 .  ie \n[doc-reference-count] \
5038 .    nop \&,
5039 .  el \
5040 .    nop \&.
5044 .\" NS doc-print-reference macro
5045 .\" NS   reference print
5046 .\" NS
5047 .\" NS modifies:
5048 .\" NS   doc-reference-count, doc-authors-processed
5050 .de doc-print-reference
5051 .  if \n[doc-author-count] \{\
5052 .    nop \&\*[doc-author-name1],
5053 .    nr doc-authors-processed 1
5054 .    if (\n[doc-author-count] > 1) \
5055 .      doc-print-reference-authors
5056 .    nr doc-reference-count -\n[doc-author-count]
5057 .  \}
5059 .  if \n[doc-reference-title-count] \{\
5060 .    ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
5061 .      nop \&\*[q]\*[doc-reference-title-name]\*[q]\c
5062 .      doc-finish-reference
5063 .    \}
5064 .    el \{\
5065 .      nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font]\c
5066 .      doc-finish-reference
5067 .  \}\}
5069 .  if \n[doc-book-count] \{\
5070 .    nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font]\c
5071 .    doc-finish-reference
5072 .  \}
5074 .  if \n[doc-publisher-count] \{\
5075 .    nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font]\c
5076 .    doc-finish-reference
5077 .  \}
5079 .  if \n[doc-journal-count] \{\
5080 .    nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font]\c
5081 .    doc-finish-reference
5082 .  \}
5084 .  if \n[doc-report-count] \{\
5085 .    nop \&\*[doc-report-name]\c
5086 .    doc-finish-reference
5087 .  \}
5089 .  if \n[doc-issue-count] \{\
5090 .    nop \&\*[doc-issue-name]\c
5091 .    doc-finish-reference
5092 .  \}
5094 .  if \n[doc-volume-count] \{\
5095 .    nop \&\*[doc-volume-name]\c
5096 .    doc-finish-reference
5097 .  \}
5099 .  if \n[doc-page-number-count] \{\
5100 .    nop \&\*[doc-page-number-string]\c
5101 .    doc-finish-reference
5102 .  \}
5104 .  if \n[doc-corporate-count] \{\
5105 .    nop \&\*[doc-corporate-name]\c
5106 .    doc-finish-reference
5107 .  \}
5109 .  if \n[doc-date-count] \{\
5110 .    nop \&\*[doc-date]\c
5111 .    doc-finish-reference
5112 .  \}
5114 .  if \n[doc-optional-count] \{\
5115 .    nop \&\*[doc-optional-string]\c
5116 .    doc-finish-reference
5117 .  \}
5119 .  if \n[doc-reference-count] \
5120 .    tm mdoc warning: unresolved reference problem
5124 .\" NS doc-authors-processed global register
5125 .\" NS   author references processed so far
5127 .nr doc-authors-processed 0
5130 .\" NS doc-print-reference-authors macro
5131 .\" NS   print out reference authors
5132 .\" NS
5133 .\" NS modifies:
5134 .\" NS   doc-authors-processed
5136 .de doc-print-reference-authors
5137 .  nr doc-authors-processed +1
5138 .  ie (\n[doc-author-count] == \n[doc-authors-processed]) \
5139 .    nop \&and \*[doc-author-name\n[doc-authors-processed]],
5140 .  el \{\
5141 .    nop \&\*[doc-author-name\n[doc-authors-processed]],
5142 .    doc-print-reference-authors
5143 .  \}
5147 .\" NS doc-author-count global register
5148 .\" NS   counter of author references
5150 .nr doc-author-count 0
5153 .\" NS doc-author-nameXXX global string
5154 .\" NS   array of author names
5155 .\" NS
5156 .\" NS   limit: doc-author-count
5158 .ds doc-author-name0
5161 .\" NS %A user macro
5162 .\" NS   reference author(s)
5163 .\" NS
5164 .\" NS modifies:
5165 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5166 .\" MS   doc-reference-count, doc-author-count, doc-reference-string-name
5167 .\" NS
5168 .\" NS width register `%A' set in doc-common
5170 .de %A
5171 .  if !\n[doc-arg-limit] \{\
5172 .    ie \n[.$] \{\
5173 .      nr doc-author-count +1
5174 .      nr doc-reference-count +1
5175 .      ds doc-reference-string-name doc-author-name\n[doc-author-count]
5177 .      ds doc-macro-name %A
5178 .      doc-parse-args \$@
5179 .    \}
5180 .    el \
5181 .      tm Usage: .%A author_name (#\n[.c])
5182 .  \}
5184 .  nr doc-arg-ptr +1
5185 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5186 .    nr doc-curr-font \n[.f]
5187 .    nr doc-curr-size \n[.s]
5188 .    doc-do-references
5189 .  \}
5193 .\" NS doc-book-count global register
5194 .\" NS   counter of book references
5196 .nr doc-book-count 0
5199 .\" NS doc-book-name global string
5200 .\" NS   string of collected book references
5202 .ds doc-book-name
5205 .\" NS %B user macro
5206 .\" NS   [reference] book name
5207 .\" NS
5208 .\" NS modifies:
5209 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
5210 .\" NS   doc-curr-size, doc-reference-count, doc-book-count,
5211 .\" NS   doc-reference-string-name
5212 .\" NS
5213 .\" NS width register `%B' set in doc-common
5215 .de %B
5216 .  if !\n[doc-arg-limit] \{\
5217 .    ie \n[.$] \{\
5218 .      if \n[doc-is-reference] \{\
5219 .        nr doc-book-count +1
5220 .        nr doc-reference-count +1
5221 .        ds doc-reference-string-name doc-book-name
5222 .      \}
5224 .      ds doc-macro-name %B
5225 .      doc-parse-args \$@
5226 .    \}
5227 .    el \
5228 .      tm Usage: .%B book_name (#\n[.c])
5229 .  \}
5231 .  nr doc-arg-ptr +1
5232 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5233 .    nr doc-curr-font \n[.f]
5234 .    nr doc-curr-size \n[.s]
5236 .    ie !\n[doc-is-reference] \{\
5237 .      as doc-out-string \*[doc-Em-font]
5238 .      doc-print-recursive
5239 .    \}
5240 .    el \
5241 .      doc-do-references
5242 .  \}
5246 .\" NS doc-date-count global register
5247 .\" NS   counter of date references
5249 .nr doc-date-count 0
5252 .\" NS doc-date global string
5253 .\" NS   string of collected date references
5255 .ds doc-date
5258 .\" NS %D user macro
5259 .\" NS   [reference] date
5260 .\" NS
5261 .\" NS modifies:
5262 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5263 .\" NS   doc-reference-count, doc-date-count, doc-reference-string-name
5264 .\" NS
5265 .\" NS width register `%D' set in doc-common
5267 .de %D
5268 .  if !\n[doc-arg-limit] \{\
5269 .    ie \n[.$] \{\
5270 .      nr doc-date-count +1
5271 .      nr doc-reference-count +1
5272 .      ds doc-reference-string-name doc-date
5274 .      ds doc-macro-name %D
5275 .      doc-parse-args \$@
5276 .    \}
5277 .    el \
5278 .      tm Usage: .%D date (#\n[.c])
5279 .  \}
5281 .  nr doc-arg-ptr +1
5282 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5283 .    nr doc-curr-font \n[.f]
5284 .    nr doc-curr-size \n[.s]
5285 .    doc-do-references
5286 .  \}
5290 .\" NS doc-publisher-count global register
5291 .\" NS   counter of publisher references
5293 .nr doc-publisher-count 0
5296 .\" NS doc-publisher-name global string
5297 .\" NS   string of collected publisher references
5299 .ds doc-publisher-name
5302 .\" NS %I user macro
5303 .\" NS   [reference] issuer/publisher name
5304 .\" NS
5305 .\" NS modifies:
5306 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5307 .\" NS   doc-reference-count, doc-reference-string-name
5308 .\" NS
5309 .\" NS width register `%I' set in doc-common
5311 .de %I
5312 .  if !\n[doc-arg-limit] \{\
5313 .    ie \n[.$] \{\
5314 .      nr doc-publisher-count +1
5315 .      nr doc-reference-count +1
5316 .      ds doc-reference-string-name doc-publisher-name
5318 .      ds doc-macro-name %I
5319 .      doc-parse-args \$@
5320 .    \}
5321 .    el \
5322 .      tm Usage: .%I issuer/publisher_name (#\n[.c])
5323 .  \}
5325 .  nr doc-arg-ptr +1
5326 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5327 .    nr doc-curr-font \n[.f]
5328 .    nr doc-curr-size \n[.s]
5329 .    doc-do-references
5330 .  \}
5334 .\" NS doc-journal-count global register
5335 .\" NS   counter of journal references
5337 .nr doc-journal-count 0
5340 .\" NS doc-journal-name global string
5341 .\" NS   string of collected journal references
5343 .ds doc-journal-name
5346 .\" NS %J user macro
5347 .\" NS   [reference] Journal Name
5348 .\" NS
5349 .\" NS modifies:
5350 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5351 .\" NS   doc-reference-count, doc-journal-count, doc-reference-string-name
5352 .\" NS
5353 .\" NS width register `%J' set in doc-common
5355 .de %J
5356 .  if !\n[doc-arg-limit] \{\
5357 .    ie \n[.$] \{\
5358 .      nr doc-journal-count +1
5359 .      nr doc-reference-count +1
5360 .      ds doc-reference-string-name doc-journal-name
5362 .      ds doc-macro-name %J
5363 .      doc-parse-args \$@
5364 .    \}
5365 .    el \
5366 .      tm Usage: .%J journal_name (#\n[.c])
5367 .  \}
5369 .  nr doc-arg-ptr +1
5370 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5371 .    nr doc-curr-font \n[.f]
5372 .    nr doc-curr-size \n[.s]
5373 .    doc-do-references
5374 .  \}
5378 .\" NS doc-issue-count global register
5379 .\" NS   counter of issue number references
5381 .nr doc-issue-count 0
5384 .\" NS doc-issue-name global string
5385 .\" NS   string of collected issue number references
5387 .ds doc-issue-name
5390 .\" NS %N user macro
5391 .\" NS   [reference] issue number
5392 .\" NS
5393 .\" NS modifies:
5394 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5395 .\" NS   doc-reference-count, doc-issue-count, doc-reference-string-name
5396 .\" NS
5397 .\" NS width register `%N' set in doc-common
5399 .de %N
5400 .  if !\n[doc-arg-limit] \{\
5401 .    ie \n[.$] \{\
5402 .      nr doc-issue-count +1
5403 .      nr doc-reference-count +1
5404 .      ds doc-reference-string-name doc-issue-name
5406 .      ds doc-macro-name %N
5407 .      doc-parse-args \$@
5408 .    \}
5409 .    el \
5410 .      tm Usage: .%N issue_number (#\n[.c])
5411 .  \}
5413 .  nr doc-arg-ptr +1
5414 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5415 .    nr doc-curr-font \n[.f]
5416 .    nr doc-curr-size \n[.s]
5417 .    doc-do-references
5418 .  \}
5422 .\" NS doc-optional-count global register
5423 .\" NS   counter of optional information references
5425 .nr doc-optional-count 0
5428 .\" NS doc-optional-string global string
5429 .\" NS   string of collected optional information references
5431 .ds doc-optional-string
5434 .\" NS %O user macro
5435 .\" NS   [reference] optional information
5436 .\" NS
5437 .\" NS modifies:
5438 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5439 .\" NS   doc-reference-count, doc-optional-count, doc-reference-string-name
5440 .\" NS
5441 .\" NS width register `%O' set in doc-common
5443 .de %O
5444 .  if !\n[doc-arg-limit] \{\
5445 .    ie \n[.$] \{\
5446 .      nr doc-optional-count +1
5447 .      nr doc-reference-count +1
5448 .      ds doc-reference-string-name doc-optional-string
5450 .      ds doc-macro-name %O
5451 .      doc-parse-args \$@
5452 .    \}
5453 .    el \
5454 .      tm Usage: .%O optional_information ... \*[doc-punct-chars] (#\n[.c])
5455 .  \}
5457 .  nr doc-arg-ptr +1
5458 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5459 .    nr doc-curr-font \n[.f]
5460 .    nr doc-curr-size \n[.s]
5461 .    doc-do-references
5462 .  \}
5466 .\" NS doc-page-number-count global register
5467 .\" NS   counter of page number references
5469 .nr doc-page-number-count 0
5472 .\" NS doc-page-number-string global string
5473 .\" NS   string of collected page number references
5475 .ds doc-page-number-string
5478 .\" NS %P user macro
5479 .\" NS   [reference] page numbers
5480 .\" NS
5481 .\" NS modifies:
5482 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5483 .\" NS   doc-reference-count, doc-page-number-count, doc-reference-string-name
5484 .\" NS
5485 .\" NS width register `%P' set in doc-common
5487 .de %P
5488 .  if !\n[doc-arg-limit] \{\
5489 .    ie \n[.$] \{\
5490 .      nr doc-page-number-count +1
5491 .      nr doc-reference-count +1
5492 .      ds doc-reference-string-name doc-page-number-string
5494 .      ds doc-macro-name %P
5495 .      doc-parse-args \$@
5496 .    \}
5497 .    el \
5498 .      tm Usage: .%P page_numbers ... \*[doc-punct-chars] (#\n[.c])
5499 .  \}
5501 .  nr doc-arg-ptr +1
5502 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5503 .    nr doc-curr-font \n[.f]
5504 .    nr doc-curr-size \n[.s]
5505 .    doc-do-references
5506 .  \}
5510 .\" NS doc-corporate-count global register
5511 .\" NS   counter of corporate references
5513 .nr doc-corporate-count 0
5516 .\" NS doc-corporate-name global string
5517 .\" NS   string of collected corporate references
5519 .ds doc-corporate-name
5522 .\" NS %Q user macro
5523 .\" NS   corporate or foreign author
5524 .\" NS
5525 .\" NS modifies:
5526 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5527 .\" NS   doc-reference-count, doc-corporate-count, doc-reference-string-name
5528 .\" NS
5529 .\" NS width register `%Q' set in doc-common
5531 .de %Q
5532 .  if !\n[doc-arg-limit] \{\
5533 .    ie \n[.$] \{\
5534 .      nr doc-corporate-count +1
5535 .      nr doc-reference-count +1
5536 .      ds doc-reference-string-name doc-corporate-name
5538 .      ds doc-macro-name %Q
5539 .      doc-parse-args \$@
5540 .    \}
5541 .    el \
5542 .      tm Usage: .%Q corporate_or_foreign_author (#\n[.c])
5543 .  \}
5545 .  nr doc-arg-ptr +1
5546 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5547 .    nr doc-curr-font \n[.f]
5548 .    nr doc-curr-size \n[.s]
5549 .    doc-do-references
5550 .  \}
5554 .\" NS doc-report-count global register
5555 .\" NS   counter of report references
5557 .nr doc-report-count 0
5560 .\" NS doc-report-name global string
5561 .\" NS   string of collected report references
5563 .ds doc-report-name
5566 .\" NS %R user macro
5567 .\" NS   [reference] report name
5568 .\" NS
5569 .\" NS modifies:
5570 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5571 .\" NS   doc-reference-count, doc-report-count, doc-reference-string-name
5572 .\" NS
5573 .\" NS width register `%R' set in doc-common
5575 .de %R
5576 .  if !\n[doc-arg-limit] \{\
5577 .    ie \n[.$] \{\
5578 .      nr doc-report-count +1
5579 .      nr doc-reference-count +1
5580 .      ds doc-reference-string-name doc-report-name
5582 .      ds doc-macro-name %R
5583 .      doc-parse-args \$@
5584 .    \}
5585 .    el \
5586 .      tm Usage: .%R reference_report (#\n[.c])
5587 .  \}
5589 .  nr doc-arg-ptr +1
5590 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5591 .    nr doc-curr-font \n[.f]
5592 .    nr doc-curr-size \n[.s]
5593 .    doc-do-references
5594 .  \}
5598 .\" NS doc-reference-title-count global register
5599 .\" NS   counter of reference title references
5601 .nr doc-reference-title-count 0
5604 .\" NS doc-reference-title-name global string
5605 .\" NS   string of collected reference title references
5607 .ds doc-reference-title-name
5610 .\" NS %T user macro
5611 .\" NS   reference title
5612 .\" NS
5613 .\" NS modifies:
5614 .\" NS   doc-macro-name, doc-arg-ptr, doc-out-string, doc-curr-font,
5615 .\" NS   doc-curr-size, doc-reference-count, doc-reference-title-count,
5616 .\" NS   doc-reference-string-name
5617 .\" NS
5618 .\" NS width register `%T' set in doc-common
5620 .de %T
5621 .  if !\n[doc-arg-limit] \{\
5622 .    ie \n[.$] \{\
5623 .      if \n[doc-is-reference] \{\
5624 .        nr doc-reference-title-count +1
5625 .        nr doc-reference-count +1
5626 .        ds doc-reference-string-name doc-reference-title-name
5627 .      \}
5629 .      ds doc-macro-name %T
5630 .      doc-parse-args \$@
5631 .    \}
5632 .    el \
5633 .      tm Usage: .%T reference_title (#\n[.c])
5634 .  \}
5636 .  nr doc-arg-ptr +1
5637 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5638 .    nr doc-curr-font \n[.f]
5639 .    nr doc-curr-size \n[.s]
5640 .    ie \n[doc-is-reference] \
5641 .      doc-do-references
5642 .    el \{\
5643 .      as doc-out-string \*[doc-Em-font]
5644 .      doc-print-recursive
5645 .  \}\}
5649 .\" NS doc-volume-count global register
5650 .\" NS   counter of reference title references
5652 .nr doc-volume-count 0
5655 .\" NS doc-volume-name global string
5656 .\" NS   string of collected volume references
5658 .ds doc-volume-name
5661 .\" NS %V user macro
5662 .\" NS   reference volume
5663 .\" NS
5664 .\" NS modifies:
5665 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5666 .\" NS   doc-reference-count, doc-volume-count, doc-reference-string-name
5667 .\" NS
5668 .\" NS width register `%V' set in doc-common
5670 .de %V
5671 .  if !\n[doc-arg-limit] \{\
5672 .    ie \n[.$] \{\
5673 .      ds doc-macro-name %V
5674 .      nr doc-volume-count +1
5675 .      nr doc-reference-count +1
5676 .      ds doc-reference-string-name doc-volume-name
5677 .      doc-parse-args \$@
5678 .    \}
5679 .    el \
5680 .      tm Usage: .%V volume , ... \*[doc-punct-chars] (#\n[.c])
5681 .  \}
5683 .  nr doc-arg-ptr +1
5684 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5685 .    nr doc-curr-font \n[.f]
5686 .    nr doc-curr-size \n[.s]
5687 .    doc-do-references
5688 .  \}
5692 .\" NS doc-do-references macro
5693 .\" NS   reference recursion routine
5694 .\" NS
5695 .\" NS modifies:
5696 .\" NS   doc-arg-ptr, doc-out-string, doc-reference-string-name,
5697 .\" NS   doc-journal-name, doc-issue-name, doc-optional-string,
5698 .\" NS   doc-corporate-name, doc-report-name, doc-reference-title-name,
5699 .\" NS   doc-volume-name, doc-date, doc-page-number-string, doc-book-name
5700 .\" NS
5701 .\" NS local variables:
5702 .\" NS   doc-str-ddr, doc-reg-ddr
5704 .de doc-do-references
5705 .  hy 0
5707 .  ds doc-str-ddr "\*[doc-type\n[doc-arg-ptr]]
5709 .  ie "\*[doc-str-ddr]"macro" \{\
5710 .    \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
5711 .    ie "\*[doc-arg\n[doc-arg-ptr]]"Tn" \
5712 .      doc-reference-trademark
5713 .    el \{\
5714 .      doc-append-arg doc-do-references macro
5715 .      \*[doc-arg\n[doc-arg-ptr]]
5716 .  \}\}
5717 .  el \{\
5718 .    nr doc-reg-ddr \n[doc-arg-ptr]
5719 .    as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
5721 .    ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
5722 .      as \*[doc-reference-string-name] \&\*[doc-out-string]
5723 .      ds doc-out-string
5724 .      ds doc-reference-string-name
5725 .      doc-reset-args
5726 .    \}
5727 .    el \{\
5728 .      nr doc-arg-ptr +1
5729 .      as doc-out-string "\*[doc-space\n[doc-reg-ddr]]
5730 .      doc-do-references
5731 .  \}\}
5735 .\" NS Hf user macro
5736 .\" NS   source include header files.
5737 .\" NS
5738 .\" NS modifies:
5739 .\" NS   doc-curr-font, doc-curr-size
5740 .\" NS
5741 .\" NS width register `Hf' set in doc-common
5743 .de Hf
5744 .  doc-paragraph
5745 .  nop File:
5746 .  Pa \$1
5747 .  doc-paragraph
5749 .  nr doc-curr-font \n[.f]
5750 .  nr doc-curr-size \n[.s]
5752 .  ie t \{\
5753 .    nop \*[doc-Li-font]
5754 .    br
5755 .    ta T 9n
5756 .  \}
5757 .  el \
5758 .    ta T 8n
5760 .  nf
5761 .  so \$1
5762 .  fi
5764 .  ft \n[doc-curr-font]
5765 .  ps \n[doc-curr-size]
5766 .  doc-paragraph
5770 .\" NS doc-have-author global register (bool)
5771 .\" NS   set in `An'
5773 .nr doc-have-author 0
5776 .\" NS An user macro
5777 .\" NS   author name
5778 .\" NS
5779 .\" NS modifies:
5780 .\" NS   doc-macro-name, doc-arg-ptr, doc-curr-font, doc-curr-size,
5781 .\" NS   doc-have-author
5782 .\" NS
5783 .\" NS width register `An' set in doc-common
5785 .de An
5786 .  if \n[doc-in-authors-section] \{\
5787 .    ie \n[doc-have-author] \
5788 .      br
5789 .    el \
5790 .      nr doc-have-author 1
5791 .  \}
5793 .  if !\n[doc-arg-limit] \{\
5794 .    ie \n[.$] \{\
5795 .      ds doc-macro-name An
5796 .      doc-parse-args \$@
5797 .    \}
5798 .    el \
5799 .      tm Usage: .An author_name ... \*[doc-punct-chars] (#\n[.c])
5800 .  \}
5802 .  nr doc-arg-ptr +1
5803 .  if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
5804 .    nr doc-curr-font \n[.f]
5805 .    nr doc-curr-size \n[.s]
5806 .    doc-print-recursive
5807 .  \}
5811 .\" NS Sf user macro
5812 .\" NS   defunct
5813 .\" NS
5814 .\" NS width register `Sf' set in doc-common
5816 .de Sf
5817 .  tm mdoc error: .Sf defunct, use .Pf or .Ns (#\n[.c])
5821 .ds doc-func-error-string "function returns the value\~0 if successful;
5822 .as doc-func-error-string " otherwise the value\~-1 is returned and
5823 .as doc-func-error-string " the global variable \*[doc-Va-font]errno\f[P]
5824 .as doc-func-error-string " is set to indicate the error.
5827 .\" NS Rv user macro
5828 .\" NS   return values
5829 .\" NS
5830 .\" NS width register `Rv' set in doc-common
5831 .\" NS
5832 .\" NS local variables:
5833 .\" NS   doc-str-Rv
5835 .de Rv
5837 .\" XXX: what does this function without `-std'?
5839 .  ie !\n[.$] \
5840 .    tm Usage: .Rv [-std] (#\n[.c])
5841 .  el \{\
5842 .    \" .ds doc-macro-name Rv
5843 .    \" .nr doc-arg-ptr 0
5844 .    \" .nr lR +1
5845 .    \" .ds doc-arg1 \$2
5846 .    \" .ds doc-arg2 \$3
5847 .    \" .ds doc-arg3 \$4
5848 .    \" .ds doc-arg4 \$5
5849 .    \" .ds doc-arg5 \$6
5850 .    \" .ds doc-arg6 \$7
5851 .    \" .ds doc-arg7 \$8
5852 .    \" .ds doc-arg8 \$9
5853 .    \" .
5854 .    \" .nr doc-num-args (\n[.$] - 1)
5856 .    if "\$1"-std" \{\
5857 .      doc-reg-Rv \*[doc-section]
5858 .      if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
5859 .        tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
5860 .      br
5861 .      nop \&The
5862 .      Fn \$2
5863 .      nop \&\*[doc-func-error-string]
5864 .  \}\}
5868 .\" NS Mt user macro
5869 .\" NS   mailto (for conversion to HTML)
5871 .de Mt
5872 .  \" XXX: error handling missing
5873 .  Pa \$@
5877 .\" NS Lk user macro
5878 .\" NS   link (for conversion to HTML)
5879 .\" NS
5880 .\" NS local variables:
5881 .\" NS   doc-str-Lk, doc-reg-Lk
5883 .de Lk
5884 .  ds doc-str-Lk Sy \$@
5886 .  ie (\n[.$] > 1) \{\
5887 .    doc-get-arg-type \$2
5888 .    ie (\[doc-arg-type] < 3) \{\
5889 .      Em \&\$2:
5890 .      ds doc-str-Lk Sy "\$1"
5891 .      doc-get-width "\$1"
5892 .      shift 2
5893 .      if \n[.$] \
5894 .        as doc-str-Lk " \$@
5895 .    \}
5896 .    el \
5897 .      doc-get-width "\$1"
5898 .  \}
5899 .  el \
5900 .    doc-get-width "\$1"
5902 .  ie n \
5903 .    nr doc-reg-Lk 26
5904 .  el \
5905 .    nr doc-reg-Lk 38
5906 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
5907 .    D1 \*[doc-str-Lk]
5908 .  el \
5909 .    \*[doc-str-Lk]
5913 .rn em e@
5915 .de em
5916 .  tm mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
5917 .  ab Should this have been `.Em ...'?
5923 .\" EOF