\" Save position .nr cl 0 1 \" This is column #0 .nr CL \\n(.l \" Save the linelength .nr CI \\n(.i \" Save the indent .nr CO \\n(.o \" Save the offset
.ll 20n \" this doesn't work in nf-mode.
.wh \\n(CDu CF \" set the bottom of column trap .\\$1 \" throw in the diverted text .ch CF \" remove trap .. TRAP1 \" debugging
.di \" close first-page (C1) diversion .di C2 \" open second-page (C2) diversion .. .nr CN 2 \" Number of columns .ev 2 .di C1 \" divert the text.. .di \" end diversion .ev .nr CA \\n(dnu/\\n(CN \" save max height of columnized text .nr CB \\n(.t-(\\n(.v*3) \" save available space on page .nr CE \\n(.lu/\\n(CN .tm The diversion is \\n(dnu high and \\n(dlu wide. At \\n(CN columns,\" fill again. .. Unfortunately, none of the above works with -mdoc2html; so we'll
.tm the max height would be \\n(CAu high, if they fit on the same page.
.tm The page length is \\n(.p, and the current vposition is \\n(nl, not to
.tm be confused with the page offset of \\n(.o.
.tm So we have \\n(CBu of space on this page.
.rn C1 C0 \" put original in C0 .ev 2 .di C1 \" Divert the first page into new C1 Diversion trap location in solid kludgite. If notCRT, we need
extra v-height. go figure.
.C0 .di .evTrap at bottom of page
.nr CD \\n(nlu+\\n(.tu-2v) \" trap right before next trap .\} Trap at the bottom of the text. All on one page.
.nr CD \\n(CAu+\\n(nlu .\} .CZ C1 The .if dxxx construct is groff-specific
.nr CA \\n(dnu/\\n(CN \" save max height of columnized text .nr CD \\n(CAu+\\n(nlu .CZ C2 .\} These should already be restored. But sometimes we don't hit
the last page trap [??]
.po \\n(COu \" restore offset
just replace columns with a regular Bd -unfilled -offset indent.
d -unfilled -offset indent .. .als Ec Ed .\} . Macros to support Table of Contents
TOC is set (from the command line) if we're generating the TOC file;
the TOC file is read from groff's stderr.
Usage:
.Sh section header
.Ss subsection header
.Ss2 sub2section header
.Te depth "item" Explicit toc entry, not based on other markup
.To depth "item" Like Te, but don't echo the item
XXX To should be unnecessary if we handle parseable/callable.
.Tc import the TOC
.Ti depth page "item" (internal) output an entry
.tm ...writing \*[toc-file].tmp .open toc-tmp \*[toc-file].tmp .nr mktoc-level \\$1 .shift .write toc-tmp .Ti \\n[mktoc-level] \\n% "\\$*" .. .rn Ss Ss-toc .Ss-toc \\$@toc 0 \\$@ .. .rn Ss2 Ss2-toc .Ss2-toc \\$@
toc 1 \\$@ .. .\} .nr Te-toc-level \\$1 .shift .. .nr To-toc-level \\$1 .shift .. . .Tc and .Ti for PostScript
. .nr Ti-toc-level \\$1 .nr Ti-page \\$2 .shift 2 .nr Ti-indent (\\n[Tc-saved-indent]+(3n*\\n[Ti-toc-level])) \\$* \c 'nr Ti-eol-pos (\\n(.l-\\n(.i-\\n(.k) 'ta (\\n[Ti-eol-pos]u-\w'099'u)R (\\n[Ti-eol-pos]u)R \a\t\\n[Ti-page] .. . .nr Tc-saved-indent \\n(.i .tm ...reading \*[toc-file] Use so-real here because toc-file is in objdir not .CURDIR
.so -real \*[toc-file] .. .\} . .Tc and .Ti for HTML
. .nr Ti-toc-level \\$1 nr Ti-page \\$2
.shift 2 \h'3n*\\n[Ti-toc-level]u' <a href="#\\$*">\\$*</a> .. . .tm ...reading \*[toc-file]Use so-real here because toc-file is in objdir not .CURDIR.. .\} . .Tc and .Ti for unpaginated text
.so -real \*[toc-file]
. .nr Ti-toc-level \\$1 nr Ti-page \\$2
.shift 2 \h'3n*\\n[Ti-toc-level]u'\\$* .. d -literal .tm ...reading \*[toc-file] Use so-real here because toc-file is in objdir not .CURDIR
.so -real \*[toc-file] .Ed .. .\} . . -------------------- MISC --------------------
. set the unused target number registers to 0, so that we can turn on all
the warnings but still do things like .if \n[amiga]:\n[alpha] stuff
(The Makefile defines the target as 1, leaving the others undefined.)
. . while \\n[.$] \{\ . if !r\\$1 .nr \\$1 0 . shift . \} .. . . Supported MACHINE_ARCHs:
.as MACHINE_ARCH_LIST " powerpc sh3eb sh3el sparc sparc64 vax x86_64 . Define registers for MACHINE_ARCHs with multiple or different MACHINEs
. . Other strings available:
\*M ${MACHINE} (e.g., `i386')
\*P ${MACHINE} for packages (e.g., `i386')
\*A ${MACHINE_ARCH} (e.g., `m68k')
\*V Version (e.g., `1.5')
\*[.CURDIR] ${.CURDIR}