PageRenderTime 80ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/contrib/groff/tmac/doc.tmac

https://bitbucket.org/freebsd/freebsd-head/
Unknown | 6528 lines | 6528 code | 0 blank | 0 comment | 0 complexity | 6c11476a85141ace1a38d6cedbd96c22 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, BSD-3-Clause, LGPL-2.0, LGPL-2.1, BSD-2-Clause, 0BSD, JSON, AGPL-1.0, GPL-2.0
  1. .\" Copyright (c) 1991, 1993
  2. .\" The Regents of the University of California. All rights reserved.
  3. .\"
  4. .\" Redistribution and use in source and binary forms, with or without
  5. .\" modification, are permitted provided that the following conditions
  6. .\" are met:
  7. .\" 1. Redistributions of source code must retain the above copyright
  8. .\" notice, this list of conditions and the following disclaimer.
  9. .\" 2. Redistributions in binary form must reproduce the above copyright
  10. .\" notice, this list of conditions and the following disclaimer in the
  11. .\" documentation and/or other materials provided with the distribution.
  12. .\" 3. [Deleted. See
  13. .\" ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change]
  14. .\" 4. Neither the name of the University nor the names of its contributors
  15. .\" may be used to endorse or promote products derived from this software
  16. .\" without specific prior written permission.
  17. .\"
  18. .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  19. .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  20. .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  21. .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  22. .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  23. .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  24. .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  25. .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  26. .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  27. .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  28. .\" SUCH DAMAGE.
  29. .\"
  30. .\" @(#)doc 8.1 (Berkeley) 06/08/93
  31. .\"
  32. .\" Modified by jjc@jclark.com as follows: the doc-* files are assumed to be
  33. .\" installed as mdoc/doc-* rather than tmac.doc-* (the filename
  34. .\" `tmac.doc-common' would be too long); when using groff, the doc-* files
  35. .\" are loaded using the `mso' request.
  36. .\"
  37. .\" Modified by
  38. .\"
  39. .\" Werner LEMBERG <wl@gnu.org> and
  40. .\" Ruslan Ermilov <ru@freebsd.org>
  41. .\"
  42. .\" to make it more readable: using long names and many groff features,
  43. .\" updating and extending documentation, etc.
  44. .\"
  45. .\" %beginstrip%
  46. .
  47. .
  48. .if !\n(.g \
  49. . ab This version of mdoc can be run with GNU troff only!
  50. .
  51. .
  52. .do if d Dd .nx
  53. .
  54. .
  55. .cp 0
  56. .
  57. .
  58. .if (\n[.x]\n[.y] < 118) \
  59. . ab You need GNU troff version 1.18 or higher to run this version of mdoc!
  60. .
  61. .
  62. .\" Load start-up files
  63. .ie t \
  64. . mso mdoc/doc-ditroff
  65. .el \
  66. . mso mdoc/doc-nroff
  67. .
  68. .mso mdoc/doc-common
  69. .mso mdoc/doc-syms
  70. .
  71. .
  72. .eo
  73. .
  74. .
  75. .\" NS doc-macro-name global string
  76. .\" NS name of calling request (set in each user-requestable macro)
  77. .
  78. .ds doc-macro-name
  79. .als doc-arg0 doc-macro-name
  80. .
  81. .
  82. .\" NS doc-arg-limit global register
  83. .\" NS total number of arguments
  84. .
  85. .nr doc-arg-limit 0
  86. .
  87. .
  88. .\" NS doc-num-args global register
  89. .\" NS number of arguments to handle (must be set to \n[.$] prior to
  90. .\" NS `doc-parse-arg-vector' request)
  91. .
  92. .nr doc-num-args 0
  93. .
  94. .
  95. .\" NS doc-arg-ptr global register
  96. .\" NS argument pointer
  97. .
  98. .nr doc-arg-ptr 0
  99. .
  100. .
  101. .\" NS doc-argXXX global string
  102. .\" NS argument vector
  103. .\" NS
  104. .\" NS limit:
  105. .\" NS doc-arg-limit
  106. .
  107. .ds doc-arg1
  108. .
  109. .
  110. .\" NS doc-typeXXX global register
  111. .\" NS argument type vector (macro=1, string=2, punctuation suffix=3,
  112. .\" NS punctuation prefix=4)
  113. .\" NS
  114. .\" NS limit:
  115. .\" NS doc-arg-limit
  116. .
  117. .nr doc-type1 0
  118. .
  119. .
  120. .\" NS doc-spaceXXX global string
  121. .\" NS space vector
  122. .\" NS
  123. .\" NS limit:
  124. .\" NS doc-arg-limit
  125. .
  126. .ds doc-space1
  127. .
  128. .
  129. .\" NS doc-parse-args macro
  130. .\" NS parse arguments (recursively) (`.doc-parse-args arg ...')
  131. .\" NS
  132. .\" NS modifies:
  133. .\" NS doc-arg-limit
  134. .\" NS doc-arg-ptr
  135. .\" NS doc-argXXX
  136. .\" NS doc-spaceXXX
  137. .\" NS doc-typeXXX
  138. .\" NS doc-arg-ptr
  139. .\" NS doc-have-space
  140. .\" NS
  141. .\" NS local variables:
  142. .\" NS doc-reg-dpa
  143. .\" NS doc-reg-dpa1
  144. .\" NS doc-str-dpa
  145. .
  146. .de doc-parse-args
  147. . if !\n[doc-arg-limit] \
  148. . doc-set-spacing-1
  149. .
  150. . nr doc-have-space 0
  151. .
  152. . if !\n[.$] \
  153. . return
  154. .
  155. . nr doc-arg-limit +1
  156. .
  157. . \" handle `|' and `...' specially
  158. . ie "\$1"|" \
  159. . ds doc-arg\n[doc-arg-limit] \f[R]|\f[]
  160. . el \{ .ie "\$1"..." \
  161. . ds doc-arg\n[doc-arg-limit] \|.\|.\|.
  162. . el \
  163. . ds doc-arg\n[doc-arg-limit] "\$1
  164. . \}
  165. .
  166. . \" get argument type and set spacing
  167. . doc-get-arg-type* \n[doc-arg-limit]
  168. . nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
  169. . doc-set-spacing-\n[doc-arg-type]
  170. .
  171. . \" check whether we have processed the last parameter
  172. . ie (\n[.$] == 1) \
  173. . nr doc-arg-ptr 0
  174. . el \{\
  175. . shift
  176. . doc-parse-args \$@
  177. . \}
  178. .
  179. . nh
  180. ..
  181. .
  182. .
  183. .\" NS doc-parse-arg-vector macro
  184. .\" NS parse argument vector (recursive)
  185. .\" NS
  186. .\" NS cf. comments in doc-parse-args
  187. .\" NS
  188. .\" NS modifies:
  189. .\" NS doc-arg-limit
  190. .\" NS doc-arg-ptr
  191. .\" NS doc-argXXX
  192. .\" NS doc-num-args
  193. .\" NS doc-spaceXXX
  194. .\" NS doc-typeXXX
  195. .\" NS
  196. .\" NS local variables:
  197. .\" NS doc-reg-dpav
  198. .\" NS doc-reg-dpav1
  199. .\" NS doc-str-dpav
  200. .
  201. .de doc-parse-arg-vector
  202. . if !\n[doc-arg-limit] \
  203. . doc-set-spacing-1
  204. .
  205. . nr doc-arg-limit +1
  206. .
  207. . ie "\*[doc-arg\n[doc-arg-limit]]"|" \
  208. . ds doc-arg\n[doc-arg-limit] \f[R]|\f[]
  209. . el \{ .if "\*[doc-arg\n[doc-arg-limit]]"..." \
  210. . ds doc-arg\n[doc-arg-limit] \|.\|.\|.
  211. . \}
  212. .
  213. . doc-get-arg-type* \n[doc-arg-limit]
  214. . nr doc-type\n[doc-arg-limit] \n[doc-arg-type]
  215. . doc-set-spacing-\n[doc-arg-type]
  216. .
  217. . ie (\n[doc-num-args] == 1) \{\
  218. . nr doc-arg-ptr 0
  219. . nr doc-num-args 0
  220. . \}
  221. . el \{\
  222. . nr doc-num-args -1
  223. . doc-parse-arg-vector
  224. . \}
  225. .
  226. . nh
  227. ..
  228. .
  229. .
  230. .\" NS doc-parse-space-vector macro
  231. .\" NS parse space vector (recursive)
  232. .\" NS
  233. .\" NS modifies:
  234. .\" NS doc-arg-limit
  235. .\" NS doc-num-args
  236. .\" NS doc-spaceXXX
  237. .
  238. .de doc-parse-space-vector
  239. . nr doc-arg-limit +1
  240. .
  241. . doc-set-spacing-\n[doc-type\n[doc-arg-limit]]
  242. .
  243. . ie (\n[doc-num-args] == 1) \
  244. . nr doc-num-args 0
  245. . el \{\
  246. . nr doc-num-args -1
  247. . doc-parse-space-vector
  248. . \}
  249. ..
  250. .
  251. .
  252. .\" NS doc-remaining-args macro
  253. .\" NS output remaining arguments as-is, separated by spaces (until
  254. .\" NS `doc-num-args' is exhausted)
  255. .\" NS
  256. .\" NS modifies:
  257. .\" NS doc-arg-ptr
  258. .\" NS doc-num-args
  259. .
  260. .de doc-remaining-args
  261. . nr doc-arg-ptr +1
  262. . nop \)\*[doc-arg\n[doc-arg-ptr]]\c
  263. .
  264. . ie (\n[doc-num-args] == 1) \{\
  265. . nr doc-arg-ptr 0
  266. . nr doc-num-args 0
  267. . \}
  268. . el \{\
  269. . nop \)\*[doc-space]\c
  270. . nr doc-num-args -1
  271. . doc-remaining-args
  272. . \}
  273. ..
  274. .
  275. .
  276. .\" NS doc-append-arg macro
  277. .\" NS append one argument to argument vector:
  278. .\" NS `.doc-append-arg [arg] [type]'
  279. .\" NS
  280. .\" NS modifies:
  281. .\" NS doc-arg-limit
  282. .\" NS doc-argXXX
  283. .\" NS doc-typeXXX
  284. .
  285. .de doc-append-arg
  286. . nr doc-arg-limit +1
  287. . ds doc-arg\n[doc-arg-limit] "\$1
  288. . nr doc-type\n[doc-arg-limit] \$2
  289. . doc-set-spacing-\$2
  290. ..
  291. .
  292. .
  293. .\" NS doc-print-and-reset macro
  294. .\" NS finish input line and clean up argument vectors
  295. .
  296. .de doc-print-and-reset
  297. . if \n[doc-space-mode] \
  298. . nop \)
  299. . doc-reset-args
  300. ..
  301. .
  302. .
  303. .\" NS doc-reset-args macro
  304. .\" NS reset argument counters
  305. .\" NS
  306. .\" NS modifies:
  307. .\" NS doc-arg-limit
  308. .\" NS doc-arg-ptr
  309. .\" NS doc-have-slot
  310. .
  311. .de doc-reset-args
  312. . nr doc-arg-limit 0
  313. . nr doc-arg-ptr 0
  314. . nr doc-have-slot 0
  315. .
  316. . hy \n[doc-hyphen-flags]
  317. ..
  318. .
  319. .
  320. .ec
  321. .
  322. .\" NS doc-curr-font global register
  323. .\" NS saved current font
  324. .
  325. .nr doc-curr-font \n[.f]
  326. .
  327. .
  328. .\" NS doc-curr-size global register
  329. .\" NS saved current font size
  330. .
  331. .nr doc-curr-size \n[.ps]
  332. .
  333. .eo
  334. .
  335. .
  336. .\" NS Fl user macro
  337. .\" NS handle flags (appends `-' and prints flags): `.Fl [arg ...]'
  338. .\" NS
  339. .\" NS modifies:
  340. .\" NS doc-arg-ptr
  341. .\" NS doc-curr-font
  342. .\" NS doc-curr-size
  343. .\" NS doc-macro-name
  344. .\" NS
  345. .\" NS local variables:
  346. .\" NS doc-reg-Fl (for communication with doc-flag-recursion)
  347. .\" NS
  348. .\" NS width register `Fl' set in doc-common
  349. .
  350. .de Fl
  351. . nr doc-curr-font \n[.f]
  352. . nr doc-curr-size \n[.ps]
  353. . nop \*[doc-Fl-font]\c
  354. .
  355. . if !\n[doc-arg-limit] \{\
  356. . ds doc-macro-name Fl
  357. . doc-parse-args \$@
  358. .
  359. . \" no arguments
  360. . if !\n[.$] \
  361. . nop \|\-\|\f[]\s[0]
  362. . \}
  363. .
  364. . if !\n[doc-arg-limit] \
  365. . return
  366. .
  367. . nr doc-arg-ptr +1
  368. . ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  369. . \" last argument
  370. . nop \|\-\f[]\s[0]\c
  371. . doc-print-and-reset
  372. . \}
  373. . el \{\
  374. . ie (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
  375. . nop \|\-\f[]\s[0]\c
  376. . \*[doc-arg\n[doc-arg-ptr]]
  377. . \}
  378. . el \{\
  379. . if (\n[doc-type\n[doc-arg-ptr]] == 3) \
  380. . nop \|\-\|\c
  381. .
  382. . nr doc-reg-Fl 1
  383. . doc-flag-recursion
  384. . \}\}
  385. ..
  386. .
  387. .
  388. .\" NS doc-flag-recursion macro
  389. .\" NS `Fl' flag recursion routine (special handling)
  390. .\" NS
  391. .\" NS modifies:
  392. .\" NS doc-arg-ptr
  393. .\" NS
  394. .\" NS local variables:
  395. .\" NS doc-reg-dfr
  396. .\" NS doc-reg-dfr1
  397. .\" NS doc-str-dfr
  398. .
  399. .de doc-flag-recursion
  400. . nr doc-reg-dfr1 \n[doc-type\n[doc-arg-ptr]]
  401. . ds doc-str-dfr "\*[doc-arg\n[doc-arg-ptr]]
  402. .
  403. . ie (\n[doc-reg-dfr1] == 1) \{\
  404. . nop \f[]\s[0]\c
  405. . \*[doc-str-dfr]
  406. . \}
  407. . el \{\
  408. . nr doc-reg-dfr \n[doc-arg-ptr]
  409. .
  410. . ie (\n[doc-reg-dfr1] == 2) \{\
  411. . \" handle vertical bar -- doc-reg-Fl is set for the first call of
  412. . \" doc-flag-recursion only; we need this to make `.Fl | ...' work
  413. . \" correctly
  414. . ie "\*[doc-str-dfr]"\*[Ba]" \{\
  415. . if \n[doc-reg-Fl] \
  416. . nop \|\-\*[doc-space]\c
  417. . nop \)\*[Ba]\c
  418. . \}
  419. . el \{\
  420. . ie "\*[doc-str-dfr]"\f[R]|\f[]" \{\
  421. . if \n[doc-reg-Fl] \
  422. . nop \|\-\*[doc-space]\c
  423. . nop \f[R]|\f[]\c
  424. . \}
  425. . el \{\
  426. . \" two consecutive hyphen characters?
  427. . ie "\*[doc-str-dfr]"-" \
  428. . nop \|\-\^\-\|\c
  429. . el \
  430. . nop \|\%\-\*[doc-str-dfr]\&\c
  431. . \}\}\}
  432. . el \{\
  433. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  434. . nop \)\*[doc-str-dfr]\f[]\s[0]\c
  435. . \}
  436. .
  437. . ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
  438. . \" last argument
  439. . if (\n[doc-reg-dfr1] == 4) \
  440. . nop \|\-\c
  441. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  442. . doc-print-and-reset
  443. . \}
  444. . el \{\
  445. . nr doc-arg-ptr +1
  446. . ie (\n[doc-type\n[doc-arg-ptr]] == 3) \{\
  447. . ie (\n[doc-type\n[doc-reg-dfr]] == 4) \
  448. . nop \|\-\c
  449. . el \
  450. . nop \)\*[doc-space\n[doc-reg-dfr]]\c
  451. . \}
  452. . el \
  453. . nop \)\*[doc-space\n[doc-reg-dfr]]\c
  454. .
  455. . shift
  456. . nr doc-reg-Fl 0
  457. . doc-flag-recursion \$@
  458. . \}\}
  459. ..
  460. .
  461. .
  462. .\" NS doc-print-recursive macro
  463. .\" NS general name recursion routine (print remaining arguments)
  464. .\" NS
  465. .\" NS modifies:
  466. .\" NS doc-arg-ptr
  467. .\" NS
  468. .\" NS local variables:
  469. .\" NS doc-reg-dpr
  470. .\" NS doc-reg-dpr1
  471. .\" NS doc-str-dpr
  472. .
  473. .de doc-print-recursive
  474. . nr doc-reg-dpr1 \n[doc-type\n[doc-arg-ptr]]
  475. . ds doc-str-dpr "\*[doc-arg\n[doc-arg-ptr]]
  476. .
  477. . ie (\n[doc-reg-dpr1] == 1) \{\
  478. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  479. . \*[doc-str-dpr]
  480. . \}
  481. . el \{\
  482. . nr doc-reg-dpr \n[doc-arg-ptr]
  483. .
  484. . \" the `\%' prevents hyphenation on a dash (`-')
  485. . ie (\n[doc-reg-dpr1] == 2) \
  486. . nop \%\*[doc-str-dpr]\&\c
  487. . el \{\
  488. . \" punctuation character
  489. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  490. . nop \)\*[doc-str-dpr]\f[]\s[0]\c
  491. . \}
  492. .
  493. . nr doc-arg-ptr +1
  494. . ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  495. . \" last argument
  496. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  497. . doc-print-and-reset
  498. . \}
  499. . el \{\
  500. . nop \)\*[doc-space\n[doc-reg-dpr]]\c
  501. . doc-print-recursive
  502. . \}\}
  503. ..
  504. .
  505. .
  506. .\" NS doc-print-prefixes macro
  507. .\" NS print leading prefixes
  508. .\" NS
  509. .\" NS modifies:
  510. .\" NS doc-arg-ptr
  511. .
  512. .de doc-print-prefixes
  513. . while (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  514. . if !(\n[doc-type\n[doc-arg-ptr]] == 4) \
  515. . break
  516. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  517. . nop \)\*[doc-arg\n[doc-arg-ptr]]\f[]\s[0]\c
  518. . nr doc-arg-ptr +1
  519. . \}
  520. ..
  521. .
  522. .
  523. .\" NS doc-generic-macro macro
  524. .\" NS this is the skeleton for most simple macros
  525. .\" NS
  526. .\" NS modifies:
  527. .\" NS doc-arg-ptr
  528. .\" NS doc-curr-font
  529. .\" NS doc-curr-size
  530. .\" NS doc-macro-name
  531. .
  532. .de doc-generic-macro
  533. . if !\n[doc-arg-limit] \{\
  534. . ie \n[.$] \{\
  535. . ds doc-macro-name \$0
  536. . doc-parse-args \$@
  537. . \}
  538. . el \
  539. . tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
  540. . \}
  541. .
  542. . if !\n[doc-arg-limit] \
  543. . return
  544. .
  545. . nr doc-arg-ptr +1
  546. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  547. . if (\n[doc-type\n[doc-arg-ptr]] == 1) \{\
  548. . tmc mdoc warning: Using a macro as first argument
  549. . tm1 " cancels effect of .\$0 (#\n[.c])
  550. .
  551. . \" the right action here would be to reset the argument counters
  552. . \" and bail out -- unfortunately, a small number of manual pages
  553. . \" (less than 2% for FreeBSD which has been used for testing)
  554. . \" relied on the old behaviour (silently ignore this error),
  555. . \" so it is commented out
  556. .
  557. .\" doc-reset-args
  558. . \}
  559. .\" el \{\
  560. . nr doc-curr-font \n[.f]
  561. . nr doc-curr-size \n[.ps]
  562. . nop \*[doc-\$0-font]\c
  563. . doc-print-recursive
  564. .\" \}
  565. . \}
  566. . el \{\
  567. . tm Usage: .\$0 \*[doc-\$0-usage] ... (#\n[.c])
  568. . doc-reset-args
  569. . \}
  570. ..
  571. .
  572. .
  573. .\" NS Ar user macro
  574. .\" NS command line `argument' macro: `.Ar [args ...]'
  575. .\" NS
  576. .\" NS modifies:
  577. .\" NS doc-arg-ptr
  578. .\" NS doc-curr-font
  579. .\" NS doc-curr-size
  580. .\" NS doc-macro-name
  581. .\" NS
  582. .\" NS local variable:
  583. .\" NS doc-str-Ar-default
  584. .\" NS
  585. .\" NS width register `Ar' set in doc-common
  586. .
  587. .ds doc-str-Ar-default "file\ .\|.\|.
  588. .
  589. .de Ar
  590. . nr doc-curr-font \n[.f]
  591. . nr doc-curr-size \n[.ps]
  592. . nop \*[doc-Ar-font]\c
  593. .
  594. . if !\n[doc-arg-limit] \{\
  595. . ds doc-macro-name Ar
  596. . doc-parse-args \$@
  597. .
  598. . \" no argument
  599. . if !\n[.$] \
  600. . nop \)\*[doc-str-Ar-default]\&\f[]\s[0]
  601. . \}
  602. .
  603. . if !\n[doc-arg-limit] \
  604. . return
  605. .
  606. . nr doc-arg-ptr +1
  607. . doc-print-prefixes
  608. . ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  609. . nop \)\*[doc-str-Ar-default]\&\f[]\s[0]\c
  610. . doc-print-and-reset
  611. . \}
  612. . el \{\
  613. . if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
  614. . \" replace previous argument (Ar) with default value
  615. . nr doc-arg-ptr -1
  616. . ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Ar-default]
  617. . nr doc-type\n[doc-arg-ptr] 2
  618. . ds doc-space\n[doc-arg-ptr] "\*[doc-space]
  619. .
  620. . \" recompute space vector for remaining arguments
  621. . nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
  622. . nr doc-arg-limit \n[doc-arg-ptr]
  623. . doc-parse-space-vector
  624. . \}
  625. . doc-print-recursive
  626. . \}
  627. ..
  628. .
  629. .
  630. .\" NS Ad user macro
  631. .\" NS Addresses
  632. .\" NS
  633. .\" NS width register `Ad' set in doc-common
  634. .
  635. .als Ad doc-generic-macro
  636. .ds doc-Ad-usage address
  637. .
  638. .
  639. .\" NS doc-indent-synopsis global register
  640. .\" NS indentation in synopsis
  641. .
  642. .nr doc-indent-synopsis 0
  643. .
  644. .
  645. .\" NS doc-indent-synopsis-active global register (bool)
  646. .\" NS indentation in synopsis active
  647. .
  648. .nr doc-indent-synopsis-active 0
  649. .
  650. .
  651. .\" NS Cd user macro
  652. .\" NS config declaration (for section 4 SYNOPSIS)
  653. .\" NS
  654. .\" NS this function causes a break; it uses the `Nm' font
  655. .\" NS
  656. .\" NS modifies:
  657. .\" NS doc-arg-ptr
  658. .\" NS doc-curr-font
  659. .\" NS doc-curr-size
  660. .\" NS doc-indent-synopsis
  661. .\" NS doc-macro-name
  662. .\" NS
  663. .\" NS width register `Cd' set in doc-common
  664. .
  665. .de Cd
  666. . if !\n[doc-arg-limit] \{\
  667. . ie \n[.$] \{\
  668. . ds doc-macro-name Cd
  669. . doc-parse-args \$@
  670. . \}
  671. . el \
  672. . tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
  673. . \}
  674. .
  675. . if !\n[doc-arg-limit] \
  676. . return
  677. .
  678. . nr doc-arg-ptr +1
  679. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  680. . nr doc-curr-font \n[.f]
  681. . nr doc-curr-size \n[.ps]
  682. .
  683. . ie \n[doc-in-synopsis-section] \{\
  684. . ie "\*[doc-macro-name]"Cd" \{\
  685. . br
  686. . if !\n[doc-indent-synopsis] \
  687. . nr doc-indent-synopsis \n[doc-display-indent]u
  688. . if !\n[doc-indent-synopsis-active] \
  689. . in +\n[doc-indent-synopsis]u
  690. . ti -\n[doc-indent-synopsis]u
  691. . nop \*[doc-Nm-font]\c
  692. . doc-print-recursive
  693. . if !\n[doc-indent-synopsis-active] \
  694. . in -\n[doc-indent-synopsis]u
  695. . \}
  696. . el \{\
  697. . nop \*[doc-Nm-font]\c
  698. . doc-print-recursive
  699. . \}\}
  700. . el \{\
  701. . nop \*[doc-Nm-font]\c
  702. . doc-print-recursive
  703. . \}\}
  704. . el \{\
  705. . tm Usage: .Cd configuration_file_declaration ... (#\n[.c])
  706. . doc-reset-args
  707. . \}
  708. ..
  709. .
  710. .
  711. .\" NS Cm user macro
  712. .\" NS interactive command modifier (flag)
  713. .\" NS
  714. .\" NS width register `Cm' set in doc-common
  715. .
  716. .als Cm doc-generic-macro
  717. .ds doc-Cm-usage interactive_command_modifier
  718. .
  719. .
  720. .\" NS Dv user macro
  721. .\" NS defined variable
  722. .\" NS
  723. .\" NS this function uses the `Er' font
  724. .\" NS
  725. .\" NS width register `Dv' set in doc-common
  726. .
  727. .als Dv doc-generic-macro
  728. .ds doc-Dv-usage defined_variable
  729. .als doc-Dv-font doc-Er-font
  730. .
  731. .
  732. .\" NS Em user macro
  733. .\" NS emphasis
  734. .\" NS
  735. .\" NS width register `Em' set in doc-common
  736. .
  737. .als Em doc-generic-macro
  738. .ds doc-Em-usage text
  739. .
  740. .
  741. .\" NS Er user macro
  742. .\" NS errno type
  743. .\" NS
  744. .\" NS width register `Er' set in doc-common
  745. .
  746. .als Er doc-generic-macro
  747. .ds doc-Er-usage text
  748. .
  749. .
  750. .\" NS Ev user macro
  751. .\" NS environment variable
  752. .\" NS
  753. .\" NS width register `Ev' set in doc-common
  754. .
  755. .als Ev doc-generic-macro
  756. .ds doc-Ev-usage text
  757. .
  758. .
  759. .\" NS doc-have-decl global register (bool)
  760. .\" NS subroutine test (in synopsis only)
  761. .
  762. .nr doc-have-decl 0
  763. .
  764. .
  765. .\" NS doc-have-var global register (bool)
  766. .\" NS whether last type is a variable type
  767. .
  768. .nr doc-have-var 0
  769. .
  770. .
  771. .\" NS doc-do-func-decl macro
  772. .\" NS do something special while in SYNOPSIS
  773. .\" NS
  774. .\" NS modifies:
  775. .\" NS doc-curr-font
  776. .\" NS doc-curr-size
  777. .\" NS doc-have-decl
  778. .\" NS doc-have-var
  779. .
  780. .de doc-do-func-decl
  781. . if \n[doc-in-synopsis-section] \{\
  782. . \" if a variable type was the last thing given, want vertical space
  783. . if \n[doc-have-var] \{\
  784. . doc-paragraph
  785. . nr doc-have-var 0
  786. . \}
  787. . \" if a subroutine was the last thing given, want vertical space
  788. . if \n[doc-have-func] \{\
  789. . ie \n[doc-have-decl] \
  790. . br
  791. . el \
  792. . doc-paragraph
  793. . \}
  794. . nr doc-have-decl 1
  795. . \}
  796. .
  797. . nr doc-curr-font \n[.f]
  798. . nr doc-curr-size \n[.ps]
  799. ..
  800. .
  801. .
  802. .\" NS Fd user macro
  803. .\" NS function declaration -- not callable
  804. .\" NS
  805. .\" NS this function causes a break
  806. .\" NS
  807. .\" NS width register `Fd' set in doc-common
  808. .
  809. .de Fd
  810. . ie ((\n[.$] >= 1) & (\n[doc-arg-limit] == 0)) \{\
  811. . doc-do-func-decl
  812. . nop \*[doc-Fd-font]\$*
  813. . br
  814. . ft \n[doc-curr-font]
  815. . ps \n[doc-curr-size]u
  816. . \}
  817. . el \{\
  818. . tm Usage: .Fd function_declaration -- Fd is not callable (#\n[.c])
  819. . doc-reset-args
  820. . \}
  821. ..
  822. .
  823. .
  824. .\" NS In user macro
  825. .\" NS #include statement in SYNOPSIS
  826. .\" NS <header.h> if not in SYNOPSIS
  827. .\" NS
  828. .\" NS this function causes a break; it uses the `Fd' font
  829. .\" NS
  830. .\" NS modifies:
  831. .\" NS doc-arg-ptr
  832. .\" NS doc-curr-font
  833. .\" NS doc-curr-size
  834. .\" NS doc-indent-synopsis
  835. .\" NS doc-macro-name
  836. .\" NS
  837. .\" NS width register `In' set in doc-common
  838. .
  839. .de In
  840. . if !\n[doc-arg-limit] \{\
  841. . ie \n[.$] \{\
  842. . ds doc-macro-name In
  843. . doc-parse-args \$@
  844. . \}
  845. . el \
  846. . tm Usage: .In include_file ... (#\n[.c])
  847. . \}
  848. .
  849. . if !\n[doc-arg-limit] \
  850. . return
  851. .
  852. . nr doc-arg-ptr +1
  853. . doc-print-prefixes
  854. . ie ((\n[doc-arg-limit] >= \n[doc-arg-ptr]) & (\n[doc-type\n[doc-arg-ptr]] == 2)) \{\
  855. . nr doc-curr-font \n[.f]
  856. . nr doc-curr-size \n[.ps]
  857. .
  858. . ie \n[doc-in-synopsis-section] \{\
  859. . ie "\*[doc-macro-name]"In" \{\
  860. . doc-do-func-decl
  861. . nop \*[doc-Fd-font]#include <\*[doc-arg\n[doc-arg-ptr]]>
  862. . ft \n[doc-curr-font]
  863. . ps \n[doc-curr-size]u
  864. . br
  865. . nr doc-arg-ptr +1
  866. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
  867. . doc-print-recursive
  868. . el \
  869. . doc-reset-args
  870. . \}
  871. . el \{\
  872. . ds doc-arg\n[doc-arg-ptr] "<\*[doc-Pa-font]\*[doc-arg\n[doc-arg-ptr]]
  873. . as doc-arg\n[doc-arg-ptr] \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]>
  874. . doc-print-recursive
  875. . \}\}
  876. . el \{\
  877. . ds doc-arg\n[doc-arg-ptr] "<\*[doc-Pa-font]\*[doc-arg\n[doc-arg-ptr]]
  878. . as doc-arg\n[doc-arg-ptr] \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]>
  879. . doc-print-recursive
  880. . \}\}
  881. . el \{\
  882. . tm Usage: .In include_file ... (#\n[.c])
  883. . doc-reset-args
  884. . \}
  885. ..
  886. .
  887. .
  888. .\" NS Fr user macro
  889. .\" NS function return value
  890. .\" NS
  891. .\" NS this function uses the `Ar' font
  892. .\" NS
  893. .\" NS width register `Fr' set in doc-common
  894. .
  895. .als Fr doc-generic-macro
  896. .ds doc-Fr-usage function_return_value
  897. .als doc-Fr-font doc-Ar-font
  898. .
  899. .
  900. .\" NS Ic user macro
  901. .\" NS interactive command
  902. .\" NS
  903. .\" NS width register `Ic' set in doc-common
  904. .
  905. .als Ic doc-generic-macro
  906. .ds doc-Ic-usage interactive_command
  907. .
  908. .
  909. .\" NS Li user macro
  910. .\" NS literals
  911. .\" NS
  912. .\" NS width register `Li' set in doc-common
  913. .
  914. .als Li doc-generic-macro
  915. .ds doc-Li-usage argument
  916. .
  917. .
  918. .\" NS Ms user macro
  919. .\" NS math symbol
  920. .\" NS
  921. .\" NS this function uses the `Sy' font
  922. .\" NS
  923. .\" NS width register `Ms' set in doc-common
  924. .
  925. .als Ms doc-generic-macro
  926. .ds doc-Ms-usage math_symbol
  927. .als doc-Ms-font doc-Sy-font
  928. .
  929. .
  930. .\" NS doc-command-name global string
  931. .\" NS save first invocation of .Nm
  932. .
  933. .ds doc-command-name
  934. .
  935. .
  936. .\" NS Nm user macro
  937. .\" NS name of command or page topic
  938. .\" NS
  939. .\" NS modifies:
  940. .\" NS doc-arg-ptr
  941. .\" NS doc-command-name
  942. .\" NS doc-curr-font
  943. .\" NS doc-curr-size
  944. .\" NS doc-indent-synopsis
  945. .\" NS doc-indent-synopsis-active
  946. .\" NS doc-macro-name
  947. .\" NS
  948. .\" NS width register `Nm' set in doc-common
  949. .
  950. .de Nm
  951. . if !\n[doc-arg-limit] \{\
  952. . ds doc-macro-name Nm
  953. . ie \n[.$] \
  954. . doc-parse-args \$@
  955. . el \{\
  956. . ie "\*[doc-command-name]"" \
  957. . tm Usage: .Nm name ... (#\n[.c])
  958. . el \
  959. . doc-parse-args \*[doc-command-name]
  960. . \}\}
  961. .
  962. . if !\n[doc-arg-limit] \
  963. . return
  964. .
  965. . nr doc-arg-ptr +1
  966. . doc-print-prefixes
  967. . ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  968. . \" last argument
  969. . ie "\*[doc-command-name]"" \{\
  970. . tm Usage: .Nm name ... (#\n[.c])
  971. . doc-reset-args
  972. . \}
  973. . el \{\
  974. . nop \*[doc-Nm-font]\*[doc-command-name]\f[]\s[0]\c
  975. . doc-print-and-reset
  976. . \}\}
  977. . el \{\
  978. . nr doc-curr-font \n[.f]
  979. . nr doc-curr-size \n[.ps]
  980. .
  981. . ie !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
  982. . ie "\*[doc-command-name]"" \
  983. . tm Usage: .Nm name ... (#\n[.c])
  984. . el \{\
  985. . \" replace previous argument (Nm) with default value
  986. . nr doc-arg-ptr -1
  987. . ds doc-arg\n[doc-arg-ptr] "\*[doc-Nm-font]\*[doc-command-name]\f[]\s[0]
  988. . nr doc-type\n[doc-arg-ptr] 2
  989. . ds doc-space\n[doc-arg-ptr] "\*[doc-space]
  990. .
  991. . \" recompute space vector for remaining arguments
  992. . nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
  993. . nr doc-arg-limit \n[doc-arg-ptr]
  994. . doc-parse-space-vector
  995. . \}\}
  996. . el \{\
  997. . \" handle `.Nm ...' in SYNOPSIS
  998. . if \n[doc-in-synopsis-section] \{\
  999. . if "\*[doc-macro-name]"Nm" \{\
  1000. . br
  1001. . if !\n[doc-indent-synopsis] \{\
  1002. . doc-get-width "\*[doc-arg\n[doc-arg-ptr]]"
  1003. . nr doc-indent-synopsis ((\n[doc-width]u + 1u) * \n[doc-fixed-width]u)
  1004. . \}
  1005. . if !\n[doc-indent-synopsis-active] \{\
  1006. . in +\n[doc-indent-synopsis]u
  1007. . nr doc-indent-synopsis-active 1
  1008. . \}
  1009. . ti -\n[doc-indent-synopsis]u
  1010. . \}\}
  1011. . if "\*[doc-command-name]"" \
  1012. . ds doc-command-name "\*[doc-arg\n[doc-arg-ptr]]
  1013. .
  1014. . nop \*[doc-Nm-font]\c
  1015. . \}
  1016. . doc-print-recursive
  1017. . \}
  1018. ..
  1019. .
  1020. .
  1021. .\" NS Pa user macro
  1022. .\" NS pathname: `.Pa [arg ...]'
  1023. .\" NS
  1024. .\" NS modifies:
  1025. .\" NS doc-arg-ptr
  1026. .\" NS doc-curr-font
  1027. .\" NS doc-curr-size
  1028. .\" NS doc-macro-name
  1029. .\" NS
  1030. .\" NS width register `Pa' set in doc-common
  1031. .
  1032. .de Pa
  1033. . if !\n[doc-arg-limit] \{\
  1034. . ds doc-macro-name Pa
  1035. . doc-parse-args \$@
  1036. .
  1037. . \" default value
  1038. . if !\n[.$] \
  1039. . nop \*[doc-Pa-font]~\f[]\s[0]
  1040. . \}
  1041. .
  1042. . if !\n[doc-arg-limit] \
  1043. . return
  1044. .
  1045. . nr doc-arg-ptr +1
  1046. . doc-print-prefixes
  1047. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  1048. . nr doc-curr-font \n[.f]
  1049. . nr doc-curr-size \n[.ps]
  1050. . nop \*[doc-Pa-font]\c
  1051. . if !(\n[doc-type\n[doc-arg-ptr]] == 2) \{\
  1052. . \" replace previous argument (Pa) with default value
  1053. . nr doc-arg-ptr -1
  1054. . ds doc-arg\n[doc-arg-ptr] ~
  1055. . nr doc-type\n[doc-arg-ptr] 2
  1056. . ds doc-space\n[doc-arg-ptr] "\*[doc-space]
  1057. .
  1058. . \" recompute space vector for remaining arguments
  1059. . nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
  1060. . nr doc-arg-limit \n[doc-arg-ptr]
  1061. . doc-parse-space-vector
  1062. . \}
  1063. . doc-print-recursive
  1064. . \}
  1065. . el \{\
  1066. . nop \*[doc-Pa-font]~\f[]\s[0]\c
  1067. . doc-print-and-reset
  1068. . \}
  1069. ..
  1070. .
  1071. .
  1072. .\" NS Sy user macro
  1073. .\" NS symbolics
  1074. .\" NS
  1075. .\" NS width register `Sy' set in doc-common
  1076. .
  1077. .als Sy doc-generic-macro
  1078. .ds doc-Sy-usage symbolic_text
  1079. .
  1080. .
  1081. .\" NS Me user macro
  1082. .\" NS menu entries
  1083. .\" NS
  1084. .\" NS width register `Me' set in doc-common
  1085. .
  1086. .als Me doc-generic-macro
  1087. .ds doc-Me-usage menu_entry
  1088. .
  1089. .
  1090. .\" NS Tn user macro
  1091. .\" NS trade name
  1092. .\" NS
  1093. .\" NS modifies:
  1094. .\" NS doc-arg-ptr
  1095. .\" NS doc-curr-font
  1096. .\" NS doc-curr-size
  1097. .\" NS doc-macro-name
  1098. .\" NS
  1099. .\" NS width register `Tn' set in doc-common
  1100. .
  1101. .de Tn
  1102. . if !\n[doc-arg-limit] \{\
  1103. . ie \n[.$] \{\
  1104. . ds doc-macro-name Tn
  1105. . doc-parse-args \$@
  1106. . \}
  1107. . el \
  1108. . tm Usage: .Tn trade_name ... (#\n[.c])
  1109. . \}
  1110. .
  1111. . if !\n[doc-arg-limit] \
  1112. . return
  1113. .
  1114. . nr doc-arg-ptr +1
  1115. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  1116. . nr doc-curr-font \n[.f]
  1117. . nr doc-curr-size \n[.ps]
  1118. . nop \)\*[doc-Tn-font-size]\c
  1119. . ie !\n[doc-is-reference] \{\
  1120. . nop \)\*[doc-Tn-font-shape]\c
  1121. . doc-print-recursive
  1122. . \}
  1123. . el \
  1124. . doc-do-references
  1125. . \}
  1126. . el \{\
  1127. . tm Usage: .Tn trade_name ... (#\n[.c])
  1128. . doc-reset-args
  1129. . \}
  1130. ..
  1131. .
  1132. .
  1133. .\" NS Va user macro
  1134. .\" NS variable name
  1135. .\" NS
  1136. .\" NS width register `Va' set in doc-common
  1137. .
  1138. .als Va doc-generic-macro
  1139. .ds doc-Va-usage variable_name
  1140. .
  1141. .
  1142. .\" NS No user macro
  1143. .\" NS normal text macro (default text style if mess up)
  1144. .\" NS
  1145. .\" NS width register `No' set in doc-common
  1146. .
  1147. .als No doc-generic-macro
  1148. .ds doc-No-usage normal_text
  1149. .
  1150. .
  1151. .\" NS doc-quote-left global string
  1152. .\" NS left quotation character for `doc-enclose-string' and
  1153. .\" NS `doc-enclose-open'
  1154. .
  1155. .ds doc-quote-left
  1156. .
  1157. .
  1158. .\" NS doc-quote-right global string
  1159. .\" NS right quotation character for `doc-enclose-string' and
  1160. .\" NS `doc-enclose-close'
  1161. .
  1162. .ds doc-quote-right
  1163. .
  1164. .
  1165. .\" NS Op user macro
  1166. .\" NS option expression (i.e., enclose string in square brackets)
  1167. .\" NS
  1168. .\" NS modifies:
  1169. .\" NS doc-macro-name
  1170. .\" NS doc-quote-left
  1171. .\" NS doc-quote-right
  1172. .\" NS
  1173. .\" NS width register `Op' set in doc-common
  1174. .
  1175. .de Op
  1176. . if !\n[doc-arg-limit] \
  1177. . ds doc-macro-name Op
  1178. .
  1179. . ds doc-quote-left "\*[doc-left-bracket]
  1180. . ds doc-quote-right "\*[doc-right-bracket]
  1181. .
  1182. . doc-enclose-string \$@
  1183. ..
  1184. .
  1185. .
  1186. .\" NS Aq user macro
  1187. .\" NS enclose string in angle brackets
  1188. .\" NS
  1189. .\" NS modifies:
  1190. .\" NS doc-macro-name
  1191. .\" NS doc-quote-left
  1192. .\" NS doc-quote-right
  1193. .\" NS
  1194. .\" NS width register `Aq' set in doc-common
  1195. .
  1196. .de Aq
  1197. . if !\n[doc-arg-limit] \
  1198. . ds doc-macro-name Aq
  1199. .
  1200. . ie "\*[doc-macro-name]"An" \{\
  1201. . ds doc-quote-left <
  1202. . ds doc-quote-right >
  1203. . \}
  1204. . el \{\
  1205. . ds doc-quote-left \[la]
  1206. . ds doc-quote-right \[ra]
  1207. . \}
  1208. .
  1209. . doc-enclose-string \$@
  1210. ..
  1211. .
  1212. .
  1213. .\" NS Bq user macro
  1214. .\" NS enclose string in square brackets
  1215. .\" NS
  1216. .\" NS modifies:
  1217. .\" NS doc-macro-name
  1218. .\" NS doc-quote-left
  1219. .\" NS doc-quote-right
  1220. .\" NS
  1221. .\" NS width register `Bq' set in doc-common
  1222. .
  1223. .de Bq
  1224. . if !\n[doc-arg-limit] \
  1225. . ds doc-macro-name Bq
  1226. .
  1227. . ds doc-quote-left "\*[doc-left-bracket]
  1228. . ds doc-quote-right "\*[doc-right-bracket]
  1229. .
  1230. . doc-enclose-string \$@
  1231. ..
  1232. .
  1233. .
  1234. .\" NS Brq user macro
  1235. .\" NS enclose string in braces
  1236. .\" NS
  1237. .\" NS modifies:
  1238. .\" NS doc-macro-name
  1239. .\" NS doc-quote-left
  1240. .\" NS doc-quote-right
  1241. .\" NS
  1242. .\" NS width register `Brq' set in doc-common
  1243. .
  1244. .de Brq
  1245. . if !\n[doc-arg-limit] \
  1246. . ds doc-macro-name Brq
  1247. .
  1248. . ds doc-quote-left {
  1249. . ds doc-quote-right }
  1250. .
  1251. . doc-enclose-string \$@
  1252. ..
  1253. .
  1254. .
  1255. .\" NS Dq user macro
  1256. .\" NS enclose string in double quotes
  1257. .\" NS
  1258. .\" NS modifies:
  1259. .\" NS doc-macro-name
  1260. .\" NS doc-quote-left
  1261. .\" NS doc-quote-right
  1262. .\" NS
  1263. .\" NS width register `Dq' set in doc-common
  1264. .
  1265. .de Dq
  1266. . if !\n[doc-arg-limit] \
  1267. . ds doc-macro-name Dq
  1268. .
  1269. . ds doc-quote-left "\*[Lq]
  1270. . ds doc-quote-right "\*[Rq]
  1271. .
  1272. . doc-enclose-string \$@
  1273. ..
  1274. .
  1275. .
  1276. .\" NS Eq user macro
  1277. .\" NS enclose string in user-defined quotes (args 1 and 2)
  1278. .\" NS
  1279. .\" NS modifies:
  1280. .\" NS doc-macro-name
  1281. .\" NS doc-quote-left
  1282. .\" NS doc-quote-right
  1283. .\" NS
  1284. .\" NS width register `Eq' set in doc-common
  1285. .
  1286. .de Eq
  1287. . if !\n[doc-arg-limit] \
  1288. . ds doc-macro-name Eq
  1289. .
  1290. . ds doc-quote-left "\$1
  1291. . ds doc-quote-right "\$2
  1292. .
  1293. . shift 2
  1294. . doc-enclose-string \$@
  1295. ..
  1296. .
  1297. .
  1298. .\" NS Pq user macro
  1299. .\" NS enclose string in parentheses
  1300. .\" NS
  1301. .\" NS modifies:
  1302. .\" NS doc-macro-name
  1303. .\" NS doc-quote-left
  1304. .\" NS doc-quote-right
  1305. .\" NS
  1306. .\" NS width register `Pq' set in doc-common
  1307. .
  1308. .de Pq
  1309. . if !\n[doc-arg-limit] \
  1310. . ds doc-macro-name Pq
  1311. .
  1312. . ds doc-quote-left "\*[doc-left-parenthesis]
  1313. . ds doc-quote-right "\*[doc-right-parenthesis]
  1314. .
  1315. . doc-enclose-string \$@
  1316. ..
  1317. .
  1318. .
  1319. .\" NS Ql user macro
  1320. .\" NS quoted literal
  1321. .\"
  1322. .\" is in file doc-[dit|n]roff
  1323. .
  1324. .
  1325. .\" NS Qq user macro
  1326. .\" NS enclose string in straight double quotes
  1327. .\" NS
  1328. .\" NS modifies:
  1329. .\" NS doc-macro-name
  1330. .\" NS doc-quote-left
  1331. .\" NS doc-quote-right
  1332. .\" NS
  1333. .\" NS width register `Qq' set in doc-common
  1334. .
  1335. .de Qq
  1336. . if !\n[doc-arg-limit] \
  1337. . ds doc-macro-name Qq
  1338. .
  1339. . ds doc-quote-left "\*[q]
  1340. . ds doc-quote-right "\*[q]
  1341. .
  1342. . doc-enclose-string \$@
  1343. ..
  1344. .
  1345. .
  1346. .\" NS Sq user macro
  1347. .\" NS enclose string in single quotes
  1348. .\" NS
  1349. .\" NS modifies:
  1350. .\" NS doc-macro-name
  1351. .\" NS doc-quote-left
  1352. .\" NS doc-quote-right
  1353. .\" NS
  1354. .\" NS width register `Sq' set in doc-common
  1355. .
  1356. .de Sq
  1357. . if !\n[doc-arg-limit] \
  1358. . ds doc-macro-name Sq
  1359. .
  1360. . ds doc-quote-left "\*[doc-left-singlequote]
  1361. . ds doc-quote-right "\*[doc-right-singlequote]
  1362. .
  1363. . doc-enclose-string \$@
  1364. ..
  1365. .
  1366. .
  1367. .\" NS Es user macro
  1368. .\" NS set up arguments (i.e., the left and right quotation character as
  1369. .\" NS first and second argument) for .En call
  1370. .\" NS
  1371. .\" NS modifies:
  1372. .\" NS doc-arg-ptr
  1373. .\" NS doc-macro-name
  1374. .\" NS doc-quote-left
  1375. .\" NS doc-quote-right
  1376. .
  1377. .de Es
  1378. . if !\n[doc-arg-limit] \{\
  1379. . ie (\n[.$] > 2) \{\
  1380. . ds doc-macro-name Es
  1381. . doc-parse-args \$@
  1382. . \}
  1383. . el \{\
  1384. . ds doc-quote-left "\$1
  1385. . ds doc-quote-right "\$2
  1386. . \}\}
  1387. .
  1388. . if !\n[doc-arg-limit] \
  1389. . return
  1390. .
  1391. . nr doc-arg-ptr +1
  1392. . ds doc-quote-left "\*[doc-arg\n[doc-arg-ptr]]
  1393. . nr doc-arg-ptr +1
  1394. . ds doc-quote-right "\*[doc-arg\n[doc-arg-ptr]]
  1395. . nr doc-arg-ptr +1
  1396. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
  1397. . doc-do-\n[doc-type\n[doc-arg-ptr]]
  1398. . el \
  1399. . doc-print-and-reset
  1400. ..
  1401. .
  1402. .
  1403. .\" NS doc-have-slot global register (bool)
  1404. .\" NS set if `doc-enclose-string' has created a slot for closing
  1405. .\" NS delimiter
  1406. .
  1407. .nr doc-have-slot 0
  1408. .
  1409. .
  1410. .\" NS doc-enclose-string macro
  1411. .\" NS enclose string with given args (e.g. [ and ])
  1412. .\" NS
  1413. .\" NS modifies:
  1414. .\" NS doc-arg-ptr
  1415. .\" NS doc-argXXX
  1416. .\" NS doc-have-slot
  1417. .\" NS
  1418. .\" NS local variables:
  1419. .\" NS doc-reg-des
  1420. .\" NS doc-reg-des1
  1421. .\" NS doc-reg-des2
  1422. .\" NS
  1423. .\" NS requires:
  1424. .\" NS doc-quote-left
  1425. .\" NS doc-quote-right
  1426. .
  1427. .de doc-enclose-string
  1428. . if \n[doc-in-synopsis-section] \
  1429. . doc-set-hard-space
  1430. .
  1431. . if !\n[doc-arg-limit] \{\
  1432. . ie \n[.$] \
  1433. . doc-parse-args \$@
  1434. . el \{\
  1435. . nop \)\*[doc-quote-left]\*[doc-quote-right]
  1436. . \}\}
  1437. .
  1438. . if !\n[doc-arg-limit] \
  1439. . return
  1440. .
  1441. . nr doc-curr-font \n[.f]
  1442. . nr doc-curr-size \n[.ps]
  1443. .
  1444. . nr doc-arg-ptr +1
  1445. . doc-print-prefixes
  1446. . \" the final `\)' prevents hyphenation in case the next character is `\%'
  1447. . nop \)\*[doc-quote-left]\)\c
  1448. . ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  1449. . \" last argument
  1450. . nop \)\*[doc-quote-right]\)\c
  1451. . doc-print-and-reset
  1452. . \}
  1453. . el \{\
  1454. . \" test whether last arguments are of type closing punctuation
  1455. . \" resp. suffix
  1456. . ie (\n[doc-type\n[doc-arg-limit]] == 3) \{\
  1457. . nr doc-reg-des (\n[doc-arg-limit] - 1)
  1458. . while (\n[doc-type\n[doc-reg-des]] == 3) \
  1459. . nr doc-reg-des -1
  1460. .
  1461. . \" prepend closing delimiter
  1462. . nr doc-reg-des +1
  1463. . ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
  1464. . \}
  1465. . el \{\
  1466. . \" test whether last arguments are macros which continue the line
  1467. . \" logically
  1468. . nr doc-reg-des \n[doc-arg-limit]
  1469. . while (\n[doc-reg-des] >= \n[doc-arg-ptr]) \{\
  1470. . if !\A\*[doc-arg\n[doc-reg-des]] \
  1471. . break
  1472. . if !d doc-after-\*[doc-arg\n[doc-reg-des]] \
  1473. . break
  1474. . nr doc-reg-des -1
  1475. . \}
  1476. .
  1477. . \" if there are no trailing macros to be skipped, append argument
  1478. . ie (\n[doc-reg-des] == \n[doc-arg-limit]) \
  1479. . doc-append-arg "\)\*[doc-quote-right]\)" 3
  1480. . el \{\
  1481. . \" if a previous call to `doc-enclose-string' has already created
  1482. . \" a slot, prepend argument
  1483. . ie \n[doc-have-slot] \
  1484. . ds doc-arg\n[doc-reg-des] "\*[doc-quote-right]\)\*[doc-arg\n[doc-reg-des]]
  1485. . el \{\
  1486. . \" we have to shift all arguments to the right
  1487. . nr doc-reg-des +1
  1488. . nr doc-reg-des1 \n[doc-arg-limit]
  1489. . nr doc-reg-des2 (\n[doc-arg-limit] + 1)
  1490. . while (\n[doc-reg-des1] >= \n[doc-reg-des]) \{\
  1491. . rn doc-arg\n[doc-reg-des1] doc-arg\n[doc-reg-des2]
  1492. . rnn doc-type\n[doc-reg-des1] doc-type\n[doc-reg-des2]
  1493. . rn doc-space\n[doc-reg-des1] doc-space\n[doc-reg-des2]
  1494. . nr doc-reg-des1 -1
  1495. . nr doc-reg-des2 -1
  1496. . \}
  1497. . nr doc-arg-limit +1
  1498. .
  1499. . \" finally, insert closing delimiter into the freed slot and
  1500. . \" recompute spacing vector
  1501. . ds doc-arg\n[doc-reg-des] "\)\*[doc-quote-right]\)
  1502. . nr doc-type\n[doc-reg-des] 3
  1503. . nr doc-num-args (\n[doc-arg-limit] - \n[doc-reg-des] + 1)
  1504. . nr doc-arg-limit (\n[doc-reg-des] - 1)
  1505. . doc-parse-space-vector
  1506. . nr doc-have-slot 1
  1507. . \}\}\}
  1508. .
  1509. . doc-do-\n[doc-type\n[doc-arg-ptr]]
  1510. . \}
  1511. .
  1512. . if \n[doc-in-synopsis-section] \
  1513. . doc-set-soft-space
  1514. ..
  1515. .
  1516. .
  1517. .\" NS En user macro
  1518. .\" NS enclose arguments with quotation characters set up with `.Es'
  1519. .
  1520. .als En doc-enclose-string
  1521. .
  1522. .
  1523. .\" NS Ao user macro
  1524. .\" NS angle open
  1525. .\" NS
  1526. .\" NS modifies:
  1527. .\" NS doc-macro-name
  1528. .\" NS doc-quote-left
  1529. .\" NS
  1530. .\" NS width register `Ao' set in doc-common
  1531. .
  1532. .de Ao
  1533. . if !\n[doc-arg-limit] \
  1534. . ds doc-macro-name Ao
  1535. .
  1536. . ie "\*[doc-macro-name]"An" \
  1537. . ds doc-quote-left <
  1538. . el \
  1539. . ds doc-quote-left \[la]
  1540. .
  1541. . doc-enclose-open \$@
  1542. ..
  1543. .
  1544. .
  1545. .\" NS Ac user macro
  1546. .\" NS angle close
  1547. .\" NS
  1548. .\" NS modifies:
  1549. .\" NS doc-macro-name
  1550. .\" NS doc-quote-right
  1551. .\" NS
  1552. .\" NS width register `Ac' set in doc-common
  1553. .
  1554. .de Ac
  1555. . if !\n[doc-arg-limit] \
  1556. . ds doc-macro-name Ac
  1557. .
  1558. . ie "\*[doc-macro-name]"An" \
  1559. . ds doc-quote-right >
  1560. . el \
  1561. . ds doc-quote-right \[ra]
  1562. .
  1563. . doc-enclose-close \$@
  1564. ..
  1565. .
  1566. .
  1567. .\" NS Bo user macro
  1568. .\" NS bracket open
  1569. .\" NS
  1570. .\" NS modifies:
  1571. .\" NS doc-macro-name
  1572. .\" NS doc-quote-left
  1573. .\" NS
  1574. .\" NS width register `Bo' set in doc-common
  1575. .
  1576. .de Bo
  1577. . if !\n[doc-arg-limit] \
  1578. . ds doc-macro-name Bo
  1579. .
  1580. . ds doc-quote-left "\*[doc-left-bracket]
  1581. .
  1582. . doc-enclose-open \$@
  1583. ..
  1584. .
  1585. .
  1586. .\" NS Bc user macro
  1587. .\" NS bracket close
  1588. .\" NS
  1589. .\" NS modifies:
  1590. .\" NS doc-macro-name
  1591. .\" NS doc-quote-right
  1592. .\" NS
  1593. .\" NS width register `Bc' set in doc-common
  1594. .
  1595. .de Bc
  1596. . if !\n[doc-arg-limit] \
  1597. . ds doc-macro-name Bc
  1598. .
  1599. . ds doc-quote-right "\*[doc-right-bracket]
  1600. .
  1601. . doc-enclose-close \$@
  1602. ..
  1603. .
  1604. .
  1605. .\" NS Bro user macro
  1606. .\" NS brace open
  1607. .\" NS
  1608. .\" NS modifies:
  1609. .\" NS doc-macro-name
  1610. .\" NS doc-quote-left
  1611. .\" NS
  1612. .\" NS width register `Bro' set in doc-common
  1613. .
  1614. .de Bro
  1615. . if !\n[doc-arg-limit] \
  1616. . ds doc-macro-name Bo
  1617. .
  1618. . ds doc-quote-left {
  1619. .
  1620. . doc-enclose-open \$@
  1621. ..
  1622. .
  1623. .
  1624. .\" NS Brc user macro
  1625. .\" NS brace close
  1626. .\" NS
  1627. .\" NS modifies:
  1628. .\" NS doc-macro-name
  1629. .\" NS doc-quote-right
  1630. .\" NS
  1631. .\" NS width register `Brc' set in doc-common
  1632. .
  1633. .de Brc
  1634. . if !\n[doc-arg-limit] \
  1635. . ds doc-macro-name Bc
  1636. .
  1637. . ds doc-quote-right }
  1638. .
  1639. . doc-enclose-close \$@
  1640. ..
  1641. .
  1642. .
  1643. .\" NS Do user macro
  1644. .\" NS double quote open
  1645. .\" NS
  1646. .\" NS modifies:
  1647. .\" NS doc-macro-name
  1648. .\" NS doc-quote-left
  1649. .\" NS
  1650. .\" NS width register `Do' set in doc-common
  1651. .
  1652. .de Do
  1653. . if !\n[doc-arg-limit] \
  1654. . ds doc-macro-name Do
  1655. .
  1656. . ds doc-quote-left "\*[Lq]
  1657. .
  1658. . doc-enclose-open \$@
  1659. ..
  1660. .
  1661. .
  1662. .\" NS Dc user macro
  1663. .\" NS double quote close
  1664. .\" NS
  1665. .\" NS modifies:
  1666. .\" NS doc-macro-name
  1667. .\" NS doc-quote-right
  1668. .\" NS
  1669. .\" NS width register `Dc' set in doc-common
  1670. .
  1671. .de Dc
  1672. . if !\n[doc-arg-limit] \
  1673. . ds doc-macro-name Dc
  1674. .
  1675. . ds doc-quote-right "\*[Rq]
  1676. .
  1677. . doc-enclose-close \$@
  1678. ..
  1679. .
  1680. .
  1681. .\" NS Eo user macro
  1682. .\" NS enclose open (using first argument as beginning of enclosure)
  1683. .\" NS
  1684. .\" NS modifies:
  1685. .\" NS doc-macro-name
  1686. .\" NS doc-quote-left
  1687. .\" NS
  1688. .\" NS width register `Eo' set in doc-common
  1689. .
  1690. .de Eo
  1691. . if !\n[doc-arg-limit] \
  1692. . ds doc-macro-name Eo
  1693. .
  1694. . ds doc-quote-left "\$1
  1695. .
  1696. . shift
  1697. . doc-enclose-open \$@
  1698. ..
  1699. .
  1700. .
  1701. .\" NS Ec user macro
  1702. .\" NS enclose close (using first argument as end of enclosure)
  1703. .\" NS
  1704. .\" NS modifies:
  1705. .\" NS doc-macro-name
  1706. .\" NS doc-quote-right
  1707. .\" NS
  1708. .\" NS width register `Ec' set in doc-common
  1709. .
  1710. .de Ec
  1711. . if !\n[doc-arg-limit] \
  1712. . ds doc-macro-name Ec
  1713. .
  1714. . ds doc-quote-right "\$1
  1715. .
  1716. . shift
  1717. . doc-enclose-close \$@
  1718. ..
  1719. .
  1720. .
  1721. .\" NS Oo user macro
  1722. .\" NS option open
  1723. .\" NS
  1724. .\" NS modifies:
  1725. .\" NS doc-macro-name
  1726. .\" NS doc-quote-left
  1727. .\" NS
  1728. .\" NS width register `Oo' set in doc-common
  1729. .
  1730. .de Oo
  1731. . if !\n[doc-arg-limit] \
  1732. . ds doc-macro-name Oo
  1733. .
  1734. . ds doc-quote-left [
  1735. .
  1736. . doc-enclose-open \$@
  1737. ..
  1738. .
  1739. .
  1740. .\" NS Oc user macro
  1741. .\" NS option close
  1742. .\" NS
  1743. .\" NS modifies:
  1744. .\" NS doc-macro-name
  1745. .\" NS doc-quote-right
  1746. .\" NS
  1747. .\" NS width register `Oc' set in doc-common
  1748. .
  1749. .de Oc
  1750. . if !\n[doc-arg-limit] \
  1751. . ds doc-macro-name Oc
  1752. .
  1753. . ds doc-quote-right ]
  1754. .
  1755. . doc-enclose-close \$@
  1756. ..
  1757. .
  1758. .
  1759. .\" NS Po user macro
  1760. .\" NS parenthesis open
  1761. .\" NS
  1762. .\" NS modifies:
  1763. .\" NS doc-macro-name
  1764. .\" NS doc-quote-left
  1765. .\" NS
  1766. .\" NS width register `Po' set in doc-common
  1767. .
  1768. .de Po
  1769. . if !\n[doc-arg-limit] \
  1770. . ds doc-macro-name Po
  1771. .
  1772. . ds doc-quote-left "\*[doc-left-parenthesis]
  1773. .
  1774. . doc-enclose-open \$@
  1775. ..
  1776. .
  1777. .
  1778. .\" NS Pc user macro
  1779. .\" NS parenthesis close
  1780. .\" NS
  1781. .\" NS modifies:
  1782. .\" NS doc-macro-name
  1783. .\" NS doc-quote-right
  1784. .\" NS
  1785. .\" NS width register `Pc' set in doc-common
  1786. .
  1787. .de Pc
  1788. . if !\n[doc-arg-limit] \
  1789. . ds doc-macro-name Pc
  1790. .
  1791. . ds doc-quote-right "\*[doc-right-parenthesis]
  1792. .
  1793. . doc-enclose-close \$@
  1794. ..
  1795. .
  1796. .
  1797. .\" NS Qo user macro
  1798. .\" NS straight double quote open
  1799. .\" NS
  1800. .\" NS modifies:
  1801. .\" NS doc-macro-name
  1802. .\" NS doc-quote-left
  1803. .\" NS
  1804. .\" NS width register `Qo' set in doc-common
  1805. .
  1806. .de Qo
  1807. . if !\n[doc-arg-limit] \
  1808. . ds doc-macro-name Qo
  1809. .
  1810. . ds doc-quote-left "\*[q]
  1811. .
  1812. . doc-enclose-open \$@
  1813. ..
  1814. .
  1815. .
  1816. .\" NS Qc user macro
  1817. .\" NS straight double quote close
  1818. .\" NS
  1819. .\" NS modifies:
  1820. .\" NS doc-macro-name
  1821. .\" NS doc-quote-right
  1822. .\" NS
  1823. .\" NS width register `Qc' set in doc-common
  1824. .
  1825. .de Qc
  1826. . if !\n[doc-arg-limit] \
  1827. . ds doc-macro-name Qc
  1828. .
  1829. . ds doc-quote-right "\*[q]
  1830. .
  1831. . doc-enclose-close \$@
  1832. ..
  1833. .
  1834. .
  1835. .\" NS So user macro
  1836. .\" NS single quote open
  1837. .\" NS
  1838. .\" NS modifies:
  1839. .\" NS doc-macro-name
  1840. .\" NS doc-quote-left
  1841. .\" NS
  1842. .\" NS width register `So' set in doc-common
  1843. .
  1844. .de So
  1845. . if !\n[doc-arg-limit] \
  1846. . ds doc-macro-name So
  1847. .
  1848. . ds doc-quote-left "\*[doc-left-singlequote]
  1849. .
  1850. . doc-enclose-open \$@
  1851. ..
  1852. .
  1853. .
  1854. .\" NS Sc user macro
  1855. .\" NS single quote close
  1856. .\" NS
  1857. .\" NS modifies:
  1858. .\" NS doc-macro-name
  1859. .\" NS doc-quote-right
  1860. .\" NS
  1861. .\" NS width register `Sc' set in doc-common
  1862. .
  1863. .de Sc
  1864. . if !\n[doc-arg-limit] \
  1865. . ds doc-macro-name Sc
  1866. .
  1867. . ds doc-quote-right "\*[doc-right-singlequote]
  1868. .
  1869. . doc-enclose-close \$@
  1870. ..
  1871. .
  1872. .
  1873. .\" NS Xo user macro
  1874. .\" NS extend open
  1875. .\" NS
  1876. .\" NS modifies:
  1877. .\" NS doc-macro-name
  1878. .\" NS doc-quote-left
  1879. .\" NS
  1880. .\" NS width register `Xo' set in doc-common
  1881. .
  1882. .de Xo
  1883. . if !\n[doc-arg-limit] \
  1884. . ds doc-macro-name Xo
  1885. .
  1886. . ds doc-quote-left
  1887. .
  1888. . doc-enclose-open \$@
  1889. ..
  1890. .
  1891. .
  1892. .\" NS Xc user macro
  1893. .\" NS extend close
  1894. .\" NS
  1895. .\" NS modifies:
  1896. .\" NS doc-macro-name
  1897. .\" NS doc-quote-right
  1898. .\" NS
  1899. .\" NS width register `Xc' set in doc-common
  1900. .
  1901. .de Xc
  1902. . if !\n[doc-arg-limit] \
  1903. . ds doc-macro-name Xc
  1904. .
  1905. . ds doc-quote-right
  1906. .
  1907. . doc-enclose-close \$@
  1908. ..
  1909. .
  1910. .
  1911. .\" NS doc-nesting-level global register
  1912. .\" NS used by `doc-enclose-open' and `doc-enclose-close'
  1913. .
  1914. .nr doc-nesting-level 0
  1915. .
  1916. .
  1917. .\" NS doc-in-list global register (bool)
  1918. .\" NS whether we are in (logical) .It
  1919. .
  1920. .nr doc-in-list 0
  1921. .
  1922. .
  1923. .\" NS doc-enclose-open macro
  1924. .\" NS enclose string open
  1925. .\" NS
  1926. .\" NS modifies:
  1927. .\" NS doc-arg-ptr
  1928. .\" NS doc-nesting-level
  1929. .
  1930. .de doc-enclose-open
  1931. . if !\n[doc-arg-limit] \
  1932. . doc-parse-args \$@
  1933. .
  1934. . nr doc-arg-ptr +1
  1935. . doc-print-prefixes
  1936. . nr doc-arg-ptr -1
  1937. .
  1938. . nop \)\*[doc-quote-left]\)\c
  1939. .
  1940. . \" start enclosure box
  1941. . box doc-enclosure-box\n[doc-nesting-level]
  1942. . ev doc-enclosure-env\n[doc-nesting-level]
  1943. . evc 0
  1944. . in 0
  1945. . nf
  1946. . \" we insert something to make .chop always work
  1947. . nop \&\c
  1948. .
  1949. . \" increase nesting level *after* parsing of arguments
  1950. . nr doc-nesting-level +1
  1951. .
  1952. . if \n[doc-arg-limit] \{\
  1953. . nr doc-arg-ptr +1
  1954. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
  1955. . doc-print-recursive
  1956. . el \
  1957. . doc-reset-args
  1958. . \}
  1959. ..
  1960. .
  1961. .
  1962. .\" NS doc-enclose-close macro
  1963. .\" NS enclose string close
  1964. .\" NS
  1965. .\" NS modifies:
  1966. .\" NS doc-nesting-level
  1967. .
  1968. .de doc-enclose-close
  1969. . nr doc-nesting-level -1
  1970. .
  1971. . \" finish enclosure box
  1972. . br
  1973. . ev
  1974. . box
  1975. . chop doc-enclosure-box\n[doc-nesting-level]
  1976. . unformat doc-enclosure-box\n[doc-nesting-level]
  1977. .
  1978. . nh
  1979. . nop \*[doc-enclosure-box\n[doc-nesting-level]]\c
  1980. . nop \)\*[doc-quote-right]\)\c
  1981. .
  1982. . if !\n[doc-arg-limit] \{\
  1983. . doc-parse-args \$@
  1984. .
  1985. . if !\n[.$] \
  1986. . doc-print-and-reset
  1987. . \}
  1988. .
  1989. . if \n[doc-arg-limit] \{\
  1990. . ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
  1991. . nop \)\*[doc-space\n[doc-arg-ptr]]\c
  1992. . nr doc-arg-ptr +1
  1993. . doc-print-recursive
  1994. . \}
  1995. . el \
  1996. . doc-print-and-reset
  1997. . \}
  1998. .
  1999. . \" shall we finish .It macro?
  2000. . if !"\*[doc-macro-name]"It" \
  2001. . if \n[doc-in-list] \
  2002. . if !\n[doc-nesting-level] \
  2003. . doc-\*[doc-list-type-stack\n[doc-list-depth]]
  2004. ..
  2005. .
  2006. .
  2007. .\" NS Pf user macro
  2008. .\" NS prefix: `.Pf prefix arg ...'
  2009. .\" NS
  2010. .\" NS modifies:
  2011. .\" NS doc-arg-ptr
  2012. .\" NS doc-macro-name
  2013. .\" NS doc-quote-left
  2014. .\" NS
  2015. .\" NS width register `Pf' set in doc-common
  2016. .
  2017. .de Pf
  2018. . if !\n[doc-arg-limit] \
  2019. . ds doc-macro-name Pf
  2020. .
  2021. . ie \n[doc-arg-limit] \{\
  2022. . ie ((\n[doc-arg-limit] - \n[doc-arg-ptr]) > 1) \{\
  2023. . nr doc-arg-ptr +1
  2024. . nop \)\*[doc-arg\n[doc-arg-ptr]]\c
  2025. . \}
  2026. . el \
  2027. . tm mdoc warning: .Pf: trailing prefix (#\n[.c])
  2028. . \}
  2029. . el \{\
  2030. . nop \)\$1\)\c
  2031. . shift
  2032. . ie \n[.$] \
  2033. . doc-parse-args \$@
  2034. . el \{\
  2035. . tm mdoc warning: .Pf: missing arguments (#\n[.c])
  2036. . nop \)
  2037. . \}\}
  2038. .
  2039. . if \n[doc-arg-limit] \{\
  2040. . nr doc-arg-ptr +1
  2041. . ie (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
  2042. . doc-print-and-reset
  2043. . el \
  2044. . doc-do-\n[doc-type\n[doc-arg-ptr]]
  2045. . \}
  2046. ..
  2047. .
  2048. .
  2049. .\" NS Ns user macro
  2050. .\" NS remove space (space removal done by `doc-parse-args')
  2051. .\" NS
  2052. .\" NS modifies:
  2053. .\" NS doc-argXXX
  2054. .\" NS doc-macro-name
  2055. .\" NS
  2056. .\" NS width register `Ns' set in doc-common
  2057. .
  2058. .de Ns
  2059. . if !\n[doc-arg-limit] \{\
  2060. . ie \n[.$] \{\
  2061. . ds doc-macro-name Ns
  2062. . doc-parse-args \$@
  2063. . \}
  2064. . el \
  2065. . tm Usage: .Ns must be called with arguments (#\n[.c])
  2066. . \}
  2067. .
  2068. . if \n[doc-arg-limit] \{\
  2069. . nr doc-arg-ptr +1
  2070. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
  2071. . doc-print-recursive
  2072. . el \
  2073. . doc-reset-args
  2074. . \}
  2075. ..
  2076. .
  2077. .
  2078. .\" NS Ap user macro
  2079. .\" NS append an apostrophe
  2080. .\" NS
  2081. .\" NS width register `Ap' set in doc-common
  2082. .
  2083. .de Ap
  2084. . ie !\n[doc-arg-limit] \
  2085. . tm Usage: `Ap' cannot be first macro on a line (no `.Ap') (#\n[.c])
  2086. . el \{\
  2087. . nop \)'\)\c
  2088. . nr doc-arg-ptr +1
  2089. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
  2090. . doc-print-recursive
  2091. . el \
  2092. . doc-reset-args
  2093. . \}
  2094. ..
  2095. .
  2096. .
  2097. .\" NS doc-space global string
  2098. .\" NS current inter-argument space
  2099. .
  2100. .ds doc-space "\*[doc-soft-space]
  2101. .
  2102. .
  2103. .\" NS doc-soft-space constant string
  2104. .\" NS soft (stretchable) space (defined in doc-common)
  2105. .
  2106. .
  2107. .\" NS doc-hard-space constant string
  2108. .\" NS hard (unpaddable) space (defined in doc-common)
  2109. .
  2110. .
  2111. .\" NS doc-set-hard-space macro
  2112. .\" NS set current space string to hard (unpaddable) space.
  2113. .\" NS
  2114. .\" NS modifies:
  2115. .\" NS doc-saved-space
  2116. .\" NS doc-space
  2117. .
  2118. .de doc-set-hard-space
  2119. . ie "\*[doc-space]"" \
  2120. . ds doc-saved-space "\*[doc-hard-space]
  2121. . el \
  2122. . ds doc-space "\*[doc-hard-space]
  2123. ..
  2124. .
  2125. .
  2126. .\" NS doc-set-soft-space macro
  2127. .\" NS set current space string to soft space
  2128. .\" NS
  2129. .\" NS modifies:
  2130. .\" NS doc-saved-space
  2131. .\" NS doc-space
  2132. .
  2133. .de doc-set-soft-space
  2134. . ie "\*[doc-space]"" \
  2135. . ds doc-saved-space "\*[doc-soft-space]
  2136. . el \
  2137. . ds doc-space "\*[doc-soft-space]
  2138. ..
  2139. .
  2140. .
  2141. .\" NS doc-space-mode global register (bool)
  2142. .\" NS default is one (space mode on)
  2143. .
  2144. .nr doc-space-mode 1
  2145. .
  2146. .
  2147. .\" NS doc-saved-space global string
  2148. .\" NS saved value of `doc-space'
  2149. .
  2150. .ds doc-saved-space "\*[doc-space]
  2151. .
  2152. .
  2153. .\" NS doc-have-space global register (bool)
  2154. .\" NS set if last command was horizontal space
  2155. .
  2156. .nr doc-have-space 0
  2157. .
  2158. .
  2159. .\" NS Sm user macro
  2160. .\" NS space mode (`.Sm'/`.Sm on'/`.Sm off')
  2161. .\" NS
  2162. .\" NS without argument, toggle space mode
  2163. .\" NS
  2164. .\" NS modifies:
  2165. .\" NS doc-arg-limit
  2166. .\" NS doc-arg-ptr
  2167. .\" NS doc-argXXX
  2168. .\" NS doc-macro-name
  2169. .\" NS doc-num-args
  2170. .\" NS doc-saved-space
  2171. .\" NS doc-space
  2172. .\" NS doc-space-mode
  2173. .\" NS doc-spaceXXX
  2174. .\" NS
  2175. .\" NS local variables:
  2176. .\" NS doc-reg-Sm
  2177. .\" NS
  2178. .\" NS width register `Sm' set in doc-common
  2179. .
  2180. .de Sm
  2181. . ie \n[doc-have-space] \
  2182. . nr doc-reg-Sm 0
  2183. . el \
  2184. . nr doc-reg-Sm 1
  2185. .
  2186. . if !\n[doc-arg-limit] \{\
  2187. . ie \n[.$] \{\
  2188. . ds doc-macro-name Sm
  2189. . doc-parse-args \$@
  2190. . \}
  2191. . el \{\
  2192. . ie \n[doc-space-mode] \{\
  2193. . ds doc-saved-space "\*[doc-space]
  2194. . ds doc-space
  2195. . nr doc-space-mode 0
  2196. . \}
  2197. . el \{\
  2198. . ds doc-space "\*[doc-saved-space]
  2199. . nr doc-space-mode 1
  2200. .
  2201. . \" finish line only if it is interrupted and `doc-have-space'
  2202. . \" isn't set
  2203. . if \n[doc-reg-Sm] \
  2204. . if \n[.int] \
  2205. . nop \)
  2206. . \}
  2207. . \}\}
  2208. .
  2209. . if !\n[doc-arg-limit] \
  2210. . return
  2211. .
  2212. . nr doc-arg-ptr +1
  2213. .
  2214. . \" avoid a warning message in case `Sm' is the last parameter
  2215. . if !d doc-arg\n[doc-arg-ptr] \
  2216. . ds doc-arg\n[doc-arg-ptr]
  2217. .
  2218. . ie "\*[doc-arg\n[doc-arg-ptr]]"on" \{\
  2219. . ds doc-space "\*[doc-saved-space]
  2220. . nr doc-space-mode 1
  2221. . \}
  2222. . el \{\
  2223. . ie "\*[doc-arg\n[doc-arg-ptr]]"off" \{\
  2224. . ds doc-saved-space "\*[doc-space]
  2225. . ds doc-space
  2226. . nr doc-space-mode 0
  2227. . \}
  2228. . el \{\
  2229. . \" no argument for Sm
  2230. . nr doc-arg-ptr -1
  2231. . ie \n[doc-space-mode] \{\
  2232. . ds doc-saved-space "\*[doc-space]
  2233. . ds doc-space
  2234. . nr doc-space-mode 0
  2235. . \}
  2236. . el \{\
  2237. . ds doc-space "\*[doc-saved-space]
  2238. . nr doc-space-mode 1
  2239. . \}
  2240. . \}\}
  2241. .
  2242. . ie \n[doc-space-mode] \{\
  2243. . \" recompute space vector for remaining arguments
  2244. . nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr])
  2245. . nr doc-arg-limit \n[doc-arg-ptr]
  2246. . if \n[doc-num-args] \
  2247. . doc-parse-space-vector
  2248. .
  2249. . \" finish line only if it is interrupted and `doc-have-space'
  2250. . \" isn't set
  2251. . if \n[doc-reg-Sm] \
  2252. . if \n[.int] \
  2253. . nop \)
  2254. . \}
  2255. . el \{\
  2256. . \" reset remaining space vector elements
  2257. . nr doc-reg-Sm (\n[doc-arg-ptr] + 1)
  2258. . while (\n[doc-reg-Sm] <= \n[doc-arg-limit]) \{\
  2259. . ds doc-space\n[doc-reg-Sm]
  2260. . nr doc-reg-Sm +1
  2261. . \" the body of a `while' request must end with the fitting `\}'!
  2262. . \}
  2263. . \}
  2264. .
  2265. . \" do we have parameters to print?
  2266. . ie (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
  2267. . \" skip `Sm' argument
  2268. . nr doc-arg-ptr +1
  2269. . doc-print-recursive
  2270. . \}
  2271. . el \
  2272. . doc-reset-args
  2273. ..
  2274. .
  2275. .
  2276. .\" NS doc-arg-type immediate register
  2277. .\" NS argument type (macro=1, string=2, punctuation suffix=3,
  2278. .\" NS punctuation prefix=4)
  2279. .
  2280. .nr doc-arg-type 0
  2281. .
  2282. .
  2283. .\" NS doc-get-arg-type macro
  2284. .\" NS get argument type
  2285. .\" NS
  2286. .\" NS this macro expects the width of the argument in `doc-width'
  2287. .\" NS
  2288. .\" NS modifies:
  2289. .\" NS doc-arg-type
  2290. .
  2291. .de doc-get-arg-type
  2292. . nr doc-arg-type 2
  2293. .
  2294. . if ((\n[doc-width] < 4) & \A\$1) \{\
  2295. . ie (\n[doc-width] == 1) \{\
  2296. . if r doc-punct\$1 \
  2297. . nr doc-arg-type \n[doc-punct\$1]
  2298. . \}
  2299. . el \
  2300. . if r \$1 \
  2301. . if d \$1 \
  2302. . nr doc-arg-type 1
  2303. . \}
  2304. ..
  2305. .
  2306. .
  2307. .\" NS doc-get-arg-type* macro
  2308. .\" NS similar to as `doc-get-arg-type' but uses doc-argXXX strings
  2309. .\" NS
  2310. .\" NS this macro sets the `doc-width' register using the `length' request
  2311. .\" NS to get the number of characters in a string literally
  2312. .\" NS
  2313. .\" NS modifies:
  2314. .\" NS doc-arg-type
  2315. .\" NS doc-width
  2316. .
  2317. .de doc-get-arg-type*
  2318. . nr doc-arg-type 2
  2319. . length doc-width "\*[doc-arg\$1]
  2320. .
  2321. . if ((\n[doc-width] < 4) & \A\*[doc-arg\$1]) \{\
  2322. . ie (\n[doc-width] == 1) \{\
  2323. . if r doc-punct\*[doc-arg\$1] \
  2324. . nr doc-arg-type \n[doc-punct\*[doc-arg\$1]]
  2325. . \}
  2326. . el \
  2327. . if r \*[doc-arg\$1] \
  2328. . if d \*[doc-arg\$1] \
  2329. . nr doc-arg-type 1
  2330. . \}
  2331. ..
  2332. .
  2333. .
  2334. .\" NS doc-set-spacing-1 macro
  2335. .\" NS set spacing for macros
  2336. .\" NS
  2337. .\" NS modifies:
  2338. .\" NS doc-spaceXXX
  2339. .\" NS
  2340. .\" NS local variables:
  2341. .\" NS doc-reg-dssfm
  2342. .\" NS doc-reg-dssfm1
  2343. .
  2344. .de doc-set-spacing-1
  2345. . nr doc-reg-dssfm1 \n[\*[doc-arg\n[doc-arg-limit]]]
  2346. .
  2347. . \" closing macros like .Ac, Bc., etc. have value 3 (remove space before
  2348. . \" argument)
  2349. . ie (\n[doc-reg-dssfm1] == 3) \{\
  2350. . if \n[doc-arg-limit] \{\
  2351. . nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
  2352. . ds doc-space\n[doc-reg-dssfm]
  2353. . \}
  2354. . ds doc-space\n[doc-arg-limit] "\*[doc-space]
  2355. . \}
  2356. . el \{\
  2357. . \" macros like .Ap and .Ns have value 2 (remove space before and after
  2358. . \" argument)
  2359. . ie (\n[doc-reg-dssfm1] == 2) \{\
  2360. . if \n[doc-arg-limit] \{\
  2361. . nr doc-reg-dssfm (\n[doc-arg-limit] - 1)
  2362. . ds doc-space\n[doc-reg-dssfm]
  2363. . \}
  2364. . ds doc-space\n[doc-arg-limit]
  2365. . \}
  2366. . el \
  2367. . ds doc-space\n[doc-arg-limit]
  2368. . \}
  2369. ..
  2370. .
  2371. .
  2372. .\" NS doc-set-spacing-2 macro
  2373. .\" NS set spacing for strings
  2374. .\" NS
  2375. .\" NS modifies:
  2376. .\" NS doc-spaceXXX
  2377. .
  2378. .de doc-set-spacing-2
  2379. . ds doc-space\n[doc-arg-limit] "\*[doc-space]
  2380. ..
  2381. .
  2382. .
  2383. .\" NS doc-set-spacing-3 macro
  2384. .\" NS set spacing for punctuation suffixes
  2385. .\" NS
  2386. .\" NS modifies:
  2387. .\" NS doc-spaceXXX
  2388. .\" NS
  2389. .\" NS local variables:
  2390. .\" NS doc-reg-dssfps
  2391. .
  2392. .de doc-set-spacing-3
  2393. . if \n[doc-arg-limit] \{\
  2394. . nr doc-reg-dssfps (\n[doc-arg-limit] - 1)
  2395. . ds doc-space\n[doc-reg-dssfps]
  2396. . \}
  2397. .
  2398. . ds doc-space\n[doc-arg-limit] "\*[doc-space]
  2399. ..
  2400. .
  2401. .
  2402. .\" NS doc-set-spacing-4 macro
  2403. .\" NS set spacing for punctuation prefixes
  2404. .\" NS
  2405. .\" NS modifies:
  2406. .\" NS doc-spaceXXX
  2407. .
  2408. .de doc-set-spacing-4
  2409. . ds doc-space\n[doc-arg-limit]
  2410. ..
  2411. .
  2412. .
  2413. .\" type switches (on current argument doc-arg-ptr)
  2414. .
  2415. .
  2416. .\" NS doc-do-1 macro
  2417. .\" NS call request if macro
  2418. .
  2419. .de doc-do-1
  2420. . \*[doc-arg\n[doc-arg-ptr]]
  2421. ..
  2422. .
  2423. .
  2424. .\" NS doc-do-2 macro
  2425. .\" NS call .doc-print-recursive if string
  2426. .
  2427. .als doc-do-2 doc-print-recursive
  2428. .
  2429. .
  2430. .\" NS doc-do-3 macro
  2431. .\" NS call .doc-print-recursive if punctuation suffix
  2432. .
  2433. .als doc-do-3 doc-print-recursive
  2434. .
  2435. .
  2436. .\" NS doc-do-4 macro
  2437. .\" NS call .doc-print-recursive if punctuation prefix
  2438. .
  2439. .als doc-do-4 doc-print-recursive
  2440. .
  2441. .
  2442. .\" NS doc-fontmode-depth global register
  2443. .\" NS font mode level
  2444. .
  2445. .nr doc-fontmode-depth 0
  2446. .
  2447. .
  2448. .\" NS doc-fontmode-font-stackXXX global register
  2449. .\" NS stack of saved current font values from `Bf' macro
  2450. .\" NS
  2451. .\" NS limit:
  2452. .\" NS doc-fontmode-depth
  2453. .
  2454. .nr doc-fontmode-font-stack0 0
  2455. .
  2456. .
  2457. .\" NS doc-fontmode-size-stackXXX global register
  2458. .\" NS stack of saved current size values from `Bf' macro
  2459. .\" NS
  2460. .\" NS limit:
  2461. .\" NS doc-fontmode-depth
  2462. .
  2463. .nr doc-fontmode-size-stack0 0
  2464. .
  2465. .
  2466. .\" NS Bf user macro
  2467. .\" NS begin font mode (will be begin-mode/end-mode in groff & TeX)
  2468. .\" NS
  2469. .\" NS modifies:
  2470. .\" NS doc-fontmode-depth
  2471. .\" NS doc-fontmode-font-stackXXX
  2472. .\" NS doc-fontmode-size-stackXXX
  2473. .\" NS doc-macro-name
  2474. .\" NS
  2475. .\" NS width register `Bf' set in doc-common
  2476. .
  2477. .de Bf
  2478. . ds doc-macro-name Bf
  2479. .
  2480. . ie \n[.$] \{\
  2481. . nr doc-fontmode-depth +1
  2482. .
  2483. . \" save current font and size
  2484. . nr doc-fontmode-font-stack\n[doc-fontmode-depth] \n[.f]
  2485. . nr doc-fontmode-size-stack\n[doc-fontmode-depth] \n[.ps]
  2486. .
  2487. . ie "\$1"Em" \
  2488. . nop \*[doc-Em-font]\c
  2489. . el \{ .ie "\$1"Li" \
  2490. . nop \*[doc-Li-font]\c
  2491. . el \{ .ie "\$1"Sy" \
  2492. . nop \*[doc-Sy-font]\c
  2493. . el \{ .ie "\$1"-emphasis" \
  2494. . nop \*[doc-Em-font]\c
  2495. . el \{ .ie "\$1"-literal" \
  2496. . nop \*[doc-Li-font]\c
  2497. . el \{ .ie "\$1"-symbolic" \
  2498. . nop \*[doc-Sy-font]\c
  2499. . el \{\
  2500. . tmc mdoc warning: Unknown keyword `\$1' in .Bf macro
  2501. . tm1 " (#\n[.c])
  2502. . \}\}\}\}\}\}\}
  2503. . el \
  2504. . tm Usage: .Bf [Em | -emphasis | Li | -literal | Sy | -symbolic] (#\n[.c])
  2505. ..
  2506. .
  2507. .
  2508. .\" NS Ef user macro
  2509. .\" NS end font mode
  2510. .\" NS
  2511. .\" NS modifies:
  2512. .\" NS doc-macro-name
  2513. .\" NS
  2514. .\" NS width register `Ef' set in doc-common
  2515. .
  2516. .de Ef
  2517. . ds doc-macro-name Ef
  2518. .
  2519. . ie \n[doc-fontmode-depth] \{\
  2520. . \" restore saved font and size
  2521. . nop \)\f[\n[doc-fontmode-font-stack\n[doc-fontmode-depth]]]\c
  2522. . nop \)\s[\n[doc-fontmode-size-stack\n[doc-fontmode-depth]]u]\c
  2523. .
  2524. . nr doc-fontmode-font-stack\n[doc-fontmode-depth] 0
  2525. . nr doc-curr-font \n[.f]
  2526. . nr doc-fontmode-size-stack\n[doc-fontmode-depth] 0
  2527. . nr doc-curr-size \n[.ps]
  2528. . nr doc-fontmode-depth -1
  2529. . \}
  2530. . el \
  2531. . tm mdoc warning: Extraneous .Ef (#\n[.c])
  2532. ..
  2533. .
  2534. .
  2535. .\" NS doc-keep-type global register
  2536. .\" NS current keep type; 1 is `-words', 2 is `-lines', 3 is unknown
  2537. .
  2538. .nr doc-keep-type 0
  2539. .
  2540. .
  2541. .\" NS Bk user macro
  2542. .\" NS begin keep
  2543. .\" NS
  2544. .\" NS modifies:
  2545. .\" NS doc-keep-type
  2546. .\" NS doc-macro-name
  2547. .\" NS
  2548. .\" NS width register `Bk' set in doc-common
  2549. .
  2550. .de Bk
  2551. . ds doc-macro-name Bk
  2552. .
  2553. . if \n[doc-keep-type] \
  2554. . tm .Bk: nesting keeps not implemented yet. (#\n[.c])
  2555. .
  2556. . ie "\$1"-lines" \{\
  2557. . nr doc-keep-type 2
  2558. . tm .Bk -lines: Not implemented yet. (#\n[.c])
  2559. . \}
  2560. . el \{ .ie "\$1"-words" \{\
  2561. . nr doc-keep-type 1
  2562. . doc-set-hard-space
  2563. . \}
  2564. . el \{ .ie "\$1"" \{\
  2565. . \" default
  2566. . nr doc-keep-type 1
  2567. . doc-set-hard-space
  2568. . \}
  2569. . el \{\
  2570. . tm mdoc warning: Unknown keyword `\$1' in .Bk macro (#\n[.c])
  2571. . nr doc-keep-type 3
  2572. . \}\}\}
  2573. .
  2574. \#. nr doc-nesting-level +1
  2575. ..
  2576. .
  2577. .
  2578. .\" NS Ek user macro
  2579. .\" NS end keep
  2580. .\" NS
  2581. .\" NS modifies:
  2582. .\" NS doc-keep-type
  2583. .\" NS doc-macro-name
  2584. .\" NS
  2585. .\" NS width register `Ek' set in doc-common
  2586. .
  2587. .de Ek
  2588. . ds doc-macro-name Ek
  2589. .
  2590. \#. nr doc-nesting-level -1
  2591. .
  2592. . ie \n[.$] \
  2593. . tm Usage: .Ek (does not take arguments) (#\n[.c])
  2594. . el \{\
  2595. . if !\n[doc-keep-type] \
  2596. . tm mdoc warning: .Ek found without .Bk before (#\n[.c])
  2597. .
  2598. . ie (\n[doc-keep-type] == 1) \
  2599. . doc-set-soft-space
  2600. . el \{ .if (\n[doc-keep-type] == 2) \
  2601. . tm .Bk -lines: Not implemented yet. (#\n[.c])
  2602. . \}\}
  2603. .
  2604. . nr doc-keep-type 0
  2605. .
  2606. \#. if !"\*[doc-out-string]"" \
  2607. \#. doc-print-out-string
  2608. ..
  2609. .
  2610. .
  2611. .\" NS doc-display-depth global register
  2612. .\" NS display level
  2613. .
  2614. .nr doc-display-depth 0
  2615. .
  2616. .
  2617. .\" NS doc-is-compact global register (bool)
  2618. .\" NS set if the `compact' keyword is given
  2619. .
  2620. .nr doc-is-compact 0
  2621. .
  2622. .
  2623. .\" NS doc-display-type-stackXXX global string
  2624. .\" NS the display type stack
  2625. .\" NS
  2626. .\" NS limit:
  2627. .\" NS doc-display-depth
  2628. .
  2629. .ds doc-display-type-stack0
  2630. .
  2631. .
  2632. .\" NS doc-display-indent-stackXXX global register
  2633. .\" NS stack of display indentation values
  2634. .\" NS
  2635. .\" NS limit:
  2636. .\" NS doc-display-depth
  2637. .
  2638. .nr doc-display-indent-stack0 0
  2639. .
  2640. .
  2641. .\" NS doc-display-ad-stackXXX global register
  2642. .\" NS stack of saved adjustment modes
  2643. .\" NS
  2644. .\" NS limit:
  2645. .\" NS doc-display-depth
  2646. .
  2647. .nr doc-display-ad-stack0 0
  2648. .
  2649. .
  2650. .\" NS doc-display-fi-stackXXX global register
  2651. .\" NS stack of saved fill modes
  2652. .\" NS
  2653. .\" NS limit:
  2654. .\" NS doc-display-depth
  2655. .
  2656. .nr doc-display-fi-stack0 0
  2657. .
  2658. .
  2659. .\" NS doc-display-ft-stackXXX global register
  2660. .\" NS stack of saved fonts
  2661. .\" NS
  2662. .\" NS limit:
  2663. .\" NS doc-display-depth
  2664. .
  2665. .nr doc-display-ft-stack0 0
  2666. .
  2667. .
  2668. .\" NS doc-display-ps-stackXXX global register
  2669. .\" NS stack of saved font sizes
  2670. .\" NS
  2671. .\" NS limit:
  2672. .\" NS doc-display-depth
  2673. .
  2674. .nr doc-display-ps-stack0 0
  2675. .
  2676. .
  2677. .\" NS Bd user macro
  2678. .\" NS begin display
  2679. .\" NS
  2680. .\" NS width register `Bd' set in doc-common
  2681. .\" NS
  2682. .\" NS modifies:
  2683. .\" NS doc-curr-font
  2684. .\" NS doc-curr-size
  2685. .\" NS doc-display-depth
  2686. .\" NS doc-display-ad-stackXXX
  2687. .\" NS doc-display-fi-stackXXX
  2688. .\" NS doc-display-ft-stackXXX
  2689. .\" NS doc-display-ps-stackXXX
  2690. .\" NS doc-display-file
  2691. .\" NS doc-display-indent-stackXXX
  2692. .\" NS doc-display-type-stackXXX
  2693. .\" NS doc-is-compact
  2694. .\" NS doc-macro-name
  2695. .\" NS
  2696. .\" NS local variables:
  2697. .\" NS doc-reg-Bd
  2698. .
  2699. .de Bd
  2700. . ds doc-macro-name Bd
  2701. .
  2702. . if !\n[.$] \{\
  2703. . tm1 "Usage: .Bd {-literal | -filled | -ragged | -centered | -unfilled}
  2704. . tm1 " [-offset [string]] [-compact] [-file name] (#\n[.c])
  2705. . return
  2706. . \}
  2707. .
  2708. . nr doc-is-compact 0
  2709. . ds doc-display-file
  2710. . nr doc-reg-Bd 1
  2711. . nr doc-display-depth +1
  2712. .
  2713. . \" save current adjustment and fill modes
  2714. . nr doc-display-ad-stack\n[doc-display-depth] \n[.j]
  2715. . nr doc-display-fi-stack\n[doc-display-depth] \n[.u]
  2716. .
  2717. . ie "\$1"-literal" \{\
  2718. . ds doc-display-type-stack\n[doc-display-depth] literal
  2719. . nr doc-display-ft-stack\n[doc-display-depth] \n[.f]
  2720. . nr doc-display-ps-stack\n[doc-display-depth] \n[.ps]
  2721. .
  2722. . ie t \
  2723. . ta T 9n
  2724. . el \
  2725. . ta T 8n
  2726. . nf
  2727. . \}
  2728. . el \{ .ie "\$1"-filled" \{\
  2729. . ds doc-display-type-stack\n[doc-display-depth] filled
  2730. . ad b
  2731. . fi
  2732. . \}
  2733. . el \{ .ie "\$1"-ragged" \{\
  2734. . ds doc-display-type-stack\n[doc-display-depth] ragged
  2735. . na
  2736. . fi
  2737. . \}
  2738. . el \{ .ie "\$1"-centered" \{\
  2739. . ds doc-display-type-stack\n[doc-display-depth] centered
  2740. . ad c
  2741. . fi
  2742. . \}
  2743. . el \{ .ie "\$1"-unfilled" \{\
  2744. . ds doc-display-type-stack\n[doc-display-depth] unfilled
  2745. . nf
  2746. . \}
  2747. . el \{\
  2748. . tm1 "mdoc warning: Unknown keyword `\$1' (or missing display type)
  2749. . tm1 " in .Bd macro (#\n[.c])
  2750. . nr doc-reg-Bd 0
  2751. . \}\}\}\}\}
  2752. .
  2753. . \" have we seen an argument?
  2754. . if \n[doc-reg-Bd] \{\
  2755. . shift
  2756. . \" check other arguments
  2757. . if \n[.$] \
  2758. . doc-do-Bd-args \$@
  2759. . \}
  2760. .
  2761. . \" avoid warning about non-existent register
  2762. . if !r doc-display-indent-stack\n[doc-display-depth] \
  2763. . nr doc-display-indent-stack\n[doc-display-depth] 0
  2764. .
  2765. . if \n[doc-display-indent-stack\n[doc-display-depth]] \
  2766. . in +\n[doc-display-indent-stack\n[doc-display-depth]]u
  2767. .
  2768. . if !\n[doc-is-compact] \
  2769. . sp \n[doc-display-vertical]u
  2770. .
  2771. . if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \
  2772. . if t \
  2773. . nop \*[doc-Li-font]\c
  2774. .
  2775. . if !\n[cR] \
  2776. . ne 2v
  2777. .
  2778. . if !"\*[doc-display-file]"" \
  2779. . so \*[doc-display-file]
  2780. .
  2781. . nr doc-is-compact 0
  2782. . ds doc-display-file
  2783. ..
  2784. .
  2785. .
  2786. .\" NS doc-do-Bd-args macro
  2787. .\" NS resolve remaining .Bd arguments
  2788. .\" NS
  2789. .\" NS modifies:
  2790. .\" NS doc-display-file
  2791. .\" NS doc-display-indent-stackXXX
  2792. .\" NS doc-is-compact
  2793. .\" NS
  2794. .\" NS local variables:
  2795. .\" NS doc-reg-ddBa
  2796. .\" NS doc-reg-ddBa1
  2797. .\" NS doc-reg-ddBa2
  2798. .\" NS doc-reg-ddBa3
  2799. .\" NS doc-reg-ddBa4
  2800. .\" NS doc-str-ddBa
  2801. .
  2802. .de doc-do-Bd-args
  2803. . nr doc-reg-ddBa 1
  2804. .
  2805. . ie "\$1"-offset" \{\
  2806. . nr doc-reg-ddBa 2
  2807. .
  2808. . ie "\$2"left" \
  2809. . nr doc-display-indent-stack\n[doc-display-depth] 0
  2810. . el \{ .ie "\$2"right" \
  2811. . nr doc-display-indent-stack\n[doc-display-depth] (\n[.l]u / 3u)
  2812. . el \{ .ie "\$2"center" \
  2813. . nr doc-display-indent-stack\n[doc-display-depth] ((\n[.l]u - \n[.i]u) / 4u)
  2814. . el \{ .ie "\$2"indent" \
  2815. . nr doc-display-indent-stack\n[doc-display-depth] \n[doc-display-indent]u
  2816. . el \{ .ie "\$2"indent-two" \
  2817. . nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-display-indent]u + \n[doc-display-indent]u)
  2818. . el \
  2819. . nr doc-reg-ddBa 1
  2820. . \}\}\}\}
  2821. .
  2822. . \" not a known keyword
  2823. . if (\n[doc-reg-ddBa] == 1) \{\
  2824. . nr doc-reg-ddBa 2
  2825. .
  2826. . nr doc-reg-ddBa1 0
  2827. . if \B(\$2) \{\
  2828. . \" disable warnings related to scaling indicators (32)
  2829. . nr doc-reg-ddBa2 \n[.warn]
  2830. . warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
  2831. .
  2832. . \" values without a scaling indicator are taken as strings;
  2833. . \" we test whether the parameter string with and without the last
  2834. . \" character yields identical numerical results (ignoring the
  2835. . \" scaling indicator)
  2836. . ds doc-str-ddBa "\$2
  2837. . substring doc-str-ddBa 0 -2
  2838. . if \B(\*[doc-str-ddBa]) \{\
  2839. . nr doc-reg-ddBa3 (;(\$2))
  2840. . nr doc-reg-ddBa4 (\*[doc-str-ddBa])
  2841. . if (\n[doc-reg-ddBa3] == \n[doc-reg-ddBa4]) \
  2842. . nr doc-reg-ddBa1 1
  2843. . \}
  2844. .
  2845. . \" enable all warnings again
  2846. . warn \n[doc-reg-ddBa2]
  2847. . \}
  2848. .
  2849. . ie \n[doc-reg-ddBa1] \
  2850. . nr doc-display-indent-stack\n[doc-display-depth] \$2
  2851. . el \{\
  2852. . doc-get-width "\$2"
  2853. . ie (\n[doc-width] <= 3) \{\
  2854. . \" if the offset parameter is a macro, use the macro's
  2855. . \" width as specified in doc-common
  2856. . doc-get-arg-type "\$2"
  2857. . ie (\n[doc-arg-type] == 1) \
  2858. . nr doc-display-indent-stack\n[doc-display-depth] \n[\$2]
  2859. . el \
  2860. . nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  2861. . \}
  2862. . el \
  2863. . nr doc-display-indent-stack\n[doc-display-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  2864. . \}\}
  2865. . \}
  2866. . el \{ .ie "\$1"-compact" \
  2867. . nr doc-is-compact 1
  2868. . el \{ .ie "\$1"-file" \{\
  2869. . ie !"\$2"" \{\
  2870. . ds doc-display-file "\$2
  2871. . nr doc-reg-ddBa 2
  2872. . \}
  2873. . el \
  2874. . tm mdoc warning: .Bd `-file' keyword requires argument (#\n[.c])
  2875. . \}
  2876. . el \
  2877. . tm mdoc warning: Unknown keyword `\$1' in .Bd macro (#\n[.c])
  2878. . \}\}
  2879. .
  2880. . if (\n[doc-reg-ddBa] < \n[.$]) \{\
  2881. . shift \n[doc-reg-ddBa]
  2882. . doc-do-Bd-args \$@
  2883. . \}
  2884. ..
  2885. .
  2886. .
  2887. .\" NS Ed user macro
  2888. .\" NS end display
  2889. .\" NS
  2890. .\" NS modifies:
  2891. .\" NS doc-display-depth
  2892. .\" NS doc-display-indent-stackXXX
  2893. .\" NS doc-display-type-stackXXX
  2894. .\" NS doc-macro-name
  2895. .\" NS
  2896. .\" NS width register `Ed' set in doc-common
  2897. .
  2898. .de Ed
  2899. . ds doc-macro-name Ed
  2900. .
  2901. . br
  2902. .
  2903. . if !\n[doc-display-depth] \{\
  2904. . tm mdoc warning: Extraneous .Ed (#\n[.c])
  2905. . nr doc-display-depth 1
  2906. . \}
  2907. .
  2908. . if "\*[doc-display-type-stack\n[doc-display-depth]]"literal" \{\
  2909. . ft \n[doc-display-ft-stack\n[doc-display-depth]]
  2910. . ps \n[doc-display-ps-stack\n[doc-display-depth]]u
  2911. . \}
  2912. .
  2913. . in -\n[doc-display-indent-stack\n[doc-display-depth]]u
  2914. .
  2915. . \" restore saved adjustment and fill modes
  2916. . ie \n[doc-display-fi-stack\n[doc-display-depth]] \
  2917. . fi
  2918. . el \
  2919. . nf
  2920. . ad \n[doc-display-ad-stack\n[doc-display-depth]]
  2921. .
  2922. . nr doc-display-indent-stack\n[doc-display-depth] 0
  2923. . ds doc-display-type-stack\n[doc-display-depth]
  2924. . nr doc-display-depth -1
  2925. ..
  2926. .
  2927. .
  2928. .\" NS doc-list-type-stackXXX global string
  2929. .\" NS stack of list types
  2930. .\" NS
  2931. .\" NS limit:
  2932. .\" NS doc-list-depth
  2933. .
  2934. .ds doc-list-type-stack1
  2935. .
  2936. .
  2937. .\" NS doc-list-indent-stackXXX global register
  2938. .\" NS stack of list indentation values
  2939. .\" NS
  2940. .\" NS limit:
  2941. .\" NS doc-list-depth
  2942. .
  2943. .nr doc-list-indent-stack1 0
  2944. .
  2945. .
  2946. .\" NS doc-list-have-indent-stackXXX global register (bool)
  2947. .\" NS an indentation value is active
  2948. .\" NS
  2949. .\" NS limit:
  2950. .\" NS doc-list-depth
  2951. .
  2952. .nr doc-list-have-indent-stack1 0
  2953. .
  2954. .
  2955. .\" NS Bl user macro
  2956. .\" NS begin list
  2957. .\" NS
  2958. .\" NS width register `Bl' set in doc-common
  2959. .\" NS
  2960. .\" NS modifies:
  2961. .\" NS doc-arg-ptr
  2962. .\" NS doc-argXXX
  2963. .\" NS doc-list-depth
  2964. .\" NS doc-list-have-indent-stackXXX
  2965. .\" NS doc-list-indent-stackXXX
  2966. .\" NS doc-list-type-stackXXX
  2967. .\" NS doc-macro-name
  2968. .\" NS doc-num-args
  2969. .\" NS doc-num-columns
  2970. .\" NS
  2971. .\" NS local variables:
  2972. .\" NS doc-reg-Bl
  2973. .
  2974. .de Bl
  2975. . if !\n[.$] \{\
  2976. . doc-Bl-usage
  2977. . return
  2978. . \}
  2979. .
  2980. . ds doc-macro-name Bl
  2981. . nr doc-list-depth +1
  2982. . nr doc-arg-ptr 1
  2983. .
  2984. . ie "\$1"-hang" \{\
  2985. . ds doc-list-type-stack\n[doc-list-depth] hang-list
  2986. . nr doc-list-indent-stack\n[doc-list-depth] 6n
  2987. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  2988. . \}
  2989. . el \{ .ie "\$1"-tag" \{\
  2990. . ds doc-list-type-stack\n[doc-list-depth] tag-list
  2991. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  2992. . \}
  2993. . el \{ .ie "\$1"-item" \{\
  2994. . ds doc-list-type-stack\n[doc-list-depth] item-list
  2995. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  2996. . \}
  2997. . el \{ .ie "\$1"-enum" \{\
  2998. . ds doc-list-type-stack\n[doc-list-depth] enum-list
  2999. . nr doc-list-indent-stack\n[doc-list-depth] 3n
  3000. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  3001. . \}
  3002. . el \{ .ie "\$1"-bullet" \{\
  3003. . ds doc-list-type-stack\n[doc-list-depth] bullet-list
  3004. . nr doc-list-indent-stack\n[doc-list-depth] 2n
  3005. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  3006. . \}
  3007. . el \{ .ie "\$1"-dash" \{\
  3008. . ds doc-list-type-stack\n[doc-list-depth] dash-list
  3009. . nr doc-list-indent-stack\n[doc-list-depth] 2n
  3010. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  3011. . \}
  3012. . el \{ .ie "\$1"-hyphen" \{\
  3013. . ds doc-list-type-stack\n[doc-list-depth] dash-list
  3014. . nr doc-list-indent-stack\n[doc-list-depth] 2n
  3015. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  3016. . \}
  3017. . el \{ .ie "\$1"-inset" \{\
  3018. . ds doc-list-type-stack\n[doc-list-depth] inset-list
  3019. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  3020. . \}
  3021. . el \{ .ie "\$1"-diag" \{\
  3022. . ds doc-list-type-stack\n[doc-list-depth] diag-list
  3023. . \}
  3024. . el \{ .ie "\$1"-ohang" \{\
  3025. . ds doc-list-type-stack\n[doc-list-depth] ohang-list
  3026. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  3027. . \}
  3028. . el \{ .ie "\$1"-column" \{\
  3029. . ds doc-list-type-stack\n[doc-list-depth] column-list
  3030. . linetabs 1
  3031. . \}
  3032. . el \{\
  3033. . tm1 "mdoc warning: Unknown list type `\$1' (or missing list type)
  3034. . tm1 " in .Bl macro
  3035. . tm
  3036. . nr doc-arg-ptr 0
  3037. . \}\}\}\}\}\}\}\}\}\}\}
  3038. .
  3039. . \" we have seen a list type
  3040. . if !\n[doc-arg-ptr] \{\
  3041. . doc-Bl-usage
  3042. . doc-reset-args
  3043. . nr doc-list-depth -1
  3044. . return
  3045. . \}
  3046. .
  3047. . shift
  3048. .
  3049. . \" fill argument vector
  3050. . nr doc-reg-Bl 1
  3051. . while (\n[doc-reg-Bl] <= \n[.$]) \{\
  3052. . ds doc-arg\n[doc-reg-Bl] "\$[\n[doc-reg-Bl]]
  3053. . \" dummy type and space so that doc-save-global-vars() doesn't warn
  3054. . nr doc-type\n[doc-reg-Bl] 0
  3055. . ds doc-space\n[doc-reg-Bl]
  3056. . nr doc-reg-Bl +1
  3057. . \}
  3058. .
  3059. . doc-increment-list-stack
  3060. .
  3061. . if \n[.$] \{\
  3062. . nr doc-arg-limit \n[.$]
  3063. . nr doc-arg-ptr 0
  3064. . doc-do-Bl-args
  3065. .
  3066. . in +\n[doc-list-offset-stack\n[doc-list-depth]]u
  3067. .
  3068. . \" initialize column list
  3069. . if "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
  3070. . doc-set-column-tab \n[doc-num-columns]
  3071. ' in -\n[doc-column-indent-width]u
  3072. . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
  3073. . sp \n[doc-display-vertical]u
  3074. .
  3075. . nf
  3076. . nr doc-num-columns 0
  3077. . \}\}
  3078. .
  3079. . doc-reset-args
  3080. ..
  3081. .
  3082. .
  3083. .\" NS doc-Bl-usage macro
  3084. .
  3085. .de doc-Bl-usage
  3086. . tm1 "Usage: .Bl {-hang | -ohang | -tag | -diag | -inset}
  3087. . tm1 " [-width <string>]
  3088. . tm1 " [-offset <string>] [-compact]
  3089. . tm1 " .Bl -column [-offset <string>] <string1> <string2> ...
  3090. . tm1 " .Bl {-item | -enum [-nested] | -bullet | -hyphen | -dash}
  3091. . tm1 " [-offset <string>] [-compact] (#\n[.c])
  3092. ..
  3093. .
  3094. .
  3095. .\" NS doc-do-Bl-args macro
  3096. .\" NS resolve remaining .Bl arguments
  3097. .\" NS
  3098. .\" NS modifies:
  3099. .\" NS doc-arg-ptr
  3100. .\" NS doc-argXXX
  3101. .\" NS doc-compact-list-stackXXX
  3102. .\" NS doc-list-indent-stackXXX
  3103. .\" NS doc-list-offset-stackXXX
  3104. .\" NS doc-num-columns
  3105. .\" NS doc-tag-prefix-stackXXX
  3106. .\" NS doc-tag-width-stackXXX
  3107. .\" NS
  3108. .\" NS local variables:
  3109. .\" NS doc-box-dBla
  3110. .\" NS doc-env-dBla
  3111. .\" NS doc-reg-dBla
  3112. .\" NS doc-reg-dBla1
  3113. .\" NS doc-reg-dBla2
  3114. .\" NS doc-reg-dBla3
  3115. .\" NS doc-reg-dBla4
  3116. .\" NS doc-str-dBla
  3117. .\" NS doc-str-dBla1
  3118. .
  3119. .de doc-do-Bl-args
  3120. . nr doc-arg-ptr +1
  3121. .
  3122. . if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \
  3123. . return
  3124. .
  3125. . \" avoid a warning message in case e.g. `-offset' has no parameter
  3126. . nr doc-reg-dBla (\n[doc-arg-ptr] + 1)
  3127. . if !d doc-arg\n[doc-reg-dBla] \
  3128. . ds doc-arg\n[doc-reg-dBla]
  3129. .
  3130. . nr doc-reg-dBla 1
  3131. .
  3132. . ie "\*[doc-arg\n[doc-arg-ptr]]"-compact" \
  3133. . nr doc-compact-list-stack\n[doc-list-depth] 1
  3134. .
  3135. . el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-nested" \{\
  3136. . ie (\n[doc-list-depth] > 1) \{\
  3137. . nr doc-reg-dBla1 (\n[doc-list-depth] - 1)
  3138. . ds doc-tag-prefix-stack\n[doc-list-depth] "\*[doc-tag-prefix-stack\n[doc-reg-dBla1]]
  3139. . as doc-tag-prefix-stack\n[doc-list-depth] \n[doc-enum-list-count-stack\n[doc-reg-dBla1]].
  3140. . length doc-reg-dBla1 "\*[doc-tag-prefix-stack\n[doc-list-depth]]
  3141. . nr doc-list-indent-stack\n[doc-list-depth] +\n[doc-reg-dBla1]n
  3142. . \}
  3143. . el \
  3144. . tm mdoc warning: `-nested' allowed with nested .Bl macros only (#\n[.c])
  3145. . \}
  3146. .
  3147. . el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-width" \{\
  3148. . nr doc-arg-ptr +1
  3149. . ds doc-tag-width-stack\n[doc-list-depth] TagwidtH
  3150. .
  3151. . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
  3152. . substring doc-str-dBla 0 0
  3153. . ie .\*[doc-str-dBla] \{\
  3154. . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
  3155. . substring doc-str-dBla 1
  3156. . doc-first-parameter \*[doc-str-dBla]
  3157. . doc-get-width "\*[doc-str-dfp]
  3158. . doc-get-arg-type "\*[doc-str-dfp]
  3159. . ie (\n[doc-arg-type] == 1) \
  3160. . nr doc-reg-dBla1 1
  3161. . el \
  3162. . nr doc-reg-dBla1 0
  3163. . \}
  3164. . el \
  3165. . nr doc-reg-dBla1 0
  3166. . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
  3167. .
  3168. . ie \n[doc-reg-dBla1] \{\
  3169. . \" execute string in a box to get the width of the diversion
  3170. . ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
  3171. . doc-save-global-vars
  3172. . doc-reset-args
  3173. . box doc-box-dBla
  3174. . ev doc-env-dBla
  3175. . evc 0
  3176. . in 0
  3177. . nf
  3178. . nop \*[doc-str-dBla]
  3179. . br
  3180. . ev
  3181. . box
  3182. . doc-restore-global-vars
  3183. . doc-get-width \h'\n[dl]u'
  3184. . nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  3185. . \}
  3186. . el \{\
  3187. . \" test whether argument is a valid numeric expression
  3188. . nr doc-reg-dBla1 0
  3189. . if \B(\*[doc-str-dBla]) \{\
  3190. . \" disable warnings related to scaling indicators (32)
  3191. . nr doc-reg-dBla2 \n[.warn]
  3192. . warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
  3193. .
  3194. . \" values without a scaling indicator are taken as strings;
  3195. . \" we test whether the parameter string with and without the last
  3196. . \" character yields identical numerical results (ignoring the
  3197. . \" scaling indicator)
  3198. . ds doc-str-dBla1 "\*[doc-str-dBla]
  3199. . substring doc-str-dBla1 0 -2
  3200. . if \B(\*[doc-str-dBla1]) \{\
  3201. . nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
  3202. . nr doc-reg-dBla4 (\*[doc-str-dBla1])
  3203. . if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
  3204. . nr doc-reg-dBla1 1
  3205. . \}
  3206. .
  3207. . \" enable all warnings again
  3208. . warn \n[doc-reg-dBla2]
  3209. . \}
  3210. .
  3211. . ie \n[doc-reg-dBla1] \
  3212. . nr doc-list-indent-stack\n[doc-list-depth] (\*[doc-str-dBla])
  3213. . el \{\
  3214. . doc-get-arg-width \n[doc-arg-ptr]
  3215. . ie (\n[doc-width] == 2) \{\
  3216. . \" if the width parameter is a macro, use the macro's
  3217. . \" width as specified in doc-common
  3218. . doc-get-arg-type \*[doc-str-dBla]
  3219. . ie (\n[doc-arg-type] == 1) \
  3220. . nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
  3221. . el \
  3222. . nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  3223. . \}
  3224. . el \
  3225. . nr doc-list-indent-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  3226. . \}\}\}
  3227. .
  3228. . el \{ .ie "\*[doc-arg\n[doc-arg-ptr]]"-offset" \{\
  3229. . nr doc-arg-ptr +1
  3230. .
  3231. . ie "\*[doc-arg\n[doc-arg-ptr]]"indent" \
  3232. . nr doc-list-offset-stack\n[doc-list-depth] \n[doc-display-indent]u
  3233. . el \{\
  3234. . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
  3235. . nr doc-reg-dBla1 0
  3236. . if \B(\*[doc-str-dBla]) \{\
  3237. . nr doc-reg-dBla2 \n[.warn]
  3238. . warn (\n[.warn] - (\n[.warn] / 32 % 2 * 32))
  3239. .
  3240. . ds doc-str-dBla1 "\*[doc-str-dBla]
  3241. . substring doc-str-dBla1 0 -2
  3242. . if \B(\*[doc-str-dBla1]) \{\
  3243. . nr doc-reg-dBla3 (;(\*[doc-str-dBla]))
  3244. . nr doc-reg-dBla4 (\*[doc-str-dBla1])
  3245. . if (\n[doc-reg-dBla3] == \n[doc-reg-dBla4]) \
  3246. . nr doc-reg-dBla1 1
  3247. . \}
  3248. .
  3249. . warn \n[doc-reg-dBla2]
  3250. . \}
  3251. .
  3252. . ie \n[doc-reg-dBla1] \
  3253. . nr doc-list-offset-stack\n[doc-list-depth] \*[doc-str-dBla]
  3254. . el \{\
  3255. . doc-get-arg-width \n[doc-arg-ptr]
  3256. . ie (\n[doc-width] <= 3) \{\
  3257. . \" if the offset parameter is a macro, use the macro's
  3258. . \" width as specified in doc-common
  3259. . doc-get-arg-type \*[doc-str-dBla]
  3260. . ie (\n[doc-arg-type] == 1) \
  3261. . nr doc-list-offset-stack\n[doc-list-depth] \n[\*[doc-str-dBla]]
  3262. . el \
  3263. . nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  3264. . \}
  3265. . el \
  3266. . nr doc-list-offset-stack\n[doc-list-depth] (\n[doc-width]u * \n[doc-fixed-width]u)
  3267. . \}\}\}
  3268. . el \
  3269. . nr doc-reg-dBla 0
  3270. . \}\}\}
  3271. .
  3272. . \" not a known keyword, so it specifies the width of the next column
  3273. . \" (if it is a column list)
  3274. . if !\n[doc-reg-dBla] \{\
  3275. . ie "\*[doc-list-type-stack\n[doc-list-depth]]"column-list" \{\
  3276. . nr doc-num-columns +1
  3277. . ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
  3278. . substring doc-str-dBla 0 0
  3279. . ie .\*[doc-str-dBla] \{\
  3280. . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
  3281. . substring doc-str-dBla 1
  3282. . doc-first-parameter \*[doc-str-dBla]
  3283. . doc-get-width "\*[doc-str-dfp]
  3284. . doc-get-arg-type "\*[doc-str-dfp]
  3285. . ie (\n[doc-arg-type] == 1) \
  3286. . nr doc-reg-dBla1 1
  3287. . el \
  3288. . nr doc-reg-dBla1 0
  3289. . \}
  3290. . el \
  3291. . nr doc-reg-dBla1 0
  3292. . ds doc-str-dBla "\*[doc-arg\n[doc-arg-ptr]]
  3293. .
  3294. . ie \n[doc-reg-dBla1] \{\
  3295. . \" execute string in a box to get the width of the diversion
  3296. . ds doc-str-dBla \*[doc-arg\n[doc-arg-ptr]]
  3297. . doc-save-global-vars
  3298. . doc-reset-args
  3299. . box doc-box-dBla
  3300. . ev doc-env-dBla
  3301. . evc 0
  3302. . in 0
  3303. . nf
  3304. . nop \*[doc-str-dBla]
  3305. . br
  3306. . ev
  3307. . box
  3308. . doc-restore-global-vars
  3309. . ds doc-arg\n[doc-num-columns] "\h'\n[dl]u'
  3310. . \}
  3311. . el \
  3312. . ds doc-arg\n[doc-num-columns] "\*[doc-arg\n[doc-arg-ptr]]
  3313. . \}
  3314. . el \{\
  3315. . tmc mdoc warning: Unknown keyword `\*[doc-arg\n[doc-arg-ptr]]'
  3316. . tm1 " in .Bl macro (#\n[.c])
  3317. . \}\}
  3318. .
  3319. . if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \
  3320. . doc-do-Bl-args
  3321. ..
  3322. .
  3323. .
  3324. .\" NS doc-save-global-vars macro
  3325. .\" NS save all global variables
  3326. .\" NS
  3327. .\" NS local variables:
  3328. .\" NS doc-reg-dsgv
  3329. .
  3330. .de doc-save-global-vars
  3331. . ds doc-macro-name-saved "\*[doc-macro-name]
  3332. . nr doc-arg-limit-saved \n[doc-arg-limit]
  3333. . nr doc-num-args-saved \n[doc-num-args]
  3334. . nr doc-arg-ptr-saved \n[doc-arg-ptr]
  3335. .
  3336. . nr doc-reg-dsgv 1
  3337. . while (\n[doc-reg-dsgv] <= \n[doc-arg-limit]) \{\
  3338. . ds doc-arg\n[doc-reg-dsgv]-saved "\*[doc-arg\n[doc-reg-dsgv]]
  3339. . nr doc-type\n[doc-reg-dsgv]-saved \n[doc-type\n[doc-reg-dsgv]]
  3340. . ds doc-space\n[doc-reg-dsgv]-saved "\*[doc-space\n[doc-reg-dsgv]]
  3341. . nr doc-reg-dsgv +1
  3342. . \}
  3343. .
  3344. . nr doc-curr-font-saved \n[doc-curr-font]
  3345. . nr doc-curr-size-saved \n[doc-curr-size]
  3346. . nr doc-in-synopsis-section-saved \n[doc-in-synopsis-section]
  3347. . nr doc-in-library-section-saved \n[doc-in-library-section]
  3348. . nr doc-indent-synopsis-saved \n[doc-indent-synopsis]
  3349. . nr doc-indent-synopsis-active-saved \n[doc-indent-synopsis-active]
  3350. . nr doc-have-decl-saved \n[doc-have-decl]
  3351. . nr doc-have-var-saved \n[doc-have-var]
  3352. . ds doc-command-name-saved "\*[doc-command-name]
  3353. . ds doc-quote-left-saved "\*[doc-quote-left]
  3354. . ds doc-quote-right-saved "\*[doc-quote-right]
  3355. . nr doc-nesting-level-saved \n[doc-nesting-level]
  3356. . nr doc-in-list-saved \n[doc-in-list]
  3357. . ds doc-space-saved "\*[doc-space]
  3358. . ds doc-saved-space-saved "\*[doc-saved-space]
  3359. . nr doc-space-mode-saved \n[doc-space-mode]
  3360. . nr doc-have-space-saved \n[doc-have-space]
  3361. . nr doc-have-slot-saved \n[doc-have-slot]
  3362. . nr doc-keep-type-saved \n[doc-keep-type]
  3363. . nr doc-display-depth-saved \n[doc-display-depth]
  3364. . nr doc-is-compact-saved \n[doc-is-compact]
  3365. .
  3366. . nr doc-reg-dsgv 0
  3367. . while (\n[doc-reg-dsgv] <= \n[doc-display-depth]) \{\
  3368. . ds doc-display-type-stack\n[doc-reg-dsgv]-saved "\*[doc-display-type-stack\n[doc-reg-dsgv]]
  3369. . nr doc-display-indent-stack\n[doc-reg-dsgv]-saved \n[doc-display-indent-stack\n[doc-reg-dsgv]]
  3370. . nr doc-display-ad-stack\n[doc-reg-dsgv]-saved \n[doc-display-ad-stack\n[doc-reg-dsgv]]
  3371. . nr doc-display-fi-stack\n[doc-reg-dsgv]-saved \n[doc-display-fi-stack\n[doc-reg-dsgv]]
  3372. . nr doc-display-ft-stack\n[doc-reg-dsgv]-saved \n[doc-display-ft-stack\n[doc-reg-dsgv]]
  3373. . nr doc-display-ps-stack\n[doc-reg-dsgv]-saved \n[doc-display-ps-stack\n[doc-reg-dsgv]]
  3374. . nr doc-reg-dsgv +1
  3375. . \}
  3376. .
  3377. . nr doc-fontmode-depth-saved \n[doc-fontmode-depth]
  3378. .
  3379. . nr doc-reg-dsgv 1
  3380. . while (\n[doc-reg-dsgv] <= \n[doc-fontmode-depth]) \{\
  3381. . nr doc-fontmode-font-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-font-stack\n[doc-reg-dsgv]]
  3382. . nr doc-fontmode-size-stack\n[doc-reg-dsgv]-saved \n[doc-fontmode-size-stack\n[doc-reg-dsgv]]
  3383. . nr doc-reg-dsgv +1
  3384. . \}
  3385. .
  3386. . nr doc-list-depth-saved \n[doc-list-depth]
  3387. .
  3388. . nr doc-reg-dsgv 1
  3389. . while (\n[doc-reg-dsgv] <= \n[doc-list-depth]) \{\
  3390. . ds doc-list-type-stack\n[doc-reg-dsgv]-saved "\*[doc-list-type-stack\n[doc-reg-dsgv]]
  3391. . nr doc-list-have-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-have-indent-stack\n[doc-reg-dsgv]]
  3392. . nr doc-list-indent-stack\n[doc-reg-dsgv]-saved \n[doc-list-indent-stack\n[doc-reg-dsgv]]
  3393. . nr doc-compact-list-stack\n[doc-reg-dsgv]-saved \n[doc-compact-list-stack\n[doc-reg-dsgv]]
  3394. . ds doc-tag-prefix-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-prefix-stack\n[doc-reg-dsgv]]
  3395. . ds doc-tag-width-stack\n[doc-reg-dsgv]-saved "\*[doc-tag-width-stack\n[doc-reg-dsgv]]
  3396. . nr doc-list-offset-stack\n[doc-reg-dsgv]-saved \n[doc-list-offset-stack\n[doc-reg-dsgv]]
  3397. . nr doc-enum-list-count-stack\n[doc-reg-dsgv]-saved \n[doc-enum-list-count-stack\n[doc-reg-dsgv]]
  3398. . nr doc-reg-dsgv +1
  3399. . \}
  3400. .
  3401. . ds doc-saved-Pa-font-saved "\*[doc-saved-Pa-font]
  3402. . nr doc-curr-type-saved \n[doc-curr-type]
  3403. . ds doc-curr-arg-saved "\*[doc-curr-arg]
  3404. . nr doc-diag-list-input-line-count-saved \n[doc-diag-list-input-line-count]
  3405. . nr doc-num-columns-saved \n[doc-num-columns]
  3406. . nr doc-column-indent-width-saved \n[doc-column-indent-width]
  3407. . nr doc-is-func-saved \n[doc-is-func]
  3408. . nr doc-have-old-func-saved \n[doc-have-old-func]
  3409. . nr doc-func-arg-count-saved \n[doc-func-arg-count]
  3410. . ds doc-func-arg-saved "\*[doc-func-arg]
  3411. . nr doc-num-func-args-saved \n[doc-num-func-args]
  3412. . nr doc-func-args-processed-saved \n[doc-func-args-processed]
  3413. . nr doc-have-func-saved \n[doc-have-func]
  3414. . nr doc-is-reference-saved \n[doc-is-reference]
  3415. . nr doc-reference-count-saved \n[doc-reference-count]
  3416. . nr doc-author-count-saved \n[doc-author-count]
  3417. .
  3418. . nr doc-reg-dsgv 0
  3419. . while (\n[doc-reg-dsgv] <= \n[doc-author-count]) \{\
  3420. . ds doc-author-name\n[doc-reg-dsgv]-saved "\*[doc-author-name\n[doc-reg-dsgv]]
  3421. . nr doc-reg-dsgv +1
  3422. . \}
  3423. .
  3424. . nr doc-book-count-saved \n[doc-book-count]
  3425. . ds doc-book-name-saved "\*[doc-book-name]
  3426. . nr doc-date-count-saved \n[doc-date-count]
  3427. . ds doc-date-saved "\*[doc-date]
  3428. . nr doc-publisher-count-saved \n[doc-publisher-count]
  3429. . ds doc-publisher-name-saved "\*[doc-publisher-name]
  3430. . nr doc-journal-count-saved \n[doc-journal-count]
  3431. . ds doc-journal-name-saved "\*[doc-journal-name]
  3432. . nr doc-issue-count-saved \n[doc-issue-count]
  3433. . ds doc-issue-name-saved "\*[doc-issue-name]
  3434. . nr doc-optional-count-saved \n[doc-optional-count]
  3435. . ds doc-optional-string-saved "\*[doc-optional-string]
  3436. . nr doc-page-number-count-saved \n[doc-page-number-count]
  3437. . ds doc-page-number-string-saved "\*[doc-page-number-string]
  3438. . nr doc-corporate-count-saved \n[doc-corporate-count]
  3439. . ds doc-corporate-name-saved "\*[doc-corporate-name]
  3440. . nr doc-report-count-saved \n[doc-report-count]
  3441. . ds doc-report-name-saved "\*[doc-report-name]
  3442. . nr doc-reference-title-count-saved \n[doc-reference-title-count]
  3443. . ds doc-reference-title-name-saved "\*[doc-reference-title-name]
  3444. . ds doc-reference-title-name-for-book-saved "\*[doc-reference-title-name-for-book]
  3445. . nr doc-url-count-saved \n[doc-url-count]
  3446. . ds doc-url-name-saved "\*[doc-url-name]
  3447. . nr doc-volume-count-saved \n[doc-volume-count]
  3448. . ds doc-volume-name-saved "\*[doc-volume-name]
  3449. . nr doc-have-author-saved \n[doc-have-author]
  3450. .
  3451. . ds doc-document-title-saved "\*[doc-document-title]
  3452. . ds doc-volume-saved "\*[doc-volume]
  3453. . ds doc-section-saved "\*[doc-section]
  3454. . ds doc-operating-system-saved "\*[doc-operating-system]
  3455. . ds doc-date-string-saved "\*[doc-date-string]
  3456. . nr doc-header-space-saved \n[doc-header-space]
  3457. . nr doc-footer-space-saved \n[doc-footer-space]
  3458. . nr doc-display-vertical-saved \n[doc-display-vertical]
  3459. . ds doc-header-string-saved "\*[doc-header-string]
  3460. . nr doc-in-see-also-section-saved \n[doc-in-see-also-section]
  3461. . nr doc-in-files-section-saved \n[doc-in-files-section]
  3462. . nr doc-in-authors-section-saved \n[doc-in-authors-section]
  3463. ..
  3464. .
  3465. .
  3466. .\" NS doc-restore-global-vars macro
  3467. .\" NS restore all global variables
  3468. .\" NS
  3469. .\" NS local variables:
  3470. .\" NS doc-reg-drgv
  3471. .
  3472. .de doc-restore-global-vars
  3473. . ds doc-macro-name "\*[doc-macro-name-saved]
  3474. . nr doc-arg-limit \n[doc-arg-limit-saved]
  3475. . nr doc-num-args \n[doc-num-args-saved]
  3476. . nr doc-arg-ptr \n[doc-arg-ptr-saved]
  3477. .
  3478. . nr doc-reg-drgv 1
  3479. . while (\n[doc-reg-drgv] <= \n[doc-arg-limit]) \{\
  3480. . ds doc-arg\n[doc-reg-drgv] "\*[doc-arg\n[doc-reg-drgv]-saved]
  3481. . nr doc-type\n[doc-reg-drgv] \n[doc-type\n[doc-reg-drgv]-saved]
  3482. . ds doc-space\n[doc-reg-drgv] "\*[doc-space\n[doc-reg-drgv]-saved]
  3483. . nr doc-reg-drgv +1
  3484. . \}
  3485. .
  3486. . nr doc-curr-font \n[doc-curr-font-saved]
  3487. . nr doc-curr-size \n[doc-curr-size-saved]
  3488. . nr doc-in-synopsis-section \n[doc-in-synopsis-section-saved]
  3489. . nr doc-in-library-section \n[doc-in-library-section-saved]
  3490. . nr doc-indent-synopsis \n[doc-indent-synopsis-saved]
  3491. . nr doc-indent-synopsis-active \n[doc-indent-synopsis-active-saved]
  3492. . nr doc-have-decl \n[doc-have-decl-saved]
  3493. . nr doc-have-var \n[doc-have-var-saved]
  3494. . ds doc-command-name "\*[doc-command-name-saved]
  3495. . ds doc-quote-left "\*[doc-quote-left-saved]
  3496. . ds doc-quote-right "\*[doc-quote-right-saved]
  3497. . nr doc-nesting-level \n[doc-nesting-level-saved]
  3498. . nr doc-in-list \n[doc-in-list-saved]
  3499. . ds doc-space "\*[doc-space-saved]
  3500. . ds doc-saved-space "\*[doc-saved-space-saved]
  3501. . nr doc-space-mode \n[doc-space-mode-saved]
  3502. . nr doc-have-space \n[doc-have-space-saved]
  3503. . nr doc-have-slot \n[doc-have-slot-saved]
  3504. . nr doc-keep-type \n[doc-keep-type-saved]
  3505. . nr doc-display-depth \n[doc-display-depth-saved]
  3506. . nr doc-is-compact \n[doc-is-compact-saved]
  3507. .
  3508. . nr doc-reg-drgv 0
  3509. . while (\n[doc-reg-drgv] <= \n[doc-display-depth]) \{\
  3510. . ds doc-display-type-stack\n[doc-reg-drgv] "\*[doc-display-type-stack\n[doc-reg-drgv]-saved]
  3511. . nr doc-display-indent-stack\n[doc-reg-drgv] \n[doc-display-indent-stack\n[doc-reg-drgv]-saved]
  3512. . nr doc-display-ad-stack\n[doc-reg-drgv] \n[doc-display-ad-stack\n[doc-reg-drgv]-saved]
  3513. . nr doc-display-fi-stack\n[doc-reg-drgv] \n[doc-display-fi-stack\n[doc-reg-drgv]-saved]
  3514. . nr doc-display-ft-stack\n[doc-reg-drgv] \n[doc-display-ft-stack\n[doc-reg-drgv]-saved]
  3515. . nr doc-display-ps-stack\n[doc-reg-drgv] \n[doc-display-ps-stack\n[doc-reg-drgv]-saved]
  3516. . nr doc-reg-drgv +1
  3517. . \}
  3518. .
  3519. . nr doc-fontmode-depth \n[doc-fontmode-depth-saved]
  3520. .
  3521. . nr doc-reg-drgv 1
  3522. . while (\n[doc-reg-drgv] <= \n[doc-fontmode-depth]) \{\
  3523. . nr doc-fontmode-font-stack\n[doc-reg-drgv] \n[doc-fontmode-font-stack\n[doc-reg-drgv]]-saved
  3524. . nr doc-fontmode-size-stack\n[doc-reg-drgv] \n[doc-fontmode-size-stack\n[doc-reg-drgv]]-saved
  3525. . nr doc-reg-drgv +1
  3526. . \}
  3527. .
  3528. . nr doc-list-depth \n[doc-list-depth-saved]
  3529. .
  3530. . nr doc-reg-drgv 1
  3531. . while (\n[doc-reg-drgv] <= \n[doc-list-depth]) \{\
  3532. . ds doc-list-type-stack\n[doc-reg-drgv] "\*[doc-list-type-stack\n[doc-reg-drgv]-saved]
  3533. . nr doc-list-have-indent-stack\n[doc-reg-drgv] \n[doc-list-have-indent-stack\n[doc-reg-drgv]-saved]
  3534. . nr doc-list-indent-stack\n[doc-reg-drgv] \n[doc-list-indent-stack\n[doc-reg-drgv]-saved]
  3535. . nr doc-compact-list-stack\n[doc-reg-drgv] \n[doc-compact-list-stack\n[doc-reg-drgv]-saved]
  3536. . ds doc-tag-prefix-stack\n[doc-reg-drgv] "\*[doc-tag-prefix-stack\n[doc-reg-drgv]-saved]
  3537. . ds doc-tag-width-stack\n[doc-reg-drgv] "\*[doc-tag-width-stack\n[doc-reg-drgv]-saved]
  3538. . nr doc-list-offset-stack\n[doc-reg-drgv] \n[doc-list-offset-stack\n[doc-reg-drgv]-saved]
  3539. . nr doc-enum-list-count-stack\n[doc-reg-drgv] \n[doc-enum-list-count-stack\n[doc-reg-drgv]-saved]
  3540. . nr doc-reg-drgv +1
  3541. . \}
  3542. .
  3543. . ds doc-saved-Pa-font "\*[doc-saved-Pa-font-saved]
  3544. . nr doc-curr-type \n[doc-curr-type-saved]
  3545. . ds doc-curr-arg "\*[doc-curr-arg-saved]
  3546. . nr doc-diag-list-input-line-count \n[doc-diag-list-input-line-count-saved]
  3547. . nr doc-num-columns \n[doc-num-columns-saved]
  3548. . nr doc-column-indent-width \n[doc-column-indent-width-saved]
  3549. . nr doc-is-func \n[doc-is-func-saved]
  3550. . nr doc-have-old-func \n[doc-have-old-func-saved]
  3551. . nr doc-func-arg-count \n[doc-func-arg-count-saved]
  3552. . ds doc-func-arg "\*[doc-func-arg-saved]
  3553. . nr doc-num-func-args \n[doc-num-func-args-saved]
  3554. . nr doc-func-args-processed \n[doc-func-args-processed-saved]
  3555. . nr doc-have-func \n[doc-have-func-saved]
  3556. . nr doc-is-reference \n[doc-is-reference-saved]
  3557. . nr doc-reference-count \n[doc-reference-count-saved]
  3558. . nr doc-author-count \n[doc-author-count-saved]
  3559. .
  3560. . nr doc-reg-drgv 0
  3561. . while (\n[doc-reg-drgv] <= \n[doc-author-count]) \{\
  3562. . ds doc-author-name\n[doc-reg-drgv] "\*[doc-author-name\n[doc-reg-drgv]-saved]
  3563. . nr doc-reg-drgv +1
  3564. . \}
  3565. .
  3566. . nr doc-book-count \n[doc-book-count-saved]
  3567. . ds doc-book-name "\*[doc-book-name-saved]
  3568. . nr doc-date-count \n[doc-date-count-saved]
  3569. . ds doc-date "\*[doc-date-saved]
  3570. . nr doc-publisher-count \n[doc-publisher-count-saved]
  3571. . ds doc-publisher-name "\*[doc-publisher-name-saved]
  3572. . nr doc-journal-count \n[doc-journal-count-saved]
  3573. . ds doc-journal-name "\*[doc-journal-name-saved]
  3574. . nr doc-issue-count \n[doc-issue-count-saved]
  3575. . ds doc-issue-name "\*[doc-issue-name-saved]
  3576. . nr doc-optional-count \n[doc-optional-count-saved]
  3577. . ds doc-optional-string "\*[doc-optional-string-saved]
  3578. . nr doc-page-number-count \n[doc-page-number-count-saved]
  3579. . ds doc-page-number-string "\*[doc-page-number-string-saved]
  3580. . nr doc-corporate-count \n[doc-corporate-count-saved]
  3581. . ds doc-corporate-name "\*[doc-corporate-name-saved]
  3582. . nr doc-report-count \n[doc-report-count-saved]
  3583. . ds doc-report-name "\*[doc-report-name-saved]
  3584. . nr doc-reference-title-count \n[doc-reference-title-count-saved]
  3585. . ds doc-reference-title-name "\*[doc-reference-title-name-saved]
  3586. . ds doc-reference-title-name-for-book "\*[doc-reference-title-name-for-book-saved]
  3587. . nr doc-url-count \n[doc-url-count-saved]
  3588. . ds doc-url-name "\*[doc-url-name-saved]
  3589. . nr doc-volume-count \n[doc-volume-count-saved]
  3590. . ds doc-volume-name "\*[doc-volume-name-saved]
  3591. . nr doc-have-author \n[doc-have-author-saved]
  3592. .
  3593. . ds doc-document-title "\*[doc-document-title-saved]
  3594. . ds doc-volume "\*[doc-volume-saved]
  3595. . ds doc-section "\*[doc-section-saved]
  3596. . ds doc-operating-system "\*[doc-operating-system-saved]
  3597. . ds doc-date-string "\*[doc-date-string-saved]
  3598. . nr doc-header-space \n[doc-header-space-saved]
  3599. . nr doc-footer-space \n[doc-footer-space-saved]
  3600. . nr doc-display-vertical \n[doc-display-vertical-saved]
  3601. . ds doc-header-string "\*[doc-header-string-saved]
  3602. . nr doc-in-see-also-section \n[doc-in-see-also-section-saved]
  3603. . nr doc-in-files-section \n[doc-in-files-section-saved]
  3604. . nr doc-in-authors-section \n[doc-in-authors-section-saved]
  3605. ..
  3606. .
  3607. .
  3608. .\" NS El user macro
  3609. .\" NS end list
  3610. .\" NS
  3611. .\" NS modifies:
  3612. .\" NS doc-list-depth
  3613. .\" NS doc-macro-name
  3614. .\" NS
  3615. .\" NS local variables:
  3616. .\" NS doc-str-El
  3617. .\" NS
  3618. .\" NS width register `El' set in doc-common
  3619. .
  3620. .de El
  3621. . if \n[.$] \{\
  3622. . tm Usage: .El (does not take arguments) (#\n[.c])
  3623. . return
  3624. . \}
  3625. .
  3626. . ds doc-macro-name El
  3627. . ds doc-str-El \*[doc-list-type-stack\n[doc-list-depth]]
  3628. .
  3629. . ie "\*[doc-str-El]"diag-list" \
  3630. . doc-end-list 0
  3631. . el \{ .ie "\*[doc-str-El]"column-list" \
  3632. . doc-end-column-list
  3633. . el \{ .ie "\*[doc-str-El]"item-list" \
  3634. . doc-end-list 0
  3635. . el \{ .ie "\*[doc-str-El]"ohang-list" \
  3636. . doc-end-list 0
  3637. . el \{ .ie "\*[doc-str-El]"inset-list" \
  3638. . doc-end-list 0
  3639. . el \
  3640. . doc-end-list 1
  3641. . \}\}\}\}
  3642. .
  3643. . br
  3644. ..
  3645. .
  3646. .
  3647. .\" NS doc-saved-Pa-font global string
  3648. .\" NS saved doc-Pa-font string for section FILES (no underline if
  3649. .\" NS nroff)
  3650. .
  3651. .ds doc-saved-Pa-font
  3652. .
  3653. .
  3654. .\" NS doc-curr-type global register
  3655. .\" NS current argument type
  3656. .
  3657. .nr doc-curr-type 0
  3658. .
  3659. .
  3660. .\" NS doc-curr-arg global string
  3661. .\" NS current argument
  3662. .
  3663. .ds doc-curr-arg
  3664. .
  3665. .
  3666. .\" NS doc-item-boxXXX global box
  3667. .\" NS item boxes associated list depth
  3668. .\" NS
  3669. .\" NS limit:
  3670. .\" NS doc-list-depth
  3671. .
  3672. .
  3673. .\" NS It user macro
  3674. .\" NS list item
  3675. .\" NS
  3676. .\" NS modifies:
  3677. .\" NS doc-arg-ptr
  3678. .\" NS doc-argXXX
  3679. .\" NS doc-curr-arg
  3680. .\" NS doc-curr-type
  3681. .\" NS doc-in-list
  3682. .\" NS doc-macro-name
  3683. .\" NS doc-num-args
  3684. .\" NS doc-saved-Pa-font
  3685. .\" NS
  3686. .\" NS local variables:
  3687. .\" NS doc-reg-It
  3688. .\" NS doc-str-It
  3689. .\" NS doc-XXX-list-type
  3690. .\" NS
  3691. .\" NS width register `It' set in doc-common
  3692. .
  3693. .nr doc-bullet-list-type 1
  3694. .nr doc-column-list-type 0
  3695. .nr doc-dash-list-type 1
  3696. .nr doc-diag-list-type 0
  3697. .nr doc-enum-list-type 1
  3698. .nr doc-hang-list-type 2
  3699. .nr doc-inset-list-type 2
  3700. .nr doc-item-list-type 1
  3701. .nr doc-ohang-list-type 2
  3702. .nr doc-tag-list-type 2
  3703. .
  3704. .de It
  3705. . ds doc-str-It \*[doc-list-type-stack\n[doc-list-depth]]
  3706. .
  3707. . if "\*[doc-str-It]"" \
  3708. . tm mdoc error: .It without preceding .Bl (#\n[.c])
  3709. .
  3710. . if \n[doc-nesting-level] \{\
  3711. . tmc "mdoc error: .It found in enclosing (e.g. .Ac ... .It ... .Ao)
  3712. . tm1 " (#\n[.c])
  3713. . \}
  3714. .
  3715. . br
  3716. . if !\n[cR] \
  3717. . ne 3v
  3718. .
  3719. . if \n[.$] \{\
  3720. . ds doc-macro-name It
  3721. .
  3722. . \" fill argument vector
  3723. . nr doc-reg-It 1
  3724. . while (\n[doc-reg-It] <= \n[.$]) \{\
  3725. . ds doc-arg\n[doc-reg-It] "\$[\n[doc-reg-It]]
  3726. . nr doc-reg-It +1
  3727. . \}
  3728. .
  3729. . nr doc-num-args \n[.$]
  3730. . nr doc-arg-ptr 0
  3731. . \}
  3732. .
  3733. . nr doc-reg-It \n[doc-\*[doc-str-It]-type]
  3734. .
  3735. . if \n[doc-reg-It] \{\
  3736. . \" start item box
  3737. . box doc-item-box\n[doc-list-depth]
  3738. . ev doc-item-env\n[doc-list-depth]
  3739. . evc 0
  3740. . in 0
  3741. . nf
  3742. . \}
  3743. .
  3744. . ie (\n[doc-reg-It] == 1) \{\
  3745. . if \n[.$] \{\
  3746. . tm1 "mdoc warning: .It macros in lists of type `\*[doc-str-It]'
  3747. . tm1 " don't take arguments (#\n[.c])
  3748. . \}\}
  3749. . el \{\
  3750. . ie \n[.$] \{\
  3751. . if (\n[doc-reg-It] == 2) \{\
  3752. . \" handle list types with arguments
  3753. . doc-parse-arg-vector
  3754. .
  3755. . nr doc-in-list 1
  3756. . nr doc-arg-ptr 1
  3757. . nr doc-curr-type \n[doc-type1]
  3758. . ds doc-curr-arg "\*[doc-arg1]
  3759. .
  3760. . if \n[doc-in-files-section] \{\
  3761. . ds doc-saved-Pa-font "\*[doc-Pa-font]
  3762. . if n \
  3763. . ds doc-Pa-font "\*[doc-No-font]
  3764. . \}
  3765. .
  3766. . ie (\n[doc-type1] == 1) \
  3767. . \*[doc-arg1]
  3768. . el \{\
  3769. . nr doc-arg-ptr 1
  3770. . doc-print-recursive
  3771. . \}\}\}
  3772. . el \{\
  3773. . tm1 "mdoc warning: .It macros in lists of type `\*[doc-str-It]'
  3774. . tm1 " require arguments (#\n[.c])
  3775. . \}
  3776. . \}
  3777. .
  3778. . \" the previous call of `.doc-print-recursive' can contain calls to
  3779. . \" opening macros like `.Ao'; we then defer the call of `doc-xxx-list'
  3780. . if !\n[doc-nesting-level] \
  3781. . doc-\*[doc-str-It]
  3782. ..
  3783. .
  3784. .
  3785. .\" NS doc-inset-list macro
  3786. .\" NS .It item of list-type inset
  3787. .\" NS
  3788. .\" NS modifies:
  3789. .\" NS doc-in-list
  3790. .
  3791. .de doc-inset-list
  3792. . \" finish item box
  3793. . br
  3794. . ev
  3795. . box
  3796. . unformat doc-item-box\n[doc-list-depth]
  3797. .
  3798. . doc-set-vertical-and-indent 0
  3799. . br
  3800. .
  3801. . nh
  3802. . doc-item-box\n[doc-list-depth]
  3803. .
  3804. . if \n[doc-in-files-section] \
  3805. . if n \
  3806. . ds doc-Pa-font "\*[doc-saved-Pa-font]
  3807. .
  3808. . nr doc-in-list 0
  3809. . doc-reset-args
  3810. ..
  3811. .
  3812. .
  3813. .\" NS doc-hang-list macro
  3814. .\" NS .It item of list-type hanging tag (as opposed to tagged)
  3815. .\" NS
  3816. .\" NS modifies:
  3817. .\" NS doc-have-space
  3818. .\" NS doc-in-list
  3819. .\" NS
  3820. .\" NS local variables:
  3821. .\" NS doc-reg-dhl
  3822. .\" NS doc-reg-dhl1
  3823. .
  3824. .de doc-hang-list
  3825. . \" finish item box
  3826. . br
  3827. . ev
  3828. . box
  3829. . unformat doc-item-box\n[doc-list-depth]
  3830. .
  3831. . doc-set-vertical-and-indent 1
  3832. . nr doc-reg-dhl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
  3833. . ti -\n[doc-reg-dhl]u
  3834. .
  3835. . nh
  3836. . ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \
  3837. . doc-item-box\n[doc-list-depth]
  3838. . el \{\
  3839. . chop doc-item-box\n[doc-list-depth]
  3840. . nr doc-reg-dhl1 \n[.k]u
  3841. . nop \*[doc-item-box\n[doc-list-depth]]\c
  3842. . nop \h'|(\n[doc-reg-dhl1]u - \n[.k]u + \n[doc-reg-dhl]u)'\c
  3843. . nr doc-have-space 1
  3844. . \}
  3845. .
  3846. . if \n[doc-in-files-section] \
  3847. . if n \
  3848. . ds doc-Pa-font "\*[doc-saved-Pa-font]
  3849. .
  3850. . nr doc-in-list 0
  3851. . doc-reset-args
  3852. ..
  3853. .
  3854. .
  3855. .\" NS doc-ohang-list macro
  3856. .\" NS .It item of list-type overhanging tag
  3857. .\" NS
  3858. .\" NS modifies:
  3859. .\" NS doc-in-list
  3860. .
  3861. .de doc-ohang-list
  3862. . \" finish item box
  3863. . br
  3864. . ev
  3865. . box
  3866. . unformat doc-item-box\n[doc-list-depth]
  3867. .
  3868. . doc-set-vertical-and-indent 0
  3869. . nh
  3870. . doc-item-box\n[doc-list-depth]
  3871. . br
  3872. .
  3873. . if \n[doc-in-files-section] \
  3874. . if n \
  3875. . ds doc-Pa-font "\*[doc-saved-Pa-font]
  3876. .
  3877. . nr doc-in-list 0
  3878. . doc-reset-args
  3879. ..
  3880. .
  3881. .
  3882. .\" NS doc-item-list macro
  3883. .\" NS .It item of list-type [empty tag]
  3884. .
  3885. .de doc-item-list
  3886. . \" finish (dummy) item box
  3887. . br
  3888. . ev
  3889. . box
  3890. .
  3891. . doc-set-vertical-and-indent 0
  3892. . br
  3893. .
  3894. . doc-reset-args
  3895. ..
  3896. .
  3897. .
  3898. .\" NS doc-enum-list-count-stackXXX global register
  3899. .\" NS stack of current enum count values
  3900. .\" NS
  3901. .\" NS limit:
  3902. .\" NS doc-list-depth
  3903. .
  3904. .nr doc-enum-list-count-stack1 0
  3905. .
  3906. .
  3907. .\" NS doc-enum-list macro
  3908. .\" NS enumerated list
  3909. .\" NS
  3910. .\" NS modifies:
  3911. .\" NS doc-enum-list-count-stackXXX
  3912. .\" NS doc-in-list
  3913. .
  3914. .de doc-enum-list
  3915. . nr doc-in-list 1
  3916. . nr doc-enum-list-count-stack\n[doc-list-depth] +1
  3917. \# XXX
  3918. \#.ll \n[doc-list-indent-stack\n[doc-list-depth]]u
  3919. \#.rj
  3920. . nop \*[doc-tag-prefix-stack\n[doc-list-depth]]\c
  3921. . nop \n[doc-enum-list-count-stack\n[doc-list-depth]].\&
  3922. . doc-do-list
  3923. ..
  3924. .
  3925. .
  3926. .\" NS doc-bullet-list macro
  3927. .\" NS bullet paragraph list
  3928. .\" NS
  3929. .\" NS modifies:
  3930. .\" NS doc-in-list
  3931. .
  3932. .de doc-bullet-list
  3933. . nr doc-in-list 1
  3934. . nop \)\*[doc-Sy-font]\[bu]\f[]
  3935. . doc-do-list
  3936. ..
  3937. .
  3938. .
  3939. .\" NS doc-dash-list macro
  3940. .\" NS hyphen paragraph list (sub bullet list)
  3941. .\" NS
  3942. .\" NS modifies:
  3943. .\" NS doc-in-list
  3944. .
  3945. .de doc-dash-list
  3946. . nr doc-in-list 1
  3947. . nop \)\*[doc-Sy-font]\-\f[]
  3948. . doc-do-list
  3949. ..
  3950. .
  3951. .
  3952. .\" NS doc-do-list macro
  3953. .\" NS .It item of list-type enum/bullet/hyphen
  3954. .
  3955. .als doc-do-list doc-hang-list
  3956. .
  3957. .
  3958. .\" NS doc-diag-list-input-line-count global register
  3959. .\" NS saved line number to be checked in next diag-list item
  3960. .
  3961. .nr doc-diag-list-input-line-count 0
  3962. .
  3963. .
  3964. .\" NS doc-diag-list macro
  3965. .\" NS .It item of list-type diagnostic-message
  3966. .\" NS
  3967. .\" NS modifies:
  3968. .\" NS doc-curr-font
  3969. .\" NS doc-curr-size
  3970. .\" NS doc-diag-list-input-line-count
  3971. .
  3972. .de doc-diag-list
  3973. . nr doc-curr-font \n[.f]
  3974. . nr doc-curr-size \n[.ps]
  3975. .
  3976. . ie ((\n[.c] - \n[doc-diag-list-input-line-count]) > 1) \{\
  3977. . ie !\n[doc-compact-list-stack\n[doc-list-depth]] \
  3978. . doc-paragraph
  3979. . el \
  3980. . br
  3981. . \}
  3982. . el \
  3983. . br
  3984. . nr doc-diag-list-input-line-count \n[.c]
  3985. .
  3986. . nh
  3987. . nop \*[doc-Sy-font]\c
  3988. . if \n[doc-num-args] \
  3989. . doc-remaining-args
  3990. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\*[doc-hard-space]\c
  3991. .
  3992. . doc-print-and-reset
  3993. ..
  3994. .
  3995. .
  3996. .\" NS doc-tag-list macro
  3997. .\" NS .It item of list-type `tag'
  3998. .\" NS
  3999. .\" NS modifies:
  4000. .\" NS doc-have-space
  4001. .\" NS doc-in-list
  4002. .\" NS
  4003. .\" NS local variables:
  4004. .\" NS doc-box-dtl
  4005. .\" NS doc-reg-dtl
  4006. .\" NS doc-reg-dtl1
  4007. .
  4008. .de doc-tag-list
  4009. . \" finish item box
  4010. . br
  4011. . ev
  4012. . box
  4013. . unformat doc-item-box\n[doc-list-depth]
  4014. .
  4015. . \" we use a box without `.nf' to compute the tag width (via `dl' register)
  4016. . box doc-box-dtl
  4017. . ev doc-env-dtl
  4018. . evc 0
  4019. . fi
  4020. . ad 0
  4021. . in 0
  4022. . doc-item-box\n[doc-list-depth]
  4023. . br
  4024. . ev
  4025. . box
  4026. .
  4027. . if !"TagwidtH"\*[doc-tag-width-stack\n[doc-list-depth]]" \{\
  4028. . if !\n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
  4029. . in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
  4030. . nr doc-list-have-indent-stack\n[doc-list-depth] 1
  4031. . \}
  4032. . doc-get-tag-width
  4033. . \}
  4034. . doc-set-vertical-and-indent 1
  4035. . nr doc-reg-dtl (\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
  4036. . ti -\n[doc-reg-dtl]u
  4037. .
  4038. . nh
  4039. . doc-item-box\n[doc-list-depth]
  4040. . ie (\n[dl]u > \n[doc-list-indent-stack\n[doc-list-depth]]u) \
  4041. . br
  4042. . el \{\
  4043. . \" format the tag separately to prevent stretching of spaces
  4044. . vpt 0
  4045. . br
  4046. . sp -1
  4047. . vpt 1
  4048. . nop \&\c
  4049. . nr doc-have-space 1
  4050. . \}
  4051. .
  4052. . if \n[doc-in-files-section] \
  4053. . if n \
  4054. . ds doc-Pa-font "\*[doc-saved-Pa-font]
  4055. .
  4056. . nr doc-in-list 0
  4057. . doc-reset-args
  4058. ..
  4059. .
  4060. .
  4061. .\" NS doc-get-tag-width macro
  4062. .\" NS resolve unknown tag width (`tag' list-type only)
  4063. .\" NS
  4064. .\" NS modifies:
  4065. .\" NS doc-list-indent-stackXXX
  4066. .\" NS doc-tag-width-stackXXX
  4067. .\" NS
  4068. .\" NS requires:
  4069. .\" NS doc-curr-arg
  4070. .\" NS doc-curr-type
  4071. .
  4072. .de doc-get-tag-width
  4073. . ie (\n[doc-curr-type] == 1) \{\
  4074. . ds doc-tag-width-stack\n[doc-list-depth] \*[doc-curr-arg]
  4075. . nr doc-list-indent-stack\n[doc-list-depth] \n[\*[doc-curr-arg]]
  4076. . \}
  4077. . el \{\
  4078. . ds doc-tag-width-stack\n[doc-list-depth] No
  4079. . nr doc-list-indent-stack\n[doc-list-depth] \n[No]
  4080. . \}
  4081. ..
  4082. .
  4083. .
  4084. .\" NS doc-set-vertical-and-indent macro
  4085. .\" NS set up vertical spacing (if not compact) and indentation (with
  4086. .\" NS offset if argument is non-zero)
  4087. .\" NS
  4088. .\" NS modifies:
  4089. .\" NS doc-list-have-indent-stackXXX
  4090. .
  4091. .de doc-set-vertical-and-indent
  4092. . if !\n[doc-compact-list-stack\n[doc-list-depth]] \
  4093. . sp \n[doc-display-vertical]u
  4094. .
  4095. . if \n[doc-list-have-indent-stack\n[doc-list-depth]] \{\
  4096. . nr doc-list-have-indent-stack\n[doc-list-depth] 0
  4097. . if \$1 \
  4098. . in +(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
  4099. . \}
  4100. .
  4101. . if !\n[cR] \
  4102. . ne 2v
  4103. ..
  4104. .
  4105. .
  4106. .\" NS doc-list-depth global register
  4107. .\" NS list type stack counter
  4108. .
  4109. .nr doc-list-depth 0
  4110. .
  4111. .
  4112. .\" NS doc-num-columns global register
  4113. .\" NS number of columns
  4114. .
  4115. .nr doc-num-columns 0
  4116. .
  4117. .
  4118. .\" NS doc-compact-list-stackXXX global register (bool)
  4119. .\" NS stack of flags to indicate whether a particular list is compact
  4120. .\" NS
  4121. .\" NS limit:
  4122. .\" NS doc-list-depth
  4123. .
  4124. .nr doc-compact-list-stack1 0
  4125. .
  4126. .
  4127. .\" NS doc-tag-prefix-stackXXX global string
  4128. .\" NS stack of tag prefixes (currently used for -nested -enum lists)
  4129. .\" NS
  4130. .\" NS limit:
  4131. .\" NS doc-list-depth
  4132. .
  4133. .ds doc-tag-prefix-stack1
  4134. .
  4135. .
  4136. .\" NS doc-tag-width-stackXXX global string
  4137. .\" NS stack of strings indicating how to set up current element of
  4138. .\" NS doc-list-indent-stackXXX -- if set to TagwidtH, user has set it
  4139. .\" NS directly; if it is a macro name, use the macro's width value;
  4140. .\" NS otherwise, `doc-get-tag-width' uses width value of `No'.
  4141. .\" NS
  4142. .\" NS limit:
  4143. .\" NS doc-list-depth
  4144. .
  4145. .ds doc-tag-width-stack0
  4146. .ds doc-tag-width-stack1
  4147. .
  4148. .
  4149. .\" NS doc-list-offset-stackXXX global register
  4150. .\" NS stack of list offsets
  4151. .\" NS
  4152. .\" NS limit:
  4153. .\" NS doc-list-depth
  4154. .
  4155. .nr doc-list-offset-stack1 0
  4156. .
  4157. .
  4158. .\" NS doc-end-list macro
  4159. .\" NS list end function; resets indentation (and offset if argument is
  4160. .\" NS non-zero)
  4161. .\" NS
  4162. .\" NS modifies:
  4163. .\" NS doc-list-depth
  4164. .\" NS doc-list-offset-stackXXX
  4165. .
  4166. .de doc-end-list
  4167. . if \$1 \
  4168. ' in -(\n[doc-list-indent-stack\n[doc-list-depth]]u + \n[doc-digit-width]u)
  4169. .
  4170. ' in -\n[doc-list-offset-stack\n[doc-list-depth]]u
  4171. .
  4172. . if (\n[doc-list-depth] <= 0) \
  4173. . tm mdoc warning: extraneous .El call (#\n[.c])
  4174. .
  4175. . doc-decrement-list-stack
  4176. . nr doc-list-depth -1
  4177. ..
  4178. .
  4179. .
  4180. .\" NS doc-increment-list-stack macro
  4181. .\" NS set up next block for list
  4182. .\" NS
  4183. .\" NS modifies:
  4184. .\" NS doc-compact-list-stackXXX
  4185. .\" NS doc-list-have-indent-stackXXX
  4186. .\" NS doc-list-indent-stackXXX
  4187. .\" NS doc-list-offset-stackXXX
  4188. .\" NS doc-list-type-stackXXX
  4189. .\" NS doc-tag-prefix-stackXXX
  4190. .\" NS doc-tag-width-stackXXX
  4191. .\" NS doc-enum-list-count-stackXXX
  4192. .\" NS
  4193. .\" NS local variables:
  4194. .\" NS doc-reg-dils
  4195. .
  4196. .de doc-increment-list-stack
  4197. . nr doc-reg-dils (\n[doc-list-depth] + 1)
  4198. . nr doc-list-have-indent-stack\n[doc-reg-dils] 0
  4199. . nr doc-list-indent-stack\n[doc-reg-dils] 0
  4200. . nr doc-list-offset-stack\n[doc-reg-dils] 0
  4201. . ds doc-tag-prefix-stack\n[doc-reg-dils]
  4202. . ds doc-tag-width-stack\n[doc-reg-dils] \*[doc-tag-width-stack\n[doc-list-depth]]
  4203. . ds doc-list-type-stack\n[doc-reg-dils]
  4204. . nr doc-compact-list-stack\n[doc-reg-dils] 0
  4205. . nr doc-enum-list-count-stack\n[doc-reg-dils] 0
  4206. ..
  4207. .
  4208. .
  4209. .\" NS doc-decrement-list-stack macro
  4210. .\" NS decrement stack
  4211. .\" NS
  4212. .\" NS modifies:
  4213. .\" NS doc-compact-list-stackXXX
  4214. .\" NS doc-list-have-indent-stackXXX
  4215. .\" NS doc-list-indent-stackXXX
  4216. .\" NS doc-list-offset-stackXXX
  4217. .\" NS doc-list-type-stackXXX
  4218. .\" NS doc-tag-prefix-stackXXX
  4219. .\" NS doc-tag-width-stackXXX
  4220. .\" NS doc-enum-list-count-stackXXX
  4221. .
  4222. .de doc-decrement-list-stack
  4223. . ds doc-list-type-stack\n[doc-list-depth]
  4224. . nr doc-list-have-indent-stack\n[doc-list-depth] 0
  4225. . nr doc-list-indent-stack\n[doc-list-depth] 0
  4226. . nr doc-list-offset-stack\n[doc-list-depth] 0
  4227. . ds doc-tag-prefix-stack\n[doc-list-depth]
  4228. . ds doc-tag-width-stack\n[doc-list-depth]
  4229. . nr doc-compact-list-stack\n[doc-list-depth] 0
  4230. . nr doc-enum-list-count-stack\n[doc-list-depth] 0
  4231. ..
  4232. .
  4233. .
  4234. .\" NS Xr user macro
  4235. .\" NS cross reference (for man pages only)
  4236. .\" NS
  4237. .\" NS modifies:
  4238. .\" NS doc-arg-ptr
  4239. .\" NS doc-macro-name
  4240. .\" NS
  4241. .\" NS local variables:
  4242. .\" NS doc-reg-Xr
  4243. .\" NS
  4244. .\" NS width register `Xr' set in doc-common
  4245. .
  4246. .de Xr
  4247. . if !\n[doc-arg-limit] \{\
  4248. . ie \n[.$] \{\
  4249. . ds doc-macro-name Xr
  4250. . doc-parse-args \$@
  4251. . \}
  4252. . el \
  4253. . doc-Xr-usage
  4254. . \}
  4255. .
  4256. . if !\n[doc-arg-limit] \
  4257. . return
  4258. .
  4259. . nr doc-arg-ptr +1
  4260. . doc-print-prefixes
  4261. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  4262. . \" first argument must be a string
  4263. . ie (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
  4264. . nr doc-curr-font \n[.f]
  4265. . nr doc-curr-size \n[.ps]
  4266. . ds doc-arg\n[doc-arg-ptr] \*[doc-Xr-font]\*[doc-arg\n[doc-arg-ptr]]\f[]\s[0]
  4267. .
  4268. . if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\
  4269. . nr doc-reg-Xr (\n[doc-arg-ptr] + 1)
  4270. . \" modify second argument if it is a string and
  4271. . \" remove space in between
  4272. . if (\n[doc-type\n[doc-reg-Xr]] == 2) \{\
  4273. . ds doc-arg\n[doc-reg-Xr] \*[lp]\*[doc-arg\n[doc-reg-Xr]]\*[rp]
  4274. . ds doc-space\n[doc-arg-ptr]
  4275. . \}
  4276. . \}
  4277. . doc-print-recursive
  4278. . \}
  4279. . el \
  4280. . doc-Xr-usage
  4281. . \}
  4282. . el \
  4283. . doc-Xr-usage
  4284. ..
  4285. .
  4286. .
  4287. .\" NS doc-Xr-usage macro
  4288. .
  4289. .de doc-Xr-usage
  4290. . tm Usage: .Xr manpage_name [section#] ... (#\n[.c])
  4291. . doc-reset-args
  4292. ..
  4293. .
  4294. .
  4295. .\" NS Sx user macro
  4296. .\" NS cross section reference
  4297. .\" NS
  4298. .\" NS width register `Sx' set in doc-common
  4299. .
  4300. .als Sx doc-generic-macro
  4301. .ds doc-Sx-usage section_header
  4302. .
  4303. .
  4304. .\" NS doc-end-column-list macro
  4305. .\" NS column-list end-list
  4306. .\" NS
  4307. .\" NS modifies:
  4308. .\" NS doc-list-depth
  4309. .
  4310. .de doc-end-column-list
  4311. . linetabs 0
  4312. ' in -(\n[doc-list-offset-stack\n[doc-list-depth]]u + \n[doc-list-indent-stack\n[doc-list-depth]]u)
  4313. . ta T .5i
  4314. . fi
  4315. . doc-decrement-list-stack
  4316. . nr doc-list-depth -1
  4317. ..
  4318. .
  4319. .
  4320. .\" NS doc-column-indent-width global register
  4321. .\" NS holds the indent width for a column list
  4322. .
  4323. .nr doc-column-indent-width 0
  4324. .
  4325. .
  4326. .\" NS doc-set-column-tab macro
  4327. .\" NS establish tabs for list-type column: `.doc-set-column-tab num_cols'
  4328. .\" NS
  4329. .\" NS modifies:
  4330. .\" NS doc-column-indent-width
  4331. .\" NS
  4332. .\" NS local variables:
  4333. .\" NS doc-reg-dsct
  4334. .\" NS doc-str-dsct
  4335. .\" NS doc-str-dsct1
  4336. .
  4337. .de doc-set-column-tab
  4338. . ds doc-str-dsct
  4339. . nr doc-reg-dsct 1
  4340. . nr doc-column-indent-width 0
  4341. .
  4342. . ie (\$1 < 5) \
  4343. . ds doc-str-dsct1 " \"
  4344. . el \{\
  4345. . ie (\$1 == 5) \
  4346. . ds doc-str-dsct1 " \"
  4347. . el \{\
  4348. . \" XXX: this is packed abnormally close -- intercolumn width
  4349. . \" should be configurable
  4350. . ds doc-str-dsct1 " \"
  4351. . \}\}
  4352. .
  4353. . while (\n[doc-reg-dsct] <= \$1) \{\
  4354. . as doc-str-dsct " +\w\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]u
  4355. . nr doc-column-indent-width +\w\*[doc-arg\n[doc-reg-dsct]]\*[doc-str-dsct1]u
  4356. . nr doc-reg-dsct +1
  4357. . \}
  4358. .
  4359. . ta \*[doc-str-dsct]
  4360. ' in +\n[doc-column-indent-width]u
  4361. ..
  4362. .
  4363. .
  4364. .\" NS doc-column-list macro
  4365. .\" NS column items
  4366. .\" NS
  4367. .\" NS modifies:
  4368. .\" NS doc-arg-ptr
  4369. .\" NS doc-list-indent-stackXXX
  4370. .\" NS doc-spaceXXX
  4371. .\" NS
  4372. .\" NS local variables:
  4373. .\" NS doc-reg-dcl
  4374. .
  4375. .de doc-column-list
  4376. . if \n[doc-num-args] \
  4377. . doc-parse-arg-vector
  4378. . nr doc-arg-ptr +1
  4379. .
  4380. . if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  4381. . tm Usage: .It column_string [Ta [column_string ...] ] (#\n[.c])
  4382. . return
  4383. . \}
  4384. .
  4385. . if "\*[doc-arg\n[doc-arg-ptr]]"Ta" \{\
  4386. . nr doc-reg-dcl (\n[doc-arg-ptr] - 1)
  4387. . ds doc-space\n[doc-reg-dcl]
  4388. . \}
  4389. .
  4390. . if !\n[doc-list-indent-stack\n[doc-list-depth]] \
  4391. . nr doc-list-indent-stack\n[doc-list-depth] \n[doc-column-indent-width]u
  4392. . if !\n[.u] \{\
  4393. . fi
  4394. . in +\n[doc-column-indent-width]u
  4395. . \}
  4396. . ti -\n[doc-column-indent-width]u
  4397. .
  4398. . doc-do-\n[doc-type\n[doc-arg-ptr]]
  4399. ..
  4400. .
  4401. .
  4402. .\" NS Ta user macro
  4403. .\" NS append tab (\t)
  4404. .\" NS
  4405. .\" NS modifies:
  4406. .\" NS doc-arg-ptr
  4407. .\" NS
  4408. .\" NS width register `Ta' set in doc-common
  4409. .
  4410. .de Ta
  4411. . ie \n[doc-arg-limit] \{\
  4412. . nr doc-arg-ptr +1
  4413. . nop \*[doc-tab]\c
  4414. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \
  4415. . doc-do-\n[doc-type\n[doc-arg-ptr]]
  4416. . el \
  4417. . doc-reset-args
  4418. . \}
  4419. . el \{\
  4420. . tm1 "Usage: Ta must follow column entry: e.g.
  4421. . tm1 " .It column_string [Ta [column_string ...]] (#\n[.c])
  4422. . \}
  4423. ..
  4424. .
  4425. .
  4426. .\" NS Dl user macro
  4427. .\" NS display (one line) literal
  4428. .\" NS
  4429. .\" NS this function uses the `Li' font
  4430. .\" NS
  4431. .\" NS modifies:
  4432. .\" NS doc-arg-ptr
  4433. .\" NS doc-curr-font
  4434. .\" NS doc-curr-size
  4435. .\" NS doc-macro-name
  4436. .\" NS
  4437. .\" NS width register `Dl' set in doc-common
  4438. .
  4439. .de Dl
  4440. . ta T .5i
  4441. . in +\n[doc-display-indent]u
  4442. .
  4443. . ie \n[doc-arg-limit] \{\
  4444. . tm Usage: .Dl not callable by other macros (#\n[.c])
  4445. . doc-reset-args
  4446. . \}
  4447. . el \{\
  4448. . ie \n[.$] \{\
  4449. . ds doc-macro-name Dl
  4450. . doc-parse-args \$@
  4451. . nr doc-arg-ptr 1
  4452. . nr doc-curr-font \n[.f]
  4453. . nr doc-curr-size \n[.ps]
  4454. . nop \*[doc-Li-font]\c
  4455. . doc-print-recursive
  4456. . \}
  4457. . el \
  4458. . tm Usage: .Dl argument ... (#\n[.c])
  4459. . \}
  4460. .
  4461. . in -\n[doc-display-indent]u
  4462. ..
  4463. .
  4464. .
  4465. .\" NS D1 user macro
  4466. .\" NS display (one line)
  4467. .\" NS
  4468. .\" NS modifies:
  4469. .\" NS doc-arg-ptr
  4470. .\" NS doc-macro-name
  4471. .\" NS
  4472. .\" NS width register `D1' set in doc-common
  4473. .
  4474. .de D1
  4475. . ta T .5i
  4476. . in +\n[doc-display-indent]u
  4477. .
  4478. . ie \n[doc-arg-limit] \{\
  4479. . tm Usage: .D1 not callable by other macros (#\n[.c])
  4480. . doc-reset-args
  4481. . \}
  4482. . el \{\
  4483. . ie \n[.$] \{\
  4484. . ds doc-macro-name D1
  4485. . doc-parse-args \$@
  4486. . nr doc-arg-ptr 1
  4487. . doc-print-recursive
  4488. . \}
  4489. . el \
  4490. . tm Usage: .D1 argument ... (#\n[.c])
  4491. . \}
  4492. .
  4493. . in -\n[doc-display-indent]u
  4494. ..
  4495. .
  4496. .
  4497. .\" NS Vt user macro
  4498. .\" NS variable type (for forcing old style variable declarations);
  4499. .\" NS this is not done in the same manner as .Ot for fortrash --
  4500. .\" NS clean up later
  4501. .\" NS
  4502. .\" NS modifies:
  4503. .\" NS doc-curr-font
  4504. .\" NS doc-curr-size
  4505. .\" NS doc-have-decl
  4506. .\" NS doc-have-var
  4507. .\" NS doc-macro-name
  4508. .\" NS
  4509. .\" NS width register `Vt' set in doc-common
  4510. .
  4511. .de Vt
  4512. . if !\n[doc-arg-limit] \{\
  4513. . ie \n[.$] \{\
  4514. . ds doc-macro-name Vt
  4515. . doc-parse-args \$@
  4516. . \}
  4517. . el \
  4518. . tm Usage: .Vt variable_type ... (#\n[.c])
  4519. . \}
  4520. .
  4521. . if !\n[doc-arg-limit] \
  4522. . return
  4523. .
  4524. . nr doc-arg-ptr +1
  4525. . if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  4526. . tm Usage: .Vt variable_type ... (#\n[.c])
  4527. . doc-reset-args
  4528. . return
  4529. . \}
  4530. .
  4531. . if \n[doc-in-synopsis-section] \{\
  4532. . \" if a function declaration was the last thing given,
  4533. . \" want vertical space
  4534. . if \n[doc-have-decl] \{\
  4535. . doc-paragraph
  4536. . nr doc-have-decl 0
  4537. . \}
  4538. .
  4539. . \" if a subroutine was the last thing given, want vertical space
  4540. . if \n[doc-have-func] \{\
  4541. . ie \n[doc-have-var] \
  4542. . br
  4543. . el \
  4544. . doc-paragraph
  4545. . \}
  4546. .
  4547. . nr doc-have-var 1
  4548. . \}
  4549. .
  4550. . nr doc-curr-font \n[.f]
  4551. . nr doc-curr-size \n[.ps]
  4552. . nop \*[doc-Ft-font]\c
  4553. . doc-print-recursive
  4554. .
  4555. . if \n[doc-in-synopsis-section] \{\
  4556. . ie \n[doc-have-old-func] \
  4557. . nop \*[doc-soft-space]\c
  4558. . el \
  4559. . br
  4560. . \}
  4561. ..
  4562. .
  4563. .
  4564. .\" NS doc-is-func global register (bool)
  4565. .\" NS set if subroutine (in synopsis only) (fortran only)
  4566. .
  4567. .nr doc-is-func 0
  4568. .
  4569. .
  4570. .\" NS Ft user macro
  4571. .\" NS function type
  4572. .\" NS
  4573. .\" NS modifies:
  4574. .\" NS doc-curr-font
  4575. .\" NS doc-curr-size
  4576. .\" NS doc-have-decl
  4577. .\" NS doc-have-var
  4578. .\" NS doc-is-func
  4579. .\" NS doc-macro-name
  4580. .\" NS
  4581. .\" NS width register `Ft' set in doc-common
  4582. .
  4583. .de Ft
  4584. . if !\n[doc-arg-limit] \{\
  4585. . ie \n[.$] \{\
  4586. . ds doc-macro-name Ft
  4587. . doc-parse-args \$@
  4588. . \}
  4589. . el \
  4590. . tm Usage: .Ft function_type ... (#\n[.c])
  4591. . \}
  4592. .
  4593. . if !\n[doc-arg-limit] \
  4594. . return
  4595. .
  4596. . nr doc-arg-ptr +1
  4597. . if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  4598. . tm Usage: .Ft function_type ... (#\n[.c])
  4599. . doc-reset-args
  4600. . return
  4601. . \}
  4602. .
  4603. . if \n[doc-in-synopsis-section] \{\
  4604. . if (\n[doc-have-func] : \n[doc-have-decl]) \{\
  4605. . doc-paragraph
  4606. . nr doc-have-decl 0
  4607. . nr doc-have-var 0
  4608. . \}
  4609. .
  4610. . if \n[doc-have-var] \{\
  4611. . doc-paragraph
  4612. . nr doc-have-var 0
  4613. . \}
  4614. .
  4615. . nr doc-is-func 1
  4616. . \}
  4617. .
  4618. . nr doc-curr-font \n[.f]
  4619. . nr doc-curr-size \n[.ps]
  4620. . nop \*[doc-Ft-font]\c
  4621. . doc-print-recursive
  4622. ..
  4623. .
  4624. .
  4625. .\" NS doc-have-old-func global register (bool)
  4626. .\" NS set if `Ot' has been called
  4627. .
  4628. .nr doc-have-old-func 0
  4629. .
  4630. .
  4631. .\" NS Ot user macro
  4632. .\" NS old function type (fortran -- no newline)
  4633. .\" NS
  4634. .\" NS modifies:
  4635. .\" NS doc-have-decl
  4636. .\" NS doc-have-old-func
  4637. .\" NS doc-have-var
  4638. .\" NS doc-is-func
  4639. .\" NS
  4640. .\" NS width register `Ot' set in doc-common
  4641. .
  4642. .de Ot
  4643. . nr doc-have-old-func 1
  4644. .
  4645. . if \n[doc-in-synopsis-section] \{\
  4646. . if (\n[doc-have-func] : \n[doc-have-decl]) \{\
  4647. . doc-paragraph
  4648. . nr doc-have-decl 0
  4649. . nr doc-have-var 0
  4650. . \}
  4651. .
  4652. . if \n[doc-have-var] \{\
  4653. . doc-paragraph
  4654. . nr doc-have-var 0
  4655. . \}
  4656. .
  4657. . nr doc-is-func 1
  4658. . \}
  4659. .
  4660. . if \n[.$] \
  4661. . nop \*[doc-Ft-font]\$*\c
  4662. . nop \ \f[]\c
  4663. ..
  4664. .
  4665. .
  4666. .\" NS Fa user macro
  4667. .\" NS function arguments
  4668. .\" NS
  4669. .\" NS modifies:
  4670. .\" NS doc-arg-ptr
  4671. .\" NS doc-curr-font
  4672. .\" NS doc-curr-size
  4673. .\" NS doc-macro-name
  4674. .\" NS
  4675. .\" NS width register `Fa' set in doc-common
  4676. .
  4677. .de Fa
  4678. . if !\n[doc-arg-limit] \{\
  4679. . ie \n[.$] \{\
  4680. . ds doc-macro-name Fa
  4681. . doc-parse-args \$@
  4682. . \}
  4683. . el \
  4684. . tm Usage: .Fa function_arguments ... (#\n[.c])
  4685. . \}
  4686. .
  4687. . ie \n[doc-func-arg-count] \
  4688. . doc-do-func
  4689. . el \{\
  4690. . nr doc-arg-ptr +1
  4691. . if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  4692. . nr doc-curr-font \n[.f]
  4693. . nr doc-curr-size \n[.ps]
  4694. . nop \*[doc-Fa-font]\c
  4695. . doc-print-recursive
  4696. .
  4697. . if \n[doc-in-synopsis-section] \
  4698. . if \n[doc-have-func] \
  4699. . br
  4700. . \}\}
  4701. ..
  4702. .
  4703. .
  4704. .\" NS doc-func-arg-count global register
  4705. .\" NS how many function arguments have been processed so far
  4706. .
  4707. .nr doc-func-arg-count 0
  4708. .
  4709. .
  4710. .\" NS doc-func-arg global string
  4711. .\" NS work buffer for function name strings
  4712. .
  4713. .ds doc-func-arg
  4714. .
  4715. .
  4716. .\" NS doc-num-func-args global register
  4717. .\" NS number of function arguments
  4718. .
  4719. .nr doc-num-func-args 0
  4720. .
  4721. .
  4722. .\" NS doc-func-args-processed global register
  4723. .\" NS function arguments processed so far
  4724. .
  4725. .nr doc-func-args-processed 0
  4726. .
  4727. .
  4728. .\" NS doc-do-func macro
  4729. .\" NS internal .Fa for .Fc
  4730. .\" NS
  4731. .\" NS modifies:
  4732. .\" NS doc-arg-ptr
  4733. .\" NS doc-argXXX
  4734. .\" NS doc-func-arg
  4735. .\" NS doc-func-arg-count
  4736. .\" NS doc-func-args-processed
  4737. .\" NS doc-num-func-args
  4738. .
  4739. .de doc-do-func
  4740. . if (\n[doc-arg-limit] <= \n[doc-arg-ptr]) \{\
  4741. . doc-reset-args
  4742. . return
  4743. . \}
  4744. .
  4745. . nr doc-arg-ptr +1
  4746. .
  4747. . ds doc-func-arg
  4748. . nr doc-num-func-args 0
  4749. . nr doc-func-args-processed 0
  4750. .
  4751. . doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
  4752. . if (\n[doc-num-func-args] > 1) \
  4753. . ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
  4754. .
  4755. . if (\n[doc-func-arg-count] > 1) \{\
  4756. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\|\c
  4757. . if !"\*[doc-arg\n[doc-arg-ptr]]"/*" \
  4758. . if !"\*[doc-arg\n[doc-arg-ptr]]"*/" \
  4759. . nop ,\)\c
  4760. . nop \)\*[doc-space\n[doc-arg-ptr]]\*[doc-Fa-font]\c
  4761. . nop \)\*[doc-arg\n[doc-arg-ptr]]\f[]\s[0]\c
  4762. . \}
  4763. .
  4764. . if (\n[doc-func-arg-count] == 1) \{\
  4765. . nop \)\*[doc-Fa-font]\*[doc-arg\n[doc-arg-ptr]]\c
  4766. . nop \f[]\s[0]\c
  4767. . \}
  4768. . nr doc-func-arg-count +1
  4769. . doc-do-func
  4770. ..
  4771. .
  4772. .
  4773. .\" NS doc-have-func global register (bool)
  4774. .\" NS whether we have more than one function in synopsis
  4775. .
  4776. .nr doc-have-func 0
  4777. .
  4778. .
  4779. .\" NS Fn user macro
  4780. .\" NS functions
  4781. .\" NS
  4782. .\" NS modifies:
  4783. .\" NS doc-arg-ptr
  4784. .\" NS doc-curr-font
  4785. .\" NS doc-curr-size
  4786. .\" NS doc-have-decl
  4787. .\" NS doc-have-func
  4788. .\" NS doc-have-var
  4789. .\" NS doc-indent-synopsis
  4790. .\" NS doc-is-func
  4791. .\" NS doc-macro-name
  4792. .\" NS
  4793. .\" NS width register `Fn' set in doc-common
  4794. .
  4795. .de Fn
  4796. . if !\n[doc-arg-limit] \{\
  4797. . ie \n[.$] \{\
  4798. . ds doc-macro-name Fn
  4799. . doc-parse-args \$@
  4800. . \}
  4801. . el \
  4802. . tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
  4803. . \}
  4804. .
  4805. . if !\n[doc-arg-limit] \
  4806. . return
  4807. .
  4808. . if \n[doc-in-synopsis-section] \{\
  4809. . \" if there is/has been more than one subroutine declaration
  4810. . ie \n[doc-is-func] \{\
  4811. . br
  4812. . nr doc-have-var 0
  4813. . nr doc-have-decl 0
  4814. . nr doc-is-func 0
  4815. . \}
  4816. . el \{\
  4817. . if \n[doc-have-func] \{\
  4818. . doc-paragraph
  4819. . nr doc-have-var 0
  4820. . nr doc-have-decl 0
  4821. . \}\}
  4822. .
  4823. . if \n[doc-have-decl] \{\
  4824. . doc-paragraph
  4825. . nr doc-have-var 0
  4826. . \}
  4827. .
  4828. . if \n[doc-have-var] \{\
  4829. . doc-paragraph
  4830. . nr doc-have-decl 0
  4831. . \}
  4832. .
  4833. . nr doc-have-func 1
  4834. . nr doc-is-func 0
  4835. .
  4836. . br
  4837. . if !\n[doc-indent-synopsis] \
  4838. . nr doc-indent-synopsis (4u * \n[doc-fixed-width]u)
  4839. . if !\n[doc-indent-synopsis-active] \
  4840. . in +\n[doc-indent-synopsis]u
  4841. . ti -\n[doc-indent-synopsis]u
  4842. . \}
  4843. .
  4844. . nr doc-arg-ptr +1
  4845. . doc-print-prefixes
  4846. . if (\n[doc-arg-limit] < \n[doc-arg-ptr]) \{\
  4847. . tm Usage: .Fn function_name [function_arg] ... (#\n[.c])
  4848. . doc-reset-args
  4849. . return
  4850. . \}
  4851. .
  4852. . nr doc-curr-font \n[.f]
  4853. . nr doc-curr-size \n[.ps]
  4854. . nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
  4855. . nop \f[]\s[0]\*[lp]\)\c
  4856. .
  4857. . nr doc-arg-ptr +1
  4858. . if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  4859. . if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
  4860. . nop \*[doc-Fa-font]\c
  4861. . doc-do-func-args
  4862. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  4863. . \}\}
  4864. .
  4865. . nop \)\*[rp]\)\c
  4866. . if \n[doc-in-synopsis-section] \
  4867. . nop \);\)\c
  4868. .
  4869. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  4870. . \" output the space (if needed)
  4871. . nr doc-arg-ptr -1
  4872. . nop \)\*[doc-space\n[doc-arg-ptr]]\c
  4873. . nr doc-arg-ptr +1
  4874. .
  4875. . doc-print-recursive
  4876. . \}
  4877. . el \
  4878. . doc-print-and-reset
  4879. .
  4880. . if \n[doc-in-synopsis-section] \
  4881. . if !\n[doc-indent-synopsis-active] \
  4882. . in -\n[doc-indent-synopsis]u
  4883. ..
  4884. .
  4885. .
  4886. .\" NS doc-do-func-args macro
  4887. .\" NS handle function arguments
  4888. .\" NS
  4889. .\" NS modifies:
  4890. .\" NS doc-arg-ptr
  4891. .\" NS doc-argXXX
  4892. .\" NS doc-func-arg
  4893. .\" NS doc-func-args-processed
  4894. .\" NS doc-num-func-args
  4895. .\" NS
  4896. .\" NS local variables:
  4897. .\" NS doc-reg-ddfa
  4898. .
  4899. .de doc-do-func-args
  4900. . if \n[doc-in-synopsis-section] \{\
  4901. . ds doc-func-arg
  4902. . nr doc-num-func-args 0
  4903. . nr doc-func-args-processed 0
  4904. .
  4905. . doc-build-func-string \*[doc-arg\n[doc-arg-ptr]]
  4906. . if (\n[doc-num-func-args] > 1) \
  4907. . ds doc-arg\n[doc-arg-ptr] "\*[doc-func-arg]
  4908. . \}
  4909. .
  4910. . nop \)\*[doc-arg\n[doc-arg-ptr]]\c
  4911. . nr doc-arg-ptr +1
  4912. .
  4913. . if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  4914. . if (\n[doc-type\n[doc-arg-ptr]] == 2) \{\
  4915. . nr doc-reg-ddfa (\n[doc-arg-ptr] - 1)
  4916. . nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\|\c
  4917. . if !"\*[doc-arg\n[doc-arg-ptr]]"/*" \
  4918. . if !"\*[doc-arg\n[doc-arg-ptr]]"*/" \
  4919. . nop ,\)\c
  4920. . nop \)\*[doc-space\n[doc-reg-ddfa]]\f[]\s[0]\|\c
  4921. . doc-do-func-args
  4922. . \}\}
  4923. ..
  4924. .
  4925. .
  4926. .\" NS doc-saved-nesting-level global register
  4927. .
  4928. .nr doc-saved-nesting-level 0
  4929. .
  4930. .
  4931. .\" NS doc-in-func-enclosure global register (bool)
  4932. .
  4933. .nr doc-in-func-enclosure 0
  4934. .
  4935. .
  4936. .\" NS Fo user macro
  4937. .\" NS function open
  4938. .\" NS
  4939. .\" NS modifies:
  4940. .\" NS doc-arg-ptr
  4941. .\" NS doc-curr-font
  4942. .\" NS doc-curr-size
  4943. .\" NS doc-func-arg-count
  4944. .\" NS doc-have-decl
  4945. .\" NS doc-have-func
  4946. .\" NS doc-have-var
  4947. .\" NS doc-in-func-enclosure
  4948. .\" NS doc-indent-synopsis
  4949. .\" NS doc-is-func
  4950. .\" NS doc-macro-name
  4951. .\" NS doc-saved-nesting-level
  4952. .\" NS
  4953. .\" NS width register `Fo' set in doc-common
  4954. .
  4955. .de Fo
  4956. . if (\n[doc-in-func-enclosure]) \{\
  4957. . tm mdoc error: .Fo/.Fc can't be nested (#\n[.c])
  4958. . return
  4959. . \}
  4960. .
  4961. . nr doc-saved-nesting-level \n[doc-nesting-level]
  4962. . nr doc-in-func-enclosure 1
  4963. .
  4964. . if !\n[doc-arg-limit] \{\
  4965. . ie \n[.$] \{\
  4966. . ds doc-macro-name Fo
  4967. . doc-parse-args \$@
  4968. . \}
  4969. . el \
  4970. . tm Usage: .Fo function_name (#\n[.c])
  4971. . \}
  4972. .
  4973. . if \n[doc-in-synopsis-section] \{\
  4974. . \" if there is/has been more than one subroutine declaration
  4975. . ie \n[doc-is-func] \{\
  4976. . br
  4977. . nr doc-have-var 0
  4978. . nr doc-have-decl 0
  4979. . nr doc-is-func 0
  4980. . \}
  4981. . el \{\
  4982. . if \n[doc-have-func] \{\
  4983. . doc-paragraph
  4984. . nr doc-have-var 0
  4985. . nr doc-have-decl 0
  4986. . \}\}
  4987. .
  4988. . if \n[doc-have-decl] \{\
  4989. . doc-paragraph
  4990. . nr doc-have-var 0
  4991. . \}
  4992. .
  4993. . if \n[doc-have-var] \{\
  4994. . doc-paragraph
  4995. . nr doc-have-decl 0
  4996. . \}
  4997. .
  4998. . nr doc-have-func 1
  4999. . nr doc-is-func 0
  5000. .
  5001. . br
  5002. . if !\n[doc-indent-synopsis] \
  5003. . nr doc-indent-synopsis (4u * \n[doc-fixed-width]u)
  5004. . \}
  5005. .
  5006. . \" start function box
  5007. . box doc-func-box
  5008. . ev doc-func-env
  5009. . evc 0
  5010. . in 0
  5011. . nf
  5012. .
  5013. . nr doc-arg-ptr +1
  5014. . doc-print-prefixes
  5015. . if (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  5016. . nr doc-func-arg-count 1
  5017. . nr doc-curr-font \n[.f]
  5018. . nr doc-curr-size \n[.ps]
  5019. .
  5020. . nop \*[doc-Fn-font]\*[doc-arg\n[doc-arg-ptr]]\c
  5021. . nop \f[]\s[0]\*[lp]\)\c
  5022. . doc-reset-args
  5023. . \}
  5024. ..
  5025. .
  5026. .
  5027. .\" NS Fc user macro
  5028. .\" NS function close
  5029. .\" NS
  5030. .\" NS modifies:
  5031. .\" NS doc-arg-ptr
  5032. .\" NS doc-func-arg-count
  5033. .\" NS doc-in-func-enclosure
  5034. .\" NS doc-saved-nesting-level
  5035. .\" NS doc-macro-name
  5036. .\" NS
  5037. .\" NS width register `Fc' set in doc-common
  5038. .
  5039. .de Fc
  5040. . if !\n[doc-in-func-enclosure] \{\
  5041. . tm mdoc warning: Extraneous .Fc (#\n[.c])
  5042. . return
  5043. . \}
  5044. .
  5045. . if \n[.$] \{\
  5046. . ds doc-macro-name Fc
  5047. . \" the first (dummy) argument is used to get the correct spacing
  5048. . doc-parse-args \) \$@
  5049. . \}
  5050. .
  5051. . if !(\n[doc-saved-nesting-level] == \n[doc-nesting-level]) \
  5052. . tm mdoc warning: Unbalanced enclosure commands within .Fo/.Fc
  5053. .
  5054. . nr doc-func-arg-count 0
  5055. . nr doc-in-func-enclosure 0
  5056. .
  5057. . ie \n[doc-in-synopsis-section] \
  5058. . nop \|\*[rp];\)
  5059. . el \
  5060. . nop \|\*[rp]\)
  5061. .
  5062. . \" finish function box
  5063. . br
  5064. . ev
  5065. . box
  5066. . chop doc-func-box
  5067. . unformat doc-func-box
  5068. .
  5069. . if \n[doc-in-synopsis-section] \{\
  5070. . if !\n[doc-indent-synopsis-active] \
  5071. . in +\n[doc-indent-synopsis]u
  5072. . ti -\n[doc-indent-synopsis]u
  5073. . \}
  5074. .
  5075. . nh
  5076. . nop \*[doc-func-box]\c
  5077. .
  5078. . nr doc-arg-ptr +1
  5079. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  5080. . nr doc-curr-font \n[.f]
  5081. . nr doc-curr-size \n[.ps]
  5082. . doc-print-recursive
  5083. . \}
  5084. . el \
  5085. . doc-print-and-reset
  5086. .
  5087. . if \n[doc-in-synopsis-section] \
  5088. . if !\n[doc-indent-synopsis-active] \
  5089. . in -\n[doc-indent-synopsis]u
  5090. ..
  5091. .
  5092. .
  5093. .\" NS doc-build-func-string macro
  5094. .\" NS collect function arguments and set hard spaces in between
  5095. .\" NS
  5096. .\" NS modifies:
  5097. .\" NS doc-func-arg
  5098. .\" NS doc-func-args-processed
  5099. .\" NS doc-num-func-args
  5100. .
  5101. .de doc-build-func-string
  5102. . if !\n[doc-num-func-args] \{\
  5103. . nr doc-num-func-args \n[.$]
  5104. . nr doc-func-args-processed 0
  5105. . ds doc-func-arg
  5106. . \}
  5107. .
  5108. . nr doc-func-args-processed +1
  5109. . as doc-func-arg "\$1
  5110. .
  5111. . if (\n[doc-func-args-processed] < \n[doc-num-func-args]) \{\
  5112. . as doc-func-arg "\*[doc-hard-space]
  5113. .
  5114. . shift
  5115. . doc-build-func-string \$@
  5116. . \}
  5117. ..
  5118. .
  5119. .
  5120. .\" Very crude references: Stash all reference info into boxes, print out
  5121. .\" reference on .Re macro and clean up. Ordering very limited, no fancy
  5122. .\" citations, but can do articles, journals, and books -- need to add
  5123. .\" several missing options (like city etc). Should be able to grab a refer
  5124. .\" entry, massage it a wee bit (prefix a `.' to the %[A-Z]) and not worry
  5125. .\" (ha!).
  5126. .
  5127. .
  5128. .\" NS doc-is-reference global register (bool)
  5129. .\" NS set if in reference
  5130. .
  5131. .nr doc-is-reference 0
  5132. .
  5133. .
  5134. .\" NS doc-reference-count global register
  5135. .\" NS reference element counter
  5136. .
  5137. .nr doc-reference-count 0
  5138. .
  5139. .
  5140. .\" NS Rs user macro
  5141. .\" NS reference start
  5142. .\" NS
  5143. .\" NS modifies:
  5144. .\" NS doc-is-reference
  5145. .\" NS doc-reference-count
  5146. .\" NS
  5147. .\" NS width register `Rs' set in doc-common
  5148. .
  5149. .de Rs
  5150. . ie \n[.$] \
  5151. . tm Usage: .Rs (does not take arguments) (#\n[.c])
  5152. . el \{\
  5153. . nr doc-is-reference 1
  5154. . doc-reset-reference
  5155. . if \n[doc-in-see-also-section] \
  5156. . doc-paragraph
  5157. . nr doc-reference-count 0
  5158. . \}
  5159. ..
  5160. .
  5161. .
  5162. .\" NS Re user macro
  5163. .\" NS reference end
  5164. .\" NS
  5165. .\" NS modifies:
  5166. .\" NS doc-is-reference
  5167. .\" NS
  5168. .\" NS width register `Re' set in doc-common
  5169. .
  5170. .de Re
  5171. . ie \n[.$] \
  5172. . tm Usage: .Re (does not take arguments) (#\n[.c])
  5173. . el \{\
  5174. . if !\n[doc-is-reference] \{\
  5175. . tm mdoc warning: Extraneous .Re (#\n[.c])
  5176. . return
  5177. . \}
  5178. . doc-print-reference
  5179. . doc-reset-reference
  5180. . nr doc-is-reference 0
  5181. . \}
  5182. ..
  5183. .
  5184. .
  5185. .\" NS doc-reset-reference macro
  5186. .\" NS reference cleanup
  5187. .\" NS
  5188. .\" NS modifies:
  5189. .\" NS doc-author-count
  5190. .\" NS doc-author-nameXXX
  5191. .\" NS doc-book-count
  5192. .\" NS doc-book-name
  5193. .\" NS doc-corporate-count
  5194. .\" NS doc-corporate-name
  5195. .\" NS doc-date
  5196. .\" NS doc-date-count
  5197. .\" NS doc-issue-count
  5198. .\" NS doc-issue-name
  5199. .\" NS doc-journal-count
  5200. .\" NS doc-journal-name
  5201. .\" NS doc-optional-count
  5202. .\" NS doc-optional-string
  5203. .\" NS doc-page-number-count
  5204. .\" NS doc-page-number-string
  5205. .\" NS doc-publisher-count
  5206. .\" NS doc-publisher-name
  5207. .\" NS doc-reference-count
  5208. .\" NS doc-reference-title-count
  5209. .\" NS doc-reference-title-name
  5210. .\" NS doc-reference-title-name-for-book
  5211. .\" NS doc-report-count
  5212. .\" NS doc-report-name
  5213. .\" NS doc-url-count
  5214. .\" NS doc-url-name
  5215. .\" NS doc-volume-count
  5216. .\" NS doc-volume-name
  5217. .
  5218. .de doc-reset-reference
  5219. . while (\n[doc-author-count]) \{\
  5220. . ds doc-author-name\n[doc-author-count]
  5221. . nr doc-author-count -1
  5222. . \}
  5223. . nr doc-journal-count 0
  5224. . nr doc-issue-count 0
  5225. . nr doc-optional-count 0
  5226. . nr doc-corporate-count 0
  5227. . nr doc-report-count 0
  5228. . nr doc-reference-title-count 0
  5229. . nr doc-url-count 0
  5230. . nr doc-volume-count 0
  5231. . nr doc-date-count 0
  5232. . nr doc-page-number-count 0
  5233. . nr doc-book-count 0
  5234. . nr doc-publisher-count 0
  5235. . nr doc-reference-count 0
  5236. .
  5237. . ds doc-journal-name
  5238. . ds doc-issue-name
  5239. . ds doc-optional-string
  5240. . ds doc-corporate-name
  5241. . ds doc-report-name
  5242. . ds doc-reference-title-name
  5243. . ds doc-reference-title-name-for-book
  5244. . ds doc-url-name
  5245. . ds doc-volume-name
  5246. . ds doc-date
  5247. . ds doc-page-number-string
  5248. . ds doc-book-name
  5249. . ds doc-publisher-name
  5250. ..
  5251. .
  5252. .
  5253. .\" NS doc-finish-reference macro
  5254. .\" NS auxiliary macro for doc-print-reference
  5255. .\" NS
  5256. .\" NS modifies:
  5257. .\" NS doc-reference-count
  5258. .
  5259. .de doc-finish-reference
  5260. . nr doc-reference-count -\$1
  5261. . ie \n[doc-reference-count] \
  5262. . nop \),
  5263. . el \
  5264. . nop \).
  5265. ..
  5266. .
  5267. .
  5268. .\" NS doc-print-reference macro
  5269. .\" NS reference print
  5270. .\" NS
  5271. .\" NS modifies:
  5272. .\" NS doc-reference-count
  5273. .
  5274. .de doc-print-reference
  5275. .
  5276. . nh
  5277. .
  5278. . if \n[doc-author-count] \{\
  5279. . doc-print-reference-authors
  5280. . nr doc-reference-count -\n[doc-author-count]
  5281. . \}
  5282. .
  5283. . if \n[doc-reference-title-count] \{\
  5284. . unformat doc-reference-title-name
  5285. . chop doc-reference-title-name
  5286. . unformat doc-reference-title-name-for-book
  5287. . chop doc-reference-title-name-for-book
  5288. . ie ((\n[doc-journal-count] == 1) : (\n[doc-book-count] == 1)) \{\
  5289. . nop \)\*[q]\)\*[doc-reference-title-name-for-book]\)\*[q]\c
  5290. . doc-finish-reference \n[doc-reference-title-count]
  5291. . \}
  5292. . el \{\
  5293. . nop \*[doc-reference-title-name]\c
  5294. . doc-finish-reference \n[doc-reference-title-count]
  5295. . \}\}
  5296. .
  5297. . if \n[doc-book-count] \{\
  5298. . unformat doc-book-name
  5299. . chop doc-book-name
  5300. . nop \*[doc-book-name]\c
  5301. . doc-finish-reference \n[doc-book-count]
  5302. . \}
  5303. .
  5304. . if \n[doc-publisher-count] \{\
  5305. . unformat doc-publisher-name
  5306. . chop doc-publisher-name
  5307. . nop \*[doc-publisher-name]\c
  5308. . doc-finish-reference \n[doc-publisher-count]
  5309. . \}
  5310. .
  5311. . if \n[doc-journal-count] \{\
  5312. . unformat doc-journal-name
  5313. . chop doc-journal-name
  5314. . nop \*[doc-journal-name]\c
  5315. . doc-finish-reference \n[doc-journal-count]
  5316. . \}
  5317. .
  5318. . if \n[doc-report-count] \{\
  5319. . unformat doc-report-name
  5320. . chop doc-report-name
  5321. . nop \*[doc-report-name]\c
  5322. . doc-finish-reference \n[doc-report-count]
  5323. . \}
  5324. .
  5325. . if \n[doc-issue-count] \{\
  5326. . unformat doc-issue-name
  5327. . chop doc-issue-name
  5328. . nop \*[doc-issue-name]\c
  5329. . doc-finish-reference \n[doc-issue-count]
  5330. . \}
  5331. .
  5332. . if \n[doc-volume-count] \{\
  5333. . unformat doc-volume-name
  5334. . chop doc-volume-name
  5335. . nop \*[doc-volume-name]\c
  5336. . doc-finish-reference \n[doc-volume-count]
  5337. . \}
  5338. .
  5339. . if \n[doc-url-count] \{\
  5340. . unformat doc-url-name
  5341. . chop doc-url-name
  5342. . nop \*[doc-url-name]\c
  5343. . doc-finish-reference \n[doc-url-count]
  5344. . \}
  5345. .
  5346. . if \n[doc-page-number-count] \{\
  5347. . unformat doc-page-number-string
  5348. . chop doc-page-number-string
  5349. . nop \*[doc-page-number-string]\c
  5350. . doc-finish-reference \n[doc-page-number-count]
  5351. . \}
  5352. .
  5353. . if \n[doc-corporate-count] \{\
  5354. . unformat doc-corporate-name
  5355. . chop doc-corporate-name
  5356. . nop \*[doc-corporate-name]\c
  5357. . doc-finish-reference \n[doc-corporate-count]
  5358. . \}
  5359. .
  5360. . if \n[doc-date-count] \{\
  5361. . unformat doc-date
  5362. . chop doc-date
  5363. . nop \*[doc-date]\c
  5364. . doc-finish-reference \n[doc-date-count]
  5365. . \}
  5366. .
  5367. . if \n[doc-optional-count] \{\
  5368. . unformat doc-optional-string
  5369. . chop doc-optional-string
  5370. . nop \*[doc-optional-string]\c
  5371. . doc-finish-reference \n[doc-optional-count]
  5372. . \}
  5373. .
  5374. . if \n[doc-reference-count] \
  5375. . tm mdoc warning: unresolved reference problem
  5376. .
  5377. . hy \n[doc-hyphen-flags]
  5378. ..
  5379. .
  5380. .
  5381. .\" NS doc-print-reference-authors macro
  5382. .\" NS print out reference authors
  5383. .\" NS
  5384. .\" NS local variables:
  5385. .\" NS doc-reg-dpra
  5386. .\" NS doc-str-dpra
  5387. .
  5388. .ds doc-str-dpra "and
  5389. .
  5390. .de doc-print-reference-authors
  5391. . nr doc-reg-dpra 1
  5392. .
  5393. . while (\n[doc-reg-dpra] < \n[doc-author-count]) \{\
  5394. . unformat doc-author-name\n[doc-reg-dpra]
  5395. . chop doc-author-name\n[doc-reg-dpra]
  5396. . ie (\n[doc-author-count] > 2) \
  5397. . nop \)\*[doc-author-name\n[doc-reg-dpra]],
  5398. . el \
  5399. . nop \)\*[doc-author-name\n[doc-reg-dpra]]
  5400. . nr doc-reg-dpra +1
  5401. . \}
  5402. .
  5403. . unformat doc-author-name\n[doc-reg-dpra]
  5404. . chop doc-author-name\n[doc-reg-dpra]
  5405. . if (\n[doc-author-count] > 1) \
  5406. . nop \)\*[doc-str-dpra]
  5407. . nop \)\*[doc-author-name\n[doc-reg-dpra]],
  5408. ..
  5409. .
  5410. .
  5411. .\" NS doc-author-count global register
  5412. .\" NS counter of author references
  5413. .
  5414. .nr doc-author-count 0
  5415. .
  5416. .
  5417. .\" NS doc-author-nameXXX global box
  5418. .\" NS array of author names
  5419. .\" NS
  5420. .\" NS limit:
  5421. .\" NS doc-author-count
  5422. .
  5423. .ds doc-author-name0
  5424. .
  5425. .
  5426. .\" NS %A user macro
  5427. .\" NS reference author(s)
  5428. .\" NS
  5429. .\" NS modifies:
  5430. .\" NS doc-arg-ptr
  5431. .\" NS doc-author-count
  5432. .\" NS doc-curr-font
  5433. .\" NS doc-curr-size
  5434. .\" NS doc-macro-name
  5435. .\" NS doc-reference-count
  5436. .\" NS
  5437. .\" NS local variables:
  5438. .\" NS doc-env-%A
  5439. .\" NS
  5440. .\" NS width register `%A' set in doc-common
  5441. .
  5442. .de %A
  5443. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5444. . tm Usage: .%A author_name ... (#\n[.c])
  5445. . return
  5446. . \}
  5447. .
  5448. . nr doc-author-count +1
  5449. . nr doc-reference-count +1
  5450. .
  5451. . ds doc-macro-name %A
  5452. . doc-parse-args \$@
  5453. .
  5454. . nr doc-arg-ptr +1
  5455. . nr doc-curr-font \n[.f]
  5456. . nr doc-curr-size \n[.ps]
  5457. .
  5458. . \" save to reference box
  5459. . box doc-author-name\n[doc-author-count]
  5460. . ev doc-env-%A
  5461. . evc 0
  5462. . in 0
  5463. . nf
  5464. . doc-do-references
  5465. ..
  5466. .
  5467. .
  5468. .\" NS doc-book-count global register
  5469. .\" NS counter of book references
  5470. .
  5471. .nr doc-book-count 0
  5472. .
  5473. .
  5474. .\" NS doc-book-name global box
  5475. .\" NS string of collected book references
  5476. .
  5477. .ds doc-book-name
  5478. .
  5479. .
  5480. .\" NS %B user macro
  5481. .\" NS [reference] book name
  5482. .\" NS
  5483. .\" NS modifies:
  5484. .\" NS doc-arg-ptr
  5485. .\" NS doc-book-count
  5486. .\" NS doc-curr-font
  5487. .\" NS doc-curr-size
  5488. .\" NS doc-macro-name
  5489. .\" NS doc-reference-count
  5490. .\" NS
  5491. .\" NS local variables:
  5492. .\" NS doc-env-%B
  5493. .\" NS
  5494. .\" NS width register `%B' set in doc-common
  5495. .
  5496. .de %B
  5497. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5498. . tm Usage: .%B book_name ... (#\n[.c])
  5499. . return
  5500. . \}
  5501. .
  5502. . if \n[doc-is-reference] \{\
  5503. . nr doc-book-count +1
  5504. . nr doc-reference-count +1
  5505. . \}
  5506. .
  5507. . ds doc-macro-name %B
  5508. . doc-parse-args \$@
  5509. .
  5510. . nr doc-arg-ptr +1
  5511. . nr doc-curr-font \n[.f]
  5512. . nr doc-curr-size \n[.ps]
  5513. .
  5514. . ie \n[doc-is-reference] \{\
  5515. . \" append to reference box
  5516. . boxa doc-book-name
  5517. . ev doc-env-%B
  5518. . evc 0
  5519. . in 0
  5520. . nf
  5521. . nop \*[doc-Em-font]\c
  5522. . doc-do-references
  5523. . \}
  5524. . el \{\
  5525. . nop \*[doc-Em-font]\c
  5526. . doc-print-recursive
  5527. . \}
  5528. ..
  5529. .
  5530. .
  5531. .\" NS doc-date-count global register
  5532. .\" NS counter of date references
  5533. .
  5534. .nr doc-date-count 0
  5535. .
  5536. .
  5537. .\" NS doc-date global box
  5538. .\" NS string of collected date references
  5539. .
  5540. .ds doc-date
  5541. .
  5542. .
  5543. .\" NS %D user macro
  5544. .\" NS [reference] date
  5545. .\" NS
  5546. .\" NS modifies:
  5547. .\" NS doc-arg-ptr
  5548. .\" NS doc-curr-font
  5549. .\" NS doc-curr-size
  5550. .\" NS doc-date-count
  5551. .\" NS doc-macro-name
  5552. .\" NS doc-reference-count
  5553. .\" NS
  5554. .\" NS local variables:
  5555. .\" NS doc-env-%D
  5556. .\" NS
  5557. .\" NS width register `%D' set in doc-common
  5558. .
  5559. .de %D
  5560. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5561. . tm Usage: .%D date ... (#\n[.c])
  5562. . return
  5563. . \}
  5564. .
  5565. . nr doc-date-count +1
  5566. . nr doc-reference-count +1
  5567. .
  5568. . ds doc-macro-name %D
  5569. . doc-parse-args \$@
  5570. .
  5571. . nr doc-arg-ptr +1
  5572. . nr doc-curr-font \n[.f]
  5573. . nr doc-curr-size \n[.ps]
  5574. .
  5575. . \" append to reference box
  5576. . boxa doc-date
  5577. . ev doc-env-%D
  5578. . evc 0
  5579. . in 0
  5580. . nf
  5581. . doc-do-references
  5582. ..
  5583. .
  5584. .
  5585. .\" NS doc-publisher-count global register
  5586. .\" NS counter of publisher references
  5587. .
  5588. .nr doc-publisher-count 0
  5589. .
  5590. .
  5591. .\" NS doc-publisher-name global box
  5592. .\" NS string of collected publisher references
  5593. .
  5594. .ds doc-publisher-name
  5595. .
  5596. .
  5597. .\" NS %I user macro
  5598. .\" NS [reference] issuer/publisher name
  5599. .\" NS
  5600. .\" NS modifies:
  5601. .\" NS doc-arg-ptr
  5602. .\" NS doc-curr-font
  5603. .\" NS doc-curr-size
  5604. .\" NS doc-macro-name
  5605. .\" NS doc-publisher-count
  5606. .\" NS doc-reference-count
  5607. .\" NS
  5608. .\" NS local variables:
  5609. .\" NS doc-env-%I
  5610. .\" NS
  5611. .\" NS width register `%I' set in doc-common
  5612. .
  5613. .de %I
  5614. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5615. . tm Usage: .%I issuer/publisher_name ... (#\n[.c])
  5616. . return
  5617. . \}
  5618. .
  5619. . nr doc-publisher-count +1
  5620. . nr doc-reference-count +1
  5621. .
  5622. . ds doc-macro-name %I
  5623. . doc-parse-args \$@
  5624. .
  5625. . nr doc-arg-ptr +1
  5626. . nr doc-curr-font \n[.f]
  5627. . nr doc-curr-size \n[.ps]
  5628. .
  5629. . \" append to reference box
  5630. . boxa doc-publisher-name
  5631. . ev doc-env-%I
  5632. . evc 0
  5633. . in 0
  5634. . nf
  5635. . nop \*[doc-Em-font]\c
  5636. . doc-do-references
  5637. ..
  5638. .
  5639. .
  5640. .\" NS doc-journal-count global register
  5641. .\" NS counter of journal references
  5642. .
  5643. .nr doc-journal-count 0
  5644. .
  5645. .
  5646. .\" NS doc-journal-name global box
  5647. .\" NS string of collected journal references
  5648. .
  5649. .ds doc-journal-name
  5650. .
  5651. .
  5652. .\" NS %J user macro
  5653. .\" NS [reference] Journal Name
  5654. .\" NS
  5655. .\" NS modifies:
  5656. .\" NS doc-arg-ptr
  5657. .\" NS doc-curr-font
  5658. .\" NS doc-curr-size
  5659. .\" NS doc-journal-count
  5660. .\" NS doc-macro-name
  5661. .\" NS doc-reference-count
  5662. .\" NS
  5663. .\" NS local variables:
  5664. .\" NS doc-env-%J
  5665. .\" NS
  5666. .\" NS width register `%J' set in doc-common
  5667. .
  5668. .de %J
  5669. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5670. . tm Usage: .%J journal_name ... (#\n[.c])
  5671. . return
  5672. . \}
  5673. .
  5674. . nr doc-journal-count +1
  5675. . nr doc-reference-count +1
  5676. .
  5677. . ds doc-macro-name %J
  5678. . doc-parse-args \$@
  5679. .
  5680. . nr doc-arg-ptr +1
  5681. . nr doc-curr-font \n[.f]
  5682. . nr doc-curr-size \n[.ps]
  5683. .
  5684. . \" append to reference box
  5685. . boxa doc-journal-name
  5686. . ev doc-env-%J
  5687. . evc 0
  5688. . in 0
  5689. . nf
  5690. . nop \*[doc-Em-font]\c
  5691. . doc-do-references
  5692. ..
  5693. .
  5694. .
  5695. .\" NS doc-issue-count global register
  5696. .\" NS counter of issue number references
  5697. .
  5698. .nr doc-issue-count 0
  5699. .
  5700. .
  5701. .\" NS doc-issue-name global box
  5702. .\" NS string of collected issue number references
  5703. .
  5704. .ds doc-issue-name
  5705. .
  5706. .
  5707. .\" NS %N user macro
  5708. .\" NS [reference] issue number
  5709. .\" NS
  5710. .\" NS modifies:
  5711. .\" NS doc-arg-ptr
  5712. .\" NS doc-curr-font
  5713. .\" NS doc-curr-size
  5714. .\" NS doc-issue-count
  5715. .\" NS doc-macro-name
  5716. .\" NS doc-reference-count
  5717. .\" NS
  5718. .\" NS local variables:
  5719. .\" NS doc-env-%N
  5720. .\" NS
  5721. .\" NS width register `%N' set in doc-common
  5722. .
  5723. .de %N
  5724. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5725. . tm Usage: .%N issue_number ... (#\n[.c])
  5726. . return
  5727. . \}
  5728. .
  5729. . nr doc-issue-count +1
  5730. . nr doc-reference-count +1
  5731. .
  5732. . ds doc-macro-name %N
  5733. . doc-parse-args \$@
  5734. .
  5735. . nr doc-arg-ptr +1
  5736. . nr doc-curr-font \n[.f]
  5737. . nr doc-curr-size \n[.ps]
  5738. .
  5739. . \" append to reference box
  5740. . boxa doc-issue-name
  5741. . ev doc-env-%N
  5742. . evc 0
  5743. . in 0
  5744. . nf
  5745. . doc-do-references
  5746. ..
  5747. .
  5748. .
  5749. .\" NS doc-optional-count global register
  5750. .\" NS counter of optional information references
  5751. .
  5752. .nr doc-optional-count 0
  5753. .
  5754. .
  5755. .\" NS doc-optional-string global box
  5756. .\" NS string of collected optional information references
  5757. .
  5758. .ds doc-optional-string
  5759. .
  5760. .
  5761. .\" NS %O user macro
  5762. .\" NS [reference] optional information
  5763. .\" NS
  5764. .\" NS modifies:
  5765. .\" NS doc-arg-ptr
  5766. .\" NS doc-curr-font
  5767. .\" NS doc-curr-size
  5768. .\" NS doc-macro-name
  5769. .\" NS doc-optional-count
  5770. .\" NS doc-reference-count
  5771. .\" NS
  5772. .\" NS local variables:
  5773. .\" NS doc-env-%O
  5774. .\" NS
  5775. .\" NS width register `%O' set in doc-common
  5776. .
  5777. .de %O
  5778. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5779. . tm Usage: .%O optional_information ... (#\n[.c])
  5780. . return
  5781. . \}
  5782. .
  5783. . nr doc-optional-count +1
  5784. . nr doc-reference-count +1
  5785. .
  5786. . ds doc-macro-name %O
  5787. . doc-parse-args \$@
  5788. .
  5789. . nr doc-arg-ptr +1
  5790. . nr doc-curr-font \n[.f]
  5791. . nr doc-curr-size \n[.ps]
  5792. .
  5793. . \" append to reference box
  5794. . boxa doc-optional-string
  5795. . ev doc-env-%O
  5796. . evc 0
  5797. . in 0
  5798. . nf
  5799. . doc-do-references
  5800. ..
  5801. .
  5802. .
  5803. .\" NS doc-page-number-count global register
  5804. .\" NS counter of page number references
  5805. .
  5806. .nr doc-page-number-count 0
  5807. .
  5808. .
  5809. .\" NS doc-page-number-string global box
  5810. .\" NS string of collected page number references
  5811. .
  5812. .ds doc-page-number-string
  5813. .
  5814. .
  5815. .\" NS %P user macro
  5816. .\" NS [reference] page numbers
  5817. .\" NS
  5818. .\" NS modifies:
  5819. .\" NS doc-arg-ptr
  5820. .\" NS doc-curr-font
  5821. .\" NS doc-curr-size
  5822. .\" NS doc-macro-name
  5823. .\" NS doc-page-number-count
  5824. .\" NS doc-reference-count
  5825. .\" NS
  5826. .\" NS local variables:
  5827. .\" NS doc-env-%P
  5828. .\" NS
  5829. .\" NS width register `%P' set in doc-common
  5830. .
  5831. .de %P
  5832. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5833. . tm Usage: .%P page_number ... (#\n[.c])
  5834. . return
  5835. . \}
  5836. .
  5837. . nr doc-page-number-count +1
  5838. . nr doc-reference-count +1
  5839. .
  5840. . ds doc-macro-name %P
  5841. . doc-parse-args \$@
  5842. .
  5843. . nr doc-arg-ptr +1
  5844. . nr doc-curr-font \n[.f]
  5845. . nr doc-curr-size \n[.ps]
  5846. .
  5847. . \" append to reference box
  5848. . boxa doc-page-number-string
  5849. . ev doc-env-%P
  5850. . evc 0
  5851. . in 0
  5852. . nf
  5853. . doc-do-references
  5854. ..
  5855. .
  5856. .
  5857. .\" NS doc-corporate-count global register
  5858. .\" NS counter of corporate references
  5859. .
  5860. .nr doc-corporate-count 0
  5861. .
  5862. .
  5863. .\" NS doc-corporate-name global box
  5864. .\" NS string of collected corporate references
  5865. .
  5866. .ds doc-corporate-name
  5867. .
  5868. .
  5869. .\" NS %Q user macro
  5870. .\" NS corporate or foreign author
  5871. .\" NS
  5872. .\" NS modifies:
  5873. .\" NS doc-arg-ptr
  5874. .\" NS doc-corporate-count
  5875. .\" NS doc-curr-font
  5876. .\" NS doc-curr-size
  5877. .\" NS doc-macro-name
  5878. .\" NS doc-reference-count
  5879. .\" NS
  5880. .\" NS local variables:
  5881. .\" NS doc-env-%Q
  5882. .\" NS
  5883. .\" NS width register `%Q' set in doc-common
  5884. .
  5885. .de %Q
  5886. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5887. . tm Usage: .%Q corporate_or_foreign_author ... (#\n[.c])
  5888. . return
  5889. . \}
  5890. .
  5891. . nr doc-corporate-count +1
  5892. . nr doc-reference-count +1
  5893. .
  5894. . ds doc-macro-name %Q
  5895. . doc-parse-args \$@
  5896. .
  5897. . nr doc-arg-ptr +1
  5898. . nr doc-curr-font \n[.f]
  5899. . nr doc-curr-size \n[.ps]
  5900. .
  5901. . \" append to reference box
  5902. . boxa doc-corporate-name
  5903. . ev doc-env-%Q
  5904. . evc 0
  5905. . in 0
  5906. . nf
  5907. . doc-do-references
  5908. ..
  5909. .
  5910. .
  5911. .\" NS doc-report-count global register
  5912. .\" NS counter of report references
  5913. .
  5914. .nr doc-report-count 0
  5915. .
  5916. .
  5917. .\" NS doc-report-name global box
  5918. .\" NS string of collected report references
  5919. .
  5920. .ds doc-report-name
  5921. .
  5922. .
  5923. .\" NS %R user macro
  5924. .\" NS [reference] report name
  5925. .\" NS
  5926. .\" NS modifies:
  5927. .\" NS doc-arg-ptr
  5928. .\" NS doc-curr-font
  5929. .\" NS doc-curr-size
  5930. .\" NS doc-macro-name
  5931. .\" NS doc-reference-count
  5932. .\" NS doc-report-count
  5933. .\" NS
  5934. .\" NS local variables:
  5935. .\" NS doc-env-%R
  5936. .\" NS
  5937. .\" NS width register `%R' set in doc-common
  5938. .
  5939. .de %R
  5940. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  5941. . tm Usage: .%R reference_report ... (#\n[.c])
  5942. . return
  5943. . \}
  5944. .
  5945. . nr doc-report-count +1
  5946. . nr doc-reference-count +1
  5947. .
  5948. . ds doc-macro-name %R
  5949. . doc-parse-args \$@
  5950. .
  5951. . nr doc-arg-ptr +1
  5952. . nr doc-curr-font \n[.f]
  5953. . nr doc-curr-size \n[.ps]
  5954. .
  5955. . \" append to reference box
  5956. . boxa doc-report-name
  5957. . ev doc-env-%R
  5958. . evc 0
  5959. . in 0
  5960. . nf
  5961. . doc-do-references
  5962. ..
  5963. .
  5964. .
  5965. .\" NS doc-reference-title-count global register
  5966. .\" NS counter of reference title references
  5967. .
  5968. .nr doc-reference-title-count 0
  5969. .
  5970. .
  5971. .\" NS doc-reference-title-name global box
  5972. .\" NS string of collected reference title references
  5973. .
  5974. .ds doc-reference-title-name
  5975. .
  5976. .
  5977. .\" NS doc-reference-title-name-for-book global box
  5978. .\" NS string of collected reference title references
  5979. .\" NS (saved with another font; this is a shortcoming of groff)
  5980. .
  5981. .ds doc-reference-title-name-for-book
  5982. .
  5983. .
  5984. .\" NS %T user macro
  5985. .\" NS reference title
  5986. .\" NS
  5987. .\" NS modifies:
  5988. .\" NS doc-arg-ptr
  5989. .\" NS doc-curr-font
  5990. .\" NS doc-curr-size
  5991. .\" NS doc-macro-name
  5992. .\" NS doc-reference-title-count
  5993. .\" NS doc-report-count
  5994. .\" NS
  5995. .\" NS local variables:
  5996. .\" NS doc-env-%T
  5997. .\" NS
  5998. .\" NS width register `%T' set in doc-common
  5999. .
  6000. .de %T
  6001. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  6002. . tm Usage: .%T reference_title ... (#\n[.c])
  6003. . return
  6004. . \}
  6005. .
  6006. . if \n[doc-is-reference] \{\
  6007. . nr doc-reference-title-count +1
  6008. . nr doc-reference-count +1
  6009. . \}
  6010. .
  6011. . ds doc-macro-name %T
  6012. . doc-parse-args \$@
  6013. .
  6014. . nr doc-arg-ptr +1
  6015. . nr doc-curr-font \n[.f]
  6016. . nr doc-curr-size \n[.ps]
  6017. . ie \n[doc-is-reference] \{\
  6018. . \" append to reference box
  6019. . boxa doc-reference-title-name-for-book
  6020. . ev doc-env-%T
  6021. . evc 0
  6022. . in 0
  6023. . nf
  6024. . nop \*[doc-No-font]\c
  6025. . doc-do-references
  6026. .
  6027. . \" do it a second time with another font
  6028. . ds doc-macro-name %T
  6029. . doc-parse-args \$@
  6030. .
  6031. . nr doc-arg-ptr +1
  6032. . nr doc-curr-font \n[.f]
  6033. . nr doc-curr-size \n[.ps]
  6034. . boxa doc-reference-title-name
  6035. . ev doc-env-%T
  6036. . evc 0
  6037. . in 0
  6038. . nf
  6039. . nop \*[doc-Em-font]\c
  6040. . doc-do-references
  6041. . \}
  6042. . el \{\
  6043. . nop \*[doc-Em-font]\c
  6044. . doc-print-recursive
  6045. . \}
  6046. ..
  6047. .
  6048. .
  6049. .\" NS doc-url-count global register
  6050. .\" NS counter of hypertext references
  6051. .
  6052. .nr doc-url-count 0
  6053. .
  6054. .
  6055. .\" NS doc-url-name global box
  6056. .\" NS string of collected hypertext references
  6057. .
  6058. .ds doc-url-name
  6059. .
  6060. .
  6061. .\" NS doc-volume-count global register
  6062. .\" NS counter of reference title references
  6063. .
  6064. .nr doc-volume-count 0
  6065. .
  6066. .
  6067. .\" NS doc-volume-name global box
  6068. .\" NS string of collected volume references
  6069. .
  6070. .ds doc-volume-name
  6071. .
  6072. .
  6073. .\" NS %U user macro
  6074. .\" NS hypertext reference
  6075. .\" NS
  6076. .\" NS modifies:
  6077. .\" NS doc-arg-ptr
  6078. .\" NS doc-curr-font
  6079. .\" NS doc-curr-size
  6080. .\" NS doc-macro-name
  6081. .\" NS doc-reference-count
  6082. .\" NS doc-url-count
  6083. .\" NS
  6084. .\" NS local variables:
  6085. .\" NS doc-env-%U
  6086. .\" NS
  6087. .\" NS width register `%U' set in doc-common
  6088. .
  6089. .de %U
  6090. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  6091. . tm Usage: .%U URL ... (#\n[.c])
  6092. . return
  6093. . \}
  6094. .
  6095. . nr doc-url-count +1
  6096. . nr doc-reference-count +1
  6097. .
  6098. . ds doc-macro-name %U
  6099. . doc-parse-args \$@
  6100. .
  6101. . nr doc-arg-ptr +1
  6102. . nr doc-curr-font \n[.f]
  6103. . nr doc-curr-size \n[.ps]
  6104. .
  6105. . \" append to reference box
  6106. . boxa doc-url-name
  6107. . ev doc-env-%U
  6108. . evc 0
  6109. . in 0
  6110. . nf
  6111. . doc-do-references
  6112. ..
  6113. .
  6114. .
  6115. .\" NS %V user macro
  6116. .\" NS reference volume
  6117. .\" NS
  6118. .\" NS modifies:
  6119. .\" NS doc-arg-ptr
  6120. .\" NS doc-curr-font
  6121. .\" NS doc-curr-size
  6122. .\" NS doc-macro-name
  6123. .\" NS doc-reference-count
  6124. .\" NS doc-volume-count
  6125. .\" NS
  6126. .\" NS local variables:
  6127. .\" NS doc-env-%V
  6128. .\" NS
  6129. .\" NS width register `%V' set in doc-common
  6130. .
  6131. .de %V
  6132. . if (\n[doc-arg-limit] : (\n[.$] == 0)) \{\
  6133. . tm Usage: .%V volume ... (#\n[.c])
  6134. . return
  6135. . \}
  6136. .
  6137. . nr doc-volume-count +1
  6138. . nr doc-reference-count +1
  6139. .
  6140. . ds doc-macro-name %V
  6141. . doc-parse-args \$@
  6142. .
  6143. . nr doc-arg-ptr +1
  6144. . nr doc-curr-font \n[.f]
  6145. . nr doc-curr-size \n[.ps]
  6146. .
  6147. . \" append to reference box
  6148. . boxa doc-volume-name
  6149. . ev doc-env-%V
  6150. . evc 0
  6151. . in 0
  6152. . nf
  6153. . doc-do-references
  6154. ..
  6155. .
  6156. .
  6157. .\" NS doc-do-references macro
  6158. .\" NS reference recursion routine
  6159. .\" NS
  6160. .\" NS modifies:
  6161. .\" NS doc-arg-ptr
  6162. .\" NS
  6163. .\" NS local variables:
  6164. .\" NS doc-reg-ddr
  6165. .\" NS doc-reg-ddr1
  6166. .
  6167. .de doc-do-references
  6168. . if !\n[doc-is-reference] \
  6169. . tm mdoc error: .\*[doc-macro-name] found outside of .Rs ... .Re (#\n[.c])
  6170. .
  6171. . nr doc-reg-ddr1 \n[doc-type\n[doc-arg-ptr]]
  6172. .
  6173. . ie (\n[doc-reg-ddr1] == 1) \{\
  6174. . \" .nop \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u]\c
  6175. . doc-append-arg \c 3
  6176. . \*[doc-arg\n[doc-arg-ptr]]
  6177. . \}
  6178. . el \{\
  6179. . nop \)\*[doc-arg\n[doc-arg-ptr]]\c
  6180. .
  6181. . ie (\n[doc-arg-limit] == \n[doc-arg-ptr]) \{\
  6182. . \" finish reference box
  6183. . br
  6184. . ev
  6185. . boxa
  6186. .
  6187. . doc-reset-args
  6188. . \}
  6189. . el \{\
  6190. . nr doc-reg-ddr \n[doc-arg-ptr]
  6191. . nr doc-arg-ptr +1
  6192. . nop \)\*[doc-space\n[doc-reg-ddr]]\c
  6193. . doc-do-references
  6194. . \}\}
  6195. ..
  6196. .
  6197. .
  6198. .\" NS Hf user macro
  6199. .\" NS source include header files.
  6200. .\" NS
  6201. .\" NS modifies:
  6202. .\" NS doc-curr-font
  6203. .\" NS doc-curr-size
  6204. .\" NS
  6205. .\" NS width register `Hf' set in doc-common
  6206. .
  6207. .de Hf
  6208. . ie ((\n[.$] == 1) & (\n[doc-arg-limit] == 0)) \{\
  6209. . doc-paragraph
  6210. . nop File:
  6211. . Pa \$1
  6212. .
  6213. . Bd -literal
  6214. . so \$1
  6215. . Ed
  6216. .
  6217. . doc-paragraph
  6218. . \}
  6219. . el \
  6220. . Usage: .Hf file (#\n[.c])
  6221. ..
  6222. .
  6223. .
  6224. .\" NS doc-have-author global register (bool)
  6225. .\" NS set in `An'
  6226. .
  6227. .nr doc-have-author 0
  6228. .
  6229. .
  6230. .\" NS An user macro
  6231. .\" NS author name
  6232. .\" NS
  6233. .\" NS modifies:
  6234. .\" NS doc-arg-ptr
  6235. .\" NS doc-curr-font
  6236. .\" NS doc-curr-size
  6237. .\" NS doc-have-author
  6238. .\" NS doc-macro-name
  6239. .\" NS
  6240. .\" NS width register `An' set in doc-common
  6241. .
  6242. .de An
  6243. . if !\n[doc-arg-limit] \{\
  6244. . ie \n[.$] \{\
  6245. . ie "\$1"-nosplit" \
  6246. . nr doc-in-authors-section 0
  6247. . el \{ .ie "\$1"-split" \
  6248. . nr doc-in-authors-section 1
  6249. . el \{\
  6250. . ds doc-macro-name An
  6251. . doc-parse-args \$@
  6252. . \}\}\}
  6253. . el \{\
  6254. . tm1 "Usage: .An {-nosplit | -split}
  6255. . tm1 " .An author_name ... (#\n[.c])
  6256. . \}\}
  6257. .
  6258. . if \n[doc-in-authors-section] \{\
  6259. . ie \n[doc-have-author] \
  6260. . br
  6261. . el \
  6262. . nr doc-have-author 1
  6263. . \}
  6264. .
  6265. . if \n[doc-arg-limit] \{\
  6266. . nr doc-arg-ptr +1
  6267. . ie (\n[doc-arg-limit] >= \n[doc-arg-ptr]) \{\
  6268. . nr doc-curr-font \n[.f]
  6269. . nr doc-curr-size \n[.ps]
  6270. . doc-print-recursive
  6271. . \}
  6272. . el \{\
  6273. . tm Usage: .An author_name ... (#\n[.c])
  6274. . doc-reset-args
  6275. . \}\}
  6276. ..
  6277. .
  6278. .
  6279. .\" NS Rv user macro
  6280. .\" NS return values
  6281. .\" NS
  6282. .\" NS width register `Rv' set in doc-common
  6283. .\" NS
  6284. .\" NS local variables:
  6285. .\" NS doc-str-Rv-std-prefix
  6286. .\" NS doc-str-Rv-std-suffix
  6287. .\" NS doc-str-Rv-stds-prefix
  6288. .\" NS doc-str-Rv-stds-and
  6289. .\" NS doc-str-Rv-stds-suffix
  6290. .\" NS doc-str-Rv-std0
  6291. .
  6292. .ds doc-str-Rv-std-prefix "The
  6293. .ds doc-str-Rv-std-suffix "function returns the value\~0 if successful;
  6294. .as doc-str-Rv-std-suffix " otherwise the value\~\-1 is returned and
  6295. .as doc-str-Rv-std-suffix " the global variable \*[doc-Va-font]errno\f[]
  6296. .as doc-str-Rv-std-suffix " is set to indicate the error.
  6297. .
  6298. .ds doc-str-Rv-stds-prefix "The
  6299. .ds doc-str-Rv-stds-and "and
  6300. .ds doc-str-Rv-stds-suffix "functions return the value\~0 if successful;
  6301. .as doc-str-Rv-stds-suffix " otherwise the value\~\-1 is returned and
  6302. .as doc-str-Rv-stds-suffix " the global variable \*[doc-Va-font]errno\f[]
  6303. .as doc-str-Rv-stds-suffix " is set to indicate the error.
  6304. .
  6305. .ds doc-str-Rv-std0 "Upon successful completion, the value\~0 is returned;
  6306. .as doc-str-Rv-std0 " otherwise the value\~\-1 is returned and
  6307. .as doc-str-Rv-std0 " the global variable \*[doc-Va-font]errno\f[]
  6308. .as doc-str-Rv-std0 " is set to indicate the error.
  6309. .
  6310. .de Rv
  6311. .
  6312. .\" XXX: what does this function without `-std'?
  6313. .
  6314. . if \n[doc-arg-limit] \{\
  6315. . tm Usage: .Rv not callable by other macros (#\n[.c])
  6316. . doc-reset-args
  6317. . return
  6318. . \}
  6319. .
  6320. . if !\n[.$] \{\
  6321. . tm Usage: .Rv [-std] [<function> ...] (#\n[.c])
  6322. . return
  6323. . \}
  6324. .
  6325. . if "\$1"-std" \{\
  6326. . nr doc-reg-Rv \*[doc-section]
  6327. . if ((\n[doc-reg-Rv] < 2) : (\n[doc-reg-Rv] > 3)) \
  6328. . tm Usage: .Rv -std in sections 2 and 3 only (#\n[.c])
  6329. . br
  6330. . shift
  6331. . ie (\n[.$] > 1) \{\
  6332. . nop \)\*[doc-str-Rv-stds-prefix]
  6333. . nr doc-reg-Rv 1
  6334. . while (\n[doc-reg-Rv] < \n[.$]) \{\
  6335. . ie (\n[.$] > 2) \
  6336. . Fn \$\n[doc-reg-Rv] ,
  6337. . el \
  6338. . Fn \$\n[doc-reg-Rv]
  6339. . nr doc-reg-Rv +1
  6340. . \}
  6341. . nop \)\*[doc-str-Rv-stds-and]
  6342. . Fn \$\n[.$]
  6343. . nop \)\*[doc-str-Rv-stds-suffix]
  6344. . \}
  6345. . el \{ .ie (\n[.$] == 1) \{\
  6346. . nop \)\*[doc-str-Rv-std-prefix]
  6347. . Fn \$1
  6348. . nop \)\*[doc-str-Rv-std-suffix]
  6349. . \}
  6350. . el \{\
  6351. . nop \)\*[doc-str-Rv-std0]
  6352. . \}\}\}
  6353. ..
  6354. .
  6355. .
  6356. .\" NS Ex user macro
  6357. .\" NS exit status
  6358. .\" NS
  6359. .\" NS width register `Ex' set in doc-common
  6360. .\" NS
  6361. .\" NS local variables:
  6362. .\" NS doc-str-Ex-std-prefix
  6363. .\" NS doc-str-Ex-std-suffix
  6364. .
  6365. .ds doc-str-Ex-std-prefix "The
  6366. .ds doc-str-Ex-std-suffix "utility exits\~0 on success,
  6367. .as doc-str-Ex-std-suffix " and\~>0 if an error occurs.
  6368. .
  6369. .ds doc-str-Ex-stds-prefix "The
  6370. .als doc-str-Ex-stds-and doc-str-Rv-stds-and
  6371. .ds doc-str-Ex-stds-suffix "utilities exit\~0 on success,
  6372. .as doc-str-Ex-stds-suffix " and\~>0 if an error occurs.
  6373. .
  6374. .de Ex
  6375. .
  6376. .\" XXX: what does this function without `-std'?
  6377. .
  6378. . if \n[doc-arg-limit] \{\
  6379. . tm Usage: .Ex not callable by other macros (#\n[.c])
  6380. . doc-reset-args
  6381. . return
  6382. . \}
  6383. .
  6384. . if !\n[.$] \{\
  6385. . tm Usage: .Ex [-std] [<utility> ...] (#\n[.c])
  6386. . return
  6387. . \}
  6388. .
  6389. . if "\$1"-std" \{\
  6390. . nr doc-reg-Ex \*[doc-section]
  6391. . if !((\n[doc-reg-Ex] == 1) : (\n[doc-reg-Ex] == 6) : (\n[doc-reg-Ex] == 8)) \
  6392. . tm Usage: .Ex -std in sections 1, 6 and 8 only (#\n[.c])
  6393. . br
  6394. . shift
  6395. . ie (\n[.$] > 1) \{\
  6396. . nop \)\*[doc-str-Ex-stds-prefix]
  6397. . nr doc-reg-Ex 1
  6398. . while (\n[doc-reg-Ex] < \n[.$]) \{\
  6399. . ie (\n[.$] > 2) \
  6400. . Nm \$\n[doc-reg-Ex] ,
  6401. . el \
  6402. . Nm \$\n[doc-reg-Ex]
  6403. . nr doc-reg-Ex +1
  6404. . \}
  6405. . nop \)\*[doc-str-Ex-stds-and]
  6406. . Nm \$\n[.$]
  6407. . nop \)\*[doc-str-Ex-stds-suffix]
  6408. . \}
  6409. . el \{\
  6410. . nop \)\*[doc-str-Ex-std-prefix]
  6411. . Nm \$1
  6412. . nop \)\*[doc-str-Ex-std-suffix]
  6413. . \}\}
  6414. ..
  6415. .
  6416. .
  6417. .\" NS Mt user macro
  6418. .\" NS mailto (for conversion to HTML)
  6419. .
  6420. .de Mt
  6421. . \" XXX: error handling missing
  6422. . Pa \$@
  6423. ..
  6424. .
  6425. .
  6426. .\" NS Lk user macro
  6427. .\" NS link (for conversion to HTML)
  6428. .\" NS
  6429. .\" NS local variables:
  6430. .\" NS doc-reg-Lk
  6431. .\" NS doc-str-Lk
  6432. .
  6433. .de Lk
  6434. . ds doc-str-Lk Sy \$@
  6435. .
  6436. . ie (\n[.$] > 1) \{\
  6437. . doc-get-arg-type \$2
  6438. . ie (\n[doc-arg-type] < 3) \{\
  6439. . Em \)\$2:
  6440. . ds doc-str-Lk Sy "\$1"
  6441. . doc-get-width "\$1"
  6442. . shift 2
  6443. . if \n[.$] \
  6444. . as doc-str-Lk " \$@
  6445. . \}
  6446. . el \
  6447. . doc-get-width "\$1"
  6448. . \}
  6449. . el \
  6450. . doc-get-width "\$1"
  6451. .
  6452. . ie n \
  6453. . nr doc-reg-Lk 26
  6454. . el \
  6455. . nr doc-reg-Lk 38
  6456. . ie (\n[doc-width] >= \n[doc-reg-Lk]) \
  6457. . D1 \*[doc-str-Lk]
  6458. . el \
  6459. . \*[doc-str-Lk]
  6460. ..
  6461. .
  6462. .
  6463. .\" NS doc-defunct-macro macro
  6464. .\" NS this is the skeleton for defunct macros
  6465. .\" NS
  6466. .
  6467. .de doc-defunct-macro
  6468. . tmc mdoc error: .\$0 defunct
  6469. . if d doc-\$0-usage \
  6470. . tmc , \*[doc-\$0-usage]
  6471. . tm1 " (#\n[.c])
  6472. ..
  6473. .
  6474. .
  6475. .\" obsolete macros
  6476. .
  6477. .als Db doc-defunct-macro
  6478. .
  6479. .als Ds doc-defunct-macro
  6480. .
  6481. .als Or doc-defunct-macro
  6482. .ds doc-Or-usage use `|'
  6483. .
  6484. .als Sf doc-defunct-macro
  6485. .ds doc-Sf-usage use .Pf or .Ns
  6486. .
  6487. .
  6488. .rn em e@
  6489. .
  6490. .de em
  6491. . tm1 "mdoc error: end-macro (.em) respecification is not allowed. (#\n[.c])
  6492. . tm1 " Should this have been `.Em ...'?
  6493. . ab
  6494. ..
  6495. .
  6496. .
  6497. .\" NS doc-empty-line macro
  6498. .\" NS emit warning and print empty line
  6499. .
  6500. .de doc-empty-line
  6501. . if !\n[doc-display-depth] \
  6502. . tm mdoc warning: Empty input line #\n[.c]
  6503. . sp
  6504. ..
  6505. .
  6506. .blm doc-empty-line
  6507. .
  6508. .
  6509. .ec
  6510. .
  6511. .
  6512. .\" For UTF-8, map some characters conservatively for the sake
  6513. .\" of easy cut and paste.
  6514. .
  6515. .if '\*[.T]'utf8' \{\
  6516. . rchar \- - ' `
  6517. .
  6518. . char \- \N'45'
  6519. . char - \N'45'
  6520. . char ' \N'39'
  6521. . char ` \N'96'
  6522. .\}
  6523. .
  6524. .
  6525. .\" load local modifications
  6526. .mso mdoc.local
  6527. .
  6528. .\" EOF