internal update
[s-roff.git] / tmac / tmac.doc.new
blob56ca1d0253b8aa5377a4bca8a7c0c7f84d8906bb
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 register (bool)
61 .\" NS   inline debug mode (inline if 1, to stderr if 0 (default))
63 .nr doc-inline-debug 0
66 .\" NS doc-debug 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
79 .\" NS   doc-debug
81 .de Db
82 .  ie \n[.$] \{\
83 .    if "\$1"on" \{\
84 .      tm DEBUGGING ON
85 .      nr doc-debug 1
86 .    \}
87 .    if "\$1"off" \{\
88 .      tm DEBUGGING OFF
89 .      nr doc-debug 0
90 .    \}
91 .  \}
92 .  el \{\
93 .    ie \n[doc-debug] \{\
94 .      tm DEBUGGING OFF
95 .      nr doc-debug 0
96 .    \}
97 .    el \{\
98 .      tm DEBUGGING ON
99 .      nr doc-debug 1
100 .    \}
101 .  \}
105 .\" NS doc-macro-name string
106 .\" NS   name of calling request (set in each user-requestable macro)
108 .ds doc-macro-name
111 .\" NS doc-args-processed register
112 .\" NS   arguments processed so far
114 .nr doc-args-processed 0
117 .\" NS doc-num-args register
118 .\" NS   number of arguments (must be set to \n[.$] prior to
119 .\" NS   doc-parse-arg-vector request)
121 .nr doc-num-args 0
124 .\" NS doc-arg-ptr register
125 .\" NS   argument pointer
127 .nr doc-arg-ptr 0
130 .\" NS doc-argXXX string
131 .\" NS   argument vector
134 .\" NS doc-typeXXX string
135 .\" NS   argument type vector (`macro', `string', `punct-suffix',
136 .\" NS   `punct-prefix')
139 .\" NS doc-spaceXXX string
140 .\" NS   space vector
143 .\" NS doc-parse-args macro
144 .\" NS   parse arguments (recursively) (`.doc-parse-args arg ...')
145 .\" NS
146 .\" NS modifies:
147 .\" NS
148 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX
149 .\" NS
150 .\" NS local variables:
151 .\" NS   doc-str-dpa, doc-reg-dpa, doc-reg-dpa1
153 .de doc-parse-args
154 .  nr doc-args-processed +1
156 .  \" handle `|' specially for some requests
157 .  ie "\$1"|" \{\
158 .    if "\*[doc-macro-name]"Op" \
159 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
160 .    if "\*[doc-macro-name]"Ar" \
161 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
162 .    if "\*[doc-macro-name]"Fl" \
163 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
164 .    if "\*[doc-macro-name]"Cm" \
165 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
166 .    if "\*[doc-macro-name]"It" \
167 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
168 .  \}
169 .  el \
170 .    ds doc-arg\n[doc-args-processed] "\$1
172 .  \" get argument type and set spacing
173 .  doc-get-arg-type* \n[doc-args-processed]
174 .  ds doc-type\n[doc-args-processed] \*[doc-arg-type]
175 .  doc-set-spacing-for-\*[doc-arg-type]
177 .  if \n[doc-debug] \{\
178 .    if "\*[doc-arg-type]"macro" \
179 .      ds doc-str-dpa macro
180 .    if "\*[doc-arg-type]"string" \
181 .      ds doc-str-dpa string
182 .    if "\*[doc-arg-type]"punct-suffix" \
183 .      ds doc-str-dpa closing punctuation or suffix
184 .    if "\*[doc-arg-type]"punct-prefix" \
185 .      ds doc-str-dpa opening punctuation or prefix
187 .    ie \n[doc-inline-debug] \{\
188 .      br
189 .      nr doc-reg-dpa \n[.i]u
190 .      in -\n[doc-reg-dpa]u
192 .      if (\n[doc-args-processed] == 1) \{\
193 .        nop \f[B]DEBUG(doc-parse-args) MACRO:\f[P] `.\*[doc-macro-name]'
194 .        nop \& \f[B]Line #:\f[P] \n[.c]
195 .      \}
196 .      nop \t\f[B]Argc:\f[P] \n[doc-args-processed]
197 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-args-processed]]'
198 .      nop \ \f[B]Length:\f[P] \n[doc-width]
199 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-args-processed]]'
200 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpa]
201 .    \}
202 .    el \{\
203 .      if (\n[doc-args-processed] == 1) \{\
204 .        tmc "DEBUG (doc-parse-args)
205 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
206 .      \}
207 .      tmc "  Argc: \n[doc-args-processed]
208 .      tmc "  Argv: `\*[doc-arg\n[doc-args-processed]]'
209 .      tm1 "  Length: \n[doc-width]
210 .      tmc "  Space: `\*[doc-space\n[doc-args-processed]]'
211 .      tm1 "  Type: \*[doc-str-dpa]
212 .    \}
213 .  \}
215 .  \" check whether we have processed the last parameter
216 .  ie (\n[.$] == 1) \{\
217 .    nr doc-arg-ptr 0
219 .    ie \n[doc-in-diversion] \{\
220 .      if (\n[doc-nesting-level] > 1) \
221 .        as doc-out-string "\*[doc-curr-space]
222 .    \}
223 .    el \{\
224 .      if \n[doc-nesting-level] \
225 .        if !\n[doc-func-arg-count] \
226 .          as doc-out-string "\*[doc-curr-space]
227 .    \}
229 .    \" use space after last parameter as the current one
230 .    ds doc-curr-space "\*[doc-space\n[doc-args-processed]]
232 .    if \n[doc-debug] \{\
233 .      nr doc-reg-dpa1 1
235 .      ie \n[doc-inline-debug] \{\
236 .        nop MACRO REQUEST: \t.\*[doc-macro-name]
237 .        while (\n[doc-reg-dpa1] <= \n[doc-args-processed]) \{\
238 .          nop "\*[doc-arg\n[doc-reg-dpa1]]"
239 .          nr doc-reg-dpa1 +1
240 .        \}
241 .        br
242 .        in \n[doc-reg-dpa]u
243 .      \}
244 .      el \{\
245 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
246 .        while (\n[doc-reg-dpa1] <= \n[doc-args-processed]) \{\
247 .          tmc " "\*[doc-arg\n[doc-reg-dpa1]]"
248 .          nr doc-reg-dpa1 +1
249 .        \}
250 .        tm
251 .      \}
252 .    \}
253 .  \}
254 .  el \{\
255 .    shift
256 .    doc-parse-args \$@
257 .  \}
261 .\" NS doc-parse-arg-vector macro
262 .\" NS   parse argument vector (recursive)
263 .\" NS
264 .\" NS modifies:
265 .\" NS
266 .\" NS   doc-argXXX, doc-typeXXX, doc-spaceXXX
267 .\" NS
268 .\" NS local variables:
269 .\" NS   doc-str-dpav, doc-reg-dpav, doc-reg-dpav1
271 .de doc-parse-arg-vector
272 .  nr doc-args-processed +1
274 .  \" handle `|' specially for some requests
275 .  if "\*[doc-arg\n[doc-args-processed]]"|" \{\
276 .    if "\*[doc-macro-name]"Op" \
277 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
278 .    if "\*[doc-macro-name]"Ar" \
279 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
280 .    if "\*[doc-macro-name]"Fl" \
281 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
282 .    if "\*[doc-macro-name]"Cm" \
283 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
284 .    if "\*[doc-macro-name]"It" \
285 .      ds doc-arg\n[doc-args-processed] \f[R]|\f[P]
286 .  \}
288 .  \" get argument type and set spacing
289 .  doc-get-arg-type* \n[doc-args-processed]
290 .  ds doc-type\n[doc-args-processed] \*[doc-arg-type]
291 .  doc-set-spacing-for-\*[doc-arg-type]
293 .  if \n[doc-debug] \{\
294 .    if "\*[doc-arg-type]"macro" \
295 .      ds doc-str-dpav macro
296 .    if "\*[doc-arg-type]"string" \
297 .      ds doc-str-dpav string
298 .    if "\*[doc-arg-type]"punct-suffix" \
299 .      ds doc-str-dpav closing punctuation or suffix
300 .    if "\*[doc-arg-type]"punct-prefix" \
301 .      ds doc-str-dpav opening punctuation or prefix
303 .    ie \n[doc-inline-debug] \{\
304 .      br
305 .      nr doc-reg-dpav \n[.i]u
306 .      in -\n[doc-reg-dpav]u
308 .      if (\n[doc-args-processed] == 1) \{\
309 .        nop \f[B]DEBUG(doc-parse-arg-vector)
310 .        nop MACRO:\f[P] `.\*[doc-macro-name]'
311 .        nop \& \f[B]Line #:\f[P] \n[.c]
312 .      \}
313 .      nop \t\f[B]Argc:\f[P] \n[doc-args-processed]
314 .      nop \ \f[B]Argv:\f[P] `\*[doc-arg\n[doc-args-processed]]'
315 .      nop \ \f[B]Length:\f[P] \n[doc-width]
316 .      nop \t\f[B]Space:\f[P] `\*[doc-space\n[doc-args-processed]]'
317 .      nop \ \f[B]Type:\f[P] \*[doc-str-dpav]
318 .    \}
319 .    el \{\
320 .      if (\n[doc-args-processed] == 1) \{\
321 .        tmc "DEBUG(doc-parse-arg-vector)
322 .        tm1 " MACRO: `.\*[doc-macro-name]'  Line #: \n[.c]
323 .      \}
324 .      tmc "  Argc: \n[doc-args-processed]
325 .      tmc "  Argv: `\*[doc-arg\n[doc-args-processed]]'
326 .      tm1 "  Length: \n[doc-width]
327 .      tmc "  Space: `\*[doc-space\n[doc-args-processed]]'
328 .      tm1 "  Type: \*[doc-str-dpav]
329 .    \}
330 .  \}
332 .  \" check whether we have processed the last parameter
333 .  ie (\n[doc-num-args] == 1) \{\
334 .    nr doc-arg-ptr 0
336 .    ie \n[doc-in-diversion] \{\
337 .      if (\n[doc-nesting-level] > 1) \
338 .        as doc-out-string "\*[doc-curr-space]
339 .    \}
340 .    el \{\
341 .      if \n[doc-nesting-level] \
342 .        if !\n[doc-func-arg-count] \
343 .          as doc-out-string "\*[doc-curr-space]
344 .    \}
346 .    \" use space after last parameter as the current one
347 .    ds doc-curr-space "\*[doc-space\n[doc-args-processed]]
349 .    nr doc-num-args 0
351 .    if \n[doc-debug] \{\
352 .      nr doc-reg-dpav1 1
354 .      ie \n[doc-inline-debug] \{\
355 .        nop \tMACRO REQUEST: .\*[doc-macro-name]
356 .        while (\n[doc-reg-dpav1] <= \n[doc-args-processed]) \{\
357 .          nop "\*[doc-arg\n[doc-reg-dpav1]]"
358 .          nr doc-reg-dpav1 +1
359 .        \}
360 .        br
361 .        in \n[doc-reg-dpav]u
362 .      \}
363 .      el \{\
364 .        tmc "  MACRO REQUEST: .\*[doc-macro-name]
365 .        while (\n[doc-reg-dpav1] <= \n[doc-args-processed]) \{\
366 .          tmc " "\*[doc-arg\n[doc-reg-dpav1]]"
367 .          nr doc-reg-dpav1 +1
368 .        \}
369 .        tm
370 .      \}
371 .    \}
372 .  \}
373 .  el \{\
374 .    nr doc-num-args -1
375 .    doc-parse-arg-vector
376 .  \}
380 .\" NS doc-remaining-args macro
381 .\" NS   output remaining arguments as-is, separated by spaces (until
382 .\" NS   `doc-num-args' is exhausted), to `doc-out-string'
384 .de doc-remaining-args
385 .  nr doc-arg-ptr +1
386 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
388 .  ie (\n[doc-num-args] == 1) \{\
389 .    nr doc-arg-ptr 0
390 .    nr doc-num-args 0
391 .  \}
392 .  el \{\
393 .    as doc-out-string "\*[doc-space]
394 .    nr doc-num-args -1
395 .    doc-remaining-args
396 .  \}
400 .\" NS doc-append-arg macro
401 .\" NS   append one argument to argument vector:
402 .\" NS   `.doc-append-arg [arg] [type]'
404 .de doc-append-arg
405 .  nr doc-args-processed +1
406 .  ds doc-arg\n[doc-args-processed] "\$1
407 .  ds doc-type\n[doc-args-processed] \$2
408 .  doc-set-spacing-for-\$2
412 .\" NS doc-print-and-reset macro
413 .\" NS   print doc-out-string and clean up argument vectors
415 .de doc-print-and-reset
416 .  doc-print-out-string
417 .  doc-reset-args
421 .\" NS doc-reset-args macro
422 .\" NS   reset argument counters
424 .de doc-reset-args
425 .  nr doc-args-processed 0
426 .  nr doc-arg-ptr 0
430 .\" NS doc-print-out-string macro
431 .\" NS   print `doc-out-string', possibly ending a diversion, enabling
432 .\" NS   hyphenation afterwards
434 .de doc-print-out-string
435 .  ie \n[doc-in-diversion] \{\
436 .    if (\n[doc-nesting-level] == 1) \{\
437 .      nop \&\*[doc-out-string]
438 .      ds doc-curr-space
439 .      ds doc-out-string
440 .    \}
441 .    if !\n[doc-nesting-level] \
442 .      doc-end-diversion-and-print
443 .  \}
444 .  el \{\
445 .    ie \n[doc-nesting-level] \{\
446 .      if \n[doc-space-mode] \
447 .        if !\n[doc-list-immediate] \
448 .          doc-save-and-divert
449 .    \}
450 .    el \{\
451 .      nop \&\*[doc-out-string]
452 .      ds doc-curr-space
453 .      ds doc-out-string
454 .    \}
455 .  \}
457 .  hy
461 .\" NS doc-diversion diversion
462 .\" NS   diversion string
465 .\" NS doc-saved-out-string string
466 .\" NS   saved doc-out-string
469 .\" NS doc-in-diversion register (bool)
470 .\" NS   whether we are in a diversion
472 .nr doc-in-diversion 0
475 .\" NS doc-save-and-divert macro
476 .\" NS   save doc-out-string, restore fill mode, and divert
478 .de doc-save-and-divert
479 .  nr doc-in-diversion 1
480 .  ds doc-saved-out-string "\*[doc-out-string]
481 .  ds doc-out-string
482 .  ev doc-divert-environment
483 .  fi
484 .  di doc-diversion
488 .\" NS doc-end-diversion-and-print macro
489 .\" NS   end diversion and print
491 .de doc-end-diversion-and-print
492 .  br
493 .  di
494 .  ev
496 .  \" insert diversion only if it contains printable stuff
497 .  ie \n[dn] \{\
498 .    ds doc-str-dedap \&\*[doc-diversion]\c
499 .    ds doc-out-string "\*[doc-saved-out-string]\*[doc-str-dedap]\*[doc-out-string]
500 .  \}
501 .  el \
502 .    ds doc-out-string "\*[doc-saved-out-string]\*[doc-out-string]
504 .  nop \&\*[doc-out-string]
506 .  ds doc-out-string
507 .  nr doc-in-diversion 0
511 .\" NS doc-curr-font register
512 .\" NS   saved current font
513 .\" NS doc-curr-size register
514 .\" NS   saved current font size
517 .nr doc-curr-font \n[.f]
518 .nr doc-curr-size \n[.s]
522 .\" NS Fl user macro
523 .\" NS   handle flags (appends `-' and prints flags): `.Fl arg ...'
524 .\" NS
525 .\" NS width register `.Fl' set in doc-common
526 .\" NS
527 .\" NS local variable:
528 .\" NS   doc-reg-Fl (for communication with doc-flag-recursion)
530 .de Fl
531 .  as doc-out-string \*[doc-Fl-font]
533 .  if !\n[doc-args-processed] \{\
534 .    ie \n[.$] \{\
535 .      ds doc-macro-name Fl
536 .      doc-parse-args \$@
537 .    \}
538 .    el \{\
539 .      \" no arguments
540 .      as doc-out-string \|\-\|\f[P]\s[0]
541 .      doc-print-out-string
542 .    \}
543 .  \}
545 .  if \n[doc-args-processed] \{\
546 .    nr doc-arg-ptr +1
547 .    ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
548 .      \" last argument
549 .      as doc-out-string \|\-\f[P]\s[0]
550 .      doc-print-and-reset
551 .    \}
552 .    el \{\
553 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
554 .        as doc-out-string \|\-\f[P]\s[0]
555 .        \*[doc-arg\n[doc-arg-ptr]]
556 .      \}
557 .      el \{\
558 .        nr doc-curr-font \n[.f]
559 .        nr doc-curr-size \n[.s]
561 .        if "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \
562 .          as doc-out-string \|\-\|
564 .        nr doc-reg-Fl 1
565 .        doc-flag-recursion
566 .      \}
567 .    \}
568 .  \}
572 .\" NS doc-flag-recursion macro
573 .\" NS   `Fl' flag recursion routine (special handling)
574 .\" NS
575 .\" NS local variables:
576 .\" NS   doc-str-dfr, doc-str-dfr1, doc-reg-dfr
578 .de doc-flag-recursion
579 .  ds doc-str-dfr \*[doc-type\n[doc-arg-ptr]]
580 .  ds doc-str-dfr1 "\*[doc-arg\n[doc-arg-ptr]]
582 .  hy 0
584 .  ie "\*[doc-str-dfr]"macro" \{\
585 .    as doc-out-string \f[P]\s[0]
586 .    \*[doc-str-dfr1]
587 .  \}
588 .  el \{\
589 .    nr doc-reg-dfr \n[doc-arg-ptr]
591 .    ie "\*[doc-str-dfr]"string" \{\
592 .      \" handle vertical bar -- doc-reg-Fl is set for the first call of
593 .      \" doc-flag-recursion only; we need this to handle `.Fl | ...'
594 .      \" correctly
595 .      ie "\*[doc-str-dfr1]"\*[Ba]" \{\
596 .        if \n[doc-reg-Fl] \
597 .          as doc-out-string \|\-\*[doc-space]
598 .        as doc-out-string \&\*[Ba]
599 .      \}
600 .      el \{\
601 .        ie "\*[doc-str-dfr1]"\f[R]|\f[P]" \{\
602 .          if \n[doc-reg-Fl] \
603 .            as doc-out-string \|\-\*[doc-space]
604 .          as doc-out-string \f[R]|\f[P]
605 .        \}
606 .        el \{\
607 .          \" two consecutive hyphen characters?
608 .          ie "\*[doc-str-dfr1]"-" \
609 .            as doc-out-string \|\-\^\-\|
610 .          el \
611 .            as doc-out-string \|\-\*[doc-str-dfr1]
612 .        \}
613 .      \}
614 .    \}
615 .    el \{\
616 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
617 .      as doc-out-string "\*[doc-str-dfr1]\f[P]\s[0]
618 .    \}
620 .    ie (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
621 .      \" last argument
622 .      if "\*[doc-str-dfr]"punct-prefix" \
623 .        as doc-out-string \|\-
624 .      as doc-out-string \f[P]\s[0]
625 .      doc-print-and-reset
626 .    \}
627 .    el \{\
628 .      nr doc-arg-ptr +1
629 .      ie "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \{\
630 .        ie "\*[doc-type\n[doc-reg-dfr]]"punct-prefix" \
631 .          as doc-out-string \|\-
632 .        el \
633 .          as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
634 .      \}
635 .      el \
636 .        as doc-out-string "\*[doc-space\n[doc-reg-dfr]]
638 .      shift
639 .      nr doc-reg-Fl 0
640 .      doc-flag-recursion \$@
641 .    \}
642 .  \}
646 .\" NS doc-print-recursive macro
647 .\" NS   general name recursion routine (print remaining arguments)
648 .\" NS
649 .\" NS local variables:
650 .\" NS   doc-str-dpr, doc-reg-dpr
652 .de doc-print-recursive
653 .  ds doc-str-dpr \*[doc-type\n[doc-arg-ptr]]
655 .  hy 0
657 .  ie "\*[doc-str-dpr]"macro" \{\
658 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
659 .    \*[doc-arg\n[doc-arg-ptr]]
660 .  \}
661 .  el \{\
662 .    nr doc-reg-dpr \n[doc-arg-ptr]
664 .    ie "\*[doc-str-dpr]"string" \
665 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
666 .    el \{\
667 .      \" punctuation character
668 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
669 .      as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
670 .    \}
672 .    nr doc-arg-ptr +1
673 .    ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
674 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
675 .      doc-print-and-reset
676 .    \}
677 .    el \{\
678 .      as doc-out-string "\*[doc-space\n[doc-reg-dpr]]
679 .      doc-print-recursive
680 .    \}
681 .  \}
685 .\" NS Ar user macro
686 .\" NS   command line `argument' macro: `.Ar [args ...]'
687 .\" NS
688 .\" NS width register `.Ar' set in doc-common
690 .de Ar
691 .  as doc-out-string \*[doc-Ar-font]
693 .  if !\n[doc-args-processed] \{\
694 .    ie \n[.$] \{\
695 .      ds doc-macro-name Ar
696 .      doc-parse-args \$@
697 .    \}
698 .    el \{\
699 .      as doc-out-string \&file\ ...\f[P]\s[0]
700 .      doc-print-out-string
701 .    \}
702 .  \}
704 .  if \n[doc-args-processed] \{\
705 .    nr doc-arg-ptr +1
706 .    ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
707 .      as doc-out-string \&file\ ...\f[P]\s[0]
708 .      doc-print-and-reset
709 .    \}
710 .    el \{\
711 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
712 .        as doc-out-string \&file\ ...\f[P]\s[0]
713 .        \*[doc-arg\n[doc-arg-ptr]]
714 .      \}
715 .      el \{\
716 .        nr doc-curr-font \n[.f]
717 .        nr doc-curr-size \n[.s]
718 .        if "\*[doc-type\n[doc-arg-ptr]]"punct-suffix" \
719 .          as doc-out-string \&file\ ...
720 .        doc-print-recursive
721 .      \}
722 .    \}
723 .  \}
727 .\" NS Ad user macro
728 .\" NS   Addresses
729 .\" NS
730 .\" NS width register `.Ad' set in doc-common
732 .de Ad
733 .  if !\n[doc-args-processed] \{\
734 .    ie !\n[.$] \
735 .      tm Usage: .Ad address ... \*[doc-punct-chars] (#\n[.c])
736 .    el \{\
737 .      ds doc-macro-name Ad
738 .      doc-parse-args \$@
739 .    \}
740 .  \}
742 .  nr doc-arg-ptr +1
743 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
744 .    as doc-out-string \*[doc-Ad-font]
745 .    nr doc-curr-font \n[.f]
746 .    nr doc-curr-size \n[.s]
747 .    doc-print-recursive
748 .  \}
752 .\" NS Cd user macro
753 .\" NS   Config declaration (for section 4 SYNOPSIS) (not callable)
754 .\" NS
755 .\" NS width register `.Cd' set in doc-common
756 .\" NS
757 .\" NS local variable:
758 .\" NS   doc-reg-Cd
760 .\" needs work - not very translatable
762 .de Cd
763 .  if !\n[doc-args-processed] \{\
764 .    ie !\n[.$] \
765 .      tm Usage: .Cd Configuration file declaration (#\n[.c])
766 .    el \{\
767 .      ds doc-macro-name Cd
769 .      nr doc-reg-Cd 1
770 .      while (\n[doc-reg-Cd] <= \n[.$]) \{\
771 .        ds doc-arg\n[doc-reg-Cd] "\$[\n[doc-reg-Cd]]
772 .        nr doc-reg-Cd +1
773 .      \}
775 .      nr doc-num-args \n[.$]
776 .      doc-parse-arg-vector
777 .    \}
778 .  \}
780 .  br
782 .  nr doc-arg-ptr +1
783 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
784 .    as doc-out-string \*[doc-Nm-font]
785 .    nr doc-curr-font \n[.f]
786 .    nr doc-curr-size \n[.s]
788 .    ie \n[doc-in-synopsis-section] \{\
789 .      if "\*[doc-macro-name]"Cd" \{\
790 .        rs
791 .        ie (\n[doc-in-synopsis-section] > 1) \
792 .          br
793 .        el \{\
794 .          if !\n[doc-indent-synopsis] \
795 .            nr doc-indent-synopsis \n[doc-display-indent]u
796 .        \}
797 .        in +\n[doc-indent-synopsis]u
798 .        ti -\n[doc-indent-synopsis]u
799 .        nr doc-in-synopsis-section +1
800 .      \}
802 .      doc-print-recursive
803 .      in -\n[doc-indent-synopsis]u
804 .    \}
805 .    el \
806 .      doc-print-recursive
807 .  \}
811 .\" NS Cm user macro
812 .\" NS   Interactive command modifier (flag)
813 .\" NS
814 .\" NS width register `.Cm' set in doc-common
815 .\" NS
816 .\" NS local variable:
817 .\" NS   doc-reg-Cm
819 .de Cm
820 .  if !\n[doc-args-processed] \{\
821 .    ie !\n[.$] \{\
822 .      tmc Usage: .Cm Interactive command modifier ...
823 .      tm1 " \*[doc-punct-chars] (#\n[.c])
824 .    \}
825 .    el \{\
826 .      ds doc-macro-name Cm
828 .      nr doc-reg-Cm 1
829 .      while (\n[doc-reg-Cm] <= \n[.$]) \{\
830 .        ds doc-arg\n[doc-reg-Cm] "\$[\n[doc-reg-Cm]]
831 .        nr doc-reg-Cm +1
832 .      \}
834 .      nr doc-num-args \n[.$]
835 .      doc-parse-arg-vector
836 .    \}
837 .  \}
839 .  nr doc-arg-ptr +1
840 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
841 .    as doc-out-string \*[doc-Cm-font]
842 .    nr doc-curr-font \n[.f]
843 .    nr doc-curr-size \n[.s]
844 .    doc-print-recursive
845 .  \}
849 .\" NS Dv user macro
850 .\" NS   define variable
851 .\" NS
852 .\" NS width register `.Dv' set in doc-common
854 .de Dv
855 .  if !\n[doc-args-processed] \{\
856 .    ie !\n[.$] \
857 .      tm Usage: .Dv define_variable ... \*[doc-punct-chars] (#\n[.c])
858 .    el \{\
859 .      ds doc-macro-name Dv
860 .      doc-parse-args \$@
861 .    \}
862 .  \}
864 .  nr doc-arg-ptr +1
865 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
866 .    as doc-out-string \*[doc-Er-font]
867 .    nr doc-curr-font \n[.f]
868 .    nr doc-curr-size \n[.s]
869 .    doc-print-recursive
870 .  \}
874 .\" NS Em user macro
875 .\" NS   emphasis
876 .\" NS
877 .\" NS width register `.Em' set in doc-common
878 .\" NS
879 .\" NS local variable:
880 .\" NS   doc-reg-Em
882 .de Em
883 .  if !\n[doc-args-processed] \{\
884 .    ie !\n[.$] \
885 .      tm Usage: .Em text ... \*[doc-punct-chars] (#\n[.c])
886 .    el \{\
887 .      ds doc-macro-name Em
889 .      nr doc-reg-Em 1
890 .      while (\n[doc-reg-Em] <= \n[.$]) \{\
891 .        ds doc-arg\n[doc-reg-Em] "\$[\n[doc-reg-Em]]
892 .        nr doc-reg-Em +1
893 .      \}
895 .      nr doc-num-args \n[.$]
896 .      doc-parse-arg-vector
897 .    \}
898 .  \}
900 .  nr doc-arg-ptr +1
901 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
902 .    as doc-out-string \*[doc-Em-font]
903 .    nr doc-curr-font \n[.f]
904 .    nr doc-curr-size \n[.s]
905 .    doc-print-recursive
910 .\" NS Er user macro
911 .\" NS   errno type
912 .\" NS
913 .\" NS width register `.Em' set in doc-common
915 .de Er
916 .  if !\n[doc-args-processed] \{\
917 .    ie !\n[.$] \
918 .      tm Usage: .Er ERRNOTYPE ... \*[doc-punct-chars] (#\n[.c])
919 .    el \{\
920 .      ds doc-macro-name Er
921 .      doc-parse-args \$@
922 .    \}
923 .  \}
925 .  nr doc-arg-ptr +1
926 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
927 .    as doc-out-string \*[doc-Er-font]
928 .    nr doc-curr-font \n[.f]
929 .    nr doc-curr-size \n[.s]
930 .    doc-print-recursive
931 .  \}
935 .\" NS Ev user macro
936 .\" NS   environment variable
937 .\" NS
938 .\" NS width register `.Ev' set in doc-common
940 .de Ev
941 .  if !\n[doc-args-processed] \{\
942 .    ie !\n[.$] \
943 .      tm Usage: .Ev ENVIRONMENT_VARIABLE ... \*[doc-punct-chars] (#\n[.c])
944 .    el \{\
945 .      ds doc-macro-name Ev
946 .      doc-parse-args \$@
947 .    \}
948 .  \}
950 .  nr doc-arg-ptr +1
951 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
952 .    as doc-out-string \*[doc-Ev-font]
953 .    nr doc-curr-font \n[.f]
954 .    nr doc-curr-size \n[.s]
955 .    doc-print-recursive
956 .  \}
960 .\" NS doc-declaration-count register
961 .\" NS   subroutine test (in synopsis only)
963 .nr doc-declaration-count 0
966 .\" NS doc-do-function-declaration macro
968 .de doc-do-function-declaration
969 .  ds doc-macro-name \$1
971 .  if \n[doc-in-synopsis-section] \{\
972 .    \" if a variable type was the last thing given, want vertical space
973 .    if \n[doc-variable-type] \{\
974 .      doc-paragraph
975 .      nr doc-variable-type 0
976 .    \}
977 .    \" if a subroutine was the last thing given, want vertical space
978 .    if \n[doc-function-count] \{\
979 .      ie !\n[doc-declaration-count] \{\
980 .        doc-paragraph
981 .        rs
982 .      \}
983 .      el \
984 .        br
985 .    \}
986 .    nr doc-declaration-count +1
987 .  \}
989 .  nr doc-curr-font \n[.f]
990 .  nr doc-curr-size \n[.s]
994 .\" NS Fd user macro
995 .\" NS   function declaration - not callable (& no err check)
996 .\" NS
997 .\" NS width register `.Fd' set in doc-common
999 .de Fd
1000 .  doc-do-function-declaration Fd
1001 .  nop \*[doc-Fd-font]\$*
1002 .  br
1003 .  ft \n[doc-curr-font]
1004 .  fs \n[doc-curr-size]
1008 .\" NS In user macro
1009 .\" NS   #include statement - not callable (& no err check)
1010 .\" NS
1011 .\" NS width register `.In' set in doc-common
1013 .de In
1014 .  doc-do-function-declaration In
1015 .  nop \*[doc-Fd-font]#include <\$1>
1016 .  br
1017 .  ft \n[doc-curr-font]
1018 .  fs \n[doc-curr-size]
1022 .\" NS Fr user macro
1023 .\" NS   function return value - not callable (at the moment)
1024 .\" NS
1025 .\" NS width register `.Fr' set in doc-common
1027 .de Fr
1028 .  if !\n[doc-args-processed] \{\
1029 .    ie !\n[.$] \
1030 .      tm Usage: .Fr Function_return_value... \*[doc-punct-chars] (#\n[.c])
1031 .    el \{\
1032 .      ds doc-macro-name Fr
1033 .      doc-parse-args \$@
1034 .    \}
1035 .  \}
1037 .  nr doc-arg-ptr +1
1038 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1039 .    as doc-out-string \*[doc-Ar-font]
1040 .    nr doc-curr-font \n[.f]
1041 .    nr doc-curr-size \n[.s]
1042 .    doc-print-recursive
1043 .  \}
1047 .\" NS Ic user macro
1048 .\" NS   interactive command
1049 .\" NS
1050 .\" NS width register `.Ic' set in doc-common
1052 .de Ic
1053 .  if !\n[doc-args-processed] \{\
1054 .    ie !\n[.$] \
1055 .      tm Usage: .Ic Interactive command ... \*[doc-punct-chars] (#\n[.c])
1056 .    el \{\
1057 .      ds doc-macro-name Ic
1058 .      doc-parse-args \$@
1059 .    \}
1060 .  \}
1062 .  nr doc-arg-ptr +1
1063 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1064 .    as doc-out-string \*[doc-Ic-font]
1065 .    nr doc-curr-font \n[.f]
1066 .    nr doc-curr-size \n[.s]
1067 .    doc-print-recursive
1068 .  \}
1072 .\" NS Li user macro
1073 .\" NS   literals
1074 .\" NS
1075 .\" NS width register `.Li' set in doc-common
1076 .\" NS
1077 .\" NS local variable:
1078 .\" NS   doc-reg-Li
1080 .de Li
1081 .  if !\n[doc-args-processed] \{\
1082 .    ie !\n[.$] \
1083 .      tm Usage .Li argument ... \*[doc-punct-chars] (#\n[.c])
1084 .    el \{\
1085 .      ds doc-macro-name Li
1087 .      nr doc-reg-Li 1
1088 .      while (\n[doc-reg-Li] <= \n[.$]) \{\
1089 .        ds doc-arg\n[doc-reg-Li] "\$[\n[doc-reg-Li]]
1090 .        nr doc-reg-Li +1
1091 .      \}
1093 .      nr doc-num-args \n[.$]
1094 .      doc-parse-arg-vector
1095 .    \}
1096 .  \}
1098 .  nr doc-arg-ptr +1
1099 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1100 .    as doc-out-string \*[doc-Li-font]
1101 .    nr doc-curr-font \n[.f]
1102 .    nr doc-curr-size \n[.s]
1103 .    doc-print-recursive
1104 .  \}
1108 .\" NS Or user macro
1109 .\" NS   pipe symbol (OR)
1110 .\" NS
1111 .\" NS width register `.Or' set in doc-common
1113 .de Or
1114 .  if !\n[doc-args-processed] \{\
1115 .    ie !\n[.$] \
1116 .      tm Usage: .Or ... \*[doc-punct-chars] (#\n[.c])
1117 .    el \{\
1118 .      ds doc-macro-name Or
1119 .      doc-parse-args \$@
1120 .    \}
1121 .  \}
1123 .  nr doc-arg-ptr +1
1124 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1125 .    as doc-out-string \*[doc-Ic-font]
1126 .    nr doc-curr-font \n[.f]
1127 .    nr doc-curr-size \n[.s]
1128 .    doc-print-recursive
1129 .  \}
1133 .\" NS Ms user macro
1134 .\" NS   math symbol
1135 .\" NS
1136 .\" NS width register `.Ms' set in doc-common
1138 .de Ms
1139 .  if !\n[doc-args-processed] \{\
1140 .    ie !\n[.$] \
1141 .      tm Usage: .Ms Math symbol ... \*[doc-punct-chars] (#\n[.c])
1142 .    el \{\
1143 .      ds doc-macro-name Ms
1144 .      doc-parse-args \$@
1145 .    \}
1146 .  \}
1148 .  nr doc-arg-ptr +1
1149 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1150 .    as doc-out-string \*[doc-Sy-font]
1151 .    nr doc-curr-font \n[.f]
1152 .    nr doc-curr-size \n[.s]
1153 .    doc-print-recursive
1154 .  \}
1158 .\" NS doc-command-name string
1159 .\" NS   save first invocation of .Nm
1161 .ds doc-command-name
1164 .\" NS Nm user macro
1165 .\" NS   name of command or page topic
1166 .\" NS
1167 .\" NS width register `.Nm' set in doc-common
1168 .\" NS
1169 .\" NS local variable:
1170 .\" NS   doc-reg-Nm
1172 .de Nm
1173 .  if !\n[doc-args-processed] \{\
1174 .    ie !\n[.$] \{\
1175 .      ie "\*[doc-command-name]"" \
1176 .        tm Usage: .Nm Name(s) ... \*[doc-punct-chars] (#\n[.c])
1177 .      el \
1178 .        nop \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1179 .    \}
1180 .    el \{\
1181 .      ds doc-macro-name Nm
1183 .      ie "\$1"" \
1184 .        ds doc-arg1 "\*[doc-command-name]
1185 .      el \
1186 .        ds doc-arg1 "\$1
1187 .      nr doc-reg-Nm 2
1188 .      while (\n[doc-reg-Nm] <= \n[.$]) \{\
1189 .        ds doc-arg\n[doc-reg-Nm] "\$[\n[doc-reg-Nm]]
1190 .        nr doc-reg-Nm +1
1191 .      \}
1193 .      nr doc-num-args \n[.$]
1194 .      doc-parse-arg-vector
1195 .    \}
1196 .  \}
1198 .  if \n[doc-args-processed] \{\
1199 .    nr doc-arg-ptr +1
1200 .    ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
1201 .      as doc-out-string \*[doc-Nm-font]\*[doc-command-name]\f[P]\s[0]
1202 .      doc-print-and-reset
1203 .    \}
1204 .    el \{\
1205 .      as doc-out-string \*[doc-Nm-font]
1206 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \{\
1207 .        as doc-out-string \&\*[doc-command-name]\f[P]\s[0]
1208 .        \*[doc-arg\n[doc-arg-ptr]]
1209 .      \}
1210 .      el \{\
1211 .        nr doc-curr-font \n[.f]
1212 .        nr doc-curr-size \n[.s]
1213 .        if \n[doc-in-synopsis-section] \{\
1214 .          if "\*[doc-macro-name]"Nm" \{\
1215 .            rs
1216 .            in -\n[doc-indent-synopsis]u
1217 .            ie (\n[doc-in-synopsis-section] > 1) \
1218 .              br
1219 .            el \{\
1220 .              if !\n[doc-indent-synopsis] \{\
1221 .                doc-get-width \$1
1222 .                nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
1223 .              \}
1224 .            \}
1225 .            in +\n[doc-indent-synopsis]u
1226 .            ti -\n[doc-indent-synopsis]u
1227 .            nr doc-in-synopsis-section +1
1228 .          \}
1229 .        \}
1230 .        if "\*[doc-command-name]"" \
1231 .          ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
1232 .        doc-print-recursive
1233 .      \}
1234 .    \}
1235 .  \}
1239 .\" NS Pa user macro
1240 .\" NS   pathname: `.Pa [arg ...]'
1241 .\" NS
1242 .\" NS width register `.Pa' set in doc-common
1244 .de Pa
1245 .  if !\n[doc-args-processed] \{\
1246 .    ie !\n[.$] \
1247 .      nop \*[doc-Pa-font]~\f[P]\s[0]
1248 .    el \{\
1249 .      ds doc-macro-name Pa
1250 .      doc-parse-args \$@
1251 .    \}
1252 .  \}
1254 .  nr doc-arg-ptr +1
1255 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1256 .    as doc-out-string \*[doc-Pa-font]
1257 .    nr doc-curr-font \n[.f]
1258 .    nr doc-curr-size \n[.s]
1259 .    doc-print-recursive
1260 .  \}
1264 .\" NS Sy user macro
1265 .\" NS   symbolics
1266 .\" NS
1267 .\" NS width register `.Sy' set in doc-common
1268 .\" NS
1269 .\" NS local variable:
1270 .\" NS   doc-reg-Sy
1272 .de Sy
1273 .  if !\n[doc-args-processed] \{\
1274 .    ie !\n[.$] \
1275 .      tm Usage: .Sy symbolic_text ... \*[doc-punct-chars] (#\n[.c])
1276 .    el \{\
1277 .      ds doc-macro-name Sy
1279 .      nr doc-reg-Sy 1
1280 .      while (\n[doc-reg-Sy] <= \n[.$]) \{\
1281 .        ds doc-arg\n[doc-reg-Sy] "\$[\n[doc-reg-Sy]]
1282 .        nr doc-reg-Sy +1
1283 .      \}
1285 .      nr doc-num-args \n[.$]
1286 .      doc-parse-arg-vector
1287 .    \}
1288 .  \}
1290 .  nr doc-arg-ptr +1
1291 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1292 .    as doc-out-string \*[doc-Sy-font]
1293 .    nr doc-curr-font \n[.f]
1294 .    nr doc-curr-size \n[.s]
1295 .    doc-print-recursive
1296 .  \}
1300 .\" NS Me user macro
1301 .\" NS   menu entries
1302 .\" NS
1303 .\" NS width register `.Me' set in doc-common
1304 .\" NS
1305 .\" NS local variable:
1306 .\" NS   doc-reg-Me
1308 .de Me
1309 .  if !\n[doc-args-processed] \{\
1310 .    ie !\n[.$] \
1311 .      tm Usage: .Me menu entry ... \*[doc-punct-chars] (#\n[.c])
1312 .    el \{\
1313 .      ds doc-macro-name Me
1315 .      nr doc-reg-Me 1
1316 .      while (\n[doc-reg-Me] <= \n[.$]) \{\
1317 .        ds doc-arg\n[doc-reg-Me] "\$[\n[doc-reg-Me]]
1318 .        nr doc-reg-Me +1
1319 .      \}
1321 .      nr doc-num-args \n[.$]
1322 .      doc-parse-arg-vector
1323 .    \}
1324 .  \}
1326 .  nr doc-arg-ptr +1
1327 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1328 .    as doc-out-string \*[doc-Me-font]
1329 .    nr doc-curr-font \n[.f]
1330 .    nr doc-curr-size \n[.s]
1331 .    doc-print-recursive
1332 .  \}
1336 .\" NS Tn user macro
1337 .\" NS   trade name
1338 .\" NS
1339 .\" NS width register `.Tn' set in doc-common
1341 .de Tn
1342 .  if !\n[doc-args-processed] \{\
1343 .    ie !\n[.$] \
1344 .      tm Usage: .Tn Trade_name(s) ... \*[doc-punct-chars] (#\n[.c])
1345 .    el \{\
1346 .      ds doc-macro-name Tn
1347 .      doc-parse-args \$@
1348 .    \}
1349 .  \}
1351 .  nr doc-arg-ptr +1
1352 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1353 .    as doc-out-string \&\*[doc-Tn-font-shape]\*[doc-Tn-font-size]
1354 .    nr doc-curr-font \n[.f]
1355 .    nr doc-curr-size \n[.s]
1356 .    doc-print-recursive
1357 .  \}
1361 .\" NS doc-reference-trademark macro
1362 .\" NS   .Tn for inside of references
1363 .\" NS
1364 .\" NS code for references checks for `Tn'!
1366 .de doc-reference-trademark
1367 .  if !\n[doc-args-processed] \{\
1368 .    ie !\n[.$] \
1369 .      tm Usage: .Tn Trade_name(s) ... \*[doc-punct-chars] (#\n[.c])
1370 .    el \{\
1371 .      ds doc-macro-name Tn
1372 .      doc-parse-args \$@
1373 .    \}
1374 .  \}
1376 .  nr doc-arg-ptr +1
1377 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1378 .    as doc-out-string \&\*[doc-Tn-font-size]
1379 .    nr doc-curr-font \n[.f]
1380 .    nr doc-curr-size \n[.s]
1381 .    doc-do-references
1382 .  \}
1386 .\" NS Va user macro
1387 .\" NS   variable name
1388 .\" NS
1389 .\" NS width register `.Va' set in doc-common
1391 .de Va
1392 .  if !\n[doc-args-processed] \{\
1393 .    ie !\n[.$] \
1394 .      tm Usage: .Va variable_name(s) ... \*[doc-punct-chars] (#\n[.c])
1395 .    el \{\
1396 .      ds doc-macro-name Va
1397 .      doc-parse-args \$@
1398 .    \}
1399 .  \}
1401 .  nr doc-arg-ptr +1
1402 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1403 .    as doc-out-string \*[doc-Va-font]
1404 .    nr doc-curr-font \n[.f]
1405 .    nr doc-curr-size \n[.s]
1406 .    doc-print-recursive
1407 .  \}
1411 .\" NS No user macro
1412 .\" NS   normal text macro (default text style if mess up)
1413 .\" NS
1414 .\" NS width register `.No' set in doc-common
1416 .de No
1417 .  as doc-out-string \*[doc-No-font]
1419 .  if !\n[doc-args-processed] \{\
1420 .    ie \n[.$] \
1421 .      ds doc-macro-name No
1422 .      doc-parse-args \$@
1423 .    el \{\
1424 .      tm Usage: .No must be called with arguments (#\n[.c])
1425 .    \}
1426 .  \}
1428 .  nr doc-arg-ptr +1
1429 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
1430 .    ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
1431 .      \*[doc-arg\n[doc-arg-ptr]]
1432 .    el \{\
1433 .      nr doc-curr-font \n[.f]
1434 .      nr doc-curr-size \n[.s]
1435 .      doc-print-recursive
1436 .    \}
1437 .  \}
1441 .\" NS Op user macro
1442 .\" NS   option expression
1443 .\" NS
1444 .\" NS width register `.Op' set in doc-common
1446 .de Op
1447 .  if !\n[doc-args-processed] \
1448 .    ds doc-macro-name Op
1450 .  ds doc-quote-left "\*[doc-left-bracket]
1451 .  ds doc-quote-right "\*[doc-right-bracket]
1453 .  doc-enclose-string \$@
1457 .\" NS Aq user macro
1458 .\" NS   enclose string in angle brackets
1459 .\" NS
1460 .\" NS width register `.Aq' set in doc-common
1462 .de Aq
1463 .  if !\n[doc-args-processed] \
1464 .    ds doc-macro-name Aq
1466 .  ds doc-quote-left <
1467 .  ds doc-quote-right >
1469 .  doc-enclose-string \$@
1473 .\" NS Bq user macro
1474 .\" NS   enclose string in square brackets
1475 .\" NS
1476 .\" NS width register `.Bq' set in doc-common
1478 .de Bq
1479 .  if !\n[doc-args-processed] \
1480 .    ds doc-macro-name Bq
1482 .  ds doc-quote-left "\*[doc-left-bracket]
1483 .  ds doc-quote-right "\*[doc-right-bracket]
1485 .  doc-enclose-string \$@
1489 .\" NS Dq user macro
1490 .\" NS   enclose string in double quotes
1491 .\" NS
1492 .\" NS width register `.Dq' set in doc-common
1494 .de Dq
1495 .  if !\n[doc-args-processed] \
1496 .    ds doc-macro-name Dq
1498 .  ds doc-quote-left "\*[Lq]
1499 .  ds doc-quote-right "\*[Rq]
1501 .  doc-enclose-string \$@
1505 .\" NS Eq user macro
1506 .\" NS   enclose string in user-defined quotes (args 1 and 2)
1507 .\" NS
1508 .\" NS width register `.Eq' set in doc-common
1510 .de Eq
1511 .  if !\n[doc-args-processed] \
1512 .    ds doc-macro-name Eq
1514 .  ds doc-quote-left "\$1
1515 .  ds doc-quote-right "\$2
1517 .  shift 2
1518 .  doc-enclose-string \$@
1522 .\" NS Pq user macro
1523 .\" NS   enclose string in parentheses
1524 .\" NS
1525 .\" NS width register `.Pq' set in doc-common
1527 .de Pq
1528 .  if !\n[doc-args-processed] \
1529 .    ds doc-macro-name Pq
1531 .  ds doc-quote-left "\*[doc-left-parenthesis]
1532 .  ds doc-quote-right "\*[doc-right-parenthesis]
1534 .  doc-enclose-string \$@
1538 .\" NS Ql user macro
1539 .\" NS   quoted literal
1541 .\"   is in file doc-[dit|n]roff (too large an if-else to carry along
1542 .\"   recursively for `if n ...')
1545 .\" NS Qq user macro
1546 .\" NS   enclose string in straight double quotes
1547 .\" NS
1548 .\" NS width register `.Qq' set in doc-common
1550 .de Qq
1551 .  if !\n[doc-args-processed] \
1552 .    ds doc-macro-name Qq
1554 .  ds doc-quote-left "\*[q]
1555 .  ds doc-quote-right "\*[q]
1557 .  doc-enclose-string \$@
1561 .\" NS Sq user macro
1562 .\" NS   enclose string in single quotes
1563 .\" NS
1564 .\" NS width register `.Sq' set in doc-common
1566 .de Sq
1567 .  if !\n[doc-args-processed] \
1568 .    ds doc-macro-name Sq
1570 .  ds doc-quote-left "\*[doc-left-singlequote]
1571 .  ds doc-quote-right "\*[doc-right-singlequote]
1573 .  doc-enclose-string \$@
1577 .\" NS doc-temp-args-processed register
1578 .\" NS   for data transfer to/from doc-skip-punct-backwards
1580 .nr doc-temp-args-processed 0
1583 .\" NS doc-enclose-string macro
1584 .\" NS   enclose string with given args (e.g. [ and ])
1585 .\" NS
1586 .\" NS requires:
1587 .\" NS   doc-quote-left (to be set by calling macro)
1588 .\" NS   doc-quote-right (to be set by calling macro)
1590 .de doc-enclose-string
1591 .  \" .tm doc-enclose-string beg:
1592 .  \" .tm1 "  arg(doc-arg[\n[doc-arg-ptr]])==\*[doc-arg\n[doc-arg-ptr]]
1593 .  \" .tm1 "  doc-nesting-level==\n[doc-nesting-level]
1594 .  \" .tm1 "  doc-in-diversion==\n[doc-in-diversion]
1595 .  \" .tm1 "  doc-saved-list-immediate==\n[doc-saved-list-immediate]
1596 .  \" .tm1 "  doc-args-processed==\n[doc-args-processed]
1598 .  ie !\n[doc-args-processed] \{\
1599 .    ie !\n[.$] \{\
1600 .      as doc-out-string \&\*[doc-quote-left]\*[doc-quote-right]
1601 .      doc-print-out-string
1602 .    \}
1603 .    el \{\
1604 .      \".as doc-macro-name (doc-enclose-string)
1605 .      doc-parse-args \$@
1606 .      as doc-out-string \&\*[doc-quote-left]
1607 .    \}
1608 .  \}
1609 .  el \
1610 .    as doc-out-string \&\*[doc-quote-left]
1612 .  if \n[doc-args-processed] \{\
1613 .    nr doc-arg-ptr +1
1614 .    ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \{\
1615 .      as doc-out-string \&\*[doc-quote-right]
1616 .      doc-print-and-reset
1617 .    \}
1618 .    el \{\
1619 .      ie "\*[doc-type\n[doc-args-processed]]"punct-suffix" \{\
1620 .        nr doc-temp-args-processed (\n[doc-args-processed] - 1)
1621 .        doc-skip-punct-backwards
1622 .        nr doc-temp-args-processed +1
1623 .        ds doc-arg\n[doc-temp-args-processed] "\*[doc-quote-right]\&\*[doc-arg\n[doc-temp-args-processed]]
1624 .        nr doc-temp-args-processed 0
1625 .      \}
1626 .      el \
1627 .        doc-append-arg "\*[doc-quote-right]" punct-suffix
1628 .      doc-do-\*[doc-type\n[doc-arg-ptr]]
1629 .      \}
1630 .    \}
1631 .  \}
1635 .\" NS doc-skip-punct-backwards macro
1636 .\" NS   vector routine (for `doc-enclose-string': trace backwards past
1637 .\" NS   trailing punctuation)
1639 .de doc-skip-punct-backwards
1640 .  if "\*[doc-type\n[doc-temp-args-processed]]"punct-suffix" \{\
1641 .    nr doc-temp-args-processed -1
1642 .    doc-skip-punct-backwards
1643 .  \}
1647 .\" NS Ao user macro
1648 .\" NS   angle open
1649 .\" NS
1650 .\" NS width register `.Ao' set in doc-common
1652 .de Ao
1653 .  if !\n[doc-args-processed] \
1654 .    ds doc-macro-name Ao
1656 .  ds doc-quote-left <
1658 .  doc-enclose-open \$@
1662 .\" NS Ac user macro
1663 .\" NS   angle close
1664 .\" NS
1665 .\" NS width register `.Ac' set in doc-common
1667 .de Ac
1668 .  if !\n[doc-args-processed] \
1669 .    ds doc-macro-name Ac
1671 .  ds doc-quote-right >
1673 .  doc-enclose-close \$@
1677 .\" NS Bo user macro
1678 .\" NS   bracket open
1679 .\" NS
1680 .\" NS width register `.Bo' set in doc-common
1682 .de Bo
1683 .  if !\n[doc-args-processed] \
1684 .    ds doc-macro-name Bo
1686 .  ds doc-quote-left [
1688 .  doc-enclose-open \$@
1692 .\" NS Bc user macro
1693 .\" NS   bracket close
1694 .\" NS
1695 .\" NS width register `.Bc' set in doc-common
1697 .de Bc
1698 .  if !\n[doc-args-processed] \
1699 .    ds doc-macro-name Bc
1701 .  ds doc-quote-right ]
1703 .  doc-enclose-close \$@
1707 .\" NS Do user macro
1708 .\" NS   double quote open
1709 .\" NS
1710 .\" NS width register `.Do' set in doc-common
1712 .de Do
1713 .  if !\n[doc-args-processed] \
1714 .    ds doc-macro-name Do
1716 .  ds doc-quote-left "\*[Lq]
1718 .  doc-enclose-open \$@
1722 .\" NS Dc user macro
1723 .\" NS   double quote close
1724 .\" NS
1725 .\" NS width register `.Dc' set in doc-common
1727 .de Dc
1728 .  if !\n[doc-args-processed] \
1729 .    ds doc-macro-name Dc
1731 .  ds doc-quote-right "\*[Rq]
1733 .  doc-enclose-close \$@
1737 .\" NS Eo user macro
1738 .\" NS   enclose open (using first argument as beginning of enclosion)
1739 .\" NS
1740 .\" NS width register `.Eo' set in doc-common
1742 .de Eo
1743 .  if !\n[doc-args-processed] \
1744 .    ds doc-macro-name Eo
1746 .  ds doc-quote-left "\$1
1748 .  shift
1749 .  doc-enclose-open \$@
1753 .\" NS Ec user macro
1754 .\" NS   enclose close (using first argument as end of enclosion)
1755 .\" NS
1756 .\" NS width register `.Ec' set in doc-common
1758 .de Ec
1759 .  if !\n[doc-args-processed] \
1760 .    ds doc-macro-name Ec
1762 .  ds doc-quote-right "\$1
1764 .  shift
1765 .  doc-enclose-close \$@
1769 .\" NS Oo user macro
1770 .\" NS   option open
1771 .\" NS
1772 .\" NS width register `.Oo' set in doc-common
1774 .de Oo
1775 .  if !\n[doc-args-processed] \
1776 .    ds doc-macro-name Oo
1778 .  ds doc-quote-left [
1780 .  doc-enclose-open \$@
1784 .\" NS Oc user macro
1785 .\" NS   option close
1786 .\" NS
1787 .\" NS width register `.Oc' set in doc-common
1789 .de Oc
1790 .  if !\n[doc-args-processed] \
1791 .    ds doc-macro-name Oc
1793 .  ds doc-quote-right ]
1795 .  doc-enclose-close \$@
1799 .\" NS Po user macro
1800 .\" NS   parenthesis open
1801 .\" NS
1802 .\" NS width register `.Po' set in doc-common
1804 .de Po
1805 .  if !\n[doc-args-processed] \
1806 .    ds doc-macro-name Po
1808 .  ds doc-quote-left (
1810 .  doc-enclose-open \$@
1814 .\" NS Pc user macro
1815 .\" NS   parenthesis close
1816 .\" NS
1817 .\" NS width register `.Pc' set in doc-common
1819 .de Pc
1820 .  if !\n[doc-args-processed] \
1821 .    ds doc-macro-name Pc
1823 .  ds doc-quote-right )
1825 .  doc-enclose-close \$@
1829 .\" NS Qo user macro
1830 .\" NS   straight double quote open
1831 .\" NS
1832 .\" NS width register `.Qo' set in doc-common
1834 .de Qo
1835 .  if !\n[doc-args-processed] \
1836 .    ds doc-macro-name Qo
1838 .  ds doc-quote-left "\*[q]
1840 .  doc-enclose-open \$@
1844 .\" NS Qc user macro
1845 .\" NS   straight double quote close
1846 .\" NS
1847 .\" NS width register `.Qc' set in doc-common
1849 .de Qc
1850 .  if !\n[doc-args-processed] \
1851 .    ds doc-macro-name Qc
1853 .  ds doc-quote-right "\*[q]
1855 .  doc-enclose-close \$@
1859 .\" NS So user macro
1860 .\" NS   single quote open
1861 .\" NS
1862 .\" NS width register `.So' set in doc-common
1864 .de So
1865 .  if !\n[doc-args-processed] \
1866 .    ds doc-macro-name So
1868 .  ds doc-quote-left "\*[doc-left-singlequote]
1870 .  doc-enclose-open \$@
1874 .\" NS Sc user macro
1875 .\" NS   single quote close
1876 .\" NS
1877 .\" NS width register `.Sc' set in doc-common
1879 .de Sc
1880 .  if !\n[doc-args-processed] \
1881 .    ds doc-macro-name Sc
1883 .  ds doc-quote-right "\*[doc-right-singlequote]
1885 .  doc-enclose-close \$@
1889 .\" NS Xo user macro
1890 .\" NS   extend open
1891 .\" NS
1892 .\" NS width register `.Xo' set in doc-common
1894 .de Xo
1895 .  if !\n[doc-args-processed] \
1896 .    ds doc-macro-name Xo
1897 .  \" .nr doc-in-macro 1
1899 .  ds doc-quote-left
1901 .  doc-enclose-open \$@
1905 .\" NS Xc user macro
1906 .\" NS   extend close
1907 .\" NS
1908 .\" NS width register `.Xc' set in doc-common
1910 .de Xc
1911 .  \" .nr doc-in-macro 0
1912 .  if !\n[doc-args-processed] \
1913 .    ds doc-macro-name Xc
1915 .  ds doc-quote-right
1917 .  doc-enclose-close \$@
1921 .\" NS doc-nesting-level register
1922 .\" NS   (extension possible)
1924 .nr doc-nesting-level 0
1927 .\" NS doc-enclose-open macro
1928 .\" NS   enclose string open
1930 .de doc-enclose-open
1931 .  nr doc-nesting-level +1
1933 .  \" .tm doc-enclose-open
1934 .  \" .tmc "  last arg==
1935 .  \" .tm doc-arg[\n[doc-args-processed]]==\*[doc-arg\n[doc-args-processed]]
1936 .  \" .tm1 "  doc-arg-ptr==\n[doc-arg-ptr]
1937 .  \" .tm1 "  doc-nesting-level==\n[doc-nesting-level]
1938 .  \" .tm1 "  doc-in-diversion==\n[doc-in-diversion]
1940 .  ie !\n[doc-args-processed] \{\
1941 .    ie \n[.$] \{\
1942 .      doc-parse-args \$@
1943 .      as doc-out-string \&\*[doc-quote-left]
1944 .    \}
1945 .    el \{\
1946 .      as doc-out-string \&\*[doc-quote-left]
1948 .      if !\n[doc-in-diversion] \
1949 .        if \n[doc-space-mode] \
1950 .          doc-save-and-divert
1951 .    \}
1952 .  \}
1953 .  el \
1954 .    as doc-out-string \&\*[doc-quote-left]
1956 .  ie \n[doc-args-processed] \{\
1957 .    if (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
1958 .      nr doc-arg-ptr +1
1959 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
1960 .        \*[doc-arg\n[doc-arg-ptr]]
1961 .      el \{\
1962 .        nr doc-arg-ptr -1
1963 .        No
1964 .      \}
1965 .    \}
1967 .    if (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
1968 .      if \n[doc-list-immediate] \{\
1969 .        \" .tm SETTING doc-saved-list-immediate!
1970 .        nr doc-saved-list-immediate 1
1971 .      \}
1972 .      \" .\" .ds doc-curr-space
1973 .      \" CHANGED .ds doc-curr-space "\*[doc-soft-space]
1974 .      doc-reset-args
1975 .    \}
1976 .  \}
1977 .  el \{\
1978 .    if (\n[doc-nesting-level] > 1) \
1979 .      as doc-out-string "\*[doc-space]
1980 .  \}
1984 .ds doc-saved-list-type
1987 .\" NS doc-enclose-close macro
1988 .\" NS   enclose string close
1989 .\" NS
1990 .\" NS local variable:
1991 .\" NS   doc-str-dec
1993 .de doc-enclose-close
1994 .  nr doc-nesting-level -1
1996 .  \" .tm doc-enclose-close
1997 .  \" .tmc "  last arg==
1998 .  \" .tm doc-arg[\n[doc-args-processed]]==\*[doc-arg\n[doc-args-processed]]
1999 .  \" .tm1 "  doc-arg-ptr==\n[doc-arg-ptr]
2000 .  \" .tm1 "  doc-nesting-level==\n[doc-nesting-level]
2001 .  \" .tm1 "  doc-in-diversion==\n[doc-in-diversion]
2003 .  as doc-out-string \&\*[doc-quote-right]
2005 .  if !\n[doc-args-processed] \{\
2006 .    ie \n[.$] \
2007 .      doc-parse-args \$@
2008 .    el \{\
2009 .      doc-print-out-string
2010 .      if !"\*[doc-saved-list-type]"" \{\
2011 .        doc-\*[doc-list-stack\n[doc-list-depth]]
2012 .        nr doc-saved-list-immediate 0
2013 .        ds doc-saved-list-type
2014 .      \}
2015 .    \}
2016 .  \}
2018 .  if (\n[doc-args-processed] > 0) \{\
2019 .    ie (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
2020 .      ie !\n[doc-nesting-level] \
2021 .        doc-print-and-reset
2022 .      el \
2023 .        doc-reset-args
2024 .    \}
2025 .    el \{\
2026 .      nr doc-str-dec (\n[doc-arg-ptr] + 1)
2027 .      if "\*[doc-type\n[doc-str-dec]]"string" \
2028 .        as doc-out-string "\*[doc-space\n[doc-args-processed]]
2030 .      \" .tm CURRENT
2031 .      \" .tm1 "  doc-arg-ptr==\*[doc-arg\n[doc-arg-ptr]]
2032 .      \" .tm1 "  ap+1==\*[doc-arg\n[doc-str-dec]]
2033 .      \" .tm1 "  doc-list-immediate==\n[doc-list-immediate]
2034 .      \" .tm1 "  doc-saved-list-immediate==\n[doc-saved-list-immediate]
2036 .      if \n[doc-list-immediate] \{\
2037 .        \" .tm UNSETTING doc-saved-list-immediate==\n[doc-saved-list-immediate]!
2038 .        if \n[doc-saved-list-immediate] \
2039 .          nr doc-saved-list-immediate 0
2040 .        \" .tm NOW doc-saved-list-immediate==\n[doc-saved-list-immediate]!
2041 .      \}
2042 .      No
2043 .    \}
2044 .  \}
2048 .\" NS Pf user macro
2049 .\" NS   prefix (calls .doc-make-prefix): `.Pf prefix arg ...'
2050 .\" NS
2051 .\" NS width register `.Pf' set in doc-common
2053 .de Pf
2054 .  if !\n[doc-args-processed] \
2055 .    ds doc-macro-name Pf
2057 .  ds doc-quote-left "\$1
2059 .  shift
2060 .  doc-make-prefix \$@
2064 .\" NS doc-make-prefix macro
2065 .\" NS   prefix (for prefixing open quotes, brackets, etc.)
2067 .de doc-make-prefix
2068 .  ie !\n[doc-args-processed] \{\
2069 .    as doc-out-string \&\*[doc-quote-left]
2070 .    ie (\n[.$] < 2) \{\
2071 .      tm mdoc warning: .Pf: missing arguments (#\n[.c])
2072 .      doc-print-out-string
2073 .    \}
2074 .    el \
2075 .      doc-parse-args \$@
2076 .  \}
2077 .  el \{\
2078 .    ie ((\n[doc-args-processed] - \n[doc-arg-ptr]) > 1) \{\
2079 .      nr doc-arg-ptr +1
2080 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2081 .    \}
2082 .    el \
2083 .      tm mdoc warning: .Pf: trailing prefix (#\n[.c])
2084 .  \}
2086 .  if \n[doc-args-processed] \{\
2087 .    nr doc-arg-ptr +1
2088 .    ie (\n[doc-args-processed] < \n[doc-arg-ptr]) \
2089 .      doc-print-and-reset
2090 .    el \
2091 .      doc-do-\*[doc-type\n[doc-arg-ptr]]
2092 .  \}
2096 .\" NS Ns user macro
2097 .\" NS   remove space (space removal done by .doc-parse-args or
2098 .\" NS   .doc-parse-arg-vector)
2099 .\" NS
2100 .\" NS width register `.Ns' set in doc-common
2102 .de Ns
2103 .  if !\n[doc-args-processed] \{\
2104 .    ds doc-macro-name Ns
2105 .    ie \n[.$] \
2106 .      doc-parse-args \$@
2107 .    el \
2108 .      tm Usage: .Ns must be called with arguments (#\n[.c])
2109 .  \}
2111 .  No
2115 .\" NS Ap user macro
2116 .\" NS   append an apostrophe
2117 .\" NS
2118 .\" NS width register `.Ap' set in doc-common
2120 .de Ap
2121 .  if !\n[doc-args-processed] \
2122 .    tm Usage: `Ap' cannot be first request on a line (no `.Ap') (#\n[.c])
2124 .  as doc-out-string \&'
2125 .  No
2129 .\" NS doc-space string
2130 .\" NS   current inter-argument space
2132 .ds doc-space "\*[doc-soft-space]
2135 .\" NS doc-soft-space string
2136 .\" NS   soft (stretchable) space (defined in doc-common)
2138 .\" NS doc-hard-space string
2139 .\" NS   hard (unpaddable) space (defined in doc-common)
2142 .\" NS doc-set-hard-space macro
2143 .\" NS   set current space string to hard (unpaddable) space.
2145 .de doc-set-hard-space
2146 .  ds doc-space "\*[doc-hard-space]
2150 .\" NS doc-set-soft-space macro
2151 .\" NS   set current space string to soft space (troff limitation)
2153 .de doc-set-soft-space
2154 .  ds doc-space "\*[doc-soft-space]
2158 .\" NS doc-space-mode register
2159 .\" NS   default is one (space mode on)
2161 .nr doc-space-mode 1
2164 .\" NS Sm user macro
2165 .\" NS   space mode
2166 .\" NS
2167 .\" NS width register `.Sm' set in doc-common
2169 .de Sm
2170 .  if !\n[doc-args-processed] \{\
2171 .    ie !\n[.$] \
2172 .      tm Usage: .Sm [off | on] (#\n[.c])
2173 .    el \{\
2174 .      ds doc-macro-name Sm
2175 .      doc-parse-args \$@
2176 .    \}
2177 .  \}
2179 .  if \n[doc-args-processed] \{\
2180 .    nr doc-arg-ptr +1
2181 .    if "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
2182 .      ds doc-space "\*[doc-soft-space]
2183 .      nr doc-space-mode 1
2184 .    \}
2185 .    if "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
2186 .      ds doc-space
2187 .      ds doc-curr-space
2188 .\" XXX
2189 .      rm doc-space1 doc-space2 doc-space3 doc-space4
2190 .      rm doc-space5 doc-space6 doc-space7 doc-space8 doc-space9
2192 .      nr doc-space-mode 0
2193 .    \}
2195 .    ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \
2196 .      No
2197 .    el \
2198 .      doc-reset-args
2199 .  \}
2203 .\" NS   doc-arg-type string
2204 .\" NS     argument type
2206 .ds doc-arg-type
2209 .\" NS doc-get-arg-type macro
2210 .\" NS   get argument type (`macro', `string', `punct-suffix', or
2211 .\" NS   `punct-prefix')
2212 .\" NS
2213 .\" NS modifies:
2214 .\" NS   doc-arg-type
2216 .de doc-get-arg-type
2217 .  ds doc-arg-type
2218 .  ie ((\n[doc-width] > 2) : (\A'\$1' == 0)) \
2219 .    ds doc-arg-type string
2220 .  el \{\
2221 .    if (\n[doc-width] == 1) \{\
2222 .      ie d z\$1 \{\
2223 .        ie "\*[z\$1]"punct-suffix" \
2224 .          ds doc-arg-type punct-suffix
2225 .        el \{\
2226 .          ie "\*[z\$1]"punct-prefix" \
2227 .            ds doc-arg-type punct-prefix
2228 .          el \
2229 .            ds doc-arg-type string
2230 .        \}
2231 .      \}
2232 .      el \
2233 .        ds doc-arg-type string
2234 .    \}
2235 .    if (\n[doc-width] == 2) \{\
2236 .      ie r \$1 \{\
2237 .        ie \n[\$1] \
2238 .          ds doc-arg-type macro
2239 .        el \
2240 .          ds doc-arg-type string
2241 .      \}
2242 .      el \
2243 .        ds doc-arg-type string
2244 .    \}
2245 .  \}
2249 .\" NS doc-get-arg-type* macro
2250 .\" NS   same as `.doc-get-arg-type' but uses doc-argXXX strings
2251 .\" NS
2252 .\" NS modifies:
2253 .\" NS
2254 .\" NS   doc-arg-type
2256 .de doc-get-arg-type*
2257 .  ds doc-arg-type
2258 .  doc-get-arg-width \$1
2260 .  ie ((\n[doc-width] > 2) : (\A'\*[doc-arg\$1]' == 0)) \
2261 .    ds doc-arg-type string
2262 .  el \{\
2263 .    if (\n[doc-width] == 1) \{\
2264 .      ie d z\*[doc-arg\$1] \{\
2265 .        ie "\*[z\*[doc-arg\$1]]"punct-suffix" \
2266 .          ds doc-arg-type punct-suffix
2267 .        el \{\
2268 .          ie "\*[z\*[doc-arg\$1]]"punct-prefix" \
2269 .            ds doc-arg-type punct-prefix
2270 .          el \
2271 .            ds doc-arg-type string
2272 .        \}
2273 .      \}
2274 .      el \
2275 .        ds doc-arg-type string
2276 .    \}
2277 .    if (\n[doc-width] == 2) \{\
2278 .      ie r \*[doc-arg\$1] \{\
2279 .        ie \n[\*[doc-arg\$1]] \
2280 .          ds doc-arg-type macro
2281 .        el \
2282 .          ds doc-arg-type string
2283 .      \}
2284 .      el \
2285 .        ds doc-arg-type string
2286 .    \}
2287 .  \}
2291 .\" NS doc-set-spacing-for- macro
2292 .\" NS   catch errors (non-existent type)
2294 .de doc-set-spacing-for-
2295 .  tmc mdoc error: bogus type (can't set space
2296 .  tm1 " `\*[doc-arg\n[doc-args-processed]]') (#\n[.c])
2300 .\" NS doc-set-spacing-for-macro macro
2301 .\" NS   set spacing for macros
2302 .\" NS
2303 .\" NS local variable:
2304 .\" NS   doc-reg-dssfm, doc-reg-dssfm1
2306 .de doc-set-spacing-for-macro
2307 .  nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-args-processed]]]
2309 .  \" closing macros like .Ac, Bc., etc. have value 3
2310 .  ie (\n[doc-reg-dssfm1] == 3) \{\
2311 .    nr doc-reg-dssfm (\n[doc-args-processed] - 1)
2312 .    ds doc-space\n[doc-reg-dssfm]
2313 .    ds doc-space\n[doc-args-processed] "\*[doc-space]
2314 .  \}
2315 .  el \{\
2316 .    \" macros like .Ap and .Ns have value 2
2317 .    ie (\n[doc-reg-dssfm1] == 2) \{\
2318 .      nr doc-reg-dssfm (\n[doc-args-processed] - 1)
2319 .      ds doc-space\n[doc-reg-dssfm]
2320 .      ds doc-space\n[doc-args-processed]
2321 .    \}
2322 .    el \
2323 .      ds doc-space\n[doc-args-processed]
2324 .  \}
2328 .\" NS doc-set-spacing-for-string macro
2329 .\" NS   set spacing for strings
2331 .de doc-set-spacing-for-string
2332 .  ds doc-space\n[doc-args-processed] "\*[doc-space]
2336 .\" NS doc-set-spacing-for-punct-suffix macro
2337 .\" NS   set spacing for punctuation suffixes
2338 .\" NS
2339 .\" NS local variable:
2340 .\" NS   doc-reg-dssfps
2342 .de doc-set-spacing-for-punct-suffix
2343 .  if (\n[doc-args-processed] > 1) \{\
2344 .    nr doc-reg-dssfps (\n[doc-args-processed] - 1)
2345 .    ds doc-space\n[doc-reg-dssfps]
2346 .  \}
2348 .  ds doc-space\n[doc-args-processed] "\*[doc-space]
2352 .\" NS doc-set-spacing-for-punct-prefix macro
2353 .\" NS   set spacing for punctuation prefixes
2355 .de doc-set-spacing-for-punct-prefix
2356 .  ds doc-space\n[doc-args-processed]
2360 .\" type switches (on current argument doc-arg-ptr)
2362 .\" NS doc-do- macro
2363 .\" NS   catch errors (non-existent type)
2365 .de doc-do-
2366 .  tmc mdoc error: bogus type (can't determine
2367 .  tm1 " `\*[doc-arg\n[doc-args-processed]]') (#\n[.c])
2371 .\" NS doc-do-macro macro
2372 .\" NS   call request if macro
2374 .de doc-do-macro
2375 .  \*[doc-arg\n[doc-arg-ptr]]
2379 .\" NS doc-do-string macro
2380 .\" NS   call .No if string
2382 .de doc-do-string
2383 .  nr doc-arg-ptr -1
2384 .  No
2388 .\" NS doc-do-punct-suffix macro
2389 .\" NS   call .No if punctuation suffix
2391 .de doc-do-punct-suffix
2392 .  nr doc-arg-ptr -1
2393 .  No
2397 .\" NS doc-do-punct-prefix macro
2398 .\" NS   call .No if punctuation prefix
2400 .de doc-do-punct-prefix
2401 .  nr doc-arg-ptr -1
2402 .  No
2406 .\" NS doc-do-xref-macro macro
2407 .\" NS   ignore if macro
2409 .de doc-do-xref-macro
2413 .\" NS doc-do-xref-string macro
2414 .\" NS   ignore if string
2416 .de doc-do-xref-string
2420 .\" NS doc-do-xref-punct-suffix macro
2421 .\" NS   append if punctuation suffix
2423 .de doc-do-xref-punct-suffix
2424 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2425 .  nr doc-arg-ptr +1
2426 .  \" XXX ?
2427 .  n\\C\\n(aP
2431 .\" NS doc-do-xref-punct-prefix macro
2432 .\" NS   append if punctuation prefix
2434 .de doc-do-xref-punct-prefix
2435 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
2436 .  nr doc-arg-ptr +1
2437 .  \" XXX ?
2438 .  n\\C\\n(aP
2442 .\" NS Bf user macro
2443 .\" NS   begin font mode (will be begin-mode/end-mode in groff & TeX)
2444 .\" NS
2445 .\" NS width register `.Bf' set in doc-common
2447 .de Bf
2448 .  ds doc-macro-name Bf
2450 .  ie \n[.$] \{\
2451 .    nr doc-curr-font-for-Ef \n[.f]
2452 .    nr doc-curr-size-for-Ef \n[.s]
2454 .    if "\$1"Em"        \*[doc-Em-font]\c
2455 .    if "\$1"Li"        \*[doc-Li-font]\c
2456 .    if "\$1"Sy"        \*[doc-Sy-font]\c
2457 .    if "\$1"-emphasis" \*[doc-Em-font]\c
2458 .    if "\$1"-literal"  \*[doc-Li-font]\c
2459 .    if "\$1"-symbolic" \*[doc-Sy-font]\c
2460 .  \}
2461 .  el \
2462 .    tm Usage .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
2466 .\" NS Ef user macro
2467 .\" NS   end font mode
2468 .\" NS
2469 .\" NS width register `.Ef' set in doc-common
2471 .de Ef
2472 .  ds doc-macro-name Ef
2474 .  ie \n[.$] \
2475 .    tm Usage .Ef (does not take arguments) (#\n[.c])
2476 .  el \
2477 .    nop \&\f[\n[doc-curr-font-for-Ef]]\s[\n[doc-curr-size-for-Ef]]
2481 .\" NS Bk user macro
2482 .\" NS   begin keep
2483 .\" NS
2484 .\" NS width register `.Bk' set in doc-common
2486 .de Bk
2487 .  ds doc-keep-type
2489 .  ds doc-macro-name Bk
2491 .  ie !\n[.$] \
2492 .    tm Usage: .Bk [-lines | -words] (#\n[.c])
2493 .  el \{\
2494 .    if !"\*[doc-keep-type]"" \
2495 .      tm .Bk: nesting keeps not implemented yet. (#\n[.c])
2496 .    if "\$1"-lines" \
2497 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2498 .    if "\$1"-words" \
2499 .      doc-set-hard-space
2501 .    ds doc-keep-type \$1
2502 .  \}
2506 .\" NS Ek user macro
2507 .\" NS   end keep
2508 .\" NS
2509 .\" NS width register `.Ek' set in doc-common
2511 .de Ek
2512 .  ds doc-macro-name Ek
2514 .  ie \n[.$] \
2515 .    tm Usage .Ek (does not take arguments) (#\n[.c])
2516 .  el \{\
2517 .    if "\*[doc-keep-type]"-lines" \
2518 .      tm .Bk -lines: Not implemented yet. (#\n[.c])
2519 .    if "\*[doc-keep-type]"-words" \
2520 .      doc-set-soft-space
2521 .  \}
2525 .\" NS Bd user macro
2526 .\" NS   begin display
2527 .\" NS
2528 .\" NS width register `.Bd' set in doc-common
2529 .\" NS
2530 .\" NS local variable:
2531 .\" NS   doc-reg-Bd
2533 .nr doc-display-depth 0
2535 .de Bd
2536 .  ds doc-macro-name Bd
2538 .  ie !\n[.$] \{\
2539 .    tm1 "Usage: .Bd [-literal | -filled | -ragged | -unfilled]
2540 .    tm1 "           [-offset [string]] [-compact] (#\n[.c])
2541 .  \}
2542 .  el \{\
2543 .    nr doc-is-compact 0
2544 .    nr doc-reg-Bd 0
2545 .    nr doc-display-depth +1
2547 .\" XXX how do avoid `if !r'?
2549 .    if !r doc-indent-stack\n[doc-display-depth] \
2550 .      nr doc-indent-stack\n[doc-display-depth] 0
2552 .    if "\$1"-literal" \{\
2553 .      nr doc-reg-Bd +1
2554 .      ds doc-display-type-stack\n[doc-display-depth] literal
2555 .      nr doc-curr-font \n[.f]
2556 .      nr doc-curr-size \n[.s]
2558 .      ie t \{\
2559 .        nop \*[doc-Li-font]\c
2560 '        ta T 9n
2561 .      \}
2562 .      el \
2563 '        ta T 8n
2564 .      nf
2565 .    \}
2567 .    if "\$1"-filled" \{\
2568 .      nr doc-reg-Bd +1
2569 .      ds doc-display-type-stack\n[doc-display-depth] filled
2570 .      br
2571 .    \}
2573 .    if "\$1"-ragged" \{\
2574 .      nr doc-reg-Bd +1
2575 .      ds doc-display-type-stack\n[doc-display-depth] ragged
2576 .      na
2577 .    \}
2579 .    if "\$1"-unfilled" \{\
2580 .      nr doc-reg-Bd +1
2581 .      ds doc-display-type-stack\n[doc-display-depth] unfilled
2582 .      nf
2583 .    \}
2585 .    \" .tm Here is argc: \n[.$] and here is doc-reg-Bd \n[doc-reg-Bd]
2586 .    if ((\n[doc-reg-Bd] >= 1) & (\n[.$] > \n[doc-reg-Bd])) \{\
2587 .      shift
2588 .      doc-do-Bv-args \$@
2589 .    \}
2591 .    if \n[doc-indent-stack\n[doc-display-depth]] \
2592 '      in (\n[.i]u + \n[doc-indent-stack\n[doc-display-depth]]u)
2594 .    if !\n[doc-is-compact] \{\
2595 .      if !\n[doc-in-synopsis-section] \{\
2596 .        ie "\*[doc-display-type-stack\n[doc-display-depth]]"ragged" \
2597 .          sp \n[doc-display-vertical]u
2598 .        el \
2599 '          sp \n[doc-display-vertical]u
2600 .      \}
2601 .    \}
2603 .    if !\n[cR] \
2604 .      ne 2v
2606 .    nr doc-is-compact 0
2611 .\" NS doc-do-Bv-args macro
2612 .\" NS   resolve remaining .Bd arguments
2613 .\" NS
2614 .\" NS local variables:
2615 .\" NS   doc-str-ddBa, doc-reg-ddBa
2617 .de doc-do-Bv-args
2618 .  \" .tm in doc-do-Bv-args with args: \$@
2620 .  nr doc-reg-ddBa 1
2621 .  ds doc-str-ddBa
2623 .  if "\$1"-offset" \{\
2624 .    ds doc-str-ddBa \$2
2626 .    if "\*[doc-str-ddBa]"left" \{\
2627 .      nr doc-reg-ddBa +1
2628 .      nr doc-indent-stack\n[doc-display-depth] 0
2629 .    \}
2631 .    if "\*[doc-str-ddBa]"right" \{\
2632 .      nr doc-reg-ddBa +1
2633 .      nr doc-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
2634 .    \}
2636 .    if "\*[doc-str-ddBa]"center" \{\
2637 .      nr doc-reg-ddBa +1
2638 .      nr doc-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
2639 .    \}
2641 .    if "\*[doc-str-ddBa]"indent" \{\
2642 .      nr doc-reg-ddBa +1
2643 .      nr doc-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
2644 .    \}
2646 .    if "\*[doc-str-ddBa]"indent-two" \{\
2647 .      nr doc-reg-ddBa +1
2648 .      nr doc-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
2649 .    \}
2651 .    if (\n[doc-reg-ddBa] == 1) \{\
2652 .      nr doc-reg-ddBa +1
2653 .      doc-get-width "\*[doc-str-ddBa]"
2654 .      ie (\n[doc-width] > 2) \{\
2655 .        ie ((\*[doc-str-ddBa] > 9n) & (\*[doc-str-ddBa] < 100n)) \
2656 .          nr doc-indent-stack\n[doc-display-depth] \*[doc-str-ddBa]
2657 .        el \
2658 .          nr doc-indent-stack\n[doc-display-depth] (\n[doc-width] * \n[doc-fixed-width])
2659 .      \}
2660 .      el \{\
2661 .        if (\n[doc-width] == 2) \
2662 .          doc-get-arg-type \*[doc-str-ddBa]
2663 .        ie "\*[doc-arg-type]"macro" \
2664 .          nr doc-indent-stack\n[doc-display-depth] \n[\*[doc-str-ddBa]]
2665 .        el \
2666 .          nr doc-indent-stack\n[doc-display-depth] \*[doc-str-ddBa]
2667 .      \}
2668 .    \}
2669 .  \}
2671 .  if "\$1"-compact" \
2672 .    nr doc-is-compact 1
2674 .\" XXX check number of arguments
2676 .  if (\n[doc-reg-ddBa] < \n[.$]) \{\
2677 .    ie "\*[doc-str-ddBa]"" \{\
2678 .      shift
2679 .      doc-do-Bv-args \$@
2680 .    \}
2681 .    el \{\
2682 .      shift 2
2683 .      doc-do-Bv-args \$@
2684 .    \}
2685 .  \}
2689 .\" NS Ed user macro
2690 .\" NS   end display
2691 .\" NS
2692 .\" NS width register `.Ed' set in doc-common
2694 .de Ed
2695 .  ds doc-macro-name Ed
2697 .  br
2699 .  if !\n[doc-display-depth] \
2700 .    tm mdoc warning: Extraneous .Ed (#\n[.c])
2702 .  if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
2703 .    ft \n[doc-curr-font]
2704 .    ps \n[doc-curr-size]
2705 .  \}
2707 .  in (\n[.i]u - \n[doc-indent-stack\n[doc-display-depth]]u)
2709 .  rr doc-indent-stack\n[doc-display-depth]
2710 .  rm doc-display-type-stack\n[doc-display-depth]
2711 .  nr doc-display-depth -1
2713 .  fi
2714 .  if t \
2715 .    ad
2719 .\" NS Bl user macro
2720 .\" NS   begin list
2721 .\" NS
2722 .\" NS width register `.Bl' set in doc-common
2723 .\" NS
2724 .\" NS local variable:
2725 .\" NS   doc-str-Bl, doc-reg-Bl
2727 .de Bl
2728 .  ie !\n[.$] \{\
2729 .    tm1 "Usage: .Bl [[-hang | -tag] [-width]]
2730 .    tm1 "           [ -item | -enum | -bullet | -diag] (#\n[.c])
2731 .  \}
2732 .  el \{\
2733 .    ds doc-macro-name Bl
2735 .    ds doc-str-Bl "\$1
2736 .    nr doc-arg-ptr 0
2737 .    nr doc-list-depth +1
2739 .    shift
2740 .    nr doc-reg-Bl 1
2741 .    while (\n[doc-reg-Bl] <= \n[.$]) \{\
2742 .      ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
2743 .      nr doc-reg-Bl +1
2744 .    \}
2746 .    nr doc-num-args \n[.$]
2748 .    if "\*[doc-str-Bl]"-hang" \{\
2749 .      nr doc-arg-ptr +1
2750 .      ds doc-list-stack\n[doc-list-depth] hang-list
2751 .      nr doc-list-indent-stack\n[doc-list-depth] 6n
2752 .      nr doc-have-indent 1
2753 .    \}
2755 .    if "\*[doc-str-Bl]"-tag" \{\
2756 .      nr doc-arg-ptr +1
2757 .      ds doc-list-stack\n[doc-list-depth] tag-list
2758 .      nr doc-have-indent 1
2759 .    \}
2761 .    if "\*[doc-str-Bl]"-item" \{\
2762 .      nr doc-arg-ptr +1
2763 .      ds doc-list-stack\n[doc-list-depth] item-list
2764 .      nr doc-have-indent 1
2765 .    \}
2767 .    if "\*[doc-str-Bl]"-enum" \{\
2768 .      nr doc-arg-ptr +1
2769 .      ds doc-list-stack\n[doc-list-depth] enum-list
2770 .      nr doc-list-indent-stack\n[doc-list-depth] 3n
2771 .      nr doc-have-indent 1
2772 .    \}
2774 .    if "\*[doc-str-Bl]"-bullet" \{\
2775 .      nr doc-arg-ptr +1
2776 .      ds doc-list-stack\n[doc-list-depth] bullet-list
2777 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
2778 .      nr doc-have-indent 1
2779 .    \}
2781 .    if "\*[doc-str-Bl]"-dash" \{\
2782 .      nr doc-arg-ptr +1
2783 .      ds doc-list-stack\n[doc-list-depth] dash-list
2784 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
2785 .      nr doc-have-indent 1
2786 .    \}
2788 .    if "\*[doc-str-Bl]"-hyphen" \{\
2789 .      nr doc-arg-ptr +1
2790 .      ds doc-list-stack\n[doc-list-depth] dash-list
2791 .      nr doc-list-indent-stack\n[doc-list-depth] 2n
2792 .      nr doc-have-indent 1
2793 .    \}
2795 .    if "\*[doc-str-Bl]"-inset" \{\
2796 .      nr doc-arg-ptr +1
2797 .      ds doc-list-stack\n[doc-list-depth] inset-list
2798 .      nr doc-have-indent 1
2799 .    \}
2801 .    if "\*[doc-str-Bl]"-diag" \{\
2802 .      nr doc-arg-ptr +1
2803 .      ds doc-list-stack\n[doc-list-depth] diag-list
2804 .      nr doc-have-diag-list 1
2805 .    \}
2807 .    if "\*[doc-str-Bl]"-ohang" \{\
2808 .      nr doc-arg-ptr +1
2809 .      ds doc-list-stack\n[doc-list-depth] ohang-list
2810 .      nr doc-have-indent 1
2811 .    \}
2813 .    if "\*[doc-str-Bl]"-column" \{\
2814 .      nr doc-arg-ptr +1
2815 .      ds doc-list-stack\n[doc-list-depth] column-list
2816 .    \}
2818 .    ie !\n[doc-arg-ptr] \{\
2819 .      tm1 "Usage: .Bl [[-hang | -tag] [-width]]
2820 .      tm1 "           [ -item | -enum | -bullet | -diag] (#\n[.c])
2821 .    \}
2822 .    el \{\
2823 .      doc-increment-list-stack
2824 .      if ((\n[doc-arg-ptr] == 1) & (\n[doc-arg-ptr] <= \n[.$])) \{\
2825 .        nr doc-arg-ptr 0
2826 .        doc-do-Bl-args
2827 .        if "\*[doc-list-stack\n[doc-list-depth]]"column-list" \{\
2828 .          doc-set-column-tab\n[doc-column-depth]
2829 .          nr doc-list-indent-stack\n[doc-list-depth] 0
2830 '          in -\n[doc-column-indent-width]u
2831 .          if !\n[doc-compact-list-stack\n[doc-list-depth]] \
2832 .            sp \n[doc-display-vertical]u
2834 .          nf
2835 .          nr doc-column-depth 0
2836 .        \}
2837 .      \}
2838 .    \}
2840 .    nr doc-arg-ptr 0
2841 .    \" .ds doc-out-string
2842 .    doc-reset-args
2843 .    \" .tmc Here is
2844 .    \" .tm1 " doc-list-stack[\n[doc-list-depth]]==\*[doc-list-stack\n[doc-list-depth]]
2845 .  \}
2851 .nr i 10
2852 .while (\n[i] < 100) \{\
2853 .  nr doc-width-\n[i]n 1
2854 .  nr i +1
2860 .\" NS doc-do-Bl-args macro
2861 .\" NS   resolve remaining .Bl arguments
2862 .\" NS
2863 .\" NS local variable:
2864 .\" NS   doc-str-dBla, doc-reg-dBla
2866 .de doc-do-Bl-args
2867 .  nr doc-arg-ptr +1
2868 .  if (\n[doc-num-args] >= \n[doc-arg-ptr]) \{\
2869 .    nr doc-reg-dBla 0
2871 .    if "\*[doc-arg\n[doc-arg-ptr]]"-compact" \{\
2872 .      nr doc-reg-dBla 1
2873 .      nr doc-compact-list-stack\n[doc-list-depth] 1
2874 .    \}
2876 .    if "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
2877 .      nr doc-reg-dBla 1
2878 .      nr doc-arg-ptr +1
2879 .      nr have-tag-width 1
2880 .      ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
2881 .      ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
2883 .      doc-get-arg-width \n[doc-arg-ptr]
2884 .      ie (\n[doc-width] > 2) \{\
2885 .        nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width] * \n[doc-fixed-width])
2886 .        if (\n[doc-width] == 3) \
2887 .          if \A'\*[doc-str-dBla]' \
2888 .            if r doc-width-\*[doc-str-dBla] \
2889 .              nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]
2890 .      \}
2891 .      el \{\
2892 .        doc-get-arg-type \*[doc-str-dBla]
2893 .        ie "\*[doc-arg-type]"macro" \
2894 .          nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
2895 .        el \
2896 .          nr doc-list-indent-stack\n[doc-list-depth] \*[doc-str-dBla]u
2897 .      \}
2898 .    \}
2900 .    if "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
2901 .      nr doc-reg-dBla 1
2902 .      nr doc-arg-ptr +1
2904 .      ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
2905 .        nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
2906 .      el \{\
2907 .        ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
2909 .        doc-get-arg-width \n[doc-arg-ptr]
2910 .        ie (\n[doc-width] > 2) \{\
2911 .          nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width] * \n[doc-fixed-width])
2912 .          if \A'\*[doc-str-dBla]' \
2913 .            if r doc-width-\*[doc-str-dBla] \
2914 .              nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
2915 .        \}
2916 .        el \{\
2917 .\" XXX ?
2918 .          doc-get-arg-type \*[doc-str-dBla]
2919 .          ie "\*[doc-arg-type]"macro" \
2920 .            nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
2921 .          el \
2922 .            nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
2923 .        \}
2924 .      \}
2925 .    \}
2927 .    if !\n[doc-reg-dBla] \{\
2928 .      if "\*[doc-list-stack\n[doc-list-depth]]"column-list" \{\
2929 .        nr doc-column-depth +1
2930 .        ds doc-arg\n[doc-column-depth] "\*[doc-arg\n[doc-arg-ptr]]
2931 .      \}
2932 .    \}
2933 .    if (\n[doc-num-args] > \n[doc-arg-ptr]) \
2934 .      doc-do-Bl-args
2935 .  \}
2939 .\" NS El user macro
2940 .\" NS   end list
2941 .\" NS
2942 .\" NS width register `.El' set in doc-common
2943 .\" NS
2944 .\" NS local variables:
2945 .\" NS   doc-str-El, doc-reg-El
2947 .de El
2948 .  ie \n[.$] \
2949 .    tm Usage: .El (#\n[.c])
2950 .  el \{\
2951 .    ds doc-macro-name El
2952 .    nr doc-reg-El 0
2953 .    ds doc-str-El \*[doc-list-stack\n[doc-list-depth]]
2955 .    if "\*[doc-str-El]"column-list" \{\
2956 .      nr doc-reg-El 1
2957 .      doc-do-end-column-list
2958 .    \}
2960 .    if "\*[doc-str-El]"enum-list" \
2961 .      nr doc-enum-list-count 0
2963 .    if \n[doc-have-diag-list] \{\
2964 .      nr doc-reg-El 1
2965 .      nr doc-have-diag-list 0
2966 .      doc-decrement-list-stack
2967 .      nr doc-list-depth -1
2968 .      doc-increment-list-stack
2969 .    \}
2971 .    if "\*[doc-str-El]"item-list" \{\
2972 '      in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
2973 .      doc-decrement-list-stack
2974 .      nr doc-list-depth -1
2975 .      doc-increment-list-stack
2976 .      nr doc-reg-El 1
2977 .    \}
2979 .    if "\*[doc-str-El]"ohang-list" \{\
2980 '      in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
2981 .      doc-decrement-list-stack
2982 .      nr doc-list-depth -1
2983 .      doc-increment-list-stack
2984 .      nr doc-reg-El 1
2985 .    \}
2987 .    if "\*[doc-str-El]"inset-list" \{\
2988 '      in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u)
2989 .      doc-decrement-list-stack
2990 .      nr doc-list-depth -1
2991 .      doc-increment-list-stack
2992 .      nr doc-reg-El 1
2993 .    \}
2995 .    if !\n[doc-reg-El] \
2996 .      doc-end-list
2998 .    br
2999 .  \}
3003 .\" NS doc-save-Pa-font string
3004 .\" NS   save doc-Pa-font font string for section FILES (no underline if
3005 .\" NS   nroff)
3008 .\" NS It user macro
3009 .\" NS   list item
3010 .\" NS
3011 .\" NS width register `.It' set in doc-common
3012 .\" NS
3013 .\" NS local variable:
3014 .\" NS   doc-str-It, doc-reg-It
3016 .de It
3017 .  ds doc-str-It \*[doc-list-stack\n[doc-list-depth]]
3019 .  if "\*[doc-str-It]"" \{\
3020 .    tm mdoc error: .It without preceding .Bl
3021 .    tmc Usage .It -list-type [-width [string] | -compact | -offset [string]]
3022 .    tm1 " (#\n[.c])
3023 .    tm .It \$@
3024 .  \}
3026 .  \" .tmc Here is
3027 .  \" .tm1 " doc-list-stack[\n[doc-list-depth]]==\*[doc-str-It]
3029 .  br
3030 .  if !\n[cR] \
3031 .    ne 3v
3033 .  ie \n[.$] \{\
3034 .    ds doc-macro-name It
3035 .    ds doc-out-string
3037 .    nr doc-reg-It 1
3038 .    while (\n[doc-reg-It] <= \n[.$]) \{\
3039 .      ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
3040 .      nr doc-reg-It +1
3041 .    \}
3043 .    nr doc-reg-It 0
3044 .    nr doc-num-args \n[.$]
3046 .    if "\*[doc-str-It]"diag-list" \{\
3047 .      nr doc-reg-It 1
3048 .      nr doc-arg-ptr 0
3049 .      doc-remaining-args
3050 .      doc-diag-list
3051 .    \}
3053 .    if "\*[doc-str-It]"column-list" \{\
3054 .      ds doc-out-string
3055 .      nr doc-arg-ptr 0
3056 .      nr doc-reg-It 1
3057 .      doc-column-list
3058 .    \}
3060 .    if "\*[doc-str-It]"item-list" \{\
3061 .      nr doc-arg-ptr 0
3062 .      nr doc-reg-It 1
3063 .      doc-item-list
3064 .    \}
3066 .    if !\n[doc-reg-It] \{\
3067 .      doc-parse-arg-vector
3069 .      \" tm1 "It list-type==\*[doc-str-It]
3070 .      \" tm1 "   doc-arg-ptr==\n[doc-arg-ptr]
3071 .      \" tm1 "   beg arg(doc-arg[1])==\*[doc-arg1]
3072 .      \" tm1 "   doc-nesting-level==\n[doc-nesting-level]
3073 .      \" tm1 "   doc-in-diversion==\n[doc-in-diversion]
3074 .      \" tm1 "   doc-saved-list-immediate==\n[doc-saved-list-immediate]
3075 .      \" tm1 "   doc-args-processed==\n[doc-args-processed]
3077 .      nr doc-nesting-level +1
3078 .      nr doc-list-immediate 1
3079 .      nr doc-arg-ptr +1
3080 .      ds doc-curr-type \*[doc-type\n[doc-arg-ptr]]
3081 .      ds doc-curr-arg "\*[doc-arg\n[doc-arg-ptr]]
3083 .      if \n[doc-in-files-section] \{\
3084 .        ds doc-save-Pa-font "\*[doc-Pa-font]
3085 .        if n \
3086 .          ds doc-Pa-font "\*[doc-No-font]
3087 .      \}
3089 .      ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
3090 .        \*[doc-arg\n[doc-arg-ptr]]
3091 .      el \{\
3092 .        nr doc-arg-ptr -1
3093 .        No
3094 .      \}
3096 .      \" tm1 "in It here is doc-out-string==\*[doc-out-string]
3097 .      \" tm1 "   arg(doc-arg[1])==\*[doc-arg1]
3098 .      \" tm1 "   doc-nesting-level==\n[doc-nesting-level]
3099 .      \" tm1 "   doc-in-diversion==\n[doc-in-diversion]
3100 .      \" tm1 "   doc-saved-list-immediate==\n[doc-saved-list-immediate]
3101 .      \" tm1 "   doc-args-processed==\n[doc-args-processed]
3103 .      ie \n[doc-saved-list-immediate] \
3104 .        ds doc-saved-list-type "\*[doc-str-It]
3105 .      el \
3106 .        doc-\*[doc-str-It]
3107 .    \}
3108 .  \}
3109 .  el \
3110 .    doc-\*[doc-str-It]
3114 .\" NS doc-inset-list macro
3115 .\" NS   .It item of list-type inset
3117 .de doc-inset-list
3118 .  doc-set-vertical-and-indent
3119 .  br
3120 .  nop \&\*[doc-out-string]
3122 .  nr doc-nesting-level -1
3123 .  nr doc-list-immediate 0
3124 .  ds doc-out-string
3125 .  doc-reset-args
3126 '  fi
3130 .\" NS doc-hang-list macro
3131 .\" NS   .It item of list-type hanging tag (as opposed to tagged)
3132 .\" NS
3133 .\" NS local variable:
3134 .\" NS   doc-reg-dhl
3136 .de doc-hang-list
3137 .  doc-set-vertical-and-indent-and-offset
3138 .  nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3139 .  ti -\n[doc-reg-dhl]u
3141 .  ie (\w\a\*[doc-out-string]\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3142 .    nop \&\*[doc-out-string]
3143 .  el \
3144 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dhl]u'\c
3146 .  nr doc-nesting-level -1
3147 .  ds doc-out-string
3148 .  nr doc-list-immediate 0
3149 .  doc-reset-args
3150 '  fi
3154 .\" NS doc-ohang-list macro
3155 .\" NS   .It item of list-type overhanging tag
3157 .de doc-ohang-list
3158 .  doc-set-vertical-and-indent
3159 .  nop \&\*[doc-out-string]
3160 .  br
3162 .  nr doc-nesting-level -1
3163 .  ds doc-out-string
3164 .  nr doc-list-immediate 0
3165 .  doc-reset-args
3166 '  fi
3170 .\" NS doc-item-list macro
3171 .\" NS   .It item of list-type [empty tag]
3173 .de doc-item-list
3174 .  doc-set-vertical-and-indent
3175 .  br
3177 .  \" .ds doc-out-string
3178 .  doc-reset-args
3179 '  fi
3183 .\" NS doc-enum-list-count register
3184 .\" NS   contains current enum count value
3186 .nr doc-enum-list-count 0
3189 .\" NS doc-enum-list macro
3190 .\" NS   enumerated list
3192 .de doc-enum-list
3193 .  nr doc-nesting-level +1
3194 .  nr doc-enum-list-count +1
3195 .  ds doc-out-string "\n[doc-enum-list-count].
3196 .  doc-do-list
3200 .\" NS doc-bullet-list macro
3201 .\" NS   bullet paragraph list
3203 .de doc-bullet-list
3204 .  nr doc-nesting-level +1
3205 .  ds doc-out-string "\*[doc-Sy-font]\[bu]\f[P]
3206 .  doc-do-list
3210 .\" NS doc-dash-list macro
3211 .\" NS   hyphen paragraph list (sub bullet list)
3213 .de doc-dash-list
3214 .  nr doc-nesting-level +1
3215 .  ds doc-out-string "\*[doc-Sy-font]\-\f[P]
3216 .  doc-do-list
3220 .\" NS doc-do-list macro
3221 .\" NS   .It item of list-type enum/bullet/hyphen
3222 .\" NS
3223 .\" NS local variable:
3224 .\" NS   doc-reg-ddl
3226 .de doc-do-list
3227 .  doc-set-vertical-and-indent-and-offset
3228 .  nr doc-reg-ddl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3229 .  ti -\n[doc-reg-ddl]u
3231 .  ie (\w\a\*[doc-out-string]\au >= \n[doc-list-indent-stack\n[doc-list-depth]]u) \
3232 .    nop \&\*[doc-out-string]
3233 .  el \
3234 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-ddl]u'\c
3236 .  nr doc-nesting-level -1
3237 .  \" .nr doc-in-diversion 1
3238 .  ds doc-out-string
3239 .  nr doc-list-immediate 0
3240 .  doc-reset-args
3241 '  fi
3245 .\" NS doc-diag-list macro
3246 .\" NS   .It item of list-type diagnostic-message
3248 .nr doc-have-diag-list 0
3249 .nr doc-diag-list-input-line-count 0
3251 .de doc-diag-list
3252 .  nr doc-curr-font \n[.f]
3253 .  nr doc-curr-size \n[.s]
3255 .  ie \n[doc-have-diag-list] \{\
3256 .    ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \
3257 .      doc-paragraph
3258 .    el \
3259 .      br
3260 .  \}
3261 .  el \
3262 .    br
3263 .  nr doc-diag-list-input-line-count \n[.c]
3265 .  nop \*[doc-Sy-font]\*[doc-out-string]\c
3266 .  nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\*[doc-digit-string]\c
3268 .  doc-reset-args
3269 .  ds doc-out-string
3270 '  fi
3274 .\" NS doc-tag-list macro
3275 .\" NS   .It item of list-type `tag'
3276 .\" NS
3277 .\" NS local variable:
3278 .\" NS   doc-reg-dtl
3280 .de doc-tag-list
3281 .  \" tm in doc-tag-list here is doc-out-string==\*[doc-out-string]
3282 .  if !\n[have-tag-width] \
3283 .    doc-get-tag-width
3284 .  doc-set-vertical-and-indent-and-offset
3285 .  nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3286 .  ti -\n[doc-reg-dtl]u
3288 .  ie (\w\a\*[doc-out-string]\au > \n[doc-list-indent-stack\n[doc-list-depth]]u) \{\
3289 .    nop \&\*[doc-out-string]
3290 .    br
3291 .  \}
3292 .  el \
3293 .    nop \&\*[doc-out-string]\h'|\n[doc-reg-dtl]u'\c
3295 .  if \n[doc-in-files-section] \
3296 .    if n \
3297 .      ds doc-Pa-font "\*[doc-save-Pa-font]
3299 .  nr doc-nesting-level -1
3300 .  nr doc-list-immediate 0
3301 .  \" .nr doc-in-diversion 1
3302 .  ds doc-out-string
3303 .  doc-reset-args
3304 '  fi
3308 .\" NS doc-get-tag-width macro
3309 .\" NS   resolve unknown tag width (if .Bl [inset | tag] only)
3311 .de doc-get-tag-width
3312 .  if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
3313 .    ie "\*[doc-curr-type]"macro" \{\
3315 .\" XXX what is `lN'?
3317 .      ds doc-tag-width-stack\n[lN] \*[doc-curr-arg]
3318 .      nr doc-list-indent-stack\n[lN] \n[\*[doc-curr-arg]]
3319 .    \}
3320 .    el \{\
3321 .      ds doc-tag-width-stack\n[lN] No
3322 .      nr doc-list-indent-stack\n[lN] \n[No]
3323 .    \}
3324 .    if !"\*[doc-tag-width-stack\n[doc-list-depth]]"\*[doc-tag-width-stack\n[lN]]" \
3325 .      nr doc-have-indent 1
3326 .  \}
3330 .\" NS doc-set-vertical-and-indent-and-offset macro
3331 .\" NS   set up vertical spacing (if compact) and indent (with offset)
3333 .de doc-set-vertical-and-indent-and-offset
3334 .  ie \n[doc-have-indent] \{\
3335 .    nr doc-have-indent 0
3336 .    nr have-tag-width 0
3337 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3338 .      sp \n[doc-display-vertical]u
3339 .    in (\n[.i]u + \n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
3340 .  \}
3341 .  el \{\
3342 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3343 .      sp \n[doc-display-vertical]u
3344 .  \}
3346 .  if !\n[cR] \
3347 .    ne 2v
3351 .\" NS doc-set-vertical-and-indent macro
3352 .\" NS   set up vertical spacing (if compact) and indent (without offset)
3354 .de doc-set-vertical-and-indent
3355 .  ie \n[doc-have-indent] \{\
3356 .    nr doc-have-indent 0
3357 .    nr have-tag-width 0
3358 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3359 .      sp \n[doc-display-vertical]u
3360 .    in (\n[.i]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3361 .  \}
3362 .  el \{\
3363 .    if !\n[doc-compact-list-stack\n[doc-list-depth]] \
3364 .      sp \n[doc-display-vertical]u
3365 .  \}
3367 .  if !\n[cR] \
3368 .    ne 2v
3372 .\" NS doc-saved-list-immediate register (bool)
3373 .\" NS   saved doc-list-immediate value
3375 .nr doc-saved-list-immediate 0
3378 .\" NS doc-list-depth register
3379 .\" NS   list type stack counter
3381 .nr doc-list-depth 0
3384 .\" NS doc-list-immediate register (bool)
3385 .\" NS   tag flag (for diversions)
3388 .nr doc-column-depth 0
3389 .nr doc-compact-list-stack1 0
3390 .ds doc-tag-width-stack0
3391 .ds doc-tag-width-stack1
3392 .nr doc-list-offset-stack1 0
3395 .\" NS doc-end-list macro
3396 .\" NS   list end function
3398 .de doc-end-list
3399 .  \" .tm in doc-list-depth:
3400 .  \" .tm1 "  doc-list-offset-stack[\n[doc-list-depth]]==\n[doc-list-offset-stack\n[doc-list-depth]]
3401 .  \" .tm1 "  doc-list-indent-stack[\n[doc-list-depth]]==\n[doc-list-indent-stack\n[doc-list-depth]]
3403 .  ie (\n[doc-list-offset-stack\n[doc-list-depth]] > 0) \{\
3404 '    in (\n[.i]u - \n[doc-list-indent-stack\n[doc-list-depth]]u - \n[doc-list-offset-stack\n[doc-list-depth]]u - \n[doc-digit-width]u)
3405 .    rr doc-list-offset-stack\n[doc-list-depth]
3406 .  \}
3407 .  el \
3408 '    in (\n[.i]u - \n[doc-list-indent-stack\n[doc-list-depth]]u - \n[doc-digit-width]u)
3410 .  if (\n[doc-list-depth] <= 0) \
3411 .    tm mdoc warning: extraneous .El call (#\n[.c])
3413 .  doc-decrement-list-stack
3414 .  nr doc-list-depth -1
3415 .  doc-increment-list-stack
3419 .\" NS doc-next-list-depth register
3420 .\" NS   next possible doc-list-depth value
3422 .nr doc-next-list-depth 1
3425 .\" NS doc-increment-list-stack macro
3426 .\" NS   set up next block for list
3428 .de doc-increment-list-stack
3429 .  nr doc-next-list-depth (\n[doc-list-depth] + 1)
3430 .  nr doc-list-indent-stack\n[doc-next-list-depth] 0
3431 .  nr doc-list-offset-stack\n[doc-next-list-depth] 0
3432 .  ds doc-tag-width-stack\n[doc-next-list-depth] \*[doc-tag-width-stack\n[doc-list-depth]]
3433 .  ds doc-list-stack\n[doc-next-list-depth]
3434 .  nr doc-compact-list-stack\n[doc-next-list-depth] 0
3438 .\" NS doc-decrement-list-stack macro
3439 .\" NS   decrement stack
3441 .de doc-decrement-list-stack
3442 .  rm doc-list-stack\n[doc-next-list-depth]
3443 .  rr doc-list-indent-stack\n[doc-next-list-depth]
3444 .  rr doc-list-offset-stack\n[doc-next-list-depth]
3445 .  rm doc-tag-width-stack\n[doc-next-list-depth]
3446 .  rr doc-compact-list-stack\n[doc-next-list-depth]
3447 .  nr doc-next-list-depth -1
3451 .\" NS Xr user macro
3452 .\" NS   cross reference (man page only)
3453 .\" NS
3454 .\" NS width register `.Xr' set in doc-common
3456 .de Xr
3457 .  if !\n[doc-args-processed] \{\
3458 .    ie !\n[.$] \
3459 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
3460 .    el \{\
3461 .      ds doc-macro-name Xr
3462 .      doc-parse-args \$@
3463 .    \}
3464 .  \}
3466 .  nr doc-arg-ptr +1
3467 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3468 .    ie "\*[doc-type\n[doc-arg-ptr]]"macro" \
3469 .      tm Usage: .Xr manpage_name [section#] \*[doc-punct-chars] (#\n[.c])
3470 .    el \{\
3471 .      ie !"\*[doc-type\n[doc-arg-ptr]]"string" \
3472 .        doc-do-xref-\*[doc-type\n[doc-arg-ptr]]
3473 .      el \{\
3474 .        as doc-out-string \*[doc-Xr-font]
3475 .        as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
3476 .        nr doc-arg-ptr +1
3477 .        if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3478 .          if "\*[doc-type\n[doc-arg-ptr]]"string" \{\
3479 .            as doc-out-string \&\*[lp]\*[doc-arg\n[doc-arg-ptr]]\*[rp]
3480 .            nr doc-arg-ptr +1
3481 .          \}
3482 .        \}
3483 .        ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \
3484 .          doc-do-\*[doc-type\n[doc-arg-ptr]]
3485 .        el \
3486 .          doc-print-and-reset
3487 .      \}
3488 .    \}
3489 .  \}
3493 .\" NS Sx user macro
3494 .\" NS   cross section reference
3495 .\" NS
3496 .\" NS width register `.Sx' set in doc-common
3498 .de Sx
3499 .  if !\n[doc-args-processed] \{\
3500 .    ie !\n[.$] \
3501 .      tm Usage: .Sx Section Header \*[doc-punct-chars] (#\n[.c])
3502 .    el \{\
3503 .      ds doc-macro-name Sx
3504 .      doc-parse-args \$@
3505 .    \}
3506 .  \}
3508 .  nr doc-arg-ptr +1
3509 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3510 .    as doc-out-string \*[doc-Sx-font]
3511 .    nr doc-curr-font \n[.f]
3512 .    nr doc-curr-size \n[.s]
3513 .    doc-print-recursive
3514 .  \}
3519 .\" NS doc-do-end-column-list macro
3520 .\" NS   column-list end-list
3522 .de doc-do-end-column-list
3523 '  in (\n[.i]u - \n[doc-list-offset-stack\n[doc-list-depth]]u - \n[doc-list-indent-stack\n[doc-list-depth]]u)
3524 .  ta T .5i 1i
3525 .  fi
3526 .  doc-decrement-list-stack
3527 .  nr doc-list-depth -1
3528 .  doc-increment-list-stack
3532 .\" NS doc-set-column-tab[1-6] macro
3533 .\" NS   establish tabs for list-type column
3535 .de doc-set-column-tab1
3536 .  ta \w\a\*[doc-arg1]    \au
3537 .  nr doc-column-indent-width \w\a\*[doc-arg1]    \au
3538 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3542 .de doc-set-column-tab2
3543 .  ta \w\a\*[doc-arg1]    \au +\w\a\*[doc-arg2]    \au
3544 .  nr doc-column-indent-width (\w\a\*[doc-arg1]    \au + \w\a\*[doc-arg2]    \au)
3545 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3549 .de doc-set-column-tab3
3550 .  ta \w\a\*[doc-arg1]    \au +\w\a\*[doc-arg2]    \au +\w\a\*[doc-arg3]    \au
3551 .  nr doc-column-indent-width (\w\a\*[doc-arg1]    \au + \w\a\*[doc-arg2]    \au + \w\a\*[doc-arg3]    \au)
3552 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3556 .de doc-set-column-tab4
3557 .  ta \w\a\*[doc-arg1]    \au +\w\a\*[doc-arg2]    \au +\w\a\*[doc-arg3]    \au +\w\a\*[doc-arg4]    \au
3558 .  nr doc-column-indent-width (\w\a\*[doc-arg1]    \au + \w\a\*[doc-arg2]    \au + \w\a\*[doc-arg3]    \au + \w\a\*[doc-arg4]    \au)
3559 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3563 .de doc-set-column-tab5
3564 .  ta \w\a\*[doc-arg1]   \au +\w\a\*[doc-arg2]   \au +\w\a\*[doc-arg3]   \au +\w\a\*[doc-arg4]   \au +\w\a\*[doc-arg5]   \au
3565 .  nr doc-column-indent-width (\w\a\*[doc-arg1]   \au + \w\a\*[doc-arg2]   \au + \w\a\*[doc-arg3]   \au + \w\a\*[doc-arg4]   \au +\w\a\*[doc-arg5]   \au)
3566 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3570 .\" This is packed abnormally close; intercol width should be an option
3571 .de doc-set-column-tab6
3572 .  ta \w\a\*[doc-arg1] \au +\w\a\*[doc-arg2] \au +\w\a\*[doc-arg3] \au +\w\a\*[doc-arg4] \au +\w\a\*[doc-arg5] \au +\w\a\*[doc-arg6] \au
3573 .  nr doc-column-indent-width (\w\a\*[doc-arg1] \au + \w\a\*[doc-arg2] \au + \w\a\*[doc-arg3] \au + \w\a\*[doc-arg4] \au + \w\a\*[doc-arg5] \au + \w\a\*[doc-arg6] \au)
3574 '  in (\n[.i]u + \n[doc-column-indent-width]u + \n[doc-list-offset-stack\n[doc-list-depth]]u)
3578 .\" NS doc-column-list macro
3579 .\" NS   column items
3580 .\" NS
3581 .\" NS local variable:
3582 .\" NS   doc-reg-dcl
3584 .de doc-column-list
3585 .  if !\n[doc-list-indent-stack\n[doc-list-depth]] \
3586 .    nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
3587 .  if !\n[.u] \{\
3588 .    fi
3589 '    in (\n[.i]u + \n[doc-column-indent-width]u)
3590 .  \}
3591 .  ti -\n[doc-column-indent-width]u
3593 .  doc-parse-arg-vector
3594 .  nr doc-arg-ptr +1
3596 .  ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3597 .    if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
3598 .      nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
3599 .      ds doc-space\n[doc-reg-dcl]
3600 .    \}
3601 .    doc-do-\*[doc-type\n[doc-arg-ptr]]
3602 .  \}
3603 .  el \
3604 .    tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
3608 .\" NS Ta user macro
3609 .\" NS   append tab (\t)
3610 .\" NS
3611 .\" NS width register `.Ta' set in doc-common
3612 .\" NS
3613 .\" NS local variable:
3614 .\" NS   doc-reg-Ta
3616 .de Ta
3617 .  ie \n[doc-args-processed] \{\
3618 .    nr doc-arg-ptr +1
3619 .    ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3620 .      if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
3621 .        nr doc-reg-Ta (\n[doc-arg-ptr] - 1)
3622 .        ds doc-space\n[doc-reg-Ta]
3623 .      \}
3624 .      as doc-out-string \t
3625 .      doc-do-\*[doc-type\n[doc-arg-ptr]]
3626 .    \}
3627 .    el \{\
3628 .      as doc-out-string \t\c
3629 .      ds doc-space\n[doc-arg-ptr]
3630 .      doc-print-out-string
3631 .      doc-reset-args
3632 .      \" .ds doc-out-string
3633 .    \}
3634 .  \}
3635 .  el \{\
3636 .    tm1 "Usage: Ta must follow column entry: e.g. (#\n[.c])
3637 .    tm1 "         .It column_string [Ta [column_string ...] ]
3638 .  \}
3642 .\" NS Dl user macro
3643 .\" NS   display (one line) literal
3644 .\" NS
3645 .\" NS width register `.Dl' set in doc-common
3646 .\" NS
3647 .\" NS local variable:
3648 .\" NS   doc-reg-Dl
3650 .de Dl
3651 '  ta T .5i
3652 .  in (\n[.i]u + \n[doc-display-indent]u)
3654 .  ie !\n[doc-args-processed] \{\
3655 .    ie !\n[.$] \
3656 .      tm Usage: .Dl argument ... (#\n[.c])
3657 .    el \{\
3658 .      ds doc-macro-name Dl
3660 .      nr doc-reg-Dl 1
3661 .      while (\n[doc-reg-Dl] <= \n[.$]) \{\
3662 .        ds doc-arg\n[doc-reg-Dl] "\$[\n[doc-reg-Dl]]
3663 .        nr doc-reg-Dl +1
3664 .      \}
3666 .      nr doc-num-args \n[.$]
3667 .      doc-parse-arg-vector
3668 .      Li
3669 .    \}
3670 .  \}
3671 .  el \
3672 .    tm Usage: .Dl not callable by other macros (#\n[.c])
3674 .  in (\n[.i]u - \n[doc-display-indent]u)
3678 .\" NS D1 user macro
3679 .\" NS   display (one line)
3680 .\" NS
3681 .\" NS width register `.D1' set in doc-common
3682 .\" NS
3683 .\" NS local variable:
3684 .\" NS   doc-reg-D1
3686 .de D1
3687 '  ta T .5i
3688 .  in (\n[.i]u + \n[doc-display-indent]u)
3690 .  ie !\n[doc-args-processed] \{\
3691 .    ie !\n[.$] \
3692 .      tm Usage: .D1 argument ... (#\n[.c])
3693 .    el \{\
3694 .      ds doc-macro-name D1
3696 .      nr doc-reg-D1 1
3697 .      while (\n[doc-reg-D1] <= \n[.$]) \{\
3698 .        ds doc-arg\n[doc-reg-D1] "\$[\n[doc-reg-D1]]
3699 .        nr doc-reg-D1 +1
3700 .      \}
3702 .      nr doc-num-args \n[.$]
3703 .      doc-parse-arg-vector
3704 .      nr doc-arg-ptr +1
3705 .      No
3706 .    \}
3707 .  \}
3708 .  el \
3709 .    tm Usage: .D1 not callable by other macros (#\n[.c])
3711 .  in (\n[.i]u - \n[doc-display-indent]u)
3715 .\" NS Ex user macro
3716 .\" NS   defunct
3718 .de Ex
3719 .  tm mdoc error: .Ex defunct, use .D1: \$@
3723 .\" NS Vt user macro
3724 .\" NS   variable type (for forcing old style variable declarations)
3725 .\" NS   this is not done in the same manner as .Ot for fortrash --
3726 .\" NS   clean up later
3727 .\" NS
3728 .\" NS width register `.Vt' set in doc-common
3730 .de Vt
3731 .  \" if a function declaration was the last thing given, want vertical space
3732 .  if \n[doc-declaration-count] \{\
3733 .    doc-paragraph
3734 .    nr doc-declaration-count 0
3735 .  \}
3737 .  \" if a subroutine was the last thing given, want vertical space
3738 .  if \n[doc-function-count] \{\
3739 .    ie !\n[doc-variable-type] \{\
3740 .      doc-paragraph
3741 .      rs
3742 .    \}
3743 .    el \
3744 .      br
3745 .  \}
3747 .  nr doc-variable-type +1
3748 .  nr doc-curr-font \n[.f]
3749 .  nr doc-curr-size \n[.s]
3750 .  nop \*[doc-Ft-font]\$*
3752 .  ie !\n[doc-have-old-function] \
3753 .    br
3754 .  el \
3755 .    nop \&\*[doc-soft-space]
3757 .  ft \n[doc-curr-font]
3758 .  fs \n[doc-curr-size]
3762 .\" NS doc-is-func-type register (bool)
3763 .\" NS   set if subroutine (in synopsis only) (fortran only)
3765 .nr doc-is-func-type 0
3768 .\" NS Ft user macro
3769 .\" NS   function type
3770 .\" NS
3771 .\" NS width register `.Ft' set in doc-common
3773 .de Ft
3774 .  if \n[doc-in-synopsis-section] \{\
3775 .    if \n[doc-function-count] \{\
3776 .      doc-paragraph
3777 .      nr doc-declaration-count 0
3778 .      nr doc-variable-type 0
3779 .    \}
3781 .    if \n[doc-declaration-count] \{\
3782 .      doc-paragraph
3783 .      nr doc-declaration-count 0
3784 .      nr doc-variable-type 0
3785 .    \}
3787 .    if \n[doc-variable-type] \{\
3788 .      doc-paragraph
3789 .      nr doc-variable-type 0
3790 .    \}
3792 .    nr doc-is-func-type 1
3793 .  \}
3795 .  nr doc-curr-font \n[.f]
3796 .  nr doc-curr-size \n[.s]
3797 .  nop \*[doc-Ft-font]\$*
3799 .  ft \n[doc-curr-font]
3800 .  ps \n[doc-curr-size]
3801 .  \" .br
3805 .\" NS doc-have-old-function register
3807 .nr doc-have-old-function 0
3810 .\" NS Ot user macro
3811 .\" NS   old function type (fortran - no newline)
3812 .\" NS
3813 .\" NS width register `.Ot' set in doc-common
3815 .de Ot
3816 .  nr doc-have-old-function 1
3818 .  if \n[doc-in-synopsis-section] \{\
3819 .    if \n[doc-function-count] \{\
3820 .      doc-paragraph
3821 .      nr doc-declaration-count 0
3822 .      nr doc-variable-type 0
3823 .    \}
3825 .    if \n[doc-declaration-count] \{\
3826 .      doc-paragraph
3827 .      nr doc-declaration-count 0
3828 .      nr doc-variable-type 0
3829 .    \}
3831 .    if \n[doc-variable-type] \{\
3832 .      doc-paragraph
3833 .      nr doc-variable-type 0
3834 .    \}
3836 .    nr doc-is-func-type 1
3837 .  \}
3839 .  if \n[.$] \
3840 .    as doc-out-string \*[doc-Ft-font]\$*
3841 .  as doc-out-string \ \f[P]
3845 .\" NS Fa user macro
3846 .\" NS   function arguments
3847 .\" NS
3848 .\" NS width register `.Fa' set in doc-common
3849 .\" NS
3850 .\" NS local variable:
3851 .\" NS   doc-reg-Fa
3853 .de Fa
3854 .  if !\n[doc-args-processed] \{\
3855 .    ie !\n[.$] \
3856 .      tm Usage: .Fa Function Arguments ... \*[doc-punct-chars] (#\n[.c])
3857 .    el \{\
3858 .      ds doc-macro-name Fa
3860 .      nr doc-reg-Fa 1
3861 .      while (\n[doc-reg-Fa] <= \n[.$]) \{\
3862 .        ds doc-arg\n[doc-reg-Fa] "\$[\n[doc-reg-Fa]]
3863 .        nr doc-reg-Fa +1
3864 .      \}
3866 .      nr doc-num-args \n[.$]
3867 .      doc-parse-arg-vector
3868 .    \}
3869 .  \}
3871 .  ie \n[doc-func-arg-count] \
3872 .    doc-do-function
3873 .  el \{\
3874 .    nr doc-arg-ptr +1
3875 .    if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
3876 .      as doc-out-string \*[doc-Fa-font]
3877 .      nr doc-curr-font \n[.f]
3878 .      nr doc-curr-size \n[.s]
3879 .      doc-print-recursive
3881 .      if \n[doc-in-synopsis-section] \
3882 .        if \n[doc-function-count] \
3883 .          br
3884 .    \}
3885 .  \}
3889 .\" NS doc-do-function macro
3890 .\" NS   internal .Fa for .Fc
3892 .nr doc-func-arg-count 0
3894 .de doc-do-function
3895 .  ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
3896 .    nr doc-arg-ptr +1
3897 .    \" .if \n[doc-in-synopsis-section] \{\
3898 .    ds doc-function-arg
3899 .    nr doc-num-function-args 0
3900 .    nr doc-function-args-processed 0
3901 .    doc-insert-hard-space \*[doc-arg\n[doc-arg-ptr]]
3902 .    if (\n[doc-num-function-args] > 1) \
3903 .      rn doc-function-arg doc-arg\n[doc-arg-ptr]
3904 .    \" .\}
3906 .    if (\n[doc-func-arg-count] > 1) \{\
3907 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]\|,
3908 .      as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]
3909 .      as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
3910 .    \}
3912 .    if (\n[doc-func-arg-count] == 1) \{\
3913 .      as doc-out-string \|\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]
3914 .      as doc-out-string \f[P]\s[0]
3915 .    \}
3916 .    nr doc-func-arg-count +1
3917 .    doc-do-function
3918 .  \}
3919 .  el \
3920 .    doc-reset-args
3924 .\" NS doc-function-count register
3925 .\" NS   break a line if more than one function in a synopsis
3927 .nr doc-function-count 0
3930 .\" NS Fn user macro
3931 .\" NS   functions
3932 .\" NS
3933 .\" NS width register `.Fn' set in doc-common
3934 .\" NS
3935 .\" NS local variable:
3936 .\" NS   doc-reg-Fn
3938 .de Fn
3939 .  if !\n[doc-args-processed] \{\
3940 .    ie !\n[.$] \{\
3941 .      tmc Usage: .Fn function_name function_arg(s) ... \*[doc-punct-chars]
3942 .      tm1 " (#\n[.c])
3943 .    \}
3944 .    el \{\
3945 .      ds doc-macro-name Fn
3947 .      nr doc-reg-Fn 1
3948 .      while (\n[doc-reg-Fn] <= \n[.$]) \{\
3949 .        ds doc-arg\n[doc-reg-Fn] "\$[\n[doc-reg-Fn]]
3950 .        nr doc-reg-Fn +1
3951 .      \}
3953 .      nr doc-num-args \n[.$]
3954 .      doc-parse-arg-vector
3955 .    \}
3956 .  \}
3958 .  if \n[doc-in-synopsis-section] \{\
3959 .    \" if there is/has been more than one subroutine declaration
3960 .    ie !\n[doc-is-func-type] \{\
3961 .      if \n[doc-function-count] \{\
3962 .        doc-paragraph
3963 .        nr doc-variable-type 0
3964 .        nr doc-declaration-count 0
3965 .      \}
3966 .    \}
3967 .    el \{\
3968 .      br
3969 .      nr doc-variable-type 0
3970 .      nr doc-declaration-count 0
3971 .      nr doc-is-func-type 0
3972 .    \}
3974 .    if \n[doc-declaration-count] \{\
3975 .      doc-paragraph
3976 .      nr doc-variable-type 0
3977 .    \}
3979 .    if \n[doc-variable-type] \{\
3980 .      doc-paragraph
3981 .      nr doc-declaration-count 0
3982 .    \}
3984 .    nr doc-function-count +1
3985 .    nr doc-is-func-type 0
3986 .    rs
3988 .    ie (\n[doc-in-synopsis-section] > 1) \
3989 .      br
3990 .    el \{\
3991 .      if !\n[doc-indent-synopsis] \
3992 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
3993 .    \}
3995 .    in +\n[doc-indent-synopsis]u
3996 .    ti -\n[doc-indent-synopsis]u
3997 .    nr doc-in-synopsis-section +1
3998 .  \}
4000 .  nr doc-arg-ptr +1
4001 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4002 .    nr doc-curr-font \n[.f]
4003 .    nr doc-curr-size \n[.s]
4004 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4005 .    as doc-out-string \f[P]\s[0]\*[lp]
4007 .    nr doc-arg-ptr +1
4008 .    ie (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4009 .      as doc-out-string \*[doc-Fa-font]
4010 .      doc-do-function-\*[doc-type\n[doc-arg-ptr]]
4011 .    \}
4012 .    el \{\
4013 .      as doc-out-string \|\*[rp]
4014 .      doc-print-and-reset
4015 .    \}
4017 .    if \n[doc-in-synopsis-section] \
4018 .      in -\n[doc-indent-synopsis]u
4019 .  \}
4023 .\" NS doc-do-function-macro macro
4025 .de doc-do-function-macro
4026 .  ie \n[doc-in-synopsis-section] \{\
4027 .    as doc-out-string \&\*[rp]\f[R];\f[P]
4028 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4029 .  \}
4030 .  el \
4031 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4033 .  \*[doc-arg\n[doc-arg-ptr]]
4037 .\" NS doc-do-function-string macro
4038 .\" NS   handle function arguments
4039 .\" NS
4040 .\" NS local variable:
4041 .\" NS   doc-reg-ddfs
4043 .de doc-do-function-string
4044 .  if \n[doc-in-synopsis-section] \{\
4045 .    ds doc-function-arg
4046 .    nr doc-num-function-args 0
4047 .    nr doc-function-args-processed 0
4048 .    doc-insert-hard-space \*[doc-arg\n[doc-arg-ptr]]
4049 .    if (\n[doc-num-function-args] > 1) \
4050 .      rn doc-function-arg doc-arg\n[doc-arg-ptr]
4051 .  \}
4053 .  as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4055 .  ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
4056 .    nr doc-reg-ddfs \n[doc-arg-ptr]
4057 .    nr doc-arg-ptr +1
4058 .    if "\*[doc-type\n[doc-arg-ptr]]"string" \{\
4059 .      as doc-out-string \|\f[\n[doc-curr-font]]\s[\n[doc-curr-size]],
4060 .      as doc-out-string "\*[doc-space\n[doc-reg-ddfs]]\f[P]\s[0]\|
4061 .    \}
4062 .    doc-do-function-\*[doc-type\n[doc-arg-ptr]]
4063 .  \}
4064 .  el \{\
4065 .    ie \n[doc-in-synopsis-section] \{\
4066 .      as doc-out-string \&\*[rp]\f[R];\f[P]
4067 .      as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4068 .    \}
4069 .    el \
4070 .      as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4071 .    doc-print-and-reset
4072 .  \}
4076 .\" NS doc-do-function-punct-suffix macro
4078 .de doc-do-function-punct-suffix
4079 .  ie \n[doc-in-synopsis-section] \{\
4080 .    as doc-out-string \&\*[rp]\f[R];\f[P]
4081 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4082 .    as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4083 .  \}
4084 .  el \{\
4085 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4086 .    as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]
4087 .  \}
4089 .  ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \
4090 .    No
4091 .  el \
4092 .    doc-print-and-reset
4096 .\" NS doc-do-function-punct-prefix macro
4097 .\" NS   write out function
4099 .de doc-do-function-punct-prefix
4100 .  ie \n[doc-in-synopsis-section] \{\
4101 .    as doc-out-string \&\*[rp]\f[R];\f[P]
4102 .    as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4103 .    as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4104 .  \}
4105 .  el \{\
4106 .    as doc-out-string \&\*[rp]\f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4107 .    as doc-out-string "\*[doc-space\n[doc-arg-ptr]]\*[doc-arg\n[doc-arg-ptr]]
4108 .  \}
4110 .  ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
4111 .    nr doc-arg-ptr +1
4112 .    No
4113 .  \}
4114 .  el \
4115 .    doc-print-and-reset
4119 .\" NS Fo user macro
4120 .\" NS   function open
4121 .\" NS
4122 .\" NS width register `.Fo' set in doc-common
4123 .\" NS
4124 .\" NS local variable:
4125 .\" NS   doc-reg-Fo
4127 .de Fo
4128 .  hy 0
4130 .  if (\n[doc-args-processed] == 0) \{\
4131 .    ie (\n[.$] == 0) \
4132 .      tm Usage: .Fo function_name (#\n[.c])
4133 .    el \{\
4134 .      ds doc-macro-name Fo
4136 .      nr doc-reg-Fo 1
4137 .      while (\n[doc-reg-Fo] <= \n[.$]) \{\
4138 .        ds doc-arg\n[doc-reg-Fo] "\$[\n[doc-reg-Fo]]
4139 .        nr doc-reg-Fo +1
4140 .      \}
4142 .      nr doc-num-args \n[.$]
4143 .      doc-parse-arg-vector
4144 .    \}
4145 .  \}
4147 .  if \n[doc-in-synopsis-section] \{\
4148 .    \" if there is/has been more than one subroutine declaration
4149 .    ie !\n[doc-is-func-type] \{\
4150 .      if \n[doc-function-count] \{\
4151 .        doc-paragraph
4152 .        nr doc-variable-type 0
4153 .        nr doc-declaration-count 0
4154 .      \}
4155 .    \}
4156 .    el \{\
4157 .      br
4158 .      nr doc-variable-type 0
4159 .      nr doc-declaration-count 0
4160 .      nr doc-is-func-type 0
4161 .    \}
4163 .    if \n[doc-declaration-count] \{\
4164 .      doc-paragraph
4165 .      nr doc-variable-type 0
4166 .    \}
4168 .    if \n[doc-variable-type] \{\
4169 .      doc-paragraph
4170 .      nr doc-declaration-count 0
4171 .    \}
4173 .    nr doc-function-count +1
4174 .    nr doc-is-func-type 0
4175 .    rs
4177 .    ie (\n[doc-in-synopsis-section] > 1) \
4178 .      br
4179 .    el \{\
4180 .      if !\n[doc-indent-synopsis] \
4181 .        nr doc-indent-synopsis (8u * \n[doc-fixed-width]u)
4182 .    \}
4184 .    in +\n[doc-indent-synopsis]u
4185 .    ti -\n[doc-indent-synopsis]u
4186 .    nr doc-in-synopsis-section +1
4187 .  \}
4189 .  nr doc-arg-ptr +1
4190 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4191 .    nr doc-nesting-level +1
4192 .    nr doc-func-arg-count 1
4193 .    nr doc-curr-font \n[.f]
4194 .    nr doc-curr-size \n[.s]
4196 .    as doc-out-string \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]
4197 .    as doc-out-string \f[P]\s[0]\*[lp]
4198 .    doc-reset-args
4199 .  \}
4203 .\" NS Fc user macro
4204 .\" NS   function close
4205 .\" NS
4206 .\" NS width register `.Fc' set in doc-common
4207 .\" NS
4208 .\" NS local variable:
4209 .\" NS   doc-reg-Fc
4211 .de Fc
4212 .  if !\n[doc-args-processed] \{\
4213 .    if \n[.$] \{\
4214 .      ds doc-macro-name Fc
4216 .      nr doc-reg-Fc 1
4217 .      while (\n[doc-reg-Fc] <= \n[.$]) \{\
4218 .        ds doc-arg\n[doc-reg-Fc] "\$[\n[doc-reg-Fc]]
4219 .        nr doc-reg-Fc +1
4220 .      \}
4222 .      nr doc-num-args \n[.$]
4223 .      doc-parse-arg-vector
4224 .    \}
4225 .  \}
4227 .  nr doc-func-arg-count 0
4228 .  nr doc-nesting-level -1
4230 .  ie \n[doc-in-synopsis-section] \
4231 .    as doc-out-string \|\*[rp]\f[R];\f[P]
4232 .  el \
4233 .    as doc-out-string \|\*[rp]
4234 .  ie (\n[doc-args-processed] > \n[doc-arg-ptr]) \{\
4235 .    nr doc-arg-ptr +1
4236 .    \*[doc-arg\n[doc-arg-ptr]]
4237 .  \}
4238 .  el \
4239 .    doc-print-and-reset
4241 .  if \n[doc-in-synopsis-section] \
4242 .    in -\n[doc-indent-synopsis]u
4244 .  hy
4248 .\" NS doc-insert-hard-space macro
4249 .\" NS   set hard space inbetween function arguments
4251 .de doc-insert-hard-space
4252 .  \" .tm1 "doc-insert-hard-space:
4253 .  \" .tm1 "  doc-num-function-args==\n[doc-num-function-args]
4254 .  \" .tm1 "  doc-function-args-processed==\n[doc-function-args-processed]
4255 .  \" .tm1 "  args==\$@
4257 .  if !\n[doc-num-function-args] \{\
4258 .    nr doc-num-function-args \n[.$]
4259 .    nr doc-function-args-processed 0
4260 .    ds doc-function-arg
4261 .  \}
4263 .  nr doc-function-args-processed +1
4264 .  as doc-function-arg "\$1
4266 .  if (\n[doc-function-args-processed] < \n[doc-num-function-args]) \{\
4267 .    as doc-function-arg "\*[doc-hard-space]
4269 .    shift
4270 .    doc-insert-hard-space \$@
4271 .  \}
4275 .\" Very crude references, stash all reference info into strings (usual
4276 .\" use of doc-out-string, then doc-out-string contents copied to
4277 .\" string of retrievable naming convention), print out reference on .Re
4278 .\" request and clean up.  Ordering very limited, no fancy citations, but
4279 .\" can do articles, journals, and books -- need to add several missing
4280 .\" options (like city etc).  Should be able to grab a refer entry, massage
4281 .\" it a wee bit (prefix a `.' to the %[A-Z]) and not worry (ha!).
4284 .\" NS Rs user macro
4285 .\" NS   reference start
4286 .\" NS
4287 .\" NS width register `.Rs' set in doc-common
4289 .de Rs
4290 .  nr doc-is-reference 1
4291 .  doc-reset-reference
4292 .  if \n[doc-in-see-also-section] \
4293 .    doc-paragraph
4294 .  nr doc-reference-count 0
4298 .\" NS Re user macro
4299 .\" NS   reference end
4300 .\" NS
4301 .\" NS width register `.Re' set in doc-common
4303 .de Re
4304 .  doc-print-reference
4305 .  doc-reset-reference
4306 .  nr doc-is-reference 0
4310 .\" NS doc-reset-reference macro
4311 .\" NS   reference cleanup
4313 .de doc-reset-reference
4314 .  nr doc-author-count 0
4315 .  nr doc-journal-count 0
4316 .  nr doc-issue-count 0
4317 .  nr doc-optional-count 0
4318 .  nr doc-corporate-count 0
4319 .  nr doc-report-count 0
4320 .  nr doc-reference-title-count 0
4321 .  nr doc-volume-count 0
4322 .  nr doc-date-count 0
4323 .  nr doc-page-number-count 0
4324 .  nr doc-book-count 0
4325 .  ds doc-reference-string-name
4326 .  rm doc-journal-name doc-issue-name doc-optional-string doc-report-name doc-corporate-name doc-reference-title-name doc-volume-name doc-date-count doc-page-number-string doc-book-name
4330 .\" NS doc-print-reference macro
4331 .\" NS   reference print
4333 .de doc-print-reference
4334 .  if \n[doc-author-count] \{\
4335 .    nop \&\*[doc-author-name1],
4336 .    nr doc-authors-processed 1
4337 .    if (\n[doc-author-count] > 1) \
4338 .      doc-print-reference-authors
4339 .    nr doc-reference-count -\n[doc-author-count]
4340 .  \}
4342 .  if \n[doc-reference-title-count] \{\
4343 .    nr doc-reference-count -1
4344 .    ie !\n[doc-reference-count] \{\
4345 .      ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \
4346 .        nop \&\*[q]\*[doc-reference-title-name]\*[q].
4347 .      el \
4348 .        nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font].
4349 .    \}
4350 .    el \{\
4351 .      ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \
4352 .        nop \&\*[q]\*[doc-reference-title-name]\*[q],
4353 .      el \
4354 .        nop \*[doc-Em-font]\*[doc-reference-title-name]\*[doc-No-font],
4355 .    \}
4356 .  \}
4358 .  if \n[doc-book-count] \{\
4359 .    nr doc-reference-count -1
4360 .    ie !\n[doc-reference-count] \
4361 .      nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font].
4362 .    el \
4363 .      nop \*[doc-Em-font]\*[doc-book-name]\*[doc-No-font],
4364 .  \}
4366 .  if \n[doc-publisher-count] \{\
4367 .    nr doc-reference-count -1
4368 .    ie !\n[doc-reference-count] \
4369 .      nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font].
4370 .    el \
4371 .      nop \*[doc-Em-font]\*[doc-publisher-name]\*[doc-No-font],
4372 .  \}
4374 .  if \n[doc-journal-count] \{\
4375 .    nr doc-reference-count -1
4376 .    ie !\n[doc-reference-count] \
4377 .      nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font].
4378 .    el \
4379 .      nop \*[doc-Em-font]\*[doc-journal-name]\*[doc-No-font],
4380 .  \}
4382 .  if \n[doc-report-count] \{\
4383 .    nr doc-reference-count -1
4384 .    ie !\n[doc-reference-count] \
4385 .      nop \&\*[doc-report-name].
4386 .    el \
4387 .      nop \&\*[doc-report-name],
4388 .  \}
4390 .  if \n[doc-issue-count] \{\
4391 .    nr doc-reference-count -1
4392 .    ie !\n[doc-reference-count] \
4393 .      nop \&\*[doc-issue-name].
4394 .    el \
4395 .      nop \&\*[doc-issue-name],
4396 .  \}
4398 .  if \n[doc-volume-count] \{\
4399 .    nr doc-reference-count -1
4400 .    ie !\n[doc-reference-count] \
4401 .      nop \&\*[doc-volume-name].
4402 .    el \
4403 .      nop \&\*[doc-volume-name],
4404 .  \}
4406 .  if \n[doc-page-number-count] \{\
4407 .    nr doc-reference-count -1
4408 .    ie !\n[doc-reference-count] \
4409 .      nop \&\*[doc-page-number-string].
4410 .    el \
4411 .      nop \&\*[doc-page-number-string],
4412 .  \}
4414 .  if \n[doc-corporate-count] \{\
4415 .    nr doc-reference-count -1
4416 .    ie !\n[doc-reference-count] \
4417 .      nop \&\*[doc-corporate-name].
4418 .    el \
4419 .      nop \&\*[doc-corporate-name],
4420 .  \}
4422 .  if \n[doc-date-count] \{\
4423 .    nr doc-reference-count -1
4424 .    ie !\n[doc-reference-count] \
4425 .      nop \&\*[doc-date].
4426 .    el \
4427 .      nop \&\*[doc-date],
4428 .  \}
4430 .  if \n[doc-optional-count] \{\
4431 .    nr doc-reference-count -1
4432 .    ie !\n[doc-reference-count] \
4433 .      nop \&\*[doc-optional-string].
4434 .    el \
4435 .      nop \&\*[doc-optional-string],
4436 .  \}
4438 .  if \n[doc-reference-count] \
4439 .    tm mdoc warning: unresolved reference problem
4443 .\" NS doc-print-reference-authors macro
4444 .\" NS   print out reference authors
4446 .de doc-print-reference-authors
4447 .  nr doc-authors-processed +1
4448 .  ie (\n[doc-author-count] == \n[doc-authors-processed]) \
4449 .    nop \&and \*[doc-author-name\n[doc-authors-processed]],
4450 .  el \{\
4451 .    nop \&\*[doc-author-name\n[doc-authors-processed]],
4452 .    doc-print-reference-authors
4453 .  \}
4457 .\" NS %A user macro
4458 .\" NS   reference author(s)
4459 .\" NS
4460 .\" NS width register `.%A' set in doc-common
4462 .de %A
4463 .  if !\n[doc-args-processed] \{\
4464 .    ie !\n[.$] \
4465 .      tm Usage: .%A Author_name (#\n[.c])
4466 .    el \{\
4467 .      nr doc-author-count +1
4468 .      nr doc-reference-count +1
4469 .      ds doc-reference-string-name doc-author-name\n[doc-author-count]
4471 .      ds doc-macro-name %A
4472 .      doc-parse-args \$@
4473 .    \}
4474 .  \}
4476 .  nr doc-arg-ptr +1
4477 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4478 .    nr doc-curr-font \n[.f]
4479 .    nr doc-curr-size \n[.s]
4480 .    doc-do-references
4481 .  \}
4485 .\" NS %B user macro
4486 .\" NS   [reference] Book Name
4487 .\" NS
4488 .\" NS width register `.%B' set in doc-common
4489 .\" NS
4490 .\" NS local variable:
4491 .\" NS   doc-reg-%B
4493 .de %B
4494 .  if !\n[doc-args-processed] \{\
4495 .    ie !\n[.$] \
4496 .      tm Usage: .%B Book Name (#\n[.c])
4497 .    el \{\
4498 .      if \n[doc-is-reference] \{\
4499 .        nr doc-book-count +1
4500 .        nr doc-reference-count +1
4501 .        ds doc-reference-string-name doc-book-name
4502 .      \}
4504 .      ds doc-macro-name %B
4506 .      nr doc-reg-%B 1
4507 .      while (\n[doc-reg-%B] <= \n[.$]) \{\
4508 .        ds doc-arg\n[doc-reg-%B] "\$[\n[doc-reg-%B]]
4509 .        nr doc-reg-%B +1
4510 .      \}
4512 .      nr doc-num-args \n[.$]
4513 .      doc-parse-arg-vector
4514 .    \}
4515 .  \}
4517 .  nr doc-arg-ptr +1
4518 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4519 .    nr doc-curr-font \n[.f]
4520 .    nr doc-curr-size \n[.s]
4522 .    ie !\n[doc-is-reference] \{\
4523 .      as doc-out-string \*[doc-Em-font]
4524 .      doc-print-recursive
4525 .    \}
4526 .    el \
4527 .      doc-do-references
4528 .  \}
4532 .\" NS %D user macro
4533 .\" NS   [reference] date
4534 .\" NS
4535 .\" NS width register `.%D' set in doc-common
4536 .\" NS
4537 .\" NS local variable:
4538 .\" NS   doc-reg-%D
4540 .de %D
4541 .  if !\n[doc-args-processed] \{\
4542 .    ie !\n[.$] \
4543 .      tm Usage: .%D Date (#\n[.c])
4544 .    el \{\
4545 .      nr doc-date-count +1
4546 .      nr doc-reference-count +1
4547 .      ds doc-reference-string-name doc-date
4549 .      ds doc-macro-name %D
4551 .      nr doc-reg-%D 1
4552 .      while (\n[doc-reg-%D] <= \n[.$]) \{\
4553 .        ds doc-arg\n[doc-reg-%D] "\$[\n[doc-reg-%D]]
4554 .        nr doc-reg-%D +1
4555 .      \}
4557 .      nr doc-num-args \n[.$]
4558 .      doc-parse-arg-vector
4559 .    \}
4560 .  \}
4562 .  nr doc-arg-ptr +1
4563 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4564 .    nr doc-curr-font \n[.f]
4565 .    nr doc-curr-size \n[.s]
4566 .    doc-do-references
4567 .  \}
4571 .\" NS %I user macro
4572 .\" NS   [reference] issuer/publisher name
4573 .\" NS
4574 .\" NS width register `.%I' set in doc-common
4575 .\" NS
4576 .\" NS local variable:
4577 .\" NS   doc-reg-%I
4579 .de %I
4580 .  if !\n[doc-args-processed] \{\
4581 .    ie !\n[.$] \
4582 .      tm Usage: .%I Issuer/Publisher Name (#\n[.c])
4583 .    el \{\
4584 .      nr doc-publisher-count +1
4585 .      nr doc-reference-count +1
4586 .      ds doc-reference-string-name doc-publisher-name
4588 .      ds doc-macro-name %I
4590 .      nr doc-reg-%I 1
4591 .      while (\n[doc-reg-%I] <= \n[.$]) \{\
4592 .        ds doc-arg\n[doc-reg-%I] "\$[\n[doc-reg-%I]]
4593 .        nr doc-reg-%I +1
4594 .      \}
4596 .      nr doc-num-args \n[.$]
4597 .      doc-parse-arg-vector
4598 .    \}
4599 .  \}
4601 .  nr doc-arg-ptr +1
4602 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4603 .    nr doc-curr-font \n[.f]
4604 .    nr doc-curr-size \n[.s]
4605 .    doc-do-references
4606 .  \}
4610 .\" NS %J user macro
4611 .\" NS   [reference] Journal Name
4612 .\" NS
4613 .\" NS width register `.%J' set in doc-common
4614 .\" NS
4615 .\" NS local variable:
4616 .\" NS   doc-reg-%J
4618 .de %J
4619 .  if !\n[doc-args-processed] \{\
4620 .    ie !\n[.$] \
4621 .      tm Usage: .%J Journal Name (#\n[.c])
4622 .    el \{\
4623 .      ds doc-macro-name %J
4624 .      nr doc-journal-count +1
4625 .      ds doc-reference-string-name doc-journal-name
4626 .      nr doc-reference-count +1
4628 .      nr doc-reg-%J 1
4629 .      while (\n[doc-reg-%J] <= \n[.$]) \{\
4630 .        ds doc-arg\n[doc-reg-%J] "\$[\n[doc-reg-%J]]
4631 .        nr doc-reg-%J +1
4632 .      \}
4634 .      nr doc-num-args \n[.$]
4635 .      doc-parse-arg-vector
4636 .    \}
4637 .  \}
4639 .  nr doc-arg-ptr +1
4640 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4641 .    nr doc-curr-font \n[.f]
4642 .    nr doc-curr-size \n[.s]
4643 .    doc-do-references
4644 .  \}
4648 .\" NS %N user macro
4649 .\" NS   [reference] issue number
4650 .\" NS
4651 .\" NS width register `.%N' set in doc-common
4653 .de %N
4654 .  if !\n[doc-args-processed] \{\
4655 .    ie !\n[.$] \
4656 .      tm Usage: .%N issue number (#\n[.c])
4657 .    el \{\
4658 .      nr doc-issue-count +1
4659 .      nr doc-reference-count +1
4660 .      ds doc-reference-string-name doc-issue-name
4662 .      ds doc-macro-name %N
4663 .      doc-parse-args \$@
4664 .    \}
4665 .  \}
4667 .  nr doc-arg-ptr +1
4668 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4669 .    nr doc-curr-font \n[.f]
4670 .    nr doc-curr-size \n[.s]
4671 .    doc-do-references
4672 .  \}
4676 .\" NS %O user macro
4677 .\" NS   [reference] optional information
4678 .\" NS
4679 .\" NS width register `.%O' set in doc-common
4680 .\" NS
4681 .\" NS local variable:
4682 .\" NS   doc-reg-%O
4684 .de %O
4685 .  if !\n[doc-args-processed] \{\
4686 .    ie !\n[.$] \
4687 .      tm Usage: .%O optional information ... \*[doc-punct-chars] (#\n[.c])
4688 .    el \{\
4689 .      nr doc-optional-count +1
4690 .      nr doc-reference-count +1
4691 .      ds doc-reference-string-name doc-optional-string
4693 .      ds doc-macro-name %O
4695 .      nr doc-reg-%O 1
4696 .      while (\n[doc-reg-%O] <= \n[.$]) \{\
4697 .        ds doc-arg\n[doc-reg-%O] "\$[\n[doc-reg-%O]]
4698 .        nr doc-reg-%O +1
4699 .      \}
4701 .      nr doc-num-args \n[.$]
4702 .      doc-parse-arg-vector
4703 .    \}
4704 .  \}
4706 .  nr doc-arg-ptr +1
4707 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4708 .    nr doc-curr-font \n[.f]
4709 .    nr doc-curr-size \n[.s]
4710 .    doc-do-references
4711 .  \}
4715 .\" NS %P user macro
4716 .\" NS   [reference] page numbers
4717 .\" NS
4718 .\" NS width register `.%P' set in doc-common
4720 .de %P
4721 .  if !\n[doc-args-processed] \{\
4722 .    ie !\n[.$] \
4723 .      tm Usage: .%P page numbers ... \*[doc-punct-chars] (#\n[.c])
4724 .    el \{\
4725 .      nr doc-page-number-count +1
4726 .      nr doc-reference-count +1
4727 .      ds doc-reference-string-name doc-page-number-string
4729 .      ds doc-macro-name %P
4731 .      nr doc-reg-%P 1
4732 .      while (\n[doc-reg-%P] <= \n[.$]) \{\
4733 .        ds doc-arg\n[doc-reg-%P] "\$[\n[doc-reg-%P]]
4734 .        nr doc-reg-%P +1
4735 .      \}
4737 .      nr doc-num-args \n[.$]
4738 .      doc-parse-arg-vector
4739 .    \}
4740 .  \}
4742 .  nr doc-arg-ptr +1
4743 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4744 .    nr doc-curr-font \n[.f]
4745 .    nr doc-curr-size \n[.s]
4746 .    doc-do-references
4747 .  \}
4751 .\" NS %Q user macro
4752 .\" NS   corporate or foreign author
4753 .\" NS
4754 .\" NS width register `.%Q' set in doc-common
4755 .\" NS
4756 .\" NS local variable:
4757 .\" NS   doc-reg-%Q
4759 .de %Q
4760 .  if !\n[doc-args-processed] \{\
4761 .    ie !\n[.$] \
4762 .      tm Usage: .%Q Corporate or Foreign Author (#\n[.c])
4763 .    el \{\
4764 .      nr doc-corporate-count +1
4765 .      nr doc-reference-count +1
4766 .      ds doc-reference-string-name doc-corporate-name
4768 .      ds doc-macro-name %Q
4770 .      nr doc-reg-%Q 1
4771 .      while (\n[doc-reg-%Q] <= \n[.$]) \{\
4772 .        ds doc-arg\n[doc-reg-%Q] "\$[\n[doc-reg-%Q]]
4773 .        nr doc-reg-%Q +1
4774 .      \}
4776 .      nr doc-num-args \n[.$]
4777 .      doc-parse-arg-vector
4778 .    \}
4779 .  \}
4781 .  nr doc-arg-ptr +1
4782 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4783 .    nr doc-curr-font \n[.f]
4784 .    nr doc-curr-size \n[.s]
4785 .    doc-do-references
4786 .  \}
4790 .\" NS %R user macro
4791 .\" NS   [reference] report name
4792 .\" NS
4793 .\" NS width register `.%R' set in doc-common
4794 .\" NS
4795 .\" NS local variable:
4796 .\" NS   doc-reg-%R
4798 .de %R
4799 .  if (\n[doc-args-processed] == 0) \{\
4800 .    ie (\n[.$] == 0) \
4801 .      tm Usage: .%R reference report (#\n[.c])
4802 .    el \{\
4803 .      nr doc-report-count +1
4804 .      nr doc-reference-count +1
4805 .      ds doc-reference-string-name doc-report-name
4807 .      ds doc-macro-name %R
4809 .      nr doc-reg-%R 1
4810 .      while (\n[doc-reg-%R] <= \n[.$]) \{\
4811 .        ds doc-arg\n[doc-reg-%R] "\$[\n[doc-reg-%R]]
4812 .        nr doc-reg-%R +1
4813 .      \}
4815 .      nr doc-num-args \n[.$]
4816 .      doc-parse-arg-vector
4817 .    \}
4818 .  \}
4820 .  nr doc-arg-ptr +1
4821 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4822 .    nr doc-curr-font \n[.f]
4823 .    nr doc-curr-size \n[.s]
4824 .    doc-do-references
4825 .  \}
4829 .\" NS %T user macro
4830 .\" NS   reference title
4831 .\" NS
4832 .\" NS width register `.%T' set in doc-common
4833 .\" NS
4834 .\" NS local variable:
4835 .\" NS   doc-reg-%T
4837 .de %T
4838 .  if !\n[doc-args-processed] \{\
4839 .    ie !\n[.$] \
4840 .      tm Usage: .%T reference title (#\n[.c])
4841 .    el \{\
4842 .      if \n[doc-is-reference] \{\
4843 .        nr doc-reference-title-count +1
4844 .        nr doc-reference-count +1
4845 .        ds doc-reference-string-name doc-reference-title-name
4846 .      \}
4848 .      ds doc-macro-name %T
4850 .      nr doc-reg-%T 1
4851 .      while (\n[doc-reg-%T] <= \n[.$]) \{\
4852 .        ds doc-arg\n[doc-reg-%T] "\$[\n[doc-reg-%T]]
4853 .        nr doc-reg-%T +1
4854 .      \}
4856 .      nr doc-num-args \n[.$]
4857 .      doc-parse-arg-vector
4858 .    \}
4859 .  \}
4861 .  nr doc-arg-ptr +1
4862 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4863 .    nr doc-curr-font \n[.f]
4864 .    nr doc-curr-size \n[.s]
4865 .    ie !\n[doc-is-reference] \{\
4866 .      as doc-out-string \*[doc-Em-font]
4867 .      doc-print-recursive
4868 .    \}
4869 .    el \
4870 .      doc-do-references
4871 .  \}
4875 .\" NS %V user macro
4876 .\" NS   reference volume
4877 .\" NS
4878 .\" NS width register `.%V' set in doc-common
4880 .de %V
4881 .  if !\n[doc-args-processed] \{\
4882 .    ie !\n[.$] \
4883 .      tm Usage: .%V Volume , ... \*[doc-punct-chars] (#\n[.c])
4884 .    el \{\
4885 .      ds doc-macro-name %V
4886 .      nr doc-volume-count +1
4887 .      nr doc-reference-count +1
4888 .      ds doc-reference-string-name doc-volume-name
4889 .      doc-parse-args \$@
4890 .    \}
4891 .  \}
4893 .  nr doc-arg-ptr +1
4894 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
4895 .    nr doc-curr-font \n[.f]
4896 .    nr doc-curr-size \n[.s]
4897 .    doc-do-references
4898 .  \}
4902 .\" NS doc-do-references macro
4903 .\" NS   reference recursion routine
4904 .\" NS
4905 .\" NS local variables:
4906 .\" NS   doc-str-ddr, doc-reg-ddr
4908 .de doc-do-references
4909 .  hy 0
4911 .  ds doc-str-ddr "\*[doc-type\n[doc-arg-ptr]]
4913 .  ie "\*[doc-str-ddr]"macro" \{\
4914 .    \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4915 .    ie "\*[doc-arg\n[doc-arg-ptr]]"Tn" \
4916 .      doc-reference-trademark
4917 .    el \{\
4918 .      doc-append-arg doc-do-references macro
4919 .      \*[doc-arg\n[doc-arg-ptr]]
4920 .    \}
4921 .  \}
4922 .  el \{\
4923 .    nr doc-reg-ddr \n[doc-arg-ptr]
4924 .    ie "\*[doc-str-ddr]"string" \
4925 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4926 .    el \
4927 .      as doc-out-string \&\*[doc-arg\n[doc-arg-ptr]]
4928 .    \" .el \{\
4929 .    \" .  as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4930 .    \" .  as doc-out-string "\*[doc-arg\n[doc-arg-ptr]]\f[P]\s[0]
4932 .    ie (\n[doc-args-processed] == \n[doc-arg-ptr]) \{\
4933 .      \" .as doc-out-string \f[\n[doc-curr-font]]\s[\n[doc-curr-size]]
4934 .      as \*[doc-reference-string-name] \&\*[doc-out-string]
4935 .      ds doc-out-string
4936 .      ds doc-reference-string-name
4937 .      doc-reset-args
4938 .    \}
4939 .    el \{\
4940 .      nr doc-arg-ptr +1
4941 .      as doc-out-string "\*[doc-space\n[doc-reg-ddr]]
4942 .      doc-do-references
4943 .    \}
4944 .  \}
4948 .\" NS Hf user macro
4949 .\" NS   source include header files.
4950 .\" NS
4951 .\" NS width register `.Hf' set in doc-common
4953 .de Hf
4954 .  doc-paragraph
4955 .  nop File:
4956 .  Pa \$1
4957 .  doc-paragraph
4959 .  nr doc-curr-font \n[.f]
4960 .  nr doc-curr-size \n[.s]
4962 .  ie t \{\
4963 .    nop \*[doc-Li-font]
4964 .    br
4965 .    ta T 9n
4966 .  \}
4967 .  el \
4968 .    ta T 8n
4970 .  nf
4971 .  so \$1
4972 .  fi
4974 .  ft \n[doc-curr-font]
4975 .  ps \n[doc-curr-size]
4976 .  doc-paragraph
4980 .\" NS doc-have-author register
4982 .nr doc-have-author 0
4985 .\" NS An user macro
4986 .\" NS   author name
4987 .\" NS
4988 .\" NS width register `.An' set in doc-common
4990 .de An
4991 .  if \n[doc-in-authors-section] \{\
4992 .    ie \n[doc-have-author] \
4993 .      br
4994 .    el \
4995 .      nr doc-have-author 1
4996 .  \}
4998 .  if !\n[doc-args-processed] \{\
4999 .    ie !\n[.$] \
5000 .      tm Usage: .An author_name ... \*[doc-punct-chars] (#\n[.c])
5001 .    el \{\
5002 .      ds doc-macro-name An
5003 .      doc-parse-args \$@
5004 .    \}
5005 .  \}
5007 .  nr doc-arg-ptr +1
5008 .  if (\n[doc-args-processed] >= \n[doc-arg-ptr]) \{\
5009 .    nr doc-curr-font \n[.f]
5010 .    nr doc-curr-size \n[.s]
5011 .    doc-print-recursive
5012 .  \}
5016 .\" NS Sf user macro
5017 .\" NS   defunct
5018 .\" NS
5019 .\" NS width register `.Sf' set in doc-common
5021 .de Sf
5022 .  tm mdoc error: .Sf defunct, use .Pf or .Ns
5026 .ds doc-func-error-string "function returns the value 0 if successful;
5027 .as doc-func-error-string " otherwise the value -1 is returned and
5028 .as doc-func-error-string " the global variable \*[doc-Va-font]errno\f[P]
5029 .as doc-func-error-string " is set to indicate the error.
5032 .\" NS Rv user macro
5033 .\" NS   return values
5034 .\" NS
5035 .\" NS width register `.Rv' set in doc-common
5036 .\" NS
5037 .\" NS local variable:
5038 .\" NS   doc-str-Rv
5040 .de Rv
5042 .\" XXX
5044 .  ie !\n[.$] \
5045 .    tm Usage: .Rv [-std] (#\n[.c])
5046 .  el \{\
5047 .    \" .ds doc-macro-name Rv
5048 .    \" .nr doc-arg-ptr 0
5049 .    \" .nr lR +1
5050 .    \" .ds doc-arg1 \$2
5051 .    \" .ds doc-arg2 \$3
5052 .    \" .ds doc-arg3 \$4
5053 .    \" .ds doc-arg4 \$5
5054 .    \" .ds doc-arg5 \$6
5055 .    \" .ds doc-arg6 \$7
5056 .    \" .ds doc-arg7 \$8
5057 .    \" .ds doc-arg8 \$9
5058 .    \" .
5059 .    \" .nr doc-num-args (\n[.$] - 1)
5061 .    if "\$1"-std" \{\
5062 .      doc-reg-Rv \*[doc-section]
5063 .      if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
5064 .        tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
5065 .      br
5066 .      nop \&The
5067 .      Fn \$2
5068 .      nop \&\*[doc-func-error-string]
5069 .    \}
5070 .  \}
5074 .\" NS Mt user macro
5075 .\" NS   mailto (for conversion to HTML)
5077 .de Mt
5078 .  Pa \$@
5082 .\" NS Lk user macro
5083 .\" NS   link (for conversion to HTML)
5084 .\" NS
5085 .\" NS local variables:
5086 .\" NS   doc-str-Lk, doc-reg-Lk
5088 .de Lk
5089 .  ds doc-str-Lk Sy \$@
5091 .  ie (\n[.$] >= 2) \{\
5092 .    doc-get-arg-type \$2
5093 .    ie (\[doc-arg-type] < 3) \{\
5094 .      Em \&\$2:
5095 .      ds doc-str-Lk Sy "\$1"
5096 .      doc-get-width "\$1"
5097 .      shift 2
5098 .      if \n[.$] \
5099 .        as doc-str-Lk " \$@
5100 .    \}
5101 .    el \
5102 .      doc-get-width "\$1"
5103 .  \}
5104 .  el \
5105 .    doc-get-width "\$1"
5107 .  ie n \
5108 .    nr doc-reg-Lk 26
5109 .  el \
5110 .    nr doc-reg-Lk 38
5111 .  ie (\n[doc-width] >= \n[doc-reg-Lk]) \
5112 .    D1 \*[doc-str-Lk]
5113 .  el \
5114 .    \*[doc-str-Lk]
5118 .rn em e@
5120 .de em
5121 .  tm mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
5122 .  ab Should this have been .Em ...?
5128 .\" EOF