summaryrefslogtreecommitdiff
path: root/xc/doc/util
diff options
context:
space:
mode:
authorrws <empty>1988-02-24 08:25:41 +0000
committerrws <empty>1988-02-24 08:25:41 +0000
commite08c7c175344f51968a6bc97fdd76bcc8993c951 (patch)
tree708c110b6549292897605110da86f744a85708ac /xc/doc/util
parent462bcf435fd86b8f3f074b8eb8ce70828f68872b (diff)
Initial revision
Diffstat (limited to 'xc/doc/util')
-rw-r--r--xc/doc/util/block.awk11
-rw-r--r--xc/doc/util/fixindex.awk40
-rw-r--r--xc/doc/util/macros.t93
3 files changed, 144 insertions, 0 deletions
diff --git a/xc/doc/util/block.awk b/xc/doc/util/block.awk
new file mode 100644
index 000000000..cb5ee9180
--- /dev/null
+++ b/xc/doc/util/block.awk
@@ -0,0 +1,11 @@
+BEGIN {
+ firstchar = "@";
+}
+
+{
+ c = substr($2,2,1);
+ if (c != firstchar)
+ printf(".LB %s\n", c);
+ firstchar = c;
+ print;
+}
diff --git a/xc/doc/util/fixindex.awk b/xc/doc/util/fixindex.awk
new file mode 100644
index 000000000..1a2efb3c7
--- /dev/null
+++ b/xc/doc/util/fixindex.awk
@@ -0,0 +1,40 @@
+BEGIN {
+ FS = "\t";
+}
+
+NR == 1 {
+ if ($3 != "")
+ printf(".Ib \"%s\"\n", $2);
+ major = $2;
+ minor = $3;
+ pageno = $1;
+ pagelist = $1;
+}
+
+NR != 1 {
+ if ($2 == major && $3 == minor) # neither has changed
+ {
+ if ($1 != pageno) # new page number, append
+ pagelist = pagelist ", " $1;
+ }
+ else # one has changed
+ {
+ if (minor != "") # dump full record
+ printf(".I< \"%s\" \"%s\" \"%s\"\n", major, minor, pagelist);
+ else
+ printf(".I> \"%s\" \"%s\"\n", major, pagelist);
+ pagelist = $1; # restart pagelist
+ if ($2 != major && $3 != "") # major has changed, minor not null
+ printf(".Ib \"%s\"\n", $2);
+ }
+ major = $2;
+ minor = $3;
+ pageno = $1;
+}
+
+END {
+ if (minor != "") # dump full record
+ printf(".I< \"%s\" \"%s\" \"%s\"\n", major, minor, pagelist);
+ else
+ printf(".I> \"%s\" \"%s\"\n", major, pagelist);
+}
diff --git a/xc/doc/util/macros.t b/xc/doc/util/macros.t
new file mode 100644
index 000000000..611b498de
--- /dev/null
+++ b/xc/doc/util/macros.t
@@ -0,0 +1,93 @@
+.na
+.de Ds
+.nf
+.\\$1D \\$2 \\$1
+.ft 1
+.ps \\n(PS
+.if \\n(VS>=40 .vs \\n(VSu
+.if \\n(VS<=39 .vs \\n(VSp
+..
+.de De
+.ce 0
+.if \\n(BD .DF
+.nr BD 0
+.in \\n(OIu
+.if \\n(TM .ls 2
+.sp \\n(DDu
+.fi
+..
+.de FD
+.LP
+.KS
+.TA .5i 3i
+.ta .5i 3i
+.nf
+..
+.de FN
+.fi
+.KE
+.LP
+..
+.de IN \" send an index entry to the stderr
+.tm \\n%\t\\$1\t\\$2
+..
+.de C{
+.KS
+.nf
+.D
+.\"
+.\" choose appropriate monospace font
+.\" the imagen conditional, 480,
+.\" may be changed to L if LB is too
+.\" heavy for your eyes...
+.\"
+.ie "\\*(.T"480" .ft L
+.el .ie "\\*(.T"300" .ft L
+.el .ie "\\*(.T"202" .ft PO
+.el .ie "\\*(.T"aps" .ft CW
+.el .ft R
+.ps \\n(PS
+.ie \\n(VS>40 .vs \\n(VSu
+.el .vs \\n(VSp
+..
+.de C}
+.DE
+.R
+..
+.de Pn
+.IN \\$2
+.ie t \\$1\f(H\^\\$2\^\fR\\$3
+.el \\$1\fI\^\\$2\^\fP\\$3
+..
+.de PN
+.IN \\$1
+.ie t \f(H\^\\$1\^\fR\\$2
+.el \fI\^\\$1\^\fP\\$2
+..
+.de NT
+.ne 7
+.ds NO Note
+.if \\n(.$>$1 .if !'\\$2'C' .ds NO \\$2
+.if \\n(.$ .if !'\\$1'C' .ds NO \\$1
+.ie n .sp
+.el .sp 10p
+.TB
+.ce
+\\*(NO
+.ie n .sp
+.el .sp 5p
+.if '\\$1'C' .ce 99
+.if '\\$2'C' .ce 99
+.in +5n
+.ll -5n
+.R
+..
+. \" Note End -- doug kraft 3/85
+.de NE
+.ce 0
+.in -5n
+.ll +5n
+.ie n .sp
+.el .sp 10p
+..
+.ny0