Do not use .Xo/.Xc to work around ancient roff limits.
[netbsd-mini2440.git] / share / tmac / doc2html
blob03957a7f88bffbfd677568cc57f057e4b3bc07e8
1 .\" $NetBSD: doc2html,v 1.61 2009/05/12 18:07:54 plunky Exp $
2 .\"
3 .\" Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
5 .\"
6 .\" This code is derived from software contributed to The NetBSD Foundation
7 .\" by Ross Harvey.
8 .\"
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 .\" POSSIBILITY OF SUCH DAMAGE.
29 .\"
30 .ig
32 The first section of this package processes a large subset of the -mdoc macro
33 functions into HTML. All of the commonly used requests are implemented.
35 The second section implements -man (-man.old) macros. These are trivial
36 compared to -mdoc.
38 NOTES:
39         The initial purpose of these macros is to support distrib/notes.
40         It's very close, but not quite ready to do all of the man pages.
42         See src/distrib/notes/Makefile.inc for important groff command
43         examples. For HTML generation it is important to turn off overstrike
44         modes with -P-b -P-u -P-o.
47 TODO:
48         There are a few internal macros and other symbols that don't contain
49         an embedded `-'.
51         Need a tbl(1) command that generates html tables from tbl(1)
52         input. (Partially written.) For now, we just switch into <pre>
53         mode on .TS or .PS. Tbl input is very uncommon these days, anyway.
54         (-mdoc has the .Bl -column list, which eliminates most requirements
55         for tbl)
57         We should probably end all the html pages with an upward
58         pointing "contents" link, except right now there is nothing
59         to point to.
61         We need "intro" or "contents" pages for each man/man? (man/html?)
62         section.
64         WARNING! If you add a callable macro (or define an old one that
65         was missing) it MUST have a doc2html@@ alias. (Scan for @@ to see.)
68 .if dError .Error - multiple inclusion of doc2html
70 .de TS
71 <pre>
73 .de TE
74 .       DEBUG .tm TE
75 </pre>
77 .de PS
78 <pre>
80 .de PE
81 .       DEBUG .tm PE
82 </pre>
85 .nr doc-stackp 0
86 .de doc-push
87 .       ds doc-stack-rq-\\n[doc-stackp] \\$1
88 .       nr doc-stack-ln-\\n[doc-stackp] \\n[.c]
89 .       nr doc-stackp +1
92 .de doc-pop
93 .       ie \\n[doc-stackp]<=0 .Error Extraneous \\$1 request
94 .       el .nr doc-stackp -1
95 .       ds doc-pop-tmp1 \\*[doc-stack-rq-\\n[doc-stackp]]
96 .       if !\a\\*[doc-pop-tmp1]\a\\$1\a \{\
97 .               tm Need \\*[doc-pop-tmp1] before \\$1
98 .               Error See line \\n[doc-stack-ln-\\n[doc-stackp]]
99 .       \}
102 .de doc-rlookup
103 .       if !r\\$1 \{\
104 .               ie \\w\a\\V[\\$1]\a .nr \\$1 \\V[\\$1]
105 .               el .nr \\$1 \\$2
106 .       \}
109 .de doc-slookup
110 .       if !d\\$1 \{\
111 .               ie \\w\a\\V[\\$1]\a .ds \\$1 \\V[\\$1]
112 .               el .ds \\$1 \\$2
113 .       \}
116 .doc-rlookup DOC_DEBUG_MODE 0
117 .doc-rlookup DOC_XR 0
118 .doc-slookup DOC_MANROOT ..
120 .nr in-pre 0
121 .nr HTML 1
122 .pl 1i
123 .po 0
124 .in 0
127 .nr list-level 0
128 .de ce
129 .       ie \\$1 \{\
130                 <center>
131 .               nr center-on \\$1
132 .               it 1 doc-center-step
133 .       \}
134 .       el .    end-center
136 .nr center-on 0
137 .de end-center
138 .       it
139 .       if \\n[center-on] </center>
140 .       nr center-on 0
143 .de doc-center-step
144 <br>
145 .       nr center-on -1
146 .       ie \\n[center-on]<=0 .end-center
147 .       el .it 1 doc-center-step
150 .ds copy &copy;
151 .ds > &gt;
152 .ds < &lt;
153 .ds >= &gt;=
154 .ds <= &lt;=
155 .ds Lt &lt;
156 .ds Gt &gt;
157 .ds & &amp;
158 .ds Am &amp;
159 .ds _ &nbsp;
160 .ds q &quot;
161 .ds body-params bgcolor="#FFFFFF" text="#000000"
162 .ds document-title
163 .ds title-section
164 .ds dot-de .de
165 .ds dot-dot ..
166 .ds sepstring \~
167 .ds doc-punct-result
168 .ds doc-punct { . , : ; ( ) [ ] }
169 .ds close-mode
170 .ds open-mode
171 .ds doc-anchor
172 .\" default EOL after .An
173 .\" can be changed with .An -nosplit
174 .ds an-eol <br>
175 .ds Nm-save
176 .ds T " x
177 .ds tN <font\ size="-1">
178 .ds aa </font>
179 .ds Px \\*(tNPOSIX\\*(aa
180 .chop T
181 .nr doc-dosep 0
182 .nr r-lvl 0
184 .if !dMANROOT \{\
185 .       ds MANROOT \V[MANROOT]
186 .       if !\w\a\*[MANROOT]\a .ds MANROOT ..
189 .blm Pp
192 .de DEBUG
193 .if \\n[DOC_DEBUG_MODE] \\$*
195 .de Dd
196 .       as document-title " \\$*
198 .de Dt
199 .       as document-title " \\$*
201 .de Os
202 .       as document-title " \\$*
203 .       init-html
205 .\"----------------------------------------------------------------------
206 .\" troff requests we delete
208 .rm wh
210 .\" troff requests we translate
212 .rn br br-real
213 .rn sp sp-real
214 .rn fi fi-real
215 .rn nf nf-real
217 .de br
218 .       if \\n[in-pre]=0 <br>
220 .de sp-nice-try-ross
221 .       ie !\\n(.$ <br>
222 .       el .ie '\\$1'1' <br>
223 .       el \{\
224 .               if !\\n[in-pre] <pre>
225 .               nr sp-tmp \\$1v-1v
226 .               if \\n[sp-tmp]>0 .sp-real \\n[sp-tmp]u
227 .               if !\\n[in-pre] </pre>
228 .       \}
230 .\" Although the above probably works, the following is a lot simpler. It
231 .\" reduces the request to 1v, but why would you put more than one adjacent
232 .\" blank line in an html document anyway?
233 .de sp
234 .       ie \\n[center-on] <!-- -->
235 .       el <br><br>
237 .de end-preformat
238 .       DEBUG .tm end-preformat \\n[in-pre]
239 .       if \\n[in-pre] </pre>
240 .       nr in-pre 0
242 .de fi
243 .       DEBUG fi
244 .       end-preformat
246 .de nf
247 <br>
248 <pre>
249 .       nr in-pre 1
252 .\"----------------------------------------------------------------------
253 .\" Magic to open and close <body> and <html>
255 .de end-macro
256 .       if \\w\a\\n[.z]\a .ab ERROR, unclosed quotation from line \
257 \\n[quotation_line]
258 .       br-real \" should be unnecessary...we have fill turned off
259 .       fl      \" more paranoia
260 </body>
261 </html>
262 .       br-real
263 .       fl
265 .em end-macro
266 .de init-html
267 <html>
268 <head>
269         <title>
270                 \\*[document-title]\\$*
271                 \\*[title-section]
272         </title>
273         <style type="text/css">
274         <!--
275                 body { margin-left:4%; }
276                 H1, H2, H3, H4, H5 {
277                         color: maroon; padding: 4pt; margin-left: -4%;
278                         border: solid; border-width: thin; width: 100%;
279                         background: rgb(204,204,255)
280                 }
281         -->
282         </style>
283 </head>
284 <body \\*[body-params]>
285 \\*[dot-de] init-html
286 \\*[dot-dot]
288 .de Lk
289 .       if \\n[.$]<1 .ab #\\n[.c]: Usage: .Lk href [ anchortext/punct ] ...
290 .       ds doc-href \\$1
291 .       ds doc-anchortext \\$1
292 .       shift
293 .       if \\n[.$] \{\
294 .               doc-checkpunct \\$1 \\*[doc-punct]
295 .               if !\\n[doc-ispunct] \{\
296 .                       ds doc-anchortext \\$1
297 .                       shift
298 .               \}
299 .       \}
300 .       ds doc-anchor <a href="\\*[doc-href]">\\*[doc-anchortext]</a>
301 .       while \\n[.$] \{\
302 .               doc-checkpunct \\$1 \\*[doc-punct]
303 .               if !\\n[doc-ispunct] .ab #\\n[.c]: .link ... '$1' -- Huh?
304 .               as doc-anchor \\$1
305 .               shift
306 .       \}
307 .       ds doc-tmp1 No
308 .       nr doc-tmp-2 \\w^G\\*[doc-anchortext]^G
309 .       nr doc-tmp-2 \\n[doc-tmp-2]/\\w'0'
310 .       if \\n[doc-tmp-2]>=30 .ds doc-tmp1 D1
311 .       \\*[doc-tmp1] \\*[doc-anchor]
314 .\".de mailto
315 .\"<a href="mailto:\\$1">\\$1</a>\\$2\\$3\\$4
316 .\"..
318 .de Ht
319 \\$*
321 .de Sh
322 .       end-preformat
323 .       init-html
324         <h3 id="\\$*">
325         \\$*
326         </h3>
328 .de Ss
329 .       end-preformat
330 .       init-html
331         <h4 id="\\$*">
332         \\$*
333         </h4>
336 .de Sx
337 .       end-preformat
338 .       ds doc-tmp-1 "\\$1
339 .       shift
340 .       while \\n[.$] \{\
341 .               doc-checkpunct \\$1 \\*[doc-punct]
342 .               ie !\\n[doc-ispunct] .as doc-tmp-1 " \\$1
343 .               el .break
344 .               shift
345 .       \}
346 <a href="#\\*[doc-tmp-1]">\\*[doc-tmp-1]</a>\\$1\\$2\\$3\\$4\\$5\\$6
349 .de Pp
350 .       end-preformat
351         <p>
354 .nr doc-markbreak 0
355 .de doc-conditional-break
356 .       if \\n[.c]>(\\n[doc-markbreak]+1) <br>
357 .       nr doc-markbreak \\n[.c]
360 .de D1
361 .       end-preformat
362 .       doc-conditional-break
363 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
364 .       No \\$@
365 <br>
368 .de Dl
369 .       end-preformat
370 .       doc-conditional-break
371 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
372 .       Li \\$@
373 <br>
376 .de Bd
377 .       doc-push .Ed
378 .       end-preformat
379 .       nr Bd-literal 0
380 .       nr Bd-offset 0
381 .       ds get-file
382 .       while \\n(.$ \{\
383 .               if '\\$1'-literal' \{\
384 .                       nr Bd-literal 1
385 .                       shift
386 .                       continue
387 .               \}
388 .               if '\\$1'-offset' \{\
389 .                       shift
390 .                       shift
391 .                       nr Bd-offset 1
392 .                       ds start-display <dl compact><dt><dd>
393 .                       continue
394 .               \}
395 .               if '\\$1'-file' \{\
396 .                       ds get-file so \\$2
397 .                       shift
398 .                       shift
399 .                       continue
400 .               \}
401 .               shift
402 .       \}
403 .       if \\n[Bd-offset] <dl compact><dt><dd>
404 .       if \\n[Bd-literal] <code>
405 <pre>\\" HOW DO WE GET RID OF THIS NEWLINE??
406 .\\*[get-file]
408 .de Ed
409 .       DEBUG .tm Ed
410 </pre>
411 .       doc-pop .Ed
412 .       if \\n[Bd-literal] </code>
413 .       if \\n[Bd-offset] </dl>
415 .de Bl
416 .       doc-push .El
417 .       end-preformat
418 .       ds list-start UNKNOWN
419 .       nr bl-is-compact 0
420 .       while \\n(.$ \{\
421 .               if '\\$1'-width' \{\
422 .                       shift
423 .                       shift
424 .                       continue
425 .               \}
426 .               if '\\$1'-column' \{\
427 .                       ds list-start <center><table>
428 .                       ds list-end </table></center>
429 .                       ds list-tag-prefix <tr><td>
430 .                       ds list-pp-prefix
431 .                       shift
432 .                       break
433 .               \}
434 .               if '\\$1'-bullet' \{\
435 .                       ds list-start <ul>
436 .                       ds list-end </ul>
437 .                       ds list-tag-prefix <p>
438 .                       ds list-pp-prefix <li>
439 .                       shift
440 .                       continue
441 .               \}
442 .               if '\\$1'-dash' \{\
443 .                       ds list-start <dl>
444 .                       ds list-end   </dl>
445 .                       ds list-tag-prefix <p>
446 .                       ds list-pp-prefix <dd>-
447 .                       shift
448 .                       continue
449 .               \}
450 .               if '\\$1'-enum' \{\
451 .                       ds list-start <ol>
452 .                       ds list-end   </ol>
453 .                       ds list-tag-prefix <p>
454 .                       ds list-pp-prefix <li>
455 .                       shift
456 .                       continue
457 .               \}
458 .               if '\\$1'-nested' \{\
459 .                       \" this should suffice
460 .                       shift
461 .                       continue
462 .               \}
463 .               if '\\$1'-hyphen' \{\
464 .                       ds list-start <dl>
465 .                       ds list-end   </dl>
466 .                       ds list-tag-prefix <p>
467 .                       ds list-pp-prefix <dd>-
468 .                       shift
469 .                       continue
470 .               \}
471 .               if '\\$1'-item' \{\
472 .                       ds list-start <dl>
473 .                       ds list-end   </dl>
474 .                       ds list-tag-prefix <p>
475 .                       ds list-pp-prefix <dd>
476 .                       shift
477 .                       continue
478 .               \}
479 .               if '\\$1'-tag' \{\
480 .                       ds list-start <dl compact>
481 .                       ds list-end   </dl>
482 .                       ds list-tag-prefix <p><dt>
483 .                       ds list-pp-prefix <dd>
484 .                       shift
485 .                       continue
486 .               \}
487 .               if '\\$1'-diag' \{\
488 .                       ds list-start <dl compact>
489 .                       ds list-end   </dl>
490 .                       ds list-tag-prefix <p><dt>
491 .                       ds list-pp-prefix <dd>
492 .                       shift
493 .                       continue
494 .               \}
495 .               if '\\$1'-hang' \{\
496 .                       ds list-start <dl compact>
497 .                       ds list-end   </dl>
498 .                       ds list-tag-prefix <p><dt>
499 .                       ds list-pp-prefix <dd>
500 .                       shift
501 .                       continue
502 .               \}
503 .               if '\\$1'-ohang' \{\
504 .                       ds list-start <dl>
505 .                       ds list-end   </dl>
506 .                       ds list-tag-prefix <p><dt>
507 .                       ds list-pp-prefix <dd>
508 .                       shift
509 .                       continue
510 .               \}
511 .               if '\\$1'-offset' \{\
512 .                       \" FIXME -- this isn't implemented
513 .                       shift
514 .                       shift
515 .                       continue
516 .               \}
517 .               if '\\$1'-compact' \{\
518 .                       nr bl-is-compact 1
519 .                       shift
520 .                       continue
521 .               \}
522 .               if '\\$1'-inset' \{\
523 .                       ds list-start <dl>
524 .                       ds list-end   </dl>
525 .                       ds list-tag-prefix <p><dt>
526 .                       ds list-pp-prefix <dd>
527 .                       shift
528 .                       continue
529 .               \}
530 .               ab Unknown .Bl list parameter \\$1 (#\\n(.c)
531 .               break
532 .       \}
533 .       if \\n[bl-is-compact] \{\
534 .               if '\\*[list-tag-prefix]'<p>' .ds list-tag-prefix
535 .               if '\\*[list-tag-prefix]'<p><dt>' .ds list-tag-prefix <dt>
536 .       \}
537 .       if '\\*[list-start]'UNKNOWN' .ab \
538 Unknown .Bl list type \\$1 (#\\n(.c)
539 .       push-list-level start end tag-prefix pp-prefix
540 \\*[list-start]
542 .de push-list-level
543 .       nr list-level +1
544 .       while \\n(.$ \{\
545 .               ds list-\\$1-\\n[list-level] \\*[list-\\$1]
546 .               shift
547 .       \}
549 .de pop-list-level
550 .       nr list-level -1
552 .de It-span
553 .       end-preformat
554 .       as doc-pcresult <tr><td colspan=9>
555 .       recurse \\$@
556 .       as doc-pcresult
557 .       pc-fin
559 .de It
560 .       end-preformat
561 .       as doc-pcresult \\*[list-tag-prefix-\\n[list-level]]
562 .       recurse \\$@
563 .       as doc-pcresult \\*[list-pp-prefix-\\n[list-level]]
564 .       pc-fin
566 .de El
567 .       doc-pop .El
568 \\*[list-end-\\n[list-level]]
569 .       pop-list-level
571 .de Lb  
572 .if !\\n(.$==1 .tm Usage: .Lb [library name]
573 .if "\\$1"libarm32" \&ARM32 Architecture Library (libarm32, -larm32)
574 .if "\\$1"libi386" \&i386 Architecture Library (libi386, -li386)
575 .if "\\$1"libm68k" \&m68k Architecture Library (libm68k, -lm68k)
576 .if "\\$1"libbluetooth" \&Bluetooth Library (libbluetooth, -lbluetooth)
577 .if "\\$1"libc" \&Standard C Library (libc, -lc)
578 .if "\\$1"libcdk" \&Curses Development Kit Library (libcdk, -lcdk)
579 .if "\\$1"libcompat" \&Compatibility Library (libcompat, -lcompat)
580 .if "\\$1"libcrypt" \&Crypt Library (libcrypt, -lcrypt)
581 .if "\\$1"libcurses" \&Curses Library (libcurses, -lcurses)
582 .if "\\$1"libedit" \&Command Line Editor Library (libedit, -ledit)
583 .if "\\$1"libevent" \&Event Notification Library (libevent, -levent)
584 .if "\\$1"libform" \&Curses Form Library (libform, -lform)
585 .if "\\$1"libintl" \&Internationalized Message Handling Library (libintl, -lintl)
586 .if "\\$1"libipsec" \&IPsec Policy Control Library (libipsec, -lipsec)
587 .if "\\$1"libkvm" \&Kernel Data Access Library (libkvm, -lkvm)
588 .if "\\$1"libm" \&Math Library (libm, -lm)
589 .if "\\$1"libmagic" \&Magic Number Recognition Library (libmagic, -lmagic)
590 .if "\\$1"libmenu" \&Curses Menu Library (libmenu, -lmenu)
591 .if "\\$1"libossaudio" \&OSS Audio Emulation Library (libossaudio, -lossaudio)
592 .if "\\$1"libpcap" \&Packet Capture Library (libpcap, -lpcap)
593 .if "\\$1"libpci" \&PCI Bus Access Library (libpci, -lpci)
594 .if "\\$1"libpmc" \&Performance Counters Library (libpmc, -lpmc)
595 .if "\\$1"libposix" \&POSIX Compatibility Library (libposix, -lposix)
596 .if "\\$1"libpthread" \&POSIX Thread Library (libpthread, -lpthread)
597 .if "\\$1"libresolv" \&DNS Resolver Library (libresolv, -lresolv)
598 .if "\\$1"librt" \&POSIX Real-time Library (librt, -lrt)
599 .if "\\$1"libtermcap" \&Termcap Access Library (libtermcap, -ltermcap)
600 .if "\\$1"libusbhid" \&USB Human Interface Devices Library (libusbhid, -lusbhid)
601 .if "\\$1"libutil" \&System Utilities Library (libutil, -lutil)
602 .if "\\$1"libz" \&Compression Library (libz, -lz) 
603 .. 
606 .de doc-checkpunct
607 .       ds doc-cp-tmp1 \\$1
608 .       shift
609 .       nr doc-ispunct 0
610 .       while \\n[.$] \{\
611 .               if \a\\*[doc-cp-tmp1]\a\\$1\a .nr doc-ispunct 1
612 .               shift
613 .       \}
616 .\" Parsed and Callable macros
618 .\" Internal structure: `recurse' and `mode-*-{on,off}'
620 .de recurse
621 .       nr r-lvl +1
622 .DEBUG .tm r \\n[r-lvl] __\\*[doc-pcresult]==\\$@__
623 .       while \\n(.$ \{\
624 .               doc-checkpunct \\$1 \\*[doc-punct]
625 .               if \\n[doc-ispunct] \{\
626 .                       as doc-punct-result \\$1
627 .                       shift
628 .                       continue
629 .               \}
630 .               nr is-request \\A'\\$1'
631 .               if \\n[is-request] \{\
632 .                       if ddoc2html@@\\$1 .nr is-request 1
633 .                       if !ddoc2html@@\\$1 .nr is-request 0
634 .               \}
635 .               ie \\n[is-request] \{\
636 .                       ds recurse-tmp1 \\$1
637 .                       shift
638 .                       \\*[recurse-tmp1] \\$@
639 .                       break
640 .               \}
641 .               el \{\
642 .DEBUG .tm r \\n[r-lvl] __\\*[doc-pcresult]+\\$1==\\$@__
643 .                       \" a random word, so output saved punctuation
644 .                       \" (normally saved until level 0 mode closure )
645 .                       if \\w\a\\*[doc-pcresult]\a \{\
646 .                               as doc-pcresult \\*[close-mode]
647 .                               as doc-pcresult \\*[doc-punct-result]
648 .                               as doc-pcresult \\*[open-mode]
649 .                               ds doc-punct-result
650 .                       \}
651 .                       if \\n[doc-dosep] .as doc-pcresult \\*[sepstring]
652 .                       nr doc-dosep 1
653 .                       as doc-pcresult \\$1
654 .                       shift
655 .                       continue
656 .               \}
657 .       \}
658 .       nr r-lvl -1
661 .de resetmode
662 .       ds open-mode
663 .       ds close-mode
666 .de make-mode
667 \\*[dot-de] mode-\\$1-on
668 .       DEBUG .tm mode-\\$1-on <\\\\$@>
669 .       rn close-mode xclose-mode
670 .       ds open-mode \\$2
671 .       ds close-mode \\$3
672 .       as doc-pcresult \\\\*[xclose-mode]\\$2
673 \\*[dot-dot]
674 \\*[dot-de] mode-\\$1-off
675 .       DEBUG .tm mode-\\$1-off <\\\\$@>
676 .       as doc-pcresult \\\\*[close-mode]
677 .       resetmode
678 \\*[dot-dot]
680 .de pc-fin
681 .       as doc-pcresult \\$1
682 .       if \\n[r-lvl]=0 \{\\*[doc-pcresult]\\*[doc-punct-result]
683 .               ds doc-punct-result
684 .               rm doc-pcresult
685 .               ds sepstring \~
686 .               nr doc-dosep 0
687 .       \}
690 .make-mode bold <b> </b>
691 .make-mode code <code> </code>
692 .make-mode em <em> </em>
693 .make-mode i <i> </i>
694 .make-mode caps <font\ size="-1"> </font>
695 .make-mode null \& \&
696 .make-mode function <code> </code>
697 .am mode-i-on
698 .       ds sepstring \~
700 .am mode-em-on
701 .       ds sepstring \~
703 .am mode-i-off
704 .       ds sepstring \~
706 .am mode-em-off
707 .       ds sepstring \~
710 .de doc-sep-append
711 .       if \\n[doc-dosep] .as doc-pcresult \~
712 .       as doc-pcresult \\$1
713 .       nr doc-dosep 0
715 .de No
716 .       as doc-pcresult \\*[close-mode]
717 .       resetmode
718 .       recurse \\$@
719 .       pc-fin
721 .de Fl
722 .DEBUG .tm .Fl \\$*
723 .       mode-bold-on
724 .       doc-sep-append \-
725 .       recurse \\$@
726 .       mode-bold-off
727 .       pc-fin
729 .de Cm
730 .DEBUG .tm .Cm \\$*
731 .       mode-bold-on
732 .       recurse \\$@
733 .       mode-bold-off
734 .       pc-fin
736 .de Op
737 .DEBUG .tm .Op \\$*
738 .       as doc-pcresult \&[
739 .       recurse \\$@
740 .       pc-fin \&]
742 .de Em
743 .DEBUG .tm .Em \\$*
744 .       mode-em-on
745 .       recurse \\$@
746 .       mode-em-off
747 .       pc-fin
749 .de Fx
750 .DEBUG .tm .Fx \\$*
751 .       as doc-pcresult FreeBSD
752 .       recurse \\$@
753 .       pc-fin
755 .de Nm
756 .       ds Nm-result \\*[Nm-save]
757 .       if \\n(.$ \{\
758 .               ie '\\$1'' .br-real
759 .               el \{\
760 .                       ds Nm-result \\$1
761 .                       if '\\*[Nm-save]'' .ds Nm-save \\$1
762 .                       shift
763 .               \}
764 .       \}
765 .       mode-bold-on
766 .       as doc-pcresult \\*[Nm-result]
767 .       recurse \\$@
768 .       mode-bold-off
769 .       pc-fin
771 .de Nd
772 .DEBUG .tm .Nd \\$*
773 - \\$*
775 .de At
776 AT&T UNIX\\$*
778 .de An
779 .       if '\\$1'-nosplit' \{\
780 .               ds an-eol
781 .               shift
782 .       \}
783 .       recurse \\$@
784 .       as doc-pcresult \\*[an-eol]
785 .       pc-fin
787 .de Lk
788 .       as doc-pcresult <a href="\\$1">\\$1</a>
789 .       shift
790 .       recurse \\$@
791 .       pc-fin
793 .de Mt
794 .       as doc-pcresult <a href="mailto:\\$1">\\$1</a>
795 .       shift
796 .       recurse \\$@
797 .       pc-fin
799 .de Ta
800 .       as doc-pcresult <td>
801 .       recurse \\$@
802 .       pc-fin
804 .de Bx
805 .       doc-checkpunct \\$1 \\*[doc-punct]
806 .       if !\\n[doc-ispunct] \{\
807 .               as doc-pcresult \\$1
808 .               shift
809 .       \}
810 .       as doc-pcresult BSD
811 .       recurse \\$@
812 .       pc-fin
814 .de Nx
815 .       as doc-pcresult NetBSD
816 .       recurse \\$@
817 .       pc-fin
819 .de Ox
820 .       as doc-pcresult OpenBSD
821 .       recurse \\$@
822 .       pc-fin
824 .de Ux
825 .       as doc-pcresult UNIX
826 .       recurse \\$@
827 .       pc-fin
829 .de Ql
830 .       as doc-pcresult `
831 .       recurse \\$@
832 .       pc-fin \&'
834 .de Pf
835 .       as doc-pcresult \\$1
836 .       shift
837 .       nr doc-dosep 0
838 .       recurse \\$@
839 .       pc-fin
841 .de Ns
842 .       nr doc-dosep 0
843 .       mode-null-on
844 .       recurse \\$@
845 .       mode-null-off
846 .       pc-fin
849 .de doc-start-quote 
850 .       if \\n[r-lvl]&\\n[doc-dosep] .as doc-pcresult \\*[sepstring]
851 .       as doc-pcresult \\$1
852 .       nr doc-dosep 0
855 .de safe-blm
858 .nr quote-level 0
859 .de doc-quote-open
860 .       nr quote-level +1
861 .       blm safe-blm
862 .       if \\n[r-lvl]&\\n[doc-dosep] .as doc-pcresult \\*[sepstring]
863 .       nr doc-dosep 0
864 .       ie \\n[quote-level]=1 \{\
865 .               ev quotation_ev
866 .               di quotation
867 .               br-real
868 .               nr quotation_line \\n[.c]
869 .       \}
870 .       el \{\
871 .               di
872 .               as quotation \\$1
873 .               da quotation
874 .       \}
877 .de general-close
878 .       nr quote-level -1
879 .       if \\w\a\\n[.z]\a=0 .Error no quotation is open
880 .       br-real
881 .       if \\n[quote-level]=0 \{\
882 .               di
883 .               ev
884 .               ev quotation_ev
885 .               br-real
886 .               da quotation
887 .               nf-real
889 .               di
890 .               ev
891 .               as doc-pcresult \\$1\\*[quotation]\\
892 .               blm Pp
893 .       \}
898 .de make-quoter
899 \\*[dot-de] \\$1o
900 .       doc-quote-open \\$2
901 .       recurse \\\\$@
902 .       pc-fin
903 \\*[dot-dot]
904 \\*[dot-de] \\$1c
905 .       DEBUG .tm CLOSE 1,\\\\$@,
906 .       general-close \\$2
907 .       DEBUG .tm CLOSE 2,\\\\$@,\\$3,
908 .       recurse \\\\$@ \\$3
909 .       pc-fin
910 \\*[dot-dot]
911 \\*[dot-de] \\$1q
912 .       doc-start-quote \\$2
913 .       recurse \\\\$@
914 .       pc-fin \\$3
915 \\*[dot-dot]
918 .\" generate Aq Ao Ac Bq Bo Bc Brq Bro Brc Dq Do Dc
919 .\"     Pq Po Pc Qq Qo Qc Sq So Sc Oo Oc
920 .make-quoter A &lt; &gt;
921 .make-quoter B \&[ ]
922 .make-quoter Br \&{ }
923 .make-quoter D \&`` ''
924 .make-quoter P \&( )
925 .make-quoter Q \&" "
926 .make-quoter S \&` '
927 .als Oo Bo
928 .als Oc Bc
929 .de Error
930 .       ab Line \\n[.c], Error: \\$*
932 .de Ft
933 .       as doc-pcresult <br><br>
934 .       mode-code-on
935 .       recurse \\$@
936 .       mode-code-off
937 .       pc-fin
939 .de Fn
940 .       mode-bold-on
941 .       as doc-pcresult "\\$1
942 .       shift
943 .       mode-bold-off
944 .       as doc-pcresult (
945 .       mode-function-on
946 .       ds sepstring , \" (need the space)
947 .       recurse \\$@
948 .       as doc-pcresult \\*[close-mode])
949 .       resetmode
950 .       pc-fin
952 .de Fo
953 .       mode-bold-on
954 .       as doc-pcresult "\\$1
955 .       shift
956 .       mode-bold-off
957 .       as doc-pcresult (
958 .       mode-code-on
959 .       recurse \\$@
960 .       mode-code-off
961 .       pc-fin
963 .de Fc
964 .       recurse \\$@
965 .       pc-fin )
967 .de Ar
968 .       mode-i-on
969 .       recurse \\$@
970 .       mode-i-off
971 .       pc-fin
973 .de Ic
974 .       mode-bold-on
975 .       recurse \\$@
976 .       mode-bold-off
977 .       pc-fin
979 .de Fa
980 .       mode-code-on
981 .       recurse \\$@
982 .       mode-code-off
983 .       pc-fin
985 .de Xr
986 .       nr have-sec 0
987 .       if \a\\$2\a1\a .nr have-sec 1
988 .       if \a\\$2\a2\a .nr have-sec 1
989 .       if \a\\$2\a3\a .nr have-sec 1
990 .       if \a\\$2\a4\a .nr have-sec 1
991 .       if \a\\$2\a5\a .nr have-sec 1
992 .       if \a\\$2\a6\a .nr have-sec 1
993 .       if \a\\$2\a7\a .nr have-sec 1
994 .       if \a\\$2\a8\a .nr have-sec 1
995 .       if \a\\$2\a9\a .nr have-sec 1
996 .       ie \\n[DOC_XR]:(\\n[have-sec]=0) \{\
997 .               mode-code-on
998 .               ie \\n[have-sec]=0 .as doc-pcresult \\$1
999 .               el .as doc-pcresult \\$1(\\$2)
1000 .               mode-code-off
1001 .       \}
1002 .       el \{\
1003 .               ds Xr-tmp \\$1
1004 .               if \a\\*[Xr-tmp]\aindex\a .ds Xr-tmp xindex
1005 .               as doc-pcresult <a href="\\*[DOC_MANROOT]/html\\$2/\\$1.html">
1006 .               ie \\w\a\\$2\a=0 .as doc-pcresult \\$1
1007 .               el .as doc-pcresult \\$1(\\$2)
1008 .               as doc-pcresult </a>
1009 .       \}
1010 .       shift
1011 .       shift
1012 .       recurse \\$@
1013 .       pc-fin
1015 .de Dv
1016 .       mode-code-on
1017 .       recurse \\$@
1018 .       mode-code-off
1019 .       pc-fin
1021 .de Ic
1022 .       mode-bold-on
1023 .       recurse \\$@
1024 .       mode-bold-off
1025 .       pc-fin
1027 .de Pa
1028 .       mode-code-on
1029 .       recurse \\$@
1030 .       mode-code-off
1031 .       pc-fin
1033 .de Tn
1034 .       mode-caps-on
1035 .       recurse \\$@
1036 .       mode-caps-off
1037 .       pc-fin
1039 .de Fd
1040 .       as doc-pcresult <br>
1041 .       mode-bold-on
1042 .       recurse \\$@
1043 .       mode-bold-off
1044 .       pc-fin
1046 .de Va
1047 .       mode-i-on
1048 .       recurse \\$@
1049 .       mode-i-off
1050 .       pc-fin
1052 .de Li
1053 .       mode-code-on
1054 .       recurse \\$@
1055 .       mode-code-off
1056 .       pc-fin
1058 .de Sy
1059 .       mode-bold-on
1060 .       recurse \\$@
1061 .       mode-bold-off
1062 .       pc-fin
1064 .de Me
1065 .       mode-bold-on
1066 .       recurse \\$@
1067 .       mode-bold-off
1068 .       pc-fin
1070 .de Ev
1071 .       mode-code-on
1072 .       recurse \\$@
1073 .       mode-code-off
1074 .       pc-fin
1076 .de Cd
1077 .       mode-bold-on
1078 .       recurse \\$@
1079 .       mode-bold-off
1080 .       pc-fin
1083         I used to have a caps-code mode for Er. But <code> apparently
1084         already implies a small mode or maybe actually small caps mode.
1086 .de Er
1087 .       mode-code-on
1088 .       recurse \\$@
1089 .       mode-code-off
1090 .       pc-fin
1092 .de St
1093 .       ie \\n(.$==0 \{\
1094 .               tm The .St (expand standard name) macro requires >= 1 arg
1095 .       \}
1096 .       el \{\
1097 .               ds std-tmp1 ERROR
1098 .\" ANSI/ISO C
1099 .               if "\\$1"-ansiC" \{\
1100 .                       ds std-tmp1 \&ANSI X3.159-1989
1101 .                       as std-tmp1 " \"exactly one space
1102 .                       as std-tmp1 (``ANSI C89'')
1103 .               \}
1104 .               if "\\$1"-ansiC-89" \{\
1105 .                       ds std-tmp1 \&ANSI X3.159-1989
1106 .                       as std-tmp1 " \"exactly one space
1107 .                       as std-tmp1 (``ANSI C89'')
1108 .               \}
1109 .               if "\\$1"-isoC" \{\
1110 .                       ds std-tmp1 \&ISO/IEC 9899:1990
1111 .                       as std-tmp1 " \"exactly one space
1112 .                       as std-tmp1 (``ISO C90'')
1113 .               \}
1114 .               if "\\$1"-isoC-90" \{\
1115 .                       ds std-tmp1 \&ISO/IEC 9899:1990
1116 .                       as std-tmp1 " \"exactly one space
1117 .                       as std-tmp1 (``ISO C90'')
1118 .               \}
1119 .               if "\\$1"-isoC-amd1" \{\
1120 .                       ds std-tmp1 \&ISO/IEC 9899/AMD1:1990
1121 .                       as std-tmp1 " \"exactly one space
1122 .                       as std-tmp1 (``ISO C90'')
1123 .               \}
1124 .               if "\\$1"-isoC-tcor1" \{\
1125 .                       ds std-tmp1 \&ISO/IEC 9899/TCOR1:1990
1126 .                       as std-tmp1 " \"exactly one space
1127 .                       as std-tmp1 (``ISO C90'')
1128 .               \}
1129 .               if "\\$1"-isoC-tcor2" \{\
1130 .                       ds std-tmp1 \&ISO/IEC 9899/TCOR2:1990
1131 .                       as std-tmp1 " \"exactly one space
1132 .                       as std-tmp1 (``ISO C90'')
1133 .               \}
1134 .               if "\\$1"-isoC-99" \{\
1135 .                       ds std-tmp1 \&ISO/IEC 9899:1999
1136 .                       as std-tmp1 " \"exactly one space
1137 .                       as std-tmp1 (``ISO C99'')
1138 .               \}
1139 .\" POSIX Part 1: System API
1140 .               if "\\$1"-p1003.1" \{\
1141 .                       ds std-tmp1 \&IEEE Std 1003.1
1142 .                       as std-tmp1 " \"exactly one space
1143 .                       as std-tmp1 (``\\*(Px.1'')
1144 .               \}
1145 .               if "\\$1"-p1003.1-88" \{\
1146 .                       ds std-tmp1 \&IEEE Std 1003.1-1988
1147 .                       as std-tmp1 " \"exactly one space
1148 .                       as std-tmp1 (``\\*(Px.1'')
1149 .               \}
1150 .               if "\\$1"-p1003.1-90" \{\
1151 .                       ds std-tmp1 \&ISO/IEC 9945-1:1990
1152 .                       as std-tmp1 " \"exactly one space
1153 .                       as std-tmp1 (``\\*(Px.1'')
1154 .               \}
1155 .               if "\\$1"-iso9945-1-90" \{\
1156 .                       ds std-tmp1 \&ISO/IEC 9945-1:1990
1157 .                       as std-tmp1 " \"exactly one space
1158 .                       as std-tmp1 (``\\*(Px.1'')
1159 .               \}
1160 .               if "\\$1"-p1003.1b-93" \{\
1161 .                       ds std-tmp1 \&IEEE Std 1003.1b-1993
1162 .                       as std-tmp1 " \"exactly one space
1163 .                       as std-tmp1 (``\\*(Px.1'')
1164 .               \}
1165 .               if "\\$1"-p1003.1c-95" \{\
1166 .                       ds std-tmp1 \&IEEE Std 1003.1c-1995
1167 .                       as std-tmp1 " \"exactly one space
1168 .                       as std-tmp1 (``\\*(Px.1'')
1169 .               \}
1170 .               if "\\$1"-p1003.1i-95" \{\
1171 .                       ds std-tmp1 \&IEEE Std 1003.1i-1995
1172 .                       as std-tmp1 " \"exactly one space
1173 .                       as std-tmp1 (``\\*(Px.1'')
1174 .               \}
1175 .               if "\\$1"-p1003.1-96" \{\
1176 .                       ds std-tmp1 \&ISO/IEC 9945-1:1996
1177 .                       as std-tmp1 " \"exactly one space
1178 .                       as std-tmp1 (``\\*(Px.1'')
1179 .               \}
1180 .               if "\\$1"-iso9945-1-96" \{\
1181 .                       ds std-tmp1 \&ISO/IEC 9945-1:1996
1182 .                       as std-tmp1 " \"exactly one space
1183 .                       as std-tmp1 (``\\*(Px.1'')
1184 .               \}
1185 .               if "\\$1"-p1003.1g-2000" \{\
1186 .                       ds std-tmp1 \&IEEE Std 1003.1g-2000
1187 .                       as std-tmp1 " \"exactly one space
1188 .                       as std-tmp1 (``\\*(Px.1'')
1189 .               \}
1190 .               if "\\$1"-p1003.1-2001" \{\
1191 .                       ds std-tmp1 \&IEEE Std 1003.1-2001
1192 .                       as std-tmp1 " \"exactly one space
1193 .                       as std-tmp1 (``\\*(Px.1'')
1194 .               \}
1195 .               if "\\$1"-p1003.1-2004" \{\
1196 .                       ds std-tmp1 \&IEEE Std 1003.1-2004
1197 .                       as std-tmp1 " \"exactly one space
1198 .                       as std-tmp1 (``\\*(Px.1'')
1199 .               \}
1200 .               if "\\$1"-p1003.1-2008" \{\
1201 .                       ds std-tmp1 \&IEEE Std 1003.1-2008
1202 .                       as std-tmp1 " \"exactly one space
1203 .                       as std-tmp1 (``\\*(Px.1'')
1204 .               \}
1205 .\" POSIX Part 2: Shell and Utilities
1206 .               if "\\$1"-p1003.2" \{\
1207 .                       ds std-tmp1 \&IEEE Std 1003.2
1208 .                       as std-tmp1 " \"exactly one space
1209 .                       as std-tmp1 (``\\*(Px.2'')
1210 .               \}
1211 .               if "\\$1"-p1003.2-92" \{\
1212 .                       ds std-tmp1 \&IEEE Std 1003.2-1992
1213 .                       as std-tmp1 " \"exactly one space
1214 .                       as std-tmp1 (``\\*(Px.2'')
1215 .               \}
1216 .               if "\\$1"-p1003.2a-92" \{\
1217 .                       ds std-tmp1 \&IEEE Std 1003.2a-1992
1218 .                       as std-tmp1 " \"exactly one space
1219 .                       as std-tmp1 (``\\*(Px.2'')
1220 .               \}
1221 .               if "\\$1"-iso9945-2-93" \{\
1222 .                       ds std-tmp1 \&ISO/IEC 9945-2:1993
1223 .                       as std-tmp1 " \"exactly one space
1224 .                       as std-tmp1 (``\\*(Px.2'')
1225 .               \}
1226 .\" X/Open
1227 .               if "\\$1"-susv2" \{\
1228 .                       ds std-tmp1 \&Version 2 of the Single UNIX Specification
1229 .                       as std-tmp1 " \"exactly one space
1230 .                       as std-tmp1 (``SUSv2'')
1231 .               \}
1232 .               if "\\$1"-svid4" \{\
1233 .                       ds std-tmp1 \&System V Interface Definition,
1234 .                       as std-tmp1 " \"exactly one space
1235 .                       as std-tmp1 \&Fourth Edition
1236 .                       as std-tmp1 " \"exactly one space
1237 .                       as std-tmp1 (``SVID4'')
1238 .               \}
1239 .               if "\\$1"-xbd5" \{\
1240 .                       ds std-tmp1 X/Open System Interface Definitions Issue 5
1241 .                       as std-tmp1 " \"exactly one space
1242 .                       as std-tmp1 (``\\*(tNXBD5\\*(aa'')
1243 .               \}
1244 .               if "\\$1"-xcu5" \{\
1245 .                       ds std-tmp1 X/Open Commands and Utilities Issue 5
1246 .                       as std-tmp1 " \"exactly one space
1247 .                       as std-tmp1 (``\\*(tNXCU5\\*(aa'')
1248 .               \}
1249 .               if "\\$1"-xcurses4.2" \{\
1250 .                       ds std-tmp1 X/Open Curses, Issue 4, Version 2
1251 .                       as std-tmp1 " \"exactly one space
1252 .                       as std-tmp1 (``\\*(tNXCURSES4.2\\*(aa'')
1253 .               \}
1254 .               if "\\$1"-xns5" \{\
1255 .                       ds std-tmp1 X/Open Networking Services Issue 5
1256 .                       as std-tmp1 " \"exactly one space
1257 .                       as std-tmp1 (``\\*(tNXNS5\\*(aa'')
1258 .               \}
1259 .               if "\\$1"-xns5.2" \{\
1260 .                       ds std-tmp1 X/Open Networking Services Issue 5.2
1261 .                       as std-tmp1 " \"exactly one space
1262 .                       as std-tmp1 (``\\*(tNXNS5.2\\*(aa'')
1263 .               \}
1264 .               if "\\$1"-xpg3" \{\
1265 .                       ds std-tmp1 X/Open Portability Guide Issue 3
1266 .                       as std-tmp1 " \"exactly one space
1267 .                       as std-tmp1 (``XPG3'')
1268 .               \}
1269 .               if "\\$1"-xpg4" \{\
1270 .                       ds std-tmp1 X/Open Portability Guide Issue 4
1271 .                       as std-tmp1 " \"exactly one space
1272 .                       as std-tmp1 (``XPG4'')
1273 .               \}
1274 .               if "\\$1"-xpg4.2" \{\
1275 .                       ds std-tmp1 X/Open Portability Guide Issue 4, Version 2
1276 .                       as std-tmp1 " \"exactly one space
1277 .                       as std-tmp1 (``XPG4.2'')
1278 .               \}
1279 .               if "\\$1"-xsh5" \{\
1280 .                       ds std-tmp1 X/Open System Interfaces and Headers Issue 5
1281 .                       as std-tmp1 " \"exactly one space
1282 .                       as std-tmp1 (``\\*(tNXSH5\\*(aa'')
1283 .               \}
1284 .\" Miscellaneous
1285 .               if "\\$1"-ieee754" \{\
1286 .                       ds std-tmp1 \&IEEE Std 754-1985
1287 .               \}
1288 .               if "\\$1"-ieee1275-94" \{\
1289 .                       ds std-tmp1 \&IEEE Std 1275-1994
1290 .                       as std-tmp1 " \"exactly one space
1291 .                       as std-tmp1 (``Open Firmware'')
1292 .               \}
1293 .               if "\\$1"-iso8802-3" \{\
1294 .                       ds std-tmp1 \&ISO/IEC 8802-3:1989
1295 .               \}
1296 .               if "\\*[std-tmp1]"ERROR" .Error no such std: .St \\$*
1297 .               shift
1298 .               as doc-pcresult \~\\*[std-tmp1]\~
1299 .               recurse \\$@
1300 .               pc-fin
1301 .       \}
1304         I've observed that <code> does decent things with caps, and it should
1305         be reminiscent of the old typewriter-style unix logos.
1307 .de At
1308 .   if \\n(.$==2 \{\
1309 .       if "\\$1"32v" Version 32V <code>AT&T UNIX</code>\\$2
1310 .       if "\\$1"V"  \<code>AT&T</code> System V <code>UNIX</code>\\$2
1311 .       if "\\$1"V.1"  <code>AT&T</code> System V.1 <code>UNIX</code>\\$2
1312 .       if "\\$1"V.2"  <code>AT&T</code> System V.2 <code>UNIX</code>\\$2
1313 .       if "\\$1"V.3"  <code>AT&T</code> System V.3 <code>UNIX</code>\\$2
1314 .       if "\\$1"V.4"  <code>AT&T</code> System V.4 <code>UNIX</code>\\$2
1315 .       if "\\$1"v1"  Version 1 <code>AT&T UNIX</code>\\$2
1316 .       if "\\$1"v5"  Version 5 <code>AT&T UNIX</code>\\$2
1317 .       if "\\$1"v6"  Version 6 <code>AT&T UNIX</code>\\$2
1318 .       if "\\$1"v7"  Version 7 <code>AT&T UNIX</code>\\$2
1319 .   \}
1320 .   if \\n(.$==1 \{\
1321 .       if "\\$1"32v" Version 32V <code>AT&T UNIX</code>
1322 .       if "\\$1"V"  <code>AT&T</code> System V <code>UNIX</code>
1323 .       if "\\$1"V.1"  <code>AT&T</code> System V.1 <code>UNIX</code>
1324 .       if "\\$1"V.2"  <code>AT&T</code> System V.2 <code>UNIX</code>
1325 .       if "\\$1"V.3"  <code>AT&T</code> System V.3 <code>UNIX</code>
1326 .       if "\\$1"V.4"  <code>AT&T</code> System V.4 <code>UNIX</code>
1327 .       if "\\$1"v1"  Version 1 <code>AT&T UNIX</code>
1328 .       if "\\$1"v5"  Version 5 <code>AT&T UNIX</code>
1329 .       if "\\$1"v6"  Version 6 <code>AT&T UNIX</code>
1330 .       if "\\$1"v7"  Version 7 <code>AT&T UNIX</code>
1331 .   \}
1332 .   if \\n(.$==0 \{\
1333 .       if 1 <code>AT&T UNIX</code>
1334 .   \}
1336 .\"----------------------------------------------------------------------
1338 .\" There must be a doc2html alias for all callable macros
1340 .als doc2html@@Dd Dd
1341 .als doc2html@@Dt Dt
1342 .als doc2html@@Os Os
1343 .als doc2html@@br br
1344 .als doc2html@@sp sp
1345 .als doc2html@@fi fi
1346 .als doc2html@@nf nf
1347 .als doc2html@@Sh Sh
1348 .als doc2html@@Ss Ss
1349 .als doc2html@@Pp Pp
1350 .als doc2html@@D1 D1
1351 .als doc2html@@Dl Dl
1352 .als doc2html@@Bd Bd
1353 .als doc2html@@Ed Ed
1354 .als doc2html@@Bl Bl
1355 .als doc2html@@It It
1356 .als doc2html@@El El
1357 .als doc2html@@Fl Fl
1358 .als doc2html@@Cm Cm
1359 .als doc2html@@Op Op
1360 .als doc2html@@Em Em
1361 .als doc2html@@Fx Fx
1362 .als doc2html@@Ox Ox
1363 .als doc2html@@Nm Nm
1364 .als doc2html@@Nd Nd
1365 .als doc2html@@At At
1366 .als doc2html@@Bx Bx
1367 .als doc2html@@Nx Nx
1368 .als doc2html@@Ux Ux
1369 .als doc2html@@Ql Ql
1370 .als doc2html@@Pf Pf
1371 .als doc2html@@Ns Ns
1372 .als doc2html@@Ft Ft
1373 .als doc2html@@Fn Fn
1374 .als doc2html@@Fo Fo
1375 .als doc2html@@Fc Fc
1376 .als doc2html@@Ar Ar
1377 .als doc2html@@Ic Ic
1378 .als doc2html@@Fa Fa
1379 .als doc2html@@Xr Xr
1380 .als doc2html@@Dv Dv
1381 .als doc2html@@Ic Ic
1382 .als doc2html@@Pa Pa
1383 .als doc2html@@Tn Tn
1384 .als doc2html@@Fd Fd
1385 .als doc2html@@Va Va
1386 .als doc2html@@Li Li
1387 .als doc2html@@Sy Sy
1388 .als doc2html@@Me Me
1389 .als doc2html@@Ev Ev
1390 .als doc2html@@Cd Cd
1391 .als doc2html@@St St
1392 .als doc2html@@Er Er
1393 .als doc2html@@Aq Aq
1394 .als doc2html@@Ao Ao
1395 .als doc2html@@Ac Ac
1396 .als doc2html@@Bq Bq
1397 .als doc2html@@Bo Bo
1398 .als doc2html@@Bc Bc
1399 .als doc2html@@Brq Brq
1400 .als doc2html@@Bro Bro
1401 .als doc2html@@Brc Brc
1402 .als doc2html@@Dq Dq
1403 .als doc2html@@Do Do
1404 .als doc2html@@Dc Dc
1405 .als doc2html@@Qq Qq
1406 .als doc2html@@Qo Qo
1407 .als doc2html@@Qc Qc
1408 .als doc2html@@Pq Pq
1409 .als doc2html@@Po Po
1410 .als doc2html@@Pc Pc
1411 .als doc2html@@Sq Sq
1412 .als doc2html@@So So
1413 .als doc2html@@Sc Sc
1414 .als doc2html@@Oo Oo
1415 .als doc2html@@Oc Oc
1416 .als doc2html@@Ta Ta
1417 .als doc2html@@Mt Mt
1418 .als doc2html@@Lk Lk
1419 .als doc2html@@No No
1420 .als doc2html@@An An
1422 .rn em doc-real-em
1423 .de em
1424 .       tm Hint: Should this have been .Em ...?
1425 .       Error end-macro (.em) respecification is not allowed.
1429 ----------------------------------------------------------------------
1430 ----------------------------------------------------------------------
1431 ----------------------------------------------------------------------
1432         THESE ARE THE -man (-man.old) MACRO FUNCTIONS
1434         Internal symbols relating to -man are prefixed with mo-
1435         The body-params string used with -mdoc2html is used here as well.
1437 .de TH
1438 .       init-html \\$@
1439 .       nr mo-section \\$2
1441 .de SH
1442 .       end-preformat
1443 .       mo-end-dl
1444 <h3 id="\\$*"> \\$* </h3>
1446 .de SS
1447 .       end-preformat
1448 .       mo-end-dl
1449 <h4 id="\\$*"> \\$* </h4>
1451 .de B
1452 .       ie \\n(.$ <b>\&\\$*</b>
1453 .       el \{\
1454 .               if 1 <b>
1455 .               it 1 mo-end-bold
1456 .       \}
1458 .de I
1459 .       ie \\n(.$ <i>\&\\$*</i>
1460 .       el \{\
1461 .               if 1 <i>
1462 .               it 1 mo-end-italic
1463 .       \}
1465 .de mo-end-bold
1466 </b>
1468 .de mo-end-italic
1469 </i>
1471 .de SM
1472 <font size=-1>
1473 .       it 1 mo-end-smallcaps
1474 .       if \\n(.$ \&\\$*
1476 .de mo-end-smallcaps
1477 </font>
1479 .de BI
1480 .       mo-try-link \\$1 \\$2
1481 .       if !\\n[mo-did-link] \{\
1482 .               ds mo-bi-tmp1
1483 .               while \\n(.$>=2 \{\
1484 .                       as mo-bi-tmp1 <b>\\$1</b><i>\\$2</i>
1485 .                       shift
1486 .                       shift
1487 .               \}
1488 .               as mo-bi-tmp1 \\$*
1489 \&\\*[mo-bi-tmp1]
1490 .       \}
1492 .de BR
1493 .       mo-try-link \\$1 \\$2
1494 .       if !\\n[mo-did-link] \{\
1495 .               ds mo-bi-tmp1
1496 .               while \\n(.$>=2 \{\
1497 .                       as mo-bi-tmp1 <b>\\$1</b>\\$2
1498 .                       shift
1499 .                       shift
1500 .               \}
1501 .               as mo-bi-tmp1 \\$*
1502 \&\\*[mo-bi-tmp1]
1503 .       \}
1505 .de IB
1506 .       mo-try-link \\$1 \\$2
1507 .       if !\\n[mo-did-link] \{\
1508 .               ds mo-bi-tmp1
1509 .               while \\n(.$>=2 \{\
1510 .                       as mo-bi-tmp1 <i>\\$1</i><b>\\$2</b>
1511 .                       shift
1512 .                       shift
1513 .               \}
1514 .               as mo-bi-tmp1 \\$*
1515 \&\\*[mo-bi-tmp1]
1516 .       \}
1518 .de IR
1519 .       mo-try-link \\$1 \\$2
1520 .       if !\\n[mo-did-link] \{\
1521 .               ds mo-bi-tmp1
1522 .               while \\n(.$>=2 \{\
1523 .                       as mo-bi-tmp1 <i>\\$1</i>\\$2
1524 .                       shift
1525 .                       shift
1526 .               \}
1527 .               as mo-bi-tmp1 \\$*
1528 \&\\*[mo-bi-tmp1]
1529 .       \}
1531 .de CT
1532 \&&lt;<font size=-1>CTRL/</font>\\$*&gt;
1534 .de DS
1535 <code><pre>
1537 .de DE
1538 .       DEBUG .tm DE
1539 </pre></code>
1541 .als Ds DS
1542 .als De DE
1543 .als EX DS
1544 .als EE DE
1545 .de TP
1546 .       mo-start-dl
1547 <dt>
1548 .       it 1 mo-dd
1550 .de IP
1551 .       mo-start-dl
1552 <dt>
1553 <b>\\$1</b>
1554 .       it 1 mo-dd
1556 .de mo-start-dl
1557 .       end-preformat
1558 .       if !\\n[mo-in-dl] <dl compact>
1559 .       nr mo-in-dl 1
1561 .de mo-dd
1562 <dd>
1564 .de mo-end-dl
1565 .       if \\n[mo-in-dl] </dl>
1566 .       nr mo-in-dl 0
1568 .de P
1569 .       end-preformat
1570 .       mo-end-dl
1573 .als PP P
1574 .als LP P
1575 .de mo-try-link
1576 .       nr mo-did-link 0
1577 .       if \\A'\\$2' \{\
1578 .               if \\w'\\*[\\$2]' \{\
1579 .                       Xr \\$1 \\*[\\$2]
1580 .                       nr mo-did-link 1
1581 .               \}
1582 .       \}
1584 .ds (1) 1
1585 .ds (2) 2
1586 .ds (3) 3
1587 .ds (4) 4
1588 .ds (5) 5
1589 .ds (6) 6
1590 .ds (7) 7
1591 .ds (8) 8
1592 .ds (9) 9
1593 .ds (1), 1
1594 .ds (2), 2
1595 .ds (3), 3
1596 .ds (4), 4
1597 .ds (5), 5
1598 .ds (6), 6
1599 .ds (7), 7
1600 .ds (8), 8
1601 .ds (9), 9
1602 .ds (1). 1
1603 .ds (2). 2
1604 .ds (3). 3
1605 .ds (4). 4
1606 .ds (5). 5
1607 .ds (6). 6
1608 .ds (7). 7
1609 .ds (8). 8
1610 .ds (9). 9