Annotation of src/share/tmac/doc2html, Revision 1.62
1.62 ! plunky 1: .\" $NetBSD: doc2html,v 1.61 2009/05/12 18:07:54 plunky Exp $
1.1 ross 2: .\"
1.55 lukem 3: .\" Copyright (c) 1998, 1999, 2008 The NetBSD Foundation, Inc.
1.1 ross 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
31:
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.
34:
35: The second section implements -man (-man.old) macros. These are trivial
36: compared to -mdoc.
37:
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.
41:
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.
45:
46:
47: TODO:
48: There are a few internal macros and other symbols that don't contain
49: an embedded `-'.
50:
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.
1.10 ross 54: (-mdoc has the .Bl -column list, which eliminates most requirements
1.1 ross 55: for tbl)
56:
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.
60:
61: We need "intro" or "contents" pages for each man/man? (man/html?)
62: section.
63:
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.)
66: ..
67: .
1.35 ross 68: .if dError .Error - multiple inclusion of doc2html
69: .
1.1 ross 70: .de TS
71: <pre>
72: ..
73: .de TE
1.35 ross 74: . DEBUG .tm TE
1.1 ross 75: </pre>
76: ..
77: .de PS
78: <pre>
79: ..
80: .de PE
1.35 ross 81: . DEBUG .tm PE
1.1 ross 82: </pre>
83: ..
84: .
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
90: ..
91: .
92: .de doc-pop
1.10 ross 93: . ie \\n[doc-stackp]<=0 .Error Extraneous \\$1 request
1.1 ross 94: . el .nr doc-stackp -1
95: . ds doc-pop-tmp1 \\*[doc-stack-rq-\\n[doc-stackp]]
96: . if !\\*[doc-pop-tmp1]\\$1 \{\
1.10 ross 97: . tm Need \\*[doc-pop-tmp1] before \\$1
98: . Error See line \\n[doc-stack-ln-\\n[doc-stackp]]
1.1 ross 99: . \}
100: ..
101: .
102: .de doc-rlookup
103: . if !r\\$1 \{\
104: . ie \\w\\V[\\$1] .nr \\$1 \\V[\\$1]
105: . el .nr \\$1 \\$2
106: . \}
107: ..
108: .
109: .de doc-slookup
110: . if !d\\$1 \{\
111: . ie \\w\\V[\\$1] .ds \\$1 \\V[\\$1]
112: . el .ds \\$1 \\$2
113: . \}
114: ..
115: .
116: .doc-rlookup DOC_DEBUG_MODE 0
1.36 ross 117: .doc-rlookup DOC_XR 0
1.1 ross 118: .doc-slookup DOC_MANROOT ..
119: .
120: .nr in-pre 0
121: .nr HTML 1
122: .pl 1i
123: .po 0
124: .in 0
125: .nf
126: .nh
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
135: ..
136: .nr center-on 0
137: .de end-center
138: . it
139: . if \\n[center-on] </center>
140: . nr center-on 0
141: ..
142: .
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
148: ..
149: .
150: .ds copy ©
151: .ds > >
152: .ds < <
153: .ds >= >=
154: .ds <= <=
1.2 ross 155: .ds Lt <
156: .ds Gt >
1.1 ross 157: .ds & &
1.58 apb 158: .ds Am &
1.1 ross 159: .ds _
160: .ds q "
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
1.10 ross 170: .ds open-mode
1.1 ross 171: .ds doc-anchor
1.49 wiz 172: .\" default EOL after .An
173: .\" can be changed with .An -nosplit
174: .ds an-eol <br>
1.9 ross 175: .ds Nm-save
1.1 ross 176: .ds T " x
1.11 ross 177: .ds tN <font\ size="-1">
178: .ds aa </font>
179: .ds Px \\*(tNPOSIX\\*(aa
1.1 ross 180: .chop T
181: .nr doc-dosep 0
182: .nr r-lvl 0
183: .
184: .if !dMANROOT \{\
185: . ds MANROOT \V[MANROOT]
186: . if !\w\*[MANROOT] .ds MANROOT ..
187: .\}
188: .
189: .blm Pp
190: .
191: .
192: .de DEBUG
193: .if \\n[DOC_DEBUG_MODE] \\$*
194: ..
195: .de Dd
196: . as document-title " \\$*
197: ..
198: .de Dt
199: . as document-title " \\$*
200: ..
201: .de Os
202: . as document-title " \\$*
203: . init-html
204: ..
205: .\"----------------------------------------------------------------------
1.35 ross 206: .\" troff requests we delete
207: .
208: .rm wh
209: .
1.1 ross 210: .\" troff requests we translate
1.35 ross 211: .
1.1 ross 212: .rn br br-real
213: .rn sp sp-real
214: .rn fi fi-real
215: .rn nf nf-real
1.35 ross 216: .
1.1 ross 217: .de br
1.35 ross 218: . if \\n[in-pre]=0 <br>
1.1 ross 219: ..
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: . \}
229: ..
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>
236: ..
237: .de end-preformat
1.35 ross 238: . DEBUG .tm end-preformat \\n[in-pre]
1.1 ross 239: . if \\n[in-pre] </pre>
240: . nr in-pre 0
241: ..
242: .de fi
1.35 ross 243: . DEBUG fi
1.1 ross 244: . end-preformat
245: ..
246: .de nf
247: <br>
248: <pre>
249: . nr in-pre 1
250: ..
251: .\"
252: .\"----------------------------------------------------------------------
253: .\" Magic to open and close <body> and <html>
254: .\"
255: .de end-macro
1.10 ross 256: . if \\w\\n[.z] .ab ERROR, unclosed quotation from line \
257: \\n[quotation_line]
1.1 ross 258: . br-real \" should be unnecessary...we have fill turned off
1.54 lukem 259: . fl \" more paranoia
1.48 wiz 260: </body>
1.1 ross 261: </html>
262: . br-real
263: . fl
264: ..
265: .em end-macro
266: .de init-html
267: <html>
1.8 ross 268: <head>
269: <title>
1.35 ross 270: \\*[document-title]\\$*
1.8 ross 271: \\*[title-section]
272: </title>
1.54 lukem 273: <style type="text/css">
274: <!--
1.8 ross 275: body { margin-left:4%; }
1.35 ross 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: }
1.54 lukem 281: -->
282: </style>
1.8 ross 283: </head>
1.1 ross 284: <body \\*[body-params]>
285: \\*[dot-de] init-html
286: \\*[dot-dot]
287: ..
288: .de Lk
1.10 ross 289: . if \\n[.$]<1 .ab #\\n[.c]: Usage: .Lk href [ anchortext/punct ] ...
1.1 ross 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]
1.10 ross 303: . if !\\n[doc-ispunct] .ab #\\n[.c]: .link ... '$1' -- Huh?
1.1 ross 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]
312: ..
313: .
314: .\".de mailto
315: .\"<a href="mailto:\\$1">\\$1</a>\\$2\\$3\\$4
316: .\"..
317: .
318: .de Ht
319: \\$*
320: ..
321: .de Sh
322: . end-preformat
323: . init-html
1.59 apb 324: <h3 id="\\$*">
1.1 ross 325: \\$*
1.8 ross 326: </h3>
1.1 ross 327: ..
328: .de Ss
329: . end-preformat
330: . init-html
1.59 apb 331: <h4 id="\\$*">
1.1 ross 332: \\$*
1.8 ross 333: </h4>
1.1 ross 334: ..
335: .
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
347: ..
348: .
349: .de Pp
350: . end-preformat
351: <p>
352: ..
353: .
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]
358: ..
359: .
360: .de D1
361: . end-preformat
362: . doc-conditional-break
363:
364: . No \\$@
365: <br>
366: ..
367: .
368: .de Dl
369: . end-preformat
370: . doc-conditional-break
371:
372: . Li \\$@
373: <br>
374: ..
375: .
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]
407: ..
408: .de Ed
1.35 ross 409: . DEBUG .tm Ed
1.1 ross 410: </pre>
411: . doc-pop .Ed
412: . if \\n[Bd-literal] </code>
413: . if \\n[Bd-offset] </dl>
414: ..
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: . \}
1.55 lukem 458: . if '\\$1'-nested' \{\
459: . \" this should suffice
460: . shift
461: . continue
462: . \}
1.1 ross 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
1.54 lukem 529: . \}
1.10 ross 530: . ab Unknown .Bl list parameter \\$1 (#\\n(.c)
1.1 ross 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: . \}
1.10 ross 537: . if '\\*[list-start]'UNKNOWN' .ab \
1.1 ross 538: Unknown .Bl list type \\$1 (#\\n(.c)
539: . push-list-level start end tag-prefix pp-prefix
540: \\*[list-start]
541: ..
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: . \}
548: ..
549: .de pop-list-level
550: . nr list-level -1
551: ..
552: .de It-span
553: . end-preformat
554: . as doc-pcresult <tr><td colspan=9>
555: . recurse \\$@
556: . as doc-pcresult
557: . pc-fin
558: ..
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
565: ..
566: .de El
567: . doc-pop .El
568: \\*[list-end-\\n[list-level]]
569: . pop-list-level
570: ..
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)
1.26 kleink 575: .if "\\$1"libm68k" \&m68k Architecture Library (libm68k, -lm68k)
1.62 ! plunky 576: .if "\\$1"libbluetooth" \&Bluetooth Library (libbluetooth, -lbluetooth)
1.1 ross 577: .if "\\$1"libc" \&Standard C Library (libc, -lc)
1.22 garbled 578: .if "\\$1"libcdk" \&Curses Development Kit Library (libcdk, -lcdk)
1.1 ross 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)
1.44 wiz 583: .if "\\$1"libevent" \&Event Notification Library (libevent, -levent)
1.21 blymn 584: .if "\\$1"libform" \&Curses Form Library (libform, -lform)
1.20 itojun 585: .if "\\$1"libintl" \&Internationalized Message Handling Library (libintl, -lintl)
1.12 itojun 586: .if "\\$1"libipsec" \&IPsec Policy Control Library (libipsec, -lipsec)
1.1 ross 587: .if "\\$1"libkvm" \&Kernel Data Access Library (libkvm, -lkvm)
588: .if "\\$1"libm" \&Math Library (libm, -lm)
1.42 uebayasi 589: .if "\\$1"libmagic" \&Magic Number Recognition Library (libmagic, -lmagic)
1.13 kleink 590: .if "\\$1"libmenu" \&Curses Menu Library (libmenu, -lmenu)
1.1 ross 591: .if "\\$1"libossaudio" \&OSS Audio Emulation Library (libossaudio, -lossaudio)
1.41 wiz 592: .if "\\$1"libpcap" \&Packet Capture Library (libpcap, -lpcap)
1.27 thorpej 593: .if "\\$1"libpci" \&PCI Bus Access Library (libpci, -lpci)
1.39 thorpej 594: .if "\\$1"libpmc" \&Performance Counters Library (libpmc, -lpmc)
1.1 ross 595: .if "\\$1"libposix" \&POSIX Compatibility Library (libposix, -lposix)
1.40 thorpej 596: .if "\\$1"libpthread" \&POSIX Thread Library (libpthread, -lpthread)
1.1 ross 597: .if "\\$1"libresolv" \&DNS Resolver Library (libresolv, -lresolv)
1.40 thorpej 598: .if "\\$1"librt" \&POSIX Real-time Library (librt, -lrt)
1.1 ross 599: .if "\\$1"libtermcap" \&Termcap Access Library (libtermcap, -ltermcap)
1.33 wiz 600: .if "\\$1"libusbhid" \&USB Human Interface Devices Library (libusbhid, -lusbhid)
1.1 ross 601: .if "\\$1"libutil" \&System Utilities Library (libutil, -lutil)
602: .if "\\$1"libz" \&Compression Library (libz, -lz)
603: ..
604: .
605: .
606: .de doc-checkpunct
607: . ds doc-cp-tmp1 \\$1
608: . shift
609: . nr doc-ispunct 0
610: . while \\n[.$] \{\
611: . if \\*[doc-cp-tmp1]\\$1 .nr doc-ispunct 1
612: . shift
613: . \}
614: ..
615: .\"
616: .\" Parsed and Callable macros
617: .\"
618: .\" Internal structure: `recurse' and `mode-*-{on,off}'
619: .\"
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 )
1.10 ross 645: . if \\w\\*[doc-pcresult] \{\
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: . \}
1.1 ross 651: . if \\n[doc-dosep] .as doc-pcresult \\*[sepstring]
652: . nr doc-dosep 1
1.35 ross 653: . as doc-pcresult \\$1
1.1 ross 654: . shift
655: . continue
656: . \}
657: . \}
658: . nr r-lvl -1
659: ..
1.10 ross 660: .
661: .de resetmode
662: . ds open-mode
663: . ds close-mode
664: ..
665: .
1.1 ross 666: .de make-mode
667: \\*[dot-de] mode-\\$1-on
668: . DEBUG .tm mode-\\$1-on <\\\\$@>
669: . rn close-mode xclose-mode
1.10 ross 670: . ds open-mode \\$2
1.1 ross 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]
1.10 ross 677: . resetmode
1.1 ross 678: \\*[dot-dot]
679: ..
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: . \}
688: ..
1.10 ross 689: .
1.1 ross 690: .make-mode bold <b> </b>
691: .make-mode code <code> </code>
692: .make-mode em <em> </em>
693: .make-mode i <i> </i>
1.38 bjh21 694: .make-mode caps <font\ size="-1"> </font>
1.3 ross 695: .make-mode null \& \&
1.11 ross 696: .make-mode function <code> </code>
1.1 ross 697: .am mode-i-on
1.10 ross 698: . ds sepstring \~
1.1 ross 699: ..
700: .am mode-em-on
1.10 ross 701: . ds sepstring \~
1.1 ross 702: ..
703: .am mode-i-off
704: . ds sepstring \~
705: ..
706: .am mode-em-off
707: . ds sepstring \~
708: ..
709: .
710: .de doc-sep-append
711: . if \\n[doc-dosep] .as doc-pcresult \~
712: . as doc-pcresult \\$1
713: . nr doc-dosep 0
714: ..
715: .de No
716: . as doc-pcresult \\*[close-mode]
1.10 ross 717: . resetmode
1.1 ross 718: . recurse \\$@
719: . pc-fin
720: ..
721: .de Fl
722: .DEBUG .tm .Fl \\$*
723: . mode-bold-on
1.51 apb 724: . doc-sep-append \-
1.1 ross 725: . recurse \\$@
726: . mode-bold-off
727: . pc-fin
728: ..
729: .de Cm
730: .DEBUG .tm .Cm \\$*
731: . mode-bold-on
732: . recurse \\$@
733: . mode-bold-off
1.5 mycroft 734: . pc-fin
735: ..
1.1 ross 736: .de Op
737: .DEBUG .tm .Op \\$*
738: . as doc-pcresult \&[
739: . recurse \\$@
740: . pc-fin \&]
741: ..
742: .de Em
743: .DEBUG .tm .Em \\$*
744: . mode-em-on
745: . recurse \\$@
746: . mode-em-off
747: . pc-fin
748: ..
749: .de Fx
750: .DEBUG .tm .Fx \\$*
751: . as doc-pcresult FreeBSD
752: . recurse \\$@
1.47 wiz 753: . pc-fin
1.1 ross 754: ..
755: .de Nm
1.8 ross 756: . ds Nm-result \\*[Nm-save]
1.1 ross 757: . if \\n(.$ \{\
1.10 ross 758: . ie '\\$1'' .br-real
1.1 ross 759: . el \{\
1.8 ross 760: . ds Nm-result \\$1
761: . if '\\*[Nm-save]'' .ds Nm-save \\$1
1.1 ross 762: . shift
763: . \}
764: . \}
765: . mode-bold-on
1.8 ross 766: . as doc-pcresult \\*[Nm-result]
1.1 ross 767: . recurse \\$@
768: . mode-bold-off
769: . pc-fin
770: ..
771: .de Nd
772: .DEBUG .tm .Nd \\$*
773: - \\$*
774: ..
775: .de At
776: AT&T UNIX\\$*
777: ..
1.46 wiz 778: .de An
1.49 wiz 779: . if '\\$1'-nosplit' \{\
780: . ds an-eol
781: . shift
782: . \}
1.46 wiz 783: . recurse \\$@
1.49 wiz 784: . as doc-pcresult \\*[an-eol]
1.46 wiz 785: . pc-fin
786: ..
1.1 ross 787: .de Lk
788: . as doc-pcresult <a href="\\$1">\\$1</a>
789: . shift
790: . recurse \\$@
791: . pc-fin
792: ..
793: .de Mt
794: . as doc-pcresult <a href="mailto:\\$1">\\$1</a>
795: . shift
796: . recurse \\$@
797: . pc-fin
798: ..
799: .de Ta
800: . as doc-pcresult <td>
801: . recurse \\$@
802: . pc-fin
803: ..
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
813: ..
814: .de Nx
815: . as doc-pcresult NetBSD
816: . recurse \\$@
817: . pc-fin
818: ..
1.19 ad 819: .de Ox
820: . as doc-pcresult OpenBSD
821: . recurse \\$@
822: . pc-fin
823: ..
1.1 ross 824: .de Ux
825: . as doc-pcresult UNIX
826: . recurse \\$@
827: . pc-fin
828: ..
829: .de Ql
830: . as doc-pcresult `
831: . recurse \\$@
832: . pc-fin \&'
833: ..
834: .de Pf
835: . as doc-pcresult \\$1
836: . shift
837: . nr doc-dosep 0
838: . recurse \\$@
839: . pc-fin
840: ..
841: .de Ns
842: . nr doc-dosep 0
1.3 ross 843: . mode-null-on
1.1 ross 844: . recurse \\$@
1.3 ross 845: . mode-null-off
1.1 ross 846: . pc-fin
847: ..
848: .
1.10 ross 849: .de doc-start-quote
1.54 lukem 850: . if \\n[r-lvl]&\\n[doc-dosep] .as doc-pcresult \\*[sepstring]
851: . as doc-pcresult \\$1
852: . nr doc-dosep 0
1.10 ross 853: ..
854: .
855: .de safe-blm
856: ..
857: .
1.35 ross 858: .nr quote-level 0
1.10 ross 859: .de doc-quote-open
1.35 ross 860: . nr quote-level +1
1.10 ross 861: . blm safe-blm
1.1 ross 862: . if \\n[r-lvl]&\\n[doc-dosep] .as doc-pcresult \\*[sepstring]
863: . nr doc-dosep 0
1.35 ross 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: . \}
1.10 ross 875: ..
876: .
877: .de general-close
1.35 ross 878: . nr quote-level -1
1.10 ross 879: . if \\w\\n[.z]=0 .Error no quotation is open
880: . br-real
1.35 ross 881: . if \\n[quote-level]=0 \{\
882: . di
883: . ev
1.10 ross 884: . ev quotation_ev
885: . br-real
886: . da quotation
1.35 ross 887: . nf-real
1.10 ross 888: .
889: . di
890: . ev
1.35 ross 891: . as doc-pcresult \\$1\\*[quotation]\\
892: . blm Pp
1.10 ross 893: . \}
894: .
895: .
1.1 ross 896: ..
897: .
898: .de make-quoter
899: \\*[dot-de] \\$1o
1.35 ross 900: . doc-quote-open \\$2
1.1 ross 901: . recurse \\\\$@
902: . pc-fin
903: \\*[dot-dot]
904: \\*[dot-de] \\$1c
1.35 ross 905: . DEBUG .tm CLOSE 1,\\\\$@,
1.10 ross 906: . general-close \\$2
1.35 ross 907: . DEBUG .tm CLOSE 2,\\\\$@,\\$3,
1.10 ross 908: . recurse \\\\$@ \\$3
909: . pc-fin
1.1 ross 910: \\*[dot-dot]
911: \\*[dot-de] \\$1q
912: . doc-start-quote \\$2
913: . recurse \\\\$@
914: . pc-fin \\$3
915: \\*[dot-dot]
916: ..
1.10 ross 917: .
1.52 apb 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
1.1 ross 920: .make-quoter A < >
1.35 ross 921: .make-quoter B \&[ ]
1.52 apb 922: .make-quoter Br \&{ }
1.35 ross 923: .make-quoter D \&`` ''
924: .make-quoter P \&( )
925: .make-quoter Q \&" "
926: .make-quoter S \&` '
1.6 mycroft 927: .als Oo Bo
928: .als Oc Bc
1.10 ross 929: .de Error
930: . ab Line \\n[.c], Error: \\$*
931: ..
1.1 ross 932: .de Ft
933: . as doc-pcresult <br><br>
934: . mode-code-on
935: . recurse \\$@
936: . mode-code-off
937: . pc-fin
938: ..
939: .de Fn
940: . mode-bold-on
941: . as doc-pcresult "\\$1
942: . shift
943: . mode-bold-off
944: . as doc-pcresult (
1.10 ross 945: . mode-function-on
1.8 ross 946: . ds sepstring , \" (need the space)
1.1 ross 947: . recurse \\$@
1.11 ross 948: . as doc-pcresult \\*[close-mode])
1.35 ross 949: . resetmode
1.10 ross 950: . pc-fin
1.1 ross 951: ..
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
962: ..
963: .de Fc
964: . recurse \\$@
965: . pc-fin )
966: ..
967: .de Ar
968: . mode-i-on
969: . recurse \\$@
970: . mode-i-off
971: . pc-fin
972: ..
973: .de Ic
974: . mode-bold-on
975: . recurse \\$@
976: . mode-bold-off
977: . pc-fin
978: ..
979: .de Fa
980: . mode-code-on
981: . recurse \\$@
982: . mode-code-off
983: . pc-fin
984: ..
985: .de Xr
1.34 ross 986: . nr have-sec 0
987: . if \\$21 .nr have-sec 1
988: . if \\$22 .nr have-sec 1
989: . if \\$23 .nr have-sec 1
990: . if \\$24 .nr have-sec 1
991: . if \\$25 .nr have-sec 1
992: . if \\$26 .nr have-sec 1
993: . if \\$27 .nr have-sec 1
994: . if \\$28 .nr have-sec 1
995: . if \\$29 .nr have-sec 1
996: . ie \\n[DOC_XR]:(\\n[have-sec]=0) \{\
1.1 ross 997: . mode-code-on
1.34 ross 998: . ie \\n[have-sec]=0 .as doc-pcresult \\$1
1.10 ross 999: . el .as doc-pcresult \\$1(\\$2)
1.1 ross 1000: . mode-code-off
1001: . \}
1002: . el \{\
1.36 ross 1003: . ds Xr-tmp \\$1
1004: . if \\*[Xr-tmp]index .ds Xr-tmp xindex
1005: . as doc-pcresult <a href="\\*[DOC_MANROOT]/html\\$2/\\$1.html">
1.10 ross 1006: . ie \\w\\$2=0 .as doc-pcresult \\$1
1007: . el .as doc-pcresult \\$1(\\$2)
1008: . as doc-pcresult </a>
1.1 ross 1009: . \}
1010: . shift
1011: . shift
1012: . recurse \\$@
1013: . pc-fin
1014: ..
1015: .de Dv
1016: . mode-code-on
1017: . recurse \\$@
1018: . mode-code-off
1019: . pc-fin
1020: ..
1021: .de Ic
1022: . mode-bold-on
1023: . recurse \\$@
1024: . mode-bold-off
1025: . pc-fin
1026: ..
1027: .de Pa
1028: . mode-code-on
1029: . recurse \\$@
1030: . mode-code-off
1031: . pc-fin
1032: ..
1033: .de Tn
1034: . mode-caps-on
1035: . recurse \\$@
1036: . mode-caps-off
1037: . pc-fin
1038: ..
1039: .de Fd
1040: . as doc-pcresult <br>
1041: . mode-bold-on
1042: . recurse \\$@
1043: . mode-bold-off
1044: . pc-fin
1045: ..
1046: .de Va
1047: . mode-i-on
1048: . recurse \\$@
1049: . mode-i-off
1050: . pc-fin
1051: ..
1052: .de Li
1053: . mode-code-on
1054: . recurse \\$@
1055: . mode-code-off
1056: . pc-fin
1057: ..
1058: .de Sy
1059: . mode-bold-on
1060: . recurse \\$@
1061: . mode-bold-off
1062: . pc-fin
1063: ..
1064: .de Me
1065: . mode-bold-on
1066: . recurse \\$@
1067: . mode-bold-off
1068: . pc-fin
1069: ..
1070: .de Ev
1071: . mode-code-on
1072: . recurse \\$@
1073: . mode-code-off
1074: . pc-fin
1075: ..
1076: .de Cd
1077: . mode-bold-on
1078: . recurse \\$@
1079: . mode-bold-off
1080: . pc-fin
1081: ..
1082: .ig
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.
1085: ..
1086: .de Er
1087: . mode-code-on
1088: . recurse \\$@
1089: . mode-code-off
1090: . pc-fin
1091: ..
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
1.54 lukem 1098: .\" ANSI/ISO C
1099: . if "\\$1"-ansiC" \{\
1100: . ds std-tmp1 \&ANSI X3.159-1989
1.37 bjh21 1101: . as std-tmp1 " \"exactly one space
1.54 lukem 1102: . as std-tmp1 (``ANSI C89'')
1103: . \}
1104: . if "\\$1"-ansiC-89" \{\
1105: . ds std-tmp1 \&ANSI X3.159-1989
1.30 kleink 1106: . as std-tmp1 " \"exactly one space
1.54 lukem 1107: . as std-tmp1 (``ANSI C89'')
1108: . \}
1109: . if "\\$1"-isoC" \{\
1110: . ds std-tmp1 \&ISO/IEC 9899:1990
1.1 ross 1111: . as std-tmp1 " \"exactly one space
1.54 lukem 1112: . as std-tmp1 (``ISO C90'')
1113: . \}
1114: . if "\\$1"-isoC-90" \{\
1.18 kleink 1115: . ds std-tmp1 \&ISO/IEC 9899:1990
1116: . as std-tmp1 " \"exactly one space
1117: . as std-tmp1 (``ISO C90'')
1.54 lukem 1118: . \}
1119: . if "\\$1"-isoC-amd1" \{\
1.18 kleink 1120: . ds std-tmp1 \&ISO/IEC 9899/AMD1:1990
1121: . as std-tmp1 " \"exactly one space
1122: . as std-tmp1 (``ISO C90'')
1.54 lukem 1123: . \}
1124: . if "\\$1"-isoC-tcor1" \{\
1.18 kleink 1125: . ds std-tmp1 \&ISO/IEC 9899/TCOR1:1990
1126: . as std-tmp1 " \"exactly one space
1127: . as std-tmp1 (``ISO C90'')
1.54 lukem 1128: . \}
1129: . if "\\$1"-isoC-tcor2" \{\
1.18 kleink 1130: . ds std-tmp1 \&ISO/IEC 9899/TCOR2:1990
1131: . as std-tmp1 " \"exactly one space
1132: . as std-tmp1 (``ISO C90'')
1.54 lukem 1133: . \}
1134: . if "\\$1"-isoC-99" \{\
1.16 kleink 1135: . ds std-tmp1 \&ISO/IEC 9899:1999
1136: . as std-tmp1 " \"exactly one space
1137: . as std-tmp1 (``ISO C99'')
1.54 lukem 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: . \}
1.56 lukem 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: . \}
1.54 lukem 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: . \}
1.56 lukem 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: . \}
1.54 lukem 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: . \}
1.60 perry 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: . \}
1.54 lukem 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
1.1 ross 1213: . as std-tmp1 " \"exactly one space
1.54 lukem 1214: . as std-tmp1 (``\\*(Px.2'')
1215: . \}
1216: . if "\\$1"-p1003.2a-92" \{\
1217: . ds std-tmp1 \&IEEE Std 1003.2a-1992
1.1 ross 1218: . as std-tmp1 " \"exactly one space
1.54 lukem 1219: . as std-tmp1 (``\\*(Px.2'')
1220: . \}
1.56 lukem 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: . \}
1.54 lukem 1226: .\" X/Open
1227: . if "\\$1"-susv2" \{\
1228: . ds std-tmp1 \&Version 2 of the Single UNIX Specification
1.1 ross 1229: . as std-tmp1 " \"exactly one space
1.54 lukem 1230: . as std-tmp1 (``SUSv2'')
1231: . \}
1232: . if "\\$1"-svid4" \{\
1233: . ds std-tmp1 \&System V Interface Definition,
1.1 ross 1234: . as std-tmp1 " \"exactly one space
1.54 lukem 1235: . as std-tmp1 \&Fourth Edition
1.1 ross 1236: . as std-tmp1 " \"exactly one space
1.54 lukem 1237: . as std-tmp1 (``SVID4'')
1238: . \}
1239: . if "\\$1"-xbd5" \{\
1.11 ross 1240: . ds std-tmp1 X/Open System Interface Definitions Issue 5
1241: . as std-tmp1 " \"exactly one space
1242: . as std-tmp1 (``\\*(tNXBD5\\*(aa'')
1.54 lukem 1243: . \}
1244: . if "\\$1"-xcu5" \{\
1.11 ross 1245: . ds std-tmp1 X/Open Commands and Utilities Issue 5
1246: . as std-tmp1 " \"exactly one space
1247: . as std-tmp1 (``\\*(tNXCU5\\*(aa'')
1.54 lukem 1248: . \}
1249: . if "\\$1"-xcurses4.2" \{\
1250: . ds std-tmp1 X/Open Curses, Issue 4, Version 2
1.11 ross 1251: . as std-tmp1 " \"exactly one space
1.54 lukem 1252: . as std-tmp1 (``\\*(tNXCURSES4.2\\*(aa'')
1253: . \}
1254: . if "\\$1"-xns5" \{\
1.11 ross 1255: . ds std-tmp1 X/Open Networking Services Issue 5
1256: . as std-tmp1 " \"exactly one space
1257: . as std-tmp1 (``\\*(tNXNS5\\*(aa'')
1.54 lukem 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
1.11 ross 1271: . as std-tmp1 " \"exactly one space
1.54 lukem 1272: . as std-tmp1 (``XPG4'')
1273: . \}
1274: . if "\\$1"-xpg4.2" \{\
1275: . ds std-tmp1 X/Open Portability Guide Issue 4, Version 2
1.4 kleink 1276: . as std-tmp1 " \"exactly one space
1.54 lukem 1277: . as std-tmp1 (``XPG4.2'')
1278: . \}
1279: . if "\\$1"-xsh5" \{\
1280: . ds std-tmp1 X/Open System Interfaces and Headers Issue 5
1.4 kleink 1281: . as std-tmp1 " \"exactly one space
1.54 lukem 1282: . as std-tmp1 (``\\*(tNXSH5\\*(aa'')
1283: . \}
1284: .\" Miscellaneous
1285: . if "\\$1"-ieee754" \{\
1286: . ds std-tmp1 \&IEEE Std 754-1985
1287: . \}
1.57 lukem 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: . \}
1.54 lukem 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 \\$*
1.1 ross 1297: . shift
1298: . as doc-pcresult \~\\*[std-tmp1]\~
1299: . recurse \\$@
1300: . pc-fin
1301: . \}
1302: ..
1303: .ig
1304: I've observed that <code> does decent things with caps, and it should
1305: be reminiscent of the old typewriter-style unix logos.
1306: ..
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
1.24 lukem 1315: . if "\\$1"v1" Version 1 <code>AT&T UNIX</code>\\$2
1.1 ross 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>
1.24 lukem 1327: . if "\\$1"v1" Version 1 <code>AT&T UNIX</code>
1328: . if "\\$1"v5" Version 5 <code>AT&T UNIX</code>
1.1 ross 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: . \}
1335: ..
1336: .\"----------------------------------------------------------------------
1337: .\"
1338: .\" There must be a doc2html alias for all callable macros
1339: .\"
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
1.19 ad 1362: .als doc2html@@Ox Ox
1.1 ross 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
1.52 apb 1399: .als doc2html@@Brq Brq
1400: .als doc2html@@Bro Bro
1401: .als doc2html@@Brc Brc
1.1 ross 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
1.7 mycroft 1408: .als doc2html@@Pq Pq
1409: .als doc2html@@Po Po
1410: .als doc2html@@Pc Pc
1.1 ross 1411: .als doc2html@@Sq Sq
1412: .als doc2html@@So So
1413: .als doc2html@@Sc Sc
1.7 mycroft 1414: .als doc2html@@Oo Oo
1415: .als doc2html@@Oc Oc
1.1 ross 1416: .als doc2html@@Ta Ta
1417: .als doc2html@@Mt Mt
1418: .als doc2html@@Lk Lk
1419: .als doc2html@@No No
1.46 wiz 1420: .als doc2html@@An An
1.1 ross 1421: .
1422: .rn em doc-real-em
1423: .de em
1.10 ross 1424: . tm Hint: Should this have been .Em ...?
1425: . Error end-macro (.em) respecification is not allowed.
1.1 ross 1426: ..
1427: .
1428: .ig
1429: ----------------------------------------------------------------------
1430: ----------------------------------------------------------------------
1431: ----------------------------------------------------------------------
1432: THESE ARE THE -man (-man.old) MACRO FUNCTIONS
1433:
1434: Internal symbols relating to -man are prefixed with mo-
1435: The body-params string used with -mdoc2html is used here as well.
1436: ..
1437: .de TH
1.35 ross 1438: . init-html \\$@
1439: . nr mo-section \\$2
1.1 ross 1440: ..
1441: .de SH
1442: . end-preformat
1443: . mo-end-dl
1.59 apb 1444: <h3 id="\\$*"> \\$* </h3>
1.1 ross 1445: ..
1446: .de SS
1447: . end-preformat
1448: . mo-end-dl
1.59 apb 1449: <h4 id="\\$*"> \\$* </h4>
1.1 ross 1450: ..
1451: .de B
1452: . ie \\n(.$ <b>\&\\$*</b>
1453: . el \{\
1454: . if 1 <b>
1455: . it 1 mo-end-bold
1456: . \}
1457: ..
1458: .de I
1459: . ie \\n(.$ <i>\&\\$*</i>
1460: . el \{\
1461: . if 1 <i>
1.35 ross 1462: . it 1 mo-end-italic
1.1 ross 1463: . \}
1464: ..
1465: .de mo-end-bold
1466: </b>
1467: ..
1468: .de mo-end-italic
1469: </i>
1470: ..
1471: .de SM
1472: <font size=-1>
1473: . it 1 mo-end-smallcaps
1474: . if \\n(.$ \&\\$*
1475: ..
1476: .de mo-end-smallcaps
1.48 wiz 1477: </font>
1.1 ross 1478: ..
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: . \}
1491: ..
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: . \}
1504: ..
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: . \}
1517: ..
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: . \}
1530: ..
1531: .de CT
1.48 wiz 1532: \&<<font size=-1>CTRL/</font>\\$*>
1.1 ross 1533: ..
1534: .de DS
1535: <code><pre>
1536: ..
1537: .de DE
1.35 ross 1538: . DEBUG .tm DE
1.1 ross 1539: </pre></code>
1540: ..
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
1549: ..
1550: .de IP
1551: . mo-start-dl
1552: <dt>
1553: <b>\\$1</b>
1554: . it 1 mo-dd
1555: ..
1556: .de mo-start-dl
1557: . end-preformat
1558: . if !\\n[mo-in-dl] <dl compact>
1559: . nr mo-in-dl 1
1560: ..
1561: .de mo-dd
1562: <dd>
1563: ..
1564: .de mo-end-dl
1565: . if \\n[mo-in-dl] </dl>
1566: . nr mo-in-dl 0
1567: ..
1568: .de P
1569: . end-preformat
1570: . mo-end-dl
1571: <p>
1572: ..
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: . \}
1583: ..
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
CVSweb <webmaster@jp.NetBSD.org>