Annotation of src/share/tmac/doc, Revision 1.8
1.8 ! ross 1: .\" $NetBSD: doc,v 1.7 1998/12/26 09:40:45 ross Exp $
1.6 thorpej 2: .\"
1.3 phil 3: .\" Copyright (c) 1991, 1993
4: .\" The Regents of the University of California. All rights reserved.
1.1 cgd 5: .\"
6: .\" Redistribution and use in source and binary forms, with or without
7: .\" modification, are permitted provided that the following conditions
8: .\" are met:
9: .\" 1. Redistributions of source code must retain the above copyright
10: .\" notice, this list of conditions and the following disclaimer.
11: .\" 2. Redistributions in binary form must reproduce the above copyright
12: .\" notice, this list of conditions and the following disclaimer in the
13: .\" documentation and/or other materials provided with the distribution.
14: .\" 3. All advertising materials mentioning features or use of this software
15: .\" must display the following acknowledgement:
16: .\" This product includes software developed by the University of
17: .\" California, Berkeley and its contributors.
18: .\" 4. Neither the name of the University nor the names of its contributors
19: .\" may be used to endorse or promote products derived from this software
20: .\" without specific prior written permission.
21: .\"
22: .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23: .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24: .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25: .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26: .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27: .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28: .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30: .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31: .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32: .\" SUCH DAMAGE.
33: .\"
1.3 phil 34: .\" @(#)doc 8.1 (Berkeley) 6/8/93
1.1 cgd 35: .\"
36: .\" .mdoc-parse - attempt to parse troff request arguments
37: .\" %beginstrip%
38: .if \n(.g \{\
39: .cp 0
40: .ftr C CR
41: .\}
42: .if t \{\
43: . so /usr/share/tmac/tmac.doc-ditroff
44: .\}
45: .if n \{\
46: . so /usr/share/tmac/tmac.doc-nroff
47: .\}
48: .so /usr/share/tmac/tmac.doc-common
49: .so /usr/share/tmac/tmac.doc-syms
50: .\" NS Db macro - start/stop DEBUG MODE
51: .\" NS Db register DEBUG MODE
52: .\" NS iN register DEBUG MODE (inline if 1, to stderr if 0 (default))
53: .nr Db 0
54: .de Db
55: .ie \\n(.$==0 \{\
56: . ie \\n(Db==0 \{\
57: .tm DEBUGGING ON
58: . nr Db 1
59: . \}
60: . el \{\
61: .tm DEBUGGING OFF
62: . nr Db 0
63: . \}
64: .\}
65: .el \{\
66: . if "\\$1"on" \{\
67: .tm DEBUGGING ON
68: . nr Db 1
69: . \}
70: . if "\\$1"off" \{\
71: .tm DEBUGGING OFF
72: . nr Db 0
73: . \}
74: .\}
75: ..
76: .\" NS aV macro - parse argument vector (recursive) (.aV arg ... )
77: .\" NS fV macro - parse argument vector (recursive) (.fV)
78: .\" NS aC register argument counter (aV/fV)
79: .\" NS fV register argument counter (must set to \\n(.$ prior to reuqest) (fV)
80: .\" NS A[0-9] argument vector (aV/fV)
81: .\" NS C[0-9] reg. arg type(1=macro, 2=arg, 3=punct-suf, 4=punct-pre) (aV/fV)
82: .\" NS S[0-9] space vector (sV)
83: .\" NS aP register argument pointer (aV)
84: .\" NS yU local string used for debugging
85: .\" NS iI local register (indent for inline debug mode)
86: .\" NS mN name of calling request (set in each user requestable macro)
87: .de aV
88: .nr aC \\n(aC+1
89: .ie "\\$1"|" \{\
90: . if "\\*(mN"Op" .ds A\\n(aC \fR\\$1\fP
91: . if "\\*(mN"Ar" .ds A\\n(aC \fR\\$1\fP
92: . if "\\*(mN"Fl" .ds A\\n(aC \fR\\$1\fP
93: . if "\\*(mN"Cm" .ds A\\n(aC \fR\\$1\fP
94: . if "\\*(mN"It" .ds A\\n(aC \fR\\$1\fP
95: .\}
96: .el .ds A\\n(aC \\$1
97: .aU \\n(aC
98: .nr C\\n(aC \\n(aT
99: .s\\n(aT
100: .if \\n(Db \{\
101: . if \\n(aT==1 .ds yU Executable
102: . if \\n(aT==2 .ds yU String
103: . if \\n(aT==3 .ds yU Closing Punctuation or suffix
104: . if \\n(aT==4 .ds yU Opening Punctuation or prefix
105: . if \\n(iN==1 \{\
106: . br
107: . nr iI \\n(.iu
108: . in -\\n(iIu
109: . if \\n(aC==1 \{\
110: \&\fBDEBUG(argv) MACRO:\fP `.\\*(mN' \fBLine #:\fP \\n(.c
111: . \}
112: \&\t\fBArgc:\fP \\n(aC \fBArgv:\fP `\\*(A\\n(aC' \fBLength:\fP \\n(sW
113: \&\t\fBSpace:\fP `\\*(S\\n(aC' \fBClass:\fP \\*(yU
114: . \}
115: . if \\n(iN==0 \{\
116: . if \\n(aC==1 \{\
117: . tm DEBUG(argv) MACRO: `.\\*(mN' Line #: \\n(.c
118: . \}
119: . tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW
120: . tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU
121: . \}
122: .\}
123: .ie \\n(.$==1 \{\
124: . nr aP 0
125: . ie \\n(dZ==1 \{\
126: . if \\n(oM>1 .as b1 \\*(S0
127: . \}
128: . el \{\
129: . if \\n(oM>0 \{\
130: . if \\n(fC==0 .as b1 \\*(S0
131: . \}
132: . \}
133: . ds S0 \\*(S\\n(aC
134: . if \\n(Db \{\
135: . if \\n(iN==1 \{\
136: \&MACRO REQUEST: \t.\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
137: . br
138: . in \\n(iIu
139: . \}
140: . if \\n(iN==0 \{\
141: .tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
142: . \}
143: . \}
144: .\}
145: .el .aV \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
146: ..
147: .de fV
148: .nr aC \\n(aC+1
149: .if "\\*(A\\n(aC"|" \{\
150: . if "\\*(mN"Op" .ds A\\n(aC \fR\\*(A\\n(aC\fP
151: . if "\\*(mN"Ar" .ds A\\n(aC \fR\\*(A\\n(aC\fP
152: . if "\\*(mN"Fl" .ds A\\n(aC \fR\&\\*(A\\n(aC\fP
153: . if "\\*(mN"Cm" .ds A\\n(aC \fR\\*(A\\n(aC\fP
154: . if "\\*(mN"It" .ds A\\n(aC \fR\\*(A\\n(aC\fP
155: .\}
156: .aU \\n(aC
157: .nr C\\n(aC \\n(aT
158: .s\\n(aT
159: .if \\n(Db \{\
160: . if \\n(aT==1 .ds yU Executable
161: . if \\n(aT==2 .ds yU String
162: . if \\n(aT==3 .ds yU Closing Punctuation or suffix
163: . if \\n(aT==4 .ds yU Opening Punctuation or prefix
164: . if \\n(iN==1 \{\
165: . br
166: . nr iI \\n(.iu
167: . in -\\n(iIu
168: . if \\n(aC==1 \{\
169: \&\fBDEBUG(fargv) MACRO:\fP `.\\*(mN' \fBLine #:\fP \\n(.c
170: . \}
171: \&\t\fBArgc:\fP \\n(aC \fBArgv:\fP `\\*(A\\n(aC' \fBLength:\fP \\n(sW
172: \&\t\fBSpace:\fP `\\*(S\\n(aC' \fBClass:\fP \\*(yU
173: . \}
174: . if \\n(iN==0 \{\
175: . if \\n(aC==1 \{\
176: . tm DEBUG(fargv) MACRO: `.\\*(mN' Line #: \\n(.c
177: . \}
178: . tm \tArgc: \\n(aC Argv: `\\*(A\\n(aC' Length: \\n(sW
179: . tm \tSpace: `\\*(S\\n(aC' Class: \\*(yU
180: . \}
181: .\}
182: .ie \\n(fV==1 \{\
183: . nr aP 0
184: . ie \\n(dZ==1 \{\
185: . if \\n(oM>1 .as b1 \\*(S0
186: . \}
187: . el \{\
188: . if \\n(oM>0 \{\
189: . if \\n(fC==0 .as b1 \\*(S0
190: . \}
191: . \}
192: . ds S0 \\*(S\\n(aC
193: . nr fV 0
194: . if \\n(Db \{\
195: . ie \\n(iN \{\
196: \&\tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
197: . br
198: . in \\n(iIu
199: . \}
200: . el \{\
201: .tm \tMACRO REQUEST: .\\*(mN \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
202: . \}
203: . \}
204: .\}
205: .el \{\
206: . nr fV \\n(fV-1
207: . fV
208: .\}
209: ..
210: .\" NS aX macro - stuff saved strings into `b1' (used by -diag list)
211: .de aX
212: .nr aP \\n(aP+1
213: .as b1 \&\\*(A\\n(aP
214: .ie \\n(fV==1 \{\
215: . nr aP 0
216: . nr fV 0
217: .\}
218: .el \{\
219: . as b1 \&\\*(sV
220: . nr fV \\n(fV-1
221: . aX
222: .\}
223: ..
224: .\" NS aI macro - append arg to arg vector: .aI [arg] [type] (used by .En only)
225: .de aI
226: .ie \\n(aC<9 \{\
227: . nr aC \\n(aC+1
228: . ds A\\n(aC \\$1
229: . nr C\\n(aC \\$2
230: . s\\$2
231: . ds xV S\\n(aC
232: .\}
233: .el \{\
234: . tm Usage: Too many arguments (maximum of 8 accepted) (#\\n(.c)
235: . tm \\*(A1 \\*(A2 \\*(A3 \\*(A4 \\*(A5 \\*(A6 \\*(A7 \\*(A8 \\*(A9
236: .\}
237: ..
238: .\"
239: .\" NS aZ macro - print buffer (pB) and clean up arg vectors (aY)
240: .de aZ
241: .pB
242: .aY
243: ..
244: .\" NS aY macro - clean up arg vector
245: .de aY
246: .rm C0 C1 C2 C3 C4 C5 C6 C7 C8 C9
247: .rm A0 A1 A2 A3 A4 A5 A6 A7 A8 A9
248: .rm S1 S2 S3 S4 S5 S6 S7 S8 S9
249: .nr aC 0
250: .nr aP 0
251: ..
252: .\" NS pB macro - test for end of vector (eol) (print b1 buffer or divert)
253: .de pB
254: .ie \\n(dZ==1 \{\
255: . if \\n(oM==1 \{\&\\*(b1
256: . rm S0
257: . ds b1
258: . \}
259: . if \\n(oM==0 \{\
260: . x2
261: . \}
262: .\}
263: .el \{\
264: . ie \\n(oM==0 \{\&\\*(b1
265: . rm S0
266: . ds b1
267: . \}
268: . el \{\
269: . if ((\\n(sM==1)&(\\n(tP==0)) \{\
270: . x1
271: . \}
272: . \}
273: .\}
274: .hy
275: ..
276: .\" NS x1 macro - save buffer and divert if tP flag set
277: .\" NS eB diversion string
278: .\" NS b2 string save of buffer
279: .\" NS lK register count of lines read from input file
280: .de x1
281: .nr dZ \\n(dZ+1
282: .ds b2 \\*(b1
283: .ds b1
284: .nr lK \\n(.c
285: .ev 2
286: .fi
1.8 ! ross 287: .if \\n(Db .tm BEGIN eB DIVERSION AT #\\n(.c
1.1 cgd 288: .di eB
289: ..
290: .\"
291: .\" NS x2 macro - end diversion and print
292: .\" NS b0 string local temporary
293: .de x2
294: .br
295: .di
296: .ev
297: .ie (\\n(.c-\\n(lK>1) \{\
298: . ds b0 \&\\*(eB\\
299: . ds b1 \\*(b2\\*(b0\\*(b1
300: .\}
301: .el .ds b1 \\*(b2\\*(b1
302: \&\\*(b1
303: .rm eB b2 b0 b1
304: .nr dZ \\n(dZ-1
305: ..
306: .\" NS Fl macro - flags (appends - and prints flags)
307: .\" NS cF register save current font
308: .\" NS cZ register save current font size
309: .de Fl
310: .as b1 \&\\*(fL
311: .if \\n(aC==0 \{\
312: . ie \\n(.$==0 \{\
313: . as b1 \&\|\-\|\fP\s0
314: . pB
315: . \}
316: . el \{\
317: . ds mN Fl
318: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
319: . \}
320: .\}
321: .if \\n(aC>0 \{\
322: . ie (\\n(aC-\\n(aP)==0 \{\
323: . as b1 \&\|\-\fP\s0
324: . aZ
325: . \}
326: . el \{\
327: . nr aP \\n(aP+1
328: . ie \\n(C\\n(aP==1 \{\
329: . as b1 \&\|\-\fP\s0
330: . \\*(A\\n(aP
331: . \}
332: . el \{\
333: . nr cF \\n(.f
334: . nr cZ \\n(.s
335: . if \\n(C\\n(aP==3 \{\
336: . as b1 \&\|\-\|
337: . \}
338: . fR
339: . \}
340: . \}
341: .\}
342: ..
343: .\"
344: .\" NS fR macro - Fl flag recursion routine (special handling)
345: .\" NS jM local register
346: .\" NS jN local register
347: .\"
348: .de fR
349: .hy 0
350: .nr jM \\n(C\\n(aP
351: .ie \\n(jM==1 \{\
352: . as b1 \&\fP\s0
353: . \\*(A\\n(aP
354: .\}
355: .el \{\
356: . nr jN \\n(aP
357: . ie \\n(jM==2 \{\
358: . ie !"\\*(A\\n(aP"\\*(Ba" \{\
359: . ie !"\\*(A\\n(aP"\fR|\fP" \{\
360: . ie "\\*(A\\n(aP"-" .as b1 \&\|\-\^\-\|
361: . el .as b1 \&\|\-\\*(A\\n(aP
362: . \}
363: . el .as b1 \&\\*(A\\n(aP
364: . \}
365: . el .as b1 \&\\*(A\\n(aP
366: . \}
367: . el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
368: . ie \\n(aC==\\n(aP \{\
369: . if \\n(jM==4 .as b1 \&\|\-
370: . as b1 \&\fP\s0
371: . aZ
372: . \}
373: . el \{\
374: . nr aP \\n(aP+1
375: . ie ((\\n(C\\n(aP==3)&(\\n(C\\n(jN==4)) .as b1 \&\|\-
376: . el .as b1 \&\\*(S\\n(jN
377: . fR \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
378: . \}
379: .\}
380: .rr jM jN
381: ..
382: .\"
383: .\" NS nR macro - general name recursion routine
384: .\" NS jM local register
385: .\" NS jN local register
386: .de nR
387: .hy 0
388: .nr jM \\n(C\\n(aP
389: .ie \\n(jM==1 \{\
390: . as b1 \&\f\\n(cF\s\\n(cZ
391: . \\*(A\\n(aP
392: .\}
393: .el \{\
394: . nr jN \\n(aP
395: . ie \\n(jM==2 .as b1 \&\\*(A\\n(aP
396: . el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
397: . ie \\n(aC==\\n(aP \{\
398: . as b1 \&\f\\n(cF\s\\n(cZ
399: . aZ
400: . \}
401: . el \{\
402: . nr aP \\n(aP+1
403: . as b1 \&\\*(S\\n(jN
404: . nR
405: . \}
406: .\}
407: .rr jM jN
408: ..
409: .\" NS Ar macro - command line `argument' macro
410: .\"
411: .de Ar
412: .as b1 \\*(aR
413: .if \\n(aC==0 \{\
414: . ie \\n(.$==0 \{\
415: . as b1 file\ ...\fP\s0
416: . pB
417: . \}
418: . el \{\
419: . ds mN Ar
420: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
421: . \}
422: .\}
423: .if \\n(aC>0 \{\
424: . ie (\\n(aC-\\n(aP)==0 \{\
425: . as b1 \&file\ ...\fP\s0
426: . aZ
427: . \}
428: . el \{\
429: . nr aP \\n(aP+1
430: . ie \\n(C\\n(aP==1 \{\
431: . as b1 \&file\ ...\fP\s0
432: . \\*(A\\n(aP
433: . \}
434: . el \{\
435: . nr cF \\n(.f
436: . nr cZ \\n(.s
437: . if \\n(C\\n(aP==3 \{\
438: . as b1 \&file\ ...
439: . \}
440: . nR
441: . \}
442: . \}
443: .\}
444: ..
445: .\" NS Ad macro - Addresses
446: .de Ad
447: .if \\n(aC==0 \{\
448: . ie \\n(.$==0 .tm Usage: .Ad address ... \\*(Pu (#\\n(.c)
449: . el \{\
450: . ds mN Ad
451: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
452: . \}
453: .\}
454: .if \\n(aC>\\n(aP \{\
455: . as b1 \\*(aD
456: . nr aP \\n(aP+1
457: . nr cF \\n(.f
458: . nr cZ \\n(.s
459: . nR
460: .\}
461: ..
462: .\" NS Cd macro - Config declaration (for section 4 SYNOPSIS) (not callable)
463: .\" needs work - not very translatable
464: .de Cd
465: .if \\n(aC==0 \{\
466: . ie \\n(.$==0 .tm Usage: .Cd Configuration file declaration (#\\n(.c)
467: . el \{\
468: . ds mN Cd
469: . ds A1 \\$1
470: . ds A2 \\$2
471: . ds A3 \\$3
472: . ds A4 \\$4
473: . ds A5 \\$5
474: . ds A6 \\$6
475: . ds A7 \\$7
476: . ds A8 \\$8
477: . ds A9 \\$9
478: . nr fV \\n(.$
479: . fV
480: . \}
481: .\}
482: .br
483: .if \\n(aC>\\n(aP \{\
484: . as b1 \\*(nM
485: . nr aP \\n(aP+1
486: . nr cF \\n(.f
487: . nr cZ \\n(.s
488: . ie \\n(nS \{\
489: . if "\\*(mN"Cd" \{\
490: . rs
491: . ie \\n(nS>1 .br
492: . el \{\
493: . if \\n(iS==0 .nr iS \\n(Dsu
494: . \}
495: . in +\\n(iSu
496: . ti -\\n(iSu
497: . nr nS \\n(nS+1
498: . \}
499: . nR
500: . in -\\n(iSu
501: . \}
502: . el .nR
503: .\}
504: ..
505: .\" NS Cm macro - Interactive command modifier (flag)
506: .de Cm
507: .if \\n(aC==0 \{\
508: . ie \\n(.$==0 .tm Usage: .Cm Interactive command modifier ... \\*(Pu (#\\n(.c)
509: . el \{\
510: . ds mN Cm
511: . ds A1 \\$1
512: . ds A2 \\$2
513: . ds A3 \\$3
514: . ds A4 \\$4
515: . ds A5 \\$5
516: . ds A6 \\$6
517: . ds A7 \\$7
518: . ds A8 \\$8
519: . ds A9 \\$9
520: . nr fV \\n(.$
521: . fV
522: . \}
523: .\}
524: .if \\n(aC>\\n(aP \{\
525: . as b1 \\*(cM
526: . nr aP \\n(aP+1
527: . nr cF \\n(.f
528: . nr cZ \\n(.s
529: . nR
530: .\}
531: ..
532: .\" NS Dv macro - define variable
533: .de Dv
534: .if \\n(aC==0 \{\
535: . ie \\n(.$==0 .tm Usage: .Dv define_variable ... \\*(Pu (#\\n(.c)
536: . el \{\
537: . ds mN Dv
538: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
539: . \}
540: .\}
541: .if \\n(aC>\\n(aP \{\
542: . as b1 \\*(eR
543: . nr aP \\n(aP+1
544: . nr cF \\n(.f
545: . nr cZ \\n(.s
546: . nR
547: .\}
548: ..
549: .\" NS Em macro - Emphasis
550: .de Em
551: .if \\n(aC==0 \{\
552: . ie \\n(.$==0 \{\
553: . tm Usage: .Em text ... \\*(Pu (#\\n(.c)
554: . \}
555: . el \{\
556: . ds mN Em
557: . ds A1 \\$1
558: . ds A2 \\$2
559: . ds A3 \\$3
560: . ds A4 \\$4
561: . ds A5 \\$5
562: . ds A6 \\$6
563: . ds A7 \\$7
564: . ds A8 \\$8
565: . ds A9 \\$9
566: . nr fV \\n(.$
567: . fV
568: . \}
569: .\}
570: .if \\n(aC>\\n(aP \{\
571: . as b1 \\*(eM
572: . nr aP \\n(aP+1
573: . nr cF \\n(.f
574: . nr cZ \\n(.s
575: . nR
576: .\}
577: ..
578: .\" NS Er macro - Errnotype
579: .de Er
580: .if \\n(aC==0 \{\
581: . ie \\n(.$==0 .tm Usage: .Er ERRNOTYPE ... \\*(Pu (#\\n(.c)
582: . el \{\
583: . ds mN Er
584: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
585: . \}
586: .\}
587: .if \\n(aC>\\n(aP \{\
588: . as b1 \\*(eR
589: . nr aP \\n(aP+1
590: . nr cF \\n(.f
591: . nr cZ \\n(.s
592: . nR
593: .\}
594: ..
595: .\" NS Ev macro - Environment variable
596: .de Ev
597: .if \\n(aC==0 \{\
598: . ie \\n(.$==0 .tm Usage: .Ev ENVIRONMENT_VARIABLE ... \\*(Pu (#\\n(.c)
599: . el \{\
600: . ds mN Ev
601: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
602: . \}
603: .\}
604: .if \\n(aC>\\n(aP \{\
605: . as b1 \\*(eV
606: . nr aP \\n(aP+1
607: . nr cF \\n(.f
608: . nr cZ \\n(.s
609: . nR
610: .\}
611: ..
612: .\" NS Fd macro - function declaration - not callable (& no err check)
613: .\" NS fD register subroutine test (in synopsis only)
614: .\" NS fY register subroutine count (in synopsis only) (fortran only)
615: .\" NS fZ register also subroutine count (in synopsis only)
1.8 ! ross 616: .de Fd-In-common
1.1 cgd 617: .ds mN Fd
618: .if \\n(nS>0 \{\
619: .\" if a variable type was the last thing given, want vertical space
620: . if \\n(fX>0 \{\
621: . Pp
622: . nr fX 0
623: . \}
624: .\" if a subroutine was the last thing given, want vertical space
625: . if \\n(fZ>0 \{\
626: . ie \\n(fD==0 \{\
627: . Pp
628: . rs
629: . \}
630: . el .br
631: . \}
632: . nr fD \\n(fD+1
633: .\}
634: .nr cF \\n(.f
635: .nr cZ \\n(.s
1.8 ! ross 636: ..
! 637: .de Fd
! 638: .Fd-In-common
1.1 cgd 639: \&\\*(fD\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
640: .br
641: .ft \\n(cF
642: .fs \\n(cZ
643: ..
1.8 ! ross 644: .de In
! 645: .Fd-In-common
! 646: \&\\*(fD#include <\\$1>
! 647: .br
! 648: .ft \\n(cF
! 649: .fs \\n(cZ
! 650: ..
1.1 cgd 651: .\" NS Fr macro - function return value - not callable (at the moment)
652: .de Fr
653: .if \\n(aC==0 \{\
654: . ie \\n(.$==0 .tm Usage: .Fr Function_return_value... \\*(Pu (#\\n(.c)
655: . el \{\
656: . ds mN Fr
657: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
658: . \}
659: .\}
660: .if \\n(aC>\\n(aP \{\
661: . as b1 \\*(aR
662: . nr aP \\n(aP+1
663: . nr cF \\n(.f
664: . nr cZ \\n(.s
665: . nR
666: .\}
667: ..
668: .\" NS Ic macro - Interactive command
669: .de Ic
670: .if \\n(aC==0 \{\
671: . ie \\n(.$==0 .tm Usage: .Ic Interactive command ... \\*(Pu (#\\n(.c)
672: . el \{\
673: . ds mN Ic
674: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
675: . \}
676: .\}
677: .if \\n(aC>\\n(aP \{\
678: . as b1 \\*(iC
679: . nr aP \\n(aP+1
680: . nr cF \\n(.f
681: . nr cZ \\n(.s
682: . nR
683: .\}
684: ..
685: .\" NS Li macro - literals
686: .de Li
687: .if \\n(aC==0 \{\
688: . ie \\n(.$==0 .tm Usage .Li argument ... \\*(Pu (#\\n(.c)
689: . el \{\
690: . ds mN Li
691: . ds A1 \\$1
692: . ds A2 \\$2
693: . ds A3 \\$3
694: . ds A4 \\$4
695: . ds A5 \\$5
696: . ds A6 \\$6
697: . ds A7 \\$7
698: . ds A8 \\$8
699: . ds A9 \\$9
700: . nr fV \\n(.$
701: . fV
702: . \}
703: .\}
704: .if \\n(aC>\\n(aP \{\
705: . as b1 \\*(lI
706: . nr aP \\n(aP+1
707: . nr cF \\n(.f
708: . nr cZ \\n(.s
709: . nR
710: .\}
711: ..
712: .\" NS Or macro - Pipe symbol (OR)
713: .de Or
714: .if \\n(aC==0 \{\
715: . ie \\n(.$==0 .tm Usage: .Or ... \\*(Pu (#\\n(.c)
716: . el \{\
717: . ds mN Or
718: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
719: . \}
720: .\}
721: .if \\n(aC>\\n(aP \{\
722: . as b1 \\*(iC
723: . nr aP \\n(aP+1
724: . nr cF \\n(.f
725: . nr cZ \\n(.s
726: . nR
727: .\}
728: ..
729: .\" NS Ms macro - Math symbol
730: .de Ms
731: .if \\n(aC==0 \{\
732: . ie \\n(.$==0 .tm Usage: .Ms Math symbol ... \\*(Pu (#\\n(.c)
733: . el \{\
734: . ds mN Ms
735: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
736: . \}
737: .\}
738: .if \\n(aC>\\n(aP \{\
739: . as b1 \\*(sY
740: . nr aP \\n(aP+1
741: . nr cF \\n(.f
742: . nr cZ \\n(.s
743: . nR
744: .\}
745: ..
746: .\" NS Nm macro - Name of command or page topic
747: .\" NS n1 string - save first invocation of .Nm
748: .\" NS iS register - indent second command line in a synopsis
749: .de Nm
750: .if \\n(aC==0 \{\
751: . ie \\n(.$==0 \{\
752: . ie "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu (#\\n(.c)
753: . el \&\\*(nM\\*(n1\fP\s0
754: . \}
755: . el \{\
756: . ds mN Nm
1.4 lukem 757: . ie "\\$1"" .ds A1 \\*(n1
758: . el .ds A1 \\$1
759: . ds A2 \\$2
760: . ds A3 \\$3
761: . ds A4 \\$4
762: . ds A5 \\$5
763: . ds A6 \\$6
764: . ds A7 \\$7
765: . ds A8 \\$8
766: . ds A9 \\$9
767: . nr fV \\n(.$
768: . fV
769: . \}
1.1 cgd 770: .\}
771: .if \\n(aC>0 \{\
772: . ie \\n(aC==\\n(aP \{\
773: . as b1 \&\\*(nM\\*(n1\fP\s0
774: . aZ
775: . \}
776: . el \{\
777: . as b1 \\*(nM
778: . nr aP \\n(aP+1
779: . ie \\n(C\\n(aP==1 \{\
780: . as b1 \&\\*(n1\fP\s0
781: . \\*(A\\n(aP
782: . \}
783: . el \{\
784: . nr cF \\n(.f
785: . nr cZ \\n(.s
786: . if \\n(nS \{\
787: . if "\\*(mN"Nm" \{\
788: . rs
789: . in -\\n(iSu
790: . ie \\n(nS>1 .br
791: . el \{\
792: . if \\n(iS==0 \{\
793: . sw \\$1
794: . nr iS ((\\n(sWu+1)*\\n(fW)u
795: . \}
796: . \}
797: . in +\\n(iSu
798: . ti -\\n(iSu
799: . nr nS \\n(nS+1
800: . \}
801: . \}
802: . if "\\*(n1"" .ds n1 \\*(A\\n(aP
803: . nR
804: . \}
805: . \}
806: .\}
807: ..
808: .\" NS Pa macro - Pathname
809: .de Pa
810: .if \\n(aC==0 \{\
811: . ie \\n(.$==0 \&\\*(pA~\fP\s0
812: . el \{\
813: . ds mN Pa
814: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
815: . \}
816: .\}
817: .if \\n(aC>\\n(aP \{\
818: . as b1 \\*(pA
819: . nr aP \\n(aP+1
820: . nr cF \\n(.f
821: . nr cZ \\n(.s
822: . nR
823: .\}
824: ..
825: .\" NS Sy macro - Symbolics
826: .de Sy
827: .if \\n(aC==0 \{\
828: . ie \\n(.$==0 .tm Usage: .Sy symbolic_text ... \\*(Pu (#\\n(.c)
829: . el \{\
830: . ds mN Sy
831: . ds A1 \\$1
832: . ds A2 \\$2
833: . ds A3 \\$3
834: . ds A4 \\$4
835: . ds A5 \\$5
836: . ds A6 \\$6
837: . ds A7 \\$7
838: . ds A8 \\$8
839: . ds A9 \\$9
840: . nr fV \\n(.$
841: . fV
842: . \}
843: .\}
844: .if \\n(aC>\\n(aP \{\
845: . as b1 \\*(sY
846: . nr aP \\n(aP+1
847: . nr cF \\n(.f
848: . nr cZ \\n(.s
849: . nR
850: .\}
851: ..
1.8 ! ross 852: .\" NS Me macro - Menu Entries
! 853: .de Me
! 854: .if \\n(aC==0 \{\
! 855: . ie \\n(.$==0 .tm Usage: .Me menu entry ... \\*(Pu (#\\n(.c)
! 856: . el \{\
! 857: . ds mN Sy
! 858: . ds A1 \\$1
! 859: . ds A2 \\$2
! 860: . ds A3 \\$3
! 861: . ds A4 \\$4
! 862: . ds A5 \\$5
! 863: . ds A6 \\$6
! 864: . ds A7 \\$7
! 865: . ds A8 \\$8
! 866: . ds A9 \\$9
! 867: . nr fV \\n(.$
! 868: . fV
! 869: . \}
! 870: .\}
! 871: .if \\n(aC>\\n(aP \{\
! 872: . as b1 \\*(sY
! 873: . nr aP \\n(aP+1
! 874: . nr cF \\n(.f
! 875: . nr cZ \\n(.s
! 876: . nR
! 877: .\}
! 878: ..
1.1 cgd 879: .\" NS Tn macro - Trade Name Macro
880: .de Tn
881: .if \\n(aC==0 \{\
882: . ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c)
883: . el \{\
884: . ds mN Tn
885: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
886: . \}
887: .\}
888: .if \\n(aC>\\n(aP \{\
889: . as b1 \\*(tN\\*(tF
890: . nr aP \\n(aP+1
891: . nr cF \\n(.f
892: . nr cZ \\n(.s
893: . nR
894: .\}
895: ..
896: .\" NS nN macro - Trade Name Macro for inside of reference
897: .de nN
898: .if \\n(aC==0 \{\
899: . ie \\n(.$==0 .tm Usage: .Tn Trade_name(s) ... \\*(Pu (#\\n(.c)
900: . el \{\
901: . ds mN Tn
902: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
903: . \}
904: .\}
905: .if \\n(aC>\\n(aP \{\
906: . as b1 \\*(tN
907: . nr aP \\n(aP+1
908: . nr cF \\n(.f
909: . nr cZ \\n(.s
910: . rR
911: .\}
912: ..
913: .\" NS Va macro - variable name macro
914: .de Va
915: .if \\n(aC==0 \{\
916: . ie \\n(.$==0 .tm Usage: .Va variable_name(s) ... \\*(Pu (#\\n(.c)
917: . el \{\
918: . ds mN Va
919: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
920: . \}
921: .\}
922: .if \\n(aC>\\n(aP \{\
923: . as b1 \\*(vA
924: . nr aP \\n(aP+1
925: . nr cF \\n(.f
926: . nr cZ \\n(.s
927: . nR
928: .\}
929: ..
930: .\"
931: .\" NS No macro - Normal text macro (default text style if mess up)
932: .de No
933: .as b1 \\*(nO
934: .if \\n(aC==0 \{\
935: . ie \\n(.$==0 .tm Usage: .No must be called with arguments (#\\n(.c)
936: . el \{\
937: . ds mN No
938: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
939: . \}
940: .\}
941: .if \\n(aC>\\n(aP \{\
942: . nr aP \\n(aP+1
943: . ie \\n(C\\n(aP==1 \{\
944: . \\*(A\\n(aP
945: . \}
946: . el \{\
947: . nr cF \\n(.f
948: . nr cZ \\n(.s
949: . nR
950: . \}
951: .\}
952: ..
953: .\"------------------------------------------------------------------------
954: .\" NS Op macro - Option Expression
955: .de Op
956: .if \\n(aC==0 \{\
957: . ds mN Op
958: .\}
959: .\" .ds qL \&\\*(lO
960: .\" .ds qR \&\\*(rO
961: .ds qL \&\\*(lB
962: .ds qR \&\\*(rB
963: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
964: ..
965: .\" NS Aq macro - Enclose string in angle brackets
966: .de Aq
967: .if \\n(aC==0 .ds mN Aq
968: .ds qL \&<
969: .ds qR \&>
970: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
971: ..
972: .\" NS Bq macro - Enclose string in square brackets
973: .de Bq
974: .if \\n(aC==0 .ds mN Bq
975: .ds qL \&\\*(lB
976: .ds qR \&\\*(rB
977: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
978: ..
979: .\" NS Dq macro - Enclose string in double quotes
980: .de Dq
981: .if \\n(aC==0 .ds mN Dq
982: .ds qL \&\\*(Lq
983: .ds qR \&\\*(Rq
984: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
985: ..
986: .\" NS Eq macro - Enclose string in double quotes
987: .de Eq
988: .if \\n(aC==0 .ds mN Eq
989: .ds qL \\$1
990: .ds qR \\$2
991: .En \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
992: ..
993: .\" NS Pq macro - Enclose string in parenthesis
994: .de Pq
995: .if \\n(aC==0 .ds mN Pq
996: .ds qL \&\\*(lP
997: .ds qR \&\\*(rP
998: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
999: ..
1000: .\" NS Ql macro - Quoted literal is in file mdoc-[dit|n|g]roff (too large
1001: .\" an if-else to carry along recursively for `if n ...')
1002: .\"
1003: .\" NS Sq macro - Enclose string in single quotes
1004: .de Qq
1005: .if \\n(aC==0 .ds mN Qq
1006: .ds qL \&\\*q
1007: .ds qR \&\\*q
1008: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1009: ..
1010: .\" NS Sq macro - Enclose string in single quotes
1011: .de Sq
1012: .if \\n(aC==0 .ds mN Sq
1013: .ds qL \&\\*(sL
1014: .ds qR \&\\*(sR
1015: .En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1016: ..
1017: .\"
1018: .\" NS Es macro - Set up strings for .En call
1019: .de Es
1020: .if \\n(aC==0 \{\
1021: . ie \\n(.$>2 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1022: . el \{\
1023: . ds qL \\$1
1024: . ds qR \\$2
1025: . \}
1026: .\}
1027: .if \\n(aC>\\n(aP \{\
1028: . nr aP \\n(aP+1
1029: . ds qL \\*(A\\n(aP
1030: . nr aP \\n(aP+1
1031: . ds qR \\*(A\\n(aP
1032: . ie \\n(aC>\\n(aP .c\\n(C\\n(aP
1033: . el .aZ
1034: .\}
1035: ..
1036: .\" .tm En beg arg(A[\\n(aP])==\\*(A\\n(aP;
1037: .\" .tm En oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
1038: .\" NS En macro - Enclose string with given args (eg [ and ] etc)
1039: .\" NS qL string variable set by calling macro
1040: .\" NS qR string variable set by calling macro
1041: .\" NS aJ register (for vR)
1042: .de En
1043: .ie \\n(aC==0 \{\
1044: . ie \\n(.$==0 \{\
1045: . as b1 \&\\*(qL\\*(qR
1046: . pB
1047: . \}
1048: . el \{\
1049: .\". as mN (En)
1050: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1051: . as b1 \&\\*(qL
1052: . \}
1053: .\}
1054: .el \{\
1055: . as b1 \&\\*(qL
1056: .\}
1057: .if \\n(aC>0 \{\
1058: . ie (\\n(aC-\\n(aP)==0 \{\
1059: . as b1 \&\\*(qR
1060: . aZ
1061: . \}
1062: . el \{\
1063: . ie \\n(C\\n(aC==3 \{\
1064: . nr aJ \\n(aC-1
1065: . vR
1066: . nr aJ \\n(aJ+1
1067: . ds A\\n(aJ \&\\*(qR\\*(A\\n(aJ
1068: . nr aJ 0
1069: . \}
1070: . el .aI \&\\*(qR 3
1071: . nr aP \\n(aP+1
1072: . if \\n(C\\n(aP==1 .\\*(A\\n(aP
1073: . if \\n(C\\n(aP>1 \{\
1074: . nr aP \\n(aP-1
1075: . No
1076: . \}
1077: . \}
1078: .\}
1079: ..
1080: .\" NS vR macro - vector routine (for En, trace backwards past trail punct)
1081: .de vR
1082: .if \\n(C\\n(aJ==3 \{\
1083: . nr aJ \\n(aJ-1
1084: . vR
1085: .\}
1086: ..
1087: .\"------------------------------------------------------------------------
1088: .\" NS Ao macro - Angle open
1089: .de Ao
1090: .if \\n(aC==0 .ds mN Ao
1091: .ds qL \&<
1092: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1093: ..
1094: .\" NS Ac macro - Angle close
1095: .de Ac
1096: .if \\n(aC==0 .ds mN Ac
1097: .ds qR \&>
1098: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1099: ..
1100: .\" NS Bo macro - Bracket open
1101: .de Bo
1102: .if \\n(aC==0 .ds mN Bo
1103: .ds qL \&[
1104: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1105: ..
1106: .\" NS Bc macro - Bracket close
1107: .de Bc
1108: .if \\n(aC==0 .ds mN Bc
1109: .ds qR \&]
1110: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1111: ..
1112: .\" NS Do macro - Double Quote open
1113: .de Do
1114: .if \\n(aC==0 .ds mN Do
1115: .ds qL \&\\*(Lq
1116: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1117: ..
1118: .\" NS Dc macro - Double Quote close
1119: .de Dc
1120: .if \\n(aC==0 .ds mN Dc
1121: .ds qR \&\\*(Rq
1122: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1123: ..
1124: .\" NS Eo macro - Enclose open
1125: .de Eo
1126: .if \\n(aC==0 .ds mN Eo
1127: .ds qL \\$1
1128: .eO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1129: ..
1130: .\" NS Ec macro - Enclose close
1131: .de Ec
1132: .if \\n(aC==0 .ds mN Ec
1133: .ds qR \\$1
1134: .eC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1135: ..
1136: .\" NS Oo macro - Option open
1137: .de Oo
1138: .if \\n(aC==0 .ds mN Oo
1139: .ds qL \&[
1140: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1141: ..
1142: .\" NS Oc macro - Option close
1143: .de Oc
1144: .if \\n(aC==0 .ds mN Oc
1145: .ds qR \&]
1146: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1147: ..
1148: .\" NS Po macro - Parenthesis open
1149: .de Po
1150: .if \\n(aC==0 .ds mN Po
1151: .ds qL \&(
1152: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1153: ..
1154: .\" NS Pc macro - Parenthesis close
1155: .de Pc
1156: .if \\n(aC==0 .ds mN Pc
1157: .ds qR \&)
1158: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1159: ..
1160: .\" NS Qo macro - Straight Double Quote open
1161: .de Qo
1162: .if \\n(aC==0 .ds mN Qo
1163: .ds qL \&\\*q
1164: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1165: ..
1166: .\" NS Qc macro - Straight Double Quote close
1167: .de Qc
1168: .if \\n(aC==0 .ds mN Qc
1169: .ds qR \&\\*q
1170: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1171: ..
1172: .\" NS So macro - Single Quote open
1173: .de So
1174: .if \\n(aC==0 .ds mN So
1175: .ds qL \&\\*(sL
1176: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1177: ..
1178: .\" NS Sc macro - Single Quote close
1179: .de Sc
1180: .if \\n(aC==0 .ds mN Sc
1181: .ds qR \&\\*(sR
1182: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1183: ..
1184: .\" NS Xo macro - Extend open (continue)
1185: .de Xo
1186: .if \\n(aC==0 .ds mN Xo
1187: .\" .nr mN 1
1188: .ds qL
1189: .eO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1190: ..
1191: .\" NS Xe macro - Extend close (end)
1192: .de Xc
1193: .\" .nr mN 0
1194: .if \\n(aC==0 .ds mN Xc
1195: .ds qR
1196: .eC \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1197: ..
1198: .\" NS eO macro - enclose string open
1199: .\" NS oM register (extension possible)
1200: .de eO
1201: .nr oM \\n(oM+1
1202: .\" .tm eO last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
1203: .ie \\n(aC==0 \{\
1204: . ie \\n(.$>0 \{\
1205: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1206: . as b1 \\*(qL
1207: . \}
1208: . el \{\
1209: . as b1 \\*(qL
1210: . if (\\n(dZ==0)&(\\n(sM==1) \{\
1211: . nr dZ \\n(dZ+1
1212: . ds b2 \\*(b1
1213: . ds b1
1214: . nr lK \\n(.c
1215: . ev 2
1216: . fi
1.8 ! ross 1217: . if \\n(Db .tm BEGIN eB DIVERSION AT #\\n(.c
1.1 cgd 1218: . di eB
1219: . \}
1220: . \}
1221: .\}
1222: .el \{\
1223: . as b1 \\*(qL
1224: .\}
1225: .ie \\n(aC>0 \{\
1226: . if \\n(aC>\\n(aP \{\
1227: . nr aP \\n(aP+1
1228: . ie \\n(C\\n(aP==1 .\\*(A\\n(aP
1229: . el \{\
1230: . nr aP \\n(aP-1
1231: . No
1232: . \}
1233: . \}
1234: . if \\n(aC==\\n(aP \{\
1235: . if \\n(tP==1 \{\
1236: .\" .tm SETTING Xt!!!
1237: . nr Xt 1
1238: . \}
1239: .\".\" . ds S0
1240: .\"CHANGED ds S0 \\*(iV
1241: . aY
1242: . \}
1243: .\}
1244: .el \{\
1245: . if \\n(oM>1 .as b1 \\*(sV
1246: .\}
1247: ..
1248: .\"
1249: .\" NS eC macro - enclose string close
1250: .\" NS aa local register
1251: .de eC
1252: .nr oM \\n(oM-1
1253: .\" tm eC last arg==A[\\n(aC]==\\*(A\\n(aC; aP==\\n(aP; oM==\\n(oM; dZ==\\n(dZ;
1254: .as b1 \\*(qR
1255: .if \\n(aC==0 \{\
1256: . ie \\n(.$>0 \{\
1257: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1258: . \}
1259: . el \{\
1260: . ie "\\*(xB"" \{\
1261: . pB
1262: . \}
1263: . el \{\
1264: . pB
1265: .\\*(L\\n(lC
1266: . nr Xt 0
1267: . ds xB
1268: . \}
1269: . \}
1270: .\}
1271: .if \\n(aC>0 \{\
1272: . ie \\n(aC==\\n(aP \{\
1273: . ie \\n(oM==0 \{\
1274: . aZ
1275: . \}
1276: . el .aY
1277: . \}
1278: . el \{\
1279: . nr aa \\n(aP+1
1280: . if \\n(C\\n(aa==2 .as b1 \\*(S\\n(aC
1281: .\" tm CURRENT arg (aP==\\*(A\\n(aP and ap+1==\\*(A\\n(aa) tP==\\n(tP Xt==\\n(Xt
1282: . rr aa
1283: . if \\n(tP>0 \{\
1284: .\" tm UNSETTING Xt==\\n(Xt!!!!
1285: . if \\n(Xt>0 .nr Xt \\n(Xt-1
1286: .\" tm NOW Xt==\\n(Xt!!!!
1287: . \}
1288: . No
1289: . \}
1290: .\}
1291: ..
1292: .\"------------------------------------------------------------------------
1293: .\" NS Pf macro - Prefix (calls .pF)
1294: .de Pf
1295: .if \\n(aC==0 .ds mN Pf
1296: .ds qL \&\\$1
1297: .pF \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1298: ..
1299: .\" NS pF macro - Prefix (for prefixing open quotes, brackets etc)
1300: .de pF
1301: .ie \\n(aC==0 \{\
1302: . as b1 \&\\*(qL
1303: . ie \\n(.$<2 \{\
1304: . tm Warning: Missing arguments - prefix .Pf)
1305: . pB
1306: . \}
1307: . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1308: .\}
1309: .el \{\
1310: . ie (\\n(aC-\\n(aP)>1 \{\
1311: . nr aP \\n(aP+1
1312: . as b1 \&\\*(A\\n(aP
1313: . \}
1314: . el .tm Warning: .Pf: trailing prefix (#\\n(.c)
1315: .\}
1316: .if \\n(aC>0 \{\
1317: . ie (\\n(aC-\\n(aP)==0 .aZ
1318: . el \{\
1319: . nr aP \\n(aP+1
1320: . c\\n(C\\n(aP
1321: . \}
1322: .\}
1323: ..
1324: .\" NS Ns macro - remove space (space remove done by .aV or .fV)
1325: .de Ns
1326: .if \\n(aC==0 \{\
1327: . ds mN Ns
1328: . ie \\n(.$>0 .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1329: . el .tm Usage: .Ns must be called with arguments (#\\n(.c)
1330: .\}
1331: .No
1332: ..
1333: .de Ap
1334: .if \\n(aC==0 \{\
1335: . ds mN Ap
1336: . tm Usage: Ap "cannot be first request on a line (no .Ap)" (#\\n(.c)
1337: .\}
1338: .as b1 \&'
1339: .No
1340: ..
1341: .\" NS Hv macro - Hard (unpaddable) Space vector
1342: .\" NS iV string inter-vector space
1343: .\" NS sV string inter-argument space
1344: .de Hv
1345: .ds iV \\*(sV
1346: .ds sV \\*(hV
1347: ..
1348: .\" NS Sv macro - Soft Space vector (troff limitation)
1349: .de Sv
1350: .ds sV \\*(iV
1351: ..
1352: .\" NS Tv macro - Tab Space vector
1353: .de Tv
1354: .ds sV \\*(tV
1355: ..
1356: .\" NS Sm macro - Space mode
1357: .\" NS sM register - default is one (space mode on)
1358: .nr sM 1
1359: .de Sm
1360: .if \\n(aC==0 \{\
1361: . ie \\n(.$==0 .tm "Usage: .Sm [off | on]" (#\\n(.c)
1362: . el \{\
1363: . ds mN Sm
1364: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1365: . \}
1366: .\}
1367: .if \\n(aC>0 \{\
1368: . nr aP \\n(aP+1
1369: . if "\\*(A\\n(aP"on" \{\
1370: . ds sV \\*(iV
1371: . nr sM 1
1372: . \}
1373: . if "\\*(A\\n(aP"off" \{\
1374: . ds sV
1375: . rm S0 S1 S2 S3 S4 S5 S6 S7 S8 S9
1376: . nr sM 0
1377: . \}
1378: . ie \\n(aC>\\n(aP \{\
1379: . No
1380: . \}
1381: . el .aY
1382: .\}
1383: ..
1384: .\"------------------------------------------------------------------------
1385: .\" Size and Argument type macros
1386: .\" NS aT macro - argument type
1387: .\" NS aU macro - argument type (same as .aT but uses A[1-9] strings
1388: .\" NS aT register argument type
1389: .if \n(.g \{\
1390: .de aT
1391: .nr aT 0
1392: .ie \\n(sW>2:(\A'\\$1'==0) \{\
1393: . nr aT 2
1394: .\}
1395: .el \{\
1396: . if \\n(sW==1 \{\
1397: . ie \\n(z\\$1>2 \{\
1398: . nr aT \\n(z\\$1
1399: . \}
1400: . el .nr aT 2
1401: . \}
1402: . if \\n(sW==2 \{\
1403: . ie \\n(\\$1 \{\
1404: . nr aT 1
1405: . \}
1406: . el .nr aT 2
1407: . \}
1408: .\}
1409: ..
1410: .de aU
1411: .nr aT 0
1412: .aW \\$1
1413: .ie \\n(sW>2:(\A'\\*(A\\$1'==0) .nr aT 2
1414: .el \{\
1415: . if \\n(sW==1 \{\
1416: . ie \\n(z\\*(A\\$1>2 \{\
1417: . nr aT \\n(z\\*(A\\$1
1418: . \}
1419: . el .nr aT 2
1420: . \}
1421: . if \\n(sW==2 \{\
1422: . ie (\\n(\\*(A\\$1) \{\
1423: . nr aT 1
1424: . \}
1425: . el .nr aT 2
1426: . \}
1427: .\}
1428: ..
1429: .\}
1430: .if !\n(.g \{\
1431: .de aT
1432: .nr aT 0
1433: .ie \\n(sW>2 \{\
1434: . nr aT 2
1435: .\}
1436: .el \{\
1437: . if \\n(sW==1 \{\
1438: . ie \\n(z\\$1>2 \{\
1439: . nr aT \\n(z\\$1
1440: . \}
1441: . el .nr aT 2
1442: . \}
1443: . if \\n(sW==2 \{\
1444: . ie \\n(\\$1 \{\
1445: . nr aT 1
1446: . \}
1447: . el .nr aT 2
1448: . \}
1449: .\}
1450: ..
1451: .de aU
1452: .nr aT 0
1453: .aW \\$1
1454: .ie \\n(sW>2 .nr aT 2
1455: .el \{\
1456: . if \\n(sW==1 \{\
1457: . ie \\n(z\\*(A\\$1>2 \{\
1458: . nr aT \\n(z\\*(A\\$1
1459: . \}
1460: . el .nr aT 2
1461: . \}
1462: . if \\n(sW==2 \{\
1463: . ie (\\n(\\*(A\\$1) \{\
1464: . nr aT 1
1465: . \}
1466: . el .nr aT 2
1467: . \}
1468: .\}
1469: ..
1470: .\}
1471: .\" NS s1 macro - set spacing for class type 1
1472: .\" NS s2 macro - set spacing for class type 2
1473: .\" NS s3 macro - set spacing for class type 3
1474: .\" NS s1 macro - set spacing for class type 1
1475: .\" NS s2 macro - set spacing for class type 2
1476: .\" NS s3 macro - set spacing for class type 3
1477: .\" NS s4 macro - set spacing for class type 4
1478: .\" NS S[0-9] string spacing
1479: .\" NS xX local register
1480: .\" NS aa local register
1481: .de s0
1482: .tm MDOC-ERROR: bogus type 0 (can't set space '\\*(A\\n(aC') (#\\n(.c)
1483: ..
1484: .de s1
1485: .if \\n(\\*(A\\n(aC==3 \{\
1486: . nr xX \\n(aC-1
1487: . rm S\\n(xX
1488: . ds S\\n(aC \\*(sV
1489: .\}
1490: .if \\n(\\*(A\\n(aC==2 \{\
1491: . nr xX \\n(aC-1
1492: .\" this kludge can probably go away, but need to double check first
1493: . ie "\\*(A\\n(aC"Nb" .ds S\\n(xX \\*(hV
1494: . el .rm S\\n(xX
1495: .\}
1496: ..
1497: .de s2
1498: .ds S\\n(aC \\*(sV
1499: ..
1500: .de s3
1501: .if \\n(aC>1 \{\
1502: . nr xX \\n(aC-1
1503: . rm S\\n(xX
1504: .\}
1505: .ds S\\n(aC \\*(sV
1506: ..
1507: .de s4
1508: .nr aa 0
1509: ..
1510: .\" Class switches (on current argument aP)
1511: .\" NS c0 macro - catch errors (non-existent class type 0)
1512: .\" NS c1 macro - call request if type 1
1513: .\" NS c2 macro - call .No if type 2
1514: .\" NS c3 macro - call .No if type 3
1515: .\" NS c4 macro - call .No if type 4
1516: .de c0
1517: .tm MDOC-ERROR: bogus class 0 (can't determine '\\*(A\\n(aC') (#\\n(.c)
1518: ..
1519: .de c1
1520: .\\*(A\\n(aP
1521: ..
1522: .de c2
1523: .nr aP \\n(aP-1
1524: .No
1525: ..
1526: .de c3
1527: .nr aP \\n(aP-1
1528: .No
1529: ..
1530: .de c4
1531: .nr aP \\n(aP-1
1532: .No
1533: ..
1534: .\" NS y1 macro - ignore if class 1
1535: .\" NS y2 macro - ignore if class 2
1536: .\" NS y3 macro - append if type 3
1537: .\" NS y4 macro - append if type 4
1538: .de y1
1539: .nr aa 1
1540: ..
1541: .de y2
1542: .nr aa 1
1543: ..
1544: .de y3
1545: .as b1 \\*(A\\n(aP
1546: .nr aP \\n(aP+1
1547: .n\\C\\n(aP
1548: ..
1549: .de y4
1550: .as b1 \\*(A\\n(aP
1551: .nr aP \\n(aP+1
1552: .n\\C\\n(aP
1553: ..
1554: .\"--------------------------------------------------------------------------
1555: .\" Ns Bf macro - Begin Font Mode (will be begin-mode/end-mode in groff & TeX)
1556: .\" Ns Ef macro - End Font Mode
1557: .de Bf
1558: .ds mN Bf
1559: .ie \\n(.$>0 \{\
1560: . nr bF \\n(.f
1561: . nr bZ \\n(.s
1562: . if "\\$1"Em" \&\\*(eM\c
1563: . if "\\$1"Li" \&\\*(lI\c
1564: . if "\\$1"Sy" \&\\*(sY\c
1565: . if "\\$1"-emphasis" \&\\*(eM\c
1566: . if "\\$1"-literal" \&\\*(lI\c
1567: . if "\\$1"-symbolic" \&\\*(sY\c
1568: .\}
1569: .el .tm Usage .Bf [Em | emphasis | Li | literal | Sy | symbolic] (#\\n(.c)
1570: ..
1571: .de Ef
1572: .ds mN Ef
1573: .ie \\n(.$>0 .tm Usage .Ef (does not take arguments) (#\\n(.c)
1574: .el \&\f\\n(bF\s\\n(bZ
1575: ..
1576: .\" Ns Bk macro - Begin Keep
1577: .\" Ns Ek macro - End Keep
1578: .\" Ns kS string - keep type
1579: .de Bk
1580: .ds mN Bk
1581: .ie \\n(.$==0 \{\
1582: .tm Usage: .Bk [-lines | -words] (#\\n(.c)
1583: .\}
1584: .el \{\
1585: . if !"\\*(kS"" .tm .Bk: nesting keeps not implemented yet. (#\\n(.c)
1586: . if "\\$1"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c)
1587: . if "\\$1"-words" .Hv
1588: . ds kS \\$1
1589: .\}
1590: ..
1591: .de Ek
1592: .ds mN Ek
1593: .ie \\n(.$>0 .tm Usage .Ek (does not take arguments) (#\\n(.c)
1594: .el \{\
1595: . if "\\*(kS"-lines" .tm .Bd -lines: Not implemented yet. (#\\n(.c)
1596: . if "\\*(kS"-words" .Sv
1597: . rm kS
1598: .\}
1599: ..
1600: .\" NS Bd macro - Begin Display display-type [offset string]
1601: .\" NS Ed macro - end Display
1602: .\" NS O[0-9] registers - stack of indent
1603: .\" NS d[0-9] registers - display-type stack
1604: .de Bd
1605: .ds mN Bd
1606: .ie \\n(.$==0 \{\
1607: .tm Usage: .Bd [-literal | -filled | -ragged | -unfilled] [-offset [string]] [-compact] (#\\n(.c)
1608: .\}
1609: .el \{\
1610: . ds aa
1611: . nr bV 0
1612: . nr iD 0
1613: . nr dP \\n(dP+1
1614: . if "\\$1"-literal" \{\
1615: . nr iD \\n(iD+1
1616: . ds d\\n(dP dL
1617: . nr cF \\n(.f
1618: . nr cZ \\n(.s
1619: . ie t \{\&\\*(lI
1620: ' ta 9n 18n 27n 36n 45n 54n 63n 72n
1621: . \}
1622: . el \{\
1623: ' ta 8n 16n 24n 32n 40n 48n 56n 64n 72n
1624: . \}
1625: . nf
1626: . \}
1627: . if "\\$1"-filled" \{\
1628: . nr iD \\n(iD+1
1629: . ds d\\n(dP dF
1630: . br
1631: . \}
1632: . if "\\$1"-ragged" \{\
1633: . nr iD \\n(iD+1
1634: . ds d\\n(dP dR
1635: . na
1636: . \}
1637: . if "\\$1"-unfilled" \{\
1638: . nr iD \\n(iD+1
1639: . ds d\\n(dP dU
1640: . nf
1641: . \}
1642: .\" .tm Here is argc: \\n(.$ and here is iD \\n(iD
1643: . if ((\\n(iD>=1)&(\\n(.$>\\n(iD)) \{\
1644: . bV \\$2 \\$3 \\$4
1645: . \}
1646: . if \\n(O\\n(dP>0 'in \\n(.iu+\\n(O\\n(dPu
1647: . if (\\n(bV==0) \{\
1648: . if (\\n(nS==0) \{\
1649: . ie "\\*(d\\n(dP"dR" .sp \\n(dVu
1650: . el 'sp \\n(dVu
1651: . \}
1652: . \}
1653: . if \\n(cR==0 .ne 2v
1654: . nr bV 0
1655: . nr iD 0
1656: .\}
1657: ..
1658: .\" NS bV macro - resolve remaining .Bd arguments
1659: .de bV
1660: .\" .tm in bV with args: \\$1 \\$2 \\$3
1661: .nr iD 1
1662: .ds bY
1663: .if "\\$1"-offset" \{\
1664: . ds bY \\$2
1665: . if "\\*(bY"left" \{\
1666: . nr iD \\n(iD+1
1667: . nr O\\n(dP 0
1668: . \}
1669: . if "\\*(bY"right" \{\
1670: . nr iD \\n(iD+1
1671: . nr O\\n(dP (\\n(.l/3)u
1672: . \}
1673: . if "\\*(bY"center" \{\
1674: . nr iD \\n(iD+1
1675: . nr O\\n(dP (\\n(.l-\\n(.i)/4u
1676: . \}
1677: . if "\\*(bY"indent" \{\
1678: . nr iD \\n(iD+1
1679: . nr O\\n(dP \\n(dIu
1680: . \}
1681: . if "\\*(bY"indent-two" \{\
1682: . nr iD \\n(iD+1
1683: . nr O\\n(dP \\n(dIu+\\n(dIu
1684: . \}
1685: . if \\n(iD==1 \{\
1686: . nr iD \\n(iD+1
1687: . sW "\\*(bY"
1688: . ie \\n(sW>2 \{\
1689: . ie ((\\*(bY>9n)&(\\*(bY<100n)) \{\
1690: . nr O\\n(dP \\*(bY
1691: . \}
1692: . el .nr O\\n(dP (\\n(sW)*\\n(fWu
1693: . \}
1694: . el \{\
1695: . if \\n(sW==2 .aT \\*(bY
1696: . ie \\n(aT==1 \{\
1697: . nr O\\n(dP \\n(\\*(bY
1698: . \}
1699: . el .nr O\\n(dP \\*(bY
1700: . \}
1701: . \}
1702: .\}
1703: .if "\\$1"-compact" \{\
1704: . nr bV 1
1705: .\}
1706: .if \\n(iD<\\n(.$ \{\
1707: . ie "\\*(bY"" \{\
1708: . bV \\$2 \\$3
1709: . \}
1710: . el \{\
1711: . bV \\$3
1712: . \}
1713: .\}
1714: ..
1715: .\" NS Ed macro - end display
1716: .de Ed
1717: .ds mN Ed
1718: .br
1.8 ! ross 1719: .if \\n(dP==0 .tm mdoc: Extraneous .Ed (#\\n[.c])
1.1 cgd 1720: .if "\\*(d\\n(dP"dL" \{\
1721: . ft \\n(cF
1722: . fz \\n(cZ
1723: .\}
1724: .in \\n(.iu-\\n(O\\n(dPu
1725: .rr O\\n(dP
1726: .rm d\\n(dP
1727: .nr dP \\n(dP-1
1728: .fi
1729: .if t .ad
1730: ..
1731: .\"--------------------------------------------------------------------------
1732: .\" NS Bl macro - begin list (.Bl list-type)
1733: .\" NS L[0-9] registers - stack of list types
1734: .de Bl
1735: .ie \\n(.$==0 \{\
1.5 lukem 1736: .tm Usage: .Bl [[-hang | -tag] [-width]] [ -item | -enum | -bullet | -dash | -hyphen | -diag] [-column](#\\n(.c)
1.1 cgd 1737: .\}
1738: .el \{\
1739: . ds mN Bl
1740: . nr aP 0
1741: . nr lC \\n(lC+1
1742: . ds A1 \\$2
1743: . ds A2 \\$3
1744: . ds A3 \\$4
1745: . ds A4 \\$5
1746: . ds A5 \\$6
1747: . ds A6 \\$7
1748: . ds A7 \\$8
1749: . ds A8 \\$9
1750: . nr fV \\n(.$-1
1751: . if "\\$1"-hang" \{\
1752: . nr aP \\n(aP+1
1753: . ds L\\n(lC hL
1754: . nr w\\n(lC 6n
1755: . nr tC 1
1756: . \}
1757: . if "\\$1"-tag" \{\
1758: . nr aP \\n(aP+1
1759: . ds L\\n(lC tL
1760: . nr tC 1
1761: . \}
1762: . if "\\$1"-item" \{\
1763: . nr aP \\n(aP+1
1764: . ds L\\n(lC iT
1765: . nr tC 1
1766: . \}
1767: . if "\\$1"-enum" \{\
1768: . nr aP \\n(aP+1
1769: . ds L\\n(lC nU
1770: . nr w\\n(lC 3n
1771: . nr tC 1
1772: . \}
1773: . if "\\$1"-bullet" \{\
1774: . nr aP \\n(aP+1
1775: . ds L\\n(lC bU
1776: . nr w\\n(lC 2n
1777: . nr tC 1
1778: . \}
1779: . if "\\$1"-dash" \{\
1780: . nr aP \\n(aP+1
1781: . ds L\\n(lC hU
1782: . nr w\\n(lC 2n
1783: . nr tC 1
1784: . \}
1785: . if "\\$1"-hyphen" \{\
1786: . nr aP \\n(aP+1
1787: . ds L\\n(lC hU
1788: . nr w\\n(lC 2n
1789: . nr tC 1
1790: . \}
1791: . if "\\$1"-inset" \{\
1792: . nr aP \\n(aP+1
1793: . ds L\\n(lC lL
1794: . nr tC 1
1795: . \}
1796: . if "\\$1"-diag" \{\
1797: . nr aP \\n(aP+1
1798: . ds L\\n(lC mL
1799: . nr mL 1
1800: . \}
1801: . if "\\$1"-ohang" \{\
1802: . nr aP \\n(aP+1
1803: . ds L\\n(lC oL
1804: . nr tC 1
1805: . \}
1806: . if "\\$1"-column" \{\
1807: . nr aP \\n(aP+1
1808: . ds L\\n(lC cL
1809: . \}
1810: . ie \\n(aP==0 \{\
1811: . tm \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
1812: . tm Usage: .Bl [[-inset|-tag] -width] [-item|-enum|-bullet|-diag] (#\\n(.c)
1813: . \}
1814: . el \{\
1815: . tY
1816: . if (\\n(aP==1)&(\\n(aP<\\n(.$) \{\
1817: . nr aP 0
1818: . lV
1819: . if "\\*(L\\n(lC"cL" \{\
1820: . W\\n(wV
1821: . nr w\\n(lC 0
1822: ' in -\\n(eWu
1823: . ie \\n(v\\n(lC==1 \{\
1824: . nr aa 0
1825: . \}
1826: . el \{\
1827: . sp \\n(dVu
1828: . \}
1829: . nf
1830: . nr wV 0
1831: . \}
1832: . \}
1833: . \}
1834: . nr aP 0
1835: .\" . ds b1
1836: . aY
1837: .\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
1838: .\}
1839: ..
1840: .if \n(.g \{\
1841: . nr i 10
1842: . while \ni<100 \{\
1843: . nr num!\nin 1
1844: . nr i +1
1845: . \}
1846: .\}
1847: .\" NS lV macro - resolve remaining .Bl arguments
1848: .de lV
1849: .nr aP \\n(aP+1
1850: .if \\n(fV>=\\n(aP \{\
1851: . nr iD 0
1852: . if "\\*(A\\n(aP"-compact" \{\
1853: . nr iD 1
1854: . nr v\\n(lC 1
1855: . \}
1856: . if "\\*(A\\n(aP"-width" \{\
1857: . nr iD 1
1858: . nr aP \\n(aP+1
1859: . nr tW 1
1860: . ds t\\n(lC TagwidtH
1861: . ds tS \\*(A\\n(aP
1862: . aW \\n(aP
1863: . ie \\n(sW>2 \{\
1864: . nr w\\n(lC (\\n(sW)*\\n(fWu
1865: . if \\n(sW==3 \{\
1866: . ie \\n(.g \{\
1867: . if \A'\\*(tS' .if r num!\\*(tS \{\
1868: . nr w\\n(lC \\*(tS
1869: . \}
1870: . \}
1871: . el \{\
1872: . if (\\*(tS>9n)&(\\*(tS<99n) \{\
1873: . nr w\\n(lC \\*(tSu
1874: . \}
1875: . \}
1876: . \}
1877: . \}
1878: . el \{\
1879: . aT \\*(tS
1880: . ie \\n(aT==1 \{\
1881: . nr w\\n(lC \\n(\\*(tS
1882: . \}
1883: . el \{\
1884: . nr w\\n(lC \\*(tSu
1885: . \}
1886: . \}
1887: . \}
1888: . if "\\*(A\\n(aP"-offset" \{\
1889: . nr iD 1
1890: . nr aP \\n(aP+1
1891: . ie "\\*(A\\n(aP"indent" \{\
1892: . nr o\\n(lC \\n(Dsu
1893: . \}
1894: . el \{\
1895: . ds tS \\*(A\\n(aP
1896: . aW \\n(aP
1897: . ie \\n(sW>2 \{\
1898: . nr o\\n(lC (\\n(sW)*\\n(fWu
1899: . ie \\n(.g \{\
1900: . if \A'\\*(tS' .if r num!\\*(tS \{\
1901: . nr o\\n(lC \\*(tS
1902: . \}
1903: . \}
1904: . el \{\
1905: . if (\\*(tS>9n)&(\\*(tS<100n) \{\
1906: . nr o\\n(lC \\*(tS
1907: . \}
1908: . \}
1909: . \}
1910: . el \{\
1911: . ie \\n(C\\n(aP==1 .nr o\\n(lC \\n(\\*(tS
1912: . el .nr o\\n(lC \\*(tS
1913: . \}
1914: . \}
1915: . \}
1916: . if \\n(iD==0 \{\
1917: . if "\\*(L\\n(lC"cL" \{\
1918: . nr wV \\n(wV+1
1919: . ds A\\n(wV \\*(A\\n(aP
1920: . \}
1921: . \}
1922: . if \\n(fV>\\n(aP .lV
1923: .\}
1924: ..
1925: .\" NS El macro - end list
1926: .\" NS iD local register
1927: .de El
1928: .ie \\n(.$>0 \{\
1929: . tm Usage: .El (#\\n(.c)
1930: .\}
1931: .el \{\
1932: . ds mN El
1933: . nr iD 0
1934: . if "\\*(L\\n(lC"cL" \{\
1935: . nr iD 1
1936: . cC
1937: . \}
1938: . if "\\*(L\\n(lC"nU" \{\
1939: . nr nU 0
1940: . \}
1941: . if \\n(mL>0 \{\
1942: . nr iD 1
1943: . nr mL 0
1944: . tZ
1945: . nr lC \\n(lC-1
1946: . tY
1947: . \}
1948: . if "\\*(L\\n(lC"iT" \{\
1949: ' in \\n(.iu-\\n(o\\n(lCu
1950: . tZ
1951: . nr lC \\n(lC-1
1952: . tY
1953: . nr iD 1
1954: . \}
1955: . if "\\*(L\\n(lC"oL" \{\
1956: ' in \\n(.iu-\\n(o\\n(lCu
1957: . tZ
1958: . nr lC \\n(lC-1
1959: . tY
1960: . nr iD 1
1961: . \}
1962: . if "\\*(L\\n(lC"lL" \{\
1963: ' in \\n(.iu-\\n(o\\n(lCu
1964: . tZ
1965: . nr lC \\n(lC-1
1966: . tY
1967: . nr iD 1
1968: . \}
1969: . if \\n(iD==0 \{\
1970: . lE
1971: . \}
1972: . br
1973: . nr iD 0
1974: .\}
1975: ..
1976: .\" NS It macro - list item
1977: .\" NS iD local register
1978: .\" NS aA save pA font string for section FILES (no underline if nroff)
1979: .de It
1980: .if "\\*(L\\n(lC"" \{\
1981: . tm Usage .Bl -list-type [-width [string] | -compact | -offset [string]] (#\\n(.c)
1982: . tm .It \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
1983: .\}
1984: .\" .tm Here is L[\\n(lC]==\\*(L\\n(lC
1985: .ne 3v
1986: .ie \\n(.$>0 \{\
1987: . ds mN It
1988: . ds b1
1989: . nr iD 0
1990: . ds A1 \\$1
1991: . ds A2 \\$2
1992: . ds A3 \\$3
1993: . ds A4 \\$4
1994: . ds A5 \\$5
1995: . ds A6 \\$6
1996: . ds A7 \\$7
1997: . ds A8 \\$8
1998: . ds A9 \\$9
1999: . nr fV \\n(.$
2000: . if "\\*(L\\n(lC"mL" \{\
2001: . nr iD 1
2002: . nr aP 0
2003: . aX
2004: . \\*(L\\n(lC
2005: . \}
2006: . if "\\*(L\\n(lC"cL" \{\
2007: . ds b1
2008: . nr aP 0
2009: . nr iD 1
2010: . \\*(L\\n(lC
2011: . \}
2012: . if "\\*(L\\n(lC"iT" \{\
2013: . nr aP 0
2014: . nr iD 1
2015: . \\*(L\\n(lC
2016: . \}
2017: . if \\n(iD==0 \{\
2018: . fV
2019: .\" tm ------------------------------------------------------------------------
2020: .\" tm It list-type==\\*(L\\n(lC, aP==\\n(aP
2021: .\" tm It beg arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
2022: . nr oM \\n(oM+1
2023: . nr tP 1
2024: . nr aP \\n(aP+1
2025: . nr tX \\n(C\\n(aP
2026: . ds tX \\*(A\\n(aP
2027: . if \\n(nF==1 \{\
2028: . ds aA \\*(pA
2029: . if n .ds pA \\*(nO
2030: . \}
2031: . ie \\n(C\\n(aP==1 \{\
2032: . \\*(A\\n(aP
2033: . \}
2034: . el \{\
2035: . nr aP \\n(aP-1
2036: . No
2037: . \}
2038: .\" tm in It here is b1==\\*(b1
2039: .\" tm It mid arg(A[1])==\\*(A1; oM==\\n(oM; dZ==\\n(dZ; Xt==\\n(Xt; aC==\\n(aC
2040: . ie \\n(Xt==1 .ds xB \&\\*(L\\n(lC
2041: . el .\\*(L\\n(lC
2042: . \}
2043: . nr iD 0
2044: .\}
2045: .el .\\*(L\\n(lC
2046: ..
2047: .\" NS lL macro - .It item of list-type inset
2048: .de lL
2049: .lY
2050: .br
2051: \&\\*(b1
2052: .nr oM \\n(oM-1
2053: .nr tP 0
2054: .ds b1
2055: .aY
2056: 'fi
2057: ..
2058: .\" NS hL macro - .It item of list-type hanging label (as opposed to tagged)
2059: .de hL
2060: .lX
2061: .nr bb \\n(w\\n(lCu+\\n(lSu
2062: .ti -\\n(bbu
2063: .ie \w\\*(b1u>=(\\n(w\\n(lCu) \&\\*(b1
2064: .el \&\\*(b1\h'|\\n(bbu'\c
2065: .nr oM \\n(oM-1
2066: .ds b1
2067: .nr tP 0
2068: .aY
2069: 'fi
2070: ..
2071: .\" NS oL macro - .It item of list-type overhanging label
2072: .de oL
2073: .lY
2074: \&\\*(b1
2075: .br
2076: .nr oM \\n(oM-1
2077: .ds b1
2078: .nr tP 0
2079: .aY
2080: 'fi
2081: ..
2082: .\" NS iT macro - .It item of list-type [empty label]
2083: .de iT
2084: .lY
2085: .br
2086: .\" .ds b1
2087: .aY
2088: 'fi
2089: ..
2090: .\" NS nU macro - Enumerated list
2091: .\" NS nU register count
2092: .\" NS hU macro - Hyphen paragraph list (sub bullet list)
2093: .\" NS bU macro - Bullet paragraph list
2094: .de nU
2095: .nr oM \\n(oM+1
2096: .nr nU \\n(nU+1
2097: .ds b1 \&\\n(nU.
2098: .uL
2099: ..
2100: .de bU
2101: .nr oM \\n(oM+1
2102: .nr bU \\n(bU+1
2103: .ds b1 \&\\*(sY\&\(bu\fP
2104: .uL
2105: ..
2106: .de hU
2107: .nr oM \\n(oM+1
2108: .nr bU \\n(bU+1
2109: .ds b1 \&\\*(sY\&\-\fP
2110: .uL
2111: ..
2112: .\" NS uL macro - .It item of list-type enum/bullet/hyphen
2113: .de uL
2114: .lX
2115: .nr bb \\n(w\\n(lCu+\\n(lSu
2116: .ti -\\n(bbu
2117: .ie \w\\*(b1u>=(\\n(w\\n(lCu) \&\\*(b1
2118: .el \&\\*(b1\h'|\\n(bbu'\c
2119: .nr oM \\n(oM-1
2120: .\" .nr dZ \\n(dZ+1
2121: .ds b1
2122: .nr tP 0
2123: .aY
2124: 'fi
2125: ..
2126: .\" NS mL macro - .It item of list-type diagnostic-message
2127: .de mL
2128: .nr cF \\n(.f
2129: .nr cZ \\n(.s
2130: .ie \\n(mL==1 \{\
2131: . nr zB \\n(.c
2132: . ie (\\n(zB-\\n(zA)>1 .Pp
2133: . el .br
2134: . nr zA \\n(zB
2135: . nr zB 0
2136: .\}
2137: .el \{\
2138: . nr zA \\n(.c
2139: . br
2140: .\}
2141: \&\\*(sY\\*(b1\f\\n(cF\s\\n(cZ\\*(lS\c
2142: .aY
2143: .ds b1
2144: 'fi
2145: ..
2146: .\" NS tL macro - .It item of list-type "tag"
2147: .de tL
2148: .\" tm in tL here is b1==\\*(b1
2149: .if \\n(tW==0 .lW
2150: .lX
2151: .nr bb \\n(w\\n(lCu+\\n(lSu
2152: .ti -\\n(bbu
2153: .ie (\w\\*(b1u)>(\\n(w\\n(lCu) \{\&\\*(b1
2154: . br
2155: .\}
2156: .el \&\\*(b1\h'|\\n(bbu'\c
2157: .if \\n(nF==1 \{\
2158: . if n .ds pA \\*(aA
2159: .\}
2160: .nr oM \\n(oM-1
2161: .nr tP 0
2162: .\" .nr dZ \\n(dZ+1
2163: .ds b1
2164: .aY
2165: 'fi
2166: ..
2167: .\" NS lW macro - resolve unknown label/tag width (if .Bl [inset | tag] only)
2168: .de lW
2169: .if !"TagwidtH"\\*(t\\n(lC" \{\
2170: . ie \\n(tX==1 \{\
2171: . ds t\\n(lN \\*(tX
2172: . nr w\\n(lN \\n(\\*(tX
2173: . \}
2174: . el \{\
2175: . ds t\\n(lN No
2176: . nr w\\n(lN \\n(No
2177: . \}
2178: . if !"\\*(t\\n(lC"\\*(t\\n(lN" .nr tC 1
2179: .\}
2180: ..
2181: .\" NS lX macro - set up vertical spacing (if compact) and offset+indent (all)
2182: .de lX
2183: .ie \\n(tC \{\
2184: . nr tC 0
2185: . nr tW 0
2186: . if \\n(v\\n(lC==0 .sp \\n(dVu
2187: . in \\n(.iu+\\n(w\\n(lCu+\\n(o\\n(lCu+\\n(lSu
2188: .\}
2189: .el \{\
2190: . ie \\n(v\\n(lC==1 \{\
2191: . nr aa 0
2192: . \}
2193: . el \{\
2194: . sp \\n(dVu
2195: . \}
2196: .\}
2197: .if !\\n(cR .ne 2v
2198: ..
2199: .\" NS lY macro - set up vertical spacing (if compact) and offset+indent (all)
2200: .de lY
2201: .ie \\n(tC \{\
2202: . nr tC 0
2203: . nr tW 0
2204: . if \\n(v\\n(lC==0 .sp \\n(dVu
2205: . in \\n(.iu+\\n(o\\n(lCu
2206: .\}
2207: .el \{\
2208: . ie \\n(v\\n(lC==1 \{\
2209: . nr aa 0
2210: . \}
2211: . el \{\
2212: . sp \\n(dVu
2213: . \}
2214: .\}
2215: .if !\\n(cR .ne 2v
2216: ..
2217: .\" NS tS temporary string
2218: .\" NS hL macro - hanging list function
2219: .\" NS tS temporary string
2220: .\" NS hL macro - hanging list function
2221: .\" NS lT macro - tagged list function
2222: .\" NS lE macro - list end function
2223: .\" NS tX string (initial string)
2224: .\" NS tX register (initial class)
2225: .\" NS tC parameter change flag
2226: .\" NS Xt save current list-type flag
2227: .\" NS lC register - list type stack counter
2228: .\" NS tP register tag flag (for diversions)
2229: .\" NS w[0-9] register tag stack (nested tags)
2230: .\" NS t[0-9] register tag string stack (nested tags)
2231: .\" NS o[0-9] register offset stack (nested tags)
2232: .\" NS v[0-9] register vertical tag break stack
2233: .\" NS h[0-9] register horizontal tag stack (continuous if 1, break if 0)
2234: .nr lC 0
2235: .nr wV 0
2236: .nr w1 0
2237: .nr o1 0
2238: .nr v1 0
2239: .nr h1 0
2240: .ds t\n(lC
2241: .de lE
2242: .\" IN lC o[\\n(lC]==\\n(o\\n(lC, w[\\n(lC]==\\n(w\\n(lC,
2243: .ie \\n(o\\n(lC>0 \{\
2244: ' in \\n(.iu-(\\n(w\\n(lCu)-(\\n(o\\n(lCu)-\\n(lSu
2245: . rr o\\n(lC
2246: .\}
2247: .el 'in \\n(.iu-\\n(w\\n(lCu-\\n(lSu
2248: .if \\n(lC<=0 .tm Extraneous .El call (#\\n(.c)
2249: .tZ
2250: .nr lC \\n(lC-1
2251: .tY
2252: ..
2253: .\" NS tY macro - set up next block for list
2254: .\" NS tZ macro - decrement stack
2255: .\" NS tY register (next possible lC value)
2256: .de tY
2257: .nr tY (\\n(lC+1)
2258: .nr w\\n(tY 0
2259: .nr h\\n(tY 0
2260: .nr o\\n(tY 0
2261: .ds t\\n(tY \\*(t\\n(lC
2262: .ds L\\n(tY
2263: .nr v\\n(tY 0
2264: ..
2265: .de tZ
2266: .rm L\\n(tY
2267: .rr w\\n(tY
2268: .rr h\\n(tY
2269: .rr o\\n(tY
2270: .rm t\\n(tY
2271: .rr v\\n(tY
2272: .nr tY \\n(tY-1
2273: ..
2274: .\" initial values
2275: .nr w1 0
2276: .nr o1 0
2277: .nr h1 0
2278: .ds t1
2279: .nr v1 0
2280: .nr tY 1
2281: .\" NS Xr macro - cross reference (man page only)
2282: .de Xr
2283: .if \\n(aC==0 \{\
2284: . ie \\n(.$==0 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c)
2285: . el \{\
2286: . ds mN Xr
2287: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2288: . \}
2289: .\}
2290: .if \\n(aC>\\n(aP \{\
2291: . nr aP \\n(aP+1
2292: . ie \\n(C\\n(aP==1 .tm Usage: .Xr manpage_name [section#] \\*(Pu (#\\n(.c)
2293: . el \{\
2294: . ie \\n(C\\n(aP>2 .y\\n(C\\n(aP
2295: . el \{\
2296: . as b1 \&\\*(xR\\*(A\\n(aP\fP\s0
2297: . if \\n(aC>\\n(aP \{\
2298: . nr aP \\n(aP+1
2299: . if \\n(C\\n(aP==2 \{\
2300: . as b1 \&(\\*(A\\n(aP)
2301: . nr aP \\n(aP+1
2302: . \}
2303: . if \\n(aC>=\\n(aP \{\
2304: . c\\n(C\\n(aP
2305: . \}
2306: . \}
2307: . \}
2308: . aZ
2309: . \}
2310: .\}
2311: ..
2312: .\" NS Sx macro - cross section reference
2313: .de Sx
2314: .if \\n(aC==0 \{\
2315: . ie \\n(.$==0 .tm Sx Usage: .Sx Section Header \\*(Pu (#\\n(.c)
2316: . el \{\
2317: . ds mN Sx
2318: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2319: . \}
2320: .\}
2321: .if \\n(aC>\\n(aP \{\
2322: . nr aP \\n(aP+1
2323: . as b1 \\*(sX
2324: . nr cF \\n(.f
2325: . nr cZ \\n(.s
2326: . nR
2327: .\}
2328: ..
2329: .\" NS cC macro - column-list end-list
2330: .\" NS eW macro - column indent width
2331: .\" NS cI register - column indent width
2332: .\" NS W[1-5] macro - establish tabs for list-type column
2333: .de cC
2334: 'in \\n(.iu-\\n(o\\n(lCu-\\n(w\\n(lCu
2335: .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
2336: .fi
2337: .tZ
2338: .nr lC \\n(lC-1
2339: .tY
2340: ..
2341: .de W1
2342: .ta \w\\*(A1 u
2343: .nr eW \w\\*(A1 u
2344: 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
2345: ..
2346: .de W2
2347: .ta \w\\*(A1 u +\w\\*(A2 u
2348: .nr eW \w\\*(A1 u+\w\\*(A2 u
2349: 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
2350: ..
2351: .de W3
2352: .ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u
2353: .nr eW \w\\*(A1 u+\w\\*(A2 u+\w\\*(A3 u
2354: 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
2355: ..
2356: .de W4
2357: .ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u
2358: .nr eW \w\\*(A1 u+\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u
2359: 'in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
2360: ..
2361: .de W5
2362: .ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u
2363: .nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u
2364: ' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
2365: ..
2366: .\" This is packed abnormally close, intercol width should be an option
2367: .de W6
2368: .ta \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6
2369: .nr eW \w\\*(A1 u +\w\\*(A2 u +\w\\*(A3 u +\w\\*(A4 u +\w\\*(A5 u +\w\\*(A6
2370: ' in \\n(.iu+\\n(eWu+\\n(o\\n(lCu
2371: ..
2372: .\" NS cL macro - column items
2373: .de cL
2374: .if \\n(w\\n(lC==0 .nr w\\n(lC \\n(eWu
2375: .if \\n(.u==0 \{\
2376: . fi
2377: ' in \\n(.iu+\\n(eWu
2378: .\}
2379: .ti -\\n(eWu
2380: .fV
2381: .nr aP \\n(aP+1
2382: .ie \\n(aC>=\\n(aP \{\
2383: . if "\\*(A\\n(aP"Ta" \{\
2384: . nr jJ \\n(aP-1
2385: . rm S\\n(jJ
2386: . rr jJ
2387: . \}
2388: . c\\n(C\\n(aP
2389: .\}
2390: .el .tm Usage: .It column_string [Ta [column_string ...] ] (#\\n(.c)
2391: ..
2392: .\" NS Ta macro - append tab (\t)
2393: .de Ta
2394: .ie \\n(aC>0 \{\
2395: . nr aP \\n(aP+1
2396: . ie \\n(aC>=\\n(aP \{\
2397: . if "\\*(A\\n(aP"Ta" \{\
2398: . nr jJ \\n(aP-1
2399: . rm S\\n(jJ
2400: . rr jJ
2401: . \}
2402: . as b1 \\t
2403: . c\\n(C\\n(aP
2404: . \}
2405: . el \{\
2406: . as b1 \\t\\c
2407: . rm S\\n(aP
2408: . pB
2409: . aY
2410: .\" . ds b1
2411: . \}
2412: .\}
2413: .el \{\
2414: . tm Usage: Ta must follow column entry: e.g. (#\\n(.c)
2415: . tm .It column_string [Ta [column_string ...] ]
2416: .\}
2417: ..
2418: .\"
2419: .\" NS Dl macro - display (one line) literal
2420: .de Dl
2421: 'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
2422: .in \\n(.iu+\\n(Dsu
2423: .ie \\n(aC==0 \{\
2424: . ie \\n(.$==0 \{\
2425: . tm Usage: .Dl argument ... (#\\n(.c)
2426: . \}
2427: . el \{\
2428: . ds mN Dl
2429: . ds A1 \\$1
2430: . ds A2 \\$2
2431: . ds A3 \\$3
2432: . ds A4 \\$4
2433: . ds A5 \\$5
2434: . ds A6 \\$6
2435: . ds A7 \\$7
2436: . ds A8 \\$8
2437: . ds A9 \\$9
2438: . nr fV \\n(.$
2439: . fV
2440: . Li
2441: . \}
2442: .\}
2443: .el \{\
2444: . tm Usage: .Dl not callable by other macros (#\\n(.c)
2445: .\}
2446: .in \\n(.iu-\\n(Dsu
2447: ..
2448: .\"
2449: .\" NS D1 macro - display (one line)
2450: .de D1
2451: 'ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
2452: .in \\n(.iu+\\n(Dsu
2453: .ie \\n(aC==0 \{\
2454: . ie \\n(.$==0 \{\
2455: . tm Usage: .D1 argument ... (#\\n(.c)
2456: . \}
2457: . el \{\
2458: . ds mN D1
2459: . ds A1 \\$1
2460: . ds A2 \\$2
2461: . ds A3 \\$3
2462: . ds A4 \\$4
2463: . ds A5 \\$5
2464: . ds A6 \\$6
2465: . ds A7 \\$7
2466: . ds A8 \\$8
2467: . ds A9 \\$9
2468: . nr fV \\n(.$
2469: . fV
1.7 ross 2470: . No
1.1 cgd 2471: . \}
2472: .\}
2473: .el \{\
2474: . tm Usage: .D1 not callable by other macros (#\\n(.c)
2475: .\}
2476: .in \\n(.iu-\\n(Dsu
2477: ..
2478: .\" NS Ex macro - DEFUNCT
2479: .de Ex
2480: .tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2481: ..
2482: .\"
2483: .\" NS Ex macro - DEFUNCT
2484: .de Ex
2485: .tm Ex defunct, Use .D1: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2486: ..
2487: .\"
2488: .\" NS Vt macro - Variable type (for forcing old style variable declarations)
2489: .\" this is not done in the same manner as .Ot for fortrash - clean up later
2490: .de Vt
2491: .\" if a function declaration was the last thing given, want vertical space
2492: .if \\n(fD>0 \{\
2493: . Pp
2494: . nr fD 0
2495: .\}
2496: .\" if a subroutine was the last thing given, want vertical space
2497: .if \\n(fZ>0 \{\
2498: . ie \\n(fX==0 \{\
2499: . Pp
2500: . rs
2501: . \}
2502: . el .br
2503: .\}
2504: .nr fX \\n(fX+1
2505: .nr cF \\n(.f
2506: .nr cZ \\n(.s
2507: \\*(fT\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2508: .ie \\n(oT==0 .br
2509: .el \&\ \&
2510: .ft \\n(cF
2511: .fs \\n(cZ
2512: ..
2513: .\"
2514: .\" NS Ft macro - Function type
2515: .nr fZ 0
2516: .de Ft
2517: .if \\n(nS>0 \{\
2518: . if \\n(fZ>0 \{\
2519: . Pp
2520: . nr fD 0
2521: . nr fX 0
2522: . \}
2523: . if \\n(fD>0 \{\
2524: . Pp
2525: . nr fD 0
2526: . nr fX 0
2527: . \}
2528: . if \\n(fX>0 \{\
2529: . Pp
2530: . nr fX 0
2531: . \}
2532: . nr fY 1
2533: .\}
2534: .nr cF \\n(.f
2535: .nr cZ \\n(.s
2536: \&\\*(fT\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2537: .ft \\n(cF
2538: .fs \\n(cZ
2539: .\" .br
2540: ..
2541: .\"
2542: .\" NS Ot macro - Old Function type (fortran - no newline)
2543: .\" Ns oT register
2544: .nr oT 0
2545: .de Ot
2546: .nr oT 1
2547: .if \\n(nS>0 \{\
2548: . if \\n(fZ>0 \{\
2549: . Pp
2550: . nr fD 0
2551: . nr fX 0
2552: . \}
2553: . if \\n(fD>0 \{\
2554: . Pp
2555: . nr fD 0
2556: . nr fX 0
2557: . \}
2558: . if \\n(fX>0 \{\
2559: . Pp
2560: . nr fX 0
2561: . \}
2562: . nr fY 1
2563: .\}
2564: .if \\n(.$==4 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3 \\$4
2565: .if \\n(.$==3 .as b1 \&\\*(fT\&\\$1 \\$2 \\$3
2566: .if \\n(.$==2 .as b1 \&\\*(fT\&\\$1 \\$2
2567: .if \\n(.$==1 .as b1 \&\\*(fT\&\\$1
2568: .as b1 \&\ \fP
2569: ..
2570: .\"
2571: .\" NS Fa macro - Function arguments
2572: .de Fa
2573: .if \\n(aC==0 \{\
2574: . ie \\n(.$==0 .tm Usage: .Fa Function Arguments ... \\*(Pu (#\\n(.c)
2575: . el \{\
2576: . ds mN Fa
2577: . ds A1 \\$1
2578: . ds A2 \\$2
2579: . ds A3 \\$3
2580: . ds A4 \\$4
2581: . ds A5 \\$5
2582: . ds A6 \\$6
2583: . ds A7 \\$7
2584: . ds A8 \\$8
2585: . ds A9 \\$9
2586: . nr fV \\n(.$
2587: . fV
2588: . \}
2589: .\}
2590: .ie \\n(fC>0 \{\
2591: . fC
2592: .\}
2593: .el \{\
2594: . if \\n(aC>\\n(aP \{\
2595: . as b1 \\*(fA
2596: . nr aP \\n(aP+1
2597: . nr cF \\n(.f
2598: . nr cZ \\n(.s
2599: . nR
2600: . if \\n(nS>0 \{\
2601: . if \\n(fZ>0 .br
2602: . \}
2603: . \}
2604: .\}
2605: ..
2606: .\" NS fC macro - interal .Fa for .FO and .Fc
2607: .de fC
2608: .ie \\n(aC>\\n(aP \{\
2609: . nr aP \\n(aP+1
2610: .\" . nr aa \\n(aP
2611: .\" . if \\n(nS>0 \{\
2612: . ds Fb
2613: . nr fB 0
2614: . nr Fb 0
2615: . fB \\*(A\\n(aP
2616: . if \\n(fB>1 \{\
2617: . rm A\\n(aP
2618: . rn Fb A\\n(aP
2619: . \}
2620: .\" . \}
2621: . if \\n(fC>1 \{\
1.3 phil 2622: . as b1 \&\f\\n(cF\s\\n(cZ\|,\\*(fA\\*(S\\n(aP\\*(A\\n(aP\fP\s0
1.1 cgd 2623: . \}
2624: . if \\n(fC==1 \{\
2625: . as b1 \&\|\\*(fA\\*(A\\n(aP\fP\s0
2626: . \}
2627: . nr fC \\n(fC+1
2628: . fC
2629: .\}
2630: .el \{\
2631: . aY
2632: .\}
2633: ..
2634: .\" NS Fn macro - functions
2635: .\" NS fY register - dick with old style function declarations (fortran)
2636: .\" NS fZ register - break a line when more than one function in a synopsis
2637: .\"
2638: .de Fn
2639: .if \\n(aC==0 \{\
2640: . ie \\n(.$==0 .tm Usage: .Fn function_name function_arg(s) ... \\*(Pu (#\\n(.c)
2641: . el \{\
2642: . ds mN Fn
2643: . ds A1 \\$1
2644: . ds A2 \\$2
2645: . ds A3 \\$3
2646: . ds A4 \\$4
2647: . ds A5 \\$5
2648: . ds A6 \\$6
2649: . ds A7 \\$7
2650: . ds A8 \\$8
2651: . ds A9 \\$9
2652: . nr fV \\n(.$
2653: . fV
2654: . \}
2655: .\}
2656: .if \\n(nS>0 \{\
2657: .\" if there is/has been more than one subroutine declaration
2658: . if \\n(fY==0 \{\
2659: . if \\n(fZ>0 \{\
2660: . Pp
2661: . nr fX 0
2662: . nr fD 0
2663: . \}
2664: . \}
2665: . if \\n(fY==1 \{\
2666: . br
2667: . nr fX 0
2668: . nr fD 0
2669: . nr fY 0
2670: . \}
2671: . if \\n(fD>0 \{\
2672: . Pp
2673: . nr fX 0
2674: . \}
2675: . if \\n(fX>0 \{\
2676: . Pp
2677: . nr fD 0
2678: . \}
2679: . nr fZ \\n(fZ+1
2680: . nr fY 0
2681: . rs
2682: . ie \\n(nS>1 .br
2683: . el \{\
2684: . if \\n(iS==0 \{\
2685: . nr iS ((8)*\\n(fW)u
2686: . \}
2687: . \}
2688: . in +\\n(iSu
2689: . ti -\\n(iSu
2690: . nr nS \\n(nS+1
2691: .\}
2692: .if \\n(aC>\\n(aP \{\
2693: . nr aP \\n(aP+1
2694: . nr cF \\n(.f
2695: . nr cZ \\n(.s
2696: . as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
2697: . ie \\n(aC>\\n(aP \{\
2698: . as b1 \\*(fA
2699: . nr aP \\n(aP+1
2700: . f\\n(C\\n(aP
2701: . \}
2702: . el \{\
1.3 phil 2703: . ie \\n(nS>0 .as b1 \|\\*(rp\fR;\fP
2704: . el .as b1 \|\\*(rp
1.1 cgd 2705: . aZ
2706: . \}
2707: . if \\n(nS>0 \{\
2708: . in -\\n(iSu
2709: . \}
2710: .\}
2711: ..
2712: .\"
2713: .\" NS f1 macro - class switch
2714: .\" NS f2 macro - handle function arguments
2715: .\" NS f3 macro - punctuation
2716: .\" NS f4 macro - write out function
2717: .de f1
1.3 phil 2718: .ie \\n(nS>0 .as b1 \\*(rp\fR;\fP\f\\n(cF\s\\n(cZ
2719: .el .as b1 \\*(rp\f\\n(cF\s\\n(cZ
1.1 cgd 2720: .\\*(A\\n(aP
2721: ..
2722: .de f2
2723: .if \\n(nS>0 \{\
2724: . ds Fb
2725: . nr fB 0
2726: . nr Fb 0
2727: . fB \\*(A\\n(aP
2728: . if \\n(fB>1 \{\
2729: . rm A\\n(aP
2730: . rn Fb A\\n(aP
2731: . \}
2732: .\}
2733: .as b1 \\*(A\\n(aP
2734: .ie \\n(aC>\\n(aP \{\
2735: . nr aa \\n(aP
2736: . nr aP \\n(aP+1
2737: . if \\n(C\\n(aP==2 \{\
2738: . as b1 \&\|\f\\n(cF\s\\n(cZ,\\*(S\\n(aa\fP\s0\|
2739: . \}
2740: . f\\n(C\\n(aP
2741: .\}
2742: .el \{\
1.3 phil 2743: . ie \\n(nS>0 .as b1 \\*(rp\fR;\fP\f\\n(cF\s\\n(cZ
2744: . el .as b1 \\*(rp\f\\n(cF\s\\n(cZ
1.1 cgd 2745: . aZ
2746: .\}
2747: ..
2748: .de f3
1.3 phil 2749: .ie \\n(nS>0 .as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(A\\n(aP
2750: .el .as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(A\\n(aP
1.1 cgd 2751: .ie \\n(aC>\\n(aP \{\
2752: . No
2753: .\}
2754: .el .aZ
2755: ..
2756: .de f4
1.3 phil 2757: .ie \\n(nS>0 .as b1 \\*(rp\fR;\fP\f\\n(cF\s\\n(cZ\\*(S\\n(aP\\*(A\\n(aP
2758: .el .as b1 \\*(rp\f\\n(cF\s\\n(cZ\\*(S\\n(aP\\*(A\\n(aP
1.1 cgd 2759: .ie \\n(aC>\\n(aP \{\
2760: . nr aP \\n(aP+1
2761: . No
2762: .\}
2763: .el .aZ
2764: ..
2765: .de Fo
2766: .hy 0
2767: .if \\n(aC==0 \{\
2768: . ie \\n(.$==0 .tm Usage: .Fo function_name
2769: . el \{\
2770: . ds mN Fo
2771: . ds A1 \\$1
2772: . ds A2 \\$2
2773: . ds A3 \\$3
2774: . ds A4 \\$4
2775: . ds A5 \\$5
2776: . ds A6 \\$6
2777: . ds A7 \\$7
2778: . ds A8 \\$8
2779: . ds A9 \\$9
2780: . nr fV \\n(.$
2781: . fV
2782: . \}
2783: .\}
2784: .if \\n(nS>0 \{\
2785: .\" if there is/has been more than one subroutine declaration
2786: . if \\n(fY==0 \{\
2787: . if \\n(fZ>0 \{\
2788: . Pp
2789: . nr fX 0
2790: . nr fD 0
2791: . \}
2792: . \}
2793: . if \\n(fY==1 \{\
2794: . br
2795: . nr fX 0
2796: . nr fD 0
2797: . nr fY 0
2798: . \}
2799: . if \\n(fD>0 \{\
2800: . Pp
2801: . nr fX 0
2802: . \}
2803: . if \\n(fX>0 \{\
2804: . Pp
2805: . nr fD 0
2806: . \}
2807: . nr fZ \\n(fZ+1
2808: . nr fY 0
2809: . rs
2810: . ie \\n(nS>1 .br
2811: . el \{\
2812: . if \\n(iS==0 \{\
2813: . nr iS ((8)*\\n(fW)u
2814: . \}
2815: . \}
2816: . in +\\n(iSu
2817: . ti -\\n(iSu
2818: . nr nS \\n(nS+1
2819: .\}
2820: .if \\n(aC>\\n(aP \{\
2821: . nr oM \\n(oM+1
2822: . nr fC 1
2823: . nr aP \\n(aP+1
2824: . nr cF \\n(.f
2825: . nr cZ \\n(.s
2826: . as b1 \\*(fN\\*(A\\n(aP\fP\s0\\*(lp
2827: . aY
2828: .\}
2829: ..
2830: .de Fc
2831: .if \\n(aC==0 \{\
2832: . if \\n(.$>0 \{\
2833: . ds mN Fo
2834: . ds A1 \\$1
2835: . ds A2 \\$2
2836: . ds A3 \\$3
2837: . ds A4 \\$4
2838: . ds A5 \\$5
2839: . ds A6 \\$6
2840: . ds A7 \\$7
2841: . ds A8 \\$8
2842: . ds A9 \\$9
2843: . nr fV \\n(.$
2844: . fV
2845: . \}
2846: .\}
2847: .nr fC 0
2848: .nr oM \\n(oM-1
1.3 phil 2849: .ie \\n(nS>0 .as b1 \|\\*(rp\fR;\fP
2850: .el .as b1 \|\\*(rp
1.1 cgd 2851: .ie \\n(aC>\\n(aP \{\
2852: . nr aP \\n(aP+1
2853: . \\*(A\\n(aP
2854: .\}
2855: .el \{\
2856: . aZ
2857: .\}
2858: .if \\n(nS>0 \{\
2859: . in -\\n(iSu
2860: .\}
2861: .hy
2862: ..
2863: .\" NS fb macro - if SYNOPSIS, set hard space inbetween function args
2864: .\" NS fb register - count of words in a function argument
2865: .\" NS Fb register - counter
2866: .\" NS Fb string - temporary string
2867: .de fB
2868: .\" .tm fB==\\n(fB, Fb==\\n(Fb, 1==\\$1 2==\\$2 3==\\$3 4==\\$4 5==\\$5 6==\\$6
2869: .if \\n(fB==0 \{\
2870: . nr fB \\n(.$
2871: . nr Fb 0
2872: . ds Fb
2873: .\}
2874: .nr Fb \\n(Fb+1
2875: .as Fb \&\\$1
2876: .if \\n(Fb<\\n(fB \{\
2877: . as Fb \&\\*(hV
2878: . fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
2879: .\}
2880: ..
2881: .\" NS Fc - Function close - not implemented yet
2882: .\" NS Fo - Function open - not implemented yet
2883: .\"
2884: .\" Very crude references, stash all reference info into strings (usual
2885: .\" use of b1 buffer, then b1 contents copied to string of retrievable
2886: .\" naming convention), print out reference on .Re request and clean up.
2887: .\" Ordering very limited, no fancy citations, but can do articles, journals
2888: .\" and books - need to add several missing options (like city etc).
2889: .\" should be able to grab a refer entry, massage it a wee bit (prefix
2890: .\" a `.' to the %[A-Z]) and not worry (ha!)
2891: .\"
2892: .\" NS Rs macro - Reference Start
2893: .\" NS rS register - Reference Start flag
2894: .\" NS rS string - Reference Start buffer name for next save (of b1 buffer)
2895: .de Rs
2896: .nr rS 1
2897: .rC
2898: .if \\n(nA==1 .Pp
2899: .nr Kl 0
2900: ..
2901: .\" NS Re macro - Reference End
2902: .de Re
2903: .rZ
2904: .rC
2905: .nr rS 0
2906: ..
2907: .\" NS rC macro - reference cleanup
2908: .de rC
2909: .nr uK 0
2910: .nr jK 0
1.3 phil 2911: .nr iK 0
1.1 cgd 2912: .nr nK 0
2913: .nr oK 0
2914: .nr qK 0
2915: .nr rK 0
2916: .nr tK 0
2917: .nr vK 0
2918: .nr dK 0
2919: .nr pK 0
2920: .nr bK 0
2921: .ds rS
2922: .rm U1 U2 U3 U4 U5 U6 U7 U8
1.3 phil 2923: .rm uK jK iK nK oK rK qK tK vK dK pK bK
1.1 cgd 2924: ..
2925: .\" NS rZ macro - reference print
2926: .de rZ
2927: .if \\n(uK \{\&\\*(U1,
2928: . nr aK 1
2929: . if (\\n(uK>1 \{\
2930: . aK
2931: . \}
2932: . nr Kl -\\n(uK
2933: .\}
2934: .if \\n(tK \{\
2935: . nr Kl \\n(Kl-1
2936: . if \\n(Kl==0 \{\
2937: . ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q.
2938: . \}
2939: . el \{\&\\*(eM\\*(tK\\*(nO.
2940: . \}
2941: . \}
2942: . if \\n(Kl>0 \{\
2943: . ie (\\n(jK==1):(\\n(bK==1) \{\&\\*q\\*(tK\\*q,
2944: . \}
2945: . el \{\&\\*(eM\\*(tK\\*(nO,
2946: . \}
2947: . \}
2948: .\}
2949: .if \\n(bK \{\
2950: . nr Kl \\n(Kl-1
2951: . if \\n(Kl==0 \&\\*(eM\\*(bK\\*(nO.
2952: . if \\n(Kl>0 \&\\*(eM\\*(bK\\*(nO,
2953: .\}
1.3 phil 2954: .if \\n(iK \{\
2955: . nr Kl \\n(Kl-1
2956: . if \\n(Kl==0 \&\\*(eM\\*(iK\\*(nO.
2957: . if \\n(Kl>0 \&\\*(eM\\*(iK\\*(nO,
2958: .\}
1.1 cgd 2959: .if \\n(jK \{\
2960: . nr Kl \\n(Kl-1
2961: . if \\n(Kl==0 \&\\*(eM\\*(jK\\*(nO.
2962: . if \\n(Kl>0 \&\\*(eM\\*(jK\\*(nO,
2963: .\}
2964: .if \\n(rK \{\
2965: . nr Kl \\n(Kl-1
2966: . if \\n(Kl==0 \&\\*(rK.
2967: . if \\n(Kl>0 \&\\*(rK,
2968: .\}
2969: .if \\n(nK \{\
2970: . nr Kl \\n(Kl-1
2971: . if \\n(Kl==0 \&\\*(nK.
2972: . if \\n(Kl>0 \&\\*(nK,
2973: .\}
2974: .if \\n(vK \{\
2975: . nr Kl \\n(Kl-1
2976: . if \\n(Kl==0 \&\\*(vK.
2977: . if \\n(Kl>0 \&\\*(vK,
2978: .\}
2979: .if \\n(pK \{\
2980: . nr Kl \\n(Kl-1
2981: . if \\n(Kl==0 \&\\*(pK.
2982: . if \\n(Kl>0 \&\\*(pK,
2983: .\}
2984: .if \\n(qK \{\
2985: . nr Kl \\n(Kl-1
2986: . if \\n(Kl==0 \&\\*(qK.
2987: . if \\n(Kl>0 \&\\*(qK,
2988: .\}
2989: .if \\n(dK \{\
2990: . nr Kl \\n(Kl-1
2991: . if \\n(Kl==0 \&\\*(dK.
2992: . if \\n(Kl>0 \&\\*(dK,
2993: .\}
2994: .if \\n(oK \{\
2995: . nr Kl \\n(Kl-1
2996: . if \\n(Kl==0 \&\\*(oK.
2997: . if \\n(Kl>0 \&\\*(oK,
2998: .\}
2999: .if \\n(Kl>0 .tm unresolved reference problem
3000: ..
3001: .\" NS aK macro - print out reference authors
3002: .de aK
3003: .nr aK \\n(aK+1
3004: .ie (\\n(uK-\\n(aK)==0 \{\&and \\*(U\\n(aK,
3005: .\}
3006: .el \{\&\\*(U\\n(aK,
3007: . aK
3008: .\}
3009: ..
3010: .\" NS %A macro - reference author(s)
3011: .\" NS uK register - reference author(s) counter
3012: .\" NS U[1-9] strings - reference author(s) names
3013: .de %A
3014: .if \\n(aC==0 \{\
3015: . ie \\n(.$==0 .tm Usage: .%A Author_name (#\\n(.c)
3016: . el \{\
3017: . nr uK \\n(uK+1
3018: . nr Kl \\n(Kl+1
3019: . ds rS U\\n(uK
3020: . ds mN %A
3021: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
3022: . \}
3023: .\}
3024: .if \\n(aC>\\n(aP \{\
3025: . nr aP \\n(aP+1
3026: . nr cF \\n(.f
3027: . nr cZ \\n(.s
3028: . rR
3029: .\}
3030: ..
3031: .\" NS %B macro - [reference] Book Name
3032: .\" NS bK string - Book Name
3033: .\" NS bK register - Book Name flag
3034: .de %B
3035: .if \\n(aC==0 \{\
3036: . ie \\n(.$==0 .tm Usage: .%B Book Name (#\\n(.c)
3037: . el \{\
3038: . ds mN %B
3039: . if \\n(rS>0 \{\
3040: . nr bK \\n(bK+1
3041: . nr Kl \\n(Kl+1
3042: . ds rS bK
3043: . \}
3044: . ds A1 \\$1
3045: . ds A2 \\$2
3046: . ds A3 \\$3
3047: . ds A4 \\$4
3048: . ds A5 \\$5
3049: . ds A6 \\$6
3050: . ds A7 \\$7
3051: . ds A8 \\$8
3052: . ds A9 \\$9
3053: . nr fV \\n(.$
3054: . fV
3055: . \}
3056: .\}
3057: .if \\n(aC>\\n(aP \{\
3058: . nr aP \\n(aP+1
3059: . nr cF \\n(.f
3060: . nr cZ \\n(.s
3061: . ie \\n(rS==0 \{\
3062: . as b1 \&\\*(eM
3063: . nR
3064: . \}
3065: . el .rR
3066: .\}
3067: ..
3068: .\" NS %D macro - [reference] Date
3069: .\" NS dK string - Date String
3070: .\" NS dK register - Date flag
3071: .de %D
3072: .if \\n(aC==0 \{\
3073: . ie \\n(.$==0 .tm Usage: .%D Date (#\\n(.c)
3074: . el \{\
3075: . ds mN %D
3076: . nr dK \\n(dK+1
3077: . nr Kl \\n(Kl+1
3078: . ds rS dK
1.3 phil 3079: . ds A1 \\$1
3080: . ds A2 \\$2
3081: . ds A3 \\$3
3082: . ds A4 \\$4
3083: . ds A5 \\$5
3084: . ds A6 \\$6
3085: . ds A7 \\$7
3086: . ds A8 \\$8
3087: . ds A9 \\$9
3088: . nr fV \\n(.$
3089: . fV
3090: . \}
3091: .\}
3092: .if \\n(aC>\\n(aP \{\
3093: . nr aP \\n(aP+1
3094: . nr cF \\n(.f
3095: . nr cZ \\n(.s
3096: . rR
3097: .\}
3098: ..
3099: .\" NS %I macro - [reference] Issuer/Publisher Name
3100: .\" NS jK register - [reference] Issuer/Publisher Name flag
3101: .\" NS jK string - [reference] Issuer/Publisher Name
3102: .de %I
3103: .if \\n(aC==0 \{\
3104: . ie \\n(.$==0 .tm Usage: .%I Issuer/Publisher Name (#\\n(.c)
3105: . el \{\
3106: . ds mN %I
3107: . nr iK \\n(iK+1
3108: . ds rS iK
3109: . nr Kl \\n(Kl+1
1.1 cgd 3110: . ds A1 \\$1
3111: . ds A2 \\$2
3112: . ds A3 \\$3
3113: . ds A4 \\$4
3114: . ds A5 \\$5
3115: . ds A6 \\$6
3116: . ds A7 \\$7
3117: . ds A8 \\$8
3118: . ds A9 \\$9
3119: . nr fV \\n(.$
3120: . fV
3121: . \}
3122: .\}
3123: .if \\n(aC>\\n(aP \{\
3124: . nr aP \\n(aP+1
3125: . nr cF \\n(.f
3126: . nr cZ \\n(.s
3127: . rR
3128: .\}
3129: ..
3130: .\" NS %J macro - [reference] Journal Name
3131: .\" NS jK register - [reference] Journal Name flag
3132: .\" NS jK string - [reference] Journal Name
3133: .de %J
3134: .if \\n(aC==0 \{\
3135: . ie \\n(.$==0 .tm Usage: .%J Journal Name (#\\n(.c)
3136: . el \{\
3137: . ds mN %J
3138: . nr jK \\n(jK+1
3139: . ds rS jK
3140: . nr Kl \\n(Kl+1
3141: . ds A1 \\$1
3142: . ds A2 \\$2
3143: . ds A3 \\$3
3144: . ds A4 \\$4
3145: . ds A5 \\$5
3146: . ds A6 \\$6
3147: . ds A7 \\$7
3148: . ds A8 \\$8
3149: . ds A9 \\$9
3150: . nr fV \\n(.$
3151: . fV
3152: . \}
3153: .\}
3154: .if \\n(aC>\\n(aP \{\
3155: . nr aP \\n(aP+1
3156: . nr cF \\n(.f
3157: . nr cZ \\n(.s
3158: . rR
3159: .\}
3160: ..
3161: .\" NS %N macro - [reference] issue number
3162: .\" NS nK register - [reference] issue number flag
3163: .\" NS nK string - [reference] issue number
3164: .de %N
3165: .if \\n(aC==0 \{\
3166: . ie \\n(.$==0 .tm Usage: .%N issue number (#\\n(.c)
3167: . el \{\
3168: . nr nK \\n(nK+1
3169: . nr Kl \\n(Kl+1
3170: . ds rS nK
3171: . ds mN %N
3172: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
3173: . \}
3174: .\}
3175: .if \\n(aC>\\n(aP \{\
3176: . nr aP \\n(aP+1
3177: . nr cF \\n(.f
3178: . nr cZ \\n(.s
3179: . rR
3180: .\}
3181: ..
3182: .\" NS %O macro - [reference] optional information
3183: .\" NS oK register - [reference] optional information flag
3184: .\" NS oK string - [reference] optional information
3185: .de %O
3186: .if \\n(aC==0 \{\
3187: . ie \\n(.$==0 .tm Usage: .%O optional information ... \\*(Pu (#\\n(.c)
3188: . el \{\
3189: . ds mN %O
3190: . nr oK \\n(oK+1
3191: . nr Kl \\n(Kl+1
3192: . ds rS oK
3193: . ds A1 \\$1
3194: . ds A2 \\$2
3195: . ds A3 \\$3
3196: . ds A4 \\$4
3197: . ds A5 \\$5
3198: . ds A6 \\$6
3199: . ds A7 \\$7
3200: . ds A8 \\$8
3201: . ds A9 \\$9
3202: . nr fV \\n(.$
3203: . fV
3204: . \}
3205: .\}
3206: .if \\n(aC>\\n(aP \{\
3207: . nr aP \\n(aP+1
3208: . nr cF \\n(.f
3209: . nr cZ \\n(.s
3210: . rR
3211: .\}
3212: ..
3213: .\" NS %P macro - [reference] page numbers
3214: .\" NS pK register - [reference] page number flag
3215: .\" NS pK string - [reference] page number
3216: .de %P
3217: .if \\n(aC==0 \{\
3218: . ie \\n(.$==0 .tm Usage: .%P page numbers ... \\*(Pu (#\\n(.c)
3219: . el \{\
3220: . ds mN %P
3221: . nr pK \\n(pK+1
3222: . nr Kl \\n(Kl+1
3223: . ds rS pK
3224: . ds A1 \\$1
3225: . ds A2 \\$2
3226: . ds A3 \\$3
3227: . ds A4 \\$4
3228: . ds A5 \\$5
3229: . ds A6 \\$6
3230: . ds A7 \\$7
3231: . ds A8 \\$8
3232: . ds A9 \\$9
3233: . nr fV \\n(.$
3234: . fV
3235: . \}
3236: .\}
3237: .if \\n(aC>\\n(aP \{\
3238: . nr aP \\n(aP+1
3239: . nr cF \\n(.f
3240: . nr cZ \\n(.s
3241: . rR
3242: .\}
3243: ..
3244: .\" NS %Q macro - Corporate or Foreign Author
3245: .\" NS qK string - Corporate or Foreign Author
3246: .\" NS qK register - Corporate or Foreign Author flag
3247: .de %Q
3248: .if \\n(aC==0 \{\
3249: . ie \\n(.$==0 .tm Usage: .%Q Corporate or Foreign Author (#\\n(.c)
3250: . el \{\
3251: . ds mN %Q
3252: . nr qK \\n(qK+1
3253: . nr Kl \\n(Kl+1
3254: . ds rS qK
3255: . ds A1 \\$1
3256: . ds A2 \\$2
3257: . ds A3 \\$3
3258: . ds A4 \\$4
3259: . ds A5 \\$5
3260: . ds A6 \\$6
3261: . ds A7 \\$7
3262: . ds A8 \\$8
3263: . ds A9 \\$9
3264: . nr fV \\n(.$
3265: . fV
3266: . \}
3267: .\}
3268: .if \\n(aC>\\n(aP \{\
3269: . nr aP \\n(aP+1
3270: . nr cF \\n(.f
3271: . nr cZ \\n(.s
3272: . rR
3273: .\}
3274: ..
3275: .\" NS %R macro - [reference] report name
3276: .\" NS rK string - [reference] report name
3277: .\" NS rK register - [reference] report flag
3278: .de %R
3279: .if \\n(aC==0 \{\
3280: . ie \\n(.$==0 .tm Usage: .%R reference report (#\\n(.c)
3281: . el \{\
3282: . ds mN %R
3283: . nr rK \\n(rK+1
3284: . nr Kl \\n(Kl+1
3285: . ds rS rK
3286: . ds A1 \\$1
3287: . ds A2 \\$2
3288: . ds A3 \\$3
3289: . ds A4 \\$4
3290: . ds A5 \\$5
3291: . ds A6 \\$6
3292: . ds A7 \\$7
3293: . ds A8 \\$8
3294: . ds A9 \\$9
3295: . nr fV \\n(.$
3296: . fV
3297: . \}
3298: .\}
3299: .if \\n(aC>\\n(aP \{\
3300: . nr aP \\n(aP+1
3301: . nr cF \\n(.f
3302: . nr cZ \\n(.s
3303: . rR
3304: .\}
3305: ..
3306: .\" NS %T macro - reference title
3307: .\" NS tK string - reference title
3308: .\" NS tK register - reference title flag
3309: .de %T
3310: .if \\n(aC==0 \{\
3311: . ie \\n(.$==0 .tm Usage: .%T (#\\n(.c)
3312: . el \{\
3313: . ds mN %T
3314: . if \\n(rS>0 \{\
3315: . nr tK \\n(tK+1
3316: . nr Kl \\n(Kl+1
3317: . ds rS tK
3318: . \}
3319: . ds A1 \\$1
3320: . ds A2 \\$2
3321: . ds A3 \\$3
3322: . ds A4 \\$4
3323: . ds A5 \\$5
3324: . ds A6 \\$6
3325: . ds A7 \\$7
3326: . ds A8 \\$8
3327: . ds A9 \\$9
3328: . nr fV \\n(.$
3329: . fV
3330: . \}
3331: .\}
3332: .if \\n(aC>\\n(aP \{\
3333: .\" . ie \\n(jS==1 \{\
3334: .\" . nr cF \\n(.f
3335: .\" . nr cZ \\n(.s
3336: .\" . ds qL \&\\*(Lq\\*(rA
3337: .\" . ds qR \&\\*(Rq\f\\n(cF\s\\n(cZ
3338: .\" . En \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
3339: .\" . \}
3340: .\" . el \{\
3341: . nr aP \\n(aP+1
3342: . nr cF \\n(.f
3343: . nr cZ \\n(.s
3344: . ie \\n(rS==0 \{\
3345: . as b1 \&\\*(eM
3346: . nR
3347: . \}
3348: . el .rR
3349: .\" . \}
3350: .\}
3351: ..
3352: .\" NS %V macro - reference volume
3353: .\" NS vK string - reference volume
3354: .\" NS vK register - reference volume flag
3355: .de %V
3356: .if \\n(aC==0 \{\
3357: . ie \\n(.$==0 .tm Usage: .%V Volume , ... \\*(Pu (#\\n(.c)
3358: . el \{\
3359: . ds mN %V
3360: . nr vK \\n(vK+1
3361: . nr Kl \\n(Kl+1
3362: . ds rS vK
3363: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
3364: . \}
3365: .\}
3366: .if \\n(aC>\\n(aP \{\
3367: . nr aP \\n(aP+1
3368: . nr cF \\n(.f
3369: . nr cZ \\n(.s
3370: . rR
3371: .\}
3372: ..
3373: .\" NS rR macro - reference recursion routine
3374: .\" NS jM local register
3375: .\" NS jN local register
3376: .de rR
3377: .hy 0
3378: .nr jM \\n(C\\n(aP
3379: .ie \\n(jM==1 \{\
3380: .\" . as b1 \&\f\\n(cF\s\\n(cZ
3381: . ie "\\*(A\\n(aP"Tn" \{\
3382: . nN
3383: . \}
3384: . el \{\
3385: . if \\n(aC>8 .tm Usage: \\*(mN - maximum 8 arguments (#\\n(.c)
3386: . aI rR 1
3387: . \\*(A\\n(aP
3388: . \}
3389: .\}
3390: .el \{\
3391: . nr jN \\n(aP
3392: . ie \\n(jM==2 .as b1 \&\\*(A\\n(aP
3393: . el .as b1 \&\\*(A\\n(aP
3394: .\" . el .as b1 \&\f\\n(cF\s\\n(cZ\\*(A\\n(aP\fP\s0
3395: . ie \\n(aC==\\n(aP \{\
3396: .\" . as b1 \&\f\\n(cF\s\\n(cZ
3397: . rD
3398: . \}
3399: . el \{\
3400: . nr aP \\n(aP+1
3401: . as b1 \&\\*(S\\n(jN
3402: . rR
3403: . \}
3404: .\}
3405: .rr jM jN
3406: ..
3407: .\" NS rD macro - save b1 buffer in to appropriate name
3408: .de rD
3409: .as \\*(rS \\*(b1
3410: .ds b1
3411: .ds rS
3412: .aY
3413: ..
3414: .\" NS Hf macro - source include header files.
3415: .de Hf
3416: .Pp
3417: File:
3418: .Pa \\$1
3419: .Pp
3420: .nr cF \\n(.f
3421: .nr cZ \\n(.s
3422: .ie t \{\
3423: \&\\*(lI
3424: .br
3425: .ta +9n 18n 27n 36n 45n 54n 63n 72n
3426: .\}
3427: .el \{\
3428: .ta +8n 16n 24n 32n 40n 48n 56n 64n 72n
3429: .\}
3430: .nf
3431: .so \\$1
3432: .fi
3433: .ft \\n(cF
3434: .fz \\n(cZ
3435: .Pp
3436: ..
3437: .\" NS An macro - author name
3438: .\" NS aN register
3439: .nr aN 0
3440: .de An
3441: .if \\n(nY==1 \{\
3442: . ie \\n(aN==1 \{\
3443: . br
3444: . \}
3445: . el \{\
3446: . nr aN 1
3447: . \}
3448: .\}
3449: .if \\n(aC==0 \{\
3450: . ie \\n(.$==0 .tm Usage: .An author_name ... \\*(Pu (#\\n(.c)
3451: . el \{\
3452: . ds mN An
3453: . aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
3454: . \}
3455: .\}
3456: .if \\n(aC>\\n(aP \{\
3457: . nr aP \\n(aP+1
3458: . nr cF \\n(.f
3459: . nr cZ \\n(.s
3460: . nR
3461: .\}
3462: ..
3463: .\" NS Sf macro -defunct
3464: .de Sf
3465: .tm .Sf defunct, use prefix or Ns
3466: ..
3467: .ds rV "function returns the value 0 if successful; otherwise the value -1 is returned and the global variable \\*(vAerrno\fP is set to indicate the error.
3468: .\" Ns Rv macro - return values
3469: .\" Ns rV string - standard return message
3470: .de Rv
3471: .ie \\n(.$==0 \{\
3472: .tm Usage: .Rv [-std] (#\\n(.c)
3473: .\}
3474: .el \{\
3475: . ds mN Rv
3476: .\" . nr aP 0
3477: .\" . nr lR \\n(lR+1
3478: .\" . ds A1 \\$2
3479: .\" . ds A2 \\$3
3480: .\" . ds A3 \\$4
3481: .\" . ds A4 \\$5
3482: .\" . ds A5 \\$6
3483: .\" . ds A6 \\$7
3484: .\" . ds A7 \\$8
3485: .\" . ds A8 \\$9
3486: .\" . nr fV \\n(.$-1
3487: . if "\\$1"-std" \{\
3488: . nr cH \\*(cH
3489: . if (\\n(cH<2):(\\n(cH>3) .tm Usage: .Rv -std sections 2 and 3 only
3490: . br
3491: \&The
3492: .Fn \\$2
3493: \&\\*(rV
3494: . \}
3495: .\}
3496: ..
1.8 ! ross 3497: .als Mt Pa
! 3498: .als It-span It
! 3499: .de Lk
! 3500: . if \\n(Db .tm .Lk \\$*
! 3501: . nr doc-tmp-1 0
! 3502: . nr aT 0
! 3503: . nr sW 0
! 3504: . ds doc-tmp-1 Sy \&\\$*
! 3505: . sW "\\$1"
! 3506: . if \\n(.$>=2 \{\
! 3507: . sW "\\$2"
! 3508: . aT \\$2
! 3509: . if \\n(Db .tm arg type==\\n(aT len==\\n(sW
! 3510: . ie \\n(aT<3 \{\
! 3511: . Em \&\\$2:
! 3512: . ds doc-tmp-1 Sy "\&\\$1"
! 3513: . sW "\\$1"
! 3514: . shift
! 3515: . shift
! 3516: . as doc-tmp-1 \\$*
! 3517: . \}
! 3518: . el .sW "\\$1"
! 3519: . \}
! 3520: . if n .nr doc-tmp-1 26
! 3521: . if t .nr doc-tmp-1 38
! 3522: . ie \\n(sW>=\\n[doc-tmp-1] .D1 \\*[doc-tmp-1]
! 3523: . el .\\*[doc-tmp-1]
! 3524: ..
! 3525: .
! 3526: .ds T " x\" embedded tab is important
! 3527: .chop T
! 3528: .
! 3529: .rn em e@
! 3530: .de em
! 3531: . tm End-macro (.em) respecification is not allowed. (#\\n(.c)
! 3532: . tm Should this have been .Em ...?
! 3533: ..
! 3534: .
CVSweb <webmaster@jp.NetBSD.org>