home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / bsd_srcs / share / tmac / tmac.doc.old < prev    next >
Encoding:
Text File  |  1991-04-20  |  35.2 KB  |  1,834 lines

  1. .\"
  2. .\" Copyright (c) 1990 The Regents of the University of California.
  3. .\" All rights reserved.
  4. .\"
  5. .\" Redistribution and use in source and binary forms, with or without
  6. .\" modification, are permitted provided that the following conditions
  7. .\" are met:
  8. .\" 1. Redistributions of source code must retain the above copyright
  9. .\"    notice, this list of conditions and the following disclaimer.
  10. .\" 2. Redistributions in binary form must reproduce the above copyright
  11. .\"    notice, this list of conditions and the following disclaimer in the
  12. .\"    documentation and/or other materials provided with the distribution.
  13. .\" 3. All advertising materials mentioning features or use of this software
  14. .\"    must display the following acknowledgement:
  15. .\"    This product includes software developed by the University of
  16. .\"    California, Berkeley and its contributors.
  17. .\" 4. Neither the name of the University nor the names of its contributors
  18. .\"    may be used to endorse or promote products derived from this software
  19. .\"    without specific prior written permission.
  20. .\"
  21. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. .\" SUCH DAMAGE.
  32. .\"
  33. .\"     @(#)tmac.doc.old    5.2 (Berkeley) 3/13/91
  34. .\"
  35. .\" Assume nroff on crt's only if cR==1
  36. .if n .nr cR 1
  37. .\"    STRING CONSTANTS
  38. .\"     DITROFF
  39. .if t \{\
  40. .\"    Address Style
  41. .ds aD \fI
  42. .\"    Argument Reference Style
  43. .ds aR \f(CO
  44. .\"    Interactive Comand Modifier (flag)
  45. .ds cM \f(CB
  46. .\"    Emphasis (in the English sense - usually italics)
  47. .ds eM \fI
  48. .\"    Errno Style
  49. .ds eR \fC
  50. .\"    Environment Variable Style
  51. .ds eV \fC
  52. .\"    Command Line Flag Style
  53. .ds fL \f(CB
  54. .\"    Header String Style
  55. .ds Hs \fR
  56. .\"    Interactive Command Style
  57. .ds iC \f(CB
  58. .\"    Literal Style
  59. .ds lI \fC
  60. .\"    Left Parenthesis Style
  61. .ds lP \fR\|(\|\fP
  62. .\"    Right Parenthesis Style
  63. .ds rP \fR\|)\|\fP
  64. .\"    Options Open Bracket Style
  65. .ds lB \fR\^[\^\fP
  66. .\"    Options Open Bracket Style
  67. .ds rB \fR\^]\fP
  68. .\"    Name (subject of manpage) Style
  69. .ds nM \f(CB
  70. .\"    Pathname Style
  71. .ds pA \fC
  72. .\"    Accepted punctuation string for -mdoc syntax
  73. .ds Pu \fR[.,:;(\^)[\^]\fR]
  74. .\"    Section Header Style
  75. .ds Sp \s12\fB
  76. .\" .ds sT \s-2\fR
  77. .\"    Symbolic Emphasis (boldface)
  78. .ds sY \f(CB
  79. .\"    Generic Variable Style
  80. .ds vA \fI
  81. .\"    Volume Title Style
  82. .ds Vs \fR
  83. .\"    Cross Reference STyle (man page only)
  84. .ds xR \fC
  85. .\"    Math *
  86. .tr *\(**
  87. .\}
  88. .\"    NROFF
  89. .if n \{\
  90. .\"    Address Style
  91. .ds aD \fI
  92. .\"    Argument Reference Style
  93. .ds aR \fI
  94. .\"    Interactive Command Modifier (flag)
  95. .ds cM \fB
  96. .\"    Emphasis (in the English sense - usually italics)
  97. .ds eM \fI
  98. .\"    Errno Style
  99. .ds eR \fR
  100. .\"    Environment Variable Style
  101. .ds eV \fR
  102. .\"    Command Line Flag Style
  103. .ds fL \fB
  104. .\"    Header String Style
  105. .ds Hs \fR
  106. .\"    Interactive Command Style
  107. .ds iC \fB
  108. .\"    Literal Style
  109. .ds lI \fR
  110. .\"    Left Parenthesis Style
  111. .ds lP \fR\|(\fP
  112. .\"    Right Parenthesis Style
  113. .ds rP \fR\|)\fP
  114. .\"    Options Open Bracket Style
  115. .ds lB \fR\|[\|\fP
  116. .\"    Options Open Bracket Style
  117. .ds rB \fR\|]\fP
  118. .\"    Name (subject of manpage) Style
  119. .ds nM \fB
  120. .\"    Pathname Style
  121. .ds pA \fI
  122. .\"    Accepted punctuation string for -mdoc syntax
  123. .ds Pu [.,;:()[]]
  124. .\"    Section Header Style
  125. .ds Sp \s12\fB
  126. .\"    .ds sT \s-2\fR
  127. .\" .ds sT \s-2\fR
  128. .\"    Symbol, Mode or Mask Style
  129. .ds sY \fB
  130. .\"    Generic Variable Style
  131. .ds vA \fI
  132. .\"    Volume Title Style
  133. .ds Vs \fR
  134. .\"    Cross Reference Style (man page only)
  135. .ds xR \fR
  136. .\}
  137. .\"    INDENTS - Subheaders(sI), Text(Ti) between Section Headers and Subsects
  138. .if t \{\
  139. .    nr sI \w'\fC,'u*5
  140. .    nr Ti \n(sIu
  141. .\}
  142. .if n \{\
  143. .    nr sI .5i
  144. .    nr Ti .5i
  145. .\}
  146. .\"    Flags for macros names which are used only for .Ds
  147. .nr dI 6n
  148. .nr dC 1
  149. .nr dL 1
  150. .nr dR 1
  151. .\"    INDENT WIDTHS (for Lists)
  152. .\"    Width Needed for Address Tag (indented amount)
  153. .nr Ad 12n
  154. .\"    Angle Quote Width
  155. .nr Aq 12n
  156. .\"    Width Needed for Argument
  157. .nr Ar 12n
  158. .\"    Width Needed for Column offset
  159. .nr Cl 15n
  160. .\"    Width neeeded for Interactive Command Modifier
  161. .nr Cm 10n
  162. .\"    Width Needed for Complex Expressions
  163. .nr Cx 20n
  164. .\"    Indent Width Needed for Display (right and left margins)
  165. .nr Ds 6n
  166. .\"    Double Quote Width
  167. .nr Dq 12n
  168. .\"    tI is dependent on Ds and used by .Dp
  169. .nr tI \n(Dsu
  170. .\"    Width Needed for Display
  171. .nr Em 10n
  172. .\"    Width Needed for Errno Types
  173. .nr Er 15n
  174. .\"    Width Needed for Environment Variables
  175. .nr Ev 15n
  176. .\"    Width Needed for Example Indent
  177. .nr Ex 10n
  178. .\"    Width Needed for Flag
  179. .nr Fl 10n
  180. .\"    Width Needed for Function
  181. .nr Fn 16n
  182. .\"    Width neeeded for Interactive Command Name
  183. .nr Ic 10n
  184. .\"    Width Needed for Constant
  185. .nr Li 16n
  186. .\"    Width Needed for Math Symbol ? not sure if needed
  187. .nr Ms 6n
  188. .\"    Width Needed for Name
  189. .nr Nm 10n
  190. .\"    Width Needed for Option Begin
  191. .nr Ob 14n
  192. .\"    Width Needed for Option End
  193. .nr Oe 14n
  194. .\"    Width Needed for Option (one line)
  195. .nr Op 14n
  196. .\"    Width Needed for Pathname
  197. .nr Pa 32n
  198. .\"    Parenthesis Quote Width
  199. .nr Pq 12n
  200. .\"    Single Quote Width
  201. .nr Sq 12n
  202. .\"    Width Needed for Symbols, Modes or Masks
  203. .nr Sy 6n
  204. .\"    Width needed for default or unknown text width
  205. .nr Tx 22n
  206. .\"    Width Needed for Generic Variable
  207. .nr Va 12n
  208. .\"    Width Needed for Cross Reference, should the cross ref be annotated.
  209. .nr Xr 10n
  210. .\" PARAGRAPH SPACE
  211. .if t \{\
  212. .    nr Pp .5v
  213. .\}
  214. .if n \{\
  215. .    nr Pp 1v
  216. .\}
  217. .\"    PAGE LAYOUT
  218. .\" .Li Tagged Paragraph Style - zero if break on oversized tag
  219. .\" one if add em space and continue filling line.
  220. .nr tP 0
  221. .\" Page Layout Macro
  222. .de pL
  223. .\"    DITROFF
  224. .ie t \{\
  225. .\" Header Margin
  226. .    nr Hm .5i
  227. .\" Footer Margin
  228. .    nr Fm .5i
  229. .\" Line length
  230. .    nr ll 5.5i
  231. .\" Line length
  232. .    ll 5.5i
  233. .\" Title length
  234. .    nr lt 5.5i
  235. .\" Title length
  236. .    lt 5.5i
  237. .\" Page offset
  238. .    nr po 1.56i
  239. .\" Page offset
  240. .    po 1.56i
  241. .\" Vertical space distance (from Section headers/Lists/Subsections)
  242. .    nr vV .5v
  243. .\" em space
  244. .    ds tP \|\|\|\|\|\|
  245. .\}
  246. .el \{\
  247. .\" Line length
  248. .    nr ll 78n
  249. .    ll 78n
  250. .\" Title length
  251. .    nr lt 78n
  252. .\" Title length
  253. .    lt 78n
  254. .\" Page offset
  255. .    nr po 0i
  256. .\" Page offset
  257. .    po 0i
  258. .\" Vertical space distance (from Section headers/Lists/Subsections)
  259. .    nr vV 1v
  260. .\" em space
  261. .    ds tP \0\0
  262. .\" Test for crt
  263. .    ie \\n(cR .nr Hm 0
  264. .    el .nr Hm .5i
  265. .\" Footer Margin
  266. .    nr Fm .5i
  267. .\}
  268. ..
  269. .\" Adjustment mode
  270. .if n \{\
  271. .ad l
  272. .na
  273. ..
  274. .\}
  275. .\" PREDEFINED STRINGS
  276. .if t \{\
  277. .    ds <= \(<=
  278. .    ds >= \(>=
  279. .    ds Lq \&``
  280. .    ds Rq \&''
  281. .    ds ua \(ua
  282. .    ds aa \(aa
  283. .    ds ga \(ga
  284. .    ds sR \(aa
  285. .    ds sL \(ga
  286. .\}
  287. .if n \{\
  288. .    ds <= \&<\&=
  289. .    ds >= \&>\&=
  290. .       ds Rq ''
  291. .       ds Lq ``
  292. .    ds ua ^
  293. .    ds aa '
  294. .    ds ga `
  295. .    ds sL `
  296. .    ds sR '
  297. .\}
  298. .\" Note: The distances from the bottom or top of the page are set
  299. .\" in headers (macro .hK): to -1.25 for troff, and -1.167 for nroff
  300. .\" bottoms, and top is 0.
  301. .\"
  302. .\"    .Dt Document/manpage_title section/chapter volume
  303. .\"        The \{ and \} is necessary as roff doesn't nest if-elses
  304. .\"        properly, especially with .ds.
  305. .\"    TODO: separate Dt into Dt, Ch and Vt for supp docs.
  306. .de Dt
  307. .ds dT UNTITLED
  308. .ds vT Local
  309. .ds cH Null
  310. .\"     Volume and Section Number or Chapter Number
  311. .if !"\\$1"" .ds dT \\$1
  312. .if !"\\$2"" \{\
  313. .    ds cH \\$2
  314. .    if "\\$3"" \{\
  315. .        \" Volume Title if none given
  316. .        if \\$2>=1 .if \\$2<=8 \{\
  317. .            ds vT UNIX Reference Manual
  318. .            if \\$2>1 .if \\$2<6 .ds vT UNIX Programmer's Manual
  319. .            if "\\$2"8" .ds vT UNIX System Manager's Manual
  320. .        \}
  321. .        if "\\$2"unass"  .ds vT DRAFT
  322. .        if "\\$2"draft"  .ds vT DRAFT
  323. .        if "\\$2"paper"  .ds vT Null
  324. .    \}
  325. .\}
  326. .if !"\\$3"" \{\
  327. .    \" Volume Title if given
  328. .    if "\\$3"USD"   .ds vT UNIX User's Supplementary Documents
  329. .    if "\\$3"PS1"   .ds vT UNIX Programmers's Supplementary Documents
  330. .    if "\\$3"AMD"   .ds vT UNIX Ancestral Manual Documents
  331. .    if "\\$3"SMM"   .ds vT UNIX System Manager's Manual
  332. .    if "\\$3"URM"   .ds vT UNIX Reference Manual
  333. .    if "\\$3"PRM"   .ds vT UNIX Programmers's Manual
  334. .    if "\\$3"IND"   .ds vT UNIX Manual Master Index
  335. .    if "\\$3"CON"   .ds vT UNIX Contributed Software Manual
  336. .    if "\\$3"IMP"    .ds vT UNIX Implementation Notes
  337. .    if "\\$3"HOW"    .ds vT UNIX How Pocket Manual
  338. .    if "\\$3"LOCAL" .ds vT UNIX Local Manual
  339. .    if "\\*(vT"Local" .ds vT \\$3
  340. .\}
  341. ..
  342. .\"
  343. .\"    .Os Operating System/Standard and Release or Version Number
  344. .\"
  345. .de Os
  346. .ds oS Null
  347. .if "\\$1"" \{\
  348. .    ds oS \fIBSD Experimental\fP
  349. .\" .    ds oS (\fIBag o' Bits\fP)
  350. .\}
  351. .if "\\$2"" \{\
  352. .    ds o1 Non-Null
  353. .\}
  354. .if "\\$1"ATT"   \{\
  355. .    ds oS AT&T
  356. .    if "\\$2""    .as oS \0UNIX
  357. .    if "\\$2"7th" .as oS \07th Edition
  358. .    if "\\$2"7"   .as oS \07th Edition
  359. .    if "\\$2"III" .as oS \0System III
  360. .    if "\\$2"3"   .as oS \0System III
  361. .    if "\\$2"V"   .as oS \0System V
  362. .    if "\\$2"V.2" .as oS \0System V Release 2
  363. .    if "\\$2"V.3" .as oS \0System V Release 3
  364. .    if "\\$2"V.4" .as oS \0System V Release 4
  365. .\}
  366. .if "\\$1"BSD" \{\
  367. .    if "\\$2"3"    .ds oS 3rd Berkeley Distribution
  368. .    if "\\$2"4"    .ds oS 4th Berkeley Distribution
  369. .    if "\\$2"4.1"  .ds oS 4.1 Berkeley Distribution
  370. .    if "\\$2"4.2"  .ds oS 4.2 Berkeley Distribution
  371. .    if "\\$2"4.3"  .ds oS 4.3 Berkeley Distribution
  372. .    if "\\$2"4.3+" .ds oS 4.3+tahoe Berkeley Distribution
  373. .\}
  374. .if "\\*(oS"Null" .ds oS \\$1
  375. .if "\\*(o1"Non-Null" .as oS \0\\$2
  376. .rm o1
  377. ..
  378. .\"
  379. .\" Standards
  380. .\"
  381. .\" .de St
  382. .\" .ds sT Null
  383. .\" .if "\\$1"POSIX" \{\
  384. .\" .    ds sT IEEE Standard POSIX
  385. .\" .    if \\$2 .as sT \0\\$2
  386. .\" .\}
  387. .\" .if "\\$1"ANSI" \{\
  388. .\" .    ds sT ANSI Standard
  389. .\" .    if \\$2 .as sT \0\\$2
  390. .\" .\}
  391. .\" .if "\\$1"ISO" \{\
  392. .\" .    ds sT ISO Standard
  393. .\" .    if \\$2 .as sT \0\\$2
  394. .\" .\}
  395. .\" .if "\\*(sT"Null" .ds sR \\$3
  396. .\" ..
  397. .\"
  398. .\" .de Gp
  399. .\" .ie !"\\$1"" .ds gP \&\\$1 \\$2 \\$3 \\$4 \\$5
  400. .\" .el .ds gP Null
  401. .\" ..
  402. .\"
  403. .\"
  404. .de Dd
  405. .nr aa 0
  406. .ie \\n(.$>0 \{\
  407. .    ie \\n(.$<4 \{\
  408. .        ds dD \\$1 \\$2 \\$3
  409. .    \}
  410. .    el .tm Usage: .Dd Month Day, Year (e.g July 4, 1977).
  411. .\}
  412. .el \{\
  413. .    ds dD Epoch
  414. .\}
  415. ..
  416. .\"
  417. .\"    House Keeping Macro - Make sense of dT, cH, vT, sT, gP and dS
  418. .\"    TODO: Try to get else's for efficiency
  419. .\"    TODO: GET RID OF .wh -1.167i (its in v7)
  420. .\"
  421. .\"
  422. .de hK
  423. .nr % 1
  424. .ds hT \\*(dT
  425. .if !"\\*(cH"Null" \{\
  426. .    ie !"\\*(gP"Null" .as hT \|(\|\\*(cH\\*(gP\|)
  427. .    el .as hT \\|(\\|\\*(cH\\|)
  428. .\}
  429. .if "\\*(cH"Null" .if !"\\*(gP"Null" .as hT \&\|(\|\\*(gP\|)
  430. .if t \{\
  431. .    wh 0 hM
  432. .    wh -1.25i fM
  433. .\}
  434. .if n \{\
  435. .    ie \\n(cR \{\
  436. .        hM
  437. .        wh -0v fM
  438. .    \}
  439. .    el \{\
  440. .        wh 0 hM
  441. .        wh -1.167i fM
  442. .    \}
  443. .\}
  444. .if n \{\
  445. .    if \\n(nl==0:\\n(nl==-1 'bp
  446. .\}
  447. .if t 'bp
  448. .em lM
  449. ..
  450. .\"    Header Macro
  451. .\"
  452. .de hM
  453. .ev 1
  454. .pL
  455. .if !\\n(cR 'sp \\n(Hmu
  456. .tl @\\*(Hs\\*(hT\fP@\\*(Vs\\*(vT\fP@\\*(Hs\\*(hT\fP@
  457. 'sp \\n(Hmu
  458. .ev
  459. ..
  460. .\"
  461. .de fM
  462. .ev 1
  463. .pL
  464. .if !\\n(cR \{\
  465. '    sp \\n(Fmu
  466. .    tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
  467. '    bp
  468. .\}
  469. .if \\n(cR \{\
  470. .\" .    tl @\\*(Hs\\*(oS\fP@\\*(Vs\\*(dD\fP@%@
  471. .\" '    bp
  472. .\}
  473. .ev
  474. ..
  475. .de lM
  476. .fl
  477. .if \\n(cR \{\
  478. .       fM
  479. .       pl \\n(nlu
  480. .\}
  481. ..
  482. .de Pp
  483. .sp \\n(Ppu
  484. .ne 2
  485. .ns
  486. ..
  487. .de Lp
  488. .Pp
  489. ..
  490. .de LP
  491. .tm Not a \-mdoc command: .LP
  492. ..
  493. .de PP
  494. .tm Not a \-mdoc command: .PP
  495. ..
  496. .de pp
  497. .tm Not a \-mdoc command: .pp
  498. ..
  499. .de Co
  500. .tm Not a \-mdoc command: .Co
  501. ..
  502. .nr z. 1
  503. .nr z, 1
  504. .nr z: 1
  505. .nr z; 1
  506. .nr z) 1
  507. .nr z( 1
  508. .nr z[ 1
  509. .nr z] 1
  510. .\" This is disgusting, troff not parse if stmt properly
  511. .nr z1 0
  512. .nr z2 0
  513. .nr z3 0
  514. .nr z4 0
  515. .nr z5 0
  516. .nr z6 0
  517. .nr z7 0
  518. .nr z8 0
  519. .nr z9 0
  520. .nr z0 0
  521. .nr z# 0
  522. .\"
  523. .de Ad
  524. .ie \\n(.$==0 \{\
  525. .       tm Usage: .Ad address [...] \\*(Pu
  526. .\}
  527. .el \{\
  528. .       ds sV \\*(aD
  529. .       nr cF \\n(.f
  530. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  531. .       el .as f1 \&\\*(sV
  532. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  533. .       ft \\n(cF
  534. .\}
  535. ..
  536. .\"
  537. .\" Command Line Argument Macro
  538. .\"
  539. .de Ar
  540. .ie \\n(.$==0 \{\
  541. .       ie !"\\*(iM"" .as f1 \&[\|\\*(aRfile\ ...\fP\|]
  542. .       el \&[\|\\*(aRfile\ ...\fP\|]
  543. .\}
  544. .el \{\
  545. .       ds sV \\*(aR
  546. .       nr cF \\n(.f
  547. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  548. .       el .as f1 \&\\*(sV
  549. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  550. .       ft \\n(cF
  551. .\}
  552. ..
  553. .\"
  554. .de Em
  555. .ie \\n(.$==0 \{\
  556. .       tm Usage: .Em text ... \\*(Pu
  557. .\}
  558. .el \{\
  559. .       ds sV \\*(eM
  560. .       nr cF \\n(.f
  561. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  562. .       el .as f1 \&\\*(sV
  563. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  564. .       ft \\n(cF
  565. .\}
  566. ..
  567. .\"
  568. .de Er
  569. .ie \\n(.$==0 \{\
  570. .       tm Usage: .Er ERRNOTYPE ... \\*(Pu
  571. .       \}
  572. .el \{\
  573. .       ds sV \\*(eR
  574. .       nr cF \\n(.f
  575. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  576. .       el .as f1 \&\\*(sV
  577. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  578. .       ft \\n(cF
  579. .\}
  580. ..
  581. .\"
  582. .de Ev
  583. .ie \\n(.$==0 \{\
  584. .    tm Usage: .Ev ENVIRONMENT_VARIABLE(s) ... \\*(Pu
  585. .    \}
  586. .el \{\
  587. .    ds sV \\*(eV
  588. .    nr cF \\n(.f
  589. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  590. .       el .as f1 \&\\*(sV
  591. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  592. .    ft \\n(cF
  593. .\}
  594. ..
  595. .\"
  596. .\" Flag Name Macro
  597. .\"
  598. .de Fl
  599. .ie \\n(.$==0 \{\
  600. .       ie !"\\*(iM"" .as f1 \&\\*(fL\-\fP
  601. .       el \&\\*(fL\-\fP
  602. .\}
  603. .el \{\
  604. .       nr rZ 0
  605. .       sW \\$1
  606. .       if (\\n(sW==1&\\n(.$==1) .rZ \\$1
  607. .       ds sV \\*(fL
  608. .       nr cF \\n(.f
  609. .       ie \\n(rZ \{\
  610. .               ie "\\*(iM"" .ds f1 \&\\*(sV\-\f\\n(cF\\$1
  611. .               el \&\\*(sV\-\f\\n(cF\\$1
  612. .       \}
  613. .    el \{\
  614. .           ie "\\*(iM"" .ds f1 \&\\*(sV
  615. .           el .as f1 \&\\*(sV
  616. .           fB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  617. .           ft \\n(cF
  618. .    \}
  619. .\}
  620. ..
  621. .\"    Interactive Commands Macro
  622. .\"
  623. .de Ic
  624. .ie \\n(.$==0 \{\
  625. .    tm Usage: .Ic Interactive Commands(s) ... \\*(Pu
  626. .\}
  627. .el \{\
  628. .       ds sV \\*(iC
  629. .       nr cF \\n(.f
  630. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  631. .       el .as f1 \&\\*(sV
  632. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  633. .       ft \\n(cF
  634. .\}
  635. ..
  636. .\"
  637. .\" Interactive Command Modifiers (flags)
  638. .\"
  639. .de Cm
  640. .ie \\n(.$==0 \{\
  641. .    tm Usage: .Cm Interactive Command Modifier(s) ... \\*(Pu
  642. .\}
  643. .el \{\
  644. .       ds sV \\*(cM
  645. .       nr cF \\n(.f
  646. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  647. .       el .as f1 \&\\*(sV
  648. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  649. .       ft \\n(cF
  650. .\}
  651. ..
  652. .\"
  653. .de Li
  654. .ie \\n(.$==0 \{\
  655. .       tm Usage: .Li literal ... \\*(Pu
  656. .       \}
  657. .el \{\
  658. .       ds sV \\*(lI
  659. .       nr cF \\n(.f
  660. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  661. .       el .as f1 \&\\*(sV
  662. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  663. .       ft \\n(cF
  664. .\}
  665. ..
  666. .\" If in nroff or any other case where the default font
  667. .\" is constant width, and literal means zilch, single quote instead.
  668. .ie n \{\
  669. .de Ql
  670. .    ie \\n(.$==0 \{\
  671. .           tm Usage: .Ql literal ... \\*(Pu
  672. .       \}
  673. .    el \{\
  674. .        Sq \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  675. .    \}
  676. ..
  677. .\}
  678. .el \{\
  679. .de Ql
  680. .    ie \\n(.$==0 \{\
  681. .           tm Usage: .Ql literal ... \\*(Pu
  682. .       \}
  683. .    el \{\
  684. .        Li \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  685. .    \}
  686. ..
  687. .\}
  688. .\"
  689. .de Nm
  690. .ie \\n(.$==0 \{\
  691. .    if "\\*(n1"" .tm Usage: .Nm Name(s) ... \\*(Pu
  692. .    ie !"\\*(iM"" .as f1 \&\\*(nM\\*(n1\\$1\fP
  693. .    el \&\\*(nM\\*(n1\\$1\fP
  694. .\}
  695. .el \{\
  696. .    ds sV \\*(nM
  697. .    nr cF \\n(.f
  698. .    if \\n(nS \{\
  699. .        rs
  700. .        in -\\n(iSu
  701. .        ie \\n(nS>1 .br
  702. .        el \{\
  703. .            sW \\$1
  704. .            nr iS ((\\n(sW+1)*\\n(fW)u
  705. .        \}
  706. .        in +\\n(iSu
  707. .        ti -\\n(iSu
  708. .        nr nS \\n(nS+1
  709. .    \}
  710. .    if "\\*(n1"" .ds n1 \\$1
  711. .    ie "\\*(iM"" .ds f1 \&\\*(sV
  712. .    el .as f1 \&\\*(sV
  713. .    nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  714. .    ft \\n(cF
  715. .\}
  716. ..
  717. .\"
  718. .de Pa
  719. .ie \\n(.$==0 \{\
  720. \&\\*(pA~\fP
  721. .\}
  722. .el \{\
  723. .       ds sV \\*(pA
  724. .       nr cF \\n(.f
  725. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  726. .       el .as f1 \&\\*(sV
  727. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  728. .       ft \\n(cF
  729. .\}
  730. ..
  731. .\"
  732. .de Sy
  733. .ie \\n(.$==0 \{\
  734. .       tm Usage: .Sy Symbolic Text ... \\*(Pu
  735. .       \}
  736. .el \{\
  737. .       ds sV \\*(sY
  738. .       nr cF \\n(.f
  739. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  740. .       el .as f1 \&\\*(sV
  741. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  742. .       ft \\n(cF
  743. .\}
  744. ..
  745. .\"
  746. .de Ms
  747. .ie \\n(.$==0 \{\
  748. .       tm Usage: .Ms Math Symbol ... \\*(Pu
  749. .       \}
  750. .el \{\
  751. .       ds sV \\*(sY
  752. .       nr cF \\n(.f
  753. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  754. .       el .as f1 \&\\*(sV
  755. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  756. .       ft \\n(cF
  757. .\}
  758. ..
  759. .\"
  760. .de Va
  761. .ie \\n(.$==0 \{\
  762. .       tm Usage: .Va variable_name(s) ... \\*(Pu
  763. .\}
  764. .el \{\
  765. .       ds sV \\*(vA
  766. .       nr cF \\n(.f
  767. .       ie "\\*(iM"" .ds f1 \&\\*(sV
  768. .       el .as f1 \&\\*(sV
  769. .       nB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  770. .       ft \\n(cF
  771. .\}
  772. ..
  773. .\"
  774. .de nB
  775. .hy 0
  776. .if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?
  777. .ie \\n(.$>1 \{\
  778. .    rZ \\$1
  779. .    ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP
  780. .    el .as f1 \&\\$1
  781. .    rZ \\$2
  782. .    if !\\n(rZ \{\
  783. .        ie !"\\*(iM""\{\
  784. .\"            I surrender
  785. .            if "\\*(iM"Tp" .as f1 \&\ \&
  786. .            if "\\*(iM"Dp" .as f1 \&\ \&
  787. .            if "\\*(iM"Op" .as f1 \&\ \&
  788. .            if "\\*(iM"Cx" .as f1 \&\ \&
  789. .            if "\\*(iM"Dq" .as f1 \& \&
  790. .            if "\\*(iM"Sq" .as f1 \& \&
  791. .            if "\\*(iM"Pq" .as f1 \& \&
  792. .            if "\\*(iM"Aq" .as f1 \& \&
  793. .        \}
  794. .        el .as f1 \& \&
  795. .    \}
  796. .    nB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  797. .\}
  798. .el \{\
  799. .    rZ \\$1
  800. .    ie \\n(rZ .as f1 \&\f\\n(cF\\$1
  801. .    el .as f1 \&\\$1\f\\n(cF
  802. .    if "\\*(iM"" \{\&\\*(f1
  803. .        ds f1
  804. .    \}
  805. .    hy
  806. .\}
  807. ..
  808. .de fB
  809. .hy 0
  810. .if \\n(.$==0 .tm Usage error: called with empty arguments (empty quotes)?
  811. .ie \\n(.$>1 \{\
  812. .    rZ \\$1
  813. .    ie \\n(rZ .as f1 \&\f\\n(cF\\$1\fP
  814. .    el \{\
  815. .        ie "\\$1"-" .as f1 \&\-\-
  816. .        el .as f1 \&\-\\$1
  817. .    \}
  818. .    rZ \\$2
  819. .    if !\\n(rZ \{\
  820. .        ie !"\\*(iM""\{\
  821. .\"            I surrender
  822. .            if "\\*(iM"Tp" .as f1 \&\ \&
  823. .            if "\\*(iM"Dp" .as f1 \&\ \&
  824. .            if "\\*(iM"Op" .as f1 \&\ \&
  825. .            if "\\*(iM"Cx" .as f1 \&\ \&
  826. .            if "\\*(iM"Dq" .as f1 \& \&
  827. .            if "\\*(iM"Sq" .as f1 \& \&
  828. .            if "\\*(iM"Pq" .as f1 \& \&
  829. .            if "\\*(iM"Aq" .as f1 \& \&
  830. .        \}
  831. .        el .as f1 \& \&
  832. .    \}
  833. .    fB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  834. .\}
  835. .el \{\
  836. .    rZ \\$1
  837. .    ie \\n(rZ .as f1 \&\f\\n(cF\\$1
  838. .    el \{\
  839. .        ie "\\$1"-" .as f1 \&\-\-\f\\n(cF
  840. .        el .as f1 \&\-\\$1\f\\n(cF
  841. .    \}
  842. .    if "\\*(iM"" \{\&\\*(f1
  843. .        ds f1
  844. .    \}
  845. .    hy
  846. .\}
  847. ..
  848. .\"
  849. .\" Single quoted Items
  850. .\" eF, sB g[0-9] and f2
  851. .de Sq
  852. .nr eF 0
  853. .ie \\n(.$==0 \{\
  854. .       ie "\\*(iM"" \&\\*(sL\&\\*sR
  855. .       el .as f1 \&\\*(sL\&\\*(sR
  856. .\}
  857. .el \{\
  858. .       ie "\\*(iM"" \{\
  859. .        ds f1 \&\\*(sL
  860. .        ds iM Sq
  861. .    \}
  862. .       el .as f1 \&\\*(sL
  863. .       sB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  864. .    ie \\n(eF>0 .\\*(g1 \\*(g2 \\*(g3 \\*(g4 \\*(g5 \\*(g6 \\*(g7 \\*(g8
  865. .    el .as f1 \\*(g0
  866. .    as f1 \\*(sR
  867. .    if !"\\*(f2"" .as f1 \\*(f2
  868. .    if "\\*(iM"Sq" \{\
  869. \&\\*(f1
  870. .        ds f1
  871. .        ds iM
  872. .    \}
  873. .    ds f2
  874. .    rm  g0 g1 g2 g3 g4 g5 g6 g7 g8 g9
  875. .    nr eF 0
  876. .\}
  877. ..
  878. .\"
  879. .\" Double quoted Items
  880. .de Dq
  881. .nr Ef 0
  882. .ie \\n(.$==0 \{\
  883. .       ie "\\*(iM"" \&\\*(Lq\&\\*(Rq
  884. .       el .as f1 \&\\*(Lq\&\\*(Rq
  885. .\}
  886. .el \{\
  887. .       ie "\\*(iM"" \{\
  888. .               ds f1 \&\\*(Lq
  889. .               ds iM Dq
  890. .       \}
  891. .       el .as f1 \&\\*(Lq
  892. .       Sb \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  893. .       ie \\n(Ef>0 .\\*(k1 \\*(k2 \\*(k3 \\*(k4 \\*(k5 \\*(k6 \\*(k7 \\*(k8
  894. .       el .as f1 \\*(k0
  895. .       as f1 \\*(Rq
  896. .       if !"\\*(f4"" .as f1 \\*(f4
  897. .       if "\\*(iM"Dq" \{\
  898. \&\\*(f1
  899. .               ds f1
  900. .               ds iM
  901. .       \}
  902. .       ds f4
  903. .       rm  k0 k1 k2 k3 k4 k5 k6 k7 k8 k9
  904. .       nr Ef 0
  905. .\}
  906. ..
  907. .\"
  908. .\" Parenthesis quoted Items
  909. .de Pq
  910. .nr pQ 0
  911. .ie \\n(.$==0 \{\
  912. .       ie "\\*(iM"" \&(\&)
  913. .       el .as f1 \&(\&)
  914. .\}
  915. .el \{\
  916. .       ie "\\*(iM"" \{\
  917. .               ds f1 \&(
  918. .               ds iM Pq
  919. .       \}
  920. .       el .as f1 \&(
  921. .       pB \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  922. .       ie \\n(pQ>0 .\\*(y1 \\*(y2 \\*(y3 \\*(y4 \\*(y5 \\*(y6 \\*(y7 \\*(y8
  923. .       el .as f1 \\*(y0
  924. .       as f1 \&)
  925. .       if !"\\*(f3"" .as f1 \\*(f3
  926. .       if "\\*(iM"Pq" \{\
  927. \&\\*(f1
  928. .               ds f1
  929. .               ds iM
  930. .       \}
  931. .       ds f3
  932. .       rm  y0 y1 y2 y3 y4 y5 y6 y7 y8 y9
  933. .       nr pQ 0
  934. .\}
  935. ..
  936. .\" eF, sB g[0-9] and f2
  937. .de sB
  938. .hy 0
  939. .ie \\n(.$==0 .tm Sick Logic: macro sB
  940. .el \{\
  941. .    ie \\n(eF>=1 .nr eF \\n(eF+1
  942. .    el \{\
  943. .        mN \\$1
  944. .        if \\n(mN .nr eF \\n(eF+1
  945. .    \}
  946. .       rZ \\$1
  947. .       ie \\n(rZ .as f2 \\$1
  948. .       el \{\
  949. .        ie \\n(eF<1 .as g\\n(eF \\$1
  950. .        el .as g\\n(eF \\$1
  951. .    \}
  952. .       if \\n(.$>1 \{\
  953. .        rZ \\$2
  954. .            if \\n(rZ==0 \{\
  955. .            if \\n(eF<1 \{\
  956. .                as g\\n(eF \& \&
  957. .            \}
  958. .        \}
  959. .        sB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  960. .    \}
  961. .\}
  962. ..
  963. .de Sb
  964. .hy 0
  965. .ie \\n(.$==0 .tm Sick Logic: macro Sb
  966. .el \{\
  967. .       ie \\n(Ef>=1 .nr Ef \\n(Ef+1
  968. .    el \{\
  969. .        mN \\$1
  970. .            if \\n(mN .nr Ef \\n(Ef+1
  971. .    \}
  972. .       rZ \\$1
  973. .       ie \\n(rZ .as f4 \\$1
  974. .       el \{\
  975. .               ie \\n(Ef<1 .as k\\n(Ef \\$1
  976. .               el .as k\\n(Ef \\$1
  977. .       \}
  978. .       if \\n(.$>1 \{\
  979. .               rZ \\$2
  980. .               if \\n(rZ==0 \{\
  981. .                       if \\n(Ef<1 \{\
  982. .                               as k\\n(Ef \& \&
  983. .                       \}
  984. .               \}
  985. .               Sb \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  986. .       \}
  987. .\}
  988. ..
  989. .de pB
  990. .hy 0
  991. .ie \\n(.$==0 .tm Sick Logic: macro pB
  992. .el \{\
  993. .       ie \\n(pQ>=1 .nr pQ \\n(pQ+1
  994. .       el \{\
  995. .               mN \\$1
  996. .               if \\n(mN .nr pQ \\n(pQ+1
  997. .       \}
  998. .       rZ \\$1
  999. .       ie \\n(rZ .as f3 \\$1
  1000. .       el \{\
  1001. .               ie \\n(pQ<1 .as y\\n(pQ \\$1
  1002. .               el .as y\\n(pQ \\$1
  1003. .       \}
  1004. .       if \\n(.$>1 \{\
  1005. .               rZ \\$2
  1006. .               if \\n(rZ==0 \{\
  1007. .                       if \\n(pQ<1 \{\
  1008. .                               as y\\n(pQ \& \&
  1009. .                       \}
  1010. .               \}
  1011. .               pB \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1012. .       \}
  1013. .\}
  1014. ..
  1015. .de aQ
  1016. .hy 0
  1017. .ie \\n(.$==0 .tm Bad Syntax: .Aq
  1018. .el \{\
  1019. .       ie \\n(aQ>=1 .nr aQ \\n(aQ+1
  1020. .       el \{\
  1021. .               mN \\$1
  1022. .               if \\n(mN .nr aQ \\n(aQ+1
  1023. .       \}
  1024. .       rZ \\$1
  1025. .       ie \\n(rZ .as aZ \\$1
  1026. .       el \{\
  1027. .               ie \\n(aQ<1 .as a\\n(aQ \\$1
  1028. .               el .as a\\n(aQ \\$1
  1029. .       \}
  1030. .       if \\n(.$>1 \{\
  1031. .               rZ \\$2
  1032. .               if \\n(rZ==0 \{\
  1033. .                       if \\n(aQ<1 \{\
  1034. .                               as a\\n(aQ \& \&
  1035. .                       \}
  1036. .               \}
  1037. .               aQ \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1038. .       \}
  1039. .\}
  1040. ..
  1041. .\" Angle Bracket Quoted Items
  1042. .de Aq
  1043. .nr aQ 0
  1044. .ie \\n(.$==0 \{\
  1045. .       ie "\\*(iM"" \&<\&>
  1046. .       el .as f1 \&<\&>
  1047. .\}
  1048. .el \{\
  1049. .       ie "\\*(iM"" \{\
  1050. .               ds f1 \&<
  1051. .               ds iM Aq
  1052. .       \}
  1053. .       el .as f1 \&<
  1054. .       aQ \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1055. .       ie \\n(aQ>0 .\\*(a1 \\*(a2 \\*(a3 \\*(a4 \\*(a5 \\*(a6 \\*(a7 \\*(a8
  1056. .       el .as f1 \\*(a0
  1057. .       as f1 \&>
  1058. .       if !"\\*(aZ"" .as f1 \\*(aZ
  1059. .       if "\\*(iM"Aq" \{\
  1060. \&\\*(f1
  1061. .               ds f1
  1062. .               ds iM
  1063. .       \}
  1064. .       ds aZ
  1065. .       rm  a0 a1 a2 a3 a4 a5 a6 a7 a8
  1066. .       nr aQ 0
  1067. .\}
  1068. ..
  1069. .\" macro Name test, return macro register value if true
  1070. .de mN
  1071. .nr mN 0
  1072. .sW \\$1
  1073. .if \\n(sW==2 \{\
  1074. .    if \\n(\\$1 .nr mN \\n(\\$1
  1075. .\}
  1076. ..
  1077. .\" Punctuation test (using z registers), return 1 if true
  1078. .de rZ
  1079. .nr rZ 0
  1080. .sW \\$1
  1081. .if \\n(sW==1 \{\
  1082. .    if \\n(z\\$1==1 \{\
  1083. .        nr rZ 1
  1084. .    \}
  1085. .\}
  1086. ..
  1087. .\"
  1088. .\" sW returns number of characters in a string
  1089. .if t \{\
  1090. .nr fW \w'\fC,'
  1091. .de sW
  1092. .nr sW \w'\fC\\$1'
  1093. .\}
  1094. .if n \{\
  1095. .nr fW \w'0'
  1096. .de sW
  1097. .nr sW \w'\\$1'
  1098. .\}
  1099. .ie \\n(sW>=\\n(fW \{\
  1100. .    ie \\n(sW%\\n(fW .nr sW (\\n(sW/\\n(fW)+1
  1101. .    el .nr sW \\n(sW/\\n(fW
  1102. .\}
  1103. .el .nr sW 0
  1104. ..
  1105. .\"    Option Expression -
  1106. .\"    TODO - add line overflow check (right!)
  1107. .nr eP 0
  1108. .ds e1
  1109. .nr oE 0
  1110. .nr hP 0
  1111. .ds hP
  1112. .nr Ep 0
  1113. .de Op
  1114. .hy 0
  1115. .if "\\*(iM"" \{\
  1116. .    ds iM Op
  1117. .       ds f1 \&
  1118. .\}
  1119. .as f1 \&\\*(lB
  1120. .\" .tm Op:  \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1121. .dO \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1122. .ie !"\\$1"Cx" .oE
  1123. .el .nr oE \\n(oE+1
  1124. ..
  1125. .\"
  1126. .\" just for mike, with every bite of garlic in mind (oops, i mean burp).
  1127. .\" dO: go dOwn an argument vector and test each argument to see if
  1128. .\" a macro name or punctuation. stash in respective place along
  1129. .\" with its arguments.
  1130. .nr oO 0
  1131. .nr oP 0
  1132. .nr aO 0
  1133. .de dO
  1134. .mN \\$1
  1135. .ie \\n(mN \{\
  1136. .       if \\n(oP  \{\
  1137. .               if \\n(hP \{\
  1138. .                       nr oZ 1
  1139. .                       oZ
  1140. .                       Oz
  1141. .               \}
  1142. .               if \\n(e1==1 \{\
  1143. .\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9
  1144. .               \}
  1145. .               uO
  1146. .        if !(\\n(oO:\\n(aO) .as f1 \& \&
  1147. .    \}
  1148. .       ie "\\$1"Op" \{\
  1149. .               as f1 \&\\*(lB
  1150. .               nr aO \\n(aO+1
  1151. .       \}
  1152. .    el \{\
  1153. .               nr eP \\n(eP+1
  1154. .               ds e\\n(eP \\$1
  1155. .               nr e\\n(eP 1
  1156. .       \}
  1157. .\}
  1158. .el \{\
  1159. .\" .tm dO: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE
  1160. .    rZ \\$1
  1161. .    ie \\n(rZ \{\
  1162. .\" .tm dO:rZ: $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(eP
  1163. .        nr hP \\n(hP+1
  1164. .        ds h\\n(hP \\$1
  1165. .    \}
  1166. .    el \{\
  1167. .\" .tm dO:word $1: \\$1: eP \\n(eP e[\\n(eP]: \\*(e\\n(ePEE
  1168. .        if \\n(eP==0:\\n(e\\n(eP==1 .nr eP \\n(eP+1
  1169. .        if \\n(eZ .as e\\n(eP \& \&
  1170. .        as e\\n(eP \&\\$1
  1171. .\" .        ds e\\n(eP \&\\$1
  1172. .        nr eZ \\n(eZ+1
  1173. .    \}
  1174. .\}
  1175. .nr oP 1
  1176. .ie \\n(.$>1 \{\
  1177. .    dO \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1178. .\}
  1179. .el \{\
  1180. .     ie \\n(e1 \{\
  1181. .\\*(e1 \\*(e2 \\*(e3 \\*(e4 \\*(e5 \\*(e6 \\*(e7 \\*(e8 \\*(e9
  1182. .    \}
  1183. .     el \{\
  1184. .    as f1 \\*(e1
  1185. .    \}
  1186. .\}
  1187. ..
  1188. .\" handle old style arguments such as the arg -Idir
  1189. .\" in adb, .Oo is a toggle.
  1190. .de Oo
  1191. .ie \\n(oO .nr oO 0
  1192. .el .nr oO 1
  1193. ..
  1194. .\" stash punctuation
  1195. .de oZ
  1196. .if \\n(hP>=\\n(oZ \{\
  1197. .    nr eP \\n(eP+1
  1198. .    ds e\\n(eP \\*(h\\n(oZ
  1199. .    nr oZ \\n(oZ+1
  1200. .    oZ
  1201. .\}
  1202. ..
  1203. .\" clean up punctuation vector
  1204. .de Oz
  1205. .if \\n(hP>0 \{\
  1206. .    rm h\\n(hP
  1207. .    nr hP \\n(hP-1
  1208. .    Oz
  1209. .\}
  1210. ..
  1211. .\" uO: go back up created vector cleaning it up along the way
  1212. .de uO
  1213. .if \\n(eP>0 \{\
  1214. .    rm e\\n(eP
  1215. .    rr e\\n(eP
  1216. .    nr eP \\n(eP-1
  1217. .    nr oP 0
  1218. .    nr eZ 0
  1219. .    uO
  1220. .\}
  1221. ..
  1222. .\" option end
  1223. .de oE
  1224. .uO
  1225. .ie \\n(hP \{\
  1226. .       as f1 \\*(rB\\*(h1\\*(h2\\*(h3
  1227. .    Oz
  1228. .    nr oZ 0
  1229. .\}
  1230. .el \{\
  1231. .    as f1 \\*(rB
  1232. .\}
  1233. .ie "\\*(iM"Op" \{\
  1234. .    if \\n(aO .aO
  1235. .if t \{\
  1236. .    if (\\n(.lu-\\n(.ku-\\n(.ou-(2*\\n(fWu))<\w'\fC\\*(f1'u .br
  1237. .\}
  1238. .if n \{\
  1239. .    nr aa \w'\\*(f1'u
  1240. .\" .    nr qq \\n(.lu-\\n(.ku-\\n(.ou
  1241. .\" \&aa == \\n(aa, f1==\\*(f1, qq==\\n(qq
  1242. .    if (\\n(.lu-\\n(.ku-\\n(.ou-\\n(aau)<=(8*\\n(fWu) .br
  1243. .\}
  1244. \&\\*(f1
  1245. .    ds iM
  1246. .    ds f1
  1247. .    hy
  1248. .\}
  1249. .el .nr oE \\n(oE-1
  1250. ..
  1251. .de aO
  1252. .as f1 \\*(rB
  1253. .nr aO \\n(aO-1
  1254. .if \\n(aO >0 .aO
  1255. ..
  1256. .\"
  1257. .de Xr
  1258. .if \\n(.$<=1 \{\
  1259. .    ie \\n(.$==1 \{\
  1260. .        if !"\\*(iM"" .as f1 \&\\*(xR\\$1\fP
  1261. .        if "\\*(iM"" \&\\*(xR\\$1\fP
  1262. .    \}
  1263. .    el .tm Xr Usage: .Xr manpage_name [section#] \\*(Pu
  1264. .\}
  1265. .if \\n(.$==2 \{\
  1266. .    rZ \\$2
  1267. .    ie "\\*(iM"" \{\
  1268. .        ie \\n(rZ \&\\*(xR\\$1\fP\\$2
  1269. .        el \&\\*(xR\\$1\fP(\\$2)
  1270. .    \}
  1271. .    el \{\
  1272. .        ie \\n(rZ .as f1 \&\\*(xR\\$1\fP\\$2
  1273. .        el .as f1 \&\\*(xR\\$1\fP(\\$2)
  1274. .    \}
  1275. .\}
  1276. .if \\n(.$>=3 \{\
  1277. .    rZ \\$2
  1278. .    ie \\n(rZ \{\
  1279. .        ie !"\\*(iM"" .as f1 \&\\*(xR\\$1\fP\\$2\\$3\\$4\\$5\\$6\\$7\\$8
  1280. .        el \&\\*(xR\\$1\fP\\$2\\$3\\$4\\$5\\$6\\$7\\$8
  1281. .    \}
  1282. .    el \{\
  1283. .        rZ \\$3
  1284. .        ie \\n(rZ \{\
  1285. .            if !"\\*(iM"" \{\
  1286. .                 as f1 \&\\*(xR\\$1\fP(\\$2)\\$3\\$4\\$5\\$6\\$7\\$8
  1287. .            \}
  1288. .            if "\\*(iM"" \{\
  1289. \&\\*(xR\\$1\fP(\\$2)\\$3\\$4\\$5\\$6\\$7\\$8
  1290. .            \}
  1291. .        \}
  1292. .        el \{\
  1293. .            tm rZ = \\n(rZ  the arg is \\$3
  1294. .            tm Xr-XX Usage: .Xr manpage_name [section#] \\*(Pu
  1295. .        \}
  1296. .    \}
  1297. .\}
  1298. ..
  1299. .\"
  1300. .\"
  1301. .de Ex
  1302. .tm Ex defunct, Use .Dl: \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1303. ..
  1304. .\" Display (one) Line of text.
  1305. .de Dl
  1306. .ie "\\*(iM"" \{\
  1307. '    ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
  1308. .    in \\n(.iu+\\n(Dsu
  1309. .    mN \\$1
  1310. .    ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1311. .    el \{\
  1312. .        nr cF \\n(.f
  1313. .\"     Literal font is none specified
  1314. \&\\*(lI\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1315. .        ft \\n(cF
  1316. .    \}
  1317. .    in \\n(.iu-\\n(Dsu
  1318. .\}
  1319. .el \{\
  1320. .    mN \\$1
  1321. .    ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1322. .    el \{\
  1323. .        nr cF \\n(.f
  1324. .        ds f1 \&\\*(lI\\&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1325. .        as f1 \&\f\\n(cF
  1326. .    \}
  1327. .\}
  1328. ..
  1329. .\"
  1330. .\"
  1331. .\" user set Tagged Paragraph Width (used in both Dp and Tp)
  1332. .de Tw
  1333. .ie \\n(.$==0 \{\
  1334. .    nr aa 0
  1335. .\}
  1336. .el \{\
  1337. .    mN \\$1
  1338. .    ie \\n(sW>2 \{\
  1339. .        nr tW (\\n(sW+3)*\\n(fWu)
  1340. .    \}
  1341. .    el \{\
  1342. .        ie \\n(mN .nr tW \\n(mN
  1343. .        el .nr tW \\$1
  1344. .    \}
  1345. .    nr tF 1
  1346. .\}
  1347. ..
  1348. .\"
  1349. .de Dw
  1350. .Tw \\$1
  1351. ..
  1352. .\"
  1353. .de Di
  1354. .ie \\n(.$==0 \{\
  1355. .    nr tI \\n(Dsu
  1356. .\}
  1357. .el \{\
  1358. .    sW \\$1
  1359. .    if \\n(sW>=2 \{\
  1360. .        nr tI \\$1u
  1361. .    \}
  1362. .    if \\n(sW<2 \{\
  1363. .        if "\\$1"L" \{\
  1364. .            nr tI 0
  1365. .        \}
  1366. .    \}
  1367. .\}
  1368. ..
  1369. .\" tagged paragraph
  1370. .\" initialize baby stack variables
  1371. .nr np 0
  1372. .nr p1 0
  1373. .ds s\n(np
  1374. .\"
  1375. .de Tp
  1376. .ie "\\$1"" .pE p s np
  1377. .el \{\
  1378. .    ds iM Tp
  1379. .    mN \\$1
  1380. .    ie \\n(tF \{\
  1381. .        ds tC Tw
  1382. .        nr tC 1
  1383. .        nr tF 0
  1384. .    \}
  1385. .    el \{\
  1386. .        if !"Tw"\\*(s\\n(np" \{\
  1387. .            ie \\n(mN \{\
  1388. .                ds tC \\$1
  1389. .                nr tW \\n(mN
  1390. .            \}
  1391. .            el \{\
  1392. .                ds tC Tx
  1393. .                nr tW \\n(Tx
  1394. .            \}
  1395. .            if !"\\*(tC"\\*(s\\n(np" .nr tC 1
  1396. .        \}
  1397. .    \}
  1398. .    sp \\n(vVu
  1399. .    if !\\n(cR .ne 2
  1400. .    if \\n(tC \{\
  1401. .        nr np \\n(np+1
  1402. .        nr p\\n(np \\n(tW
  1403. .        ds s\\n(np \\*(tC
  1404. .        nr tC 0
  1405. .        ds tC
  1406. .        in \\n(.iu+\\n(p\\n(npu
  1407. .    \}
  1408. .    ie \\n(mN \{\
  1409. .        ds f1
  1410. .        \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1411. .        if !"\\$1"Cx" .pT st p np
  1412. .    \}
  1413. .    el \{\
  1414. .        br
  1415. .        ev 1
  1416. .        fi
  1417. .        di Td
  1418. \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1419. .        br
  1420. .        di
  1421. .        ev
  1422. .        na
  1423. .        ds tD \\*(Td\\
  1424. .        pT di p np
  1425. .    \}
  1426. .\}
  1427. ..
  1428. .\"
  1429. .\"
  1430. .\" Complex Expression Macro
  1431. .\"
  1432. .\"     TODO: add length across line boundary check (like Li)
  1433. .de Cx
  1434. .hy 0
  1435. .ie \\n(.$==0 \{\
  1436. .    if "\\*(iM"Cx" \{\
  1437. .        ds iM
  1438. .        if \\n(oE .oE
  1439. \&\\*(f1
  1440. .        ds f1
  1441. .    \}
  1442. .    if "\\*(iM"Tp" .pT st p np
  1443. .    if "\\*(iM"Dp" .pT st q mp
  1444. .\}
  1445. .el \{\
  1446. .    if "\\*(iM"" \{\
  1447. .        ds iM Cx
  1448. .        ds f1 \&
  1449. .    \}
  1450. .    mN \\$1
  1451. .\" Here are the args: `\\$1'  `\\$2'  `\\$3'  `\\$4'
  1452. .    ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1453. .    el \{\
  1454. .        as f1 \&\\$1
  1455. .        if \\n(.$>1 .Cx \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1456. .    \}
  1457. .\}
  1458. ..
  1459. .\" Prefix string in default font to content specified string
  1460. .de Pf
  1461. .Cx \\$1
  1462. .\\$2 \\$3 \\$4 \\$5
  1463. .Cx
  1464. ..
  1465. .\" Suffix string in default font to content specified string
  1466. .de Sf
  1467. .Cx \\$1 \\$2
  1468. .Cx \\$3
  1469. .Cx
  1470. ..
  1471. .\" Simple Option Begin
  1472. .de Ob
  1473. .hy 0
  1474. .ie "\\*(iM"" \{\
  1475. .    ev 2
  1476. .    fi
  1477. .    di oB
  1478. .\}
  1479. .el \{\
  1480. .tm shouldn't be here
  1481. .    as f1 \&[
  1482. .    mN \\$1
  1483. .    ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1484. .    el \{\
  1485. .        as f1 \&\\$1
  1486. .        if \\n(.$>1 .Oc \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1487. .    \}
  1488. .\}
  1489. ..
  1490. .de Oc
  1491. .as f1 \&\\$1
  1492. .if \\n(.$>1 .Oc \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1493. ..
  1494. .de Oe
  1495. .hy 0
  1496. .ie "\\*(iM"" \{\
  1497. .    br
  1498. .    di
  1499. .    ev
  1500. .    ds bO \\*(oB\\
  1501. \&[\\*(bO\&]
  1502. .\}
  1503. .el \{\
  1504. .    as f1 \&]
  1505. .\}
  1506. ..
  1507. .\" White space for Cx
  1508. .de Ws
  1509. .Cx \&\ \&
  1510. ..
  1511. .\" tagged paragraph
  1512. .\" initialize baby stack variables
  1513. .nr mp 0
  1514. .nr q1 0
  1515. .ds r\n(np
  1516. .\"
  1517. .\" Complex Dp tag
  1518. .de Dc
  1519. .Dp Cx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1520. ..
  1521. .\" Complex Tp tag
  1522. .de Tc
  1523. .Tp Cx \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8
  1524. ..
  1525. .\" Tag with a flag and an argument with a space
  1526. .de Ta
  1527. .if "\\$2"" \{\
  1528. .    Tp Fl \\$1
  1529. .\}
  1530. .el \{\
  1531. .    Tp Fl \\$1
  1532. .    Cx \&\ \&
  1533. .    Ar \\$2 \\$3
  1534. .    Cx
  1535. .\}
  1536. ..
  1537. .de Da
  1538. .Dp Cx Fl \\$1
  1539. .Ws
  1540. .Ar \\$2 \\$3
  1541. .Cx
  1542. ..
  1543. .de To
  1544. .Tp Cx Fl \\$1
  1545. .Ar \\$2 \\$3
  1546. .Cx
  1547. ..
  1548. .de Do
  1549. .Dp Cx Fl \\$1
  1550. .Ar \\$2 \\$3
  1551. .Cx
  1552. ..
  1553. .\" Blended tag toggle
  1554. .de Bt
  1555. .ie \\n(tP==0 .nr tP 1
  1556. .el .nr tP 0
  1557. ..
  1558. .\" Bullet paragraph
  1559. .de Bu
  1560. .Tp Sy \&\(bu
  1561. ..
  1562. .\" Display tagged paragraph
  1563. .de Dp
  1564. .ie "\\$1"" \{\
  1565. .    pE q r mp
  1566. .    sp \\n(vVu
  1567. .\}
  1568. .el \{\
  1569. .       ds iM Dp
  1570. .       mN \\$1
  1571. .       ie \\n(tF \{\
  1572. .               ds tC Tw
  1573. .               nr tC 1
  1574. .               nr tF 0
  1575. .       \}
  1576. .       el \{\
  1577. .               if !"Tw"\\*(r\\n(mp" \{\
  1578. .                       ie \\n(mN \{\
  1579. .                               ds tC \\$1
  1580. .                               nr tW \\n(mN
  1581. .                       \}
  1582. .                       el \{\
  1583. .                               ds tC Tx
  1584. .                               nr tW \\n(Tx
  1585. .                       \}
  1586. .                       if !"\\*(tC"\\*(r\\n(mp" .nr tC 1
  1587. .               \}
  1588. .       \}
  1589. .       if !\\n(cR .ne 2
  1590. .       if \\n(tC \{\
  1591. .               nr mp \\n(mp+1
  1592. .               nr q\\n(mp \\n(tW
  1593. .               ds r\\n(mp \\*(tC
  1594. .               nr tC 0
  1595. .               ds tC
  1596. .        ie \\n(tIu==\\n(Dsu .nr i\\n(mp \\n(Dsu
  1597. .        el \{\
  1598. .            nr i\\n(mp \\n(tIu
  1599. .            nr tI \\n(Dsu
  1600. .        \}
  1601. .                  in \\n(.iu+\\n(i\\n(mpu
  1602. .        sp \\n(vVu
  1603. .        in \\n(.iu+\\n(\\q\\n(mpu
  1604. .       \}
  1605. .       ie \\n(mN \{\
  1606. .               \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1607. .               if !"\\$1"Cx" .pT st q mp
  1608. .       \}
  1609. .       el \{\
  1610. .               br
  1611. .               ev 1
  1612. .               fi
  1613. .               di Td
  1614. \&\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1615. .               br
  1616. .               di
  1617. .               ev
  1618. .               na
  1619. .               ds tD \\*(Td\\
  1620. .               pT di q mp
  1621. .       \}
  1622. .\}
  1623. ..
  1624. .\"
  1625. .\" .pE number_stack string_stack counter
  1626. .de pE
  1627. .ie "\\$3"mp" \{\
  1628. .    in \\n(.iu-(\\n(\\$1\\n(\\$3u)-(\\n(i\\n(mpu)
  1629. .    rr i\\n(mp
  1630. .\}
  1631. .el .in \\n(.iu-\\n(\\$1\\n(\\$3u
  1632. .\" .in \\n(.iu-\\n(\\$1\\n(\\$3u
  1633. .if \\n(\\$3<=0 .tm Extraneous call .Tp or .Dp
  1634. .rr \\$1\\n(\\$3
  1635. .rm \\$2\\n(\\$3
  1636. .nr \\$3 \\n(\\$3-1
  1637. .ds iM
  1638. ..
  1639. .\"
  1640. .\" .pT [st or di] number_stack counter
  1641. .de pT
  1642. .ie "\\$1"st" \{\
  1643. .    nr bb \\n(\\$2\\n(\\$3u
  1644. .    ti -\\n(bbu
  1645. .    ie (\\n(\\$2\\n(\\$3u-2n)<=\w'\\*(f1'u \{\&\\*(f1\\*(tP
  1646. .        if \\n(tP==0 .br
  1647. .    \}
  1648. .    el \\*(f1\h'|\\n(\\$2\\n(\\$3u'\c
  1649. .\}
  1650. .el \{\
  1651. .       ti -\\n(\\$2\\n(\\$3u
  1652. .    ie (\\n(\\$2\\n(\\$3u-2n)<=\\n(dlu \{\&\\*(tD\\*(tP
  1653. .           if !\\n(tP .br
  1654. .    \}
  1655. .    el \\*(tD\h'|\\n(\\$2\\n(\\$3u-'\c
  1656. .    if t 'ad
  1657. .\}
  1658. .    ds iM
  1659. .    ds f1
  1660. 'fi
  1661. ..
  1662. .\"
  1663. .\" The new SH
  1664. .\"
  1665. .de Sh
  1666. .\" set Sh state off, check for list state before calling indent (.In)
  1667. .nr nS 0
  1668. .nr sE 0
  1669. .ie "\\$1"NAME" \{\
  1670. .\"    name state on, housekeep (headers & footers)
  1671. .    hK
  1672. '    in 0
  1673. .\}
  1674. .el \{\
  1675. .    if "\\$1"SYNOPSIS" .nr nS 1
  1676. .    in 0
  1677. .\}
  1678. .pL
  1679. 'sp
  1680. .ns
  1681. .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
  1682. .if !\\n(cR .ne 3
  1683. 'fi
  1684. \&\fB\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
  1685. \&\fP\&
  1686. .in \\n(.iu+\\n(Tiu
  1687. .if "\\$1"SEE" .nr sE 1
  1688. .ns
  1689. ..
  1690. .\"
  1691. .\" Nd minus sign for an en dash used in .Sh Name
  1692. .de Nd
  1693. \&\-\& \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1694. ..
  1695. .de Ss
  1696. .sp
  1697. .ti -.25i
  1698. \&\fB\\$1 \|\\$2 \|\\$3 \|\\$4 \|\\$5 \|\\$6 \|\\$7 \|\\$8 \|\\$9
  1699. \&\fP\&
  1700. .ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
  1701. .if !\\n(cR .ne 2
  1702. .br
  1703. ..
  1704. .\"    .if "\\$1"Ss" .in \\n(.iu+\\n(sIu
  1705. .\"..
  1706. .\"
  1707. .\"
  1708. .\" Column Macro
  1709. .\"
  1710. .hy 0
  1711. .de Cw
  1712. .ie \\n(.$==0 \{\
  1713. .    br
  1714. .    in \\n(.iu-\\n(eWu
  1715. .    ta .5i 1i 1.5i 2i 2.5i 3i 3.5i 4i 4.5i 5i 5.5i 6i 6.5i
  1716. .\}
  1717. .el \{\
  1718. .    Pp
  1719. .    if \\n(.$==1 \{\
  1720. .        ta \w'\\$1    'u
  1721. .        nr eW \w'\\$1    'u
  1722. '        in \\n(.iu+\\n(eWu
  1723. .    \}
  1724. .    if \\n(.$==2 \{\
  1725. .        ta \w'\\$1    'u +\w'\\$2    'u
  1726. .        nr eW \w'\\$1    'u+\w'\\$2    'u
  1727. '        in \\n(.iu+\\n(eWu
  1728. .    \}
  1729. .    if \\n(.$==3 \{\
  1730. .        ta \w'\\$1    'u +\w'\\$2    'u +\w'\\$3    'u
  1731. .        nr eW \w'\\$1    'u+\w'\\$2    'u+\w'\\$3    'u
  1732. '        in \\n(.iu+\\n(eWu
  1733. .    \}
  1734. .    if \\n(.$==4 \{\
  1735. .    ta \w'\\$1    'u +\w'\\$2    'u +\w'\\$3    'u +\w'\\$4    'u
  1736. .    nr eW \w'\\$1    'u+\w'\\$2    'u+\w'\\$3    'u +\w'\\$4    'u
  1737. '    in \\n(.iu+\\n(eWu
  1738. .    \}
  1739. .    if \\n(.$==5 \{\
  1740. .ta \w'\\$1    'u +\w'\\$2    'u +\w'\\$3    'u +\w'\\$4    'u +\w'\\$5    'u
  1741. .nr eW \w'\\$1    'u +\w'\\$2    'u +\w'\\$3    'u +\w'\\$4    'u +\w'\\$5    'u
  1742. '    in \\n(.iu+\\n(eWu
  1743. .    \}
  1744. .\}
  1745. ..
  1746. .de Cl
  1747. .ti -\\n(eWu
  1748. .mN \\$1
  1749. .ie \\n(mN .\\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1750. .el \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1751. ..
  1752. .nr dQ 0
  1753. .de Ds
  1754. .ie !"\\$1"" \{\
  1755. .    mN d\\$1
  1756. .    if \\n(mN \{\
  1757. .        nr dQ \\n(dQ+1
  1758. .        d\\$1
  1759. .    \}
  1760. .\}
  1761. .el .br
  1762. .nf
  1763. ..
  1764. .de Df
  1765. .ie !"\\$1"" \{\
  1766. .       mN d\\$1
  1767. .       if \\n(mN \{\
  1768. .               nr dQ \\n(dQ+1
  1769. .               d\\$1
  1770. .       \}
  1771. .\}
  1772. .el .br
  1773. ..
  1774. .de Dn
  1775. \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1776. .nf
  1777. ..
  1778. .de dI
  1779. .nr d\\n(dQ \\n(dIu
  1780. .in \\n(.iu+\\n(dIu
  1781. ..
  1782. .de dC
  1783. .nr d\\n(dQ (\\n(.l-\\n(.i)/4u
  1784. .in \\n(.iu+\\n(d\\n(dQu
  1785. ..
  1786. .de dR
  1787. .nr d\\n(dQ (\\n(.l/3)u
  1788. .in \\n(.iu+\\n(d\\n(dQu
  1789. ..
  1790. .de dL
  1791. .nr aa 0
  1792. ..
  1793. .de De
  1794. .br
  1795. .if \\n(d\\n(dQ \{\
  1796. .    in \\n(.iu-\\n(d\\n(dQu
  1797. .    rr d\\n(dQ
  1798. .    nr dQ \\n(dQ-1
  1799. .\}
  1800. .fi
  1801. ..
  1802. .\"
  1803. .de Fn
  1804. .ie \\n(.$==0 \{\
  1805. .    tm Usage: .Fn function_name function_arg(s) ... \\*(Pu
  1806. .\}
  1807. .el \{\
  1808. .    nr cF \\n(.f
  1809. .    ie \\n(.$==1 .ds f1 \&\\*(nM\\$1\fP\\*(lP\fP\\*(rP\fP
  1810. .    el \{\
  1811. .        ds f1 \\*(nM\\$1\fP\\*(lP
  1812. .        nr aa 0
  1813. .        rC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9
  1814. .    \}
  1815. .    if "\\*(iM"" \{\\&\\*(f1
  1816. .        ds f1
  1817. .    \}
  1818. .\}
  1819. ..
  1820. .\"
  1821. .de rC
  1822. .rZ \\$1
  1823. .ie \\n(rZ \{\
  1824. .    as f1 \f\\n(cF\\*(rP\f\\n(cF\\$1\\$2\\$3\\$4\\$5\\$6\\$7
  1825. .\}
  1826. .el \{\
  1827. .    ie \\n(aa .as f1 \fP, \\*(aR\\$1
  1828. .    el .as f1 \\*(aR\\$1
  1829. .    nr aa 1
  1830. .    ie \\n(.$>1 .rC \\$2 \\$3 \\$4 \\$5 \\$6 \\$7
  1831. .    el .as f1 \fP\\*(rP\fP
  1832. .\}
  1833. ..
  1834.