From 3b5355d725800022c2c055a699326722a43b9dc2 Mon Sep 17 00:00:00 2001
From: ru
Date: Tue, 17 Apr 2001 12:23:50 +0000
Subject: [PATCH 1/2] Removed files not present in v1.17 import.
---
contrib/groff/addftinfo/Makefile.dep | 3 -
contrib/groff/addftinfo/Makefile.sub | 11 -
contrib/groff/addftinfo/addftinfo.cc | 196 -
contrib/groff/addftinfo/addftinfo.man | 102 -
contrib/groff/addftinfo/guess.cc | 490 --
contrib/groff/addftinfo/guess.h | 44 -
contrib/groff/afmtodit/Makefile.sub | 21 -
contrib/groff/afmtodit/afmtodit.man | 222 -
contrib/groff/afmtodit/afmtodit.pl | 326 -
contrib/groff/devX100-12/CB | 308 -
contrib/groff/devX100-12/CBI | 308 -
contrib/groff/devX100-12/CI | 308 -
contrib/groff/devX100-12/CR | 308 -
contrib/groff/devX100-12/DESC | 9 -
contrib/groff/devX100-12/HB | 308 -
contrib/groff/devX100-12/HBI | 308 -
contrib/groff/devX100-12/HI | 308 -
contrib/groff/devX100-12/HR | 308 -
contrib/groff/devX100-12/Makefile.sub | 2 -
contrib/groff/devX100-12/NB | 308 -
contrib/groff/devX100-12/NBI | 308 -
contrib/groff/devX100-12/NI | 308 -
contrib/groff/devX100-12/NR | 308 -
contrib/groff/devX100-12/S | 226 -
contrib/groff/devX100-12/TB | 308 -
contrib/groff/devX100-12/TBI | 308 -
contrib/groff/devX100-12/TI | 308 -
contrib/groff/devX100-12/TR | 308 -
contrib/groff/devX100/CB | 308 -
contrib/groff/devX100/CBI | 308 -
contrib/groff/devX100/CI | 308 -
contrib/groff/devX100/CR | 308 -
contrib/groff/devX100/DESC | 9 -
contrib/groff/devX100/HB | 308 -
contrib/groff/devX100/HBI | 308 -
contrib/groff/devX100/HI | 308 -
contrib/groff/devX100/HR | 308 -
contrib/groff/devX100/Makefile.sub | 2 -
contrib/groff/devX100/NB | 308 -
contrib/groff/devX100/NBI | 308 -
contrib/groff/devX100/NI | 308 -
contrib/groff/devX100/NR | 308 -
contrib/groff/devX100/S | 226 -
contrib/groff/devX100/TB | 308 -
contrib/groff/devX100/TBI | 308 -
contrib/groff/devX100/TI | 308 -
contrib/groff/devX100/TR | 308 -
contrib/groff/devX75-12/CB | 308 -
contrib/groff/devX75-12/CBI | 308 -
contrib/groff/devX75-12/CI | 308 -
contrib/groff/devX75-12/CR | 308 -
contrib/groff/devX75-12/DESC | 9 -
contrib/groff/devX75-12/HB | 308 -
contrib/groff/devX75-12/HBI | 308 -
contrib/groff/devX75-12/HI | 308 -
contrib/groff/devX75-12/HR | 308 -
contrib/groff/devX75-12/Makefile.sub | 2 -
contrib/groff/devX75-12/NB | 308 -
contrib/groff/devX75-12/NBI | 308 -
contrib/groff/devX75-12/NI | 308 -
contrib/groff/devX75-12/NR | 308 -
contrib/groff/devX75-12/S | 226 -
contrib/groff/devX75-12/TB | 308 -
contrib/groff/devX75-12/TBI | 308 -
contrib/groff/devX75-12/TI | 308 -
contrib/groff/devX75-12/TR | 308 -
contrib/groff/devX75/CB | 308 -
contrib/groff/devX75/CBI | 308 -
contrib/groff/devX75/CI | 308 -
contrib/groff/devX75/CR | 308 -
contrib/groff/devX75/DESC | 9 -
contrib/groff/devX75/HB | 308 -
contrib/groff/devX75/HBI | 308 -
contrib/groff/devX75/HI | 308 -
contrib/groff/devX75/HR | 308 -
contrib/groff/devX75/Makefile.sub | 2 -
contrib/groff/devX75/NB | 308 -
contrib/groff/devX75/NBI | 308 -
contrib/groff/devX75/NI | 308 -
contrib/groff/devX75/NR | 308 -
contrib/groff/devX75/S | 226 -
contrib/groff/devX75/TB | 308 -
contrib/groff/devX75/TBI | 308 -
contrib/groff/devX75/TI | 308 -
contrib/groff/devX75/TR | 308 -
contrib/groff/devascii/DESC.proto | 8 -
contrib/groff/devascii/Makefile.sub | 31 -
contrib/groff/devascii/R.proto | 167 -
contrib/groff/devcp1047/DESC.proto | 8 -
contrib/groff/devcp1047/Makefile.sub | 32 -
contrib/groff/devcp1047/R.proto | 356 --
contrib/groff/devdvi/B | 358 --
contrib/groff/devdvi/BI | 365 --
contrib/groff/devdvi/CW | 160 -
contrib/groff/devdvi/CWI | 160 -
contrib/groff/devdvi/DESC.in | 10 -
contrib/groff/devdvi/EX | 144 -
contrib/groff/devdvi/H | 307 -
contrib/groff/devdvi/HB | 307 -
contrib/groff/devdvi/HI | 308 -
contrib/groff/devdvi/I | 366 --
contrib/groff/devdvi/MI | 136 -
contrib/groff/devdvi/Makefile.sub | 11 -
contrib/groff/devdvi/R | 441 --
contrib/groff/devdvi/S | 153 -
contrib/groff/devdvi/SA | 143 -
contrib/groff/devdvi/SB | 132 -
contrib/groff/devdvi/generate/CompileFonts | 15 -
contrib/groff/devdvi/generate/Makefile | 107 -
contrib/groff/devdvi/generate/cork.map | 206 -
contrib/groff/devdvi/generate/msam.map | 127 -
contrib/groff/devdvi/generate/msbm.map | 121 -
contrib/groff/devdvi/generate/texb.map | 127 -
contrib/groff/devdvi/generate/texex.map | 100 -
contrib/groff/devdvi/generate/texi.map | 127 -
contrib/groff/devdvi/generate/texmi.map | 32 -
contrib/groff/devdvi/generate/texr.map | 127 -
contrib/groff/devdvi/generate/texsy.map | 100 -
contrib/groff/devdvi/generate/textt.map | 126 -
contrib/groff/devhtml/CB | 308 -
contrib/groff/devhtml/CBI | 308 -
contrib/groff/devhtml/CI | 308 -
contrib/groff/devhtml/CR | 308 -
contrib/groff/devhtml/DESC | 12 -
contrib/groff/devhtml/HB | 308 -
contrib/groff/devhtml/HBI | 308 -
contrib/groff/devhtml/HI | 308 -
contrib/groff/devhtml/HR | 308 -
contrib/groff/devhtml/Makefile.sub | 2 -
contrib/groff/devhtml/NB | 308 -
contrib/groff/devhtml/NBI | 308 -
contrib/groff/devhtml/NI | 308 -
contrib/groff/devhtml/NR | 308 -
contrib/groff/devhtml/S | 226 -
contrib/groff/devhtml/TB | 308 -
contrib/groff/devhtml/TBI | 308 -
contrib/groff/devhtml/TI | 308 -
contrib/groff/devhtml/TR | 308 -
contrib/groff/devlatin1/DESC.proto | 8 -
contrib/groff/devlatin1/Makefile.sub | 32 -
contrib/groff/devlatin1/R.proto | 357 --
contrib/groff/devlbp/CB | 272 -
contrib/groff/devlbp/CI | 272 -
contrib/groff/devlbp/CR | 272 -
contrib/groff/devlbp/DESC.in | 9 -
contrib/groff/devlbp/EB | 272 -
contrib/groff/devlbp/EI | 272 -
contrib/groff/devlbp/ER | 272 -
contrib/groff/devlbp/HB | 491 --
contrib/groff/devlbp/HBI | 492 --
contrib/groff/devlbp/HI | 492 --
contrib/groff/devlbp/HNB | 491 --
contrib/groff/devlbp/HNBI | 491 --
contrib/groff/devlbp/HNI | 491 --
contrib/groff/devlbp/HNR | 491 --
contrib/groff/devlbp/HR | 491 --
contrib/groff/devlbp/Makefile.sub | 16 -
contrib/groff/devlbp/TB | 513 --
contrib/groff/devlbp/TBI | 493 --
contrib/groff/devlbp/TI | 521 --
contrib/groff/devlbp/TR | 517 --
contrib/groff/devlj4/ALBB | 790 ---
contrib/groff/devlj4/ALBR | 805 ---
contrib/groff/devlj4/AOB | 748 ---
contrib/groff/devlj4/AOI | 813 ---
contrib/groff/devlj4/AOR | 735 ---
contrib/groff/devlj4/CB | 350 --
contrib/groff/devlj4/CBI | 351 --
contrib/groff/devlj4/CI | 351 --
contrib/groff/devlj4/CLARENDON | 351 --
contrib/groff/devlj4/CORONET | 351 --
contrib/groff/devlj4/CR | 350 --
contrib/groff/devlj4/DESC.in | 9 -
contrib/groff/devlj4/GB | 749 ---
contrib/groff/devlj4/GBI | 752 ---
contrib/groff/devlj4/GI | 686 --
contrib/groff/devlj4/GR | 872 ---
contrib/groff/devlj4/LGB | 350 --
contrib/groff/devlj4/LGI | 351 --
contrib/groff/devlj4/LGR | 350 --
contrib/groff/devlj4/MARIGOLD | 351 --
contrib/groff/devlj4/Makefile.sub | 33 -
contrib/groff/devlj4/OB | 817 ---
contrib/groff/devlj4/OBI | 810 ---
contrib/groff/devlj4/OI | 923 ---
contrib/groff/devlj4/OR | 899 ---
contrib/groff/devlj4/S | 195 -
contrib/groff/devlj4/TB | 991 ---
contrib/groff/devlj4/TBI | 1045 ----
contrib/groff/devlj4/TI | 1131 ----
contrib/groff/devlj4/TR | 878 ---
contrib/groff/devlj4/UB | 829 ---
contrib/groff/devlj4/UBI | 779 ---
contrib/groff/devlj4/UCB | 790 ---
contrib/groff/devlj4/UCBI | 698 ---
contrib/groff/devlj4/UCI | 840 ---
contrib/groff/devlj4/UCR | 759 ---
contrib/groff/devlj4/UI | 983 ---
contrib/groff/devlj4/UR | 880 ---
contrib/groff/devlj4/generate/Makefile | 170 -
contrib/groff/devlj4/generate/special.map | 178 -
contrib/groff/devlj4/generate/text.map | 344 -
contrib/groff/devps/AB | 574 --
contrib/groff/devps/ABI | 575 --
contrib/groff/devps/AI | 575 --
contrib/groff/devps/AR | 574 --
contrib/groff/devps/BMB | 441 --
contrib/groff/devps/BMBI | 444 --
contrib/groff/devps/BMI | 437 --
contrib/groff/devps/BMR | 433 --
contrib/groff/devps/CB | 339 -
contrib/groff/devps/CBI | 340 -
contrib/groff/devps/CI | 340 -
contrib/groff/devps/CR | 339 -
contrib/groff/devps/DESC.in | 11 -
contrib/groff/devps/HB | 561 --
contrib/groff/devps/HBI | 562 --
contrib/groff/devps/HI | 630 --
contrib/groff/devps/HNB | 561 --
contrib/groff/devps/HNBI | 562 --
contrib/groff/devps/HNI | 630 --
contrib/groff/devps/HNR | 629 --
contrib/groff/devps/HR | 629 --
contrib/groff/devps/Makefile.sub | 35 -
contrib/groff/devps/NB | 473 --
contrib/groff/devps/NBI | 594 --
contrib/groff/devps/NI | 535 --
contrib/groff/devps/NR | 522 --
contrib/groff/devps/PB | 461 --
contrib/groff/devps/PBI | 463 --
contrib/groff/devps/PI | 465 --
contrib/groff/devps/PR | 466 --
contrib/groff/devps/S | 227 -
contrib/groff/devps/SS | 194 -
contrib/groff/devps/TB | 548 --
contrib/groff/devps/TBI | 531 --
contrib/groff/devps/TI | 544 --
contrib/groff/devps/TR | 536 --
contrib/groff/devps/ZCMI | 494 --
contrib/groff/devps/ZD | 193 -
contrib/groff/devps/ZDR | 193 -
contrib/groff/devps/download | 5 -
contrib/groff/devps/generate/Makefile | 223 -
contrib/groff/devps/generate/afmname | 44 -
contrib/groff/devps/generate/dingbatsmap | 2 -
contrib/groff/devps/generate/dingbatsrmap | 1 -
contrib/groff/devps/generate/lgreekmap | 28 -
contrib/groff/devps/generate/symbol.sed | 33 -
contrib/groff/devps/generate/symbolchars | 60 -
contrib/groff/devps/generate/symbolsl.afm | 203 -
contrib/groff/devps/generate/textmap | 453 --
contrib/groff/devps/prologue.ps | 228 -
contrib/groff/devps/psstrip.sed | 7 -
contrib/groff/devps/symbol.afm | 212 -
contrib/groff/devps/symbolmap | 513 --
contrib/groff/devps/symbolsl.ps | 41 -
contrib/groff/devps/text.enc | 231 -
contrib/groff/devps/zapfdr.afm | 222 -
contrib/groff/devps/zapfdr.ps | 225 -
contrib/groff/devutf8/DESC.proto | 8 -
contrib/groff/devutf8/Makefile.sub | 32 -
contrib/groff/devutf8/NOTES | 92 -
contrib/groff/devutf8/R.proto | 471 --
contrib/groff/eqn/Makefile.dep | 31 -
contrib/groff/eqn/Makefile.sub | 57 -
contrib/groff/eqn/TODO | 49 -
contrib/groff/eqn/box.cc | 611 --
contrib/groff/eqn/box.h | 277 -
contrib/groff/eqn/delim.cc | 381 --
contrib/groff/eqn/eqn.cc | 1277 ----
contrib/groff/eqn/eqn.h | 51 -
contrib/groff/eqn/eqn.man | 877 ---
contrib/groff/eqn/eqn.tab.h | 67 -
contrib/groff/eqn/eqn.y | 331 -
contrib/groff/eqn/eqn_tab.h | 67 -
contrib/groff/eqn/lex.cc | 1165 ----
contrib/groff/eqn/limit.cc | 195 -
contrib/groff/eqn/list.cc | 237 -
contrib/groff/eqn/main.cc | 358 --
contrib/groff/eqn/mark.cc | 121 -
contrib/groff/eqn/neqn.sh | 5 -
contrib/groff/eqn/other.cc | 601 --
contrib/groff/eqn/over.cc | 196 -
contrib/groff/eqn/pbox.h | 141 -
contrib/groff/eqn/pile.cc | 293 -
contrib/groff/eqn/script.cc | 221 -
contrib/groff/eqn/special.cc | 115 -
contrib/groff/eqn/sqrt.cc | 179 -
contrib/groff/eqn/text.cc | 528 --
contrib/groff/grn/Makefile.sub | 17 -
contrib/groff/grn/README | 60 -
contrib/groff/grn/gprint.h | 84 -
contrib/groff/grn/grn.man | 634 --
contrib/groff/grn/hdb.cc | 326 -
contrib/groff/grn/hgraph.cc | 1043 ----
contrib/groff/grn/hpoint.cc | 49 -
contrib/groff/grn/main.cc | 901 ---
contrib/groff/grodvi/Makefile.dep | 3 -
contrib/groff/grodvi/Makefile.sub | 6 -
contrib/groff/grodvi/dvi.cc | 900 ---
contrib/groff/grodvi/grodvi.man | 174 -
contrib/groff/groff/Makefile.dep | 5 -
contrib/groff/groff/Makefile.sub | 8 -
contrib/groff/groff/groff.cc | 647 --
contrib/groff/groff/groff.man | 465 --
contrib/groff/groff/pipeline.c | 421 --
contrib/groff/groff/pipeline.h | 30 -
contrib/groff/grog/Makefile.sub | 24 -
contrib/groff/grog/grog.man | 78 -
contrib/groff/grog/grog.pl | 167 -
contrib/groff/grog/grog.sh | 82 -
contrib/groff/grohtml/ChangeLog | 247 -
contrib/groff/grohtml/Makefile.dep | 3 -
contrib/groff/grohtml/Makefile.sub | 10 -
contrib/groff/grohtml/TODO | 294 -
contrib/groff/grohtml/design.ms | 129 -
contrib/groff/grohtml/grohtml.man | 187 -
contrib/groff/grohtml/html.cc | 6591 --------------------
contrib/groff/grohtml/html.h | 57 -
contrib/groff/grohtml/html_chars.h | 27 -
contrib/groff/grohtml/ordered_list.h | 193 -
contrib/groff/grohtml/output.cc | 257 -
contrib/groff/grolbp/Makefile.sub | 6 -
contrib/groff/grolbp/charset.h | 69 -
contrib/groff/grolbp/grolbp.man | 353 --
contrib/groff/grolbp/lbp.cc | 772 ---
contrib/groff/grolbp/lbp.h | 512 --
contrib/groff/grolj4/Makefile.dep | 3 -
contrib/groff/grolj4/Makefile.sub | 6 -
contrib/groff/grolj4/grolj4.man | 144 -
contrib/groff/grolj4/lj4.cc | 700 ---
contrib/groff/grops/Makefile.dep | 6 -
contrib/groff/grops/Makefile.sub | 12 -
contrib/groff/grops/TODO | 29 -
contrib/groff/grops/grops.man | 842 ---
contrib/groff/grops/ps.cc | 1541 -----
contrib/groff/grops/ps.h | 122 -
contrib/groff/grops/psfig.diff | 106 -
contrib/groff/grops/psrm.cc | 1103 ----
contrib/groff/grotty/Makefile.dep | 3 -
contrib/groff/grotty/Makefile.sub | 6 -
contrib/groff/grotty/TODO | 3 -
contrib/groff/grotty/grotty.man | 260 -
contrib/groff/grotty/tty.cc | 474 --
contrib/groff/hpftodit/Makefile.dep | 3 -
contrib/groff/hpftodit/Makefile.sub | 6 -
contrib/groff/hpftodit/hpftodit.cc | 812 ---
contrib/groff/hpftodit/hpftodit.man | 155 -
contrib/groff/include/Makefile.sub | 41 -
contrib/groff/include/assert.h | 39 -
contrib/groff/include/cmap.h | 56 -
contrib/groff/include/cset.h | 75 -
contrib/groff/include/device.h | 21 -
contrib/groff/include/driver.h | 39 -
contrib/groff/include/errarg.h | 46 -
contrib/groff/include/error.h | 58 -
contrib/groff/include/font.h | 116 -
contrib/groff/include/getopt.h | 169 -
contrib/groff/include/groff-getopt.h | 68 -
contrib/groff/include/htmlindicate.h | 41 -
contrib/groff/include/index.h | 42 -
contrib/groff/include/lib.h | 114 -
contrib/groff/include/macropath.h | 21 -
contrib/groff/include/nonposix.h | 137 -
contrib/groff/include/posix.h | 51 -
contrib/groff/include/printer.h | 76 -
contrib/groff/include/ptable.h | 168 -
contrib/groff/include/refid.h | 35 -
contrib/groff/include/search.h | 96 -
contrib/groff/include/searchpath.h | 29 -
contrib/groff/include/stringclass.h | 195 -
contrib/groff/include/unix.h | 0
contrib/groff/indxbib/Makefile.dep | 6 -
contrib/groff/indxbib/Makefile.sub | 30 -
contrib/groff/indxbib/dirnamemax.c | 49 -
contrib/groff/indxbib/eign | 133 -
contrib/groff/indxbib/indxbib.cc | 794 ---
contrib/groff/indxbib/indxbib.man | 207 -
contrib/groff/indxbib/signal.c | 63 -
contrib/groff/libbib/Makefile.dep | 12 -
contrib/groff/libbib/Makefile.sub | 14 -
contrib/groff/libbib/common.cc | 38 -
contrib/groff/libbib/index.cc | 641 --
contrib/groff/libbib/linear.cc | 503 --
contrib/groff/libbib/map.c | 75 -
contrib/groff/libbib/search.cc | 132 -
contrib/groff/libdriver/Makefile.dep | 6 -
contrib/groff/libdriver/Makefile.sub | 7 -
contrib/groff/libdriver/input.cc | 501 --
contrib/groff/libdriver/printer.cc | 263 -
contrib/groff/libgroff/Makefile.dep | 39 -
contrib/groff/libgroff/Makefile.sub | 84 -
contrib/groff/libgroff/assert.cc | 34 -
contrib/groff/libgroff/change_lf.cc | 37 -
contrib/groff/libgroff/cmap.cc | 56 -
contrib/groff/libgroff/cset.cc | 102 -
contrib/groff/libgroff/device.cc | 36 -
contrib/groff/libgroff/errarg.cc | 118 -
contrib/groff/libgroff/error.cc | 137 -
contrib/groff/libgroff/fatal.cc | 27 -
contrib/groff/libgroff/filename.cc | 1 -
contrib/groff/libgroff/fmod.c | 28 -
contrib/groff/libgroff/font.cc | 938 ---
contrib/groff/libgroff/fontfile.cc | 66 -
contrib/groff/libgroff/getcwd.c | 38 -
contrib/groff/libgroff/getopt.c | 1055 ----
contrib/groff/libgroff/getopt1.c | 188 -
contrib/groff/libgroff/htmlindicate.cc | 67 -
contrib/groff/libgroff/iftoa.c | 65 -
contrib/groff/libgroff/illegal.cc | 41 -
contrib/groff/libgroff/itoa.c | 43 -
contrib/groff/libgroff/lf.cc | 62 -
contrib/groff/libgroff/lineno.cc | 1 -
contrib/groff/libgroff/macropath.cc | 28 -
contrib/groff/libgroff/matherr.c | 45 -
contrib/groff/libgroff/nametoindex.cc | 118 -
contrib/groff/libgroff/new.cc | 67 -
contrib/groff/libgroff/prime.cc | 26 -
contrib/groff/libgroff/progname.cc | 1 -
contrib/groff/libgroff/ptable.cc | 52 -
contrib/groff/libgroff/putenv.c | 95 -
contrib/groff/libgroff/searchpath.cc | 118 -
contrib/groff/libgroff/strerror.c | 41 -
contrib/groff/libgroff/string.cc | 311 -
contrib/groff/libgroff/strsave.cc | 31 -
contrib/groff/libgroff/strtol.c | 131 -
contrib/groff/libgroff/tmpfile.cc | 187 -
contrib/groff/lkbib/Makefile.dep | 3 -
contrib/groff/lkbib/Makefile.sub | 6 -
contrib/groff/lkbib/lkbib.cc | 124 -
contrib/groff/lkbib/lkbib.man | 110 -
contrib/groff/lookbib/Makefile.dep | 3 -
contrib/groff/lookbib/Makefile.sub | 7 -
contrib/groff/lookbib/lookbib.cc | 128 -
contrib/groff/lookbib/lookbib.man | 78 -
contrib/groff/mm/ChangeLog | 493 --
contrib/groff/mm/Makefile.sim | 66 -
contrib/groff/mm/Makefile.sub | 50 -
contrib/groff/mm/NOTES | 103 -
contrib/groff/mm/README | 28 -
contrib/groff/mm/examples/APP | 352 --
contrib/groff/mm/examples/B1B2 | 91 -
contrib/groff/mm/examples/COVER | 235 -
contrib/groff/mm/examples/IND | 4191 -------------
contrib/groff/mm/examples/LT | 1058 ----
contrib/groff/mm/examples/LT.se | 1062 ----
contrib/groff/mm/examples/ML | 169 -
contrib/groff/mm/examples/MOVE | 175 -
contrib/groff/mm/examples/MUL | 535 --
contrib/groff/mm/examples/NCOL | 196 -
contrib/groff/mm/examples/ND | 17 -
contrib/groff/mm/examples/README | 32 -
contrib/groff/mm/examples/References | 975 ---
contrib/groff/mm/examples/SETR | 109 -
contrib/groff/mm/groff_mm.man | 1895 ------
contrib/groff/mm/groff_mmse.man | 82 -
contrib/groff/mm/mm/0.MT | 146 -
contrib/groff/mm/mm/4.MT | 81 -
contrib/groff/mm/mm/5.MT | 34 -
contrib/groff/mm/mm/ms.cov | 84 -
contrib/groff/mm/mm/se_ms.cov | 3 -
contrib/groff/mm/mmroff.man | 48 -
contrib/groff/mm/mmroff.pl | 134 -
contrib/groff/mm/tmac.m | 3471 -----------
contrib/groff/mm/tmac.mse | 184 -
contrib/groff/nroff/Makefile.sub | 18 -
contrib/groff/nroff/nroff.man | 98 -
contrib/groff/nroff/nroff.sh | 85 -
contrib/groff/pfbtops/Makefile.dep | 1 -
contrib/groff/pfbtops/Makefile.sub | 6 -
contrib/groff/pfbtops/pfbtops.c | 118 -
contrib/groff/pfbtops/pfbtops.man | 44 -
contrib/groff/pic/Makefile.dep | 24 -
contrib/groff/pic/Makefile.sub | 31 -
contrib/groff/pic/TODO | 37 -
contrib/groff/pic/common.cc | 497 --
contrib/groff/pic/common.h | 70 -
contrib/groff/pic/depend | 21 -
contrib/groff/pic/lex.cc | 1939 ------
contrib/groff/pic/main.cc | 624 --
contrib/groff/pic/object.cc | 1833 ------
contrib/groff/pic/object.h | 217 -
contrib/groff/pic/output.h | 79 -
contrib/groff/pic/pic.cc | 5224 ----------------
contrib/groff/pic/pic.h | 104 -
contrib/groff/pic/pic.man | 883 ---
contrib/groff/pic/pic.tab.h | 129 -
contrib/groff/pic/pic.y | 1807 ------
contrib/groff/pic/pic_tab.h | 130 -
contrib/groff/pic/position.h | 47 -
contrib/groff/pic/tex.cc | 412 --
contrib/groff/pic/text.h | 28 -
contrib/groff/pic/troff.cc | 503 --
contrib/groff/psbb/Makefile.dep | 1 -
contrib/groff/psbb/Makefile.sub | 5 -
contrib/groff/psbb/psbb.c | 169 -
contrib/groff/psbb/psbb.man | 43 -
contrib/groff/refer/Makefile.dep | 17 -
contrib/groff/refer/Makefile.sub | 23 -
contrib/groff/refer/TODO | 124 -
contrib/groff/refer/command.cc | 807 ---
contrib/groff/refer/command.h | 36 -
contrib/groff/refer/label.cc | 1602 -----
contrib/groff/refer/label.y | 1177 ----
contrib/groff/refer/ref.cc | 1160 ----
contrib/groff/refer/ref.h | 120 -
contrib/groff/refer/refer.cc | 1228 ----
contrib/groff/refer/refer.h | 78 -
contrib/groff/refer/refer.man | 1302 ----
contrib/groff/refer/token.cc | 378 --
contrib/groff/refer/token.h | 88 -
contrib/groff/soelim/Makefile.dep | 2 -
contrib/groff/soelim/Makefile.sub | 6 -
contrib/groff/soelim/TODO | 1 -
contrib/groff/soelim/soelim.cc | 338 -
contrib/groff/soelim/soelim.man | 76 -
contrib/groff/tbl/Makefile.dep | 6 -
contrib/groff/tbl/Makefile.sub | 12 -
contrib/groff/tbl/main.cc | 1514 -----
contrib/groff/tbl/table.cc | 2778 ---------
contrib/groff/tbl/table.h | 152 -
contrib/groff/tbl/tbl.man | 178 -
contrib/groff/tfmtodit/Makefile.dep | 2 -
contrib/groff/tfmtodit/Makefile.sub | 6 -
contrib/groff/tfmtodit/tfmtodit.cc | 863 ---
contrib/groff/tfmtodit/tfmtodit.man | 175 -
contrib/groff/tmac/groff_markup.man | 319 -
contrib/groff/tmac/groff_mdoc.samples.man | 2925 ---------
contrib/groff/tmac/groff_msafer.man | 59 -
contrib/groff/tmac/me.man | 274 -
contrib/groff/tmac/mm.diff | 70 -
contrib/groff/tmac/msafer.man | 56 -
contrib/groff/tmac/tmac.X | 46 -
contrib/groff/tmac/tmac.Xps | 44 -
contrib/groff/tmac/tmac.a4 | 3 -
contrib/groff/tmac/tmac.an | 429 --
contrib/groff/tmac/tmac.andoc | 12 -
contrib/groff/tmac/tmac.arkup | 161 -
contrib/groff/tmac/tmac.doc | 3427 ----------
contrib/groff/tmac/tmac.dvi | 145 -
contrib/groff/tmac/tmac.e | 1661 -----
contrib/groff/tmac/tmac.html | 60 -
contrib/groff/tmac/tmac.latin1 | 101 -
contrib/groff/tmac/tmac.lbp | 13 -
contrib/groff/tmac/tmac.lj4 | 18 -
contrib/groff/tmac/tmac.man | 1 -
contrib/groff/tmac/tmac.mandoc | 1 -
contrib/groff/tmac/tmac.markup | 1 -
contrib/groff/tmac/tmac.mdoc | 1 -
contrib/groff/tmac/tmac.me | 1 -
contrib/groff/tmac/tmac.ms | 1 -
contrib/groff/tmac/tmac.pic | 10 -
contrib/groff/tmac/tmac.ps | 53 -
contrib/groff/tmac/tmac.psatk | 61 -
contrib/groff/tmac/tmac.psfig | 87 -
contrib/groff/tmac/tmac.psnew | 26 -
contrib/groff/tmac/tmac.psold | 60 -
contrib/groff/tmac/tmac.pspic | 50 -
contrib/groff/tmac/tmac.s | 1869 ------
contrib/groff/tmac/tmac.safer | 13 -
contrib/groff/tmac/tmac.trace | 10 -
contrib/groff/tmac/tmac.tty | 48 -
contrib/groff/tmac/tmac.tty-char | 202 -
contrib/groff/troff/Makefile.dep | 36 -
contrib/groff/troff/Makefile.sub | 57 -
contrib/groff/troff/TODO | 137 -
contrib/groff/troff/charinfo.h | 171 -
contrib/groff/troff/column.cc | 732 ---
contrib/groff/troff/dictionary.cc | 212 -
contrib/groff/troff/dictionary.h | 92 -
contrib/groff/troff/div.cc | 1127 ----
contrib/groff/troff/div.h | 150 -
contrib/groff/troff/env.cc | 3215 ----------
contrib/groff/troff/env.h | 334 -
contrib/groff/troff/hvunits.h | 340 -
contrib/groff/troff/hyphen.us | 4449 -------------
contrib/groff/troff/input.cc | 6406 -------------------
contrib/groff/troff/node.cc | 4920 ---------------
contrib/groff/troff/node.h | 495 --
contrib/groff/troff/number.cc | 669 --
contrib/groff/troff/reg.cc | 473 --
contrib/groff/troff/reg.h | 73 -
contrib/groff/troff/request.h | 79 -
contrib/groff/troff/symbol.cc | 150 -
contrib/groff/troff/symbol.h | 73 -
contrib/groff/troff/token.h | 201 -
contrib/groff/troff/troff.h | 83 -
contrib/groff/troff/troff.man | 2164 -------
contrib/groff/xditview/ChangeLog | 378 --
contrib/groff/xditview/DESC | 9 -
contrib/groff/xditview/Dvi.c | 573 --
contrib/groff/xditview/Dvi.h | 46 -
contrib/groff/xditview/DviChar.c | 664 --
contrib/groff/xditview/DviChar.h | 37 -
contrib/groff/xditview/DviP.h | 233 -
contrib/groff/xditview/FontMap | 17 -
contrib/groff/xditview/GXditview-ad.h | 52 -
contrib/groff/xditview/GXditview.ad | 57 -
contrib/groff/xditview/INSTALL | 20 -
contrib/groff/xditview/Imakefile | 55 -
contrib/groff/xditview/Imakefile.in | 99 -
contrib/groff/xditview/Makefile | 639 --
contrib/groff/xditview/Menu.h | 46 -
contrib/groff/xditview/README | 14 -
contrib/groff/xditview/TODO | 17 -
contrib/groff/xditview/XFontName.c | 256 -
contrib/groff/xditview/XFontName.h | 45 -
contrib/groff/xditview/ad2c | 62 -
contrib/groff/xditview/device.c | 594 --
contrib/groff/xditview/device.h | 21 -
contrib/groff/xditview/draw.c | 721 ---
contrib/groff/xditview/font.c | 471 --
contrib/groff/xditview/gray1.bm | 4 -
contrib/groff/xditview/gray2.bm | 4 -
contrib/groff/xditview/gray3.bm | 4 -
contrib/groff/xditview/gray4.bm | 4 -
contrib/groff/xditview/gray5.bm | 4 -
contrib/groff/xditview/gray6.bm | 4 -
contrib/groff/xditview/gray7.bm | 4 -
contrib/groff/xditview/gray8.bm | 4 -
contrib/groff/xditview/gxditview.man | 246 -
contrib/groff/xditview/lex.c | 103 -
contrib/groff/xditview/page.c | 88 -
contrib/groff/xditview/parse.c | 334 -
contrib/groff/xditview/xdit.bm | 14 -
contrib/groff/xditview/xdit_mask.bm | 14 -
contrib/groff/xditview/xditview.c | 594 --
contrib/groff/xditview/xtotroff.c | 311 -
628 files changed, 219491 deletions(-)
delete mode 100644 contrib/groff/addftinfo/Makefile.dep
delete mode 100644 contrib/groff/addftinfo/Makefile.sub
delete mode 100644 contrib/groff/addftinfo/addftinfo.cc
delete mode 100644 contrib/groff/addftinfo/addftinfo.man
delete mode 100644 contrib/groff/addftinfo/guess.cc
delete mode 100644 contrib/groff/addftinfo/guess.h
delete mode 100644 contrib/groff/afmtodit/Makefile.sub
delete mode 100644 contrib/groff/afmtodit/afmtodit.man
delete mode 100644 contrib/groff/afmtodit/afmtodit.pl
delete mode 100644 contrib/groff/devX100-12/CB
delete mode 100644 contrib/groff/devX100-12/CBI
delete mode 100644 contrib/groff/devX100-12/CI
delete mode 100644 contrib/groff/devX100-12/CR
delete mode 100644 contrib/groff/devX100-12/DESC
delete mode 100644 contrib/groff/devX100-12/HB
delete mode 100644 contrib/groff/devX100-12/HBI
delete mode 100644 contrib/groff/devX100-12/HI
delete mode 100644 contrib/groff/devX100-12/HR
delete mode 100644 contrib/groff/devX100-12/Makefile.sub
delete mode 100644 contrib/groff/devX100-12/NB
delete mode 100644 contrib/groff/devX100-12/NBI
delete mode 100644 contrib/groff/devX100-12/NI
delete mode 100644 contrib/groff/devX100-12/NR
delete mode 100644 contrib/groff/devX100-12/S
delete mode 100644 contrib/groff/devX100-12/TB
delete mode 100644 contrib/groff/devX100-12/TBI
delete mode 100644 contrib/groff/devX100-12/TI
delete mode 100644 contrib/groff/devX100-12/TR
delete mode 100644 contrib/groff/devX100/CB
delete mode 100644 contrib/groff/devX100/CBI
delete mode 100644 contrib/groff/devX100/CI
delete mode 100644 contrib/groff/devX100/CR
delete mode 100644 contrib/groff/devX100/DESC
delete mode 100644 contrib/groff/devX100/HB
delete mode 100644 contrib/groff/devX100/HBI
delete mode 100644 contrib/groff/devX100/HI
delete mode 100644 contrib/groff/devX100/HR
delete mode 100644 contrib/groff/devX100/Makefile.sub
delete mode 100644 contrib/groff/devX100/NB
delete mode 100644 contrib/groff/devX100/NBI
delete mode 100644 contrib/groff/devX100/NI
delete mode 100644 contrib/groff/devX100/NR
delete mode 100644 contrib/groff/devX100/S
delete mode 100644 contrib/groff/devX100/TB
delete mode 100644 contrib/groff/devX100/TBI
delete mode 100644 contrib/groff/devX100/TI
delete mode 100644 contrib/groff/devX100/TR
delete mode 100644 contrib/groff/devX75-12/CB
delete mode 100644 contrib/groff/devX75-12/CBI
delete mode 100644 contrib/groff/devX75-12/CI
delete mode 100644 contrib/groff/devX75-12/CR
delete mode 100644 contrib/groff/devX75-12/DESC
delete mode 100644 contrib/groff/devX75-12/HB
delete mode 100644 contrib/groff/devX75-12/HBI
delete mode 100644 contrib/groff/devX75-12/HI
delete mode 100644 contrib/groff/devX75-12/HR
delete mode 100644 contrib/groff/devX75-12/Makefile.sub
delete mode 100644 contrib/groff/devX75-12/NB
delete mode 100644 contrib/groff/devX75-12/NBI
delete mode 100644 contrib/groff/devX75-12/NI
delete mode 100644 contrib/groff/devX75-12/NR
delete mode 100644 contrib/groff/devX75-12/S
delete mode 100644 contrib/groff/devX75-12/TB
delete mode 100644 contrib/groff/devX75-12/TBI
delete mode 100644 contrib/groff/devX75-12/TI
delete mode 100644 contrib/groff/devX75-12/TR
delete mode 100644 contrib/groff/devX75/CB
delete mode 100644 contrib/groff/devX75/CBI
delete mode 100644 contrib/groff/devX75/CI
delete mode 100644 contrib/groff/devX75/CR
delete mode 100644 contrib/groff/devX75/DESC
delete mode 100644 contrib/groff/devX75/HB
delete mode 100644 contrib/groff/devX75/HBI
delete mode 100644 contrib/groff/devX75/HI
delete mode 100644 contrib/groff/devX75/HR
delete mode 100644 contrib/groff/devX75/Makefile.sub
delete mode 100644 contrib/groff/devX75/NB
delete mode 100644 contrib/groff/devX75/NBI
delete mode 100644 contrib/groff/devX75/NI
delete mode 100644 contrib/groff/devX75/NR
delete mode 100644 contrib/groff/devX75/S
delete mode 100644 contrib/groff/devX75/TB
delete mode 100644 contrib/groff/devX75/TBI
delete mode 100644 contrib/groff/devX75/TI
delete mode 100644 contrib/groff/devX75/TR
delete mode 100644 contrib/groff/devascii/DESC.proto
delete mode 100644 contrib/groff/devascii/Makefile.sub
delete mode 100644 contrib/groff/devascii/R.proto
delete mode 100644 contrib/groff/devcp1047/DESC.proto
delete mode 100644 contrib/groff/devcp1047/Makefile.sub
delete mode 100644 contrib/groff/devcp1047/R.proto
delete mode 100644 contrib/groff/devdvi/B
delete mode 100644 contrib/groff/devdvi/BI
delete mode 100644 contrib/groff/devdvi/CW
delete mode 100644 contrib/groff/devdvi/CWI
delete mode 100644 contrib/groff/devdvi/DESC.in
delete mode 100644 contrib/groff/devdvi/EX
delete mode 100644 contrib/groff/devdvi/H
delete mode 100644 contrib/groff/devdvi/HB
delete mode 100644 contrib/groff/devdvi/HI
delete mode 100644 contrib/groff/devdvi/I
delete mode 100644 contrib/groff/devdvi/MI
delete mode 100644 contrib/groff/devdvi/Makefile.sub
delete mode 100644 contrib/groff/devdvi/R
delete mode 100644 contrib/groff/devdvi/S
delete mode 100644 contrib/groff/devdvi/SA
delete mode 100644 contrib/groff/devdvi/SB
delete mode 100755 contrib/groff/devdvi/generate/CompileFonts
delete mode 100644 contrib/groff/devdvi/generate/Makefile
delete mode 100644 contrib/groff/devdvi/generate/cork.map
delete mode 100644 contrib/groff/devdvi/generate/msam.map
delete mode 100644 contrib/groff/devdvi/generate/msbm.map
delete mode 100644 contrib/groff/devdvi/generate/texb.map
delete mode 100644 contrib/groff/devdvi/generate/texex.map
delete mode 100644 contrib/groff/devdvi/generate/texi.map
delete mode 100644 contrib/groff/devdvi/generate/texmi.map
delete mode 100644 contrib/groff/devdvi/generate/texr.map
delete mode 100644 contrib/groff/devdvi/generate/texsy.map
delete mode 100644 contrib/groff/devdvi/generate/textt.map
delete mode 100644 contrib/groff/devhtml/CB
delete mode 100644 contrib/groff/devhtml/CBI
delete mode 100644 contrib/groff/devhtml/CI
delete mode 100644 contrib/groff/devhtml/CR
delete mode 100644 contrib/groff/devhtml/DESC
delete mode 100644 contrib/groff/devhtml/HB
delete mode 100644 contrib/groff/devhtml/HBI
delete mode 100644 contrib/groff/devhtml/HI
delete mode 100644 contrib/groff/devhtml/HR
delete mode 100644 contrib/groff/devhtml/Makefile.sub
delete mode 100644 contrib/groff/devhtml/NB
delete mode 100644 contrib/groff/devhtml/NBI
delete mode 100644 contrib/groff/devhtml/NI
delete mode 100644 contrib/groff/devhtml/NR
delete mode 100644 contrib/groff/devhtml/S
delete mode 100644 contrib/groff/devhtml/TB
delete mode 100644 contrib/groff/devhtml/TBI
delete mode 100644 contrib/groff/devhtml/TI
delete mode 100644 contrib/groff/devhtml/TR
delete mode 100644 contrib/groff/devlatin1/DESC.proto
delete mode 100644 contrib/groff/devlatin1/Makefile.sub
delete mode 100644 contrib/groff/devlatin1/R.proto
delete mode 100644 contrib/groff/devlbp/CB
delete mode 100644 contrib/groff/devlbp/CI
delete mode 100644 contrib/groff/devlbp/CR
delete mode 100644 contrib/groff/devlbp/DESC.in
delete mode 100644 contrib/groff/devlbp/EB
delete mode 100644 contrib/groff/devlbp/EI
delete mode 100644 contrib/groff/devlbp/ER
delete mode 100644 contrib/groff/devlbp/HB
delete mode 100644 contrib/groff/devlbp/HBI
delete mode 100644 contrib/groff/devlbp/HI
delete mode 100644 contrib/groff/devlbp/HNB
delete mode 100644 contrib/groff/devlbp/HNBI
delete mode 100644 contrib/groff/devlbp/HNI
delete mode 100644 contrib/groff/devlbp/HNR
delete mode 100644 contrib/groff/devlbp/HR
delete mode 100644 contrib/groff/devlbp/Makefile.sub
delete mode 100644 contrib/groff/devlbp/TB
delete mode 100644 contrib/groff/devlbp/TBI
delete mode 100644 contrib/groff/devlbp/TI
delete mode 100644 contrib/groff/devlbp/TR
delete mode 100644 contrib/groff/devlj4/ALBB
delete mode 100644 contrib/groff/devlj4/ALBR
delete mode 100644 contrib/groff/devlj4/AOB
delete mode 100644 contrib/groff/devlj4/AOI
delete mode 100644 contrib/groff/devlj4/AOR
delete mode 100644 contrib/groff/devlj4/CB
delete mode 100644 contrib/groff/devlj4/CBI
delete mode 100644 contrib/groff/devlj4/CI
delete mode 100644 contrib/groff/devlj4/CLARENDON
delete mode 100644 contrib/groff/devlj4/CORONET
delete mode 100644 contrib/groff/devlj4/CR
delete mode 100644 contrib/groff/devlj4/DESC.in
delete mode 100644 contrib/groff/devlj4/GB
delete mode 100644 contrib/groff/devlj4/GBI
delete mode 100644 contrib/groff/devlj4/GI
delete mode 100644 contrib/groff/devlj4/GR
delete mode 100644 contrib/groff/devlj4/LGB
delete mode 100644 contrib/groff/devlj4/LGI
delete mode 100644 contrib/groff/devlj4/LGR
delete mode 100644 contrib/groff/devlj4/MARIGOLD
delete mode 100644 contrib/groff/devlj4/Makefile.sub
delete mode 100644 contrib/groff/devlj4/OB
delete mode 100644 contrib/groff/devlj4/OBI
delete mode 100644 contrib/groff/devlj4/OI
delete mode 100644 contrib/groff/devlj4/OR
delete mode 100644 contrib/groff/devlj4/S
delete mode 100644 contrib/groff/devlj4/TB
delete mode 100644 contrib/groff/devlj4/TBI
delete mode 100644 contrib/groff/devlj4/TI
delete mode 100644 contrib/groff/devlj4/TR
delete mode 100644 contrib/groff/devlj4/UB
delete mode 100644 contrib/groff/devlj4/UBI
delete mode 100644 contrib/groff/devlj4/UCB
delete mode 100644 contrib/groff/devlj4/UCBI
delete mode 100644 contrib/groff/devlj4/UCI
delete mode 100644 contrib/groff/devlj4/UCR
delete mode 100644 contrib/groff/devlj4/UI
delete mode 100644 contrib/groff/devlj4/UR
delete mode 100644 contrib/groff/devlj4/generate/Makefile
delete mode 100644 contrib/groff/devlj4/generate/special.map
delete mode 100644 contrib/groff/devlj4/generate/text.map
delete mode 100644 contrib/groff/devps/AB
delete mode 100644 contrib/groff/devps/ABI
delete mode 100644 contrib/groff/devps/AI
delete mode 100644 contrib/groff/devps/AR
delete mode 100644 contrib/groff/devps/BMB
delete mode 100644 contrib/groff/devps/BMBI
delete mode 100644 contrib/groff/devps/BMI
delete mode 100644 contrib/groff/devps/BMR
delete mode 100644 contrib/groff/devps/CB
delete mode 100644 contrib/groff/devps/CBI
delete mode 100644 contrib/groff/devps/CI
delete mode 100644 contrib/groff/devps/CR
delete mode 100644 contrib/groff/devps/DESC.in
delete mode 100644 contrib/groff/devps/HB
delete mode 100644 contrib/groff/devps/HBI
delete mode 100644 contrib/groff/devps/HI
delete mode 100644 contrib/groff/devps/HNB
delete mode 100644 contrib/groff/devps/HNBI
delete mode 100644 contrib/groff/devps/HNI
delete mode 100644 contrib/groff/devps/HNR
delete mode 100644 contrib/groff/devps/HR
delete mode 100644 contrib/groff/devps/Makefile.sub
delete mode 100644 contrib/groff/devps/NB
delete mode 100644 contrib/groff/devps/NBI
delete mode 100644 contrib/groff/devps/NI
delete mode 100644 contrib/groff/devps/NR
delete mode 100644 contrib/groff/devps/PB
delete mode 100644 contrib/groff/devps/PBI
delete mode 100644 contrib/groff/devps/PI
delete mode 100644 contrib/groff/devps/PR
delete mode 100644 contrib/groff/devps/S
delete mode 100644 contrib/groff/devps/SS
delete mode 100644 contrib/groff/devps/TB
delete mode 100644 contrib/groff/devps/TBI
delete mode 100644 contrib/groff/devps/TI
delete mode 100644 contrib/groff/devps/TR
delete mode 100644 contrib/groff/devps/ZCMI
delete mode 100644 contrib/groff/devps/ZD
delete mode 100644 contrib/groff/devps/ZDR
delete mode 100644 contrib/groff/devps/download
delete mode 100644 contrib/groff/devps/generate/Makefile
delete mode 100755 contrib/groff/devps/generate/afmname
delete mode 100644 contrib/groff/devps/generate/dingbatsmap
delete mode 100644 contrib/groff/devps/generate/dingbatsrmap
delete mode 100644 contrib/groff/devps/generate/lgreekmap
delete mode 100644 contrib/groff/devps/generate/symbol.sed
delete mode 100644 contrib/groff/devps/generate/symbolchars
delete mode 100644 contrib/groff/devps/generate/symbolsl.afm
delete mode 100644 contrib/groff/devps/generate/textmap
delete mode 100644 contrib/groff/devps/prologue.ps
delete mode 100644 contrib/groff/devps/psstrip.sed
delete mode 100644 contrib/groff/devps/symbol.afm
delete mode 100644 contrib/groff/devps/symbolmap
delete mode 100644 contrib/groff/devps/symbolsl.ps
delete mode 100644 contrib/groff/devps/text.enc
delete mode 100644 contrib/groff/devps/zapfdr.afm
delete mode 100644 contrib/groff/devps/zapfdr.ps
delete mode 100644 contrib/groff/devutf8/DESC.proto
delete mode 100644 contrib/groff/devutf8/Makefile.sub
delete mode 100644 contrib/groff/devutf8/NOTES
delete mode 100644 contrib/groff/devutf8/R.proto
delete mode 100644 contrib/groff/eqn/Makefile.dep
delete mode 100644 contrib/groff/eqn/Makefile.sub
delete mode 100644 contrib/groff/eqn/TODO
delete mode 100644 contrib/groff/eqn/box.cc
delete mode 100644 contrib/groff/eqn/box.h
delete mode 100644 contrib/groff/eqn/delim.cc
delete mode 100644 contrib/groff/eqn/eqn.cc
delete mode 100644 contrib/groff/eqn/eqn.h
delete mode 100644 contrib/groff/eqn/eqn.man
delete mode 100644 contrib/groff/eqn/eqn.tab.h
delete mode 100644 contrib/groff/eqn/eqn.y
delete mode 100644 contrib/groff/eqn/eqn_tab.h
delete mode 100644 contrib/groff/eqn/lex.cc
delete mode 100644 contrib/groff/eqn/limit.cc
delete mode 100644 contrib/groff/eqn/list.cc
delete mode 100644 contrib/groff/eqn/main.cc
delete mode 100644 contrib/groff/eqn/mark.cc
delete mode 100644 contrib/groff/eqn/neqn.sh
delete mode 100644 contrib/groff/eqn/other.cc
delete mode 100644 contrib/groff/eqn/over.cc
delete mode 100644 contrib/groff/eqn/pbox.h
delete mode 100644 contrib/groff/eqn/pile.cc
delete mode 100644 contrib/groff/eqn/script.cc
delete mode 100644 contrib/groff/eqn/special.cc
delete mode 100644 contrib/groff/eqn/sqrt.cc
delete mode 100644 contrib/groff/eqn/text.cc
delete mode 100644 contrib/groff/grn/Makefile.sub
delete mode 100644 contrib/groff/grn/README
delete mode 100644 contrib/groff/grn/gprint.h
delete mode 100644 contrib/groff/grn/grn.man
delete mode 100644 contrib/groff/grn/hdb.cc
delete mode 100644 contrib/groff/grn/hgraph.cc
delete mode 100644 contrib/groff/grn/hpoint.cc
delete mode 100644 contrib/groff/grn/main.cc
delete mode 100644 contrib/groff/grodvi/Makefile.dep
delete mode 100644 contrib/groff/grodvi/Makefile.sub
delete mode 100644 contrib/groff/grodvi/dvi.cc
delete mode 100644 contrib/groff/grodvi/grodvi.man
delete mode 100644 contrib/groff/groff/Makefile.dep
delete mode 100644 contrib/groff/groff/Makefile.sub
delete mode 100644 contrib/groff/groff/groff.cc
delete mode 100644 contrib/groff/groff/groff.man
delete mode 100644 contrib/groff/groff/pipeline.c
delete mode 100644 contrib/groff/groff/pipeline.h
delete mode 100644 contrib/groff/grog/Makefile.sub
delete mode 100644 contrib/groff/grog/grog.man
delete mode 100644 contrib/groff/grog/grog.pl
delete mode 100644 contrib/groff/grog/grog.sh
delete mode 100644 contrib/groff/grohtml/ChangeLog
delete mode 100644 contrib/groff/grohtml/Makefile.dep
delete mode 100644 contrib/groff/grohtml/Makefile.sub
delete mode 100644 contrib/groff/grohtml/TODO
delete mode 100644 contrib/groff/grohtml/design.ms
delete mode 100644 contrib/groff/grohtml/grohtml.man
delete mode 100644 contrib/groff/grohtml/html.cc
delete mode 100644 contrib/groff/grohtml/html.h
delete mode 100644 contrib/groff/grohtml/html_chars.h
delete mode 100644 contrib/groff/grohtml/ordered_list.h
delete mode 100644 contrib/groff/grohtml/output.cc
delete mode 100644 contrib/groff/grolbp/Makefile.sub
delete mode 100644 contrib/groff/grolbp/charset.h
delete mode 100644 contrib/groff/grolbp/grolbp.man
delete mode 100644 contrib/groff/grolbp/lbp.cc
delete mode 100644 contrib/groff/grolbp/lbp.h
delete mode 100644 contrib/groff/grolj4/Makefile.dep
delete mode 100644 contrib/groff/grolj4/Makefile.sub
delete mode 100644 contrib/groff/grolj4/grolj4.man
delete mode 100644 contrib/groff/grolj4/lj4.cc
delete mode 100644 contrib/groff/grops/Makefile.dep
delete mode 100644 contrib/groff/grops/Makefile.sub
delete mode 100644 contrib/groff/grops/TODO
delete mode 100644 contrib/groff/grops/grops.man
delete mode 100644 contrib/groff/grops/ps.cc
delete mode 100644 contrib/groff/grops/ps.h
delete mode 100644 contrib/groff/grops/psfig.diff
delete mode 100644 contrib/groff/grops/psrm.cc
delete mode 100644 contrib/groff/grotty/Makefile.dep
delete mode 100644 contrib/groff/grotty/Makefile.sub
delete mode 100644 contrib/groff/grotty/TODO
delete mode 100644 contrib/groff/grotty/grotty.man
delete mode 100644 contrib/groff/grotty/tty.cc
delete mode 100644 contrib/groff/hpftodit/Makefile.dep
delete mode 100644 contrib/groff/hpftodit/Makefile.sub
delete mode 100644 contrib/groff/hpftodit/hpftodit.cc
delete mode 100644 contrib/groff/hpftodit/hpftodit.man
delete mode 100644 contrib/groff/include/Makefile.sub
delete mode 100644 contrib/groff/include/assert.h
delete mode 100644 contrib/groff/include/cmap.h
delete mode 100644 contrib/groff/include/cset.h
delete mode 100644 contrib/groff/include/device.h
delete mode 100644 contrib/groff/include/driver.h
delete mode 100644 contrib/groff/include/errarg.h
delete mode 100644 contrib/groff/include/error.h
delete mode 100644 contrib/groff/include/font.h
delete mode 100644 contrib/groff/include/getopt.h
delete mode 100644 contrib/groff/include/groff-getopt.h
delete mode 100644 contrib/groff/include/htmlindicate.h
delete mode 100644 contrib/groff/include/index.h
delete mode 100644 contrib/groff/include/lib.h
delete mode 100644 contrib/groff/include/macropath.h
delete mode 100644 contrib/groff/include/nonposix.h
delete mode 100644 contrib/groff/include/posix.h
delete mode 100644 contrib/groff/include/printer.h
delete mode 100644 contrib/groff/include/ptable.h
delete mode 100644 contrib/groff/include/refid.h
delete mode 100644 contrib/groff/include/search.h
delete mode 100644 contrib/groff/include/searchpath.h
delete mode 100644 contrib/groff/include/stringclass.h
delete mode 100644 contrib/groff/include/unix.h
delete mode 100644 contrib/groff/indxbib/Makefile.dep
delete mode 100644 contrib/groff/indxbib/Makefile.sub
delete mode 100644 contrib/groff/indxbib/dirnamemax.c
delete mode 100644 contrib/groff/indxbib/eign
delete mode 100644 contrib/groff/indxbib/indxbib.cc
delete mode 100644 contrib/groff/indxbib/indxbib.man
delete mode 100644 contrib/groff/indxbib/signal.c
delete mode 100644 contrib/groff/libbib/Makefile.dep
delete mode 100644 contrib/groff/libbib/Makefile.sub
delete mode 100644 contrib/groff/libbib/common.cc
delete mode 100644 contrib/groff/libbib/index.cc
delete mode 100644 contrib/groff/libbib/linear.cc
delete mode 100644 contrib/groff/libbib/map.c
delete mode 100644 contrib/groff/libbib/search.cc
delete mode 100644 contrib/groff/libdriver/Makefile.dep
delete mode 100644 contrib/groff/libdriver/Makefile.sub
delete mode 100644 contrib/groff/libdriver/input.cc
delete mode 100644 contrib/groff/libdriver/printer.cc
delete mode 100644 contrib/groff/libgroff/Makefile.dep
delete mode 100644 contrib/groff/libgroff/Makefile.sub
delete mode 100644 contrib/groff/libgroff/assert.cc
delete mode 100644 contrib/groff/libgroff/change_lf.cc
delete mode 100644 contrib/groff/libgroff/cmap.cc
delete mode 100644 contrib/groff/libgroff/cset.cc
delete mode 100644 contrib/groff/libgroff/device.cc
delete mode 100644 contrib/groff/libgroff/errarg.cc
delete mode 100644 contrib/groff/libgroff/error.cc
delete mode 100644 contrib/groff/libgroff/fatal.cc
delete mode 100644 contrib/groff/libgroff/filename.cc
delete mode 100644 contrib/groff/libgroff/fmod.c
delete mode 100644 contrib/groff/libgroff/font.cc
delete mode 100644 contrib/groff/libgroff/fontfile.cc
delete mode 100644 contrib/groff/libgroff/getcwd.c
delete mode 100644 contrib/groff/libgroff/getopt.c
delete mode 100644 contrib/groff/libgroff/getopt1.c
delete mode 100644 contrib/groff/libgroff/htmlindicate.cc
delete mode 100644 contrib/groff/libgroff/iftoa.c
delete mode 100644 contrib/groff/libgroff/illegal.cc
delete mode 100644 contrib/groff/libgroff/itoa.c
delete mode 100644 contrib/groff/libgroff/lf.cc
delete mode 100644 contrib/groff/libgroff/lineno.cc
delete mode 100644 contrib/groff/libgroff/macropath.cc
delete mode 100644 contrib/groff/libgroff/matherr.c
delete mode 100644 contrib/groff/libgroff/nametoindex.cc
delete mode 100644 contrib/groff/libgroff/new.cc
delete mode 100644 contrib/groff/libgroff/prime.cc
delete mode 100644 contrib/groff/libgroff/progname.cc
delete mode 100644 contrib/groff/libgroff/ptable.cc
delete mode 100644 contrib/groff/libgroff/putenv.c
delete mode 100644 contrib/groff/libgroff/searchpath.cc
delete mode 100644 contrib/groff/libgroff/strerror.c
delete mode 100644 contrib/groff/libgroff/string.cc
delete mode 100644 contrib/groff/libgroff/strsave.cc
delete mode 100644 contrib/groff/libgroff/strtol.c
delete mode 100644 contrib/groff/libgroff/tmpfile.cc
delete mode 100644 contrib/groff/lkbib/Makefile.dep
delete mode 100644 contrib/groff/lkbib/Makefile.sub
delete mode 100644 contrib/groff/lkbib/lkbib.cc
delete mode 100644 contrib/groff/lkbib/lkbib.man
delete mode 100644 contrib/groff/lookbib/Makefile.dep
delete mode 100644 contrib/groff/lookbib/Makefile.sub
delete mode 100644 contrib/groff/lookbib/lookbib.cc
delete mode 100644 contrib/groff/lookbib/lookbib.man
delete mode 100644 contrib/groff/mm/ChangeLog
delete mode 100644 contrib/groff/mm/Makefile.sim
delete mode 100644 contrib/groff/mm/Makefile.sub
delete mode 100644 contrib/groff/mm/NOTES
delete mode 100644 contrib/groff/mm/README
delete mode 100644 contrib/groff/mm/examples/APP
delete mode 100644 contrib/groff/mm/examples/B1B2
delete mode 100644 contrib/groff/mm/examples/COVER
delete mode 100644 contrib/groff/mm/examples/IND
delete mode 100644 contrib/groff/mm/examples/LT
delete mode 100644 contrib/groff/mm/examples/LT.se
delete mode 100644 contrib/groff/mm/examples/ML
delete mode 100644 contrib/groff/mm/examples/MOVE
delete mode 100644 contrib/groff/mm/examples/MUL
delete mode 100644 contrib/groff/mm/examples/NCOL
delete mode 100644 contrib/groff/mm/examples/ND
delete mode 100644 contrib/groff/mm/examples/README
delete mode 100644 contrib/groff/mm/examples/References
delete mode 100644 contrib/groff/mm/examples/SETR
delete mode 100644 contrib/groff/mm/groff_mm.man
delete mode 100644 contrib/groff/mm/groff_mmse.man
delete mode 100644 contrib/groff/mm/mm/0.MT
delete mode 100644 contrib/groff/mm/mm/4.MT
delete mode 100644 contrib/groff/mm/mm/5.MT
delete mode 100644 contrib/groff/mm/mm/ms.cov
delete mode 100644 contrib/groff/mm/mm/se_ms.cov
delete mode 100644 contrib/groff/mm/mmroff.man
delete mode 100755 contrib/groff/mm/mmroff.pl
delete mode 100644 contrib/groff/mm/tmac.m
delete mode 100644 contrib/groff/mm/tmac.mse
delete mode 100644 contrib/groff/nroff/Makefile.sub
delete mode 100644 contrib/groff/nroff/nroff.man
delete mode 100755 contrib/groff/nroff/nroff.sh
delete mode 100644 contrib/groff/pfbtops/Makefile.dep
delete mode 100644 contrib/groff/pfbtops/Makefile.sub
delete mode 100644 contrib/groff/pfbtops/pfbtops.c
delete mode 100644 contrib/groff/pfbtops/pfbtops.man
delete mode 100644 contrib/groff/pic/Makefile.dep
delete mode 100644 contrib/groff/pic/Makefile.sub
delete mode 100644 contrib/groff/pic/TODO
delete mode 100644 contrib/groff/pic/common.cc
delete mode 100644 contrib/groff/pic/common.h
delete mode 100644 contrib/groff/pic/depend
delete mode 100644 contrib/groff/pic/lex.cc
delete mode 100644 contrib/groff/pic/main.cc
delete mode 100644 contrib/groff/pic/object.cc
delete mode 100644 contrib/groff/pic/object.h
delete mode 100644 contrib/groff/pic/output.h
delete mode 100644 contrib/groff/pic/pic.cc
delete mode 100644 contrib/groff/pic/pic.h
delete mode 100644 contrib/groff/pic/pic.man
delete mode 100644 contrib/groff/pic/pic.tab.h
delete mode 100644 contrib/groff/pic/pic.y
delete mode 100644 contrib/groff/pic/pic_tab.h
delete mode 100644 contrib/groff/pic/position.h
delete mode 100644 contrib/groff/pic/tex.cc
delete mode 100644 contrib/groff/pic/text.h
delete mode 100644 contrib/groff/pic/troff.cc
delete mode 100644 contrib/groff/psbb/Makefile.dep
delete mode 100644 contrib/groff/psbb/Makefile.sub
delete mode 100644 contrib/groff/psbb/psbb.c
delete mode 100644 contrib/groff/psbb/psbb.man
delete mode 100644 contrib/groff/refer/Makefile.dep
delete mode 100644 contrib/groff/refer/Makefile.sub
delete mode 100644 contrib/groff/refer/TODO
delete mode 100644 contrib/groff/refer/command.cc
delete mode 100644 contrib/groff/refer/command.h
delete mode 100644 contrib/groff/refer/label.cc
delete mode 100644 contrib/groff/refer/label.y
delete mode 100644 contrib/groff/refer/ref.cc
delete mode 100644 contrib/groff/refer/ref.h
delete mode 100644 contrib/groff/refer/refer.cc
delete mode 100644 contrib/groff/refer/refer.h
delete mode 100644 contrib/groff/refer/refer.man
delete mode 100644 contrib/groff/refer/token.cc
delete mode 100644 contrib/groff/refer/token.h
delete mode 100644 contrib/groff/soelim/Makefile.dep
delete mode 100644 contrib/groff/soelim/Makefile.sub
delete mode 100644 contrib/groff/soelim/TODO
delete mode 100644 contrib/groff/soelim/soelim.cc
delete mode 100644 contrib/groff/soelim/soelim.man
delete mode 100644 contrib/groff/tbl/Makefile.dep
delete mode 100644 contrib/groff/tbl/Makefile.sub
delete mode 100644 contrib/groff/tbl/main.cc
delete mode 100644 contrib/groff/tbl/table.cc
delete mode 100644 contrib/groff/tbl/table.h
delete mode 100644 contrib/groff/tbl/tbl.man
delete mode 100644 contrib/groff/tfmtodit/Makefile.dep
delete mode 100644 contrib/groff/tfmtodit/Makefile.sub
delete mode 100644 contrib/groff/tfmtodit/tfmtodit.cc
delete mode 100644 contrib/groff/tfmtodit/tfmtodit.man
delete mode 100644 contrib/groff/tmac/groff_markup.man
delete mode 100644 contrib/groff/tmac/groff_mdoc.samples.man
delete mode 100644 contrib/groff/tmac/groff_msafer.man
delete mode 100644 contrib/groff/tmac/me.man
delete mode 100644 contrib/groff/tmac/mm.diff
delete mode 100644 contrib/groff/tmac/msafer.man
delete mode 100644 contrib/groff/tmac/tmac.X
delete mode 100644 contrib/groff/tmac/tmac.Xps
delete mode 100644 contrib/groff/tmac/tmac.a4
delete mode 100644 contrib/groff/tmac/tmac.an
delete mode 100644 contrib/groff/tmac/tmac.andoc
delete mode 100644 contrib/groff/tmac/tmac.arkup
delete mode 100644 contrib/groff/tmac/tmac.doc
delete mode 100644 contrib/groff/tmac/tmac.dvi
delete mode 100644 contrib/groff/tmac/tmac.e
delete mode 100644 contrib/groff/tmac/tmac.html
delete mode 100644 contrib/groff/tmac/tmac.latin1
delete mode 100644 contrib/groff/tmac/tmac.lbp
delete mode 100644 contrib/groff/tmac/tmac.lj4
delete mode 100644 contrib/groff/tmac/tmac.man
delete mode 100644 contrib/groff/tmac/tmac.mandoc
delete mode 100644 contrib/groff/tmac/tmac.markup
delete mode 100644 contrib/groff/tmac/tmac.mdoc
delete mode 100644 contrib/groff/tmac/tmac.me
delete mode 100644 contrib/groff/tmac/tmac.ms
delete mode 100644 contrib/groff/tmac/tmac.pic
delete mode 100644 contrib/groff/tmac/tmac.ps
delete mode 100644 contrib/groff/tmac/tmac.psatk
delete mode 100644 contrib/groff/tmac/tmac.psfig
delete mode 100644 contrib/groff/tmac/tmac.psnew
delete mode 100644 contrib/groff/tmac/tmac.psold
delete mode 100644 contrib/groff/tmac/tmac.pspic
delete mode 100644 contrib/groff/tmac/tmac.s
delete mode 100644 contrib/groff/tmac/tmac.safer
delete mode 100644 contrib/groff/tmac/tmac.trace
delete mode 100644 contrib/groff/tmac/tmac.tty
delete mode 100644 contrib/groff/tmac/tmac.tty-char
delete mode 100644 contrib/groff/troff/Makefile.dep
delete mode 100644 contrib/groff/troff/Makefile.sub
delete mode 100644 contrib/groff/troff/TODO
delete mode 100644 contrib/groff/troff/charinfo.h
delete mode 100644 contrib/groff/troff/column.cc
delete mode 100644 contrib/groff/troff/dictionary.cc
delete mode 100644 contrib/groff/troff/dictionary.h
delete mode 100644 contrib/groff/troff/div.cc
delete mode 100644 contrib/groff/troff/div.h
delete mode 100644 contrib/groff/troff/env.cc
delete mode 100644 contrib/groff/troff/env.h
delete mode 100644 contrib/groff/troff/hvunits.h
delete mode 100644 contrib/groff/troff/hyphen.us
delete mode 100644 contrib/groff/troff/input.cc
delete mode 100644 contrib/groff/troff/node.cc
delete mode 100644 contrib/groff/troff/node.h
delete mode 100644 contrib/groff/troff/number.cc
delete mode 100644 contrib/groff/troff/reg.cc
delete mode 100644 contrib/groff/troff/reg.h
delete mode 100644 contrib/groff/troff/request.h
delete mode 100644 contrib/groff/troff/symbol.cc
delete mode 100644 contrib/groff/troff/symbol.h
delete mode 100644 contrib/groff/troff/token.h
delete mode 100644 contrib/groff/troff/troff.h
delete mode 100644 contrib/groff/troff/troff.man
delete mode 100644 contrib/groff/xditview/ChangeLog
delete mode 100644 contrib/groff/xditview/DESC
delete mode 100644 contrib/groff/xditview/Dvi.c
delete mode 100644 contrib/groff/xditview/Dvi.h
delete mode 100644 contrib/groff/xditview/DviChar.c
delete mode 100644 contrib/groff/xditview/DviChar.h
delete mode 100644 contrib/groff/xditview/DviP.h
delete mode 100644 contrib/groff/xditview/FontMap
delete mode 100644 contrib/groff/xditview/GXditview-ad.h
delete mode 100644 contrib/groff/xditview/GXditview.ad
delete mode 100644 contrib/groff/xditview/INSTALL
delete mode 100644 contrib/groff/xditview/Imakefile
delete mode 100644 contrib/groff/xditview/Imakefile.in
delete mode 100644 contrib/groff/xditview/Makefile
delete mode 100644 contrib/groff/xditview/Menu.h
delete mode 100644 contrib/groff/xditview/README
delete mode 100644 contrib/groff/xditview/TODO
delete mode 100644 contrib/groff/xditview/XFontName.c
delete mode 100644 contrib/groff/xditview/XFontName.h
delete mode 100644 contrib/groff/xditview/ad2c
delete mode 100644 contrib/groff/xditview/device.c
delete mode 100644 contrib/groff/xditview/device.h
delete mode 100644 contrib/groff/xditview/draw.c
delete mode 100644 contrib/groff/xditview/font.c
delete mode 100644 contrib/groff/xditview/gray1.bm
delete mode 100644 contrib/groff/xditview/gray2.bm
delete mode 100644 contrib/groff/xditview/gray3.bm
delete mode 100644 contrib/groff/xditview/gray4.bm
delete mode 100644 contrib/groff/xditview/gray5.bm
delete mode 100644 contrib/groff/xditview/gray6.bm
delete mode 100644 contrib/groff/xditview/gray7.bm
delete mode 100644 contrib/groff/xditview/gray8.bm
delete mode 100644 contrib/groff/xditview/gxditview.man
delete mode 100644 contrib/groff/xditview/lex.c
delete mode 100644 contrib/groff/xditview/page.c
delete mode 100644 contrib/groff/xditview/parse.c
delete mode 100644 contrib/groff/xditview/xdit.bm
delete mode 100644 contrib/groff/xditview/xdit_mask.bm
delete mode 100644 contrib/groff/xditview/xditview.c
delete mode 100644 contrib/groff/xditview/xtotroff.c
diff --git a/contrib/groff/addftinfo/Makefile.dep b/contrib/groff/addftinfo/Makefile.dep
deleted file mode 100644
index e38c273c8d59..000000000000
--- a/contrib/groff/addftinfo/Makefile.dep
+++ /dev/null
@@ -1,3 +0,0 @@
-addftinfo.o: addftinfo.cc ../include/lib.h ../include/errarg.h \
- ../include/error.h ../include/stringclass.h ../include/cset.h guess.h
-guess.o: guess.cc guess.h
diff --git a/contrib/groff/addftinfo/Makefile.sub b/contrib/groff/addftinfo/Makefile.sub
deleted file mode 100644
index 23848d54fc72..000000000000
--- a/contrib/groff/addftinfo/Makefile.sub
+++ /dev/null
@@ -1,11 +0,0 @@
-PROG=addftinfo
-MAN1=addftinfo.n
-XLIBS=$(LIBGROFF)
-OBJS=\
- addftinfo.o \
- guess.o
-CCSRCS=\
- $(srcdir)/addftinfo.cc \
- $(srcdir)/guess.cc
-HDRS=\
- $(srcdir)/guess.h
diff --git a/contrib/groff/addftinfo/addftinfo.cc b/contrib/groff/addftinfo/addftinfo.cc
deleted file mode 100644
index 55b62427d145..000000000000
--- a/contrib/groff/addftinfo/addftinfo.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-#include "stringclass.h"
-#include "cset.h"
-#include "guess.h"
-
-static void usage();
-static void convert_font(const font_params &, FILE *, FILE *);
-
-typedef int font_params::*param_t;
-
-static struct {
- const char *name;
- param_t par;
-} param_table[] = {
- { "x-height", &font_params::x_height },
- { "fig-height", &font_params::fig_height },
- { "asc-height", &font_params::asc_height },
- { "body-height", &font_params::body_height },
- { "cap-height", &font_params::cap_height },
- { "comma-depth", &font_params::comma_depth },
- { "desc-depth", &font_params::desc_depth },
- { "body-depth", &font_params::body_depth },
-};
-
-// These are all in thousandths of an em.
-// These values are correct for PostScript Times Roman.
-
-#define DEFAULT_X_HEIGHT 448
-#define DEFAULT_FIG_HEIGHT 676
-#define DEFAULT_ASC_HEIGHT 682
-#define DEFAULT_BODY_HEIGHT 676
-#define DEFAULT_CAP_HEIGHT 662
-#define DEFAULT_COMMA_DEPTH 143
-#define DEFAULT_DESC_DEPTH 217
-#define DEFAULT_BODY_DEPTH 177
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- if (argc < 4)
- usage();
- int resolution;
- if (sscanf(argv[argc-3], "%d", &resolution) != 1)
- usage();
- if (resolution <= 0)
- fatal("resolution must be > 0");
- int unitwidth;
- if (sscanf(argv[argc-2], "%d", &unitwidth) != 1)
- usage();
- if (unitwidth <= 0)
- fatal("unitwidth must be > 0");
- font_params param;
- const char *font = argv[argc-1];
- param.italic = (font[0] != '\0' && strchr(font, '\0')[-1] == 'I');
- param.em = (resolution*unitwidth)/72;
- param.x_height = DEFAULT_X_HEIGHT;
- param.fig_height = DEFAULT_FIG_HEIGHT;
- param.asc_height = DEFAULT_ASC_HEIGHT;
- param.body_height = DEFAULT_BODY_HEIGHT;
- param.cap_height = DEFAULT_CAP_HEIGHT;
- param.comma_depth = DEFAULT_COMMA_DEPTH;
- param.desc_depth = DEFAULT_DESC_DEPTH;
- param.body_depth = DEFAULT_BODY_DEPTH;
- int i;
- for (i = 1; i < argc && argv[i][0] == '-'; i++) {
- if (argv[i][1] == '-' && argv[i][2] == '\0') {
- i++;
- break;
- }
- if (i + 1 >= argc)
- usage();
- int j;
- for (j = 0;; j++) {
- if (j >= sizeof(param_table)/sizeof(param_table[0]))
- fatal("parameter `%1' not recognized", argv[i] + 1);
- if (strcmp(param_table[j].name, argv[i] + 1) == 0)
- break;
- }
- if (sscanf(argv[i+1], "%d", &(param.*(param_table[j].par))) != 1)
- fatal("invalid argument `%1'", argv[i+1]);
- i++;
- }
- if (argc - i != 3)
- usage();
- errno = 0;
- FILE *infp = fopen(font, "r");
- if (infp == 0)
- fatal("can't open `%1': %2", font, strerror(errno));
- convert_font(param, infp, stdout);
- return 0;
-}
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-param value] ... resolution unitwidth font\n",
- program_name);
- exit(1);
-}
-
-static int get_line(FILE *fp, string *p)
-{
- int c;
- p->clear();
- while ((c = getc(fp)) != EOF) {
- *p += char(c);
- if (c == '\n')
- break;
- }
- return p->length() > 0;
-}
-
-static void convert_font(const font_params ¶m, FILE *infp, FILE *outfp)
-{
- string s;
- while (get_line(infp, &s)) {
- put_string(s, outfp);
- if (s.length() >= 8
- && strncmp(&s[0], "charset", 7))
- break;
- }
- while (get_line(infp, &s)) {
- s += '\0';
- string name;
- const char *p = s.contents();
- while (csspace(*p))
- p++;
- while (*p != '\0' && !csspace(*p))
- name += *p++;
- while (csspace(*p))
- p++;
- for (const char *q = s.contents(); q < p; q++)
- putc(*q, outfp);
- char *next;
- char_metric metric;
- metric.width = (int)strtol(p, &next, 10);
- if (next != p) {
- printf("%d", metric.width);
- p = next;
- metric.type = (int)strtol(p, &next, 10);
- if (next != p) {
- name += '\0';
- guess(name.contents(), param, &metric);
- if (metric.sk == 0) {
- if (metric.left_ic == 0) {
- if (metric.ic == 0) {
- if (metric.depth == 0) {
- if (metric.height != 0)
- printf(",%d", metric.height);
- }
- else
- printf(",%d,%d", metric.height, metric.depth);
- }
- else
- printf(",%d,%d,%d", metric.height, metric.depth, metric.ic);
- }
- else
- printf(",%d,%d,%d,%d", metric.height, metric.depth, metric.ic,
- metric.left_ic);
- }
- else
- printf(",%d,%d,%d,%d,%d", metric.height, metric.depth, metric.ic,
- metric.left_ic, metric.sk);
- }
- }
- fputs(p, outfp);
- }
-}
-
diff --git a/contrib/groff/addftinfo/addftinfo.man b/contrib/groff/addftinfo/addftinfo.man
deleted file mode 100644
index 6741c171f643..000000000000
--- a/contrib/groff/addftinfo/addftinfo.man
+++ /dev/null
@@ -1,102 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-1995 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.TH ADDFTINFO @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-addftinfo \- add information to troff font files for use with groff
-.SH SYNOPSIS
-.B addftinfo
-[
-.BI \- param\ value\fR.\|.\|.
-]
-.I res
-.I unitwidth
-.I font
-.SH DESCRIPTION
-.B addftinfo
-reads a troff font file
-and adds some additional font-metric information
-that is used by the groff system.
-The font file with the information added is written on the
-standard output.
-The information added is guessed using
-some parametric information about the font
-and assumptions
-about the traditional troff names for characters.
-The main information added is the heights and depths of characters.
-The
-.I res
-and
-.I unitwidth
-arguments should be the same as the corresponding parameters
-in the DESC file;
-.I font
-is the name of the file describing the font;
-if
-.I font
-ends with
-.B I
-the font will be assumed to be italic.
-.SH OPTIONS
-Each of the options changes one of the parameters that is used
-to derive the heights and depths.
-Like the existing quantities in the font
-file, each
-.I value
-is in
-.RI inches/ res
-for a font whose point size is
-.IR unitwidth .
-.I param
-must be one of:
-.TP
-.B x-height
-The height of lowercase letters without ascenders such as x.
-.TP
-.B fig-height
-The height of figures (digits).
-.TP
-.B asc-height
-The height of characters with ascenders, such as b, d or l.
-.TP
-.B body-height
-The height of characters such as parentheses.
-.TP
-.B cap-height
-The height of uppercase letters such as A.
-.TP
-.B comma-depth
-The depth of a comma.
-.TP
-.B desc-depth
-The depth of characters with descenders, such as p,q, or y.
-.TP
-.B body-depth
-The depth of characters such as parentheses.
-.LP
-.B addftinfo
-makes no attempt to use the specified parameters to guess
-the unspecified parameters.
-If a parameter is not specified the default will be used.
-The defaults are chosen to have the reasonable values for
-a Times font.
-.SH "SEE ALSO"
-.BR font (5)
-.BR groff_font (@MAN5EXT@),
-.BR groff (@MAN1EXT@),
-.BR groff_char (@MAN7EXT@)
diff --git a/contrib/groff/addftinfo/guess.cc b/contrib/groff/addftinfo/guess.cc
deleted file mode 100644
index dcfd4c92cb9b..000000000000
--- a/contrib/groff/addftinfo/guess.cc
+++ /dev/null
@@ -1,490 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "guess.h"
-
-void guess(const char *s, const font_params ¶m, char_metric *metric)
-{
- int &height = metric->height;
- int &depth = metric->depth;
-
- metric->ic = 0;
- metric->left_ic = 0;
- metric->sk = 0;
- height = 0;
- depth = 0;
- if (s[0] == '\0' || (s[1] != '\0' && s[2] != '\0'))
- goto do_default;
-#define HASH(c1, c2) (((unsigned char)(c1) << 8) | (unsigned char)(c2))
- switch (HASH(s[0], s[1])) {
- default:
- do_default:
- if (metric->type & 01)
- depth = param.desc_depth;
- if (metric->type & 02)
- height = param.asc_height;
- else
- height = param.x_height;
- break;
- case HASH('\\', '|'):
- case HASH('\\', '^'):
- case HASH('\\', '&'):
- // these have zero height and depth
- break;
- case HASH('f', 0):
- height = param.asc_height;
- if (param.italic)
- depth = param.desc_depth;
- break;
- case HASH('a', 0):
- case HASH('c', 0):
- case HASH('e', 0):
- case HASH('m', 0):
- case HASH('n', 0):
- case HASH('o', 0):
- case HASH('r', 0):
- case HASH('s', 0):
- case HASH('u', 0):
- case HASH('v', 0):
- case HASH('w', 0):
- case HASH('x', 0):
- case HASH('z', 0):
- height = param.x_height;
- break;
- case HASH('i', 0):
- height = param.x_height;
- break;
- case HASH('b', 0):
- case HASH('d', 0):
- case HASH('h', 0):
- case HASH('k', 0):
- case HASH('l', 0):
- case HASH('F', 'i'):
- case HASH('F', 'l'):
- case HASH('f', 'f'):
- case HASH('f', 'i'):
- case HASH('f', 'l'):
- height = param.asc_height;
- break;
- case HASH('t', 0):
- height = param.asc_height;
- break;
- case HASH('g', 0):
- case HASH('p', 0):
- case HASH('q', 0):
- case HASH('y', 0):
- height = param.x_height;
- depth = param.desc_depth;
- break;
- case HASH('j', 0):
- height = param.x_height;
- depth = param.desc_depth;
- break;
- case HASH('A', 0):
- case HASH('B', 0):
- case HASH('C', 0):
- case HASH('D', 0):
- case HASH('E', 0):
- case HASH('F', 0):
- case HASH('G', 0):
- case HASH('H', 0):
- case HASH('I', 0):
- case HASH('J', 0):
- case HASH('K', 0):
- case HASH('L', 0):
- case HASH('M', 0):
- case HASH('N', 0):
- case HASH('O', 0):
- case HASH('P', 0):
- case HASH('Q', 0):
- case HASH('R', 0):
- case HASH('S', 0):
- case HASH('T', 0):
- case HASH('U', 0):
- case HASH('V', 0):
- case HASH('W', 0):
- case HASH('X', 0):
- case HASH('Y', 0):
- case HASH('Z', 0):
- height = param.cap_height;
- break;
- case HASH('*', 'A'):
- case HASH('*', 'B'):
- case HASH('*', 'C'):
- case HASH('*', 'D'):
- case HASH('*', 'E'):
- case HASH('*', 'F'):
- case HASH('*', 'G'):
- case HASH('*', 'H'):
- case HASH('*', 'I'):
- case HASH('*', 'K'):
- case HASH('*', 'L'):
- case HASH('*', 'M'):
- case HASH('*', 'N'):
- case HASH('*', 'O'):
- case HASH('*', 'P'):
- case HASH('*', 'Q'):
- case HASH('*', 'R'):
- case HASH('*', 'S'):
- case HASH('*', 'T'):
- case HASH('*', 'U'):
- case HASH('*', 'W'):
- case HASH('*', 'X'):
- case HASH('*', 'Y'):
- case HASH('*', 'Z'):
- height = param.cap_height;
- break;
- case HASH('0', 0):
- case HASH('1', 0):
- case HASH('2', 0):
- case HASH('3', 0):
- case HASH('4', 0):
- case HASH('5', 0):
- case HASH('6', 0):
- case HASH('7', 0):
- case HASH('8', 0):
- case HASH('9', 0):
- case HASH('1', '2'):
- case HASH('1', '4'):
- case HASH('3', '4'):
- height = param.fig_height;
- break;
- case HASH('(', 0):
- case HASH(')', 0):
- case HASH('[', 0):
- case HASH(']', 0):
- case HASH('{', 0):
- case HASH('}', 0):
- height = param.body_height;
- depth = param.body_depth;
- break;
- case HASH('i', 's'):
- height = (param.em*3)/4;
- depth = param.em/4;
- break;
- case HASH('*', 'a'):
- case HASH('*', 'e'):
- case HASH('*', 'i'):
- case HASH('*', 'k'):
- case HASH('*', 'n'):
- case HASH('*', 'o'):
- case HASH('*', 'p'):
- case HASH('*', 's'):
- case HASH('*', 't'):
- case HASH('*', 'u'):
- case HASH('*', 'w'):
- height = param.x_height;
- break;
- case HASH('*', 'd'):
- case HASH('*', 'l'):
- height = param.asc_height;
- break;
- case HASH('*', 'g'):
- case HASH('*', 'h'):
- case HASH('*', 'm'):
- case HASH('*', 'r'):
- case HASH('*', 'x'):
- case HASH('*', 'y'):
- height = param.x_height;
- depth = param.desc_depth;
- break;
- case HASH('*', 'b'):
- case HASH('*', 'c'):
- case HASH('*', 'f'):
- case HASH('*', 'q'):
- case HASH('*', 'z'):
- height = param.asc_height;
- depth = param.desc_depth;
- break;
- case HASH('t', 's'):
- height = param.x_height;
- depth = param.desc_depth;
- break;
- case HASH('!', 0):
- case HASH('?', 0):
- case HASH('"', 0):
- case HASH('#', 0):
- case HASH('$', 0):
- case HASH('%', 0):
- case HASH('&', 0):
- case HASH('*', 0):
- case HASH('+', 0):
- height = param.asc_height;
- break;
- case HASH('`', 0):
- case HASH('\'', 0):
- height = param.asc_height;
- break;
- case HASH('~', 0):
- case HASH('^', 0):
- case HASH('a', 'a'):
- case HASH('g', 'a'):
- height = param.asc_height;
- break;
- case HASH('r', 'u'):
- case HASH('.', 0):
- break;
- case HASH(',', 0):
- depth = param.comma_depth;
- break;
- case HASH('m', 'i'):
- case HASH('-', 0):
- case HASH('h', 'y'):
- case HASH('e', 'm'):
- height = param.x_height;
- break;
- case HASH(':', 0):
- height = param.x_height;
- break;
- case HASH(';', 0):
- height = param.x_height;
- depth = param.comma_depth;
- break;
- case HASH('=', 0):
- case HASH('e', 'q'):
- height = param.x_height;
- break;
- case HASH('<', 0):
- case HASH('>', 0):
- case HASH('>', '='):
- case HASH('<', '='):
- case HASH('@', 0):
- case HASH('/', 0):
- case HASH('|', 0):
- case HASH('\\', 0):
- height = param.asc_height;
- break;
- case HASH('_', 0):
- case HASH('u', 'l'):
- case HASH('\\', '_'):
- depth = param.em/4;
- break;
- case HASH('r', 'n'):
- height = (param.em*3)/4;
- break;
- case HASH('s', 'r'):
- height = (param.em*3)/4;
- depth = param.em/4;
- break;
- case HASH('b', 'u'):
- case HASH('s', 'q'):
- case HASH('d', 'e'):
- case HASH('d', 'g'):
- case HASH('f', 'm'):
- case HASH('c', 't'):
- case HASH('r', 'g'):
- case HASH('c', 'o'):
- case HASH('p', 'l'):
- case HASH('*', '*'):
- case HASH('s', 'c'):
- case HASH('s', 'l'):
- case HASH('=', '='):
- case HASH('~', '='):
- case HASH('a', 'p'):
- case HASH('!', '='):
- case HASH('-', '>'):
- case HASH('<', '-'):
- case HASH('u', 'a'):
- case HASH('d', 'a'):
- case HASH('m', 'u'):
- case HASH('d', 'i'):
- case HASH('+', '-'):
- case HASH('c', 'u'):
- case HASH('c', 'a'):
- case HASH('s', 'b'):
- case HASH('s', 'p'):
- case HASH('i', 'b'):
- case HASH('i', 'p'):
- case HASH('i', 'f'):
- case HASH('p', 'd'):
- case HASH('g', 'r'):
- case HASH('n', 'o'):
- case HASH('p', 't'):
- case HASH('e', 's'):
- case HASH('m', 'o'):
- case HASH('b', 'r'):
- case HASH('d', 'd'):
- case HASH('r', 'h'):
- case HASH('l', 'h'):
- case HASH('o', 'r'):
- case HASH('c', 'i'):
- height = param.asc_height;
- break;
- case HASH('l', 't'):
- case HASH('l', 'b'):
- case HASH('r', 't'):
- case HASH('r', 'b'):
- case HASH('l', 'k'):
- case HASH('r', 'k'):
- case HASH('b', 'v'):
- case HASH('l', 'f'):
- case HASH('r', 'f'):
- case HASH('l', 'c'):
- case HASH('r', 'c'):
- height = (param.em*3)/4;
- depth = param.em/4;
- break;
-#if 0
- case HASH('%', '0'):
- case HASH('-', '+'):
- case HASH('-', 'D'):
- case HASH('-', 'd'):
- case HASH('-', 'd'):
- case HASH('-', 'h'):
- case HASH('.', 'i'):
- case HASH('.', 'j'):
- case HASH('/', 'L'):
- case HASH('/', 'O'):
- case HASH('/', 'l'):
- case HASH('/', 'o'):
- case HASH('=', '~'):
- case HASH('A', 'E'):
- case HASH('A', 'h'):
- case HASH('A', 'N'):
- case HASH('C', 's'):
- case HASH('D', 'o'):
- case HASH('F', 'c'):
- case HASH('F', 'o'):
- case HASH('I', 'J'):
- case HASH('I', 'm'):
- case HASH('O', 'E'):
- case HASH('O', 'f'):
- case HASH('O', 'K'):
- case HASH('O', 'm'):
- case HASH('O', 'R'):
- case HASH('P', 'o'):
- case HASH('R', 'e'):
- case HASH('S', '1'):
- case HASH('S', '2'):
- case HASH('S', '3'):
- case HASH('T', 'P'):
- case HASH('T', 'p'):
- case HASH('Y', 'e'):
- case HASH('\\', '-'):
- case HASH('a', '"'):
- case HASH('a', '-'):
- case HASH('a', '.'):
- case HASH('a', '^'):
- case HASH('a', 'b'):
- case HASH('a', 'c'):
- case HASH('a', 'd'):
- case HASH('a', 'e'):
- case HASH('a', 'h'):
- case HASH('a', 'o'):
- case HASH('a', 't'):
- case HASH('a', '~'):
- case HASH('b', 'a'):
- case HASH('b', 'b'):
- case HASH('b', 's'):
- case HASH('c', '*'):
- case HASH('c', '+'):
- case HASH('f', '/'):
- case HASH('f', 'a'):
- case HASH('f', 'c'):
- case HASH('f', 'o'):
- case HASH('h', 'a'):
- case HASH('h', 'o'):
- case HASH('i', 'j'):
- case HASH('l', 'A'):
- case HASH('l', 'B'):
- case HASH('l', 'C'):
- case HASH('m', 'd'):
- case HASH('n', 'c'):
- case HASH('n', 'e'):
- case HASH('n', 'm'):
- case HASH('o', 'A'):
- case HASH('o', 'a'):
- case HASH('o', 'e'):
- case HASH('o', 'q'):
- case HASH('p', 'l'):
- case HASH('p', 'p'):
- case HASH('p', 's'):
- case HASH('r', '!'):
- case HASH('r', '?'):
- case HASH('r', 'A'):
- case HASH('r', 'B'):
- case HASH('r', 'C'):
- case HASH('r', 's'):
- case HASH('s', 'h'):
- case HASH('s', 's'):
- case HASH('t', 'e'):
- case HASH('t', 'f'):
- case HASH('t', 'i'):
- case HASH('t', 'm'):
- case HASH('~', '~'):
- case HASH('v', 'S'):
- case HASH('v', 'Z'):
- case HASH('v', 's'):
- case HASH('v', 'z'):
- case HASH('^', 'A'):
- case HASH('^', 'E'):
- case HASH('^', 'I'):
- case HASH('^', 'O'):
- case HASH('^', 'U'):
- case HASH('^', 'a'):
- case HASH('^', 'e'):
- case HASH('^', 'i'):
- case HASH('^', 'o'):
- case HASH('^', 'u'):
- case HASH('`', 'A'):
- case HASH('`', 'E'):
- case HASH('`', 'I'):
- case HASH('`', 'O'):
- case HASH('`', 'U'):
- case HASH('`', 'a'):
- case HASH('`', 'e'):
- case HASH('`', 'i'):
- case HASH('`', 'o'):
- case HASH('`', 'u'):
- case HASH('~', 'A'):
- case HASH('~', 'N'):
- case HASH('~', 'O'):
- case HASH('~', 'a'):
- case HASH('~', 'n'):
- case HASH('~', 'o'):
- case HASH('\'', 'A'):
- case HASH('\'', 'C'):
- case HASH('\'', 'E'):
- case HASH('\'', 'I'):
- case HASH('\'', 'O'):
- case HASH('\'', 'U'):
- case HASH('\'', 'a'):
- case HASH('\'', 'c'):
- case HASH('\'', 'e'):
- case HASH('\'', 'i'):
- case HASH('\'', 'o'):
- case HASH('\'', 'u')
- case HASH(':', 'A'):
- case HASH(':', 'E'):
- case HASH(':', 'I'):
- case HASH(':', 'O'):
- case HASH(':', 'U'):
- case HASH(':', 'Y'):
- case HASH(':', 'a'):
- case HASH(':', 'e'):
- case HASH(':', 'i'):
- case HASH(':', 'o'):
- case HASH(':', 'u'):
- case HASH(':', 'y'):
- case HASH(',', 'C'):
- case HASH(',', 'c'):
-#endif
- }
-}
diff --git a/contrib/groff/addftinfo/guess.h b/contrib/groff/addftinfo/guess.h
deleted file mode 100644
index 4471dda8d9a6..000000000000
--- a/contrib/groff/addftinfo/guess.h
+++ /dev/null
@@ -1,44 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-struct font_params {
- int italic;
- int em;
- int x_height;
- int fig_height;
- int cap_height;
- int asc_height;
- int body_height;
- int comma_depth;
- int desc_depth;
- int body_depth;
-};
-
-struct char_metric {
- int width;
- int type;
- int height;
- int depth;
- int ic;
- int left_ic;
- int sk;
-};
-
-void guess(const char *s, const font_params ¶m, char_metric *metric);
diff --git a/contrib/groff/afmtodit/Makefile.sub b/contrib/groff/afmtodit/Makefile.sub
deleted file mode 100644
index 9fee2def5745..000000000000
--- a/contrib/groff/afmtodit/Makefile.sub
+++ /dev/null
@@ -1,21 +0,0 @@
-MAN1=afmtodit.n
-CLEANADD=afmtodit
-
-all: afmtodit
-
-afmtodit: afmtodit.pl
- if test -n "$(PERLPATH)"; then \
- sed -e 's;/usr/bin/perl;$(PERLPATH);' \
- $(srcdir)/afmtodit.pl >afmtodit; \
- else \
- cp $(srcdir)/afmtodit.pl afmtodit; \
- fi
- chmod +x afmtodit
-
-install_data: afmtodit
- -test -d $(bindir) || $(mkinstalldirs) $(bindir)
- -rm -f $(bindir)/afmtodit
- $(INSTALL_SCRIPT) afmtodit $(bindir)/afmtodit
-
-uninstall_sub:
- -rm -f $(bindir)/afmtodit
diff --git a/contrib/groff/afmtodit/afmtodit.man b/contrib/groff/afmtodit/afmtodit.man
deleted file mode 100644
index e0631e092e0f..000000000000
--- a/contrib/groff/afmtodit/afmtodit.man
+++ /dev/null
@@ -1,222 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.TH AFMTODIT @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-afmtodit \- create font files for use with groff \-Tps
-.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fBafmtodit 'u
-.ti \niu
-.B afmtodit
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.OP \-ns
-.OP \-d desc_file
-.OP \-e enc_file
-.OP \-i n
-.OP \-a n
-.I afm_file
-.I map_file
-.I font
-.br
-.ad \na
-.SH DESCRIPTION
-.B afmtodit
-creates a font file for use with groff and
-.BR grops .
-.B afmtodit
-is written in perl;
-you must have perl version 3 installed in order to run
-.BR afmtodit .
-.I afm_file
-is the AFM (Adobe Font Metric) file for the font.
-.I map_file
-is a file that says which groff character names map onto
-each PostScript character name;
-this file should contain a sequence of lines of the form
-.IP
-.I
-ps_char groff_char
-.LP
-where
-.I ps_char
-is the PostScript name of the character
-and
-.I groff_char
-is the groff name of the character (as used in the groff font file.)
-The same
-.I ps_char
-can occur multiple times in the file;
-each
-.I groff_char
-must occur at most once.
-.I font
-is the groff name of the font.
-If a PostScript character is in the encoding to be used for the font
-but is not mentioned in
-.I map_file
-then
-.B afmtodit
-will put it in the groff font file as an unnamed character,
-which can be accessed by the
-.B \eN
-escape sequence in
-.BR troff .
-The groff font file will be output to a file called
-.IR font .
-.LP
-If there is a downloadable font file for the font, it may be listed in
-the file
-.BR @FONTDIR@/devps/download ;
-see
-.BR grops (@MAN1EXT@).
-.LP
-If the
-.B \-i
-option is used,
-.B afmtodit
-will automatically generate an italic correction,
-a left italic correction and a subscript correction
-for each character
-(the significance of these parameters is explained in
-.BR groff_font (@MAN5EXT@));
-these parameters may be specified for individual characters by
-adding to the
-.I afm_file
-lines of the form:
-.IP
-.BI italicCorrection\ ps_char\ n
-.br
-.BI leftItalicCorrection\ ps_char\ n
-.br
-.BI subscriptCorrection\ ps_char\ n
-.LP
-where
-.I ps_char
-is the PostScript name of the character,
-and
-.I n
-is the desired value of the corresponding parameter in thousandths of an em.
-These parameters are normally needed only for italic (or oblique) fonts.
-.SH OPTIONS
-.TP
-.B \-n
-Don't output a
-.B ligatures
-command for this font.
-Use this with constant-width fonts.
-.TP
-.B \-s
-The font is special.
-The effect of this option is to add the
-.B special
-command to the font file.
-.TP
-.BI \-d desc_file
-The device description file is
-.I desc_file
-rather than the default
-.BR DESC .
-.TP
-.BI \-e enc_file
-The PostScript font should be reencoded to use the encoding described
-in enc_file.
-The format of
-.I enc_file
-is described in
-.BR grops (@MAN1EXT@).
-.TP
-.BI \-a n
-Use
-.I n
-as the slant parameter in the font file;
-this is used by groff in the positioning of accents.
-By default
-.B afmtodit
-uses the negative of the ItalicAngle specified in the afm file;
-with true italic fonts it is sometimes desirable to use
-a slant that is less than this.
-If you find that characters from an italic font have accents
-placed too far to the right over them,
-then use the
-.B \-a
-option to give the font a smaller slant.
-.TP
-.BI \-i n
-Generate an italic correction for each character so that
-the character's width plus the character's italic correction
-is equal to
-.I n
-thousandths of an em
-plus the amount by which the right edge of the character's bounding
-is to the right of the character's origin.
-If this would result in a negative italic correction, use a zero
-italic correction instead.
-.IP
-Also generate a subscript correction equal to the
-product of the tangent of the slant of the font and
-four fifths of the x-height of the font.
-If this would result in a subscript correction greater than the italic
-correction, use a subscript correction equal to the italic correction
-instead.
-.IP
-Also generate a left italic correction for each character
-equal to
-.I n
-thousandths of an em
-plus the amount by which the left edge of the character's bounding box
-is to the left of the character's origin.
-The left italic correction may be negative.
-.IP
-This option is normally needed only with italic (or oblique) fonts.
-The font files distributed with groff were created using an option of
-.B \-i50
-for italic fonts.
-.SH FILES
-.Tp \w'\fB@FONTDIR@/devps/download'u+2n
-.B @FONTDIR@/devps/DESC
-Device description file.
-.TP
-.BI @FONTDIR@/devps/ F
-Font description file for font
-.IR F .
-.TP
-.B @FONTDIR@/devps/download
-List of downloadable fonts.
-.TP
-.B @FONTDIR@/devps/text.enc
-Encoding used for text fonts.
-.TP
-.B @FONTDIR@/devps/generate/textmap
-Standard mapping.
-.SH "SEE ALSO"
-.BR groff (@MAN1EXT@),
-.BR grops (@MAN1EXT@),
-.BR groff_font (@MAN5EXT@),
-.BR perl (1)
diff --git a/contrib/groff/afmtodit/afmtodit.pl b/contrib/groff/afmtodit/afmtodit.pl
deleted file mode 100644
index a44ae7a2d6fb..000000000000
--- a/contrib/groff/afmtodit/afmtodit.pl
+++ /dev/null
@@ -1,326 +0,0 @@
-#! /usr/bin/perl -P-
-# -*- Perl -*-
-#Copyright (C) 1989-2000 Free Software Foundation, Inc.
-# Written by James Clark (jjc@jclark.com)
-#
-#This file is part of groff.
-#
-#groff is free software; you can redistribute it and/or modify it under
-#the terms of the GNU General Public License as published by the Free
-#Software Foundation; either version 2, or (at your option) any later
-#version.
-#
-#groff is distributed in the hope that it will be useful, but WITHOUT ANY
-#WARRANTY; without even the implied warranty of MERCHANTABILITY or
-#FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-#for more details.
-#
-#You should have received a copy of the GNU General Public License along
-#with groff; see the file COPYING. If not, write to the Free Software
-#Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-
-$prog = $0;
-$prog =~ s@.*/@@;
-
-do 'getopts.pl';
-do Getopts('e:sd:i:a:n');
-
-if ($#ARGV != 2) {
- die "Usage: $prog [-ns] [-d DESC] [-e encoding] [-i n] [-a angle] afmfile mapfile font\n";
-}
-
-$afm = $ARGV[0];
-$map = $ARGV[1];
-$font = $ARGV[2];
-$desc = $opt_d || "DESC";
-
-# read the afm file
-
-open(AFM, $afm) || die "$prog: can't open \`$ARGV[0]': $!\n";
-
-while () {
- chop;
- @field = split(' ');
- if ($field[0] eq "FontName") {
- $psname = $field[1];
- }
- elsif($field[0] eq "ItalicAngle") {
- $italic_angle = -$field[1];
- }
- elsif ($field[0] eq "KPX") {
- if ($#field == 3) {
- push(kern1, $field[1]);
- push(kern2, $field[2]);
- push(kernx, $field[3]);
- }
- }
- elsif ($field[0] eq "italicCorrection") {
- $italic_correction{$field[1]} = $field[2];
- }
- elsif ($field[0] eq "leftItalicCorrection") {
- $left_italic_correction{$field[1]} = $field[2];
- }
- elsif ($field[0] eq "subscriptCorrection") {
- $subscript_correction{$field[1]} = $field[2];
- }
- elsif ($field[0] eq "StartCharMetrics") {
- while () {
- @field = split(' ');
- last if ($field[0] eq "EndCharMetrics");
- if ($field[0] eq "C") {
- $c = -1;
- $wx = 0;
- $n = "";
- $lly = 0;
- $ury = 0;
- $llx = 0;
- $urx = 0;
- $c = $field[1];
- $i = 2;
- while ($i <= $#field) {
- if ($field[$i] eq "WX") {
- $w = $field[$i + 1];
- $i += 2;
- }
- elsif ($field[$i] eq "N") {
- $n = $field[$i + 1];
- $i += 2;
- }
- elsif ($field[$i] eq "B") {
- $llx = $field[$i + 1];
- $lly = $field[$i + 2];
- $urx = $field[$i + 3];
- $ury = $field[$i + 4];
- $i += 5;
- }
- elsif ($field[$i] eq "L") {
- push(ligatures, $field[$i + 2]);
- $i += 3;
- }
- else {
- while ($i <= $#field && $field[$i] ne ";") {
- $i++;
- }
- $i++;
- }
- }
- if (!$opt_e && $c != -1) {
- $encoding[$c] = $n;
- $in_encoding{$n} = 1;
- }
- $width{$n} = $w;
- $height{$n} = $ury;
- $depth{$n} = -$lly;
- $left_side_bearing{$n} = -$llx;
- $right_side_bearing{$n} = $urx - $w;
- }
- }
- }
-}
-close(AFM);
-
-# read the DESC file
-
-$sizescale = 1;
-
-open(DESC, $desc) || die "$prog: can't open \`$desc': $!\n";
-while () {
- next if /^#/;
- chop;
- @field = split(' ');
- last if $field[0] eq "charset";
- if ($field[0] eq "res") { $resolution = $field[1]; }
- if ($field[0] eq "unitwidth") { $unitwidth = $field[1]; }
- if ($field[0] eq "sizescale") { $sizescale = $field[1]; }
-}
-close(DESC);
-
-if ($opt_e) {
- # read the encoding file
-
- open(ENCODING, $opt_e) || die "$prog: can't open \`$opt_e': $!\n";
- while () {
- chop;
- @field = split(' ');
- if ($#field == 1) {
- if ($field[1] >= 0 && defined $width{$field[0]}) {
- $encoding[$field[1]] = $field[0];
- $in_encoding{$field[0]} = 1;
- }
- }
- }
- close(ENCODING);
-}
-
-# read the map file
-
-open(MAP, $map) || die "$prog: can't open \`$map': $!\n";
-while (
sequence.
- */
-
-void html_printer::move_vertical (text_glob *g, paragraph_type p)
-{
- int r = font::res;
- int height = (g->text_style.point_size+2)*r/72; // --fixme-- we always assume VS is PS+2 (could do better)
- int temp_vpos;
-
- if (auto_on) {
- if ((more_than_line_break(output_vpos, g->minv, height)) || (p != current_paragraph->para_type)) {
- end_paragraph();
- begin_paragraph(p);
- } else {
- html_newline();
- }
- } else {
- if (output_vpos == -1) {
- temp_vpos = g->minv;
- } else {
- temp_vpos = output_vpos;
- }
-
- force_begin_paragraph();
- if (need_one_newline) {
- html_newline();
- temp_vpos += height;
- } else {
- need_one_newline = TRUE;
- }
-
- while ((temp_vpos < g->minv) && (more_than_line_break(temp_vpos, g->minv, height))) {
- html_newline();
- temp_vpos += height;
- }
- }
-}
-
-/*
- * emit_space - emits a space within html, it checks for the font type and
- * will change font depending upon, g. Courier spaces are larger
- * than roman so we need consistancy when changing between them.
- */
-
-void html_printer::emit_space (text_glob *g, int force_space)
-{
- if (! current_paragraph->need_paragraph) {
- // only generate a space if we have written a word - as html will ignore it otherwise
- if ((output_style != g->text_style) && (g->text_style.f != 0)) {
- terminate_current_font();
- }
- if (force_space || (g->minh > output_hpos)) {
- html.put_string(" ");
- }
- change_font(g, TRUE);
- }
-}
-
-/*
- * html_position_text - determine whether the text is subscript/superscript/normal
- * or a header.
- */
-
-char *html_printer::html_position_text (text_glob *g, int left_margin, int right_margin)
-{
- char *postword=0;
-
- begin_paragraph(left_alignment);
-
- if ((! header.written_header) &&
- (is_on_same_line(g, output_vpos) ||
- pretend_is_on_same_line(g, left_margin, right_margin))) {
-
- /*
- * check whether we should supress superscripts and subscripts.
- * I guess we might be able to do better by examining text on this line
- * --fixme--
- */
-
- if ((! is_on_same_line(g, output_vpos)) && (pretend_is_on_same_line(g, left_margin, right_margin))) {
- supress_sub_sup = TRUE;
- }
- header.written_header = FALSE;
- force_begin_paragraph();
-
- // check whether we need to insert white space between words on 'same' line
- if (pretend_is_on_same_line(g, left_margin, right_margin)) {
- emit_space(g, TRUE);
- }
-
- // check whether the font was reset after generating an image
- if (output_style.f == 0) {
- change_font(g, TRUE);
- }
-
- if (looks_like_subscript(g)) {
-
- g->text_style.point_size = output_style.point_size;
- g->minv = output_vpos; // this ensures that output_vpos doesn't alter
- // which allows multiple subscripted words
- move_horizontal(g, left_margin);
- html.put_string("");
- postword = "";
- } else if (looks_like_superscript(g)) {
-
- g->text_style.point_size = output_style.point_size;
- g->minv = output_vpos;
-
- move_horizontal(g, left_margin);
- html.put_string("");
- postword = "";
- } else {
- move_horizontal(g, left_margin);
- }
- supress_sub_sup = FALSE;
- } else {
- // we have found a new line
- if (! header.written_header) {
- move_vertical(g, left_alignment);
- }
- header.written_header = FALSE;
-
- if (processed_header(g)) {
- // we must not alter output_vpos as we have peeped at the next word
- // and set vpos to this - to ensure we do not generate a
after
- // a heading. (The html heading automatically generates a line break)
- output_hpos = left_margin;
- return( postword );
- } else {
- force_begin_paragraph();
- if ((! is_in_table()) && (margin_on)) {
- make_html_indent(left_margin);
- }
- if (g->minh-left_margin != 0) {
- make_html_indent(g->minh-left_margin);
- }
- change_font(g, TRUE);
- supress_sub_sup = FALSE;
- }
- }
- output_vpos = g->minv;
- output_hpos = g->maxh;
- return( postword );
-}
-
-
-int html_printer::html_position_region (void)
-{
- int r = font::res;
- int height = output_style.point_size*r/72;
- int temp_vpos;
- int is_center = FALSE;
-
- if (output_style.point_size != 0) {
- if (output_vpos != start_region_vpos) {
-
- // graphic starts on a different line
- if (output_vpos == -1) {
- temp_vpos = start_region_vpos;
- } else {
- temp_vpos = output_vpos;
- }
- supress_sub_sup = TRUE;
- if (need_one_newline) {
- html_newline();
- temp_vpos += height;
- } else {
- need_one_newline = TRUE;
- }
-
- while ((temp_vpos < start_region_vpos) &&
- (more_than_line_break(temp_vpos, start_region_vpos, height))) {
- html_newline();
- temp_vpos += height;
- }
- }
- }
- if (auto_on && (is_in_middle(start_region_hpos, end_region_hpos))) {
- is_center = TRUE;
- } else {
- if (start_region_hpos > get_left()) {
- make_html_indent(start_region_hpos-get_left());
- }
- }
- output_vpos = start_region_vpos;
- output_hpos = start_region_hpos;
- return( is_center );
-}
-
-/*
- * gs_x - translate and scale the x axis
- */
-
-int html_printer::gs_x (int x)
-{
- x += IMAGE_BOARDER_PIXELS/2;
- return((x-start_region_hpos)*postscript_res/font::res);
-}
-
-
-/*
- * gs_y - translate and scale the y axis
- */
-
-int html_printer::gs_y (int y)
-{
- int yoffset=((int)(A4_PAGE_LENGTH*(double)font::res))-end_region_vpos;
-
- y += IMAGE_BOARDER_PIXELS/2;
- return( (y+yoffset)*postscript_res/font::res );
-}
-
-
-void html_printer::troff_position_text (text_glob *g)
-{
- change_font(g, FALSE);
-
- troff.put_string("V");
- troff.put_number(gs_y(g->maxv));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->minh));
- troff.put_string("\n");
-}
-
-void html_printer::troff_change_font (const char *fontname, int size, int font_no)
-{
- troff.put_string("x font ");
- troff.put_number(font_no);
- troff.put_string(" ");
- troff.put_string(fontname);
- troff.put_string("\nf");
- troff.put_number(font_no);
- troff.put_string("\ns");
- troff.put_number(size*1000);
- troff.put_string("\n");
-}
-
-
-void html_printer::set_style(const style &sty)
-{
-#if 0
- const char *fontname = sty.f->get_name();
- if (fontname == 0)
- fatal("no internalname specified for font");
-
- change_font(fontname, (font::res/(72*font::sizescale))*sty.point_size);
-#endif
-}
-
-void html_printer::end_of_line()
-{
- flush_sbuf();
- output_hpos = -1;
-}
-
-void html_printer::html_display_word (text_glob *g)
-{
-#if 0
- if (strcmp(g->text_string, "ot") == 0) {
- stop();
- }
-#endif
- if (! check_able_to_use_table(g)) {
- char *postword=html_position_text(g, left_margin_indent, right_margin_indent);
-
- if (! header.written_header) {
- if (g->is_raw_command) {
- html.put_string((char *)g->text_string);
- } else {
- translate_to_html(g);
- }
- if (postword != 0) {
- html.put_string(postword);
- }
- need_one_newline = TRUE;
- issued_newline = FALSE;
- }
- }
-}
-
-void html_printer::troff_display_word (text_glob *g)
-{
- troff_position_text(g);
- if (g->is_raw_command) {
- int l=strlen((char *)g->text_string);
- if (l == 1) {
- troff.put_string("c");
- troff.put_string((char *)g->text_string);
- troff.put_string("\n");
- } else if (l > 1) {
- troff.put_string("C");
- troff.put_troffps_char((char *)g->text_string);
- troff.put_string("\n");
- }
- } else {
- troff_position_text(g);
- troff.put_string("t");
- troff.put_translated_string((const char *)g->text_string);
- troff.put_string("\n");
- }
-}
-
-void html_printer::display_word (text_glob *g, int is_to_html)
-{
- if (is_to_html) {
- html_display_word(g);
- } else if ((g->is_raw_command) && (g->is_html_command)) {
- // found a raw html command inside a graphic glob.
- // We should emit the command to the html device, but of course we
- // cannot place it correctly as we are dealing with troff words.
- // Remember output_vpos will refer to troff and not html.
- html.put_string((char *)g->text_string);
- } else {
- troff_display_word(g);
- }
-}
-
-/*
- * translate_to_html - translates a textual string into html text
- */
-
-void html_printer::translate_to_html (text_glob *g)
-{
- char buf[MAX_STRING_LENGTH];
-
- str_translate_to_html(g->text_style.f, buf, MAX_STRING_LENGTH,
- g->text_string, g->text_length, TRUE);
- html.put_string(buf);
-}
-
-/*
- * html_knows_about - given a character name, troff, return TRUE
- * if we know how to display this character using
- * html unicode.
- */
-
-int html_printer::html_knows_about (char *troff)
-{
- // --fixme-- needs to have similar code as above
- return( FALSE );
-}
-
-/*
- * display_fill - generates a troff format fill command
- */
-
-void html_printer::display_fill (graphic_glob *g)
-{
- troff.put_string("Df ") ;
- troff.put_number(g->fill);
- troff.put_string(" 0\n");
-}
-
-/*
- * display_line - displays a line using troff format
- */
-
-void html_printer::display_line (graphic_glob *g, int is_to_html)
-{
- if (is_to_html) {
- fatal("cannot emit lines in html");
- }
- if (g->code == 'l') {
- // straight line
-
- troff.put_string("V");
- troff.put_number(gs_y(g->point[0].y));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->point[0].x));
- troff.put_string("\n");
-
- display_fill(g);
-
- troff.put_string("Dl ");
- troff.put_number((g->point[1].x-g->point[0].x)*postscript_res/font::res);
- troff.put_string(" ");
- troff.put_number((g->point[1].y-g->point[0].y)*postscript_res/font::res);
- troff.put_string("\n");
- // printf("line %c %d %d %d %d size %d\n", (char)g->code, g->point[0].x, g->point[0].y,
- // g->point[1].x, g->point[1].y, g->size);
- } else if ((g->code == 'c') || (g->code == 'C')) {
- // circle
-
- int xradius = (g->maxh - g->minh) / 2;
- int yradius = (g->maxv - g->minv) / 2;
- // center of circle or elipse
-
- troff.put_string("V");
- troff.put_number(gs_y(g->minv+yradius));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->minh));
- troff.put_string("\n");
-
- display_fill(g);
-
- if (g->code == 'c') {
- troff.put_string("Dc ");
- } else {
- troff.put_string("DC ");
- }
-
- troff.put_number(xradius*2*postscript_res/font::res);
- troff.put_string("\n");
-
- } else if ((g->code == 'e') || (g->code == 'E')) {
- // ellipse
-
- int xradius = (g->maxh - g->minh) / 2;
- int yradius = (g->maxv - g->minv) / 2;
- // center of elipse - this is untested
-
- troff.put_string("V");
- troff.put_number(gs_y(g->minv+yradius));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->minh));
- troff.put_string("\n");
-
- display_fill(g);
-
- if (g->code == 'e') {
- troff.put_string("De ");
- } else {
- troff.put_string("DE ");
- }
-
- troff.put_number(xradius*2*postscript_res/font::res);
- troff.put_string(" ");
- troff.put_number(yradius*2*postscript_res/font::res);
- troff.put_string("\n");
- } else if ((g->code == 'p') || (g->code == 'P')) {
- // polygon
- troff.put_string("V");
- troff.put_number(gs_y(g->yc));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->xc));
- troff.put_string("\n");
-
- display_fill(g);
-
- if (g->code == 'p') {
- troff.put_string("Dp");
- } else {
- troff.put_string("DP");
- }
-
- int i;
- int xc=g->xc;
- int yc=g->yc;
- for (i=0; inopoints; i++) {
- troff.put_string(" ");
- troff.put_number((g->point[i].x-xc)*postscript_res/font::res);
- troff.put_string(" ");
- troff.put_number((g->point[i].y-yc)*postscript_res/font::res);
- xc = g->point[i].x;
- yc = g->point[i].y;
- }
- troff.put_string("\n");
- } else if (g->code == 'a') {
- // arc
- troff.put_string("V");
- troff.put_number(gs_y(g->yc));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->xc));
- troff.put_string("\n");
-
- display_fill(g);
-
- troff.put_string("Da");
-
- int i;
-
- for (i=0; inopoints; i++) {
- troff.put_string(" ");
- troff.put_number(g->point[i].x*postscript_res/font::res);
- troff.put_string(" ");
- troff.put_number(g->point[i].y*postscript_res/font::res);
- }
- troff.put_string("\n");
- } else if (g->code == '~') {
- // spline
- troff.put_string("V");
- troff.put_number(gs_y(g->yc));
- troff.put_string("\n");
-
- troff.put_string("H");
- troff.put_number(gs_x(g->xc));
- troff.put_string("\n");
-
- display_fill(g);
-
- troff.put_string("D~");
-
- int i;
- int xc=g->xc;
- int yc=g->yc;
- for (i=0; inopoints; i++) {
- troff.put_string(" ");
- troff.put_number((g->point[i].x-xc)*postscript_res/font::res);
- troff.put_string(" ");
- troff.put_number((g->point[i].y-yc)*postscript_res/font::res);
- xc = g->point[i].x;
- yc = g->point[i].y;
- }
- troff.put_string("\n");
- }
-}
-
-
-/*
- * flush_sbuf - flushes the current sbuf into the list of glyphs.
- */
-
-void html_printer::flush_sbuf()
-{
- if (sbuf_len > 0) {
- int r=font::res; // resolution of the device
- set_style(sbuf_style);
-
- page_contents->add(&sbuf_style, sbuf, sbuf_len,
- sbuf_vpos-sbuf_style.point_size*r/72, sbuf_start_hpos,
- sbuf_vpos , sbuf_end_hpos);
-
- output_hpos = sbuf_end_hpos;
- output_vpos = sbuf_vpos;
- sbuf_len = 0;
- sbuf_dmark_hpos = -1;
- }
-}
-
-
-void html_printer::set_line_thickness(const environment *env)
-{
- line_thickness = env->size;
- printf("line thickness = %d\n", line_thickness);
-}
-
-void html_printer::draw(int code, int *p, int np, const environment *env)
-{
- switch (code) {
-
- case 'l':
- if (np == 2) {
- page_contents->add_line(code,
- env->hpos, env->vpos, env->hpos+p[0], env->vpos+p[1],
- env->size, fill);
- } else {
- error("2 arguments required for line");
- }
- break;
- case 't':
- {
- if (np == 0) {
- line_thickness = -1;
- } else {
- // troff gratuitously adds an extra 0
- if (np != 1 && np != 2) {
- error("0 or 1 argument required for thickness");
- break;
- }
- line_thickness = p[0];
- }
- break;
- }
-
- case 'P':
- // fall through
- case 'p':
- {
- if (np & 1) {
- error("even number of arguments required for polygon");
- break;
- }
- if (np == 0) {
- error("no arguments for polygon");
- break;
- }
- // firstly lets add our current position to polygon
- int oh=env->hpos;
- int ov=env->vpos;
- int i=0;
-
- while (iadd_polygon(code, np, p, env->hpos, env->vpos, env->size, fill);
- }
- break;
- case 'E':
- // fall through
- case 'e':
- if (np != 2) {
- error("2 arguments required for ellipse");
- break;
- }
- page_contents->add_line(code,
- env->hpos, env->vpos-p[1]/2, env->hpos+p[0], env->vpos+p[1]/2,
- env->size, fill);
-
- break;
- case 'C':
- // fill circle
-
- case 'c':
- {
- // troff adds an extra argument to C
- if (np != 1 && !(code == 'C' && np == 2)) {
- error("1 argument required for circle");
- break;
- }
- page_contents->add_line(code,
- env->hpos, env->vpos-p[0]/2, env->hpos+p[0], env->vpos+p[0]/2,
- env->size, fill);
- }
- break;
- case 'a':
- {
- if (np == 4) {
- double c[2];
-
- if (adjust_arc_center(p, c)) {
- page_contents->add_arc('a', env->hpos, env->vpos, p, c, env->size, fill);
- } else {
- // a straignt line
- page_contents->add_line('l', env->hpos, env->vpos, p[0]+p[2], p[1]+p[3], env->size, fill);
- }
- } else {
- error("4 arguments required for arc");
- }
- }
- break;
- case '~':
- {
- if (np & 1) {
- error("even number of arguments required for spline");
- break;
- }
- if (np == 0) {
- error("no arguments for spline");
- break;
- }
- // firstly lets add our current position to spline
- int oh=env->hpos;
- int ov=env->vpos;
- int i=0;
-
- while (iadd_spline('~', env->hpos, env->vpos, np, p, env->size, fill);
- }
- break;
- case 'f':
- {
- if (np != 1 && np != 2) {
- error("1 argument required for fill");
- break;
- }
- fill = p[0];
- if (fill < 0 || fill > FILL_MAX) {
- // This means fill with the current color.
- fill = FILL_MAX + 1;
- }
- break;
- }
-
- default:
- error("unrecognised drawing command `%1'", char(code));
- break;
- }
-}
-
-
-void html_printer::begin_page(int n)
-{
- page_number = n;
- html.begin_comment("Page: ").comment_arg(i_to_a(page_number)).end_comment();;
- no_of_printed_pages++;
-
- output_style.f = 0;
- output_space_code = 32;
- output_draw_point_size = -1;
- output_line_thickness = -1;
- output_hpos = -1;
- output_vpos = -1;
-}
-
-void testing (text_glob *g) {}
-
-void html_printer::flush_graphic (void)
-{
- graphic_glob g;
-
- graphic_level = 0;
- page_contents->is_in_graphic = FALSE;
-
- g.minv = -1;
- g.maxv = -1;
- calculate_region_range(&g);
- if (g.minv != -1) {
- page_contents->make_new_region(&g);
- }
- move_region_to_page();
-}
-
-void html_printer::end_page(int)
-{
- flush_sbuf();
- flush_graphic();
- flush_page();
-}
-
-font *html_printer::make_font(const char *nm)
-{
- return html_font::load_html_font(nm);
-}
-
-html_printer::~html_printer()
-{
- if (fseek(tempfp, 0L, 0) < 0)
- fatal("fseek on temporary file failed");
- html.set_file(stdout);
- fputs("\n", stdout);
- fputs("\n", stdout);
- fputs("\n", stdout);
- write_title(TRUE);
- fputs("\n", stdout);
- fputs("\n", stdout);
- write_title(FALSE);
- header.write_headings(stdout);
- {
- extern const char *Version_string;
- html.begin_comment("Creator : ")
- .comment_arg("groff ")
- .comment_arg("version ")
- .comment_arg(Version_string)
- .end_comment();
- }
- {
-#ifdef LONG_FOR_TIME_T
- long
-#else
- time_t
-#endif
- t = time(0);
- html.begin_comment("CreationDate: ")
- .comment_arg(ctime(&t))
- .end_comment();
- }
- html.begin_comment("Total number of pages: ").comment_arg(i_to_a(no_of_printed_pages)).end_comment();
- html.end_line();
- html.copy_file(tempfp);
- fputs("\n", stdout);
- fputs("\n", stdout);
- fclose(tempfp);
-}
-
-
-/*
- * calculate_region_range - calculates the vertical range for words and lines
- * within the region lists.
- */
-
-void html_printer::calculate_region_range (graphic_glob *r)
-{
- text_glob *w;
- graphic_glob *g;
-
- if (! page_contents->region_lines.is_empty()) {
- page_contents->region_lines.start_from_head();
- do {
- g = page_contents->region_lines.get_data();
- if ((r->minv == -1) || (g->minv < r->minv)) {
- r->minv = g->minv;
- }
- if ((r->maxv == -1) || (g->maxv > r->maxv)) {
- r->maxv = g->maxv;
- }
- page_contents->region_lines.move_right();
- } while (! page_contents->region_lines.is_equal_to_head());
- }
- if (! page_contents->region_words.is_empty()) {
- page_contents->region_words.start_from_head();
- do {
- w = page_contents->region_words.get_data();
-
- if ((r->minv == -1) || (w->minv < r->minv)) {
- r->minv = w->minv;
- }
- if ((r->maxv == -1) || (w->maxv > r->maxv)) {
- r->maxv = w->maxv;
- }
- page_contents->region_words.move_right();
- } while (! page_contents->region_words.is_equal_to_head());
- }
-}
-
-
-/*
- * move_region_to_page - moves lines and words held in the temporary region
- * list to the page list.
- */
-
-void html_printer::move_region_to_page (void)
-{
- text_glob *w;
- graphic_glob *g;
-
- page_contents->region_lines.start_from_head();
- while (! page_contents->region_lines.is_empty()) {
- g = page_contents->region_lines.get_data(); // remove from our temporary region list
- page_contents->lines.add(g); // and add to the page list
- page_contents->region_lines.sub_move_right();
- }
- page_contents->region_words.start_from_head();
- while (! page_contents->region_words.is_empty()) {
- w = page_contents->region_words.get_data(); // remove from our temporary region list
- page_contents->words.add(w); // and add to the page list
- page_contents->region_words.sub_move_right();
- }
-}
-
-/*
- * is_graphic_start - returns TRUE if the start of table, pic, eqn was seen.
- */
-
-int is_graphic_start (char *s)
-{
- return( (strcmp(s, "graphic-start") == 0) ||
- ((strcmp(s, "table-start") == 0) && (table_image_on)) );
-}
-
-/*
- * is_graphic_end - return TRUE if the end of a table, pic, eqn was seen.
- */
-
-int is_graphic_end (char *s)
-{
- return( (strcmp(s, "graphic-end") == 0) ||
- ((strcmp(s, "table-end") == 0) && (table_image_on)) );
-}
-
-/*
- * special - handle all x X requests from troff. For grohtml they allow users
- * to pass raw html commands, turn auto linked headings off/on and
- * also allow tbl, eqn & pic say what commands they have generated.
- */
-
-void html_printer::special(char *s, const environment *env)
-{
- if (s != 0) {
- if (is_graphic_start(s)) {
- graphic_level++;
- if (graphic_level == 1) {
- page_contents->is_in_graphic = TRUE; // add words and lines to temporary region lists
- }
- } else if (is_graphic_end(s) && (graphic_level > 0)) {
- graphic_level--;
- if (graphic_level == 0) {
- flush_graphic();
- }
- } else if (strncmp(s, "html:", 5) == 0) {
- int r=font::res; // resolution of the device
- char buf[MAX_STRING_LENGTH];
- font *f=sbuf_style.f;
-
- if (f == NULL) {
- int found=FALSE;
-
- f = font::load_font("TR", &found);
- }
- str_translate_to_html(f, buf, MAX_STRING_LENGTH,
- &s[5], strlen(s)-5, FALSE);
- page_contents->add_html_command(&sbuf_style, buf, strlen(buf),
-
- // need to pass rest of string through to html output during flush
-
- env->vpos-env->size*r/72, env->hpos,
- env->vpos , env->hpos);
- // assume that the html command has no width, if it does then we hopefully troff
- // will have fudged this in a macro and requested that the formatting move right by
- // the appropriate width
- } else if (strncmp(s, "index:", 6) == 0) {
- cutoff_heading = atoi(&s[6]);
- }
- }
-}
-
-void set_image_type (char *type)
-{
- if (strcmp(type, "gif") == 0) {
- image_type = gif;
- } else if (strcmp(type, "png") == 0) {
- image_type = png;
- image_device = "png256";
- } else if (strncmp(type, "png", 3) == 0) {
- image_type = png;
- image_device = type;
- }
-}
-
-printer *make_printer()
-{
- return new html_printer;
-}
-
-static void usage();
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- int c;
- while ((c = getopt(argc, argv, "F:atTvdgmx?I:r:")) != EOF)
- switch(c) {
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "grohtml version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case 'a':
- auto_on = FALSE;
- break;
- case 't':
- table_on = FALSE;
- break;
- case 'T':
- table_image_on = FALSE;
- break;
- case 'F':
- font::command_line_font_dir(optarg);
- break;
- case 'I':
- // user specifying the type of images we should generate
- set_image_type(optarg);
- break;
- case 'r':
- // resolution (dots per inch for an image)
- image_res = atoi(optarg);
- break;
- case 'd':
- // debugging on
- debug_on = TRUE;
- break;
- case 'x':
- debug_table_on = TRUE;
- break;
- case 'g':
- // do not guess title and headings
- guess_on = FALSE;
- break;
- case 'm':
- // leave margins alone
- margin_on = TRUE;
- break;
- case '?':
- usage();
- break;
- default:
- assert(0);
- }
- if (optind >= argc) {
- do_file("-");
- } else {
- for (int i = optind; i < argc; i++)
- do_file(argv[i]);
- }
- delete pr;
- return 0;
-}
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-avdgmt?] [-r resolution] [-F dir] [-I imagetype] [files ...]\n",
- program_name);
- exit(1);
-}
diff --git a/contrib/groff/grohtml/html.h b/contrib/groff/grohtml/html.h
deleted file mode 100644
index 370077517b6b..000000000000
--- a/contrib/groff/grohtml/html.h
+++ /dev/null
@@ -1,57 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-class simple_output {
-public:
- simple_output(FILE *, int max_line_length);
- simple_output &put_string(const char *, int);
- simple_output &put_string(const char *s);
- simple_output &put_troffps_char (const char *s);
- simple_output &put_translated_string(const char *s);
- simple_output &put_number(int);
- simple_output &put_float(double);
- simple_output &put_symbol(const char *);
- simple_output &put_literal_symbol(const char *);
- simple_output &set_fixed_point(int);
- simple_output &simple_comment(const char *);
- simple_output &begin_comment(const char *);
- simple_output &comment_arg(const char *);
- simple_output &end_comment();
- simple_output &set_file(FILE *);
- simple_output &include_file(FILE *);
- simple_output ©_file(FILE *);
- simple_output &end_line();
- simple_output &put_raw_char(char);
- simple_output &special(const char *);
- simple_output &put_html_char (char);
- FILE *get_file();
-private:
- FILE *fp;
- int max_line_length; // not including newline
- int col;
- int need_space;
- int fixed_point;
-};
-
-inline FILE *simple_output::get_file()
-{
- return fp;
-}
-
diff --git a/contrib/groff/grohtml/html_chars.h b/contrib/groff/grohtml/html_chars.h
deleted file mode 100644
index 76f094c83a7f..000000000000
--- a/contrib/groff/grohtml/html_chars.h
+++ /dev/null
@@ -1,27 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 2000 Free Software Foundation, Inc.
- *
- * Gaius Mulley (gaius@glam.ac.uk) wrote output.cc
- * but it owes a huge amount of ideas and raw code from
- * James Clark (jjc@jclark.com) grops/ps.cc.
- *
- * html_chars.h
- *
- * provides a diacritical character combination table for html
- */
-
-
-
-struct diacritical_desc {
- char *mark;
- char *second_troff_char;
- char translation;
-};
-
-
-static struct diacritical_desc diacritical_table[] = {
- { "ad" , "aeiouyAEIOU" , ':' , }, /* */
- { "ac" , "cC" , ',' , }, /* cedilla */
- { "aa" , "aeiouyAEIOU" , '\'' , }, /* acute */
- { NULL , NULL , (char)0, },
-};
diff --git a/contrib/groff/grohtml/ordered_list.h b/contrib/groff/grohtml/ordered_list.h
deleted file mode 100644
index 5f0c7e1d0c47..000000000000
--- a/contrib/groff/grohtml/ordered_list.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/*
- * Copyright (C) 1999 Free Software Foundation, Inc.
- *
- * Ordered list, a template module for simple ordered list manipulation.
- *
- * Gaius Mulley (gaius@glam.ac.uk)
- */
-
-template class list_element
-{
- public:
- list_element *right;
- list_element *left;
-
- list_element (T *in);
- T *data;
-};
-
-template class ordered_list
-{
- private:
- list_element *head;
- list_element *tail;
- list_element *ptr;
- public:
- ordered_list (void);
- ~ ordered_list (void);
- void add (T* in);
- void sub_move_right (void);
- void move_right (void);
- void move_left (void);
- int is_empty (void);
- int is_equal_to_tail (void);
- int is_equal_to_head (void);
- void start_from_head (void);
- void start_from_tail (void);
- T *move_right_get_data (void);
- T *move_left_get_data (void);
- T *get_data (void);
-};
-
-
-template ordered_list::ordered_list()
- : head(0), tail(0), ptr(0)
-{
-}
-
-template ordered_list::~ordered_list()
-{
- list_element *temp=head;
-
- do {
- temp = head;
- if (temp != 0) {
- head = head->right;
- delete temp;
- }
- } while ((head != 0) && (head != tail));
-}
-
-template list_element::list_element(T *in)
- : right(0), left(0)
-{
- data = in;
-}
-
-template void ordered_list::add(T *in)
-{
- list_element *t = new list_element(in); // create a new list element with data field initialized
- list_element *last;
-
- if (in == 0) {
- fatal("cannot add NULL to ordered list");
- }
-
- if (head == 0) {
- head = t;
- tail = t;
- t->left = t;
- t->right = t;
- } else {
- last = tail;
-
- while ((last != head) && (in->is_less(in, last->data))) {
- last = last->left;
- }
-
- if (in->is_less(in, last->data)) {
- t->right = last;
- last->left->right = t;
- t->left = last->left;
- last->left = t;
- // now check for a new head
- if (last == head) {
- head = t;
- }
- } else {
- // add t onto beyond last
- t->right = last->right;
- t->left = last;
- last->right->left = t;
- last->right = t;
- // now check for a new tail
- if (last == tail) {
- tail = t;
- }
- }
- }
-}
-
-template void ordered_list::sub_move_right (void)
-{
- list_element *t=ptr->right;
-
- if (head == tail) {
- head = 0;
- if (tail != 0) {
- delete tail;
- }
- tail = 0;
- ptr = 0;
- } else {
- if (head == ptr) {
- head = head->right;
- }
- if (tail == ptr) {
- tail = tail->left;
- }
- ptr->left->right = ptr->right;
- ptr->right->left = ptr->left;
- ptr=t;
- }
-}
-
-template void ordered_list::start_from_head (void)
-{
- ptr = head;
-}
-
-template void ordered_list::start_from_tail (void)
-{
- ptr = tail;
-}
-
-template int ordered_list::is_empty (void)
-{
- return( head == 0 );
-}
-
-template int ordered_list::is_equal_to_tail (void)
-{
- return( ptr == tail );
-}
-
-template int ordered_list::is_equal_to_head (void)
-{
- return( ptr == head );
-}
-
-template void ordered_list::move_left (void)
-{
- ptr = ptr->left;
-}
-
-template void ordered_list::move_right (void)
-{
- ptr = ptr->right;
-}
-
-template T* ordered_list::get_data (void)
-{
- return( ptr->data );
-}
-
-template T* ordered_list::move_right_get_data (void)
-{
- ptr = ptr->right;
- if (ptr == head) {
- return( 0 );
- } else {
- return( ptr->data );
- }
-}
-
-template T* ordered_list::move_left_get_data (void)
-{
- ptr = ptr->left;
- if (ptr == tail) {
- return( 0 );
- } else {
- return( ptr->data );
- }
-}
diff --git a/contrib/groff/grohtml/output.cc b/contrib/groff/grohtml/output.cc
deleted file mode 100644
index d6dc18849baf..000000000000
--- a/contrib/groff/grohtml/output.cc
+++ /dev/null
@@ -1,257 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 2000 Free Software Foundation, Inc.
- *
- * Gaius Mulley (gaius@glam.ac.uk) wrote output.cc
- * but it owes a huge amount of ideas and raw code from
- * James Clark (jjc@jclark.com) grops/ps.cc.
- *
- * output.cc
- *
- * provide the simple low level output routines needed by html.cc
- */
-
-/*
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "driver.h"
-#include "stringclass.h"
-#include "cset.h"
-
-#include
-#include "html.h"
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-#if !defined(TRUE)
-# define TRUE (1==1)
-#endif
-#if !defined(FALSE)
-# define FALSE (1==0)
-#endif
-
-
-/*
- * the classes and methods for simple_output manipulation
- */
-
-simple_output::simple_output(FILE *f, int n)
-: fp(f), max_line_length(n), col(0), need_space(0), fixed_point(0)
-{
-}
-
-simple_output &simple_output::set_file(FILE *f)
-{
- fp = f;
- col = 0;
- return *this;
-}
-
-simple_output &simple_output::copy_file(FILE *infp)
-{
- int c;
- while ((c = getc(infp)) != EOF)
- putc(c, fp);
- return *this;
-}
-
-simple_output &simple_output::end_line()
-{
- if (col != 0) {
- putc('\n', fp);
- col = 0;
- need_space = 0;
- }
- return *this;
-}
-
-simple_output &simple_output::special(const char *s)
-{
- return *this;
-}
-
-simple_output &simple_output::simple_comment(const char *s)
-{
- if (col != 0)
- putc('\n', fp);
- fputs("\n", fp);
- col = 0;
- need_space = 0;
- return *this;
-}
-
-simple_output &simple_output::begin_comment(const char *s)
-{
- if (col != 0)
- putc('\n', fp);
- fputs("\n", fp);
- col = 0;
- need_space = 0;
- return *this;
-}
-
-simple_output &simple_output::comment_arg(const char *s)
-{
- int len = strlen(s);
-
- if (col + len + 1 > max_line_length) {
- fputs("\n ", fp);
- col = 1;
- }
- fputs(s, fp);
- col += len + 1;
- return *this;
-}
-
-simple_output &simple_output::set_fixed_point(int n)
-{
- assert(n >= 0 && n <= 10);
- fixed_point = n;
- return *this;
-}
-
-simple_output &simple_output::put_raw_char(char c)
-{
- putc(c, fp);
- col++;
- need_space = 0;
- return *this;
-}
-
-simple_output &simple_output::put_string(const char *s, int n)
-{
- int i=0;
-
- while (i for the grolbp
-program.
-..
-.de TQ
-.br
-.ns
-.TP \\$1
-..
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.TH GROLBP @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-grolbp \- groff driver for Canon CAPSL printers (LBP-4 and LBP-8 series laser printers).
-.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fBgrolbp 'u
-.ti \niu
-.B grolpb
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.OP \-l
-.OP \-\-landscape
-.OP \-v
-.OP \-\-version
-.OP \-c n
-.OP \-\-copies= numcopies
-.OP \-p paper_size
-.OP \-\-papersize= paper_size
-.OP \-o orientation
-.OP \-\-orientation= orientation
-.OP \-F dir
-.OP \-\-fontdir= dir
-.OP \-h
-.OP \-\-help
-.RI "[\ " files\|.\|.\|. "\ ]"
-.br
-.ad \na
-.SH DESCRIPTION
-.B grolbp
-is a driver for
-.B groff
-that produces output in CAPSL and VDM format suitable for Canon LBP\-4 and
-LBP\-8 printers.
-.LP
-For compatibility with grolj4 there is an additional drawing command
-available:
-.TP
-.BI \eD'R\ dh\ dv '
-Draw a rule (i.e.\ a solid black rectangle), with one corner at the current
-position, and the diagonally opposite corner at the current position
-.RI +( dh , dv ).
-.SH OPTIONS
-Note that there can be whitespace between a one-letter option and its
-argument; on the other hand, there must be whitespace and/or an equal sign
-(`=') between a long-name option and its argument.
-.TP
-.BI \-c numcopies
-.TQ
-.BI \-\-copies= numcopies
-Print
-.I numcopies
-copies of each page.
-.TP
-.B \-l
-.TQ
-.B \-\-landscape
-Print the document with a landscape orientation.
-.TP
-.BI \-p paper_size
-.TQ
-.BI \-\-papersize= paper_size
-Set the paper size to
-.IR paper_size ,
-which must be a valid paper size description as indicated in the section
-.BR "PAPER SIZES" .
-.TP
-.BI \-o orientation
-.TQ
-.BI \-\-orientation= orientation
-Print the document with
-.I orientation
-orientation, which must be `portrait' or `landscape'.
-.TP
-.B \-v
-.TQ
-.B \-\-version
-Print the version number.
-.TP
-.BI \-F dir
-.TQ
-.BI \-\-fontdir= dir
-Search directory
-.IB dir /devlbp
-for font and device description files.
-.TP
-.B \-h
-.TQ
-.B \-\-help
-Print a short help text.
-.SH TYPEFACES
-The driver supports the Dutch, Swiss and Swiss-Narrow scalable typefaces,
-each one in the Regular, Bold, Italic and Bold-Italic styles.
-Additionally, the Courier and Elite monospaced typefaces at the sizes 8 and
-12 points (for Courier) resp. 8 and 10 points (for Elite) are supported,
-each one in the Regular, Bold and Italic styles.
-.PP
-The following chart summarizes the font names you can use to access these
-fonts:
-.PP
-.TS
-tab(|) allbox center;
-c c c c c
-ab c c c c
-.
-Typeface | Regular | Bold | Italic | Bold-Italic
-Dutch | TR | TB | TI | TBI
-Swiss | HR | HB | HI | HBI
-Swiss Narrow | HNR | HNB | HNI | HNBI
-Courier | CR | CB | CI |
-Elite | ER | EB | EI |
-.TE
-.PP
-.SH PAPER SIZES
-The paper size can be set in the
-.B DESC
-file or with command line options to
-.BR grolbp .
-If the paper size is specified both ways, the command line options take
-precedence over the contents of the
-.B DESC
-file (this applies to the page orientation too).
-.PP
-To set the paper size in the
-.B DESC
-file, insert in that file a line containing
-.B papersize
-.IR desired_papersize ,
-where
-.I desired_papersize
-is:
-.IP \(bu 4
-One of the recognized paper sizes: `a4', `letter', `legal' or `executive'.
-.IP \(bu 4
-A custom defined paper size, as described in the
-.B CUSTOM PAPER SIZES
-subsection below.
-.IP \(bu 4
-The name of a file (e.g.
-.IR /etc/papersize )
-whose first line must be the desired paper size in one of the above formats.
-.PP
-If there are various papersize lines in the
-.B DESC
-file, only the first valid one is used.
-.PP
-To set the paper size in the command line, add
-.sp 1
-.in +2m
-.BI \-p \ desired_papersize
-.in -2m
-.sp 1
-or
-.sp 1
-.in +2m
-.BI \-\-papersize= desired_papersize
-.in -2m
-.sp 1
-to the other
-.B grolbp
-options, where
-.B desired_papersize
-is in the same format as in the
-.B DESC
-file.
-.PP
-Paper sizes are case insensitive (i.e., `A4' is the same as `a4').
-.PP
-If no paper size is specified in the
-.B DESC
-file or the command line, a default size of A4 is used.
-.TP
-.SH CUSTOM PAPER SIZES
-Custom defined paper sizes are in the form
-.BI cust length x width
-where
-.I length
-and
-.I width
-are the dimensions of the paper you want to to use, specified in printer
-units (1/300 of an inch).
-For instance, to print in a postcard sized paper which is two inches long
-and four inches wide you can insert a line containing
-.sp 1
-.in +2m
-.B papersize cust600x1200
-.in -2m
-.sp 1
-at the beginning of the
-.B DESC
-file.
-.SH PAGE ORIENTATION
-As with the page size, the orientation of the printed page
-.RB ( portrait
-or
-.BR landscape )
-can be set in the
-.B DESC
-file or with command line options.
-It is also case insensitive.
-.PP
-To set the orientation in the
-.B DESC
-file, insert a line with the following content:
-.sp 1
-.in +2m
-.B orientation
-.RB [ portrait | landscape ]
-.in -2m
-.sp 1
-As with paper sizes, only the first valid orientation command in the
-.B DESC
-file is used.
-.PP
-To set the page orientation with command line options you can use the
-.B \-o
-or
-.B \-\-orientation
-option with the same parameters
-.RB ( portrait
-or
-.BR landscape )
-as in the
-.B DESC
-file.
-Or you can use the
-.B \-l
-option to force the pages to be printed in landscape.
-.SH FONT FILE FORMAT
-In addition to the usual commands described in
-.BR groff_font (@MAN5EXT@),
-.B grolbp
-provides the command
-.I lbpname
-which sets the font name sent to the printer when requesting this font.
-The syntax of this command is:
-.sp 1
-.in +2m
-.B lbpname
-.I printer_font_name
-.in -2m
-.IP \(bu
-For bitmapped fonts,
-.I printer_font_name
-has the form
-.sp 1
-.in +2m
-.RI N\(la base_fontname \(ra\(la font_style \(ra
-.in -2m
-.sp 1
-.I base_fontname
-is the font name as it appears in the printers font listings without the
-first letter, up to (but not including) the font size.
-.I font_style
-can be one of the letters
-.BR R ,
-.BR I ,
-or
-.BR B ,
-indicating the font styles Roman, Italic and Bold respectively.
-.IP
-For instance, if the printer's
-.I font listing A
-shows font `Nelite12I.ISO_USA', the corresponding entry in the font
-description file is
-.sp 1
-.in +2m
-.B lbpname NeliteI
-.in -2m
-.IP
-Note that you may need to modify
-.B grolbp
-to add support for new bitmapped fonts, since the available font names and
-font sizes of bitmapped fonts (as documented above) are hard-coded into the
-program.
-.IP \(bu
-For scalable fonts,
-.I printer_font_name
-is identical to the font name as it appears in the printer's
-.IR "font listing A" .
-.IP
-For instance, to select the `Swiss' font in bold style, which appears in
-the printer's
-.I font listing A
-as `Swiss-Bold', the required
-.B lbpname
-command line is
-.sp 1
-.in +2m
-.B lbpname Swiss-Bold
-.in -2m
-.sp 1
-.PP
-The argument of
-.B lbpname
-is case sensitive.
-.SH FILES
-.TP
-.B @FONTDIR@/devlbp/DESC
-Device description file.
-.TP
-.BI @FONTDIR@/devlbp/ F
-Font description file for font
-.IR F .
-.SH SEE ALSO
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR groff_out (@MAN5EXT@),
-.BR groff_font (@MAN5EXT@),
-.BR groff_char (@MAN7EXT@)
-.\"
-.\" Local Variables:
-.\" mode: nroff
-.\" End:
diff --git a/contrib/groff/grolbp/lbp.cc b/contrib/groff/grolbp/lbp.cc
deleted file mode 100644
index fe06e1c41cf4..000000000000
--- a/contrib/groff/grolbp/lbp.cc
+++ /dev/null
@@ -1,772 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1994 Free Software Foundation, Inc.
- Written by Francisco Andrés Verdú with many ideas
- taken from the other groff drivers.
-
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/*
-TODO
-
- - Add X command to include bitmaps
-*/
-#define _GNU_SOURCE
-
-#include "driver.h"
-#include "lbp.h"
-#include "charset.h"
-
-#include "nonposix.h"
-
-#ifdef HAVE_STRNCASECMP
-#ifdef NEED_DECLARATION_STRNCASECMP
-extern "C" {
- // SunOS's string.h fails to declare this.
- int strncasecmp(const char *, const char *, int);
-}
-#endif /* NEED_DECLARATION_STRNCASECMP */
-#endif /* HAVE_STRNCASECMP */
-
-static short int papersize = -1, // papersize
- orientation = -1 , // orientation
- paperlength = 0, // Custom Paper size
- paperwidth = 0,
- ncopies = 1; // Number of copies
-
-class lbp_font : public font {
-public:
- ~lbp_font();
- void handle_unknown_font_command(const char *command, const char *arg,
- const char *filename, int lineno);
- static lbp_font *load_lbp_font(const char *);
- char *lbpname;
- char is_scalable;
-private:
- lbp_font(const char *);
-};
-
-class lbp_printer : public printer {
-public:
- lbp_printer();
- ~lbp_printer();
- void set_char(int, font *, const environment *, int, const char *name);
- void draw(int code, int *p, int np, const environment *env);
- void begin_page(int);
- void end_page(int page_length);
- font *make_font(const char *);
- void end_of_line();
-private:
- void set_line_thickness(int size, int dot = 0);
- void vdmstart();
- void vdmflush(); // the name vdmend was already used in lbp.h
- void setfillmode(int mode);
- void polygon( int hpos,int vpos,int np,int *p);
- char *font_name(const lbp_font *f, const int siz);
-
- int fill_pattern;
- int fill_mode;
- int cur_hpos;
- int cur_vpos;
- lbp_font *cur_font;
- int cur_size;
- unsigned short cur_symbol_set;
- int line_thickness;
-};
-
-// Compatibility section.
-//
-// Here we define some functions not present in some of the targets
-// platforms
-#ifndef HAVE_STRSEP
-// Solaris 8 doesn't have the strsep function
-static char *strsep(char **pcadena, const char *delim)
-{
- char *p;
-
- p = strtok(*pcadena,delim);
- *pcadena = strtok(NULL,delim);
- return p;
-
-};
-#endif
-
-#ifndef HAVE_STRDUP
-// Ditto with OS/390 and strdup
-static char *strdup(const char *s)
-{
- char *result;
-
- result = (char *)malloc(strlen(s)+1);
- if (result != NULL) strcpy(result,s);
- return result;
-
-}; // strdup
-
-#endif
-lbp_font::lbp_font(const char *nm)
-: font(nm)
-{
-}
-
-lbp_font::~lbp_font()
-{
-}
-
-lbp_font *lbp_font::load_lbp_font(const char *s)
-{
- lbp_font *f = new lbp_font(s);
- f->lbpname = NULL;
- f->is_scalable = 1; // Default is that fonts are scalable
- if (!f->load()) {
- delete f;
- return 0;
- }
- return f;
-}
-
-
-void lbp_font::handle_unknown_font_command(const char *command,
- const char *arg,
- const char *filename, int lineno)
-{
- if (strcmp(command, "lbpname") == 0) {
- if (arg == 0)
- fatal_with_file_and_line(filename, lineno,
- "`%1' command requires an argument",
- command);
- this->lbpname = new char[strlen(arg)+1];
- strcpy(this->lbpname,arg);
- // We Recongnize bitmaped fonts by the first character of it's name
- if (arg[0] == 'N') this->is_scalable = 0;
- // fprintf(stderr,"Loading font \"%s\" \n",arg);
- }; // if (strcmp(command, "lbpname")
- // fprintf(stderr,"Loading font %s \"%s\" in %s at %d\n",command,arg,filename,lineno);
-};
-
-static void wp54charset()
-{
- int i;
-
- lbpputs("\033[714;100;29;0;32;120.}");
- for (i = 0; i < sizeof(symset) ; i++) lbpputc(symset[i]);
- lbpputs("\033[100;0 D");
- return ;
-};
-
-lbp_printer::lbp_printer()
-: fill_pattern(1),
- fill_mode(0),
- cur_hpos(-1),
- cur_font(0),
- cur_size(0),
- cur_symbol_set(0),
- line_thickness(-1)
-{
-#ifdef SET_BINARY
- SET_BINARY(fileno(stdout));
-#endif
- lbpinit(stdout);
- lbpputs("\033c\033;\033[2&z\033[7 I\033[?32h\033[?33h\033[11h");
- wp54charset(); // Define the new symbol set
- lbpputs("\033[7 I\033[?32h\033[?33h\033[11h");
- // Paper size handling
- if (orientation < 0) orientation = 0;// Default orientation is portrait
- if (papersize < 0) papersize = 14; // Default paper size is A4
- if (papersize < 80) // standard paper
- lbpprintf("\033[%dp",(papersize | orientation));
- else // Custom paper
- lbpprintf("\033[%d;%d;%dp",(papersize | orientation),\
- paperlength,paperwidth);
-
- // Number of copies
- lbpprintf("\033[%dv\n",ncopies);
-
- lbpputs("\033[0u\033[1u\033P1y Grolbp\033\\");
- lbpmoveabs(0,0);
- lbpputs("\033[0t\033[2t");
- lbpputs("\033('$2\033)' 1"); // Primary symbol set IBML
- // Secondary symbol set IBMR1
- cur_symbol_set = 0;
-};
-
-lbp_printer::~lbp_printer()
-{
- lbpputs("\033P1y\033\\");
- lbpputs("\033c\033<");
-}
-
-void lbp_printer::begin_page(int)
-{
-}
-
-void lbp_printer::end_page(int)
-{
- if (vdminited()) vdmflush();
- lbpputc('\f');
- cur_hpos = -1;
-}
-
-void lbp_printer::end_of_line()
-{
- cur_hpos = -1; // force absolute motion
-}
-
-char *lbp_printer::font_name(const lbp_font *f, const int siz)
-{
- static char bfont_name[255] ; // The resulting font name
- char type, // Italic, Roman, Bold
- ori, // Normal or Rotated
- *nam; // The font name without other data.
-// nam[strlen(f->lbpname)-2]; // The font name without other data.
- int cpi; // The font size in characters per inch
- // (Bitmaped fonts are monospaced).
-
-
- /* Bitmap font selection is ugly in this printer, so don't expect
- this function to be elegant. */
-
- bfont_name[0] = 0x00;
- if (orientation) // Landscape
- ori = 'R';
- else // Portrait
- ori = 'N';
- type = f->lbpname[strlen(f->lbpname)-1];
- nam = new char[strlen(f->lbpname)-2];
- strncpy(nam,&(f->lbpname[1]),strlen(f->lbpname)-2);
- nam[strlen(f->lbpname)-2] = 0x00;
- // fprintf(stderr,"Bitmap font '%s' %d %c %c \n",nam,siz,type,ori);
- /* Since these fonts are avaiable only at certain sizes,
- 10 and 17 cpi for courier, 12 and 17 cpi for elite,
- we adjust the resulting size. */
- cpi = 17;
- // Fortunately there were only two bitmaped fonts shiped with the printer.
- if (!strcasecmp(nam,"courier"))
- { // Courier font
- if (siz >= 12) cpi = 10;
- else cpi = 17;
- };
- if (!strcasecmp(nam,"elite"))
- { // Elite font
- if (siz >= 10) cpi = 12;
- else cpi = 17;
- };
-
- // Now that we have all the data, let's generate the font name.
- if ((type != 'B') && (type != 'I')) // Roman font
- sprintf(bfont_name,"%c%s%d",ori,nam,cpi);
- else
- sprintf(bfont_name,"%c%s%d%c",ori,nam,cpi,type);
-
- return bfont_name;
-
-}; // lbp_printer::font_name
-
-void lbp_printer::set_char(int index, font *f, const environment *env, int w, const char *name)
-{
- int code = f->get_code(index);
-
- unsigned char ch = code & 0xff;
- unsigned short symbol_set = code >> 8;
- if (f != cur_font) {
- lbp_font *psf = (lbp_font *)f;
- // fprintf(stderr,"Loading font %s \"%d\" \n",psf->lbpname,env->size);
- if (psf->is_scalable)
- { // Scalable font selection is different from bitmaped
- lbpprintf("\033Pz%s.IBML\033\\\033[%d C",psf->lbpname,\
- (int)((env->size*300)/72));
- } else
- { // Bitmaped font
- lbpprintf("\033Pz%s.IBML\033\\\n",font_name(psf,env->size));
- };
- lbpputs("\033)' 1"); // Select IBML and IBMR1 symbol set
- cur_size = env->size;
- cur_font = psf;
- cur_symbol_set = 0;
- }
- if (symbol_set != cur_symbol_set) {
- if ( cur_symbol_set == 3 ) {
- // if current symbol set is Symbol we must restore the font
- lbpprintf("\033Pz%s.IBML\033\\\033[%d C",cur_font->lbpname,\
- (int)((env->size*300)/72));
- }; // if ( cur_symbol_set == 3 )
- switch (symbol_set) {
- case 0: lbpputs("\033('$2\033)' 1"); // Select IBML and IBMR1 symbol sets
- break;
- case 1: lbpputs("\033(d\033)' 1"); // Select wp54 symbol set
- break;
- case 2: lbpputs("\033('$2\033)'!0"); // Select IBMP symbol set
- break;
- case 3: lbpprintf("\033PzSymbol.SYML\033\\\033[%d C",\
- (int)((env->size*300)/72));
- lbpputs("\033(\"!!0\033)\"!!1"); // Select symbol font
- break;
- case 4: lbpputs("\033)\"! 1\033(\"!$2"); // Select PS symbol set
- break;
- }; // switch (symbol_set)
-
-// if (symbol_set == 1) lbpputs("\033(d"); // Select wp54 symbol set
-// else lbpputs("\033('$2\033)' 1"); // Select IBML and IBMR1 symbol sets
- cur_symbol_set = symbol_set;
- }
- if (env->size != cur_size) {
-
- if (!cur_font->is_scalable)
- lbpprintf("\033Pz%s.IBML\033\\\n",font_name(cur_font,env->size));
- else
- lbpprintf("\033[%d C",(int)((env->size*300)/72));
- cur_size = env->size;
- }
- if ((env->hpos != cur_hpos) || (env->vpos != cur_vpos))
- {
- // lbpmoveabs(env->hpos - ((5*300)/16),env->vpos );
- lbpmoveabs(env->hpos - 64,env->vpos - 64 );
- cur_vpos = env->vpos;
- cur_hpos = env->hpos;
- };
- if ((ch & 0x7F) < 32) lbpputs("\033[1.v");
- lbpputc(ch);
- cur_hpos += w;
-};
-
-void
-lbp_printer::vdmstart()
-{
- FILE *f;
- static int changed_origin = 0;
-
- errno = 0;
- f = tmpfile();
- // f = fopen("/tmp/gtmp","w+");
- if (f == NULL) perror("Openinig temp file");
- vdminit(f);
- if (!changed_origin) { // we should change the origin only one time
- changed_origin = 1;
- vdmorigin(-63,0);
- };
- vdmlinewidth(line_thickness);
-
-};
-
-void
-lbp_printer::vdmflush()
-{
- char buffer[1024];
- int bytes_read = 1;
-
- vdmend();
- fflush(lbpoutput);
- /* lets copy the vdm code to the output */
- rewind(vdmoutput);
- do
- {
- bytes_read = fread(buffer,1,sizeof(buffer),vdmoutput);
- bytes_read = fwrite(buffer,1,bytes_read,lbpoutput);
- } while ( bytes_read == sizeof(buffer));
-
- fclose(vdmoutput); // This will also delete the file,
- // since it is created by tmpfile()
- vdmoutput = NULL;
-
-}; // lbp_printer::vdmflush
-
-inline void
-lbp_printer::setfillmode(int mode)
-{
- if (mode != fill_mode) {
- if (mode != 1) vdmsetfillmode(mode,1,0);
- else vdmsetfillmode(mode,1,1); // To get black we must use white
- // inverted
- fill_mode = mode;
- };
-}; // setfillmode
-
-inline void
-lbp_printer::polygon( int hpos,int vpos,int np,int *p)
-{
- //int points[np+2],i;
- int *points,i;
-
- points = new int[np+2];
- points[0] = hpos;
- points[1] = vpos;
-/* fprintf(stderr,"Poligon (%d,%d) ", points[0],points[1]);*/
- for (i = 0; i < np; i++) points[i+2] = p[i];
-/* for (i = 0; i < np; i++) fprintf(stderr," %d ",p[i]);
- fprintf(stderr,"\n"); */
- vdmpolygon((np /2) + 1,points);
-};
-
-void lbp_printer::draw(int code, int *p, int np, const environment *env)
-{
- switch (code) {
- case 't':
- if (np == 0) line_thickness = 1;
- else { // troff gratuitously adds an extra 0
- if (np != 1 && np != 2) {
- error("0 or 1 argument required for thickness");
- break;
- } // if (np != ...
- if (p[0] == 0) line_thickness = 1;
- if (p[0] < 0) // Default = 1 point
- line_thickness = (int)(env->size*30/72);
- line_thickness = (int)((abs(p[0])*env->size)/10);
- if ((line_thickness > 16 ) && (!vdminited()))
- { /* for greater thickness we must use VDM */
- vdmstart();
- /* vdmlinewidth(line_thickness); already done in
- * vdmstart() */
- };
- if (vdminited()) vdmlinewidth(line_thickness);
- // fprintf(stderr,"\nthickness: %d == %d, size %d\n",
- // p[0],line_thickness,env->size );
- } // else
- break;
-
- case 'l': // Line
- if (np != 2) {
- error("2 arguments required for line");
- break;
- };
- if (!vdminited()) vdmstart();
- vdmline(env->hpos,env->vpos,p[0],p[1]);
- /*fprintf(stderr,"\nline: %d,%d - %d,%d thickness %d == %d\n",\
- env->hpos - 64,env->vpos -64, env->hpos - 64 + p[0],\
- env->vpos -64 + p[1],env->size, line_thickness);*/
- break;
- case 'R': // Rule
- if (np != 2) {
- error("2 arguments required for Rule");
- break;
- }
- if (vdminited()) {
- setfillmode(fill_pattern); // Solid Rule
- vdmrectangle(env->hpos,env->vpos,p[0],p[1]);
- }
- else {
- lbpruleabs(env->hpos - 64,env->vpos -64 , p[0], p[1]);
- cur_vpos = p[1];
- cur_hpos = p[0];
- };
- fprintf(stderr,"\nrule: thickness %d == %d\n", env->size, line_thickness);
- break;
- case 'P': // Filled Polygon
- if (!vdminited()) vdmstart();
- setfillmode(fill_pattern);
- polygon(env->hpos,env->vpos,np,p);
- break;
- case 'p': // Empty Polygon
- if (!vdminited()) vdmstart();
- setfillmode(0);
- polygon(env->hpos,env->vpos,np,p);
- break;
- case 'C': // Filled Circle
- if (!vdminited()) vdmstart();
- // fprintf(stderr,"Circle (%d,%d) Fill %d\n",env->hpos,env->vpos,fill_pattern);
- setfillmode(fill_pattern);
- vdmcircle(env->hpos + (p[0]/2),env->vpos,p[0]/2);
- break;
- case 'c': // Empty Circle
- if (!vdminited()) vdmstart();
- setfillmode(0);
- vdmcircle(env->hpos + (p[0]/2),env->vpos,p[0]/2);
- break;
- case 'E': // Filled Ellipse
- if (!vdminited()) vdmstart();
- setfillmode(fill_pattern);
- vdmellipse(env->hpos + (p[0]/2),env->vpos,p[0]/2,p[1]/2,0);
- break;
- case 'e': // Empty Ellipse
- if (!vdminited()) vdmstart();
- setfillmode(0);
- vdmellipse(env->hpos + (p[0]/2),env->vpos,p[0]/2,p[1]/2,0);
- break;
- case 'a': // Arc
- if (!vdminited()) vdmstart();
- setfillmode(0);
- // VDM draws arcs clockwise and pic counterclockwise
- // We must compensate for that, exchanging the starting and
- // ending points
- vdmvarc(env->hpos + p[0],env->vpos+p[1],\
- int(sqrt( double((p[0]*p[0])+(p[1]*p[1])))),\
- p[2],p[3],\
- (-p[0]),(-p[1]),1,2);
- break;
- case '~': // Spline
- if (!vdminited()) vdmstart();
- setfillmode(0);
- vdmspline(np/2,env->hpos,env->vpos,p);
- break;
- case 'f':
- if (np != 1 && np != 2) {
- error("1 argument required for fill");
- break;
- };
- // fprintf(stderr,"Fill %d\n",p[0]);
- if ((p[0] == 1) || (p[0] >= 1000)) { // Black
- fill_pattern = 1;
- break;
- }; // if (p[0] == 1)
- if (p[0] == 0) { // White
- fill_pattern = 0;
- break;
- };
- if ((p[0] > 1) && (p[0] < 1000))
- {
- if (p[0] >= 990) fill_pattern = -23;
- else if (p[0] >= 700) fill_pattern = -28;
- else if (p[0] >= 500) fill_pattern = -27;
- else if (p[0] >= 400) fill_pattern = -26;
- else if (p[0] >= 300) fill_pattern = -25;
- else if (p[0] >= 200) fill_pattern = -22;
- else if (p[0] >= 100) fill_pattern = -24;
- else fill_pattern = -21;
- }; // if (p[0] >= 0 && p[0] <= 1000)
- break;
- default:
- error("unrecognised drawing command `%1'", char(code));
- break;
- }; // switch (code)
- return ;
-};
-
-font *lbp_printer::make_font(const char *nm)
-{
- return lbp_font::load_lbp_font(nm);
-}
-
-
-
-printer *make_printer()
-{
- return new lbp_printer;
-}
-
-static struct
-{
- const char *name;
- int code;
-} papersizes[] =
-{{ "A4", 14 },
-{ "letter", 30 },
-{ "legal", 32 },
-{ "executive", 40 },
-};
-
-
-static int set_papersize(const char *papersize)
-{
- int i;
-
- // First test for a standard (i.e. supported directly by the printer)
- // papersize
- for (i = 0 ; i < sizeof(papersizes)/sizeof(papersizes[0]); i++)
- {
- if (strcasecmp(papersizes[i].name,papersize) == 0)
- return papersizes[i].code;
- };
-
- // Now test for a custom papersize
- if (strncasecmp("cust",papersize,4) == 0)
- {
- char *p ,
- *p1,
- *papsize;
-
- p = papsize = strdup(&papersize[4]);
- if (papsize == NULL) return -1;
- p1 = strsep(&p,"x");
- if (p == NULL)
- { // let's test for an uppercase x
- p = papsize ;
- p1 = strsep(&p,"X");
- if (p == NULL) { free(papsize); return -1;};
- }; // if (p1 == NULL)
- paperlength = atoi(p1);
- if (paperlength == 0) { free(papsize); return -1;};
- paperwidth = atoi(p);
- if (paperwidth == 0) { free(papsize); return -1;};
- free(papsize);
- return 82;
- }; // if (strcnasecmp("cust",papersize,4) == 0)
-
- return -1;
-};
-
-static int handle_papersize_command(const char *arg)
-{
- int n = set_papersize(arg);
-
- if (n < 0)
- { // If is not a standard nor custom paper size
- // let's see if it's a file (i.e /etc/papersize )
- FILE *f = fopen(arg,"r");
- if (f != NULL)
- { // the file exists and is readable
- char psize[255],*p;
- fgets(psize,254,f);
- fclose(f);
- // set_papersize doesn't like the trailing \n
- p = psize; while (*p) p++;
- if (*(--p) == '\n') *p = 0x00;
-
- n = set_papersize(psize);
- }; // if (f != NULL)
- }; // if (n < 0)
-
- return n;
-}; // handle_papersize_command
-
-
-static void handle_unknown_desc_command(const char *command, const char *arg,
- const char *filename, int lineno)
-{
- // papersize command
- if (strcasecmp(command, "papersize") == 0) {
- // We give priority to command line options
- if (papersize > 0) return;
- if (arg == 0)
- error_with_file_and_line(filename, lineno,
- "`papersize' command requires an argument");
- else
- {
- int n = handle_papersize_command(arg);
- if (n < 0)
- error_with_file_and_line(filename, lineno,
- "unknown paper size `%1'", arg);
- else
- papersize = n;
-
- }; // if (arg == 0) ... else ...
- }; // if (strcasecmp(command, "papersize")
-
- // orientation command
- if (strcasecmp(command, "orientation") == 0) {
- // We give priority to command line options
- if (orientation > 0) return;
- if (arg == 0)
- error_with_file_and_line(filename, lineno,
- "`papersize' command requires an argument");
- else {
- if (strcasecmp(arg,"portrait") == 0) orientation = 0;
- else { if (strcasecmp(arg,"landscape") == 0) orientation = 1;
- else error_with_file_and_line(filename, lineno,
- "`orientation' command requires an argument");
- };
- }; // if (arg == 0) ... else ...
- }; // if (strcasecmp(command, "orientation") == 0)
-};
-
-static struct option long_options[] = {
- {"orientation",1,NULL,'o'},
- {"version",0,NULL,'v'},
- {"copies",1,NULL,'c'},
- {"landscape",0,NULL,'l'},
- {"papersize",1,NULL,'p'},
- {"fontdir",1,NULL,'F'},
- {"help",0,NULL,'h'},
- {0, 0, 0, 0}
- };
-
-static void usage()
-{
- fprintf(stderr,
- "usage: %s [-lvh] [-c n] [-p paper_size] [-F dir] [-o or] "\
- " [files ...]\n"\
- " -o --orientation=[portrait|landscape]\n"\
- " -v --version\n"\
- " -c --copies=numcopies\n"\
- " -l --landscape\n"\
- " -p --papersize=paper_size\n"\
- " -F --fontdir=dir\n"\
- " -h --help\n",
- program_name);
- exit(1);
-}; // usage
-
-int main(int argc, char **argv)
-{
- if (program_name == NULL) program_name = strdup(argv[0]);
-
- font::set_unknown_desc_command_handler(handle_unknown_desc_command);
- // command line parsing
- int c = 0;
- int option_index = 0;
-
- while (c >= 0 )
- {
- c = getopt_long (argc, argv, "F:p:lvo:c:h",\
- long_options, &option_index);
- switch (c) {
- case 'F' : font::command_line_font_dir(optarg);
- break;
- case 'p' : {
- int n = handle_papersize_command(optarg);
- if (n < 0)
- error("unknown paper size `%1'", optarg);
- else
- papersize = n;
- break;
- };
- case 'l' : orientation = 1;
- break;
- case 'v' : {
- extern const char *version_string;
- fprintf(stderr, "grolbp version %s\n",\
- version_string);
- fflush(stderr);
- break;
- };
- case 'o' : {
- if (strcasecmp(optarg,"portrait") == 0)
- orientation = 0;
- else {
- if (strcasecmp(optarg,"landscape") == 0)
- orientation = 1;
- else
- error("unknown orientation '%1'", optarg);
- };
- break;
- };
- case 'c' : {
- char *ptr;
- long n = strtol(optarg, &ptr, 10);
- if ((n <= 0) && (ptr == optarg))
- error("argument for -c must be a positive integer");
- else if (n <= 0 || n > 32767)
- error("out of range argument for -c");
- else
- ncopies = unsigned(n);
- break;
- }
- case 'h' : usage();
- break;
-
-
- }; // switch (c)
- }; // while (c > 0 )
-
- if (optind >= argc)
- do_file("-");
-
- while (optind < argc) {
- do_file(argv[optind++]);
- };
-
- lbpputs("\033c\033<");
- return 0;
-};
diff --git a/contrib/groff/grolbp/lbp.h b/contrib/groff/grolbp/lbp.h
deleted file mode 100644
index 04e6cecb7f14..000000000000
--- a/contrib/groff/grolbp/lbp.h
+++ /dev/null
@@ -1,512 +0,0 @@
-
-// -*- C -*-
-/* Copyright (C) 1994 Free Software Foundation, Inc.
- Written by Francisco Andrés Verdú
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* This file contains a set of utility functions to use canon CAPSL printers
- * (lbp-4 and lbp-8 series printers) */
-
-#ifndef LBP_H
-#define LBP_H
-
-#include
-#include
-
-static FILE *lbpoutput = NULL;
-static FILE *vdmoutput = NULL;
-
-static inline void
-lbpinit(FILE *outfile)
-{
- lbpoutput = outfile;
-};
-
-
-static inline void
-lbpprintf(char *format, ... )
-{ /* Taken from cjet */
- va_list stuff;
-
- va_start(stuff, format);
- vfprintf(lbpoutput, format, stuff);
- va_end(stuff);
-};
-
-static inline void
-lbpputs(char *data)
-{
- fputs(data,lbpoutput);
-};
-
-static inline void
-lbpputc(char c)
-{
- fputc(c,lbpoutput);
-};
-
-
-static inline void
-lbpsavestatus(int index )
-{
- fprintf(lbpoutput,"\033[%d%%y",index);
-};
-
-static inline void
-lbprestorestatus(int index )
-{
- fprintf(lbpoutput,"\033[%d%cz",index ,'%');
-};
-
-static inline void
-lbpsavepos(int index)
-{
- fprintf(lbpoutput,"\033[1;%d;0x",index);
-};
-
-static inline void
-lbprestorepos(int index)
-{
- fprintf(lbpoutput,"\033[0;%d;0x",index);
-};
-
-static inline void
-lbprestoreposx(int index)
-{
- fprintf(lbpoutput,"\033[0;%d;1x",index);
-};
-
-static inline void
-lbpmoverel(int despl, char direction)
-{
- fprintf(lbpoutput,"\033[%d%c",despl,direction);
-};
-
-static inline void
-lbplinerel(int width,int despl,char direction )
-{
- fprintf(lbpoutput,"\033[%d;0;9{\033[%d%c\033[9}",width,despl,direction);
-};
-
-static inline void
-lbpmoveabs(int x, int y)
-{
- fprintf(lbpoutput,"\033[%d;%df",y,x);
-};
-
-static inline void
-lbplineto(int x,int y, int width )
-{
- fprintf(lbpoutput,"\033[%d;0;9{",width);
- lbpmoveabs(x,y);
- fprintf(lbpoutput,"\033[9}\n");
-};
-
-static inline void
-lbpruleabs(int x, int y, int hsize, int vsize)
-{
- lbpmoveabs(x,y);
- fprintf(lbpoutput,"\033[0;9;000s");
- lbpmoveabs(x+hsize,y+vsize);
- fprintf(lbpoutput,"\033[9r");
-};
-
-static inline void vdmprintf(char *format, ... );
-
-static inline char *
-vdmnum(int num,char *result)
-{
- char b1,b2,b3;
- char *p = result;
- int nm;
-
- nm = abs(num);
- /* First byte 1024 - 32768 */
- b1 = ((nm >> 10) & 0x3F);
- if (b1) *p++ = b1 | 0x40;
-
- /* Second Byte 16 - 1024 */
- b2 = ((nm >> 4) & 0x3F);
- if ( b1 || b2) *p++= b2 | 0x40;
-
- /* Third byte 0 - 15 */
- b3 = ((nm & 0x0F) | 32);
- if (num >= 0) b3 |= 16;
- *p++ = b3;
- *p = 0x00; /* End of the resulting string */
- return result;
-};
-
-static inline void
-vdmorigin(int newx, int newy)
-{
- char nx[4],ny[4];
-
- vdmprintf("}\"%s%s\x1e",vdmnum(newx,nx),vdmnum(newy,ny));
-}; /* vdmorigin */
-
-
-static inline FILE *
-vdminit(FILE *vdmfile)
-{
- char scale[4],size[4],lineend[4];
-
-/* vdmoutput = tmpfile();*/
- vdmoutput = vdmfile;
- /* Initialize the VDM mode */
- vdmprintf("\033[0&}#GROLBP\x1e!0%s%s\x1e$\x1e}F%s\x1e",\
- vdmnum(-3,scale),vdmnum(1,size),vdmnum(1,lineend));
- return vdmoutput;
-
-};
-
-static inline void
-vdmend()
-{
- vdmprintf("}p\x1e");
-};
-
-static inline void
-vdmprintf(char *format, ... )
-{ /* Taken from cjet */
- va_list stuff;
-
- if (vdmoutput == NULL) vdminit(tmpfile());
- va_start(stuff, format);
- vfprintf(vdmoutput, format, stuff);
- va_end(stuff);
-};
-
-static inline void
-vdmsetfillmode(int pattern,int perimeter, int inverted)
-{
- char patt[4],perim[4],
- rot[4], /* rotation */
- espejo[4], /* espejo */
- inv[4]; /* Inverted */
-
- vdmprintf("I%s%s%s%s%s\x1e",vdmnum(pattern,patt),\
- vdmnum(perimeter,perim),vdmnum(0,rot),
- vdmnum(0,espejo),vdmnum(inverted,inv));
-};
-
-static inline void
-vdmcircle(int centerx, int centery, int radius)
-{
- char x[4],y[4],rad[4];
-
- vdmprintf("5%s%s%s\x1e",vdmnum(centerx,x),vdmnum(centery,y),\
- vdmnum(radius,rad));
-};
-
-static inline void
-vdmaarc(int centerx, int centery, int radius,int startangle,int angle,int style,int arcopen)
-{
- char x[4],y[4],rad[4],stx[4],sty[4],styl[4],op[4];
-
- vdmprintf("}6%s%s%s%s%s%s%s\x1e",vdmnum(arcopen,op),\
- vdmnum(centerx,x),vdmnum(centery,y),\
- vdmnum(radius,rad),vdmnum(startangle,stx),vdmnum(angle,sty),\
- vdmnum(style,styl));
-};
-
-static inline void
-vdmvarc(int centerx, int centery,int radius, int startx, int starty, int endx, int endy,\
- int style,int arcopen)
-{
- char x[4],y[4],rad[4],stx[4],sty[4],enx[4],eny[4],styl[4],op[4];
-
- vdmprintf("}6%s%s%s%s%s%s%s%s\x1e",vdmnum(arcopen,op),\
- vdmnum(centerx,x),vdmnum(centery,y),\
- vdmnum(radius,rad),vdmnum(startx,stx),vdmnum(starty,sty),\
- vdmnum(endx,enx),vdmnum(endy,eny),vdmnum(style,styl));
-};
-
-static inline void
-vdmellipse(int centerx, int centery, int radiusx, int radiusy,int rotation)
-{
- char x[4],y[4],radx[4],rady[4],rotat[4];
-
- vdmprintf("}7%s%s%s%s%s\x1e\n",vdmnum(centerx,x),vdmnum(centery,y),\
- vdmnum(radiusx,radx),vdmnum(radiusy,rady),\
- vdmnum(rotation,rotat));
-};
-
-static inline void
-vdmsetlinetype(int lintype)
-{
- char ltyp[4], expfact[4];
-
- vdmprintf("E1%s%s\x1e",vdmnum(lintype,ltyp),vdmnum(1,expfact));
-
-};
-
-static inline void
-vdmsetlinestyle(int lintype, int pattern,int unionstyle)
-{
- char patt[4],ltip[4],
- rot[4], /* rotation */
- espejo[4], /* espejo */
- in[4]; /* Inverted */
-
- vdmprintf("}G%s%s%s%s%s\x1e",vdmnum(lintype,ltip),\
- vdmnum(pattern,patt),vdmnum(0,rot),
- vdmnum(0,espejo),vdmnum(0,in));
- vdmprintf("}F%s",vdmnum(unionstyle,rot));
-};
-
-static inline void
-vdmlinewidth(int width)
-{
- char wh[4];
-
- vdmprintf("F1%s\x1e",vdmnum(width,wh));
-};
-
-static inline void
-vdmrectangle(int origx, int origy,int dstx, int dsty)
-{
- char xcoord[4],ycoord[4],sdstx[4],sdsty[4];
-
- vdmprintf("}:%s%s%s%s\x1e\n",vdmnum(origx,xcoord),vdmnum(dstx,sdstx),\
- vdmnum(origy,ycoord),vdmnum(dsty,sdsty));
-}; /* polyline */
-
-static inline void
-vdmpolyline(int numpoints, int *points)
-{
- int i,*p = points;
- char xcoord[4],ycoord[4];
-
- if (numpoints < 2) return;
- vdmprintf("1%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
- p += 2;
- for (i = 1; i < numpoints ; i++) {
- vdmprintf("%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
- p += 2;
- }; /* for */
- vdmprintf("\x1e\n");
-}; /* polyline */
-
-static inline void
-vdmpolygon(int numpoints, int *points)
-{
- int i,*p = points;
- char xcoord[4],ycoord[4];
-
- if (numpoints < 2) return;
- vdmprintf("2%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
- p += 2;
- for (i = 1; i < numpoints ; i++) {
- vdmprintf("%s%s",vdmnum(*p,xcoord),vdmnum(*(p+1),ycoord));
- p += 2;
- }; /* for */
- vdmprintf("\x1e\n");
-
-}; /* vdmpolygon */
-
-
-/************************************************************************
- * Highter level auxiliary functions *
- ************************************************************************/
-static inline int
-vdminited()
-{
- return (vdmoutput != NULL);
-}; /* vdminited */
-
-
-static inline void
-vdmline(int startx, int starty, int sizex, int sizey)
-{
- int points[4];
-
- points[0] = startx;
- points[1] = starty;
- points[2] = sizex;
- points[3] = sizey;
-
- vdmpolyline(2,points);
-
-};
-
-/*#define THRESHOLD .05 */ /* inch */
-#define THRESHOLD 1 /* points (1/300 inch) */
-static inline void
-splinerel(double px,double py,int flush)
-{
- static int lx = 0 ,ly = 0;
- static float pend = 0.0;
- static int dy = 0, despx = 0, despy = 0, sigpend = 0;
- int dxnew ,dynew, sg;
- char xcoord[4],ycoord[4];
- float npend ;
-
- if (flush == -1) {lx = (int)px; ly = (int)py; return;};
-
- if (flush == 0) {
- dxnew = (int)px -lx;
- dynew = (int)py -ly;
- if ((dxnew == 0) && (dynew == 0)) return;
- sg = (dxnew < 0)? -1 : 0;
-/* fprintf(stderr,"s (%d,%d) (%d,%d)\n",dxnew,dynew,despx,despy);*/
- if (dynew == 0) {
- despx = dxnew;
- if ((sg == sigpend) && (dy == 0)){
- return;
- };
- dy = 0;
- }
- else {
- dy = 1;
- npend = (1.0*dxnew)/dynew;
- if (( npend == pend) && (sigpend == sg))
- { despy = dynew; despx = dxnew; return; }
- else
- { sigpend = sg;
- pend = npend;
- }; /* else (( npend == pend) && ... */
- }; /* else (if (dynew == 0)) */
- }; /* if (!flush ) */
-
- /* if we've changed direction we must draw the line */
-/* fprintf(stderr," (%d) %.2f,%.2f\n",flush,(float)px,(float)py);*/
- if ((despx != 0) || (despy != 0)) vdmprintf("%s%s",vdmnum(despx,xcoord),\
- vdmnum(despy,ycoord));
- /*if ((despx != 0) || (despy != 0)) fprintf(stderr,"2
- *%d,%d\n",despx,despy);*/
- if (flush) {
- dxnew = dy = despx = despy = 0;
- return;
- }; /* if (flush) */
- dxnew -= despx;
- dynew -= despy;
- if ((dxnew != 0) || (dynew != 0)) vdmprintf("%s%s",vdmnum(dxnew,xcoord),\
- vdmnum(dynew,ycoord));
-
-/* if ((dxnew != 0) || (dynew != 0)) fprintf(stderr,"3
- * %d,%d\n",dxnew,dynew);*/
- lx = (int)px; ly = (int)py;
- dxnew = dy = despx = despy = 0;
-
-}; /* splinerel */
-
-/**********************************************************************
- * The following code to draw splines is adapted from the transfig package
- */
-static void
-quadratic_spline(double a1,double b1, double a2, double b2, \
- double a3, double b3, double a4, double b4)
-{
- double x1, y1, x4, y4;
- double xmid, ymid;
-
- x1 = a1; y1 = b1;
- x4 = a4; y4 = b4;
- xmid = (a2 + a3)/2.0;
- ymid = (b2 + b3)/2.0;
- if ((fabs(x1 - xmid) < THRESHOLD) && (fabs(y1 - ymid) < THRESHOLD)) {
- splinerel(xmid,ymid,0);
-/* fprintf(tfp, "PA%.4f,%.4f;\n", xmid, ymid);*/
- }
- else {
- quadratic_spline(x1, y1, ((x1+a2)/2.0), ((y1+b2)/2.0),
- ((3.0*a2+a3)/4.0), ((3.0*b2+b3)/4.0), xmid, ymid);
- }
-
- if ((fabs(xmid - x4) < THRESHOLD) && (fabs(ymid - y4) < THRESHOLD)) {
- splinerel(x4,y4,0);
-/* fprintf(tfp, "PA%.4f,%.4f;\n", x4, y4);*/
- }
- else {
- quadratic_spline(xmid, ymid, ((a2+3.0*a3)/4.0), ((b2+3.0*b3)/4.0),
- ((a3+x4)/2.0), ((b3+y4)/2.0), x4, y4);
- };
-}; /* quadratic_spline */
-
-#define XCOORD(i) numbers[(2*i)]
-#define YCOORD(i) numbers[(2*i)+1]
-static void
-vdmspline(int numpoints, int ox,int oy, int *numbers)
-{
- double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
- double x1, y1, x2, y2;
- char xcoord[4],ycoord[4];
- int i;
-
- /*p = s->points;
- x1 = p->x/ppi;*/
- x1 = ox;
- y1 = oy;
-/* p = p->next;
- x2 = p->x/ppi;
- y2 = p->y/ppi;*/
- x2 = ox + XCOORD(0);
- y2 = oy + YCOORD(0);
- cx1 = (x1 + x2)/2.0;
- cy1 = (y1 + y2)/2.0;
- cx2 = (x1 + 3.0*x2)/4.0;
- cy2 = (y1 + 3.0*y2)/4.0;
-
-/* fprintf(stderr,"Spline %d (%d,%d)\n",numpoints,(int)x1,(int)y1);*/
- vdmprintf("1%s%s",vdmnum((int)x1,xcoord),vdmnum((int)y1,ycoord));
- splinerel(x1,y1,-1);
- splinerel(cx1,cy1,0);
-/* fprintf(tfp, "PA%.4f,%.4f;PD%.4f,%.4f;\n",
- x1, y1, cx1, cy1);*/
-
- /*for (p = p->next; p != NULL; p = p->next) {*/
- for (i = 1; i < (numpoints); i++) {
- x1 = x2;
- y1 = y2;
-/* x2 = p->x/ppi;
- y2 = p->y/ppi;*/
- x2 = x1 + XCOORD(i);
- y2 = y1 + YCOORD(i);
- cx3 = (3.0*x1 + x2)/4.0;
- cy3 = (3.0*y1 + y2)/4.0;
- cx4 = (x1 + x2)/2.0;
- cy4 = (y1 + y2)/2.0;
- /* fprintf(stderr,"Point (%d,%d) - (%d,%d)\n",(int)x1,(int)(y1),(int)x2,(int)y2);*/
- quadratic_spline(cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4);
- cx1 = cx4;
- cy1 = cy4;
- cx2 = (x1 + 3.0*x2)/4.0;
- cy2 = (y1 + 3.0*y2)/4.0;
- }
- x1 = x2;
- y1 = y2;
-/* p = s->points->next;
- x2 = p->x/ppi;
- y2 = p->y/ppi;*/
- x2 = ox + XCOORD(0);
- y2 = oy + YCOORD(0);
- cx3 = (3.0*x1 + x2)/4.0;
- cy3 = (3.0*y1 + y2)/4.0;
- cx4 = (x1 + x2)/2.0;
- cy4 = (y1 + y2)/2.0;
- splinerel(x1,y1,0);
- splinerel(x1,y1,1);
- /*vdmprintf("%s%s",vdmnum((int)(x1-lx),xcoord),\
- vdmnum((int)(y1-ly),ycoord));*/
- vdmprintf("\x1e\n");
-/* fprintf(tfp, "PA%.4f,%.4f;PU;\n", x1, y1);*/
-
-
-}; /* vdmspline */
-
-
-#endif
diff --git a/contrib/groff/grolj4/Makefile.dep b/contrib/groff/grolj4/Makefile.dep
deleted file mode 100644
index 3fa1d22f8d09..000000000000
--- a/contrib/groff/grolj4/Makefile.dep
+++ /dev/null
@@ -1,3 +0,0 @@
-lj4.o: lj4.cc ../include/driver.h ../include/errarg.h \
- ../include/error.h ../include/font.h ../include/printer.h \
- ../include/lib.h
diff --git a/contrib/groff/grolj4/Makefile.sub b/contrib/groff/grolj4/Makefile.sub
deleted file mode 100644
index bbb0cff0dc5a..000000000000
--- a/contrib/groff/grolj4/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=grolj4
-MAN1=grolj4.n
-XLIBS=$(LIBDRIVER) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=lj4.o
-CCSRCS=$(srcdir)/lj4.cc
diff --git a/contrib/groff/grolj4/grolj4.man b/contrib/groff/grolj4/grolj4.man
deleted file mode 100644
index e2d582647578..000000000000
--- a/contrib/groff/grolj4/grolj4.man
+++ /dev/null
@@ -1,144 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1994-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.TH GROLJ4 @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-grolj4 \- groff driver for HP Laserjet 4 family
-.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fBgrolj4 'u
-.ti \niu
-.B grolj4
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.OP \-lv
-.OP \-d \fR[\fPn\fR]\fP
-.OP \-c n
-.OP \-p paper_size
-.OP \-w n
-.OP \-F dir
-.RI "[\ " files\|.\|.\|. "\ ]"
-.br
-.ad \na
-.PP
-It is possible to have whitespace between a command line option and its
-parameter.
-.SH DESCRIPTION
-.B grolj4
-is a driver for
-.B groff
-that produces output in PCL5 format suitable for an HP Laserjet 4 printer.
-.LP
-There is an additional drawing command available:
-.TP
-.BI \eD'R\ dh\ dv '
-Draw a rule (solid black rectangle), with one corner
-at the current position, and the diagonally opposite corner
-at the current position
-.RI +( dh , dv ).
-Afterwards the current position will be at the opposite corner. This
-generates a PCL fill rectangle command, and so will work on
-printers that do not support HPGL/2 unlike the other
-.B \eD
-commands.
-.SH OPTIONS
-.TP
-.BI \-c n
-Print
-.I n
-copies of each page.
-.TP
-.B \-l
-Print the document with a landscape orientation.
-.TP
-.BI "\-d [" n ]
-Use duplex mode
-.IR n :
-1\ is long-side binding; 2\ is short-side binding;
-default is\ 1.
-.TP
-.BI \-p size
-Set the paper size to
-.IR size ,
-which must be one of
-letter, legal, executive, a4, com10, monarch, c5, b5, dl.
-.TP
-.B \-v
-Print the version number.
-.TP
-.BI \-w n
-Set the default line thickness to
-.I n
-thousandths of an em.
-.TP
-.BI \-F dir
-Search directory
-.IB dir /devlj4
-for font and device description files.
-.LP
-The following four commands are available additionally in the
-.B DESC
-file:
-.TP
-.BI pclweight \ N
-The integer value
-.I N
-must be in the range -7 to +7; default is 0.
-.TP
-.BI pclstyle \ N
-The integer value
-.I N
-must be in the range 0 to 32767; default is 0.
-.TP
-.BI pclproportional \ N
-A boolean flag which can be either 0 or 1; default is 0.
-.TP
-.BI pcltypeface \ N
-The integer value
-.I N
-must be in the range 0 to 65535; default is 0.
-.SH FILES
-.TP
-.B @FONTDIR@/devlj4/DESC
-Device description file.
-.TP
-.BI @FONTDIR@/devlj4/ F
-Font description file for font
-.IR F .
-.TP
-.B @MACRODIR@/tmac.lj4
-Macros for use with
-.BR grolj4 .
-.SH BUGS
-Small dots.
-.SH "SEE ALSO"
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR groff_out (@MAN5EXT@),
-.BR groff_font (@MAN5EXT@),
-.BR groff_char (@MAN7EXT@)
diff --git a/contrib/groff/grolj4/lj4.cc b/contrib/groff/grolj4/lj4.cc
deleted file mode 100644
index 0c23a456eb28..000000000000
--- a/contrib/groff/grolj4/lj4.cc
+++ /dev/null
@@ -1,700 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1994 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/*
-TODO
-
-option to use beziers for circle/ellipse/arc
-option to use lines for spline (for LJ3)
-left/top offset registration
-output bin selection option
-paper source option
-output non-integer parameters using fixed point numbers
-X command to insert contents of file
-X command to specify inline escape sequence (how to specify unprintable chars?)
-X command to include bitmap graphics
-*/
-
-#include "driver.h"
-#include "nonposix.h"
-
-static struct {
- const char *name;
- int code;
- // at 300dpi
- int x_offset_portrait;
- int x_offset_landscape;
-} paper_table[] = {
- { "letter", 2, 75, 60 },
- { "legal", 3, 75, 60 },
- { "executive", 1, 75, 60 },
- { "a4", 26, 71, 59 },
- { "com10", 81, 75, 60 },
- { "monarch", 80, 75, 60 },
- { "c5", 91, 71, 59 },
- { "b5", 100, 71, 59 },
- { "dl", 90, 71, 59 },
-};
-
-static int paper_size = -1;
-static int landscape_flag = 0;
-static int duplex_flag = 0;
-
-// An upper limit on the paper size in centipoints,
-// used for setting HPGL picture frame.
-#define MAX_PAPER_WIDTH (12*720)
-#define MAX_PAPER_HEIGHT (17*720)
-
-// Dotted lines that are thinner than this don't work right.
-#define MIN_DOT_PEN_WIDTH .351
-
-#ifndef DEFAULT_LINE_WIDTH_FACTOR
-// in ems/1000
-#define DEFAULT_LINE_WIDTH_FACTOR 40
-#endif
-
-const int DEFAULT_HPGL_UNITS = 1016;
-int line_width_factor = DEFAULT_LINE_WIDTH_FACTOR;
-unsigned ncopies = 0; // 0 means don't send ncopies command
-
-class lj4_font : public font {
-public:
- ~lj4_font();
- void handle_unknown_font_command(const char *command, const char *arg,
- const char *filename, int lineno);
- static lj4_font *load_lj4_font(const char *);
- int weight;
- int style;
- int proportional;
- int typeface;
-private:
- lj4_font(const char *);
-};
-
-lj4_font::lj4_font(const char *nm)
-: font(nm), weight(0), style(0), proportional(0), typeface(0)
-{
-}
-
-lj4_font::~lj4_font()
-{
-}
-
-lj4_font *lj4_font::load_lj4_font(const char *s)
-{
- lj4_font *f = new lj4_font(s);
- if (!f->load()) {
- delete f;
- return 0;
- }
- return f;
-}
-
-static struct {
- const char *s;
- int lj4_font::*ptr;
- int min;
- int max;
-} command_table[] = {
- { "pclweight", &lj4_font::weight, -7, 7 },
- { "pclstyle", &lj4_font::style, 0, 32767 },
- { "pclproportional", &lj4_font::proportional, 0, 1 },
- { "pcltypeface", &lj4_font::typeface, 0, 65535 },
-};
-
-void lj4_font::handle_unknown_font_command(const char *command,
- const char *arg,
- const char *filename, int lineno)
-{
- for (int i = 0; i < sizeof(command_table)/sizeof(command_table[0]); i++) {
- if (strcmp(command, command_table[i].s) == 0) {
- if (arg == 0)
- fatal_with_file_and_line(filename, lineno,
- "`%1' command requires an argument",
- command);
- char *ptr;
- long n = strtol(arg, &ptr, 10);
- if (n == 0 && ptr == arg)
- fatal_with_file_and_line(filename, lineno,
- "`%1' command requires numeric argument",
- command);
- if (n < command_table[i].min) {
- error_with_file_and_line(filename, lineno,
- "argument for `%1' command must not be less than %2",
- command, command_table[i].min);
- n = command_table[i].min;
- }
- else if (n > command_table[i].max) {
- error_with_file_and_line(filename, lineno,
- "argument for `%1' command must not be greater than %2",
- command, command_table[i].max);
- n = command_table[i].max;
- }
- this->*command_table[i].ptr = int(n);
- break;
- }
- }
-}
-
-class lj4_printer : public printer {
-public:
- lj4_printer();
- ~lj4_printer();
- void set_char(int, font *, const environment *, int, const char *name);
- void draw(int code, int *p, int np, const environment *env);
- void begin_page(int);
- void end_page(int page_length);
- font *make_font(const char *);
- void end_of_line();
-private:
- void set_line_thickness(int size, int dot = 0);
- void hpgl_init();
- void hpgl_start();
- void hpgl_end();
- int moveto(int hpos, int vpos);
- int moveto1(int hpos, int vpos);
-
- int cur_hpos;
- int cur_vpos;
- lj4_font *cur_font;
- int cur_size;
- unsigned short cur_symbol_set;
- int x_offset;
- int line_thickness;
- double pen_width;
- double hpgl_scale;
- int hpgl_inited;
-};
-
-inline
-int lj4_printer::moveto(int hpos, int vpos)
-{
- if (cur_hpos != hpos || cur_vpos != vpos || cur_hpos < 0)
- return moveto1(hpos, vpos);
- else
- return 1;
-}
-
-inline
-void lj4_printer::hpgl_start()
-{
- fputs("\033%1B", stdout);
-}
-
-inline
-void lj4_printer::hpgl_end()
-{
- fputs(";\033%0A", stdout);
-}
-
-lj4_printer::lj4_printer()
-: cur_hpos(-1),
- cur_font(0),
- cur_size(0),
- cur_symbol_set(0),
- line_thickness(-1),
- pen_width(-1.0),
- hpgl_inited(0)
-{
- if (7200 % font::res != 0)
- fatal("invalid resolution %1: resolution must be a factor of 7200",
- font::res);
- fputs("\033E", stdout); // reset
- if (font::res != 300)
- printf("\033&u%dD", font::res); // unit of measure
- if (ncopies > 0)
- printf("\033&l%uX", ncopies);
- if (paper_size < 0)
- paper_size = 0; // default to letter
- printf("\033&l%dA" // paper size
- "\033&l%dO" // orientation
- "\033&l0E", // no top margin
- paper_table[paper_size].code,
- landscape_flag != 0);
- if (landscape_flag)
- x_offset = paper_table[paper_size].x_offset_landscape;
- else
- x_offset = paper_table[paper_size].x_offset_portrait;
- x_offset = (x_offset * font::res) / 300;
- if (duplex_flag)
- printf("\033&l%dS", duplex_flag);
-}
-
-lj4_printer::~lj4_printer()
-{
- fputs("\033E", stdout);
-}
-
-void lj4_printer::begin_page(int)
-{
-}
-
-void lj4_printer::end_page(int)
-{
- putchar('\f');
- cur_hpos = -1;
-}
-
-void lj4_printer::end_of_line()
-{
- cur_hpos = -1; // force absolute motion
-}
-
-inline
-int is_unprintable(unsigned char c)
-{
- return c < 32 && (c == 0 || (7 <= c && c <= 15) || c == 27);
-}
-
-void lj4_printer::set_char(int index, font *f, const environment *env, int w, const char *name)
-{
- int code = f->get_code(index);
-
- unsigned char ch = code & 0xff;
- unsigned short symbol_set = code >> 8;
- if (symbol_set != cur_symbol_set) {
- printf("\033(%d%c", symbol_set/32, (symbol_set & 31) + 64);
- cur_symbol_set = symbol_set;
- }
- if (f != cur_font) {
- lj4_font *psf = (lj4_font *)f;
- // FIXME only output those that are needed
- printf("\033(s%dp%ds%db%dT",
- psf->proportional,
- psf->style,
- psf->weight,
- psf->typeface);
- if (!psf->proportional || !cur_font || !cur_font->proportional)
- cur_size = 0;
- cur_font = psf;
- }
- if (env->size != cur_size) {
- if (cur_font->proportional) {
- static const char *quarters[] = { "", ".25", ".5", ".75" };
- printf("\033(s%d%sV", env->size/4, quarters[env->size & 3]);
- }
- else {
- double pitch = double(font::res)/w;
- // PCL uses the next largest pitch, so round it down.
- pitch = floor(pitch*100.0)/100.0;
- printf("\033(s%.2fH", pitch);
- }
- cur_size = env->size;
- }
- if (!moveto(env->hpos, env->vpos))
- return;
- if (is_unprintable(ch))
- fputs("\033&p1X", stdout);
- putchar(ch);
- cur_hpos += w;
-}
-
-int lj4_printer::moveto1(int hpos, int vpos)
-{
- if (hpos < x_offset || vpos < 0)
- return 0;
- fputs("\033*p", stdout);
- if (cur_hpos < 0)
- printf("%dx%dY", hpos - x_offset, vpos);
- else {
- if (cur_hpos != hpos)
- printf("%s%d%c", hpos > cur_hpos ? "+" : "",
- hpos - cur_hpos, vpos == cur_vpos ? 'X' : 'x');
- if (cur_vpos != vpos)
- printf("%s%dY", vpos > cur_vpos ? "+" : "", vpos - cur_vpos);
- }
- cur_hpos = hpos;
- cur_vpos = vpos;
- return 1;
-}
-
-void lj4_printer::draw(int code, int *p, int np, const environment *env)
-{
- switch (code) {
- case 'R':
- {
- if (np != 2) {
- error("2 arguments required for rule");
- break;
- }
- int hpos = env->hpos;
- int vpos = env->vpos;
- int hsize = p[0];
- int vsize = p[1];
- if (hsize < 0) {
- hpos += hsize;
- hsize = -hsize;
- }
- if (vsize < 0) {
- vpos += vsize;
- vsize = -vsize;
- }
- if (!moveto(hpos, vpos))
- return;
- printf("\033*c%da%db0P", hsize, vsize);
- break;
- }
- case 'l':
- if (np != 2) {
- error("2 arguments required for line");
- break;
- }
- hpgl_init();
- if (!moveto(env->hpos, env->vpos))
- return;
- hpgl_start();
- set_line_thickness(env->size, p[0] == 0 && p[1] == 0);
- printf("PD%d,%d", p[0], p[1]);
- hpgl_end();
- break;
- case 'p':
- case 'P':
- {
- if (np & 1) {
- error("even number of arguments required for polygon");
- break;
- }
- if (np == 0) {
- error("no arguments for polygon");
- break;
- }
- hpgl_init();
- if (!moveto(env->hpos, env->vpos))
- return;
- hpgl_start();
- if (code == 'p')
- set_line_thickness(env->size);
- printf("PMPD%d", p[0]);
- for (int i = 1; i < np; i++)
- printf(",%d", p[i]);
- printf("PM2%cP", code == 'p' ? 'E' : 'F');
- hpgl_end();
- break;
- }
- case '~':
- {
- if (np & 1) {
- error("even number of arguments required for spline");
- break;
- }
- if (np == 0) {
- error("no arguments for spline");
- break;
- }
- hpgl_init();
- if (!moveto(env->hpos, env->vpos))
- return;
- hpgl_start();
- set_line_thickness(env->size);
- printf("PD%d,%d", p[0]/2, p[1]/2);
- const int tnum = 2;
- const int tden = 3;
- if (np > 2) {
- fputs("BR", stdout);
- for (int i = 0; i < np - 2; i += 2) {
- if (i != 0)
- putchar(',');
- printf("%d,%d,%d,%d,%d,%d",
- (p[i]*tnum)/(2*tden),
- (p[i + 1]*tnum)/(2*tden),
- p[i]/2 + (p[i + 2]*(tden - tnum))/(2*tden),
- p[i + 1]/2 + (p[i + 3]*(tden - tnum))/(2*tden),
- (p[i] - p[i]/2) + p[i + 2]/2,
- (p[i + 1] - p[i + 1]/2) + p[i + 3]/2);
- }
- }
- printf("PR%d,%d", p[np - 2] - p[np - 2]/2, p[np - 1] - p[np - 1]/2);
- hpgl_end();
- break;
- }
- case 'c':
- case 'C':
- // troff adds an extra argument to C
- if (np != 1 && !(code == 'C' && np == 2)) {
- error("1 argument required for circle");
- break;
- }
- hpgl_init();
- if (!moveto(env->hpos + p[0]/2, env->vpos))
- return;
- hpgl_start();
- if (code == 'c') {
- set_line_thickness(env->size);
- printf("CI%d", p[0]/2);
- }
- else
- printf("WG%d,0,360", p[0]/2);
- hpgl_end();
- break;
- case 'e':
- case 'E':
- if (np != 2) {
- error("2 arguments required for ellipse");
- break;
- }
- hpgl_init();
- if (!moveto(env->hpos + p[0]/2, env->vpos))
- return;
- hpgl_start();
- printf("SC0,%.4f,0,-%.4f,2", hpgl_scale * double(p[0])/p[1], hpgl_scale);
- if (code == 'e') {
- set_line_thickness(env->size);
- printf("CI%d", p[1]/2);
- }
- else
- printf("WG%d,0,360", p[1]/2);
- printf("SC0,%.4f,0,-%.4f,2", hpgl_scale, hpgl_scale);
- hpgl_end();
- break;
- case 'a':
- {
- if (np != 4) {
- error("4 arguments required for arc");
- break;
- }
- hpgl_init();
- if (!moveto(env->hpos, env->vpos))
- return;
- hpgl_start();
- set_line_thickness(env->size);
- double c[2];
- if (adjust_arc_center(p, c)) {
- double sweep = ((atan2(p[1] + p[3] - c[1], p[0] + p[2] - c[0])
- - atan2(-c[1], -c[0]))
- * 180.0/PI);
- if (sweep > 0.0)
- sweep -= 360.0;
- printf("PDAR%d,%d,%f", int(c[0]), int(c[1]), sweep);
- }
- else
- printf("PD%d,%d", p[0] + p[2], p[1] + p[3]);
- hpgl_end();
- }
- break;
- case 'f':
- if (np != 1 && np != 2) {
- error("1 argument required for fill");
- break;
- }
- hpgl_init();
- hpgl_start();
- if (p[0] >= 0 && p[0] <= 1000)
- printf("FT10,%d", p[0]/10);
- hpgl_end();
- break;
- case 't':
- {
- if (np == 0) {
- line_thickness = -1;
- }
- else {
- // troff gratuitously adds an extra 0
- if (np != 1 && np != 2) {
- error("0 or 1 argument required for thickness");
- break;
- }
- line_thickness = p[0];
- }
- break;
- }
- default:
- error("unrecognised drawing command `%1'", char(code));
- break;
- }
-}
-
-void lj4_printer::hpgl_init()
-{
- if (hpgl_inited)
- return;
- hpgl_inited = 1;
- hpgl_scale = double(DEFAULT_HPGL_UNITS)/font::res;
- printf("\033&f0S" // push position
- "\033*p0x0Y" // move to 0,0
- "\033*c%dx%dy0T" // establish picture frame
- "\033%%1B" // switch to HPGL
- "SP1SC0,%.4f,0,-%.4f,2IR0,100,0,100" // set up scaling
- "LA1,4,2,4" // round line ends and joins
- "PR" // relative plotting
- "TR0" // opaque
- ";\033%%1A" // back to PCL
- "\033&f1S", // pop position
- MAX_PAPER_WIDTH, MAX_PAPER_HEIGHT,
- hpgl_scale, hpgl_scale);
-}
-
-void lj4_printer::set_line_thickness(int size, int dot)
-{
- double pw;
- if (line_thickness < 0)
- pw = (size * (line_width_factor * 25.4))/(font::sizescale * 72000.0);
- else
- pw = line_thickness*25.4/font::res;
- if (dot && pw < MIN_DOT_PEN_WIDTH)
- pw = MIN_DOT_PEN_WIDTH;
- if (pw != pen_width) {
- printf("PW%f", pw);
- pen_width = pw;
- }
-}
-
-font *lj4_printer::make_font(const char *nm)
-{
- return lj4_font::load_lj4_font(nm);
-}
-
-printer *make_printer()
-{
- return new lj4_printer;
-}
-
-static
-int lookup_paper_size(const char *s)
-{
- for (int i = 0; i < sizeof(paper_table)/sizeof(paper_table[0]); i++) {
- // FIXME Perhaps allow unique prefix.
- if (strcasecmp(s, paper_table[i].name) == 0)
- return i;
- }
- return -1;
-}
-
-static
-void handle_unknown_desc_command(const char *command, const char *arg,
- const char *filename, int lineno)
-{
- if (strcmp(command, "papersize") == 0) {
- if (arg == 0)
- error_with_file_and_line(filename, lineno,
- "`papersize' command requires an argument");
- else if (paper_size < 0) {
- int n = lookup_paper_size(arg);
- if (n < 0)
- error_with_file_and_line(filename, lineno,
- "unknown paper size `%1'", arg);
- else
- paper_size = n;
- }
- }
-}
-
-static void usage();
-
-extern "C" int optopt, optind;
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- font::set_unknown_desc_command_handler(handle_unknown_desc_command);
- int c;
- while ((c = getopt(argc, argv, ":F:p:d:lvw:c:")) != EOF)
- switch(c) {
- case 'l':
- landscape_flag = 1;
- break;
- case ':':
- if (optopt == 'd') {
- fprintf(stderr, "duplex assumed to be long-side\n");
- duplex_flag = 1;
- } else
- fprintf(stderr, "option -%c requires an operand\n", optopt);
- fflush(stderr);
- break;
- case 'd':
- if (!isdigit(*optarg)) // this ugly hack prevents -d without
- optind--; // args from messing up the arg list
- duplex_flag = atoi(optarg);
- if (duplex_flag != 1 && duplex_flag != 2) {
- fprintf(stderr, "odd value for duplex; assumed to be long-side\n");
- duplex_flag = 1;
- }
- break;
- case 'p':
- {
- int n = lookup_paper_size(optarg);
- if (n < 0)
- error("unknown paper size `%1'", optarg);
- else
- paper_size = n;
- break;
- }
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "grolj4 version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case 'F':
- font::command_line_font_dir(optarg);
- break;
- case 'c':
- {
- char *ptr;
- long n = strtol(optarg, &ptr, 10);
- if (n == 0 && ptr == optarg)
- error("argument for -c must be a positive integer");
- else if (n <= 0 || n > 32767)
- error("out of range argument for -c");
- else
- ncopies = unsigned(n);
- break;
- }
- case 'w':
- {
- char *ptr;
- long n = strtol(optarg, &ptr, 10);
- if (n == 0 && ptr == optarg)
- error("argument for -w must be a non-negative integer");
- else if (n < 0 || n > INT_MAX)
- error("out of range argument for -w");
- else
- line_width_factor = int(n);
- break;
- }
- case '?':
- usage();
- break;
- default:
- assert(0);
- }
-#ifdef SET_BINARY
- SET_BINARY(fileno(stdout));
-#endif
- if (optind >= argc)
- do_file("-");
- else {
- for (int i = optind; i < argc; i++)
- do_file(argv[i]);
- }
- delete pr;
- return 0;
-}
-
-static void usage()
-{
- fprintf(stderr,
- "usage: %s [-lv] [-d [n]] [-c n] [-p paper_size]\n"
- " [-w n] [-F dir] [files ...]\n",
- program_name);
- exit(1);
-}
diff --git a/contrib/groff/grops/Makefile.dep b/contrib/groff/grops/Makefile.dep
deleted file mode 100644
index 94e343401cf5..000000000000
--- a/contrib/groff/grops/Makefile.dep
+++ /dev/null
@@ -1,6 +0,0 @@
-ps.o: ps.cc ../include/driver.h ../include/errarg.h ../include/error.h \
- ../include/font.h ../include/printer.h ../include/lib.h \
- ../include/stringclass.h ../include/cset.h ps.h
-psrm.o: psrm.cc ../include/driver.h ../include/errarg.h \
- ../include/error.h ../include/font.h ../include/printer.h \
- ../include/lib.h ../include/stringclass.h ../include/cset.h ps.h
diff --git a/contrib/groff/grops/Makefile.sub b/contrib/groff/grops/Makefile.sub
deleted file mode 100644
index 4182527d514f..000000000000
--- a/contrib/groff/grops/Makefile.sub
+++ /dev/null
@@ -1,12 +0,0 @@
-PROG=grops
-MAN1=grops.n
-XLIBS=$(LIBDRIVER) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=\
- ps.o \
- psrm.o
-CCSRCS=\
- $(srcdir)/ps.cc \
- $(srcdir)/psrm.cc
-HDRS=\
- $(srcdir)/ps.h
diff --git a/contrib/groff/grops/TODO b/contrib/groff/grops/TODO
deleted file mode 100644
index da67973a2feb..000000000000
--- a/contrib/groff/grops/TODO
+++ /dev/null
@@ -1,29 +0,0 @@
-Read PFB files directly.
-
-Generate %%DocumentMedia comment.
-
-Generate %%For comment.
-
-Generate %%Title comment.
-
-For efficiency it might be better to have the printer interface have
-support for the t and u commands.
-
-Angles in arc command: don't generate more digits after the decimal
-point than are necessary.
-
-Possibly generate BoundingBox comment.
-
-Per font composite character mechanism (sufficient for fractions).
-
-Consider whether we ought to do rounding of graphical objects other
-than lines. What's the point?
-
-Error messages should refer to output page number.
-
-Search for downloadable fonts using their PostScript names if not
-found in download file.
-
-Separate path for searching for downloadable font files.
-
-Clip to the BoundingBox when importing documents.
diff --git a/contrib/groff/grops/grops.man b/contrib/groff/grops/grops.man
deleted file mode 100644
index da422b4c2576..000000000000
--- a/contrib/groff/grops/grops.man
+++ /dev/null
@@ -1,842 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.TH GROPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-grops \- PostScript driver for groff
-.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fBgrops 'u
-.ti \niu
-.B grops
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.OP \-glmv
-.OP \-b n
-.OP \-c n
-.OP \-w n
-.OP \-F dir
-.RI "[\ " files\|.\|.\|. "\ ]"
-.br
-.ad \na
-.PP
-It is possible to have whitespace between a command line option and its
-parameter.
-.SH DESCRIPTION
-.B grops
-translates the output of GNU
-.B troff
-to PostScript.
-Normally
-.B grops
-should be invoked by using the groff command
-with a
-.B \-Tps
-option.
-.if '@DEVICE@'ps' (Actually, this is the default for groff.)
-If no files are given,
-.B grops
-will read the standard input.
-A filename of
-.B \-
-will also cause
-.B grops
-to read the standard input.
-PostScript output is written to the standard output.
-When
-.B grops
-is run by
-.B groff
-options can be passed to
-.B grops
-using the
-.B groff
-.B \-P
-option.
-.SH OPTIONS
-.TP
-.BI \-b n
-Workaround broken spoolers and previewers.
-Normally
-.B grops
-produces output that conforms
-the Document Structuring Conventions version 3.0.
-Unfortunately some spoolers and previewers can't handle such output.
-The value of
-.I n
-controls what
-.B grops
-does to its output acceptable to such programs.
-A value of 0 will cause grops not to employ any workarounds.
-Add 1 if no
-.B %%BeginDocumentSetup
-and
-.B %%EndDocumentSetup
-comments should be generated;
-this is needed for early versions of TranScript that get confused by
-anything between the
-.B %%EndProlog
-comment and the first
-.B %%Page
-comment.
-Add 2 if lines in included files beginning with
-.B %!
-should be stripped out; this is needed for Sun's pageview previewer.
-Add 4 if
-.BR %%Page ,
-.BR %%Trailer
-and
-.B %%EndProlog
-comments should be
-stripped out of included files; this is needed for spoolers that
-don't understand the
-.B %%BeginDocument
-and
-.B %%EndDocument
-comments.
-Add 8 if the first line of the PostScript output should be
-.B %!PS-Adobe-2.0
-rather than
-.BR %!PS-Adobe-3.0 ;
-this is needed when using Sun's Newsprint with a printer that requires
-page reversal.
-The default value can be specified by a
-.RS
-.IP
-.BI broken\ n
-.LP
-command in the DESC file.
-Otherwise the default value is 0.
-.RE
-.TP
-.BI \-c n
-Print
-.I n
-copies of each page.
-.TP
-.BI \-g
-Guess the page length.
-This generates PostScript code that guesses the page length.
-The guess will be correct only if the imageable area is vertically
-centered on the page.
-This option allows you to generate documents that can be printed
-both on letter (8.5\(mu11) paper and on A4 paper without change.
-.TP
-.B \-l
-Print the document in landscape format.
-.TP
-.B \-m
-Turn manual feed on for the document.
-.TP
-.BI \-F dir
-Search the directory
-.IB dir /dev name
-for font and device description files;
-.I name
-is the name of the device, usually
-.BR ps .
-.TP
-.BI \-w n
-Lines should be drawn using a thickness of
-.I n
-thousandths of an em.
-.TP
-.B \-v
-Print the version number.
-.SH USAGE
-There are styles called
-.BR R ,
-.BR I ,
-.BR B ,
-and
-.B BI
-mounted at font positions 1 to 4.
-The fonts are grouped into families
-.BR A ,
-.BR BM ,
-.BR C ,
-.BR H ,
-.BR HN ,
-.BR N ,
-.B P
-and
-.B T
-having members in each of these styles:
-.de FT
-.if '\\*(.T'ps' .ft \\$1
-..
-.TP
-.B AR
-.FT AR
-AvantGarde-Book
-.FT
-.TP
-.B AI
-.FT AI
-AvantGarde-BookOblique
-.FT
-.TP
-.B AB
-.FT AB
-AvantGarde-Demi
-.FT
-.TP
-.B ABI
-.FT ABI
-AvantGarde-DemiOblique
-.FT
-.TP
-.B BMR
-.FT BMR
-Bookman-Light
-.FT
-.TP
-.B BMI
-.FT BMI
-Bookman-LightItalic
-.FT
-.TP
-.B BMB
-.FT BMB
-Bookman-Demi
-.FT
-.TP
-.B BMBI
-.FT BMBI
-Bookman-DemiItalic
-.FT
-.TP
-.B CR
-.FT CR
-Courier
-.FT
-.TP
-.B CI
-.FT CI
-Courier-Oblique
-.FT
-.TP
-.B CB
-.FT CB
-Courier-Bold
-.FT
-.TP
-.B CBI
-.FT CBI
-Courier-BoldOblique
-.FT
-.TP
-.B HR
-.FT HR
-Helvetica
-.FT
-.TP
-.B HI
-.FT HI
-Helvetica-Oblique
-.FT
-.TP
-.B HB
-.FT HB
-Helvetica-Bold
-.FT
-.TP
-.B HBI
-.FT HBI
-Helvetica-BoldOblique
-.FT
-.TP
-.B HNR
-.FT HNR
-Helvetica-Narrow
-.FT
-.TP
-.B HNI
-.FT HNI
-Helvetica-Narrow-Oblique
-.FT
-.TP
-.B HNB
-.FT HNB
-Helvetica-Narrow-Bold
-.FT
-.TP
-.B HNBI
-.FT HNBI
-Helvetica-Narrow-BoldOblique
-.FT
-.TP
-.B NR
-.FT NR
-NewCenturySchlbk-Roman
-.FT
-.TP
-.B NI
-.FT NI
-NewCenturySchlbk-Italic
-.FT
-.TP
-.B NB
-.FT NB
-NewCenturySchlbk-Bold
-.FT
-.TP
-.B NBI
-.FT NBI
-NewCenturySchlbk-BoldItalic
-.FT
-.TP
-.B PR
-.FT PR
-Palatino-Roman
-.FT
-.TP
-.B PI
-.FT PI
-Palatino-Italic
-.FT
-.TP
-.B PB
-.FT PB
-Palatino-Bold
-.FT
-.TP
-.B PBI
-.FT PBI
-Palatino-BoldItalic
-.FT
-.TP
-.B TR
-.FT TR
-Times-Roman
-.FT
-.TP
-.B TI
-.FT TI
-Times-Italic
-.FT
-.TP
-.B TB
-.FT TB
-Times-Bold
-.FT
-.TP
-.B TBI
-.FT TBI
-Times-BoldItalic
-.FT
-.LP
-There is also the following font which is not a member of a family:
-.TP
-.B ZCMI
-.FT ZCMI
-ZapfChancery-MediumItalic
-.FT
-.LP
-There are also some special fonts called
-.B SS
-and
-.BR S .
-Zapf Dingbats is available as
-.BR ZD
-and a reversed version of ZapfDingbats (with symbols pointing in the opposite
-direction) is available as
-.BR ZDR ;
-most characters in these fonts are unnamed and must be accessed using
-.BR \eN .
-.LP
-.B grops
-understands various X commands produced using the
-.B \eX
-escape sequence;
-.B grops
-will only interpret commands that begin with a
-.B ps:
-tag.
-.TP
-.BI \eX'ps:\ exec\ code '
-This executes the arbitrary PostScript commands in
-.IR code .
-The PostScript currentpoint will be set to the position of the
-.B \eX
-command before executing
-.IR code .
-The origin will be at the top left corner of the page,
-and y coordinates will increase down the page.
-A procedure
-.B u
-will be defined that converts groff units
-to the coordinate system in effect.
-For example,
-.RS
-.IP
-.B
-\&.nr x 1i
-.br
-.B
-\eX'ps: exec \enx u 0 rlineto stroke'
-.br
-.RE
-.IP
-will draw a horizontal line one inch long.
-.I code
-may make changes to the graphics state,
-but any changes will persist only to the
-end of the page.
-A dictionary containing the definitions specified by the
-.B def
-and
-.B mdef
-will be on top of the dictionary stack.
-If your code adds definitions to this dictionary,
-you should allocate space for them using
-.BI \eX'ps\ mdef \ n '\fR.
-Any definitions will persist only until the end of the page.
-If you use the
-.B \eY
-escape sequence with an argument that names a macro,
-.I code
-can extend over multiple lines.
-For example,
-.RS
-.IP
-.nf
-.ft B
-\&.nr x 1i
-\&.de y
-\&ps: exec
-\&\enx u 0 rlineto
-\&stroke
-\&..
-\&\eYy
-.fi
-.ft R
-.LP
-is another way to draw a horizontal line one inch long.
-.RE
-.TP
-.BI \eX'ps:\ file\ name '
-This is the same as the
-.B exec
-command except that the PostScript code is read from file
-.IR name .
-.TP
-.BI \eX'ps:\ def\ code '
-Place a PostScript definition contained in
-.I code
-in the prologue.
-There should be at most one definition per
-.B \eX
-command.
-Long definitions can be split over several
-.B \eX
-commands;
-all the
-.I code
-arguments are simply joined together separated by newlines.
-The definitions are placed in a dictionary which is automatically
-pushed on the dictionary stack when an
-.B exec
-command is executed.
-If you use the
-.B \eY
-escape sequence with an argument that names a macro,
-.I code
-can extend over multiple lines.
-.TP
-.BI \eX'ps:\ mdef\ n\ code '
-Like
-.BR def ,
-except that
-.I code
-may contain up to
-.I n
-definitions.
-.B grops
-needs to know how many definitions
-.I code
-contains
-so that it can create an appropriately sized PostScript dictionary
-to contain them.
-.TP
-.BI \eX'ps:\ import\ file\ llx\ lly\ urx\ ury\ width\ \fR[\fP\ height\ \fR]\fP '
-Import a PostScript graphic from
-.IR file .
-The arguments
-.IR llx ,
-.IR lly ,
-.IR urx ,
-and
-.I ury
-give the bounding box of the graphic in the default PostScript
-coordinate system; they should all be integers;
-.I llx
-and
-.I lly
-are the x and y coordinates of the lower left
-corner of the graphic;
-.I urx
-and
-.I ury
-are the x and y coordinates of the upper right corner of the graphic;
-.I width
-and
-.I height
-are integers that give the desired width and height in groff
-units of the graphic.
-The graphic will be scaled so that it has this width and height
-and translated so that the lower left corner of the graphic is
-located at the position associated with
-.B \eX
-command.
-If the height argument is omitted it will be scaled uniformly in the
-x and y directions so that it has the specified width.
-Note that the contents of the
-.B \eX
-command are not interpreted by
-.BR troff ;
-so vertical space for the graphic is not automatically added,
-and the
-.I width
-and
-.I height
-arguments are not allowed to have attached scaling indicators.
-If the PostScript file complies with the Adobe Document Structuring
-Conventions and contains a
-.B %%BoundingBox
-comment, then the bounding box can be automatically
-extracted from within groff by using the
-.B psbb
-request.
-.RS
-.LP
-The
-.B \-mps
-macros (which are automatically loaded when
-.B grops
-is run by the groff command) include a
-.B PSPIC
-macro which allows a picture to be easily imported.
-This has the format
-.IP
-\&\fB.PSPIC\fP [ \fB\-L\fP | \fB-R\fP | \fB\-I\fP \fIn\fP ]\ \"
-\fI\|file\fP [ \fIwidth\fP [ \fIheight\fP ]]
-.LP
-.I file
-is the name of the file containing the illustration;
-.I width
-and
-.I height
-give the desired width and height of the graphic.
-The
-.I width
-and
-.I height
-arguments may have scaling indicators attached;
-the default scaling indicator is
-.BR i .
-This macro will scale the graphic uniformly
-in the x and y directions so that it is no more than
-.I width
-wide
-and
-.I height
-high.
-By default, the graphic will be horizontally centered.
-The
-.BI \-L
-and
-.BI \-R
-cause the graphic to be left-aligned and right-aligned
-respectively.
-The
-.B \-I
-option causes the graphic to be indented by
-.IR n .
-.RE
-.TP
-.B \eX'ps:\ invis'
-.br
-.ns
-.TP
-.B \eX'ps:\ endinvis'
-No output will be generated for text and drawing commands
-that are bracketed with these
-.B \eX
-commands.
-These commands are intended for use when output from
-.B troff
-will be previewed before being processed with
-.BR grops ;
-if the previewer is unable to display certain characters
-or other constructs, then other substitute characters or constructs
-can be used for previewing by bracketing them with these
-.B \eX
-commands.
-.RS
-.LP
-For example,
-.B gxditview
-is not able to display a proper
-.B \e(em
-character because the standard X11 fonts do not provide it;
-this problem can be overcome by executing the following
-request
-.IP
-.ft B
-.nf
-\&.char \e(em \eX'ps: invis'\e
-\eZ'\ev'-.25m'\eh'.05m'\eD'l .9m 0'\eh'.05m''\e
-\eX'ps: endinvis'\e(em
-.ft
-.fi
-.LP
-In this case,
-.B gxditview
-will be unable to display the
-.B \e(em
-character and will draw the line,
-whereas
-.B grops
-will print the
-.B \e(em
-character
-and ignore the line.
-.RE
-.LP
-The input to
-.B grops
-must be in the format output by
-.BR @g@troff (@MAN1EXT@).
-This is described in
-.BR groff_out (@MAN1EXT@).
-In addition the device and font description files for the device used
-must meet certain requirements.
-The device and font description files supplied for
-.B ps
-device meet all these requirements.
-.BR afmtodit (@MAN1EXT@)
-can be used to create font files from AFM files.
-The resolution must be an integer multiple of 72 times the
-.BR sizescale .
-The
-.B ps
-device uses a resolution of 72000 and a sizescale of 1000.
-The device description file should contain a command
-.IP
-.BI paperlength\ n
-.LP
-which says that output should be generated which is suitable for
-printing on a page whose length is
-.I n
-machine units.
-Each font description file must contain a command
-.IP
-.BI internalname\ psname
-.LP
-which says that the PostScript name of the font is
-.IR psname .
-It may also contain a command
-.IP
-.BI encoding\ enc_file
-.LP
-which says that
-the PostScript font should be reencoded using the encoding described in
-.IR enc_file ;
-this file should consist of a sequence of lines of the form:
-.IP
-.I
-pschar code
-.LP
-where
-.I pschar
-is the PostScript name of the character,
-and
-.I code
-is its position in the encoding expressed as a decimal integer.
-The code for each character given in the font file must correspond
-to the code for the character in encoding file, or to the code in the default
-encoding for the font if the PostScript font is not to be reencoded.
-This code can be used with the
-.B \eN
-escape sequence in
-.B troff
-to select the character,
-even if the character does not have a groff name.
-Every character in the font file must exist in the PostScript font, and
-the widths given in the font file must match the widths used
-in the PostScript font.
-.B grops
-will assume that a character with a groff name of
-.B space
-is blank (makes no marks on the page);
-it can make use of such a character to generate more efficient and
-compact PostScript output.
-.LP
-.B grops
-can automatically include the downloadable fonts necessary
-to print the document.
-Any downloadable fonts which should, when required, be included by
-.B grops
-must be listed in the file
-.BR @FONTDIR@/devps/download ;
-this should consist of lines of the form
-.IP
-.I
-font filename
-.LP
-where
-.I font
-is the PostScript name of the font,
-and
-.I filename
-is the name of the file containing the font;
-lines beginning with
-.B #
-and blank lines are ignored;
-fields may be separated by tabs or spaces;
-.I filename
-will be searched for using the same mechanism that is used
-for groff font metric files.
-The
-.B download
-file itself will also be searched for using this mechanism.
-.LP
-If the file containing a downloadable font or imported document
-conforms to the Adobe Document Structuring Conventions,
-then
-.B grops
-will interpret any comments in the files sufficiently to ensure that its
-own output is conforming.
-It will also supply any needed font resources that are listed in the
-.B download
-file
-as well as any needed file resources.
-It is also able to handle inter-resource dependencies.
-For example, suppose that you have a downloadable font called Garamond,
-and also a downloadable font called Garamond-Outline
-which depends on Garamond
-(typically it would be defined to copy Garamond's font dictionary,
-and change the PaintType),
-then it is necessary for Garamond to be appear before Garamond-Outline
-in the PostScript document.
-.B grops
-will handle this automatically
-provided that the downloadable font file for Garamond-Outline
-indicates its dependence on Garamond by means of
-the Document Structuring Conventions,
-for example by beginning with the following lines
-.IP
-.B
-%!PS-Adobe-3.0 Resource-Font
-.br
-.B
-%%DocumentNeededResources: font Garamond
-.br
-.B
-%%EndComments
-.br
-.B
-%%IncludeResource: font Garamond
-.LP
-In this case both Garamond and Garamond-Outline would need to be listed
-in the
-.B download
-file.
-A downloadable font should not include its own name in a
-.B %%DocumentSuppliedResources
-comment.
-.LP
-.B grops
-will not interpret
-.B %%DocumentFonts
-comments.
-The
-.BR %%DocumentNeededResources ,
-.BR %%DocumentSuppliedResources ,
-.BR %%IncludeResource ,
-.BR %%BeginResource
-and
-.BR %%EndResource
-comments
-(or possibly the old
-.BR %%DocumentNeededFonts ,
-.BR %%DocumentSuppliedFonts ,
-.BR %%IncludeFont ,
-.BR %%BeginFont
-and
-.BR %%EndFont
-comments)
-should be used.
-.SH FILES
-.Tp \w'\fB@FONTDIR@/devps/download'u+2n
-.B @FONTDIR@/devps/DESC
-Device description file.
-.TP
-.BI @FONTDIR@/devps/ F
-Font description file for font
-.IR F .
-.TP
-.B @FONTDIR@/devps/download
-List of downloadable fonts.
-.TP
-.B @FONTDIR@/devps/text.enc
-Encoding used for text fonts.
-.TP
-.B @MACRODIR@/tmac.ps
-Macros for use with
-.BR grops ;
-automatically loaded by
-.BR troffrc
-.TP
-.B @MACRODIR@/tmac.pspic
-Definition of
-.B PSPIC
-macro,
-automatically loaded by
-.BR tmac.ps .
-.TP
-.B @MACRODIR@/tmac.psold
-Macros to disable use of characters not present in older
-PostScript printers; automatically loaded by
-.BR tmac.ps .
-.TP
-.B @MACRODIR@/tmac.psnew
-Macros to undo the effect of
-.BR tmac.psold .
-.TP
-.BI /tmp/grops XXXXXX
-Temporary file.
-.SH "SEE ALSO"
-.BR afmtodit (@MAN1EXT@),
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR psbb (@MAN1EXT@),
-.BR groff_out (@MAN5EXT@),
-.BR groff_font (@MAN5EXT@),
-.BR groff_char (@MAN7EXT@)
diff --git a/contrib/groff/grops/ps.cc b/contrib/groff/grops/ps.cc
deleted file mode 100644
index c065dafae7c0..000000000000
--- a/contrib/groff/grops/ps.cc
+++ /dev/null
@@ -1,1541 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "driver.h"
-#include "stringclass.h"
-#include "cset.h"
-#include "nonposix.h"
-
-#include "ps.h"
-#include
-
-static int landscape_flag = 0;
-static int manual_feed_flag = 0;
-static int ncopies = 1;
-static int linewidth = -1;
-// Non-zero means generate PostScript code that guesses the paper
-// length using the imageable area.
-static int guess_flag = 0;
-
-// Non-zero if -b was specified on the command line.
-static int bflag = 0;
-unsigned broken_flags = 0;
-
-#define DEFAULT_LINEWIDTH 40 /* in ems/1000 */
-#define MAX_LINE_LENGTH 72
-#define FILL_MAX 1000
-
-const char *const dict_name = "grops";
-const char *const defs_dict_name = "DEFS";
-const int DEFS_DICT_SPARE = 50;
-
-double degrees(double r)
-{
- return r*180.0/PI;
-}
-
-double radians(double d)
-{
- return d*PI/180.0;
-}
-
-inline double transform_fill(int fill)
-{
- return 1 - fill/double(FILL_MAX);
-}
-
-// This is used for testing whether a character should be output in the
-// PostScript file using \nnn, so we really want the character to be
-// less than 0200.
-
-inline int is_ascii(char c)
-{
- return (unsigned char)c < 0200;
-}
-
-ps_output::ps_output(FILE *f, int n)
-: fp(f), col(0), max_line_length(n), need_space(0), fixed_point(0)
-{
-}
-
-ps_output &ps_output::set_file(FILE *f)
-{
- fp = f;
- col = 0;
- return *this;
-}
-
-ps_output &ps_output::copy_file(FILE *infp)
-{
- int c;
- while ((c = getc(infp)) != EOF)
- putc(c, fp);
- return *this;
-}
-
-ps_output &ps_output::end_line()
-{
- if (col != 0) {
- putc('\n', fp);
- col = 0;
- need_space = 0;
- }
- return *this;
-}
-
-ps_output &ps_output::special(const char *s)
-{
- if (s == 0 || *s == '\0')
- return *this;
- if (col != 0) {
- putc('\n', fp);
- col = 0;
- }
- fputs(s, fp);
- if (strchr(s, '\0')[-1] != '\n')
- putc('\n', fp);
- need_space = 0;
- return *this;
-}
-
-ps_output &ps_output::simple_comment(const char *s)
-{
- if (col != 0)
- putc('\n', fp);
- putc('%', fp);
- putc('%', fp);
- fputs(s, fp);
- putc('\n', fp);
- col = 0;
- need_space = 0;
- return *this;
-}
-
-ps_output &ps_output::begin_comment(const char *s)
-{
- if (col != 0)
- putc('\n', fp);
- putc('%', fp);
- putc('%', fp);
- fputs(s, fp);
- col = 2 + strlen(s);
- return *this;
-}
-
-ps_output &ps_output::end_comment()
-{
- if (col != 0) {
- putc('\n', fp);
- col = 0;
- }
- need_space = 0;
- return *this;
-}
-
-ps_output &ps_output::comment_arg(const char *s)
-{
- int len = strlen(s);
- if (col + len + 1 > max_line_length) {
- putc('\n', fp);
- fputs("%%+", fp);
- col = 3;
- }
- putc(' ', fp);
- fputs(s, fp);
- col += len + 1;
- return *this;
-}
-
-ps_output &ps_output::set_fixed_point(int n)
-{
- assert(n >= 0 && n <= 10);
- fixed_point = n;
- return *this;
-}
-
-ps_output &ps_output::put_delimiter(char c)
-{
- if (col + 1 > max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- putc(c, fp);
- col++;
- need_space = 0;
- return *this;
-}
-
-ps_output &ps_output::put_string(const char *s, int n)
-{
- int len = 0;
- int i;
- for (i = 0; i < n; i++) {
- char c = s[i];
- if (is_ascii(c) && csprint(c)) {
- if (c == '(' || c == ')' || c == '\\')
- len += 2;
- else
- len += 1;
- }
- else
- len += 4;
- }
- if (len > n*2) {
- if (col + n*2 + 2 > max_line_length && n*2 + 2 <= max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- if (col + 1 > max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- putc('<', fp);
- col++;
- for (i = 0; i < n; i++) {
- if (col + 2 > max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- fprintf(fp, "%02x", s[i] & 0377);
- col += 2;
- }
- putc('>', fp);
- col++;
- }
- else {
- if (col + len + 2 > max_line_length && len + 2 <= max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- if (col + 2 > max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- putc('(', fp);
- col++;
- for (i = 0; i < n; i++) {
- char c = s[i];
- if (is_ascii(c) && csprint(c)) {
- if (c == '(' || c == ')' || c == '\\')
- len = 2;
- else
- len = 1;
- }
- else
- len = 4;
- if (col + len + 1 > max_line_length) {
- putc('\\', fp);
- putc('\n', fp);
- col = 0;
- }
- switch (len) {
- case 1:
- putc(c, fp);
- break;
- case 2:
- putc('\\', fp);
- putc(c, fp);
- break;
- case 4:
- fprintf(fp, "\\%03o", c & 0377);
- break;
- default:
- assert(0);
- }
- col += len;
- }
- putc(')', fp);
- col++;
- }
- need_space = 0;
- return *this;
-}
-
-ps_output &ps_output::put_number(int n)
-{
- char buf[1 + INT_DIGITS + 1];
- sprintf(buf, "%d", n);
- int len = strlen(buf);
- if (col > 0 && col + len + need_space > max_line_length) {
- putc('\n', fp);
- col = 0;
- need_space = 0;
- }
- if (need_space) {
- putc(' ', fp);
- col++;
- }
- fputs(buf, fp);
- col += len;
- need_space = 1;
- return *this;
-}
-
-ps_output &ps_output::put_fix_number(int i)
-{
- const char *p = if_to_a(i, fixed_point);
- int len = strlen(p);
- if (col > 0 && col + len + need_space > max_line_length) {
- putc('\n', fp);
- col = 0;
- need_space = 0;
- }
- if (need_space) {
- putc(' ', fp);
- col++;
- }
- fputs(p, fp);
- col += len;
- need_space = 1;
- return *this;
-}
-
-ps_output &ps_output::put_float(double d)
-{
- char buf[128];
- sprintf(buf, "%.4f", d);
- int len = strlen(buf);
- if (col > 0 && col + len + need_space > max_line_length) {
- putc('\n', fp);
- col = 0;
- need_space = 0;
- }
- if (need_space) {
- putc(' ', fp);
- col++;
- }
- fputs(buf, fp);
- col += len;
- need_space = 1;
- return *this;
-}
-
-ps_output &ps_output::put_symbol(const char *s)
-{
- int len = strlen(s);
- if (col > 0 && col + len + need_space > max_line_length) {
- putc('\n', fp);
- col = 0;
- need_space = 0;
- }
- if (need_space) {
- putc(' ', fp);
- col++;
- }
- fputs(s, fp);
- col += len;
- need_space = 1;
- return *this;
-}
-
-ps_output &ps_output::put_literal_symbol(const char *s)
-{
- int len = strlen(s);
- if (col > 0 && col + len + 1 > max_line_length) {
- putc('\n', fp);
- col = 0;
- }
- putc('/', fp);
- fputs(s, fp);
- col += len + 1;
- need_space = 1;
- return *this;
-}
-
-class ps_font : public font {
- ps_font(const char *);
-public:
- int encoding_index;
- char *encoding;
- char *reencoded_name;
- ~ps_font();
- void handle_unknown_font_command(const char *command, const char *arg,
- const char *filename, int lineno);
- static ps_font *load_ps_font(const char *);
-};
-
-ps_font *ps_font::load_ps_font(const char *s)
-{
- ps_font *f = new ps_font(s);
- if (!f->load()) {
- delete f;
- return 0;
- }
- return f;
-}
-
-ps_font::ps_font(const char *nm)
-: font(nm), encoding_index(-1), encoding(0), reencoded_name(0)
-{
-}
-
-ps_font::~ps_font()
-{
- a_delete encoding;
- a_delete reencoded_name;
-}
-
-void ps_font::handle_unknown_font_command(const char *command, const char *arg,
- const char *filename, int lineno)
-{
- if (strcmp(command, "encoding") == 0) {
- if (arg == 0)
- error_with_file_and_line(filename, lineno,
- "`encoding' command requires an argument");
- else
- encoding = strsave(arg);
- }
-}
-
-static void handle_unknown_desc_command(const char *command, const char *arg,
- const char *filename, int lineno)
-{
- if (strcmp(command, "broken") == 0) {
- if (arg == 0)
- error_with_file_and_line(filename, lineno,
- "`broken' command requires an argument");
- else if (!bflag)
- broken_flags = atoi(arg);
- }
-}
-
-struct style {
- font *f;
- int point_size;
- int height;
- int slant;
- style();
- style(font *, int, int, int);
- int operator==(const style &) const;
- int operator!=(const style &) const;
-};
-
-style::style() : f(0)
-{
-}
-
-style::style(font *p, int sz, int h, int sl)
-: f(p), point_size(sz), height(h), slant(sl)
-{
-}
-
-int style::operator==(const style &s) const
-{
- return (f == s.f && point_size == s.point_size
- && height == s.height && slant == s.slant);
-}
-
-int style::operator!=(const style &s) const
-{
- return !(*this == s);
-}
-
-class ps_printer : public printer {
- FILE *tempfp;
- ps_output out;
- int res;
- int space_char_index;
- int pages_output;
- int paper_length;
- int equalise_spaces;
- enum { SBUF_SIZE = 256 };
- char sbuf[SBUF_SIZE];
- int sbuf_len;
- int sbuf_start_hpos;
- int sbuf_vpos;
- int sbuf_end_hpos;
- int sbuf_space_width;
- int sbuf_space_count;
- int sbuf_space_diff_count;
- int sbuf_space_code;
- int sbuf_kern;
- style sbuf_style;
- style output_style;
- int output_hpos;
- int output_vpos;
- int output_draw_point_size;
- int line_thickness;
- int output_line_thickness;
- int fill;
- unsigned char output_space_code;
- enum { MAX_DEFINED_STYLES = 50 };
- style defined_styles[MAX_DEFINED_STYLES];
- int ndefined_styles;
- int next_encoding_index;
- string defs;
- int ndefs;
- resource_manager rm;
- int invis_count;
-
- void flush_sbuf();
- void set_style(const style &);
- void set_space_code(unsigned char c);
- int set_encoding_index(ps_font *);
- void do_exec(char *, const environment *);
- void do_import(char *, const environment *);
- void do_def(char *, const environment *);
- void do_mdef(char *, const environment *);
- void do_file(char *, const environment *);
- void do_invis(char *, const environment *);
- void do_endinvis(char *, const environment *);
- void set_line_thickness(const environment *);
- void fill_path();
- void encode_fonts();
- void define_encoding(const char *, int);
- void reencode_font(ps_font *);
-public:
- ps_printer();
- ~ps_printer();
- void set_char(int i, font *f, const environment *env, int w, const char *name);
- void draw(int code, int *p, int np, const environment *env);
- void begin_page(int);
- void end_page(int);
- void special(char *arg, const environment *env);
- font *make_font(const char *);
- void end_of_line();
-};
-
-ps_printer::ps_printer()
-: out(0, MAX_LINE_LENGTH),
- pages_output(0),
- sbuf_len(0),
- output_hpos(-1),
- output_vpos(-1),
- line_thickness(-1),
- fill(FILL_MAX + 1),
- ndefined_styles(0),
- next_encoding_index(0),
- ndefs(0),
- invis_count(0)
-{
- tempfp = xtmpfile();
- out.set_file(tempfp);
- if (linewidth < 0)
- linewidth = DEFAULT_LINEWIDTH;
- if (font::hor != 1)
- fatal("horizontal resolution must be 1");
- if (font::vert != 1)
- fatal("vertical resolution must be 1");
- if (font::res % (font::sizescale*72) != 0)
- fatal("res must be a multiple of 72*sizescale");
- int r = font::res;
- int point = 0;
- while (r % 10 == 0) {
- r /= 10;
- point++;
- }
- res = r;
- out.set_fixed_point(point);
- space_char_index = font::name_to_index("space");
- paper_length = font::paperlength;
- if (paper_length == 0)
- paper_length = 11*font::res;
- equalise_spaces = font::res >= 72000;
-}
-
-int ps_printer::set_encoding_index(ps_font *f)
-{
- if (f->encoding_index >= 0)
- return f->encoding_index;
- for (font_pointer_list *p = font_list; p; p = p->next)
- if (p->p != f) {
- char *encoding = ((ps_font *)p->p)->encoding;
- int encoding_index = ((ps_font *)p->p)->encoding_index;
- if (encoding != 0 && encoding_index >= 0
- && strcmp(f->encoding, encoding) == 0) {
- return f->encoding_index = encoding_index;
- }
- }
- return f->encoding_index = next_encoding_index++;
-}
-
-void ps_printer::set_char(int i, font *f, const environment *env, int w, const char *name)
-{
- if (i == space_char_index || invis_count > 0)
- return;
- unsigned char code = f->get_code(i);
- style sty(f, env->size, env->height, env->slant);
- if (sty.slant != 0) {
- if (sty.slant > 80 || sty.slant < -80) {
- error("silly slant `%1' degrees", sty.slant);
- sty.slant = 0;
- }
- }
- if (sbuf_len > 0) {
- if (sbuf_len < SBUF_SIZE
- && sty == sbuf_style
- && sbuf_vpos == env->vpos) {
- if (sbuf_end_hpos == env->hpos) {
- sbuf[sbuf_len++] = code;
- sbuf_end_hpos += w + sbuf_kern;
- return;
- }
- if (sbuf_len == 1 && sbuf_kern == 0) {
- sbuf_kern = env->hpos - sbuf_end_hpos;
- sbuf_end_hpos = env->hpos + sbuf_kern + w;
- sbuf[sbuf_len++] = code;
- return;
- }
- /* If sbuf_end_hpos - sbuf_kern == env->hpos, we are better off
- starting a new string. */
- if (sbuf_len < SBUF_SIZE - 1 && env->hpos >= sbuf_end_hpos
- && (sbuf_kern == 0 || sbuf_end_hpos - sbuf_kern != env->hpos)) {
- if (sbuf_space_code < 0) {
- if (f->contains(space_char_index)) {
- sbuf_space_code = f->get_code(space_char_index);
- sbuf_space_width = env->hpos - sbuf_end_hpos;
- sbuf_end_hpos = env->hpos + w + sbuf_kern;
- sbuf[sbuf_len++] = sbuf_space_code;
- sbuf[sbuf_len++] = code;
- sbuf_space_count++;
- return;
- }
- }
- else {
- int diff = env->hpos - sbuf_end_hpos - sbuf_space_width;
- if (diff == 0 || (equalise_spaces && (diff == 1 || diff == -1))) {
- sbuf_end_hpos = env->hpos + w + sbuf_kern;
- sbuf[sbuf_len++] = sbuf_space_code;
- sbuf[sbuf_len++] = code;
- sbuf_space_count++;
- if (diff == 1)
- sbuf_space_diff_count++;
- else if (diff == -1)
- sbuf_space_diff_count--;
- return;
- }
- }
- }
- }
- flush_sbuf();
- }
- sbuf_len = 1;
- sbuf[0] = code;
- sbuf_end_hpos = env->hpos + w;
- sbuf_start_hpos = env->hpos;
- sbuf_vpos = env->vpos;
- sbuf_style = sty;
- sbuf_space_code = -1;
- sbuf_space_width = 0;
- sbuf_space_count = sbuf_space_diff_count = 0;
- sbuf_kern = 0;
-}
-
-static char *make_encoding_name(int encoding_index)
-{
- static char buf[3 + INT_DIGITS + 1];
- sprintf(buf, "ENC%d", encoding_index);
- return buf;
-}
-
-const char *const WS = " \t\n\r";
-
-void ps_printer::define_encoding(const char *encoding, int encoding_index)
-{
- char *vec[256];
- int i;
- for (i = 0; i < 256; i++)
- vec[i] = 0;
- char *path;
- FILE *fp = font::open_file(encoding, &path);
- if (fp == 0)
- fatal("can't open encoding file `%1'", encoding);
- int lineno = 1;
- char buf[256];
- while (fgets(buf, 512, fp) != 0) {
- char *p = buf;
- while (csspace(*p))
- p++;
- if (*p != '#' && *p != '\0' && (p = strtok(buf, WS)) != 0) {
- char *q = strtok(0, WS);
- int n;
- if (q == 0 || sscanf(q, "%d", &n) != 1 || n < 0 || n >= 256)
- fatal_with_file_and_line(path, lineno, "bad second field");
- vec[n] = new char[strlen(p) + 1];
- strcpy(vec[n], p);
- }
- lineno++;
- }
- a_delete path;
- out.put_literal_symbol(make_encoding_name(encoding_index));
- out.put_delimiter('[');
- for (i = 0; i < 256; i++) {
- if (vec[i] == 0)
- out.put_literal_symbol(".notdef");
- else {
- out.put_literal_symbol(vec[i]);
- a_delete vec[i];
- }
- }
- out.put_delimiter(']').put_symbol("def");
-}
-
-void ps_printer::reencode_font(ps_font *f)
-{
- out.put_literal_symbol(f->reencoded_name)
- .put_symbol(make_encoding_name(f->encoding_index))
- .put_literal_symbol(f->get_internal_name())
- .put_symbol("RE");
-}
-
-void ps_printer::encode_fonts()
-{
- if (next_encoding_index == 0)
- return;
- char *done_encoding = new char[next_encoding_index];
- for (int i = 0; i < next_encoding_index; i++)
- done_encoding[i] = 0;
- for (font_pointer_list *f = font_list; f; f = f->next) {
- int encoding_index = ((ps_font *)f->p)->encoding_index;
- if (encoding_index >= 0) {
- assert(encoding_index < next_encoding_index);
- if (!done_encoding[encoding_index]) {
- done_encoding[encoding_index] = 1;
- define_encoding(((ps_font *)f->p)->encoding, encoding_index);
- }
- reencode_font((ps_font *)f->p);
- }
- }
- a_delete done_encoding;
-}
-
-void ps_printer::set_style(const style &sty)
-{
- char buf[1 + INT_DIGITS + 1];
- for (int i = 0; i < ndefined_styles; i++)
- if (sty == defined_styles[i]) {
- sprintf(buf, "F%d", i);
- out.put_symbol(buf);
- return;
- }
- if (ndefined_styles >= MAX_DEFINED_STYLES)
- ndefined_styles = 0;
- sprintf(buf, "F%d", ndefined_styles);
- out.put_literal_symbol(buf);
- const char *psname = sty.f->get_internal_name();
- if (psname == 0)
- fatal("no internalname specified for font `%1'", sty.f->get_name());
- char *encoding = ((ps_font *)sty.f)->encoding;
- if (encoding != 0) {
- char *s = ((ps_font *)sty.f)->reencoded_name;
- if (s == 0) {
- int ei = set_encoding_index((ps_font *)sty.f);
- char *tem = new char[strlen(psname) + 1 + INT_DIGITS + 1];
- sprintf(tem, "%s@%d", psname, ei);
- psname = tem;
- ((ps_font *)sty.f)->reencoded_name = tem;
- }
- else
- psname = s;
- }
- out.put_fix_number((font::res/(72*font::sizescale))*sty.point_size);
- if (sty.height != 0 || sty.slant != 0) {
- int h = sty.height == 0 ? sty.point_size : sty.height;
- h *= font::res/(72*font::sizescale);
- int c = int(h*tan(radians(sty.slant)) + .5);
- out.put_fix_number(c).put_fix_number(h).put_literal_symbol(psname)
- .put_symbol("MF");
- }
- else {
- out.put_literal_symbol(psname).put_symbol("SF");
- }
- defined_styles[ndefined_styles++] = sty;
-}
-
-void ps_printer::set_space_code(unsigned char c)
-{
- out.put_literal_symbol("SC").put_number(c).put_symbol("def");
-}
-
-void ps_printer::end_of_line()
-{
- flush_sbuf();
- // this ensures that we do an absolute motion to the beginning of a line
- output_vpos = output_hpos = -1;
-}
-
-void ps_printer::flush_sbuf()
-{
- enum {
- NONE,
- RELATIVE_H,
- RELATIVE_V,
- RELATIVE_HV,
- ABSOLUTE
- } motion = NONE;
- int space_flag = 0;
- if (sbuf_len == 0)
- return;
- if (output_style != sbuf_style) {
- set_style(sbuf_style);
- output_style = sbuf_style;
- }
- int extra_space = 0;
- if (output_hpos < 0 || output_vpos < 0)
- motion = ABSOLUTE;
- else {
- if (output_hpos != sbuf_start_hpos)
- motion = RELATIVE_H;
- if (output_vpos != sbuf_vpos) {
- if (motion != NONE)
- motion = RELATIVE_HV;
- else
- motion = RELATIVE_V;
- }
- }
- if (sbuf_space_code >= 0) {
- int w = sbuf_style.f->get_width(space_char_index, sbuf_style.point_size);
- if (w + sbuf_kern != sbuf_space_width) {
- if (sbuf_space_code != output_space_code) {
- set_space_code(sbuf_space_code);
- output_space_code = sbuf_space_code;
- }
- space_flag = 1;
- extra_space = sbuf_space_width - w - sbuf_kern;
- if (sbuf_space_diff_count > sbuf_space_count/2)
- extra_space++;
- else if (sbuf_space_diff_count < -(sbuf_space_count/2))
- extra_space--;
- }
- }
- if (space_flag)
- out.put_fix_number(extra_space);
- if (sbuf_kern != 0)
- out.put_fix_number(sbuf_kern);
- out.put_string(sbuf, sbuf_len);
- char command_array[] = {'A', 'B', 'C', 'D',
- 'E', 'F', 'G', 'H',
- 'I', 'J', 'K', 'L',
- 'M', 'N', 'O', 'P',
- 'Q', 'R', 'S', 'T'};
- char sym[2];
- sym[0] = command_array[motion*4 + space_flag + 2*(sbuf_kern != 0)];
- sym[1] = '\0';
- switch (motion) {
- case NONE:
- break;
- case ABSOLUTE:
- out.put_fix_number(sbuf_start_hpos)
- .put_fix_number(sbuf_vpos);
- break;
- case RELATIVE_H:
- out.put_fix_number(sbuf_start_hpos - output_hpos);
- break;
- case RELATIVE_V:
- out.put_fix_number(sbuf_vpos - output_vpos);
- break;
- case RELATIVE_HV:
- out.put_fix_number(sbuf_start_hpos - output_hpos)
- .put_fix_number(sbuf_vpos - output_vpos);
- break;
- default:
- assert(0);
- }
- out.put_symbol(sym);
- output_hpos = sbuf_end_hpos;
- output_vpos = sbuf_vpos;
- sbuf_len = 0;
-}
-
-
-void ps_printer::set_line_thickness(const environment *env)
-{
- if (line_thickness < 0) {
- if (output_draw_point_size != env->size) {
- // we ought to check for overflow here
- int lw = ((font::res/(72*font::sizescale))*linewidth*env->size)/1000;
- out.put_fix_number(lw).put_symbol("LW");
- output_draw_point_size = env->size;
- output_line_thickness = -1;
- }
- }
- else {
- if (output_line_thickness != line_thickness) {
- out.put_fix_number(line_thickness).put_symbol("LW");
- output_line_thickness = line_thickness;
- output_draw_point_size = -1;
- }
- }
-}
-
-void ps_printer::fill_path()
-{
- if (fill > FILL_MAX)
- out.put_symbol("BL");
- else
- out.put_float(transform_fill(fill)).put_symbol("FL");
-}
-
-void ps_printer::draw(int code, int *p, int np, const environment *env)
-{
- if (invis_count > 0)
- return;
- int fill_flag = 0;
- switch (code) {
- case 'C':
- fill_flag = 1;
- // fall through
- case 'c':
- // troff adds an extra argument to C
- if (np != 1 && !(code == 'C' && np == 2)) {
- error("1 argument required for circle");
- break;
- }
- out.put_fix_number(env->hpos + p[0]/2)
- .put_fix_number(env->vpos)
- .put_fix_number(p[0]/2)
- .put_symbol("DC");
- if (fill_flag) {
- fill_path();
- }
- else {
- set_line_thickness(env);
- out.put_symbol("ST");
- }
- break;
- case 'l':
- if (np != 2) {
- error("2 arguments required for line");
- break;
- }
- set_line_thickness(env);
- out.put_fix_number(p[0] + env->hpos)
- .put_fix_number(p[1] + env->vpos)
- .put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("DL");
- break;
- case 'E':
- fill_flag = 1;
- // fall through
- case 'e':
- if (np != 2) {
- error("2 arguments required for ellipse");
- break;
- }
- out.put_fix_number(p[0])
- .put_fix_number(p[1])
- .put_fix_number(env->hpos + p[0]/2)
- .put_fix_number(env->vpos)
- .put_symbol("DE");
- if (fill_flag) {
- fill_path();
- }
- else {
- set_line_thickness(env);
- out.put_symbol("ST");
- }
- break;
- case 'P':
- fill_flag = 1;
- // fall through
- case 'p':
- {
- if (np & 1) {
- error("even number of arguments required for polygon");
- break;
- }
- if (np == 0) {
- error("no arguments for polygon");
- break;
- }
- out.put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("MT");
- for (int i = 0; i < np; i += 2)
- out.put_fix_number(p[i])
- .put_fix_number(p[i+1])
- .put_symbol("RL");
- out.put_symbol("CL");
- if (fill_flag) {
- fill_path();
- }
- else {
- set_line_thickness(env);
- out.put_symbol("ST");
- }
- break;
- }
- case '~':
- {
- if (np & 1) {
- error("even number of arguments required for spline");
- break;
- }
- if (np == 0) {
- error("no arguments for spline");
- break;
- }
- out.put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("MT");
- out.put_fix_number(p[0]/2)
- .put_fix_number(p[1]/2)
- .put_symbol("RL");
- /* tnum/tden should be between 0 and 1; the closer it is to 1
- the tighter the curve will be to the guiding lines; 2/3
- is the standard value */
- const int tnum = 2;
- const int tden = 3;
- for (int i = 0; i < np - 2; i += 2) {
- out.put_fix_number((p[i]*tnum)/(2*tden))
- .put_fix_number((p[i + 1]*tnum)/(2*tden))
- .put_fix_number(p[i]/2 + (p[i + 2]*(tden - tnum))/(2*tden))
- .put_fix_number(p[i + 1]/2 + (p[i + 3]*(tden - tnum))/(2*tden))
- .put_fix_number((p[i] - p[i]/2) + p[i + 2]/2)
- .put_fix_number((p[i + 1] - p[i + 1]/2) + p[i + 3]/2)
- .put_symbol("RC");
- }
- out.put_fix_number(p[np - 2] - p[np - 2]/2)
- .put_fix_number(p[np - 1] - p[np - 1]/2)
- .put_symbol("RL");
- set_line_thickness(env);
- out.put_symbol("ST");
- }
- break;
- case 'a':
- {
- if (np != 4) {
- error("4 arguments required for arc");
- break;
- }
- set_line_thickness(env);
- double c[2];
- if (adjust_arc_center(p, c))
- out.put_fix_number(env->hpos + int(c[0]))
- .put_fix_number(env->vpos + int(c[1]))
- .put_fix_number(int(sqrt(c[0]*c[0] + c[1]*c[1])))
- .put_float(degrees(atan2(-c[1], -c[0])))
- .put_float(degrees(atan2(p[1] + p[3] - c[1], p[0] + p[2] - c[0])))
- .put_symbol("DA");
- else
- out.put_fix_number(p[0] + p[2] + env->hpos)
- .put_fix_number(p[1] + p[3] + env->vpos)
- .put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("DL");
- }
- break;
- case 't':
- {
- if (np == 0) {
- line_thickness = -1;
- }
- else {
- // troff gratuitously adds an extra 0
- if (np != 1 && np != 2) {
- error("0 or 1 argument required for thickness");
- break;
- }
- line_thickness = p[0];
- }
- break;
- }
- case 'f':
- {
- if (np != 1 && np != 2) {
- error("1 argument required for fill");
- break;
- }
- fill = p[0];
- if (fill < 0 || fill > FILL_MAX) {
- // This means fill with the current color.
- fill = FILL_MAX + 1;
- }
- break;
- }
- default:
- error("unrecognised drawing command `%1'", char(code));
- break;
- }
-
- output_hpos = output_vpos = -1;
-}
-
-
-void ps_printer::begin_page(int n)
-{
- out.begin_comment("Page:").comment_arg(i_to_a(n));
- out.comment_arg(i_to_a(++pages_output)).end_comment();
- output_style.f = 0;
- output_space_code = 32;
- output_draw_point_size = -1;
- output_line_thickness = -1;
- output_hpos = output_vpos = -1;
- ndefined_styles = 0;
- out.simple_comment("BeginPageSetup");
- out.put_symbol("BP");
- out.simple_comment("EndPageSetup");
-}
-
-void ps_printer::end_page(int)
-{
- flush_sbuf();
- out.put_symbol("EP");
- if (invis_count != 0) {
- error("missing `endinvis' command");
- invis_count = 0;
- }
-}
-
-font *ps_printer::make_font(const char *nm)
-{
- return ps_font::load_ps_font(nm);
-}
-
-ps_printer::~ps_printer()
-{
- out.simple_comment("Trailer");
- out.put_symbol("end");
- out.simple_comment("EOF");
- if (fseek(tempfp, 0L, 0) < 0)
- fatal("fseek on temporary file failed");
- fputs("%!PS-Adobe-", stdout);
- fputs((broken_flags & USE_PS_ADOBE_2_0) ? "2.0" : "3.0", stdout);
- putchar('\n');
- out.set_file(stdout);
- {
- extern const char *Version_string;
- out.begin_comment("Creator:")
- .comment_arg("groff")
- .comment_arg("version")
- .comment_arg(Version_string)
- .end_comment();
- }
- {
- fputs("%%CreationDate: ", out.get_file());
-#ifdef LONG_FOR_TIME_T
- long
-#else
- time_t
-#endif
- t = time(0);
- fputs(ctime(&t), out.get_file());
- }
- for (font_pointer_list *f = font_list; f; f = f->next) {
- ps_font *psf = (ps_font *)(f->p);
- rm.need_font(psf->get_internal_name());
- }
- rm.print_header_comments(out);
- out.begin_comment("Pages:").comment_arg(i_to_a(pages_output)).end_comment();
- out.begin_comment("PageOrder:").comment_arg("Ascend").end_comment();
-#if 0
- fprintf(out.get_file(), "%%%%DocumentMedia: () %g %g 0 () ()\n",
- font::paperwidth*72.0/font::res,
- paper_length*72.0/font::res);
-#endif
- out.begin_comment("Orientation:")
- .comment_arg(landscape_flag ? "Landscape" : "Portrait")
- .end_comment();
- if (ncopies != 1) {
- out.end_line();
- fprintf(out.get_file(), "%%%%Requirements: numcopies(%d)\n", ncopies);
- }
- out.simple_comment("EndComments");
- out.simple_comment("BeginProlog");
- rm.output_prolog(out);
- if (!(broken_flags & NO_SETUP_SECTION)) {
- out.simple_comment("EndProlog");
- out.simple_comment("BeginSetup");
- }
- rm.document_setup(out);
- out.put_symbol(dict_name).put_symbol("begin");
- if (ndefs > 0)
- ndefs += DEFS_DICT_SPARE;
- out.put_literal_symbol(defs_dict_name)
- .put_number(ndefs + 1)
- .put_symbol("dict")
- .put_symbol("def");
- out.put_symbol(defs_dict_name)
- .put_symbol("begin");
- out.put_literal_symbol("u")
- .put_delimiter('{')
- .put_fix_number(1)
- .put_symbol("mul")
- .put_delimiter('}')
- .put_symbol("bind")
- .put_symbol("def");
- defs += '\0';
- out.special(defs.contents());
- out.put_symbol("end");
- if (ncopies != 1)
- out.put_literal_symbol("#copies").put_number(ncopies).put_symbol("def");
- out.put_literal_symbol("RES").put_number(res).put_symbol("def");
- out.put_literal_symbol("PL");
- if (guess_flag)
- out.put_symbol("PLG");
- else
- out.put_fix_number(paper_length);
- out.put_symbol("def");
- out.put_literal_symbol("LS")
- .put_symbol(landscape_flag ? "true" : "false")
- .put_symbol("def");
- if (manual_feed_flag) {
- out.begin_comment("BeginFeature:")
- .comment_arg("*ManualFeed")
- .comment_arg("True")
- .end_comment()
- .put_symbol("MANUAL")
- .simple_comment("EndFeature");
- }
- encode_fonts();
- out.simple_comment((broken_flags & NO_SETUP_SECTION)
- ? "EndProlog"
- : "EndSetup");
- out.end_line();
- out.copy_file(tempfp);
- fclose(tempfp);
-}
-
-void ps_printer::special(char *arg, const environment *env)
-{
- typedef void (ps_printer::*SPECIAL_PROCP)(char *, const environment *);
- static struct {
- const char *name;
- SPECIAL_PROCP proc;
- } proc_table[] = {
- { "exec", &ps_printer::do_exec },
- { "def", &ps_printer::do_def },
- { "mdef", &ps_printer::do_mdef },
- { "import", &ps_printer::do_import },
- { "file", &ps_printer::do_file },
- { "invis", &ps_printer::do_invis },
- { "endinvis", &ps_printer::do_endinvis },
- };
- char *p;
- for (p = arg; *p == ' ' || *p == '\n'; p++)
- ;
- char *tag = p;
- for (; *p != '\0' && *p != ':' && *p != ' ' && *p != '\n'; p++)
- ;
- if (*p == '\0' || strncmp(tag, "ps", p - tag) != 0) {
- error("X command without `ps:' tag ignored");
- return;
- }
- p++;
- for (; *p == ' ' || *p == '\n'; p++)
- ;
- char *command = p;
- for (; *p != '\0' && *p != ' ' && *p != '\n'; p++)
- ;
- if (*command == '\0') {
- error("X command without `ps:' tag ignored");
- return;
- }
- for (int i = 0; i < sizeof(proc_table)/sizeof(proc_table[0]); i++)
- if (strncmp(command, proc_table[i].name, p - command) == 0) {
- (this->*(proc_table[i].proc))(p, env);
- return;
- }
- error("X command `%1' not recognised", command);
-}
-
-// A conforming PostScript document must not have lines longer
-// than 255 characters (excluding line termination characters).
-
-static int check_line_lengths(const char *p)
-{
- for (;;) {
- const char *end = strchr(p, '\n');
- if (end == 0)
- end = strchr(p, '\0');
- if (end - p > 255)
- return 0;
- if (*end == '\0')
- break;
- p = end + 1;
- }
- return 1;
-}
-
-void ps_printer::do_exec(char *arg, const environment *env)
-{
- flush_sbuf();
- while (csspace(*arg))
- arg++;
- if (*arg == '\0') {
- error("missing argument to X exec command");
- return;
- }
- if (!check_line_lengths(arg)) {
- error("lines in X exec command must not be more than 255 characters long");
- return;
- }
- out.put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("EBEGIN")
- .special(arg)
- .put_symbol("EEND");
- output_hpos = output_vpos = -1;
- output_style.f = 0;
- output_draw_point_size = -1;
- output_line_thickness = -1;
- ndefined_styles = 0;
- if (!ndefs)
- ndefs = 1;
-}
-
-void ps_printer::do_file(char *arg, const environment *env)
-{
- flush_sbuf();
- while (csspace(*arg))
- arg++;
- if (*arg == '\0') {
- error("missing argument to X file command");
- return;
- }
- const char *filename = arg;
- do {
- ++arg;
- } while (*arg != '\0' && *arg != ' ' && *arg != '\n');
- out.put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("EBEGIN");
- rm.import_file(filename, out);
- out.put_symbol("EEND");
- output_hpos = output_vpos = -1;
- output_style.f = 0;
- output_draw_point_size = -1;
- output_line_thickness = -1;
- ndefined_styles = 0;
- if (!ndefs)
- ndefs = 1;
-}
-
-void ps_printer::do_def(char *arg, const environment *)
-{
- flush_sbuf();
- while (csspace(*arg))
- arg++;
- if (!check_line_lengths(arg)) {
- error("lines in X def command must not be more than 255 characters long");
- return;
- }
- defs += arg;
- if (*arg != '\0' && strchr(arg, '\0')[-1] != '\n')
- defs += '\n';
- ndefs++;
-}
-
-// Like def, but the first argument says how many definitions it contains.
-
-void ps_printer::do_mdef(char *arg, const environment *)
-{
- flush_sbuf();
- char *p;
- int n = (int)strtol(arg, &p, 10);
- if (n == 0 && p == arg) {
- error("first argument to X mdef must be an integer");
- return;
- }
- if (n < 0) {
- error("out of range argument `%1' to X mdef command", int(n));
- return;
- }
- arg = p;
- while (csspace(*arg))
- arg++;
- if (!check_line_lengths(arg)) {
- error("lines in X mdef command must not be more than 255 characters long");
- return;
- }
- defs += arg;
- if (*arg != '\0' && strchr(arg, '\0')[-1] != '\n')
- defs += '\n';
- ndefs += n;
-}
-
-void ps_printer::do_import(char *arg, const environment *env)
-{
- flush_sbuf();
- while (*arg == ' ' || *arg == '\n')
- arg++;
- char *p;
- for (p = arg; *p != '\0' && *p != ' ' && *p != '\n'; p++)
- ;
- if (*p != '\0')
- *p++ = '\0';
- int parms[6];
- int nparms = 0;
- while (nparms < 6) {
- char *end;
- long n = strtol(p, &end, 10);
- if (n == 0 && end == p)
- break;
- parms[nparms++] = int(n);
- p = end;
- }
- if (csalpha(*p) && (p[1] == '\0' || p[1] == ' ' || p[1] == '\n')) {
- error("scaling indicators not allowed in arguments for X import command");
- return;
- }
- while (*p == ' ' || *p == '\n')
- p++;
- if (nparms < 5) {
- if (*p == '\0')
- error("too few arguments for X import command");
- else
- error("invalid argument `%1' for X import command", p);
- return;
- }
- if (*p != '\0') {
- error("superflous argument `%1' for X import command", p);
- return;
- }
- int llx = parms[0];
- int lly = parms[1];
- int urx = parms[2];
- int ury = parms[3];
- int desired_width = parms[4];
- int desired_height = parms[5];
- if (desired_width <= 0) {
- error("bad width argument `%1' for X import command: must be > 0",
- desired_width);
- return;
- }
- if (nparms == 6 && desired_height <= 0) {
- error("bad height argument `%1' for X import command: must be > 0",
- desired_height);
- return;
- }
- if (llx == urx) {
- error("llx and urx arguments for X import command must not be equal");
- return;
- }
- if (lly == ury) {
- error("lly and ury arguments for X import command must not be equal");
- return;
- }
- if (nparms == 5) {
- int old_wid = urx - llx;
- int old_ht = ury - lly;
- if (old_wid < 0)
- old_wid = -old_wid;
- if (old_ht < 0)
- old_ht = -old_ht;
- desired_height = int(desired_width*(double(old_ht)/double(old_wid)) + .5);
- }
- if (env->vpos - desired_height < 0)
- warning("top of imported graphic is above the top of the page");
- out.put_number(llx)
- .put_number(lly)
- .put_fix_number(desired_width)
- .put_number(urx - llx)
- .put_fix_number(-desired_height)
- .put_number(ury - lly)
- .put_fix_number(env->hpos)
- .put_fix_number(env->vpos)
- .put_symbol("PBEGIN");
- rm.import_file(arg, out);
- // do this here just in case application defines PEND
- out.put_symbol("end");
- out.put_symbol("PEND");
-}
-
-void ps_printer::do_invis(char *, const environment *)
-{
- invis_count++;
-}
-
-void ps_printer::do_endinvis(char *, const environment *)
-{
- if (invis_count == 0)
- error("unbalanced `endinvis' command");
- else
- --invis_count;
-}
-
-printer *make_printer()
-{
- return new ps_printer;
-}
-
-static void usage();
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- int c;
- while ((c = getopt(argc, argv, "F:glmc:w:vb:")) != EOF)
- switch(c) {
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "grops version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case 'c':
- if (sscanf(optarg, "%d", &ncopies) != 1 || ncopies <= 0) {
- error("bad number of copies `%s'", optarg);
- ncopies = 1;
- }
- break;
- case 'g':
- guess_flag = 1;
- break;
- case 'l':
- landscape_flag = 1;
- break;
- case 'm':
- manual_feed_flag = 1;
- break;
- case 'F':
- font::command_line_font_dir(optarg);
- break;
- case 'w':
- if (sscanf(optarg, "%d", &linewidth) != 1 || linewidth < 0) {
- error("bad linewidth `%1'", optarg);
- linewidth = -1;
- }
- break;
- case 'b':
- // XXX check this
- broken_flags = atoi(optarg);
- bflag = 1;
- break;
- case '?':
- usage();
- break;
- default:
- assert(0);
- }
- font::set_unknown_desc_command_handler(handle_unknown_desc_command);
-#ifdef SET_BINARY
- SET_BINARY(fileno(stdout));
-#endif
- if (optind >= argc)
- do_file("-");
- else {
- for (int i = optind; i < argc; i++)
- do_file(argv[i]);
- }
- delete pr;
- return 0;
-}
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-glmv] [-b n] [-c n] [-w n] [-F dir] [files ...]\n",
- program_name);
- exit(1);
-}
diff --git a/contrib/groff/grops/ps.h b/contrib/groff/grops/ps.h
deleted file mode 100644
index 6e78597d1276..000000000000
--- a/contrib/groff/grops/ps.h
+++ /dev/null
@@ -1,122 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-class ps_output {
-public:
- ps_output(FILE *, int max_line_length);
- ps_output &put_string(const char *, int);
- ps_output &put_number(int);
- ps_output &put_fix_number(int);
- ps_output &put_float(double);
- ps_output &put_symbol(const char *);
- ps_output &put_literal_symbol(const char *);
- ps_output &set_fixed_point(int);
- ps_output &simple_comment(const char *);
- ps_output &begin_comment(const char *);
- ps_output &comment_arg(const char *);
- ps_output &end_comment();
- ps_output &set_file(FILE *);
- ps_output &include_file(FILE *);
- ps_output ©_file(FILE *);
- ps_output &end_line();
- ps_output &put_delimiter(char);
- ps_output &special(const char *);
- FILE *get_file();
-private:
- FILE *fp;
- int col;
- int max_line_length; // not including newline
- int need_space;
- int fixed_point;
-};
-
-inline FILE *ps_output::get_file()
-{
- return fp;
-}
-
-enum resource_type {
- RESOURCE_FONT,
- RESOURCE_PROCSET,
- RESOURCE_FILE,
- RESOURCE_ENCODING,
- RESOURCE_FORM,
- RESOURCE_PATTERN
- };
-
-struct resource;
-
-extern string an_empty_string;
-
-class resource_manager {
-public:
- resource_manager();
- ~resource_manager();
- void import_file(const char *filename, ps_output &);
- void need_font(const char *name);
- void print_header_comments(ps_output &);
- void document_setup(ps_output &);
- void output_prolog(ps_output &);
-private:
- unsigned extensions;
- unsigned language_level;
- resource *procset_resource;
- resource *resource_list;
- resource *lookup_resource(resource_type type, string &name,
- string &version = an_empty_string,
- unsigned revision = 0);
- resource *lookup_font(const char *name);
- void read_download_file();
- void supply_resource(resource *r, int rank, FILE *outfp,
- int is_document = 0);
- void process_file(int rank, FILE *fp, const char *filename, FILE *outfp);
- resource *read_file_arg(const char **);
- resource *read_procset_arg(const char **);
- resource *read_font_arg(const char **);
- resource *read_resource_arg(const char **);
- void print_resources_comment(unsigned flag, FILE *outfp);
- void print_extensions_comment(FILE *outfp);
- void print_language_level_comment(FILE *outfp);
- int do_begin_resource(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_include_resource(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_document(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_include_document(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_procset(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_include_procset(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_font(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_include_font(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_file(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_include_file(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int change_to_end_resource(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_preview(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_data(const char *ptr, int rank, FILE *fp, FILE *outfp);
- int do_begin_binary(const char *ptr, int rank, FILE *fp, FILE *outfp);
-};
-
-extern unsigned broken_flags;
-
-// broken_flags is ored from these
-
-enum {
- NO_SETUP_SECTION = 01,
- STRIP_PERCENT_BANG = 02,
- STRIP_STRUCTURE_COMMENTS = 04,
- USE_PS_ADOBE_2_0 = 010
-};
diff --git a/contrib/groff/grops/psfig.diff b/contrib/groff/grops/psfig.diff
deleted file mode 100644
index 5be080ddd933..000000000000
--- a/contrib/groff/grops/psfig.diff
+++ /dev/null
@@ -1,106 +0,0 @@
-These are patches to makes psfig work with groff. They apply to the
-version of psfig in comp.sources.unix/Volume11. After applying them,
-psfig should be recompiled with -DGROFF. The resulting psfig will
-work only with groff, so you might want to install it under a
-different name. The output of this psfig must be processed using the
-macros in the file ../tmac/tmac.psfig. These will automatically add
-the necessary PostScript code to the prologue output by grops. Use of
-the `global' feature in psfig will result in non-conformant PostScript
-which will fail if processed by a page reversal program. Note that
-psfig is unsupported by me (I'm not interested in hearing about psfig
-problems.) For new documents, I recommend using the PostScript
-inclusion features provided by grops.
-
-James Clark
-jjc@jclark.com
-
-*** cmds.c.~1~ Thu Feb 14 16:09:45 1991
---- cmds.c Mon Mar 4 12:49:26 1991
-***************
-*** 245,253 ****
---- 245,261 ----
- (void) sprintf(x, "%.2fp", fx);
- (void) sprintf(y, "%.2fp", fy);
- } else if (!*x) {
-+ #ifndef GROFF
- (void) sprintf(x,"(%.2fp*%s/%.2fp)", fx, y, fy);
-+ #else /* GROFF */
-+ (void) sprintf(x,"(%.0fu*%s/%.0fu)", fx, y, fy);
-+ #endif /* GROFF */
- } else if (!*y) {
-+ #ifndef GROFF
- (void) sprintf(y,"(%.2fp*%s/%.2fp)", fy, x, fx);
-+ #else /* GROFF */
-+ (void) sprintf(y,"(%.0fu*%s/%.0fu)", fy, x, fx);
-+ #endif /* GROFF */
- }
-
- /*
-*** troff.c.~1~ Thu Feb 14 16:09:48 1991
---- troff.c Mon Mar 4 12:48:46 1991
-***************
-*** 26,32 ****
---- 26,36 ----
- }
-
-
-+ #ifndef GROFF
- char incl_file_s[] = "\\X'f%s'";
-+ #else /* GROFF */
-+ char incl_file_s[] = "\\X'ps: file %s'";
-+ #endif /* GROFF */
- includeFile(filenm)
- char *filenm; {
- printf(incl_file_s, filenm);
-***************
-*** 40,52 ****
---- 44,64 ----
- error("buffer overflow");
- }
-
-+ #ifndef GROFF
- char endfig_s[] = "\\X'pendFig'";
-+ #else /* GROFF */
-+ char endfig_s[] = "\\X'ps: exec psfigend'";
-+ #endif /* GROFF */
- endfig() {
- printf(endfig_s);
- }
-
- char startfig_s[] =
-+ #ifndef GROFF
- "\\X'p\\w@\\h@%s@@'\\X'p\\w@\\h@%s@@'\\X'p%.2f'\\X'p%.2f'\\X'p%.2f'\\X'p%.2f'\\X'pstartFig'";
-+ #else /* GROFF */
-+ "\\X'ps: exec \\w@\\h@%s@@ \\w@\\h@%s@@ %.2f %.2f %.2f %.2f psfigstart'";
-+ #endif /* GROFF */
-
- startfig(x, y, llx, lly, urx, ury)
- char *x, *y;
-***************
-*** 57,63 ****
---- 69,79 ----
- }
-
- emitDoClip() {
-+ #ifndef GROFF
- printf("\\X'pdoclip'");
-+ #else /* GROFF */
-+ printf("\\X'ps: exec psfigclip'");
-+ #endif /* GROFF */
- }
-
- flushX()
-***************
-*** 116,122 ****
---- 132,142 ----
-
- #define isWhite(ch) ((ch) == ' ' || (ch) == '\t' || (ch) == '\n')
-
-+ #ifndef GROFF
- char literal_s[] = "\\X'p%s'";
-+ #else /* GROFF */
-+ char literal_s[] = "\\X'ps: exec %s'";
-+ #endif /* GROFF */
- emitLiteral(text)
- char *text; {
- static char litbuf[BUFSZ];
diff --git a/contrib/groff/grops/psrm.cc b/contrib/groff/grops/psrm.cc
deleted file mode 100644
index 91b7e6f131a9..000000000000
--- a/contrib/groff/grops/psrm.cc
+++ /dev/null
@@ -1,1103 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "driver.h"
-#include "stringclass.h"
-#include "cset.h"
-
-#include "ps.h"
-
-#define PROLOGUE "prologue"
-
-static void print_ps_string(const string &s, FILE *outfp);
-
-cset white_space("\n\r \t");
-string an_empty_string;
-
-const char *extension_table[] = {
- "DPS",
- "CMYK",
- "Composite",
- "FileSystem",
-};
-
-const int NEXTENSIONS = sizeof(extension_table)/sizeof(extension_table[0]);
-
-const char *resource_table[] = {
- "font",
- "procset",
- "file",
- "encoding",
- "form",
- "pattern",
-};
-
-const int NRESOURCES = sizeof(resource_table)/sizeof(resource_table[0]);
-
-static int read_uint_arg(const char **pp, unsigned *res)
-{
- while (white_space(**pp))
- *pp += 1;
- if (**pp == '\0') {
- error("missing argument");
- return 0;
- }
- const char *start = *pp;
- // XXX use strtoul
- long n = strtol(start, (char **)pp, 10);
- if (n == 0 && *pp == start) {
- error("not an integer");
- return 0;
- }
- if (n < 0) {
- error("argument must not be negative");
- return 0;
- }
- *res = unsigned(n);
- return 1;
-}
-
-struct resource {
- resource *next;
- resource_type type;
- string name;
- enum { NEEDED = 01, SUPPLIED = 02, FONT_NEEDED = 04, BUSY = 010 };
- unsigned flags;
- string version;
- unsigned revision;
- char *filename;
- int rank;
- resource(resource_type, string &, string & = an_empty_string, unsigned = 0);
- ~resource();
- void print_type_and_name(FILE *outfp);
-};
-
-resource::resource(resource_type t, string &n, string &v, unsigned r)
-: next(0), type(t), flags(0), revision(r), filename(0), rank(-1)
-{
- name.move(n);
- version.move(v);
- if (type == RESOURCE_FILE) {
- if (name.search('\0') >= 0)
- error("filename contains a character with code 0");
- filename = name.extract();
- }
-}
-
-resource::~resource()
-{
- a_delete filename;
-}
-
-void resource::print_type_and_name(FILE *outfp)
-{
- fputs(resource_table[type], outfp);
- putc(' ', outfp);
- print_ps_string(name, outfp);
- if (type == RESOURCE_PROCSET) {
- putc(' ', outfp);
- print_ps_string(version, outfp);
- fprintf(outfp, " %u", revision);
- }
-}
-
-resource_manager::resource_manager()
-: extensions(0), language_level(0), resource_list(0)
-{
- read_download_file();
- string procset_name("grops");
- extern const char *version_string;
- extern const char *revision_string;
- unsigned revision_uint;
- if ( !read_uint_arg( &revision_string, &revision_uint) )
- revision_uint = 0;
- string procset_version(version_string);
- procset_resource = lookup_resource(RESOURCE_PROCSET, procset_name,
- procset_version, revision_uint);
- procset_resource->flags |= resource::SUPPLIED;
-}
-
-resource_manager::~resource_manager()
-{
- while (resource_list) {
- resource *tem = resource_list;
- resource_list = resource_list->next;
- delete tem;
- }
-}
-
-resource *resource_manager::lookup_resource(resource_type type,
- string &name,
- string &version,
- unsigned revision)
-{
- resource *r;
- for (r = resource_list; r; r = r->next)
- if (r->type == type
- && r->name == name
- && r->version == version
- && r->revision == revision)
- return r;
- r = new resource(type, name, version, revision);
- r->next = resource_list;
- resource_list = r;
- return r;
-}
-
-// Just a specialized version of lookup_resource().
-
-resource *resource_manager::lookup_font(const char *name)
-{
- resource *r;
- for (r = resource_list; r; r = r->next)
- if (r->type == RESOURCE_FONT
- && strlen(name) == r->name.length()
- && memcmp(name, r->name.contents(), r->name.length()) == 0)
- return r;
- string s(name);
- r = new resource(RESOURCE_FONT, s);
- r->next = resource_list;
- resource_list = r;
- return r;
-}
-
-void resource_manager::need_font(const char *name)
-{
- lookup_font(name)->flags |= resource::FONT_NEEDED;
-}
-
-typedef resource *Presource; // Work around g++ bug.
-
-void resource_manager::document_setup(ps_output &out)
-{
- int nranks = 0;
- resource *r;
- for (r = resource_list; r; r = r->next)
- if (r->rank >= nranks)
- nranks = r->rank + 1;
- if (nranks > 0) {
- // Sort resource_list in reverse order of rank.
- Presource *head = new Presource[nranks + 1];
- Presource **tail = new Presource *[nranks + 1];
- int i;
- for (i = 0; i < nranks + 1; i++) {
- head[i] = 0;
- tail[i] = &head[i];
- }
- for (r = resource_list; r; r = r->next) {
- i = r->rank < 0 ? 0 : r->rank + 1;
- *tail[i] = r;
- tail[i] = &(*tail[i])->next;
- }
- resource_list = 0;
- for (i = 0; i < nranks + 1; i++)
- if (head[i]) {
- *tail[i] = resource_list;
- resource_list = head[i];
- }
- a_delete head;
- a_delete tail;
- // check it
- for (r = resource_list; r; r = r->next)
- if (r->next)
- assert(r->rank >= r->next->rank);
- for (r = resource_list; r; r = r->next)
- if (r->type == RESOURCE_FONT && r->rank >= 0)
- supply_resource(r, -1, out.get_file());
- }
-}
-
-void resource_manager::print_resources_comment(unsigned flag, FILE *outfp)
-{
- int continued = 0;
- for (resource *r = resource_list; r; r = r->next)
- if (r->flags & flag) {
- if (continued)
- fputs("%%+ ", outfp);
- else {
- fputs(flag == resource::NEEDED
- ? "%%DocumentNeededResources: "
- : "%%DocumentSuppliedResources: ",
- outfp);
- continued = 1;
- }
- r->print_type_and_name(outfp);
- putc('\n', outfp);
- }
-}
-
-void resource_manager::print_header_comments(ps_output &out)
-{
- for (resource *r = resource_list; r; r = r->next)
- if (r->type == RESOURCE_FONT && (r->flags & resource::FONT_NEEDED))
- supply_resource(r, 0, 0);
- print_resources_comment(resource::NEEDED, out.get_file());
- print_resources_comment(resource::SUPPLIED, out.get_file());
- print_language_level_comment(out.get_file());
- print_extensions_comment(out.get_file());
-}
-
-void resource_manager::output_prolog(ps_output &out)
-{
- FILE *outfp = out.get_file();
- out.end_line();
- char *path;
- FILE *fp = font::open_file(PROLOGUE, &path);
- if (!fp)
- fatal("can't find `%1'", PROLOGUE);
- fputs("%%BeginResource: ", outfp);
- procset_resource->print_type_and_name(outfp);
- putc('\n', outfp);
- process_file(-1, fp, path, outfp);
- fclose(fp);
- a_delete path;
- fputs("%%EndResource\n", outfp);
-}
-
-void resource_manager::import_file(const char *filename, ps_output &out)
-{
- out.end_line();
- string name(filename);
- resource *r = lookup_resource(RESOURCE_FILE, name);
- supply_resource(r, -1, out.get_file(), 1);
-}
-
-void resource_manager::supply_resource(resource *r, int rank, FILE *outfp,
- int is_document)
-{
- if (r->flags & resource::BUSY) {
- r->name += '\0';
- fatal("loop detected in dependency graph for %1 `%2'",
- resource_table[r->type],
- r->name.contents());
- }
- r->flags |= resource::BUSY;
- if (rank > r->rank)
- r->rank = rank;
- char *path;
- FILE *fp = 0;
- if (r->filename != 0) {
- if (r->type == RESOURCE_FONT) {
- fp = font::open_file(r->filename, &path);
- if (!fp) {
- error("can't find `%1'", r->filename);
- a_delete r->filename;
- r->filename = 0;
- }
- }
- else {
- errno = 0;
- fp = fopen(r->filename, "r");
- if (!fp) {
- error("can't open `%1': %2", r->filename, strerror(errno));
- a_delete r->filename;
- r->filename = 0;
- }
- else
- path = r->filename;
- }
- }
- if (fp) {
- if (outfp) {
- if (r->type == RESOURCE_FILE && is_document) {
- fputs("%%BeginDocument: ", outfp);
- print_ps_string(r->name, outfp);
- putc('\n', outfp);
- }
- else {
- fputs("%%BeginResource: ", outfp);
- r->print_type_and_name(outfp);
- putc('\n', outfp);
- }
- }
- process_file(rank, fp, path, outfp);
- fclose(fp);
- if (r->type == RESOURCE_FONT)
- a_delete path;
- if (outfp) {
- if (r->type == RESOURCE_FILE && is_document)
- fputs("%%EndDocument\n", outfp);
- else
- fputs("%%EndResource\n", outfp);
- }
- r->flags |= resource::SUPPLIED;
- }
- else {
- if (outfp) {
- if (r->type == RESOURCE_FILE && is_document) {
- fputs("%%IncludeDocument: ", outfp);
- print_ps_string(r->name, outfp);
- putc('\n', outfp);
- }
- else {
- fputs("%%IncludeResource: ", outfp);
- r->print_type_and_name(outfp);
- putc('\n', outfp);
- }
- }
- r->flags |= resource::NEEDED;
- }
- r->flags &= ~resource::BUSY;
-}
-
-
-#define PS_LINE_MAX 255
-#define PS_MAGIC "%!PS-Adobe-"
-
-static int ps_get_line(char *buf, FILE *fp)
-{
- int c = getc(fp);
- if (c == EOF) {
- buf[0] = '\0';
- return 0;
- }
- current_lineno++;
- int i = 0;
- int err = 0;
- while (c != '\r' && c != '\n' && c != EOF) {
- if ((c < 0x1b && !white_space(c)) || c == 0x7f)
- error("illegal input character code %1", int(c));
- else if (i < PS_LINE_MAX)
- buf[i++] = c;
- else if (!err) {
- err = 1;
- error("PostScript file non-conforming "
- "because length of line exceeds 255");
- }
- c = getc(fp);
- }
- buf[i++] = '\n';
- buf[i] = '\0';
- if (c == '\r') {
- c = getc(fp);
- if (c != EOF && c != '\n')
- ungetc(c, fp);
- }
- return 1;
-}
-
-static int read_text_arg(const char **pp, string &res)
-{
- res.clear();
- while (white_space(**pp))
- *pp += 1;
- if (**pp == '\0') {
- error("missing argument");
- return 0;
- }
- if (**pp != '(') {
- for (; **pp != '\0' && !white_space(**pp); *pp += 1)
- res += **pp;
- return 1;
- }
- *pp += 1;
- res.clear();
- int level = 0;
- for (;;) {
- if (**pp == '\0' || **pp == '\r' || **pp == '\n') {
- error("missing ')'");
- return 0;
- }
- if (**pp == ')') {
- if (level == 0) {
- *pp += 1;
- break;
- }
- res += **pp;
- level--;
- }
- else if (**pp == '(') {
- level++;
- res += **pp;
- }
- else if (**pp == '\\') {
- *pp += 1;
- switch (**pp) {
- case 'n':
- res += '\n';
- break;
- case 'r':
- res += '\n';
- break;
- case 't':
- res += '\t';
- break;
- case 'b':
- res += '\b';
- break;
- case 'f':
- res += '\f';
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- {
- int val = **pp - '0';
- if ((*pp)[1] >= '0' && (*pp)[1] <= '7') {
- *pp += 1;
- val = val*8 + (**pp - '0');
- if ((*pp)[1] >= '0' && (*pp)[1] <= '7') {
- *pp += 1;
- val = val*8 + (**pp - '0');
- }
- }
- }
- break;
- default:
- res += **pp;
- break;
- }
- }
- else
- res += **pp;
- *pp += 1;
- }
- return 1;
-}
-
-resource *resource_manager::read_file_arg(const char **ptr)
-{
- string arg;
- if (!read_text_arg(ptr, arg))
- return 0;
- return lookup_resource(RESOURCE_FILE, arg);
-}
-
-resource *resource_manager::read_font_arg(const char **ptr)
-{
- string arg;
- if (!read_text_arg(ptr, arg))
- return 0;
- return lookup_resource(RESOURCE_FONT, arg);
-}
-
-resource *resource_manager::read_procset_arg(const char **ptr)
-{
- string arg;
- if (!read_text_arg(ptr, arg))
- return 0;
- string version;
- if (!read_text_arg(ptr, version))
- return 0;
- unsigned revision;
- if (!read_uint_arg(ptr, &revision))
- return 0;
- return lookup_resource(RESOURCE_PROCSET, arg, version, revision);
-}
-
-resource *resource_manager::read_resource_arg(const char **ptr)
-{
- while (white_space(**ptr))
- *ptr += 1;
- const char *name = *ptr;
- while (**ptr != '\0' && !white_space(**ptr))
- *ptr += 1;
- if (name == *ptr) {
- error("missing resource type");
- return 0;
- }
- int ri;
- for (ri = 0; ri < NRESOURCES; ri++)
- if (strlen(resource_table[ri]) == *ptr - name
- && memcmp(resource_table[ri], name, *ptr - name) == 0)
- break;
- if (ri >= NRESOURCES) {
- error("unknown resource type");
- return 0;
- }
- if (ri == RESOURCE_PROCSET)
- return read_procset_arg(ptr);
- string arg;
- if (!read_text_arg(ptr, arg))
- return 0;
- return lookup_resource(resource_type(ri), arg);
-}
-
-static const char *matches_comment(const char *buf, const char *comment)
-{
- if (buf[0] != '%' || buf[1] != '%')
- return 0;
- for (buf += 2; *comment; comment++, buf++)
- if (*buf != *comment)
- return 0;
- if (comment[-1] == ':')
- return buf;
- if (*buf == '\0' || white_space(*buf))
- return buf;
- return 0;
-}
-
-// Return 1 if the line should be copied out.
-
-int resource_manager::do_begin_resource(const char *ptr, int, FILE *,
- FILE *)
-{
- resource *r = read_resource_arg(&ptr);
- if (r)
- r->flags |= resource::SUPPLIED;
- return 1;
-}
-
-int resource_manager::do_include_resource(const char *ptr, int rank, FILE *,
- FILE *outfp)
-{
- resource *r = read_resource_arg(&ptr);
- if (r) {
- if (r->type == RESOURCE_FONT) {
- if (rank >= 0)
- supply_resource(r, rank + 1, outfp);
- else
- r->flags |= resource::FONT_NEEDED;
- }
- else
- supply_resource(r, rank, outfp);
- }
- return 0;
-}
-
-int resource_manager::do_begin_document(const char *ptr, int, FILE *,
- FILE *)
-{
- resource *r = read_file_arg(&ptr);
- if (r)
- r->flags |= resource::SUPPLIED;
- return 1;
-}
-
-int resource_manager::do_include_document(const char *ptr, int rank, FILE *,
- FILE *outfp)
-{
- resource *r = read_file_arg(&ptr);
- if (r)
- supply_resource(r, rank, outfp, 1);
- return 0;
-}
-
-int resource_manager::do_begin_procset(const char *ptr, int, FILE *,
- FILE *outfp)
-{
- resource *r = read_procset_arg(&ptr);
- if (r) {
- r->flags |= resource::SUPPLIED;
- if (outfp) {
- fputs("%%BeginResource: ", outfp);
- r->print_type_and_name(outfp);
- putc('\n', outfp);
- }
- }
- return 0;
-}
-
-int resource_manager::do_include_procset(const char *ptr, int rank, FILE *,
- FILE *outfp)
-{
- resource *r = read_procset_arg(&ptr);
- if (r)
- supply_resource(r, rank, outfp);
- return 0;
-}
-
-int resource_manager::do_begin_file(const char *ptr, int, FILE *,
- FILE *outfp)
-{
- resource *r = read_file_arg(&ptr);
- if (r) {
- r->flags |= resource::SUPPLIED;
- if (outfp) {
- fputs("%%BeginResource: ", outfp);
- r->print_type_and_name(outfp);
- putc('\n', outfp);
- }
- }
- return 0;
-}
-
-int resource_manager::do_include_file(const char *ptr, int rank, FILE *,
- FILE *outfp)
-{
- resource *r = read_file_arg(&ptr);
- if (r)
- supply_resource(r, rank, outfp);
- return 0;
-}
-
-int resource_manager::do_begin_font(const char *ptr, int, FILE *,
- FILE *outfp)
-{
- resource *r = read_font_arg(&ptr);
- if (r) {
- r->flags |= resource::SUPPLIED;
- if (outfp) {
- fputs("%%BeginResource: ", outfp);
- r->print_type_and_name(outfp);
- putc('\n', outfp);
- }
- }
- return 0;
-}
-
-int resource_manager::do_include_font(const char *ptr, int rank, FILE *,
- FILE *outfp)
-{
- resource *r = read_font_arg(&ptr);
- if (r) {
- if (rank >= 0)
- supply_resource(r, rank + 1, outfp);
- else
- r->flags |= resource::FONT_NEEDED;
- }
- return 0;
-}
-
-int resource_manager::change_to_end_resource(const char *, int, FILE *,
- FILE *outfp)
-{
- if (outfp)
- fputs("%%EndResource\n", outfp);
- return 0;
-}
-
-int resource_manager::do_begin_preview(const char *, int, FILE *fp, FILE *)
-{
- char buf[PS_LINE_MAX + 2];
- do {
- if (!ps_get_line(buf, fp)) {
- error("end of file in preview section");
- break;
- }
- } while (!matches_comment(buf, "EndPreview"));
- return 0;
-}
-
-int read_one_of(const char **ptr, const char **s, int n)
-{
- while (white_space(**ptr))
- *ptr += 1;
- if (**ptr == '\0')
- return -1;
- const char *start = *ptr;
- do {
- ++(*ptr);
- } while (**ptr != '\0' && !white_space(**ptr));
- for (int i = 0; i < n; i++)
- if (strlen(s[i]) == *ptr - start
- && memcmp(s[i], start, *ptr - start) == 0)
- return i;
- return -1;
-}
-
-int resource_manager::do_begin_data(const char *ptr, int, FILE *fp,
- FILE *outfp)
-{
- while (white_space(*ptr))
- ptr++;
- const char *start = ptr;
- unsigned numberof;
- if (!read_uint_arg(&ptr, &numberof))
- return 0;
- static const char *types[] = { "Binary", "Hex", "ASCII" };
- const int Binary = 0;
- int type = 0;
- static const char *units[] = { "Bytes", "Lines" };
- const int Bytes = 0;
- int unit = Bytes;
- while (white_space(*ptr))
- ptr++;
- if (*ptr != '\0') {
- type = read_one_of(&ptr, types, 3);
- if (type < 0) {
- error("bad data type");
- return 0;
- }
- while (white_space(*ptr))
- ptr++;
- if (*ptr != '\0') {
- unit = read_one_of(&ptr, units, 2);
- if (unit < 0) {
- error("expected `Bytes' or `Lines'");
- return 0;
- }
- }
- }
- if (type != Binary)
- return 1;
- if (outfp) {
- fputs("%%BeginData: ", outfp);
- fputs(start, outfp);
- }
- if (numberof > 0) {
- unsigned bytecount = 0;
- unsigned linecount = 0;
- do {
- int c = getc(fp);
- if (c == EOF) {
- error("end of file within data section");
- return 0;
- }
- if (outfp)
- putc(c, outfp);
- bytecount++;
- if (c == '\r') {
- int cc = getc(fp);
- if (cc != '\n') {
- linecount++;
- current_lineno++;
- }
- if (cc != EOF)
- ungetc(c, fp);
- }
- else if (c == '\n') {
- linecount++;
- current_lineno++;
- }
- } while ((unit == Bytes ? bytecount : linecount) < numberof);
- }
- char buf[PS_LINE_MAX + 2];
- if (!ps_get_line(buf, fp)) {
- error("missing %%%%EndData line");
- return 0;
- }
- if (!matches_comment(buf, "EndData"))
- error("bad %%%%EndData line");
- if (outfp)
- fputs(buf, outfp);
- return 0;
-}
-
-int resource_manager::do_begin_binary(const char *ptr, int, FILE *fp,
- FILE *outfp)
-{
- if (!outfp)
- return 0;
- unsigned count;
- if (!read_uint_arg(&ptr, &count))
- return 0;
- if (outfp)
- fprintf(outfp, "%%%%BeginData: %u Binary Bytes\n", count);
- while (count != 0) {
- int c = getc(fp);
- if (c == EOF) {
- error("end of file within binary section");
- return 0;
- }
- if (outfp)
- putc(c, outfp);
- --count;
- if (c == '\r') {
- int cc = getc(fp);
- if (cc != '\n')
- current_lineno++;
- if (cc != EOF)
- ungetc(c, fp);
- }
- else if (c == '\n')
- current_lineno++;
- }
- char buf[PS_LINE_MAX + 2];
- if (!ps_get_line(buf, fp)) {
- error("missing %%%%EndBinary line");
- return 0;
- }
- if (!matches_comment(buf, "EndBinary")) {
- error("bad %%%%EndBinary line");
- if (outfp)
- fputs(buf, outfp);
- }
- else if (outfp)
- fputs("%%EndData\n", outfp);
- return 0;
-}
-
-static unsigned parse_extensions(const char *ptr)
-{
- unsigned flags = 0;
- for (;;) {
- while (white_space(*ptr))
- ptr++;
- if (*ptr == '\0')
- break;
- const char *name = ptr;
- do {
- ++ptr;
- } while (*ptr != '\0' && !white_space(*ptr));
- int i;
- for (i = 0; i < NEXTENSIONS; i++)
- if (strlen(extension_table[i]) == ptr - name
- && memcmp(extension_table[i], name, ptr - name) == 0) {
- flags |= (1 << i);
- break;
- }
- if (i >= NEXTENSIONS) {
- string s(name, ptr - name);
- s += '\0';
- error("unknown extension `%1'", s.contents());
- }
- }
- return flags;
-}
-
-// XXX if it has not been surrounded with {Begin,End}Document need to strip
-// out Page: Trailer {Begin,End}Prolog {Begin,End}Setup sections.
-
-// XXX Perhaps the decision whether to use BeginDocument or
-// BeginResource: file should be postponed till we have seen
-// the first line of the file.
-
-void resource_manager::process_file(int rank, FILE *fp, const char *filename,
- FILE *outfp)
-{
- // If none of these comments appear in the header section, and we are
- // just analyzing the file (ie outfp is 0), then we can return immediately.
- static const char *header_comment_table[] = {
- "DocumentNeededResources:",
- "DocumentSuppliedResources:",
- "DocumentNeededFonts:",
- "DocumentSuppliedFonts:",
- "DocumentNeededProcSets:",
- "DocumentSuppliedProcSets:",
- "DocumentNeededFiles:",
- "DocumentSuppliedFiles:",
- };
-
- const int NHEADER_COMMENTS = (sizeof(header_comment_table)
- / sizeof(header_comment_table[0]));
- struct comment_info {
- const char *name;
- int (resource_manager::*proc)(const char *, int, FILE *, FILE *);
- };
-
- static comment_info comment_table[] = {
- { "BeginResource:", &resource_manager::do_begin_resource },
- { "IncludeResource:", &resource_manager::do_include_resource },
- { "BeginDocument:", &resource_manager::do_begin_document },
- { "IncludeDocument:", &resource_manager::do_include_document },
- { "BeginProcSet:", &resource_manager::do_begin_procset },
- { "IncludeProcSet:", &resource_manager::do_include_procset },
- { "BeginFont:", &resource_manager::do_begin_font },
- { "IncludeFont:", &resource_manager::do_include_font },
- { "BeginFile:", &resource_manager::do_begin_file },
- { "IncludeFile:", &resource_manager::do_include_file },
- { "EndProcSet", &resource_manager::change_to_end_resource },
- { "EndFont", &resource_manager::change_to_end_resource },
- { "EndFile", &resource_manager::change_to_end_resource },
- { "BeginPreview:", &resource_manager::do_begin_preview },
- { "BeginData:", &resource_manager::do_begin_data },
- { "BeginBinary:", &resource_manager::do_begin_binary },
- };
-
- const int NCOMMENTS = sizeof(comment_table)/sizeof(comment_table[0]);
- char buf[PS_LINE_MAX + 2];
- int saved_lineno = current_lineno;
- const char *saved_filename = current_filename;
- current_filename = filename;
- current_lineno = 0;
- if (!ps_get_line(buf, fp)) {
- current_filename = saved_filename;
- current_lineno = saved_lineno;
- return;
- }
- if (strlen(buf) < sizeof(PS_MAGIC) - 1
- || memcmp(buf, PS_MAGIC, sizeof(PS_MAGIC) - 1) != 0) {
- if (outfp) {
- do {
- if (!(broken_flags & STRIP_PERCENT_BANG)
- || buf[0] != '%' || buf[1] != '!')
- fputs(buf, outfp);
- } while (ps_get_line(buf, fp));
- }
- }
- else {
- if (!(broken_flags & STRIP_PERCENT_BANG) && outfp)
- fputs(buf, outfp);
- int in_header = 1;
- int interesting = 0;
- int had_extensions_comment = 0;
- int had_language_level_comment = 0;
- for (;;) {
- if (!ps_get_line(buf, fp))
- break;
- int copy_this_line = 1;
- if (buf[0] == '%') {
- if (buf[1] == '%') {
- const char *ptr;
- int i;
- for (i = 0; i < NCOMMENTS; i++)
- if ((ptr = matches_comment(buf, comment_table[i].name))) {
- copy_this_line
- = (this->*(comment_table[i].proc))(ptr, rank, fp, outfp);
- break;
- }
- if (i >= NCOMMENTS && in_header) {
- if ((ptr = matches_comment(buf, "EndComments")))
- in_header = 0;
- else if (!had_extensions_comment
- && (ptr = matches_comment(buf, "Extensions:"))) {
- extensions |= parse_extensions(ptr);
- // XXX handle possibility that next line is %%+
- had_extensions_comment = 1;
- }
- else if (!had_language_level_comment
- && (ptr = matches_comment(buf, "LanguageLevel:"))) {
- unsigned ll;
- if (read_uint_arg(&ptr, &ll) && ll > language_level)
- language_level = ll;
- had_language_level_comment = 1;
- }
- else {
- for (i = 0; i < NHEADER_COMMENTS; i++)
- if (matches_comment(buf, header_comment_table[i])) {
- interesting = 1;
- break;
- }
- }
- }
- if ((broken_flags & STRIP_STRUCTURE_COMMENTS)
- && (matches_comment(buf, "EndProlog")
- || matches_comment(buf, "Page:")
- || matches_comment(buf, "Trailer")))
- copy_this_line = 0;
- }
- else if (buf[1] == '!') {
- if (broken_flags & STRIP_PERCENT_BANG)
- copy_this_line = 0;
- }
- }
- else
- in_header = 0;
- if (!outfp && !in_header && !interesting)
- break;
- if (copy_this_line && outfp)
- fputs(buf, outfp);
- }
- }
- current_filename = saved_filename;
- current_lineno = saved_lineno;
-}
-
-void resource_manager::read_download_file()
-{
- char *path = 0;
- FILE *fp = font::open_file("download", &path);
- if (!fp)
- fatal("can't find `download'");
- char buf[512];
- int lineno = 0;
- while (fgets(buf, sizeof(buf), fp)) {
- lineno++;
- char *p = strtok(buf, " \t\r\n");
- if (p == 0 || *p == '#')
- continue;
- char *q = strtok(0, " \t\r\n");
- if (!q)
- fatal_with_file_and_line(path, lineno, "missing filename");
- lookup_font(p)->filename = strsave(q);
- }
- a_delete path;
- fclose(fp);
-}
-
-// XXX Can we share some code with ps_output::put_string()?
-
-static void print_ps_string(const string &s, FILE *outfp)
-{
- int len = s.length();
- const char *str = s.contents();
- int funny = 0;
- if (str[0] == '(')
- funny = 1;
- else {
- for (int i = 0; i < len; i++)
- if (str[i] <= 040 || str[i] > 0176) {
- funny = 1;
- break;
- }
- }
- if (!funny) {
- put_string(s, outfp);
- return;
- }
- int level = 0;
- int i;
- for (i = 0; i < len; i++)
- if (str[i] == '(')
- level++;
- else if (str[i] == ')' && --level < 0)
- break;
- putc('(', outfp);
- for (i = 0; i < len; i++)
- switch (str[i]) {
- case '(':
- case ')':
- if (level != 0)
- putc('\\', outfp);
- putc(str[i], outfp);
- break;
- case '\\':
- fputs("\\\\", outfp);
- break;
- case '\n':
- fputs("\\n", outfp);
- break;
- case '\r':
- fputs("\\r", outfp);
- break;
- case '\t':
- fputs("\\t", outfp);
- break;
- case '\b':
- fputs("\\b", outfp);
- break;
- case '\f':
- fputs("\\f", outfp);
- break;
- default:
- if (str[i] < 040 || str[i] > 0176)
- fprintf(outfp, "\\%03o", str[i] & 0377);
- else
- putc(str[i], outfp);
- break;
- }
- putc(')', outfp);
-}
-
-void resource_manager::print_extensions_comment(FILE *outfp)
-{
- if (extensions) {
- fputs("%%Extensions:", outfp);
- for (int i = 0; i < NEXTENSIONS; i++)
- if (extensions & (1 << i)) {
- putc(' ', outfp);
- fputs(extension_table[i], outfp);
- }
- putc('\n', outfp);
- }
-}
-
-void resource_manager::print_language_level_comment(FILE *outfp)
-{
- if (language_level)
- fprintf(outfp, "%%%%LanguageLevel: %u\n", language_level);
-}
-
diff --git a/contrib/groff/grotty/Makefile.dep b/contrib/groff/grotty/Makefile.dep
deleted file mode 100644
index 59390586d72e..000000000000
--- a/contrib/groff/grotty/Makefile.dep
+++ /dev/null
@@ -1,3 +0,0 @@
-tty.o: tty.cc ../include/driver.h ../include/errarg.h \
- ../include/error.h ../include/font.h ../include/printer.h \
- ../include/lib.h
diff --git a/contrib/groff/grotty/Makefile.sub b/contrib/groff/grotty/Makefile.sub
deleted file mode 100644
index 91d3908c00fe..000000000000
--- a/contrib/groff/grotty/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=grotty
-MAN1=grotty.n
-XLIBS=$(LIBDRIVER) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=tty.o
-CCSRCS=$(srcdir)/tty.cc
diff --git a/contrib/groff/grotty/TODO b/contrib/groff/grotty/TODO
deleted file mode 100644
index 3f23dc35d56b..000000000000
--- a/contrib/groff/grotty/TODO
+++ /dev/null
@@ -1,3 +0,0 @@
-Document font and device description file usage of grotty.
-
-With -h avoid using a tab when a single space will do.
diff --git a/contrib/groff/grotty/grotty.man b/contrib/groff/grotty/grotty.man
deleted file mode 100644
index 51c6a498126f..000000000000
--- a/contrib/groff/grotty/grotty.man
+++ /dev/null
@@ -1,260 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.TH GROTTY @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-grotty \- groff driver for typewriter-like devices
-.SH SYNOPSIS
-.B grotty
-[
-.B \-hfbuodBUv
-] [
-.BI \-F dir
-] [
-.IR files \|.\|.\|.
-]
-.PP
-It is possible to have whitespace between the
-.B \-F
-option and its parameter.
-.SH DESCRIPTION
-.B grotty
-translates the output of GNU
-.B troff
-into a form suitable for typewriter-like devices.
-Normally
-.B grotty
-should invoked by using the
-.B groff
-command
-with a
-.BR \-Tascii ,
-.B \-Tlatin1
-or
-.B \-Tutf8
-option on ASCII based systems, and with
-.B \-Tcp1047
-on EBCDIC based hosts.
-If no files are given,
-.B grotty
-will read the standard input.
-A filename of
-.B \-
-will also cause
-.B grotty
-to read the standard input.
-Output is written to the standard output.
-.LP
-Normally
-.B grotty
-prints a bold character
-.I c
-using the sequence
-.RI ` c
-.SM BACKSPACE
-.IR c '
-and a italic character
-.I c
-by the sequence
-.RB ` _
-.SM BACKSPACE
-.IR c '.
-These sequences can be displayed on a terminal
-by piping through
-.BR ul (1).
-Pagers such as
-.BR more (1)
-or
-.BR less (1)
-are also able to display these sequences.
-Use either
-.B \-B
-or
-.B \-U
-when piping into
-.BR less (1);
-use
-.B \-b
-when piping into
-.BR more (1).
-There is no need to filter the output through
-.BR col (1)
-since
-.B grotty
-never outputs reverse line feeds.
-.LP
-The font description file may contain a command
-.IP
-.BI internalname\ n
-.LP
-where
-.I n
-is a decimal integer.
-If the 01 bit in
-.I n
-is set,
-then the font will be treated as an italic font;
-if the 02 bit is set,
-then it will be treated as a bold font.
-The code field in the font description field gives the
-code which will be used to output the character.
-This code can also be used in the
-.B \eN
-escape sequence in
-.BR troff .
-.SH OPTIONS
-.TP
-.BI \-F dir
-Search the directory
-.IB dir /dev name
-for font and device description files;
-.I name
-is the name of the device, usually
-.BR ascii ,
-.BR latin1 ,
-.BR utf8 ,
-or
-.BR cp1047 .
-.TP
-.B \-h
-Use horizontal tabs in the output.
-Tabs are assumed to be set every 8 columns.
-.TP
-.B \-f
-Use form feeds in the output.
-A form feed will be output at the end of each page that has no output
-on its last line.
-.TP
-.B \-b
-Suppress the use of overstriking for bold characters.
-.TP
-.B \-u
-Suppress the use of underlining for italic characters.
-.TP
-.B \-B
-Use only overstriking for bold-italic characters.
-.TP
-.B \-U
-Use only underlining for bold-italic characters.
-.TP
-.B \-o
-Suppress overstriking (other than for bold or underlined characters).
-.TP
-.B \-d
-Ignore all
-.B \eD
-commands.
-Without this
-.B grotty
-will render
-.B \eD'l\|.\|.\|.'
-commands that have at least at least one zero argument
-(and so are either horizontal or vertical)
-using
-.BR \- ,
-.B |
-and
-.B +
-characters.
-.TP
-.B \-v
-Print the version number.
-.SH FILES
-.TP
-.B @FONTDIR@/devascii/DESC
-Device description file for
-.B ascii
-device.
-.TP
-.BI @FONTDIR@/devascii/ F
-Font description file for font
-.I F
-of
-.B ascii
-device.
-.TP
-.B @FONTDIR@/devlatin1/DESC
-Device description file for
-.B latin1
-device.
-.TP
-.BI @FONTDIR@/devlatin1/ F
-Font description file for font
-.I F
-of
-.B latin1
-device.
-.TP
-.B @FONTDIR@/devutf8/DESC
-Device description file for
-.B utf8
-device.
-.TP
-.BI @FONTDIR@/devutf8/ F
-Font description file for font
-.I F
-of
-.B utf8
-device.
-.TP
-.B @FONTDIR@/devcp1047/DESC
-Device description file for
-.B cp1047
-device.
-.TP
-.BI @FONTDIR@/devcp1047/ F
-Font description file for font
-.I F
-of
-.B cp1047
-device.
-.TP
-.B @MACRODIR@/tmac.tty
-Macros for use with
-.BR grotty .
-.TP
-.B @MACRODIR@/tmac.tty-char
-Additional klugey character definitions for use with
-.BR grotty .
-.LP
-Note that on EBCDIC hosts, only files for the
-.B cp1047
-device will be installed.
-.SH BUGS
-.LP
-.B grotty
-is intended only for simple documents.
-.LP
-There is no support for fractional horizontal or vertical motions.
-.LP
-There is no support for
-.B \eD
-commands
-other than horizontal and vertical lines.
-.LP
-Characters above the first line (ie with a vertical position of 0)
-cannot be printed.
-.SH "SEE ALSO"
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR groff_out (@MAN5EXT@),
-.BR groff_font (@MAN5EXT@),
-.BR groff_char (@MAN7EXT@),
-.BR ul (1),
-.BR more (1),
-.BR less (1)
diff --git a/contrib/groff/grotty/tty.cc b/contrib/groff/grotty/tty.cc
deleted file mode 100644
index 63d8fb8fe527..000000000000
--- a/contrib/groff/grotty/tty.cc
+++ /dev/null
@@ -1,474 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989-2000 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "driver.h"
-#include "device.h"
-
-#ifndef SHRT_MIN
-#define SHRT_MIN (-32768)
-#endif
-
-#ifndef SHRT_MAX
-#define SHRT_MAX 32767
-#endif
-
-#define TAB_WIDTH 8
-
-static int horizontal_tab_flag = 0;
-static int form_feed_flag = 0;
-static int bold_flag = 1;
-static int underline_flag = 1;
-static int overstrike_flag = 1;
-static int draw_flag = 1;
-
-enum {
- UNDERLINE_MODE = 01,
- BOLD_MODE = 02,
- VDRAW_MODE = 04,
- HDRAW_MODE = 010
-};
-
-// Mode to use for bold-underlining.
-static unsigned char bold_underline_mode = BOLD_MODE|UNDERLINE_MODE;
-
-class tty_font : public font {
- tty_font(const char *);
- unsigned char mode;
-public:
- ~tty_font();
- unsigned char get_mode() { return mode; }
-#if 0
- void handle_x_command(int argc, const char **argv);
-#endif
- static tty_font *load_tty_font(const char *);
-};
-
-tty_font *tty_font::load_tty_font(const char *s)
-{
- tty_font *f = new tty_font(s);
- if (!f->load()) {
- delete f;
- return 0;
- }
- const char *num = f->get_internal_name();
- long n;
- if (num != 0 && (n = strtol(num, 0, 0)) != 0)
- f->mode = int(n & (BOLD_MODE|UNDERLINE_MODE));
- if (!underline_flag)
- f->mode &= ~UNDERLINE_MODE;
- if (!bold_flag)
- f->mode &= ~BOLD_MODE;
- if ((f->mode & (BOLD_MODE|UNDERLINE_MODE)) == (BOLD_MODE|UNDERLINE_MODE))
- f->mode = (f->mode & ~(BOLD_MODE|UNDERLINE_MODE)) | bold_underline_mode;
- return f;
-}
-
-tty_font::tty_font(const char *nm)
-: font(nm), mode(0)
-{
-}
-
-tty_font::~tty_font()
-{
-}
-
-#if 0
-void tty_font::handle_x_command(int argc, const char **argv)
-{
- if (argc >= 1 && strcmp(argv[0], "bold") == 0)
- mode |= BOLD_MODE;
- else if (argc >= 1 && strcmp(argv[0], "underline") == 0)
- mode |= UNDERLINE_MODE;
-}
-#endif
-
-class glyph {
- static glyph *free_list;
-public:
- glyph *next;
- short hpos;
- unsigned int code;
- unsigned char mode;
- void *operator new(size_t);
- void operator delete(void *);
- inline int draw_mode() { return mode & (VDRAW_MODE|HDRAW_MODE); }
-};
-
-glyph *glyph::free_list = 0;
-
-void *glyph::operator new(size_t)
-{
- if (!free_list) {
- const int BLOCK = 1024;
- free_list = (glyph *)new char[sizeof(glyph)*BLOCK];
- for (int i = 0; i < BLOCK - 1; i++)
- free_list[i].next = free_list + i + 1;
- free_list[BLOCK - 1].next = 0;
- }
- glyph *p = free_list;
- free_list = free_list->next;
- p->next = 0;
- return p;
-}
-
-void glyph::operator delete(void *p)
-{
- if (p) {
- ((glyph *)p)->next = free_list;
- free_list = (glyph *)p;
- }
-}
-
-class tty_printer : public printer {
- int is_utf8;
- glyph **lines;
- int nlines;
- int cached_v;
- int cached_vpos;
- void add_char(unsigned int, int, int, unsigned char);
-public:
- tty_printer(const char *device);
- ~tty_printer();
- void set_char(int, font *, const environment *, int, const char *name);
- void draw(int code, int *p, int np, const environment *env);
- void put_char(unsigned int);
- void begin_page(int) { }
- void end_page(int page_length);
- font *make_font(const char *);
-};
-
-tty_printer::tty_printer(const char *device) : cached_v(0)
-{
- is_utf8 = !strcmp(device,"utf8");
- nlines = 66;
- lines = new glyph *[nlines];
- for (int i = 0; i < nlines; i++)
- lines[i] = 0;
-}
-
-tty_printer::~tty_printer()
-{
- a_delete lines;
-}
-
-void tty_printer::set_char(int i, font *f, const environment *env, int w, const char *name)
-{
- if (w != font::hor)
- fatal("width of character not equal to horizontal resolution");
- add_char(f->get_code(i), env->hpos, env->vpos, ((tty_font *)f)->get_mode());
-}
-
-void tty_printer::add_char(unsigned int c, int h, int v, unsigned char mode)
-{
-#if 0
- // This is too expensive.
- if (h % font::hor != 0)
- fatal("horizontal position not a multiple of horizontal resolution");
-#endif
- int hpos = h / font::hor;
- if (hpos < SHRT_MIN || hpos > SHRT_MAX) {
- error("character with ridiculous horizontal position discarded");
- return;
- }
- int vpos;
- if (v == cached_v && cached_v != 0)
- vpos = cached_vpos;
- else {
- if (v % font::vert != 0)
- fatal("vertical position not a multiple of vertical resolution");
- vpos = v / font::vert;
- if (vpos > nlines) {
- glyph **old_lines = lines;
- lines = new glyph *[vpos + 1];
- memcpy(lines, old_lines, nlines*sizeof(glyph *));
- for (int i = nlines; i <= vpos; i++)
- lines[i] = 0;
- a_delete old_lines;
- nlines = vpos + 1;
- }
- // Note that the first output line corresponds to groff
- // position font::vert.
- if (vpos <= 0) {
- error("character above first line discarded");
- return;
- }
- cached_v = v;
- cached_vpos = vpos;
- }
- glyph *g = new glyph;
- g->hpos = hpos;
- g->code = c;
- g->mode = mode;
-
- // The list will be reversed later. After reversal, it must be in
- // increasing order of hpos, with HDRAW characters before VDRAW
- // characters before normal characters at each hpos, and otherwise
- // in order of occurrence.
-
- glyph **pp;
- for (pp = lines + (vpos - 1); *pp; pp = &(*pp)->next)
- if ((*pp)->hpos < hpos
- || ((*pp)->hpos == hpos && (*pp)->draw_mode() >= g->draw_mode()))
- break;
-
- g->next = *pp;
- *pp = g;
-}
-
-void tty_printer::draw(int code, int *p, int np, const environment *env)
-{
- if (code != 'l' || !draw_flag)
- return;
- if (np != 2) {
- error("2 arguments required for line");
- return;
- }
- if (p[0] == 0) {
- // vertical line
- int v = env->vpos;
- int len = p[1];
- if (len < 0) {
- v += len;
- len = -len;
- }
- while (len >= 0) {
- add_char('|', env->hpos, v, VDRAW_MODE);
- len -= font::vert;
- v += font::vert;
- }
- }
- if (p[1] == 0) {
- // horizontal line
- int h = env->hpos;
- int len = p[0];
- if (len < 0) {
- h += len;
- len = -len;
- }
- while (len >= 0) {
- add_char('-', h, env->vpos, HDRAW_MODE);
- len -= font::hor;
- h += font::hor;
- }
- }
-}
-
-void tty_printer::put_char (unsigned int wc)
-{
- if (is_utf8 && wc >= 0x80) {
- char buf[6+1];
- int count;
- char *p = buf;
- if (wc < 0x800)
- count = 1, *p = (unsigned char) ((wc >> 6) | 0xC0);
- else if (wc < 0x10000)
- count = 2, *p = (unsigned char) ((wc >> 12) | 0xE0);
- else if (wc < 0x200000)
- count = 3, *p = (unsigned char) ((wc >> 18) | 0xF0);
- else if (wc < 0x4000000)
- count = 4, *p = (unsigned char) ((wc >> 24) | 0xF8);
- else if (wc <= 0x7FFFFFFF)
- count = 5, *p = (unsigned char) ((wc >> 30) | 0xFC);
- else
- return;
- do *++p = (unsigned char)(((wc >> (6 * --count)) & 0x3F) | 0x80);
- while (count > 0);
- *++p = '\0';
- fputs(buf,stdout);
- } else {
- putchar(wc);
- }
-}
-
-void tty_printer::end_page(int page_length)
-{
- if (page_length % font::vert != 0)
- error("vertical position at end of page not multiple of vertical resolution");
- int lines_per_page = page_length / font::vert;
- int last_line;
- for (last_line = nlines; last_line > 0; last_line--)
- if (lines[last_line - 1])
- break;
-#if 0
- if (last_line > lines_per_page) {
- error("characters past last line discarded");
- do {
- --last_line;
- while (lines[last_line]) {
- glyph *tem = lines[last_line];
- lines[last_line] = tem->next;
- delete tem;
- }
- } while (last_line > lines_per_page);
- }
-#endif
- for (int i = 0; i < last_line; i++) {
- glyph *p = lines[i];
- lines[i] = 0;
- glyph *g = 0;
- while (p) {
- glyph *tem = p->next;
- p->next = g;
- g = p;
- p = tem;
- }
- int hpos = 0;
-
- glyph *nextp;
- for (p = g; p; delete p, p = nextp) {
- nextp = p->next;
- if (nextp && p->hpos == nextp->hpos) {
- if (p->draw_mode() == HDRAW_MODE && nextp->draw_mode() == VDRAW_MODE) {
- nextp->code = '+';
- continue;
- }
- if (p->draw_mode() != 0 && p->draw_mode() == nextp->draw_mode()) {
- nextp->code = p->code;
- continue;
- }
- if (!overstrike_flag)
- continue;
- }
- if (hpos > p->hpos) {
- do {
- putchar('\b');
- hpos--;
- } while (hpos > p->hpos);
- }
- else {
- if (horizontal_tab_flag) {
- for (;;) {
- int next_tab_pos = ((hpos + TAB_WIDTH) / TAB_WIDTH) * TAB_WIDTH;
- if (next_tab_pos > p->hpos)
- break;
- putchar('\t');
- hpos = next_tab_pos;
- }
- }
- for (; hpos < p->hpos; hpos++)
- putchar(' ');
- }
- assert(hpos == p->hpos);
- if (p->mode & UNDERLINE_MODE) {
- putchar('_');
- putchar('\b');
- }
- if (p->mode & BOLD_MODE) {
- put_char(p->code);
- putchar('\b');
- }
- put_char(p->code);
- hpos++;
- }
- putchar('\n');
- }
- if (form_feed_flag) {
- if (last_line < lines_per_page)
- putchar('\f');
- }
- else {
- for (; last_line < lines_per_page; last_line++)
- putchar('\n');
- }
-}
-
-font *tty_printer::make_font(const char *nm)
-{
- return tty_font::load_tty_font(nm);
-}
-
-printer *make_printer()
-{
- return new tty_printer(device);
-}
-
-static void usage();
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- int c;
- while ((c = getopt(argc, argv, "F:vhfbuoBUd")) != EOF)
- switch(c) {
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "grotty version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case 'b':
- // Do not embolden by overstriking.
- bold_flag = 0;
- break;
- case 'u':
- // Do not underline.
- underline_flag = 0;
- break;
- case 'o':
- // Do not overstrike (other than emboldening and underlining).
- overstrike_flag = 0;
- break;
- case 'B':
- // Do bold-underlining as bold.
- bold_underline_mode = BOLD_MODE;
- break;
- case 'U':
- // Do bold-underlining as underlining.
- bold_underline_mode = UNDERLINE_MODE;
- break;
- case 'h':
- // Use horizontal tabs.
- horizontal_tab_flag = 1;
- break;
- case 'f':
- form_feed_flag = 1;
- break;
- case 'F':
- font::command_line_font_dir(optarg);
- break;
- case 'd':
- // Ignore \D commands.
- draw_flag = 0;
- break;
- case '?':
- usage();
- break;
- default:
- assert(0);
- }
- if (optind >= argc)
- do_file("-");
- else {
- for (int i = optind; i < argc; i++)
- do_file(argv[i]);
- }
- delete pr;
- return 0;
-}
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-hfvbuodBU] [-F dir] [files ...]\n",
- program_name);
- exit(1);
-}
diff --git a/contrib/groff/hpftodit/Makefile.dep b/contrib/groff/hpftodit/Makefile.dep
deleted file mode 100644
index 5239b9d7b686..000000000000
--- a/contrib/groff/hpftodit/Makefile.dep
+++ /dev/null
@@ -1,3 +0,0 @@
-hpftodit.o: hpftodit.cc ../include/assert.h ../include/lib.h \
- ../include/posix.h ../include/errarg.h ../include/error.h \
- ../include/cset.h
diff --git a/contrib/groff/hpftodit/Makefile.sub b/contrib/groff/hpftodit/Makefile.sub
deleted file mode 100644
index f5ff13e48654..000000000000
--- a/contrib/groff/hpftodit/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=hpftodit
-MAN1=hpftodit.n
-XLIBS=$(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=hpftodit.o
-CCSRCS=$(srcdir)/hpftodit.cc
diff --git a/contrib/groff/hpftodit/hpftodit.cc b/contrib/groff/hpftodit/hpftodit.cc
deleted file mode 100644
index 2e5978c10f1e..000000000000
--- a/contrib/groff/hpftodit/hpftodit.cc
+++ /dev/null
@@ -1,812 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1994 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/*
-TODO
-put human readable font name in device file
-devise new names for useful characters
-use --- for unnamed characters
-option to specify symbol sets to look in
-make it work with TrueType fonts
-put filename in error messages (or fix lib)
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include "assert.h"
-#include "lib.h"
-#include "posix.h"
-#include "errarg.h"
-#include "error.h"
-#include "cset.h"
-#include "nonposix.h"
-
-#define SIZEOF(v) (sizeof(v)/sizeof(v[0]))
-
-const int MULTIPLIER = 3;
-
-inline
-int scale(int n)
-{
- return n * MULTIPLIER;
-}
-
-// tags in TFM file
-
-enum tag_type {
- min_tag = 400,
- type_tag = 400,
- symbol_set_tag = 404,
- msl_tag = 403,
- inches_per_point_tag = 406,
- design_units_per_em_tag = 408,
- posture_tag = 409,
- stroke_weight_tag = 411,
- spacing_tag = 412,
- slant_tag = 413,
- appearance_width_tag = 414,
- word_spacing_tag = 421,
- x_height_tag = 424,
- lower_ascent_tag = 427,
- lower_descent_tag = 428,
- width_tag = 433,
- left_extent_tag = 435,
- right_extent_tag = 436,
- ascent_tag = 437,
- descent_tag = 438,
- pair_kern_tag = 439,
- typeface_tag = 442,
- max_tag = 443
- };
-
-// types in TFM file
-
-enum {
- ENUM_TYPE = 1,
- BYTE_TYPE = 2,
- USHORT_TYPE = 3,
- FLOAT_TYPE = 5,
- SIGNED_SHORT_TYPE = 17
- };
-
-
-typedef unsigned char byte;
-typedef unsigned short uint16;
-typedef short int16;
-typedef unsigned int uint32;
-
-class File {
-public:
- File(const char *);
- void skip(int n);
- byte get_byte();
- uint16 get_uint16();
- uint32 get_uint32();
- void seek(uint32 n);
-private:
- unsigned char *buf_;
- const unsigned char *ptr_;
- const unsigned char *end_;
-};
-
-struct entry {
- char present;
- uint16 type;
- uint32 count;
- uint32 value;
- entry() : present(0) { }
-};
-
-struct char_info {
- uint16 msl;
- uint16 width;
- uint16 ascent;
- int16 descent;
- int16 left_extent;
- uint16 right_extent;
- uint16 symbol_set;
- unsigned char code;
-};
-
-const uint16 NO_SYMBOL_SET = 0;
-
-struct name_list {
- char *name;
- name_list *next;
- name_list(const char *s, name_list *p) : name(strsave(s)), next(p) { }
- ~name_list() { a_delete name; }
-};
-
-struct symbol_set {
- uint16 select;
- uint16 index[256];
-};
-
-#define SYMBOL_SET(n, c) ((n) * 32 + ((c) - 64))
-
-uint16 text_symbol_sets[] = {
- SYMBOL_SET(0, 'N'), // Latin 1
- SYMBOL_SET(6, 'J'), // Microsoft Publishing
- SYMBOL_SET(2, 'N'), // Latin 2
- 0
- };
-
-uint16 special_symbol_sets[] = {
- SYMBOL_SET(8, 'M'),
- SYMBOL_SET(5, 'M'),
- SYMBOL_SET(15, 'U'),
- 0
- };
-
-entry tags[max_tag + 1 - min_tag];
-
-char_info *char_table;
-uint32 nchars;
-
-int msl_name_table_size = 0;
-name_list **msl_name_table = 0;
-
-int n_symbol_sets;
-symbol_set *symbol_set_table;
-
-static int special_flag = 0;
-static int italic_flag = 0;
-static int italic_sep;
-
-static void usage();
-static const char *xbasename(const char *);
-static void read_tags(File &);
-static void check_type();
-static void check_units(File &);
-static int read_map(const char *);
-static void require_tag(tag_type);
-static void dump_tags(File &f);
-static void output_spacewidth();
-static void output_pclweight();
-static void output_pclproportional();
-static void read_and_output_pcltypeface(File &);
-static void output_pclstyle();
-static void output_slant();
-static void output_ligatures();
-static void read_symbol_sets(File &);
-static void read_and_output_kernpairs(File &);
-static void output_charset();
-static void read_char_table(File &f);
-
-inline
-entry &tag_info(tag_type t)
-{
- return tags[t - min_tag];
-}
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
-
- int opt;
- int debug_flag = 0;
-
- while ((opt = getopt(argc, argv, "dsvi:")) != EOF) {
- switch (opt) {
- case 'd':
- debug_flag = 1;
- break;
- case 's':
- special_flag = 1;
- break;
- case 'i':
- italic_flag = 1;
- italic_sep = atoi(optarg);
- break;
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "hpftodit version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- break;
- case '?':
- usage();
- default:
- assert(0);
- }
- }
- if (argc - optind != 3)
- usage();
- File f(argv[optind]);
- if (!read_map(argv[optind + 1]))
- exit(1);
- current_filename = 0;
- current_lineno = -1; // no line numbers
- if (freopen(argv[optind + 2], "w", stdout) == 0)
- fatal("cannot open `%1': %2", argv[optind + 2], strerror(errno));
- current_filename = argv[optind];
- printf("name %s\n", xbasename(argv[optind + 2]));
- if (special_flag)
- printf("special\n");
- read_tags(f);
- check_type();
- check_units(f);
- if (debug_flag)
- dump_tags(f);
- read_char_table(f);
- output_spacewidth();
- output_slant();
- read_and_output_pcltypeface(f);
- output_pclproportional();
- output_pclweight();
- output_pclstyle();
- read_symbol_sets(f);
- output_ligatures();
- read_and_output_kernpairs(f);
- output_charset();
- return 0;
-}
-
-static
-void usage()
-{
- fprintf(stderr, "usage: %s [-s] [-i n] tfm_file map_file output_font\n",
- program_name);
- exit(1);
-}
-
-File::File(const char *s)
-{
- // We need to read the file in binary mode because hpftodit relies
- // on byte counts.
- int fd = open(s, O_RDONLY | O_BINARY);
- if (fd < 0)
- fatal("cannot open `%1': %2", s, strerror(errno));
- current_filename = s;
- struct stat sb;
- if (fstat(fd, &sb) < 0)
- fatal("cannot stat: %1", strerror(errno));
- if (!S_ISREG(sb.st_mode))
- fatal("not a regular file");
- buf_ = new unsigned char[sb.st_size];
- long nread = read(fd, buf_, sb.st_size);
- if (nread < 0)
- fatal("read error: %1", strerror(errno));
- if (nread != sb.st_size)
- fatal("read unexpected number of bytes");
- ptr_ = buf_;
- end_ = buf_ + sb.st_size;
- // These are actually text files, so we must get rid of the `\r'
- // characters. This is also enabled for Posix systems, in case the
- // input came from Windows...
- unsigned char *p = buf_, *q = buf_;
- while (q < end_)
- {
- if (*q == '\r')
- {
- if (*++q != '\n')
- *p++ = '\r';
- }
-#if defined(__MSDOS__) || defined(_MSC_VER)
- if (*q == '\032') // ^Z means ``software EOF''
- break;
-#endif
- *p++ = *q++;
- }
- end_ = p;
-}
-
-void File::skip(int n)
-{
- if (end_ - ptr_ < n)
- fatal("unexpected end of file");
- ptr_ += n;
-}
-
-void File::seek(uint32 n)
-{
- if (end_ - buf_ < n)
- fatal("unexpected end of file");
- ptr_ = buf_ + n;
-}
-
-byte File::get_byte()
-{
- if (ptr_ >= end_)
- fatal("unexpected end of file");
- return *ptr_++;
-}
-
-uint16 File::get_uint16()
-{
- if (end_ - ptr_ < 2)
- fatal("unexpected end of file");
- uint16 n = *ptr_++;
- return n + (*ptr_++ << 8);
-}
-
-uint32 File::get_uint32()
-{
- if (end_ - ptr_ < 4)
- fatal("unexpected end of file");
- uint32 n = *ptr_++;
- for (int i = 0; i < 3; i++)
- n += *ptr_++ << (i + 1)*8;
- return n;
-}
-
-static
-void read_tags(File &f)
-{
- if (f.get_byte() != 'I' || f.get_byte() != 'I')
- fatal("not an Intel format TFM file");
- f.skip(6);
- uint16 ntags = f.get_uint16();
- entry dummy;
- for (uint16 i = 0; i < ntags; i++) {
- uint16 tag = f.get_uint16();
- entry *p;
- if (min_tag <= tag && tag <= max_tag)
- p = tags + (tag - min_tag);
- else
- p = &dummy;
- p->present = 1;
- p->type = f.get_uint16();
- p->count = f.get_uint32();
- p->value = f.get_uint32();
- }
-}
-
-static
-void check_type()
-{
- require_tag(type_tag);
- if (tag_info(type_tag).value != 0) {
- if (tag_info(type_tag).value == 2)
- fatal("cannot handle TrueType tfm files");
- fatal("unknown type tag %1", int(tag_info(type_tag).value));
- }
-}
-
-static
-void check_units(File &f)
-{
- require_tag(design_units_per_em_tag);
- f.seek(tag_info(design_units_per_em_tag).value);
- uint32 num = f.get_uint32();
- uint32 den = f.get_uint32();
- if (num != 8782 || den != 1)
- fatal("design units per em != 8782/1");
- require_tag(inches_per_point_tag);
- f.seek(tag_info(inches_per_point_tag).value);
- num = f.get_uint32();
- den = f.get_uint32();
- if (num != 100 || den != 7231)
- fatal("inches per point not 100/7231");
-}
-
-static
-void require_tag(tag_type t)
-{
- if (!tag_info(t).present)
- fatal("tag %1 missing", int(t));
-}
-
-static
-void output_spacewidth()
-{
- require_tag(word_spacing_tag);
- printf("spacewidth %d\n", scale(tag_info(word_spacing_tag).value));
-}
-
-static
-void read_symbol_sets(File &f)
-{
- uint32 symbol_set_dir_length = tag_info(symbol_set_tag).count;
- n_symbol_sets = symbol_set_dir_length/14;
- symbol_set_table = new symbol_set[n_symbol_sets];
- int i;
- for (i = 0; i < n_symbol_sets; i++) {
- f.seek(tag_info(symbol_set_tag).value + i*14);
- (void)f.get_uint32();
- uint32 off1 = f.get_uint32();
- uint32 off2 = f.get_uint32();
- (void)f.get_uint16(); // what's this for?
- f.seek(off1);
- int j;
- uint16 kind = 0;
- for (j = 0; j < off2 - off1; j++) {
- unsigned char c = f.get_byte();
- if ('0' <= c && c <= '9')
- kind = kind*10 + (c - '0');
- else if ('A' <= c && c <= 'Z')
- kind = kind*32 + (c - 64);
- }
- symbol_set_table[i].select = kind;
- for (j = 0; j < 256; j++)
- symbol_set_table[i].index[j] = f.get_uint16();
- }
- for (i = 0; i < nchars; i++)
- char_table[i].symbol_set = NO_SYMBOL_SET;
-
- uint16 *symbol_set_selectors = (special_flag
- ? special_symbol_sets
- : text_symbol_sets);
- for (i = 0; symbol_set_selectors[i] != 0; i++) {
- int j;
- for (j = 0; j < n_symbol_sets; j++)
- if (symbol_set_table[j].select == symbol_set_selectors[i])
- break;
- if (j < n_symbol_sets) {
- for (int k = 0; k < 256; k++) {
- uint16 index = symbol_set_table[j].index[k];
- if (index != 0xffff
- && char_table[index].symbol_set == NO_SYMBOL_SET) {
- char_table[index].symbol_set = symbol_set_table[j].select;
- char_table[index].code = k;
- }
- }
- }
- }
-}
-
-static
-void read_char_table(File &f)
-{
- require_tag(msl_tag);
- nchars = tag_info(msl_tag).count;
- char_table = new char_info[nchars];
-
- f.seek(tag_info(msl_tag).value);
- uint32 i;
- for (i = 0; i < nchars; i++)
- char_table[i].msl = f.get_uint16();
-
- require_tag(width_tag);
- f.seek(tag_info(width_tag).value);
- for (i = 0; i < nchars; i++)
- char_table[i].width = f.get_uint16();
-
- require_tag(ascent_tag);
- f.seek(tag_info(ascent_tag).value);
- for (i = 0; i < nchars; i++) {
- char_table[i].ascent = f.get_uint16();
- }
-
- require_tag(descent_tag);
- f.seek(tag_info(descent_tag).value);
- for (i = 0; i < nchars; i++) {
- char_table[i].descent = f.get_uint16();
- if (char_table[i].descent > 0)
- char_table[i].descent = 0;
- }
-
- require_tag(left_extent_tag);
- f.seek(tag_info(left_extent_tag).value);
- for (i = 0; i < nchars; i++)
- char_table[i].left_extent = int16(f.get_uint16());
-
- require_tag(right_extent_tag);
- f.seek(tag_info(right_extent_tag).value);
- for (i = 0; i < nchars; i++)
- char_table[i].right_extent = f.get_uint16();
-}
-
-static
-void output_pclweight()
-{
- require_tag(stroke_weight_tag);
- int stroke_weight = tag_info(stroke_weight_tag).value;
- int pcl_stroke_weight;
- if (stroke_weight < 128)
- pcl_stroke_weight = -3;
- else if (stroke_weight == 128)
- pcl_stroke_weight = 0;
- else if (stroke_weight <= 145)
- pcl_stroke_weight = 1;
- else if (stroke_weight <= 179)
- pcl_stroke_weight = 3;
- else
- pcl_stroke_weight = 4;
- printf("pclweight %d\n", pcl_stroke_weight);
-}
-
-static
-void output_pclproportional()
-{
- require_tag(spacing_tag);
- printf("pclproportional %d\n", tag_info(spacing_tag).value == 0);
-}
-
-static
-void read_and_output_pcltypeface(File &f)
-{
- printf("pcltypeface ");
- require_tag(typeface_tag);
- f.seek(tag_info(typeface_tag).value);
- for (uint32 i = 0; i < tag_info(typeface_tag).count; i++) {
- unsigned char c = f.get_byte();
- if (c == '\0')
- break;
- putchar(c);
- }
- printf("\n");
-}
-
-static
-void output_pclstyle()
-{
- unsigned pcl_style = 0;
- // older tfms don't have the posture tag
- if (tag_info(posture_tag).present) {
- if (tag_info(posture_tag).value)
- pcl_style |= 1;
- }
- else {
- require_tag(slant_tag);
- if (tag_info(slant_tag).value != 0)
- pcl_style |= 1;
- }
- require_tag(appearance_width_tag);
- if (tag_info(appearance_width_tag).value < 100) // guess
- pcl_style |= 4;
- printf("pclstyle %d\n", pcl_style);
-}
-
-static
-void output_slant()
-{
- require_tag(slant_tag);
- int slant = int16(tag_info(slant_tag).value);
- if (slant != 0)
- printf("slant %f\n", slant/100.0);
-}
-
-static
-void output_ligatures()
-{
- // don't use ligatures for fixed space font
- require_tag(spacing_tag);
- if (tag_info(spacing_tag).value != 0)
- return;
- static const char *ligature_names[] = {
- "fi", "fl", "ff", "ffi", "ffl"
- };
-
- static const char *ligature_chars[] = {
- "fi", "fl", "ff", "Fi", "Fl"
- };
-
- unsigned ligature_mask = 0;
- int i;
- for (i = 0; i < nchars; i++) {
- uint16 msl = char_table[i].msl;
- if (msl < msl_name_table_size
- && char_table[i].symbol_set != NO_SYMBOL_SET) {
- for (name_list *p = msl_name_table[msl]; p; p = p->next)
- for (int j = 0; j < SIZEOF(ligature_chars); j++)
- if (strcmp(p->name, ligature_chars[j]) == 0) {
- ligature_mask |= 1 << j;
- break;
- }
- }
- }
- if (ligature_mask) {
- printf("ligatures");
- for (i = 0; i < SIZEOF(ligature_names); i++)
- if (ligature_mask & (1 << i))
- printf(" %s", ligature_names[i]);
- printf(" 0\n");
- }
-}
-
-static
-void read_and_output_kernpairs(File &f)
-{
- if (tag_info(pair_kern_tag).present) {
- printf("kernpairs\n");
- f.seek(tag_info(pair_kern_tag).value);
- uint16 n_pairs = f.get_uint16();
- for (int i = 0; i < n_pairs; i++) {
- uint16 i1 = f.get_uint16();
- uint16 i2 = f.get_uint16();
- int16 val = int16(f.get_uint16());
- if (char_table[i1].symbol_set != NO_SYMBOL_SET
- && char_table[i2].symbol_set != NO_SYMBOL_SET
- && char_table[i1].msl < msl_name_table_size
- && char_table[i2].msl < msl_name_table_size) {
- for (name_list *p = msl_name_table[char_table[i1].msl];
- p;
- p = p->next)
- for (name_list *q = msl_name_table[char_table[i2].msl];
- q;
- q = q->next)
- printf("%s %s %d\n", p->name, q->name, scale(val));
- }
- }
- }
-}
-
-static
-void output_charset()
-{
- require_tag(slant_tag);
- double slant_angle = int16(tag_info(slant_tag).value)*PI/18000.0;
- double slant = sin(slant_angle)/cos(slant_angle);
-
- require_tag(x_height_tag);
- require_tag(lower_ascent_tag);
- require_tag(lower_descent_tag);
-
- printf("charset\n");
- int i;
- for (i = 0; i < nchars; i++) {
- uint16 msl = char_table[i].msl;
- if (msl < msl_name_table_size
- && msl_name_table[msl]) {
- if (char_table[i].symbol_set != NO_SYMBOL_SET) {
- printf("%s\t%d,%d",
- msl_name_table[msl]->name,
- scale(char_table[i].width),
- scale(char_table[i].ascent));
- int depth = scale(- char_table[i].descent);
- if (depth < 0)
- depth = 0;
- int italic_correction = 0;
- int left_italic_correction = 0;
- int subscript_correction = 0;
- if (italic_flag) {
- italic_correction = scale(char_table[i].right_extent
- - char_table[i].width
- + italic_sep);
- if (italic_correction < 0)
- italic_correction = 0;
- subscript_correction = int((tag_info(x_height_tag).value
- * slant * .8) + .5);
- if (subscript_correction > italic_correction)
- subscript_correction = italic_correction;
- left_italic_correction = scale(italic_sep
- - char_table[i].left_extent);
- }
- if (subscript_correction != 0)
- printf(",%d,%d,%d,%d",
- depth, italic_correction, left_italic_correction,
- subscript_correction);
- else if (left_italic_correction != 0)
- printf(",%d,%d,%d", depth, italic_correction, left_italic_correction);
- else if (italic_correction != 0)
- printf(",%d,%d", depth, italic_correction);
- else if (depth != 0)
- printf(",%d", depth);
- // This is fairly arbitrary. Fortunately it doesn't much matter.
- unsigned type = 0;
- if (char_table[i].ascent > (tag_info(lower_ascent_tag).value*9)/10)
- type |= 2;
- if (char_table[i].descent < (int16(tag_info(lower_descent_tag).value)*9)/10)
- type |= 1;
- printf("\t%d\t%d\n",
- type,
- char_table[i].symbol_set*256 + char_table[i].code);
- for (name_list *p = msl_name_table[msl]->next; p; p = p->next)
- printf("%s\t\"\n", p->name);
- }
- else
- warning("MSL %1 not in any of the searched symbol sets", msl);
- }
- }
-}
-
-static
-void dump_tags(File &f)
-{
- int i;
- for (i = min_tag; i <= max_tag; i++) {
- enum tag_type t = tag_type(i);
- if (tag_info(t).present) {
- fprintf(stderr,
- "%d %d %d %d\n", i, tag_info(t).type, tag_info(t).count,
- tag_info(t).value);
- if (tag_info(t).type == FLOAT_TYPE
- && tag_info(t).count == 1) {
- f.seek(tag_info(t).value);
- uint32 num = f.get_uint32();
- uint32 den = f.get_uint32();
- fprintf(stderr, "(%u/%u = %g)\n", num, den, (double)num/den);
- }
- }
- }
-}
-
-static
-int read_map(const char *file)
-{
- errno = 0;
- FILE *fp = fopen(file, "r");
- if (!fp) {
- error("can't open `%1': %2", file, strerror(errno));
- return 0;
- }
- current_filename = file;
- char buf[512];
- current_lineno = 0;
- while (fgets(buf, int(sizeof(buf)), fp)) {
- current_lineno++;
- char *ptr = buf;
- while (csspace(*ptr))
- ptr++;
- if (*ptr == '\0' || *ptr == '#')
- continue;
- ptr = strtok(ptr, " \n\t");
- if (!ptr)
- continue;
- int n;
- if (sscanf(ptr, "%d", &n) != 1) {
- error("bad map file");
- fclose(fp);
- return 0;
- }
- if (n < 0) {
- error("negative code");
- fclose(fp);
- return 0;
- }
- if (n >= msl_name_table_size) {
- size_t old_size = msl_name_table_size;
- name_list **old_table = msl_name_table;
- msl_name_table_size = n + 256;
- msl_name_table = new name_list *[msl_name_table_size];
- if (old_table) {
- memcpy(msl_name_table, old_table, old_size*sizeof(name_list *));
- a_delete old_table;
- }
- for (size_t i = old_size; i < msl_name_table_size; i++)
- msl_name_table[i] = 0;
- }
- ptr = strtok(0, " \n\t");
- if (!ptr) {
- error("missing names");
- fclose(fp);
- return 0;
- }
- for (; ptr; ptr = strtok(0, " \n\t"))
- msl_name_table[n] = new name_list(ptr, msl_name_table[n]);
- }
- fclose(fp);
- return 1;
-}
-
-static
-const char *xbasename(const char *s)
-{
- // DIR_SEPS[] are possible directory separator characters, see
- // nonposix.h. We want the rightmost separator of all possible
- // ones. Example: d:/foo\\bar.
- const char *b = strrchr(s, DIR_SEPS[0]), *b1;
- const char *sep = &DIR_SEPS[1];
-
- while (*sep)
- {
- b1 = strrchr(s, *sep);
- if (b1 && (!b || b1 > b))
- b = b1;
- sep++;
- }
- return b ? b + 1 : s;
-}
diff --git a/contrib/groff/hpftodit/hpftodit.man b/contrib/groff/hpftodit/hpftodit.man
deleted file mode 100644
index d107e8c8d549..000000000000
--- a/contrib/groff/hpftodit/hpftodit.man
+++ /dev/null
@@ -1,155 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1994-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.TH HPFTODIT @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-hpftodit \- create font description files for use with groff \-Tlj4
-.SH SYNOPSIS
-.B hpftodit
-[
-.B \-sv
-]
-[
-.BI \-i n
-]
-.I tfm_file
-.I map_file
-.I font
-.PP
-It is possible to have whitespace between the
-.B \-i
-command line option and its parameter.
-.SH DESCRIPTION
-.B hpftodit
-creates a font file for use with
-.B
-groff \-Tlj4\fR
-from an HP tagged font metric file.
-.I tfm_file
-is the name of the tagged font metric file for the font.
-.I map_file
-is a file giving the groff names for characters in the font;
-this file should consist of a sequence of lines of the form:
-.IP
-.I
-n c1 c2 \fR.\|.\|.
-.LP
-where
-.I n
-is a decimal integer giving the MSL number of the character,
-and
-.IR c1 ,
-.IR c2 ,.\|.\|.
-are the groff names of the character.
-.I font
-is the name of the groff font file.
-The groff font file is written to
-.IR font .
-.LP
-The
-.B \-s
-option should be given if the font is special
-(a font is
-.I special
-if
-.B troff
-should search it whenever
-a character is not found in the current font.)
-If the font is special,
-it should be listed in the
-.B fonts
-command in the DESC file;
-if it is not special, there is no need to list it, since
-.B troff
-can automatically mount it when it's first used.
-.LP
-If the
-.B \-i
-option is used,
-.B hpftodit
-will automatically generate an italic correction,
-a left italic correction and a subscript correction
-for each character
-(the significance of these parameters is explained in
-.BR groff_font (@MAN5EXT@)).
-.SH OPTIONS
-.TP
-.B \-v
-Print the version number.
-.TP
-.B \-s
-The font is special.
-The effect of this option is to add the
-.B special
-command to the font file.
-.TP
-.BI \-i n
-Generate an italic correction for each character so that
-the character's width plus the character's italic correction
-is equal to
-.I n
-design units
-plus the amount by which the right edge of the character's bounding
-is to the right of the character's origin.
-If this would result in a negative italic correction, use a zero
-italic correction instead.
-There are 8782 design units per em for Intellifont fonts.
-.IP
-Also generate a subscript correction equal to the
-product of the tangent of the slant of the font and
-four fifths of the x-height of the font.
-If this would result in a subscript correction greater than the italic
-correction, use a subscript correction equal to the italic correction
-instead.
-.IP
-Also generate a left italic correction for each character
-equal to
-.I n
-design units
-plus the amount by which the left edge of the character's bounding box
-is to the left of the character's origin.
-The left italic correction may be negative.
-.IP
-This option is normally needed only with italic (or oblique) fonts.
-.SH FILES
-.Tp \w'\fB@FONTDIR@/devlj4/DESC'u+2n
-.B @FONTDIR@/devlj4/DESC
-Device description file.
-.TP
-.BI @FONTDIR@/devlj4/ F
-Font description file for font
-.IR F .
-.SH BUGS
-.LP
-This program was written without the benefit of complete, official
-documentation on the tagged font metric format.
-It is therefore likely that it will fail to work on tfm files that are
-dissimilar to those for the internal fonts on the Laserjet 4,
-with which it was tested:
-.LP
-TrueType tfm files are not supported.
-.SH "SEE ALSO"
-.BR groff (@MAN1EXT@),
-.BR grolj4 (@MAN1EXT@),
-.BR groff_font (@MAN5EXT@)
diff --git a/contrib/groff/include/Makefile.sub b/contrib/groff/include/Makefile.sub
deleted file mode 100644
index 500f05974dc3..000000000000
--- a/contrib/groff/include/Makefile.sub
+++ /dev/null
@@ -1,41 +0,0 @@
-HDRS=\
- assert.h \
- cmap.h \
- cset.h \
- device.h \
- driver.h \
- errarg.h \
- error.h \
- font.h \
- getopt.h \
- groff-getopt.h \
- htmlindicate.h \
- index.h \
- lib.h \
- macropath.h \
- nonposix.h \
- posix.h \
- printer.h \
- ptable.h \
- refid.h \
- search.h \
- searchpath.h \
- stringclass.h
-GENHDRS=defs.h
-CLEANADD=$(GENHDRS)
-
-all depend: $(GENHDRS)
-
-defs.h: FORCE
- @$(SHELL) $(top_srcdir)/gendef.sh defs.h \
- "PROG_PREFIX=\"$(g)\"" \
- "DEVICE=\"$(DEVICE)\"" \
- "FONTPATH=\"$(fontpath)\"" \
- "MACROPATH=\"$(tmacpath)\"" \
- "INDEX_SUFFIX=\"$(indexext)\"" \
- "COMMON_WORDS_FILE=\"$(common_words_file)\"" \
- "DEFAULT_INDEX_DIR=\"$(indexdir)\"" \
- "DEFAULT_INDEX_NAME=\"$(indexname)\"" \
- "DEFAULT_INDEX=\"$(indexdir)/$(indexname)\""
-
-FORCE:
diff --git a/contrib/groff/include/assert.h b/contrib/groff/include/assert.h
deleted file mode 100644
index 18d9c2623eda..000000000000
--- a/contrib/groff/include/assert.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifndef ASSERT_H
-#define ASSERT_H
-
-void assertion_failed(int, const char *);
-
-inline void do_assert(int expr, int line, const char *file)
-{
- if (!expr)
- assertion_failed(line, file);
-}
-#endif /* ASSERT_H */
-
-#undef assert
-
-#ifdef NDEBUG
-#define assert(ignore) /* as nothing */
-#else
-#define assert(expr) do_assert(expr, __LINE__, __FILE__)
-#endif
diff --git a/contrib/groff/include/cmap.h b/contrib/groff/include/cmap.h
deleted file mode 100644
index 1537d4627d7b..000000000000
--- a/contrib/groff/include/cmap.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifndef UCHAR_MAX
-#define UCHAR_MAX 255
-#endif
-
-enum cmap_builtin { CMAP_BUILTIN };
-
-class cmap {
-public:
- cmap();
- cmap(cmap_builtin);
- int operator()(unsigned char) const;
- unsigned char &operator[](unsigned char);
-
- friend class cmap_init;
-private:
- unsigned char v[UCHAR_MAX+1];
-};
-
-inline int cmap::operator()(unsigned char c) const
-{
- return v[c];
-}
-
-inline unsigned char &cmap::operator[](unsigned char c)
-{
- return v[c];
-}
-
-extern cmap cmlower;
-extern cmap cmupper;
-
-static class cmap_init {
- static int initialised;
-public:
- cmap_init();
-} _cmap_init;
diff --git a/contrib/groff/include/cset.h b/contrib/groff/include/cset.h
deleted file mode 100644
index b3a1a976139e..000000000000
--- a/contrib/groff/include/cset.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CC_LIMITS_H
-#include
-#else /* not HAVE_CC_LIMITS_H */
-#ifndef UCHAR_MAX
-#define UCHAR_MAX 255
-#endif
-#endif /* not HAVE_CC_LIMITS_H */
-
-enum cset_builtin { CSET_BUILTIN };
-
-class cset {
-public:
- cset();
- cset(cset_builtin);
- cset(const char *);
- cset(const unsigned char *);
- int operator()(unsigned char) const;
-
- cset &operator|=(const cset &);
- cset &operator|=(unsigned char);
-
- friend class cset_init;
-private:
- char v[UCHAR_MAX+1];
- void clear();
-};
-
-inline int cset::operator()(unsigned char c) const
-{
- return v[c];
-}
-
-inline cset &cset::operator|=(unsigned char c)
-{
- v[c] = 1;
- return *this;
-}
-
-extern cset csalpha;
-extern cset csupper;
-extern cset cslower;
-extern cset csdigit;
-extern cset csxdigit;
-extern cset csspace;
-extern cset cspunct;
-extern cset csalnum;
-extern cset csprint;
-extern cset csgraph;
-extern cset cscntrl;
-
-static class cset_init {
- static int initialised;
-public:
- cset_init();
-} _cset_init;
diff --git a/contrib/groff/include/device.h b/contrib/groff/include/device.h
deleted file mode 100644
index 341af8d2a70f..000000000000
--- a/contrib/groff/include/device.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-extern const char *device;
diff --git a/contrib/groff/include/driver.h b/contrib/groff/include/driver.h
deleted file mode 100644
index c0384c71d023..000000000000
--- a/contrib/groff/include/driver.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#ifdef HAVE_STRINGS_H
-#include
-#endif
-#include
-#include
-#include
-#include
-#include
-#include
-#include "errarg.h"
-#include "error.h"
-#include "font.h"
-#include "printer.h"
-#include "lib.h"
-
-void do_file(const char *);
-extern printer *pr;
diff --git a/contrib/groff/include/errarg.h b/contrib/groff/include/errarg.h
deleted file mode 100644
index 0c7957c85ce0..000000000000
--- a/contrib/groff/include/errarg.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-class errarg {
- enum { EMPTY, STRING, CHAR, INTEGER, DOUBLE } type;
- union {
- const char *s;
- int n;
- char c;
- double d;
- };
- public:
- errarg();
- errarg(const char *);
- errarg(char);
- errarg(unsigned char);
- errarg(int);
- errarg(double);
- int empty() const;
- void print() const;
-};
-
-extern errarg empty_errarg;
-
-extern void errprint(const char *,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
diff --git a/contrib/groff/include/error.h b/contrib/groff/include/error.h
deleted file mode 100644
index d26e2c70facd..000000000000
--- a/contrib/groff/include/error.h
+++ /dev/null
@@ -1,58 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-extern void fatal_with_file_and_line(const char *filename, int lineno,
- const char *format,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-extern void error_with_file_and_line(const char *filename, int lineno,
- const char *format,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-extern void warning_with_file_and_line(const char *filename, int lineno,
- const char *format,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-extern void fatal(const char *,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-extern void error(const char *,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-extern void warning(const char *,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-
-extern const char *program_name;
-extern int current_lineno;
-extern const char *current_filename;
-
diff --git a/contrib/groff/include/font.h b/contrib/groff/include/font.h
deleted file mode 100644
index 099f97bea180..000000000000
--- a/contrib/groff/include/font.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-typedef void (*FONT_COMMAND_HANDLER)(const char *, const char *,
- const char *, int);
-
-struct font_kern_list;
-struct font_char_metric;
-struct font_widths_cache;
-
-class font {
-public:
- enum {
- LIG_ff = 1,
- LIG_fi = 2,
- LIG_fl = 4,
- LIG_ffi = 8,
- LIG_ffl = 16
- };
-
- virtual ~font();
- int contains(int index);
- int is_special();
- int get_width(int index, int point_size);
- int get_height(int index, int point_size);
- int get_depth(int index, int point_size);
- int get_space_width(int point_size);
- int get_character_type(int index);
- int get_kern(int index1, int index2, int point_size);
- int get_skew(int index, int point_size, int slant);
- int has_ligature(int);
- int get_italic_correction(int index, int point_size);
- int get_left_italic_correction(int index, int point_size);
- int get_subscript_correction(int index, int point_size);
- int get_code(int i);
- const char *get_special_device_encoding(int index);
- const char *get_name();
- const char *get_internal_name();
-
- static font *load_font(const char *, int *not_found = 0);
- static void command_line_font_dir(const char *path);
- static FILE *open_file(const char *name, char **pathp);
- static int load_desc();
- static int name_to_index(const char *);
- static int number_to_index(int);
- static FONT_COMMAND_HANDLER
- set_unknown_desc_command_handler(FONT_COMMAND_HANDLER);
-
- static int res;
- static int hor;
- static int vert;
- static int unitwidth;
- static int paperwidth;
- static int paperlength;
- static int biggestfont;
- static int spare2;
- static int sizescale;
- static int tcommand;
- static int pass_filenames;
- static int use_charnames_in_special;
-
- static const char **font_name_table;
- static const char **style_table;
- static const char *family;
- static int *sizes;
-private:
- unsigned ligatures;
- font_kern_list **kern_hash_table;
- int space_width;
- short *ch_index;
- int nindices;
- font_char_metric *ch;
- int ch_used;
- int ch_size;
- int special;
- char *name;
- char *internalname;
- double slant;
- font_widths_cache *widths_cache;
- static FONT_COMMAND_HANDLER unknown_desc_command_handler;
-
- enum { KERN_HASH_TABLE_SIZE = 503 };
-
- void add_entry(int index, const font_char_metric &);
- void copy_entry(int new_index, int old_index);
- void add_kern(int index1, int index2, int amount);
- static int hash_kern(int i1, int i2);
- void alloc_ch_index(int);
- void extend_ch();
- void compact();
-
- static int scale(int w, int pointsize);
- virtual void handle_unknown_font_command(const char *command,
- const char *arg,
- const char *file, int lineno);
-protected:
- font(const char *);
- int load(int *not_found = 0);
-};
diff --git a/contrib/groff/include/getopt.h b/contrib/groff/include/getopt.h
deleted file mode 100644
index b0147e9d2ac3..000000000000
--- a/contrib/groff/include/getopt.h
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-# if defined __STDC__ && __STDC__
- const char *name;
-# else
- char *name;
-# endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-# define no_argument 0
-# define required_argument 1
-# define optional_argument 2
-#endif /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
- arguments in ARGV (ARGC of them, minus the program name) for
- options given in OPTS.
-
- Return the option character from OPTS just read. Return -1 when
- there are no more options. For unrecognized options, or options
- missing arguments, `optopt' is set to the option letter, and '?' is
- returned.
-
- The OPTS string is a list of characters which are recognized option
- letters, optionally followed by colons, specifying that that letter
- takes an argument, to be placed in `optarg'.
-
- If a letter in OPTS is followed by two colons, its argument is
- optional. This behavior is specific to the GNU `getopt'.
-
- The argument `--' causes premature termination of argument
- scanning, explicitly telling `getopt' that there are no more
- options.
-
- If OPTS begins with `--', then non-option arguments are treated as
- arguments to the option '\0'. This behavior is specific to the GNU
- `getopt'. */
-
-#if defined __STDC__ && __STDC__
-# ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
-# else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
-
-# ifndef __need_getopt
-extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
- const struct option *__longopts, int *__longind);
-extern int getopt_long_only (int __argc, char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int __argc, char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations. */
-#undef __need_getopt
-
-#endif /* getopt.h */
diff --git a/contrib/groff/include/groff-getopt.h b/contrib/groff/include/groff-getopt.h
deleted file mode 100644
index 1807fc7ccfb9..000000000000
--- a/contrib/groff/include/groff-getopt.h
+++ /dev/null
@@ -1,68 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 2000 Free Software Foundation, Inc.
- Written by Werner Lemberg (wl@gnu.org)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/*
- This file has to be included from within lib.h instead of getopt.h
- to avoid problems with picky C++ compilers.
-*/
-
-#ifndef _GROFF_GETOPT_H
-#define _GROFF_GETOPT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern char *optarg;
-extern int optind;
-extern int opterr;
-extern int optopt;
-
-struct option
-{
- const char *name;
- int has_arg;
- int *flag;
- int val;
-};
-
-#define no_argument 0
-#define required_argument 1
-#define optional_argument 2
-
-extern int getopt(int __argc,
- char *const *__argv,
- const char *__shortopts);
-extern int getopt_long(int __argc,
- char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts,
- int *__longind);
-extern int getopt_long_only(int __argc,
- char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts,
- int *__longind);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _GROFF_GETOPT_H */
diff --git a/contrib/groff/include/htmlindicate.h b/contrib/groff/include/htmlindicate.h
deleted file mode 100644
index 96a63884d40e..000000000000
--- a/contrib/groff/include/htmlindicate.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 2000 Free Software Foundation, Inc.
- Written by Gaius Mulley
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#if !defined(HTMLINDICATE_H)
-# define HTMLINDICATE_H
-
-/*
- * graphic_start - emit a html graphic start indicator, but only
- * if one has not already been issued.
- */
-
-extern void graphic_start (void);
-
-
-/*
- * graphic_end - emit a html graphic end indicator, but only
- * if a corresponding matching graphic-start has
- * been issued.
- */
-
-extern void graphic_end (void);
-
-#endif
-
diff --git a/contrib/groff/include/index.h b/contrib/groff/include/index.h
deleted file mode 100644
index 7e6081381c2e..000000000000
--- a/contrib/groff/include/index.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define INDEX_MAGIC 0x23021964
-#define INDEX_VERSION 1
-
-struct index_header {
- int magic;
- int version;
- int tags_size;
- int table_size;
- int lists_size;
- int strings_size;
- int truncate;
- int shortest;
- int common;
-};
-
-struct tag {
- int filename_index;
- int start;
- int length;
-};
-
-unsigned hash(const char *s, int len);
diff --git a/contrib/groff/include/lib.h b/contrib/groff/include/lib.h
deleted file mode 100644
index 2af894acca1e..000000000000
--- a/contrib/groff/include/lib.h
+++ /dev/null
@@ -1,114 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989-2000 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-extern "C" {
-#ifndef strerror
- char *strerror(int);
-#endif
- const char *i_to_a(int);
- const char *if_to_a(int, int);
-}
-
-#include
-
-char *strsave(const char *s);
-int is_prime(unsigned);
-
-#include
-
-FILE *xtmpfile(char **namep=0, char *postfix=0, int do_unlink=1);
-char *xtmptemplate(char *extension=0);
-
-#ifdef NEED_DECLARATION_POPEN
-
-extern "C" { FILE *popen(const char *, const char *); }
-
-#endif /* NEED_DECLARATION_POPEN */
-
-#ifdef NEED_DECLARATION_PCLOSE
-
-extern "C" { int pclose (FILE *); }
-
-#endif /* NEED_DECLARATION_PCLOSE */
-
-int interpret_lf_args(const char *p);
-
-extern char illegal_char_table[];
-
-inline int illegal_input_char(int c)
-{
- return c >= 0 && illegal_char_table[c];
-}
-
-#ifndef HAVE_STRCASECMP
-#define strcasecmp(a,b) strcmp((a),(b))
-#endif
-
-#ifndef HAVE_STRNCASECMP
-#define strncasecmp(a,b,c) strncmp((a),(b),(c))
-#endif
-
-#ifdef HAVE_CC_LIMITS_H
-#include
-#else /* not HAVE_CC_LIMITS_H */
-#define INT_MAX 2147483647
-#endif /* not HAVE_CC_LIMITS_H */
-
-/* It's not safe to rely on people getting INT_MIN right (ie signed). */
-
-#ifdef INT_MIN
-#undef INT_MIN
-#endif
-
-#ifdef CFRONT_ANSI_BUG
-
-/* This works around a bug in cfront 2.0 used with ANSI C compilers. */
-
-#define INT_MIN ((long)(-INT_MAX-1))
-
-#else /* not CFRONT_ANSI_BUG */
-
-#define INT_MIN (-INT_MAX-1)
-
-#endif /* not CFRONT_ANSI_BUG */
-
-/* Maximum number of digits in the decimal representation of an int
-(not including the -). */
-
-#define INT_DIGITS 10
-
-#ifdef PI
-#undef PI
-#endif
-
-const double PI = 3.14159265358979323846;
-
-/* ad_delete deletes an array of objects with destructors;
-a_delete deletes an array of objects without destructors */
-
-#ifdef ARRAY_DELETE_NEEDS_SIZE
-/* for 2.0 systems */
-#define ad_delete(size) delete [size]
-#define a_delete delete
-#else /* not ARRAY_DELETE_NEEDS_SIZE */
-/* for ARM systems */
-#define ad_delete(size) delete []
-#define a_delete delete []
-#endif /* not ARRAY_DELETE_NEEDS_SIZE */
diff --git a/contrib/groff/include/macropath.h b/contrib/groff/include/macropath.h
deleted file mode 100644
index 4aa2f00c584e..000000000000
--- a/contrib/groff/include/macropath.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-extern search_path macro_path;
diff --git a/contrib/groff/include/nonposix.h b/contrib/groff/include/nonposix.h
deleted file mode 100644
index e4b02da3c2e0..000000000000
--- a/contrib/groff/include/nonposix.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* Copyright (C) 2000 Free Software Foundation, Inc.
- Written by Eli Zaretskii (eliz@is.elta.co.il)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* This header file compartmentalize all idiosyncrasies of non-Posix
- systems, such as MS-DOS, MS-Windows, etc. */
-
-#if defined _MSC_VER
-# ifndef _WIN32
-# define _WIN32
-# endif
-# define setmode(f,m) _setmode(f,m)
-# define fileno(f) _fileno(f)
-#endif
-
-#if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN32__))
-
-/* Binary I/O nuisances. Note: "setmode" is right for DJGPP and
- Borland; Windows compilers might need _setmode or some such. */
-# include
-# include
-# ifdef HAVE_UNISTD_H
-# include
-# endif
-# define SET_BINARY(f) do {if (!isatty(f)) setmode(f,O_BINARY);} while(0)
-# define FOPEN_RB "rb"
-# define FOPEN_WB "wb"
-# define FOPEN_RWB "wb+"
-# ifdef _MSC_VER
-# define POPEN_RT "rt"
-# define POPEN_WT "wt"
-# define popen(c,m) _popen(c,m)
-# define pclose(p) _pclose(p)
-# define getpid() (1)
-# endif
-# ifndef O_BINARY
-# ifdef _O_BINARY
-# define O_BINARY (_O_BINARY)
-# endif
-# endif
-
-/* The system shell. Groff assumes a Unixy shell, but non-Posix
- systems don't have standard places where it lives, and might not
- have it installed to begin with. We want to give them some leeway. */
-# define BSHELL (system_shell_name())
-# define BSHELL_DASH_C (system_shell_dash_c())
-# define IS_BSHELL(s) (is_system_shell(s))
-
-/* The separator for directories in PATH and other environment
- variables. */
-# define PATH_SEP ";"
-
-/* Characters that separate directories in a path name. */
-# define DIR_SEPS "/\\:"
-
-/* How to tell if the argument is an absolute file name. */
-# define IS_ABSOLUTE(f) \
- ((f)[0] == '/' || (f)[0] == '\\' || (f)[0] && (f)[1] == ':')
-
-/* The executable extension. */
-# define EXE_EXT ".exe"
-
-/* The system null device. */
-# define NULL_DEV "NUL"
-
-/* Prototypes. */
-# ifdef __cplusplus
- extern "C" {
-# endif
- const char * system_shell_name(void);
- const char * system_shell_dash_c(void);
- int is_system_shell(const char *);
-# ifdef __cplusplus
- }
-# endif
-
-#endif
-
-/* Defaults, for Posix systems. */
-
-#ifndef FOPEN_RB
-# define FOPEN_RB "r"
-#endif
-#ifndef FOPEN_WB
-# define FOPEN_WB "w"
-#endif
-#ifndef FOPEN_RWB
-# define FOPEN_RWB "w+"
-#endif
-#ifndef POPEN_RT
-# define POPEN_RT "r"
-#endif
-#ifndef POPEN_WT
-# define POPEN_WT "w"
-#endif
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-#ifndef BSHELL
-# define BSHELL "/bin/sh"
-#endif
-#ifndef BSHELL_DASH_C
-# define BSHELL_DASH_C "-c"
-#endif
-#ifndef IS_BSHELL
-# define IS_BSHELL(s) ((s) && strcmp(s,BSHELL) == 0)
-#endif
-#ifndef PATH_SEP
-# define PATH_SEP ":"
-#endif
-#ifndef DIR_SEPS
-# define DIR_SEPS "/"
-#endif
-#ifndef IS_ABSOLUTE
-# define IS_ABSOLUTE(f) ((f)[0] == '/')
-#endif
-#ifndef EXE_EXT
-# define EXE_EXT ""
-#endif
-#ifndef NULL_DEV
-# define NULL_DEV "/dev/null"
-#endif
diff --git a/contrib/groff/include/posix.h b/contrib/groff/include/posix.h
deleted file mode 100644
index 1b7d5cdc3424..000000000000
--- a/contrib/groff/include/posix.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1992, 2000 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-
-#ifdef HAVE_CC_OSFCN_H
-#include
-#else
-#include
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-#endif
-
-#ifndef S_IRUSR
-#define S_IRUSR 0400
-#endif
-
-#ifndef S_IRGRP
-#define S_IRGRP 0040
-#endif
-
-#ifndef S_IROTH
-#define S_IROTH 0004
-#endif
-
-#ifndef S_ISREG
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-
-#ifndef O_RDONLY
-#define O_RDONLY 0
-#endif
diff --git a/contrib/groff/include/printer.h b/contrib/groff/include/printer.h
deleted file mode 100644
index 974c9d5b07ba..000000000000
--- a/contrib/groff/include/printer.h
+++ /dev/null
@@ -1,76 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-struct environment {
- int fontno;
- int size;
- int hpos;
- int vpos;
- int height;
- int slant;
-};
-
-struct font;
-
-struct font_pointer_list {
- font *p;
- font_pointer_list *next;
-
- font_pointer_list(font *, font_pointer_list *);
-};
-
-class printer {
-public:
- printer();
- virtual ~printer();
- void load_font(int i, const char *name);
- void set_ascii_char(unsigned char c, const environment *env,
- int *widthp = 0);
- void set_special_char(const char *nm, const environment *env,
- int *widthp = 0);
- void set_numbered_char(int n, const environment *env, int *widthp = 0);
- int set_char_and_width(const char *nm, const environment *env,
- int *widthp, font **f);
- virtual void draw(int code, int *p, int np, const environment *env);
- virtual void begin_page(int) = 0;
- virtual void end_page(int page_length) = 0;
- virtual font *make_font(const char *nm);
- virtual void end_of_line();
- virtual void special(char *arg, const environment *env);
- static int adjust_arc_center(const int *, double *);
-protected:
- font_pointer_list *font_list;
-
- // information about named characters
- int is_char_named;
- int is_named_set;
- char named_command;
- const char *named_char_s;
- int named_char_n;
-
-private:
- font **font_table;
- int nfonts;
- font *find_font(const char *);
- virtual void set_char(int index, font *f, const environment *env,
- int w, const char *name) = 0;
-};
-
-printer *make_printer();
diff --git a/contrib/groff/include/ptable.h b/contrib/groff/include/ptable.h
deleted file mode 100644
index dc56add0f6c7..000000000000
--- a/contrib/groff/include/ptable.h
+++ /dev/null
@@ -1,168 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-
-#ifdef TRADITIONAL_CPP
-#define name2(a,b) a/**/b
-#else /* not TRADITIONAL_CPP */
-#define name2(a,b) name2x(a,b)
-#define name2x(a,b) a ## b
-#endif /* not TRADITIONAL_CPP */
-
-#define PTABLE(T) name2(T,_ptable)
-#define PASSOC(T) name2(T,_passoc)
-#define PTABLE_ITERATOR(T) name2(T,_ptable_iterator)
-
-extern unsigned next_ptable_size(unsigned);
-extern unsigned long hash_string(const char *);
-
-#define declare_ptable(T) \
- \
-struct PASSOC(T) { \
- char *key; \
- T *val; \
- PASSOC(T)(); \
-}; \
- \
-struct PTABLE(T); \
- \
-class PTABLE_ITERATOR(T) { \
- PTABLE(T) *p; \
- unsigned i; \
-public: \
- PTABLE_ITERATOR(T)(PTABLE(T) *); \
- int next(const char **, T **); \
-}; \
- \
-class PTABLE(T) { \
- PASSOC(T) *v; \
- unsigned size; \
- unsigned used; \
- enum { FULL_NUM = 2, FULL_DEN = 3, INITIAL_SIZE = 17 }; \
-public: \
- PTABLE(T)(); \
- ~PTABLE(T)(); \
- void define(const char *, T *); \
- T *lookup(const char *); \
- friend class PTABLE_ITERATOR(T); \
-};
-
-
-#define implement_ptable(T) \
- \
-PASSOC(T)::PASSOC(T)() \
-: key(0), val(0) \
-{ \
-} \
- \
-PTABLE(T)::PTABLE(T)() \
-{ \
- v = new PASSOC(T)[size = INITIAL_SIZE]; \
- used = 0; \
-} \
- \
-PTABLE(T)::~PTABLE(T)() \
-{ \
- for (unsigned i = 0; i < size; i++) { \
- a_delete v[i].key; \
- delete v[i].val; \
- } \
- a_delete v; \
-} \
- \
-void PTABLE(T)::define(const char *key, T *val) \
-{ \
- assert(key != 0); \
- unsigned long h = hash_string(key); \
- unsigned n; \
- for (n = unsigned(h % size); \
- v[n].key != 0; \
- n = (n == 0 ? size - 1 : n - 1)) \
- if (strcmp(v[n].key, key) == 0) { \
- delete v[n].val; \
- v[n].val = val; \
- return; \
- } \
- if (val == 0) \
- return; \
- if (used*FULL_DEN >= size*FULL_NUM) { \
- PASSOC(T) *oldv = v; \
- unsigned old_size = size; \
- size = next_ptable_size(size); \
- v = new PASSOC(T)[size]; \
- for (unsigned i = 0; i < old_size; i++) \
- if (oldv[i].key != 0) { \
- if (oldv[i].val == 0) \
- a_delete oldv[i].key; \
- else { \
- unsigned j; \
- for (j = unsigned(hash_string(oldv[i].key) % size); \
- v[j].key != 0; \
- j = (j == 0 ? size - 1 : j - 1)) \
- ; \
- v[j].key = oldv[i].key; \
- v[j].val = oldv[i].val; \
- } \
- } \
- for (n = unsigned(h % size); \
- v[n].key != 0; \
- n = (n == 0 ? size - 1 : n - 1)) \
- ; \
- a_delete oldv; \
- } \
- char *temp = new char[strlen(key)+1]; \
- strcpy(temp, key); \
- v[n].key = temp; \
- v[n].val = val; \
- used++; \
-} \
- \
-T *PTABLE(T)::lookup(const char *key) \
-{ \
- assert(key != 0); \
- for (unsigned n = unsigned(hash_string(key) % size); \
- v[n].key != 0; \
- n = (n == 0 ? size - 1 : n - 1)) \
- if (strcmp(v[n].key, key) == 0) \
- return v[n].val; \
- return 0; \
-} \
- \
-PTABLE_ITERATOR(T)::PTABLE_ITERATOR(T)(PTABLE(T) *t) \
-: p(t), i(0) \
-{ \
-} \
- \
-int PTABLE_ITERATOR(T)::next(const char **keyp, T **valp) \
-{ \
- unsigned size = p->size; \
- PASSOC(T) *v = p->v; \
- for (; i < size; i++) \
- if (v[i].key != 0) { \
- *keyp = v[i].key; \
- *valp = v[i].val; \
- i++; \
- return 1; \
- } \
- return 0; \
-}
-
diff --git a/contrib/groff/include/refid.h b/contrib/groff/include/refid.h
deleted file mode 100644
index 605427e9af9b..000000000000
--- a/contrib/groff/include/refid.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-class reference_id {
- int filename_id;
- int pos;
-public:
- reference_id() : filename_id(-1) { }
- reference_id(int fid, int off) : filename_id(fid), pos(off) { }
- unsigned hash() const { return (filename_id << 4) + pos; }
- int is_null() const { return filename_id < 0; }
- friend inline int operator==(const reference_id &, const reference_id &);
-};
-
-inline int operator==(const reference_id &r1, const reference_id &r2)
-{
- return r1.filename_id == r2.filename_id && r1.pos == r2.pos;
-}
diff --git a/contrib/groff/include/search.h b/contrib/groff/include/search.h
deleted file mode 100644
index 260410e2372b..000000000000
--- a/contrib/groff/include/search.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-struct search_item;
-struct search_item_iterator;
-
-class search_list {
-public:
- search_list();
- ~search_list();
- void add_file(const char *fn, int silent = 0);
- int nfiles() const;
-private:
- search_item *list;
- int niterators;
- int next_fid;
- friend class search_list_iterator;
-};
-
-struct bmpattern;
-
-class linear_searcher {
- const char *ignore_fields;
- int truncate_len;
- bmpattern **keys;
- int nkeys;
- const char *search_and_check(const bmpattern *key, const char *buf,
- const char *bufend, const char **start = 0)
- const;
- int check_match(const char *buf, const char *bufend, const char *match,
- int matchlen, const char **cont, const char **start)
- const;
-public:
- linear_searcher(const char *query, int query_len,
- const char *ign, int trunc);
- ~linear_searcher();
- int search(const char *buf, const char *bufend,
- const char **startp, int *lengthp) const;
-};
-
-class search_list_iterator {
- search_list *list;
- search_item *ptr;
- search_item_iterator *iter;
- char *query;
- linear_searcher searcher;
-public:
- search_list_iterator(search_list *, const char *query);
- ~search_list_iterator();
- int next(const char **, int *, reference_id * = 0);
-};
-
-class search_item {
-protected:
- char *name;
- int filename_id;
-public:
- search_item *next;
- search_item(const char *nm, int fid);
- virtual search_item_iterator *make_search_item_iterator(const char *) = 0;
- virtual ~search_item();
- int is_named(const char *) const;
- virtual int next_filename_id() const;
-};
-
-class search_item_iterator {
- char shut_g_plus_plus_up;
-public:
- virtual ~search_item_iterator();
- virtual int next(const linear_searcher &, const char **ptr, int *lenp,
- reference_id *) = 0;
-};
-
-search_item *make_index_search_item(const char *filename, int fid);
-search_item *make_linear_search_item(int fd, const char *filename, int fid);
-
-extern int linear_truncate_len;
-extern const char *linear_ignore_fields;
-extern int verify_flag;
diff --git a/contrib/groff/include/searchpath.h b/contrib/groff/include/searchpath.h
deleted file mode 100644
index d1cb2eeeea2e..000000000000
--- a/contrib/groff/include/searchpath.h
+++ /dev/null
@@ -1,29 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-class search_path {
- char *dirs;
- unsigned init_len;
-public:
- search_path(const char *envvar, const char *standard);
- ~search_path();
- void command_line_dir(const char *);
- FILE *open_file(const char *, char **);
-};
diff --git a/contrib/groff/include/stringclass.h b/contrib/groff/include/stringclass.h
deleted file mode 100644
index be3a044fb0b0..000000000000
--- a/contrib/groff/include/stringclass.h
+++ /dev/null
@@ -1,195 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-
-// Ensure that the first declaration of functions that are later
-// declared as inline declares them as inline.
-
-class string;
-
-inline string operator+(const string &, const string &);
-inline string operator+(const string &, const char *);
-inline string operator+(const char *, const string &);
-inline string operator+(const string &, char);
-inline string operator+(char, const string &);
-inline int operator==(const string &, const string &);
-inline int operator!=(const string &, const string &);
-
-class string {
-public:
- string();
- string(const string &);
- string(const char *);
- string(const char *, int);
- string(char);
-
- ~string();
-
- string &operator=(const string &);
- string &operator=(const char *);
- string &operator=(char);
-
- string &operator+=(const string &);
- string &operator+=(const char *);
- string &operator+=(char);
- void append(const char *, int);
-
- int length() const;
- int empty() const;
- int operator*() const;
-
- string substring(int i, int n) const;
-
- char &operator[](int);
- char operator[](int) const;
-
- void set_length(int i);
- const char *contents() const;
- int search(char) const;
- char *extract() const;
- void clear();
- void move(string &);
-
- friend string operator+(const string &, const string &);
- friend string operator+(const string &, const char *);
- friend string operator+(const char *, const string &);
- friend string operator+(const string &, char);
- friend string operator+(char, const string &);
-
- friend int operator==(const string &, const string &);
- friend int operator!=(const string &, const string &);
- friend int operator<=(const string &, const string &);
- friend int operator<(const string &, const string &);
- friend int operator>=(const string &, const string &);
- friend int operator>(const string &, const string &);
-
-private:
- char *ptr;
- int len;
- int sz;
-
- string(const char *, int, const char *, int); // for use by operator+
- void grow1();
-};
-
-
-inline char &string::operator[](int i)
-{
- assert(i >= 0 && i < len);
- return ptr[i];
-}
-
-inline char string::operator[](int i) const
-{
- assert(i >= 0 && i < len);
- return ptr[i];
-}
-
-inline int string::length() const
-{
- return len;
-}
-
-inline int string::empty() const
-{
- return len == 0;
-}
-
-inline int string::operator*() const
-{
- return len;
-}
-
-inline const char *string::contents() const
-{
- return ptr;
-}
-
-inline string operator+(const string &s1, const string &s2)
-{
- return string(s1.ptr, s1.len, s2.ptr, s2.len);
-}
-
-inline string operator+(const string &s1, const char *s2)
-{
-#ifdef __GNUG__
- if (s2 == 0)
- return s1;
- else
- return string(s1.ptr, s1.len, s2, strlen(s2));
-#else
- return s2 == 0 ? s1 : string(s1.ptr, s1.len, s2, strlen(s2));
-#endif
-}
-
-inline string operator+(const char *s1, const string &s2)
-{
-#ifdef __GNUG__
- if (s1 == 0)
- return s2;
- else
- return string(s1, strlen(s1), s2.ptr, s2.len);
-#else
- return s1 == 0 ? s2 : string(s1, strlen(s1), s2.ptr, s2.len);
-#endif
-}
-
-inline string operator+(const string &s, char c)
-{
- return string(s.ptr, s.len, &c, 1);
-}
-
-inline string operator+(char c, const string &s)
-{
- return string(&c, 1, s.ptr, s.len);
-}
-
-inline int operator==(const string &s1, const string &s2)
-{
- return (s1.len == s2.len
- && (s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) == 0));
-}
-
-inline int operator!=(const string &s1, const string &s2)
-{
- return (s1.len != s2.len
- || (s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) != 0));
-}
-
-inline string string::substring(int i, int n) const
-{
- assert(i >= 0 && i + n <= len);
- return string(ptr + i, n);
-}
-
-inline string &string::operator+=(char c)
-{
- if (len >= sz)
- grow1();
- ptr[len++] = c;
- return *this;
-}
-
-void put_string(const string &, FILE *);
-
-string as_string(int);
diff --git a/contrib/groff/include/unix.h b/contrib/groff/include/unix.h
deleted file mode 100644
index e69de29bb2d1..000000000000
diff --git a/contrib/groff/indxbib/Makefile.dep b/contrib/groff/indxbib/Makefile.dep
deleted file mode 100644
index dec439efeb84..000000000000
--- a/contrib/groff/indxbib/Makefile.dep
+++ /dev/null
@@ -1,6 +0,0 @@
-indxbib.o: indxbib.cc ../include/posix.h ../include/lib.h \
- ../include/errarg.h ../include/error.h ../include/stringclass.h \
- ../include/cset.h ../include/cmap.h ../include/defs.h \
- ../include/index.h
-dirnamemax.o: dirnamemax.c
-signal.o: signal.c
diff --git a/contrib/groff/indxbib/Makefile.sub b/contrib/groff/indxbib/Makefile.sub
deleted file mode 100644
index 2c50e659af95..000000000000
--- a/contrib/groff/indxbib/Makefile.sub
+++ /dev/null
@@ -1,30 +0,0 @@
-PROG=indxbib
-MAN1=indxbib.n
-XLIBS=$(LIBBIB) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=\
- indxbib.o \
- dirnamemax.o \
- signal.o
-CCSRCS=\
- $(srcdir)/indxbib.cc
-CSRCS=\
- $(srcdir)/dirnamemax.c \
- $(srcdir)/signal.c
-NAMEPREFIX=$(g)
-
-install_data: eign
- -test -d $(datadir) || $(mkinstalldirs) $(datadir)
- -test -d $(datasubdir) || $(mkinstalldirs) $(datasubdir)
- if test -f /usr/lib/eign; then \
- rm -f $(common_words_file); \
- ln -s /usr/lib/eign $(common_words_file) 2>/dev/null \
- || ln /usr/lib/eign $(common_words_file) 2>/dev/null \
- || cp /usr/lib/eign $(common_words_file); \
- else \
- rm -f $(common_words_file); \
- $(INSTALL_DATA) $(srcdir)/eign $(common_words_file); \
- fi
-
-uninstall_sub:
- -rm -f $(common_words_file)
diff --git a/contrib/groff/indxbib/dirnamemax.c b/contrib/groff/indxbib/dirnamemax.c
deleted file mode 100644
index a8cd9923c469..000000000000
--- a/contrib/groff/indxbib/dirnamemax.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/* dir_name_max(dir) does the same as pathconf(dir, _PC_NAME_MAX) */
-
-#include
-
-#ifdef HAVE_UNISTD_H
-#include
-#endif /* HAVE_UNISTD_H */
-
-#ifdef _POSIX_VERSION
-
-long dir_name_max(dir)
- char *dir;
-{
- return pathconf(dir, _PC_NAME_MAX);
-}
-
-#else /* not _POSIX_VERSION */
-
-#ifdef HAVE_LIMITS_H
-#include
-#endif /* HAVE_LIMITS_H */
-
-#ifdef HAVE_DIRENT_H
-#include
-#else /* not HAVE_DIRENT_H */
-#ifdef HAVE_SYS_DIR_H
-#include
-#endif /* HAVE_SYS_DIR_H */
-#endif /* not HAVE_DIRENT_H */
-
-#ifndef NAME_MAX
-#ifdef MAXNAMLEN
-#define NAME_MAX MAXNAMLEN
-#else /* !MAXNAMLEN */
-#ifdef MAXNAMELEN
-#define NAME_MAX MAXNAMELEN
-#else /* !MAXNAMELEN */
-#define NAME_MAX 14
-#endif /* !MAXNAMELEN */
-#endif /* !MAXNAMLEN */
-#endif /* !NAME_MAX */
-
-long dir_name_max(dir)
- char *dir;
-{
- return NAME_MAX;
-}
-
-#endif /* not _POSIX_VERSION */
diff --git a/contrib/groff/indxbib/eign b/contrib/groff/indxbib/eign
deleted file mode 100644
index 7718c8b1124c..000000000000
--- a/contrib/groff/indxbib/eign
+++ /dev/null
@@ -1,133 +0,0 @@
-a
-i
-the
-to
-of
-and
-in
-is
-it
-for
-that
-if
-you
-this
-be
-on
-with
-not
-have
-are
-or
-as
-from
-can
-but
-by
-at
-an
-will
-no
-all
-was
-do
-there
-my
-one
-so
-we
-they
-what
-would
-any
-which
-about
-get
-your
-use
-some
-me
-then
-name
-like
-out
-when
-up
-time
-other
-more
-only
-just
-end
-also
-know
-how
-new
-should
-been
-than
-them
-he
-who
-make
-may
-people
-these
-now
-their
-here
-into
-first
-could
-way
-had
-see
-work
-well
-were
-two
-very
-where
-while
-us
-because
-good
-same
-even
-much
-most
-many
-such
-long
-his
-over
-last
-since
-right
-before
-our
-without
-too
-those
-why
-must
-part
-being
-current
-back
-still
-go
-point
-value
-each
-did
-both
-true
-off
-say
-another
-state
-might
-under
-start
-try
diff --git a/contrib/groff/indxbib/indxbib.cc b/contrib/groff/indxbib/indxbib.cc
deleted file mode 100644
index 3185fe2cda89..000000000000
--- a/contrib/groff/indxbib/indxbib.cc
+++ /dev/null
@@ -1,794 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-
-#include "posix.h"
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-#include "stringclass.h"
-#include "cset.h"
-#include "cmap.h"
-
-#include "defs.h"
-#include "index.h"
-
-#include "nonposix.h"
-
-extern "C" {
- // Solaris 2.5.1 has these functions,
- // but its stdlib.h fails to declare them.
- char *mktemp(char *);
- int mkstemp(char *);
-}
-
-#define DEFAULT_HASH_TABLE_SIZE 997
-#define TEMP_INDEX_TEMPLATE "indxbibXXXXXX"
-
-// (2^n - MALLOC_OVERHEAD) should be a good argument for malloc().
-
-#define MALLOC_OVERHEAD 16
-
-#ifdef BLOCK_SIZE
-#undef BLOCK_SIZE
-#endif
-
-const int BLOCK_SIZE = ((1024 - MALLOC_OVERHEAD - sizeof(struct block *)
- - sizeof(int)) / sizeof(int));
-struct block {
- block *next;
- int used;
- int v[BLOCK_SIZE];
-
- block(block *p = 0) : next(p), used(0) { }
-};
-
-struct block;
-
-union table_entry {
- block *ptr;
- int count;
-};
-
-struct word_list {
- word_list *next;
- char *str;
- int len;
- word_list(const char *, int, word_list *);
-};
-
-table_entry *hash_table;
-int hash_table_size = DEFAULT_HASH_TABLE_SIZE;
-// We make this the same size as hash_table so we only have to do one
-// mod per key.
-static word_list **common_words_table = 0;
-char *key_buffer;
-
-FILE *indxfp;
-int ntags = 0;
-string filenames;
-char *temp_index_file = 0;
-
-const char *ignore_fields = "XYZ";
-const char *common_words_file = COMMON_WORDS_FILE;
-int n_ignore_words = 100;
-int truncate_len = 6;
-int shortest_len = 3;
-int max_keys_per_item = 100;
-
-static void usage();
-static void write_hash_table();
-static void init_hash_table();
-static void read_common_words_file();
-static int store_key(char *s, int len);
-static void possibly_store_key(char *s, int len);
-static int do_whole_file(const char *filename);
-static int do_file(const char *filename);
-static void store_reference(int filename_index, int pos, int len);
-static void check_integer_arg(char opt, const char *arg, int min, int *res);
-static void store_filename(const char *);
-static void fwrite_or_die(const void *ptr, int size, int nitems, FILE *fp);
-static char *get_cwd();
-
-extern "C" {
- void cleanup();
- long dir_name_max(const char *);
- void catch_fatal_signals();
- void ignore_fatal_signals();
-}
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
-
- const char *basename = 0;
- typedef int (*parser_t)(const char *);
- parser_t parser = do_file;
- const char *directory = 0;
- const char *foption = 0;
- int opt;
- while ((opt = getopt(argc, argv, "c:o:h:i:k:l:t:n:c:d:f:vw")) != EOF)
- switch (opt) {
- case 'c':
- common_words_file = optarg;
- break;
- case 'd':
- directory = optarg;
- break;
- case 'f':
- foption = optarg;
- break;
- case 'h':
- check_integer_arg('h', optarg, 1, &hash_table_size);
- if (!is_prime(hash_table_size)) {
- while (!is_prime(++hash_table_size))
- ;
- warning("%1 not prime: using %2 instead", optarg, hash_table_size);
- }
- break;
- case 'i':
- ignore_fields = optarg;
- break;
- case 'k':
- check_integer_arg('k', optarg, 1, &max_keys_per_item);
- break;
- case 'l':
- check_integer_arg('l', optarg, 0, &shortest_len);
- break;
- case 'n':
- check_integer_arg('n', optarg, 0, &n_ignore_words);
- break;
- case 'o':
- basename = optarg;
- break;
- case 't':
- check_integer_arg('t', optarg, 1, &truncate_len);
- break;
- case 'w':
- parser = do_whole_file;
- break;
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "GNU indxbib version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case '?':
- usage();
- break;
- default:
- assert(0);
- break;
- }
- if (optind >= argc && foption == 0)
- fatal("no files and no -f option");
- if (!directory) {
- char *path = get_cwd();
- store_filename(path);
- a_delete path;
- }
- else
- store_filename(directory);
- init_hash_table();
- store_filename(common_words_file);
- store_filename(ignore_fields);
- key_buffer = new char[truncate_len];
- read_common_words_file();
- if (!basename)
- basename = optind < argc ? argv[optind] : DEFAULT_INDEX_NAME;
- const char *p = strrchr(basename, DIR_SEPS[0]), *p1;
- const char *sep = &DIR_SEPS[1];
- while (*sep)
- {
- p1 = strrchr(basename, *sep);
- if (p1 && (!p || p1 > p))
- p = p1;
- sep++;
- }
- long name_max;
- if (p) {
- char *dir = strsave(basename);
- dir[p - basename] = '\0';
- name_max = dir_name_max(dir);
- a_delete dir;
- }
- else
- name_max = dir_name_max(".");
- const char *filename = p ? p + 1 : basename;
- if (name_max >= 0 && strlen(filename) + sizeof(INDEX_SUFFIX) - 1 > name_max)
- fatal("`%1.%2' is too long for a filename", filename, INDEX_SUFFIX);
- if (p) {
- p++;
- temp_index_file = new char[p - basename + sizeof(TEMP_INDEX_TEMPLATE)];
- memcpy(temp_index_file, basename, p - basename);
- strcpy(temp_index_file + (p - basename), TEMP_INDEX_TEMPLATE);
- }
- else {
- temp_index_file = strsave(TEMP_INDEX_TEMPLATE);
- }
-#ifndef HAVE_MKSTEMP
- if (!mktemp(temp_index_file) || !temp_index_file[0])
- fatal("cannot create file name for temporary file");
-#endif
- catch_fatal_signals();
-#ifdef HAVE_MKSTEMP
- int fd = mkstemp(temp_index_file);
-#else
- int fd = creat(temp_index_file, S_IRUSR|S_IRGRP|S_IROTH);
-#endif
- if (fd < 0)
- fatal("can't create temporary index file: %1", strerror(errno));
- indxfp = fdopen(fd, FOPEN_WB);
- if (indxfp == 0)
- fatal("fdopen failed");
- if (fseek(indxfp, sizeof(index_header), 0) < 0)
- fatal("can't seek past index header: %1", strerror(errno));
- int failed = 0;
- if (foption) {
- FILE *fp = stdin;
- if (strcmp(foption, "-") != 0) {
- errno = 0;
- fp = fopen(foption, "r");
- if (!fp)
- fatal("can't open `%1': %2", foption, strerror(errno));
- }
- string path;
- int lineno = 1;
- for (;;) {
- int c;
- for (c = getc(fp); c != '\n' && c != EOF; c = getc(fp)) {
- if (c == '\0')
- error_with_file_and_line(foption, lineno,
- "nul character in pathname ignored");
- else
- path += c;
- }
- if (path.length() > 0) {
- path += '\0';
- if (!(*parser)(path.contents()))
- failed = 1;
- path.clear();
- }
- if (c == EOF)
- break;
- lineno++;
- }
- if (fp != stdin)
- fclose(fp);
- }
- for (int i = optind; i < argc; i++)
- if (!(*parser)(argv[i]))
- failed = 1;
- write_hash_table();
- if (fclose(indxfp) < 0)
- fatal("error closing temporary index file: %1", strerror(errno));
- char *index_file = new char[strlen(basename) + sizeof(INDEX_SUFFIX)];
- strcpy(index_file, basename);
- strcat(index_file, INDEX_SUFFIX);
-#ifdef HAVE_RENAME
- if (rename(temp_index_file, index_file) < 0)
- {
-#ifdef __MSDOS__
- // RENAME could fail on plain MSDOS filesystems because
- // INDEX_FILE is an invalid filename, e.g. it has multiple dots.
- char *fname = p ? index_file + (p - basename) : 0;
- char *dot = 0;
-
- // Replace the dot with an underscore and try again.
- if (fname
- && (dot = strchr(fname, '.')) != 0
- && strcmp(dot, INDEX_SUFFIX) != 0)
- *dot = '_';
- if (rename(temp_index_file, index_file) < 0)
-#endif
- fatal("can't rename temporary index file: %1", strerror(errno));
- }
-#else /* not HAVE_RENAME */
- ignore_fatal_signals();
- if (unlink(index_file) < 0) {
- if (errno != ENOENT)
- fatal("can't unlink `%1': %2", index_file, strerror(errno));
- }
- if (link(temp_index_file, index_file) < 0)
- fatal("can't link temporary index file: %1", strerror(errno));
- if (unlink(temp_index_file) < 0)
- fatal("can't unlink temporary index file: %1", strerror(errno));
-#endif /* not HAVE_RENAME */
- temp_index_file = 0;
- return failed;
-}
-
-static void usage()
-{
- fprintf(stderr,
-"usage: %s [-vw] [-c file] [-d dir] [-f file] [-h n] [-i XYZ] [-k n]\n"
-" [-l n] [-n n] [-o base] [-t n] [files...]\n",
- program_name);
- exit(1);
-}
-
-static void check_integer_arg(char opt, const char *arg, int min, int *res)
-{
- char *ptr;
- long n = strtol(arg, &ptr, 10);
- if (n == 0 && ptr == arg)
- error("argument to -%1 not an integer", opt);
- else if (n < min)
- error("argument to -%1 must not be less than %2", opt, min);
- else {
- if (n > INT_MAX)
- error("argument to -%1 greater than maximum integer", opt);
- else if (*ptr != '\0')
- error("junk after integer argument to -%1", opt);
- *res = int(n);
- }
-}
-
-static char *get_cwd()
-{
- char *buf;
- int size = 12;
-
- for (;;) {
- buf = new char[size];
- if (getcwd(buf, size))
- break;
- if (errno != ERANGE)
- fatal("cannot get current working directory: %1", strerror(errno));
- a_delete buf;
- if (size == INT_MAX)
- fatal("current working directory longer than INT_MAX");
- if (size > INT_MAX/2)
- size = INT_MAX;
- else
- size *= 2;
- }
- return buf;
-}
-
-word_list::word_list(const char *s, int n, word_list *p)
-: next(p), len(n)
-{
- str = new char[n];
- memcpy(str, s, n);
-}
-
-static void read_common_words_file()
-{
- if (n_ignore_words <= 0)
- return;
- errno = 0;
- FILE *fp = fopen(common_words_file, "r");
- if (!fp)
- fatal("can't open `%1': %2", common_words_file, strerror(errno));
- common_words_table = new word_list * [hash_table_size];
- for (int i = 0; i < hash_table_size; i++)
- common_words_table[i] = 0;
- int count = 0;
- int key_len = 0;
- for (;;) {
- int c = getc(fp);
- while (c != EOF && !csalnum(c))
- c = getc(fp);
- if (c == EOF)
- break;
- do {
- if (key_len < truncate_len)
- key_buffer[key_len++] = cmlower(c);
- c = getc(fp);
- } while (c != EOF && csalnum(c));
- if (key_len >= shortest_len) {
- int h = hash(key_buffer, key_len) % hash_table_size;
- common_words_table[h] = new word_list(key_buffer, key_len,
- common_words_table[h]);
- }
- if (++count >= n_ignore_words)
- break;
- key_len = 0;
- if (c == EOF)
- break;
- }
- n_ignore_words = count;
- fclose(fp);
-}
-
-static int do_whole_file(const char *filename)
-{
- errno = 0;
- FILE *fp = fopen(filename, "r");
- if (!fp) {
- error("can't open `%1': %2", filename, strerror(errno));
- return 0;
- }
- int count = 0;
- int key_len = 0;
- int c;
- while ((c = getc(fp)) != EOF) {
- if (csalnum(c)) {
- key_len = 1;
- key_buffer[0] = c;
- while ((c = getc(fp)) != EOF) {
- if (!csalnum(c))
- break;
- if (key_len < truncate_len)
- key_buffer[key_len++] = c;
- }
- if (store_key(key_buffer, key_len)) {
- if (++count >= max_keys_per_item)
- break;
- }
- if (c == EOF)
- break;
- }
- }
- store_reference(filenames.length(), 0, 0);
- store_filename(filename);
- fclose(fp);
- return 1;
-}
-
-static int do_file(const char *filename)
-{
- errno = 0;
- // Need binary I/O for MS-DOS/MS-Windows, because indxbib relies on
- // byte counts to be consistent with fseek.
- FILE *fp = fopen(filename, FOPEN_RB);
- if (fp == 0) {
- error("can't open `%1': %2", filename, strerror(errno));
- return 0;
- }
- int filename_index = filenames.length();
- store_filename(filename);
-
- enum {
- START, // at the start of the file; also in between references
- BOL, // in the middle of a reference, at the beginning of the line
- PERCENT, // seen a percent at the beginning of the line
- IGNORE, // ignoring a field
- IGNORE_BOL, // at the beginning of a line ignoring a field
- KEY, // in the middle of a key
- DISCARD, // after truncate_len bytes of a key
- MIDDLE // in between keys
- } state = START;
-
- // In states START, BOL, IGNORE_BOL, space_count how many spaces at
- // the beginning have been seen. In states PERCENT, IGNORE, KEY,
- // MIDDLE space_count must be 0.
- int space_count = 0;
- int byte_count = 0; // bytes read
- int key_len = 0;
- int ref_start = -1; // position of start of current reference
- for (;;) {
- int c = getc(fp);
- if (c == EOF)
- break;
- // We opened the file in binary mode, so we need to skip
- // every CR character before a Newline.
- if (c == '\r') {
- int peek = getc(fp);
- if (peek = '\n') {
- byte_count++;
- c = peek;
- }
- else
- ungetc(peek, fp);
- }
-#if defined(__MSDOS__) || defined(_MSC_VER)
- else if (c == 0x1a) // ^Z means EOF in text files
- break;
-#endif
- byte_count++;
- switch (state) {
- case START:
- if (c == ' ' || c == '\t') {
- space_count++;
- break;
- }
- if (c == '\n') {
- space_count = 0;
- break;
- }
- ref_start = byte_count - space_count - 1;
- space_count = 0;
- if (c == '%')
- state = PERCENT;
- else if (csalnum(c)) {
- state = KEY;
- key_buffer[0] = c;
- key_len = 1;
- }
- else
- state = MIDDLE;
- break;
- case BOL:
- switch (c) {
- case '%':
- if (space_count > 0) {
- space_count = 0;
- state = MIDDLE;
- }
- else
- state = PERCENT;
- break;
- case ' ':
- case '\t':
- space_count++;
- break;
- case '\n':
- store_reference(filename_index, ref_start,
- byte_count - 1 - space_count - ref_start);
- state = START;
- space_count = 0;
- break;
- default:
- space_count = 0;
- if (csalnum(c)) {
- state = KEY;
- key_buffer[0] = c;
- key_len = 1;
- }
- else
- state = MIDDLE;
- }
- break;
- case PERCENT:
- if (strchr(ignore_fields, c) != 0)
- state = IGNORE;
- else if (c == '\n')
- state = BOL;
- else
- state = MIDDLE;
- break;
- case IGNORE:
- if (c == '\n')
- state = IGNORE_BOL;
- break;
- case IGNORE_BOL:
- switch (c) {
- case '%':
- if (space_count > 0) {
- state = IGNORE;
- space_count = 0;
- }
- else
- state = PERCENT;
- break;
- case ' ':
- case '\t':
- space_count++;
- break;
- case '\n':
- store_reference(filename_index, ref_start,
- byte_count - 1 - space_count - ref_start);
- state = START;
- space_count = 0;
- break;
- default:
- space_count = 0;
- state = IGNORE;
- }
- break;
- case KEY:
- if (csalnum(c)) {
- if (key_len < truncate_len)
- key_buffer[key_len++] = c;
- else
- state = DISCARD;
- }
- else {
- possibly_store_key(key_buffer, key_len);
- key_len = 0;
- if (c == '\n')
- state = BOL;
- else
- state = MIDDLE;
- }
- break;
- case DISCARD:
- if (!csalnum(c)) {
- possibly_store_key(key_buffer, key_len);
- key_len = 0;
- if (c == '\n')
- state = BOL;
- else
- state = MIDDLE;
- }
- break;
- case MIDDLE:
- if (csalnum(c)) {
- state = KEY;
- key_buffer[0] = c;
- key_len = 1;
- }
- else if (c == '\n')
- state = BOL;
- break;
- default:
- assert(0);
- }
- }
- switch (state) {
- case START:
- break;
- case DISCARD:
- case KEY:
- possibly_store_key(key_buffer, key_len);
- // fall through
- case BOL:
- case PERCENT:
- case IGNORE_BOL:
- case IGNORE:
- case MIDDLE:
- store_reference(filename_index, ref_start,
- byte_count - ref_start - space_count);
- break;
- default:
- assert(0);
- }
- fclose(fp);
- return 1;
-}
-
-static void store_reference(int filename_index, int pos, int len)
-{
- tag t;
- t.filename_index = filename_index;
- t.start = pos;
- t.length = len;
- fwrite_or_die(&t, sizeof(t), 1, indxfp);
- ntags++;
-}
-
-static void store_filename(const char *fn)
-{
- filenames += fn;
- filenames += '\0';
-}
-
-static void init_hash_table()
-{
- hash_table = new table_entry[hash_table_size];
- for (int i = 0; i < hash_table_size; i++)
- hash_table[i].ptr = 0;
-}
-
-static void possibly_store_key(char *s, int len)
-{
- static int last_tagno = -1;
- static int key_count;
- if (last_tagno != ntags) {
- last_tagno = ntags;
- key_count = 0;
- }
- if (key_count < max_keys_per_item) {
- if (store_key(s, len))
- key_count++;
- }
-}
-
-static int store_key(char *s, int len)
-{
- if (len < shortest_len)
- return 0;
- int is_number = 1;
- for (int i = 0; i < len; i++)
- if (!csdigit(s[i])) {
- is_number = 0;
- s[i] = cmlower(s[i]);
- }
- if (is_number && !(len == 4 && s[0] == '1' && s[1] == '9'))
- return 0;
- int h = hash(s, len) % hash_table_size;
- if (common_words_table) {
- for (word_list *ptr = common_words_table[h]; ptr; ptr = ptr->next)
- if (len == ptr->len && memcmp(s, ptr->str, len) == 0)
- return 0;
- }
- table_entry *pp = hash_table + h;
- if (!pp->ptr)
- pp->ptr = new block;
- else if (pp->ptr->v[pp->ptr->used - 1] == ntags)
- return 1;
- else if (pp->ptr->used >= BLOCK_SIZE)
- pp->ptr = new block(pp->ptr);
- pp->ptr->v[(pp->ptr->used)++] = ntags;
- return 1;
-}
-
-static void write_hash_table()
-{
- const int minus_one = -1;
- int li = 0;
- for (int i = 0; i < hash_table_size; i++) {
- block *ptr = hash_table[i].ptr;
- if (!ptr)
- hash_table[i].count = -1;
- else {
- hash_table[i].count = li;
- block *rev = 0;
- while (ptr) {
- block *tem = ptr;
- ptr = ptr->next;
- tem->next = rev;
- rev = tem;
- }
- while (rev) {
- fwrite_or_die(rev->v, sizeof(int), rev->used, indxfp);
- li += rev->used;
- block *tem = rev;
- rev = rev->next;
- delete tem;
- }
- fwrite_or_die(&minus_one, sizeof(int), 1, indxfp);
- li += 1;
- }
- }
- if (sizeof(table_entry) == sizeof(int))
- fwrite_or_die(hash_table, sizeof(int), hash_table_size, indxfp);
- else {
- // write it out word by word
- for (int i = 0; i < hash_table_size; i++)
- fwrite_or_die(&hash_table[i].count, sizeof(int), 1, indxfp);
- }
- fwrite_or_die(filenames.contents(), 1, filenames.length(), indxfp);
- if (fseek(indxfp, 0, 0) < 0)
- fatal("error seeking on index file: %1", strerror(errno));
- index_header h;
- h.magic = INDEX_MAGIC;
- h.version = INDEX_VERSION;
- h.tags_size = ntags;
- h.lists_size = li;
- h.table_size = hash_table_size;
- h.strings_size = filenames.length();
- h.truncate = truncate_len;
- h.shortest = shortest_len;
- h.common = n_ignore_words;
- fwrite_or_die(&h, sizeof(h), 1, indxfp);
-}
-
-static void fwrite_or_die(const void *ptr, int size, int nitems, FILE *fp)
-{
- if (fwrite(ptr, size, nitems, fp) != nitems)
- fatal("fwrite failed: %1", strerror(errno));
-}
-
-void fatal_error_exit()
-{
- cleanup();
- exit(3);
-}
-
-extern "C" {
-
-void cleanup()
-{
- if (temp_index_file)
- unlink(temp_index_file);
-}
-
-}
diff --git a/contrib/groff/indxbib/indxbib.man b/contrib/groff/indxbib/indxbib.man
deleted file mode 100644
index ed84ccaec2c8..000000000000
--- a/contrib/groff/indxbib/indxbib.man
+++ /dev/null
@@ -1,207 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.TH @G@INDXBIB @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-@g@indxbib \- make inverted index for bibliographic databases
-.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fB@g@indxbib 'u
-.ti \niu
-.B @g@indxbib
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.OP \-vw
-.OP \-c file
-.OP \-d dir
-.OP \-f file
-.OP \-h n
-.OP \-i string
-.OP \-k n
-.OP \-l n
-.OP \-n n
-.OP \-o file
-.OP \-t n
-.RI [\ filename \|.\|.\|.\ ]
-.ad \na
-.PP
-It is possible to have whitespace between a command line option and its
-parameter.
-.SH DESCRIPTION
-.B @g@indxbib
-makes an inverted index for the bibliographic databases in
-.IR filename \|.\|.\|.
-for use with
-.BR @g@refer (@MAN1EXT@),
-.BR @g@lookbib (@MAN1EXT@),
-and
-.BR lkbib (@MAN1EXT@).
-The index will be named
-.IB filename @INDEX_SUFFIX@\fR;
-the index is written to a temporary file which is then renamed to this.
-If no filenames are given on the command line because the
-.B \-f
-option has been used, and no
-.B \-o
-option is given, the index will be named
-.BR @DEFAULT_INDEX_NAME@@INDEX_SUFFIX@ .
-.LP
-Bibliographic databases are divided into records by blank lines.
-Within a record, each fields starts with a
-.B %
-character at the beginning of a line.
-Fields have a one letter name which follows the
-.B %
-character.
-.LP
-The values set by the
-.BR \-c ,
-.BR \-n ,
-.BR \-l
-and
-.B \-t
-options are stored in the index;
-when the index is searched, keys will be discarded and truncated in a
-manner appropriate to these options;
-the original keys will be used for verifying that any record
-found using the index actually contains the keys.
-This means that a user of an index need not know whether these
-options were used in the creation of the index,
-provided that not all the keys to be searched for
-would have been discarded during indexing
-and that the user supplies at least the part of each key
-that would have remained after being truncated during indexing.
-The value set by the
-.B \-i
-option is also stored in the index
-and will be used in verifying records found using the index.
-.SH OPTIONS
-.TP
-.B \-v
-Print the version number.
-.TP
-.B \-w
-Index whole files.
-Each file is a separate record.
-.TP
-.BI \-c file
-Read the list of common words from
-.I file
-instead of
-.BR @COMMON_WORDS_FILE@ .
-.TP
-.BI \-d dir
-Use
-.I dir
-as the pathname of the current working directory to store in the index,
-instead of the path printed by
-.BR pwd (1).
-Usually
-.I dir
-will be a symbolic link that points to the directory printed by
-.BR pwd (1).
-.TP
-.BI \-f file
-Read the files to be indexed from
-.IR file .
-If
-.I file
-is
-.BR \- ,
-files will be read from the standard input.
-The
-.B \-f
-option can be given at most once.
-.TP
-.BI \-i string
-Don't index the contents of fields whose names are in
-.IR string .
-Initially
-.I string
-is
-.BR XYZ .
-.TP
-.BI \-h n
-Use the first prime greater than or equal to
-.I n
-for the size of the hash table.
-Larger values of
-.I n
-will usually make searching faster,
-but will make the index larger
-and
-.B @g@indxbib
-use more memory.
-Initially
-.I n
-is 997.
-.TP
-.BI \-k n
-Use at most
-.I n
-keys per input record.
-Initially
-.I n
-is 100.
-.TP
-.BI \-l n
-Discard keys that are shorter than
-.IR n .
-Initially
-.I n
-is 3.
-.TP
-.BI \-n n
-Discard the
-.I n
-most common words.
-Initially
-.I n
-is 100.
-.TP
-.BI \-o basename
-The index should be named
-.IB basename @INDEX_SUFFIX@\fR.
-.TP
-.BI \-t n
-Truncate keys to
-.IR n .
-Initially
-.I n
-is 6.
-.SH FILES
-.TP \w'\fBindxbib\fIXXXXXX'u+2n
-.IB filename @INDEX_SUFFIX@
-Index.
-.TP
-.B @DEFAULT_INDEX_NAME@@INDEX_SUFFIX@
-Default index name.
-.TP
-.B @COMMON_WORDS_FILE@
-List of common words.
-.TP
-.BI indxbib XXXXXX
-Temporary file.
-.SH "SEE ALSO"
-.BR @g@refer (@MAN1EXT@),
-.BR lkbib (@MAN1EXT@),
-.BR @g@lookbib (@MAN1EXT@)
diff --git a/contrib/groff/indxbib/signal.c b/contrib/groff/indxbib/signal.c
deleted file mode 100644
index 8078472f95db..000000000000
--- a/contrib/groff/indxbib/signal.c
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Copyright (C) 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-/* Unfortunately vendors seem to have problems writing a
-that is correct for C++, so we implement all signal handling in C. */
-
-#include
-#include
-#ifdef HAVE_UNISTD_H
-#include
-#endif
-
-#ifndef RETSIGTYPE
-#define RETSIGTYPE void
-#endif
-
-extern void cleanup();
-
-static RETSIGTYPE handle_fatal_signal(signum)
- int signum;
-{
- signal(signum, SIG_DFL);
- cleanup();
- kill(getpid(), signum);
-}
-
-void catch_fatal_signals()
-{
-#ifdef SIGHUP
- signal(SIGHUP, handle_fatal_signal);
-#endif
- signal(SIGINT, handle_fatal_signal);
- signal(SIGTERM, handle_fatal_signal);
-}
-
-#ifndef HAVE_RENAME
-
-void ignore_fatal_signals()
-{
-#ifdef SIGHUP
- signal(SIGHUP, SIG_IGN);
-#endif
- signal(SIGINT, SIG_IGN);
- signal(SIGTERM, SIG_IGN);
-}
-
-#endif /* not HAVE_RENAME */
diff --git a/contrib/groff/libbib/Makefile.dep b/contrib/groff/libbib/Makefile.dep
deleted file mode 100644
index 8c4974853d61..000000000000
--- a/contrib/groff/libbib/Makefile.dep
+++ /dev/null
@@ -1,12 +0,0 @@
-common.o: common.cc
-index.o: index.cc ../include/posix.h ../include/lib.h \
- ../include/cset.h ../include/cmap.h ../include/errarg.h \
- ../include/error.h ../include/refid.h ../include/search.h \
- ../include/index.h ../include/defs.h
-linear.o: linear.cc ../include/posix.h ../include/lib.h \
- ../include/errarg.h ../include/error.h ../include/cset.h \
- ../include/cmap.h ../include/refid.h ../include/search.h
-search.o: search.cc ../include/posix.h ../include/lib.h \
- ../include/errarg.h ../include/error.h ../include/refid.h \
- ../include/search.h
-map.o: map.c
diff --git a/contrib/groff/libbib/Makefile.sub b/contrib/groff/libbib/Makefile.sub
deleted file mode 100644
index 482f01abcf66..000000000000
--- a/contrib/groff/libbib/Makefile.sub
+++ /dev/null
@@ -1,14 +0,0 @@
-LIB=bib
-OBJS=\
- common.o \
- index.o \
- linear.o \
- search.o \
- map.o
-CCSRCS=\
- $(srcdir)/common.cc \
- $(srcdir)/index.cc \
- $(srcdir)/linear.cc \
- $(srcdir)/search.cc
-CSRCS=\
- $(srcdir)/map.c
diff --git a/contrib/groff/libbib/common.cc b/contrib/groff/libbib/common.cc
deleted file mode 100644
index 4b2bcca23e21..000000000000
--- a/contrib/groff/libbib/common.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-unsigned hash(const char *s, int len)
-{
-#if 0
- unsigned h = 0, g;
- while (*s != '\0') {
- h <<= 4;
- h += *s++;
- if ((g = h & 0xf0000000) != 0) {
- h ^= g >> 24;
- h ^= g;
- }
- }
-#endif
- unsigned h = 0;
- while (--len >= 0)
- h = *s++ + 65587*h;
- return h;
-}
-
diff --git a/contrib/groff/libbib/index.cc b/contrib/groff/libbib/index.cc
deleted file mode 100644
index 55737717dcbe..000000000000
--- a/contrib/groff/libbib/index.cc
+++ /dev/null
@@ -1,641 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-
-#include "posix.h"
-#include "lib.h"
-#include "cset.h"
-#include "cmap.h"
-#include "errarg.h"
-#include "error.h"
-
-#include "refid.h"
-#include "search.h"
-#include "index.h"
-#include "defs.h"
-
-#include "nonposix.h"
-
-// Interface to mmap.
-extern "C" {
- void *mapread(int fd, int len);
- int unmap(void *, int len);
-}
-
-#if 0
-const
-#endif
-int minus_one = -1;
-
-int verify_flag = 0;
-
-struct word_list;
-
-class index_search_item : public search_item {
- search_item *out_of_date_files;
- index_header header;
- char *buffer;
- void *map_addr;
- int map_len;
- tag *tags;
- int *table;
- int *lists;
- char *pool;
- char *key_buffer;
- char *filename_buffer;
- int filename_buflen;
- char **common_words_table;
- int common_words_table_size;
- const char *ignore_fields;
- time_t mtime;
-
- const char *do_verify();
- const int *search1(const char **pp, const char *end);
- const int *search(const char *ptr, int length, int **temp_listp);
- const char *munge_filename(const char *);
- void read_common_words_file();
- void add_out_of_date_file(int fd, const char *filename, int fid);
-public:
- index_search_item(const char *, int);
- ~index_search_item();
- int load(int fd);
- search_item_iterator *make_search_item_iterator(const char *);
- int verify();
- void check_files();
- int next_filename_id() const;
- friend class index_search_item_iterator;
-};
-
-class index_search_item_iterator : public search_item_iterator {
- index_search_item *indx;
- search_item_iterator *out_of_date_files_iter;
- search_item *next_out_of_date_file;
- const int *found_list;
- int *temp_list;
- char *buf;
- int buflen;
- linear_searcher searcher;
- char *query;
- int get_tag(int tagno, const linear_searcher &, const char **, int *,
- reference_id *);
-public:
- index_search_item_iterator(index_search_item *, const char *);
- ~index_search_item_iterator();
- int next(const linear_searcher &, const char **, int *, reference_id *);
-};
-
-
-index_search_item::index_search_item(const char *filename, int fid)
-: search_item(filename, fid), out_of_date_files(0), buffer(0), map_addr(0),
- map_len(0), key_buffer(0), filename_buffer(0), filename_buflen(0),
- common_words_table(0)
-{
-}
-
-index_search_item::~index_search_item()
-{
- if (buffer)
- free(buffer);
- if (map_addr) {
- if (unmap(map_addr, map_len) < 0)
- error("unmap: %1", strerror(errno));
- }
- while (out_of_date_files) {
- search_item *tem = out_of_date_files;
- out_of_date_files = out_of_date_files->next;
- delete tem;
- }
- a_delete filename_buffer;
- a_delete key_buffer;
- if (common_words_table) {
- for (int i = 0; i < common_words_table_size; i++)
- a_delete common_words_table[i];
- a_delete common_words_table;
- }
-}
-
-class file_closer {
- int *fdp;
-public:
- file_closer(int &fd) : fdp(&fd) { }
- ~file_closer() { close(*fdp); }
-};
-
-// Tell the compiler that a variable is intentionally unused.
-inline void unused(void *) { }
-
-int index_search_item::load(int fd)
-{
- file_closer fd_closer(fd); // close fd on return
- unused(&fd_closer);
- struct stat sb;
- if (fstat(fd, &sb) < 0) {
- error("can't fstat `%1': %2", name, strerror(errno));
- return 0;
- }
- if (!S_ISREG(sb.st_mode)) {
- error("`%1' is not a regular file", name);
- return 0;
- }
- mtime = sb.st_mtime;
- int size = int(sb.st_size);
- char *addr;
- map_addr = mapread(fd, size);
- if (map_addr) {
- addr = (char *)map_addr;
- map_len = size;
- }
- else {
- addr = buffer = (char *)malloc(size);
- if (buffer == 0) {
- error("can't allocate buffer for `%1'", name);
- return 0;
- }
- char *ptr = buffer;
- int bytes_to_read = size;
- while (bytes_to_read > 0) {
- int nread = read(fd, ptr, bytes_to_read);
- if (nread == 0) {
- error("unexpected EOF on `%1'", name);
- return 0;
- }
- if (nread < 0) {
- error("read error on `%1': %2", name, strerror(errno));
- return 0;
- }
- bytes_to_read -= nread;
- ptr += nread;
- }
- }
- header = *(index_header *)addr;
- if (header.magic != INDEX_MAGIC) {
- error("`%1' is not an index file: wrong magic number", name);
- return 0;
- }
- if (header.version != INDEX_VERSION) {
- error("version number in `%1' is wrong: was %2, should be %3",
- name, header.version, INDEX_VERSION);
- return 0;
- }
- int sz = (header.tags_size * sizeof(tag)
- + header.lists_size * sizeof(int)
- + header.table_size * sizeof(int)
- + header.strings_size
- + sizeof(header));
- if (sz != size) {
- error("size of `%1' is wrong: was %2, should be %3",
- name, size, sz);
- return 0;
- }
- tags = (tag *)(addr + sizeof(header));
- lists = (int *)(tags + header.tags_size);
- table = (int *)(lists + header.lists_size);
- pool = (char *)(table + header.table_size);
- ignore_fields = strchr(strchr(pool, '\0') + 1, '\0') + 1;
- key_buffer = new char[header.truncate];
- read_common_words_file();
- return 1;
-}
-
-const char *index_search_item::do_verify()
-{
- if (tags == 0)
- return "not loaded";
- if (lists[header.lists_size - 1] >= 0)
- return "last list element not negative";
- int i;
- for (i = 0; i < header.table_size; i++) {
- int li = table[i];
- if (li >= header.lists_size)
- return "bad list index";
- if (li >= 0) {
- for (int *ptr = lists + li; *ptr >= 0; ptr++) {
- if (*ptr >= header.tags_size)
- return "bad tag index";
- if (*ptr >= ptr[1] && ptr[1] >= 0)
- return "list not ordered";
- }
- }
- }
- for (i = 0; i < header.tags_size; i++) {
- if (tags[i].filename_index >= header.strings_size)
- return "bad index in tags";
- if (tags[i].length < 0)
- return "bad length in tags";
- if (tags[i].start < 0)
- return "bad start in tags";
- }
- if (pool[header.strings_size - 1] != '\0')
- return "last character in pool not nul";
- return 0;
-}
-
-int index_search_item::verify()
-{
- const char *reason = do_verify();
- if (!reason)
- return 1;
- error("`%1' is bad: %2", name, reason);
- return 0;
-}
-
-int index_search_item::next_filename_id() const
-{
- return filename_id + header.strings_size + 1;
-}
-
-search_item_iterator *index_search_item::make_search_item_iterator(
- const char *query)
-{
- return new index_search_item_iterator(this, query);
-}
-
-search_item *make_index_search_item(const char *filename, int fid)
-{
- char *index_filename = new char[strlen(filename) + sizeof(INDEX_SUFFIX)];
- strcpy(index_filename, filename);
- strcat(index_filename, INDEX_SUFFIX);
- int fd = open(index_filename, O_RDONLY | O_BINARY);
- if (fd < 0)
- return 0;
- index_search_item *item = new index_search_item(index_filename, fid);
- a_delete index_filename;
- if (!item->load(fd)) {
- close(fd);
- delete item;
- return 0;
- }
- else if (verify_flag && !item->verify()) {
- delete item;
- return 0;
- }
- else {
- item->check_files();
- return item;
- }
-}
-
-
-index_search_item_iterator::index_search_item_iterator(index_search_item *ind,
- const char *q)
-: indx(ind), out_of_date_files_iter(0), next_out_of_date_file(0), temp_list(0),
- buf(0), buflen(0),
- searcher(q, strlen(q), ind->ignore_fields, ind->header.truncate),
- query(strsave(q))
-{
- found_list = indx->search(q, strlen(q), &temp_list);
- if (!found_list) {
- found_list = &minus_one;
- warning("all keys would have been discarded in constructing index `%1'",
- indx->name);
- }
-}
-
-index_search_item_iterator::~index_search_item_iterator()
-{
- a_delete temp_list;
- a_delete buf;
- a_delete query;
- delete out_of_date_files_iter;
-}
-
-int index_search_item_iterator::next(const linear_searcher &,
- const char **pp, int *lenp,
- reference_id *ridp)
-{
- if (found_list) {
- for (;;) {
- int tagno = *found_list;
- if (tagno == -1)
- break;
- found_list++;
- if (get_tag(tagno, searcher, pp, lenp, ridp))
- return 1;
- }
- found_list = 0;
- next_out_of_date_file = indx->out_of_date_files;
- }
- while (next_out_of_date_file) {
- if (out_of_date_files_iter == 0)
- out_of_date_files_iter
- = next_out_of_date_file->make_search_item_iterator(query);
- if (out_of_date_files_iter->next(searcher, pp, lenp, ridp))
- return 1;
- delete out_of_date_files_iter;
- out_of_date_files_iter = 0;
- next_out_of_date_file = next_out_of_date_file->next;
- }
- return 0;
-}
-
-int index_search_item_iterator::get_tag(int tagno,
- const linear_searcher &searcher,
- const char **pp, int *lenp,
- reference_id *ridp)
-{
- if (tagno < 0 || tagno >= indx->header.tags_size) {
- error("bad tag number");
- return 0;
- }
- tag *tp = indx->tags + tagno;
- const char *filename = indx->munge_filename(indx->pool + tp->filename_index);
- int fd = open(filename, O_RDONLY | O_BINARY);
- if (fd < 0) {
- error("can't open `%1': %2", filename, strerror(errno));
- return 0;
- }
- struct stat sb;
- if (fstat(fd, &sb) < 0) {
- error("can't fstat: %1", strerror(errno));
- close(fd);
- return 0;
- }
- time_t mtime = sb.st_mtime;
- if (mtime > indx->mtime) {
- indx->add_out_of_date_file(fd, filename,
- indx->filename_id + tp->filename_index);
- return 0;
- }
- int res = 0;
- FILE *fp = fdopen(fd, FOPEN_RB);
- if (!fp) {
- error("fdopen failed");
- close(fd);
- return 0;
- }
- if (tp->start != 0 && fseek(fp, long(tp->start), 0) < 0)
- error("can't seek on `%1': %2", filename, strerror(errno));
- else {
- int length = tp->length;
- int err = 0;
- if (length == 0) {
- struct stat sb;
- if (fstat(fileno(fp), &sb) < 0) {
- error("can't stat `%1': %2", filename, strerror(errno));
- err = 1;
- }
- else if (!S_ISREG(sb.st_mode)) {
- error("`%1' is not a regular file", filename);
- err = 1;
- }
- else
- length = int(sb.st_size);
- }
- if (!err) {
- if (length + 2 > buflen) {
- a_delete buf;
- buflen = length + 2;
- buf = new char[buflen];
- }
- if (fread(buf + 1, 1, length, fp) != length)
- error("fread on `%1' failed: %2", filename, strerror(errno));
- else {
- buf[0] = '\n';
- // Remove the CR characters from CRLF pairs.
- int sidx = 1, didx = 1;
- for ( ; sidx < length + 1; sidx++, didx++)
- {
- if (buf[sidx] == '\r')
- {
- if (buf[++sidx] != '\n')
- buf[didx++] = '\r';
- else
- length--;
- }
- if (sidx != didx)
- buf[didx] = buf[sidx];
- }
- buf[length + 1] = '\n';
- res = searcher.search(buf + 1, buf + 2 + length, pp, lenp);
- if (res && ridp)
- *ridp = reference_id(indx->filename_id + tp->filename_index,
- tp->start);
- }
- }
- }
- fclose(fp);
- return res;
-}
-
-const char *index_search_item::munge_filename(const char *filename)
-{
- if (IS_ABSOLUTE(filename))
- return filename;
- const char *cwd = pool;
- int need_slash = (cwd[0] != 0
- && strchr(DIR_SEPS, strchr(cwd, '\0')[-1]) == 0);
- int len = strlen(cwd) + strlen(filename) + need_slash + 1;
- if (len > filename_buflen) {
- a_delete filename_buffer;
- filename_buflen = len;
- filename_buffer = new char[len];
- }
- strcpy(filename_buffer, cwd);
- if (need_slash)
- strcat(filename_buffer, "/");
- strcat(filename_buffer, filename);
- return filename_buffer;
-}
-
-const int *index_search_item::search1(const char **pp, const char *end)
-{
- while (*pp < end && !csalnum(**pp))
- *pp += 1;
- if (*pp >= end)
- return 0;
- const char *start = *pp;
- while (*pp < end && csalnum(**pp))
- *pp += 1;
- int len = *pp - start;
- if (len < header.shortest)
- return 0;
- if (len > header.truncate)
- len = header.truncate;
- int is_number = 1;
- for (int i = 0; i < len; i++)
- if (csdigit(start[i]))
- key_buffer[i] = start[i];
- else {
- key_buffer[i] = cmlower(start[i]);
- is_number = 0;
- }
- if (is_number && !(len == 4 && start[0] == '1' && start[1] == '9'))
- return 0;
- unsigned hc = hash(key_buffer, len);
- if (common_words_table) {
- for (int h = hc % common_words_table_size;
- common_words_table[h];
- --h) {
- if (strlen(common_words_table[h]) == len
- && memcmp(common_words_table[h], key_buffer, len) == 0)
- return 0;
- if (h == 0)
- h = common_words_table_size;
- }
- }
- int li = table[int(hc % header.table_size)];
- return li < 0 ? &minus_one : lists + li;
-}
-
-static void merge(int *result, const int *s1, const int *s2)
-{
- for (; *s1 >= 0; s1++) {
- while (*s2 >= 0 && *s2 < *s1)
- s2++;
- if (*s2 == *s1)
- *result++ = *s2;
- }
- *result++ = -1;
-}
-
-const int *index_search_item::search(const char *ptr, int length,
- int **temp_listp)
-{
- const char *end = ptr + length;
- if (*temp_listp) {
- a_delete *temp_listp;
- *temp_listp = 0;
- }
- const int *first_list = 0;
- while (ptr < end && (first_list = search1(&ptr, end)) == 0)
- ;
- if (!first_list)
- return 0;
- if (*first_list < 0)
- return first_list;
- const int *second_list = 0;
- while (ptr < end && (second_list = search1(&ptr, end)) == 0)
- ;
- if (!second_list)
- return first_list;
- if (*second_list < 0)
- return second_list;
- const int *p;
- for (p = first_list; *p >= 0; p++)
- ;
- int len = p - first_list;
- for (p = second_list; *p >= 0; p++)
- ;
- if (p - second_list < len)
- len = p - second_list;
- int *matches = new int[len + 1];
- merge(matches, first_list, second_list);
- while (ptr < end) {
- const int *list = search1(&ptr, end);
- if (list != 0) {
- if (*list < 0) {
- a_delete matches;
- return list;
- }
- merge(matches, matches, list);
- if (*matches < 0) {
- a_delete matches;
- return &minus_one;
- }
- }
- }
- *temp_listp = matches;
- return matches;
-}
-
-void index_search_item::read_common_words_file()
-{
- if (header.common <= 0)
- return;
- const char *common_words_file = munge_filename(strchr(pool, '\0') + 1);
- errno = 0;
- FILE *fp = fopen(common_words_file, "r");
- if (!fp) {
- error("can't open `%1': %2", common_words_file, strerror(errno));
- return;
- }
- common_words_table_size = 2*header.common + 1;
- while (!is_prime(common_words_table_size))
- common_words_table_size++;
- common_words_table = new char *[common_words_table_size];
- for (int i = 0; i < common_words_table_size; i++)
- common_words_table[i] = 0;
- int count = 0;
- int key_len = 0;
- for (;;) {
- int c = getc(fp);
- while (c != EOF && !csalnum(c))
- c = getc(fp);
- if (c == EOF)
- break;
- do {
- if (key_len < header.truncate)
- key_buffer[key_len++] = cmlower(c);
- c = getc(fp);
- } while (c != EOF && csalnum(c));
- if (key_len >= header.shortest) {
- int h = hash(key_buffer, key_len) % common_words_table_size;
- while (common_words_table[h]) {
- if (h == 0)
- h = common_words_table_size;
- --h;
- }
- common_words_table[h] = new char[key_len + 1];
- memcpy(common_words_table[h], key_buffer, key_len);
- common_words_table[h][key_len] = '\0';
- }
- if (++count >= header.common)
- break;
- key_len = 0;
- if (c == EOF)
- break;
- }
- fclose(fp);
-}
-
-void index_search_item::add_out_of_date_file(int fd, const char *filename,
- int fid)
-{
- search_item **pp;
- for (pp = &out_of_date_files; *pp; pp = &(*pp)->next)
- if ((*pp)->is_named(filename))
- return;
- *pp = make_linear_search_item(fd, filename, fid);
- warning("`%1' modified since `%2' created", filename, name);
-}
-
-void index_search_item::check_files()
-{
- const char *pool_end = pool + header.strings_size;
- for (const char *ptr = strchr(ignore_fields, '\0') + 1;
- ptr < pool_end;
- ptr = strchr(ptr, '\0') + 1) {
- const char *path = munge_filename(ptr);
- struct stat sb;
- if (stat(path, &sb) < 0)
- error("can't stat `%1': %2", path, strerror(errno));
- else if (sb.st_mtime > mtime) {
- int fd = open(path, O_RDONLY | O_BINARY);
- if (fd < 0)
- error("can't open `%1': %2", path, strerror(errno));
- else
- add_out_of_date_file(fd, path, filename_id + (ptr - pool));
- }
- }
-}
diff --git a/contrib/groff/libbib/linear.cc b/contrib/groff/libbib/linear.cc
deleted file mode 100644
index a8c2a553735d..000000000000
--- a/contrib/groff/libbib/linear.cc
+++ /dev/null
@@ -1,503 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-
-#include
-#include
-#include
-#include
-
-#include "posix.h"
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-#include "cset.h"
-#include "cmap.h"
-#include "nonposix.h"
-
-#include "refid.h"
-#include "search.h"
-
-class file_buffer {
- char *buffer;
- char *bufend;
-public:
- file_buffer();
- ~file_buffer();
- int load(int fd, const char *filename);
- const char *get_start() const;
- const char *get_end() const;
-};
-
-typedef unsigned char uchar;
-
-static uchar map[256];
-static uchar inv_map[256][3];
-
-struct map_init {
- map_init();
-};
-
-static map_init the_map_init;
-
-map_init::map_init()
-{
- int i;
- for (i = 0; i < 256; i++)
- map[i] = csalnum(i) ? cmlower(i) : '\0';
- for (i = 0; i < 256; i++) {
- if (cslower(i)) {
- inv_map[i][0] = i;
- inv_map[i][1] = cmupper(i);
- inv_map[i][2] = '\0';
- }
- else if (csdigit(i)) {
- inv_map[i][0] = i;
- inv_map[i][1] = 0;
- }
- else
- inv_map[i][0] = '\0';
- }
-}
-
-
-class bmpattern {
- char *pat;
- int len;
- int delta[256];
-public:
- bmpattern(const char *pattern, int pattern_length);
- ~bmpattern();
- const char *search(const char *p, const char *end) const;
- int length() const;
-};
-
-bmpattern::bmpattern(const char *pattern, int pattern_length)
-: len(pattern_length)
-{
- pat = new char[len];
- int i;
- for (i = 0; i < len; i++)
- pat[i] = map[uchar(pattern[i])];
- for (i = 0; i < 256; i++)
- delta[i] = len;
- for (i = 0; i < len; i++)
- for (const unsigned char *inv = inv_map[uchar(pat[i])]; *inv; inv++)
- delta[*inv] = len - i - 1;
-}
-
-const char *bmpattern::search(const char *buf, const char *end) const
-{
- int buflen = end - buf;
- if (len > buflen)
- return 0;
- const char *strend;
- if (buflen > len*4)
- strend = end - len*4;
- else
- strend = buf;
- const char *k = buf + len - 1;
- const int *del = delta;
- const char *pattern = pat;
- for (;;) {
- while (k < strend) {
- int t = del[uchar(*k)];
- if (!t)
- break;
- k += t;
- k += del[uchar(*k)];
- k += del[uchar(*k)];
- }
- while (k < end && del[uchar(*k)] != 0)
- k++;
- if (k == end)
- break;
- int j = len - 1;
- const char *s = k;
- for (;;) {
- if (j == 0)
- return s;
- if (map[uchar(*--s)] != uchar(pattern[--j]))
- break;
- }
- k++;
- }
- return 0;
-}
-
-bmpattern::~bmpattern()
-{
- a_delete pat;
-}
-
-inline int bmpattern::length() const
-{
- return len;
-}
-
-
-static const char *find_end(const char *bufend, const char *p);
-
-const char *linear_searcher::search_and_check(const bmpattern *key,
- const char *buf, const char *bufend, const char **start) const
-{
- assert(buf[-1] == '\n');
- assert(bufend[-1] == '\n');
- const char *ptr = buf;
- for (;;) {
- const char *found = key->search(ptr, bufend);
- if (!found)
- break;
- if (check_match(buf, bufend, found, key->length(), &ptr, start))
- return found;
- }
- return 0;
-}
-
-static const char *skip_field(const char *end, const char *p)
-{
- for (;;)
- if (*p++ == '\n') {
- if (p == end || *p == '%')
- break;
- const char *q;
- for (q = p; *q == ' ' || *q == '\t'; q++)
- ;
- if (*q == '\n')
- break;
- p = q + 1;
- }
- return p;
-}
-
-static const char *find_end(const char *bufend, const char *p)
-{
- for (;;)
- if (*p++ == '\n') {
- if (p == bufend)
- break;
- const char *q;
- for (q = p; *q == ' ' || *q == '\t'; q++)
- ;
- if (*q == '\n')
- break;
- p = q + 1;
- }
- return p;
-}
-
-
-int linear_searcher::check_match(const char *buf, const char *bufend,
- const char *match, int matchlen,
- const char **cont, const char **start) const
-{
- *cont = match + 1;
- // The user is required to supply only the first truncate_len characters
- // of the key. If truncate_len <= 0, he must supply all the key.
- if ((truncate_len <= 0 || matchlen < truncate_len)
- && map[uchar(match[matchlen])] != '\0')
- return 0;
-
- // The character before the match must not be an alphanumeric
- // character (unless the alphanumeric character follows one or two
- // percent characters at the beginning of the line), nor must it be
- // a percent character at the beginning of a line, nor a percent
- // character following a percent character at the beginning of a
- // line.
-
- switch (match - buf) {
- case 0:
- break;
- case 1:
- if (match[-1] == '%' || map[uchar(match[-1])] != '\0')
- return 0;
- break;
- case 2:
- if (map[uchar(match[-1])] != '\0' && match[-2] != '%')
- return 0;
- if (match[-1] == '%'
- && (match[-2] == '\n' || match[-2] == '%'))
- return 0;
- break;
- default:
- if (map[uchar(match[-1])] != '\0'
- && !(match[-2] == '%'
- && (match[-3] == '\n'
- || (match[-3] == '%' && match[-4] == '\n'))))
- return 0;
- if (match[-1] == '%'
- && (match[-2] == '\n'
- || (match[-2] == '%' && match[-3] == '\n')))
- return 0;
- }
-
- const char *p = match;
- int had_percent = 0;
- for (;;) {
- if (*p == '\n') {
- if (!had_percent && p[1] == '%') {
- if (p[2] != '\0' && strchr(ignore_fields, p[2]) != 0) {
- *cont = skip_field(bufend, match + matchlen);
- return 0;
- }
- if (!start)
- break;
- had_percent = 1;
- }
- if (p <= buf) {
- if (start)
- *start = p + 1;
- return 1;
- }
- const char *q;
- for (q = p - 1; *q == ' ' || *q == '\t'; q--)
- ;
- if (*q == '\n') {
- if (start)
- *start = p + 1;
- break;
- }
- p = q;
- }
- p--;
- }
- return 1;
-}
-
-file_buffer::file_buffer()
-: buffer(0), bufend(0)
-{
-}
-
-file_buffer::~file_buffer()
-{
- a_delete buffer;
-}
-
-const char *file_buffer::get_start() const
-{
- return buffer ? buffer + 4 : 0;
-}
-
-const char *file_buffer::get_end() const
-{
- return bufend;
-}
-
-int file_buffer::load(int fd, const char *filename)
-{
- struct stat sb;
- if (fstat(fd, &sb) < 0)
- error("can't fstat `%1': %2", filename, strerror(errno));
- else if (!S_ISREG(sb.st_mode))
- error("`%1' is not a regular file", filename);
- else {
- // We need one character extra at the beginning for an additional newline
- // used as a sentinel. We get 4 instead so that the read buffer will be
- // word-aligned. This seems to make the read slightly faster. We also
- // need one character at the end also for an additional newline used as a
- // sentinel.
- int size = int(sb.st_size);
- buffer = new char[size + 4 + 1];
- int nread = read(fd, buffer + 4, size);
- if (nread < 0)
- error("error reading `%1': %2", filename, strerror(errno));
- else if (nread != size)
- error("size of `%1' decreased", filename);
- else {
- char c;
- nread = read(fd, &c, 1);
- if (nread != 0)
- error("size of `%1' increased", filename);
- else if (memchr(buffer + 4, '\0', size < 1024 ? size : 1024) != 0)
- error("database `%1' is a binary file", filename);
- else {
- close(fd);
- buffer[3] = '\n';
- int sidx = 4, didx = 4;
- for ( ; sidx < size + 4; sidx++, didx++)
- {
- if (buffer[sidx] == '\r')
- {
- if (buffer[++sidx] != '\n')
- buffer[didx++] = '\r';
- else
- size--;
- }
- if (sidx != didx)
- buffer[didx] = buffer[sidx];
- }
- bufend = buffer + 4 + size;
- if (bufend[-1] != '\n')
- *bufend++ = '\n';
- return 1;
- }
- }
- a_delete buffer;
- buffer = 0;
- }
- close(fd);
- return 0;
-}
-
-linear_searcher::linear_searcher(const char *query, int query_len,
- const char *ign, int trunc)
-: ignore_fields(ign), truncate_len(trunc), keys(0), nkeys(0)
-{
- const char *query_end = query + query_len;
- int nk = 0;
- const char *p;
- for (p = query; p < query_end; p++)
- if (map[uchar(*p)] != '\0'
- && (p[1] == '\0' || map[uchar(p[1])] == '\0'))
- nk++;
- if (nk == 0)
- return;
- keys = new bmpattern*[nk];
- p = query;
- for (;;) {
- while (p < query_end && map[uchar(*p)] == '\0')
- p++;
- if (p == query_end)
- break;
- const char *start = p;
- while (p < query_end && map[uchar(*p)] != '\0')
- p++;
- keys[nkeys++] = new bmpattern(start, p - start);
- }
- assert(nkeys <= nk);
- if (nkeys == 0) {
- a_delete keys;
- keys = 0;
- }
-}
-
-linear_searcher::~linear_searcher()
-{
- for (int i = 0; i < nkeys; i++)
- delete keys[i];
- a_delete keys;
-}
-
-int linear_searcher::search(const char *buffer, const char *bufend,
- const char **startp, int *lengthp) const
-{
- assert(bufend - buffer > 0);
- assert(buffer[-1] == '\n');
- assert(bufend[-1] == '\n');
- if (nkeys == 0)
- return 0;
- for (;;) {
- const char *refstart;
- const char *found = search_and_check(keys[0], buffer, bufend, &refstart);
- if (!found)
- break;
- const char *refend = find_end(bufend, found + keys[0]->length());
- int i;
- for (i = 1; i < nkeys; i++)
- if (!search_and_check(keys[i], refstart, refend))
- break;
- if (i >= nkeys) {
- *startp = refstart;
- *lengthp = refend - refstart;
- return 1;
- }
- buffer = refend;
- }
- return 0;
-}
-
-class linear_search_item : public search_item {
- file_buffer fbuf;
-public:
- linear_search_item(const char *filename, int fid);
- ~linear_search_item();
- int load(int fd);
- search_item_iterator *make_search_item_iterator(const char *);
- friend class linear_search_item_iterator;
-};
-
-class linear_search_item_iterator : public search_item_iterator {
- linear_search_item *lsi;
- int pos;
-public:
- linear_search_item_iterator(linear_search_item *, const char *query);
- ~linear_search_item_iterator();
- int next(const linear_searcher &, const char **ptr, int *lenp,
- reference_id *ridp);
-};
-
-search_item *make_linear_search_item(int fd, const char *filename, int fid)
-{
- linear_search_item *item = new linear_search_item(filename, fid);
- if (!item->load(fd)) {
- delete item;
- return 0;
- }
- else
- return item;
-}
-
-linear_search_item::linear_search_item(const char *filename, int fid)
-: search_item(filename, fid)
-{
-}
-
-linear_search_item::~linear_search_item()
-{
-}
-
-int linear_search_item::load(int fd)
-{
- return fbuf.load(fd, name);
-}
-
-search_item_iterator *linear_search_item::make_search_item_iterator(
- const char *query)
-{
- return new linear_search_item_iterator(this, query);
-}
-
-linear_search_item_iterator::linear_search_item_iterator(
- linear_search_item *p, const char *)
-: lsi(p), pos(0)
-{
-}
-
-linear_search_item_iterator::~linear_search_item_iterator()
-{
-}
-
-int linear_search_item_iterator::next(const linear_searcher &searcher,
- const char **startp, int *lengthp,
- reference_id *ridp)
-{
- const char *bufstart = lsi->fbuf.get_start();
- const char *bufend = lsi->fbuf.get_end();
- const char *ptr = bufstart + pos;
- if (ptr < bufend && searcher.search(ptr, bufend, startp, lengthp)) {
- pos = *startp + *lengthp - bufstart;
- if (ridp)
- *ridp = reference_id(lsi->filename_id, *startp - bufstart);
- return 1;
- }
- else
- return 0;
-}
diff --git a/contrib/groff/libbib/map.c b/contrib/groff/libbib/map.c
deleted file mode 100644
index 3632a11ef488..000000000000
--- a/contrib/groff/libbib/map.c
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_MMAP
-
-#include
-#include
-
-/* The Net-2 man pages says that a MAP_FILE flag is required. */
-#ifndef MAP_FILE
-#define MAP_FILE 0
-#endif
-
-char *mapread(fd, nbytes)
- int fd;
- int nbytes;
-{
- char *p = (char *)mmap((caddr_t)0, (size_t)nbytes, PROT_READ,
- MAP_FILE|MAP_PRIVATE, fd, (off_t)0);
- if (p == (char *)-1)
- return 0;
- /* mmap() shouldn't return 0 since MAP_FIXED wasn't specified. */
- if (p == 0)
- abort();
- return p;
-}
-
-int unmap(p, len)
- char *p;
- int len;
-{
- return munmap((caddr_t)p, len);
-}
-
-#else /* not HAVE_MMAP */
-
-#include
-
-#ifndef errno
-extern int errno;
-#endif
-
-char *mapread(fd, nbytes)
- int fd;
- int nbytes;
-{
- errno = ENODEV;
- return 0;
-}
-
-int unmap(p, len)
- char *p;
- int len;
-{
- errno = EINVAL;
- return -1;
-}
-
-#endif /* not HAVE_MMAP */
diff --git a/contrib/groff/libbib/search.cc b/contrib/groff/libbib/search.cc
deleted file mode 100644
index 1e027c609711..000000000000
--- a/contrib/groff/libbib/search.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-
-#include "posix.h"
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-#include "nonposix.h"
-
-#include "refid.h"
-#include "search.h"
-
-int linear_truncate_len = 6;
-const char *linear_ignore_fields = "XYZ";
-
-search_list::search_list()
-: list(0), niterators(0), next_fid(1)
-{
-}
-
-search_list::~search_list()
-{
- assert(niterators == 0);
- while (list) {
- search_item *tem = list->next;
- delete list;
- list = tem;
- }
-}
-
-void search_list::add_file(const char *filename, int silent)
-{
- search_item *p = make_index_search_item(filename, next_fid);
- if (!p) {
- int fd = open(filename, O_RDONLY | O_BINARY);
- if (fd < 0) {
- if (!silent)
- error("can't open `%1': %2", filename, strerror(errno));
- }
- else
- p = make_linear_search_item(fd, filename, next_fid);
- }
- if (p) {
- search_item **pp;
- for (pp = &list; *pp; pp = &(*pp)->next)
- ;
- *pp = p;
- next_fid = p->next_filename_id();
- }
-}
-
-int search_list::nfiles() const
-{
- int n = 0;
- for (search_item *ptr = list; ptr; ptr = ptr->next)
- n++;
- return n;
-}
-
-search_list_iterator::search_list_iterator(search_list *p, const char *q)
-: list(p), ptr(p->list), iter(0), query(strsave(q)),
- searcher(q, strlen(q), linear_ignore_fields, linear_truncate_len)
-{
- list->niterators += 1;
-}
-
-search_list_iterator::~search_list_iterator()
-{
- list->niterators -= 1;
- a_delete query;
- delete iter;
-}
-
-int search_list_iterator::next(const char **pp, int *lenp, reference_id *ridp)
-{
- while (ptr) {
- if (iter == 0)
- iter = ptr->make_search_item_iterator(query);
- if (iter->next(searcher, pp, lenp, ridp))
- return 1;
- delete iter;
- iter = 0;
- ptr = ptr->next;
- }
- return 0;
-}
-
-search_item::search_item(const char *nm, int fid)
-: name(strsave(nm)), filename_id(fid), next(0)
-{
-}
-
-search_item::~search_item()
-{
- a_delete name;
-}
-
-int search_item::is_named(const char *nm) const
-{
- return strcmp(name, nm) == 0;
-}
-
-int search_item::next_filename_id() const
-{
- return filename_id + 1;
-}
-
-search_item_iterator::~search_item_iterator()
-{
-}
diff --git a/contrib/groff/libdriver/Makefile.dep b/contrib/groff/libdriver/Makefile.dep
deleted file mode 100644
index cf2a6959b583..000000000000
--- a/contrib/groff/libdriver/Makefile.dep
+++ /dev/null
@@ -1,6 +0,0 @@
-input.o: input.cc ../include/driver.h ../include/errarg.h \
- ../include/error.h ../include/font.h ../include/printer.h \
- ../include/lib.h ../include/device.h ../include/cset.h
-printer.o: printer.cc ../include/driver.h ../include/errarg.h \
- ../include/error.h ../include/font.h ../include/printer.h \
- ../include/lib.h
diff --git a/contrib/groff/libdriver/Makefile.sub b/contrib/groff/libdriver/Makefile.sub
deleted file mode 100644
index d50f060bd917..000000000000
--- a/contrib/groff/libdriver/Makefile.sub
+++ /dev/null
@@ -1,7 +0,0 @@
-LIB=driver
-OBJS=\
- input.o \
- printer.o
-CCSRCS=\
- $(srcdir)/input.cc \
- $(srcdir)/printer.cc
diff --git a/contrib/groff/libdriver/input.cc b/contrib/groff/libdriver/input.cc
deleted file mode 100644
index ba71a5b3e703..000000000000
--- a/contrib/groff/libdriver/input.cc
+++ /dev/null
@@ -1,501 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "driver.h"
-#include "device.h"
-#include "cset.h"
-
-const char *current_filename=0;
-int current_lineno;
-const char *device = 0;
-FILE *current_file;
-
-int get_integer(); // don't read the newline
-int possibly_get_integer(int *);
-char *get_string(int is_long = 0);
-void skip_line();
-
-struct environment_list {
- environment env;
- environment_list *next;
-
- environment_list(const environment &, environment_list *);
-};
-
-environment_list::environment_list(const environment &e, environment_list *p)
-: env(e), next(p)
-{
-}
-
-inline int get_char()
-{
- return getc(current_file);
-}
-
-/*
- * remember_filename - is needed as get_string might overwrite the
- * filename eventually.
- */
-
-void remember_filename (const char *filename)
-{
- if (current_filename != 0) {
- free((char *)current_filename);
- }
- if (strcmp(filename, "-") == 0) {
- filename = "";
- }
- current_filename = (const char *)malloc(strlen(filename)+1);
- if (current_filename == 0) {
- fatal("can't malloc space for filename");
- }
- strcpy((char *)current_filename, (char *)filename);
-}
-
-void do_file(const char *filename)
-{
- int npages = 0;
- if (filename[0] == '-' && filename[1] == '\0') {
- remember_filename(filename);
- current_file = stdin;
- }
- else {
- errno = 0;
- current_file = fopen(filename, "r");
- if (current_file == 0) {
- error("can't open `%1'", filename);
- return;
- }
- remember_filename(filename);
- }
- environment env;
- env.vpos = -1;
- env.hpos = -1;
- env.fontno = -1;
- env.height = 0;
- env.slant = 0;
- environment_list *env_list = 0;
- current_lineno = 1;
- int command;
- char *s;
- command = get_char();
- if (command == EOF)
- return;
- if (command != 'x')
- fatal("the first command must be `x T'");
- s = get_string();
- if (s[0] != 'T')
- fatal("the first command must be `x T'");
- char *dev = get_string();
- if (pr == 0) {
- device = strsave(dev);
- if (!font::load_desc())
- fatal("sorry, I can't continue");
- }
- else {
- if (device == 0 || strcmp(device, dev) != 0)
- fatal("all files must use the same device");
- }
- skip_line();
- env.size = 10*font::sizescale;
- command = get_char();
- if (command != 'x')
- fatal("the second command must be `x res'");
- s = get_string();
- if (s[0] != 'r')
- fatal("the second command must be `x res'");
- int n = get_integer();
- if (n != font::res)
- fatal("resolution does not match");
- n = get_integer();
- if (n != font::hor)
- fatal("horizontal resolution does not match");
- n = get_integer();
- if (n != font::vert)
- fatal("vertical resolution does not match");
- skip_line();
- command = get_char();
- if (command != 'x')
- fatal("the third command must be `x init'");
- s = get_string();
- if (s[0] != 'i')
- fatal("the third command must be `x init'");
- skip_line();
- if (pr == 0)
- pr = make_printer();
- while ((command = get_char()) != EOF) {
- switch (command) {
- case 's':
- env.size = get_integer();
- if (env.height == env.size)
- env.height = 0;
- break;
- case 'f':
- env.fontno = get_integer();
- break;
- case 'F':
- remember_filename(get_string());
- break;
- case 'C':
- {
- if (npages == 0)
- fatal("`C' command illegal before first `p' command");
- char *s = get_string();
- pr->set_special_char(s, &env);
- }
- break;
- case 'N':
- {
- if (npages == 0)
- fatal("`N' command illegal before first `p' command");
- pr->set_numbered_char(get_integer(), &env);
- }
- break;
- case 'H':
- env.hpos = get_integer();
- break;
- case 'h':
- env.hpos += get_integer();
- break;
- case 'V':
- env.vpos = get_integer();
- break;
- case 'v':
- env.vpos += get_integer();
- break;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- int c = get_char();
- if (!csdigit(c))
- fatal("digit expected");
- env.hpos += (command - '0')*10 + (c - '0');
- }
- // fall through
- case 'c':
- {
- if (npages == 0)
- fatal("`c' command illegal before first `p' command");
- int c = get_char();
- if (c == EOF)
- fatal("missing argument to `c' command");
- pr->set_ascii_char(c, &env);
- }
- break;
- case 'n':
- if (npages == 0)
- fatal("`n' command illegal before first `p' command");
- pr->end_of_line();
- (void)get_integer();
- (void)get_integer();
- break;
- case 'w':
- case ' ':
- break;
- case '\n':
- current_lineno++;
- break;
- case 'p':
- if (npages)
- pr->end_page(env.vpos);
- npages++;
- pr->begin_page(get_integer());
- env.vpos = 0;
- break;
- case '{':
- env_list = new environment_list(env, env_list);
- break;
- case '}':
- if (!env_list) {
- fatal("can't pop");
- }
- else {
- env = env_list->env;
- environment_list *tem = env_list;
- env_list = env_list->next;
- delete tem;
- }
- break;
- case 'u':
- {
- if (npages == 0)
- fatal("`u' command illegal before first `p' command");
- int kern = get_integer();
- int c = get_char();
- while (c == ' ')
- c = get_char();
- while (c != EOF) {
- if (c == '\n') {
- current_lineno++;
- break;
- }
- int w;
- pr->set_ascii_char(c, &env, &w);
- env.hpos += w + kern;
- c = get_char();
- if (c == ' ')
- break;
- }
- }
- break;
- case 't':
- {
- if (npages == 0)
- fatal("`t' command illegal before first `p' command");
- int c;
- while ((c = get_char()) != EOF && c != ' ') {
- if (c == '\n') {
- current_lineno++;
- break;
- }
- int w;
- pr->set_ascii_char(c, &env, &w);
- env.hpos += w;
- }
- }
- break;
- case '#':
- skip_line();
- break;
- case 'D':
- {
- if (npages == 0)
- fatal("`D' command illegal before first `p' command");
- int c;
- while ((c = get_char()) == ' ')
- ;
- int n;
- int *p = 0;
- int szp = 0;
- int np;
- for (np = 0; possibly_get_integer(&n); np++) {
- if (np >= szp) {
- if (szp == 0) {
- szp = 16;
- p = new int[szp];
- }
- else {
- int *oldp = p;
- p = new int[szp*2];
- memcpy(p, oldp, szp*sizeof(int));
- szp *= 2;
- a_delete oldp;
- }
- }
- p[np] = n;
- }
- pr->draw(c, p, np, &env);
- if (c == 'e') {
- if (np > 0)
- env.hpos += p[0];
- }
- else if (c == 'f' || c == 't')
- ;
- else {
- int i;
- for (i = 0; i < np/2; i++) {
- env.hpos += p[i*2];
- env.vpos += p[i*2 + 1];
- }
- // there might be an odd number of characters
- if (i*2 < np)
- env.hpos += p[i*2];
- }
- a_delete p;
- skip_line();
- }
- break;
- case 'x':
- {
- char *s = get_string();
- int suppress_skip = 0;
- switch (s[0]) {
- case 'i':
- error("duplicate `x init' command");
- break;
- case 'T':
- error("duplicate `x T' command");
- break;
- case 'r':
- error("duplicate `x res' command");
- break;
- case 'p':
- break;
- case 's':
- break;
- case 't':
- break;
- case 'f':
- {
- int n = get_integer();
- char *name = get_string();
- pr->load_font(n, name);
- }
- break;
- case 'H':
- env.height = get_integer();
- if (env.height == env.size)
- env.height = 0;
- break;
- case 'S':
- env.slant = get_integer();
- break;
- case 'X':
- if (npages == 0)
- fatal("`x X' command illegal before first `p' command");
- pr->special(get_string(1), &env);
- suppress_skip = 1;
- break;
- default:
- error("unrecognised x command `%1'", s);
- }
- if (!suppress_skip)
- skip_line();
- }
- break;
- default:
- error("unrecognised command code %1", int(command));
- skip_line();
- break;
- }
- }
- if (npages)
- pr->end_page(env.vpos);
-}
-
-int get_integer()
-{
- int c = get_char();
- while (c == ' ')
- c = get_char();
- int neg = 0;
- if (c == '-') {
- neg = 1;
- c = get_char();
- }
- if (!csdigit(c))
- fatal("integer expected");
- int total = 0;
- do {
- total = total*10;
- if (neg)
- total -= c - '0';
- else
- total += c - '0';
- c = get_char();
- } while (csdigit(c));
- if (c != EOF)
- ungetc(c, current_file);
- return total;
-}
-
-int possibly_get_integer(int *res)
-{
- int c = get_char();
- while (c == ' ')
- c = get_char();
- int neg = 0;
- if (c == '-') {
- neg = 1;
- c = get_char();
- }
- if (!csdigit(c)) {
- if (c != EOF)
- ungetc(c, current_file);
- return 0;
- }
- int total = 0;
- do {
- total = total*10;
- if (neg)
- total -= c - '0';
- else
- total += c - '0';
- c = get_char();
- } while (csdigit(c));
- if (c != EOF)
- ungetc(c, current_file);
- *res = total;
- return 1;
-}
-
-
-char *get_string(int is_long)
-{
- static char *buf;
- static int buf_size;
- int c = get_char();
- while (c == ' ')
- c = get_char();
- for (int i = 0;; i++) {
- if (i >= buf_size) {
- if (buf_size == 0) {
- buf_size = 16;
- buf = new char[buf_size];
- }
- else {
- char *old_buf = buf;
- int old_size = buf_size;
- buf_size *= 2;
- buf = new char[buf_size];
- memcpy(buf, old_buf, old_size);
- a_delete old_buf;
- }
- }
- if ((!is_long && (c == ' ' || c == '\n')) || c == EOF) {
- buf[i] = '\0';
- break;
- }
- if (is_long && c == '\n') {
- current_lineno++;
- c = get_char();
- if (c == '+')
- c = '\n';
- else {
- buf[i] = '\0';
- break;
- }
- }
- buf[i] = c;
- c = get_char();
- }
- if (c != EOF)
- ungetc(c, current_file);
- return buf;
-}
-
-void skip_line()
-{
- int c;
- while ((c = get_char()) != EOF)
- if (c == '\n') {
- current_lineno++;
- break;
- }
-}
-
diff --git a/contrib/groff/libdriver/printer.cc b/contrib/groff/libdriver/printer.cc
deleted file mode 100644
index 770aa50711be..000000000000
--- a/contrib/groff/libdriver/printer.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "driver.h"
-
-printer *pr = 0;
-
-font_pointer_list::font_pointer_list(font *f, font_pointer_list *fp)
-: p(f), next(fp)
-{
-}
-
-printer::printer()
-: font_list(0), font_table(0), nfonts(0)
-{
-}
-
-printer::~printer()
-{
- a_delete font_table;
- while (font_list) {
- font_pointer_list *tem = font_list;
- font_list = font_list->next;
- delete tem->p;
- delete tem;
- }
- if (ferror(stdout) || fflush(stdout) < 0)
- fatal("output error");
-}
-
-void printer::load_font(int n, const char *nm)
-{
- assert(n >= 0);
- if (n >= nfonts) {
- if (nfonts == 0) {
- nfonts = 10;
- if (nfonts <= n)
- nfonts = n + 1;
- font_table = new font *[nfonts];
- for (int i = 0; i < nfonts; i++)
- font_table[i] = 0;
- }
- else {
- font **old_font_table = font_table;
- int old_nfonts = nfonts;
- nfonts *= 2;
- if (n >= nfonts)
- nfonts = n + 1;
- font_table = new font *[nfonts];
- int i;
- for (i = 0; i < old_nfonts; i++)
- font_table[i] = old_font_table[i];
- for (i = old_nfonts; i < nfonts; i++)
- font_table[i] = 0;
- a_delete old_font_table;
- }
- }
- font *f = find_font(nm);
- font_table[n] = f;
-}
-
-font *printer::find_font(const char *nm)
-{
- for (font_pointer_list *p = font_list; p; p = p->next)
- if (strcmp(p->p->get_name(), nm) == 0)
- return p->p;
- font *f = make_font(nm);
- if (!f)
- fatal("sorry, I can't continue");
- font_list = new font_pointer_list(f, font_list);
- return f;
-}
-
-font *printer::make_font(const char *nm)
-{
- return font::load_font(nm);
-}
-
-void printer::end_of_line()
-{
-}
-
-void printer::special(char *, const environment *)
-{
-}
-
-void printer::draw(int, int *, int, const environment *)
-{
-}
-
-void printer::set_ascii_char(unsigned char c, const environment *env,
- int *widthp)
-{
- char buf[2];
- int w;
- font *f;
-
- buf[0] = c;
- buf[1] = '\0';
-
- int i = set_char_and_width(buf, env, &w, &f);
- set_char(i, f, env, w, 0);
- if (widthp) {
- *widthp = w;
- }
-}
-
-void printer::set_special_char(const char *nm, const environment *env,
- int *widthp)
-{
- font *f;
- int w;
- int i = set_char_and_width(nm, env, &w, &f);
- if (i != -1) {
- set_char(i, f, env, w, nm);
- if (widthp) {
- *widthp = w;
- }
- }
-}
-
-int printer::set_char_and_width(const char *nm, const environment *env,
- int *widthp, font **f)
-{
- int i = font::name_to_index(nm);
- int fn = env->fontno;
- if (fn < 0 || fn >= nfonts) {
- error("bad font position `%1'", fn);
- return(-1);
- }
- *f = font_table[fn];
- if (*f == 0) {
- error("no font mounted at `%1'", fn);
- return(-1);
- }
- if (!(*f)->contains(i)) {
- if (nm[0] != '\0' && nm[1] == '\0')
- error("font `%1' does not contain ascii character `%2'",
- (*f)->get_name(),
- nm[0]);
- else
- error("font `%1' does not contain special character `%2'",
- (*f)->get_name(),
- nm);
- return(-1);
- }
- int w = (*f)->get_width(i, env->size);
- if (widthp)
- *widthp = w;
- return( i );
-}
-
-void printer::set_numbered_char(int num, const environment *env, int *widthp)
-{
- int i = font::number_to_index(num);
- int fn = env->fontno;
- if (fn < 0 || fn >= nfonts) {
- error("bad font position `%1'", fn);
- return;
- }
- font *f = font_table[fn];
- if (f == 0) {
- error("no font mounted at `%1'", fn);
- return;
- }
- if (!f->contains(i)) {
- error("font `%1' does not contain numbered character %2",
- f->get_name(),
- num);
- return;
- }
- int w = f->get_width(i, env->size);
- if (widthp)
- *widthp = w;
- set_char(i, f, env, w, 0);
-}
-
-// This utility function adjusts the specified center of the
-// arc so that it is equidistant between the specified start
-// and end points. (p[0], p[1]) is a vector from the current
-// point to the center; (p[2], p[3]) is a vector from the
-// center to the end point. If the center can be adjusted,
-// a vector from the current point to the adjusted center is
-// stored in c[0], c[1] and 1 is returned. Otherwise 0 is
-// returned.
-
-#if 1
-int printer::adjust_arc_center(const int *p, double *c)
-{
- // We move the center along a line parallel to the line between
- // the specified start point and end point so that the center
- // is equidistant between the start and end point.
- // It can be proved (using Lagrange multipliers) that this will
- // give the point nearest to the specified center that is equidistant
- // between the start and end point.
-
- double x = p[0] + p[2]; // (x, y) is the end point
- double y = p[1] + p[3];
- double n = x*x + y*y;
- if (n != 0) {
- c[0]= double(p[0]);
- c[1] = double(p[1]);
- double k = .5 - (c[0]*x + c[1]*y)/n;
- c[0] += k*x;
- c[1] += k*y;
- return 1;
- }
- else
- return 0;
-}
-#else
-int printer::adjust_arc_center(const int *p, double *c)
-{
- int x = p[0] + p[2]; // (x, y) is the end point
- int y = p[1] + p[3];
- // Start at the current point; go in the direction of the specified
- // center point until we reach a point that is equidistant between
- // the specified starting point and the specified end point. Place
- // the center of the arc there.
- double n = p[0]*double(x) + p[1]*double(y);
- if (n > 0) {
- double k = (double(x)*x + double(y)*y)/(2.0*n);
- // (cx, cy) is our chosen center
- c[0] = k*p[0];
- c[1] = k*p[1];
- return 1;
- }
- else {
- // We would never reach such a point. So instead start at the
- // specified end point of the arc. Go towards the specified
- // center point until we reach a point that is equidistant between
- // the specified start point and specified end point. Place
- // the center of the arc there.
- n = p[2]*double(x) + p[3]*double(y);
- if (n > 0) {
- double k = 1 - (double(x)*x + double(y)*y)/(2.0*n);
- // (c[0], c[1]) is our chosen center
- c[0] = p[0] + k*p[2];
- c[1] = p[1] + k*p[3];
- return 1;
- }
- else
- return 0;
- }
-}
-#endif
diff --git a/contrib/groff/libgroff/Makefile.dep b/contrib/groff/libgroff/Makefile.dep
deleted file mode 100644
index 2ddf64057679..000000000000
--- a/contrib/groff/libgroff/Makefile.dep
+++ /dev/null
@@ -1,39 +0,0 @@
-assert.o: assert.cc ../include/assert.h
-change_lf.o: change_lf.cc
-cmap.o: cmap.cc ../include/cmap.h
-cset.o: cset.cc ../include/cset.h
-device.o: device.cc ../include/device.h ../include/defs.h
-errarg.o: errarg.cc ../include/assert.h ../include/errarg.h
-error.o: error.cc ../include/errarg.h ../include/error.h
-fatal.o: fatal.cc
-filename.o: filename.cc
-font.o: font.cc ../include/errarg.h ../include/error.h \
- ../include/cset.h ../include/font.h ../include/lib.h
-fontfile.o: fontfile.cc ../include/font.h ../include/lib.h \
- ../include/searchpath.h ../include/device.h ../include/defs.h
-lf.o: lf.cc ../include/cset.h ../include/stringclass.h
-lineno.o: lineno.cc
-macropath.o: macropath.cc ../include/lib.h ../include/searchpath.h \
- ../include/macropath.h ../include/defs.h
-nametoindex.o: nametoindex.cc ../include/lib.h ../include/errarg.h \
- ../include/error.h ../include/font.h ../include/ptable.h
-new.o: new.cc ../include/posix.h
-prime.o: prime.cc
-progname.o: progname.cc
-ptable.o: ptable.cc ../include/ptable.h ../include/errarg.h \
- ../include/error.h
-searchpath.o: searchpath.cc ../include/lib.h ../include/searchpath.h
-string.o: string.cc ../include/stringclass.h ../include/lib.h
-strsave.o: strsave.cc
-tmpfile.o: tmpfile.cc ../include/posix.h ../include/lib.h \
- ../include/errarg.h ../include/error.h
-version.o: version.cc
-illegal.o: illegal.cc ../include/lib.h
-fmod.o: fmod.c
-getcwd.o: getcwd.c
-iftoa.o: iftoa.c
-itoa.o: itoa.c
-matherr.o: matherr.c
-strerror.o: strerror.c
-strtol.o: strtol.c
-putenv.o: putenv.c
diff --git a/contrib/groff/libgroff/Makefile.sub b/contrib/groff/libgroff/Makefile.sub
deleted file mode 100644
index 5ce0691af5a8..000000000000
--- a/contrib/groff/libgroff/Makefile.sub
+++ /dev/null
@@ -1,84 +0,0 @@
-LIB=groff
-OBJS=\
- assert.o \
- change_lf.o \
- cmap.o \
- cset.o \
- device.o \
- errarg.o \
- error.o \
- fatal.o \
- filename.o \
- font.o \
- fontfile.o \
- getopt.o \
- getopt1.o \
- htmlindicate.o \
- illegal.o \
- lf.o \
- lineno.o \
- macropath.o \
- nametoindex.o \
- new.o \
- prime.o \
- progname.o \
- ptable.o \
- searchpath.o \
- string.o \
- strsave.o \
- tmpfile.o \
- iftoa.o \
- itoa.o \
- matherr.o \
- version.o \
- $(LIBOBJS)
-CCSRCS=\
- $(srcdir)/assert.cc \
- $(srcdir)/change_lf.cc \
- $(srcdir)/cmap.cc \
- $(srcdir)/cset.cc \
- $(srcdir)/device.cc \
- $(srcdir)/errarg.cc \
- $(srcdir)/error.cc \
- $(srcdir)/fatal.cc \
- $(srcdir)/filename.cc \
- $(srcdir)/font.cc \
- $(srcdir)/fontfile.cc \
- $(srcdir)/htmlindicate.cc \
- $(srcdir)/illegal.cc \
- $(srcdir)/lf.cc \
- $(srcdir)/lineno.cc \
- $(srcdir)/macropath.cc \
- $(srcdir)/nametoindex.cc \
- $(srcdir)/new.cc \
- $(srcdir)/prime.cc \
- $(srcdir)/progname.cc \
- $(srcdir)/ptable.cc \
- $(srcdir)/searchpath.cc \
- $(srcdir)/string.cc \
- $(srcdir)/strsave.cc \
- $(srcdir)/tmpfile.cc \
- version.cc
-CSRCS=\
- $(srcdir)/fmod.c \
- $(srcdir)/getcwd.c \
- $(srcdir)/getopt.c \
- $(srcdir)/getopt1.c \
- $(srcdir)/iftoa.c \
- $(srcdir)/itoa.c \
- $(srcdir)/matherr.c \
- $(srcdir)/putenv.c \
- $(srcdir)/strerror.c \
- $(srcdir)/strtol.c
-GENSRCS=\
- version.cc
-
-version=`cat $(top_srcdir)/VERSION`
-revision=`cat $(top_srcdir)/REVISION`
-
-version.cc: $(top_srcdir)/VERSION $(top_srcdir)/REVISION
- @echo Making version.cc
- @echo const char \*version_string = \"$(version)\"\; >$@
- @echo const char \*revision_string = \"$(revision)\"\; >>$@
- @echo const char \*Version_string = \"$(version).$(revision)\"\; | \
- sed -e 's/\.0\"/\"/' >>$@
diff --git a/contrib/groff/libgroff/assert.cc b/contrib/groff/libgroff/assert.cc
deleted file mode 100644
index 89742e32cbb1..000000000000
--- a/contrib/groff/libgroff/assert.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include "assert.h"
-
-extern const char *program_name;
-
-void assertion_failed(int lineno, const char *filename)
-{
- if (program_name != 0)
- fprintf(stderr, "%s: ", program_name);
- fprintf(stderr, "Failed assertion at line %d, file `%s'.\n",
- lineno, filename);
- fflush(stderr);
- abort();
-}
diff --git a/contrib/groff/libgroff/change_lf.cc b/contrib/groff/libgroff/change_lf.cc
deleted file mode 100644
index 2e44af1d5749..000000000000
--- a/contrib/groff/libgroff/change_lf.cc
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-
-extern char *strsave(const char *);
-
-extern const char *current_filename;
-extern int current_lineno;
-
-void change_filename(const char *f)
-{
- if (current_filename != 0 && strcmp(current_filename, f) == 0)
- return;
- current_filename = strsave(f);
-}
-
-void change_lineno(int ln)
-{
- current_lineno = ln;
-}
diff --git a/contrib/groff/libgroff/cmap.cc b/contrib/groff/libgroff/cmap.cc
deleted file mode 100644
index 4b75d06f1dcf..000000000000
--- a/contrib/groff/libgroff/cmap.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include "cmap.h"
-
-cmap cmlower(CMAP_BUILTIN);
-cmap cmupper(CMAP_BUILTIN);
-
-#ifdef isascii
-#define ISASCII(c) isascii(c)
-#else
-#define ISASCII(c) (1)
-#endif
-
-cmap::cmap()
-{
- unsigned char *p = v;
- for (int i = 0; i <= UCHAR_MAX; i++)
- p[i] = i;
-}
-
-cmap::cmap(cmap_builtin)
-{
- // these are initialised by cmap_init::cmap_init()
-}
-
-int cmap_init::initialised = 0;
-
-cmap_init::cmap_init()
-{
- if (initialised)
- return;
- initialised = 1;
- for (int i = 0; i <= UCHAR_MAX; i++) {
- cmupper.v[i] = ISASCII(i) && islower(i) ? toupper(i) : i;
- cmlower.v[i] = ISASCII(i) && isupper(i) ? tolower(i) : i;
- }
-}
diff --git a/contrib/groff/libgroff/cset.cc b/contrib/groff/libgroff/cset.cc
deleted file mode 100644
index e4845c11012e..000000000000
--- a/contrib/groff/libgroff/cset.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include "cset.h"
-
-cset csalpha(CSET_BUILTIN);
-cset csupper(CSET_BUILTIN);
-cset cslower(CSET_BUILTIN);
-cset csdigit(CSET_BUILTIN);
-cset csxdigit(CSET_BUILTIN);
-cset csspace(CSET_BUILTIN);
-cset cspunct(CSET_BUILTIN);
-cset csalnum(CSET_BUILTIN);
-cset csprint(CSET_BUILTIN);
-cset csgraph(CSET_BUILTIN);
-cset cscntrl(CSET_BUILTIN);
-
-#ifdef isascii
-#define ISASCII(c) isascii(c)
-#else
-#define ISASCII(c) (1)
-#endif
-
-void cset::clear()
-{
- char *p = v;
- for (int i = 0; i <= UCHAR_MAX; i++)
- p[i] = 0;
-}
-
-cset::cset()
-{
- clear();
-}
-
-cset::cset(const char *s)
-{
- clear();
- while (*s)
- v[(unsigned char)*s++] = 1;
-}
-
-cset::cset(const unsigned char *s)
-{
- clear();
- while (*s)
- v[*s++] = 1;
-}
-
-cset::cset(cset_builtin)
-{
- // these are initialised by cset_init::cset_init()
-}
-
-cset &cset::operator|=(const cset &cs)
-{
- for (int i = 0; i <= UCHAR_MAX; i++)
- if (cs.v[i])
- v[i] = 1;
- return *this;
-}
-
-
-int cset_init::initialised = 0;
-
-cset_init::cset_init()
-{
- if (initialised)
- return;
- initialised = 1;
- for (int i = 0; i <= UCHAR_MAX; i++) {
- csalpha.v[i] = ISASCII(i) && isalpha(i);
- csupper.v[i] = ISASCII(i) && isupper(i);
- cslower.v[i] = ISASCII(i) && islower(i);
- csdigit.v[i] = ISASCII(i) && isdigit(i);
- csxdigit.v[i] = ISASCII(i) && isxdigit(i);
- csspace.v[i] = ISASCII(i) && isspace(i);
- cspunct.v[i] = ISASCII(i) && ispunct(i);
- csalnum.v[i] = ISASCII(i) && isalnum(i);
- csprint.v[i] = ISASCII(i) && isprint(i);
- csgraph.v[i] = ISASCII(i) && isgraph(i);
- cscntrl.v[i] = ISASCII(i) && iscntrl(i);
- }
-}
diff --git a/contrib/groff/libgroff/device.cc b/contrib/groff/libgroff/device.cc
deleted file mode 100644
index 7efbfef25a2d..000000000000
--- a/contrib/groff/libgroff/device.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include "device.h"
-#include "defs.h"
-
-const char *device = DEVICE;
-
-struct device_init {
- device_init();
-} _device_init;
-
-device_init::device_init()
-{
- char *tem = getenv("GROFF_TYPESETTER");
- if (tem)
- device = tem;
-}
diff --git a/contrib/groff/libgroff/errarg.cc b/contrib/groff/libgroff/errarg.cc
deleted file mode 100644
index be4d3dc9d31b..000000000000
--- a/contrib/groff/libgroff/errarg.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include "assert.h"
-#include "errarg.h"
-
-errarg::errarg(const char *p) : type(STRING)
-{
- s = p ? p : "(null)";
-}
-
-errarg::errarg() : type(EMPTY)
-{
-}
-
-errarg::errarg(unsigned char cc) : type(CHAR)
-{
- c = cc;
-}
-
-errarg::errarg(int nn) : type(INTEGER)
-{
- n = nn;
-}
-
-errarg::errarg(char cc) : type(CHAR)
-{
- c = cc;
-}
-
-errarg::errarg(double dd) : type(DOUBLE)
-{
- d = dd;
-}
-
-int errarg::empty() const
-{
- return type == EMPTY;
-}
-
-extern "C" {
- const char *i_to_a(int);
-}
-
-void errarg::print() const
-{
- switch (type) {
- case INTEGER:
- fputs(i_to_a(n), stderr);
- break;
- case CHAR:
- putc(c, stderr);
- break;
- case STRING:
- fputs(s, stderr);
- break;
- case DOUBLE:
- fprintf(stderr, "%g", d);
- break;
- case EMPTY:
- break;
- }
-}
-
-errarg empty_errarg;
-
-void errprint(const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- assert(format != 0);
- char c;
- while ((c = *format++) != '\0') {
- if (c == '%') {
- c = *format++;
- switch(c) {
- case '%':
- fputc('%', stderr);
- break;
- case '1':
- assert(!arg1.empty());
- arg1.print();
- break;
- case '2':
- assert(!arg2.empty());
- arg2.print();
- break;
- case '3':
- assert(!arg3.empty());
- arg3.print();
- break;
- default:
- assert(0);
- }
- }
- else
- putc(c, stderr);
- }
-}
diff --git a/contrib/groff/libgroff/error.cc b/contrib/groff/libgroff/error.cc
deleted file mode 100644
index 53fd629845fc..000000000000
--- a/contrib/groff/libgroff/error.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include "errarg.h"
-#include "error.h"
-
-extern void fatal_error_exit();
-
-enum error_type { WARNING, ERROR, FATAL };
-
-static void do_error_with_file_and_line(const char *filename, int lineno,
- error_type type,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- int need_space = 0;
- if (program_name) {
- fprintf(stderr, "%s:", program_name);
- need_space = 1;
- }
- if (lineno >= 0 && filename != 0) {
- if (strcmp(filename, "-") == 0)
- filename = "";
- fprintf(stderr, "%s:%d:", filename, lineno);
- need_space = 1;
- }
- switch (type) {
- case FATAL:
- fputs("fatal error:", stderr);
- need_space = 1;
- break;
- case ERROR:
- break;
- case WARNING:
- fputs("warning:", stderr);
- need_space = 1;
- break;
- }
- if (need_space)
- fputc(' ', stderr);
- errprint(format, arg1, arg2, arg3);
- fputc('\n', stderr);
- fflush(stderr);
- if (type == FATAL)
- fatal_error_exit();
-}
-
-
-static void do_error(error_type type,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error_with_file_and_line(current_filename, current_lineno,
- type, format, arg1, arg2, arg3);
-}
-
-
-void error(const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error(ERROR, format, arg1, arg2, arg3);
-}
-
-void warning(const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error(WARNING, format, arg1, arg2, arg3);
-}
-
-void fatal(const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error(FATAL, format, arg1, arg2, arg3);
-}
-
-void error_with_file_and_line(const char *filename,
- int lineno,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error_with_file_and_line(filename, lineno,
- ERROR, format, arg1, arg2, arg3);
-}
-
-void warning_with_file_and_line(const char *filename,
- int lineno,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error_with_file_and_line(filename, lineno,
- WARNING, format, arg1, arg2, arg3);
-}
-
-void fatal_with_file_and_line(const char *filename,
- int lineno,
- const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- do_error_with_file_and_line(filename, lineno,
- FATAL, format, arg1, arg2, arg3);
-}
diff --git a/contrib/groff/libgroff/fatal.cc b/contrib/groff/libgroff/fatal.cc
deleted file mode 100644
index 42560dcaf5e7..000000000000
--- a/contrib/groff/libgroff/fatal.cc
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-
-#define FATAL_ERROR_EXIT_CODE 3
-
-void fatal_error_exit()
-{
- exit(FATAL_ERROR_EXIT_CODE);
-}
diff --git a/contrib/groff/libgroff/filename.cc b/contrib/groff/libgroff/filename.cc
deleted file mode 100644
index 1cbaa93dddfc..000000000000
--- a/contrib/groff/libgroff/filename.cc
+++ /dev/null
@@ -1 +0,0 @@
-const char *current_filename = 0;
diff --git a/contrib/groff/libgroff/fmod.c b/contrib/groff/libgroff/fmod.c
deleted file mode 100644
index 818f946edc04..000000000000
--- a/contrib/groff/libgroff/fmod.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-
-double fmod(x, y)
- double x, y;
-{
- double quot = x/y;
- return x - (quot < 0.0 ? ceil(quot) : floor(quot)) * y;
-}
-
diff --git a/contrib/groff/libgroff/font.cc b/contrib/groff/libgroff/font.cc
deleted file mode 100644
index c3bfa23ea479..000000000000
--- a/contrib/groff/libgroff/font.cc
+++ /dev/null
@@ -1,938 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include "errarg.h"
-#include "error.h"
-#include "cset.h"
-#include "font.h"
-#include "lib.h"
-
-const char *const WS = " \t\n\r";
-
-struct font_char_metric {
- char type;
- int code;
- int width;
- int height;
- int depth;
- int pre_math_space;
- int italic_correction;
- int subscript_correction;
- char *special_device_coding;
-};
-
-struct font_kern_list {
- int i1;
- int i2;
- int amount;
- font_kern_list *next;
-
- font_kern_list(int, int, int, font_kern_list * = 0);
-};
-
-struct font_widths_cache {
- font_widths_cache *next;
- int point_size;
- int *width;
-
- font_widths_cache(int, int, font_widths_cache *);
- ~font_widths_cache();
-};
-
-/* text_file */
-
-struct text_file {
- FILE *fp;
- char *path;
- int lineno;
- int size;
- int skip_comments;
- char *buf;
- text_file(FILE *fp, char *p);
- ~text_file();
- int next();
- void error(const char *format,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-};
-
-text_file::text_file(FILE *p, char *s)
-: fp(p), path(s), lineno(0), size(0), skip_comments(1), buf(0)
-{
-}
-
-text_file::~text_file()
-{
- a_delete buf;
- a_delete path;
- if (fp)
- fclose(fp);
-}
-
-
-int text_file::next()
-{
- if (fp == 0)
- return 0;
- if (buf == 0) {
- buf = new char [128];
- size = 128;
- }
- for (;;) {
- int i = 0;
- for (;;) {
- int c = getc(fp);
- if (c == EOF)
- break;
- if (illegal_input_char(c))
- error("illegal input character code `%1'", int(c));
- else {
- if (i + 1 >= size) {
- char *old_buf = buf;
- buf = new char[size*2];
- memcpy(buf, old_buf, size);
- a_delete old_buf;
- size *= 2;
- }
- buf[i++] = c;
- if (c == '\n')
- break;
- }
- }
- if (i == 0)
- break;
- buf[i] = '\0';
- lineno++;
- char *ptr = buf;
- while (csspace(*ptr))
- ptr++;
- if (*ptr != 0 && (!skip_comments || *ptr != '#'))
- return 1;
- }
- return 0;
-}
-
-void text_file::error(const char *format,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- error_with_file_and_line(path, lineno, format, arg1, arg2, arg3);
-}
-
-
-/* font functions */
-
-font::font(const char *s)
-: ligatures(0), kern_hash_table(0), space_width(0), ch_index(0), nindices(0),
- ch(0), ch_used(0), ch_size(0), special(0), widths_cache(0)
-{
- name = new char[strlen(s) + 1];
- strcpy(name, s);
- internalname = 0;
- slant = 0.0;
- // load(); // for testing
-}
-
-font::~font()
-{
- a_delete ch;
- a_delete ch_index;
- if (kern_hash_table) {
- for (int i = 0; i < KERN_HASH_TABLE_SIZE; i++) {
- font_kern_list *kerns = kern_hash_table[i];
- while (kerns) {
- font_kern_list *tem = kerns;
- kerns = kerns->next;
- delete tem;
- }
- }
- a_delete kern_hash_table;
- }
- a_delete name;
- a_delete internalname;
- while (widths_cache) {
- font_widths_cache *tem = widths_cache;
- widths_cache = widths_cache->next;
- delete tem;
- }
-}
-
-static int scale_round(int n, int x, int y)
-{
- assert(x >= 0 && y > 0);
- int y2 = y/2;
- if (x == 0)
- return 0;
- if (n >= 0) {
- if (n <= (INT_MAX - y2)/x)
- return (n*x + y2)/y;
- return int(n*double(x)/double(y) + .5);
- }
- else {
- if (-(unsigned)n <= (-(unsigned)INT_MIN - y2)/x)
- return (n*x - y2)/y;
- return int(n*double(x)/double(y) - .5);
- }
-}
-
-inline int font::scale(int w, int sz)
-{
- return sz == unitwidth ? w : scale_round(w, sz, unitwidth);
-}
-
-int font::get_skew(int c, int point_size, int sl)
-{
- int h = get_height(c, point_size);
- return int(h*tan((slant+sl)*PI/180.0) + .5);
-}
-
-int font::contains(int c)
-{
- return c >= 0 && c < nindices && ch_index[c] >= 0;
-}
-
-int font::is_special()
-{
- return special;
-}
-
-font_widths_cache::font_widths_cache(int ps, int ch_size,
- font_widths_cache *p = 0)
-: next(p), point_size(ps)
-{
- width = new int[ch_size];
- for (int i = 0; i < ch_size; i++)
- width[i] = -1;
-}
-
-font_widths_cache::~font_widths_cache()
-{
- a_delete width;
-}
-
-int font::get_width(int c, int point_size)
-{
- assert(c >= 0 && c < nindices);
- int i = ch_index[c];
- assert(i >= 0);
-
- if (point_size == unitwidth)
- return ch[i].width;
-
- if (!widths_cache)
- widths_cache = new font_widths_cache(point_size, ch_size);
- else if (widths_cache->point_size != point_size) {
- font_widths_cache **p;
- for (p = &widths_cache; *p; p = &(*p)->next)
- if ((*p)->point_size == point_size)
- break;
- if (*p) {
- font_widths_cache *tem = *p;
- *p = (*p)->next;
- tem->next = widths_cache;
- widths_cache = tem;
- }
- else
- widths_cache = new font_widths_cache(point_size, ch_size, widths_cache);
- }
- int &w = widths_cache->width[i];
- if (w < 0)
- w = scale(ch[i].width, point_size);
- return w;
-}
-
-int font::get_height(int c, int point_size)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return scale(ch[ch_index[c]].height, point_size);
-}
-
-int font::get_depth(int c, int point_size)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return scale(ch[ch_index[c]].depth, point_size);
-}
-
-int font::get_italic_correction(int c, int point_size)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return scale(ch[ch_index[c]].italic_correction, point_size);
-}
-
-int font::get_left_italic_correction(int c, int point_size)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return scale(ch[ch_index[c]].pre_math_space, point_size);
-}
-
-int font::get_subscript_correction(int c, int point_size)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return scale(ch[ch_index[c]].subscript_correction, point_size);
-}
-
-int font::get_space_width(int point_size)
-{
- return scale(space_width, point_size);
-}
-
-font_kern_list::font_kern_list(int c1, int c2, int n, font_kern_list *p)
- : i1(c1), i2(c2), amount(n), next(p)
-{
-}
-
-inline int font::hash_kern(int i1, int i2)
-{
- int n = ((i1 << 10) + i2) % KERN_HASH_TABLE_SIZE;
- return n < 0 ? -n : n;
-}
-
-void font::add_kern(int i1, int i2, int amount)
-{
- if (!kern_hash_table) {
- kern_hash_table = new font_kern_list *[KERN_HASH_TABLE_SIZE];
- for (int i = 0; i < KERN_HASH_TABLE_SIZE; i++)
- kern_hash_table[i] = 0;
- }
- font_kern_list **p = kern_hash_table + hash_kern(i1, i2);
- *p = new font_kern_list(i1, i2, amount, *p);
-}
-
-int font::get_kern(int i1, int i2, int point_size)
-{
- if (kern_hash_table) {
- for (font_kern_list *p = kern_hash_table[hash_kern(i1, i2)]; p; p = p->next)
- if (i1 == p->i1 && i2 == p->i2)
- return scale(p->amount, point_size);
- }
- return 0;
-}
-
-int font::has_ligature(int mask)
-{
- return mask & ligatures;
-}
-
-int font::get_character_type(int c)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return ch[ch_index[c]].type;
-}
-
-int font::get_code(int c)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return ch[ch_index[c]].code;
-}
-
-const char *font::get_name()
-{
- return name;
-}
-
-const char *font::get_internal_name()
-{
- return internalname;
-}
-
-const char *font::get_special_device_encoding(int c)
-{
- assert(c >= 0 && c < nindices && ch_index[c] >= 0);
- return( ch[ch_index[c]].special_device_coding );
-}
-
-void font::alloc_ch_index(int index)
-{
- if (nindices == 0) {
- nindices = 128;
- if (index >= nindices)
- nindices = index + 10;
- ch_index = new short[nindices];
- for (int i = 0; i < nindices; i++)
- ch_index[i] = -1;
- }
- else {
- int old_nindices = nindices;
- nindices *= 2;
- if (index >= nindices)
- nindices = index + 10;
- short *old_ch_index = ch_index;
- ch_index = new short[nindices];
- memcpy(ch_index, old_ch_index, sizeof(short)*old_nindices);
- for (int i = old_nindices; i < nindices; i++)
- ch_index[i] = -1;
- a_delete old_ch_index;
- }
-}
-
-void font::extend_ch()
-{
- if (ch == 0)
- ch = new font_char_metric[ch_size = 16];
- else {
- int old_ch_size = ch_size;
- ch_size *= 2;
- font_char_metric *old_ch = ch;
- ch = new font_char_metric[ch_size];
- memcpy(ch, old_ch, old_ch_size*sizeof(font_char_metric));
- a_delete old_ch;
- }
-}
-
-void font::compact()
-{
- int i;
- for (i = nindices - 1; i >= 0; i--)
- if (ch_index[i] >= 0)
- break;
- i++;
- if (i < nindices) {
- short *old_ch_index = ch_index;
- ch_index = new short[i];
- memcpy(ch_index, old_ch_index, i*sizeof(short));
- a_delete old_ch_index;
- nindices = i;
- }
- if (ch_used < ch_size) {
- font_char_metric *old_ch = ch;
- ch = new font_char_metric[ch_used];
- memcpy(ch, old_ch, ch_used*sizeof(font_char_metric));
- a_delete old_ch;
- ch_size = ch_used;
- }
-}
-
-void font::add_entry(int index, const font_char_metric &metric)
-{
- assert(index >= 0);
- if (index >= nindices)
- alloc_ch_index(index);
- assert(index < nindices);
- if (ch_used + 1 >= ch_size)
- extend_ch();
- assert(ch_used + 1 < ch_size);
- ch_index[index] = ch_used;
- ch[ch_used++] = metric;
-}
-
-void font::copy_entry(int new_index, int old_index)
-{
- assert(new_index >= 0 && old_index >= 0 && old_index < nindices);
- if (new_index >= nindices)
- alloc_ch_index(new_index);
- ch_index[new_index] = ch_index[old_index];
-}
-
-font *font::load_font(const char *s, int *not_found)
-{
- font *f = new font(s);
- if (!f->load(not_found)) {
- delete f;
- return 0;
- }
- return f;
-}
-
-static char *trim_arg(char *p)
-{
- if (!p)
- return 0;
- while (csspace(*p))
- p++;
- char *q = strchr(p, '\0');
- while (q > p && csspace(q[-1]))
- q--;
- *q = '\0';
- return p;
-}
-
-// If the font can't be found, then if not_found is non-NULL, it will be set
-// to 1 otherwise a message will be printed.
-
-int font::load(int *not_found)
-{
- char *path;
- FILE *fp;
- if ((fp = open_file(name, &path)) == NULL) {
- if (not_found)
- *not_found = 1;
- else
- error("can't find font file `%1'", name);
- return 0;
- }
- text_file t(fp, path);
- t.skip_comments = 1;
- char *p;
- for (;;) {
- if (!t.next()) {
- t.error("missing charset command");
- return 0;
- }
- p = strtok(t.buf, WS);
- if (strcmp(p, "name") == 0) {
- }
- else if (strcmp(p, "spacewidth") == 0) {
- p = strtok(0, WS);
- int n;
- if (p == 0 || sscanf(p, "%d", &n) != 1 || n <= 0) {
- t.error("bad argument for spacewidth command");
- return 0;
- }
- space_width = n;
- }
- else if (strcmp(p, "slant") == 0) {
- p = strtok(0, WS);
- double n;
- if (p == 0 || sscanf(p, "%lf", &n) != 1 || n >= 90.0 || n <= -90.0) {
- t.error("bad argument for slant command", p);
- return 0;
- }
- slant = n;
- }
- else if (strcmp(p, "ligatures") == 0) {
- for (;;) {
- p = strtok(0, WS);
- if (p == 0 || strcmp(p, "0") == 0)
- break;
- if (strcmp(p, "ff") == 0)
- ligatures |= LIG_ff;
- else if (strcmp(p, "fi") == 0)
- ligatures |= LIG_fi;
- else if (strcmp(p, "fl") == 0)
- ligatures |= LIG_fl;
- else if (strcmp(p, "ffi") == 0)
- ligatures |= LIG_ffi;
- else if (strcmp(p, "ffl") == 0)
- ligatures |= LIG_ffl;
- else {
- t.error("unrecognised ligature `%1'", p);
- return 0;
- }
- }
- }
- else if (strcmp(p, "internalname") == 0) {
- p = strtok(0, WS);
- if (!p) {
- t.error("`internalname command requires argument");
- return 0;
- }
- internalname = new char[strlen(p) + 1];
- strcpy(internalname, p);
- }
- else if (strcmp(p, "special") == 0) {
- special = 1;
- }
- else if (strcmp(p, "kernpairs") != 0 && strcmp(p, "charset") != 0) {
- char *command = p;
- p = strtok(0, "\n");
- handle_unknown_font_command(command, trim_arg(p), t.path, t.lineno);
- }
- else
- break;
- }
- char *command = p;
- int had_charset = 0;
- t.skip_comments = 0;
- while (command) {
- if (strcmp(command, "kernpairs") == 0) {
- for (;;) {
- if (!t.next()) {
- command = 0;
- break;
- }
- char *c1 = strtok(t.buf, WS);
- if (c1 == 0)
- continue;
- char *c2 = strtok(0, WS);
- if (c2 == 0) {
- command = c1;
- break;
- }
- p = strtok(0, WS);
- if (p == 0) {
- t.error("missing kern amount");
- return 0;
- }
- int n;
- if (sscanf(p, "%d", &n) != 1) {
- t.error("bad kern amount `%1'", p);
- return 0;
- }
- int i1 = name_to_index(c1);
- if (i1 < 0) {
- t.error("illegal character `%1'", c1);
- return 0;
- }
- int i2 = name_to_index(c2);
- if (i2 < 0) {
- t.error("illegal character `%1'", c2);
- return 0;
- }
- add_kern(i1, i2, n);
- }
- }
- else if (strcmp(command, "charset") == 0) {
- had_charset = 1;
- int last_index = -1;
- for (;;) {
- if (!t.next()) {
- command = 0;
- break;
- }
- char *nm = strtok(t.buf, WS);
- if (nm == 0)
- continue; // I dont think this should happen
- p = strtok(0, WS);
- if (p == 0) {
- command = nm;
- break;
- }
- if (p[0] == '"') {
- if (last_index == -1) {
- t.error("first charset entry is duplicate");
- return 0;
- }
- if (strcmp(nm, "---") == 0) {
- t.error("unnamed character cannot be duplicate");
- return 0;
- }
- int index = name_to_index(nm);
- if (index < 0) {
- t.error("illegal character `%1'", nm);
- return 0;
- }
- copy_entry(index, last_index);
- }
- else {
- font_char_metric metric;
- metric.height = 0;
- metric.depth = 0;
- metric.pre_math_space = 0;
- metric.italic_correction = 0;
- metric.subscript_correction = 0;
- int nparms = sscanf(p, "%d,%d,%d,%d,%d,%d",
- &metric.width, &metric.height, &metric.depth,
- &metric.italic_correction,
- &metric.pre_math_space,
- &metric.subscript_correction);
- if (nparms < 1) {
- t.error("bad width for `%1'", nm);
- return 0;
- }
- p = strtok(0, WS);
- if (p == 0) {
- t.error("missing character type for `%1'", nm);
- return 0;
- }
- int type;
- if (sscanf(p, "%d", &type) != 1) {
- t.error("bad character type for `%1'", nm);
- return 0;
- }
- if (type < 0 || type > 255) {
- t.error("character code `%1' out of range", type);
- return 0;
- }
- metric.type = type;
- p = strtok(0, WS);
- if (p == 0) {
- t.error("missing code for `%1'", nm);
- return 0;
- }
- char *ptr;
- metric.code = (int)strtol(p, &ptr, 0);
- if (metric.code == 0 && ptr == p) {
- t.error("bad code `%1' for character `%2'", p, nm);
- return 0;
- }
-
- p = strtok(0, WS);
- if ((p == NULL) || (strcmp(p, "--") == 0)) {
- metric.special_device_coding = NULL;
- } else {
- char *name=(char *)malloc(strlen(p)+1);
-
- if (name == NULL) {
- fatal("malloc failed while reading character encoding");
- }
- strcpy(name, p);
- metric.special_device_coding = name;
- }
-
- if (strcmp(nm, "---") == 0) {
- last_index = number_to_index(metric.code);
- add_entry(last_index, metric);
- }
- else {
- last_index = name_to_index(nm);
- if (last_index < 0) {
- t.error("illegal character `%1'", nm);
- return 0;
- }
- add_entry(last_index, metric);
- copy_entry(number_to_index(metric.code), last_index);
- }
- }
- }
- if (last_index == -1) {
- t.error("I didn't seem to find any characters");
- return 0;
- }
- }
- else {
- t.error("unrecognised command `%1' after `kernpairs' or `charset' command", command);
- return 0;
- }
- }
- if (!had_charset) {
- t.error("missing charset command");
- return 0;
- }
- if (space_width == 0)
- space_width = scale_round(unitwidth, res, 72*3*sizescale);
- compact();
- return 1;
-}
-
-static struct {
- const char *command;
- int *ptr;
-} table[] = {
- { "res", &font::res },
- { "hor", &font::hor },
- { "vert", &font::vert },
- { "unitwidth", &font::unitwidth },
- { "paperwidth", &font::paperwidth },
- { "paperlength", &font::paperlength },
- { "spare1", &font::biggestfont },
- { "biggestfont", &font::biggestfont },
- { "spare2", &font::spare2 },
- { "sizescale", &font::sizescale }
- };
-
-
-int font::load_desc()
-{
- int nfonts = 0;
- FILE *fp;
- char *path;
- if ((fp = open_file("DESC", &path)) == 0) {
- error("can't find `DESC' file");
- return 0;
- }
- text_file t(fp, path);
- t.skip_comments = 1;
- res = 0;
- while (t.next()) {
- char *p = strtok(t.buf, WS);
- int found = 0;
- int idx;
- for (idx = 0; !found && idx < sizeof(table)/sizeof(table[0]); idx++)
- if (strcmp(table[idx].command, p) == 0)
- found = 1;
- if (found) {
- char *q = strtok(0, WS);
- if (!q) {
- t.error("missing value for command `%1'", p);
- return 0;
- }
- //int *ptr = &(this->*(table[idx-1].ptr));
- int *ptr = table[idx-1].ptr;
- if (sscanf(q, "%d", ptr) != 1) {
- t.error("bad number `%1'", q);
- return 0;
- }
- }
- else if (strcmp("tcommand", p) == 0) {
- tcommand = 1;
- }
- else if (strcmp("pass_filenames", p) == 0) {
- pass_filenames = 1;
- }
- else if (strcmp("use_charnames_in_special", p) == 0) {
- use_charnames_in_special = 1;
- }
- else if (strcmp("family", p) == 0) {
- p = strtok(0, WS);
- if (!p) {
- t.error("family command requires an argument");
- return 0;
- }
- char *tem = new char[strlen(p)+1];
- strcpy(tem, p);
- family = tem;
- }
- else if (strcmp("fonts", p) == 0) {
- p = strtok(0, WS);
- if (!p || sscanf(p, "%d", &nfonts) != 1 || nfonts <= 0) {
- t.error("bad number of fonts `%1'", p);
- return 0;
- }
- font_name_table = (const char **)new char *[nfonts+1];
- for (int i = 0; i < nfonts; i++) {
- p = strtok(0, WS);
- while (p == 0) {
- if (!t.next()) {
- t.error("end of file while reading list of fonts");
- return 0;
- }
- p = strtok(t.buf, WS);
- }
- char *temp = new char[strlen(p)+1];
- strcpy(temp, p);
- font_name_table[i] = temp;
- }
- p = strtok(0, WS);
- if (p != 0) {
- t.error("font count does not match number of fonts");
- return 0;
- }
- font_name_table[nfonts] = 0;
- }
- else if (strcmp("sizes", p) == 0) {
- int n = 16;
- sizes = new int[n];
- int i = 0;
- for (;;) {
- p = strtok(0, WS);
- while (p == 0) {
- if (!t.next()) {
- t.error("list of sizes must be terminated by `0'");
- return 0;
- }
- p = strtok(t.buf, WS);
- }
- int lower, upper;
- switch (sscanf(p, "%d-%d", &lower, &upper)) {
- case 1:
- upper = lower;
- // fall through
- case 2:
- if (lower <= upper && lower >= 0)
- break;
- // fall through
- default:
- t.error("bad size range `%1'", p);
- return 0;
- }
- if (i + 2 > n) {
- int *old_sizes = sizes;
- sizes = new int[n*2];
- memcpy(sizes, old_sizes, n*sizeof(int));
- n *= 2;
- a_delete old_sizes;
- }
- sizes[i++] = lower;
- if (lower == 0)
- break;
- sizes[i++] = upper;
- }
- if (i == 1) {
- t.error("must have some sizes");
- return 0;
- }
- }
- else if (strcmp("styles", p) == 0) {
- int style_table_size = 5;
- style_table = (const char **)new char *[style_table_size];
- int j;
- for (j = 0; j < style_table_size; j++)
- style_table[j] = 0;
- int i = 0;
- for (;;) {
- p = strtok(0, WS);
- if (p == 0)
- break;
- // leave room for terminating 0
- if (i + 1 >= style_table_size) {
- const char **old_style_table = style_table;
- style_table_size *= 2;
- style_table = (const char **)new char*[style_table_size];
- for (j = 0; j < i; j++)
- style_table[j] = old_style_table[j];
- for (; j < style_table_size; j++)
- style_table[j] = 0;
- a_delete old_style_table;
- }
- char *tem = new char[strlen(p) + 1];
- strcpy(tem, p);
- style_table[i++] = tem;
- }
- }
- else if (strcmp("charset", p) == 0)
- break;
- else if (unknown_desc_command_handler) {
- char *command = p;
- p = strtok(0, "\n");
- (*unknown_desc_command_handler)(command, trim_arg(p), t.path, t.lineno);
- }
- }
- if (res == 0) {
- t.error("missing `res' command");
- return 0;
- }
- if (unitwidth == 0) {
- t.error("missing `unitwidth' command");
- return 0;
- }
- if (font_name_table == 0) {
- t.error("missing `fonts' command");
- return 0;
- }
- if (sizes == 0) {
- t.error("missing `sizes' command");
- return 0;
- }
- if (sizescale < 1) {
- t.error("bad `sizescale' value");
- return 0;
- }
- if (hor < 1) {
- t.error("bad `hor' value");
- return 0;
- }
- if (vert < 1) {
- t.error("bad `vert' value");
- return 0;
- }
- return 1;
-}
-
-void font::handle_unknown_font_command(const char *, const char *,
- const char *, int)
-{
-}
-
-FONT_COMMAND_HANDLER
-font::set_unknown_desc_command_handler(FONT_COMMAND_HANDLER func)
-{
- FONT_COMMAND_HANDLER prev = unknown_desc_command_handler;
- unknown_desc_command_handler = func;
- return prev;
-}
-
diff --git a/contrib/groff/libgroff/fontfile.cc b/contrib/groff/libgroff/fontfile.cc
deleted file mode 100644
index fa87b861f955..000000000000
--- a/contrib/groff/libgroff/fontfile.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-#include "font.h"
-#include "lib.h"
-#include "searchpath.h"
-#include "device.h"
-#include "defs.h"
-
-const char *const FONT_ENV_VAR = "GROFF_FONT_PATH";
-
-static search_path font_path(FONT_ENV_VAR, FONTPATH);
-
-int font::res = 0;
-int font::hor = 1;
-int font::vert = 1;
-int font::unitwidth = 0;
-int font::paperwidth = 0;
-int font::paperlength = 0;
-int font::biggestfont = 0;
-int font::spare2 = 0;
-int font::sizescale = 1;
-int font::tcommand = 0;
-int font::pass_filenames = 0;
-int font::use_charnames_in_special = 0;
-const char **font::font_name_table = 0;
-int *font::sizes = 0;
-const char *font::family = 0;
-const char **font::style_table = 0;
-FONT_COMMAND_HANDLER font::unknown_desc_command_handler = 0;
-
-void font::command_line_font_dir(const char *dir)
-{
- font_path.command_line_dir(dir);
-}
-
-FILE *font::open_file(const char *name, char **pathp)
-{
- char *filename = new char[strlen(name) + strlen(device) + 5];
- sprintf(filename, "dev%s/%s", device, name);
- FILE *fp = font_path.open_file(filename, pathp);
- a_delete filename;
- return fp;
-}
diff --git a/contrib/groff/libgroff/getcwd.c b/contrib/groff/libgroff/getcwd.c
deleted file mode 100644
index 208e81118530..000000000000
--- a/contrib/groff/libgroff/getcwd.c
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Partial emulation of getcwd in terms of getwd. */
-
-#include
-#include
-#include
-#ifndef errno
-extern int errno;
-#endif
-
-char *getwd();
-
-char *getcwd(buf, size)
- char *buf;
- int size; /* POSIX says this should be size_t */
-{
- if (size <= 0) {
- errno = EINVAL;
- return 0;
- }
- else {
- char mybuf[MAXPATHLEN];
- int saved_errno = errno;
-
- errno = 0;
- if (!getwd(mybuf)) {
- if (errno == 0)
- ; /* what to do? */
- return 0;
- }
- errno = saved_errno;
- if (strlen(mybuf) + 1 > size) {
- errno = ERANGE;
- return 0;
- }
- strcpy(buf, mybuf);
- return buf;
- }
-}
diff --git a/contrib/groff/libgroff/getopt.c b/contrib/groff/libgroff/getopt.c
deleted file mode 100644
index 4744e43390ac..000000000000
--- a/contrib/groff/libgroff/getopt.c
+++ /dev/null
@@ -1,1055 +0,0 @@
-/* Getopt for GNU.
- NOTE: getopt is now part of the C library, so if you don't know what
- "Keep this file name-space clean" means, talk to drepper@gnu.org
- before changing it!
-
- Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
- Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-/* This tells Alpha OSF/1 not to define a getopt prototype in .
- Ditto for AIX 3.2 and . */
-#ifndef _NO_PROTO
-# define _NO_PROTO
-#endif
-
-#ifdef HAVE_CONFIG_H
-# include
-#endif
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-# ifndef const
-# define const
-# endif
-#endif
-
-#include
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-# include
-# if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-# define ELIDE_CODE
-# endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-/* Don't include stdlib.h for non-GNU C libraries because some of them
- contain conflicting prototypes for getopt. */
-# include
-# include
-#endif /* GNU C library. */
-
-#ifdef VMS
-# include
-# if HAVE_STRING_H - 0
-# include
-# endif
-#endif
-
-#ifndef _
-/* This is for other GNU distributions with internationalized messages.
- When compiling libc, the _ macro is predefined. */
-# ifdef HAVE_LIBINTL_H
-# include
-# define _(msgid) gettext (msgid)
-# else
-# define _(msgid) (msgid)
-# endif
-#endif
-
-/* This version of `getopt' appears to the caller like standard Unix `getopt'
- but it behaves differently for the user, since it allows the user
- to intersperse the options with the other arguments.
-
- As `getopt' works, it permutes the elements of ARGV so that,
- when it is done, all the options precede everything else. Thus
- all application programs are extended to handle flexible argument order.
-
- Setting the environment variable POSIXLY_CORRECT disables permutation.
- Then the behavior is completely standard.
-
- GNU application programs can use a third alternative mode in which
- they can distinguish the relative order of options and other arguments. */
-
-#include "getopt.h"
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-/* 1003.2 says this must be 1 before any call. */
-int optind = 1;
-
-/* Formerly, initialization of getopt depended on optind==0, which
- causes problems with re-calling getopt as programs generally don't
- know that. */
-
-int __getopt_initialized;
-
-/* The next char to be scanned in the option-element
- in which the last option character we returned was found.
- This allows us to pick up the scan where we left off.
-
- If this is zero, or a null string, it means resume the scan
- by advancing to the next ARGV-element. */
-
-static char *nextchar;
-
-/* Callers store zero here to inhibit the error message
- for unrecognized options. */
-
-int opterr = 1;
-
-/* Set to an option character which was unrecognized.
- This must be initialized on some systems to avoid linking in the
- system's own getopt implementation. */
-
-int optopt = '?';
-
-/* Describe how to deal with options that follow non-option ARGV-elements.
-
- If the caller did not specify anything,
- the default is REQUIRE_ORDER if the environment variable
- POSIXLY_CORRECT is defined, PERMUTE otherwise.
-
- REQUIRE_ORDER means don't recognize them as options;
- stop option processing when the first non-option is seen.
- This is what Unix does.
- This mode of operation is selected by either setting the environment
- variable POSIXLY_CORRECT, or using `+' as the first character
- of the list of option characters.
-
- PERMUTE is the default. We permute the contents of ARGV as we scan,
- so that eventually all the non-options are at the end. This allows options
- to be given in any order, even with programs that were not written to
- expect this.
-
- RETURN_IN_ORDER is an option available to programs that were written
- to expect options and other ARGV-elements in any order and that care about
- the ordering of the two. We describe each non-option ARGV-element
- as if it were the argument of an option with character code 1.
- Using `-' as the first character of the list of option characters
- selects this mode of operation.
-
- The special argument `--' forces an end of option-scanning regardless
- of the value of `ordering'. In the case of RETURN_IN_ORDER, only
- `--' can cause `getopt' to return -1 with `optind' != ARGC. */
-
-static enum
-{
- REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
-} ordering;
-
-/* Value of POSIXLY_CORRECT environment variable. */
-static char *posixly_correct;
-
-#ifdef __GNU_LIBRARY__
-/* We want to avoid inclusion of string.h with non-GNU libraries
- because there are many ways it can cause trouble.
- On some systems, it contains special magic macros that don't work
- in GCC. */
-# include
-# define my_index strchr
-#else
-
-# if HAVE_STRING_H
-# include
-# else
-# include
-# endif
-
-/* Avoid depending on library functions or files
- whose names are inconsistent. */
-
-#ifndef getenv
-extern char *getenv ();
-#endif
-
-static char *
-my_index (str, chr)
- const char *str;
- int chr;
-{
- while (*str)
- {
- if (*str == chr)
- return (char *) str;
- str++;
- }
- return 0;
-}
-
-/* If using GCC, we can safely declare strlen this way.
- If not using GCC, it is ok not to declare it. */
-#ifdef __GNUC__
-/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
- That was relevant to code that was here before. */
-# if (!defined __STDC__ || !__STDC__) && !defined strlen
-/* gcc with -traditional declares the built-in strlen to return int,
- and has done so at least since version 2.4.5. -- rms. */
-extern int strlen (const char *);
-# endif /* not __STDC__ */
-#endif /* __GNUC__ */
-
-#endif /* not __GNU_LIBRARY__ */
-
-/* Handle permutation of arguments. */
-
-/* Describe the part of ARGV that contains non-options that have
- been skipped. `first_nonopt' is the index in ARGV of the first of them;
- `last_nonopt' is the index after the last of them. */
-
-static int first_nonopt;
-static int last_nonopt;
-
-#ifdef _LIBC
-/* Bash 2.0 gives us an environment variable containing flags
- indicating ARGV elements that should not be considered arguments. */
-
-/* Defined in getopt_init.c */
-extern char *__getopt_nonoption_flags;
-
-static int nonoption_flags_max_len;
-static int nonoption_flags_len;
-
-static int original_argc;
-static char *const *original_argv;
-
-/* Make sure the environment variable bash 2.0 puts in the environment
- is valid for the getopt call we must make sure that the ARGV passed
- to getopt is that one passed to the process. */
-static void
-__attribute__ ((unused))
-store_args_and_env (int argc, char *const *argv)
-{
- /* XXX This is no good solution. We should rather copy the args so
- that we can compare them later. But we must not use malloc(3). */
- original_argc = argc;
- original_argv = argv;
-}
-# ifdef text_set_element
-text_set_element (__libc_subinit, store_args_and_env);
-# endif /* text_set_element */
-
-# define SWAP_FLAGS(ch1, ch2) \
- if (nonoption_flags_len > 0) \
- { \
- char __tmp = __getopt_nonoption_flags[ch1]; \
- __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \
- __getopt_nonoption_flags[ch2] = __tmp; \
- }
-#else /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif /* _LIBC */
-
-/* Exchange two adjacent subsequences of ARGV.
- One subsequence is elements [first_nonopt,last_nonopt)
- which contains all the non-options that have been skipped so far.
- The other is elements [last_nonopt,optind), which contains all
- the options processed since those non-options were skipped.
-
- `first_nonopt' and `last_nonopt' are relocated so that they describe
- the new indices of the non-options in ARGV after they are moved. */
-
-#if defined __STDC__ && __STDC__
-static void exchange (char **);
-#endif
-
-static void
-exchange (argv)
- char **argv;
-{
- int bottom = first_nonopt;
- int middle = last_nonopt;
- int top = optind;
- char *tem;
-
- /* Exchange the shorter segment with the far end of the longer segment.
- That puts the shorter segment into the right place.
- It leaves the longer segment in the right place overall,
- but it consists of two parts that need to be swapped next. */
-
-#ifdef _LIBC
- /* First make sure the handling of the `__getopt_nonoption_flags'
- string can work normally. Our top argument must be in the range
- of the string. */
- if (nonoption_flags_len > 0 && top >= nonoption_flags_max_len)
- {
- /* We must extend the array. The user plays games with us and
- presents new arguments. */
- char *new_str = malloc (top + 1);
- if (new_str == NULL)
- nonoption_flags_len = nonoption_flags_max_len = 0;
- else
- {
- memset (__mempcpy (new_str, __getopt_nonoption_flags,
- nonoption_flags_max_len),
- '\0', top + 1 - nonoption_flags_max_len);
- nonoption_flags_max_len = top + 1;
- __getopt_nonoption_flags = new_str;
- }
- }
-#endif
-
- while (top > middle && middle > bottom)
- {
- if (top - middle > middle - bottom)
- {
- /* Bottom segment is the short one. */
- int len = middle - bottom;
- register int i;
-
- /* Swap it with the top part of the top segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[top - (middle - bottom) + i];
- argv[top - (middle - bottom) + i] = tem;
- SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
- }
- /* Exclude the moved bottom segment from further swapping. */
- top -= len;
- }
- else
- {
- /* Top segment is the short one. */
- int len = top - middle;
- register int i;
-
- /* Swap it with the bottom part of the bottom segment. */
- for (i = 0; i < len; i++)
- {
- tem = argv[bottom + i];
- argv[bottom + i] = argv[middle + i];
- argv[middle + i] = tem;
- SWAP_FLAGS (bottom + i, middle + i);
- }
- /* Exclude the moved top segment from further swapping. */
- bottom += len;
- }
- }
-
- /* Update records for the slots the non-options now occupy. */
-
- first_nonopt += (optind - last_nonopt);
- last_nonopt = optind;
-}
-
-/* Initialize the internal data when the first call is made. */
-
-#if defined __STDC__ && __STDC__
-static const char *_getopt_initialize (int, char *const *, const char *);
-#endif
-static const char *
-_getopt_initialize (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- /* Start processing options with ARGV-element 1 (since ARGV-element 0
- is the program name); the sequence of previously skipped
- non-option ARGV-elements is empty. */
-
- first_nonopt = last_nonopt = optind;
-
- nextchar = NULL;
-
- posixly_correct = getenv ("POSIXLY_CORRECT");
-
- /* Determine how to handle the ordering of options and nonoptions. */
-
- if (optstring[0] == '-')
- {
- ordering = RETURN_IN_ORDER;
- ++optstring;
- }
- else if (optstring[0] == '+')
- {
- ordering = REQUIRE_ORDER;
- ++optstring;
- }
- else if (posixly_correct != NULL)
- ordering = REQUIRE_ORDER;
- else
- ordering = PERMUTE;
-
-#ifdef _LIBC
- if (posixly_correct == NULL
- && argc == original_argc && argv == original_argv)
- {
- if (nonoption_flags_max_len == 0)
- {
- if (__getopt_nonoption_flags == NULL
- || __getopt_nonoption_flags[0] == '\0')
- nonoption_flags_max_len = -1;
- else
- {
- const char *orig_str = __getopt_nonoption_flags;
- int len = nonoption_flags_max_len = strlen (orig_str);
- if (nonoption_flags_max_len < argc)
- nonoption_flags_max_len = argc;
- __getopt_nonoption_flags =
- (char *) malloc (nonoption_flags_max_len);
- if (__getopt_nonoption_flags == NULL)
- nonoption_flags_max_len = -1;
- else
- memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
- '\0', nonoption_flags_max_len - len);
- }
- }
- nonoption_flags_len = nonoption_flags_max_len;
- }
- else
- nonoption_flags_len = 0;
-#endif
-
- return optstring;
-}
-
-/* Scan elements of ARGV (whose length is ARGC) for option characters
- given in OPTSTRING.
-
- If an element of ARGV starts with '-', and is not exactly "-" or "--",
- then it is an option element. The characters of this element
- (aside from the initial '-') are option characters. If `getopt'
- is called repeatedly, it returns successively each of the option characters
- from each of the option elements.
-
- If `getopt' finds another option character, it returns that character,
- updating `optind' and `nextchar' so that the next call to `getopt' can
- resume the scan with the following option character or ARGV-element.
-
- If there are no more option characters, `getopt' returns -1.
- Then `optind' is the index in ARGV of the first ARGV-element
- that is not an option. (The ARGV-elements have been permuted
- so that those that are not options now come last.)
-
- OPTSTRING is a string containing the legitimate option characters.
- If an option character is seen that is not listed in OPTSTRING,
- return '?' after printing an error message. If you set `opterr' to
- zero, the error message is suppressed but we still return '?'.
-
- If a char in OPTSTRING is followed by a colon, that means it wants an arg,
- so the following text in the same ARGV-element, or the text of the following
- ARGV-element, is returned in `optarg'. Two colons mean an option that
- wants an optional arg; if there is text in the current ARGV-element,
- it is returned in `optarg', otherwise `optarg' is set to zero.
-
- If OPTSTRING starts with `-' or `+', it requests different methods of
- handling the non-option ARGV-elements.
- See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
-
- Long-named options begin with `--' instead of `-'.
- Their names may be abbreviated as long as the abbreviation is unique
- or is an exact match for some defined option. If they have an
- argument, it follows the option name in the same ARGV-element, separated
- from the option name by a `=', or else the in next ARGV-element.
- When `getopt' finds a long-named option, it returns 0 if that option's
- `flag' field is nonzero, the value of the option's `val' field
- if the `flag' field is zero.
-
- The elements of ARGV aren't really const, because we permute them.
- But we pretend they're const in the prototype to be compatible
- with other systems.
-
- LONGOPTS is a vector of `struct option' terminated by an
- element containing a name which is zero.
-
- LONGIND returns the index in LONGOPT of the long-named option found.
- It is only valid when a long-named option has been found by the most
- recent call.
-
- If LONG_ONLY is nonzero, '-' as well as '--' can introduce
- long-named options. */
-
-int
-_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
- int argc;
- char *const *argv;
- const char *optstring;
- const struct option *longopts;
- int *longind;
- int long_only;
-{
- int print_errors = opterr;
- if (optstring[0] == ':')
- print_errors = 0;
-
- optarg = NULL;
-
- if (optind == 0 || !__getopt_initialized)
- {
- if (optind == 0)
- optind = 1; /* Don't scan ARGV[0], the program name. */
- optstring = _getopt_initialize (argc, argv, optstring);
- __getopt_initialized = 1;
- }
-
- /* Test whether ARGV[optind] points to a non-option argument.
- Either it does not have option syntax, or there is an environment flag
- from the shell indicating it is not an option. The later information
- is only used when the used in the GNU libc. */
-#ifdef _LIBC
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0' \
- || (optind < nonoption_flags_len \
- && __getopt_nonoption_flags[optind] == '1'))
-#else
-# define NONOPTION_P (argv[optind][0] != '-' || argv[optind][1] == '\0')
-#endif
-
- if (nextchar == NULL || *nextchar == '\0')
- {
- /* Advance to the next ARGV-element. */
-
- /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
- moved back by the user (who may also have changed the arguments). */
- if (last_nonopt > optind)
- last_nonopt = optind;
- if (first_nonopt > optind)
- first_nonopt = optind;
-
- if (ordering == PERMUTE)
- {
- /* If we have just processed some options following some non-options,
- exchange them so that the options come first. */
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (last_nonopt != optind)
- first_nonopt = optind;
-
- /* Skip any additional non-options
- and extend the range of non-options previously skipped. */
-
- while (optind < argc && NONOPTION_P)
- optind++;
- last_nonopt = optind;
- }
-
- /* The special ARGV-element `--' means premature end of options.
- Skip it like a null option,
- then exchange with previous non-options as if it were an option,
- then skip everything else like a non-option. */
-
- if (optind != argc && !strcmp (argv[optind], "--"))
- {
- optind++;
-
- if (first_nonopt != last_nonopt && last_nonopt != optind)
- exchange ((char **) argv);
- else if (first_nonopt == last_nonopt)
- first_nonopt = optind;
- last_nonopt = argc;
-
- optind = argc;
- }
-
- /* If we have done all the ARGV-elements, stop the scan
- and back over any non-options that we skipped and permuted. */
-
- if (optind == argc)
- {
- /* Set the next-arg-index to point at the non-options
- that we previously skipped, so the caller will digest them. */
- if (first_nonopt != last_nonopt)
- optind = first_nonopt;
- return -1;
- }
-
- /* If we have come to a non-option and did not permute it,
- either stop the scan or describe it to the caller and pass it by. */
-
- if (NONOPTION_P)
- {
- if (ordering == REQUIRE_ORDER)
- return -1;
- optarg = argv[optind++];
- return 1;
- }
-
- /* We have found another option-ARGV-element.
- Skip the initial punctuation. */
-
- nextchar = (argv[optind] + 1
- + (longopts != NULL && argv[optind][1] == '-'));
- }
-
- /* Decode the current option-ARGV-element. */
-
- /* Check whether the ARGV-element is a long option.
-
- If long_only and the ARGV-element has the form "-f", where f is
- a valid short option, don't consider it an abbreviated form of
- a long option that starts with f. Otherwise there would be no
- way to give the -f short option.
-
- On the other hand, if there's a long option "fubar" and
- the ARGV-element is "-fu", do consider that an abbreviation of
- the long option, just like "--fu", and not "-f" with arg "u".
-
- This distinction seems to be the most useful approach. */
-
- if (longopts != NULL
- && (argv[optind][1] == '-'
- || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = -1;
- int option_index;
-
- for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar)
- == (unsigned int) strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
-
- if (ambig && !exact)
- {
- if (print_errors)
- fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- optopt = 0;
- return '?';
- }
-
- if (pfound != NULL)
- {
- option_index = indfound;
- optind++;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (print_errors)
- {
- if (argv[optind - 1][1] == '-')
- /* --option */
- fprintf (stderr,
- _("%s: option `--%s' doesn't allow an argument\n"),
- argv[0], pfound->name);
- else
- /* +option or -option */
- fprintf (stderr,
- _("%s: option `%c%s' doesn't allow an argument\n"),
- argv[0], argv[optind - 1][0], pfound->name);
- }
-
- nextchar += strlen (nextchar);
-
- optopt = pfound->val;
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (print_errors)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- optopt = pfound->val;
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
-
- /* Can't find it as a long option. If this is not getopt_long_only,
- or the option starts with '--' or is not a valid short
- option, then it's an error.
- Otherwise interpret it as a short option. */
- if (!long_only || argv[optind][1] == '-'
- || my_index (optstring, *nextchar) == NULL)
- {
- if (print_errors)
- {
- if (argv[optind][1] == '-')
- /* --option */
- fprintf (stderr, _("%s: unrecognized option `--%s'\n"),
- argv[0], nextchar);
- else
- /* +option or -option */
- fprintf (stderr, _("%s: unrecognized option `%c%s'\n"),
- argv[0], argv[optind][0], nextchar);
- }
- nextchar = (char *) "";
- optind++;
- optopt = 0;
- return '?';
- }
- }
-
- /* Look at and handle the next short option-character. */
-
- {
- char c = *nextchar++;
- char *temp = my_index (optstring, c);
-
- /* Increment `optind' when we start to process its last character. */
- if (*nextchar == '\0')
- ++optind;
-
- if (temp == NULL || c == ':')
- {
- if (print_errors)
- {
- if (posixly_correct)
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: illegal option -- %c\n"),
- argv[0], c);
- else
- fprintf (stderr, _("%s: invalid option -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- return '?';
- }
- /* Convenience. Treat POSIX -W foo same as long option --foo */
- if (temp[0] == 'W' && temp[1] == ';')
- {
- char *nameend;
- const struct option *p;
- const struct option *pfound = NULL;
- int exact = 0;
- int ambig = 0;
- int indfound = 0;
- int option_index;
-
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (print_errors)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr, _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- return c;
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
-
- /* optarg is now the argument, see if it's in the
- table of longopts. */
-
- for (nextchar = nameend = optarg; *nameend && *nameend != '='; nameend++)
- /* Do nothing. */ ;
-
- /* Test all long options for either exact match
- or abbreviated matches. */
- for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!strncmp (p->name, nextchar, nameend - nextchar))
- {
- if ((unsigned int) (nameend - nextchar) == strlen (p->name))
- {
- /* Exact match found. */
- pfound = p;
- indfound = option_index;
- exact = 1;
- break;
- }
- else if (pfound == NULL)
- {
- /* First nonexact match found. */
- pfound = p;
- indfound = option_index;
- }
- else
- /* Second or later nonexact match found. */
- ambig = 1;
- }
- if (ambig && !exact)
- {
- if (print_errors)
- fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
- argv[0], argv[optind]);
- nextchar += strlen (nextchar);
- optind++;
- return '?';
- }
- if (pfound != NULL)
- {
- option_index = indfound;
- if (*nameend)
- {
- /* Don't test has_arg with >, because some C compilers don't
- allow it to be used on enums. */
- if (pfound->has_arg)
- optarg = nameend + 1;
- else
- {
- if (print_errors)
- fprintf (stderr, _("\
-%s: option `-W %s' doesn't allow an argument\n"),
- argv[0], pfound->name);
-
- nextchar += strlen (nextchar);
- return '?';
- }
- }
- else if (pfound->has_arg == 1)
- {
- if (optind < argc)
- optarg = argv[optind++];
- else
- {
- if (print_errors)
- fprintf (stderr,
- _("%s: option `%s' requires an argument\n"),
- argv[0], argv[optind - 1]);
- nextchar += strlen (nextchar);
- return optstring[0] == ':' ? ':' : '?';
- }
- }
- nextchar += strlen (nextchar);
- if (longind != NULL)
- *longind = option_index;
- if (pfound->flag)
- {
- *(pfound->flag) = pfound->val;
- return 0;
- }
- return pfound->val;
- }
- nextchar = NULL;
- return 'W'; /* Let the application handle it. */
- }
- if (temp[1] == ':')
- {
- if (temp[2] == ':')
- {
- /* This is an option that accepts an argument optionally. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- optind++;
- }
- else
- optarg = NULL;
- nextchar = NULL;
- }
- else
- {
- /* This is an option that requires an argument. */
- if (*nextchar != '\0')
- {
- optarg = nextchar;
- /* If we end this ARGV-element by taking the rest as an arg,
- we must advance to the next element now. */
- optind++;
- }
- else if (optind == argc)
- {
- if (print_errors)
- {
- /* 1003.2 specifies the format of this message. */
- fprintf (stderr,
- _("%s: option requires an argument -- %c\n"),
- argv[0], c);
- }
- optopt = c;
- if (optstring[0] == ':')
- c = ':';
- else
- c = '?';
- }
- else
- /* We already incremented `optind' once;
- increment it again when taking next ARGV-elt as argument. */
- optarg = argv[optind++];
- nextchar = NULL;
- }
- }
- return c;
- }
-}
-
-int
-getopt (argc, argv, optstring)
- int argc;
- char *const *argv;
- const char *optstring;
-{
- return _getopt_internal (argc, argv, optstring,
- (const struct option *) 0,
- (int *) 0,
- 0);
-}
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-/* Compile with -DTEST to make an executable for use in testing
- the above definition of `getopt'. */
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
-
- c = getopt (argc, argv, "abc:d:0123456789");
- if (c == -1)
- break;
-
- switch (c)
- {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/contrib/groff/libgroff/getopt1.c b/contrib/groff/libgroff/getopt1.c
deleted file mode 100644
index 3d264f2db4d5..000000000000
--- a/contrib/groff/libgroff/getopt1.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/* getopt_long and getopt_long_only entry points for GNU getopt.
- Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
- Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifdef HAVE_CONFIG_H
-#include
-#endif
-
-#include "getopt.h"
-
-#if !defined __STDC__ || !__STDC__
-/* This is a separate conditional since some stdc systems
- reject `defined (const)'. */
-#ifndef const
-#define const
-#endif
-#endif
-
-#include
-
-/* Comment out all this code if we are using the GNU C Library, and are not
- actually compiling the library itself. This code is part of the GNU C
- Library, but also included in many other GNU distributions. Compiling
- and linking in this code is a waste when using the GNU C library
- (especially if it is a shared library). Rather than having every GNU
- program understand `configure --with-gnu-libc' and omit the object files,
- it is simpler to just do this in the source for each such file. */
-
-#define GETOPT_INTERFACE_VERSION 2
-#if !defined _LIBC && defined __GLIBC__ && __GLIBC__ >= 2
-#include
-#if _GNU_GETOPT_INTERFACE_VERSION == GETOPT_INTERFACE_VERSION
-#define ELIDE_CODE
-#endif
-#endif
-
-#ifndef ELIDE_CODE
-
-
-/* This needs to come after some library #include
- to get __GNU_LIBRARY__ defined. */
-#ifdef __GNU_LIBRARY__
-#include
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-int
-getopt_long (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
-}
-
-/* Like getopt_long, but '-' as well as '--' can indicate a long option.
- If an option that starts with '-' (not '--') doesn't match a long option,
- but does match a short option, it is parsed as a short option
- instead. */
-
-int
-getopt_long_only (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
-{
- return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
-}
-
-
-#endif /* Not ELIDE_CODE. */
-
-#ifdef TEST
-
-#include
-
-int
-main (argc, argv)
- int argc;
- char **argv;
-{
- int c;
- int digit_optind = 0;
-
- while (1)
- {
- int this_option_optind = optind ? optind : 1;
- int option_index = 0;
- static struct option long_options[] =
- {
- {"add", 1, 0, 0},
- {"append", 0, 0, 0},
- {"delete", 1, 0, 0},
- {"verbose", 0, 0, 0},
- {"create", 0, 0, 0},
- {"file", 1, 0, 0},
- {0, 0, 0, 0}
- };
-
- c = getopt_long (argc, argv, "abc:d:0123456789",
- long_options, &option_index);
- if (c == -1)
- break;
-
- switch (c)
- {
- case 0:
- printf ("option %s", long_options[option_index].name);
- if (optarg)
- printf (" with arg %s", optarg);
- printf ("\n");
- break;
-
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- if (digit_optind != 0 && digit_optind != this_option_optind)
- printf ("digits occur in two different argv-elements.\n");
- digit_optind = this_option_optind;
- printf ("option %c\n", c);
- break;
-
- case 'a':
- printf ("option a\n");
- break;
-
- case 'b':
- printf ("option b\n");
- break;
-
- case 'c':
- printf ("option c with value `%s'\n", optarg);
- break;
-
- case 'd':
- printf ("option d with value `%s'\n", optarg);
- break;
-
- case '?':
- break;
-
- default:
- printf ("?? getopt returned character code 0%o ??\n", c);
- }
- }
-
- if (optind < argc)
- {
- printf ("non-option ARGV-elements: ");
- while (optind < argc)
- printf ("%s ", argv[optind++]);
- printf ("\n");
- }
-
- exit (0);
-}
-
-#endif /* TEST */
diff --git a/contrib/groff/libgroff/htmlindicate.cc b/contrib/groff/libgroff/htmlindicate.cc
deleted file mode 100644
index 91e53a26b5ed..000000000000
--- a/contrib/groff/libgroff/htmlindicate.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by Gaius Mulley (gaius@glam.ac.uk)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-
-#include "posix.h"
-#include "stringclass.h"
-
-/*
- * this file contains a very simple set of routines shared by
- * tbl, pic, eqn which help the html device driver to make
- * sensible formatting choices. Currently it simply indicates
- * when a region of gyphs should be rendered as an image rather
- * than html. In the future it should be expanded so to enable:
- *
- * tbl to inform grohtml about table widths.
- * troff to inform grohtml about tab positions and whether
- * we are entering two/three column mode.
- */
-
-
-static int is_in_graphic_start = 0;
-
-/*
- * graphic_start - emit a html graphic start indicator, but only
- * if one has not already been issued.
- */
-
-void graphic_start (void)
-{
- if (! is_in_graphic_start) {
- put_string(".if '\\*(.T'html' \\X(graphic-start(\\c\n", stdout);
- is_in_graphic_start = 1;
- }
-}
-
-/*
- * graphic_end - emit a html graphic end indicator, but only
- * if a corresponding matching graphic-start has
- * been issued.
- */
-
-void graphic_end (void)
-{
- if (is_in_graphic_start) {
- put_string(".if '\\*(.T'html' \\X(graphic-end(\\c\n", stdout);
- is_in_graphic_start = 0;
- }
-}
diff --git a/contrib/groff/libgroff/iftoa.c b/contrib/groff/libgroff/iftoa.c
deleted file mode 100644
index fa108337054d..000000000000
--- a/contrib/groff/libgroff/iftoa.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define INT_DIGITS 19 /* enough for 64-bit integer */
-
-char *if_to_a(i, decimal_point)
- int i, decimal_point;
-{
- /* room for a -, INT_DIGITS digits, a decimal point, and a terminating '\0' */
- static char buf[INT_DIGITS + 3];
- char *p = buf + INT_DIGITS + 2;
- int point = 0;
- buf[INT_DIGITS + 2] = '\0';
- /* assert(decimal_point <= INT_DIGITS); */
- if (i >= 0) {
- do {
- *--p = '0' + (i % 10);
- i /= 10;
- if (++point == decimal_point)
- *--p = '.';
- } while (i != 0 || point < decimal_point);
- }
- else { /* i < 0 */
- do {
- *--p = '0' - (i % 10);
- i /= 10;
- if (++point == decimal_point)
- *--p = '.';
- } while (i != 0 || point < decimal_point);
- *--p = '-';
- }
- if (decimal_point > 0) {
- char *q;
- /* there must be a dot, so this will terminate */
- for (q = buf + INT_DIGITS + 2; q[-1] == '0'; --q)
- ;
- if (q[-1] == '.') {
- if (q - 1 == p) {
- q[-1] = '0';
- q[0] = '\0';
- }
- else
- q[-1] = '\0';
- }
- else
- *q = '\0';
- }
- return p;
-}
diff --git a/contrib/groff/libgroff/illegal.cc b/contrib/groff/libgroff/illegal.cc
deleted file mode 100644
index c1bdbc507966..000000000000
--- a/contrib/groff/libgroff/illegal.cc
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "lib.h"
-
-// Table of illegal input characters.
-
-char illegal_char_table[256]= {
-#ifndef IS_EBCDIC_HOST
- 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-#else
- 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-#endif
-};
diff --git a/contrib/groff/libgroff/itoa.c b/contrib/groff/libgroff/itoa.c
deleted file mode 100644
index c811c7655249..000000000000
--- a/contrib/groff/libgroff/itoa.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#define INT_DIGITS 19 /* enough for 64 bit integer */
-
-char *i_to_a(i)
- int i;
-{
- /* Room for INT_DIGITS digits, - and '\0' */
- static char buf[INT_DIGITS + 2];
- char *p = buf + INT_DIGITS + 1; /* points to terminating '\0' */
- if (i >= 0) {
- do {
- *--p = '0' + (i % 10);
- i /= 10;
- } while (i != 0);
- return p;
- }
- else { /* i < 0 */
- do {
- *--p = '0' - (i % 10);
- i /= 10;
- } while (i != 0);
- *--p = '-';
- }
- return p;
-}
diff --git a/contrib/groff/libgroff/lf.cc b/contrib/groff/libgroff/lf.cc
deleted file mode 100644
index 34272c7d03d0..000000000000
--- a/contrib/groff/libgroff/lf.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include "cset.h"
-#include "stringclass.h"
-
-extern void change_filename(const char *);
-extern void change_lineno(int);
-
-int interpret_lf_args(const char *p)
-{
- while (*p == ' ')
- p++;
- if (!csdigit(*p))
- return 0;
- int ln = 0;
- do {
- ln *= 10;
- ln += *p++ - '0';
- } while (csdigit(*p));
- if (*p != ' ' && *p != '\n' && *p != '\0')
- return 0;
- while (*p == ' ')
- p++;
- if (*p == '\0' || *p == '\n') {
- change_lineno(ln);
- return 1;
- }
- const char *q;
- for (q = p;
- *q != '\0' && *q != ' ' && *q != '\n' && *q != '\\';
- q++)
- ;
- string tem(p, q - p);
- while (*q == ' ')
- q++;
- if (*q != '\n' && *q != '\0')
- return 0;
- tem += '\0';
- change_filename(tem.contents());
- change_lineno(ln);
- return 1;
-}
diff --git a/contrib/groff/libgroff/lineno.cc b/contrib/groff/libgroff/lineno.cc
deleted file mode 100644
index f7138dba0210..000000000000
--- a/contrib/groff/libgroff/lineno.cc
+++ /dev/null
@@ -1 +0,0 @@
-int current_lineno = 0;
diff --git a/contrib/groff/libgroff/macropath.cc b/contrib/groff/libgroff/macropath.cc
deleted file mode 100644
index 4fd22a30a5b5..000000000000
--- a/contrib/groff/libgroff/macropath.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "lib.h"
-#include "searchpath.h"
-#include "macropath.h"
-#include "defs.h"
-
-#define MACROPATH_ENVVAR "GROFF_TMAC_PATH"
-
-search_path macro_path(MACROPATH_ENVVAR, MACROPATH);
diff --git a/contrib/groff/libgroff/matherr.c b/contrib/groff/libgroff/matherr.c
deleted file mode 100644
index b0097b8b5559..000000000000
--- a/contrib/groff/libgroff/matherr.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-
-#ifdef HAVE_STRUCT_EXCEPTION
-#ifdef TLOSS
-
-int matherr(exc)
-struct exception *exc;
-{
- switch (exc->type) {
- case SING:
- case DOMAIN:
- errno = EDOM;
- break;
- case OVERFLOW:
- case UNDERFLOW:
- case TLOSS:
- case PLOSS:
- errno = ERANGE;
- break;
- }
- return 1;
-}
-
-#endif /* TLOSS */
-#endif /* HAVE_STRUCT_EXCEPTION */
diff --git a/contrib/groff/libgroff/nametoindex.cc b/contrib/groff/libgroff/nametoindex.cc
deleted file mode 100644
index 39a7b697a5a1..000000000000
--- a/contrib/groff/libgroff/nametoindex.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-#include "font.h"
-#include "ptable.h"
-
-declare_ptable(int)
-implement_ptable(int)
-
-class character_indexer {
-public:
- character_indexer();
- ~character_indexer();
- int ascii_char_index(unsigned char);
- int named_char_index(const char *);
- int numbered_char_index(int);
-private:
- enum { NSMALL = 256 };
- int next_index;
- int ascii_index[256];
- int small_number_index[NSMALL];
- PTABLE(int) table;
- int lookup_char(const char *, int);
-};
-
-character_indexer::character_indexer()
-: next_index(0)
-{
- int i;
- for (i = 0; i < 256; i++)
- ascii_index[i] = -1;
- for (i = 0; i < NSMALL; i++)
- small_number_index[i] = -1;
-}
-
-character_indexer::~character_indexer()
-{
-}
-
-int character_indexer::ascii_char_index(unsigned char c)
-{
- if (ascii_index[c] < 0)
- ascii_index[c] = next_index++;
- return ascii_index[c];
-}
-
-int character_indexer::numbered_char_index(int n)
-{
- if (n >= 0 && n < NSMALL) {
- if (small_number_index[n] < 0)
- small_number_index[n] = next_index++;
- return small_number_index[n];
- }
- // Not the most efficient possible implementation.
- char buf[INT_DIGITS + 3];
- buf[0] = ' ';
- strcpy(buf + 1, i_to_a(n));
- return named_char_index(buf);
-}
-
-int character_indexer::named_char_index(const char *s)
-{
- int *np = table.lookup(s);
- if (!np) {
- np = new int;
- *np = next_index++;
- table.define(s, np);
- }
- return *np;
-}
-
-static character_indexer indexer;
-
-int font::number_to_index(int n)
-{
- return indexer.numbered_char_index(n);
-}
-
-int font::name_to_index(const char *s)
-{
- assert(s != 0 && s[0] != '\0' && s[0] != ' ');
- if (s[1] == '\0')
- return indexer.ascii_char_index(s[0]);
- /* char128 and \200 are synonyms */
- if (s[0] == 'c' && s[1] == 'h' && s[2] == 'a' && s[3] == 'r') {
- char *res;
- long n = strtol(s + 4, &res, 10);
- if (res != s + 4 && *res == '\0' && n >= 0 && n < 256)
- return indexer.ascii_char_index((unsigned char)n);
- }
- return indexer.named_char_index(s);
-}
-
diff --git a/contrib/groff/libgroff/new.cc b/contrib/groff/libgroff/new.cc
deleted file mode 100644
index d26db2f5a38b..000000000000
--- a/contrib/groff/libgroff/new.cc
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-
-#include "posix.h"
-
-extern const char *program_name;
-
-static void ewrite(const char *s)
-{
- write(2, s, strlen(s));
-}
-
-void *operator new(size_t size)
-{
- // Avoid relying on the behaviour of malloc(0).
- if (size == 0)
- size++;
-#ifdef COOKIE_BUG
- char *p = (char *)malloc(unsigned(size + 8));
-#else /* not COOKIE_BUG */
- char *p = (char *)malloc(unsigned(size));
-#endif /* not COOKIE_BUG */
- if (p == 0) {
- if (program_name) {
- ewrite(program_name);
- ewrite(": ");
- }
- ewrite("out of memory\n");
- _exit(-1);
- }
-#ifdef COOKIE_BUG
- ((unsigned *)p)[1] = 0;
- return p + 8;
-#else /* not COOKIE_BUG */
- return p;
-#endif /* not COOKIE_BUG */
-}
-
-#ifdef COOKIE_BUG
-
-void operator delete(void *p)
-{
- if (p)
- free((void *)((char *)p - 8));
-}
-
-#endif /* COOKIE_BUG */
diff --git a/contrib/groff/libgroff/prime.cc b/contrib/groff/libgroff/prime.cc
deleted file mode 100644
index f0b1eadcc68b..000000000000
--- a/contrib/groff/libgroff/prime.cc
+++ /dev/null
@@ -1,26 +0,0 @@
-#include
-
-int is_prime(unsigned n)
-{
- if (n <= 3)
- return 1;
- if (!(n & 1))
- return 0;
- if (n % 3 == 0)
- return 0;
- unsigned lim = unsigned(sqrt((double)n));
- unsigned d = 5;
- for (;;) {
- if (d > lim)
- break;
- if (n % d == 0)
- return 0;
- d += 2;
- if (d > lim)
- break;
- if (n % d == 0)
- return 0;
- d += 4;
- }
- return 1;
-}
diff --git a/contrib/groff/libgroff/progname.cc b/contrib/groff/libgroff/progname.cc
deleted file mode 100644
index a70e3419c2be..000000000000
--- a/contrib/groff/libgroff/progname.cc
+++ /dev/null
@@ -1 +0,0 @@
-const char *program_name = 0;
diff --git a/contrib/groff/libgroff/ptable.cc b/contrib/groff/libgroff/ptable.cc
deleted file mode 100644
index 76735c2426de..000000000000
--- a/contrib/groff/libgroff/ptable.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "ptable.h"
-#include "errarg.h"
-#include "error.h"
-
-unsigned long hash_string(const char *s)
-{
- assert(s != 0);
- unsigned long h = 0, g;
- while (*s != 0) {
- h <<= 4;
- h += *s++;
- if ((g = h & 0xf0000000) != 0) {
- h ^= g >> 24;
- h ^= g;
- }
- }
- return h;
-}
-
-static const unsigned table_sizes[] = {
-101, 503, 1009, 2003, 3001, 4001, 5003, 10007, 20011, 40009,
-80021, 160001, 500009, 1000003, 2000003, 4000037, 8000009,
-16000057, 32000011, 64000031, 128000003, 0
-};
-
-unsigned next_ptable_size(unsigned n)
-{
- const unsigned *p;
- for (p = table_sizes; *p <= n; p++)
- if (*p == 0)
- fatal("cannot expand table");
- return *p;
-}
diff --git a/contrib/groff/libgroff/putenv.c b/contrib/groff/libgroff/putenv.c
deleted file mode 100644
index c1ca671ae89f..000000000000
--- a/contrib/groff/libgroff/putenv.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Copyright (C) 1991 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
-
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
-
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
-
-/* Hacked slightly by jjc@jclark.com for groff. */
-
-#include
-
-#ifdef __STDC__
-#include
-typedef void *PTR;
-typedef size_t SIZE_T;
-#else /* not __STDC__ */
-typedef char *PTR;
-typedef int SIZE_T;
-#endif /* not __STDC__ */
-
-#ifdef HAVE_STDLIB_H
-#include
-#else /* not HAVE_STDLIB_H */
-PTR malloc();
-#endif /* not HAVE_STDLIB_H */
-
-#ifndef NULL
-#define NULL 0
-#endif
-
-extern char **environ;
-
-/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
-
-int putenv(const char *string)
-{
- char *name_end = strchr(string, '=');
- SIZE_T size;
- char **ep;
-
- if (name_end == NULL)
- {
- /* Remove the variable from the environment. */
- size = strlen(string);
- for (ep = environ; *ep != NULL; ++ep)
- if (!strncmp(*ep, string, size) && (*ep)[size] == '=')
- {
- while (ep[1] != NULL)
- {
- ep[0] = ep[1];
- ++ep;
- }
- *ep = NULL;
- return 0;
- }
- }
-
- size = 0;
- for (ep = environ; *ep != NULL; ++ep)
- if (!strncmp(*ep, string, name_end - string)
- && (*ep)[name_end - string] == '=')
- break;
- else
- ++size;
-
- if (*ep == NULL)
- {
- static char **last_environ = NULL;
- char **new_environ = (char **) malloc((size + 2) * sizeof(char *));
- if (new_environ == NULL)
- return -1;
- (void) memcpy((PTR) new_environ, (PTR) environ, size * sizeof(char *));
- new_environ[size] = (char *) string;
- new_environ[size + 1] = NULL;
- if (last_environ != NULL)
- free((PTR) last_environ);
- last_environ = new_environ;
- environ = new_environ;
- }
- else
- *ep = (char *) string;
-
- return 0;
-}
diff --git a/contrib/groff/libgroff/searchpath.cc b/contrib/groff/libgroff/searchpath.cc
deleted file mode 100644
index a857c258114a..000000000000
--- a/contrib/groff/libgroff/searchpath.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-
-#include "lib.h"
-#include "searchpath.h"
-#include "nonposix.h"
-
-search_path::search_path(const char *envvar, const char *standard)
-{
- char *e = envvar ? getenv(envvar) : 0;
- if (e && standard) {
- dirs = new char[strlen(e) + strlen(standard) + 2];
- strcpy(dirs, e);
- strcat(dirs, PATH_SEP);
- strcat(dirs, standard);
- }
- else
- dirs = strsave(e ? e : standard);
- init_len = dirs ? strlen(dirs) : 0;
-}
-
-search_path::~search_path()
-{
- if (dirs)
- a_delete dirs;
-}
-
-void search_path::command_line_dir(const char *s)
-{
- if (!dirs)
- dirs = strsave(s);
- else {
- char *old = dirs;
- unsigned old_len = strlen(old);
- unsigned slen = strlen(s);
- dirs = new char[old_len + 1 + slen + 1];
- memcpy(dirs, old, old_len - init_len);
- char *p = dirs;
- p += old_len - init_len;
- if (init_len == 0)
- *p++ = PATH_SEP[0];
- memcpy(p, s, slen);
- p += slen;
- if (init_len > 0) {
- *p++ = PATH_SEP[0];
- memcpy(p, old + old_len - init_len, init_len);
- p += init_len;
- }
- *p++ = '\0';
- a_delete old;
- }
-}
-
-FILE *search_path::open_file(const char *name, char **pathp)
-{
- assert(name != 0);
- if (IS_ABSOLUTE(name) || dirs == 0 || *dirs == '\0') {
- FILE *fp = fopen(name, "r");
- if (fp) {
- if (pathp)
- *pathp = strsave(name);
- return fp;
- }
- else
- return 0;
- }
- unsigned namelen = strlen(name);
- char *p = dirs;
- for (;;) {
- char *end = strchr(p, PATH_SEP[0]);
- if (!end)
- end = strchr(p, '\0');
- int need_slash = end > p && strchr(DIR_SEPS, end[-1]) == 0;
- char *path = new char[(end - p) + need_slash + namelen + 1];
- memcpy(path, p, end - p);
- if (need_slash)
- path[end - p] = '/';
- strcpy(path + (end - p) + need_slash, name);
-#if 0
- fprintf(stderr, "trying `%s'\n", path);
-#endif
- FILE *fp = fopen(path, "r");
- if (fp) {
- if (pathp)
- *pathp = path;
- else
- a_delete path;
- return fp;
- }
- a_delete path;
- if (*end == '\0')
- break;
- p = end + 1;
- }
- return 0;
-}
diff --git a/contrib/groff/libgroff/strerror.c b/contrib/groff/libgroff/strerror.c
deleted file mode 100644
index 69089f13235f..000000000000
--- a/contrib/groff/libgroff/strerror.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-
-#define INT_DIGITS 19 /* enough for 64 bit integer */
-
-#ifndef HAVE_SYS_NERR
-extern int sys_nerr;
-#endif
-#ifndef HAVE_SYS_ERRLIST
-extern char *sys_errlist[];
-#endif
-
-char *strerror(n)
- int n;
-{
- static char buf[sizeof("Error ") + 1 + INT_DIGITS];
- if (n >= 0 && n < sys_nerr && sys_errlist[n] != 0)
- return sys_errlist[n];
- else {
- sprintf(buf, "Error %d", n);
- return buf;
- }
-}
diff --git a/contrib/groff/libgroff/string.cc b/contrib/groff/libgroff/string.cc
deleted file mode 100644
index 4bcd4cccb047..000000000000
--- a/contrib/groff/libgroff/string.cc
+++ /dev/null
@@ -1,311 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include "stringclass.h"
-#include "lib.h"
-
-static char *salloc(int len, int *sizep);
-static void sfree(char *ptr, int size);
-static char *sfree_alloc(char *ptr, int size, int len, int *sizep);
-static char *srealloc(char *ptr, int size, int oldlen, int newlen, int *sizep);
-
-static char *salloc(int len, int *sizep)
-{
- if (len == 0) {
- *sizep = 0;
- return 0;
- }
- else
- return new char[*sizep = len*2];
-}
-
-static void sfree(char *ptr, int)
-{
- a_delete ptr;
-}
-
-static char *sfree_alloc(char *ptr, int oldsz, int len, int *sizep)
-{
- if (oldsz >= len) {
- *sizep = oldsz;
- return ptr;
- }
- a_delete ptr;
- if (len == 0) {
- *sizep = 0;
- return 0;
- }
- else
- return new char[*sizep = len*2];
-}
-
-static char *srealloc(char *ptr, int oldsz, int oldlen, int newlen, int *sizep)
-{
- if (oldsz >= newlen) {
- *sizep = oldsz;
- return ptr;
- }
- if (newlen == 0) {
- a_delete ptr;
- *sizep = 0;
- return 0;
- }
- else {
- char *p = new char[*sizep = newlen*2];
- if (oldlen < newlen && oldlen != 0)
- memcpy(p, ptr, oldlen);
- a_delete ptr;
- return p;
- }
-}
-
-string::string() : ptr(0), len(0), sz(0)
-{
-}
-
-string::string(const char *p, int n) : len(n)
-{
- assert(n >= 0);
- ptr = salloc(n, &sz);
- if (n != 0)
- memcpy(ptr, p, n);
-}
-
-string::string(const char *p)
-{
- if (p == 0) {
- len = 0;
- ptr = 0;
- sz = 0;
- }
- else {
- len = strlen(p);
- ptr = salloc(len, &sz);
- memcpy(ptr, p, len);
- }
-}
-
-string::string(char c) : len(1)
-{
- ptr = salloc(1, &sz);
- *ptr = c;
-}
-
-string::string(const string &s) : len(s.len)
-{
- ptr = salloc(len, &sz);
- if (len != 0)
- memcpy(ptr, s.ptr, len);
-}
-
-string::~string()
-{
- sfree(ptr, sz);
-}
-
-string &string::operator=(const string &s)
-{
- ptr = sfree_alloc(ptr, sz, s.len, &sz);
- len = s.len;
- if (len != 0)
- memcpy(ptr, s.ptr, len);
- return *this;
-}
-
-string &string::operator=(const char *p)
-{
- if (p == 0) {
- sfree(ptr, len);
- len = 0;
- ptr = 0;
- sz = 0;
- }
- else {
- int slen = strlen(p);
- ptr = sfree_alloc(ptr, sz, slen, &sz);
- len = slen;
- memcpy(ptr, p, len);
- }
- return *this;
-}
-
-string &string::operator=(char c)
-{
- ptr = sfree_alloc(ptr, sz, 1, &sz);
- len = 1;
- *ptr = c;
- return *this;
-}
-
-void string::move(string &s)
-{
- sfree(ptr, sz);
- ptr = s.ptr;
- len = s.len;
- sz = s.sz;
- s.ptr = 0;
- s.len = 0;
- s.sz = 0;
-}
-
-void string::grow1()
-{
- ptr = srealloc(ptr, sz, len, len + 1, &sz);
-}
-
-string &string::operator+=(const char *p)
-{
- if (p != 0) {
- int n = strlen(p);
- int newlen = len + n;
- if (newlen > sz)
- ptr = srealloc(ptr, sz, len, newlen, &sz);
- memcpy(ptr + len, p, n);
- len = newlen;
- }
- return *this;
-}
-
-string &string::operator+=(const string &s)
-{
- if (s.len != 0) {
- int newlen = len + s.len;
- if (newlen > sz)
- ptr = srealloc(ptr, sz, len, newlen, &sz);
- memcpy(ptr + len, s.ptr, s.len);
- len = newlen;
- }
- return *this;
-}
-
-void string::append(const char *p, int n)
-{
- if (n > 0) {
- int newlen = len + n;
- if (newlen > sz)
- ptr = srealloc(ptr, sz, len, newlen, &sz);
- memcpy(ptr + len, p, n);
- len = newlen;
- }
-}
-
-string::string(const char *s1, int n1, const char *s2, int n2)
-{
- assert(n1 >= 0 && n2 >= 0);
- len = n1 + n2;
- if (len == 0) {
- sz = 0;
- ptr = 0;
- }
- else {
- ptr = salloc(len, &sz);
- if (n1 == 0)
- memcpy(ptr, s2, n2);
- else {
- memcpy(ptr, s1, n1);
- if (n2 != 0)
- memcpy(ptr + n1, s2, n2);
- }
- }
-}
-
-int operator<=(const string &s1, const string &s2)
-{
- return (s1.len <= s2.len
- ? s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) <= 0
- : s2.len != 0 && memcmp(s1.ptr, s2.ptr, s2.len) < 0);
-}
-
-int operator<(const string &s1, const string &s2)
-{
- return (s1.len < s2.len
- ? s1.len == 0 || memcmp(s1.ptr, s2.ptr, s1.len) <= 0
- : s2.len != 0 && memcmp(s1.ptr, s2.ptr, s2.len) < 0);
-}
-
-int operator>=(const string &s1, const string &s2)
-{
- return (s1.len >= s2.len
- ? s2.len == 0 || memcmp(s1.ptr, s2.ptr, s2.len) >= 0
- : s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) > 0);
-}
-
-int operator>(const string &s1, const string &s2)
-{
- return (s1.len > s2.len
- ? s2.len == 0 || memcmp(s1.ptr, s2.ptr, s2.len) >= 0
- : s1.len != 0 && memcmp(s1.ptr, s2.ptr, s1.len) > 0);
-}
-
-void string::set_length(int i)
-{
- assert(i >= 0);
- if (i > sz)
- ptr = srealloc(ptr, sz, len, i, &sz);
- len = i;
-}
-
-void string::clear()
-{
- len = 0;
-}
-
-int string::search(char c) const
-{
- char *p = ptr ? (char *)memchr(ptr, c, len) : NULL;
- return p ? p - ptr : -1;
-}
-
-// we silently strip nuls
-
-char *string::extract() const
-{
- char *p = ptr;
- int n = len;
- int nnuls = 0;
- int i;
- for (i = 0; i < n; i++)
- if (p[i] == '\0')
- nnuls++;
- char *q = new char[n + 1 - nnuls];
- char *r = q;
- for (i = 0; i < n; i++)
- if (p[i] != '\0')
- *r++ = p[i];
- q[n] = '\0';
- return q;
-}
-
-void put_string(const string &s, FILE *fp)
-{
- int len = s.length();
- const char *ptr = s.contents();
- for (int i = 0; i < len; i++)
- putc(ptr[i], fp);
-}
-
-string as_string(int i)
-{
- static char buf[INT_DIGITS + 2];
- sprintf(buf, "%d", i);
- return string(buf);
-}
-
diff --git a/contrib/groff/libgroff/strsave.cc b/contrib/groff/libgroff/strsave.cc
deleted file mode 100644
index dfd2b6f40743..000000000000
--- a/contrib/groff/libgroff/strsave.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-
-char *strsave(const char *s)
-{
- if (s == 0)
- return 0;
- char *p = new char[strlen(s) + 1];
- strcpy(p, s);
- return p;
-}
-
diff --git a/contrib/groff/libgroff/strtol.c b/contrib/groff/libgroff/strtol.c
deleted file mode 100644
index 071bade8dc19..000000000000
--- a/contrib/groff/libgroff/strtol.c
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#ifndef errno
-extern int errno;
-#endif
-
-#ifdef HAVE_LIMITS_H
-#include
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX 2147483647
-#endif
-
-#ifndef LONG_MIN
-#define LONG_MIN (-LONG_MAX-1)
-#endif
-
-#ifdef isascii
-#define ISASCII(c) isascii(c)
-#else
-#define ISASCII(c) (1)
-#endif
-
-long strtol(str, ptr, base)
- char *str, **ptr;
- int base;
-{
- char *start = str;
- int neg = 0;
- long val;
- char *p;
- static char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-
- while (ISASCII((unsigned char)*str) && isspace((unsigned char)*str))
- str++;
-
- if (*str == '-') {
- neg = 1;
- str++;
- }
- if (base == 0) {
- if (*str == '0') {
- if (str[1] == 'x' || str[1] == 'X') {
- str += 2;
- base = 16;
- }
- else
- base = 8;
- }
- else
- base = 10;
- }
- if (base < 2 || base > 36)
- base = 10;
- else if (base == 16 && *str == '0' && (str[1] == 'x' || str[1] == 'X'))
- str += 2;
-
- p = strchr(digits, (ISASCII((unsigned char)*str)
- && isupper((unsigned char)*str)
- ? tolower((unsigned char)*str)
- : *str));
- if (p == 0 || (val = (p - digits)) >= base) {
- if (base == 16 && str > start && (str[-1] == 'x' || str[-1] == 'X')) {
- if (ptr)
- *ptr = str - 1;
- }
- else {
- if (ptr)
- *ptr = start;
- errno = ERANGE;
- }
- return 0;
- }
- if (neg)
- val = -val;
-
- while (*++str != '\0') {
- int n;
-
- p = strchr(digits, (ISASCII((unsigned char)*str)
- && isupper((unsigned char)*str)
- ? tolower((unsigned char)*str) : *str));
- if (p == 0)
- break;
- n = p - digits;
- if (n >= base)
- break;
- if (neg) {
- if (-(unsigned long)val > (-(unsigned long)LONG_MIN - n)/base) {
- val = LONG_MIN;
- errno = ERANGE;
- }
- else
- val = val*base - n;
- }
- else {
- if (val > (LONG_MAX - n)/base) {
- val = LONG_MAX;
- errno = ERANGE;
- }
- else
- val = val*base + n;
- }
- }
-
- if (ptr)
- *ptr = str;
-
- return val;
-}
diff --git a/contrib/groff/libgroff/tmpfile.cc b/contrib/groff/libgroff/tmpfile.cc
deleted file mode 100644
index ffc165cedf7f..000000000000
--- a/contrib/groff/libgroff/tmpfile.cc
+++ /dev/null
@@ -1,187 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-
-#include "posix.h"
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-#include "nonposix.h"
-
-extern "C" {
- // Solaris 2.5.1 has these functions,
- // but its stdlib.h fails to declare them.
- char *mktemp(char *);
- int mkstemp(char *);
-}
-
-// If this is set, create temporary files there
-#define GROFF_TMPDIR_ENVVAR "GROFF_TMPDIR"
-// otherwise if this is set, create temporary files there
-#define TMPDIR_ENVVAR "TMPDIR"
-// otherwise if P_tmpdir is defined, create temporary files there
-#ifdef P_tmpdir
-# define DEFAULT_TMPDIR P_tmpdir
-#else
-// otherwise create temporary files here.
-# define DEFAULT_TMPDIR "/tmp"
-#endif
-// Use this as the prefix for temporary filenames.
-#define TMPFILE_PREFIX "groff"
-
-/*
- * Generate a temporary name template with a postfix
- * immediately after the TMPFILE_PREFIX.
- * It uses the groff preferences for a temporary directory.
- * Note that no file name is either created or opened,
- * only the *template* is returned.
- */
-
-char *xtmptemplate(char *postfix)
-{
- const char *dir = getenv(GROFF_TMPDIR_ENVVAR);
- int postlen = 0;
-
- if (postfix)
- postlen = strlen(postfix);
-
- if (!dir) {
- dir = getenv(TMPDIR_ENVVAR);
- if (!dir)
- dir = DEFAULT_TMPDIR;
- }
-
- size_t dir_len = strlen(dir);
- const char *dir_end = dir + dir_len - 1;
- int needs_slash = strchr(DIR_SEPS, *dir_end) == NULL;
- char *templ = new char[strlen(dir) + needs_slash
- + sizeof(TMPFILE_PREFIX) - 1 + 6 + 1 + postlen];
- strcpy(templ, dir);
- if (needs_slash)
- strcat(templ, "/");
- strcat(templ, TMPFILE_PREFIX);
- if (postlen > 0)
- strcat(templ, postfix);
- strcat(templ, "XXXXXX");
-
- return( templ );
-}
-
-// The trick with unlinking the temporary file while it is still in
-// use is not portable, it will fail on MS-DOS and most MS-Windows
-// filesystems. So it cannot be used on non-Posix systems.
-// Instead, we maintain a list of files to be deleted on exit, and
-// register an atexit function that will remove them all in one go.
-// This should be portable to all platforms.
-
-static struct xtmpfile_list {
- struct xtmpfile_list *next;
- char *fname;
-} *xtmpfiles_to_delete;
-
-static void remove_tmp_files(void)
-{
- struct xtmpfile_list *p = xtmpfiles_to_delete;
-
- while (p)
- {
- if (unlink(p->fname) < 0)
- error("cannot unlink `%1': %2", p->fname, strerror(errno));
- a_delete p->fname;
- struct xtmpfile_list *old = p;
- p = p->next;
- free(old);
- }
-}
-
-static void add_tmp_file(const char *name)
-{
- if (xtmpfiles_to_delete == NULL)
- atexit(remove_tmp_files);
-
- char *fname = new char[FILENAME_MAX];
- struct xtmpfile_list *p
- = (struct xtmpfile_list *)malloc(sizeof(struct xtmpfile_list));
- if (p == NULL)
- {
- error("cannot unlink `%1': %2", name, strerror(errno));
- return;
- }
- p->next = xtmpfiles_to_delete;
- p->fname = strcpy(fname, name);
- xtmpfiles_to_delete = p;
-}
-
-// Open a temporary file and with fatal error on failure.
-
-#ifndef _MSC_VER
-
-FILE *xtmpfile(char **namep, char *postfix, int do_unlink)
-{
- char *templ = xtmptemplate(postfix);
-
-#ifdef HAVE_MKSTEMP
- errno = 0;
- int fd = mkstemp(templ);
- if (fd < 0)
- fatal("cannot create temporary file: %1", strerror(errno));
- errno = 0;
- FILE *fp = fdopen(fd, FOPEN_RWB); // many callers of xtmpfile use binary I/O
- if (!fp)
- fatal("fdopen: %1", strerror(errno));
-#else /* not HAVE_MKSTEMP */
- if (!mktemp(templ) || !templ[0])
- fatal("cannot create file name for temporary file");
- errno = 0;
- FILE *fp = fopen(templ, FOPEN_RWB);
- if (!fp)
- fatal("cannot open `%1': %2", templ, strerror(errno));
-#endif /* not HAVE_MKSTEMP */
- if (do_unlink)
- add_tmp_file(templ);
- if ((namep != 0) && ((*namep) != 0)) {
- *namep = templ;
- } else {
- a_delete templ;
- }
- return fp;
-}
-
-#else
-
-// FIXME: does MSVC have mktemp or mkstemp? If so, it should now
-// use the version above, as it no longer removes an open file.
-// The version below will NOT work with grohtml, since grohtml
-// wants to know the name of the file opened by xtmpfile!!
-
-// If you're not running Unix, the following will do:
-FILE *xtmpfile(char **namep, char *postfix, int do_unlink)
-{
- FILE *fp = tmpfile();
- if (!fp)
- fatal("couldn't create temporary file");
- return fp;
-}
-
-#endif /* _MSC_VER */
diff --git a/contrib/groff/lkbib/Makefile.dep b/contrib/groff/lkbib/Makefile.dep
deleted file mode 100644
index 19d441a24607..000000000000
--- a/contrib/groff/lkbib/Makefile.dep
+++ /dev/null
@@ -1,3 +0,0 @@
-lkbib.o: lkbib.cc ../include/lib.h ../include/errarg.h \
- ../include/error.h ../include/defs.h ../include/refid.h \
- ../include/search.h
diff --git a/contrib/groff/lkbib/Makefile.sub b/contrib/groff/lkbib/Makefile.sub
deleted file mode 100644
index 8f31e10f5fad..000000000000
--- a/contrib/groff/lkbib/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=lkbib
-MAN1=lkbib.n
-XLIBS=$(LIBBIB) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=lkbib.o
-CCSRCS=$(srcdir)/lkbib.cc
diff --git a/contrib/groff/lkbib/lkbib.cc b/contrib/groff/lkbib/lkbib.cc
deleted file mode 100644
index cfd099a53d46..000000000000
--- a/contrib/groff/lkbib/lkbib.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-
-#include "lib.h"
-#include "errarg.h"
-#include "error.h"
-
-#include "defs.h"
-#include "refid.h"
-#include "search.h"
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-nv] [-p database] [-i XYZ] [-t N] keys ...\n",
- program_name);
- exit(1);
-}
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- int search_default = 1;
- search_list list;
- int opt;
- while ((opt = getopt(argc, argv, "nvVi:t:p:")) != EOF)
- switch (opt) {
- case 'V':
- verify_flag = 1;
- break;
- case 'n':
- search_default = 0;
- break;
- case 'i':
- linear_ignore_fields = optarg;
- break;
- case 't':
- {
- char *ptr;
- long n = strtol(optarg, &ptr, 10);
- if (n == 0 && ptr == optarg) {
- error("bad integer `%1' in `t' option", optarg);
- break;
- }
- if (n < 1)
- n = 1;
- linear_truncate_len = int(n);
- break;
- }
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "GNU lkbib version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case 'p':
- list.add_file(optarg);
- break;
- case '?':
- usage();
- default:
- assert(0);
- }
- if (optind >= argc)
- usage();
- char *filename = getenv("REFER");
- if (filename)
- list.add_file(filename);
- else if (search_default)
- list.add_file(DEFAULT_INDEX, 1);
- if (list.nfiles() == 0)
- fatal("no databases");
- int total_len = 0;
- int i;
- for (i = optind; i < argc; i++)
- total_len += strlen(argv[i]);
- total_len += argc - optind - 1 + 1; // for spaces and '\0'
- char *buffer = new char[total_len];
- char *ptr = buffer;
- for (i = optind; i < argc; i++) {
- if (i > optind)
- *ptr++ = ' ';
- strcpy(ptr, argv[i]);
- ptr = strchr(ptr, '\0');
- }
- search_list_iterator iter(&list, buffer);
- const char *start;
- int len;
- int count;
- for (count = 0; iter.next(&start, &len); count++) {
- if (fwrite(start, 1, len, stdout) != len)
- fatal("write error on stdout: %1", strerror(errno));
- // Can happen for last reference in file.
- if (start[len - 1] != '\n')
- putchar('\n');
- putchar('\n');
- }
- return !count;
-}
diff --git a/contrib/groff/lkbib/lkbib.man b/contrib/groff/lkbib/lkbib.man
deleted file mode 100644
index 872313de0155..000000000000
--- a/contrib/groff/lkbib/lkbib.man
+++ /dev/null
@@ -1,110 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.ds g \" empty
-.ds G \" empty
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.TH LKBIB @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-lkbib \- search bibliographic databases
-.SH SYNOPSIS
-.B lkbib
-[
-.B \-v
-]
-[
-.BI \-i fields
-]
-[
-.BI \-p filename
-]
-[
-.BI \-t n
-]
-.IR key \|.\|.\|.
-.PP
-It is possible to have whitespace between a command line option and its
-parameter.
-.SH DESCRIPTION
-.B lkbib
-searches bibliographic databases for references that contain the keys
-.IR key \|.\|.\|.
-and prints any references found on the standard output.
-.B lkbib
-will search any databases given by
-.B \-p
-options, and then a default database.
-The default database is taken from the
-.SB REFER
-environment variable if it is set,
-otherwise it is
-.BR @DEFAULT_INDEX@ .
-For each database
-.I filename
-to be searched,
-if an index
-.IB filename @INDEX_SUFFIX@
-created by
-.BR @g@indxbib (@MAN1EXT@)
-exists, then it will be searched instead;
-each index can cover multiple databases.
-.SH OPTIONS
-.TP
-.B \-v
-Print the version number.
-.TP
-.BI \-p filename
-Search
-.IR filename .
-Multiple
-.B \-p
-options can be used.
-.TP
-.BI \-i string
-When searching files for which no index exists,
-ignore the contents of fields whose names are in
-.IR string .
-.TP
-.BI \-t n
-Only require the first
-.I n
-characters of keys to be given.
-Initially
-.I n
-is 6.
-.SH ENVIRONMENT
-.TP \w'\fBREFER'u+2n
-.SB REFER
-Default database.
-.SH FILES
-.Tp \w'\fB@DEFAULT_INDEX@'u+2n
-.B @DEFAULT_INDEX@
-Default database to be used if the
-.SB REFER
-environment variable is not set.
-.IB filename @INDEX_SUFFIX@
-Index files.
-.SH "SEE ALSO"
-.BR @g@refer (@MAN1EXT@),
-.BR @g@lookbib (@MAN1EXT@),
-.BR @g@indxbib (@MAN1EXT@)
diff --git a/contrib/groff/lookbib/Makefile.dep b/contrib/groff/lookbib/Makefile.dep
deleted file mode 100644
index 341a3b9737ef..000000000000
--- a/contrib/groff/lookbib/Makefile.dep
+++ /dev/null
@@ -1,3 +0,0 @@
-lookbib.o: lookbib.cc ../include/errarg.h ../include/error.h \
- ../include/lib.h ../include/cset.h ../include/refid.h \
- ../include/search.h
diff --git a/contrib/groff/lookbib/Makefile.sub b/contrib/groff/lookbib/Makefile.sub
deleted file mode 100644
index 91b140453153..000000000000
--- a/contrib/groff/lookbib/Makefile.sub
+++ /dev/null
@@ -1,7 +0,0 @@
-PROG=lookbib
-MAN1=lookbib.n
-XLIBS=$(LIBBIB) $(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=lookbib.o
-CCSRCS=$(srcdir)/lookbib.cc
-NAMEPREFIX=$(g)
diff --git a/contrib/groff/lookbib/lookbib.cc b/contrib/groff/lookbib/lookbib.cc
deleted file mode 100644
index 4240a47fe9b4..000000000000
--- a/contrib/groff/lookbib/lookbib.cc
+++ /dev/null
@@ -1,128 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-
-#include "errarg.h"
-#include "error.h"
-#include "lib.h"
-#include "cset.h"
-
-#include "refid.h"
-#include "search.h"
-
-extern "C" {
- int isatty(int);
-}
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-v] [-i XYZ] [-t N] database ...\n",
- program_name);
- exit(1);
-}
-
-int main(int argc, char **argv)
-{
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- int opt;
- while ((opt = getopt(argc, argv, "vVi:t:")) != EOF)
- switch (opt) {
- case 'V':
- verify_flag = 1;
- break;
- case 'i':
- linear_ignore_fields = optarg;
- break;
- case 't':
- {
- char *ptr;
- long n = strtol(optarg, &ptr, 10);
- if (n == 0 && ptr == optarg) {
- error("bad integer `%1' in `t' option", optarg);
- break;
- }
- if (n < 1)
- n = 1;
- linear_truncate_len = int(n);
- break;
- }
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "GNU lookbib version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case '?':
- usage();
- default:
- assert(0);
- }
- if (optind >= argc)
- usage();
- search_list list;
- for (int i = optind; i < argc; i++)
- list.add_file(argv[i]);
- if (list.nfiles() == 0)
- fatal("no databases");
- char line[1024];
- int interactive = isatty(fileno(stdin));
- for (;;) {
- if (interactive) {
- fputs("> ", stderr);
- fflush(stderr);
- }
- if (!fgets(line, sizeof(line), stdin))
- break;
- char *ptr = line;
- while (csspace(*ptr))
- ptr++;
- if (*ptr == '\0')
- continue;
- search_list_iterator iter(&list, line);
- const char *start;
- int len;
- int count;
- for (count = 0; iter.next(&start, &len); count++) {
- if (fwrite(start, 1, len, stdout) != len)
- fatal("write error on stdout: %1", strerror(errno));
- // Can happen for last reference in file.
- if (start[len - 1] != '\n')
- putchar('\n');
- putchar('\n');
- }
- fflush(stdout);
- if (interactive) {
- fprintf(stderr, "%d found\n", count);
- fflush(stderr);
- }
- }
- if (interactive)
- putc('\n', stderr);
- return 0;
-}
-
diff --git a/contrib/groff/lookbib/lookbib.man b/contrib/groff/lookbib/lookbib.man
deleted file mode 100644
index 846798dce02d..000000000000
--- a/contrib/groff/lookbib/lookbib.man
+++ /dev/null
@@ -1,78 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.TH @G@LOOKBIB @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-@g@lookbib \- search bibliographic databases
-.SH SYNOPSIS
-.B @g@lookbib
-[
-.B \-v
-]
-[
-.BI \-i string
-]
-[
-.BI \-t n
-]
-.IR filename \|.\|.\|.
-.PP
-It is possible to have whitespace between a command line option and its
-parameter.
-.SH DESCRIPTION
-@g@lookbib prints a prompt on the standard error (unless the standard input is not a terminal),
-reads from the standard input a line containing a set of keywords,
-searches the bibliographic databases
-.IR filename \|.\|.\|.
-for references containing those keywords,
-prints any references found on the standard output,
-and repeats this process until the end of input.
-For each database
-.I filename
-to be searched,
-if an index
-.IB filename @INDEX_SUFFIX@
-created by
-.BR @g@indxbib (@MAN1EXT@)
-exists, then it will be searched instead;
-each index can cover multiple databases.
-.SH OPTIONS
-.TP
-.B \-v
-Print the version number.
-.TP
-.BI \-i string
-When searching files for which no index exists,
-ignore the contents of fields whose names are in
-.IR string .
-.TP
-.BI \-t n
-Only require the first
-.I n
-characters of keys to be given.
-Initially
-.I n
-is 6.
-.SH FILES
-.TP \w'\fIfilename\fB@INDEX_SUFFIX@'u+2n
-.IB filename @INDEX_SUFFIX@
-Index files.
-.SH "SEE ALSO"
-.BR @g@refer (@MAN1EXT@),
-.BR lkbib (@MAN1EXT@),
-.BR @g@indxbib (@MAN1EXT@)
diff --git a/contrib/groff/mm/ChangeLog b/contrib/groff/mm/ChangeLog
deleted file mode 100644
index 09d7b07994d3..000000000000
--- a/contrib/groff/mm/ChangeLog
+++ /dev/null
@@ -1,493 +0,0 @@
-Sat Jun 17 23:00:00 2000 Eli Zaretskii
-
- * Makefile.sim (.man.n): Replace `;' with `|', since DOS/Windows
- path lists use the semicolon as a separator.
-
-Sun Jun 4 21:39:00 2000 Kaneda Hiroshi (vanitas at ma3.seikyou.ne.jp)
-
- * Fixing a lot of typos in groff_mm.man
-
-Sun Jan 30 22:52:20 2000 Jörgen Hägg (jh at axis.com)
-
- * version 1.34
- * Changed the version number in the CVS repository
-
-Fri Sep 3 07:33:14 1999 Jörgen Hägg (jh at axis.com)
-
- * version 1.33
- * At last! I finally tracked down the PGFORM bug!
- It didn't setup the @pl, @ll and @po as it should, now it does.
- * mgm_ref/mgm_roff renamed to mmroff [-x]
- * fixed y2k-bug in \*[DT]
- * \n[cov*year] removed, hope noone used that.
- * ISODATE added with Iso as command line flag
- (iso-date suggested by Paul Eggert)
- * Added ISODATE to tmac.mse and removed local settings
- of new-date.
- * INITI syntax changed and enhanced. Index processing is now
- done with mmroff.
- * A few examples has been added, new subdirectory 'examples'.
- * Fixed bug with SETR, header references are now only saved
- when Ref > 0
- * Problem with register H1h fixed
- * Added test for missing abstract in 4.MT
- * Updated Makefile.sub, using tmac_m_prefix.
-
-Mon Mar 15 22:22:42 1999 Jörgen Hägg (jh at axis.com)
-
- * OK, let's release this as a beta, 1.33 will be better. :-)
- * version 1.32
- * fixed .el-error
- * Added number variable Hss
- * Changed Hps1 and Hps2 to units
- * added hd*h1-text to be used in user defined macro TP.
- * -U needed for SETR (I really need 'mv', 'echo', 'rm'
- and 'test' builtin!)
- * Rewritten the reference system, SETR now prints to stderr
- if the number register Qrf > 0. Store in the filename
- that is the argument to .INITR
- The old behaviour is returned if number register Initr > 0.
- * Fixed bug with List of XXXX, long lines messed up the result.
- * added number register H1dot.
- * added string variable H1txt
- * added string variable Tcst
- * added number register Dsp.
- * added alias APPX for user-defined appendix title.
- * added string variable Apptxt
- * added H1h for use in TP in headers
- * added macro EPIC
- * added macro PIC (safe replacement for PSPIC)
- * fixed Hps-bug, should be 1, not 1v.
- * fixed bug with APPSK, variable not set.
-
-Wed Feb 4 15:46:04 1998 Jörgen Hägg (jh at axis.se)
-
- * version 1.31
- * .LI will now honor a space mark.
- * Another fix for .AU to let it be used without arguments.
- * uninitialized eq*label fixed
-
-Fri Sep 6 07:13:07 1996 Jörgen Hägg (jh at axis.se)
-
- * version 1.30
- * This is more like a beta-release, bugs might pop up. :-)
- * last line in TOC was not correctly terminated (missing .br)
- * changed the indentation for displays, it will now
- indent to the current indent, not the one at the definition
- of the display.
- * Equation marks should now work better, indentation also.
- * included these bug fixes from Larry Jones:
- * The documentation for the argument to .AS was incorrect for MT 4.
- * \*(EM should be a double-dash for nroff.
- * \nS is in points, not units.
- * If \nO isn't set, the default page offset should be .75i for nroff
- and .963i for troff.
- * .S D should set the point size to \nS, not 10.
- * .S was setting the vertical spacing based on the old point size
- instead of the new point size.
- * Got rid of a spurrious .br that prevented run-in headings from
- working.
- * Reset the .SP counters in pg@header so that spacing on one page
- won't affect spacing on subsequent pages.
- * Allow .AU and .AF with no arguments (real mm does, even though it
- isn't documented).
- * Do .init@reset first thing to initialize the default environment.
- * For MT 4, the title should be 4 points larger than the default size,
- not 12 point.
- * The cover environment needs to be initialized.
- * Printing the abstract on the first page needs to be controlled by
- the .AS argument.
- * Heading eject should be suppressed if the heading immediately
- follows the first page stuff (title, author, etc.).
- * support for table of contents numbering style (.nr Oc)
- * changes the troff empty line height from .25v to .5v
- * fixed section page numbering
- * fixed a really nasty bug in footnotes that could cause you
- to lose the page footer completely if the very first
- footnote on the page occurred at just the wrong place
-
-
-Wed May 15 07:39:32 1996 Jörgen Hägg (jh at axis.se)
-
- * version 1.29
- * Syntax and scaling errror fixed, (thanks to Frazer Williams)
- * DF/DE will now do a line-break before printing the display.
- * Updated the manual for TB,FG,EX and EC.
- * Added support for the ms- (and mgs-)macro .IX
- * Added indexmacro IX, INITI, IND and INDP, support for
- TXIND, TYIND and TZIND.
- * PGFORM will now always really reset to the default
- values for unspecified arguments.
- * Floating displays tested and repaired, it should
- now (finanlly) work exactly as the original (I hope :-).
- * Should now set year correctly even after 2000.
- * Stupid bug in PGNH fixed.
- * Corrected line length for figure caption (FG and friends)
-
-
-Mon Apr 24 07:37:52 1995 Jörgen Hägg (jh at axis.se)
-
- * version 1.28
- * Added AVL (AV without date)
- * Fixed nroff scaling for W and L.
- * Added support for register E and roman/bold
- for all Subject/Date/From strings.
- * Added support for register C (1-4), (for DRAFTs and other types)
- * Will protest if not used with groff.
- * Change of the internal number registers @ps and @vs, they
- are now in units, and is set in the new macros .@ps and .@vs.
- @ps and @vs is now corrected to the real point and vertical size.
- * Macro EQ has now correct pointsize.
- * Figures should now get the right page number in the index.
- * User-defined macros can now be defined for list of
- figures, tables, equations and exhibits (T{X,Y}{FG,TB,EC,EX}.
- * Space may be omitted between prefix and mark in automatic lists (.AL)
- See .LI
-
-Tue Jan 10 07:51:37 1995 Jörgen Hägg (jh at axis.se)
-
- * version 1.27
- * Manual updated
- * More bugs fixed in DS/DF
- * added alias for :g
- * LC can now be used without argument (as the manual says. :-)
- * Register :R now supported (RS/RF)
- * footnote line was printed even if there was no room for
- any footnotes. Fixed.
- * Fixed 1C so that it can be used without page eject
- * Added support for EOP (TPs twin)
- * Hyphenation turned off by default. (Hy == 0)
-
-Fri Nov 4 08:14:50 1994 Jörgen Hägg (jh at axis.se)
-
- * version 1.25
- * DS/DF separated and several bugs fixed. Watch out for new though. :-)
- * string DT was emptied by mistake in the previous version.
- * RD made prettier.
- * typo in AV and let@print-head fixed.
-
-Mon Oct 31 08:19:24 1994 Jörgen Hägg (jh at axis.se)
-
- * version 1.24
- * Bug fixed and format extended in .SG and .FC.
- * date is always printed unless .ND without argument is used.
- (I wonder what's the right thing to do, this might change.)
- * Swedish letter-standards implemented in tmac.mse.
- * .ND can be used to turn off the date. (Empty argument)
-
-Mon Oct 31 08:14:09 1994 Jörgen Hägg (jh at axis.se)
-
- * version 1.23
- * An attempt to get in sync with RCS. This is the distributed
- version.
-
-Thu Oct 27 08:29:34 1994 Jörgen Hägg (jh at axis.se)
-
- * version 1.22
- * (version 1.21 lost... :-)
- * Letter macros added!!
- * The following macros are added:
- * AV, FC, IA ,IE, LT, LO, NE, NS, SG, WA, WE
- * nP also added.
-
-Tue Dec 14 16:26:36 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.20
- * spelling-corrections
- * Makefile.sim updated to the correct version, and a uninstall
- target added.
- * @cur-lib removed from tmac.m (obsolete)
- * fixed check for references i .TC, .RP now resets the flag correctly.
- * floating display should now be printed if there is space.
- * first version using RCS. I've been avoiding version control until it
- became necessary.
- * WC WD now works in two-column-mode.
-
-Tue Sep 7 08:37:00 1993 Jörgen Hägg (jh at efd.lth.se)
-
- * version 1.19
- * .lt is called in the header for .TP also.
- * Variable Pgps added to control the header and footer point-size.
- * Error-text printed with .APP removed.
- * Error with .FG, .TB, .EC and .EX indentation fixed.
- * header and footer line-length is not changed by MC or 2C.
- * Default for page-length and page-offset is now taken from
- \n[.p] and \n[.o].
- * Argument to .ab (abort) is supplied.
- * Argument to .1C added.
- * Argument to .PGFORM added.
- * RP/RS/RF totally rewritten. Should work with 2C now.
-
-Fri Apr 23 10:37:25 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.18
- * Height of display is now more exactly calculated.
- * tabs and blankspaces where wrong in .VERBON.
- * error in manual for escape-character in VERBON.
- * Makefile.sub: installed tmac.m as tmac.m and tmac.mse
- * Installation of tmac.mse now supports TMAC_M.
- * bug with N fixed.
-
-Mon Apr 5 09:36:01 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.17
- * MULB preserves size.
- * bug in VERBON fixed, causing strange errors.
- * section-page footer fixed.
- * added support for numberregister S
- * fixed bug with floating displays wich made floats to
- generate space on a page, but broke page anyway.
- * end-of-page trap reinstalled.
-
-Mon Mar 29 10:53:13 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.16
- * MUL* now use the previous font and family.
- * extra blank page at end-of-text eliminated.
-
-Mon Mar 8 10:27:47 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.15
- * Didn't restore pointsize to current size in .H.
- * B1/B2 did not work with indent. (MULE and friends)
- * fixed old problem with trailing empty pages.
-
-Fri Mar 5 15:20:49 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.14
- * Sigh. Amazing what a missing \} can do. If the string
- HP was set, then all text disappeared...
-
-Fri Mar 5 14:12:43 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.13
- * Fixed bug with handling ps/vs in .H. (again, sigh... )
-
-Wed Mar 3 09:21:20 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.12
- * Line-break added to PGFORM.
- * added more features to VERBON
- * .S is not used anymore in H, it caused confusion with
- normal text, but it will still set .vs.
- * SK was broken, will now produce the requested number of
- empty pages.
- * dotted lines added to LIST OF FIGURES adn friends.
- Also better linespacing.
-
-Mon Feb 22 12:41:06 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.11
- * missing left-parenthesis gave ") .sp" when N=4.
- * N=4 removed user-specified header also.
- * MOVE made linelength pageoffset wider than wanted.
- * fixed (again) parenthesis in RP.
-
-Thu Jan 21 12:10:39 1993 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.10
- * changed PROG_PREFIX to g in the manual-pages.
- * Better check if new page is needed in .H, when Ej>0.
- * Usage of variable Lsp now more complete.
- * Space added in TOC when mark is equal to size.
- * Usermacro HY moved after font-calulations.
- * .S used instead of .ps, which will use .vs correct.
- * Now possible to set Hps1/2 inside HX.
- * .FD "" 1 is now fixed.
- * section-page numbering bug fixed.
- * several bugs in VERBON/OFF fixed.
-
-Tue Dec 8 16:43:15 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.09
- * N==4 gives no default header
-
-Sat Nov 21 14:28:20 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.08
- * Escape-character disabled between
- VERBON/VERBOFF (turned on by an argument).
- Pointsize and fontchange also added as arguments.
- * MULB, MULN and MULE added to get multicolumn output
- with different width.
- * Number register N can now use 1-5.
- * Register Sectp and Sectf added.
- * Register P is now updated correctly for "section-page" numbering.
-
-Thu Nov 19 11:19:33 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.07
- * .OP fixed to eject a blank page if not odd.
-
-Fri Nov 13 09:46:09 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.06
- * Macro TL rewritten. TL depends now on a following .AU.
- * NOTES updated.
- * .lt is now used more frequent when linelength is changed.
- * macro AST added.
- * removed PH/EH/OH not needed in ?.MT.
-
-Wed Oct 28 14:35:43 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.05
- * .VM implemented.
- * Possible bug in page heading fixed. Changed .sp to 'sp in HEADER.
-
-Thu Aug 20 13:56:31 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.04
- * page-break in .EQ moved.
- * changed unit for footer-size and header-size from units to lines.
- Fixes problems with .S and page-breaks.
- * \n[%] is now treated as a string, wich makes it possible
- to assign new formats to it. Unfortunately, it was necessary
- to change the page-number-variable in GETPN to a string.
- * Makefile.sub included. (Thank you, James)
-
-Thu May 7 16:14:10 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.03
- * Typo and centering in DS/DE fixed.
- Even and odd pageheaders were reversed.
- * LI: pad and mark-indent was lost in some earlier versions. Now fixed.
- * fixed bug in reference to .FG, .TB, ...
- * APP did not clear headercounters.
- * Pointsize in titles is now only set at the beginning and
- when PH, PF, OH, OF, EH and EF are used.
-
-Thu May 6 16:01:35 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.02
- * OP fixed.
-
-Fri Mar 6 09:36:09 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.01
- * two .LI without text between should not be printed
- on the same row. Now fixed.
- * figure titles and friends fixed, now possible with many .FG
- in a DS/DE. Didn't always position correctly in previous version,
- but is now always printed as it should.
- * Makefile fixed for Ultrix.
- * DS/DF could not handle empty arguments correct
- * Missing .br i EQ added.
-
-Sat Jan 25 15:47:21 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 1.00
- * No betaversion anymore!
- * Fixed headernumbers within appendixes.
- * DS did not keep the same font as before DS.
- * mmse did a line break.
-
-Fri Jan 24 14:38:16 1992 Joergen Haegg (jh at efd.lth.se)
-
- * version 0.16
- * bug in TC, multiple line headers did not wrap correctly.
- * added support for mm/locale and mm/language_locale.
- * cov*default-firm in locale sets name of firm in the MT covers.
- * cov*location-xxxx in locale sets location xxxx to the contents
- of cov*location-xxxx. Used in the MT covers.
- * hanging indent in lists fixed.
- * use larger empty lines if .nroff is defined.
- * macros, like .P, can now be used inside abstracts.
- * .S do not reset indentation anymore.
- * .RS aA now sets a string, not an integer.
- * appendix with .APP or .APPSK added.
-
-Thu Nov 28 22:00:59 1991 Joergen Haegg (jh at efd.lth.se)
-
- * version 0.15
- * Fixed .AU in MT 0-3, added support for variable Au.
- * Bug in the positioning of the foot-notes.
- * lists not indented properly.
- * Hps1 and Hps2 added.
- * COVER had to have an argument.
- * table of contents can now have multiline header.
- * .HU now increments headingvariable H?
- * added the inclusion of a locale file.
-
-Sat Nov 23 14:40:17 1991 Joergen Haegg (jh at efd.lth.se)
-
- * version 0.14
- * bug when using -rO fixed.
- * MT 1-4 added.
- * default is now MT 1
- * .EQ/.EN can be used outside of .DS/.DE without complaints. But
- I don't recommend it. Neither does the DWB books.
- * LI don't break lines now if arg too big.
- * PGFORM did not reset indent.
- * Added the numbervariable Hps.
- * Rewritten and added MT 0-5 + "string".
- * Added TM.
- * Indent to AS added
-
-Wed Nov 6 15:18:40 1991 Joergen Haegg (jh at efd.lth.se)
-
- * version 0.13
- * ds*format nod defined if PS/PE is used without DS/DE.
- * GETST added, fourth argument to EX, FG, TB and EC added.
-
-Mon Nov 4 13:38:01 1991 Joergen Haegg (jh at efd.lth.se)
-
- * version 0.12
- * Fixed C,D,P,+-size in .S
-
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * Next version will have ChangeLog entries...
- * Bug in INITR fixed.
- * VERBON/VERBOFF added to include programlistings
- * Bug in .DE fixed, addition overflow
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * spelling error in month-names.
- * WC should work now (no warranty :-)
- * FD almost finished, some details missing.
- * incorrect calculation of foot-notes fixed.
- * DS/DE did not break page when the size was smaller than the paper
- * Forward/backward referencesystem added. Se .INITR in README.
- * mgmsw changed name to mgmse.
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * embarrassing bug in .P fixed
- * .H did always eject page, now fixed.
- * lost floating displays now found.
- * accents added (from mgs)
- * empty line in .EQ/.EN removed
- * indentation in .TC corrected.
- * indentation of DS/DE in lists fixed.
- * .TB and friends now work inside DS/DE and outside.
- * .WC partially implemented (WF and WD). Still working on it.
- * .mso used if version>=1.02
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * register P was not working.
- * support for register Fg, Tb, Ec and Ex.
- * list items was left on the previous page at a page break.
- * tlevel in .TC now defaults to 2.
- * string DT, EM and Tm supported.
- * new macro: PGNH, see comments.
- * bug in MOVE fixed.
- * pagenumber in .TC fixed.
- * a blank page was ejected if Ej==1, now fixed
- * bug in floating display fixed (did break and SP wrong)
- * bug in .SP fixed, no lines is now printed at top of page
- * There are still problems with footnotes and displays in two column mode.
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * register P added (same as %)
- * bug in floating displays fixed
- * MOVE added
- * MT added, see comment below
- * COVER/COVEND added
- * fixed bug in figure titles
- * extended S, se comment below
- * MT 0 added
- * ms-cover added (COVER ms)
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * bugs in RD and comb. fonts fixed
-Sun Jan 1 00:00:00 1991 Joergen Haegg (jh at efd.lth.se)
- * HC added
- * Combined fonts (IB,BI...)
- * HM added
- * RD added
- * OP added
- * TP&PX supported
- * warnings for unimplemented macros
diff --git a/contrib/groff/mm/Makefile.sim b/contrib/groff/mm/Makefile.sim
deleted file mode 100644
index 7775c79bc46b..000000000000
--- a/contrib/groff/mm/Makefile.sim
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# $Id: Makefile.sim,v 1.2 2000/06/18 10:08:06 wlemb Exp $
-#
-# To install mgm separately as tmac.gm:
-# make -f Makefile.sub tmacdir=/usr/local/lib/groff/tmac srcdir=. \
-# INSTALL_DATA='install -m 644' tmac_m=gm install
-#
-# or as tmac.m:
-#
-# tmacdir is the destination for your groff/tmac-directory, srcdir is
-# this directory and INSTALL_DATA is the command to install a file with.
-# If you dont have 'install': use 'cp'.
-
-
-# change this to whatever you like
-tmacdir=/usr/local/lib/groff/tmac
-#tmac_m = gm
-tmac_m = m
-indexdir = xx
-install = install -m 644
-
-# Do not change anything below this line
-srcdir = .
-version = 1.32
-mdate = 1999-09-03
-
-.SUFFIXES: .n .man
-
-all:
-
-
-install: groff_mm.n groff_mmse.n
- $(MAKE) -f Makefile.sub tmacdir=$(tmacdir) srcdir=$(srcdir) \
- INSTALL_DATA='$(install)' tmac_m=$(tmac_m) install
-
- uninstall: groff_mm.n groff_mmse.n
- $(MAKE) -f Makefile.sub tmacdir=$(tmacdir) srcdir=$(srcdir) \
- INSTALL_DATA='$(install)' tmac_m=$(tmac_m) uninstall_sub
-
-
-.man.n:
- @echo Making $@ from $<
- @-rm -f $@
- @sed -e "s|@HYPHENFILE@|$(hyphenfile)|g" \
- -e "s|@FONTDIR@|$(fontdir)|g" \
- -e "s|@FONTPATH@|$(fontpath)|g" \
- -e "s|@MACRODIR@|$(tmacdir)|g" \
- -e "s|@MACROPATH@|$(tmacpath)|g" \
- -e "s|@DEVICE@|$(DEVICE)|g" \
- -e "s|@DEFAULT_INDEX@|$(indexdir)/$(indexname)|g" \
- -e "s|@DEFAULT_INDEX_NAME@|$(indexname)|g" \
- -e "s|@INDEX_SUFFIX@|$(indexext)|g" \
- -e "s|@COMMON_WORDS_FILE@|$(common_words_file)|g" \
- -e "s|@MAN1EXT@|$(man1ext)|g" \
- -e "s|@MAN5EXT@|$(man5ext)|g" \
- -e "s|@MAN7EXT@|$(man7ext)|g" \
- -e "s|@TMAC_S@|$(tmac_s)|g" \
- -e "s|@TMAC_M@|$(tmac_m)|g" \
- -e "s|@TMAC_MDIR@|$(tmacdir)/mm|g" \
- -e "s|@BROKEN_SPOOLER_FLAGS@|$(BROKEN_SPOOLER_FLAGS)|g" \
- -e "s|@VERSION@|$(version)|g" \
- -e "s|@MDATE@|$(mdate)|g" \
- -e "s|@g@|$(g)|g" \
- -e "s!@G@;`echo $(g) | tr [a-z] [A-Z]`!g" \
- $< >$@
-
diff --git a/contrib/groff/mm/Makefile.sub b/contrib/groff/mm/Makefile.sub
deleted file mode 100644
index c706d711f42b..000000000000
--- a/contrib/groff/mm/Makefile.sub
+++ /dev/null
@@ -1,50 +0,0 @@
-#
-# $Id: Makefile.sub,v 1.3 2000/03/07 22:17:58 wlemb Exp $
-#
-PROG=mmroff
-MAN7=\
- groff_mm.n \
- groff_mmse.n \
- mmroff.n
-FILES=0.MT 5.MT 4.MT ms.cov se_ms.cov
-# Local configuration files with default values.
-LOCALE = locale se_locale
-CLEANADD=temp
-install: install_mm
-
-install_mm: install_mmroff install_m
- -test -d $(tmacdir)/mm || $(mkinstalldirs) $(tmacdir)/mm
- -for f in $(FILES); do \
- rm -f $(tmacdir)/mm/$$f; \
- $(INSTALL_DATA) $(srcdir)/mm/$$f $(tmacdir)/mm/$$f; \
- done
- -for f in $(LOCALE); do \
- test -f $(tmacdir)/mm/$$f || touch $(tmacdir)/mm/$$f; \
- done
-
-install_m:
- -test -d $(tmacdir) || $(mkinstalldirs) $(tmacdir)
- -rm -f $(tmacdir)/tmac.$(tmac_m_prefix)m
- $(INSTALL_DATA) $(srcdir)/tmac.m $(tmacdir)/tmac.$(tmac_m_prefix)m
- @sed -e "s;^.mso tmac.m;.mso tmac.$(tmac_m_prefix)m;g" \
- $(srcdir)/tmac.mse > $(tmacdir)/tmac.$(tmac_m_prefix)mse
-install_mmroff : mmroff
- -test -d $(bindir) || $(mkinstalldirs) $(bindir)
- -rm -f $(bindir)/mmroff
- $(INSTALL_SCRIPT) mmroff $(bindir)/mmroff
-
-mmroff: mmroff.pl
- -rm -f $@
- -sed -e 's;/usr/bin/perl;$(PERLPATH);' $(srcdir)/mmroff.pl >$@
- -chmod +x $@
-
-
-uninstall_sub:
- -for f in $(FILES); do rm -f $(tmacdir)/mm/$$f; done
- -for f in $(LOCALE); do \
- test -s $(tmacdir)/mm/$$f || rm -f $(tmacdir)/mm/$$f; \
- done
- -rm -f $(tmacdir)/tmac.$(tmac_m_prefix)m
- -rm -f $(tmacdir)/tmac.$(tmac_m_prefix)mse
- -rmdir $(tmacdir)/mm
- -rm -f $(bindir)/mmroff
diff --git a/contrib/groff/mm/NOTES b/contrib/groff/mm/NOTES
deleted file mode 100644
index 43794a29c646..000000000000
--- a/contrib/groff/mm/NOTES
+++ /dev/null
@@ -1,103 +0,0 @@
-######################################################################
-Beware!
-This may be old information. Trust only the source. :-)
-
-Implementation notes. (Or how to make your own national mm)
-
-Different commands:
-
-COVER [arg]
-MT [arg [addressee]]
-The arg is part of a filename in mm/*.MT or mm/*.cov.
-This file is read when the macro is executed. Therefore it must be
-put before any text output.
-In each file there are definitions of all extra macros needed for the
-cover sheet. MT files is only for compatibility reasons, and has several
-limits due to that it don't know when the cover starts, and cannot
-change sizes. Use COVER for new coversheet macros.
-
-But with MT it is possible to write all of the AT&T covers.
-An example can be found in mm/0.MT.
-
-When writing a new cover using COVER, have in mind that the cover
-should print the page with the COVEND macro. This macro
-should be defined by the new macrofile.
-
-Here is a part of ms.cov:
-> .\"-----------------
-> .de COVEND
-> .sp |4.2c
-> .cov@print-title
-> .cov@print-authors
-> .cov@print-firm
-> .cov@print-abstract
-> .cov@print-date
-This is important, since COVER disables the page header.
-> .pg@enable-top-trap
-Should begin with page one (normally).
-> .bp 1
-And enable the trap at the page footer.
-> .pg@enable-trap
-> ..
-
-#########################
-
-Variables for covers:
-I = integer
-S = string
-D = diversion
-M = macro
-
-Name Type Desc.
-cov*au I The number of authors.
-
-cov*title M Title collected with .TL.
-
-cov*au!x!y S Author(s) given to .AU
-cov*at!x!y S Author(s) title given to .AT
- x is the author-index [1-cov*au],
- y is the argument-index [1-9].
- Look at the table with indexes.
-
-cov*firm I Author(s) firm.
-
-cov*abs-arg I Argument to abstract.
-
-cov*abs-ind I Indent for abstract.
-
-cov*abs-name S The string 'ABSTRACT', changed with .AST
-
-cov*abstract M The abstract.
-
-cov*new-date S The date (todays date if ND is not used)
-
-cov*mt-type S MT type
-cov*mt-addresse S MT addressee
-
-
-##########################
-Argument-index for cov*au:
-
-Index Desc.
-1 name
-2 initials
-3 location
-4 department
-5 extension
-6 room
-7 arg 7
-8 arg 8
-9 arg 9
-
-The location is set to the contents of string cov*location-xxxx
-if location is equal to xxxx and cov*location-xxxx is defined
-in the file locale.
-
-
-Argument-index for cov*at:
-
-Index Desc.
-1 title 1
-. .
-. .
-9 title 9
diff --git a/contrib/groff/mm/README b/contrib/groff/mm/README
deleted file mode 100644
index a720f07054fd..000000000000
--- a/contrib/groff/mm/README
+++ /dev/null
@@ -1,28 +0,0 @@
-
-This is mgm, a macro package for groff.
-
-It is supposed to be compatible with the DWB mm macros,
-and has several extensions.
-
-Send bug reports to jh@axis.se with a description of the problem
-and a sample of text which reproduces the error.
-
-Don't forget to mention the version of mgm (look in the beginning
-of tmac.m) and the version of groff.
-
-Any new ideas or improvements are welcome.
-
-Newest version is available with anonymous FTP
-at ftp://ftp.efd.lth.se/pub/groff/mm.gz
-or ftp://ftp.axis.se/pub/groff/mm.gz
-
-You can install mgm as a separate package without the configure in groff
-with the following command:
-
-make -f Makefile.sim install
-
-This README should be bigger :-)
-
-Jörgen.
-
-Thanks to everyone who have sent me bug-reports and fixes.
diff --git a/contrib/groff/mm/examples/APP b/contrib/groff/mm/examples/APP
deleted file mode 100644
index 82352e58c3e4..000000000000
--- a/contrib/groff/mm/examples/APP
+++ /dev/null
@@ -1,352 +0,0 @@
-.H 1 " granary grand grandchild grandchildren granddaughter grandeur"
-granary
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.H 2 "grapefruit grapevine graph grapheme graphic graphite"
-granary
-grand
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.H 3 "grapple"
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.H 1 "Graves gravestone graveyard gravid gravitate gravy gray"
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.H 1 "Greenfield greengrocer greenhouse greenish Greenland Greensboro"
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.H 1 "greensward greenware Greenwich greenwood Greer greet"
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-.APP "" "Graves app a gravestone graveyard gravid gravitate gravy gray"
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.APP "" "Greenfield app b greengrocer greenhouse greenish Greenland Greensboro"
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-.H 2 "grandfather grandiloquent grandiose grandma grandmother grandnephew"
-.H 2 "grandniece grandpa grandparent grandson grandstand granite granitic"
-.H 2 "granny granola grant grantee grantor granular granulate"
-.H 2 "granule Granville grape"
-.H 2 "grapefruit grapevine graph grapheme graphic graphite"
-.H 3 "grapple"
-grandfather
-grandiloquent
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-.APP ABC "greensward app abc greenware Greenwich greenwood Greer greet"
-graven
-Graves
-.APP "" "handstand app f handwrite handwritten handy handyman handymen"
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-.APPSK "" 10 "Handel app c 10 handhold handicap handicapped handicapper"
-.APPSK "" 23 "handicapping app d 23 handicraftsmen handiwork"
-.APPSK "" 99 "handmade app e 99 handset handshake handsome handspike"
-.nr Aph 0
-.APP "" "handstand app f handwrite handwritten handy handyman handymen"
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-.H 2 "graybeard grayish Grayson graywacke graze grease greasy great greatcoat"
-.H 2 "greater grebe Grecian Greece greed greedy Greek green Greenbelt Greenberg"
-.H 2 "Greenblatt Greenbriar Greene greenery"
-.H 3 "Greenfield greengrocer greenhouse greenish Greenland Greensboro"
-.H 3 "greensward greenware Greenwich greenwood Greer greet"
-heady
-heal
-Healey
-health
-healthful
-healthy
-Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-heaven
-heavenward
-heavy
-heavyweight
-Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-.APP "" "hang hangable app f hangar hangman hangmen hangout hangover hank"
-Hecuba
-he'd
-hedge
-.H 2 "graybeard grayish Grayson graywacke graze grease greasy great greatcoat"
-hedgehog
-hedonism
-hedonist
-heed
-heel
-.H 2 "greater grebe Grecian Greece greed greedy Greek green Greenbelt Greenberg"
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-hello
-helm
-helmet
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-.APP "" "Hankel app g Hanley Hanlon Hanna Hannah Hannibal Hanoi Hanover"
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-henbane
-hence
-henceforth
-henchman
-henchmen
-.H 2 "greater grebe Grecian Greece greed greedy Greek green Greenbelt Greenberg"
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-.TC
diff --git a/contrib/groff/mm/examples/B1B2 b/contrib/groff/mm/examples/B1B2
deleted file mode 100644
index a2bb3add57d9..000000000000
--- a/contrib/groff/mm/examples/B1B2
+++ /dev/null
@@ -1,91 +0,0 @@
-abetting
-abeyance
-abeyant
-abhorred
-abhorrent
-abide
-Abidjan
-Abigail
-abject
-ablate
-ablaze
-able
-ablution
-Abner
-abnormal
-Abo
-aboard
-abode
-abolish
-.B1
-abolition
-abominable
-abominate
-aboriginal
-AAA
-ABORIGINE
-ABORNING
-ABORT
-ABOUND
-ABOUT
-ABOVE
-ABOVEBOARD
-ABOVEGROUND
-abovementioned
-abrade
-Abraham
-Abram
-Abramson
-abrasion
-abrasive
-abreact
-.B2
-abreast
-abrogate
-abrupt
-abscess
-abscissa
-abscissae
-absence
-absent
-absentee
-absenteeism
-absentia
-absentminded
-absinthe
-absolute
-absolution
-absolve
-absorb
-absorbent
-absorption
-absorptive
-abstain
-abstention
-abstract
-abstracter
-abstractor
-ABSURD
-ABUILDING
-ABUNDANT
-ABUSABLE
-ABUSE
-ABUSIVE
-ABUT
-ABUTTED
-ABUTTING
-ABYSMAL
-ABYSS
-ABYSSINIA
-AC
-ACADEME
-ACADEMIA
-ACADEMIC
-ACADEMICIAN
-ACADEMY
-ACADIA
-ACANTHUS
-ACAPULCO
-ACCEDE
-ACCELERATE
-ACCELEROMETER
diff --git a/contrib/groff/mm/examples/COVER b/contrib/groff/mm/examples/COVER
deleted file mode 100644
index d23597f0a897..000000000000
--- a/contrib/groff/mm/examples/COVER
+++ /dev/null
@@ -1,235 +0,0 @@
-.COVER
-.ND 911123
-.TL "charge" "filing"
-This is a test
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-.AU "Nisse Svensson" "DGY" "BF" "Computer Center" "5488" "5-2115" "nisse@vira.sture.elm"
-.AF "MT GRANDSTAND GRANITE GRANITIC"
-.AS 1 10
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-grebe
-Grecian
-.AE
-.COVEND
-Greece
-greed
-greedy
-Greek
-green
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-grebe
-Grecian
-Greece
-greed
-greedy
-Greek
-green
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-greenware
diff --git a/contrib/groff/mm/examples/IND b/contrib/groff/mm/examples/IND
deleted file mode 100644
index fbf6c43a031a..000000000000
--- a/contrib/groff/mm/examples/IND
+++ /dev/null
@@ -1,4191 +0,0 @@
-.de foo
-a=\\$1, b=\\$2
-.br
-..
-.INITI N ind-data
-.H 1 "halve"
-.IND granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-.IND grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-.IND granulate
-granule
-Granville
-grape
-.H 2 "grandfather grandiloquent grandiose grandma grandmother grandnephew"
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-.H 1 "halo halocarbon halogen Halpern Halsey Halstead halt halvah"
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-.IND grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-.H 1 "Han Hancock hand handbag handbook handclasp handcuff Handel handful"
-grebe
-Grecian
-Greece
-greed
-greedy
-.IND Greek
-green
-Greenbelt
-Greenberg
-.H 1 " granary grand grandchild grandchildren granddaughter grandeur"
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-.H 1 "handgun"
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-.IND gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-.IND grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-.IND groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-.H 1 "handicapped handicapper handicapping handicraft handicraftsman"
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-.IND growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
-guaranty
-guard
-guardhouse
-.IND Guardia
-guardian
-Guatemala
-.IND gubernatorial
-Guelph
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-.H 1 "handicraftsmen handiwork handkerchief handle"
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-.IND guilty
-guinea
-guise
-guitar
-gules
-gulf
-.H 1 "handleable handlebar handline handmade handmaiden handout"
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-.IND gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-.IND gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-.H 1 "handset"
-Gutenberg
-Guthrie
-gutsy
-guttural
-.IND guy
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-.IND gyrocompass
-gyroscope
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-.IND Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-.H 1 "handshake handsome handspike handstand handwaving handwrite handwritten"
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-.IND Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-.IND haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-.IND halfhearted
-halfway
-halibut
-halide
-.H 1 "handy handyman handymen Haney Hanford hang hangable hangar"
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-.IND Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-.IND Hampton
-hamster
-Han
-.H 1 "hangman hangmen hangout hangover hank Hankel Hanley"
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handful
-handgun
-handhold
-handicap
-handicapped
-.IND handicapper
-handicapping
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwaving
-.H 1 "Hanlon Hanna Hannah Hannibal Hanoi Hanover Hanoverian Hans"
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-.IND Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-.IND hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-.H 1 "Hansel"
-haphazard
-.IND haploid
-haploidy
-haplology
-happen
-happenstance
-happy
-Hapsburg
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-hardcopy
-harden
-hardhat
-Hardin
-.H 1 "Hansen hansom Hanson Hanukkah hap haphazard haploid haploidy"
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-.IND hardworking
-hardy
-hare
-harelip
-harem
-.IND hark
-Harlan
-Harlem
-Harley
-harm
-harmful
-Harmon
-harmonic
-harmonica
-harmonious
-.H 1 "haplology happen happenstance happy Hapsburg harangue harass Harbin"
-harmony
-harness
-Harold
-harp
-harpoon
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-.IND Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-.IND hatchet
-hatchway
-.IND hate
-hateful
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Hattiesburg
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Hausdorff
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-.IND Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-.H 2 "hammock Hammond hamper Hampshire Hampton hamster"
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-Hayward
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-head
-.IND headache
-.IND headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headquarters
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthful
-healthy
-.IND Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-.IND heaven
-heavenward
-heavy
-heavyweight
-.IND Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-he'd
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-.IND heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-.IND hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-.IND hello
-helm
-helmet
-.H 1 "Halverson ham Hamal Hamburg hamburger Hamilton hamlet Hamlin hammerhead"
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-.IND henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-.IND hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-.IND Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-herewith
-heritable
-heritage
-Herkimer
-Herman
-.IND Hermann
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-Hernandez
-hero
-Herodotus
-heroes
-heroic
-heroin
-.IND heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-.IND hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hesse
-Hessian
-Hester
-heterocyclic
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-.IND Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-.IND hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-.IND hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-.IND highwaymen
-hijack
-hijinks
-hike
-hilarious
-hilarity
-Hilbert
-.IND Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-.IND hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-Hippocrates
-Hippocratic
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-.IND hiss
-histamine
-histidine
-histochemic
-.IND histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-.H 1 "harbinger"
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-.IND hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-hobbyhorse
-hobgoblin
-hobo
-Hoboken
-hoc
-hock
-hockey
-hocus
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-.IND hoi
-.IND Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdout
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-.IND Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-.IND holystone
-.INDP
-inject injudicious Injun injunct injunction injure injurious injury
-injustice ink inkling inlaid inland inlay inlet Inman inmate inn innards
-innate inner innermost innkeeper innocent innocuous innovate innuendo
-innumerable inoculate inoffensive inoperable inoperative inopportune
-inordinate inorganic input inputting inquest inquire inquiry inquisition
-inquisitive inquisitor inroad insane insatiable inscribe inscription
-inscrutable insect insecticide insecure inseminate insensible insensitive
-inseparable insert inset inshore inside insidious insight insightful
-insignia insignificant insincere insinuate insipid insist insistent
-insofar insolent insoluble insolvable insolvent insomnia insomniac
-insouciant inspect inspector inspiration inspire instable install
-installation instalment instance instant instantaneous instantiate
-.INITI H ind-data2
-.H 1 "halve"
-.IND granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-.IND grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-.IND granulate
-granule
-Granville
-grape
-.H 2 "grandfather grandiloquent grandiose grandma grandmother grandnephew"
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-.H 1 "halo halocarbon halogen Halpern Halsey Halstead halt halvah"
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-.IND grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-.H 1 "Han Hancock hand handbag handbook handclasp handcuff Handel handful"
-grebe
-Grecian
-Greece
-greed
-greedy
-.IND Greek
-green
-Greenbelt
-Greenberg
-.H 1 " granary grand grandchild grandchildren granddaughter grandeur"
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-.H 1 "handgun"
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-.IND gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-.IND grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-.IND groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-.H 1 "handicapped handicapper handicapping handicraft handicraftsman"
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-.IND growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
-guaranty
-guard
-guardhouse
-.IND Guardia
-guardian
-Guatemala
-.IND gubernatorial
-Guelph
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-.H 1 "handicraftsmen handiwork handkerchief handle"
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-.IND guilty
-guinea
-guise
-guitar
-gules
-gulf
-.H 1 "handleable handlebar handline handmade handmaiden handout"
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-.IND gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-.IND gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-.H 1 "handset"
-Gutenberg
-Guthrie
-gutsy
-guttural
-.IND guy
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-.IND gyrocompass
-gyroscope
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-.IND Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-.H 1 "handshake handsome handspike handstand handwaving handwrite handwritten"
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-.IND Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-.IND haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-.IND halfhearted
-halfway
-halibut
-halide
-.H 1 "handy handyman handymen Haney Hanford hang hangable hangar"
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-.IND Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-.IND Hampton
-hamster
-Han
-.H 1 "hangman hangmen hangout hangover hank Hankel Hanley"
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handful
-handgun
-handhold
-handicap
-handicapped
-.IND handicapper
-handicapping
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwaving
-.H 1 "Hanlon Hanna Hannah Hannibal Hanoi Hanover Hanoverian Hans"
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-.IND Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-.IND hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-.H 1 "Hansel"
-haphazard
-.IND haploid
-haploidy
-haplology
-happen
-happenstance
-happy
-Hapsburg
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-hardcopy
-harden
-hardhat
-Hardin
-.H 1 "Hansen hansom Hanson Hanukkah hap haphazard haploid haploidy"
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-.IND hardworking
-hardy
-hare
-harelip
-harem
-.IND hark
-Harlan
-Harlem
-Harley
-harm
-harmful
-Harmon
-harmonic
-harmonica
-harmonious
-.H 1 "haplology happen happenstance happy Hapsburg harangue harass Harbin"
-harmony
-harness
-Harold
-harp
-harpoon
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-.IND Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-.IND hatchet
-hatchway
-.IND hate
-hateful
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Hattiesburg
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Hausdorff
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-.IND Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-.H 2 "hammock Hammond hamper Hampshire Hampton hamster"
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-Hayward
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-head
-.IND headache
-.IND headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headquarters
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthful
-healthy
-.IND Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-.IND heaven
-heavenward
-heavy
-heavyweight
-.IND Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-he'd
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-.IND heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-.IND hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-.IND hello
-helm
-helmet
-.H 1 "Halverson ham Hamal Hamburg hamburger Hamilton hamlet Hamlin hammerhead"
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-.IND henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-.IND hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-.IND Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-herewith
-heritable
-heritage
-Herkimer
-Herman
-.IND Hermann
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-Hernandez
-hero
-Herodotus
-heroes
-heroic
-heroin
-.IND heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-.IND hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hesse
-Hessian
-Hester
-heterocyclic
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-.IND Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-.IND hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-.IND hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-.IND highwaymen
-hijack
-hijinks
-hike
-hilarious
-hilarity
-Hilbert
-.IND Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-.IND hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-Hippocrates
-Hippocratic
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-.IND hiss
-histamine
-histidine
-histochemic
-.IND histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-.H 1 "harbinger"
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-.IND hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-hobbyhorse
-hobgoblin
-hobo
-Hoboken
-hoc
-hock
-hockey
-hocus
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-.IND hoi
-.IND Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdout
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-.IND Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-.IND holystone
-.INDP
-inject injudicious Injun injunct injunction injure injurious injury
-injustice ink inkling inlaid inland inlay inlet Inman inmate inn innards
-innate inner innermost innkeeper innocent innocuous innovate innuendo
-innumerable inoculate inoffensive inoperable inoperative inopportune
-inordinate inorganic input inputting inquest inquire inquiry inquisition
-.INITI B ind-data3
-.H 1 "halve"
-.IND granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-.IND grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-.IND granulate
-granule
-Granville
-grape
-.H 2 "grandfather grandiloquent grandiose grandma grandmother grandnephew"
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-.H 1 "halo halocarbon halogen Halpern Halsey Halstead halt halvah"
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-.IND grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-.H 1 "Han Hancock hand handbag handbook handclasp handcuff Handel handful"
-grebe
-Grecian
-Greece
-greed
-greedy
-.IND Greek
-green
-Greenbelt
-Greenberg
-.H 1 " granary grand grandchild grandchildren granddaughter grandeur"
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-.H 1 "handgun"
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-.IND gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-.IND grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-.IND groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-.H 1 "handicapped handicapper handicapping handicraft handicraftsman"
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-.IND growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
-guaranty
-guard
-guardhouse
-.IND Guardia
-guardian
-Guatemala
-.IND gubernatorial
-Guelph
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-.H 1 "handicraftsmen handiwork handkerchief handle"
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-.IND guilty
-guinea
-guise
-guitar
-gules
-gulf
-.H 1 "handleable handlebar handline handmade handmaiden handout"
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-.IND gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-.IND gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-.H 1 "handset"
-Gutenberg
-Guthrie
-gutsy
-guttural
-.IND guy
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-.IND gyrocompass
-gyroscope
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-.IND Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-.H 1 "handshake handsome handspike handstand handwaving handwrite handwritten"
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-.IND Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-.IND haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-.IND halfhearted
-halfway
-halibut
-halide
-.H 1 "handy handyman handymen Haney Hanford hang hangable hangar"
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-.IND Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-.IND Hampton
-hamster
-Han
-.H 1 "hangman hangmen hangout hangover hank Hankel Hanley"
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handful
-handgun
-handhold
-handicap
-handicapped
-.IND handicapper
-handicapping
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwaving
-.H 1 "Hanlon Hanna Hannah Hannibal Hanoi Hanover Hanoverian Hans"
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-.IND Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-.IND hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-.H 1 "Hansel"
-haphazard
-.IND haploid
-haploidy
-haplology
-happen
-happenstance
-happy
-Hapsburg
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-hardcopy
-harden
-hardhat
-Hardin
-.H 1 "Hansen hansom Hanson Hanukkah hap haphazard haploid haploidy"
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-.IND hardworking
-hardy
-hare
-harelip
-harem
-.IND hark
-Harlan
-Harlem
-Harley
-harm
-harmful
-Harmon
-harmonic
-harmonica
-harmonious
-.H 1 "haplology happen happenstance happy Hapsburg harangue harass Harbin"
-harmony
-harness
-Harold
-harp
-harpoon
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-.IND Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-.IND hatchet
-hatchway
-.IND hate
-hateful
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Hattiesburg
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Hausdorff
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-.IND Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-.H 2 "hammock Hammond hamper Hampshire Hampton hamster"
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-Hayward
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-head
-.IND headache
-.IND headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headquarters
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthful
-healthy
-.IND Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-.IND heaven
-heavenward
-heavy
-heavyweight
-.IND Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-he'd
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-.IND heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-.IND hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-.IND hello
-helm
-helmet
-.H 1 "Halverson ham Hamal Hamburg hamburger Hamilton hamlet Hamlin hammerhead"
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-.IND henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-.IND hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-.IND Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-herewith
-heritable
-heritage
-Herkimer
-Herman
-.IND Hermann
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-Hernandez
-hero
-Herodotus
-heroes
-heroic
-heroin
-.IND heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-.IND hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hesse
-Hessian
-Hester
-heterocyclic
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-.IND Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-.IND hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-.IND hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-.IND highwaymen
-hijack
-hijinks
-hike
-hilarious
-hilarity
-Hilbert
-.IND Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-.IND hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-Hippocrates
-Hippocratic
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-.IND hiss
-histamine
-histidine
-histochemic
-.IND histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-.H 1 "harbinger"
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-.IND hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-hobbyhorse
-hobgoblin
-hobo
-Hoboken
-hoc
-hock
-hockey
-hocus
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-.IND hoi
-.IND Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdout
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-.IND Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-.IND holystone
-.INDP
-inject injudicious Injun injunct injunction injure injurious injury
-injustice ink inkling inlaid inland inlay inlet Inman inmate inn innards
-innate inner innermost innkeeper innocent innocuous innovate innuendo
-innumerable inoculate inoffensive inoperable inoperative inopportune
-inordinate inorganic input inputting inquest inquire inquiry inquisition
-.INITI B ind-data4 foo
-.H 1 "halve"
-.IND granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-.IND grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-.IND granulate
-granule
-Granville
-grape
-.H 2 "grandfather grandiloquent grandiose grandma grandmother grandnephew"
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-.H 1 "halo halocarbon halogen Halpern Halsey Halstead halt halvah"
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-.IND grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-.H 1 "Han Hancock hand handbag handbook handclasp handcuff Handel handful"
-grebe
-Grecian
-Greece
-greed
-greedy
-.IND Greek
-green
-Greenbelt
-Greenberg
-.H 1 " granary grand grandchild grandchildren granddaughter grandeur"
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-.H 1 "handgun"
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-.IND gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-.IND grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-.IND groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-.H 1 "handicapped handicapper handicapping handicraft handicraftsman"
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-.IND growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
-guaranty
-guard
-guardhouse
-.IND Guardia
-guardian
-Guatemala
-.IND gubernatorial
-Guelph
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-.H 1 "handicraftsmen handiwork handkerchief handle"
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-.IND guilty
-guinea
-guise
-guitar
-gules
-gulf
-.H 1 "handleable handlebar handline handmade handmaiden handout"
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-.IND gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-.IND gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-.H 1 "handset"
-Gutenberg
-Guthrie
-gutsy
-guttural
-.IND guy
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-.IND gyrocompass
-gyroscope
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-.IND Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-.H 1 "handshake handsome handspike handstand handwaving handwrite handwritten"
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-.IND Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-.IND haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-.IND halfhearted
-halfway
-halibut
-halide
-.H 1 "handy handyman handymen Haney Hanford hang hangable hangar"
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-.IND Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-.IND Hampton
-hamster
-Han
-.H 1 "hangman hangmen hangout hangover hank Hankel Hanley"
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handful
-handgun
-handhold
-handicap
-handicapped
-.IND handicapper
-handicapping
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwaving
-.H 1 "Hanlon Hanna Hannah Hannibal Hanoi Hanover Hanoverian Hans"
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-.IND Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-.IND hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-.H 1 "Hansel"
-haphazard
-.IND haploid
-haploidy
-haplology
-happen
-happenstance
-happy
-Hapsburg
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-hardcopy
-harden
-hardhat
-Hardin
-.H 1 "Hansen hansom Hanson Hanukkah hap haphazard haploid haploidy"
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-.IND hardworking
-hardy
-hare
-harelip
-harem
-.IND hark
-Harlan
-Harlem
-Harley
-harm
-harmful
-Harmon
-harmonic
-harmonica
-harmonious
-.H 1 "haplology happen happenstance happy Hapsburg harangue harass Harbin"
-harmony
-harness
-Harold
-harp
-harpoon
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-.IND Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-.IND hatchet
-hatchway
-.IND hate
-hateful
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Hattiesburg
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Hausdorff
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-.IND Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-.H 2 "hammock Hammond hamper Hampshire Hampton hamster"
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-Hayward
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-head
-.IND headache
-.IND headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headquarters
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthful
-healthy
-.IND Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-.IND heaven
-heavenward
-heavy
-heavyweight
-.IND Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-he'd
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-.IND heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-.IND hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-.IND hello
-helm
-helmet
-.H 1 "Halverson ham Hamal Hamburg hamburger Hamilton hamlet Hamlin hammerhead"
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-.IND henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-.IND hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-.IND Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-herewith
-heritable
-heritage
-Herkimer
-Herman
-.IND Hermann
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-Hernandez
-hero
-Herodotus
-heroes
-heroic
-heroin
-.IND heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-.IND hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hesse
-Hessian
-Hester
-heterocyclic
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-.IND Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-.IND hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-.IND hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-.IND highwaymen
-hijack
-hijinks
-hike
-hilarious
-hilarity
-Hilbert
-.IND Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-.IND hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-Hippocrates
-Hippocratic
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-.IND hiss
-histamine
-histidine
-histochemic
-.IND histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-.H 1 "harbinger"
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-.IND hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-hobbyhorse
-hobgoblin
-hobo
-Hoboken
-hoc
-hock
-hockey
-hocus
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-.IND hoi
-.IND Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdout
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-.IND Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-.IND holystone
-.INDP
-inject injudicious Injun injunct injunction injure injurious injury
-injustice ink inkling inlaid inland inlay inlet Inman inmate inn innards
-innate inner innermost innkeeper innocent innocuous innovate innuendo
-innumerable inoculate inoffensive inoperable inoperative inopportune
-inordinate inorganic input inputting inquest inquire inquiry inquisition
diff --git a/contrib/groff/mm/examples/LT b/contrib/groff/mm/examples/LT
deleted file mode 100644
index cf063897371c..000000000000
--- a/contrib/groff/mm/examples/LT
+++ /dev/null
@@ -1,1058 +0,0 @@
-.ND 1994-10-26
-.\" .WA "Nisse Nilsson" notitle
-.\" .WE
-.WA "Sven Olsson" title
-Return address
-Street
-City, State Zip Code
-Text
-.WE
-.IA "Inside address" title
-Addressee name XXXXXXX
-Title XXXXXXXXXXXXXXX
-Company xxxxxxxxxxxx
-Street xxxxxxxxxxxxxx
-City, State Zip Code
-Text xxxxxxxxxxxxxxxxxx
-.IE
-.LO CN
-.LO RN "referens"
-.LO AT Attention
-.LO SA "Hej hopp"
-.LO SJ "Subject line"
-.LT BL
-hepp
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-grebe
-Grecian
-Greece
-greed
-greedy
-Greek
-green
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-.P
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
-guaranty
-guard
-guardhouse
-Guardia
-guardian
-Guatemala
-gubernatorial
-Guelph
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-guilty
-guinea
-guise
-guitar
-gules
-gulf
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-Gutenberg
-Guthrie
-gutsy
-guttural
-guy
-.P
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-gyrocompass
-gyroscope
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-halfhearted
-halfway
-halibut
-halide
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-Hampton
-hamster
-Han
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handful
-handgun
-handhold
-handicap
-handicapped
-handicapper
-handicapping
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwaving
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-haphazard
-haploid
-haploidy
-haplology
-happen
-happenstance
-happy
-Hapsburg
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-hardcopy
-harden
-hardhat
-Hardin
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-hardworking
-hardy
-hare
-harelip
-harem
-hark
-Harlan
-Harlem
-Harley
-harm
-harmful
-Harmon
-harmonic
-harmonica
-harmonious
-harmony
-harness
-Harold
-harp
-harpoon
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-.P
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-hatchet
-hatchway
-hate
-hateful
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Hattiesburg
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Hausdorff
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-Hayward
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-head
-headache
-headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headquarters
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthful
-healthy
-Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-heaven
-heavenward
-heavy
-heavyweight
-Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-he'd
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-hello
-helm
-helmet
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-.P
-herewith
-heritable
-heritage
-Herkimer
-Herman
-Hermann
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-Hernandez
-hero
-Herodotus
-heroes
-heroic
-heroin
-heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hesse
-Hessian
-Hester
-heterocyclic
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-highwaymen
-hijack
-hijinks
-hike
-hilarious
-hilarity
-Hilbert
-Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-Hippocrates
-Hippocratic
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-hiss
-histamine
-histidine
-histochemic
-histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-.P
-hobbyhorse
-hobgoblin
-hobo
-Hoboken
-hoc
-hock
-hockey
-hocus
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-hoi
-Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdout
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-holystone
-.FC
-.SG
-.NS 7
-text text text
-text text text
-.NS 12
-Holyoke
-holystone
-.NS
-holt
-.NE
diff --git a/contrib/groff/mm/examples/LT.se b/contrib/groff/mm/examples/LT.se
deleted file mode 100644
index bfbd77f5543e..000000000000
--- a/contrib/groff/mm/examples/LT.se
+++ /dev/null
@@ -1,1062 +0,0 @@
-.\" groff -mmse LT.se
-.ND 1994-10-26
-.WA "Sven Olsson" title
-Return address
-Street
-City, State Zip Code
-Text
-.WE
-.IA "Inside address" title
-Addressee name XXXXXXX
-Title XXXXXXXXXXXXXXX
-Company xxxxxxxxxxxx
-Street xxxxxxxxxxxxxx
-City, State Zip Code
-Text xxxxxxxxxxxxxxxxxx
-.IE
-.LO DNAMN Dokumentnamn
-.LO MDAT 1994-01-01
-.LO BIL 2
-.LO KOMP Kompletteringsuppgift
-.LO DBET dokumentnummer
-.LO BET ärendebeteckning
-.LO MBET "Mottagarens b"
-.LO SIDOR 22
-.\" vänster eller högerställt brev
-.\" .LT SVH
-.LT SVV
-hepp
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-grebe
-Grecian
-Greece
-greed
-greedy
-Greek
-green
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-.P
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
-guaranty
-guard
-guardhouse
-Guardia
-guardian
-Guatemala
-gubernatorial
-Guelph
-Guenther
-guerdon
-guernsey
-guerrilla
-guess
-guesswork
-guest
-guffaw
-Guggenheim
-Guiana
-guidance
-guide
-guidebook
-guideline
-guidepost
-guiding
-guignol
-guild
-guildhall
-guile
-Guilford
-guillemot
-guillotine
-guilt
-guilty
-guinea
-guise
-guitar
-gules
-gulf
-gull
-Gullah
-gullet
-gullible
-gully
-gulp
-gum
-gumbo
-gumdrop
-gummy
-gumption
-gumshoe
-gun
-Gunderson
-gunfight
-gunfire
-gunflint
-gunk
-gunky
-gunman
-gunmen
-gunnery
-gunny
-gunplay
-gunpowder
-gunshot
-gunsling
-Gunther
-gurgle
-Gurkha
-guru
-Gus
-gush
-gusset
-gust
-Gustafson
-Gustav
-Gustave
-Gustavus
-gusto
-gusty
-gut
-Gutenberg
-Guthrie
-gutsy
-guttural
-guy
-.P
-Guyana
-guzzle
-Gwen
-Gwyn
-gym
-gymnasium
-gymnast
-gymnastic
-gymnosperm
-gyp
-gypsite
-gypsum
-gypsy
-gyrate
-gyrfalcon
-gyro
-gyrocompass
-gyroscope
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-halfhearted
-halfway
-halibut
-halide
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-Hampton
-hamster
-Han
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-Handel
-handful
-handgun
-handhold
-handicap
-handicapped
-handicapper
-handicapping
-handicraft
-handicraftsman
-handicraftsmen
-handiwork
-handkerchief
-handle
-handleable
-handlebar
-handline
-handmade
-handmaiden
-handout
-handset
-handshake
-handsome
-handspike
-handstand
-handwaving
-handwrite
-handwritten
-handy
-handyman
-handymen
-Haney
-Hanford
-hang
-hangable
-hangar
-hangman
-hangmen
-hangout
-hangover
-hank
-Hankel
-Hanley
-Hanlon
-Hanna
-Hannah
-Hannibal
-Hanoi
-Hanover
-Hanoverian
-Hans
-Hansel
-Hansen
-hansom
-Hanson
-Hanukkah
-hap
-haphazard
-haploid
-haploidy
-haplology
-happen
-happenstance
-happy
-Hapsburg
-harangue
-harass
-Harbin
-harbinger
-Harcourt
-hard
-hardbake
-hardboard
-hardboiled
-hardcopy
-harden
-hardhat
-Hardin
-Harding
-hardscrabble
-hardtack
-hardtop
-hardware
-hardwood
-hardworking
-hardy
-hare
-harelip
-harem
-hark
-Harlan
-Harlem
-Harley
-harm
-harmful
-Harmon
-harmonic
-harmonica
-harmonious
-harmony
-harness
-Harold
-harp
-harpoon
-harpsichord
-Harpy
-Harriet
-Harriman
-Harrington
-Harris
-Harrisburg
-Harrison
-harrow
-harry
-harsh
-harshen
-hart
-Hartford
-Hartley
-Hartman
-Harvard
-.P
-harvest
-harvestman
-Harvey
-hash
-hashish
-hasn't
-hasp
-hassle
-hast
-haste
-hasten
-Hastings
-hasty
-hat
-hatch
-hatchet
-hatchway
-hate
-hateful
-hater
-Hatfield
-hath
-Hathaway
-hatred
-Hatteras
-Hattie
-Hattiesburg
-Haugen
-haughty
-haul
-haulage
-haunch
-haunt
-Hausdorff
-Havana
-have
-haven
-haven't
-Havilland
-havoc
-haw
-Hawaii
-Hawaiian
-hawk
-Hawkins
-Hawley
-hawthorn
-Hawthorne
-hay
-Hayden
-Haydn
-Hayes
-hayfield
-Haynes
-Hays
-haystack
-Hayward
-hayward
-hazard
-hazardous
-haze
-hazel
-hazelnut
-hazy
-he
-head
-headache
-headboard
-headdress
-headland
-headlight
-headline
-headmaster
-headphone
-headquarter
-headquarters
-headroom
-headset
-headsman
-headsmen
-headstand
-headstone
-headstrong
-headwall
-headwater
-headway
-headwind
-heady
-heal
-Healey
-health
-healthful
-healthy
-Healy
-heap
-hear
-heard
-hearken
-hearsay
-hearse
-Hearst
-heart
-heartbeat
-heartbreak
-hearten
-heartfelt
-hearth
-hearty
-heat
-heater
-heath
-heathen
-heathenish
-Heathkit
-heave
-heaven
-heavenward
-heavy
-heavyweight
-Hebe
-hebephrenic
-Hebraic
-Hebrew
-Hecate
-hecatomb
-heck
-heckle
-Heckman
-hectic
-hector
-Hecuba
-he'd
-hedge
-hedgehog
-hedonism
-hedonist
-heed
-heel
-heft
-hefty
-Hegelian
-hegemony
-Heidelberg
-heigh
-height
-heighten
-Heine
-Heinrich
-Heinz
-heir
-heiress
-Heisenberg
-held
-Helen
-Helena
-Helene
-Helga
-helical
-helicopter
-heliocentric
-heliotrope
-helium
-helix
-he'll
-hell
-hellbender
-hellebore
-Hellenic
-hellfire
-hellgrammite
-hellish
-hello
-helm
-helmet
-Helmholtz
-helmsman
-helmsmen
-Helmut
-help
-helpful
-helpmate
-Helsinki
-Helvetica
-hem
-hematite
-Hemingway
-hemisphere
-hemispheric
-hemlock
-hemoglobin
-hemolytic
-hemorrhage
-hemorrhoid
-hemosiderin
-hemp
-Hempstead
-hen
-henbane
-hence
-henceforth
-henchman
-henchmen
-Henderson
-Hendrick
-Hendricks
-Hendrickson
-henequen
-Henley
-henpeck
-Henri
-Henrietta
-henry
-hepatica
-hepatitis
-Hepburn
-heptane
-her
-Hera
-Heraclitus
-herald
-herb
-Herbert
-Herculean
-Hercules
-herd
-herdsman
-here
-hereabout
-hereafter
-hereby
-hereditary
-heredity
-Hereford
-herein
-hereinabove
-hereinafter
-hereinbelow
-hereof
-heresy
-heretic
-hereto
-heretofore
-hereunder
-hereunto
-.P
-herewith
-heritable
-heritage
-Herkimer
-Herman
-Hermann
-hermeneutic
-Hermes
-hermetic
-Hermite
-hermitian
-Hermosa
-Hernandez
-hero
-Herodotus
-heroes
-heroic
-heroin
-heroine
-heroism
-heron
-herpes
-herpetology
-Herr
-herringbone
-Herschel
-herself
-Hershel
-Hershey
-hertz
-Hertzog
-hesitant
-hesitate
-hesitater
-Hesperus
-Hess
-Hesse
-Hessian
-Hester
-heterocyclic
-heterodyne
-heterogamous
-heterogeneity
-heterogeneous
-heterosexual
-heterostructure
-heterozygous
-Hetman
-Hettie
-Hetty
-Heublein
-heuristic
-Heusen
-Heuser
-hew
-Hewett
-Hewitt
-Hewlett
-hewn
-hex
-hexachloride
-hexadecimal
-hexafluoride
-hexagon
-hexagonal
-hexameter
-hexane
-hey
-heyday
-hi
-Hiatt
-hiatus
-Hiawatha
-hibachi
-Hibbard
-hibernate
-Hibernia
-hick
-Hickey
-Hickman
-hickory
-Hicks
-hid
-hidalgo
-hidden
-hide
-hideaway
-hideous
-hideout
-hierarchal
-hierarchic
-hierarchy
-hieratic
-hieroglyphic
-Hieronymus
-hifalutin
-Higgins
-high
-highball
-highboy
-highest
-highfalutin
-highhanded
-highland
-highlight
-highroad
-hightail
-highway
-highwayman
-highwaymen
-hijack
-hijinks
-hike
-hilarious
-hilarity
-Hilbert
-Hildebrand
-hill
-hillbilly
-Hillcrest
-Hillel
-hillman
-hillmen
-hillock
-hillside
-hilltop
-hilly
-hilt
-Hilton
-hilum
-him
-Himalaya
-himself
-hind
-hindmost
-hindrance
-hindsight
-Hindu
-Hinduism
-Hines
-hinge
-Hinman
-hint
-hinterland
-hip
-hippo
-Hippocrates
-Hippocratic
-hippodrome
-hippopotamus
-hippy
-hipster
-Hiram
-hire
-hireling
-Hiroshi
-Hiroshima
-Hirsch
-hirsute
-his
-Hispanic
-hiss
-histamine
-histidine
-histochemic
-histochemistry
-histogram
-histology
-historian
-historic
-historiography
-history
-histrionic
-hit
-Hitachi
-hitch
-Hitchcock
-hither
-hitherto
-Hitler
-hive
-ho
-hoagie
-Hoagland
-hoagy
-hoar
-hoard
-hoarfrost
-hoarse
-hob
-Hobart
-Hobbes
-hobble
-Hobbs
-hobby
-.P
-hobbyhorse
-hobgoblin
-hobo
-Hoboken
-hoc
-hock
-hockey
-hocus
-hodge
-hodgepodge
-Hodges
-Hodgkin
-hoe
-Hoff
-Hoffman
-hog
-hogan
-hogging
-hoi
-Hokan
-Holbrook
-Holcomb
-hold
-holden
-holdout
-holdover
-holdup
-hole
-holeable
-holiday
-Holland
-Hollandaise
-holler
-Hollerith
-Hollingsworth
-Hollister
-hollow
-Holloway
-hollowware
-holly
-hollyhock
-Hollywood
-Holm
-Holman
-Holmdel
-Holmes
-holmium
-holocaust
-Holocene
-hologram
-holography
-Holst
-Holstein
-holster
-holt
-Holyoke
-holystone
-.FC
-.SG
-.NS 7
-text text text
-text text text
-.NS 12
-Holyoke
-holystone
-.NS
-holt
-.NE
diff --git a/contrib/groff/mm/examples/ML b/contrib/groff/mm/examples/ML
deleted file mode 100644
index bbfca3def549..000000000000
--- a/contrib/groff/mm/examples/ML
+++ /dev/null
@@ -1,169 +0,0 @@
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-.ML MARK
-.LI "LOCALMARK"
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-.LI
-.DS
-Where shall we put this.
-Where shall we put this.
-Where shall we put this.
-.DE
-.LI
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-.LI
-.DS
-Where shall we put this.
-.DE
-.LI
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-.LI
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-.LI
-gratuity
-grave
-gravel
-.LE
-.SP 3
-.ML $ 1c
-.LI
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-.LI
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-.LI
-greater
-grebe
-Grecian
-Greece
-greed
-greedy
-Greek
-green
-.LI
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-.LE
-.SP 3
-.ML X 1c 1
-.LI
-Greenfield
-greengrocer
-grandson
-grandstand
-granite
-granitic
-granny
-graph
-.LI
-grapheme
-greenhouse
-greenish
-Greenland
-Greensboro
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-.LI
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-.LI
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-.LI
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-.LE
diff --git a/contrib/groff/mm/examples/MOVE b/contrib/groff/mm/examples/MOVE
deleted file mode 100644
index 0f0399cc7a35..000000000000
--- a/contrib/groff/mm/examples/MOVE
+++ /dev/null
@@ -1,175 +0,0 @@
-.PH "'hej'hopp'i skogen'"
-.PF "'livet'är'härligt'"
-.OH "'ojämn'%'sida'"
-.EH "'ojämn'%'sida'"
-.OF "'ojämn'%'sida'"
-.EF "'ojämn'%'sida'"
-10th
-1st
-2nd
-3rd
-4th
-5th
-6th
-7th
-8th
-9th
-a
-AAA
-AAAS
-Aarhus
-Aaron
-AAU
-ABA
-Ababa
-aback
-abacus
-abalone
-abandon
-abase
-abash
-abate
-abater
-abbas
-abbe
-abbey
-abbot
-Abbott
-abbreviate
-abc
-abdicate
-abdomen
-abdominal
-abet
-abetted
-abetting
-abeyance
-abeyant
-abhorred
-abhorrent
-abide
-Abidjan
-Abigail
-abject
-ablate
-ablaze
-able
-ablution
-Abner
-.MOVE 50 20
-abnormal
-Abo
-aboard
-abode
-abolish
-abolition
-abominable
-abominate
-aboriginal
-AAA
-ABORIGINE
-ABORNING
-ABORT
-ABOUND
-ABOUT
-ABOVE
-ABOVEBOARD
-ABOVEGROUND
-abovementioned
-abrade
-Abraham
-Abram
-Abramson
-abrasion
-abrasive
-abreact
-abreast
-BBB
-ABRIDGE
-ABRIDGMENT
-ABROAD
-abrogate
-abrupt
-abscess
-abscissa
-abscissae
-absence
-absent
-absentee
-absenteeism
-absentia
-absentminded
-.MOVE 30 10
-absinthe
-absolute
-absolution
-absolve
-absorb
-absorbent
-absorption
-absorptive
-abstain
-abstention
-abstinent
-abstract
-abstracter
-abstractor
-CCC
-ABSTRUSE
-ABSURD
-ABUILDING
-ABUNDANT
-ABUSABLE
-ABUSE
-ABUSIVE
-ABUT
-ABUTTED
-ABUTTING
-ABYSMAL
-ABYSS
-ABYSSINIA
-AC
-ACADEME
-ACADEMIA
-ACADEMIC
-ACADEMICIAN
-ACADEMY
-ACADIA
-ACANTHUS
-ACAPULCO
-ACCEDE
-ACCELERATE
-ACCELEROMETER
-ACCENT
-ACCENTUAL
-ACCENTUATE
-ACCEPT
-ACCEPTANT
-acceptor
-access
-.MOVE 62 0 20
-accessible
-accession
-accessory
-accident
-accidental
-accipiter
-acclaim
-acclamation
-acclimate
-accolade
-accommodate
-accompaniment
-accompanist
-accompany
-accomplice
-accomplish
-accord
-accordant
-DDD
-ACCORDION
-ACCOST
-ACCOUNT
-ACCOUNTANT
-ACCRA
-.PGFORM
diff --git a/contrib/groff/mm/examples/MUL b/contrib/groff/mm/examples/MUL
deleted file mode 100644
index ae91fae0d404..000000000000
--- a/contrib/groff/mm/examples/MUL
+++ /dev/null
@@ -1,535 +0,0 @@
-inject
-injudicious
-Injun
-injunct
-injunction
-injure
-injurious
-injury
-injustice
-ink
-inkling
-inlaid
-inland
-inlay
-inlet
-Inman
-inmate
-inn
-innards
-innate
-inner
-innermost
-innkeeper
-innocent
-innocuous
-innovate
-innuendo
-innumerable
-inoculate
-inoffensive
-inoperable
-inoperative
-inopportune
-inordinate
-inorganic
-input
-inputting
-inquest
-inquire
-inquiry
-inquisition
-inquisitive
-inquisitor
-inroad
-insane
-insatiable
-inscribe
-inscription
-inscrutable
-insect
-insecticide
-insecure
-inseminate
-insensible
-insensitive
-inseparable
-insert
-inset
-inshore
-inside
-insidious
-insight
-insightful
-insignia
-insignificant
-insincere
-insinuate
-insipid
-insist
-insistent
-insofar
-insolent
-insoluble
-insolvable
-insolvent
-insomnia
-insomniac
-insouciant
-inspect
-inspector
-inspiration
-inspire
-instable
-install
-installation
-instalment
-instance
-instant
-instantaneous
-instantiate
-instead
-instep
-instigate
-instill
-instillation
-instinct
-instinctual
-institute
-institution
-instruct
-instructor
-instrument
-instrumentation
-insubordinate
-insubstantial
-insufferable
-insufficient
-insular
-insulate
-insulin
-insult
-insuperable
-insupportable
-insuppressible
-insurance
-insure
-insurgent
-insurmountable
-insurrect
-insurrection
-intact
-intake
-intangible
-integer
-integrable
-.MULB 4c 1 5c 1 4c 1 3c
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-grim
-grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-.MULN
-h
-ha
-Haag
-Haas
-habeas
-haberdashery
-Haberman
-Habib
-habit
-habitant
-habitat
-habitation
-habitual
-habituate
-hacienda
-hack
-hackberry
-Hackett
-hackle
-hackmatack
-hackney
-hackneyed
-hacksaw
-had
-Hadamard
-Haddad
-haddock
-Hades
-Hadley
-hadn't
-Hadrian
-hadron
-hafnium
-Hagen
-Hager
-haggard
-haggle
-Hagstrom
-Hague
-Hahn
-Haifa
-haiku
-hail
-hailstone
-hailstorm
-Haines
-hair
-haircut
-hairdo
-hairpin
-hairy
-Haiti
-Haitian
-Hal
-halcyon
-hale
-Haley
-half
-halfback
-halfhearted
-halfway
-halibut
-halide
-Halifax
-halite
-hall
-hallelujah
-Halley
-hallmark
-hallow
-Halloween
-hallucinate
-hallway
-halma
-halo
-halocarbon
-halogen
-Halpern
-Halsey
-Halstead
-halt
-halvah
-halve
-Halverson
-ham
-Hamal
-Hamburg
-hamburger
-Hamilton
-hamlet
-Hamlin
-hammerhead
-hammock
-Hammond
-hamper
-Hampshire
-Hampton
-hamster
-Han
-Hancock
-hand
-handbag
-handbook
-handclasp
-handcuff
-.MULN
-coliform
-coliseum
-collaborate
-collage
-collagen
-collapse
-collapsible
-collar
-collarbone
-collard
-collate
-collateral
-colleague
-collect
-collectible
-collector
-college
-collegial
-collegian
-collegiate
-collet
-collide
-collie
-Collier
-collimate
-collinear
-Collins
-collision
-collocation
-colloidal
-Colloq
-colloquia
-colloquial
-colloquium
-colloquy
-command
-commandant
-commandeer
-commando
-commemorate
-commend
-commendation
-commendatory
-commensurable
-commensurate
-comment
-commentary
-commentator
-commerce
-commercial
-commingle
-commiserate
-commissariat
-commissary
-commission
-commit
-committable
-committal
-committed
-committee
-committeeman
-committeemen
-committeewoman
-committeewomen
-committing
-commodious
-commodity
-commodore
-common
-commonality
-.MULN
-locoweed
-lunch
-luncheon
-lunchroom
-lunchtime
-Lund
-Lundberg
-Lundquist
-lung
-lunge
-lupine
-Lura
-lurch
-lure
-lurid
-lurk
-Lusaka
-luscious
-lush
-lust
-lustful
-lustrous
-lusty
-lutanist
-lute
-lutetium
-Luther
-Lutheran
-Lutz
-lymphocyte
-lymphoma
-lynch
-Lynchburg
-Lynn
-lynx
-Lyon
-Lyons
-Lyra
-lyric
-lyricism
-Lysenko
-lysergic
-lysine
-.MULE
-m
-ma
-Mabel
-Mac
-macabre
-macaque
-MacArthur
-Macassar
-Macbeth
-MacDonald
-MacDougall
-mace
-Macedon
-Macedonia
-MacGregor
-Mach
-Machiavelli
-machination
-machine
-machinelike
-machinery
-machismo
-macho
-macintosh
-mack
-MacKenzie
-mackerel
-Mackey
-Mackinac
-Mackinaw
-mackintosh
-MacMillan
-Macon
-macrame
-macro
-macromolecular
-macromolecule
-macrophage
-macroprocessor
-macroscopic
-macrostructure
-mad
-Madagascar
-madam
-Madame
-madcap
-madden
-Maddox
-made
-Madeira
-Madeleine
-Madeline
-madhouse
-Madison
-madman
-madmen
-Madonna
-Madras
-Madrid
-madrigal
-Madsen
-madstone
-Mae
-Maelstrom
-maestro
-Mafia
-magazine
-Magdalene
-magenta
-Maggie
-maggot
-maggoty
-magi
-magic
-magician
-magisterial
-magistrate
-magma
-magna
-magnanimity
-magnanimous
-magnate
-magnesia
-magnesite
-magnesium
-magnet
-magnetic
-magnetite
-magneto
-magnetron
-magnificent
-magnify
-magnitude
-magnolia
-magnum
-Magnuson
-Magog
-magpie
-Magruder
-Mahayana
-Mahayanist
-mahogany
-Mahoney
-maid
-maiden
-maidenhair
-maidservant
-Maier
-mail
-mailbox
-mailman
-mailmen
-maim
-main
-Maine
-mainland
-mainline
-mainstay
-mainstream
-maintain
-maintenance
-maitre
-majestic
-majesty
-major
-make
-makeshift
-makeup
-Malabar
-maladapt
-maladaptive
-maladjust
-maladroit
-malady
-Malagasy
-malaise
-malaprop
-malaria
-malarial
-Malawi
-Malay
-Malaysia
diff --git a/contrib/groff/mm/examples/NCOL b/contrib/groff/mm/examples/NCOL
deleted file mode 100644
index 82c6f8d50812..000000000000
--- a/contrib/groff/mm/examples/NCOL
+++ /dev/null
@@ -1,196 +0,0 @@
-granary
-grand
-grandchild
-grandchildren
-granddaughter
-grandeur
-grandfather
-grandiloquent
-grandiose
-grandma
-grandmother
-grandnephew
-grandniece
-grandpa
-grandparent
-grandson
-grandstand
-granite
-granitic
-granny
-granola
-grant
-grantee
-grantor
-granular
-granulate
-granule
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-grapple
-grasp
-grass
-grassland
-grassy
-.MC 3c
-grata
-grate
-grateful
-grater
-gratify
-gratis
-gratitude
-gratuitous
-gratuity
-grave
-gravel
-graven
-Graves
-gravestone
-graveyard
-gravid
-gravitate
-gravy
-gray
-graybeard
-grayish
-Grayson
-graywacke
-graze
-grease
-greasy
-great
-greatcoat
-greater
-grebe
-Grecian
-Greece
-greed
-greedy
-.NCOL
-Greek
-green
-Greenbelt
-Greenberg
-Greenblatt
-Greenbriar
-Greene
-greenery
-Greenfield
-greengrocer
-greenhouse
-greenish
-Greenland
-Greensboro
-greensward
-greenware
-Greenwich
-greenwood
-Greer
-greet
-Greg
-gregarious
-Gregg
-Gregory
-gremlin
-grenade
-Grendel
-Grenoble
-Gresham
-Greta
-Gretchen
-grew
-grey
-greyhound
-greylag
-grid
-griddle
-gridiron
-grief
-grievance
-grieve
-grievous
-griffin
-Griffith
-grill
-grille
-grilled
-grillwork
-.NCOL
-grim
-grimace
-Grimaldi
-grime
-Grimes
-Grimm
-grin
-grind
-grindstone
-grip
-gripe
-grippe
-grisly
-grist
-gristmill
-Griswold
-grit
-gritty
-grizzle
-grizzly
-groan
-groat
-grocer
-grocery
-groggy
-groin
-grommet
-groom
-groove
-grope
-grosbeak
-gross
-Grosset
-Grossman
-Grosvenor
-grotesque
-Groton
-ground
-groundsel
-groundskeep
-groundwork
-group
-groupoid
-grout
-grove
-grovel
-Grover
-grow
-growl
-grown
-grownup
-growth
-grub
-grubby
-grudge
-gruesome
-gruff
-grumble
-Grumman
-grunt
-gryphon
-g's
-GSA
-GU
-Guam
-guanidine
-guanine
-guano
-guarantee
-guaranteeing
-guarantor
diff --git a/contrib/groff/mm/examples/ND b/contrib/groff/mm/examples/ND
deleted file mode 100644
index 4b3694a37261..000000000000
--- a/contrib/groff/mm/examples/ND
+++ /dev/null
@@ -1,17 +0,0 @@
-.nf
-----------------------------------------------------------------------
-.ce
-Testing
-----------------------------------------------------------------------
-Date = \*[DT]
-.ISODATE
-Date = \*[DT]
-.ISODATE 0
-
-.ND "13 August 1992"
-Date = \*[DT]
-
-.ISODATE
-.ND "14 August 1992"
-Date = \*[DT]
-----------------------------------------------------------------------
diff --git a/contrib/groff/mm/examples/README b/contrib/groff/mm/examples/README
deleted file mode 100644
index cb6980f85327..000000000000
--- a/contrib/groff/mm/examples/README
+++ /dev/null
@@ -1,32 +0,0 @@
-
-This directory contains examples of my enhancements to MM.
-
-APP The appendix macro
-B1B2 Box macro with text
-COVER My general cover macro, this example is using
- ms.cov.
-IND A general indexing method, see manual for INITI
-LT The letter macro
-LT.se A swedish example with the extra
- swedish macros for getting a letter conforming
- to swedish standard letter, both left and right adjusted.
-ML Marked list, an extended list type
-MOVE The MOVE macro, how to begin to print on an exact position.
-MUL Enhanced multicolumn mode.
-NCOL Start on next column. (Not for MUL*)
-ND New date, with iso date example
-References How to use references
-SETR General reference system, see manual for INITR
-
-
-Examples that I should have:
-
-PIC How to include postscript pictures, see manual for PIC
-VERBON Begin verbatim output
-
-
-And remember, check the manual for all string and number registers,
-I've made shure that mgm will be useful in several languages
-and all english output can be redefined.
-Check the manual for groff_mse (swedish format) and the
-macro file, tmac.mse.
diff --git a/contrib/groff/mm/examples/References b/contrib/groff/mm/examples/References
deleted file mode 100644
index 72f648220903..000000000000
--- a/contrib/groff/mm/examples/References
+++ /dev/null
@@ -1,975 +0,0 @@
-.PH "'this'is'a header'"
-.PF "'this'is'a footer'"
-.OH "'odd'%'page'"
-.EH "'even'%'page'"
-.OF "'odd'%'page'"
-.EF "'even'%'page'"
-10th
-1st
-2nd
-3rd
-4th
-5th
-6th
-7th
-8th
-9th
-a
-AAA
-.B
-AAAS
-Aarhus
-Aaron
-.R
-AAU
-ABA
-Ababa
-aback
-abacus
-abalone
-abandon
-abase
-.H 1 "hej hopp"
-abash
-abate
-abater
-abbas
-abbe
-abbey
-abbot
-Abbott
-abbreviate
-abc
-abdicate
-abdomen
-abet
-abetted
-abetting
-abeyance
-abeyant
-.H 2 "hej hopp"
-abhorred
-abhorrent
-abide
-Abidjan
-Abigail
-abject
-ablate
-ablaze
-able
-ablution
-Abner
-abnormal
-.H 2 "hej hopp"
-Abo
-aboard
-abode
-abolish
-.HU "hej hopp"
-.B1
-abolition
-abominable
-abominate\*(Rf
-aboriginal
-.RS
-AAA
-ABORIGINE
-ABORNING
-ABORT
-ABOUND
-ABOUT
-ABOVE
-ABOVEBOARD
-ABOVEGROUND
-.RF
-abovementioned
-abrade
-Abraham\*(Rf
-Abram\*(Rf
-Abramson\*(Rf
-abrasion\*(Rf
-abrasive\*(Rf
-abreact\*(Rf
-.B2
-abreast\*(Rf
-.RS
-BBB
-ABRIDGE
-ABRIDGMENT
-ABROAD
-.RF
-abrogate
-abrupt
-abscess\*(Rf
-abscissa\*(Rf
-abscissae\*(Rf
-absence\*(Rf
-absent
-absentee
-absenteeism
-absentia
-.H 3 "hej hopp"
-absentminded
-absinthe
-absolute
-absolution
-absolve
-absorb
-absorbent
-absorption
-absorptive
-abstain
-abstention
-abstinent\*(Rf
-abstract
-abstracter
-abstractor
-.RS nisse
-CCC
-ABSTRUSE
-ABSURD
-ABUILDING
-ABUNDANT
-ABUSABLE
-ABUSE
-ABUSIVE
-ABUT
-ABUTTED
-ABUTTING
-ABYSMAL
-ABYSS
-ABYSSINIA
-AC
-ACADEME
-ACADEMIA
-ACADEMIC
-ACADEMICIAN
-ACADEMY
-ACADIA
-ACANTHUS
-ACAPULCO
-ACCEDE
-ACCELERATE
-ACCELEROMETER
-ACCENT
-ACCENTUAL
-ACCENTUATE
-ACCEPT
-ACCEPTANT
-.RF
-acceptor
-access
-accessible
-accession
-Ref \*[nisse]
-accessory
-.H 4 "hej hopp"
-accident
-accidental
-accipiter
-acclaim
-acclamation
-acclimate
-accolade
-accommodate
-accompaniment
-accompanist
-accompany
-accomplice
-accomplish\*(Rf
-accord
-accordant
-.RS
-DDD
-ACCORDION
-ACCOST
-ACCOUNT
-ACCOUNTANT
-ACCRA
-ACCREDIT
-ACCREDITATE
-ACCREDITATION
-ACCRETION
-ACCRUAL
-ACCRUE
-.RF
-acculturate
-accumulate
-accuracy
-accurate
-accusation
-accusative
-accusatory
-accuse
-accustom
-ace
-acerbic
-acerbity
-acetate
-acetic
-acetone
-acetylene
-ache
-achieve
-Achilles
-aching
-achromatic
-acid
-acidic
-acidulous
-.H 5 "hej hopp"
-Ackerman
-Ackley
-acknowledge
-acknowledgeable
-ACM
-acme
-acolyte
-acorn
-acoustic
-acquaint
-acquaintance
-acquiesce
-acquiescent
-acquire
-acquisition
-acquisitive
-acquit
-acquittal
-acquitting
-acre
-acreage
-acrid
-acrimonious
-acrimony
-acrobacy
-acrobat
-acrobatic
-acronym
-acropolis
-across
-acrylate
-acrylic
-ACS
-act
-Actaeon
-actinic
-actinide
-actinium
-actinolite
-actinometer
-activate
-activation
-activism
-Acton
-actor
-actress
-Acts
-actual
-actuarial
-actuate
-.H 6 "hej hopp"
-acuity
-acumen
-acute
-acyclic
-ad
-Ada
-adage
-adagio
-Adair
-Adam
-adamant
-Adams
-Adamson
-adapt
-adaptation
-adaptive
-add
-added
-addend
-addenda
-addendum
-addict
-Addis
-Addison
-addition
-additional
-additive
-addle
-address
-addressee
-Addressograph
-adduce
-Adelaide
-Adele
-Adelia
-Aden
-adenine
-adenoma
-adenosine
-adept
-adequacy
-adequate
-adhere
-adherent
-adhesion
-adhesive
-adiabatic
-adieu
-adipic
-Adirondack
-.H 7 "hej hopp"
-adjacent
-adject
-adjectival
-adjective
-adjoin
-adjoint
-adjourn
-adjudge
-adjudicate
-adjunct
-adjust
-adjutant
-Adkins
-Adler
-administer
-administrable
-administrate
-administratrix
-admiral
-admiralty
-admiration
-admire
-admissible
-admission
-admit
-admittance
-admitted
-admitting
-admix
-admixture
-admonish
-admonition
-ado
-adobe
-adolescent
-Adolph
-Adolphus
-Adonis
-adopt
-adoption
-adoptive
-adore
-adorn
-adposition
-adrenal
-adrenaline
-Adrian
-Adriatic
-Adrienne
-adrift
-adroit
-adsorb
-adsorbate
-adsorption
-adsorptive
-adulate
-adult
-adulterate
-adulterous
-adultery
-adulthood
-advance
-advantage
-advantageous
-advent
-adventitious
-adventure
-adventurous
-adverb
-adverbial
-adversary
-adverse
-advert
-advertise
-advice
-advisable
-advise
-advisee
-advisor
-advisory
-advocacy
-advocate
-Aegean
-aegis
-Aeneas
-Aeneid
-aeolian
-Aeolus
-aerate
-aerial
-Aerobacter
-aerobic
-aerodynamic
-aerogene
-aeronautic
-aerosol
-aerospace
-Aeschylus
-aesthete
-aesthetic
-10th
-1st
-2nd
-3rd
-4th
-5th
-6th
-7th
-8th
-9th
-a
-AAA
-AAAS
-Aarhus
-Aaron
-AAU
-ABA
-Ababa
-aback
-abacus
-abalone
-abandon
-abase
-.H 1 "hej hopp"
-abash
-abate
-abater
-abbas
-abbe
-abbey
-abbot
-Abbott
-abbreviate
-abc
-abdicate
-abdomen
-abdominal
-abduct
-Abe
-abed
-Abel
-Abelian
-Abelson
-Aberdeen
-Abernathy
-aberrant
-aberrate
-abet
-abetted
-abetting
-abeyance
-abeyant
-.H 2 "hej hopp"
-abhorred
-abhorrent
-abide
-Abidjan
-Abigail
-abject
-ablate
-ablaze
-able
-ablution
-Abner
-abnormal
-Abo
-aboard
-abode
-abolish
-abolition
-abominable
-abominate
-aboriginal
-aborigine
-aborning
-abort
-abound
-about
-above
-aboveboard
-aboveground
-abovementioned
-abrade
-Abraham
-Abram
-Abramson
-abrasion
-abrasive
-abreact
-abreast
-abridge
-abridgment
-abroad
-abrogate
-abrupt
-abscess
-abscissa
-abscissae
-absence
-absent
-absentee
-absenteeism
-absentia
-.H 3 "hej hopp"
-absentminded
-absinthe
-absolute
-absolution
-absolve
-absorb
-absorbent
-absorption
-absorptive
-abstain
-abstention
-abstinent
-abstract
-abstracter
-abstractor
-abstruse
-absurd
-abuilding
-abundant
-abusable
-abuse
-abusive
-abut
-abutted
-abutting
-abysmal
-abyss
-Abyssinia
-AC
-academe
-academia
-academic
-academician
-academy
-Acadia
-acanthus
-Acapulco
-accede
-accelerate
-accelerometer
-accent
-accentual
-accentuate
-accept
-acceptant
-acceptor
-access
-accessible
-accession
-accessory
-.H 4 "hej hopp"
-accident
-accidental
-accipiter
-acclaim
-acclamation
-acclimate
-accolade
-accommodate
-accompaniment
-accompanist
-accompany
-accomplice
-accomplish
-accord
-accordant
-accordion
-accost
-account
-accountant
-Accra
-accredit
-accreditate
-accreditation
-accretion
-accrual
-accrue
-acculturate
-accumulate
-accuracy
-accurate
-accusation
-accusative
-accusatory
-accuse
-accustom
-ace
-acerbic
-acerbity
-acetate
-acetic
-acetone
-acetylene
-ache
-achieve
-Achilles
-aching
-achromatic
-acid
-acidic
-acidulous
-.H 5 "hej hopp"
-Ackerman
-Ackley
-acknowledge
-acknowledgeable
-ACM
-acme
-acolyte
-acorn
-acoustic
-acquaint
-acquaintance
-acquiesce
-acquiescent
-acquire
-acquisition
-acquisitive
-acquit
-acquittal
-acquitting
-acre
-acreage
-acrid
-acrimonious
-acrimony
-acrobacy
-acrobat
-acrobatic
-acronym
-acropolis
-across
-acrylate
-acrylic
-ACS
-act
-Actaeon
-actinic
-actinide
-actinium
-actinolite
-actinometer
-activate
-activation
-activism
-Acton
-actor
-actress
-Acts
-actual
-actuarial
-actuate
-.H 6 "hej hopp"
-acuity
-acumen
-acute
-acyclic
-ad
-Ada
-adage
-adagio
-Adair
-Adam
-adamant
-Adams
-Adamson
-adapt
-adaptation
-adaptive
-add
-added
-addend
-addenda
-addendum
-addict
-Addis
-Addison
-addition
-additional
-additive
-addle
-address
-addressee
-Addressograph
-adduce
-Adelaide
-Adele
-Adelia
-Aden
-adenine
-adenoma
-adenosine
-adept
-adequacy
-adequate
-adhere
-adherent
-adhesion
-adhesive
-adiabatic
-adieu
-adipic
-Adirondack
-.H 7 "hej hopp"
-adjacent
-adject
-adjectival
-adjective
-adjoin
-adjoint
-adjourn
-adjudge
-adjudicate
-adjunct
-adjust
-adjutant
-Adkins
-Adler
-administer
-administrable
-administrate
-administratrix
-admiral
-admiralty
-admiration
-admire
-admissible
-admission
-admit
-admittance
-admitted
-admitting
-admix
-admixture
-admonish
-admonition
-ado
-adobe
-adolescent
-Adolph
-Adolphus
-Adonis
-adopt
-adoption
-adoptive
-adore
-adorn
-adposition
-adrenal
-adrenaline
-Adrian
-Adriatic
-Adrienne
-adrift
-adroit
-adsorb
-adsorbate
-adsorption
-adsorptive
-adulate
-adult
-adulterate
-adulterous
-adultery
-adulthood
-advance
-advantage
-advantageous
-advent
-adventitious
-adverse
-advert
-advertise
-advice
-advisable
-advise
-advisee
-advisor
-advisory
-advocacy
-advocate
-Aegean
-aegis
-Aeneas
-Aeneid
-aeolian
-Aeolus
-aerate
-aerial
-Aerobacter
-aerobic
-aerodynamic
-aerogene
-aeronautic
-aerosol
-aerospace
-Aeschylus
-aesthete
-aesthetic
-.H 1 "hej hopp"
-acuity
-acumen
-acute
-acyclic
-ad
-Ada
-adage
-adagio
-Adair
-Adam
-adamant
-Adams
-Adamson
-adapt
-adaptation
-adaptive
-add
-added
-addend
-addenda
-addendum
-addict
-Addis
-Addison
-addition
-additional
-additive
-addle
-address
-addressee
-Addressograph
-adduce
-Adelaide
-Adele
-Adelia
-Aden
-adenine
-adenoma
-adenosine
-adept
-adequacy
-adequate
-adhere
-adherent
-adhesion
-adhesive
-adiabatic
-adieu
-adipic
-Adirondack
-.H 2 "hej hopp"
-adjacent
-adject
-adjectival
-adjective
-adjoin
-adjoint
-adjourn
-adjudge
-adjudicate
-.H 2 "hej hopp"
-adjunct
-adjust
-adjutant
-Adkins
-Adler
-administer
-administrable
-administrate
-administratrix
-admiral
-admiralty
-admiration
-admire
-admissible
-admission
-admit
-admittance
-admitted
-admitting
-admix
-admixture
-admonish
-admonition
-ado
-adobe
-adolescent
-Adolph
-Adolphus
-Adonis
-adopt
-adoption
-adoptive
-adore
-adorn
-adposition
-adrenal
-adrenaline
-Adrian
-Adriatic
-Adrienne
-adrift
-adroit
-adsorb
-adsorbate
-adsorption
-adsorptive
-adulate
-adult
-adulterate
-adulterous
-adultery
-adulthood
-advance
-advantage
-advantageous
-advent
-adventitious
-adverse
-advert
-advertise
-advice
-advisable
-advise
-advisee
-advisor
-advisory
-advocacy
-advocate
-Aegean
-aegis
-Aeneas
-Aeneid
-aeolian
-Aeolus
-aerate
-aerial
-Aerobacter
-aerobic
-aerodynamic
-aerogene
-aeronautic
-aerosol
-aerospace
-Aeschylus
-aesthete
-aesthetic
-.RP 0 1
-.TC
diff --git a/contrib/groff/mm/examples/SETR b/contrib/groff/mm/examples/SETR
deleted file mode 100644
index 0a922415895e..000000000000
--- a/contrib/groff/mm/examples/SETR
+++ /dev/null
@@ -1,109 +0,0 @@
-.nr Cl 6
-.INITR setr
-.H 1 " granary grand grandchild grandchildren granddaughter grandeur"
-.SETR ref1
-.H 2 "grandfather grandiloquent grandiose grandma grandmother grandnephew"
-.H 2 "grandniece grandpa grandparent grandson grandstand granite granitic"
-.H 2 "granny granola grant grantee grantor granular granulate"
-.SETR ref2
-.H 2 "granule Granville grape"
-grant
-grantee
-grantor
-granular
-granulate
-.br
-granule
-.B
-REF 9:
-.GETHN ref9
-, page number
-.GETPN ref9
-.R
-Granville
-grape
-.br
-grapefruit
-grapevine
-graph
-grapheme
-graphic
-graphite
-\fBExhibit\fP
-.GETHN ex1
-
-grapple
-grasp
-grass
-grassland
-grassy
-grata
-grate
-.H 2 "grapefruit grapevine graph grapheme graphic graphite"
-.H 3 "grapple"
-.SETR ref3
-.H 3 "grasp grass grassland grassy grata grate grateful"
-.H 3 "grater gratify gratis gratitude"
-.H 4 "gratuitous gratuity grave"
-.H 4 "gravel graven"
-.SETR ref4
-.H 1 "Graves gravestone graveyard gravid gravitate gravy gray"
-.H 2 "graybeard grayish Grayson graywacke graze grease greasy great greatcoat"
-.H 2 "greater grebe Grecian Greece greed greedy Greek green Greenbelt Greenberg"
-.H 2 "Greenblatt Greenbriar Greene greenery"
-.SETR ref5
-.H 1 "Greenfield greengrocer greenhouse greenish Greenland Greensboro"
-.H 1 "greensward greenware Greenwich greenwood Greer greet"
-grant
-grantee
-.DS
-
-Advertisements contain the only truths to be relied on in a newspaper.
- -- Thomas Jefferson
-.EX fortune "" "" ex1
-.DE
-grantor
-granular
-.GETR ref1
-granulate
-granule
-.H 2 "Using variables"
-.B
-REF 2:
-.GETHN ref2 c
-.GETPN ref2 bbb
-\*c, page number \*[bbb]
-.R
-Granville
-grape
-grapefruit
-grapevine
-graph
-grapheme
-.H 2 "Greg gregarious Gregg Gregory gremlin grenade Grendel"
-.H 2 "Grenoble Gresham Greta Gretchen"
-.SETR ref6
-.H 2 "grew"
-.H 1 "grey greyhound greylag grid griddle gridiron grief"
-.H 1 "grievance grieve grievous griffin Griffith grill grille grilled grillwork"
-.H 3 "grim grimace Grimaldi grime Grimes Grimm grin grind grindstone"
-.H 3 "grip gripe grippe grisly grist gristmill Griswold grit"
-.SETR ref7
-.H 3 "gritty grizzle grizzly groan groat grocer grocery groggy groin"
-.H 1 "grommet groom groove grope grosbeak gross Grosset Grossman Grosvenor grotesque"
-.H 1 "Groton ground groundsel groundskeep groundwork group groupoid"
-.H 4 "grout grove grovel Grover grow growl grown grownup growth grub grubby"
-.H 4 "grudge gruesome gruff grumble Grumman grunt gryphon g's"
-.SETR ref8
-.H 4 "GSA GU Guam guanidine guanine guano guarantee guaranteeing guarantor"
-.H 4 "guaranty"
-.H 1 "guard guardhouse Guardia guardian Guatemala gubernatorial Guelph Guenther"
-.H 1 "guerdon guernsey guerrilla guess guesswork guest guffaw Guggenheim"
-.SETR ref9
-.H 1 "Guiana guidance guide guidebook guideline guidepost guiding"
-.H 1 "guignol"
-.GETR ref6
-.H 1 "guild guildhall guile Guilford guillemot guillotine guilt"
-.SETR ref10
-.H 1 "guilty guinea guise guitar gules gulf gull Gullah"
-.H 1 "gullet gullible gully gulp gum gumbo gumdrop gummy gumption"
diff --git a/contrib/groff/mm/groff_mm.man b/contrib/groff/mm/groff_mm.man
deleted file mode 100644
index a6de21b52383..000000000000
--- a/contrib/groff/mm/groff_mm.man
+++ /dev/null
@@ -1,1895 +0,0 @@
-.\"
-.\" $Id: groff_mm.man,v 1.3 2000/06/04 21:47:19 wlemb Exp $
-.\"
-.de T2
-.ne 2v
-.ti -.5i
-\\$1
-.sp -1
-..
-.de T3
-.ne 2v
-.ti -.5i
-\fB\\$1\fP
-.br
-..
-.TH GROFF_MM @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-groff_mm \- groff mm macros
-.SH SYNOPSIS
-.B groff
-.B \-m@TMAC_M_PREFIX@m
-[
-.IR options .\|.\|.
-]
-[
-.IR files .\|.\|.
-]
-.SH DESCRIPTION
-The groff mm macros are intended to be compatible with the DWB mm macros
-with the following limitations:
-.TP
-.B \(bu
-no Bell Labs localisms implemented.
-.TP
-.B \(bu
-the macros OK and PM is not implemented.
-.TP
-.B \(bu
-groff mm does not support cut marks
-.LP
-\fBm@TMAC_M_PREFIX@m\fP is intended to be international. Therefore it is
-possible to write short national macrofiles which change all
-english text to the preferred language. Use \fBm@TMAC_M_PREFIX@mse\fP as an example.
-.\"########################################################################
-.LP
-A file called \fBlocale\fP or \fIlang\fP\fB_locale\fP is read
-after the initiation of the global variables. It is therefore
-possible to localize the macros with companyname and so on.
-.sp
-In this manual square brackets is used to show optional arguments.
-.sp 3
-\fBNumber registers and strings\fP
-.br
-Many macros can be controlled by number registers and strings.
-A number register is assigned with the \fBnr\fP command:
-.br
-\fB\&.nr\fP \fIXXX\fP \fI[+-]n [i]\fP
-.br
-\fBXXX\fP is the name of the register, \fBn\fP is the value to
-be assigned, and \fBi\fP is increment value for auto-increment.
-\fBn\fP can have a plus or minus sign as prefix if an increment
-or decrement of the current value is wanted. (Auto-increment or decrement
-occurs if the number register is used with a plus or minus sign,
-\fB\en+[XXX]\fP or \fB\en-[XXX]\fP.)
-.sp
-Strings is defined with \fBds\fP.
-.br
-\fB\&.ds\fP \fIYYY string\fP
-.br
-The string is assigned everything to the end of the line, even blanks.
-Initial blanks in \fIstring\fP should be prefixed with
-a double-quote. (Strings are used in the text as \fB\e*[YYY]\fP.)
-.sp
-\fBSpecial formatting of number registers\fP
-.br
-A number register is printed with normal digits if no format has been
-given.
-Set the format with \fBaf\fP:
-.br
-\fB\&.af\fP \fIR c\fP
-.br
-\fIR\fP is the name of the register, \fIc\fP is the format.
-.in +.5i
-.T2 \fBForm\fP
-\fBSequence\fP
-.T2 1
-0, 1, 2, 3, ...
-.T2 001
-000, 001, 002, 003, ...
-.T2 i
-0, i, ii, iii, iv, ...
-.T2 I
-0, I, II, III, IV, ...
-.T2 a
-0, a, b, c, ..., z, aa, ab, ...
-.T2 A
-0, A, B, C, ..., Z, AA, AB, ...
-.in
-
-.LP
-\fBMacros:\fP
-.TP
-.B ")E level text"
-Adds \fBtext\fP (heading-text) to the table of contents
-with \fBlevel\fP either 0
-or between 1-7. See also \fB.H\fP. This macro is used for customized
-table of contents.
-.TP
-.B "1C [1]"
-Begin one column processing. An \fB1\fP as argument disables the page-break.
-Use wide footnotes, small footnotes may be overprinted.
-.TP
-.B 2C
-Begin two column processing. Splits the page in two columns. It is
-a special case of \fBMC\fP. See also \fB1C\fP.
-.TP
-.B AE
-Abstract end, see \fBAS\fP.
-.TP
-.B "AF [name of firm]"
-Authors firm, should be called before \fBAU\fP, see also \fBCOVER\fP.
-.TP
-.B "AL [type [text-indent [1]]]"
-Start autoincrement list. Items are numbered beginning on one.
-The \fItype\fP argument controls the type of numbers.
-.in +.5i
-.T2 Arg
-Description
-.T2 1
-Arabic (the default)
-.T2 A
-Upper-case letters (A-Z)
-.T2 a
-Lower-case letters (a-z)
-.T2 I
-Upper-case roman
-.T2 i
-Lower-case roman
-.in
-\fIText-indent\fP sets the indent and overrides \fBLi\fP.
-A third argument will prohibit printing of a blank line before each
-item.
-.TP
-.B "APP name text"
-Begin an appendix with name \fIname\fP. Automatic naming occurs if
-\fIname\fP is "". The appendixes starts with \fBA\fP if auto is used.
-An new page is ejected, and a header is also produced if the number
-variable \fBAph\fP is non-zero. This is the default.
-The appendix always appear in the 'List of contents' with correct
-pagenumber. The name \fIAPPENDIX\fP can be changed by setting
-the string \fBApp\fP to the desired text.
-The string \fBApptxt\fP contains the current appendix text.
-.TP
-.B "APPSK name pages text"
-Same as \fB.APP\fP, but the pagenr is incremented with \fIpages\fP.
-This is used when diagrams or other non-formatted documents are
-included as appendixes.
-.TP
-.B "AS [arg [indent]]"
-Abstract start. Indent is specified in 'ens', but scaling is allowed.
-Argument \fIarg\fP controls where the abstract is printed.
-.in +.5i
-.T2 Arg
-Placement
-.T2 0
-Abstract will be printed on page 1 and on the cover sheet if
-used in the released-paper style (\fBMT 4\fP), otherwise
-it will be printed on page 1 without a cover sheet.
-.T2 1
-Abstract will only be printed on the cover sheet (\fBMT 4\fP only).
-.T2 2
-Abstract will be printed only on the cover sheet (other than \fBMT 4\fP only).
-The cover sheet is printed without need for \fBCS\fP.
-.in
-Abstract is not printed at all in external letters (\fBMT 5\fP).
-The \fIindent\fP controls the indentation of both margins, otherwise
-will normal text indent be used.
-.TP
-.B "AST [title]"
-Abstract title. Default is \fBABSTRACT\fP.
-Sets the text above the abstract text.
-.TP
-.B "AT title1 [title2 ...]"
-Authors title. \fBAT\fP must appear just after each \fBAU\fP.
-The title will show up after the name in the signature block.
-.TP
-.B "AU [name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]]"
-Author information, specifies the author of the memo or paper, and
-will be printed on the cover sheet and on other similar places.
-\fBAU\fP must not appear before \fBTL\fP. The author information
-can contain initials, location, department, telephone extension,
-room number or name and up to three extra arguments.
-.TP
-.B "AV [name [1]]"
-Approval signature, generates an approval line with place for
-signature and date. The string \fBAPPROVED:\fP can be changed
-with variable \fBLetapp\fP, and the string \fBDate\fP in \fBLetdate\fP.
-.TP
-.B "AVL [name]"
-Letter signature, generates a line with place for signature.
-.TP
-.B "B [bold-text [prev-font-text [bold...]]]"
-Begin boldface.
-No limit on the number of arguments.
-All arguments will be concatenated to one word, the first, third and so
-on will be printed in boldface.
-.TP
-.B B1
-Begin box (as the ms macro).
-Draws a box around the text. The text will be indented one character,
-and the right margin will be one character shorter.
-.TP
-.B B2
-End box. Finish the box started by \fBB1\fP.
-.TP
-.B BE
-End bottom block, see \fBBS\fP.
-.TP
-.B "BI [bold-text [italic-text [bold-text [...]]]]"
-Bold-italic.
-No limit on the number of arguments, see \fBB\fP.
-.TP
-.B "BL [text-indent [1]]"
-Start bullet list, initialize a list with a bullet and a space
-in the beginning of each list item (see \fBLI\fP).
-\fIText-indent\fP
-overrides the default indentation of the list items set by
-number register \fBPi\fP.
-A third argument will prohibit printing of a blank line before each
-item.
-.TP
-.B "BR [bold-text [roman-text [bold-text [...]]]]"
-Bold-roman.
-No limit on the number of arguments.
-.TP
-.B BS
-Bottom block start. Begins the definition of a text block which is
-printed at the bottom of each page. Block ends with \fBBE\fP.
-.TP
-.B "BVL text-indent [mark-indent [1]]"
-Start of
-broken variable-item list.
-Broken variable-item list has no fixed mark, it assumes that
-every \fBLI\fP has a mark instead.
-The text will always begin at the next line after the mark.
-\fIText-indent\fP sets the indent to the text, and \fImark-indent\fP
-the distance from the current indent to the mark.
-A third argument will prohibit printing of a blank line before each
-item.
-.TP
-.B "COVER [arg]"
-\&\fBCOVER\fP begins a coversheet definition. It is important
-that \fB.COVER\fP appears before any normal text.
-\&\fB.COVER\fP uses \fIarg\fP to build the filename
-@TMAC_MDIR@/\fIarg\fP.cov. Therefore it is possible to create unlimited
-types of coversheets.
-\fIms.cov\fP is supposed to look like the \fBms\fP coversheet.
-\&\fB.COVER\fP requires a \fB.COVEND\fP at the end of the coverdefinition.
-Always use this order of the covermacros:
-.nf
-\&.COVER
-\&.TL
-\&.AF
-\&.AU
-\&.AT
-\&.AS
-\&.AE
-\&.COVEND
-.fi
-However, only \fB.TL\fP and \fB.AU\fP are required.
-.TP
-.B COVEND
-This finish the cover description and prints the cover-page.
-It is defined in the cover file.
-.TP
-.B DE
-Display end. Ends a block of text, display, that begins
-with \fBDS\fP or \fBDF\fP.
-.TP
-.B "DF [format [fill [rindent]]]"
-Begin floating display (no nesting allowed).
-A floating display is saved in a queue and is printed in the
-order entered. \fIFormat\fP, \fIfill\fP and \fIrindent\fP is the same
-as in \fBDS\fP.
-Floating displays are controlled by the two number registers \fBDe\fP
-and \fBDf\fP.
-.sp
-\fBDe register\fP
-.in +.5i
-.T2 0
-Nothing special, this is the default.
-.T2 1
-A page eject will occur after each printed display, giving only
-one display per page and no text following it.
-.in
-.sp
-\fBDf register\fP
-.in +.5i
-.T2 0
-Displays are printed at the end of each section (when section-page
-numbering is active) or at the end of the document.
-.T2 1
-A new display will be printed on the current page if there is enough
-space, otherwise it will be printed at the end of the document.
-.T2 2
-One display will be printed at the top of each page or column
-(in multi-column mode).
-.T2 3
-Print one display if there is enough space for it, otherwise it will
-be printed at the top of the next page or column.
-.T2 4
-Print as many displays that will fit in a new page or column.
-A page break will occur between each display if \fBDe\fP is not zero.
-.T2 5
-Fill the current page with displays and the rest beginning at a new page
-or column. (This is the default.)
-A page break will occur between each display
-if \fBDe\fP is not zero.
-.in
-.TP
-.B "DL [text-indent [1]]"
-Dash list start. Begins a list where each item is printed
-after a dash. \fIText-indent\fP changes the default indentation
-of the list items set by
-number register \fBPi\fP.
-A second argument prevents the empty line between each list item
-to be printed. See \fBLI\fP.
-.TP
-.B "DS [format [fill [rindent]]]"
-Static display start.
-Begins collection of text until \fBDE\fP.
-The text is printed together on the same page, unless it is longer
-than the height of the page.
-\fBDS\fP can be nested to a unlimited depth (reasonably :-).
-.sp
-\fBformat\fP
-.in +.5i
-.ds x "
-.T2 """"""
-No indentation.
-.T2 none
-No indentation.
-.T2 L
-No indentation.
-.T2 I
-Indent text with the value of number register \fBSi\fP.
-.T2 C
-Center each line
-.T2 CB
-Center the whole display as a block.
-.T2 R
-Right adjust the lines.
-.T2 RB
-Right adjust the whole display as a block
-.in
-.sp
-L, I, C and CB can also be specified as 0, 1, 2 or 3 for compatibility
-reasons. (Don't use it. :-)
-.sp
-\fBfill\fP
-.in +.5i
-.T2 """"""
-Line-filling turned off.
-.T2 none
-Line-filling turned off.
-.T2 N
-Line-filling turned off.
-.T2 F
-Line-filling turned on.
-.in
-.sp
-N and F can also be specified as 0 or 1.
-An empty line will normally be printed before and after the
-display. Setting number register \fBDs\fP to 0 will prevent this.
-\fIRindent\fP shortens the line length by that amount.
-.TP
-.B "EC [title [override [flag [refname]]]]"
-Equation title.
-Sets a title for an equation. The \fIoverride\fP argument
-change the numbering.
-.sp
-\fBflag\fP
-.in +.5i
-.T2 none
-\fIoverride\fP is a prefix to the number.
-.T2 0
-\fIoverride\fP is a prefix to the number.
-.T2 1
-\fIoverride\fP is a suffix to the number.
-.T2 2
-\fIoverride\fP replaces the number.
-.in
-\fBEC\fP uses the number register \fBEc\fP as counter.
-It is possible to use \fB.af\fP to change the format of the number.
-If number register \fBOf\fP is 1, then the format of title
-will use a dash instead of a dot after the number.
-.br
-The string \fBLe\fP controls the title of the
-List of Equations, default is \fILIST OF EQUATIONS\fP.
-The List of Equations will only be printed if number register \fBLe\fP
-is 1, default 0.
-The string \fBLiec\fP contains the word \fIEquation\fP, wich
-is printed before the number.
-If \fIrefname\fP is used, then the equation number is saved with
-\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
-.br
-Special handling of the title will occur if
-\fBEC\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
-affected by the format of \fBDS\fP.
-.TP
-.B "EF [arg]"
-Even-page footer, printed just above the normal page footer
-on even pages, see \fBPF\fP.
-.TP
-.B "EH [arg]"
-Even-page header, printed just below the normal page header
-on even pages, see \fBPH\fP.
-.TP
-.B EN
-Equation end, see \fBEQ\fP.
-.TP
-.B EOP
-End of page user-defined macro. This macro will be called
-instead of the normal printing of the footer. The macro
-will be executed in a separate environment, without any
-trap active. See \fBTP\fP.
-.sp
-\fBStrings available to EOP\fP
-.in +.5i
-.T2 EOPf
-Argument from \fBPF\fP.
-.T2 EOPef
-Argument from \fBEF\fP.
-.T2 EOPof
-Argument from \fBOF\fP.
-.in
-.TP
-.B "EPIC width height [name]"
-\fBEPIC\fP draws a box with the given \fIwidth\fP and \fIheight\fP, it will
-also print the text \fIname\fP or a default string if
-\fIname\fP is not specified..
-This is used to include external pictures, just give the size
-of the picture.
-See \fBPIC\fP
-.TP
-.B "EQ [label]"
-Equation start.
-\fBEQ\fP/\fBEN\fP are the delimiters for equations written for \fBeqn\fP.
-\fBEQ\fP/\fBEN\fP must be inside a \fBDS\fP/\fBDE\fP-pair, except
-when \fBEQ\fP is only used to set options in \fBeqn\fP.
-The \fIlabel\fP will appear at the right margin of the equation, unless
-number register \fBEq\fP is 1. Then the label will appear at the
-left margin.
-.TP
-.B "EX [title [override [flag [refname]]]]"
-Exhibit title, arguments are the same as for \fBEC\fP.
-\fBEX\fP uses the number register \fBEx\fP as counter.
-The string \fBLx\fP controls the title of the
-List of Exhibits, default is \fILIST OF EXHIBITS\fP.
-The List of Exhibits will only be printed if number register \fBLx\fP
-is 1, default 1.
-The string \fBLiex\fP contains the word \fIExhibit\fP, which
-is printed before the number.
-If \fIrefname\fP is used, then the exhibit number is saved with
-\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
-.br
-Special handling of the title will occur if
-\fBEX\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
-affected by the format of \fBDS\fP.
-.TP
-.B "FC [closing]"
-Prints \fIYours\ very\ truly,\fP as a formal closing of a letter or
-memorandum. The argument replaces the defualt string.
-The default is stored in string variable \fBLetfc\fP.
-.TP
-.B "FD [arg [1]]"
-Footnote default format.
-Controls the hyphenation (hyphen), right margin justification (adjust),
-indentation of footnote text (indent). It can also change the label
-justification (ljust).
-.sp
-.ne 14v
-.nf
-.ta .5i +.8i +.8i +.8i +.8i
-\fBarg hyphen adjust indent ljust\fP
-0 no yes yes left
-1 yes yes yes left
-2 no no yes left
-3 yes no yes left
-4 no yes no left
-5 yes yes no left
-6 no no no left
-7 yes no no left
-8 no yes yes right
-9 yes yes yes right
-10 no no yes right
-11 yes no yes right
-.sp
-.fi
-.DT
-Argument greater than 11 is considered as arg 0.
-Default for m@TMAC_M_PREFIX@m is 10.
-.TP
-.B FE
-Footnote end.
-.TP
-.B "FG [title [override [flag [refname]]]]"
-Figure title, arguments are the same as for \fBEC\fP.
-\fBFG\fP uses the number register \fBFg\fP as counter.
-The string \fBLf\fP controls the title of the
-List of Figures, default is \fILIST OF FIGURES\fP.
-The List of Figures will only be printed if number register \fBLf\fP
-is 1, default 1.
-The string \fBLifg\fP contains the word \fIFigure\fP, wich
-is printed before the number.
-If \fIrefname\fP is used, then the figure number is saved with
-\&\fB.SETR\fP, and can be retrieved with \fB.GETST\fP \fIrefname\fP.
-.br
-Special handling of the title will occur if
-\fBFG\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
-affected by the format of \fBDS\fP.
-.TP
-.B "FS [label]"
-Footnote start.
-The footnote is ended by \fBFE\fP. Footnotes is normally automatically
-numbered, the number is available in string \fBF\fP.
-Just add \fB\e*F\fP in the text. By adding \fIlabel\fP, it is possible
-to have other number or names on the footnotes.
-Footnotes in displays is now possible.
-An empty line separates footnotes, the height of the line
-is controlled by number register \fBFs\fP, default value is 1.
-.TP
-.B "GETHN refname [varname]"
-Includes the headernumber where the corresponding \fBSETR\fP \fIrefname\fP
-was placed. Will be X.X.X. in pass 1. See \fBINITR\fP.
-If \fIvarname\fP is used, \fBGETHN\fP sets the stringvariable \fIvarname\fP to the
-headernumber.
-.TP
-.B "GETPN refname [varname]"
-Includes the pagenumber where the corresponding \fBSETR\fP \fIrefname\fP
-was placed. Will be 9999 in pass 1. See \fBINITR\fP.
-If \fIvarname\fP is used, \fBGETPN\fP sets the stringvariable \fIvarname\fP
-to the pagenumber.
-.TP
-.B "GETR refname"
-Combines \fBGETHN\fP and \fBGETPN\fP with the text 'chapter' and ', page'.
-The string \fIQrf\fP contains the text for reference:
-.ti +.5i
-\&.ds Qrf See chapter \e\e*[Qrfh], page \e\e*[Qrfp].
-.br
-\fIQrf\fP may be changed to support other languages.
-Strings \fIQrfh\fP and \fIQrfp\fP are set by \fBGETR\fP
-and contains the page and headernumber.
-.TP
-.B "GETST refname [varname]"
-Includes the string saved with the second argument to \fB.SETR\fP.
-Will be dummystring in pass 1.
-If varname is used, \fBGETST\fP sets the stringvariable \fIvarname\fP to the
-saved string. See \fBINITR\fP.
-.TP
-.B "H level [heading-text [heading-suffix]]"
-Numbered section heading.
-Section headers can have a level between 1 and 7, level 1 is the
-top level. The text is given in \fIheading-text\fP, and must be
-surrounded by double quotes if it contains spaces.
-\fBHeading-suffix\fP is added to the header in the text but not in
-the table of contents. This is normally used for footnote marks
-and similar things. Don't use \fB\e*F\fP in \fIheading-suffix\fP, it won't
-work. A manual label must be used, see \fBFS\fP.
-.sp
-An eventual paragraph, \fBP\fP, directly after \fBH\fP will be
-ignored, \fBH\fP is taking care of spacing and indentation.
-.sp
-\fBPage ejection before heading\fP
-.br
-Number register \fBEj\fP controls page ejection before the heading.
-Normally, a level one heading gets two blank lines before it, higher levels
-gets only one. A new page is ejected before each
-first-level heading if number register \fBEj\fP is 1.
-All levels below or equal the value of \fBEj\fP gets a new page.
-Default value for \fBEj\fP is 0.
-.sp
-\fBHeading break level\fP
-.br
-A line break occurs after the heading if the heading level is less
-or equal to number register \fBHb\fP.
-Default value 2.
-.sp
-\fBHeading space level\fP
-.br
-A blank line is inserted after the heading if the heading level is less
-or equal to number register \fBHs\fP.
-Default value 2.
-.sp
-Text will follow the heading on the same line if the level is greater
-than both \fBHb\fP and \fBHs\fP.
-.sp
-\fBPost-heading indent\fP
-.br
-Indentation of the text after the heading is controlled by number
-register \fBHi\fP, default value 0.
-.sp
-\fBHi\fP
-.in +.5i
-.T2 0
-The text will be left-justified.
-.T2 1
-Indentation of the text will follow the value of number register \fBPt\fP,
-see \fBP\fP.
-.T2 2
-The text will be lined up with the first word of the heading.
-.in
-.sp
-\fBCentered section headings\fP
-.br
-All headings whose level is equal or below number register \fBHc\fP
-and also less than or equal to \fBHb\fP or \fBHs\fP
-is centerered.
-.sp
-\fBFont control of the heading\fP
-.br
-The font of each heading level is controlled by string \fBHF\fP.
-It contains a fontnumber or fontname for each level. Default
-is \fB2\ 2\ 2\ 2\ 2\ 2\ 2\fP (all headings in italic).
-Could also be written as \fBI\ I\ I\ I\ I\ I\ I\fP.
-All omitted values are presumed to be a 1.
-.sp
-\fBPoint size control\fP.
-.br
-String \fBHP\fP controls the pointsize of each heading, in the
-same way as \fBHF\fP controls the font.
-A value of 0 selects the default point size.
-Default value is \fB0\ 0\ 0\ 0\ 0\ 0\ 0\fP. Beware that only the
-point size changes, not the vertical size.
-That can be controlled by the user specified macro \fBHX\fP and/or
-\fBHZ\fP.
-.sp
-\fBHeading counters\fP
-.br
-Seven number registers, named \fBH1\fP thru \fBH7\fP contains
-the counter for each heading level.
-The values are printed using arabic numerals, this can be changed
-with the macro \fBHM\fP (see below).
-All marks are concatenated before printing. To avoid this, set
-number register \fBHt\fP to 1. That will only print the current
-heading counter at each heading.
-.sp
-\fBAutomatic table of contents\fP
-.br
-All headings whose level is equal or below number register \fBCl\fP
-is saved to be printed in the table of contents. Default value is 2.
-.sp
-\fBSpecial control of the heading, user-defined macros\fP.
-.br
-These macros can be defined by the user to get a finer control
-of vertical spacing, fonts or other features.
-Argument \fIlevel\fP is the level-argument to \fBH\fP, but
-0 for unnumbered headings (see \fBHU\fP).
-Argument \fIrlevel\fP is the real level, it is
-set to number register \fBHu\fP for unnumbered headings.
-Argument \fIheading-text\fP is the text argument to \fBH\fP and \fBHU\fP.
-.sp
-\fBHX\ \fP\fIlevel\ rlevel\ heading-text\fP
-.br
-\fBHX\fP is called just before the printing of the heading.
-The following register is available for \fBHX\fP.
-\fBHX\fP may alter \fB}0\fP, \fB}2\fP and \fB;3\fP.
-.in +.5i
-.T3 "string }0"
-Contains the heading mark plus two spaces if \fIrlevel\fP is non-zero,
-otherwise empty.
-.T3 "register ;0"
-Contains the position of the text after the heading.
-0 means that the text should follow the heading on the same line, 1
-means that a line break should occur before the text and
-2 means that a blank line should separate the heading and the text.
-.T3 "string }2"
-Contains two spaces if register \fB;0\fP is 0. It is used to
-separate the heading from the text. The string
-is empty if \fB;0\fP is non-zero.
-.T3 "register ;3"
-Contains the needed space in units after the heading.
-Default is 2v.
-
-Can be used to change things like numbering (\fB}0\fP),
-vertical spacing (\fB}2\fP)
-and the needed space after the heading.
-.in
-.sp
-\fBHY\ \fP\fIdlevel\ rlevel\ heading-text\fP
-.br
-\fBHY\fP is called after size and font calculations and
-might be used to change indentation.
-.sp
-\fBHZ\ \fP\fIdlevel\ rlevel\ heading-text\fP
-.br
-\fBHZ\fP is called after the printing of the heading, just before
-\fBH\fP or \fBHU\fP exits.
-Could be used to change the page header according to the section heading.
-.TP
-.B "HC [hyphenation-character]"
-Set hyphenation character.
-Default value is \e%.
-Resets to the default if called without argument.
-Hyphenation can be turned off by setting number
-register \fBHy\fP to 0 in the beginning of the file.
-.TP
-.B "HM [arg1 [arg2 [... [arg7]]]]"
-Heading mark style.
-Controls the type of marking for printing of the heading counters.
-Default is 1 for all levels.
-.sp
-\fBArgument\fP
-.in +.5i
-.T2 1
-Arabic numerals.
-.T2 0001
-Arabic numerals with leading zeroes, one or more.
-.T2 A
-Upper-case alphabetic
-.T2 a
-Lower-case alphabetic
-.T2 I
-Upper-case roman numerals
-.T2 i
-lower-case roman numerals
-.T2 \fIempty\fP
-Arabic numerals.
-.in
-.TP
-.B "HU heading-text"
-Unnumbered section header.
-\fBHU\fP behavies like \fBH\fP at the level in number register \fBHu\fP.
-See \fBH\fP.
-.TP
-.B "HX dlevel rlevel heading-text"
-Userdefined heading exit.
-Called just before printing the header.
-See \fBH\fP.
-.TP
-.B "HY dlevel rlevel heading-text"
-Userdefined heading exit.
-Called just before printing the header.
-See \fBH\fP.
-.TP
-.B "HZ dlevel rlevel heading-text"
-Userdefined heading exit.
-Called just after printing the header.
-See \fBH\fP.
-.TP
-.B "I [italic-text [prev-font-text [italic-text [...]]]]"
-Italic.
-Changes the font to italic if called without arguments.
-With one argument it will set the word in italic.
-With two argument it will concatenate them and set the first
-word in italic and the second in the previous font.
-There is no limit on the number of argument, all will be concatenated.
-.TP
-.B "IA [addressee-name [title]]"
-Begins specification of the addressee and addressee's address in
-letter style.
-Several names can be specified with empty \fBIA\fP/\fBIE\fP-pairs, but
-only one address.
-See \fBLT\fP.
-.TP
-.B "IB [italic-text [bold-text [italic-text [...]]]]"
-Italic-bold.
-Even arguments is printed in italic, odd in boldface.
-See \fBI\fP.
-.TP
-.B IE
-Ends the address-specification after \fPIA\fP.
-.TP
-.B "INITI type filename [macro]"
-Initialize the new index system, sets the filename to collect
-index lines in with \fBIND\fP. Argument \fItype\fP selects
-the type of index, page number, header marks or both.
-The default is \fIN\fP.
-
-It is also possible to create a macro that is responsible
-for formatting each row. Add the name of the macro as argument 3.
-The macro will be called with the index as argument(s).
-.sp
-\fBtype\fP
-.in +.5i
-.T2 N
-Page numbers
-.T2 H
-Header marks
-.T2 B
-Both page numbers and header marks, tab separated
-.in
-.TP
-.B "INITR filename"
-Initialize the refencemacros. References will be written to
-\fIfilename.tmp\fP and \fIfilename.qrf\fP. Requires two passes with groff.
-The first looks for references and the second includes them.
-\fBINITR\fP can be used several times, but it is only the first
-occurrence of \fBINITR\fP that is active.
-Option \fB-U\fP might be needed if \fBunsafe\fP-errors occur.
-See also \fBSETR\fP, \fBGETPN\fP and \fBGETHN\fP.
-.TP
-.B "IND arg1 [arg2 [...]]"
-\fBIND\fP writes a line in the index file selected by \fBINITI\fP
-with all arguments and the page number or header mark separated by tabs.
-.in +.5i
-\fBExamples\fP
-.br
-arg1\etpage number
-.br
-arg1\etarg2\etpage number
-.br
-arg1\etheader mark
-.br
-arg1\etpage number\etheader mark
-.in
-.TP
-.B "INDP"
-\fBINDP\fP prints the index by running the command specified
-by string variable \fBIndcmd\fP, normally \fIsort\ -t\et\fP.
-\fBINDP\fP reads the output from the command to form
-the index, normally in two columns (can be changed by defining \fBTYIND\fP).
-The index is printed with string variable \fBIndex\fP as header,
-default is \fBINDEX\fP. One-column processing is
-returned after the list. \fBINDP\fP will call the
-user-defined macros \fBTXIND\fP, \fBTYIND\fP and \fBTZIND\fP if defined.
-\fBTXIND\fP is called before printing \fBINDEX\fP, \fBTYIND\fP
-is called instead of printing \fBINDEX\fP. \fBTZIND\fP is called
-after the printing and should take care of restoring to normal
-operation again.
-.TP
-.B "ISODATE [0]"
-\fBISODATE\fP changes the predefined date string in \fBDT\fP to
-ISO-format, ie YYYY-MM-DD. This can also be done by
-adding \fB-rIso=1\fP on the command line.
-Reverts to old date format if argument is \fB0\fP.
-.TP
-.B "IR [italic-text [roman-text [italic-text [...]]]]"
-Italic-roman.
-Even arguments is printed in italic, odd in roman.
-See \fBI\fP.
-.TP
-.B "LB text-indent mark-indent pad type [mark [LI-space [LB-space]]]"
-List begin macro.
-This is the common macro used for all lists.
-\fIText-indent\fP is the number of spaces to indent the text from the
-current indent.
-.sp
-\fIPad\fP and \fImark-indent\fP controls where to put the mark.
-The mark is placed within the mark area, and \fImark-indent\fP
-sets the number of spaces before this area. It is normally 0.
-The mark area ends where the text begins. The start of the text
-is still controlled by \fItext-indent\fP.
-.sp
-The mark is left justified whitin the mark area if \fIpad\fP is 0.
-If \fIpad\fP is greater than 0, then \fImark-indent\fP is ignored, and
-the mark is placed \fIpad\fP spaces before the text.
-This will right justify the mark.
-.sp
-If \fItype\fP is 0 the list will have either a hanging indent or, if
-argument \fImark\fP is given, the string \fImark\fP as mark.
-.sp
-If \fItype\fP is greater than 0 automatic numbering will occur, arabic
-if \fImark\fP is empty. \fIMark\fP can then be any of \fB1\fP, \fBA\fP,
-\fBa\fP, \fBI\fP or \fBi\fP.
-.sp
-\fIType\fP selects one of six possible ways to display the mark.
-.br
-\fBtype\fP
-.in +.6i
-.T2 1
-x.
-.T2 2
-x)
-.T2 3
-(x)
-.T2 4
-[x]
-.T2 5
-
-.T2 6
-{x}
-.in
-.sp
-Every item in the list will get \fILI-space\fP number of blank lines
-before them. Default is 1.
-.sp
-\fBLB\fP itself will print \fILB-space\fP blank lines. Default is 0.
-.TP
-.B "LC [list-level]"
-List-status clear.
-Terminates all current active lists down to \fIlist-level\fP, or 0
-if no argmuent is given. This is used by \fBH\fP to clear any
-active list.
-.TP
-.B "LE [1]"
-List end.
-Terminate the current list. \fBLE\fP outputs a blank line
-if an argument is given.
-.TP
-.B "LI [mark [1]]"
-List item precedes every item in a list. Without argument \fBLI\fP
-will print the mark determined by the current list type. By giving
-\fBLI\fP one argument, it will use that as the mark instead.
-Two arguments to \fBLI\fP will make \fImark\fP a prefix to
-the current mark.
-There will be no separating space between the prefix
-and the mark if the second argument is \fB2\fP instead of \fB1\fP.
-This behaviour can also be achieved by setting number register
-\fBLimsp\fP to zero.
-A zero length \fImark\fP will make a hanging
-indent instead.
-.sp
-A blank line is normally printed before the list item. This behaviour
-can be controlled by number register \fBLs\fP. Pre-spacing
-will occur for each list-level less than or equal to \fBLs\fP.
-Default value is 99. (Nesting of lists is unlimited. :-)
-.sp
-The indentation can be changed thru number register \fBLi\fP.
-Default is 6.
-.sp
-All lists begins with a list initialization macro, \fBLB\fP.
-There are, however, seven predefined listtypes to
-make lists easier to use. They all call \fBLB\fP with different
-default values.
-.in +.5i
-.T2 \fBAL\fP
-Automatically Incremented List
-.T2 \fBML\fP
-Marked List
-.T2 \fBVL\fP
-Variable-Item List
-.T2 \fBBL\fP
-Bullet List
-.T2 \fBDL\fP
-Dash List
-.T2 \fBRL\fP
-Reference List
-.T2 \fBBVL\fP
-Broken Varable List.
-.in
-These lists are described at other places in this manual. See also \fBLB\fP.
-.TP
-.B "LT [arg]"
-Formats a letter in one of four different styles depending
-on the argument.
-See also \fBINTERNALS\fP.
-.in +.5i
-.T2 \fBArg
-Style\fP
-.T2 BL
-Blocked. Date line, return address, writer's address and closing
-begins at the center of the line. All other lines begin at the left margin.
-.T2 SB
-Semi-blocked. Same as blocked, except that the first line in every
-paragraph is indented five spaces.
-.T2 FB
-Full-blocked. All lines begin at the left margin.
-.T2 SP
-Simplified. Almost the same as the full-blocked style. Subject and
-the writer's identification are printed in all-capital.
-.in
-.TP
-.B "LO type [arg]"
-Specify options in letter (see \fB.LT\fP).
-This is a list of the standard options:
-.in +.5i
-.T2 CN
-Confidential notation. Prints \fBCONFIDENTIAL\fP on the second line
-below the date line. Any argument replaces \fBCONFIDENTIAL\fP.
-See also string variable \fBLetCN\fP.
-.T2 RN
-Reference notation. Prints \fBIn reference to:\fP and the argument
-two lines below the date line.
-See also string variable \fBLetRN\fP.
-.T2 AT
-Attention. Prints \fBATTENTION:\fP and the argument below the inside address.
-See also string variable \fBLetAT\fP.
-.T2 SA
-Salutation. Prints \fBTo Whom It May Concern:\fP or the argument if
-it was present. The salutation is printed two lines below the inside address.
-See also string variable \fBLetSA\fP.
-.T2 SJ
-Subject line. Prints the argument as subject prefixed with \fBSUBJECT:\fP
-two lines below the inside address, except in letter type \fBSP\fP.
-Then the subject is printed in all-captial without any prefix.
-See also string variable \fBLetSJ\fP.
-.in
-.TP
-.B "MC column-size [column-separation] "
-Begin multiple columns. Return to normal with \fB1C\fP.
-\fBMC\fP will create as many columns as the current line length permits.
-\fIColumn-size\fP is the width of each column, and \fIcolumn-separation\fP
-is the space between two columns. Default separation is the
-column-size/15.
-See also \fB1C\fP.
-.TP
-.B "ML mark [text-indent [1]]"
-Marked list start. The \fImark\fP argument will be printed before
-each list item.
-\fIText-indent\fP sets the indent and overrides \fBLi\fP.
-A third argument will prohibit printing of a blank line before each
-item.
-.TP
-.B "MT [arg [addressee]]"
-Memorandum type.
-The \fIarg\fP is part of a filename in \fI@TMAC_MDIR@/*.MT\fP.
-Memorandum type 0 thru 5 are supported, including \fI"string"\fP.
-\fIAddressee\fP just sets a variable, used in the AT&T macros.
-.br
-\fBarg\fP
-.in +.5i
-.T2 0
-Normal memorandum, no type printed
-.T2 1
-Memorandum with \fIMEMORANDUM FOR FILE\fP printed
-.T2 2
-Memorandum with \fIPROGRAMMER'S NOTES\fP printed
-.T2 3
-Memorandum with \fIENGINEER'S NOTES\fP printed
-.T2 4
-Released paper style
-.T2 5
-External letter style
-.in
-See also \fBCOVER\fP/\fBCOVEND\fP, a more flexible type of front page.
-.TP
-.B "MOVE y-pos [x-pos [line-length]]"
-Move to a position, pageoffset set to \fIx-pos\fP.
-If \fIline-length\fP is not given, the difference between
-current and new pageoffset is used.
-Use \fBPGFORM\fP without arguments to return to normal.
-.TP
-.B "MULB cw1 space1 [cw2 space2 [cw3 ...]]"
-Begin a special multi-column mode. Every columns width must be specified.
-Also the space between the columns must be specified. The last column
-does not need any space-definition. \fBMULB\fP starts a diversion and \fBMULE\fP
-ends the diversion and prints the columns.
-The unit for width and space is 'n', but \fBMULB\fP accepts all
-normal unitspecifications like 'c' and 'i'.
-\fBMULB\fP operates in a separate environment.
-.TP
-.B "MULN"
-Begin the next column. This is the only way to switch column.
-.TP
-.B "MULE"
-End the multi-column mode and print the columns.
-.TP
-.B "nP [type]"
-Print numbered paragraph with header level two. See \fB.P\fP.
-.TP
-.B "NCOL"
-Force printing to the next column, don't use this together with
-the \fBMUL*\fP macros, see \fB2C\fP.
-.TP
-.B "NS [arg [1]]"
-Prints different types of notations. The argument selects between
-the predefined type of notations. If the second argument is available,
-then the argument becomes the entire notation.
-If the argument doesn't exist in the predefined, it will be
-printed as \fBCopy (\fP\fIarg\fP\fB) to\fP.
-It is possible to add more standard notations, see the string variable
-\fBLetns\fP and \fBLetnsdef\fP.
-.nf
-.in +.5i
-.T2 \fBArg
-Notation\fP
-.T2 \fInone\fP
-Copy To
-.T2 """""
-Copy To
-.T2 1
-Copy To (with att.) to
-.T2 2
-Copy To (without att.) to
-.T2 3
-Att.
-.T2 4
-Atts.
-.T2 5
-Enc.
-.T2 6
-Encs.
-.T2 7
-Under separate cover
-.T2 8
-Letter to
-.T2 9
-Memorandum to
-.T2 10
-Copy (with atts.) to
-.T2 11
-Copy (without atts.) to
-.T2 12
-Abstract Only to
-.T2 13
-Complete Memorandum to
-.T2 14
-CC
-.in
-.fi
-.TP
-.B "ND new-date"
-New date. Override the current date. Date is not
-printed if \fInew-date\fP is an empty string.
-.TP
-.B "OF [arg]"
-Odd-page footer, a line printed just above the normal footer.
-See \fBEF\fP and \fBPF\fP.
-.TP
-.B "OH [arg]"
-Odd-page header, a line printed just below the normal header.
-See \fBEH\fP and \fBPH\fP.
-.TP
-.B OP
-Make sure that the following text is printed at the top
-of an odd-numbered page. Will not output an empty page
-if currently at the top of an odd page.
-.TP
-.B "P [type]"
-Begin new paragraph.
-\fBP\fP without argument will produce left justified text, even
-the first line of the paragraph. This is the same as setting
-\fItype\fP to 0. If the argument is 1, then the first line
-of text following \fBP\fP will be indented by the number of
-spaces in number register \fBPi\fP, normally 5.
-.sp
-Instead of giving 1 as argument to \fBP\fP it is possible to set the
-paragraph type in number register \fBPt\fP. Using 0 and 1
-will be the same as adding that value to \fBP\fP.
-A value of 2 will indent all paragraphs, except after
-headings, lists and displays.
-.sp
-The space between two paragraphs is controlled by number register \fBPs\fP,
-and is 1 by default (one blank line).
-.TP
-.B "PGFORM [linelength [pagelength [pageoffset [1]]]]"
-Sets linelength, pagelength and/or pageoffset.
-This macro can be used for special formatting, like letterheads
-and other.
-It is normally the first command in a file, though it's not necessary.
-\fBPGFORM\fP can be used without arguments
-to reset everything after a \fBMOVE\fP.
-A line-break is done unless the fourth argument is given.
-This can be used to avoid the pagenumber on the first page while setting
-new width and length.
-(It seems as if this macro sometimes doesn't work too well.
-Use the command line arguments
-to change linelength, pagelength and pageoffset instead. Sorry.)
-.TP
-.B PGNH
-No header is printed on the next page. Used to get rid of
-the header in letters or other special texts.
-This macro must be used before any text to inhibit the pageheader
-on the first page.
-.TP
-.B PIC [-L] [-C] [-R] [-I n] filename [width [height]]
-\fBPIC\fP includes a Postscript file in the document.
-The macro depends on \fBmmroff\fP and \fBINITR\fP.
-\fB-L\fP, \fB-C\fP, \fB-R\fP and \fB-I n\fP adjusts the picture
-or indents it. The optionally \fIwidth\fP and \fIheight\fP
-can also be given to resize the picture.
-.TP
-.B PE
-Picture end.
-Ends a picture for \fB@TMAC_M_PREFIX@pic\fP, see the manual for \fB@TMAC_M_PREFIX@pic\fP.
-.TP
-.B "PF [arg]"
-Page footer.
-\fBPF\fP sets the line to be printed at the bottom of each page.
-Normally empty. See \fBPH\fP for the argument specification.
-.TP
-.B "PH [arg]"
-Page header, a line printed at the top of each page.
-The argument should be specified as "'left-part'center-part'right-part'",
-where left-, center- and right-part is printed left-justified, centered
-and right justified. The character \fB%\fP is changed to the current
-page number. The default page-header is "''- % -''", the page
-number between two dashes.
-.TP
-.B PS
-Picture start (from pic). Begins a picture for \fB@TMAC@pic\fP, see
-the manual.
-.TP
-.B PX
-Page-header user-defined exit.
-\fBPX\fP is called just after the printing of the page header
-in \fIno-space\fP mode.
-.TP
-.B R
-Roman.
-Return to roman font, see also \fBI\fP.
-.TP
-.B "RB [roman-text [bold-text [roman-text [...]]]]"
-Roman-bold.
-Even arguments is printed in roman, odd in boldface.
-See \fBI\fP.
-.TP
-.B "RD [prompt [diversion [string]]]"
-Read from standard input to diversion and/or string.
-The text will be saved in a diversion named \fIdiversion\fP.
-Recall the text by writing the name of the diversion after a dot
-on an empty line. A string will also be defined if
-\fIstring\fP is given. \fIDiversion\fP and/or \fIprompt\fP can
-be empty ("").
-.TP
-.B RF
-Reference end. Ends a reference definition and returns to normal
-processing. See \fBRS\fP.
-.TP
-.B "RI [roman-text [italic-text [roman-text [...]]]]"
-Even arguments are printed in roman, odd in italic.
-See \fBI\fP.
-.TP
-.B "RL [text-indent [1]]"
-Reference list start.
-Begins a list where each item is preceded with a automatically
-incremented number between
-square brackets.
-\fIText-indent\fP changes the default indentation.
-.TP
-.B "RP [arg1 [arg2]]"
-Produce reference page.
-\fBRP\fP can be used if a reference page is wanted somewhere in the
-document. It is not needed if \fBTC\fP is used to produce
-a table of content. The reference page will then be printed automatically.
-.sp
-The reference counter will not be reset if \fIarg1\fP is 1.
-.sp
-\fIArg2\fP tells \fBRP\fP whether to eject a page or not.
-.br
-\fBArg2\fP
-.in +.5i
-.T2 0
-The reference page will be printed on a separate page.
-This is
-the default.
-.T2 1
-Do not eject page after the list.
-.T2 2
-Do not eject page before the list.
-.T2 3
-Do not eject page before and after the list.
-.in
-The reference items will be separated by a blank line.
-Setting number register \fBLs\fP to 0 will suppress the line.
-.sp
-The string \fBRp\fP contains the reference page title and
-is normally set to \fIREFERENCES\fP.
-.TP
-.B "RS [string-name]"
-\fBRS\fP begins an automatically numbered reference definition.
-Put the string \fB\e*(Rf\fP where the reference mark
-should be and write the reference between \fBRS\fP/\fBRF\fP
-at next new line after the reference mark. The reference number
-is stored in number register \fB:R\fP.
-If \fIstring-name\fP is given, a string with that name
-will be defined and contain the current reference mark.
-The string can be referenced as \fB\e*[\fIstring-name\fP]\fP later in
-the text.
-.TP
-.B "S [size [spacing]]"
-Set point size and vertical spacing. If any argument is equal 'P', then
-the previous value is used. A 'C' means current value, and 'D' default value.
-If '+' or '-' is used before the value, then increment or decrement of
-the current value will be done.
-.TP
-.B "SA [arg]"
-Set right-margin justification.
-Justification is normally turned on.
-No argumenent or \fB0\fP turns off justification, a \fB1\fP turns on
-justification.
-.TP
-.B "SETR refname [string]"
-Remember the current header and page-number as \fIrefname\fP.
-Saves \fIstring\fP if \fIstring\fP is defined. \fIstring\fP is retrieved
-with \fB.GETST\fP.
-See \fBINITR\fP.
-.TP
-.B "SG [arg [1]]"
-Signature line. Prints the authors name(s) after the formal closing.
-The argument will be appended to the reference data, printed
-at either the first or last author. The reference data is the location,
-department and initials specified with \fB.AU\fP.
-It will be printed at the first author if the second argument is given,
-otherwise at the last.
-No reference data will be printed if the author(s) is specifed
-thru \fB.WA\fP/\fB.WE\fP.
-See \fBINTERNALS\fP.
-.TP
-.B "SK [pages]"
-Skip pages.
-If \fIpages\fP is \fB0\fP or omitted, a skip to the next page
-will occur unless it is already at the top of a page.
-Otherwise it will skip \fIpages\fP pages.
-.TP
-.B "SM string1 [string2 [string3]]"
-Make a string smaller.
-If \fIstring2\fP is given, \fIstring1\fP will be smaller and \fIstring2\fP
-normal, concatenated with \fIstring1\fP. With three argument, all is
-concatenated, but only \fIstring2\fP is made smaller.
-.TP
-.B "SP [lines]"
-Space vertically. \fIlines\fP can have any scalingfactor, like \fI3i\fP or
-\fI8v\fP. Several \fBSP\fP in a line will only produce the
-maximum number of lines, not the sum. \fBSP\fP will also be ignored
-until the first textline in a page. Add a \fB\e&\fP before \fBSP\fP
-to avoid this.
-.TP
-.B TAB
-reset tabs to every 5n. Normally used to reset any previous tabpositions.
-.TP
-.B "TB [title [override [flag [refname]]]]"
-Table title, arguments are the same as for \fBEC\fP.
-\fBTB\fP uses the number register \fBTb\fP as counter.
-The string \fBLt\fP controls the title of the
-List of Tables, default is \fILIST OF TABLES\fP.
-The List of Tables will only be printed if number register \fBLt\fP
-is 1, default 1.
-The string \fBLitb\fP contains the word \fITABLE\fP, wich
-is printed before the number.
-.br
-Special handling of the title will occur if
-\fBTB\fP is used inside \fBDS\fP/\fBDE\fP, it will not be
-affected by the format of \fBDS\fP.
-.TP
-.B "TC [slevel [spacing [tlevel [tab [h1 [h2 [h3 [h4 [h5]]]]]]]]]"
-Table of contents.
-This macro is normally used at the last line of the document.
-It generates a table of contents with headings up to the level
-controlled by number register \fBCl\fP. Note that \fBCl\fP controls
-the saving of headings, it has nothing to do with \fBTC\fP.
-Headings with level less than or equal to \fIslevel\fP will get
-\fIspacing\fP number of lines before them.
-Headings with level less than or equal to \fItlevel\fP will have
-their page numbers right justified with dots or spaces separating
-the text and the page number. Spaces is used if \fItab\fP
-is greater than zero, otherwise dots.
-Other headings will have the
-page number directly at the end of the heading text (\fIragged right\fP).
-.sp
-The rest of the arguments will be printed, centered, before the
-table of contents.
-.sp
-The user-defined macros \fBTX\fP and \fBTY\fP are used if \fBTC\fP is called
-with at most four arguments. \fBTX\fP is called before the printing
-of \fICONTENTS\fP, and \fBTY\fP is called instead of printing \fICONTENTS\fP.
-.sp
-Equivalent macros can be defined for list of figures, tables, equations
-and excibits by defining \fBTXxx\fP or \fBTYxx\fP, where \fBxx\fP
-is \fBFg\fP, \fBTB\fP, \fBEC\fP or \fBEX\fP.
-.sp
-String \fBCi\fP can be set to control the indentations for each heading-level.
-It must be scaled, like \fB.ds\ Ci\ .25i\ .5i\ .75i\ 1i\ 1i\fP.
-The indentation is normally controlled by the maxlength of headings
-in each level.
-.sp
-All texts can be redefined, new stringvariables
-\fILifg\fP, \fILitb\fP, \fILiex\fP, \fILiec\fP and \fILicon\fP contain
-"Figure", "TABLE", "Exhibit", "Equation" and "CONTENTS".
-These can be redefined to other languages.
-.TP
-.B TE
-Table end. See \fBTS\fP.
-.TP
-.B "TH [N]"
-Table header. See \fBTS\fP.
-\fBTH\fP ends the header of the table. This header will
-be printed again if a page-break occurs.
-Argument \fIN\fP isn't implemented yet.
-.TP
-.B TL [charging-case number(s) [filing-case number(s)]]
-Begin title of memorandum.
-All text up to the next \fBAU\fP is included in the title.
-\fICharging-case number\fP and \fIfiling-case\fP are saved
-for use in the front page processing.
-.TP
-.B TM [num1 [num2 [...]]]
-Technical memorandumnumbers used in \fB.MT\fP. Unlimited number
-of arguments may be given.
-.TP
-.B TP
-Top of page user-defined macro.
-This macro is called instead of the normal page header. It is
-possible to get complete control over the header.
-Note that header and footer is printed in a separate environment.
-Linelength is preserved though.
-.TP
-.B "TS [H]"
-Table start. This is the start of a table specification
-to \fB@TMAC@tbl\fP. See separate manual for \fB@TMAC@tbl\fP.
-\fBTS\fP ends with \fBTE\fP.
-Argument \fIH\fP tells \fBm@TMAC@m\fP that the table
-has a header. See \fBTH\fP.
-.TP
-.B TX
-Userdefined table of contents exit.
-This macro is called just before \fBTC\fP prints the word \fICONTENTS\fP.
-See \fBTC\fP.
-.TP
-.B TY
-Userdefined table of contents exit (no "CONTENTS").
-This macro is called instead of printing \fICONTENTS\fP.
-See \fBTC\fP.
-.TP
-.B VERBON [flag [pointsize [font]]]
-Begin verbatim output using courier font.
-Usually for printing programs.
-All character has equal width.
-The pointsize can be changed with
-the second argument. By specifying the font-argument
-it is possible to use another font instead of courier.
-\fIflag\fP controls several special features.
-It contains the sum of all wanted features.
-.in +.5i
-.T2 Value
-Description
-.T2 1
-Disable the escape-character (\e). This is normally turned on during
-verbose output.
-.T2 2
-Add an empty line before the verbose text.
-.T2 4
-Add an empty line after the verbose text.
-.T2 8
-Print the verbose text with numbered lines. This adds four digitsized
-spaces in the beginning of each line. Finer control is available with
-the string-variable \fBVerbnm\fP. It contains all arguments to the
-\fBtroff\fP-command \fB.nm\fP, normally '1'.
-.T2 16
-Indent the verbose text with five 'n':s. This is controlled by the
-number-variable \fBVerbin\fP (in units).
-.in
-.TP
-.B VERBOFF
-End verbatim output.
-.TP
-.B "VL text-indent [mark-indent [1]]"
-Variable-item list has no fixed mark, it assumes that
-every \fBLI\fP have a mark instead.
-\fIText-indent\fP sets the indent to the text, and \fImark-indent\fP
-the distance from the current indent to the mark.
-A third argument will prohibit printing of a blank line before each
-item.
-.TP
-.B "VM [top [bottom]]"
-Vertical margin.
-.TP
-.B "WA [writer-name [title]]"
-Begins specification of the writer and writer's address.
-Several names can be specified with empty \fBWA\fP/\fBWE\fP-pairs, but
-only one address.
-.TP
-.B WE
-Ends the address-specification after \fP.WA\fP.
-.TP
-.B "WC [format]"
-Footnote and display width control.
-.in +.5i
-.T2 N
-Set default mode, \fB-WF\fP, \fB-FF\fP, \fB-WD\fP and \fBFB\fP.
-.T2 WF
-Wide footnotes, wide also in two-column mode.
-.T2 -WF
-Normal footnote width, follow column mode.
-.T2 FF
-All footnotes gets the same width as the first footnote encountered.
-.T2 -FF
-Normal footnotes, width follows \fBWF\fP and \fB-WF\fP.
-.T2 WD
-Wide displays, wide also in two-column mode.
-.T2 -WD
-Normal display width, follow column mode.
-.T2 FB
-Floating displays generates a line break when printed on the current page.
-.T2 -FB
-Floating displays does not generate line break.
-.in
-.sp 3
-.LP
-.\"########################################################################
-.LP
-.B "Strings used in m@TMAC_M_PREFIX@m:"
-.TP
-.B App
-A string containing the word "APPENDIX".
-.TP
-.B Apptxt
-.TP
-The current appendix text.
-.B "EM"
-Em dash string
-.TP
-.B H1txt
-Will be updated by \fB.H\fP and \fB.HU\fP to the current heading text.
-Also updated in table of contents & friends.
-.TP
-.B HF
-Fontlist for headings, normally "2 2 2 2 2 2 2".
-Nonnumeric fontnames may also be used.
-.TP
-.B HP
-Pointsize list for headings. Normally "0 0 0 0 0 0 0" which is the same as
-"10 10 10 10 10 10 10".
-.TP
-.B Index
-.TP
-Contains \fIINDEX\fP.
-.B Indcmd
-.TP
-Contains the index command, \fIsort\ -t\et\fP.
-.B Lifg
-String containing \fIFigure\fP.
-.TP
-.B Litb
-String containing \fITABLE\fP.
-.TP
-.B Liex
-String containing \fIExhibit\fP.
-.TP
-.B Liec
-String containing \fIEquation\fP.
-.TP
-.B Licon
-String containing \fICONTENTS\fP.
-.TP
-.B Lf
-Contains "LIST OF FIGURES".
-.TP
-.B Lt
-Contains "LIST OF TABLES".
-.TP
-.B Lx
-Contains "LIST OF EXHIBITS".
-.TP
-.B Le
-Contains "LIST OF EQUATIONS".
-.TP
-.B Letfc
-Contains "Yours very truly,", used in \fB.FC\fP.
-.TP
-.B Letapp
-Contains "APPROVED:", used in \fB.AV\fP.
-.TP
-.B Letdate
-Contains "Date", used in \fB.AV\fP.
-.TP
-.B LetCN
-Contains "CONFIDENTIAL", used in \fB.LO CN\fP.
-.TP
-.B LetSA
-Contains "To Whom It May Concern:", used in \fB.LO SA\fP.
-.TP
-.B LetAT
-Contains "ATTENTION:", used in \fB.LO AT\fP.
-.TP
-.B LetSJ
-Contains "SUBJECT:", used in \fB.LO SJ\fP.
-.TP
-.B LetRN
-Contains "In reference to:", used in \fB.LO RN\fP.
-.TP
-.B Letns
-is an array containing the different strings used in \fB.NS\fP.
-It is really a number of stringvariables prefixed with \fBLetns!\fP.
-If the argument doesn't exist, it will be included
-between \fB()\fP with \fBLetns!copy\fP as prefix and \fBLetns!to\fP as suffix.
-Observe the space after \fBcopy\fP and before \fBto\fP.
-.nf
-.ta 1.5i
-\fBName Value\fP
-Letns!0 Copy to
-Letns!1 Copy (with att.) to
-Letns!2 Copy (without att.) to
-Letns!3 Att.
-Letns!4 Atts.
-Letns!5 Enc.
-Letns!6 Encs.
-Letns!7 Under separate cover
-Letns!8 Letter to
-Letns!9 Memorandum to
-Letns!10 Copy (with atts.) to
-Letns!11 Copy (without atts.) to
-Letns!12 Abstract Only to
-Letns!13 Complete Memorandum to
-Letns!14 CC
-Letns!copy Copy "
-Letns!to " to
-.fi
-.TP
-.B Letnsdef
-Defines the standard-notation used when no argument is given
-to \fB.NS\fP. Default is \fB0\fP.
-.TP
-.B "MO1 - MO12"
-Strings containing \fIJanuary\fP thru \fIDecember\fP.
-.TP
-.B Qrf
-String containing "See chapter \e\e*[Qrfh], page \e\en[Qrfp].".
-.TP
-.B Rp
-Contains "REFERENCES".
-.TP
-.B Tcst
-Contains current status of table of contents and list of XXXX.
-Empty outside \fB.TC\fP.
-Useful in user-defined macros like \fB.TP\fP.
-.nf
-.ta 1.5i
-\fBValue Meaning\fP
-co Table of contents
-fg List of figures
-tb List of tables
-ec List of equations
-ex List of exhibits
-ap Appendix
-.fi
-.ta
-.TP
-.B Tm
-Contains \e(tm, trade mark.
-.TP
-.B Verbnm
-Argument to \fB.nm\fP in \fB.VERBON\fP, default: \fB1\fP.
-.\"-----------------------------------
-.LP
-.B "Number variables used in m@TMAC_M_PREFIX@m:"
-.TP
-.B Aph
-Print an appendix-page for every new appendix
-if this numbervariable is non-zero.
-No output will occur if \fBAph\fP is zero, but there will always
-be an appendix-entry in the 'List of contents'.
-.TP
-.B Cl
-Contents level [0:7], contents saved if heading level <= Cl, default 2.
-.TP
-.B Cp
-Eject page between LIST OF XXXX if Cp == 0, default 0.
-.TP
-.B D
-Debugflag, values >0 produces varying degree of debug. A value of 1
-gives information about the progress of formatting, default 0.
-.TP
-.B De
-Eject after floating display is output [0:1], default 0.
-.TP
-.B Dsp
-Controls the space output before and after static displays
-if defined. Otherwise is the value of Lsp used.
-.TP
-.B Df
-Floating keep output [0:5], default 5.
-.TP
-.B Ds
-\fBLsp\fP space before and after display if == 1 [0:1], default 1.
-.TP
-.B Ej
-Eject page, default 0.
-.TP
-.B Eq
-Equation lable adjust 0=left, 1=right. Default 0.
-.TP
-.B Fs
-Footnote spacing, default 1.
-.TP
-.B "H1-H7"
-Heading counters
-.TP
-.B H1dot
-Append a dot after the level one heading number if > 0. Default is 1.
-.TP
-.B H1h
-.TP
-Copy of number register \fBH1\fP, but it is incremented
-just before the page break. Useful in user defined header macros.
-.B Hb
-Heading break level [0:7], default 2.
-.TP
-.B Hc
-Heading centering level, [0:7]. Default 0.
-.TP
-.B Hi
-Heading temporary indent [0:2], default 1.
-.br
-0\ ->\ 0 indent, left margin
-.br
-1\ ->\ indent to right , like .P 1
-.br
-2\ ->\ indent to line up with text part of preceding heading
-.TP
-.B Hps
-Numbervariable with the heading pre-space level. If the heading-level
-is less than or equal to \fBHps\fP, then two lines will precede the
-section heading instead of one. Default is first level only.
-The real amount of lines is controlled by the variables \fBHps1\fP and
-\fBHps2\fP.
-.TP
-.B Hps1
-This is the number of lines preceding \fB.H\fP when the heading-level
-is greater than \fBHps\fP. Value is in units, normally 0.5.
-.TP
-.B Hps2
-This is the number of lines preceding \fB.H\fP when the heading-level
-is less than or equal to \fBHps\fP. Value is in units, normally 1.
-.TP
-.B Hs
-Heading space level [0:7], default 2.
-.TP
-.B Hss
-This is the number of lines that follows \fB.H\fP when the heading-level
-is less than or equal to \fBHs\fP. Value is in units, normally 1.
-.TP
-.B Ht
-Heading numbering type, default 0.
-0 -> multiple (1.1.1 ...)
-.br
-1 -> single
-.TP
-.B Hu
-Unnumbered heading level, default 2.
-.TP
-.B Hy
-Hyphenation in body, default 1.
-.br
-0\ ->\ no hyphenation
-.br
-1\ ->\ hyphenation 14 on
-.TP
-.B Iso
-Set this variable to 1 on the command line to get ISO-formatted date string.
-(\fB-rIso=1\fP)
-Useless inside a document.
-.TP
-.B Letwam
-Max lines in return-address, used in \fB.WA\fP/\fB.WE\fP. Default 14.
-.TP
-.B "Lf, Lt, Lx, Le"
-Enables (1) or disables (0) the printing of List of figures,
-List of tables, List of exhibits and List of equations.
-Default: Lf=1, Lt=1, Lx=1, Le=0.
-.TP
-.B Li
-List indent, used by .AL, default 6.
-.TP
-.B Limsp
-Flag for space between prefix and mark in automatic lists (.AL).
-.br
-0\ ==\ no space
-.br
-1\ ==\ space
-.TP
-.B Ls
-List space, if current listlevel > Ls then no spacing will occur around lists.
-Default 99.
-.TP
-.B Lsp
-The size of an empty line. Normally 0.5v, but it is 1v
-if \fBn\fP is set (\fB.nroff\fP).
-.TP
-.B N
-Numbering style [0:5], default 0.
-.br
-0\ ==\ (default) normal header for all pages.
-.br
-1\ ==\ header replaces footer on first page, header is empty.
-.br
-2\ ==\ page header is removed on the first page.
-.br
-3\ ==\ "section-page" numbering enabled.
-.br
-4\ ==\ page header is removed on the first page.
-.br
-5\ ==\ "section-page" and "section-figure" numbering enabled.
-See also the number-register Sectf and Sectp.
-.TP
-.B Np
-Numbered paragraphs, default 0.
-.br
-0\ ==\ not numbered
-.br
-1\ ==\ numbered in first level headings.
-.TP
-.B Of
-Format of figure,table,exhibit,equation titles, default 0.
-.br
-0\ =\ ". "
-.br
-1\ =\ " - "
-.TP
-.B P
-Current page-number, normally the same as % unless "section-page" numbering
-is enabled.
-.TP
-.B Pi
-paragraph indent, default 5.
-.TP
-.B Pgps
-Controls whether header and footer pointsize should follow the current
-setting or just change when the header and footer is defined.
-.in +.5i
-.ti -.5i
-.T2 Value
-Description
-.T2 0
-Pointsize will only change to the current setting when \fB.PH\fP, \fB.PF\fP,
-\&\fB.OH\fP, \fP.EH\fP, \fB.OF\fP or \fB.OE\fP is executed.
-.T2 1
-Pointsize will change after every \fB.S\fP. This is the default.
-.in
-.TP
-.B Ps
-paragraph spacing, default 1.
-.TP
-.B Pt
-Paragraph type, default 0.
-.br
-0\ ==\ left-justified
-.br
-1\ ==\ indented .P
-.br
-2\ ==\ indented .P except after .H, .DE or .LE.
-.TP
-.B Sectf
-Flag controlling "section-figures". A non-zero value enables this.
-See also register N.
-.TP
-.B Sectp
-Flag controlling "section-page-numbers". A non-zero value enables this.
-See also register N.
-.TP
-.B Si
-Display indent, default 5.
-.TP
-.B Verbin
-Indent for \fB.VERBON\fP, default 5n.
-.TP
-.B .mgm
-Always 1.
-.LP
-.SH INTERNALS
-The letter macros is using different submacros depending on
-the letter type. The name of the submacro has the letter type
-as suffix. It is therefore possible to define other letter types, either
-in the national macro-file, or as local additions.
-\&\fB.LT\fP will set the number variables \fBPt\fP and \fBPi\fP to 0 and 5.
-The following strings and macros must be defined for a new letter type:
-.TP
-\fBlet@init_\fP\fItype\fP
-This macro is called directly by \fB.LT\fP. It is supposed to initialize
-variables and other stuff.
-.TP
-\fBlet@head_\fP\fItype\fP
-This macro prints the letter head, and is called instead of the
-normal page header. It is supposed to remove the alias \fBlet@header\fP,
-otherwise it will be called for all pages.
-.TP
-\fBlet@sg_\fP\fItype\ name\ title\ n\ flag\ [arg1\ [arg2\ [...]]]\fP
-\&\fB.SG\fP is calling this macro only for letters, memorandums has
-its own processing. \fIname\fP and \fItitle\fP is specified
-thru \fB.WA\fP/\fB.WB\fP. \fIn\fP is the counter, 1-max, and
-\fIflag\fP is true for the last name. Any other argument to \fB.SG\fP
-is appended.
-.TP
-\fBlet@fc_\fP\fItype\ closing\fP
-This macro is called by \fB.FC\fP, and has the
-formal closing as argument.
-.LP
-\&\fB.LO\fP is implemented as a general option-macro. \fB.LO\fP demands
-that a string named \fBLet\fP\fItype\fP is defined, where \fItype\fP
-is the letter type.
-\&\fB.LO\fP will then assign the argument to the string
-variable \fBlet*lo-\fP\fItype\fP.
-.LP
-.\".SH BUGS
-.SH AUTHOR
-Jörgen Hägg, Lund, Sweden .
-.SH FILES
-.TP
-.B @MACRODIR@/tmac.@TMAC_M_PREFIX@m
-.TP
-.B @TMAC_MDIR@/*.cov
-.TP
-.B @TMAC_MDIR@/*.MT
-.TP
-.B @TMAC_MDIR@/locale
-.SH "SEE ALSO"
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR @g@tbl (@MAN1EXT@),
-.BR @g@pic (@MAN1EXT@),
-.BR @g@eqn (@MAN1EXT@)
-.br
-.BR mm (@MAN7EXT@)
-.BR m@TMAC_M_PREFIX@mse (@MAN7EXT@)
diff --git a/contrib/groff/mm/groff_mmse.man b/contrib/groff/mm/groff_mmse.man
deleted file mode 100644
index 45ae7221794f..000000000000
--- a/contrib/groff/mm/groff_mmse.man
+++ /dev/null
@@ -1,82 +0,0 @@
-.\"
-.\" $Id: groff_mmse.man,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\" Skrivet av Jörgen Hägg, Lund, Sverige
-.\"
-.TH GROFF_MMSE @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAMN
-groff_mmse \- svenska mm makro för groff
-.SH SYNTAX
-.B groff
-.B \-m@TMAC_M_PREFIX@mse
-[
-.IR flaggor .\|.\|.
-]
-[
-.IR filer .\|.\|.
-]
-.SH BESKRIVNING
-\fBm@TMAC_M_PREFIX@mse\fP är en svensk variant av \fBm@TMAC_M_PREFIX@m\fP. Alla texter
-är översatta. En A4 sida får text som är 13 cm bred, 3.5 cm indragning
-samt är 28.5 cm hög.
-Det finns stöd för brevuppställning enligt svensk standard
-för vänster och högerjusterad text.
-.LP
-\fBCOVER\fP kan använda \fIse_ms\fP som argument. Detta ger ett
-svenskt försättsblad.
-Se \fBgroff_mm(@MAN7EXT@)\fP för övriga detaljer.
-.SH BREV
-Tillgängliga brevtyper:
-.TP
-.B ".LT SVV"
-Vänsterställd löptext med adressat i position T0 (vänsterställt).
-.TP
-.B ".LT SVH"
-Högerställd löptext med adressat i position T4 (passar
-fönsterkuvert).
-.LP
-Följande extra LO-variabler används.
-.TP
-.B ".LO DNAMN\fI namn\fP"
-Anger dokumentets namn.
-.TP
-.br
-.B ".LO MDAT\fI datum\fP"
-Mottagarens datum, anges under \fBErt datum:\fP (\fBLetMDAT\fP).
-.TP
-.br
-.B ".LO BIL\fI sträng\fP"
-Anger bilaga, nummer eller sträng med \fBBilaga\fP (\fBLetBIL\fP)
-som prefix.
-.TP
-.br
-.B ".LO KOMP\fI text\fP"
-Anger kompletteringsuppgift.
-.TP
-.br
-.B ".LO DBET\fI beteckning\fP"
-Anger dokumentbeteckning eller dokumentnummer.
-.TP
-.br
-.B ".LO BET\fI beteckning\fP"
-Anger beteckning (ärendebeteckning i form av diarienummer eller liknande).
-.TP
-.br
-.B ".LO SIDOR\fI antal\fP"
-Anger totala antalet sidor och skrivs ut efter sidnumret inom
-parenteser.
-.LP
-Om makrot \fB.TP\fP är definierat anropas det efter utskrift av brevhuvudet.
-Där lägger man lämpligen in postadress och annat som brevfot.
-.SH "SKRIVET AV"
-Jörgen Hägg, Lund, Sweden
-.SH FILER
-.B @MACRODIR@/tmac.@TMAC_M_PREFIX@mse
-.B @TMAC_MDIR@/se_*.cov
-.SH "SE OCKSÅ"
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR @g@tbl (@MAN1EXT@),
-.BR @g@pic (@MAN1EXT@),
-.BR @g@eqn (@MAN1EXT@)
-.br
-.BR m@TMAC_M_PREFIX@m (@MAN7EXT@)
diff --git a/contrib/groff/mm/mm/0.MT b/contrib/groff/mm/mm/0.MT
deleted file mode 100644
index 8c93108fcd51..000000000000
--- a/contrib/groff/mm/mm/0.MT
+++ /dev/null
@@ -1,146 +0,0 @@
-.\"------------
-.\" $Id: 0.MT,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\" Cover sheet. Memorandum type 0-3 and "string".
-.\"------------
-.if !r Au .nr Au 1
-.nr cov*mt0-ind 1.1c
-.de cov@print-title
-.MOVE 4.8c 1.5c
-.S 8
-subject:
-.sp -1.1
-.S
-.PGFORM
-.ft \\*[@sdf_font]
-.ll 9c
-.fi
-.cov*title
-.ft
-.ll
-.nf
-.if d cov*title-charge-case \fBCharge Case \\*[cov*title-charge-case]\fP
-.if d cov*title-file-case \fBFile Case \\*[cov*title-file-case]\fP
-.fi
-..
-.\"------------
-.de cov@print-authors
-.MOVE 5.7c 13.3c
-.nf
-.S 8
-\\$1:
-.br
-.S
-.sp -1
-.in 0.8c
-.ft \\*[@sdf_font]
-.nr cov*i 0 1
-.while \\n+[cov*i]<=\\n[cov*au] \{\
-. cov@print-au1 \\n[cov*i] 1
-. if \\n[Au] \{\
-. cov@print-au2 \\n[cov*i] 3 4
-. cov@print-au2 \\n[cov*i] 6 5
-. cov@print-au1 \\n[cov*i] 7
-. cov@print-au1 \\n[cov*i] 8
-. cov@print-au1 \\n[cov*i] 9
-. \}
-. if \\n[cov*i]<\\n[cov*au] .SP 1
-.\}
-.ft
-.if r cov*mt-tm-max \{\
-. SP 1
-. nr cov*i 0 1
-. ft \\*[@sdf_font]
-TM
-. in 1.5c
-. sp -1
-. while \\n+[cov*i]<\\n[cov*mt-tm-max] \\*[cov*mt-tm!\\n[cov*i]]
-. in
-. ft
-.\}
-.fi
-.PGFORM
-..
-.\"------------
-.\" index arg1
-.de cov@print-au1
-.if d cov*au!\\$1!\\$2 \\*[cov*au!\\$1!\\$2]
-..
-.\"------------
-.de cov@print-au2
-.\" index arg1 arg2
-.if d cov*au!\\$1!\\$2 \\*[cov*au!\\$1!\\$2] \c
-.if \\$3=5 .if d cov*au!\\$1!\\$3 x\c
-.if d cov*au!\\$1!\\$3 \\*[cov*au!\\$1!\\$3]\c
-.br
-..
-.\"------------
-.de cov@print-date
-.MOVE 4.8c 13.3c
-.S 8
-.nf
-\\$1:
-.br
-.S
-.sp -1
-.in 0.8c
-\f[\\*[@sdf_font]]\\*[cov*new-date]\fP
-.br
-.fi
-.PGFORM
-..
-.\"------------
-.de cov@print-firm
-.if d cov*firm \{\
-. MOVE 2.8c 0 17.7c
-. S 18
-. rj 1
-\fB\\*[cov*firm]\fP
-. S
-. PGFORM
-.\}
-..
-.\"------------
-.de cov@print-abstract
-.SP 3
-.if d cov*abstract \{\
-. misc@ev-keep cov*ev
-. if \\n[cov*abs-ind]>0 \{\
-. in +\\n[cov*abs-ind]u
-. ll -\\n[cov*abs-ind]u
-. \}
-. ce
-\fI\\$1\fP
-. SP 1.5
-. fi
-. cov*abstract
-. br
-. ev
-.\}
-..
-.\"-----------------
-.ds cov*mt0-txt!1 MEMORANDUM FOR FILE
-.ds cov*mt0-txt!2 PROGRAMMER'S NOTES
-.ds cov*mt0-txt!3 ENGINEER'S NOTES
-.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
-.\"
-.if !d cov*mt-printed \{\
-. cov@print-firm
-. cov@print-title subject
-. cov@print-date date
-. cov@print-authors from
-. cov@print-abstract \\*[cov*abs-name]
-. SP 3
-. if (\*[cov*mt-type]>=1)&(\*[cov*mt-type]<=3) \{\
-. ce
-\fI\*[cov*mt0-txt!\*[cov*mt-type]]\fP
-. SP 1.5
-. \}
-. if \*[cov*mt-type]=6 \{\
-. ce
-\fI\*[cov*mt-type-text]\fP
-. SP 1.5
-. \}
-. pg@enable-top-trap
-. pg@enable-trap
-. ds cov*mt-printed
-.\}
diff --git a/contrib/groff/mm/mm/4.MT b/contrib/groff/mm/mm/4.MT
deleted file mode 100644
index 330d2838db85..000000000000
--- a/contrib/groff/mm/mm/4.MT
+++ /dev/null
@@ -1,81 +0,0 @@
-.\"------------
-.\" $Id: 4.MT,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\" Cover sheet. Memorandum type 4
-.\"------------
-.de cov@print-title
-.if !d cov*title .@error title (.TL) not defined!
-.MOVE 2.4c
-.S +4
-.ad c
-.fi
-.B
-.cov*title
-.br
-.S
-.R
-.ad b
-.PGFORM
-..
-.\"------------
-.de cov@print-authors
-.SP 0.5
-.I
-.nr cov*i 0 1
-.while \\n+[cov*i]<=\\n[cov*au] \{\
-.ce
-\\*[cov*au!\\n[cov*i]!1]
-.br
-.\}
-.R
-.PGFORM
-..
-.\"------------
-.de cov@print-firm
-.if !d cov*firm .@error firm (.AF) not defined!
-.SP 0.5
-.ce
-\\*[cov*firm]
-..
-.\"------------
-.de cov@print-abstract
-.SP 2
-.if d cov*abstract \{\
-. misc@ev-keep cov*ev
-. init@reset
-. if \\n[cov*abs-ind]>0 \{\
-. in +\\n[cov*abs-ind]u
-. ll -\\n[cov*abs-ind]u
-. \}
-. ce
-\fI\\*[cov*abs-name]\fP
-. SP 2
-. fi
-. cov*abstract
-. br
-. ev
-.\}
-..
-.\"-----------------
-.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
-.if !d cov*mt-printed \{\
-. cov@print-title
-. cov@print-authors
-. cov@print-firm
-. if d cov*abstract \{\
-. if !\n[cov*abs-arg] .cov@print-abstract
-. \}
-. SP 3
-. nr hd*cur-bline \n[nl]
-. ds cov*mt-printed
-. pg@enable-top-trap
-. pg@enable-trap
-.\}
-.de CS
-.pg@disable-top-trap
-.SK
-.cov@print-title
-.cov@print-authors
-.cov@print-firm
-.cov@print-abstract
-..
-
diff --git a/contrib/groff/mm/mm/5.MT b/contrib/groff/mm/mm/5.MT
deleted file mode 100644
index ee0ac1160e48..000000000000
--- a/contrib/groff/mm/mm/5.MT
+++ /dev/null
@@ -1,34 +0,0 @@
-.\"------------
-.\" $Id: 5.MT,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\" Cover sheet. Memorandum type 5
-.\"------------
-.nr cov*mt0-ind 1.1c
-.de cov@print-title
-.B
-.ll 9c
-.fi
-.cov*title
-.R
-.ll
-.nf
-.if d cov*title-charge-case \fBCharge Case \\*[cov*title-charge-case]\fP
-.if d cov*title-file-case \fBFile Case \\*[cov*title-file-case]\fP
-.fi
-..
-.\"------------
-.de cov@print-date
-.rj 1
-\f[\\*[@sdf_font]]\\*[cov*new-date]\fP
-.br
-..
-.\"------------
-.if !d cov*mt-printed \{\
-. SP 1.9c
-. cov@print-title
-. SP 1.2c
-. cov@print-date
-. SP 3
-. pg@enable-top-trap
-. pg@enable-trap
-. ds cov*mt-printed
-.\}
diff --git a/contrib/groff/mm/mm/ms.cov b/contrib/groff/mm/mm/ms.cov
deleted file mode 100644
index 699ca44000c7..000000000000
--- a/contrib/groff/mm/mm/ms.cov
+++ /dev/null
@@ -1,84 +0,0 @@
-.\"------------
-.\" $Id: ms.cov,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\" Cover sheet. Mostly like ms cover.
-.\"------------
-.de cov@print-title
-.in 0
-.misc@ev-keep cov*ev
-.init@reset
-.ad c
-.hy 0
-.fi
-.B
-.cov*title
-.br
-.ad b
-.R
-.ev
-..
-.\"------------
-.de cov@print-authors
-.SP
-.nr cov*i 0 1
-.while \\n+[cov*i]<=\\n[cov*au] \{\
-. ce
-\fI\\*[cov*au!\\n[cov*i]!1]\fP
-. nr cov*j 0 1
-. while \\n+[cov*j]<=9 \{\
-. if d cov*at!\\n[cov*i]!\\n[cov*j] \{\
-. if \w'\\*[cov*at!\\n[cov*i]!\\n[cov*j]]' \{\
-. ce
-\s-1\\*[cov*at!\\n[cov*i]!\\n[cov*j]]\s0
-. .\}
-. \}
-. \}
-.\}
-..
-.\"------------
-.de cov@print-firm
-.SP .5
-.ce
-\\*[cov*firm]
-..
-.\"------------
-.de cov@print-abstract
-.SP 2
-.if d cov*abstract \{\
-. misc@ev-keep cov*ev
-. init@reset
-. if \\n[cov*abs-ind]>0 \{\
-. in +\\n[cov*abs-ind]u
-. ll -\\n[cov*abs-ind]u
-. \}
-. ce
-\fI\\$1\fP
-. SP 1.5
-. fi
-. cov*abstract
-. br
-. ev
-.\}
-..
-.\"------------
-.de cov@print-date
-.SP 2
-\f[\\*[@sdf_font]]\\*[cov*new-date]\fP
-..
-.\"-----------------
-.de COVEND
-.br
-.if d cov*default-firm .if !d cov*firm .ds cov*firm \\*[cov*default-firm]
-.sp |4.2c
-.cov@print-title
-.cov@print-authors
-.cov@print-firm
-.cov@print-abstract \\*[cov*abs-name]
-.cov@print-date
-.pg@enable-top-trap
-.bp 1
-.pg@enable-trap
-.if d cov*abs-arg .if \\n[cov*abs-arg] \{\
-. cov@print-abstract ABSTRACT
-. SP 2
-.\}
-..
diff --git a/contrib/groff/mm/mm/se_ms.cov b/contrib/groff/mm/mm/se_ms.cov
deleted file mode 100644
index 64e7c1176cad..000000000000
--- a/contrib/groff/mm/mm/se_ms.cov
+++ /dev/null
@@ -1,3 +0,0 @@
-.\" $Id: se_ms.cov,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.mso mm/ms.cov
-.nr cur*abstract-ll 11c
diff --git a/contrib/groff/mm/mmroff.man b/contrib/groff/mm/mmroff.man
deleted file mode 100644
index e6aa5eb459b6..000000000000
--- a/contrib/groff/mm/mmroff.man
+++ /dev/null
@@ -1,48 +0,0 @@
-.\"
-.\" $Id: mmroff.man,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\"
-.TH MMROFF @MAN7EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-mmroff \- reference preprocessor
-.SH SYNOPSIS
-.B mmroff
-[
-.I -x
-]
-.I groff_arguments
-.SH DESCRIPTION
-\fBmmroff\fP is a simple preprocessor for \fBgroff\fP, it is
-used for expanding references in \fBm@TMAC_M_PREFIX@m\fP, see
-\fBgroff_mm(@MAN7EXT@)\fP.
-\fBgroff\fP is executed twice, first with \fB-z\fP and \fB-rRef=1\fR
-to collect all references and then to do the real processing
-when the reference file is up to date.
-.TP
-\fB\-x\fR
-Just create the reference file. This can be used to refresh
-the reference file, it isn't always needed to have accurate
-references and by using this option \fBgroff\fP will only
-be run once.
-.\".SH BUGS
-.SH AUTHOR
-Jörgen Hägg, Lund, Sweden .
-.SH FILES
-.TP
-.B @MACRODIR@/tmac.@TMAC_M_PREFIX@m
-.TP
-.B @TMAC_MDIR@/*.cov
-.TP
-.B @TMAC_MDIR@/*.MT
-.TP
-.B @TMAC_MDIR@/locale
-.SH "SEE ALSO"
-.BR groff_mm(@MAN7EXT@),
-.BR groff_mmse(@MAN7EXT@),
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR @g@tbl (@MAN1EXT@),
-.BR @g@pic (@MAN1EXT@),
-.BR @g@eqn (@MAN1EXT@)
-.br
-.BR mm (@MAN7EXT@)
-.BR m@TMAC_M_PREFIX@mse (@MAN7EXT@)
diff --git a/contrib/groff/mm/mmroff.pl b/contrib/groff/mm/mmroff.pl
deleted file mode 100755
index 69b6105b2925..000000000000
--- a/contrib/groff/mm/mmroff.pl
+++ /dev/null
@@ -1,134 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-# runs groff in safe mode, that seems to be the default
-# installation now. That means that I have to fix all nice
-# features outside groff. Sigh.
-# I do agree however that the previous way opened a whole bunch
-# of security holes.
-
-my $no_exec;
-# check for -x and remove it
-if (grep(/^-x$/, @ARGV)) {
- $no_exec++;
- @ARGV = grep(!/^-x$/, @ARGV);
-}
-
-my $check_macro = "groff -rRef=1 -z @ARGV";
-my $run_macro = "groff @ARGV";
-
-my (%cur, $rfilename, $max_height, $imacro, $max_width, @out, @indi);
-open(MACRO, "$check_macro 2>&1 |") || die "run $check_macro:$!";
-while() {
- if (m#^\.\\" Rfilename: (\S+)#) {
- # remove all directories just to be more secure
- ($rfilename = $1) =~ s#.*/##;
- next;
- }
- if (m#^\.\\" Imacro: (\S+)#) {
- # remove all directories just to be more secure
- ($imacro = $1) =~ s#.*/##;
- next;
- }
- if (m#^\.\\" Index: (\S+)#) {
- # remove all directories just to be more secure
- my $f;
- ($f = $1) =~ s#.*/##;
- &print_index($f, \@indi, $imacro);
- @indi = ();
- $imacro = '';
- next;
- }
- my $x;
- if (($x) = m#^\.\\" IND (.+)#) {
- $x =~ s#\\##g;
- my @x = split(/\t/, $x);
- grep(s/\s+$//, @x);
- push(@indi, join("\t", @x));
- next;
- }
- if (m#^\.\\" PIC id (\d+)#) {
- %cur = ('id', $1);
- next;
- }
- if (m#^\.\\" PIC file (\S+)#) {
- &psbb($1);
- &ps_calc($1);
- next;
- }
- if (m#^\.\\" PIC (\w+)\s+(\S+)#) {
- eval "\$cur{'$1'} = '$2'";
- next;
- }
- s#\\ \\ $##;
- push(@out, $_);
-}
-close(MACRO);
-
-
-if ($rfilename && @out) {
- push(@out, ".nr pict*max-height $max_height\n") if defined $max_height;
- push(@out, ".nr pict*max-width $max_width\n") if defined $max_width;
-
- open(OUT, ">$rfilename") || "create $rfilename:$!";
- my $i;
- for $i (@out) {
- print OUT $i;
- }
- close(OUT);
-}
-
-exit 0 if $no_exec;
-exit system($run_macro);
-
-sub print_index {
- my ($f, $ind, $macro) = @_;
-
- open(OUT, ">$f") || "create $f:$!";
- my $i;
- for $i (sort @$ind) {
- if ($macro) {
- $i = '.'.$macro.' "'.join('" "', split(/\t/, $i)).'"';
- }
- print OUT "$i\n";
- }
- close(OUT);
-}
-
-sub ps_calc {
- my ($f) = @_;
-
- my $w = abs($cur{'llx'}-$cur{'urx'});
- my $h = abs($cur{'lly'}-$cur{'ury'});
- $max_width = $w if $w > $max_width;
- $max_height = $h if $h > $max_height;
-
- my $id = $cur{'id'};
- push(@out, ".ds pict*file!$id $f\n");
- push(@out, ".ds pict*id!$f $id\n");
- push(@out, ".nr pict*llx!$id $cur{'llx'}\n");
- push(@out, ".nr pict*lly!$id $cur{'lly'}\n");
- push(@out, ".nr pict*urx!$id $cur{'urx'}\n");
- push(@out, ".nr pict*ury!$id $cur{'ury'}\n");
- push(@out, ".nr pict*w!$id $w\n");
- push(@out, ".nr pict*h!$id $h\n");
-}
-
-
-sub psbb {
- my ($f) = @_;
-
- unless (open(IN, $f)) {
- print STDERR "Warning: Postscript file $f:$!";
- next;
- }
- while() {
- if (/^%%BoundingBox:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/) {
- $cur{'llx'} = $1;
- $cur{'lly'} = $2;
- $cur{'urx'} = $3;
- $cur{'ury'} = $4;
- }
- }
- close(IN);
-}
diff --git a/contrib/groff/mm/tmac.m b/contrib/groff/mm/tmac.m
deleted file mode 100644
index cf7d8e112dc5..000000000000
--- a/contrib/groff/mm/tmac.m
+++ /dev/null
@@ -1,3471 +0,0 @@
-.\"
-.de @revision
-.ds RE \\$2
-..
-.\"
-.\" $Id: tmac.m,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.@revision $Revision: 1.2 $
-.ig
-
-Copyright (C) 1991-2000 Free Software Foundation, Inc.
-mgm is written by Jörgen Hägg
-
-mgm is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-mgm is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
-
-Please send bugreports with examples to jh@axis.com.
-
-Naming convention stolen from mgs.
-Local names module*name
-Extern names module@name
-Env.var environ:name
-Index array!index
-..
-.if !\n(.g .ab These mm macros require groff.
-.if \n(.C .ab The groff mm macros do not work in compatibility mode.
-.warn
-.\" ######## init #######
-.\" Contents level [0:7], contents saved if heading level <= Cl
-.nr Cl 2
-.\" Eject page between LIST OF XXXX if Cp == 0
-.nr Cp 0
-.\" Debugflag
-.if !r D .nr D 0
-.\" Eject after floating display is output [0:1]
-.nr De 0
-.\" Floating keep output [0;5]
-.nr Df 5
-.\" space before and after display if == 1 [0:1]
-.nr Ds 1
-.\" Eject page
-.nr Ej 0
-.\" Equation label adjust 0=left, 1=right
-.nr Eq 0
-.\" Em dash string
-.ie n .ds EM " --
-.el .ds EM \(em
-.\" Footnote spacing
-.nr Fs 1
-.\" H1-H7 heading counters
-.nr H1 0 1
-.nr H2 0 1
-.nr H3 0 1
-.nr H4 0 1
-.nr H5 0 1
-.nr H6 0 1
-.nr H7 0 1
-.\" Heading break level [0:7]
-.nr Hb 2
-.\" heading centering level, [0:7]
-.nr Hc 0
-.\" header format
-.ds HF 2 2 2 2 2 2 2
-.\" heading temp. indent [0:2]
-.\" 0 -> 0 indent, left margin
-.\" 1 -> indent to right , like .P 1
-.\" 2 -> indent to line up with text part of preceding heading
-.nr Hi 1
-.\" header pointsize
-.ds HP 0 0 0 0 0 0 0
-.\" heading space level [0:7]
-.nr Hs 2
-.\" heading numbering type
-.\" 0 -> multiple (1.1.1 ...)
-.\" 1 -> single
-.nr Ht 0
-.\" Unnumbered heading level
-.nr Hu 2
-.\" hyphenation in body
-.\" 0 -> no hyphenation
-.\" 1 -> hyphenation 14 on
-.nr Hy 0
-.\" text for toc, selfexplanatory. Look in the new variable section
-.ds Lf LIST OF FIGURES
-.nr Lf 1
-.ds Lt LIST OF TABLES
-.nr Lt 1
-.ds Lx LIST OF EXHIBITS
-.nr Lx 1
-.ds Le LIST OF EQUATIONS
-.nr Le 0
-.\" List indent, used by .AL
-.nr Li 6
-.\" List space, if listlevel > Ls then no spacing will occur around lists.
-.nr Ls 99
-.\" Numbering style [0:5]
-.if !r N .nr N 0
-.\" numbered paragraphs
-.\" 0 == not numbered
-.\" 1 == numbered in first level headings.
-.nr Np 0
-.\" Format of figure,table,exhibit,equation titles.
-.\" 0= ". ", 1=" - "
-.nr Of 0
-.\" Table of contents page numbering style
-.nr Oc 0
-.\" Page-number, normally same as %.
-.nr P 0
-.\" paragraph indent
-.nr Pi 5
-.\" paragraph spacing
-.nr Ps 1
-.\" paragraph type
-.\" 0 == left-justified
-.\" 1 == indented .P
-.\" 2 == indented .P except after .H, .DE or .LE.
-.nr Pt 0
-.\" Reference title
-.ds Rp REFERENCES
-.\" Display indent
-.nr Si 5
-.\"
-.\" Current state of TOC, empty outside TC, inside
-.\" it will be set to co,fg,tb,ec,ex or ap.
-.ds Tcst
-.\"
-.ds Tm \(tm
-.\"
-.\"---------------------------------------------
-.\" Internal global variables
-.\"
-.\" This is for cover macro .MT
-.\" .ds @language
-.\"
-.nr @copy_type 0
-.if r C .nr @copy_type \n[C]
-.\" >0 if Subject/Date/From should be bold, roman otherwise
-.ie n .ds @sdf_font R
-.el .ds @sdf_font B
-.if \n[@copy_type]=4 \{\
-. ls 2
-. nr Pi 10
-. nr Pt 1
-.\}
-.\"
-.\"
-.if r E \{\
-. ie \n[E] .ds @sdf_font B
-. el .ds @sdf_font R
-.\}
-.\"
-.\" Current pointsize and vertical space, always in points.
-.if !r S .nr S 10
-.ps \n[S]
-.vs \n[S]+2
-.\"
-.nr @ps \n[.ps]
-.nr @vs \n[.v]
-.if \n[D]>1 .tm @ps=\n[@ps], @vs=\n[@vs]
-.if \n[D]>3 .tm INIT: l:\n[.l] p:\n[.p] o:\n[.o]
-.\"
-.\" Page length
-.if r L \{\
-. ie n .pl \n[L]u
-. el .pl \n[L]u
-.\}
-.nr @pl \n[.p]
-.\"
-.\" page width
-.ie r W \{\
-. ie n .ll \n[W]u
-. el .ll \n[W]u
-.\}
-.el .ll 6i
-.nr @ll \n[.l]
-.nr @cur-ll \n[@ll]
-.lt \n[@ll]u
-.\"
-.\" page offset
-.ie r O .po \n[O]
-.el \{\
-. ie n .po .75i
-. el .po .963i
-.\}
-.\"
-.nr @po \n[.o]
-.\"
-.\" non-zero if escape mechanism is turned off. Used by VERBON/OFF
-.nr @verbose-flag 0
-.\"---------------------------------------------
-.\" New variables
-.\"
-.\" Appendix name
-.ds App APPENDIX
-.\" print appendixheader, 0 == don't
-.nr Aph 1
-.\"
-.\" Current appendix text
-.ds Apptext
-.\" Controls the space before and after static displays if defined.
-.\" Lsp is used otherwise
-.\" .nr Dsp 1v
-.\"
-.\" Add a dot after level one heading number if >0
-.nr H1dot 1
-.\"
-.\" header prespace level. If level <= Hps, then two lines will be printed
-.\" before the header instead of one.
-.nr Hps 1
-.\"
-.\" These variables controls the number of lines preceding .H.
-.\" Hps1 is the number of lines when level > Hps
-.nr Hps1 0.5
-.if n .nr Hps1 1
-.\"
-.\" Hps2 is the number of lines when level <= Hps
-.nr Hps2 1
-.if n .nr Hps2 2
-.\"
-.\" Hss is the number of lines (Lsp) after the header.
-.nr Hss 1
-.\"
-.\" H1txt will be updated by .H and .HU, containing the heading text.
-.\" Will also be updated in table of contents & friends
-.\"
-.ds H1txt
-.\"
-.\" header text for the index
-.ds Index INDEX
-.\" command to sort the index
-.ds Indcmd sort
-.\"
-.\" flag for mkindex
-.if !r Idxf .nr Idxf 0
-.\" Change these in the national configuration file
-.ds Lifg Figure
-.ds Litb TABLE
-.ds Liex Exhibit
-.ds Liec Equation
-.ds Licon CONTENTS
-.\" Flag for space between mark and prefix 1==space, 0==no space
-.\" Can also be controlled by using '.LI mark 2'
-.nr Limsp 1
-.\"
-.\" Lsp controls the height of an empty line. Normally 0.5v
-.\" Normally used for nroff compatibility.
-.nr Lsp 0.5v
-.if n .nr Lsp 1v
-.ds MO1 January
-.ds MO2 February
-.ds MO3 March
-.ds MO4 April
-.ds MO5 May
-.ds MO6 June
-.ds MO7 July
-.ds MO8 August
-.ds MO9 September
-.ds MO10 October
-.ds MO11 November
-.ds MO12 December
-.\" for GETR
-.ds Qrf See chapter \\*[Qrfh], page \\*[Qrfp].
-.\"
-.\" header- and footer-size will only change to the current
-.\" if Pgps is > 0.
-.nr Pgps 1
-.\"
-.\" section-page if Sectp > 0
-.nr Sectp 0
-.if (\n[N]=3):(\n[N]=5) \{\
-. nr Sectp 1
-. nr Ej 1
-.\}
-.\" section-figure if Sectf > 0
-.nr Sectf 0
-.if \n[N]=5 .nr Sectf 1
-.\"
-.\" argument to .nm in .VERBON.
-.ds Verbnm "1
-.\" indent for VERBON
-.nr Verbin 5n
-.\"
-.\" Letter section
-.\" Formal closing (.FC)
-.ds Letfc Yours very truly,
-.\"
-.\" Approval line
-.ds Letapp APPROVED:
-.\" Approval date-string
-.ds Letdate Date
-.\"
-.ds LetCN CONFIDENTIAL\" Confidential default
-.ds LetSA To Whom It May Concern:\" Salutation default
-.ds LetAT ATTENTION:\" Attention string
-.ds LetSJ SUBJECT:\" Subject string
-.ds LetRN In reference to:\" Reference string
-.\"
-.\" Copy to (.NS)
-.ds Letnsdef 0
-.ds Letns!copy Copy \" space!
-.ds Letns!to " to
-.ds Letns!0 Copy to
-.ds Letns!1 Copy (with att.) to
-.ds Letns!2 Copy (without att.) to
-.ds Letns!3 Att.
-.ds Letns!4 Atts.
-.ds Letns!5 Enc.
-.ds Letns!6 Encs.
-.ds Letns!7 Under separate cover
-.ds Letns!8 Letter to
-.ds Letns!9 Memorandum to
-.ds Letns!10 Copy (with atts.) to
-.ds Letns!11 Copy (without atts.) to
-.ds Letns!12 Abstract Only to
-.ds Letns!13 Complete Memorandum to
-.ds Letns!14 CC:
-.\"
-.\" Text printed below the footer. Controlled by @copy_type (C).
-.ds Pg_type!0
-.ds Pg_type!1 OFFICIAL FILE COPY
-.ds Pg_type!2 DATE FILE COPY
-.ds Pg_type!3 D\ R\ A\ F\ T
-.ds Pg_type!4 D\ R\ A\ F\ T
-.\" Max lines in return address
-.nr Letwam 14
-.\"--------------------------
-.\" test for mgm macro. This can be used if the text must test
-.\" what macros is used.
-.nr .mgm 1
-.\"
-.\" Due to security problems with groff I had to rewrite
-.\" the reference system. It's not as elegant as before, you
-.\" have to run groff with '-z -rRef=1' and put stderr into the filename
-.\" for .INITR
-.\"
-.\" Output references to stderr if non-zero
-.ie !r Ref \{\
-. nr Ref 0
-.\}
-.el .warn 0
-.\"
-.\"---------------------------------------------
-.\" set local variables.
-.ie d @language .mso mm/\*[@language]_locale
-.el .mso mm/locale
-.\"---------------------------------------------
-.if \n[D] .tm Groff mm, version \*[RE].
-.\" ####### module init ######
-.\" reset all things
-.de init@reset
-.ie \\n[misc@adjust] 'ad
-.el 'na
-.ie \\n[Hy] 'hy 14
-.el 'nh
-'in 0
-'ti 0
-.ps \\n[@ps]u
-.vs \\n[@vs]u
-..
-.de @warning
-'tm WARNING:(\\n[.F]) input line \\n[.c]:\\$*
-.if \\n[D] .backtrace
-..
-.de @error
-'tm ******************
-'tm ERROR:(\\n[.F]) input line \\n[.c]:\\$*
-.if \\n[D] .backtrace
-'tm ******************
-.ab "Input aborted, syntax error"
-..
-.de misc@toupper
-.tr aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ
-.br
-\\$1
-.tr aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz
-.br
-..
-.\" ####### module debug #################################
-.de debug
-'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s],\\n[.ps] \
-in=\\n[.i] fi=\\n[.u] .d=\\n[.d] nl=\\n[nl] pg=\\n[%]
-..
-.de debug-all
-.nr debug*n 1n
-.nr debug*m 1m
-'tm \\$1:\\n[.F]:\\n[c.] ll=\\n[.l] vs=\\n[.v] ps=\\n[.s] in=\\n[.i]\
- ad=\\n[.j] fi=\\n[.u] pl=\\n[.p] page=\\n[%] .o=\\n[.o]
-'tm _______ .d=\\n[.d] .f=\\n[.f] .h=\\n[.h] .k=\\n[.k] .n=\\n[.n]\
- .p=\\n[.p] .t=\\n[.t] .z=\\n[.z] nl=\\n[nl] dn=\\n[dn] n=\\n[debug*n]
-..
-.\" ####### module par #################################
-.nr par@ind-flag 1 \" indent on following P if Pt=2
-.nr hd*last-pos -1
-.nr hd*last-hpos -1
-.nr par*number 0 1
-.af par*number 01
-.nr par*number2 0 1
-.af par*number2 01
-.nr par*num-count 0 1
-.af par*num-count 01
-.\" reset numbered paragraphs, arg1 = headerlevel
-.de par@reset-num
-.if \\$1<3 .nr par*num-count 0
-.if (\\$1=1)&(\\n[Np]=1) .nr par*number 0
-..
-.\"------------
-.\" paragraph
-.de P
-.\" skip P if previous heading
-.ie !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
-. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
-. par@doit \\$*
-. if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
-.\}
-.el .if !(\\n[hd*last-hpos]=\\n[.k]) \{\
-. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
-. par@doit \\$*
-. if \\n[Np] \\n[H1].\\n+[par*number]\ \ \c
-.\}
-.nr par@ind-flag 1
-..
-.\"------------
-.de nP
-.\" skip P if previous heading
-.ie !((\\n[nl]=\\n[hd*last-pos]):(\\n[nl]=(\\n[hd*last-pos]-.5v))) \{\
-. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
-. par@doit \\$*
-\\n[H2].\\n+[par*number2]\ \ \c
-.\}
-.el .if !(\\n[hd*last-hpos]=\\n[.k]) \{\
-. if \\n[D]>2 .tm Paragraph nl=\\n[nl]
-. par@doit \\$*
-\\n[H2].\\n+[par*number2]\ \ \c
-.\}
-.nr par@ind-flag 1
-..
-.\"------------
-.de par@doit
-.SP (u;\\n[Ps]*\\n[Lsp])
-.ie \\n[.$] \{\
-. if \\$1=1 .ti +\\n[Pi]n
-.\}
-.el \{\
-. if \\n[Pt]=1 .ti +\\n[Pi]n
-. if (\\n[Pt]=2)&\\n[par@ind-flag] .ti +\\n[Pi]n
-.\}
-..
-.\" ####### module line #######################################
-.de SP
-.br
-.if !r line*lp\\n[.z] .nr line*lp\\n[.z] 0
-.if !r line*ac\\n[.z] .nr line*ac\\n[.z] 0
-.ie \\n[.$] .nr line*temp (v;\\$1)
-.el .nr line*temp 1v
-.\"
-.ie \\n[line*lp\\n[.z]]=\\n[.d] \{\
-. \" go here if no output since the last .SP
-. nr line*output \\n[line*temp]-\\n[line*ac\\n[.z]]
-. if \\n[line*output]<0 .nr line*output 0
-. nr line*ac\\n[.z] +\\n[line*output]
-.\}
-.el \{\
-. nr line*ac\\n[.z] \\n[line*temp]
-. nr line*output \\n[line*temp]
-. \" no extra space in the beginning of a page
-. if (\\n[.d]<0):(\\n[pg*head-mark]=\\n[.d]) .nr line*output 0
-.\}
-.if \\n[line*output] .sp \\n[line*output]u
-.nr line*lp\\n[.z] \\n[.d]
-..
-.\" ######## module misc ###############
-.nr misc@adjust 14
-.de SA
-.if \\n[.$] \{\
-. if \\$1-1 .@error "SA: bad arg: \\$1"
-. nr misc@adjust 0\\$1
-.\}
-.ie \\n[misc@adjust] 'ad
-.el 'na
-..
-.\"-------------
-.\" switch environment, keep all important settings.
-.de misc@ev-keep
-.nr misc*ll \\n[.l]
-.ev \\$1
-.ll \\n[misc*ll]u
-.lt \\n[misc*ll]u
-..
-.\"-------------
-.\" .misc@push stackname value
-.de misc@push
-.ie d misc*st-\\$1 .ds misc*st-\\$1 \\$2 \\*[misc*st-\\$1]
-.el .ds misc*st-\\$1 \\$2
-..
-.\"-------------
-.\" .misc@pop stackname
-.\" value returned in the string misc*pop
-.de misc@pop
-.misc@pop-set misc*st-\\$1 \\*[misc*st-\\$1]
-..
-.\"-------------
-.de misc@pop-set
-.ds misc*st-name \\$1
-.shift
-.if \\n[.$]<1 .@error "stack \\*[misc*st-name] empty"
-.ds misc*pop \\$1
-.shift
-.ds \\*[misc*st-name] \\$*
-..
-.\"-------------
-.\" .misc@pop-nr stackname varname
-.de misc@pop-nr
-.misc@pop \\$1
-.nr \\$2 \\*[misc*pop]
-..
-.\"-------------
-.\" .misc@pop-ds stackname varname
-.de misc@pop-ds
-.misc@pop \\$1
-.ds \\$2 \\*[misc*pop]
-..
-.\"-----------
-.\" reset tabs
-.de TAB
-.ta T 5n
-..
-.\"-------------
-.\" .PGFORM linelength [ pagelength [ pageoffset [1]]]
-.de PGFORM
-.\" Break here to avoid problems with new linesetting of the previous line.
-.\" Hope this doesn't break anything else :-)
-.\" Don't break if arg_4 is a '1'.
-.if \\n[D]>2 .tm PGFORM: \\$*
-.if ''\\$4' .br
-.if \\n[D]>3 .tm PGFORM: IN l:\\n[.l] p:\\n[.p] o:\\n[.o]
-.ie !''\\$1' \{\
-. ll \\$1
-. nr @ll \\n[.l]
-. nr @cur-ll \\n[@ll]
-. lt \\n[@ll]u
-.\}
-.el \{\
-. ll \\n[@ll]u
-. lt \\n[@ll]u
-.\}
-.\"
-.ie !''\\$2' \{\
-. pl \\$2
-. nr @pl \\n[.p]
-.\}
-.el .pl \\n[@pl]u
-.\"
-.ie !''\\$3' \{\
-. po \\$3
-. nr @po \\n[.o]
-.\}
-.el .po \\n[@po]u
-.if \\n[D]>3 .tm PGFORM: OUT l:\\n[.l] p:\\n[.p] o:\\n[.o]
-.if \\n[D]>2 .tm PGFORM: ll=\\n[@ll], pl=\\n[@pl], po=\\n[@po]
-'in 0
-.pg@move-trap
-.if \\n[D]>2 \{\
-. tm Traps:
-. ptr
-.\}
-..
-.\"-------------
-.\" .MOVE y [[x] linelength]
-.\" move to line y, indent to x
-.de MOVE
-.if !\\n[.$] .@error "MOVE y [x]: no arguments"
-.if \\n[nl]<0 \c
-.\" move to Y-pos
-.sp |(v;\\$1)
-.\" calc linelength
-.ie \\n[.$]>2 .nr pg*i (n;\\$3)
-.el \{\
-. ie \\n[.$]>1 .nr pg*i (n;\\n[@ll]u-\\$2)
-. el .nr pg*i \\n[@ll]u
-.\}
-.\" move to X-pos, if any
-.if !''\\$2' .po \\$2
-.\" set linelength
-.ll \\n[pg*i]u
-..
-.\"-------------
-.de SM
-.if !\\n[.$] .@error "SM: no arguments"
-.if \\n[.$]=1 \s-1\\$1\s0
-.if \\n[.$]=2 \s-1\\$1\s0\\$2
-.if \\n[.$]=3 \\$1\s-1\\$2\s0\\$3
-..
-.\"-------------
-.nr misc*S-ps \n[@ps]
-.nr misc*S-vs \n[@vs]
-.nr misc*S-ps1 \n[@ps]
-.nr misc*S-vs1 \n[@vs]
-.ds misc*a
-.ds misc*b
-.de S
-.ie !\\n[.$] \{\
-. ds misc*a P
-. ds misc*b P
-.\}
-.el \{\
-. ie \\n[.$]=1 .ds misc*b D
-. el \{\
-. ie \w@\\$2@=0 .ds misc*b C
-. el .ds misc*b \\$2
-. \}
-. ie \w@\\$1@=0 .ds misc*a C
-. el .ds misc*a \\$1
-.\}
-.\"
-.\" set point size
-.if !'\\*[misc*a]'C' \{\
-. ie '\\*[misc*a]'P' .ps \\n[misc*S-ps]u
-. el \{\
-. ie '\\*[misc*a]'D' .ps \\n[@ps]u
-. el .ps \\*[misc*a]
-. if \\n[D]>2 .tm S: .ps \\*[misc*a]
-. \}
-.\}
-.\"
-.\" set vertical spacing
-.if !'\\*[misc*b]'C' \{\
-. ie '\\*[misc*b]'P' .vs \\n[misc*S-vs]u
-. el \{\
-. ie '\\*[misc*b]'D' .vs \\n[.ps]u+2p
-. el .vs \\*[misc*b]
-. if \\n[D]>2 .tm S: .vs \\*[misc*b]
-. \}
-.\}
-.nr @ps \\n[.ps]
-.nr @vs \\n[.v]
-.\"
-.if \\n[D]>1 .tm S(\\$*): ma:\\*[misc*a], mb:\\*[misc*b] => ps:\\n[@ps]u, vs:\\n[@vs]u
-.nr misc*S-ps \\n[misc*S-ps1]
-.nr misc*S-vs \\n[misc*S-vs1]
-.nr misc*S-ps1 \\n[@ps]
-.nr misc*S-vs1 \\n[@vs]
-.pg@move-trap
-..
-.\"------------
-.de HC
-.ev 0
-.hc \\$1
-.ev
-.ev 1
-.hc \\$1
-.ev
-.ev 2
-.hc \\$1
-.ev
-..
-.\"------------
-.de RD
-.di misc*rd
-'fl
-.rd \\$1\t
-.br
-.di
-.ie !''\\$3' \{\
-. di misc*rd2
-. ds \\$3 "\\*[misc*rd]
-. br
-. di
-.\}
-.if !''\\$2' .rn misc*rd \\$2
-.rm misc*rd misc*rd2
-..
-.\"------------
-.\" VERBON [flag [pointsize [font]]]
-.\" flag
-.\" bit function
-.\" 0 escape on
-.\" 1 add an empty line before verbose text
-.\" 2 add an empty line after verbose text
-.\" 3 numbered lines (controlled by the string Verbnm)
-.\" 4 indent text by the numbervariable Verbin.
-.de VERBON
-.br
-.nr misc*verb 0\\$1
-.if (0\\n[misc*verb]%4)/2 .SP \\n[Lsp]u
-.misc@ev-keep misc*verb-ev
-.nf
-.if (0\\n[misc*verb]%16)/8 .nm \\*[Verbnm]
-.ie !'\\$3'' .ft \\$3
-.el .ft CR
-.ie 0\\$2 \{\
-. ss \\$2
-. ps \\$2
-. vs \\$2
-.\}
-.el .ss 12
-.ta T 8u*\w@n@u
-.if (0\\n[misc*verb]%32)/16 .in +\\n[Verbin]u
-.if 0\\n[misc*verb]%2 \{\
-. eo
-. nr @verbose-flag 1 \" tell pageheader to set ec/eo
-.\}
-..
-.de VERBOFF
-.ec
-.br
-.if (0\\n[misc*verb]%8)/4 .SP \\n[Lsp]u
-.if (0\\n[misc*verb]%16)/8 .nm
-.if (0\\n[misc*verb]%32)/16 .in
-.ev
-.nr @verbose-flag 0
-..
-.\" ######## module pict #################
-.nr pict*width 0
-.nr pict*height 0
-.nr pict*mode 0
-.nr pict*ind 0
-.nr pict*id 0 1
-.\" I assume that the number variable pict*id is the same
-.\" between two runs.
-.de PIC
-.br
-.nr pict*ind 0
-.nr pict*box 0
-.while \\n[.$]>0 \{\
-. if '-B'\\$1' \{\
-. nr pict*box 1
-. shift
-. continue
-. \}
-. if '-L'\\$1' \{\
-. nr pict*mode 0
-. shift
-. continue
-. \}
-. if '-R'\\$1' \{\
-. nr pict*mode 1
-. shift
-. continue
-. \}
-. if '-I'\\$1' \{\
-. nr pict*ind (m;\\$2)
-. nr pict*mode 2
-. shift 2
-. continue
-. \}
-. if '-C'\\$1' \{\
-. nr pict*mode 3
-. shift
-. continue
-. \}
-. ds pict*f \\$1
-. nr pict*id +1
-. shift
-. if \\n[.$]>0 \{\
-. nr pict*width (i;\\$1)
-. shift
-. \}
-. if \\n[.$]>0 \{\
-. nr pict*height (i;\\$1)
-. shift
-. \}
-.\}
-.if \\n[Ref]>0 \{\
-. tm .\\\\" PIC id \\n[pict*id]
-. tm .\\\\" PIC file \\*[pict*f]
-.\}
-.if d pict*file!\\n[pict*id] \{\
-. ds pict*f \\*[pict*file!\\n[pict*id]]
-. nr pict*llx \\n[pict*llx!\\n[pict*id]]
-. nr pict*lly \\n[pict*lly!\\n[pict*id]]
-. nr pict*urx \\n[pict*urx!\\n[pict*id]]
-. nr pict*ury \\n[pict*ury!\\n[pict*id]]
-. \"
-. nr pict*w (p;\\n[pict*urx]-\\n[pict*llx])
-. if \\n[pict*w]<0 .nr pict*w 0-\\n[pict*w]
-. nr pict*h (p;\\n[pict*ury]-\\n[pict*lly])
-. if \\n[pict*h]<0 .nr pict*h 0-\\n[pict*h]
-. if \\n[pict*width]>0 \{\
-. nr pict*rs (u;1000*\\n[pict*width]/\\n[pict*w])
-. nr pict*w (u;\\n[pict*w]*\\n[pict*rs]/1000)
-. nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
-. \}
-. if \\n[pict*height]>0 \{\
-. nr pict*rs (u;1000*\\n[pict*height]/\\n[pict*h])
-. nr pict*h (u;\\n[pict*h]*\\n[pict*rs]/1000)
-. \}
-. if '0'\\n[pict*mode]' \{\
-. nr pict*in \\n[.i]u
-. \}
-. if '1'\\n[pict*mode]' \{\
-. nr pict*in (u;\\n[.l]-\\n[.i]-\\n[pict*w])
-. \}
-. if '2'\\n[pict*mode]' \{\
-. nr pict*in \\n[pict*ind]u
-. \}
-. if '3'\\n[pict*mode]' \{\
-. nr pict*in (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
-. \}
-. ds pict*h "
-. if \\n[pict*h]>0 .ds pict*h \\n[pict*h]
-. \"
-. ne \\n[pict*h]u
-. \"
-. \" these lines are copied and modified from tmac.pspic.
-. \" Originally written by James Clark
-. br
-. ie \\n[pict*box]>0 \{\
-\h'\\n[pict*in]u'\
-\Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
-\v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
-\\n[pict*llx] \\n[pict*lly] \\n[pict*urx] \\n[pict*ury] \\n[pict*w] \\n[pict*h]'
-.\}
-. el \{\
-\h'\\n[pict*in]u'\
-\X'ps: invis'\
-\Z'\D'p 0 \\n[pict*h]u \\n[pict*w]u 0 0 -\\n[pict*h]u''\
-\X'ps: endinvis'\
-\v'\\n[pict*h]u'\X'ps: import \\*[pict*f] \
-\\n[pict*llx] \\n[pict*lly] \\n[pict*urx] \\n[pict*ury] \\n[pict*w] \\n[pict*h]'
-. \}
-. br
-. sp \\n[pict*h]u
-.\}
-..
-.\" external picture
-.de EPIC
-.if \\n[.$]< 2 .@error "EPIC: Not enough arguments"
-.nr pict*w \\$1
-.nr pict*h \\$2
-.ds pict*name "External picture
-.if !''$3' .ds pict*name \\$3
-\&
-.br
-.ne \\n[pict*h]u
-.sp \\n[pict*h]u
-.nr pict*ind (u;(\\n[.l]-\\n[.i]-\\n[pict*w])/2)
-.in +\\n[pict*ind]u
-\D'l \\n[pict*w]u 0'\
-\D'l 0 -\\n[pict*h]u'\
-\D'l -\\n[pict*w]u 0'\
-\D'l 0 \\n[pict*h]u'\
-\v'-(u;\\n[pict*h]/2)'\
-\h'(u;(\\n[pict*w]-\w'\\*[pict*name]'/2))'\\*[pict*name]
-.in
-..
-.\" ######## module acc #################
-.\"-----------
-.\" accents. These are copied from mgs, written by James Clark.
-.de acc@over-def
-.ds \\$1 \Z'\v'(u;\w'x'*0+\En[rst]-\En[.cht])'\
-\h'(u;-\En[skw]+(-\En[.w]-\w'\\$2'/2)+\En[.csk])'\\$2'
-..
-.de acc@under-def
-.ds \\$1 \Z'\v'\En[.cdp]u'\h'(u;-\En[.w]-\w'\\$2'/2)'\\$2'
-..
-.acc@over-def ` \`
-.acc@over-def ' \'
-.acc@over-def ^ ^
-.acc@over-def ~ ~
-.acc@over-def : \(ad
-.acc@over-def ; \(ad
-.acc@under-def , \(ac
-.\" ######## module uni #################
-.\" unimplemented macros
-.de OK
-'tm "OK: not implemented"
-..
-.de PM
-'tm "PM: not implemented"
-..
-.\" ######## module hd #################
-.\" support for usermacro
-.nr hd*h1-page 1 \" last page-number for level 1 header.
-.nr hd*htype 0
-.ds hd*sect-pg
-.ds hd*mark
-.ds hd*suf-space
-.nr hd*need 0
-.aln ;0 hd*htype
-.als }0 hd*mark
-.als }2 hd*suf-space
-.aln ;3 hd*need
-.\"-------------
-.\" .hd@split varable index name val1 val2 ...
-.de hd@split
-.if \\$2>(\\n[.$]-3) .@error "\\$3 must have at least \\$2 values (\\*[\\$3]).
-.nr hd*sp-tmp \\$2+3
-.ds \\$1 \\$[\\n[hd*sp-tmp]]
-..
-.de HU
-.H 0 "\\$1"
-..
-.\"-------------
-.de H
-.if !r hd*cur-bline .nr hd*cur-bline \\n[nl]
-.br
-.df@print-float 2\" $$$ could be wrong...
-.\" terminate all lists
-.LC
-.init@reset
-.nr hd*level 0\\$1
-.nr hd*arg1 0\\$1
-.if !\\n[hd*level] .nr hd*level \\n[Hu]
-.\"
-.\" clear lower counters
-.nr hd*i 1 1
-.while \\n+[hd*i]<8 .if \\n[hd*level]<\\n[hd*i] .nr H\\n[hd*i] 0 1
-.\"
-.\" save last text for use in TP
-.if \\n[hd*level]=1 .ds H1txt \\$2\\$3
-.\"
-.\" This is a little fix to be able to get correct H1 heading number
-.\" in page headers. Special attention was needed when other formats are used.
-.ie !''\\g[H1]' \{\
-. ds hd*format \\g[H1]
-. af H1 0
-. nr H1h \\n[H1] 1
-. af H1 \\*[hd*format]
-.\}
-.el .nr H1h \\n[H1] 1
-.if \\n[hd*level]=1 .nr H1h +1
-.\"
-.\" Check if it's time for new page. Only if text has
-.\" appeared before.
-.if \\n[Ej]&(\\n[Ej]>=\\n[hd*level])&(\\n[nl]>\\n[hd*cur-bline]) .pg@next-page
-.\"
-.\" increment current counter
-.nr H\\n[hd*level] +1
-.\"
-.\" update pagenumber if section-page is used
-.if (\\n[hd*level]=1)&(\\n[Sectp]>0) .hd@set-page 1
-.\"
-.\" hd*mark is the text written to the left of the header.
-.ds hd*mark \\n[H1].
-.\"
-.if \\n[hd*level]>1 .as hd*mark \\n[H2]
-.\"
-.nr hd*i 2 1
-.while \\n+[hd*i]<8 .if \\n[hd*level]>(\\n[hd*i]-1) .as hd*mark .\\n[H\\n[hd*i]]
-.if \\n[Ht] .ds hd*mark \\n[H\\n[hd*level]].
-.\"
-.\" special case, no dot after level one heading if not H1dot true
-.if (\\n[hd*level]=1)&(\\n[H1dot]=0) .ds hd*mark \\n[H1]
-.\"
-.as hd*mark \ \ \" add spaces between mark and heading
-.if !\\n[hd*arg1] .ds hd*mark\" no mark for unnumbered
-.\"
-.if \\n[D]>1 .tm At header \\*[hd*mark] "\\$2"
-.nr hd*htype 0 \" hd*htype = check break and space
-. \" 0 = run-in, 1 = break only, 2 = space
-.if \\n[hd*level]<=\\n[Hb] .nr hd*htype 1
-.if \\n[hd*level]<=\\n[Hs] .nr hd*htype 2
-. \" two spaces if hd*htype == 0
-.ie (\\n[hd*htype]=0)&(\w@\\$2@) .ds hd*suf-space " \"
-.el .ds hd*suf-space
-.nr hd*need 2v \" hd*need = header need space
-.\"---------- user macro HX ------------
-.\" User exit macro to override numbering.
-.\" May change hd*mark (}0), hd*suf-space (}2) and hd*need (;3)
-.\" Can also change Hps1/2.
-.if d HX .HX \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
-.\"--------------------------------------
-.\" pre-space
-.ie \\n[hd*level]<=\\n[Hps] .SP (u;\\n[Hps2])
-.el .SP (u;\\n[Hps1])
-.\"
-.par@reset-num \\n[hd*level]\" reset numbered paragraph
-.\" start diversion to measure size of header
-.di hd*div
-\\*[hd*mark]\\$2\\$3\\*[hd*suf-space]
-.br
-.di
-.rm hd*div
-.if \\n[hd*htype] .na \" no adjust if run-in
-.if \\n[hd*htype]<2 .nr hd*need +\\n[Lsp]u \" add some extra space
-.ne \\n[hd*need]u+\\n[dn]u+.5p-1v \" this is the needed space for a header
-.\"
-.\" size and font calculations
-.hd@split hd*font \\n[hd*level] HF \\*[HF]\" get font for this level
-.ft \\*[hd*font]\" set new font
-.hd@split hd*new-ps \\n[hd*level] HP \\*[HP]\" get point size
-.ie (\\*[hd*new-ps]=0):(\w@\\*[hd*new-ps]@=0) \{\
-. if \\n[hd*htype] \{\
-. if '\\*[hd*font]'3' \{\
-. ps -1
-. vs -1
-. \}
-. if '\\*[hd*font]'B' \{\
-. ps -1
-. vs -1
-. \}
-. \}
-.\}
-.el \{\
-. ps \\*[hd*new-ps]
-. vs \\*[hd*new-ps]+2
-.\}
-.\"
-.\"---------- user macro HY -------------
-.\" user macro to reset indents
-.if d HY .HY \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
-.\"--------------------------------------
-.nr hd*mark-size \w@\\*[hd*mark]@
-.if (\\n[hd*level]<=\\n[Hc])&\\n[hd*htype] .ce\" center if level<=Hc
-.\"
-.\" finally, output the header
-\\*[hd*mark]\&\c
-.\" and the rest of the header
-.ie \\n[hd*htype] \{\
-\\$2\\$3
-. br
-.\}
-.el \\$2\\$3\\*[hd*suf-space]\&\c
-.ft 1
-.\" restore pointsize and vertical size.
-.ps \\n[@ps]u
-.vs \\n[@vs]u
-.\"
-.\" table of contents
-.if (\\n[hd*level]<=\\n[Cl])&\w@\\$2@ .toc@entry \\n[hd*level] "\\$2"
-.\" set adjust to previous value
-.SA
-.\" do break or space
-.if \\n[hd*htype] .br
-.if \\n[hd*htype]>1 .SP (u;\\n[Lsp]*\\n[Hss])
-.if \\n[hd*htype] \{\
-. \" indent if Hi=1 and Pt=1
-. if (\\n[Hi]=1)&(\\n[Pt]=1) .ti +\\n[Pi]n
-. \" indent size of mark if Hi=2
-. if \\n[hd*htype]&(\\n[Hi]>1) .ti +\\n[hd*mark-size]u
-.\}
-.nr par@ind-flag 0 \" no indent on .P if Pt=2
-.\"
-.\" check if it is time to reset footnotes
-.if (\\n[hd*level]=1)&\\n[ft*clear-at-header] .nr ft*nr 0 1
-.\"
-.\" check if it is time to reset indexes
-.if (\\n[hd*level]=1)&\\n[Sectf] \{\
-. nr lix*fg-nr 0 1
-. nr lix*tb-nr 0 1
-. nr lix*ec-nr 0 1
-. nr lix*ex-nr 0 1
-.\}
-.\"---------- user macro HZ ----------
-.if d HZ .HZ \\n[hd*level] \\n[hd*arg1] "\\$2\\$3"
-.nr hd*last-pos \\n[nl]
-.nr hd*last-hpos \\n[.k]
-.nr par@ind-flag 0
-..
-.\"--------
-.de HM
-.nr hd*i 0 1
-.while \\n+[hd*i]<8 .af H\\n[hd*i] \\$[\\n[hd*i]] 1
-..
-.\"----------------------
-.\" set page-nr, called from header
-.\"
-.de hd@set-page
-.\"
-.ie \\n[.$]>0 .nr P \\$1
-.el .nr P +1
-.\" Set section-page-string
-.ds hd*sect-pg \\n[H1]-\\n[P]
-.if \\n[Sectp]>1 .if '\\n[H1]'0' .ds hd*sect-pg "
-..
-.\"########### module pg ####################
-.\" set end of text trap
-.wh 0 pg@header
-.em pg@end-of-text
-.\"
-.ds pg*header ''- \\nP -''
-.ds pg*footer
-.if \n[N]=4 .ds pg*header ''''
-.if (\n[N]=3):(\n[N]=5) \{\
-. ds pg*header ''''
-. ds pg*footer ''\\*[hd*sect-pg]''
-.\}
-.ds pg*even-footer
-.ds pg*odd-footer
-.ds pg*even-header
-.ds pg*odd-header
-.\"
-.nr pg*top-margin 0
-.nr pg*foot-margin 0
-.nr pg*block-size 0
-.nr pg*footer-size 5\" 1v+footer+even/odd footer+2v
-.nr pg*header-size 7\" 3v+header+even/odd header+2v
-.nr pg*extra-footer-size 0
-.nr pg*extra-header-size 0
-.nr ft*note-size 0
-.nr pg*cur-column 0
-.nr pg*cols-per-page 1
-.nr pg*cur-po \n[@po]
-.nr pg*head-mark 0
-.\"
-.nr pg*ps \n[@ps]
-.nr pg*vs \n[@vs]
-.\"-------------------------
-.\" footer TRAPS: set, enable and disable
-.de pg@set-new-trap
-.nr pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v+\\n[pg*extra-footer-size]u)
-.\"
-.if \\n[D]>2 .tm pg*foot-trap \\n[@pl]u-(\\n[pg*block-size]u+\\n[ft*note-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v+\\n[pg*extra-footer-size]u) = \\n[pg*foot-trap]
-.\"
-.\" last-pos points to the position of the footer and bottom
-.\" block below foot-notes.
-.nr pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v)
-.if \\n[D]>2 .tm pg*last-pos \\n[@pl]u-(\\n[pg*block-size]u+\\n[pg*foot-margin]u+\\n[pg*footer-size]v) = \\n[pg*last-pos]
-..
-.de pg@enable-trap
-.wh \\n[pg*foot-trap]u pg@footer
-.if \\n[D]>2 .tm pg@enable-trap .t=\\n[.t] nl=\\n[nl]
-.if \\n[D]>2 .ptr
-..
-.de pg@disable-trap
-.ch pg@footer
-..
-.\" move to new trap (if changed).
-.de pg@move-trap
-.pg@disable-trap
-.pg@set-new-trap
-.pg@enable-trap
-..
-.de pg@enable-top-trap
-.\" set trap for pageheader.
-.nr pg*top-enabled 1
-..
-.de pg@disable-top-trap
-.\" remove trap for pageheader.
-.nr pg*top-enabled 0
-..
-.\" no header on the next page
-.de PGNH
-.nr pg*top-enabled (-1)
-..
-.\" set first trap for pagefooter
-.pg@enable-top-trap
-.pg@set-new-trap
-.pg@enable-trap
-.\"-------------------------
-.\" stop output and begin on next page. Fix footnotes and all that.
-.de pg@next-page
-.\".debug next-page
-.ne 999i \" activate trap
-.\" .pg@footer
-..
-.\"-------------------------
-.\" support for PX, TP and EOP.
-.als }t pg*header
-.als }e pg*even-header
-.als }o pg*odd-header
-.als TPh pg*header
-.als TPeh pg*even-header
-.als TPoh pg*odd-header
-.\"
-.als EOPf pg*footer
-.als EOPef pg*even-footer
-.als EOPof pg*odd-footer
-.\"------------------------------------------------------------
-.\" HEADER
-.de pg@header
-.if \\n[D]>1 .tm Page# \\n[%] (\\n[.F]:\\n[c.])
-.if \\n[Idxf] \{\
-.tl ''''
-.\}
-.\" assign current page-number to P
-.hd@set-page
-.\" reset spacing
-.nr line*lp\\n[.z] 0
-.nr line*ac\\n[.z] 0
-.\"
-.\" suppress pageheader if pagenumber == 1 and N == [124]
-.if \\n[pg*top-enabled] \{\
-.\" must be fixed!!
-.\". pg@disable-top-trap
-. if \\n[pg*extra-header-size] 'sp \\n[pg*extra-header-size]u
-. if \\n[pg*top-margin] 'sp \\n[pg*top-margin]u
-. ev pg*tl-ev
-. pg@set-env
-. ie d let@header .let@header
-. el \{\
-. ie d TP .TP
-. el \{\
-' sp 3
-. ie ((\\n[%]=1)&((\\n[N]=1):(\\n[N]=2))) .sp
-. el .tl \\*[pg*header]
-. ie o .tl \\*[pg*odd-header]
-. el .tl \\*[pg*even-header]
-' sp 2
-. \}
-. \}
-. ev
-. \" why no-space??
-. if d PX \{\
-. ns
-. PX
-. rs
-. \}
-. \" check for pending footnotes
-. ft@check-old
-. \"
-. \" back to normal text processing
-. pg@enable-trap
-. \" mark for multicolumn
-. nr pg*head-mark \\n[nl]u
-. \" reset NCOL pointer at each new page.
-. nr pg*last-ncol 0
-. \" set multicolumn
-. \"
-. pg@set-po
-. \" print floating displays
-. df@print-float 4
-. tbl@top-hook
-. ns
-.\}
-.if \\n[pg*top-enabled]<0 .nr pg*top-enabled 1
-.nr hd*cur-bline \\n[nl] \" .H needs to know if output has occured
-..
-.\"---------------------------------------------------------
-.\" FOOTER
-.de pg@footer
-.ec
-.if \\n[D]>2 .tm Footer# \\n[%] (\\n[.F]:\\n[c.])
-.pg@disable-trap
-.\".debug footer
-.tbl@bottom-hook
-.\" increment pageoffset for MC
-.\" move to the exact start of footer.
-'sp |\\n[pg*foot-trap]u+1v
-.\"
-.if \\n[D]>3 .tm FOOTER after .sp
-.\" print footnotes
-.if d ft*div .ft@print
-.\"
-.pg@inc-po
-.if !\\n[pg*cur-column] .pg@print-footer
-.\" next column
-.pg@set-po
-.pg@enable-trap
-.if \\n[@verbose-flag] .eo \" to help VERBON/VERBOFF
-..
-.\"-------------------------
-.de pg@print-footer
-.\" jump to the position just below the foot-notes.
-'sp |\\n[pg*last-pos]u+1v
-.\" check if there are any bottom block
-.if d pg*block-div .pg@block
-.\"
-.\" print the footer and eject new page
-.ev pg*tl-ev
-.pg@set-env
-.\" user defined end-of-page macro
-.ie d EOP .EOP
-.el \{\
-. ie o .tl \\*[pg*odd-footer]
-. el .tl \\*[pg*even-footer]
-. ie (\\n[%]=1)&(\\n[N]=1) .tl \\*[pg*header]
-. el .tl \\*[pg*footer]
-. tl ''\\*[Pg_type!\\n[@copy_type]]''
-.\}
-.ev
-.\" be sure that floating displays and footnotes will be
-.\" printed at the end of the document.
-.ie (\\n[df*fnr]>=\\n[df*o-fnr]):\\n[ft*exist] \{\
-. ev ne
-' bp
-. ev
-.\}
-.el 'bp
-..
-.\"-------------------------
-.\"
-.\" Initialize the title environment
-.de pg@set-env
-'na
-'nh
-'in 0
-'ti 0
-.ie \\n[Pgps] \{\
-. ps \\n[@ps]u
-. vs \\n[@vs]u
-.\}
-.el \{\
-. ps \\n[pg*ps]u
-. vs \\n[pg*vs]u
-.\}
-.lt \\n[@ll]u
-..
-.\"-------------------------
-.de PH
-.ds pg*header "\\$1
-.pg@set-new-size
-..
-.de PF
-.ds pg*footer "\\$1
-.pg@set-new-size
-..
-.de OH
-.ds pg*odd-header "\\$1
-.pg@set-new-size
-..
-.de EH
-.ds pg*even-header "\\$1
-.pg@set-new-size
-..
-.de OF
-.ds pg*odd-footer "\\$1
-.pg@set-new-size
-..
-.de EF
-.ds pg*even-footer "\\$1
-.pg@set-new-size
-..
-.de pg@clear-hd
-.ds pg*even-header
-.ds pg*odd-header
-.ds pg*header
-..
-.de pg@clear-ft
-.ds pg*even-footer
-.ds pg*odd-footer
-.ds pg*footer
-..
-.de pg@set-new-size
-.nr pg*ps \\n[@ps]
-.nr pg*vs \\n[@vs]
-.pg@move-trap
-..
-.\"-------------------------
-.\" end of page processing
-.de pg@footnotes
-.\".debug footnotes
-.\" output footnotes. set trap for block
-.\"
-..
-.\"-------------------------
-.\" print bottom block
-.de pg@block
-.ev pg*block-ev
-'nf
-'in 0
-.ll 100i
-.pg*block-div
-.br
-.ev
-..
-.\"-------------------------
-.\" define bottom block
-.de BS
-.misc@ev-keep pg*block-ev
-.init@reset
-.br
-.di pg*block-div
-..
-.\"-------------------------
-.de BE
-.br
-.di
-.nr pg*block-size \\n[dn]u
-.ev
-.pg@move-trap
-..
-.\"-------------------------
-.\" print out all pending text
-.de pg@end-of-text
-.if \\n[D]>2 .tm ---------- End of text processing ----------------
-.df@eot-print
-.ref@eot-print
-..
-.\"-------------------------
-.\" set top and bottom margins
-.de VM
-.if \\n[.$]=0 \{\
-. nr pg*extra-footer-size 0
-. nr pg*extra-header-size 0
-.\}
-.if \\n[.$]>0 .nr pg*extra-header-size (v;\\$1)
-.if \\n[.$]>1 .nr pg*extra-footer-size (v;\\$2)
-.if \\n[D]>2 \{\
-. tm extra top \\n[pg*extra-footer-size]
-. tm extra bottom \\n[pg*extra-header-size]
-.\}
-.pg@move-trap
-..
-.\"---------------------
-.\" multicolumn output.
-.de pg@set-po
-.if \\n[pg*cols-per-page]>1 \{\
-. ll \\n[pg*column-size]u
-.\}
-..
-.de pg@inc-po
-.if \\n[pg*cols-per-page]>1 \{\
-. ie \\n+[pg*cur-column]>=\\n[pg*cols-per-page] \{\
-. nr pg*cur-column 0 1
-. nr pg*cur-po \\n[@po]u
-. po \\n[@po]u
-. ll \\n[@ll]u
-. \}
-. el \{\
-. nr pg*cur-po +(\\n[pg*column-size]u+\\n[pg*column-sep]u)
-. po \\n[pg*cur-po]u
-' sp |\\n[pg*head-mark]u
-. tbl@top-hook
-. \}
-.\}
-..
-.\" An argument disables the page-break.
-.de 1C
-.br
-.if \\n[pg*cols-per-page]<=1 .@error "1C: multicolumn mode not active"
-.nr pg*cols-per-page 1
-.nr pg*column-sep 0
-.nr pg*column-size \\n[@ll]
-.nr pg*ncol-i \\n[pg*cur-column]\" temp variable
-.nr pg*cur-column 0 1
-.nr pg*cur-po \\n[@po]u
-.PGFORM
-.ie !'\\$1'1' .SK
-.el \{\
-. if d ft*div \{\
-. if \\n[pg*ncol-i]>0 \{\
-. @warning 1C: footnotes will be messy
-. \}
-. \}
-. if \\n[pg*last-ncol]>0 \{\
-. sp |\\n[pg*last-ncol]u
-. nr pg*last-ncol 0
-. \}
-.\}
-..
-.de 2C
-.br
-.nr pg*head-mark \\n[nl]u
-.if \\n[pg*cols-per-page]>1 .@error "2C: multicolumn mode already active"
-.nr pg*cols-per-page 2
-.nr pg*column-sep \\n[@ll]/15
-.nr pg*column-size (\\n[@ll]u*7)/15
-.nr pg*cur-column 0 1
-.nr pg*cur-po \\n[@po]u
-.ll \\n[pg*column-size]u
-.\" .lt \\n[pg*column-size]u
-..
-.\" MC column-size [ column-separation ]
-.de MC
-.br
-.nr pg*head-mark \\n[nl]u
-.if \\n[pg*cols-per-page]>1 .@error "MC: multicolumn mode already active"
-.ie ''\\$1' .nr pg*column-size \\n[.l]
-.el .nr pg*column-size (n;\\$1)
-.ie ''\\$2' .nr pg*column-sep \\n[pg*column-size]/15
-.el .nr pg*column-sep (n;\\$2)
-.\"
-.nr pg*cols-per-page (u;\\n[.l]/(\\n[pg*column-size]+\\n[pg*column-sep]+1))
-.nr pg*cur-column 0 1
-.nr pg*cur-po \\n[@po]u
-.ll \\n[pg*column-size]u
-.\" .lt \\n[pg*column-size]u
-..
-.\" begin a new column
-.de NCOL
-.br
-.if \\n[nl]>\\n[pg*last-ncol] .nr pg*last-ncol \\n[nl]
-.pg@footer
-..
-.\" skip pages
-.de SK
-.br
-.bp
-.nr pg*i 0 1
-.\" force new page by writing something invisible.
-.while \\n+[pg*i]<=(0\\$1) \{\
-\&
-. bp
-.\}
-..
-.\"-------------------------------
-.\" MULB width1 space1 width2 space2 width3 space3 ...
-.de MULB
-.br
-.nr pg*i 0 1
-.nr pg*mul-x 0 1
-.nr pg*mul-ind 0
-.nr pg*mul-last 0
-.while \\n[.$] \{\
-. nr pg*mul!\\n+[pg*i] (n;0\\$1)
-. nr pg*muls!\\n[pg*i] (n;0\\$2)
-. shift 2
-.\}
-.nr pg*mul-max-col \\n[pg*i]
-.ds pg*mul-fam \\n[.fam]
-.nr pg*mul-font \\n[.f]
-.ev pg*mul-ev
-.ps \\n[@ps]u
-.vs \\n[@vs]u
-.fam \\*[pg*mul-fam]
-.ft \\n[pg*mul-font]
-.fi
-.hy 14
-.di pg*mul-div
-.MULN
-..
-.\"-----------
-.de MULN
-.if \\n[pg*mul-x]>=\\n[pg*mul-max-col] .@error "MULN: Undefined columnwidth"
-.br
-.if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
-.rt +0
-.in \\n[pg*mul-ind]u
-.ll (u;\\n[.i]+\\n[pg*mul!\\n+[pg*mul-x]])u
-.nr pg*mul-ind +(u;\\n[pg*mul!\\n[pg*mul-x]]+\\n[pg*muls!\\n[pg*mul-x]])
-..
-.\"-----------
-.\" MULE
-.de MULE
-.br
-.if \\n[.d]>\\n[pg*mul-last] .nr pg*mul-last \\n[.d]
-.di
-.ev
-.ne \\n[pg*mul-last]u
-.nf
-.mk
-.pg*mul-div
-.rt
-.sp \\n[pg*mul-last]u
-.fi
-..
-.\"-----------
-.de OP
-.br
-.ie o .if !\\n[pg*head-mark]=\\n[nl] \{\
-. bp +1
-. bp +1
-.\}
-.el .bp
-..
-.\"########### module footnotes ###################
-.nr ft*note-size 0
-.nr ft*busy 0
-.nr ft*nr 0 1
-.nr ft*wide 0
-.nr ft*hyphen 0\" hyphenation value
-.nr ft*adjust 1\" >0 if adjust true
-.nr ft*indent 1\" >0 if text indent true (not imp. $$$)
-.nr ft*just 0\" 0=left justification, 1=right (not imp. $$$)
-.nr ft*exist 0\" not zero if there are any footnotes to be printed
-.nr ft*clear-at-header 0\" >0 if footnotes should be reset at first level head.
-.\"
-.ds F \v'-.4m'\s-3\\n+[ft*nr]\s0\v'.4m'
-.\"
-.\"-----------------
-.\" init footnote environment
-.de ft@init
-.\" indentcontrol not implemented $$$
-.\" label justification not implemented $$$
-'in 0
-'fi
-.ie \\n[ft*adjust] 'ad
-.el 'na
-.ie \\n[ft*hyphen] 'hy 14
-.el 'hy 0
-.ll \\n[@cur-ll]u
-.lt \\n[@cur-ll]u
-.ps (p;\\n[@ps]u-2)
-.vs (p;\\n[@vs]u-1)
-..
-.\"-----------------
-.\" set footnote format
-.\" no support for two column processing (yet). $$$
-.de FD
-.if \\n[.$]=0 .@error "FD: bad arg \\$1"
-.ie \\n[.$]=2 .nr ft*clear-at-header 1
-.el .nr ft*clear-at-header 0
-.\"
-.if !'\\$1'' \{\
-. ie \\$1>11 .nr ft*format 0
-. el .nr ft*format \\$1
-. \"
-. nr ft*hyphen (\\n[ft*format]%2)*14
-. nr ft*format \\n[ft*format]/2
-. \"
-. nr ft*adjust 1-(\\n[ft*format]%2)
-. nr ft*format \\n[ft*format]/2
-. \"
-. nr ft*indent 1-(\\n[ft*format]%2)
-. nr ft*format \\n[ft*format]/2
-. \"
-. nr ft*just \\n[ft*format]%2
-.\}
-..
-.\"---------------
-.\" Footnote and display width control $$$
-.de WC
-.nr ft*i 0 1
-.while \\n+[ft*i]<=\\n[.$] \{\
-. ds ft*x \\$[\\n[ft*i]]
-. if '\\*[ft*x]'N' \{\
-. nr ft*wide 0
-. nr ft*first-fn 0
-. nr ds*wide 0
-. nr ds*float-break 1
-. \}
-. if '\\*[ft*x]'-WF' .nr ft*wide 0
-. if '\\*[ft*x]'WF' .nr ft*wide 1
-. if '\\*[ft*x]'-FF' .nr ft*first-fn 0
-. if '\\*[ft*x]'FF' .nr ft*first-fn 1
-. if '\\*[ft*x]'-WD' \{\
-. nr ds*wide 0
-. if r ft*df-save \{\
-. nr Df \\n[ft*df-save]
-. rm ft*df-save
-. \}
-. \}
-. if '\\*[ft*x]'WD' \{\
-. nr ds*wide 1
-. nr ft*df-save \\n[Df]
-. nr Df 4
-. \}
-. if '\\*[ft*x]'-FB' .nr ds*float-break 0
-. if '\\*[ft*x]'FB' .nr ds*float-break 1
-. if \\n[D]>1 .tm WC WF=\\n[ft*wide] WD=\\n[ds*wide]
-.\}
-..
-.\"-----------------
-.\" begin footnote
-.\" Change environment, switch to diversion and print the foot-note mark.
-.de FS
-.if \\n[ft*busy] .@error "FS: missing FE"
-.nr ft*busy 1
-.ev ft*ev
-.ft@init
-.if !\\n[ft*wide] .pg@set-po
-.di ft*tmp-div
-.nr ft*space (u;\\n[Fs]*\\n[Lsp])
-.sp \\n[ft*space]u
-.\" print mark
-.ie \\n[.$] .ds ft*mark \\$1
-.el .ds ft*mark \\n[ft*nr].
-\\*[ft*mark]
-.in +.75c
-.sp -1
-.nr ft*exist 1
-..
-.\"-----------------
-.\" init footnote diversion
-.de ft@init-footnote
-.di ft*div
-\l'20n'
-.br
-.di
-.nr ft*note-size \\n[dn]
-..
-.\"-----------------
-.\" end footnote
-.\" End the diversion, back to previous environment, and adjust
-.\" the trap to the new foot-note size.
-.de FE
-.nr ft*busy 0
-.br
-.di
-'in 0
-'nf
-.if \\n[@pl]u<\\n[dn]u .@error "FE: too big footnote"
-.if !d ft*div .nr dn +1v
-.if \\n[D]>3 .tm FE: foot-trap=\\n[pg*foot-trap] .d=\\n[.d] dn=\\n[dn]
-.ie (\\n[pg*foot-trap]u-\\n[.d]u)<\\n[dn]u \{\
-. da ft*next-div
-. ft*tmp-div
-. br
-. di
-.\}
-.el \{\
-. if !d ft*div .ft@init-footnote
-. da ft*div
-. ft*tmp-div
-. di
-. nr ft*note-size +\\n[dn]
-.\}
-.rm ft*tmp-div
-.ev
-.pg@move-trap
-..
-.\"-----------------
-.\" print footnotes, see pg@footer
-.de ft@print
-.ev ft*print-ev
-'nf
-'in 0
-.ll 100i
-.ft*div
-.br
-.ev
-.rm ft*div
-.nr ft*note-size 0
-.pg@move-trap
-..
-.\"-----------------
-.\" check if any pending footnotes, see pg@header
-.de ft@check-old
-.if d ft*next-div \{\
-. ev ft*ev
-. ft@init
-. ft@init-footnote
-. nf
-. in 0
-. da ft*div
-. ft*next-div
-. di
-. nr ft*note-size +\\n[dn]
-. rm ft*next-div
-. ev
-. nr ft*exist 0
-. pg@move-trap
-.\}
-..
-.\"########### module display ###################
-.nr ds*wide 0\" >0 if wide displays wanted
-.nr df*fnr 0 1\" floating display counter
-.nr df*o-fnr 1\" floating display counter, already printed
-.nr ds*snr 0 1\" static display counter
-.nr ds*lvl 0 1\" display level
-.nr ds*float-busy 0\" >0 if printing float
-.nr df*float 0 >0 if previous display was floating
-.\"--------------------------------------------
-.de DE
-.ie \\n[df*float] .df@end \\$@
-.el .ds@end \\$@
-..
-.\"--------------------------------------------
-.\" floating display start
-.\" nested DF/DE is not allowed.
-.de DF
-.if \\n[df*float] .@error "DF:nested floating is not allowed. Use DS."
-.ds@set-format \\$@
-.\"
-.nr df*old-ll \\n[.l]
-.nr ds*ftmp \\n[.f]
-.misc@ev-keep df*ev
-.ft \\n[ds*ftmp]
-.\"
-.init@reset
-.di df*div
-'in 0
-.\"
-.ds@set-new-ev \\n[df*old-ll]
-.SP \\n[Lsp]u
-.nr df*float 1
-..
-.\"--------------------------------------------
-.de df@end
-.br
-.SP \\n[Lsp]u
-.di
-.nr df*width!\\n+[df*fnr] \\n[dl]
-.nr df*height!\\n[df*fnr] \\n[dn]
-.nr df*wide!\\n[df*fnr] \\n[ds*wide]
-.nr df*format!\\n[df*fnr] \\n[ds*format]
-.ev
-.if \\n[D]>2 .tm DF:fnr=\\n[df*fnr] w=\\n[dl] h=\\n[dn] wide=\\n[ds*wide] \
- form=\\n[ds*format]
-.\" move div to the floating display list
-.rn df*div df*fdiv!\\n[df*fnr]
-.\"
-.nr par@ind-flag 0
-.\" print float if queue is empty and the display fits into
-.\" the current page
-.if ((\\n[df*fnr]>=\\n[df*o-fnr])&(\\n[dn]<\\n[.t])) .df@print-float 1
-.nr df*float 0
-..
-.\"-------------
-.\" called by end-of-text
-.de df@eot-print
-.br
-.if \\n[df*o-fnr]<=\\n[df*fnr] \{\
-. if \\n[D]>2 .tm Print remaining displays.
-.\" still some floats left, make non-empty environment
-. misc@ev-keep ne
-. init@reset
-\c
-. df@print-float 3
-. ev
-.\}
-..
-.\"---------------
-.\" print according to Df and De.
-.\" .df@print-float type
-.\" type called from
-.\" 1 .DE
-.\" 2 end of section
-.\" 3 end of document
-.\" 4 beginning of new page
-.\"
-.de df@print-float
-.if \\n[Df]>5 .@error "Df=\\n[Df], max value is 5"
-.if !\\n[ds*float-busy] \{\
-. nr ds*float-busy 1
-.\" at .DE
-. if \\n[D]>3 .tm print-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
-. \" Df = 1 or 5
-. if (\\$1=1)&((\\n[Df]=1):(\\n[Df]=5)) \{\
-. if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
-. \" Print only new displays.
-. if \\n[df*o-fnr]=\\n[df*fnr] \{\
-. br
-. ds@print-one-float
-. \}
-. \}
-. \}
-. \" Df = 3
-. if (\\$1=1)&(\\n[Df]=3) \{\
-. if \\n[.t]>\\n[df*height!\\n[df*o-fnr]] \{\
-. br
-. ds@print-one-float
-. \}
-. \}
-.\" print all if Df<2 and end of section
-. if (\\$1=2)&(\\n[Sectp]>0)&(\\n[Df]<2) \{\
-. br
-. ds@print-all-floats
-. \}
-.\" print all if end of document. Where should they go instead?
-. if \\$1=3 \{\
-. br
-. ds@print-all-floats
-.\}
-.\" new page
-. if (\\$1=4)&(\\n[Df]>1) \{\
-. if \\n[Df]=2 .ds@print-one-float
-. if \\n[Df]=3 .ds@print-one-float
-. if \\n[Df]>3 \{\
-. ie \\n[De] .ds@print-all-floats
-. el .ds@print-this-page
-. \}
-. \}
-. nr ds*float-busy 0
-.\}
-..
-.\"---------------
-.\" DF out
-.\" print a floating diversion
-.de ds@output-float
-.nr df*old-ll \\n[.l]
-.nr df*old-in \\n[.i]
-.ev ds*fev
-.nf
-.nr df*i \\n[df*o-fnr]
-.nr df*f \\n[df*format!\\n[df*i]]
-.\"
-.in \\n[df*old-in]u
-.if \\n[df*f]=1 'in +\\n[Si]n
-.if \\n[df*f]>=2 'in 0
-.if \\n[df*f]=2 'ce 9999
-.if \\n[df*f]=3 'in (u;(\\n[.l]-\\n[df*width!\\n[df*i]])/2)
-.if \\n[df*f]=4 'rj 9999
-.if \\n[df*f]=5 'in (u;\\n[.l]-\\n[df*width!\\n[df*i]])
-.\"
-.\"
-.df*fdiv!\\n[df*o-fnr]
-.\"
-.if \\n[df*f]=2 'ce 0
-.if \\n[df*f]=4 'rj 0
-.ev
-.rm df*fdiv!\\n[df*i]
-.rm df*height!\\n[df*i]
-.rm df*format!\\n[df*i]
-.if \\n[df*wide!\\n[df*i]] .nr pg*head-mark \\n[nl]u
-.nr df*o-fnr +1
-..
-.\"---------------
-.\" print one floating display if there is one.
-.de ds@print-one-float
-.if \\n[df*o-fnr]<=\\n[df*fnr] \{\
-. if \\n[D]>3 .tm print-one-float: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
-. if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
-. ds@output-float
-. if \\n[De] .pg@next-page
-.\}
-..
-.\"---------------
-.\" print all queued floats.
-.\" if De>0 do a page eject between the floats.
-.de ds@print-all-floats
-.while \\n[df*o-fnr]<=\\n[df*fnr] \{\
-. if \\n[D]>3 .tm print-all-floats: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
-. if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .pg@next-page
-. br
-\c
-. ds@output-float
-. if \\n[De] .pg@next-page
-.\}
-..
-.\"---------------
-.\" print as many floats as will fit on the current page
-.de ds@print-this-page
-.while \\n[df*o-fnr]<=\\n[df*fnr] \{\
-. if \\n[D]>3 .tm print-this-page: .t=\\n[.t], h=\\n[df*height!\\n[df*o-fnr]]
-. if \\n[.t]<\\n[df*height!\\n[df*o-fnr]] .break
-. ds@output-float
-.\}
-..
-.\"---------------------------------------------------
-.\" get format of the display
-.de ds@set-format
-.ie \\n[.$] \{\
-. ie r ds*format!\\$1 .nr ds*format \\n[ds*format!\\$1]
-. el .@error "DS/DF:wrong format:\\$1"
-.\}
-.el .nr ds*format 0
-.if \\n[D]>2 .tm set format=\\n[ds*format]
-.\" fill or not to fill, that is the...
-.nr ds*fill 0
-.ie \\n[.$]>1 \{\
-. ie r ds*fill!\\$2 .nr ds*fill \\n[ds*fill!\\$2]
-. el .@error "\\*[ds*type]:wrong fill:\\$2"
-.\}
-.if \\n[D]>2 .tm set fill=\\n[ds*fill]
-.nr ds*rindent 0
-.if \\n[.$]>2 .nr ds*rindent \\$3
-.if \\n[D]>2 .tm set indent=\\n[ds*rindent]
-..
-.\"-----------------------------
-.\" .ds@set-new-ev previous-line-length
-.de ds@set-new-ev
-.ll \\$1u
-.lt \\$1u
-.if \\n[ds*rindent] \{\
-. ll -\\n[ds*rindent]n
-. lt -\\n[ds*rindent]n
-.\}
-.if \\n[ds*wide] \{\
-. ll \\n[@ll]u
-. lt \\n[@ll]u
-.\}
-.\"
-.ie \\n[ds*fill] 'fi
-.el 'nf
-..
-.\"--------------------------------------------------------
-.nr ds*format 0\" dummy value for .En/.EQ
-.nr ds*format! 0\" no indent
-.nr ds*format!0 0\" no indent
-.nr ds*format!L 0\" no indent
-.nr ds*format!I 1\" indent
-.nr ds*format!1 1\" indent
-.nr ds*format!C 2\" center each line
-.nr ds*format!2 2\" center each line
-.nr ds*format!CB 3\" center as block
-.nr ds*format!3 3\" center as block
-.nr ds*format!R 4\" right justify each line
-.nr ds*format!4 4\" right justify each line
-.nr ds*format!RB 5\" right justify as block
-.nr ds*format!5 5\" right justify as block
-.\"---------------
-.nr ds*fill! 0\" no fill
-.nr ds*fill!N 0\" no fill
-.nr ds*fill!0 0\" no fill
-.nr ds*fill!F 1\" fill on
-.nr ds*fill!1 1\" fill on
-.\"--------------------------------------------
-.\" static display start
-.\" nested DS/DE is allowed. No limit on depth.
-.de DS
-.br
-.nr ds*lvl +1
-.ds@set-format \\$@
-.\"
-.nr ds*old-ll \\n[.l]
-.nr ds*old-in \\n[.i]
-.misc@push ds-ll \\n[.l]
-.misc@push ds-form \\n[ds*format]
-.nr ds*i \\n[.i]
-.nr ds*ftmp \\n[.f]
-.misc@ev-keep ds*ev!\\n+[ds*snr]
-.ft \\n[ds*ftmp]
-.\"
-.init@reset
-.\" indent in a diversion doesn't seem like a good idea.
-'in 0
-.di ds*div!\\n[ds*snr]
-.\"
-.ds@set-new-ev \\n[ds*old-ll]
-.nr df*float 0
-..
-.\"--------------------------------------------
-.de ds@end
-.if \\n-[ds*lvl]<0 .@error "DE: no corresponding DS"
-.br
-.di
-.\" **********
-.nr ds*width \\n[dl]
-.nr ds*height \\n[dn]
-.misc@pop-nr ds-ll ds*old-ll
-.misc@pop-nr ds-form ds*format
-.\"
-.\" **********
-'nf
-.\" calculate needed space
-.nr ds*need \\n[ds*height]
-.nr ds*i \\n[pg*foot-trap]-\\n[pg*header-size]v-\\n[pg*extra-header-size]v
-.if (\\n[ds*height]>\\n[ds*i])&(\\n[.t]<(\\n[ds*i]/2)) .nr ds*need \\n[.t]u+1v
-.if (\\n[ds*height]<\\n[ds*i])&(\\n[.t]<(\\n[ds*height])) .nr ds*need \\n[.t]u+1v
-.\" Eject page if display will fit one page and
-.\" there are less than half of the page left.
-.if \\n[ds*need] .ne \\n[ds*need]u
-.\"
-.\" check if pending equation label
-.eq@check \\n[ds*need]
-'in \\n[ds*old-in]u
-.if \\n[ds*format]=1 'in \\n[ds*old-in]u+\\n[Si]n
-.if \\n[ds*format]>=2 'in 0
-.if \\n[ds*format]=2 'ce 9999
-.if \\n[ds*format]=3 'in (u;(\\n[.l]-\\n[ds*width])/2)
-.if \\n[ds*format]=4 'rj 9999
-.if \\n[ds*format]=5 'in (u;\\n[.l]-\\n[ds*width])
-.\" **********
-.\"
-.\" Print static display
-.nr ds*i \\n[Lsp]
-.if r Dsp .nr ds*i \\n[Dsp]
-.\"
-.if \\n[Ds] .SP \\n[ds*i]u
-.ds*div!\\n[ds*snr]
-.if \\n[Ds] .SP \\n[ds*i]u
-.\"
-.if \\n[ds*format]=2 'ce 0
-.if \\n[ds*format]=4 'rj 0
-.rm ds*div!\\n[ds*snr]
-.nr ds*snr -1
-.nr par@ind-flag 0
-.ev
-..
-.\"########### module list ###################
-.\" .LI text-indent mark-indent pad type [mark [LI-space [LB-space] ] ]
-.\"
-.nr li*tind 0
-.nr li*mind 0
-.nr li*pad 0
-.nr li*type 0
-.ds li*mark 0
-.nr li*li-spc 0
-.nr li*lvl 0 1
-.aln :g li*lvl
-.nr li*cur-vpos 0
-.\"--------------------------
-.\" the major list-begin macro.
-.\" If type == -1 a 'break' will occur.
-.de LB
-.if \\n[.$]<4 .@error "LB: not enough arguments, min 4"
-.misc@push cind \\n[.i]
-.misc@push tind \\n[li*tind]
-.misc@push mind \\n[li*mind]
-.misc@push pad \\n[li*pad]
-.misc@push type \\n[li*type]
-.misc@push li-spc \\n[li*li-spc]
-.ds li*mark-list!\\n[li*lvl] \\*[li*mark]
-.nr li*lvl +1
-.\"
-.nr li*tind (n;0\\$1)\" text-indent
-.nr li*mind (n;0\\$2)\" mark-indent
-.nr li*pad (n;0\\$3)\" pad
-.nr li*type 0\\$4\" type
-.ds li*mark \\$5\" mark
-.ie !'\\$6'' .nr li*li-spc \\$6\" LI-space
-.el .nr li*li-spc 1
-.ie !'\\$7'' .nr li*lb-spc \\$6\" LB-space
-.el .nr li*lb-spc 0
-.\" init listcounter
-.nr li*cnt!\\n[li*lvl] 0 1
-.\" assign format
-.af li*cnt!\\n[li*lvl] 1
-.if \\n[li*type] .if !'\\*[li*mark]'' .af li*cnt!\\n[li*lvl] \\*[li*mark]
-.\"
-.if \\n[li*lb-spc] .SP (u;\\n[li*lb-spc]*\\n[Lsp])
-.in +\\n[li*tind]u
-..
-.\"---------------
-.de LI
-.if \\n[li*lvl]<1 .@error "LI:no lists active"
-.if \\n[li*li-spc]&(\\n[Ls]>=\\n[li*lvl]) .SP (u;\\n[li*li-spc]*\\n[Lsp])
-.ne 2v
-.\"
-.ds li*c-mark \\*[li*mark]
-.nr li*cnt!\\n[li*lvl] +1
-.if \\n[li*type]=1 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]].
-.if \\n[li*type]=2 .ds li*c-mark \\n[li*cnt!\\n[li*lvl]])
-.if \\n[li*type]=3 .ds li*c-mark (\\n[li*cnt!\\n[li*lvl]])
-.if \\n[li*type]=4 .ds li*c-mark [\\n[li*cnt!\\n[li*lvl]]]
-.if \\n[li*type]=5 .ds li*c-mark <\\n[li*cnt!\\n[li*lvl]]>
-.if \\n[li*type]=6 .ds li*c-mark {\\n[li*cnt!\\n[li*lvl]]}
-.if \\n[.$]=1 .ds li*c-mark \\$1
-.ie \\n[.$]=2 \{\
-. ie (\\$2=2):(\\n[Limsp]=0) .ds li*c-mark \\$1\\*[li*c-mark]
-. el .ds li*c-mark \\$1\ \\*[li*c-mark]
-.\}
-.\"
-.\" determine where the text begins
-.nr li*text-begin \\n[li*tind]>?\w@\\*[li*c-mark]\ @
-.nr x \w@\\*[li*c-mark]\ @
-.\"
-.\" determine where the mark begin
-.ie !\\n[li*pad] .nr li*in \\n[li*mind]
-.el .nr li*in \\n[li*text-begin]-\\n[li*pad]-\w@\\*[li*c-mark]@
-.if !\\n[li*in] .nr li*in 0
-.\"
-.ti -\\n[li*tind]u
-.\" no indentation if hanging indent
-.if (\w@\\*[li*c-mark]@=0)&((\\n[.$]=0):(\w@\\$1@=0)) .nr li*text-begin 0
-\Z'\&\h'\\n[li*in]u'\\*[li*c-mark]'\h'\\n[li*text-begin]u'\&\c
-.if \\n[li*type]=-1 .br
-..
-.\"
-.\"-------------
-.de li@pop
-.nr li*lvl -1
-.misc@pop-nr cind li*tmp
-.in \\n[li*tmp]u
-.misc@pop-nr tind li*tind
-.misc@pop-nr mind li*mind
-.misc@pop-nr pad li*pad
-.misc@pop-nr type li*type
-.misc@pop-nr li-spc li*li-spc
-.ds li*mark \\*[li*mark-list!\\n[li*lvl]]
-..
-.de LE
-.if \\n[li*lvl]<1 .@error "LE:mismatched"
-.li@pop
-.if '\\$1'1' .SP \\n[Lsp]u
-..
-.\"-------------
-.\" list status clear.
-.\" terminate all lists to level i
-.de LC
-.ie \\n[.$]<1 .nr li*i 0
-.el .nr li*i \\$1
-.if \\n[li*i]>\\n[li*lvl] .@error "LC: incorrect argument: \\n[li*i] (too big)"
-.while \\n[li*lvl]>\\n[li*i] .li@pop
-.nr par@ind-flag 0
-..
-.\"-------------
-.de AL
-.if \\n[.$]>3 .@error "AL: too many arguments"
-.if \\n[D]>2 .tm AL $*
-.ie \\n[.$]<=1 .LB \\n[Li] 0 2 1 "\\$1"
-.el \{\
-. ie \\n[.$]=2 .LB 0\\$2 0 2 1 "\\$1"
-. el \{\
-. ie !'\\$2'' .LB \\$2 0 2 1 "\\$1" 0 1
-. el .LB \\n[Li] 0 2 1 "\\$1" 0 1
-. \}
-.\}
-..
-.de ML
-.if \\n[.$]>3 .@error "ML: too many arguments"
-.if \\n[D]>2 .tm ML $*
-.nr li*ml-width \w@\\$1@u+1n
-.if \\n[.$]<2 .LB \\n[li*ml-width]u 0 1 0 "\\$1"
-.if \\n[.$]=2 .LB 0\\$2 0 1 0 "\\$1"
-.if \\n[.$]=3 \{\
-. ie '\\$2'' .LB \\n[li*ml-width]u 0 1 0 "\\$1" 0 1
-. el .LB \\n[Li] 0 1 0 "\\$1" 0 1
-.\}
-..
-.de VL
-.if \\n[D]>2 .tm VL $*
-.if \\n[.$]>3 .@error "VL: too many arguments"
-.if \\n[.$]<1 .@error "VL: missing text-indent"
-.ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 0
-.el .LB 0\\$1 0\\$2 0 0 \& 0 1
-..
-.\" Bullet (for .BL)
-.de BL
-.if \\n[D]>2 .tm BL $*
-.ds BU \s-2\(bu\s0
-.if \\n[.$]>2 .@error "BL: too many arguments"
-.if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \\*[BU]
-.if \\n[.$]=1 .LB 0\\$1 0 1 0 \\*[BU]
-.if \\n[.$]=2 \{\
-. ie '\\$1'' .LB \\n[Pi] 0 1 0 \\*[BU] 0 1
-. el .LB 0\\$1 0 1 0 \\*[BU] 0 1
-.\}
-..
-.de DL
-.if \\n[D]>2 .tm DL $*
-.if \\n[.$]>2 .@error "DL: too many arguments"
-.if \\n[.$]<1 .LB \\n[Pi] 0 1 0 \(em
-.if \\n[.$]=1 .LB 0\\$1 0 1 0 \(em
-.if \\n[.$]=2 \{\
-. ie '\\$1'' .LB \\n[Pi] 0 1 0 \(em 0 1
-. el .LB 0\\$1 0 1 0 \(em 0 1
-.\}
-..
-.de RL
-.if \\n[D]>2 .tm RL $*
-.if \\n[.$]>2 .@error "RL: too many arguments"
-.if \\n[.$]<1 .LB 6 0 2 4
-.if \\n[.$]=1 .LB 0\\$1 0 2 4
-.if \\n[.$]=2 \{\
-. ie '\\$1'' .LB 6 0 2 4 1 0 1
-. el .LB 0\\$1 0 2 4 1 0 1
-.\}
-..
-.\" Broken Variable List. As .VL but text begin on the next line
-.de BVL
-.if \\n[D]>2 .tm BVL $*
-.if \\n[.$]>3 .@error "BVL: too many arguments"
-.if \\n[.$]<1 .@error "BVL: missing text-indent"
-.ie \\n[.$]<3 .LB 0\\$1 0\\$2 0 -1
-.el .LB 0\\$1 0\\$2 0 -1 \& 0 1
-..
-.\" ####### module tbl #######################################
-.\" This module is copied from groff_ms and modified for mgm.
-.\" Yes, it does not resemble the original anymore :-).
-.\" Don't know if I missed something important.
-.\" Groff_ms is written by James Clark.
-.nr tbl*have-header 0
-.nr tbl*header-written 0
-.de TS
-.br
-.if ''\\n[.z]' .SP
-.if '\\$1'H' .di tbl*header-div
-..
-.de tbl@top-hook
-.if \\n[tbl*have-header] \{\
-. ie \\n[.t]-\\n[tbl*header-ht]-1v .tbl@print-header
-. el .sp \\n[.t]u
-.\}
-..
-.de tbl@bottom-hook
-.if \\n[tbl*have-header] \{\
-. nr T. 1
-.\" draw bottom and side lines of boxed tables.
-. T#
-.\}
-.nr tbl*header-written 0
-..
-.de tbl@print-header
-.ev tbl*ev
-'nf
-.tbl*header-div
-.ev
-.mk #T
-.nr tbl*header-written 1
-..
-.de TH
-.if '\\$1'N' @error TH: N not implemented yet. Sorry.
-.ie '\\n[.z]'tbl*header-div' \{\
-. nr T. 0
-. T#
-. br
-. di
-. nr tbl*header-ht \\n[dn]
-. ne \\n[dn]u+1v
-. nr tbl*have-header 1
-. ie '\\$1'N' .if !\\n[tbl*header-written] .tbl@print-header
-. el .tbl@print-header
-.\}
-.el .@error ".TH without .TS H"
-..
-.de TE
-.ie '\\n(.z'tbl*header-div' .@error ".TS H but no .TH before .TE"
-.el \{\
-. nr tbl*have-header 0
-.\}
-.\" reset tabs
-.TAB
-..
-.de T&
-..
-.\" ####### module pic #######################################
-.de PS
-.nr pic*in 0
-.br
-.SP .5
-.ie \\n[.$]<2 .@error "PS: bad arguments. Probably not processed with pic."
-.el \{\
-. if !\\n[ds*lvl] .ne (u;\\$1)+1v
-.\" should be contained between .DS/.DE
-.if r ds*format \{\
-. if \\n[ds*lvl]&((\\n[ds*format]=2):(\\n[ds*format]=3)) \{\
-. nr pic*in \\n[.i]
-.\" . in +(u;\\n[.l]-\\n[.i]-\\$2/2)
-. \}
-. \}
-.\}
-..
-.de PE
-.init@reset
-.SP .5
-..
-.\" ####### module eq #######################################
-.\"
-.nr eq*number 0 1
-.ds eq*label
-.de EQ
-.ds eq*label "\\$1
-..
-.de eq@check
-.if !'\\*[eq*label]'' \{\
-. mk
-' sp (u;\\$1/2-.45v)
-. ie (\\n[Eq]%2) \{\
-. \" label to the left
-\h'|0'\\*[eq*label]\c
-. \}
-. el \{\
-. \" label to the right
-\h'|\\n[.l]u'\\*[eq*label]
-. \}
-. rt
-.\}
-.ds eq*label
-..
-.de EN
-..
-.\"########### module toc ###################
-.\" table of contents
-.nr toc*slevel 1
-.nr toc*spacing \n[Lsp]u
-.nr toc*tlevel 2
-.nr toc*tab 0
-.\"-----------
-.\" Table of contents with friends (module lix)
-.de TC
-.br
-.\" print any pending displays and references
-.df@print-float 3
-.if \\n[ref*flag] .RP 0 1
-.\"
-.if \w@\\$1@>0 .nr toc*slevel \\$1
-.if \w@\\$2@>0 .nr toc*spacing (u;\\$2*\\n[Lsp])
-.if \w@\\$3@>0 .nr toc*tlevel \\$3
-.if \w@\\$4@>0 .nr toc*tab \\$4
-.if \\n[pg*cols-per-page]>1 .1C
-.ds H1txt \\*[Licon]
-.ds Tcst co
-.pg@clear-hd
-.EF ""
-.OF ""
-.pg@next-page
-.\"-------------
-.if d Ci .toc@read-Ci \\*[Ci]
-.nf
-.in 0
-.ie \\n[Oc] .hd@set-page 1
-.el \{\
-. nr toc*pn 1 1
-. af toc*pn i
-. aln ;g toc*pn
-. PF "''\\\\\\\\n[toc*pn]''"
-. am pg@header
-. nr toc*pn +1
-\\..
-.\}
-.nr toc*i 4 1
-.while \\n+[toc*i]<10 \{\
-. if !'\\$\\n[toc*i]'' \{\
-. ce
-\\$\\n[toc*i]
-. br
-. \}
-.\}
-.if \\n[.$]<=4 .if d TX .TX
-.ie d TY .if \\n[.$]<=4 .TY
-.el \{\
-. ce
-\\*[Licon]
-. br
-. SP 3
-.\}
-.if d toc*list .toc*list
-.br
-.\" print LIST OF XXX
-.if d lix*dsfg .lix@print-ds fg FG "\\*[Lf]" \\n[.$]
-.if d lix*dstb .lix@print-ds tb TB "\\*[Lt]" \\n[.$]
-.if d lix*dsec .lix@print-ds ec EC "\\*[Le]" \\n[.$]
-.if d lix*dsex .lix@print-ds ex EX "\\*[Lx]" \\n[.$]
-..
-.\"-----------
-.\" .toc@read-Ci lev1 lev2 lev3 lev4 ... lev7
-.de toc@read-Ci
-.nr toc*i 0 1
-.while \\n+[toc*i]<8 \{\
-. nr toc*hl!\\n[toc*i] \\$\\n[toc*i]
-.\}
-..
-.\"-----------
-.de toc@entry
-.ie \\n[Sectp] \{\
-. toc@save \\$1 "\\*[hd*mark]" "\\$2" \\*[hd*sect-pg]
-.\}
-.el .toc@save \\$1 "\\*[hd*mark]" "\\$2" \\n[%]
-..
-.als )E toc@entry
-.\"-----------
-.de toc@save
-.\" collect maxsize of mark if string Ci don't exist.
-.if !d Ci \{\
-. if !r toc*hl!\\$1 .nr toc*hl!\\$1 0
-. if \\n[toc*hl!\\$1]<=\w@\\$2@ \{\
-. nr toc*hl!\\$1 \w@\\$2@u
-. \}
-.\}
-.am toc*list
-.\" .toc@set level headernumber text pagenr
-.toc@set \\$1 "\\$2" "\\$3" \\$4
-\\..
-..
-.\"-----------
-.\" level mark text pagenumber
-.de toc@set
-.if \\$1<=\\n[toc*slevel] .SP \\n[toc*spacing]u
-.na
-.fi
-.nr toc*ind 0
-.nr toc*i 0 1
-.ie d Ci \{\
-. nr toc*ind +\\n[toc*hl!\\$1]u
-.\}
-.el \{\
-. while \\n+[toc*i]<\\$1 \{\
-. nr toc*ind +\\n[toc*hl!\\n[toc*i]]u
-. \}
-.\}
-.nr toc*text \\n[toc*ind]u+\\n[toc*hl!\\$1]u
-.in \\n[toc*text]u
-.ti -\\n[toc*hl!\\$1]u
-.\"
-.\" length of headernum space
-.nr toc*i \\n[toc*hl!\\$1]-\w@\\$2@
-.\"
-.ll \\n[@ll]u-\w@\\$4@u-2m
-.ne 2v
-.\" ragged right ---------------------------------
-.ie \\$1>\\n[toc*tlevel] \{\
-\\$2
-. sp -1
-\\$3\ \ \ \\$4
-. br
-.\}
-.el \{\
-. \" unnumbered heading --------------------
-. ie '\\$2'' \{\
-. in \\n[toc*ind]u
-\\$3\h'1m'
-. \}
-. \" normal heading ------------------------
-. el \{\
-\\$2
-. sp -1
-\\$3\h'1m'
-. \}
-. ll \\n[@ll]u
-. sp -1
-. nr toc*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$4@)-1m
-\h'|\\n[.n]u'\l'\\n[toc*sep]u.'\h'1m'\\$4
-.\}
-.ll \\n[@ll]u
-..
-.\"########################### module lix ############################
-.\" LIST OF figures, tables, exhibits and equations
-.nr lix*fg-nr 0 1
-.nr lix*tb-nr 0 1
-.nr lix*ec-nr 0 1
-.nr lix*ex-nr 0 1
-.aln Fg lix*fg-nr
-.aln Tb lix*tb-nr
-.aln Ec lix*ec-nr
-.aln Ex lix*ex-nr
-.\"------------
-.de FG
-.lix@print-line fg Lf \\n+[lix*fg-nr] "\\$1" "\\$2" "\\$3" "\\$4"
-..
-.de TB
-.lix@print-line tb Lt \\n+[lix*tb-nr] "\\$1" "\\$2" "\\$3" "\\$4"
-..
-.de EC
-.lix@print-line ec Le \\n+[lix*ec-nr] "\\$1" "\\$2" "\\$3" "\\$4"
-..
-.de EX
-.lix@print-line ex Lx \\n+[lix*ex-nr] "\\$1" "\\$2" "\\$3" "\\$4"
-..
-.\"------------
-.\" print line with 'figure' in the text
-.\" type stringvar number text override flag refname
-.de lix@print-line
-.ds lix*text "\\$4
-.\"
-.ie \\n[Sectf] .ds lix*numb \\n[H1]-\\$3
-.el .ds lix*numb \\$3
-.\"
-.ie !\\n[Of] .ds lix*ds-form .\ \ \"
-.el .ds lix*ds-form "\ \(em\ \"
-.nr lix*in \\n[.i]
-.ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\*[lix*ds-form]
-.if !'\\$5'' \{\
-. if !0\\$6 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*numb]\\*[lix*ds-form]
-. if 0\\$6=1 .ds lix*label \\*[Li\\$1]\ \\*[lix*numb]\\$5\\*[lix*ds-form]
-. if 0\\$6=2 .ds lix*label \\*[Li\\$1]\ \\$5\\*[lix*ds-form]
-.\}
-.\" print line if not between DS/DE
-.ie \\n[ds*lvl]<1&\\n[df*float]=0 \{\
-. lix@print-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
-.\}
-.el \{\
-. lix@embedded-text "\\*[lix*label]" "\\*[lix*text]" \\$1 \\$2 \\$7
-.\}
-.\"
-..
-.\"-----------
-.\" label text type stringvar refname
-.de lix@print-text
-.ie \\n[Sectp] .ds lix*pgnr \\*[hd*sect-pg]
-.el .ds lix*pgnr \\n[%]
-.SP \\n[Lsp]u
-.misc@ev-keep lix
-.init@reset
-.br
-.ie (\w@\\$1\\$2@)>(\\n[.l]-\\n[.i]) \{\
-. in +\w@\\$1@u
-. ti 0
-.\}
-.el .ce 1
-\fB\\$1\fP\\$2
-.br
-.ev
-.\" save line for LIST OF XXX, wth is the width of the label
-.if !r lix*wth\\$3 .nr lix*wth\\$3 0
-.\" find the maximum width
-.if \w@\\*[lix*label]@>\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
-.if \\n[\\$4] .lix@ds-save \\$3 \\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
-.\" save reference to the figure
-.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
-..
-.\" hide printout until diversion is evaluated
-.de lix@embedded-text
-\!.ie \\\\n[Sectp] .ds lix*pgnr \\\\*[hd*sect-pg]
-\!.el .ds lix*pgnr \\\\n[%]
-\!.SP \\\\n[Lsp]u
-\!.misc@ev-keep lix
-\!.ll \\n[.l]u
-\!.init@reset
-\!.fi
-\!.ie (\w@\\$1\\$2@)>(\\\\n[.l]-\\\\n[.i]) \{\
-. in +\w@\\$1@u
-\!. ti 0
-\!\fB\\$1\fP\\$2
-\!.\}
-\!.el \{\
-. ce 1
-\!\fB\\$1\fP\\$2
-\!.\}
-\!.br
-\!.ev
-.\" save line for LIST OF XXX, wth is the width of the label
-\!.if !r lix*wth\\$3 .nr lix*wth\\$3 0
-.\" find the maximum width
-\!.if \w@\\*[lix*label]@>\\\\n[lix*wth\\$3] .nr lix*wth\\$3 \w@\\*[lix*label]@
-\!.if \\\\n[\\$4] .lix@ds-save \\$3 \\\\*[lix*pgnr] "\\*[lix*text]" "\\*[lix*label]"
-.\" save reference to the figure
-\!.if !'\\$5'' .SETR \\$5 \\*[lix*numb]
-..
-.\"------------
-.\" print complete list of XXXX
-.de lix@print-ds
-.\" arg: fg,tb,ec,ex text
-.ds H1txt \\$3
-.ds Tcst \\$1
-.if !\\n[Cp] .pg@next-page
-.\" print LIST OF XXXX
-.\" execute user-defined macros
-.if \\$4<=4 .if d TX\\$2 .TX\\$2
-.ie d TY\\$2 .if \\$4<=4 .TY\\$2
-.el \{\
-. ce
-\\$3
-. SP 3
-.\}
-.in \\n[lix*wth\\$1]u
-.fi
-.lix*ds\\$1
-..
-.\"------------
-.\" save line of list in macro
-.de lix@ds-save
-.\" type pagenumber text
-.am lix*ds\\$1
-.lix@dsln \\$1 \\$2 "\\$3" "\\$4" \\$5
-\\..
-..
-.\"------------
-.\" print appended macro
-.\" lix@dsln type pagenumber text headernr
-.de lix@dsln
-.nr lix*i \\n[lix*wth\\$1]-\w@\\$4@
-.ne 4v
-.ll \\n[@ll]u-\w@\\$4@u-\w@\\$2@u-2m
-.ti -\\n[lix*wth\\$1]u
-\\$4
-.sp -1
-\\$3\h'1m'
-.sp -1
-.ll
-.nr lix*sep (u;\\n[.l]-\\n[.n]-\\n[.i]-\w@\\$2@)-1m
-\h'|\\n[.n]u'\l'\\n[lix*sep]u.'\h'1m'\\$2
-.SP \\n[toc*spacing]u
-..
-.\"########################### module fnt ############################
-.\" some font macros.
-.de R
-.ft R
-.ul 0
-..
-.\"-----------
-.de fnt@switch
-.ul 0
-.ds fnt*tmp
-.nr fnt*prev \\n[.f]
-.nr fnt*i 2 1
-.while \\n+[fnt*i]<=\\n[.$] \{\
-. if \\n[fnt*i]>3 .as fnt*tmp \,
-. ie (\\n[fnt*i]%2)=1 .as fnt*tmp \\$1\\$[\\n[fnt*i]]
-. el .as fnt*tmp \\$2\\$[\\n[fnt*i]]
-. if \\n[fnt*i]<\\n[.$] .as fnt*tmp \/
-.\}
-\&\\*[fnt*tmp]\f[\\n[fnt*prev]]
-..
-.\"-----------
-.de B
-.ie \\n[.$] .fnt@switch \fB \f[\\n[.f]] \\$@
-.el .ft B
-..
-.de I
-.ie \\n[.$] .fnt@switch \fI \f[\\n[.f]] \\$@
-.el .ft I
-..
-.de IB
-.if \\n[.$] .fnt@switch \fI \fB \\$@
-..
-.de BI
-.if \\n[.$] .fnt@switch \fB \fI \\$@
-..
-.de IR
-.if \\n[.$] .fnt@switch \fI \fR \\$@
-..
-.de RI
-.if \\n[.$] .fnt@switch \fR \fI \\$@
-..
-.de RB
-.if \\n[.$] .fnt@switch \fR \fB \\$@
-..
-.de BR
-.if \\n[.$] .fnt@switch \fB \fR \\$@
-..
-.\"########################### module box ############################
-.\" draw a box around some text. Text will be kept on the same page.
-.\"
-.nr box*ll 0
-.\" .B1 and .B2 works like .DS
-.de B1
-.if \\n[box*ll] .@error "B1: missing B2"
-.nr box*ll \\n[.l]
-.nr box*ind \\n[.i]
-.nr box*hyp \\n[.hy]
-.nr box*wid \\n[.l]-\\n[.i]
-.\"
-.\" jump to new environment.
-.ev box*ev
-.di box*div
-.ps \\n[@ps]u
-.vs \\n[@vs]u
-.in 1n
-.ll (u;\\n[box*wid]-1n)
-.hy \\n[.hy]
-..
-.de B2
-.if !\\n[box*ll] .@error "B2: missing B1"
-.br
-.di
-.nr box*height \\n[dn]
-.ne \\n[dn]u+1v
-.ll \\n[box*ll]u
-.in \\n[box*ind]u
-.nr box*y-pos \\n[.d]u
-.nf
-.box*div
-.fi
-\v'-1v+.25m'\
-\D'l \\n[box*wid]u 0'\
-\D'l 0 -\\n[box*height]u'\
-\D'l -\\n[box*wid]u 0'\
-\D'l 0 \\n[box*height]u'
-.br
-.sp -1
-.ev
-.sp .20v
-.in \\n[box*ind]u
-.ll \\n[box*ll]u
-.rm box*div
-.nr box*ll 0
-..
-.\"########################### module ref ############################
-.nr ref*nr 0 1
-.aln :R ref*nr
-.nr ref*nr-width 5n
-.nr ref*flag 0 \" for end-of-text
-.ds Rf \v'-.4m'\s-3[\\n+[ref*nr]]\s0\v'.4m'
-.\"
-.\" start reference
-.\"------------
-.de RS
-.if !''\\$1' .ds \\$1 \v'-.4m'\s-3[\\n[ref*nr]]\s0\v'.4m'
-.nr ref*flag 1
-.am ref*mac
-.ref@start-print \\n[ref*nr]
-\\..
-.eo
-.am ref*mac RF
-..
-.\"------------
-.de RF
-.ec
-.am ref*mac
-.ref@stop-print
-\\..
-..
-.\"------------
-.de ref@start-print
-.di ref*div
-.in \\n[ref*nr-width]u
-.ti -(\w@\\$1.@u+1n)
-\\$1.
-.sp -1
-..
-.de ref@stop-print
-.br
-.di
-.ne \\n[dn]u
-.ev ref*ev2
-.nf
-.ref*div
-.ev
-.rm ref*div
-.if \\n[Ls] .SP \\n[Lsp]u
-..
-.\"-----------
-.de RP
-.if !d ref*mac .@error "RP: No references!"
-.nr ref*i 0\\$2
-.if \\n[ref*i]<2 .SK
-.SP 2
-.ref@print-refs
-.if 0\\$1<1 .nr ref*nr 0 1
-.if ((\\n[ref*i]=0):(\\n[ref*i]=2)) .SK
-..
-.\"-----------
-.\" called by end-of-text!
-.de ref@eot-print
-.\".if \\n[ref*flag] \{
-.if d ref*mac \{\
-. if \\n[D]>2 .tm Print references, called by eot
-. nr ref*flag 0
-. br
-. misc@ev-keep ne
-. init@reset
-\c
-' bp
-. ev
-. ref@print-refs
-.\}
-..
-.\"-----------
-.\" prints the references
-.de ref@print-refs
-.toc@save 1 "" "\\*[Rp]" \\n[%]
-.ce
-\fI\\*[Rp]\fP
-.sp
-.nr ref*ll \\n[.l]
-.misc@ev-keep ref*ev
-.ll \\n[ref*ll]u
-.in 0
-.ref*mac
-.in
-.rm ref*mac
-.ev
-.nr ref*flag 0 1
-..
-.\"########################### module app ############################
-.\"
-.nr app*nr 0 1
-.af app*nr A
-.nr app*dnr 0 1
-.nr app*flag 0
-.\"------------
-.\" .APP name text
-.\" name == "" -> autonumber
-.de APP
-.\" .if \\n[.$]<2 .@error "APP: too few arguments"
-.app@set-ind "\\$1"
-.\"
-.ds Tcst ap
-.ds Apptxt \\$2
-.\"
-.ie \\n[Aph] .app@header \\*[app*ind] "\\$2"
-.el .bp
-.app@index "\\*[app*ind]" "\\$2"
-..
-.\"------------
-.\" .APPSK name pages text
-.\" name == "" -> autonumber
-.de APPSK
-.if \\n[.$]<2 .@error "APPSK: too few arguments"
-.app@set-ind "\\$1"
-.\"
-.ds Tcst ap
-.ds Apptxt \\$3
-.\"
-.ie \\n[Aph] .app@header \\*[app*ind] "\\$3"
-.el .bp
-.app@index "\\*[app*ind]" "\\$3"
-.pn +\\$2
-..
-.\"------------
-.de app@set-ind
-.ie \w@\\$1@ .ds app*ind \\$1
-.el \{\
-. if !\\n[app*flag] \{\
-. nr H1 0 1
-. af H1 A
-. af H1h A
-. nr app*flag 1
-. \}
-. ds app*ind \\n+[app*nr]
-. nr H1 \\n+[app*dnr]
-. nr H1h \\n[app*dnr]
-.\}
-.\" clear lower counters
-.nr app*i 1 1
-.while \\n+[app*i]<8 .nr H\\n[app*i] 0 1
-..
-.\"------------
-.de app@index
-.toc@save 1 "" "\\*[App] \\$1: \\$2" \\n[%]
-..
-.\"------------
-.\" app@heaer name text
-.de app@header
-.bp
-.SP (u;\\n[Lsp]*4)
-.ce 1
-\s+4\fB\\*[App]\ \\$1\fP\s0
-.SP (u;\\n[Lsp]*2)
-.if \w@\\$2@<\\n[.l] .ce 1
-\fB\s+2\\$2\s0\fP
-.SP (u;\\n[Lsp]*4)
-..
-.als APPX app@header
-.\"########################### module cov ############################
-.\" title stored in diversion cov*title
-.\" abstract stored in diversion cov*abstract
-.\" arg to abstract stored in cov*abs-arg
-.\" indent stored in cov*abs-ind
-.\" number of authors stored in cov*au
-.\" author(s) stored in cov*au!x!y
-.\" author(s) title stored in cov*at!x!y
-.\" x is the author-index [1-cov*au], y is the argument-index [1-9].
-.\" author(s) firm stored in cov*firm
-.\" new date (if .ND exists) is stored in cov*new-date
-.\"
-.\"
-.ds cov*abs-name ABSTRACT
-.\"
-.nr cov*au 0
-.de TL
-.rm IA IE WA WE LO LT
-.if \\n[.$]>0 .ds cov*title-charge-case \\$1
-.if \\n[.$]>1 .ds cov*title-file-case \\$2
-.pg@disable-top-trap
-.eo
-.de cov*title AU
-..
-.\"-------------------
-.de cov@title-end
-.ec
-..
-.\"-------------------
-.\" .AU name [initials [loc [dept [ext [room [arg [arg [arg]]]]]]]]
-.de AU
-.cov@title-end
-.pg@disable-top-trap
-.nr cov*au +1
-.nr cov*i 0 1
-.ds cov*au!\\n[cov*au]!1
-.while \\n[.$]>=\\n+[cov*i] \{\
-. ds cov*au!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
-.\}
-.if (\\n[.$]>=3)&(\w@\\$3@) \{\
-. if d cov*location-\\$3] \{\
-. ds cov*au!3!\\n[cov*au] \\*[cov*location-\\$3]
-. \}
-.\}
-..
-.\"-------------------
-.\" .AT title1 [title2 [... [title9] ]]]]
-.\" Well, thats all that COVEND look for.
-.\" Must appear directly after .AU
-.de AT
-.if \\n[.$]<1 .@error "AT: no arguments"
-.nr cov*i 0 1
-.while \\n[.$]>=\\n+[cov*i] \{\
-. ds cov*at!\\n[cov*au]!\\n[cov*i] "\\$[\\n[cov*i]]
-.\}
-..
-.\"-------------------
-.de AF
-.cov@title-end
-.ds cov*firm \\$1
-..
-.de AST
-.ds cov*abs-name \\$1
-..
-.de AS
-.pg@disable-top-trap
-.if d cov*abstract .@error "AS: only one abstract allowed"
-.if !''\\n[.z]' .@error "AS: no diversion allowed (previous .AS?)"
-.nr cov*abs-arg 0\\$1
-.nr cov*abs-ind (n;0\\$2)
-.de cov*abstract AE
-..
-.de AE
-..
-.\" fixed for 2000, now uses \n[year].
-.de ISODATE
-. \" support for ISO-date
-. nr cov*mm \\n[mo]
-. nr cov*dd \\n[dy]
-. af cov*mm 01
-. af cov*dd 01
-. ie '0'\\$1' \{\
-. ds cov*new-date \\*[MO\\n[mo]] \\n[dy], \\n[year]
-. \}
-. el \{\
-. ds cov*new-date \\n[year]-\\n[cov*mm]-\\n[cov*dd]
-. \}
-..
-.ISODATE 0
-.als DT cov*new-date
-.de ND
-.ds cov*new-date \\$1
-..
-.\" switch to ISO-date if register Iso exist: YYYY-MM-DD
-.if r Iso .ISODATE 1
-.\"-------------------
-.\" save technical numbers.
-.de TM
-.nr cov*i 0 1
-.while \\n[.$]>=\\n+[cov*i] .ds cov*mt-tm!\\n[cov*i] \\$[\\n[cov*i]]
-.nr cov*mt-tm-max \\n[.$]
-..
-.\"-----------------------
-.\" cover sheet
-.\" the file must have the following last lines (somewhere):
-.\" .pg@enable-top-trap
-.\" .bp 1
-.\" .pg@enable-trap
-.ds cov*mt-file!0 0.MT
-.ds cov*mt-file!1 0.MT
-.ds cov*mt-file!2 0.MT
-.ds cov*mt-file!3 0.MT
-.ds cov*mt-file!4 4.MT
-.ds cov*mt-file!5 5.MT
-.ds cov*mt-file!6 0.MT
-.\"------------
-.de MT
-.ie \\n[.$] \{\
-. ie d cov*mt-file!\\$1 .ds cov*mt-type \\$1
-. el .ds cov*mt-type 6
-.\}
-.el .ds cov*mt-type 1
-.ds cov*mt-addresse "\\$2
-.ds cov*mt-type-text "\\$1
-.ie d @language .ds cov*str mm/\\*[@language]_
-.el .ds cov*str mm/
-.mso \\*[cov*str]\\*[cov*mt-file!\\*[cov*mt-type]]
-..
-.de COVER
-.ie !\\n[.$] .ds cov*cov-type ms
-.el .ds cov*cov-type \\$1
-.pg@disable-top-trap
-.ie d @language .ds cov*str mm/\\*[@language]_\\*[cov*cov-type].cov
-.el .ds cov*str mm/\\*[cov*cov-type].cov
-.mso \\*[cov*str]
-..
-.\"########################### module qrf ############################
-.\" forward and backward reference thru special files.
-.\"
-.\" check if stderr-method is wanted
-.\" This was needed when I discovered that groff was considered unsafe
-.\" and groff -U didn't work. It's a workaround like the original
-.\" index method, but not in my view elegant enough.
-.\"
-.\" init reference system
-.de INITR
-.ds qrf*file \\$1.qrf
-.nr qrf*pass 2
-.if \\n[D]>1 .tm INITR: source \\*[qrf*file]
-.ie \\n[Ref] \{\
-. tm .\\\\" Rfilename: \\*[qrf*file]
-.\}
-.el 'so \\*[qrf*file]
-..
-.\"---------------
-.\" set a reference.
-.de SETR
-.if \\n[.$]<1 .@error "SETR:reference name missing"
-.if !r qrf*pass .tm "SETR: No .INITR in this file"
-.if \\n[Ref] \{\
-. ds qrf*name qrf*ref-\\$1
-. if \\n[D]>2 .tm SETR: ref \\*[qrf*name]=\\*[hd*mark],\\n[%]
-. \" heading-number
-. ds \\*[qrf*name]-hn \\*[hd*mark]
-. \" page-number
-. ds \\*[qrf*name]-pn \\n[%]
-. \"
-. if \\n[Ref] \{\
-. tm .ds \\*[qrf*name]-hn \\*[hd*mark]
-. tm .ds \\*[qrf*name]-pn \\n[%]
-. if !'\\$2'' .tm .ds \\*[qrf*name]-xx \\$2
-. \}
-.\}
-..
-.\"---------------
-.\" get misc-string
-.\" If two arg -> set var. arg to misc-string.
-.de GETST
-.if \\n[.$]<1 .@error "GETST:reference name missing"
-.if !r qrf*pass .tm "GETST: No .INITR in this file"
-.ds qrf*name qrf*ref-\\$1
-. if d \\*[qrf*name]-xx \{\
-. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-xx]
-. el \\*[\\*[qrf*name]-xx]\c
-. \}
-.\}
-..
-.\"---------------
-.\" get header-number
-.\" If two arg -> set var. arg to header-number.
-.de GETHN
-.if \\n[.$]<1 .@error "GETHN:reference name missing"
-.if !r qrf*pass .tm "GETHN: No .INITR in this file"
-.ds qrf*name qrf*ref-\\$1
-.if d \\*[qrf*name]-hn \{\
-. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-hn]
-. el \\*[\\*[qrf*name]-hn]\c
-.\}
-..
-.\"---------------
-.\" get page-number
-.\" If two arg -> set var. arg to page-number.
-.de GETPN
-.if \\n[.$]<1 .@error "GETPN:reference name missing"
-.if !r qrf*pass .tm "GETPN: No .INITR in this file"
-.ds qrf*name qrf*ref-\\$1
-.if d \\*[qrf*name]-pn \{\
-. ie \\n[.$]>1 .ds \\$2 \\*[\\*[qrf*name]-pn]
-. el \\*[\\*[qrf*name]-pn]\c
-.\}
-..
-.\"----------
-.de GETR
-.if \\n[.$]<1 .@error "GETR:reference name missing"
-.ie !r qrf*pass \{\
-. tm "GETR: No .INITR in this file"
-.\}
-.el \{\
-. GETHN \\$1 Qrfh
-. GETPN \\$1 Qrfp
-\\*[Qrf]
-.\}
-..
-.\"########################### module ind ############################
-.\" Support for mgs-style indexing, borrowed from mgs.
-.de IX
-.tm \\$1\t\\$2\t\\$3\t\\$4 ... \\n[%]
-..
-.\"--------------------
-.\" Another type of index system
-.\" INITI type filename [macro]
-.de INITI
-.if \\n[.$]<1 .@error "INITI:type missing"
-.\" ignore if INITI has already been used
-.if \\n[.$]>1 \{\
-. if d ind*file .@error "INITI:file already set"
-. ds ind*file \\$2.ind
-. if \\n[D]>1 .tm INITI: source \\*[ind*file]
-.\}
-.if !d ind*file .@error "INITI:file not specified"
-.ds ind*type \\$1
-.if \\n[Ref] \{\
-. if \\n[.$]>2 .tm .\\\\" Imacro: \\$3
-.\}
-..
-.\"---------------
-.de IND
-.if !d ind*file .@error "IND: No active INITI"
-.if \\n[D]>1 .tm IND: type=\\*[ind*type]
-.ds ind*ref
-.if '\\*[ind*type]'N' .ds ind*ref \\n[%]
-.if '\\*[ind*type]'H' .ds ind*ref \\*[hd*mark]
-.if '\\*[ind*type]'B' .ds ind*ref \\*[hd*mark]\t\\n[%]
-.if '\\*[ind*ref]'' .@error "IND:wrong index type: \\*[ind*ref]"
-.\"
-.ds ind*line \\$1
-.while \\n[.$]>0 \{\
-. shift
-. as ind*line \t\\$1
-.\}
-.as ind*line \\*[ind*ref]
-.if \\n[Ref] .tm .\\\\" IND \\*[ind*line]
-..
-.\" print index
-.de INDP
-.ie \\n[Ref] .tm .\\\\" Index: \\*[ind*file]
-.el \{\
-. if !\\n[Cp] .pg@next-page
-. \" print INDEX
-. \" execute user-defined macros
-. if d TXIND .TXIND
-. ie d TYIND .TYIND
-. el \{\
-. SK
-. ce
-\\*[Index]
-. SP 3
-. 2C
-. nf
-. \}
-' so \\*[ind*file]
-. ie d TZIND .TZIND
-. el \{\
-. fi
-. 1C
-. \}
-.\}
-.rm ind*file
-..
-.\"########################### module let ############################
-.\" Letter macros
-.\"------------------------
-.\" Formal closing
-.de FC
-.df@print-float 3
-.ie \\n[.$] .ds let*i \\$1
-.el .ds let*i \\*[Letfc]
-.ie d let*type .let@fc_\\*[let*type] "\\*[let*i]" \\$@
-.el .let@mt-closing "\\*[let*i]" \\$@
-..
-.\"-------
-.de let@mt-closing
-.ne 5v
-.in (u;\\n[.l]/2)
-.sp
-\\$1
-.in
-..
-.\"------------------------
-.\" Signature line
-.de SG
-.ie d let*type .let*lt-sign \\$@
-.el .let*mt-sign \\$@
-..
-.\"------------------------
-.de let*lt-sign
-.if !d let@sg_\\*[let*type] .@error "SG: letter type \\*[let*type] undefined"
-.df@print-float 3
-.nr let*i 0 1
-.nr let*j 0
-.while \\n+[let*i]<=\\n[let*wa-n] \{\
-.if \\n[let*i]=\\n[let*wa-n] .nr let*j 1
-.let@sg_\\*[let*type] "\\*[let*wa-name!\\n[let*i]]" "\\*[let*wa-title!\\n[let*i]]" \\n[let*i] \\n[let*j] \\$@
-.\}
-..
-.\"------------------------
-.\" Memorandum signature
-.de let*mt-sign
-.df@print-float 3
-.ne \\n[cov*au]u*4v
-.ie \\n[.$]>1 .nr let*k 1
-.el .nr let*k \\n[cov*au]
-.ds let*tmp \\*[cov*au!\\n[let*k]!3]-\\*[cov*au!\\n[let*k]!4]-
-.nr let*i 0 1
-.while \\n+[let*i]<=\\n[cov*au] \{\
-. if \\n[let*i]>1 .as let*tmp /
-. as let*tmp \\*[cov*au!\\n[let*k]!2]
-.\}
-.if !''\\$1' .as let*tmp -\\$1
-.in (u;\\n[.l]/2)
-.nf
-.nr let*i 0 1
-.while \\n+[let*i]<=\\n[cov*au] \{\
-. SP 3v
-. if \\n[let*i]=\\n[let*k] \{\
-\Z'\h'-(u;\\n[.l]/2)'\\*[let*tmp]'\c
-. \}
-\\*[cov*au!\\n[let*i]!1]
-.\}
-.fi
-.in
-..
-.\"------------------------
-.\" Approval signature
-.de AV
-.ne 6v
-.nf
-.sp
-.ie \\n[.$]<2 \\*[Letapp]
-.el .sp
-.sp 2
-.ie n ______________________________ ______________
-.el \D'l 25m 0'\h'4m'\D'l 12m 0'
-\Z'\\$1'\h'29m'\f[\\*[@sdf_font]]\\*[Letdate]\fP
-.fi
-..
-.\"------------------------
-.\" Letter signature
-.de AVL
-.ne 6v
-.nf
-.sp 3
-.ie n ______________________________
-.el \D'l 25m 0'
-\Z'\\$1'
-.fi
-..
-.\"------------------------
-.\" Letter type
-.\" let@header is called from the header. It is supposed
-.\" to remove the alias itself.
-.de LT
-.rm AF AS AE AT AU CS OK TL MT
-.ds let*type BL
-.nr Pi 5
-.nr Pt 0
-.if !''\\$1' .ds let*type \\$1
-.if !d let@head_\\*[let*type] .@error "LT: unknown letter type \\$1"
-.shift
-.als let@header let@head_\\*[let*type]
-.let@init_\\*[let*type] \\$@
-.if \n[D]>1 .tm Letter type \\*[let*type]
-..
-.\"-----------
-.\" Blocked letter
-.de let@init_BL
-..
-.de let@head_BL
-.rm let@header
-.let@print-head 1
-..
-.de let@sg_BL
-.ne 5v
-.nf
-.in (u;\\n[.l]/2)
-.sp 3v
-\\$1
-\\$2
-.in
-.if \\$4 .sp
-.if \w'\\$5'&\\$4 \\$5
-.fi
-..
-.als let@fc_BL let@mt-closing
-.\"-----------
-.\" Semiblocked letter
-.de let@init_SB
-.nr Pt 1
-..
-.de let@head_SB
-.rm let@header
-.let@print-head 1
-..
-.als let@sg_SB let@sg_BL
-.als let@fc_SB let@mt-closing
-.\"-----------
-.\" Full-blocked letter
-.de let@init_FB
-..
-.de let@head_FB
-.rm let@header
-.let@print-head
-..
-.de let@sg_FB
-.ne 5v
-.nf
-.sp 3v
-\\$1
-\\$2
-.if \\$4 .sp
-.if \w'\\$5'&\\$4 \\$5
-.fi
-..
-.de let@fc_FB
-.ne 5v
-.sp
-\\$1
-..
-.\"-----------
-.\" Simplified letter
-.de let@init_SP
-..
-.de let@head_SP
-.rm let@header
-.let@print-head
-..
-.de let@sg_SP
-.nf
-.if \\$3=1 .sp
-.sp
-.misc@toupper "\\$1, \\$2"
-.if \\$4 .sp
-.if \w'\\$5'&\\$4 \\$5
-.fi
-..
-.de let@fc_SP
-.sp 2
-..
-.\"--------------------------------------
-.\" Print the letter-head
-.de let@print-head
-.nf
-.sp |11
-.if '1'\\$1' .in (u;\\n[.l]/2)
-.\" ---- WA
-.ie d let@wa-div .let@wa-div
-.el .sp 3
-.\" ---- datum
-\\*[cov*new-date]
-.sp
-.if '1'\\$1' .if !d let*lo-CN .if !d let*lo-RN .sp 2
-.\" ---- Confidential
-.if d let*lo-CN \{\
-. ti 0
-. ie !''\\*[let*lo-CN]' \\*[let*lo-CN]
-. el \\*[LetCN]
-. sp
-.\}
-.\" ---- Reference
-.if d let*lo-RN \{\
-\\*[LetRN] \\*[let*lo-RN]
-. sp
-.\}
-.\" ---- IA
-.sp
-.in 0
-.nr let*i 0 1
-.while \\n+[let*i]<=\\n[let*ia-n] \{\
-\\*[let*ia-name!\\n[let*i]]
-\\*[let*ia-title!\\n[let*i]]
-.\}
-.if d let@ia-div .let@ia-div
-.\" ---- Attention
-.if d let*lo-AT \{\
-. sp
-\\*[LetAT] \\*[let*lo-AT]
-.\}
-.\" ---- Salutation
-.if !'\\*[let*type]'SP' .if d let*lo-SA \{\
-. sp
-. ti 0
-. ie !''\\*[let*lo-SA]' \\*[let*lo-SA]
-. el \\*[LetSA]
-.\}
-.\" ---- Subject
-.if d let*lo-SJ \{\
-. ie '\\*[let*type]'SP' \{\
-. sp 2
-. misc@toupper \\*[let*lo-SJ]
-. sp
-. \}
-. el \{\
-. sp
-. if '\\*[let*type]'SB' .ti +5m
-\\*[LetSJ] \f[\\*[@sdf_font]]\\*[let*lo-SJ]\fP
-. \}
-.\}
-..
-.\"-------------------
-.\" .IA [name [title]]
-.nr let*ia-n 0 1
-.de IA
-.if \\n[.$] .ds let*ia-name!\\n+[let*ia-n] \\$1
-.if \\n[.$]>1 .ds let*ia-title!\\n[let*ia-n] \\$2
-.ev let@ev
-'nf
-.di let@ia-div
-.eo
-..
-.de IE
-.di
-.ec
-.ev
-..
-.\"-------------------
-.\" .WA [name [title]]
-.nr let*wa-n 0 1
-.de WA
-.if \\n[.$] .ds let*wa-name!\\n+[let*wa-n] \\$1
-.if \\n[.$]>1 .ds let*wa-title!\\n[let*wa-n] \\$2
-.ev let@ev
-'nf
-.di let@wa-div
-.it \\n[Letwam] let@wa-drain
-.eo
-..
-.\"------
-.de let@wa-drain
-.it
-.di
-.di let@wa-junk
-..
-.\"------
-.de WE
-.it
-.ec
-.di
-.ev
-.if d let@wa-junk .rm let@wa-junk
-..
-.\"-------------------
-.\" Copy to
-.de NS
-.sp
-.ie !''\\$2' .ds let*str \\$1
-.el \{\
-. ie \\n[.$]>0 \{\
-. ie !\w'\\$1' .ds let*str \\*[Letns!\\*[Letnsdef]]
-. el \{\
-. ie d Letns!\\$1 .ds let*str \\*[Letns!\\$1]
-. el .ds let*str \\*[Letns!copy](\\$1)\\*[Letns!to]
-. \}
-. \}
-. el .ds let*str \\*[Letns!\\*[Letnsdef]]
-.\}
-.ne 2
-.nf
-\\*[let*str]
-..
-.de NE
-.fi
-..
-.\"-------------------
-.\" Letter options
-.de LO
-.rm AF AS AE AT AU CS OK TL MT
-.if ''\\$1' .@error "LO: missing option"
-.if !d Let\\$1 .@error "LO: unknown option (\\$1)"
-.ds let*lo-\\$1 \\$2
-.if \n[D]>1 .tm Letter option \\$1 \\$2
-..
-.\"--------------------
-.\" Start with a clean slate
-.init@reset
diff --git a/contrib/groff/mm/tmac.mse b/contrib/groff/mm/tmac.mse
deleted file mode 100644
index 39f137eae92b..000000000000
--- a/contrib/groff/mm/tmac.mse
+++ /dev/null
@@ -1,184 +0,0 @@
-.\" $Id: tmac.mse,v 1.2 2000/02/21 20:32:58 jhaegg Exp $
-.\"
-.\" swedish version of mm
-.\" See tmac.m for version-information.
-.ds @language se
-.mso tmac.m
-.ISODATE
-.\"
-.ds App Bilaga
-.ds Lf Figurer
-.ds Lt Tabeller
-.ds Lx Uppställningar
-.ds Le Ekvationer
-.\" Page length
-.if !r L .nr @pl 28.5c
-.\" page width
-.if !r W .nr @ll 13c
-.\" page offset
-.if !r O .nr @po 3.5c
-.\" set the above parameters
-.ll \n[@ll]u
-.po \n[@po]u
-.pl \n[@pl]u
-.ds Lifg Figur
-.ds Litb Tabell
-.ds Liex Uppställning
-.ds Liec Ekvation
-.ds Licon Innehållsförteckning
-.ds Qrf Se kapitel \\*[Qrfh], sidan \\*[Qrfp].
-.ds Rp Referenser
-.ds Letfc Vänliga hälsningar
-.ds Letapp Godkänd av:
-.ds Letdate datum
-.ds Letconf KONFIDENTIELLT
-.ds Letsal Till vederbörande:
-.ds Letatt ATTENTION:
-.ds Letsubj Innehåll:
-.ds Letref Refererande till:
-.\"
-.ds Letns!copy Kopia \" space!
-.ds Letns!to " till
-.ds Letns!0 Kopia till
-.ds Letns!1 Kopia (med att.) till
-.ds Letns!2 Kopia (utan att.) till
-.ds Letns!3 Att.
-.ds Letns!4 Atts.
-.ds Letns!5 Enc.
-.ds Letns!6 Encs.
-.ds Letns!7 Annat försättsblad
-.ds Letns!8 Brev till
-.ds Letns!9 Dokument till
-.ds Letns!10 Kopia (med atts.) till
-.ds Letns!11 Kopia (utan atts.) till
-.ds Letns!12 Endast abstract till
-.ds Letns!13 Hela dokumentet till
-.ds Letns!14 CC:
-.\"
-.ds MO1 januari
-.ds MO2 februari
-.ds MO3 mars
-.ds MO4 april
-.ds MO5 maj
-.ds MO6 juni
-.ds MO7 juli
-.ds MO8 augusti
-.ds MO9 september
-.ds MO10 oktober
-.ds MO11 november
-.ds MO12 december
-.nr pg*footer-size 4\" 1v+footer+even/odd footer+1v
-.\"------------------------------------------------
-.\" Dokumentnamn
-.ds LetDNAMN
-.\" Mottagarens datum
-.ds LetMDAT Ert datum:
-.\" Bilaga
-.ds LetBIL Bilaga \"
-.\" Kompletteringsuppgift
-.ds LetKOMP
-.\" Dokumentbeteckning eller dokumentnummer
-.ds LetDBET
-.\" Beteckning (ärendebeteckning i form av diarienummer e.d.
-.ds LetBET Beteckning:
-.\" Mottagarens beteckning.
-.ds LetMBET Er beteckning:
-.\" Antal sidor
-.ds LetSIDOR
-.\" Svensk standard med högerställd löptext. ---------------------
-.de let@init_SVH
-.in 4.57c
-.ll 17.57c
-..
-.de let@head_SVH
-.rm let@header
-.let@print_SV H
-..
-.de let@sg_SVH
-..
-.de let@fc_SVH
-..
-.\" Svensk standard med vänsterställd löptext. ---------------------
-.de let@init_SVV
-..
-.de let@head_SVV
-.rm let@header
-.let@print_SV V
-..
-.de let@sg_SVV
-..
-.de let@fc_SVV
-..
-.\"--------------------------------
-.de let@print_SV
-.nf
-.\" pos T0 -----------------------------------
-.in 0
-.sp |3
-.if d let@wa-div .let@wa-div
-.\"----- addressat
-.if '\\$1'V' .if d let@ia-div \{\
-. sp |10
-. let@ia-div
-.\}
-.\" pos T4 -----------------------------------
-.in 9.14c
-.\"----- kompletteringsuppgift
-.if d let*lo-KOMP \{\
-. sp |2
-\\*[let*lo-KOMP]
-.\}
-.\"----- dokumentnamn
-.if d let*lo-DNAMN \{\
-. sp |3
-\\*[let*lo-DNAMN]
-.\}
-.\"----- datum
-.if d cov*new-date \{\
-. sp |5
-Datum:
-\\*[cov*new-date]
-.\}
-.\"----- mottagarens datum
-.if d let*lo-MDAT \{\
-. sp |7
-\\*[LetMDAT]
-\\*[let*lo-MDAT]
-.\}
-.\"----- addressat
-.if '\\$1'H' .if d let@ia-div \{\
-. sp |10
-. let@ia-div
-.\}
-.\" pos T6 -----------------------------------
-.in 13.72c
-.\"----- mottagarens beteck.
-.if d let*lo-MBET \{\
-. sp |7
-\\*[LetMBET]
-\\*[let*lo-MBET]
-.\}
-.\"----- dokumentbeteck.
-.if d let*lo-BET \{\
-. sp |3
-\\*[LetBET]
-\\*[let*lo-BET]
-.\}
-.\" pos T7 -----------------------------------
-.in 16c
-.\"----- bilaga
-.if d let*lo-BIL \{\
-. sp |2
-\\*[LetBIL]\\*[let*lo-BIL]
-.\}
-.\"
-.\"----- sidnummer
-.sp |3
-.ie d let*lo-SIDOR \\n[%] (\\*[let*lo-SIDOR])
-.el \\n[%]
-.\"
-.\" Ta hand om special
-.if d TP .TP
-.sp |17
-..
-.\" -----------------------------------
diff --git a/contrib/groff/nroff/Makefile.sub b/contrib/groff/nroff/Makefile.sub
deleted file mode 100644
index fa6bc4dcc491..000000000000
--- a/contrib/groff/nroff/Makefile.sub
+++ /dev/null
@@ -1,18 +0,0 @@
-MAN1=nroff.n
-NAMEPREFIX=$(g)
-CLEANADD=nroff
-
-all: nroff
-
-nroff: nroff.sh
- rm -f $@
- sed "$(SH_SCRIPT_SED_CMD)" $(srcdir)/nroff.sh >$@
- chmod +x $@
-
-install_data: nroff
- -test -d $(bindir) || $(mkinstalldirs) $(bindir)
- -rm -f $(bindir)/$(NAMEPREFIX)nroff
- $(INSTALL_SCRIPT) nroff $(bindir)/$(NAMEPREFIX)nroff
-
-uninstall_sub:
- -rm -f $(bindir)/$(NAMEPREFIX)nroff
diff --git a/contrib/groff/nroff/nroff.man b/contrib/groff/nroff/nroff.man
deleted file mode 100644
index a01ea59d8333..000000000000
--- a/contrib/groff/nroff/nroff.man
+++ /dev/null
@@ -1,98 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.TH @G@NROFF @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-@g@nroff \- emulate nroff command with groff
-.SH SYNOPSIS
-.nr a \n(.j
-.ad l
-.nr i \n(.i
-.in +\w'\fB@g@nroff 'u
-.ti \niu
-.B @g@nroff
-.de OP
-.ie \\n(.$-1 .RI "[\ \fB\\$1\fP" "\\$2" "\ ]"
-.el .RB "[\ " "\\$1" "\ ]"
-..
-.OP \-h
-.OP \-i
-.OP \-m name
-.OP \-n num
-.OP \-o list
-.OP \-r cn
-.OP \-T name
-.RI "[\ " file\|.\|.\|. "\ ]"
-.br
-.ad \na
-.SH DESCRIPTION
-The
-.B @g@nroff
-script emulates the
-.B nroff
-command using groff.
-The
-.B \-T
-option with an argument other than
-.BR ascii ,
-.BR latin1 ,
-.BR utf8 ,
-or
-.B cp1047
-will be ignored.
-The
-.B \-h
-option
-is equivalent to the
-.B grotty
-.B \-h
-option.
-The
-.BR \-i ,
-.BR \-n ,
-.BR \-m ,
-.B \-o
-and
-.B \-r
-options have the effect described in
-.BR @g@troff (@MAN1EXT@).
-In addition
-.B @g@nroff
-silently ignores options of
-.BR \-e ,
-.B \-q
-or
-.BR \-s .
-Options
-.B \-S
-(safer) and
-.B \-U
-(unsafe) are passed to
-.BR groff .
-.B \-S
-is passed by default.
-.SH NOTES
-This shell script is basically intended for use with
-.BR man (1),
-so warnings are suppressed.
-nroff-style character definitions (in the file tmac.tty-char) are also
-loaded to emulate unrepresentable glyphs.
-.SH "SEE ALSO"
-.BR groff (@MAN1EXT@),
-.BR @g@troff (@MAN1EXT@),
-.BR grotty (@MAN1EXT@)
diff --git a/contrib/groff/nroff/nroff.sh b/contrib/groff/nroff/nroff.sh
deleted file mode 100755
index b1cab83612a2..000000000000
--- a/contrib/groff/nroff/nroff.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/sh
-# Emulate nroff with groff.
-
-prog="$0"
-# Default device.
-# First try the "locale charmap" command, because it's most reliable.
-# On systems where it doesn't exist, look at the environment variables.
-case "`locale charmap 2>/dev/null`" in
- UTF-8)
- T=-Tutf8 ;;
- ISO-8859-1)
- T=-Tlatin1 ;;
- IBM-1047)
- T=-Tcp1047 ;;
- *)
- case "${LC_ALL-${LC_CTYPE-${LANG}}}" in
- *.UTF-8)
- T=-Tutf8 ;;
- iso_8859_1 | *.ISO-8859-1)
- T=-Tlatin1 ;;
- *.IBM-1047)
- T=-Tcp1047 ;;
- *)
- case "$LESSCHARSET" in
- utf-8)
- T=-Tutf8 ;;
- latin1)
- T=-Tlatin1 ;;
- cp1047)
- T=-Tcp1047 ;;
- *)
- T=-Tascii ;;
- esac ;;
- esac ;;
-esac
-opts=
-safer=-S
-
-# `for i; do' doesn't work with some versions of sh
-
-for i
- do
- case $1 in
- -h)
- opts="$opts -P-h" ;;
- -[eq] | -s*)
- # ignore these options
- ;;
- -[mrnoT])
- echo "$prog: option $1 requires an argument" >&2
- exit 1 ;;
- -i | -[mrno]*)
- opts="$opts $1" ;;
- -Tascii | -Tlatin1 | -Tutf8 | -Tcp1047)
- T=$1 ;;
- -T*)
- # ignore other devices
- ;;
- -S)
- # safer behaviour
- safer=-S ;;
- -U)
- # unsafe behaviour
- safer=-U ;;
- -u*)
- # Solaris 2.2 `man' uses -u0; ignore it,
- # since `less' and `more' can use the emboldening info.
- ;;
- --)
- shift
- break ;;
- -)
- break ;;
- -*)
- echo "$prog: invalid option $1" >&2
- exit 1 ;;
- *)
- break ;;
- esac
- shift
-done
-
-# This shell script is intended for use with man, so warnings are
-# probably not wanted. Also load nroff-style character definitions.
-exec groff $safer -Wall -mtty-char $T $opts ${1+"$@"}
diff --git a/contrib/groff/pfbtops/Makefile.dep b/contrib/groff/pfbtops/Makefile.dep
deleted file mode 100644
index f601c366ab97..000000000000
--- a/contrib/groff/pfbtops/Makefile.dep
+++ /dev/null
@@ -1 +0,0 @@
-pfbtops.o: pfbtops.c
diff --git a/contrib/groff/pfbtops/Makefile.sub b/contrib/groff/pfbtops/Makefile.sub
deleted file mode 100644
index f731ff578ba2..000000000000
--- a/contrib/groff/pfbtops/Makefile.sub
+++ /dev/null
@@ -1,6 +0,0 @@
-PROG=pfbtops
-MAN1=pfbtops.n
-OBJS=pfbtops.o
-CSRCS=$(srcdir)/pfbtops.c
-XLIBS=$(LIBGROFF)
-MLIB=$(LIBM)
diff --git a/contrib/groff/pfbtops/pfbtops.c b/contrib/groff/pfbtops/pfbtops.c
deleted file mode 100644
index 9aaeeccfe8e8..000000000000
--- a/contrib/groff/pfbtops/pfbtops.c
+++ /dev/null
@@ -1,118 +0,0 @@
-/* This translates ps fonts in .pfb format to ASCII ps files. */
-
-#include
-#include
-
-#include "nonposix.h"
-
-/* Binary bytes per output line. */
-#define BYTES_PER_LINE (64/2)
-#define HEX_DIGITS "0123456789abcdef"
-
-static char *program_name;
-
-static void error(s)
- char *s;
-{
- fprintf(stderr, "%s: %s\n", program_name, s);
- exit(2);
-}
-
-static void usage()
-{
- fprintf(stderr, "usage: %s [-v] [pfb_file]\n", program_name);
- exit(1);
-}
-
-int main(argc, argv)
- int argc;
- char **argv;
-{
- int opt;
- extern int optind;
-
- program_name = argv[0];
-
- while ((opt = getopt(argc, argv, "v")) != EOF) {
- switch (opt) {
- case 'v':
- {
- extern char *Version_string;
- fprintf(stderr, "pfbtops groff version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case '?':
- usage();
- }
- }
-
- if (argc - optind > 1)
- usage();
- if (argc > optind && !freopen(argv[optind], "r", stdin))
- {
- perror(argv[optind]);
- exit(1);
- }
-#ifdef SET_BINARY
- SET_BINARY(fileno(stdin));
-#endif
- for (;;)
- {
- int type, c, i;
- long n;
-
- c = getchar();
- if (c != 0x80)
- error("first byte of packet not 0x80");
- type = getchar();
- if (type == 3)
- break;
- if (type != 1 && type != 2)
- error("bad packet type");
- n = 0;
- for (i = 0; i < 4; i++)
- {
- c = getchar();
- if (c == EOF)
- error("end of file in packet header");
- n |= (long)c << (i << 3);
- }
- if (n < 0)
- error("negative packet length");
- if (type == 1)
- {
- while (--n >= 0)
- {
- c = getchar();
- if (c == EOF)
- error("end of file in text packet");
- if (c == '\r')
- c = '\n';
- putchar(c);
- }
- if (c != '\n')
- putchar('\n');
- }
- else
- {
- int count = 0;
- while (--n >= 0)
- {
- c = getchar();
- if (c == EOF)
- error("end of file in binary packet");
- if (count >= BYTES_PER_LINE)
- {
- putchar('\n');
- count = 0;
- }
- count++;
- putchar(HEX_DIGITS[(c >> 4) & 0xf]);
- putchar(HEX_DIGITS[c & 0xf]);
- }
- putchar('\n');
- }
- }
- exit(0);
-}
diff --git a/contrib/groff/pfbtops/pfbtops.man b/contrib/groff/pfbtops/pfbtops.man
deleted file mode 100644
index cfef3e0a1033..000000000000
--- a/contrib/groff/pfbtops/pfbtops.man
+++ /dev/null
@@ -1,44 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-1995 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.TH PFBTOPS @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-pfbtops \- translate a PostScript font in .pfb format to ASCII
-.SH SYNOPSIS
-.B pfbtops
-[
-.I pfb_file
-]
-.SH DESCRIPTION
-.B pfbtops
-translates a PostScript font in
-.B .pfb
-format to ASCII.
-If
-.I pfb_file
-is omitted the pfb file will be read from the standard input.
-The ASCII format PostScript font will be written on the standard output.
-PostScript fonts for MS-DOS are normally supplied in
-.B .pfb
-format.
-.LP
-The resulting ASCII format PostScript font can be used with groff.
-It must first be listed in
-.BR @FONTDIR@/devps/download .
-.SH "SEE ALSO"
-.BR grops (@MAN1EXT@)
diff --git a/contrib/groff/pic/Makefile.dep b/contrib/groff/pic/Makefile.dep
deleted file mode 100644
index 1e07874890b7..000000000000
--- a/contrib/groff/pic/Makefile.dep
+++ /dev/null
@@ -1,24 +0,0 @@
-lex.o: lex.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h ../include/ptable.h \
- object.h pic.cc
-main.o: main.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h
-object.o: object.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h ../include/ptable.h \
- object.h
-common.o: common.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h common.h
-troff.o: troff.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h common.h
-tex.o: tex.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h common.h
-pic.o: pic.cc pic.h ../include/assert.h ../include/cset.h \
- ../include/lib.h ../include/stringclass.h ../include/errarg.h \
- ../include/error.h position.h text.h output.h ../include/ptable.h \
- object.h
diff --git a/contrib/groff/pic/Makefile.sub b/contrib/groff/pic/Makefile.sub
deleted file mode 100644
index f1e292731c14..000000000000
--- a/contrib/groff/pic/Makefile.sub
+++ /dev/null
@@ -1,31 +0,0 @@
-PROG=pic
-MAN1=pic.n
-XLIBS=$(LIBGROFF)
-MLIB=$(LIBM)
-OBJS=\
- pic.o \
- lex.o \
- main.o \
- object.o \
- common.o \
- troff.o \
- tex.o
- # fig.o
-CCSRCS=\
- $(srcdir)/lex.cc \
- $(srcdir)/main.cc \
- $(srcdir)/object.cc \
- $(srcdir)/common.cc \
- $(srcdir)/troff.cc \
- $(srcdir)/tex.cc
-HDRS=\
- $(srcdir)/common.h \
- $(srcdir)/object.h \
- $(srcdir)/output.h \
- $(srcdir)/pic.h \
- $(srcdir)/position.h \
- $(srcdir)/text.h
-GRAM=$(srcdir)/pic.y
-YTABC=$(srcdir)/pic.cc
-YTABH=$(srcdir)/pic_tab.h
-NAMEPREFIX=$(g)
diff --git a/contrib/groff/pic/TODO b/contrib/groff/pic/TODO
deleted file mode 100644
index 2346b575e1de..000000000000
--- a/contrib/groff/pic/TODO
+++ /dev/null
@@ -1,37 +0,0 @@
-Dotted and dashed ellipses.
-
-In troff mode, dotted and dashed splines.
-
-Make DELIMITED have type lstr; this would allow us to give better
-error messages for problems within the body of for and if constructs.
-
-In troff mode without -x, fake \D't' with .ps commands.
-
-Perhaps an option to set command char.
-
-Add an output class for dumb line printers. It wouldn't be pretty but
-it would be better than nothing. Integrate it with texinfo. Useful
-for groff -Tascii as well.
-
-Option to allow better positioning of arrowheads on arcs.
-
-Perhaps add PostScript output mode.
-
-Change the interface to the output class so that output devices have
-the opportunity to handle arrowheads themselves.
-
-Consider whether the line thickness should scale.
-
-Consider whether the test in a for loop should be fuzzy (as it
-apparently is in grap).
-
-Possibly change fillval so that zero is black.
-
-Provide a way of getting text blocks (positioned with `.in' rather
-than \h), into pic. Should be possible to use block of diverted text
-in pic. Possibly something similar to T{ and T} in tbl.
-
-Option to provide macro backtraces.
-
-Have a path that is searched by `copy' statement. Set by environment
-variable or command line option.
diff --git a/contrib/groff/pic/common.cc b/contrib/groff/pic/common.cc
deleted file mode 100644
index e83ef3122583..000000000000
--- a/contrib/groff/pic/common.cc
+++ /dev/null
@@ -1,497 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "pic.h"
-#include "common.h"
-
-// output a dashed circle as a series of arcs
-
-void common_output::dashed_circle(const position ¢, double rad,
- const line_type <)
-{
- assert(lt.type == line_type::dashed);
- line_type slt = lt;
- slt.type = line_type::solid;
- double dash_angle = lt.dash_width/rad;
- int ndashes;
- double gap_angle;
- if (dash_angle >= M_PI/4.0) {
- if (dash_angle < M_PI/2.0) {
- gap_angle = M_PI/2.0 - dash_angle;
- ndashes = 4;
- }
- else if (dash_angle < M_PI) {
- gap_angle = M_PI - dash_angle;
- ndashes = 2;
- }
- else {
- circle(cent, rad, slt, -1.0);
- return;
- }
- }
- else {
- ndashes = 4*int(ceil(M_PI/(4.0*dash_angle)));
- gap_angle = (M_PI*2.0)/ndashes - dash_angle;
- }
- for (int i = 0; i < ndashes; i++) {
- double start_angle = i*(dash_angle+gap_angle) - dash_angle/2.0;
- solid_arc(cent, rad, start_angle, start_angle + dash_angle, lt);
- }
-}
-
-// output a dotted circle as a series of dots
-
-void common_output::dotted_circle(const position ¢, double rad,
- const line_type <)
-{
- assert(lt.type == line_type::dotted);
- double gap_angle = lt.dash_width/rad;
- int ndots;
- if (gap_angle >= M_PI/2.0) {
- // always have at least 2 dots
- gap_angle = M_PI;
- ndots = 2;
- }
- else {
- ndots = 4*int(M_PI/(2.0*gap_angle));
- gap_angle = (M_PI*2.0)/ndots;
- }
- double ang = 0.0;
- for (int i = 0; i < ndots; i++, ang += gap_angle)
- dot(cent + position(cos(ang), sin(ang))*rad, lt);
-}
-
-// return non-zero iff we can compute a center
-
-int compute_arc_center(const position &start, const position ¢,
- const position &end, position *result)
-{
- // This finds the point along the vector from start to cent that
- // is equidistant between start and end.
- distance c = cent - start;
- distance e = end - start;
- double n = c*e;
- if (n == 0.0)
- return 0;
- *result = start + c*((e*e)/(2.0*n));
- return 1;
-}
-
-// output a dashed arc as a series of arcs
-
-void common_output::dashed_arc(const position &start, const position ¢,
- const position &end, const line_type <)
-{
- assert(lt.type == line_type::dashed);
- position c;
- if (!compute_arc_center(start, cent, end, &c)) {
- line(start, &end, 1, lt);
- return;
- }
- distance start_offset = start - c;
- distance end_offset = end - c;
- double start_angle = atan2(start_offset.y, start_offset.x);
- double end_angle = atan2(end_offset.y, end_offset.x);
- double rad = hypot(c - start);
- double dash_angle = lt.dash_width/rad;
- double total_angle = end_angle - start_angle;
- while (total_angle < 0)
- total_angle += M_PI + M_PI;
- if (total_angle <= dash_angle*2.0) {
- solid_arc(cent, rad, start_angle, end_angle, lt);
- return;
- }
- int ndashes = int((total_angle - dash_angle)/(dash_angle*2.0) + .5);
- double dash_and_gap_angle = (total_angle - dash_angle)/ndashes;
- for (int i = 0; i <= ndashes; i++)
- solid_arc(cent, rad, start_angle + i*dash_and_gap_angle,
- start_angle + i*dash_and_gap_angle + dash_angle, lt);
-}
-
-// output a dotted arc as a series of dots
-
-void common_output::dotted_arc(const position &start, const position ¢,
- const position &end, const line_type <)
-{
- assert(lt.type == line_type::dotted);
- position c;
- if (!compute_arc_center(start, cent, end, &c)) {
- line(start, &end, 1, lt);
- return;
- }
- distance start_offset = start - c;
- distance end_offset = end - c;
- double start_angle = atan2(start_offset.y, start_offset.x);
- double total_angle = atan2(end_offset.y, end_offset.x) - start_angle;
- while (total_angle < 0)
- total_angle += M_PI + M_PI;
- double rad = hypot(c - start);
- int ndots = int(total_angle/(lt.dash_width/rad) + .5);
- if (ndots == 0)
- dot(start, lt);
- else {
- for (int i = 0; i <= ndots; i++) {
- double a = start_angle + (total_angle*i)/ndots;
- dot(cent + position(cos(a), sin(a))*rad, lt);
- }
- }
-}
-
-void common_output::solid_arc(const position ¢, double rad,
- double start_angle, double end_angle,
- const line_type <)
-{
- line_type slt = lt;
- slt.type = line_type::solid;
- arc(cent + position(cos(start_angle), sin(start_angle))*rad,
- cent,
- cent + position(cos(end_angle), sin(end_angle))*rad,
- slt);
-}
-
-
-void common_output::rounded_box(const position ¢, const distance &dim,
- double rad, const line_type <, double fill)
-{
- if (fill >= 0.0)
- filled_rounded_box(cent, dim, rad, fill);
- switch (lt.type) {
- case line_type::invisible:
- break;
- case line_type::dashed:
- dashed_rounded_box(cent, dim, rad, lt);
- break;
- case line_type::dotted:
- dotted_rounded_box(cent, dim, rad, lt);
- break;
- case line_type::solid:
- solid_rounded_box(cent, dim, rad, lt);
- break;
- default:
- assert(0);
- }
-}
-
-
-void common_output::dashed_rounded_box(const position ¢,
- const distance &dim, double rad,
- const line_type <)
-{
- line_type slt = lt;
- slt.type = line_type::solid;
-
- double hor_length = dim.x + (M_PI/2.0 - 2.0)*rad;
- int n_hor_dashes = int(hor_length/(lt.dash_width*2.0) + .5);
- double hor_gap_width = (n_hor_dashes != 0
- ? hor_length/n_hor_dashes - lt.dash_width
- : 0.0);
-
- double vert_length = dim.y + (M_PI/2.0 - 2.0)*rad;
- int n_vert_dashes = int(vert_length/(lt.dash_width*2.0) + .5);
- double vert_gap_width = (n_vert_dashes != 0
- ? vert_length/n_vert_dashes - lt.dash_width
- : 0.0);
- // Note that each corner arc has to be split into two for dashing,
- // because one part is dashed using vert_gap_width, and the other
- // using hor_gap_width.
- double offset = lt.dash_width/2.0;
- dash_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad,
- -M_PI/4.0, 0, slt, lt.dash_width, vert_gap_width, &offset);
- dash_line(cent + position(dim.x/2.0, -dim.y/2.0 + rad),
- cent + position(dim.x/2.0, dim.y/2.0 - rad),
- slt, lt.dash_width, vert_gap_width, &offset);
- dash_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad,
- 0, M_PI/4.0, slt, lt.dash_width, vert_gap_width, &offset);
-
- offset = lt.dash_width/2.0;
- dash_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad,
- M_PI/4.0, M_PI/2, slt, lt.dash_width, hor_gap_width, &offset);
- dash_line(cent + position(dim.x/2.0 - rad, dim.y/2.0),
- cent + position(-dim.x/2.0 + rad, dim.y/2.0),
- slt, lt.dash_width, hor_gap_width, &offset);
- dash_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad,
- M_PI/2, 3*M_PI/4.0, slt, lt.dash_width, hor_gap_width, &offset);
-
- offset = lt.dash_width/2.0;
- dash_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad,
- 3.0*M_PI/4.0, M_PI, slt, lt.dash_width, vert_gap_width, &offset);
- dash_line(cent + position(-dim.x/2.0, dim.y/2.0 - rad),
- cent + position(-dim.x/2.0, -dim.y/2.0 + rad),
- slt, lt.dash_width, vert_gap_width, &offset);
- dash_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad,
- M_PI, 5.0*M_PI/4.0, slt, lt.dash_width, vert_gap_width, &offset);
-
- offset = lt.dash_width/2.0;
- dash_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad,
- 5*M_PI/4.0, 3*M_PI/2.0, slt, lt.dash_width, hor_gap_width, &offset);
- dash_line(cent + position(-dim.x/2.0 + rad, -dim.y/2.0),
- cent + position(dim.x/2.0 - rad, -dim.y/2.0),
- slt, lt.dash_width, hor_gap_width, &offset);
- dash_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad,
- 3*M_PI/2, 7*M_PI/4, slt, lt.dash_width, hor_gap_width, &offset);
-}
-
-// Used by dashed_rounded_box.
-
-void common_output::dash_arc(const position ¢, double rad,
- double start_angle, double end_angle,
- const line_type <,
- double dash_width, double gap_width,
- double *offsetp)
-{
- double length = (end_angle - start_angle)*rad;
- double pos = 0.0;
- for (;;) {
- if (*offsetp >= dash_width) {
- double rem = dash_width + gap_width - *offsetp;
- if (pos + rem > length) {
- *offsetp += length - pos;
- break;
- }
- else {
- pos += rem;
- *offsetp = 0.0;
- }
- }
- else {
- double rem = dash_width - *offsetp;
- if (pos + rem > length) {
- solid_arc(cent, rad, start_angle + pos/rad, end_angle, lt);
- *offsetp += length - pos;
- break;
- }
- else {
- solid_arc(cent, rad, start_angle + pos/rad,
- start_angle + (pos + rem)/rad, lt);
- pos += rem;
- *offsetp = dash_width;
- }
- }
- }
-}
-
-// Used by dashed_rounded_box.
-
-void common_output::dash_line(const position &start, const position &end,
- const line_type <,
- double dash_width, double gap_width,
- double *offsetp)
-{
- distance dist = end - start;
- double length = hypot(dist);
- if (length == 0.0)
- return;
- double pos = 0.0;
- for (;;) {
- if (*offsetp >= dash_width) {
- double rem = dash_width + gap_width - *offsetp;
- if (pos + rem > length) {
- *offsetp += length - pos;
- break;
- }
- else {
- pos += rem;
- *offsetp = 0.0;
- }
- }
- else {
- double rem = dash_width - *offsetp;
- if (pos + rem > length) {
- line(start + dist*(pos/length), &end, 1, lt);
- *offsetp += length - pos;
- break;
- }
- else {
- position p(start + dist*((pos + rem)/length));
- line(start + dist*(pos/length), &p, 1, lt);
- pos += rem;
- *offsetp = dash_width;
- }
- }
- }
-}
-
-void common_output::dotted_rounded_box(const position ¢,
- const distance &dim, double rad,
- const line_type <)
-{
- line_type slt = lt;
- slt.type = line_type::solid;
-
- double hor_length = dim.x + (M_PI/2.0 - 2.0)*rad;
- int n_hor_dots = int(hor_length/lt.dash_width + .5);
- double hor_gap_width = (n_hor_dots != 0
- ? hor_length/n_hor_dots
- : lt.dash_width);
-
- double vert_length = dim.y + (M_PI/2.0 - 2.0)*rad;
- int n_vert_dots = int(vert_length/lt.dash_width + .5);
- double vert_gap_width = (n_vert_dots != 0
- ? vert_length/n_vert_dots
- : lt.dash_width);
- double epsilon = lt.dash_width/(rad*100.0);
-
- double offset = 0.0;
- dot_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad,
- -M_PI/4.0, 0, slt, vert_gap_width, &offset);
- dot_line(cent + position(dim.x/2.0, -dim.y/2.0 + rad),
- cent + position(dim.x/2.0, dim.y/2.0 - rad),
- slt, vert_gap_width, &offset);
- dot_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad,
- 0, M_PI/4.0 - epsilon, slt, vert_gap_width, &offset);
-
- offset = 0.0;
- dot_arc(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad,
- M_PI/4.0, M_PI/2, slt, hor_gap_width, &offset);
- dot_line(cent + position(dim.x/2.0 - rad, dim.y/2.0),
- cent + position(-dim.x/2.0 + rad, dim.y/2.0),
- slt, hor_gap_width, &offset);
- dot_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad,
- M_PI/2, 3*M_PI/4.0 - epsilon, slt, hor_gap_width, &offset);
-
- offset = 0.0;
- dot_arc(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad,
- 3.0*M_PI/4.0, M_PI, slt, vert_gap_width, &offset);
- dot_line(cent + position(-dim.x/2.0, dim.y/2.0 - rad),
- cent + position(-dim.x/2.0, -dim.y/2.0 + rad),
- slt, vert_gap_width, &offset);
- dot_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad,
- M_PI, 5.0*M_PI/4.0 - epsilon, slt, vert_gap_width, &offset);
-
- offset = 0.0;
- dot_arc(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad,
- 5*M_PI/4.0, 3*M_PI/2.0, slt, hor_gap_width, &offset);
- dot_line(cent + position(-dim.x/2.0 + rad, -dim.y/2.0),
- cent + position(dim.x/2.0 - rad, -dim.y/2.0),
- slt, hor_gap_width, &offset);
- dot_arc(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad,
- 3*M_PI/2, 7*M_PI/4 - epsilon, slt, hor_gap_width, &offset);
-}
-
-// Used by dotted_rounded_box.
-
-void common_output::dot_arc(const position ¢, double rad,
- double start_angle, double end_angle,
- const line_type <, double gap_width,
- double *offsetp)
-{
- double length = (end_angle - start_angle)*rad;
- double pos = 0.0;
- for (;;) {
- if (*offsetp == 0.0) {
- double ang = start_angle + pos/rad;
- dot(cent + position(cos(ang), sin(ang))*rad, lt);
- }
- double rem = gap_width - *offsetp;
- if (pos + rem > length) {
- *offsetp += length - pos;
- break;
- }
- else {
- pos += rem;
- *offsetp = 0.0;
- }
- }
-}
-
-// Used by dotted_rounded_box.
-
-void common_output::dot_line(const position &start, const position &end,
- const line_type <, double gap_width,
- double *offsetp)
-{
- distance dist = end - start;
- double length = hypot(dist);
- if (length == 0.0)
- return;
- double pos = 0.0;
- for (;;) {
- if (*offsetp == 0.0)
- dot(start + dist*(pos/length), lt);
- double rem = gap_width - *offsetp;
- if (pos + rem > length) {
- *offsetp += length - pos;
- break;
- }
- else {
- pos += rem;
- *offsetp = 0.0;
- }
- }
-}
-
-
-void common_output::solid_rounded_box(const position ¢,
- const distance &dim, double rad,
- const line_type <)
-{
- position tem = cent - dim/2.0;
- arc(tem + position(0.0, rad),
- tem + position(rad, rad),
- tem + position(rad, 0.0),
- lt);
- tem = cent + position(-dim.x/2.0, dim.y/2.0);
- arc(tem + position(rad, 0.0),
- tem + position(rad, -rad),
- tem + position(0.0, -rad),
- lt);
- tem = cent + dim/2.0;
- arc(tem + position(0.0, -rad),
- tem + position(-rad, -rad),
- tem + position(-rad, 0.0),
- lt);
- tem = cent + position(dim.x/2.0, -dim.y/2.0);
- arc(tem + position(-rad, 0.0),
- tem + position(-rad, rad),
- tem + position(0.0, rad),
- lt);
- position end;
- end = cent + position(-dim.x/2.0, dim.y/2.0 - rad);
- line(cent - dim/2.0 + position(0.0, rad), &end, 1, lt);
- end = cent + position(dim.x/2.0 - rad, dim.y/2.0);
- line(cent + position(-dim.x/2.0 + rad, dim.y/2.0), &end, 1, lt);
- end = cent + position(dim.x/2.0, -dim.y/2.0 + rad);
- line(cent + position(dim.x/2.0, dim.y/2.0 - rad), &end, 1, lt);
- end = cent + position(-dim.x/2.0 + rad, -dim.y/2.0);
- line(cent + position(dim.x/2.0 - rad, -dim.y/2.0), &end, 1, lt);
-}
-
-void common_output::filled_rounded_box(const position ¢,
- const distance &dim, double rad,
- double fill)
-{
- line_type ilt;
- ilt.type = line_type::invisible;
- circle(cent + position(dim.x/2.0 - rad, dim.y/2.0 - rad), rad, ilt, fill);
- circle(cent + position(-dim.x/2.0 + rad, dim.y/2.0 - rad), rad, ilt, fill);
- circle(cent + position(-dim.x/2.0 + rad, -dim.y/2.0 + rad), rad, ilt, fill);
- circle(cent + position(dim.x/2.0 - rad, -dim.y/2.0 + rad), rad, ilt, fill);
- position vec[4];
- vec[0] = cent + position(dim.x/2.0, dim.y/2.0 - rad);
- vec[1] = cent + position(-dim.x/2.0, dim.y/2.0 - rad);
- vec[2] = cent + position(-dim.x/2.0, -dim.y/2.0 + rad);
- vec[3] = cent + position(dim.x/2.0, -dim.y/2.0 + rad);
- polygon(vec, 4, ilt, fill);
- vec[0] = cent + position(dim.x/2.0 - rad, dim.y/2.0);
- vec[1] = cent + position(-dim.x/2.0 + rad, dim.y/2.0);
- vec[2] = cent + position(-dim.x/2.0 + rad, -dim.y/2.0);
- vec[3] = cent + position(dim.x/2.0 - rad, -dim.y/2.0);
- polygon(vec, 4, ilt, fill);
-}
diff --git a/contrib/groff/pic/common.h b/contrib/groff/pic/common.h
deleted file mode 100644
index 25a6e10c689c..000000000000
--- a/contrib/groff/pic/common.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-class common_output : public output {
-private:
- void dash_line(const position &start, const position &end,
- const line_type <, double dash_width, double gap_width,
- double *offsetp);
- void dash_arc(const position ¢, double rad,
- double start_angle, double end_angle, const line_type <,
- double dash_width, double gap_width, double *offsetp);
- void dot_line(const position &start, const position &end,
- const line_type <, double gap_width, double *offsetp);
- void dot_arc(const position ¢, double rad,
- double start_angle, double end_angle, const line_type <,
- double gap_width, double *offsetp);
-protected:
- virtual void dot(const position &, const line_type &) = 0;
- void dashed_circle(const position &, double rad, const line_type &);
- void dotted_circle(const position &, double rad, const line_type &);
- void dashed_arc(const position &, const position &, const position &,
- const line_type &);
- void dotted_arc(const position &, const position &, const position &,
- const line_type &);
- virtual void solid_arc(const position ¢, double rad, double start_angle,
- double end_angle, const line_type <);
- void dashed_rounded_box(const position &, const distance &, double,
- const line_type &);
- void dotted_rounded_box(const position &, const distance &, double,
- const line_type &);
- void solid_rounded_box(const position &, const distance &, double,
- const line_type &);
- void filled_rounded_box(const position &, const distance &, double, double);
-public:
- void start_picture(double sc, const position &ll, const position &ur) = 0;
- void finish_picture() = 0;
- void circle(const position &, double rad, const line_type &, double) = 0;
- void text(const position &, text_piece *, int, double) = 0;
- void line(const position &, const position *, int n, const line_type &) = 0;
- void polygon(const position *, int n, const line_type &, double) = 0;
- void spline(const position &, const position *, int n,
- const line_type &) = 0;
- void arc(const position &, const position &, const position &,
- const line_type &) = 0;
- void ellipse(const position &, const distance &,
- const line_type &, double) = 0;
- void rounded_box(const position &, const distance &, double,
- const line_type &, double);
-};
-
-int compute_arc_center(const position &start, const position ¢,
- const position &end, position *result);
-
diff --git a/contrib/groff/pic/depend b/contrib/groff/pic/depend
deleted file mode 100644
index 73ac3ab9093c..000000000000
--- a/contrib/groff/pic/depend
+++ /dev/null
@@ -1,21 +0,0 @@
-pic.tab.o : pic.tab.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h ../lib/ptable.h object.h
-lex.o : lex.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h ../lib/ptable.h object.h pic.tab.h
-main.o : main.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h
-object.o : object.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h ../lib/ptable.h object.h
-common.o : common.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h common.h
-troff.o : troff.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h common.h
-tex.o : tex.cc pic.h ../lib/assert.h ../lib/cset.h ../lib/lib.h \
- ../lib/stringclass.h ../lib/errarg.h ../lib/error.h position.h text.h \
- output.h common.h
diff --git a/contrib/groff/pic/lex.cc b/contrib/groff/pic/lex.cc
deleted file mode 100644
index 329578a53deb..000000000000
--- a/contrib/groff/pic/lex.cc
+++ /dev/null
@@ -1,1939 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "pic.h"
-#include "ptable.h"
-#include "object.h"
-#include "pic_tab.h"
-
-declare_ptable(char)
-implement_ptable(char)
-
-PTABLE(char) macro_table;
-
-class macro_input : public input {
- char *s;
- char *p;
-public:
- macro_input(const char *);
- ~macro_input();
- int get();
- int peek();
-};
-
-class argument_macro_input : public input {
- char *s;
- char *p;
- char *ap;
- int argc;
- char *argv[9];
-public:
- argument_macro_input(const char *, int, char **);
- ~argument_macro_input();
- int get();
- int peek();
-};
-
-input::input() : next(0)
-{
-}
-
-input::~input()
-{
-}
-
-int input::get_location(const char **, int *)
-{
- return 0;
-}
-
-file_input::file_input(FILE *f, const char *fn)
-: fp(f), filename(fn), lineno(0), ptr("")
-{
-}
-
-file_input::~file_input()
-{
- fclose(fp);
-}
-
-int file_input::read_line()
-{
- for (;;) {
- line.clear();
- lineno++;
- for (;;) {
- int c = getc(fp);
- if (c == EOF)
- break;
- else if (illegal_input_char(c))
- lex_error("illegal input character code %1", c);
- else {
- line += char(c);
- if (c == '\n')
- break;
- }
- }
- if (line.length() == 0)
- return 0;
- if (!(line.length() >= 3 && line[0] == '.' && line[1] == 'P'
- && (line[2] == 'S' || line[2] == 'E' || line[2] == 'F')
- && (line.length() == 3 || line[3] == ' ' || line[3] == '\n'
- || compatible_flag))) {
- line += '\0';
- ptr = line.contents();
- return 1;
- }
- }
-}
-
-int file_input::get()
-{
- if (*ptr != '\0' || read_line())
- return (unsigned char)*ptr++;
- else
- return EOF;
-}
-
-int file_input::peek()
-{
- if (*ptr != '\0' || read_line())
- return (unsigned char)*ptr;
- else
- return EOF;
-}
-
-int file_input::get_location(const char **fnp, int *lnp)
-{
- *fnp = filename;
- *lnp = lineno;
- return 1;
-}
-
-macro_input::macro_input(const char *str)
-{
- p = s = strsave(str);
-}
-
-macro_input::~macro_input()
-{
- a_delete s;
-}
-
-int macro_input::get()
-{
- if (p == 0 || *p == '\0')
- return EOF;
- else
- return (unsigned char)*p++;
-}
-
-int macro_input::peek()
-{
- if (p == 0 || *p == '\0')
- return EOF;
- else
- return (unsigned char)*p;
-}
-
-// Character representing $1. Must be illegal input character.
-#define ARG1 14
-
-char *process_body(const char *body)
-{
- char *s = strsave(body);
- int j = 0;
- for (int i = 0; s[i] != '\0'; i++)
- if (s[i] == '$' && s[i+1] >= '0' && s[i+1] <= '9') {
- if (s[i+1] != '0')
- s[j++] = ARG1 + s[++i] - '1';
- }
- else
- s[j++] = s[i];
- s[j] = '\0';
- return s;
-}
-
-
-argument_macro_input::argument_macro_input(const char *body, int ac, char **av)
-: ap(0), argc(ac)
-{
- for (int i = 0; i < argc; i++)
- argv[i] = av[i];
- p = s = process_body(body);
-}
-
-
-argument_macro_input::~argument_macro_input()
-{
- for (int i = 0; i < argc; i++)
- a_delete argv[i];
- a_delete s;
-}
-
-int argument_macro_input::get()
-{
- if (ap) {
- if (*ap != '\0')
- return (unsigned char)*ap++;
- ap = 0;
- }
- if (p == 0)
- return EOF;
- while (*p >= ARG1 && *p <= ARG1 + 8) {
- int i = *p++ - ARG1;
- if (i < argc && argv[i] != 0 && argv[i][0] != '\0') {
- ap = argv[i];
- return (unsigned char)*ap++;
- }
- }
- if (*p == '\0')
- return EOF;
- return (unsigned char)*p++;
-}
-
-int argument_macro_input::peek()
-{
- if (ap) {
- if (*ap != '\0')
- return (unsigned char)*ap;
- ap = 0;
- }
- if (p == 0)
- return EOF;
- while (*p >= ARG1 && *p <= ARG1 + 8) {
- int i = *p++ - ARG1;
- if (i < argc && argv[i] != 0 && argv[i][0] != '\0') {
- ap = argv[i];
- return (unsigned char)*ap;
- }
- }
- if (*p == '\0')
- return EOF;
- return (unsigned char)*p;
-}
-
-class input_stack {
- static input *current_input;
- static int bol_flag;
-public:
- static void push(input *);
- static void clear();
- static int get_char();
- static int peek_char();
- static int get_location(const char **fnp, int *lnp);
- static void push_back(unsigned char c, int was_bol = 0);
- static int bol();
-};
-
-input *input_stack::current_input = 0;
-int input_stack::bol_flag = 0;
-
-inline int input_stack::bol()
-{
- return bol_flag;
-}
-
-void input_stack::clear()
-{
- while (current_input != 0) {
- input *tem = current_input;
- current_input = current_input->next;
- delete tem;
- }
- bol_flag = 1;
-}
-
-void input_stack::push(input *in)
-{
- in->next = current_input;
- current_input = in;
-}
-
-void lex_init(input *top)
-{
- input_stack::clear();
- input_stack::push(top);
-}
-
-void lex_cleanup()
-{
- while (input_stack::get_char() != EOF)
- ;
-}
-
-int input_stack::get_char()
-{
- while (current_input != 0) {
- int c = current_input->get();
- if (c != EOF) {
- bol_flag = c == '\n';
- return c;
- }
- // don't pop the top-level input off the stack
- if (current_input->next == 0)
- return EOF;
- input *tem = current_input;
- current_input = current_input->next;
- delete tem;
- }
- return EOF;
-}
-
-int input_stack::peek_char()
-{
- while (current_input != 0) {
- int c = current_input->peek();
- if (c != EOF)
- return c;
- if (current_input->next == 0)
- return EOF;
- input *tem = current_input;
- current_input = current_input->next;
- delete tem;
- }
- return EOF;
-}
-
-class char_input : public input {
- int c;
-public:
- char_input(int);
- int get();
- int peek();
-};
-
-char_input::char_input(int n) : c((unsigned char)n)
-{
-}
-
-int char_input::get()
-{
- int n = c;
- c = EOF;
- return n;
-}
-
-int char_input::peek()
-{
- return c;
-}
-
-void input_stack::push_back(unsigned char c, int was_bol)
-{
- push(new char_input(c));
- bol_flag = was_bol;
-}
-
-int input_stack::get_location(const char **fnp, int *lnp)
-{
- for (input *p = current_input; p; p = p->next)
- if (p->get_location(fnp, lnp))
- return 1;
- return 0;
-}
-
-string context_buffer;
-
-string token_buffer;
-double token_double;
-int token_int;
-
-void interpolate_macro_with_args(const char *body)
-{
- char *argv[9];
- int argc = 0;
- int i;
- for (i = 0; i < 9; i++)
- argv[i] = 0;
- int level = 0;
- int c;
- enum { NORMAL, IN_STRING, IN_STRING_QUOTED } state = NORMAL;
- do {
- token_buffer.clear();
- for (;;) {
- c = input_stack::get_char();
- if (c == EOF) {
- lex_error("end of input while scanning macro arguments");
- break;
- }
- if (state == NORMAL && level == 0 && (c == ',' || c == ')')) {
- if (token_buffer.length() > 0) {
- token_buffer += '\0';
- argv[argc] = strsave(token_buffer.contents());
- }
- // for `foo()', argc = 0
- if (argc > 0 || c != ')' || i > 0)
- argc++;
- break;
- }
- token_buffer += char(c);
- switch (state) {
- case NORMAL:
- if (c == '"')
- state = IN_STRING;
- else if (c == '(')
- level++;
- else if (c == ')')
- level--;
- break;
- case IN_STRING:
- if (c == '"')
- state = NORMAL;
- else if (c == '\\')
- state = IN_STRING_QUOTED;
- break;
- case IN_STRING_QUOTED:
- state = IN_STRING;
- break;
- }
- }
- } while (c != ')' && c != EOF);
- input_stack::push(new argument_macro_input(body, argc, argv));
-}
-
-static int docmp(const char *s1, int n1, const char *s2, int n2)
-{
- if (n1 < n2) {
- int r = memcmp(s1, s2, n1);
- return r ? r : -1;
- }
- else if (n1 > n2) {
- int r = memcmp(s1, s2, n2);
- return r ? r : 1;
- }
- else
- return memcmp(s1, s2, n1);
-}
-
-int lookup_keyword(const char *str, int len)
-{
- static struct keyword {
- const char *name;
- int token;
- } table[] = {
- { "Here", HERE },
- { "above", ABOVE },
- { "aligned", ALIGNED },
- { "and", AND },
- { "arc", ARC },
- { "arrow", ARROW },
- { "at", AT },
- { "atan2", ATAN2 },
- { "below", BELOW },
- { "between", BETWEEN },
- { "bottom", BOTTOM },
- { "box", BOX },
- { "by", BY },
- { "ccw", CCW },
- { "center", CENTER },
- { "chop", CHOP },
- { "circle", CIRCLE },
- { "command", COMMAND },
- { "copy", COPY },
- { "cos", COS },
- { "cw", CW },
- { "dashed", DASHED },
- { "define", DEFINE },
- { "diam", DIAMETER },
- { "diameter", DIAMETER },
- { "do", DO },
- { "dotted", DOTTED },
- { "down", DOWN },
- { "ellipse", ELLIPSE },
- { "else", ELSE },
- { "end", END },
- { "exp", EXP },
- { "fill", FILL },
- { "filled", FILL },
- { "for", FOR },
- { "from", FROM },
- { "height", HEIGHT },
- { "ht", HEIGHT },
- { "if", IF },
- { "int", INT },
- { "invis", INVISIBLE },
- { "invisible", INVISIBLE },
- { "last", LAST },
- { "left", LEFT },
- { "line", LINE },
- { "ljust", LJUST },
- { "log", LOG },
- { "lower", LOWER },
- { "max", K_MAX },
- { "min", K_MIN },
- { "move", MOVE },
- { "of", OF },
- { "plot", PLOT },
- { "print", PRINT },
- { "rad", RADIUS },
- { "radius", RADIUS },
- { "rand", RAND },
- { "reset", RESET },
- { "right", RIGHT },
- { "rjust", RJUST },
- { "same", SAME },
- { "sh", SH },
- { "sin", SIN },
- { "spline", SPLINE },
- { "sprintf", SPRINTF },
- { "sqrt", SQRT },
- { "srand", SRAND },
- { "start", START },
- { "the", THE },
- { "then", THEN },
- { "thick", THICKNESS },
- { "thickness", THICKNESS },
- { "thru", THRU },
- { "to", TO },
- { "top", TOP },
- { "undef", UNDEF },
- { "until", UNTIL },
- { "up", UP },
- { "upper", UPPER },
- { "way", WAY },
- { "wid", WIDTH },
- { "width", WIDTH },
- { "with", WITH },
- };
-
- const keyword *start = table;
- const keyword *end = table + sizeof(table)/sizeof(table[0]);
- while (start < end) {
- // start <= target < end
- const keyword *mid = start + (end - start)/2;
-
- int cmp = docmp(str, len, mid->name, strlen(mid->name));
- if (cmp == 0)
- return mid->token;
- if (cmp < 0)
- end = mid;
- else
- start = mid + 1;
- }
- return 0;
-}
-
-int get_token_after_dot(int c)
-{
- // get_token deals with the case where c is a digit
- switch (c) {
- case 'h':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- context_buffer = ".ht";
- return DOT_HT;
- }
- else if (c == 'e') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'i') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'g') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'h') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- context_buffer = ".height";
- return DOT_HT;
- }
- input_stack::push_back('h');
- }
- input_stack::push_back('g');
- }
- input_stack::push_back('i');
- }
- input_stack::push_back('e');
- }
- input_stack::push_back('h');
- return '.';
- case 'x':
- input_stack::get_char();
- context_buffer = ".x";
- return DOT_X;
- case 'y':
- input_stack::get_char();
- context_buffer = ".y";
- return DOT_Y;
- case 'c':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'e') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'n') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'e') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'r') {
- input_stack::get_char();
- context_buffer = ".center";
- return DOT_C;
- }
- input_stack::push_back('e');
- }
- input_stack::push_back('t');
- }
- input_stack::push_back('n');
- }
- input_stack::push_back('e');
- }
- context_buffer = ".c";
- return DOT_C;
- case 'n':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'e') {
- input_stack::get_char();
- context_buffer = ".ne";
- return DOT_NE;
- }
- else if (c == 'w') {
- input_stack::get_char();
- context_buffer = ".nw";
- return DOT_NW;
- }
- else {
- context_buffer = ".n";
- return DOT_N;
- }
- break;
- case 'e':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'n') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'd') {
- input_stack::get_char();
- context_buffer = ".end";
- return DOT_END;
- }
- input_stack::push_back('n');
- context_buffer = ".e";
- return DOT_E;
- }
- context_buffer = ".e";
- return DOT_E;
- case 'w':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'i') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'd') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'h') {
- input_stack::get_char();
- context_buffer = ".width";
- return DOT_WID;
- }
- input_stack::push_back('t');
- }
- context_buffer = ".wid";
- return DOT_WID;
- }
- input_stack::push_back('i');
- }
- context_buffer = ".w";
- return DOT_W;
- case 's':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'e') {
- input_stack::get_char();
- context_buffer = ".se";
- return DOT_SE;
- }
- else if (c == 'w') {
- input_stack::get_char();
- context_buffer = ".sw";
- return DOT_SW;
- }
- else {
- if (c == 't') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'a') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'r') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- context_buffer = ".start";
- return DOT_START;
- }
- input_stack::push_back('r');
- }
- input_stack::push_back('a');
- }
- input_stack::push_back('t');
- }
- context_buffer = ".s";
- return DOT_S;
- }
- break;
- case 't':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'o') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'p') {
- input_stack::get_char();
- context_buffer = ".top";
- return DOT_N;
- }
- input_stack::push_back('o');
- }
- context_buffer = ".t";
- return DOT_N;
- case 'l':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'e') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'f') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- context_buffer = ".left";
- return DOT_W;
- }
- input_stack::push_back('f');
- }
- input_stack::push_back('e');
- }
- context_buffer = ".l";
- return DOT_W;
- case 'r':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'a') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'd') {
- input_stack::get_char();
- context_buffer = ".rad";
- return DOT_RAD;
- }
- input_stack::push_back('a');
- }
- else if (c == 'i') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'g') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'h') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- context_buffer = ".right";
- return DOT_E;
- }
- input_stack::push_back('h');
- }
- input_stack::push_back('g');
- }
- input_stack::push_back('i');
- }
- context_buffer = ".r";
- return DOT_E;
- case 'b':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'o') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'o') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'm') {
- input_stack::get_char();
- context_buffer = ".bottom";
- return DOT_S;
- }
- input_stack::push_back('o');
- }
- input_stack::push_back('t');
- }
- context_buffer = ".bot";
- return DOT_S;
- }
- input_stack::push_back('o');
- }
- context_buffer = ".b";
- return DOT_S;
- default:
- context_buffer = '.';
- return '.';
- }
-}
-
-int get_token(int lookup_flag)
-{
- context_buffer.clear();
- for (;;) {
- int n = 0;
- int bol = input_stack::bol();
- int c = input_stack::get_char();
- if (bol && c == command_char) {
- token_buffer.clear();
- token_buffer += c;
- // the newline is not part of the token
- for (;;) {
- c = input_stack::peek_char();
- if (c == EOF || c == '\n')
- break;
- input_stack::get_char();
- token_buffer += char(c);
- }
- context_buffer = token_buffer;
- return COMMAND_LINE;
- }
- switch (c) {
- case EOF:
- return EOF;
- case ' ':
- case '\t':
- break;
- case '\\':
- {
- int d = input_stack::peek_char();
- if (d != '\n') {
- context_buffer = '\\';
- return '\\';
- }
- input_stack::get_char();
- break;
- }
- case '#':
- do {
- c = input_stack::get_char();
- } while (c != '\n' && c != EOF);
- if (c == '\n')
- context_buffer = '\n';
- return c;
- case '"':
- context_buffer = '"';
- token_buffer.clear();
- for (;;) {
- c = input_stack::get_char();
- if (c == '\\') {
- context_buffer += '\\';
- c = input_stack::peek_char();
- if (c == '"') {
- input_stack::get_char();
- token_buffer += '"';
- context_buffer += '"';
- }
- else
- token_buffer += '\\';
- }
- else if (c == '\n') {
- error("newline in string");
- break;
- }
- else if (c == EOF) {
- error("missing `\"'");
- break;
- }
- else if (c == '"') {
- context_buffer += '"';
- break;
- }
- else {
- context_buffer += char(c);
- token_buffer += char(c);
- }
- }
- return TEXT;
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- {
- int overflow = 0;
- n = 0;
- for (;;) {
- if (n > (INT_MAX - 9)/10) {
- overflow = 1;
- break;
- }
- n *= 10;
- n += c - '0';
- context_buffer += char(c);
- c = input_stack::peek_char();
- if (c == EOF || !csdigit(c))
- break;
- c = input_stack::get_char();
- }
- token_double = n;
- if (overflow) {
- for (;;) {
- token_double *= 10.0;
- token_double += c - '0';
- context_buffer += char(c);
- c = input_stack::peek_char();
- if (c == EOF || !csdigit(c))
- break;
- c = input_stack::get_char();
- }
- // if somebody asks for 1000000000000th, we will silently
- // give them INT_MAXth
- double temp = token_double; // work around gas 1.34/sparc bug
- if (token_double > INT_MAX)
- n = INT_MAX;
- else
- n = int(temp);
- }
- }
- switch (c) {
- case 'i':
- case 'I':
- context_buffer += char(c);
- input_stack::get_char();
- return NUMBER;
- case '.':
- {
- context_buffer += '.';
- input_stack::get_char();
- got_dot:
- double factor = 1.0;
- for (;;) {
- c = input_stack::peek_char();
- if (!c == EOF || !csdigit(c))
- break;
- input_stack::get_char();
- context_buffer += char(c);
- factor /= 10.0;
- if (c != '0')
- token_double += factor*(c - '0');
- }
- if (c != 'e' && c != 'E') {
- if (c == 'i' || c == 'I') {
- context_buffer += char(c);
- input_stack::get_char();
- }
- return NUMBER;
- }
- }
- // fall through
- case 'e':
- case 'E':
- {
- int echar = c;
- input_stack::get_char();
- c = input_stack::peek_char();
- int sign = '+';
- if (c == '+' || c == '-') {
- sign = c;
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == EOF || !csdigit(c)) {
- input_stack::push_back(sign);
- input_stack::push_back(echar);
- return NUMBER;
- }
- context_buffer += char(echar);
- context_buffer += char(sign);
- }
- else {
- if (c == EOF || !csdigit(c)) {
- input_stack::push_back(echar);
- return NUMBER;
- }
- context_buffer += char(echar);
- }
- input_stack::get_char();
- context_buffer += char(c);
- n = c - '0';
- for (;;) {
- c = input_stack::peek_char();
- if (c == EOF || !csdigit(c))
- break;
- input_stack::get_char();
- context_buffer += char(c);
- n = n*10 + (c - '0');
- }
- if (sign == '-')
- n = -n;
- if (c == 'i' || c == 'I') {
- context_buffer += char(c);
- input_stack::get_char();
- }
- token_double *= pow(10.0, n);
- return NUMBER;
- }
- case 'n':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'd') {
- input_stack::get_char();
- token_int = n;
- context_buffer += "nd";
- return ORDINAL;
- }
- input_stack::push_back('n');
- return NUMBER;
- case 'r':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'd') {
- input_stack::get_char();
- token_int = n;
- context_buffer += "rd";
- return ORDINAL;
- }
- input_stack::push_back('r');
- return NUMBER;
- case 't':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'h') {
- input_stack::get_char();
- token_int = n;
- context_buffer += "th";
- return ORDINAL;
- }
- input_stack::push_back('t');
- return NUMBER;
- case 's':
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- token_int = n;
- context_buffer += "st";
- return ORDINAL;
- }
- input_stack::push_back('s');
- return NUMBER;
- default:
- return NUMBER;
- }
- break;
- case '\'':
- {
- c = input_stack::peek_char();
- if (c == 't') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == 'h') {
- input_stack::get_char();
- context_buffer = "'th";
- return TH;
- }
- else
- input_stack::push_back('t');
- }
- context_buffer = "'";
- return '\'';
- }
- case '.':
- {
- c = input_stack::peek_char();
- if (c != EOF && csdigit(c)) {
- n = 0;
- token_double = 0.0;
- context_buffer = '.';
- goto got_dot;
- }
- return get_token_after_dot(c);
- }
- case '<':
- c = input_stack::peek_char();
- if (c == '-') {
- input_stack::get_char();
- c = input_stack::peek_char();
- if (c == '>') {
- input_stack::get_char();
- context_buffer = "<->";
- return DOUBLE_ARROW_HEAD;
- }
- context_buffer = "<-";
- return LEFT_ARROW_HEAD;
- }
- else if (c == '=') {
- input_stack::get_char();
- context_buffer = "<=";
- return LESSEQUAL;
- }
- context_buffer = "<";
- return '<';
- case '-':
- c = input_stack::peek_char();
- if (c == '>') {
- input_stack::get_char();
- context_buffer = "->";
- return RIGHT_ARROW_HEAD;
- }
- context_buffer = "-";
- return '-';
- case '!':
- c = input_stack::peek_char();
- if (c == '=') {
- input_stack::get_char();
- context_buffer = "!=";
- return NOTEQUAL;
- }
- context_buffer = "!";
- return '!';
- case '>':
- c = input_stack::peek_char();
- if (c == '=') {
- input_stack::get_char();
- context_buffer = ">=";
- return GREATEREQUAL;
- }
- context_buffer = ">";
- return '>';
- case '=':
- c = input_stack::peek_char();
- if (c == '=') {
- input_stack::get_char();
- context_buffer = "==";
- return EQUALEQUAL;
- }
- context_buffer = "=";
- return '=';
- case '&':
- c = input_stack::peek_char();
- if (c == '&') {
- input_stack::get_char();
- context_buffer = "&&";
- return ANDAND;
- }
- context_buffer = "&";
- return '&';
- case '|':
- c = input_stack::peek_char();
- if (c == '|') {
- input_stack::get_char();
- context_buffer = "||";
- return OROR;
- }
- context_buffer = "|";
- return '|';
- default:
- if (c != EOF && csalpha(c)) {
- token_buffer.clear();
- token_buffer = c;
- for (;;) {
- c = input_stack::peek_char();
- if (c == EOF || (!csalnum(c) && c != '_'))
- break;
- input_stack::get_char();
- token_buffer += char(c);
- }
- int tok = lookup_keyword(token_buffer.contents(),
- token_buffer.length());
- if (tok != 0) {
- context_buffer = token_buffer;
- return tok;
- }
- char *def = 0;
- if (lookup_flag) {
- token_buffer += '\0';
- def = macro_table.lookup(token_buffer.contents());
- token_buffer.set_length(token_buffer.length() - 1);
- if (def) {
- if (c == '(') {
- input_stack::get_char();
- interpolate_macro_with_args(def);
- }
- else
- input_stack::push(new macro_input(def));
- }
- }
- if (!def) {
- context_buffer = token_buffer;
- if (csupper(token_buffer[0]))
- return LABEL;
- else
- return VARIABLE;
- }
- }
- else {
- context_buffer = char(c);
- return (unsigned char)c;
- }
- break;
- }
- }
-}
-
-int get_delimited()
-{
- token_buffer.clear();
- int c = input_stack::get_char();
- while (c == ' ' || c == '\t' || c == '\n')
- c = input_stack::get_char();
- if (c == EOF) {
- lex_error("missing delimiter");
- return 0;
- }
- context_buffer = char(c);
- int had_newline = 0;
- int start = c;
- int level = 0;
- enum { NORMAL, IN_STRING, IN_STRING_QUOTED, DELIM_END } state = NORMAL;
- for (;;) {
- c = input_stack::get_char();
- if (c == EOF) {
- lex_error("missing closing delimiter");
- return 0;
- }
- if (c == '\n')
- had_newline = 1;
- else if (!had_newline)
- context_buffer += char(c);
- switch (state) {
- case NORMAL:
- if (start == '{') {
- if (c == '{') {
- level++;
- break;
- }
- if (c == '}') {
- if (--level < 0)
- state = DELIM_END;
- break;
- }
- }
- else {
- if (c == start) {
- state = DELIM_END;
- break;
- }
- }
- if (c == '"')
- state = IN_STRING;
- break;
- case IN_STRING_QUOTED:
- if (c == '\n')
- state = NORMAL;
- else
- state = IN_STRING;
- break;
- case IN_STRING:
- if (c == '"' || c == '\n')
- state = NORMAL;
- else if (c == '\\')
- state = IN_STRING_QUOTED;
- break;
- case DELIM_END:
- // This case it just to shut cfront 2.0 up.
- default:
- assert(0);
- }
- if (state == DELIM_END)
- break;
- token_buffer += c;
- }
- return 1;
-}
-
-void do_define()
-{
- int t = get_token(0); // do not expand what we are defining
- if (t != VARIABLE && t != LABEL) {
- lex_error("can only define variable or placename");
- return;
- }
- token_buffer += '\0';
- string nm = token_buffer;
- const char *name = nm.contents();
- if (!get_delimited())
- return;
- token_buffer += '\0';
- macro_table.define(name, strsave(token_buffer.contents()));
-}
-
-void do_undef()
-{
- int t = get_token(0); // do not expand what we are undefining
- if (t != VARIABLE && t != LABEL) {
- lex_error("can only define variable or placename");
- return;
- }
- token_buffer += '\0';
- macro_table.define(token_buffer.contents(), 0);
-}
-
-
-class for_input : public input {
- char *var;
- char *body;
- double to;
- int by_is_multiplicative;
- double by;
- const char *p;
- int done_newline;
-public:
- for_input(char *, double, int, double, char *);
- ~for_input();
- int get();
- int peek();
-};
-
-for_input::for_input(char *vr, double t, int bim, double b, char *bd)
-: var(vr), body(bd), to(t), by_is_multiplicative(bim), by(b), p(body),
- done_newline(0)
-{
-}
-
-for_input::~for_input()
-{
- a_delete var;
- a_delete body;
-}
-
-int for_input::get()
-{
- if (p == 0)
- return EOF;
- for (;;) {
- if (*p != '\0')
- return (unsigned char)*p++;
- if (!done_newline) {
- done_newline = 1;
- return '\n';
- }
- double val;
- if (!lookup_variable(var, &val)) {
- lex_error("body of `for' terminated enclosing block");
- return EOF;
- }
- if (by_is_multiplicative)
- val *= by;
- else
- val += by;
- define_variable(var, val);
- if (val > to) {
- p = 0;
- return EOF;
- }
- p = body;
- done_newline = 0;
- }
-}
-
-int for_input::peek()
-{
- if (p == 0)
- return EOF;
- if (*p != '\0')
- return (unsigned char)*p;
- if (!done_newline)
- return '\n';
- double val;
- if (!lookup_variable(var, &val))
- return EOF;
- if (by_is_multiplicative) {
- if (val * by > to)
- return EOF;
- }
- else {
- if (val + by > to)
- return EOF;
- }
- if (*body == '\0')
- return EOF;
- return (unsigned char)*body;
-}
-
-void do_for(char *var, double from, double to, int by_is_multiplicative,
- double by, char *body)
-{
- define_variable(var, from);
- if (from <= to)
- input_stack::push(new for_input(var, to, by_is_multiplicative, by, body));
-}
-
-
-void do_copy(const char *filename)
-{
- errno = 0;
- FILE *fp = fopen(filename, "r");
- if (fp == 0) {
- lex_error("can't open `%1': %2", filename, strerror(errno));
- return;
- }
- input_stack::push(new file_input(fp, filename));
-}
-
-class copy_thru_input : public input {
- int done;
- char *body;
- char *until;
- const char *p;
- const char *ap;
- int argv[9];
- int argc;
- string line;
- int get_line();
- virtual int inget() = 0;
-public:
- copy_thru_input(const char *b, const char *u);
- ~copy_thru_input();
- int get();
- int peek();
-};
-
-class copy_file_thru_input : public copy_thru_input {
- input *in;
-public:
- copy_file_thru_input(input *, const char *b, const char *u);
- ~copy_file_thru_input();
- int inget();
-};
-
-copy_file_thru_input::copy_file_thru_input(input *i, const char *b,
- const char *u)
-: copy_thru_input(b, u), in(i)
-{
-}
-
-copy_file_thru_input::~copy_file_thru_input()
-{
- delete in;
-}
-
-int copy_file_thru_input::inget()
-{
- if (!in)
- return EOF;
- else
- return in->get();
-}
-
-class copy_rest_thru_input : public copy_thru_input {
-public:
- copy_rest_thru_input(const char *, const char *u);
- int inget();
-};
-
-copy_rest_thru_input::copy_rest_thru_input(const char *b, const char *u)
-: copy_thru_input(b, u)
-{
-}
-
-int copy_rest_thru_input::inget()
-{
- while (next != 0) {
- int c = next->get();
- if (c != EOF)
- return c;
- if (next->next == 0)
- return EOF;
- input *tem = next;
- next = next->next;
- delete tem;
- }
- return EOF;
-
-}
-
-copy_thru_input::copy_thru_input(const char *b, const char *u)
-: done(0)
-{
- ap = 0;
- body = process_body(b);
- p = 0;
- until = strsave(u);
-}
-
-
-copy_thru_input::~copy_thru_input()
-{
- a_delete body;
- a_delete until;
-}
-
-int copy_thru_input::get()
-{
- if (ap) {
- if (*ap != '\0')
- return (unsigned char)*ap++;
- ap = 0;
- }
- for (;;) {
- if (p == 0) {
- if (!get_line())
- break;
- p = body;
- }
- if (*p == '\0') {
- p = 0;
- return '\n';
- }
- while (*p >= ARG1 && *p <= ARG1 + 8) {
- int i = *p++ - ARG1;
- if (i < argc && line[argv[i]] != '\0') {
- ap = line.contents() + argv[i];
- return (unsigned char)*ap++;
- }
- }
- if (*p != '\0')
- return (unsigned char)*p++;
- }
- return EOF;
-}
-
-int copy_thru_input::peek()
-{
- if (ap) {
- if (*ap != '\0')
- return (unsigned char)*ap;
- ap = 0;
- }
- for (;;) {
- if (p == 0) {
- if (!get_line())
- break;
- p = body;
- }
- if (*p == '\0')
- return '\n';
- while (*p >= ARG1 && *p <= ARG1 + 8) {
- int i = *p++ - ARG1;
- if (i < argc && line[argv[i]] != '\0') {
- ap = line.contents() + argv[i];
- return (unsigned char)*ap;
- }
- }
- if (*p != '\0')
- return (unsigned char)*p;
- }
- return EOF;
-}
-
-int copy_thru_input::get_line()
-{
- if (done)
- return 0;
- line.clear();
- argc = 0;
- int c = inget();
- for (;;) {
- while (c == ' ')
- c = inget();
- if (c == EOF || c == '\n')
- break;
- if (argc == 9) {
- do {
- c = inget();
- } while (c != '\n' && c != EOF);
- break;
- }
- argv[argc++] = line.length();
- do {
- line += char(c);
- c = inget();
- } while (c != ' ' && c != '\n');
- line += '\0';
- }
- if (until != 0 && argc > 0 && strcmp(&line[argv[0]], until) == 0) {
- done = 1;
- return 0;
- }
- return argc > 0 || c == '\n';
-}
-
-class simple_file_input : public input {
- const char *filename;
- int lineno;
- FILE *fp;
-public:
- simple_file_input(FILE *, const char *);
- ~simple_file_input();
- int get();
- int peek();
- int get_location(const char **, int *);
-};
-
-simple_file_input::simple_file_input(FILE *p, const char *s)
-: filename(s), lineno(1), fp(p)
-{
-}
-
-simple_file_input::~simple_file_input()
-{
- // don't delete the filename
- fclose(fp);
-}
-
-int simple_file_input::get()
-{
- int c = getc(fp);
- while (illegal_input_char(c)) {
- error("illegal input character code %1", c);
- c = getc(fp);
- }
- if (c == '\n')
- lineno++;
- return c;
-}
-
-int simple_file_input::peek()
-{
- int c = getc(fp);
- while (illegal_input_char(c)) {
- error("illegal input character code %1", c);
- c = getc(fp);
- }
- if (c != EOF)
- ungetc(c, fp);
- return c;
-}
-
-int simple_file_input::get_location(const char **fnp, int *lnp)
-{
- *fnp = filename;
- *lnp = lineno;
- return 1;
-}
-
-
-void copy_file_thru(const char *filename, const char *body, const char *until)
-{
- errno = 0;
- FILE *fp = fopen(filename, "r");
- if (fp == 0) {
- lex_error("can't open `%1': %2", filename, strerror(errno));
- return;
- }
- input *in = new copy_file_thru_input(new simple_file_input(fp, filename),
- body, until);
- input_stack::push(in);
-}
-
-void copy_rest_thru(const char *body, const char *until)
-{
- input_stack::push(new copy_rest_thru_input(body, until));
-}
-
-void push_body(const char *s)
-{
- input_stack::push(new char_input('\n'));
- input_stack::push(new macro_input(s));
-}
-
-int delim_flag = 0;
-
-char *get_thru_arg()
-{
- int c = input_stack::peek_char();
- while (c == ' ') {
- input_stack::get_char();
- c = input_stack::peek_char();
- }
- if (c != EOF && csalpha(c)) {
- // looks like a macro
- input_stack::get_char();
- token_buffer = c;
- for (;;) {
- c = input_stack::peek_char();
- if (c == EOF || (!csalnum(c) && c != '_'))
- break;
- input_stack::get_char();
- token_buffer += char(c);
- }
- context_buffer = token_buffer;
- token_buffer += '\0';
- char *def = macro_table.lookup(token_buffer.contents());
- if (def)
- return strsave(def);
- // I guess it wasn't a macro after all; so push the macro name back.
- // -2 because we added a '\0'
- for (int i = token_buffer.length() - 2; i >= 0; i--)
- input_stack::push_back(token_buffer[i]);
- }
- if (get_delimited()) {
- token_buffer += '\0';
- return strsave(token_buffer.contents());
- }
- else
- return 0;
-}
-
-int lookahead_token = -1;
-string old_context_buffer;
-
-void do_lookahead()
-{
- if (lookahead_token == -1) {
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- }
-}
-
-int yylex()
-{
- if (delim_flag) {
- assert(lookahead_token == -1);
- if (delim_flag == 2) {
- if ((yylval.str = get_thru_arg()) != 0)
- return DELIMITED;
- else
- return 0;
- }
- else {
- if (get_delimited()) {
- token_buffer += '\0';
- yylval.str = strsave(token_buffer.contents());
- return DELIMITED;
- }
- else
- return 0;
- }
- }
- for (;;) {
- int t;
- if (lookahead_token >= 0) {
- t = lookahead_token;
- lookahead_token = -1;
- }
- else
- t = get_token(1);
- switch (t) {
- case '\n':
- return ';';
- case EOF:
- return 0;
- case DEFINE:
- do_define();
- break;
- case UNDEF:
- do_undef();
- break;
- case ORDINAL:
- yylval.n = token_int;
- return t;
- case NUMBER:
- yylval.x = token_double;
- return t;
- case COMMAND_LINE:
- case TEXT:
- token_buffer += '\0';
- if (!input_stack::get_location(&yylval.lstr.filename,
- &yylval.lstr.lineno)) {
- yylval.lstr.filename = 0;
- yylval.lstr.lineno = -1;
- }
- yylval.lstr.str = strsave(token_buffer.contents());
- return t;
- case LABEL:
- case VARIABLE:
- token_buffer += '\0';
- yylval.str = strsave(token_buffer.contents());
- return t;
- case LEFT:
- // change LEFT to LEFT_CORNER when followed by OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token == OF)
- return LEFT_CORNER;
- else
- return t;
- case RIGHT:
- // change RIGHT to RIGHT_CORNER when followed by OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token == OF)
- return RIGHT_CORNER;
- else
- return t;
- case UPPER:
- // recognise UPPER only before LEFT or RIGHT
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != LEFT && lookahead_token != RIGHT) {
- yylval.str = strsave("upper");
- return VARIABLE;
- }
- else
- return t;
- case LOWER:
- // recognise LOWER only before LEFT or RIGHT
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != LEFT && lookahead_token != RIGHT) {
- yylval.str = strsave("lower");
- return VARIABLE;
- }
- else
- return t;
- case TOP:
- // recognise TOP only before OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != OF) {
- yylval.str = strsave("top");
- return VARIABLE;
- }
- else
- return t;
- case BOTTOM:
- // recognise BOTTOM only before OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != OF) {
- yylval.str = strsave("bottom");
- return VARIABLE;
- }
- else
- return t;
- case CENTER:
- // recognise CENTER only before OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != OF) {
- yylval.str = strsave("center");
- return VARIABLE;
- }
- else
- return t;
- case START:
- // recognise START only before OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != OF) {
- yylval.str = strsave("start");
- return VARIABLE;
- }
- else
- return t;
- case END:
- // recognise END only before OF
- old_context_buffer = context_buffer;
- lookahead_token = get_token(1);
- if (lookahead_token != OF) {
- yylval.str = strsave("end");
- return VARIABLE;
- }
- else
- return t;
- default:
- return t;
- }
- }
-}
-
-void lex_error(const char *message,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- const char *filename;
- int lineno;
- if (!input_stack::get_location(&filename, &lineno))
- error(message, arg1, arg2, arg3);
- else
- error_with_file_and_line(filename, lineno, message, arg1, arg2, arg3);
-}
-
-void lex_warning(const char *message,
- const errarg &arg1,
- const errarg &arg2,
- const errarg &arg3)
-{
- const char *filename;
- int lineno;
- if (!input_stack::get_location(&filename, &lineno))
- warning(message, arg1, arg2, arg3);
- else
- warning_with_file_and_line(filename, lineno, message, arg1, arg2, arg3);
-}
-
-void yyerror(const char *s)
-{
- const char *filename;
- int lineno;
- const char *context = 0;
- if (lookahead_token == -1) {
- if (context_buffer.length() > 0) {
- context_buffer += '\0';
- context = context_buffer.contents();
- }
- }
- else {
- if (old_context_buffer.length() > 0) {
- old_context_buffer += '\0';
- context = old_context_buffer.contents();
- }
- }
- if (!input_stack::get_location(&filename, &lineno)) {
- if (context) {
- if (context[0] == '\n' && context[1] == '\0')
- error("%1 before newline", s);
- else
- error("%1 before `%2'", s, context);
- }
- else
- error("%1 at end of picture", s);
- }
- else {
- if (context) {
- if (context[0] == '\n' && context[1] == '\0')
- error_with_file_and_line(filename, lineno, "%1 before newline", s);
- else
- error_with_file_and_line(filename, lineno, "%1 before `%2'",
- s, context);
- }
- else
- error_with_file_and_line(filename, lineno, "%1 at end of picture", s);
- }
-}
-
diff --git a/contrib/groff/pic/main.cc b/contrib/groff/pic/main.cc
deleted file mode 100644
index 1536513a706b..000000000000
--- a/contrib/groff/pic/main.cc
+++ /dev/null
@@ -1,624 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "pic.h"
-
-extern int yyparse();
-
-output *out;
-
-int flyback_flag;
-int zero_length_line_flag = 0;
-// Non-zero means we're using a groff driver.
-int driver_extension_flag = 1;
-int compatible_flag = 0;
-int safer_flag = 1;
-int command_char = '.'; // the character that introduces lines
- // that should be passed through tranparently
-static int lf_flag = 1; // non-zero if we should attempt to understand
- // lines beginning with `.lf'
-
-// Non-zero means a parse error was encountered.
-static int had_parse_error = 0;
-
-void do_file(const char *filename);
-
-class top_input : public input {
- FILE *fp;
- int bol;
- int eof;
- int push_back[3];
- int start_lineno;
-public:
- top_input(FILE *);
- int get();
- int peek();
- int get_location(const char **, int *);
-};
-
-top_input::top_input(FILE *p) : fp(p), bol(1), eof(0)
-{
- push_back[0] = push_back[1] = push_back[2] = EOF;
- start_lineno = current_lineno;
-}
-
-int top_input::get()
-{
- if (eof)
- return EOF;
- if (push_back[2] != EOF) {
- int c = push_back[2];
- push_back[2] = EOF;
- return c;
- }
- else if (push_back[1] != EOF) {
- int c = push_back[1];
- push_back[1] = EOF;
- return c;
- }
- else if (push_back[0] != EOF) {
- int c = push_back[0];
- push_back[0] = EOF;
- return c;
- }
- int c = getc(fp);
- while (illegal_input_char(c)) {
- error("illegal input character code %1", int(c));
- c = getc(fp);
- bol = 0;
- }
- if (bol && c == '.') {
- c = getc(fp);
- if (c == 'P') {
- c = getc(fp);
- if (c == 'F' || c == 'E') {
- int d = getc(fp);
- if (d != EOF)
- ungetc(d, fp);
- if (d == EOF || d == ' ' || d == '\n' || compatible_flag) {
- eof = 1;
- flyback_flag = c == 'F';
- return EOF;
- }
- push_back[0] = c;
- push_back[1] = 'P';
- return '.';
- }
- if (c == 'S') {
- c = getc(fp);
- if (c != EOF)
- ungetc(c, fp);
- if (c == EOF || c == ' ' || c == '\n' || compatible_flag) {
- error("nested .PS");
- eof = 1;
- return EOF;
- }
- push_back[0] = 'S';
- push_back[1] = 'P';
- return '.';
- }
- if (c != EOF)
- ungetc(c, fp);
- push_back[0] = 'P';
- return '.';
- }
- else {
- if (c != EOF)
- ungetc(c, fp);
- return '.';
- }
- }
- if (c == '\n') {
- bol = 1;
- current_lineno++;
- return '\n';
- }
- bol = 0;
- if (c == EOF) {
- eof = 1;
- error("end of file before .PE or .PF");
- error_with_file_and_line(current_filename, start_lineno - 1,
- ".PS was here");
- }
- return c;
-}
-
-int top_input::peek()
-{
- if (eof)
- return EOF;
- if (push_back[2] != EOF)
- return push_back[2];
- if (push_back[1] != EOF)
- return push_back[1];
- if (push_back[0] != EOF)
- return push_back[0];
- int c = getc(fp);
- while (illegal_input_char(c)) {
- error("illegal input character code %1", int(c));
- c = getc(fp);
- bol = 0;
- }
- if (bol && c == '.') {
- c = getc(fp);
- if (c == 'P') {
- c = getc(fp);
- if (c == 'F' || c == 'E') {
- int d = getc(fp);
- if (d != EOF)
- ungetc(d, fp);
- if (d == EOF || d == ' ' || d == '\n' || compatible_flag) {
- eof = 1;
- flyback_flag = c == 'F';
- return EOF;
- }
- push_back[0] = c;
- push_back[1] = 'P';
- push_back[2] = '.';
- return '.';
- }
- if (c == 'S') {
- c = getc(fp);
- if (c != EOF)
- ungetc(c, fp);
- if (c == EOF || c == ' ' || c == '\n' || compatible_flag) {
- error("nested .PS");
- eof = 1;
- return EOF;
- }
- push_back[0] = 'S';
- push_back[1] = 'P';
- push_back[2] = '.';
- return '.';
- }
- if (c != EOF)
- ungetc(c, fp);
- push_back[0] = 'P';
- push_back[1] = '.';
- return '.';
- }
- else {
- if (c != EOF)
- ungetc(c, fp);
- push_back[0] = '.';
- return '.';
- }
- }
- if (c != EOF)
- ungetc(c, fp);
- if (c == '\n')
- return '\n';
- return c;
-}
-
-int top_input::get_location(const char **filenamep, int *linenop)
-{
- *filenamep = current_filename;
- *linenop = current_lineno;
- return 1;
-}
-
-void do_picture(FILE *fp)
-{
- flyback_flag = 0;
- int c;
- while ((c = getc(fp)) == ' ')
- ;
- if (c == '<') {
- string filename;
- while ((c = getc(fp)) == ' ')
- ;
- while (c != EOF && c != ' ' && c != '\n') {
- filename += char(c);
- c = getc(fp);
- }
- if (c == ' ') {
- do {
- c = getc(fp);
- } while (c != EOF && c != '\n');
- }
- if (c == '\n')
- current_lineno++;
- if (filename.length() == 0)
- error("missing filename after `<'");
- else {
- filename += '\0';
- const char *old_filename = current_filename;
- int old_lineno = current_lineno;
- // filenames must be permanent
- do_file(strsave(filename.contents()));
- current_filename = old_filename;
- current_lineno = old_lineno;
- }
- out->set_location(current_filename, current_lineno);
- }
- else {
- out->set_location(current_filename, current_lineno);
- string start_line;
- while (c != EOF) {
- if (c == '\n') {
- current_lineno++;
- break;
- }
- start_line += c;
- c = getc(fp);
- }
- if (c == EOF)
- return;
- start_line += '\0';
- double wid, ht;
- switch (sscanf(&start_line[0], "%lf %lf", &wid, &ht)) {
- case 1:
- ht = 0.0;
- break;
- case 2:
- break;
- default:
- ht = wid = 0.0;
- break;
- }
- out->set_desired_width_height(wid, ht);
- out->set_args(start_line.contents());
- lex_init(new top_input(fp));
- if (yyparse()) {
- had_parse_error = 1;
- lex_error("giving up on this picture");
- }
- parse_cleanup();
- lex_cleanup();
-
- // skip the rest of the .PF/.PE line
- while ((c = getc(fp)) != EOF && c != '\n')
- ;
- if (c == '\n')
- current_lineno++;
- out->set_location(current_filename, current_lineno);
- }
-}
-
-void do_file(const char *filename)
-{
- FILE *fp;
- if (strcmp(filename, "-") == 0)
- fp = stdin;
- else {
- errno = 0;
- fp = fopen(filename, "r");
- if (fp == 0)
- fatal("can't open `%1': %2", filename, strerror(errno));
- }
- out->set_location(filename, 1);
- current_filename = filename;
- current_lineno = 1;
- enum { START, MIDDLE, HAD_DOT, HAD_P, HAD_PS, HAD_l, HAD_lf } state = START;
- for (;;) {
- int c = getc(fp);
- if (c == EOF)
- break;
- switch (state) {
- case START:
- if (c == '.')
- state = HAD_DOT;
- else {
- putchar(c);
- if (c == '\n') {
- current_lineno++;
- state = START;
- }
- else
- state = MIDDLE;
- }
- break;
- case MIDDLE:
- putchar(c);
- if (c == '\n') {
- current_lineno++;
- state = START;
- }
- break;
- case HAD_DOT:
- if (c == 'P')
- state = HAD_P;
- else if (lf_flag && c == 'l')
- state = HAD_l;
- else {
- putchar('.');
- putchar(c);
- if (c == '\n') {
- current_lineno++;
- state = START;
- }
- else
- state = MIDDLE;
- }
- break;
- case HAD_P:
- if (c == 'S')
- state = HAD_PS;
- else {
- putchar('.');
- putchar('P');
- putchar(c);
- if (c == '\n') {
- current_lineno++;
- state = START;
- }
- else
- state = MIDDLE;
- }
- break;
- case HAD_PS:
- if (c == ' ' || c == '\n' || compatible_flag) {
- ungetc(c, fp);
- do_picture(fp);
- state = START;
- }
- else {
- fputs(".PS", stdout);
- putchar(c);
- state = MIDDLE;
- }
- break;
- case HAD_l:
- if (c == 'f')
- state = HAD_lf;
- else {
- putchar('.');
- putchar('l');
- putchar(c);
- if (c == '\n') {
- current_lineno++;
- state = START;
- }
- else
- state = MIDDLE;
- }
- break;
- case HAD_lf:
- if (c == ' ' || c == '\n' || compatible_flag) {
- string line;
- while (c != EOF) {
- line += c;
- if (c == '\n') {
- current_lineno++;
- break;
- }
- c = getc(fp);
- }
- line += '\0';
- interpret_lf_args(line.contents());
- printf(".lf%s", line.contents());
- state = START;
- }
- else {
- fputs(".lf", stdout);
- putchar(c);
- state = MIDDLE;
- }
- break;
- default:
- assert(0);
- }
- }
- switch (state) {
- case START:
- break;
- case MIDDLE:
- putchar('\n');
- break;
- case HAD_DOT:
- fputs(".\n", stdout);
- break;
- case HAD_P:
- fputs(".P\n", stdout);
- break;
- case HAD_PS:
- fputs(".PS\n", stdout);
- break;
- case HAD_l:
- fputs(".l\n", stdout);
- break;
- case HAD_lf:
- fputs(".lf\n", stdout);
- break;
- }
- if (fp != stdin)
- fclose(fp);
-}
-
-#ifdef FIG_SUPPORT
-void do_whole_file(const char *filename)
-{
- // Do not set current_filename.
- FILE *fp;
- if (strcmp(filename, "-") == 0)
- fp = stdin;
- else {
- errno = 0;
- fp = fopen(filename, "r");
- if (fp == 0)
- fatal("can't open `%1': %2", filename, strerror(errno));
- }
- lex_init(new file_input(fp, filename));
- if (yyparse())
- had_parse_error = 1;
- parse_cleanup();
- lex_cleanup();
-}
-#endif
-
-void usage()
-{
- fprintf(stderr, "usage: %s [ -nvC ] [ filename ... ]\n", program_name);
-#ifdef TEX_SUPPORT
- fprintf(stderr, " %s -t [ -cvzC ] [ filename ... ]\n", program_name);
-#endif
-#ifdef FIG_SUPPORT
- fprintf(stderr, " %s -f [ -v ] [ filename ]\n", program_name);
-#endif
- exit(1);
-}
-
-#ifdef __MSDOS__
-static char *fix_program_name(char *arg, char *dflt)
-{
- if (!arg)
- return dflt;
- char *prog = strchr(arg, '\0');
- for (;;) {
- if (prog == arg)
- break;
- --prog;
- if (strchr("\\/:", *prog)) {
- prog++;
- break;
- }
- }
- char *ext = strchr(prog, '.');
- if (ext)
- *ext = '\0';
- for (char *p = prog; *p; p++)
- if ('A' <= *p && *p <= 'Z')
- *p = 'a' + (*p - 'A');
- return prog;
-}
-#endif /* __MSDOS__ */
-
-int main(int argc, char **argv)
-{
-#ifdef __MSDOS__
- argv[0] = fix_program_name(argv[0], "pic");
-#endif /* __MSDOS__ */
- program_name = argv[0];
- static char stderr_buf[BUFSIZ];
- setbuf(stderr, stderr_buf);
- int opt;
-#ifdef TEX_SUPPORT
- int tex_flag = 0;
- int tpic_flag = 0;
-#endif
-#ifdef FIG_SUPPORT
- int whole_file_flag = 0;
- int fig_flag = 0;
-#endif
- while ((opt = getopt(argc, argv, "T:CDSUtcvnxzpf")) != EOF)
- switch (opt) {
- case 'C':
- compatible_flag = 1;
- break;
- case 'D':
- case 'T':
- break;
- case 'S':
- safer_flag = 1;
- break;
- case 'U':
- safer_flag = 0;
- break;
- case 'f':
-#ifdef FIG_SUPPORT
- whole_file_flag++;
- fig_flag++;
-#else
- fatal("fig support not included");
-#endif
- break;
- case 'n':
- driver_extension_flag = 0;
- break;
- case 'p':
- case 'x':
- warning("-%1 option is obsolete", char(opt));
- break;
- case 't':
-#ifdef TEX_SUPPORT
- tex_flag++;
-#else
- fatal("TeX support not included");
-#endif
- break;
- case 'c':
-#ifdef TEX_SUPPORT
- tpic_flag++;
-#else
- fatal("TeX support not included");
-#endif
- break;
- case 'v':
- {
- extern const char *Version_string;
- fprintf(stderr, "GNU pic version %s\n", Version_string);
- fflush(stderr);
- break;
- }
- case 'z':
- // zero length lines will be printed as dots
- zero_length_line_flag++;
- break;
- case '?':
- usage();
- break;
- default:
- assert(0);
- }
- parse_init();
-#ifdef TEX_SUPPORT
- if (tpic_flag) {
- out = make_tpic_output();
- lf_flag = 0;
- }
- else if (tex_flag) {
- out = make_tex_output();
- command_char = '\\';
- lf_flag = 0;
- }
- else
-#endif
-#ifdef FIG_SUPPORT
- if (fig_flag)
- out = make_fig_output();
- else
-#endif
- out = make_troff_output();
-#ifdef FIG_SUPPORT
- if (whole_file_flag) {
- if (optind >= argc)
- do_whole_file("-");
- else if (argc - optind > 1)
- usage();
- else
- do_whole_file(argv[optind]);
- }
- else {
-#endif
- if (optind >= argc)
- do_file("-");
- else
- for (int i = optind; i < argc; i++)
- do_file(argv[i]);
-#ifdef FIG_SUPPORT
- }
-#endif
- delete out;
- if (ferror(stdout) || fflush(stdout) < 0)
- fatal("output error");
- return had_parse_error;
-}
-
diff --git a/contrib/groff/pic/object.cc b/contrib/groff/pic/object.cc
deleted file mode 100644
index 6b346330e4e2..000000000000
--- a/contrib/groff/pic/object.cc
+++ /dev/null
@@ -1,1833 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include "pic.h"
-#include "ptable.h"
-#include "object.h"
-
-void print_object_list(object *);
-
-line_type::line_type()
-: type(solid), thickness(1.0)
-{
-}
-
-output::output() : args(0), desired_height(0.0), desired_width(0.0)
-{
-}
-
-output::~output()
-{
- a_delete args;
-}
-
-void output::set_desired_width_height(double wid, double ht)
-{
- desired_width = wid;
- desired_height = ht;
-}
-
-void output::set_args(const char *s)
-{
- a_delete args;
- if (s == 0 || *s == '\0')
- args = 0;
- else
- args = strsave(s);
-}
-
-void output::command(const char *, const char *, int)
-{
-}
-
-void output::set_location(const char *, int)
-{
-}
-
-int output::supports_filled_polygons()
-{
- return 0;
-}
-
-void output::begin_block(const position &, const position &)
-{
-}
-
-void output::end_block()
-{
-}
-
-double output::compute_scale(double sc, const position &ll, const position &ur)
-{
- distance dim = ur - ll;
- if (desired_width != 0.0 || desired_height != 0.0) {
- sc = 0.0;
- if (desired_width != 0.0) {
- if (dim.x == 0.0)
- error("width specified for picture with zero width");
- else
- sc = dim.x/desired_width;
- }
- if (desired_height != 0.0) {
- if (dim.y == 0.0)
- error("height specified for picture with zero height");
- else {
- double tem = dim.y/desired_height;
- if (tem > sc)
- sc = tem;
- }
- }
- return sc == 0.0 ? 1.0 : sc;
- }
- else {
- if (sc <= 0.0)
- sc = 1.0;
- distance sdim = dim/sc;
- double max_width = 0.0;
- lookup_variable("maxpswid", &max_width);
- double max_height = 0.0;
- lookup_variable("maxpsht", &max_height);
- if ((max_width > 0.0 && sdim.x > max_width)
- || (max_height > 0.0 && sdim.y > max_height)) {
- double xscale = dim.x/max_width;
- double yscale = dim.y/max_height;
- return xscale > yscale ? xscale : yscale;
- }
- else
- return sc;
- }
-}
-
-position::position(const place &pl)
-{
- if (pl.obj != 0) {
- // Use two statements to work around bug in SGI C++.
- object *tem = pl.obj;
- *this = tem->origin();
- }
- else {
- x = pl.x;
- y = pl.y;
- }
-}
-
-position::position() : x(0.0), y(0.0)
-{
-}
-
-position::position(double a, double b) : x(a), y(b)
-{
-}
-
-
-int operator==(const position &a, const position &b)
-{
- return a.x == b.x && a.y == b.y;
-}
-
-int operator!=(const position &a, const position &b)
-{
- return a.x != b.x || a.y != b.y;
-}
-
-position &position::operator+=(const position &a)
-{
- x += a.x;
- y += a.y;
- return *this;
-}
-
-position &position::operator-=(const position &a)
-{
- x -= a.x;
- y -= a.y;
- return *this;
-}
-
-position &position::operator*=(double a)
-{
- x *= a;
- y *= a;
- return *this;
-}
-
-position &position::operator/=(double a)
-{
- x /= a;
- y /= a;
- return *this;
-}
-
-position operator-(const position &a)
-{
- return position(-a.x, -a.y);
-}
-
-position operator+(const position &a, const position &b)
-{
- return position(a.x + b.x, a.y + b.y);
-}
-
-position operator-(const position &a, const position &b)
-{
- return position(a.x - b.x, a.y - b.y);
-}
-
-position operator/(const position &a, double n)
-{
- return position(a.x/n, a.y/n);
-}
-
-position operator*(const position &a, double n)
-{
- return position(a.x*n, a.y*n);
-}
-
-// dot product
-
-double operator*(const position &a, const position &b)
-{
- return a.x*b.x + a.y*b.y;
-}
-
-double hypot(const position &a)
-{
- return hypot(a.x, a.y);
-}
-
-struct arrow_head_type {
- double height;
- double width;
- int solid;
-};
-
-void draw_arrow(const position &pos, const distance &dir,
- const arrow_head_type &aht, const line_type <)
-{
- double hyp = hypot(dir);
- if (hyp == 0.0) {
- error("cannot draw arrow on object with zero length");
- return;
- }
- position base = -dir;
- base *= aht.height/hyp;
- position n(dir.y, -dir.x);
- n *= aht.width/(hyp*2.0);
- line_type slt = lt;
- slt.type = line_type::solid;
- if (aht.solid && out->supports_filled_polygons()) {
- position v[3];
- v[0] = pos;
- v[1] = pos + base + n;
- v[2] = pos + base - n;
- // A value > 1 means fill with the current color.
- out->polygon(v, 3, slt, 2.0);
- }
- else {
- position v[2];
- v[0] = pos;
- v[1] = pos + base + n;
- out->line(pos + base - n, v, 2, slt);
- }
-}
-
-object::object() : prev(0), next(0)
-{
-}
-
-object::~object()
-{
-}
-
-void object::move_by(const position &)
-{
-}
-
-void object::print()
-{
-}
-
-void object::print_text()
-{
-}
-
-int object::blank()
-{
- return 0;
-}
-
-struct bounding_box {
- int blank;
- position ll;
- position ur;
-
- bounding_box();
- void encompass(const position &);
-};
-
-bounding_box::bounding_box()
-: blank(1)
-{
-}
-
-void bounding_box::encompass(const position &pos)
-{
- if (blank) {
- ll = pos;
- ur = pos;
- blank = 0;
- }
- else {
- if (pos.x < ll.x)
- ll.x = pos.x;
- if (pos.y < ll.y)
- ll.y = pos.y;
- if (pos.x > ur.x)
- ur.x = pos.x;
- if (pos.y > ur.y)
- ur.y = pos.y;
- }
-}
-
-void object::update_bounding_box(bounding_box *)
-{
-}
-
-position object::origin()
-{
- return position(0.0,0.0);
-}
-
-position object::north()
-{
- return origin();
-}
-
-position object::south()
-{
- return origin();
-}
-
-position object::east()
-{
- return origin();
-}
-
-position object::west()
-{
- return origin();
-}
-
-position object::north_east()
-{
- return origin();
-}
-
-position object::north_west()
-{
- return origin();
-}
-
-position object::south_east()
-{
- return origin();
-}
-
-position object::south_west()
-{
- return origin();
-}
-
-position object::start()
-{
- return origin();
-}
-
-position object::end()
-{
- return origin();
-}
-
-position object::center()
-{
- return origin();
-}
-
-double object::width()
-{
- return 0.0;
-}
-
-double object::radius()
-{
- return 0.0;
-}
-
-double object::height()
-{
- return 0.0;
-}
-
-place *object::find_label(const char *)
-{
- return 0;
-}
-
-segment::segment(const position &a, int n, segment *p)
-: is_absolute(n), pos(a), next(p)
-{
-}
-
-text_item::text_item(char *t, const char *fn, int ln)
-: next(0), text(t), filename(fn), lineno(ln)
-{
- adj.h = CENTER_ADJUST;
- adj.v = NONE_ADJUST;
-}
-
-text_item::~text_item()
-{
- a_delete text;
-}
-
-object_spec::object_spec(object_type t) : type(t)
-{
- flags = 0;
- tbl = 0;
- segment_list = 0;
- segment_width = segment_height = 0.0;
- segment_is_absolute = 0;
- text = 0;
- with = 0;
- dir = RIGHT_DIRECTION;
-}
-
-object_spec::~object_spec()
-{
- delete tbl;
- while (segment_list != 0) {
- segment *tem = segment_list;
- segment_list = segment_list->next;
- delete tem;
- }
- object *p = oblist.head;
- while (p != 0) {
- object *tem = p;
- p = p->next;
- delete tem;
- }
- while (text != 0) {
- text_item *tem = text;
- text = text->next;
- delete tem;
- }
- delete with;
-}
-
-class command_object : public object {
- char *s;
- const char *filename;
- int lineno;
-public:
- command_object(char *, const char *, int);
- ~command_object();
- object_type type() { return OTHER_OBJECT; }
- void print();
-};
-
-command_object::command_object(char *p, const char *fn, int ln)
-: s(p), filename(fn), lineno(ln)
-{
-}
-
-command_object::~command_object()
-{
- a_delete s;
-}
-
-void command_object::print()
-{
- out->command(s, filename, lineno);
-}
-
-object *make_command_object(char *s, const char *fn, int ln)
-{
- return new command_object(s, fn, ln);
-}
-
-class mark_object : public object {
-public:
- mark_object();
- object_type type();
-};
-
-object *make_mark_object()
-{
- return new mark_object();
-}
-
-mark_object::mark_object()
-{
-}
-
-object_type mark_object::type()
-{
- return MARK_OBJECT;
-}
-
-object_list::object_list() : head(0), tail(0)
-{
-}
-
-void object_list::append(object *obj)
-{
- if (tail == 0) {
- obj->next = obj->prev = 0;
- head = tail = obj;
- }
- else {
- obj->prev = tail;
- obj->next = 0;
- tail->next = obj;
- tail = obj;
- }
-}
-
-void object_list::wrap_up_block(object_list *ol)
-{
- object *p;
- for (p = tail; p && p->type() != MARK_OBJECT; p = p->prev)
- ;
- assert(p != 0);
- ol->head = p->next;
- if (ol->head) {
- ol->tail = tail;
- ol->head->prev = 0;
- }
- else
- ol->tail = 0;
- tail = p->prev;
- if (tail)
- tail->next = 0;
- else
- head = 0;
- delete p;
-}
-
-text_piece::text_piece()
-: text(0), filename(0), lineno(-1)
-{
- adj.h = CENTER_ADJUST;
- adj.v = NONE_ADJUST;
-}
-
-text_piece::~text_piece()
-{
- a_delete text;
-}
-
-class graphic_object : public object {
- int ntext;
- text_piece *text;
- int aligned;
-protected:
- line_type lt;
-public:
- graphic_object();
- ~graphic_object();
- object_type type() = 0;
- void print_text();
- void add_text(text_item *, int);
- void set_dotted(double);
- void set_dashed(double);
- void set_thickness(double);
- void set_invisible();
- virtual void set_fill(double);
-};
-
-graphic_object::graphic_object() : ntext(0), text(0), aligned(0)
-{
-}
-
-void graphic_object::set_dotted(double wid)
-{
- lt.type = line_type::dotted;
- lt.dash_width = wid;
-}
-
-void graphic_object::set_dashed(double wid)
-{
- lt.type = line_type::dashed;
- lt.dash_width = wid;
-}
-
-void graphic_object::set_thickness(double th)
-{
- lt.thickness = th;
-}
-
-void graphic_object::set_fill(double)
-{
-}
-
-void graphic_object::set_invisible()
-{
- lt.type = line_type::invisible;
-}
-
-void graphic_object::add_text(text_item *t, int a)
-{
- aligned = a;
- int len = 0;
- text_item *p;
- for (p = t; p; p = p->next)
- len++;
- if (len == 0)
- text = 0;
- else {
- text = new text_piece[len];
- for (p = t, len = 0; p; p = p->next, len++) {
- text[len].text = p->text;
- p->text = 0;
- text[len].adj = p->adj;
- text[len].filename = p->filename;
- text[len].lineno = p->lineno;
- }
- }
- ntext = len;
-}
-
-void graphic_object::print_text()
-{
- double angle = 0.0;
- if (aligned) {
- position d(end() - start());
- if (d.x != 0.0 || d.y != 0.0)
- angle = atan2(d.y, d.x);
- }
- if (text != 0)
- out->text(center(), text, ntext, angle);
-}
-
-graphic_object::~graphic_object()
-{
- if (text)
- ad_delete(ntext) text;
-}
-
-class rectangle_object : public graphic_object {
-protected:
- position cent;
- position dim;
-public:
- rectangle_object(const position &);
- double width() { return dim.x; }
- double height() { return dim.y; }
- position origin() { return cent; }
- position center() { return cent; }
- position north() { return position(cent.x, cent.y + dim.y/2.0); }
- position south() { return position(cent.x, cent.y - dim.y/2.0); }
- position east() { return position(cent.x + dim.x/2.0, cent.y); }
- position west() { return position(cent.x - dim.x/2.0, cent.y); }
- position north_east() { return position(cent.x + dim.x/2.0, cent.y + dim.y/2.0); }
- position north_west() { return position(cent.x - dim.x/2.0, cent.y + dim.y/2.0); }
- position south_east() { return position(cent.x + dim.x/2.0, cent.y - dim.y/2.0); }
- position south_west() { return position(cent.x - dim.x/2.0, cent.y - dim.y/2.0); }
- object_type type() = 0;
- void update_bounding_box(bounding_box *);
- void move_by(const position &);
-};
-
-rectangle_object::rectangle_object(const position &d)
-: dim(d)
-{
-}
-
-void rectangle_object::update_bounding_box(bounding_box *p)
-{
- p->encompass(cent - dim/2.0);
- p->encompass(cent + dim/2.0);
-}
-
-void rectangle_object::move_by(const position &a)
-{
- cent += a;
-}
-
-class closed_object : public rectangle_object {
-public:
- closed_object(const position &);
- object_type type() = 0;
- void set_fill(double);
-protected:
- double fill; // < 0 if not filled
-};
-
-closed_object::closed_object(const position &pos)
-: rectangle_object(pos), fill(-1.0)
-{
-}
-
-void closed_object::set_fill(double f)
-{
- assert(f >= 0.0);
- fill = f;
-}
-
-
-class box_object : public closed_object {
- double xrad;
- double yrad;
-public:
- box_object(const position &, double);
- object_type type() { return BOX_OBJECT; }
- void print();
- position north_east();
- position north_west();
- position south_east();
- position south_west();
-};
-
-box_object::box_object(const position &pos, double r)
-: closed_object(pos), xrad(dim.x > 0 ? r : -r), yrad(dim.y > 0 ? r : -r)
-{
-}
-
-const double CHOP_FACTOR = 1.0 - 1.0/M_SQRT2;
-
-position box_object::north_east()
-{
- return position(cent.x + dim.x/2.0 - CHOP_FACTOR*xrad,
- cent.y + dim.y/2.0 - CHOP_FACTOR*yrad);
-}
-
-position box_object::north_west()
-{
- return position(cent.x - dim.x/2.0 + CHOP_FACTOR*xrad,
- cent.y + dim.y/2.0 - CHOP_FACTOR*yrad);
-}
-
-position box_object::south_east()
-{
- return position(cent.x + dim.x/2.0 - CHOP_FACTOR*xrad,
- cent.y - dim.y/2.0 + CHOP_FACTOR*yrad);
-}
-
-position box_object::south_west()
-{
- return position(cent.x - dim.x/2.0 + CHOP_FACTOR*xrad,
- cent.y - dim.y/2.0 + CHOP_FACTOR*yrad);
-}
-
-void box_object::print()
-{
- if (lt.type == line_type::invisible && fill < 0.0)
- return;
- if (xrad == 0.0) {
- distance dim2 = dim/2.0;
- position vec[4];
- vec[0] = cent + position(dim2.x, -dim2.y);
- vec[1] = cent + position(dim2.x, dim2.y);
- vec[2] = cent + position(-dim2.x, dim2.y);
- vec[3] = cent + position(-dim2.x, -dim2.y);
- out->polygon(vec, 4, lt, fill);
- }
- else {
- distance abs_dim(fabs(dim.x), fabs(dim.y));
- out->rounded_box(cent, abs_dim, fabs(xrad), lt, fill);
- }
-}
-
-graphic_object *object_spec::make_box(position *curpos, direction *dirp)
-{
- static double last_box_height;
- static double last_box_width;
- static double last_box_radius;
- static int have_last_box = 0;
- if (!(flags & HAS_HEIGHT)) {
- if ((flags & IS_SAME) && have_last_box)
- height = last_box_height;
- else
- lookup_variable("boxht", &height);
- }
- if (!(flags & HAS_WIDTH)) {
- if ((flags & IS_SAME) && have_last_box)
- width = last_box_width;
- else
- lookup_variable("boxwid", &width);
- }
- if (!(flags & HAS_RADIUS)) {
- if ((flags & IS_SAME) && have_last_box)
- radius = last_box_radius;
- else
- lookup_variable("boxrad", &radius);
- }
- last_box_width = width;
- last_box_height = height;
- last_box_radius = radius;
- have_last_box = 1;
- radius = fabs(radius);
- if (radius*2.0 > fabs(width))
- radius = fabs(width/2.0);
- if (radius*2.0 > fabs(height))
- radius = fabs(height/2.0);
- box_object *p = new box_object(position(width, height), radius);
- if (!position_rectangle(p, curpos, dirp)) {
- delete p;
- p = 0;
- }
- return p;
-}
-
-// return non-zero for success
-
-int object_spec::position_rectangle(rectangle_object *p,
- position *curpos, direction *dirp)
-{
- position pos;
- dir = *dirp; // ignore any direction in attribute list
- position motion;
- switch (dir) {
- case UP_DIRECTION:
- motion.y = p->height()/2.0;
- break;
- case DOWN_DIRECTION:
- motion.y = -p->height()/2.0;
- break;
- case LEFT_DIRECTION:
- motion.x = -p->width()/2.0;
- break;
- case RIGHT_DIRECTION:
- motion.x = p->width()/2.0;
- break;
- default:
- assert(0);
- }
- if (flags & HAS_AT) {
- pos = at;
- if (flags & HAS_WITH) {
- place offset;
- place here;
- here.obj = p;
- if (!with->follow(here, &offset))
- return 0;
- pos -= offset;
- }
- }
- else {
- pos = *curpos;
- pos += motion;
- }
- p->move_by(pos);
- pos += motion;
- *curpos = pos;
- return 1;
-}
-
-class block_object : public rectangle_object {
- object_list oblist;
- PTABLE(place) *tbl;
-public:
- block_object(const position &, const object_list &ol, PTABLE(place) *t);
- ~block_object();
- place *find_label(const char *);
- object_type type();
- void move_by(const position &);
- void print();
-};
-
-block_object::block_object(const position &d, const object_list &ol,
- PTABLE(place) *t)
-: rectangle_object(d), oblist(ol), tbl(t)
-{
-}
-
-block_object::~block_object()
-{
- delete tbl;
- object *p = oblist.head;
- while (p != 0) {
- object *tem = p;
- p = p->next;
- delete tem;
- }
-}
-
-void block_object::print()
-{
- out->begin_block(south_west(), north_east());
- print_object_list(oblist.head);
- out->end_block();
-}
-
-static void adjust_objectless_places(PTABLE(place) *tbl, const position &a)
-{
- // Adjust all the labels that aren't attached to objects.
- PTABLE_ITERATOR(place) iter(tbl);
- const char *key;
- place *pl;
- while (iter.next(&key, &pl))
- if (key && csupper(key[0]) && pl->obj == 0) {
- pl->x += a.x;
- pl->y += a.y;
- }
-}
-
-void block_object::move_by(const position &a)
-{
- cent += a;
- for (object *p = oblist.head; p; p = p->next)
- p->move_by(a);
- adjust_objectless_places(tbl, a);
-}
-
-
-place *block_object::find_label(const char *name)
-{
- return tbl->lookup(name);
-}
-
-object_type block_object::type()
-{
- return BLOCK_OBJECT;
-}
-
-graphic_object *object_spec::make_block(position *curpos, direction *dirp)
-{
- bounding_box bb;
- for (object *p = oblist.head; p; p = p->next)
- p->update_bounding_box(&bb);
- position dim;
- if (!bb.blank) {
- position m = -(bb.ll + bb.ur)/2.0;
- for (object *p = oblist.head; p; p = p->next)
- p->move_by(m);
- adjust_objectless_places(tbl, m);
- dim = bb.ur - bb.ll;
- }
- if (flags & HAS_WIDTH)
- dim.x = width;
- if (flags & HAS_HEIGHT)
- dim.y = height;
- block_object *block = new block_object(dim, oblist, tbl);
- if (!position_rectangle(block, curpos, dirp)) {
- delete block;
- block = 0;
- }
- tbl = 0;
- oblist.head = oblist.tail = 0;
- return block;
-}
-
-class text_object : public rectangle_object {
-public:
- text_object(const position &);
- object_type type() { return TEXT_OBJECT; }
-};
-
-text_object::text_object(const position &d)
-: rectangle_object(d)
-{
-}
-
-graphic_object *object_spec::make_text(position *curpos, direction *dirp)
-{
- if (!(flags & HAS_HEIGHT)) {
- lookup_variable("textht", &height);
- int nitems = 0;
- for (text_item *t = text; t; t = t->next)
- nitems++;
- height *= nitems;
- }
- if (!(flags & HAS_WIDTH))
- lookup_variable("textwid", &width);
- text_object *p = new text_object(position(width, height));
- if (!position_rectangle(p, curpos, dirp)) {
- delete p;
- p = 0;
- }
- return p;
-}
-
-
-class ellipse_object : public closed_object {
-public:
- ellipse_object(const position &);
- position north_east() { return position(cent.x + dim.x/(M_SQRT2*2.0),
- cent.y + dim.y/(M_SQRT2*2.0)); }
- position north_west() { return position(cent.x - dim.x/(M_SQRT2*2.0),
- cent.y + dim.y/(M_SQRT2*2.0)); }
- position south_east() { return position(cent.x + dim.x/(M_SQRT2*2.0),
- cent.y - dim.y/(M_SQRT2*2.0)); }
- position south_west() { return position(cent.x - dim.x/(M_SQRT2*2.0),
- cent.y - dim.y/(M_SQRT2*2.0)); }
- double radius() { return dim.x/2.0; }
- object_type type() { return ELLIPSE_OBJECT; }
- void print();
-};
-
-ellipse_object::ellipse_object(const position &d)
-: closed_object(d)
-{
-}
-
-void ellipse_object::print()
-{
- if (lt.type == line_type::invisible && fill < 0.0)
- return;
- out->ellipse(cent, dim, lt, fill);
-}
-
-graphic_object *object_spec::make_ellipse(position *curpos, direction *dirp)
-{
- static double last_ellipse_height;
- static double last_ellipse_width;
- static int have_last_ellipse = 0;
- if (!(flags & HAS_HEIGHT)) {
- if ((flags & IS_SAME) && have_last_ellipse)
- height = last_ellipse_height;
- else
- lookup_variable("ellipseht", &height);
- }
- if (!(flags & HAS_WIDTH)) {
- if ((flags & IS_SAME) && have_last_ellipse)
- width = last_ellipse_width;
- else
- lookup_variable("ellipsewid", &width);
- }
- last_ellipse_width = width;
- last_ellipse_height = height;
- have_last_ellipse = 1;
- ellipse_object *p = new ellipse_object(position(width, height));
- if (!position_rectangle(p, curpos, dirp)) {
- delete p;
- return 0;
- }
- return p;
-}
-
-class circle_object : public ellipse_object {
-public:
- circle_object(double);
- object_type type() { return CIRCLE_OBJECT; }
- void print();
-};
-
-circle_object::circle_object(double diam)
-: ellipse_object(position(diam, diam))
-{
-}
-
-void circle_object::print()
-{
- if (lt.type == line_type::invisible && fill < 0.0)
- return;
- out->circle(cent, dim.x/2.0, lt, fill);
-}
-
-graphic_object *object_spec::make_circle(position *curpos, direction *dirp)
-{
- static double last_circle_radius;
- static int have_last_circle = 0;
- if (!(flags & HAS_RADIUS)) {
- if ((flags & IS_SAME) && have_last_circle)
- radius = last_circle_radius;
- else
- lookup_variable("circlerad", &radius);
- }
- last_circle_radius = radius;
- have_last_circle = 1;
- circle_object *p = new circle_object(radius*2.0);
- if (!position_rectangle(p, curpos, dirp)) {
- delete p;
- return 0;
- }
- return p;
-}
-
-class move_object : public graphic_object {
- position strt;
- position en;
-public:
- move_object(const position &s, const position &e);
- position origin() { return en; }
- object_type type() { return MOVE_OBJECT; }
- void update_bounding_box(bounding_box *);
- void move_by(const position &);
-};
-
-move_object::move_object(const position &s, const position &e)
-: strt(s), en(e)
-{
-}
-
-void move_object::update_bounding_box(bounding_box *p)
-{
- p->encompass(strt);
- p->encompass(en);
-}
-
-void move_object::move_by(const position &a)
-{
- strt += a;
- en += a;
-}
-
-graphic_object *object_spec::make_move(position *curpos, direction *dirp)
-{
- static position last_move;
- static int have_last_move = 0;
- *dirp = dir;
- // No need to look at at since `at' attribute sets `from' attribute.
- position startpos = (flags & HAS_FROM) ? from : *curpos;
- if (!(flags & HAS_SEGMENT)) {
- if ((flags && IS_SAME) && have_last_move)
- segment_pos = last_move;
- else {
- switch (dir) {
- case UP_DIRECTION:
- segment_pos.y = segment_height;
- break;
- case DOWN_DIRECTION:
- segment_pos.y = -segment_height;
- break;
- case LEFT_DIRECTION:
- segment_pos.x = -segment_width;
- break;
- case RIGHT_DIRECTION:
- segment_pos.x = segment_width;
- break;
- default:
- assert(0);
- }
- }
- }
- segment_list = new segment(segment_pos, segment_is_absolute, segment_list);
- // Reverse the segment_list so that it's in forward order.
- segment *old = segment_list;
- segment_list = 0;
- while (old != 0) {
- segment *tem = old->next;
- old->next = segment_list;
- segment_list = old;
- old = tem;
- }
- // Compute the end position.
- position endpos = startpos;
- for (segment *s = segment_list; s; s = s->next)
- if (s->is_absolute)
- endpos = s->pos;
- else
- endpos += s->pos;
- have_last_move = 1;
- last_move = endpos - startpos;
- move_object *p = new move_object(startpos, endpos);
- *curpos = endpos;
- return p;
-}
-
-class linear_object : public graphic_object {
-protected:
- char arrow_at_start;
- char arrow_at_end;
- arrow_head_type aht;
- position strt;
- position en;
-public:
- linear_object(const position &s, const position &e);
- position start() { return strt; }
- position end() { return en; }
- void move_by(const position &);
- void update_bounding_box(bounding_box *) = 0;
- object_type type() = 0;
- void add_arrows(int at_start, int at_end, const arrow_head_type &);
-};
-
-class line_object : public linear_object {
-protected:
- position *v;
- int n;
-public:
- line_object(const position &s, const position &e, position *, int);
- ~line_object();
- position origin() { return strt; }
- position center() { return (strt + en)/2.0; }
- position north() { return (en.y - strt.y) > 0 ? en : strt; }
- position south() { return (en.y - strt.y) < 0 ? en : strt; }
- position east() { return (en.x - strt.x) > 0 ? en : strt; }
- position west() { return (en.x - strt.x) < 0 ? en : strt; }
- object_type type() { return LINE_OBJECT; }
- void update_bounding_box(bounding_box *);
- void print();
- void move_by(const position &);
-};
-
-class arrow_object : public line_object {
-public:
- arrow_object(const position &, const position &, position *, int);
- object_type type() { return ARROW_OBJECT; }
-};
-
-class spline_object : public line_object {
-public:
- spline_object(const position &, const position &, position *, int);
- object_type type() { return SPLINE_OBJECT; }
- void print();
- void update_bounding_box(bounding_box *);
-};
-
-linear_object::linear_object(const position &s, const position &e)
-: arrow_at_start(0), arrow_at_end(0), strt(s), en(e)
-{
-}
-
-void linear_object::move_by(const position &a)
-{
- strt += a;
- en += a;
-}
-
-void linear_object::add_arrows(int at_start, int at_end,
- const arrow_head_type &a)
-{
- arrow_at_start = at_start;
- arrow_at_end = at_end;
- aht = a;
-}
-
-line_object::line_object(const position &s, const position &e,
- position *p, int i)
-: linear_object(s, e), v(p), n(i)
-{
-}
-
-void line_object::print()
-{
- if (lt.type == line_type::invisible)
- return;
- out->line(strt, v, n, lt);
- if (arrow_at_start)
- draw_arrow(strt, strt-v[0], aht, lt);
- if (arrow_at_end)
- draw_arrow(en, v[n-1] - (n > 1 ? v[n - 2] : strt), aht, lt);
-}
-
-void line_object::update_bounding_box(bounding_box *p)
-{
- p->encompass(strt);
- for (int i = 0; i < n; i++)
- p->encompass(v[i]);
-}
-
-void line_object::move_by(const position &pos)
-{
- linear_object::move_by(pos);
- for (int i = 0; i < n; i++)
- v[i] += pos;
-}
-
-void spline_object::update_bounding_box(bounding_box *p)
-{
- p->encompass(strt);
- p->encompass(en);
- /*
-
- If
-
- p1 = q1/2 + q2/2
- p2 = q1/6 + q2*5/6
- p3 = q2*5/6 + q3/6
- p4 = q2/2 + q3/2
- [ the points for the Bezier cubic ]
-
- and
-
- t = .5
-
- then
-
- (1-t)^3*p1 + 3*t*(t - 1)^2*p2 + 3*t^2*(1-t)*p3 + t^3*p4
- [ the equation for the Bezier cubic ]
-
- = .125*q1 + .75*q2 + .125*q3
-
- */
- for (int i = 1; i < n; i++)
- p->encompass((i == 1 ? strt : v[i-2])*.125 + v[i-1]*.75 + v[i]*.125);
-}
-
-arrow_object::arrow_object(const position &s, const position &e,
- position *p, int i)
-: line_object(s, e, p, i)
-{
-}
-
-spline_object::spline_object(const position &s, const position &e,
- position *p, int i)
-: line_object(s, e, p, i)
-{
-}
-
-void spline_object::print()
-{
- if (lt.type == line_type::invisible)
- return;
- out->spline(strt, v, n, lt);
- if (arrow_at_start)
- draw_arrow(strt, strt-v[0], aht, lt);
- if (arrow_at_end)
- draw_arrow(en, v[n-1] - (n > 1 ? v[n - 2] : strt), aht, lt);
-}
-
-line_object::~line_object()
-{
- a_delete v;
-}
-
-linear_object *object_spec::make_line(position *curpos, direction *dirp)
-{
- static position last_line;
- static int have_last_line = 0;
- *dirp = dir;
- // No need to look at at since `at' attribute sets `from' attribute.
- position startpos = (flags & HAS_FROM) ? from : *curpos;
- if (!(flags & HAS_SEGMENT)) {
- if ((flags & IS_SAME) && (type == LINE_OBJECT || type == ARROW_OBJECT)
- && have_last_line)
- segment_pos = last_line;
- else
- switch (dir) {
- case UP_DIRECTION:
- segment_pos.y = segment_height;
- break;
- case DOWN_DIRECTION:
- segment_pos.y = -segment_height;
- break;
- case LEFT_DIRECTION:
- segment_pos.x = -segment_width;
- break;
- case RIGHT_DIRECTION:
- segment_pos.x = segment_width;
- break;
- default:
- assert(0);
- }
- }
- segment_list = new segment(segment_pos, segment_is_absolute, segment_list);
- // reverse the segment_list so that it's in forward order
- segment *old = segment_list;
- segment_list = 0;
- while (old != 0) {
- segment *tem = old->next;
- old->next = segment_list;
- segment_list = old;
- old = tem;
- }
- // Absolutise all movements
- position endpos = startpos;
- int nsegments = 0;
- segment *s;
- for (s = segment_list; s; s = s->next, nsegments++)
- if (s->is_absolute)
- endpos = s->pos;
- else {
- endpos += s->pos;
- s->pos = endpos;
- s->is_absolute = 1; // to avoid confusion
- }
- // handle chop
- line_object *p = 0;
- position *v = new position[nsegments];
- int i = 0;
- for (s = segment_list; s; s = s->next, i++)
- v[i] = s->pos;
- if (flags & IS_DEFAULT_CHOPPED) {
- lookup_variable("circlerad", &start_chop);
- end_chop = start_chop;
- flags |= IS_CHOPPED;
- }
- if (flags & IS_CHOPPED) {
- position start_chop_vec, end_chop_vec;
- if (start_chop != 0.0) {
- start_chop_vec = v[0] - startpos;
- start_chop_vec *= start_chop / hypot(start_chop_vec);
- }
- if (end_chop != 0.0) {
- end_chop_vec = (v[nsegments - 1]
- - (nsegments > 1 ? v[nsegments - 2] : startpos));
- end_chop_vec *= end_chop / hypot(end_chop_vec);
- }
- startpos += start_chop_vec;
- v[nsegments - 1] -= end_chop_vec;
- endpos -= end_chop_vec;
- }
- switch (type) {
- case SPLINE_OBJECT:
- p = new spline_object(startpos, endpos, v, nsegments);
- break;
- case ARROW_OBJECT:
- p = new arrow_object(startpos, endpos, v, nsegments);
- break;
- case LINE_OBJECT:
- p = new line_object(startpos, endpos, v, nsegments);
- break;
- default:
- assert(0);
- }
- have_last_line = 1;
- last_line = endpos - startpos;
- *curpos = endpos;
- return p;
-}
-
-class arc_object : public linear_object {
- int clockwise;
- position cent;
- double rad;
-public:
- arc_object(int, const position &, const position &, const position &);
- position origin() { return cent; }
- position center() { return cent; }
- double radius() { return rad; }
- position north();
- position south();
- position east();
- position west();
- position north_east();
- position north_west();
- position south_east();
- position south_west();
- void update_bounding_box(bounding_box *);
- object_type type() { return ARC_OBJECT; }
- void print();
- void move_by(const position &pos);
-};
-
-arc_object::arc_object(int cw, const position &s, const position &e,
- const position &c)
-: linear_object(s, e), clockwise(cw), cent(c)
-{
- rad = hypot(c - s);
-}
-
-void arc_object::move_by(const position &pos)
-{
- linear_object::move_by(pos);
- cent += pos;
-}
-
-// we get arc corners from the corresponding circle
-
-position arc_object::north()
-{
- position result(cent);
- result.y += rad;
- return result;
-}
-
-position arc_object::south()
-{
- position result(cent);
- result.y -= rad;
- return result;
-}
-
-position arc_object::east()
-{
- position result(cent);
- result.x += rad;
- return result;
-}
-
-position arc_object::west()
-{
- position result(cent);
- result.x -= rad;
- return result;
-}
-
-position arc_object::north_east()
-{
- position result(cent);
- result.x += rad/M_SQRT2;
- result.y += rad/M_SQRT2;
- return result;
-}
-
-position arc_object::north_west()
-{
- position result(cent);
- result.x -= rad/M_SQRT2;
- result.y += rad/M_SQRT2;
- return result;
-}
-
-position arc_object::south_east()
-{
- position result(cent);
- result.x += rad/M_SQRT2;
- result.y -= rad/M_SQRT2;
- return result;
-}
-
-position arc_object::south_west()
-{
- position result(cent);
- result.x -= rad/M_SQRT2;
- result.y -= rad/M_SQRT2;
- return result;
-}
-
-
-void arc_object::print()
-{
- if (lt.type == line_type::invisible)
- return;
- if (clockwise)
- out->arc(en, cent, strt, lt);
- else
- out->arc(strt, cent, en, lt);
- if (arrow_at_start) {
- position c = cent - strt;
- draw_arrow(strt,
- (clockwise ? position(c.y, -c.x) : position(-c.y, c.x)),
- aht, lt);
- }
- if (arrow_at_end) {
- position e = en - cent;
- draw_arrow(en,
- (clockwise ? position(e.y, -e.x) : position(-e.y, e.x)),
- aht, lt);
- }
-}
-
-inline double max(double a, double b)
-{
- return a > b ? a : b;
-}
-
-void arc_object::update_bounding_box(bounding_box *p)
-{
- p->encompass(strt);
- p->encompass(en);
- position start_offset = strt - cent;
- if (start_offset.x == 0.0 && start_offset.y == 0.0)
- return;
- position end_offset = en - cent;
- if (end_offset.x == 0.0 && end_offset.y == 0.0)
- return;
- double start_quad = atan2(start_offset.y, start_offset.x)/(M_PI/2.0);
- double end_quad = atan2(end_offset.y, end_offset.x)/(M_PI/2.0);
- if (clockwise) {
- double temp = start_quad;
- start_quad = end_quad;
- end_quad = temp;
- }
- if (start_quad < 0.0)
- start_quad += 4.0;
- while (end_quad <= start_quad)
- end_quad += 4.0;
- double radius = max(hypot(start_offset), hypot(end_offset));
- for (int q = int(start_quad) + 1; q < end_quad; q++) {
- position offset;
- switch (q % 4) {
- case 0:
- offset.x = radius;
- break;
- case 1:
- offset.y = radius;
- break;
- case 2:
- offset.x = -radius;
- break;
- case 3:
- offset.y = -radius;
- break;
- }
- p->encompass(cent + offset);
- }
-}
-
-// We ignore the with attribute. The at attribute always refers to the center.
-
-linear_object *object_spec::make_arc(position *curpos, direction *dirp)
-{
- *dirp = dir;
- int cw = (flags & IS_CLOCKWISE) != 0;
- // compute the start
- position startpos;
- if (flags & HAS_FROM)
- startpos = from;
- else
- startpos = *curpos;
- if (!(flags & HAS_RADIUS))
- lookup_variable("arcrad", &radius);
- // compute the end
- position endpos;
- if (flags & HAS_TO)
- endpos = to;
- else {
- position m(radius, radius);
- // Adjust the signs.
- if (cw) {
- if (dir == DOWN_DIRECTION || dir == LEFT_DIRECTION)
- m.x = -m.x;
- if (dir == DOWN_DIRECTION || dir == RIGHT_DIRECTION)
- m.y = -m.y;
- *dirp = direction((dir + 3) % 4);
- }
- else {
- if (dir == UP_DIRECTION || dir == LEFT_DIRECTION)
- m.x = -m.x;
- if (dir == DOWN_DIRECTION || dir == LEFT_DIRECTION)
- m.y = -m.y;
- *dirp = direction((dir + 1) % 4);
- }
- endpos = startpos + m;
- }
- // compute the center
- position centerpos;
- if (flags & HAS_AT)
- centerpos = at;
- else if (startpos == endpos)
- centerpos = startpos;
- else {
- position h = (endpos - startpos)/2.0;
- double d = hypot(h);
- if (radius <= 0)
- radius = .25;
- // make the radius big enough
- while (radius < d)
- radius *= 2.0;
- double alpha = acos(d/radius);
- double theta = atan2(h.y, h.x);
- if (cw)
- theta -= alpha;
- else
- theta += alpha;
- centerpos = position(cos(theta), sin(theta))*radius + startpos;
- }
- arc_object *p = new arc_object(cw, startpos, endpos, centerpos);
- *curpos = endpos;
- return p;
-}
-
-graphic_object *object_spec::make_linear(position *curpos, direction *dirp)
-{
- linear_object *obj;
- if (type == ARC_OBJECT)
- obj = make_arc(curpos, dirp);
- else
- obj = make_line(curpos, dirp);
- if (type == ARROW_OBJECT
- && (flags & (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD)) == 0)
- flags |= HAS_RIGHT_ARROW_HEAD;
- if (obj && (flags & (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD))) {
- arrow_head_type a;
- int at_start = (flags & HAS_LEFT_ARROW_HEAD) != 0;
- int at_end = (flags & HAS_RIGHT_ARROW_HEAD) != 0;
- if (flags & HAS_HEIGHT)
- a.height = height;
- else
- lookup_variable("arrowht", &a.height);
- if (flags & HAS_WIDTH)
- a.width = width;
- else
- lookup_variable("arrowwid", &a.width);
- double solid;
- lookup_variable("arrowhead", &solid);
- a.solid = solid != 0.0;
- obj->add_arrows(at_start, at_end, a);
- }
- return obj;
-}
-
-object *object_spec::make_object(position *curpos, direction *dirp)
-{
- graphic_object *obj = 0;
- switch (type) {
- case BLOCK_OBJECT:
- obj = make_block(curpos, dirp);
- break;
- case BOX_OBJECT:
- obj = make_box(curpos, dirp);
- break;
- case TEXT_OBJECT:
- obj = make_text(curpos, dirp);
- break;
- case ELLIPSE_OBJECT:
- obj = make_ellipse(curpos, dirp);
- break;
- case CIRCLE_OBJECT:
- obj = make_circle(curpos, dirp);
- break;
- case MOVE_OBJECT:
- obj = make_move(curpos, dirp);
- break;
- case ARC_OBJECT:
- case LINE_OBJECT:
- case SPLINE_OBJECT:
- case ARROW_OBJECT:
- obj = make_linear(curpos, dirp);
- break;
- case MARK_OBJECT:
- case OTHER_OBJECT:
- default:
- assert(0);
- break;
- }
- if (obj) {
- if (flags & IS_INVISIBLE)
- obj->set_invisible();
- if (text != 0)
- obj->add_text(text, (flags & IS_ALIGNED) != 0);
- if (flags & IS_DOTTED)
- obj->set_dotted(dash_width);
- else if (flags & IS_DASHED)
- obj->set_dashed(dash_width);
- double th;
- if (flags & HAS_THICKNESS)
- th = thickness;
- else
- lookup_variable("linethick", &th);
- obj->set_thickness(th);
- if (flags & (IS_DEFAULT_FILLED|IS_FILLED)) {
- if (flags & IS_DEFAULT_FILLED)
- lookup_variable("fillval", &fill);
- if (fill < 0.0)
- error("bad fill value %1", fill);
- else
- obj->set_fill(fill);
- }
- }
- return obj;
-}
-
-struct string_list {
- string_list *next;
- char *str;
- string_list(char *);
- ~string_list();
-};
-
-string_list::string_list(char *s)
-: next(0), str(s)
-{
-}
-
-string_list::~string_list()
-{
- a_delete str;
-}
-
-/* A path is used to hold the argument to the with attribute. For example,
-`.nw' or `.A.s' or `.A'. The major operation on a path is to take a
-place and follow the path through the place to place within the place.
-Note that `.A.B.C.sw' will work. */
-
-path::path(corner c)
-: crn(c), label_list(0), ypath(0)
-{
-}
-
-path::path(char *l, corner c)
-: crn(c), ypath(0)
-{
- label_list = new string_list(l);
-}
-
-path::~path()
-{
- while (label_list) {
- string_list *tem = label_list;
- label_list = label_list->next;
- delete tem;
- }
- delete ypath;
-}
-
-void path::append(corner c)
-{
- assert(crn == 0);
- crn = c;
-}
-
-void path::append(char *s)
-{
- string_list **p;
- for (p = &label_list; *p; p = &(*p)->next)
- ;
- *p = new string_list(s);
-}
-
-void path::set_ypath(path *p)
-{
- ypath = p;
-}
-
-// return non-zero for success
-
-int path::follow(const place &pl, place *result) const
-{
- const place *p = &pl;
- for (string_list *lb = label_list; lb; lb = lb->next)
- if (p->obj == 0 || (p = p->obj->find_label(lb->str)) == 0) {
- lex_error("object does not contain a place `%1'", lb->str);
- return 0;
- }
- if (crn == 0 || p->obj == 0)
- *result = *p;
- else {
- position pos = ((p->obj)->*(crn))();
- result->x = pos.x;
- result->y = pos.y;
- result->obj = 0;
- }
- if (ypath) {
- place tem;
- if (!ypath->follow(pl, &tem))
- return 0;
- result->y = tem.y;
- if (result->obj != tem.obj)
- result->obj = 0;
- }
- return 1;
-}
-
-void print_object_list(object *p)
-{
- for (; p; p = p->next) {
- p->print();
- p->print_text();
- }
-}
-
-void print_picture(object *obj)
-{
- bounding_box bb;
- for (object *p = obj; p; p = p->next)
- p->update_bounding_box(&bb);
- double scale;
- lookup_variable("scale", &scale);
- out->start_picture(scale, bb.ll, bb.ur);
- print_object_list(obj);
- out->finish_picture();
-}
-
diff --git a/contrib/groff/pic/object.h b/contrib/groff/pic/object.h
deleted file mode 100644
index 2748e81e8465..000000000000
--- a/contrib/groff/pic/object.h
+++ /dev/null
@@ -1,217 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-struct place;
-
-enum object_type {
- OTHER_OBJECT,
- BOX_OBJECT,
- CIRCLE_OBJECT,
- ELLIPSE_OBJECT,
- ARC_OBJECT,
- SPLINE_OBJECT,
- LINE_OBJECT,
- ARROW_OBJECT,
- MOVE_OBJECT,
- TEXT_OBJECT,
- BLOCK_OBJECT,
- MARK_OBJECT
- };
-
-struct bounding_box;
-
-struct object {
- object *prev;
- object *next;
- object();
- virtual ~object();
- virtual position origin();
- virtual double width();
- virtual double radius();
- virtual double height();
- virtual position north();
- virtual position south();
- virtual position east();
- virtual position west();
- virtual position north_east();
- virtual position north_west();
- virtual position south_east();
- virtual position south_west();
- virtual position start();
- virtual position end();
- virtual position center();
- virtual place *find_label(const char *);
- virtual void move_by(const position &);
- virtual int blank();
- virtual void update_bounding_box(bounding_box *);
- virtual object_type type() = 0;
- virtual void print();
- virtual void print_text();
-};
-
-typedef position (object::*corner)();
-
-struct place {
- object *obj;
- double x, y;
-};
-
-struct string_list;
-
-class path {
- corner crn;
- string_list *label_list;
- path *ypath;
-public:
- path(corner = 0);
- path(char *, corner = 0);
- ~path();
- void append(corner);
- void append(char *);
- void set_ypath(path *);
- int follow(const place &, place *) const;
-};
-
-struct object_list {
- object *head;
- object *tail;
- object_list();
- void append(object *);
- void wrap_up_block(object_list *);
-};
-
-declare_ptable(place)
-
-// these go counterclockwise
-enum direction {
- RIGHT_DIRECTION,
- UP_DIRECTION,
- LEFT_DIRECTION,
- DOWN_DIRECTION
- };
-
-struct graphics_state {
- double x, y;
- direction dir;
-};
-
-struct saved_state : public graphics_state {
- saved_state *prev;
- PTABLE(place) *tbl;
-};
-
-
-struct text_item {
- text_item *next;
- char *text;
- adjustment adj;
- const char *filename;
- int lineno;
-
- text_item(char *, const char *, int);
- ~text_item();
-};
-
-const unsigned long IS_DOTTED = 01;
-const unsigned long IS_DASHED = 02;
-const unsigned long IS_CLOCKWISE = 04;
-const unsigned long IS_INVISIBLE = 020;
-const unsigned long HAS_LEFT_ARROW_HEAD = 040;
-const unsigned long HAS_RIGHT_ARROW_HEAD = 0100;
-const unsigned long HAS_SEGMENT = 0200;
-const unsigned long IS_SAME = 0400;
-const unsigned long HAS_FROM = 01000;
-const unsigned long HAS_AT = 02000;
-const unsigned long HAS_WITH = 04000;
-const unsigned long HAS_HEIGHT = 010000;
-const unsigned long HAS_WIDTH = 020000;
-const unsigned long HAS_RADIUS = 040000;
-const unsigned long HAS_TO = 0100000;
-const unsigned long IS_CHOPPED = 0200000;
-const unsigned long IS_DEFAULT_CHOPPED = 0400000;
-const unsigned long HAS_THICKNESS = 01000000;
-const unsigned long IS_FILLED = 02000000;
-const unsigned long IS_DEFAULT_FILLED = 04000000;
-const unsigned long IS_ALIGNED = 010000000;
-
-struct segment {
- int is_absolute;
- position pos;
- segment *next;
- segment(const position &, int, segment *);
-};
-
-struct rectangle_object;
-struct graphic_object;
-struct linear_object;
-
-struct object_spec {
- unsigned long flags;
- object_type type;
- object_list oblist;
- PTABLE(place) *tbl;
- double dash_width;
- position from;
- position to;
- position at;
- position by;
- path *with;
- text_item *text;
- double height;
- double radius;
- double width;
- double segment_width;
- double segment_height;
- double start_chop;
- double end_chop;
- double thickness;
- double fill;
- direction dir;
- segment *segment_list;
- position segment_pos;
- int segment_is_absolute;
-
- object_spec(object_type);
- ~object_spec();
- object *make_object(position *, direction *);
- graphic_object *make_box(position *, direction *);
- graphic_object *make_block(position *, direction *);
- graphic_object *make_text(position *, direction *);
- graphic_object *make_ellipse(position *, direction *);
- graphic_object *make_circle(position *, direction *);
- linear_object *make_line(position *, direction *);
- linear_object *make_arc(position *, direction *);
- graphic_object *make_linear(position *, direction *);
- graphic_object *make_move(position *, direction *);
- int position_rectangle(rectangle_object *p, position *curpos,
- direction *dirp);
-};
-
-
-object *make_object(object_spec *, position *, direction *);
-
-object *make_mark_object();
-object *make_command_object(char *, const char *, int);
-
-int lookup_variable(const char *name, double *val);
-void define_variable(const char *name, double val);
-
-void print_picture(object *);
-
diff --git a/contrib/groff/pic/output.h b/contrib/groff/pic/output.h
deleted file mode 100644
index ac490db463e3..000000000000
--- a/contrib/groff/pic/output.h
+++ /dev/null
@@ -1,79 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-struct line_type {
- enum { invisible, solid, dotted, dashed } type;
- double dash_width;
- double thickness; // the thickness is in points
-
- line_type();
-};
-
-
-class output {
-protected:
- char *args;
- double desired_height; // zero if no height specified
- double desired_width; // zero if no depth specified
- double compute_scale(double, const position &, const position &);
-public:
- output();
- virtual ~output();
- void set_desired_width_height(double wid, double ht);
- void set_args(const char *);
- virtual void start_picture(double sc, const position &ll, const position &ur) = 0;
- virtual void finish_picture() = 0;
- virtual void circle(const position &, double rad,
- const line_type &, double) = 0;
- virtual void text(const position &, text_piece *, int, double) = 0;
- virtual void line(const position &, const position *, int n,
- const line_type &) = 0;
- virtual void polygon(const position *, int n,
- const line_type &, double) = 0;
- virtual void spline(const position &, const position *, int n,
- const line_type &) = 0;
- virtual void arc(const position &, const position &, const position &,
- const line_type &) = 0;
- virtual void ellipse(const position &, const distance &,
- const line_type &, double) = 0;
- virtual void rounded_box(const position &, const distance &, double,
- const line_type &, double) = 0;
- virtual void command(const char *, const char *, int);
- virtual void set_location(const char *, int);
- virtual int supports_filled_polygons();
- virtual void begin_block(const position &ll, const position &ur);
- virtual void end_block();
-};
-
-extern output *out;
-
-/* #define FIG_SUPPORT 1 */
-#define TEX_SUPPORT 1
-
-output *make_troff_output();
-
-#ifdef TEX_SUPPORT
-output *make_tex_output();
-output *make_tpic_output();
-#endif /* TEX_SUPPORT */
-
-#ifdef FIG_SUPPORT
-output *make_fig_output();
-#endif /* FIG_SUPPORT */
diff --git a/contrib/groff/pic/pic.cc b/contrib/groff/pic/pic.cc
deleted file mode 100644
index 1130fdce5add..000000000000
--- a/contrib/groff/pic/pic.cc
+++ /dev/null
@@ -1,5224 +0,0 @@
-#ifndef lint
-/*static char yysccsid[] = "from: @(#)yaccpar 1.9 (Berkeley) 02/21/93";*/
-static char yyrcsid[] = "$Id: pic.cc,v 1.2 2000/05/31 14:18:50 wlemb Exp $";
-#endif
-#define YYBYACC 1
-#define YYMAJOR 1
-#define YYMINOR 9
-#define yyclearin (yychar=(-1))
-#define yyerrok (yyerrflag=0)
-#define YYRECOVERING (yyerrflag!=0)
-#define YYPREFIX "yy"
-#line 20 "/home/cjk/groff/pic/pic.y"
-#include "pic.h"
-#include "ptable.h"
-#include "object.h"
-
-extern int delim_flag;
-extern void do_copy(const char *);
-extern void copy_rest_thru(const char *, const char *);
-extern void copy_file_thru(const char *, const char *, const char *);
-extern void push_body(const char *);
-extern void do_for(char *var, double from, double to,
- int by_is_multiplicative, double by, char *body);
-extern void do_lookahead();
-
-#ifndef HAVE_FMOD
-extern "C" {
- double fmod(double, double);
-}
-#endif
-
-#undef rand
-#undef srand
-extern "C" {
- int rand();
-#ifdef RET_TYPE_SRAND_IS_VOID
- void srand(unsigned int);
-#else
- int srand(unsigned int);
-#endif
-}
-
-/* Maximum number of characters produced by printf("%g") */
-#define GDIGITS 14
-
-int yylex();
-void yyerror(const char *);
-
-void reset(const char *nm);
-void reset_all();
-
-place *lookup_label(const char *);
-void define_label(const char *label, const place *pl);
-
-direction current_direction;
-position current_position;
-
-implement_ptable(place)
-
-PTABLE(place) top_table;
-
-PTABLE(place) *current_table = &top_table;
-saved_state *current_saved_state = 0;
-
-object_list olist;
-
-const char *ordinal_postfix(int n);
-const char *object_type_name(object_type type);
-char *format_number(const char *form, double n);
-char *do_sprintf(const char *form, const double *v, int nv);
-
-#line 78 "/home/cjk/groff/pic/pic.y"
-typedef union {
- char *str;
- int n;
- double x;
- struct { double x, y; } pair;
- struct { double x; char *body; } if_data;
- struct { char *str; const char *filename; int lineno; } lstr;
- struct { double *v; int nv; int maxv; } dv;
- struct { double val; int is_multiplicative; } by;
- place pl;
- object *obj;
- corner crn;
- path *pth;
- object_spec *spec;
- saved_state *pstate;
- graphics_state state;
- object_type obtype;
-} YYSTYPE;
-#line 88 "y.tab.c"
-#define LABEL 257
-#define VARIABLE 258
-#define NUMBER 259
-#define TEXT 260
-#define COMMAND_LINE 261
-#define DELIMITED 262
-#define ORDINAL 263
-#define TH 264
-#define LEFT_ARROW_HEAD 265
-#define RIGHT_ARROW_HEAD 266
-#define DOUBLE_ARROW_HEAD 267
-#define LAST 268
-#define UP 269
-#define DOWN 270
-#define LEFT 271
-#define RIGHT 272
-#define BOX 273
-#define CIRCLE 274
-#define ELLIPSE 275
-#define ARC 276
-#define LINE 277
-#define ARROW 278
-#define MOVE 279
-#define SPLINE 280
-#define HEIGHT 281
-#define RADIUS 282
-#define WIDTH 283
-#define DIAMETER 284
-#define FROM 285
-#define TO 286
-#define AT 287
-#define WITH 288
-#define BY 289
-#define THEN 290
-#define DOTTED 291
-#define DASHED 292
-#define CHOP 293
-#define SAME 294
-#define INVISIBLE 295
-#define LJUST 296
-#define RJUST 297
-#define ABOVE 298
-#define BELOW 299
-#define OF 300
-#define THE 301
-#define WAY 302
-#define BETWEEN 303
-#define AND 304
-#define HERE 305
-#define DOT_N 306
-#define DOT_E 307
-#define DOT_W 308
-#define DOT_S 309
-#define DOT_NE 310
-#define DOT_SE 311
-#define DOT_NW 312
-#define DOT_SW 313
-#define DOT_C 314
-#define DOT_START 315
-#define DOT_END 316
-#define DOT_X 317
-#define DOT_Y 318
-#define DOT_HT 319
-#define DOT_WID 320
-#define DOT_RAD 321
-#define SIN 322
-#define COS 323
-#define ATAN2 324
-#define LOG 325
-#define EXP 326
-#define SQRT 327
-#define K_MAX 328
-#define K_MIN 329
-#define INT 330
-#define RAND 331
-#define SRAND 332
-#define COPY 333
-#define THRU 334
-#define TOP 335
-#define BOTTOM 336
-#define UPPER 337
-#define LOWER 338
-#define SH 339
-#define PRINT 340
-#define CW 341
-#define CCW 342
-#define FOR 343
-#define DO 344
-#define IF 345
-#define ELSE 346
-#define ANDAND 347
-#define OROR 348
-#define NOTEQUAL 349
-#define EQUALEQUAL 350
-#define LESSEQUAL 351
-#define GREATEREQUAL 352
-#define LEFT_CORNER 353
-#define RIGHT_CORNER 354
-#define CENTER 355
-#define END 356
-#define START 357
-#define RESET 358
-#define UNTIL 359
-#define PLOT 360
-#define THICKNESS 361
-#define FILL 362
-#define ALIGNED 363
-#define SPRINTF 364
-#define COMMAND 365
-#define DEFINE 366
-#define UNDEF 367
-#define YYERRCODE 256
-short yylhs[] = { -1,
- 0, 0, 16, 17, 17, 28, 28, 29, 29, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 31, 30,
- 30, 32, 33, 30, 34, 35, 30, 36, 30, 30,
- 37, 30, 30, 30, 38, 38, 38, 26, 26, 27,
- 27, 27, 39, 7, 23, 23, 2, 2, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
- 15, 15, 15, 15, 40, 42, 15, 15, 41, 41,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 43, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 25, 25, 24, 24, 19, 19,
- 6, 6, 6, 6, 6, 6, 44, 44, 5, 5,
- 13, 13, 13, 13, 13, 14, 14, 14, 22, 22,
- 21, 21, 8, 8, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 11, 11, 12, 12, 12, 10, 10,
- 10, 10, 10, 10, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
-};
-short yylen[] = { 2,
- 1, 1, 3, 1, 3, 0, 1, 1, 2, 3,
- 4, 1, 1, 1, 1, 1, 2, 2, 0, 3,
- 2, 0, 0, 7, 0, 0, 6, 0, 10, 1,
- 0, 4, 1, 1, 2, 2, 3, 1, 2, 1,
- 1, 1, 0, 5, 0, 2, 1, 1, 3, 3,
- 3, 3, 3, 3, 3, 3, 2, 0, 2, 3,
- 1, 4, 4, 4, 0, 0, 6, 1, 0, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 3, 0, 4, 3, 3, 3, 3, 2, 2, 3,
- 2, 3, 2, 3, 2, 3, 3, 3, 3, 3,
- 3, 2, 2, 3, 2, 3, 2, 3, 2, 3,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 3, 2, 1, 5, 0, 3, 1, 1,
- 1, 3, 3, 5, 5, 6, 1, 4, 3, 3,
- 1, 2, 2, 3, 1, 1, 1, 3, 1, 3,
- 1, 2, 2, 2, 1, 1, 1, 1, 1, 1,
- 1, 2, 1, 2, 3, 1, 1, 2, 1, 5,
- 4, 3, 3, 2, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
- 2, 2, 2, 1, 1, 2, 2, 2, 2, 1,
- 1, 1, 1, 1, 2, 2, 2, 2, 2, 3,
- 3, 3, 3, 3, 3, 2, 3, 4, 4, 6,
- 4, 4, 4, 6, 6, 4, 4, 3, 4, 3,
- 3, 3, 3, 3, 3, 3, 3, 2,
-};
-short yydefred[] = { 0,
- 8, 0, 2, 0, 0, 0, 0, 125, 16, 12,
- 13, 14, 15, 71, 72, 73, 74, 75, 76, 77,
- 78, 0, 19, 0, 0, 0, 0, 0, 0, 0,
- 65, 82, 0, 4, 0, 0, 79, 68, 0, 9,
- 0, 0, 0, 0, 25, 0, 146, 203, 204, 149,
- 151, 188, 189, 145, 175, 176, 177, 178, 179, 180,
- 181, 182, 183, 184, 185, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 186, 187, 0, 0,
- 194, 195, 200, 202, 201, 0, 0, 0, 0, 0,
- 131, 129, 147, 0, 0, 0, 0, 0, 0, 41,
- 0, 38, 0, 0, 0, 0, 0, 0, 0, 0,
- 35, 0, 0, 0, 0, 0, 31, 3, 0, 113,
- 114, 115, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 102, 0, 0, 0, 111,
- 112, 119, 120, 121, 122, 116, 117, 0, 0, 124,
- 0, 118, 36, 0, 0, 10, 0, 22, 0, 20,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 190, 192, 196, 198, 191, 193, 197, 199, 0,
- 0, 0, 0, 0, 0, 0, 0, 137, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 205, 206, 207, 208,
- 209, 0, 142, 0, 0, 163, 155, 156, 157, 158,
- 159, 160, 161, 0, 154, 152, 153, 39, 0, 0,
- 57, 0, 0, 0, 43, 0, 0, 0, 0, 81,
- 127, 0, 0, 0, 0, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 166, 100, 0, 169, 0, 0, 101,
- 0, 0, 0, 0, 0, 37, 0, 0, 0, 0,
- 0, 0, 62, 0, 11, 0, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 228, 0, 0, 217,
- 140, 0, 150, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 148, 132, 133, 162, 0, 0, 53, 0,
- 0, 0, 0, 0, 51, 0, 0, 50, 49, 0,
- 66, 83, 32, 174, 0, 0, 0, 0, 164, 0,
- 168, 0, 0, 23, 0, 218, 219, 0, 221, 222,
- 223, 0, 0, 226, 227, 229, 0, 0, 0, 0,
- 0, 44, 0, 126, 0, 0, 173, 172, 0, 165,
- 0, 0, 27, 0, 0, 0, 134, 138, 0, 0,
- 0, 0, 70, 67, 171, 0, 24, 46, 220, 224,
- 225, 136, 0, 0, 170, 0, 0, 28, 0, 0,
- 29,
-};
-short yydgoto[] = { 2,
- 106, 181, 108, 404, 91, 92, 33, 93, 94, 265,
- 266, 267, 109, 96, 34, 3, 35, 36, 97, 225,
- 98, 99, 383, 340, 110, 101, 102, 243, 5, 38,
- 46, 286, 381, 159, 355, 410, 245, 39, 333, 115,
- 394, 375, 116, 204,
-};
-short yysindex[] = { -44,
- 0, 0, 0,11792, -40, -37, -14, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, -246, 0,10742, -229,10874, -218,11317, 6,10742,
- 0, 0, -296, 0, -44,10435, 0, 0, -39, 0,
- -44,10874, 13, -280, 0, -195, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 45, 47, 54, 76, 87,
- 92, 109, 120, 142, 146, 158, 0, 0, -262, -219,
- 0, 0, 0, 0, 0,10985,10874,11317,11317, 350,
- 0, 0, 0, -76, -162, 1981, 18, -35, 734, 0,
-10742, 0, 139,10874,10874, 1064, -153, -269, -162, -156,
- 0, 623, -59,10742, -44, -44, 0, 0,11764, 0,
- 0, 0,11649,11649,11649,11649,11317,11317,11317,11317,
-11428,11428,11428, 1994,11538, 0,11649,11649,11649, 0,
- 0, 0, 0, 0, 0, 0, 0,11317,11649, 0,
- 1477, 0, 0, -55,10076, 0,10874, 0, -48, 0,
-10874,10874,10874,10874,10874,10874,10874,10874,10874,10574,
-10874, 0, 0, 0, 0, 0, 0, 0, 0, 1517,
- 166, 174, 97, -46, 127, 127, -79, 0,11317,11317,
-11317,11317,11317,11317,11317,11428,11317,11317,11317,11317,
-11317,11317,11317,11428, -7, 180, 0, 0, 0, 0,
- 0, -29, 0,11538,11538, 0, 0, 0, 0, 0,
- 0, 0, 0, 136, 0, 0, 0, 0,11317, 127,
- 0,10874,10874,11317, 0,10874,10874, -252, -252, 0,
- 0, 106,11792, 141, -26, 0, 1477, 1477, 1477, 1477,
- 1477, 1477, 1477, 1477, 350, 18, 18, 18, 1649, 1192,
- -35, 1649, -8, 0, 0, 1661, 0,11095, 266, 0,
- 1477, 1477, 1477, 1477, 1477, 0, -37, -14, 0, 0,
- 0, -162, 0, 18, 0, -16, 0, 210, 212, 211,
- 216, 218, 228, 232, 233, 231, 0, 238, 239, 0,
- 0,11428, 0, -15, 1414, 1484, 595, 595, 507, 507,
- 1477, 190, 251, 507, -19, -19, 127, 127, 127, 127,
- -42, 180, 0, 0, 0, 0, -11, 1414, 0, 1505,
- -57, 507, 30, 1414, 0, 1505, -57, 0, 0, 28,
- 0, 0, 0, 0, -35, 1649, 1649, 254, 0, 43,
- 0, 634, 174, 0, -52, 0, 0,10874, 0, 0,
- 0,10874,10874, 0, 0, 0, 14, -1,11428,11428,
-11317, 0,11317, 0,11792, 1649, 0, 0, 1649, 0,
- -52, 52, 0, 273, 274, 280, 0, 0, -21, 18,
- 1075, 1477, 0, 0, 0, 281, 0, 0, 0, 0,
- 0, 0,11207, -20, 0,11317, 1477, 0, 1477, 71,
- 0,
-};
-short yyrindex[] = { 202,
- 0, 0, 0, 332, 93, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 25, 0, 0, 0,
- 0, 0, 58, 0, 161, 60, 0, 0, 70, 0,
-10326, 0, 0, 204, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 8870,
- 0, 0, 0, 0, 4424, 8570, 8999, 0, 0, 0,
- 376, 0, 0, 0, 0, 1390, 0, 2313, 0, 0,
- 0, 9969, 0, 465,11903,11903, 0, 0, 206, 0,
- 0, 0, 9151, 9360, 9110, 9239, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 9460, 9545, 9669, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 9786, 0,
- 4973, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 293,
- 0, 261, 0, 0, 455, 563, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 3101, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 223,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5273, 5381, 5681, 5789,
- 6089, 6197, 6497, 6605, 0, 6905, 7013, 7313, 0, 0,
- 0, 0, 0, 0, 0, 8656, 0, 0, 0, 0,
- 7421, 7721, 7829, 8129, 8237, 0, 9547, 2399, 2602, 3043,
- 37, 411, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 3983, 4091, 3209, 3542, 2219, 2327,
- 4865, 8699, 0, 2660, 1778, 1886, 896, 1004, 1337, 1445,
- 0, 3650, 0, 0, 0, 0, 0, 27, 0, 230,
- 466, 2768, 0, 95, 0, 908, 1015, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 293, 0, 0, 468, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 484, 0, 0, 0, 0, 0,
- 468, 0, 0, 0, 0, 0, 0, 0, 0, 4532,
- -9, 32, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 33, 0, 34, 0,
- 0,
-};
-short yygindex[] = { 0,
- -24, 919, -89, 0, -69, 188, 0, 0, 768, 0,
- 0, 327, 187, -83, -117, -18, 0, 0, 2276, -64,
- 0, 0, -23, 0, 9, 314, -71, 7, 322, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,
-};
-#define YYTABLESIZE 12268
-short yytable[] = { 90,
- 214, 246, 215, 112, 154, 90, 4, 8, 172, 173,
- 206, 151, 37, 44, 1, 231, 182, 202, 40, 87,
- 41, 214, 200, 215, 34, 202, 236, 201, 103, 228,
- 200, 198, 100, 199, 227, 201, 63, 283, 100, 111,
- 402, 118, 228, 43, 152, 113, 42, 155, 234, 117,
- 197, 176, 177, 158, 387, 224, 214, 30, 215, 61,
- 214, 180, 215, 185, 186, 270, 160, 236, 374, 33,
- 236, 373, 128, 157, 203, 128, 90, 236, 237, 129,
- 230, 129, 203, 34, 161, 236, 162, 45, 87, 90,
- 174, 175, 7, 163, 52, 63, 242, 244, 247, 248,
- 249, 250, 251, 252, 253, 254, 255, 255, 255, 100,
- 269, 29, 271, 272, 273, 164, 30, 34, 61, 236,
- 240, 322, 100, 274, 275, 7, 165, 37, 33, 63,
- 255, 166, 7, 178, 179, 52, 235, 7, 52, 214,
- 302, 215, 329, 331, 324, 325, 335, 337, 167, 34,
- 30, 236, 61, 52, 207, 208, 209, 210, 211, 168,
- 6, 63, 33, 37, 305, 306, 307, 308, 309, 310,
- 311, 312, 314, 315, 316, 317, 318, 319, 320, 255,
- 47, 169, 30, 7, 61, 170, 50, 52, 7, 269,
- 269, 51, 238, 239, 33, 346, 347, 171, 353, 229,
- 241, 6, 276, 21, 327, 7, 300, 328, 330, 332,
- 95, 334, 336, 287, 301, 7, 95, 303, 153, 52,
- 203, 304, 238, 205, 216, 212, 202, 323, 326, 237,
- 341, 200, 198, 342, 199, 343, 201, 217, 218, 219,
- 220, 221, 222, 352, 223, 354, 338, 339, 349, 47,
- 356, 37, 357, 6, 358, 50, 359, 393, 360, 238,
- 51, 370, 21, 238, 238, 238, 238, 238, 361, 238,
- 237, 364, 95, 237, 371, 362, 363, 255, 365, 366,
- 376, 238, 238, 203, 238, 6, 368, 95, 237, 236,
- 236, 372, 6, 214, 369, 215, 21, 379, 7, 380,
- 95, 388, 202, 131, 131, 131, 382, 200, 198, 195,
- 199, 398, 201, 399, 400, 238, 236, 95, 95, 95,
- 401, 405, 237, 408, 6, 234, 236, 197, 21, 236,
- 7, 1, 411, 47, 58, 189, 190, 191, 192, 193,
- 194, 282, 281, 114, 255, 255, 391, 238, 392, 7,
- 7, 7, 7, 7, 237, 7, 119, 397, 52, 203,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 236, 236, 18, 59, 60, 407, 0,
- 0, 409, 95, 37, 52, 0, 202, 0, 0, 0,
- 95, 200, 198, 195, 199, 0, 201, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 196,
- 64, 197, 0, 0, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 0, 7, 7, 7,
- 7, 7, 7, 0, 18, 7, 0, 7, 0, 0,
- 0, 52, 52, 203, 0, 7, 7, 7, 7, 7,
- 7, 0, 7, 130, 216, 130, 7, 7, 6, 6,
- 0, 6, 6, 0, 17, 56, 0, 45, 18, 64,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 0, 69, 0, 0, 238, 216, 95, 187,
- 0, 216, 188, 237, 216, 216, 216, 216, 216, 216,
- 18, 216, 0, 64, 0, 0, 56, 0, 0, 56,
- 0, 0, 238, 216, 216, 0, 216, 0, 0, 237,
- 0, 0, 238, 17, 56, 238, 45, 0, 0, 237,
- 0, 0, 237, 0, 6, 64, 0, 0, 0, 0,
- 6, 6, 69, 202, 6, 0, 6, 216, 200, 198,
- 216, 199, 0, 201, 0, 95, 95, 17, 56, 6,
- 45, 6, 238, 0, 0, 6, 6, 0, 0, 238,
- 238, 238, 238, 238, 238, 0, 69, 237, 0, 216,
- 0, 0, 0, 0, 0, 344, 0, 0, 348, 17,
- 56, 0, 45, 0, 0, 238, 0, 0, 0, 238,
- 203, 0, 238, 238, 238, 238, 238, 238, 69, 238,
- 0, 0, 189, 190, 191, 192, 193, 194, 0, 0,
- 0, 238, 238, 0, 238, 0, 0, 0, 0, 0,
- 0, 202, 0, 0, 0, 0, 200, 198, 0, 199,
- 0, 201, 0, 0, 0, 0, 0, 0, 0, 187,
- 0, 0, 188, 0, 234, 238, 197, 0, 238, 202,
- 0, 0, 0, 0, 200, 198, 0, 199, 0, 201,
- 202, 0, 377, 378, 0, 200, 198, 195, 199, 0,
- 201, 0, 234, 0, 197, 0, 0, 238, 203, 0,
- 0, 0, 0, 234, 0, 197, 189, 190, 191, 192,
- 193, 194, 395, 0, 0, 396, 0, 0, 0, 0,
- 0, 216, 216, 216, 216, 0, 203, 216, 216, 216,
- 216, 216, 216, 216, 216, 216, 216, 203, 0, 56,
- 0, 0, 0, 0, 0, 216, 216, 216, 216, 216,
- 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
- 216, 216, 216, 216, 216, 56, 0, 216, 216, 216,
- 216, 216, 216, 216, 216, 216, 216, 216, 216, 216,
- 216, 0, 0, 0, 0, 0, 216, 216, 216, 216,
- 216, 216, 216, 216, 216, 216, 216, 0, 0, 216,
- 216, 216, 216, 0, 0, 216, 216, 0, 216, 0,
- 0, 216, 216, 216, 216, 216, 216, 216, 216, 216,
- 216, 216, 0, 56, 0, 216, 216, 216, 216, 238,
- 238, 238, 238, 0, 224, 238, 238, 238, 238, 238,
- 238, 238, 238, 238, 238, 0, 0, 0, 0, 0,
- 0, 0, 0, 238, 238, 238, 238, 238, 238, 238,
- 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
- 238, 238, 238, 213, 0, 238, 238, 238, 238, 238,
- 238, 238, 238, 238, 238, 238, 238, 238, 238, 0,
- 0, 0, 8, 0, 238, 238, 238, 238, 238, 238,
- 238, 238, 238, 238, 238, 212, 0, 238, 238, 238,
- 238, 264, 0, 238, 238, 0, 238, 55, 0, 238,
- 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
- 0, 0, 0, 238, 238, 238, 238, 0, 212, 0,
- 0, 0, 212, 0, 0, 212, 212, 212, 212, 212,
- 212, 0, 212, 0, 107, 193, 194, 0, 55, 0,
- 0, 55, 0, 0, 212, 212, 0, 212, 0, 0,
- 156, 0, 0, 0, 0, 0, 55, 0, 0, 189,
- 190, 191, 192, 193, 194, 0, 0, 0, 0, 0,
- 232, 233, 191, 192, 193, 194, 29, 0, 212, 0,
- 0, 212, 0, 216, 0, 0, 0, 0, 0, 0,
- 55, 226, 0, 213, 0, 184, 217, 218, 219, 220,
- 221, 222, 0, 223, 54, 0, 0, 0, 0, 0,
- 212, 0, 0, 0, 0, 0, 264, 0, 0, 264,
- 0, 0, 55, 351, 0, 0, 213, 0, 0, 0,
- 213, 0, 0, 213, 213, 213, 213, 213, 213, 0,
- 213, 0, 0, 0, 0, 54, 0, 0, 54, 0,
- 0, 0, 213, 213, 0, 213, 0, 0, 0, 0,
- 0, 0, 0, 54, 0, 285, 0, 0, 0, 288,
- 289, 290, 291, 292, 293, 294, 295, 296, 298, 299,
- 0, 0, 0, 0, 0, 0, 213, 0, 0, 213,
- 202, 0, 0, 0, 0, 200, 198, 54, 199, 0,
- 201, 202, 0, 264, 264, 0, 200, 198, 0, 199,
- 0, 201, 0, 234, 0, 197, 0, 0, 213, 0,
- 0, 0, 0, 0, 234, 0, 197, 0, 0, 54,
- 0, 0, 0, 264, 0, 0, 264, 0, 0, 0,
- 0, 0, 212, 212, 212, 212, 0, 203, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 203, 0,
- 0, 55, 0, 0, 0, 0, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 0, 55, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 0, 0, 0, 0, 0, 212, 212, 212,
- 212, 212, 212, 212, 212, 212, 212, 212, 0, 0,
- 212, 212, 212, 212, 0, 0, 212, 212, 0, 212,
- 0, 0, 212, 212, 212, 212, 212, 212, 212, 212,
- 212, 212, 212, 0, 0, 55, 212, 212, 212, 212,
- 213, 213, 213, 213, 0, 0, 213, 213, 213, 213,
- 213, 213, 213, 213, 213, 213, 384, 0, 54, 0,
- 385, 386, 224, 0, 213, 213, 213, 213, 213, 213,
- 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
- 213, 213, 213, 213, 54, 0, 213, 213, 213, 213,
- 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
- 0, 0, 0, 0, 0, 213, 213, 213, 213, 213,
- 213, 213, 213, 213, 213, 213, 214, 0, 213, 213,
- 213, 213, 0, 0, 213, 213, 0, 213, 0, 0,
- 213, 213, 213, 213, 213, 213, 213, 213, 213, 213,
- 213, 0, 54, 403, 213, 213, 213, 213, 0, 214,
- 0, 0, 0, 214, 0, 0, 214, 214, 214, 214,
- 214, 214, 0, 214, 0, 0, 0, 0, 0, 47,
- 0, 0, 0, 0, 0, 214, 214, 0, 214, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 232, 233, 191, 192, 193, 194, 0, 0, 0, 0,
- 0, 189, 190, 191, 192, 193, 194, 0, 0, 214,
- 47, 0, 214, 47, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 215, 0, 0, 0, 47, 0,
- 202, 216, 0, 0, 0, 200, 198, 0, 199, 345,
- 201, 214, 0, 0, 217, 218, 219, 220, 221, 222,
- 0, 223, 0, 234, 0, 197, 0, 215, 0, 0,
- 0, 215, 47, 0, 215, 215, 215, 215, 215, 215,
- 0, 215, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 215, 215, 0, 215, 203, 0, 0,
- 0, 0, 0, 202, 47, 0, 0, 0, 200, 198,
- 202, 199, 0, 201, 0, 200, 198, 0, 199, 0,
- 201, 0, 0, 0, 0, 0, 234, 215, 197, 0,
- 215, 202, 0, 234, 0, 197, 200, 198, 0, 199,
- 0, 201, 0, 202, 0, 0, 0, 0, 200, 198,
- 195, 199, 0, 201, 234, 0, 197, 0, 0, 215,
- 203, 0, 0, 0, 0, 0, 196, 203, 197, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 214, 214, 214, 214, 0, 203, 214,
- 214, 214, 214, 214, 214, 214, 214, 214, 214, 0,
- 203, 0, 0, 0, 0, 0, 0, 214, 214, 214,
- 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
- 214, 214, 214, 214, 214, 214, 214, 0, 0, 214,
- 214, 214, 214, 214, 214, 214, 214, 214, 214, 214,
- 214, 214, 214, 47, 0, 0, 0, 0, 214, 214,
- 214, 214, 214, 214, 214, 214, 214, 214, 214, 0,
- 0, 214, 214, 214, 214, 0, 0, 214, 214, 47,
- 214, 0, 0, 214, 214, 214, 214, 214, 214, 214,
- 214, 214, 214, 214, 263, 0, 0, 214, 214, 214,
- 214, 215, 215, 215, 215, 0, 350, 215, 215, 215,
- 215, 215, 215, 215, 215, 215, 215, 0, 0, 0,
- 0, 0, 0, 0, 0, 215, 215, 215, 215, 215,
- 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
- 215, 215, 215, 215, 215, 0, 0, 215, 215, 215,
- 215, 215, 215, 215, 215, 215, 215, 215, 215, 215,
- 215, 0, 191, 192, 193, 194, 215, 215, 215, 215,
- 215, 215, 215, 215, 215, 215, 215, 210, 0, 215,
- 215, 215, 215, 0, 0, 215, 215, 0, 215, 0,
- 0, 215, 215, 215, 215, 215, 215, 215, 215, 215,
- 215, 215, 0, 0, 0, 215, 215, 215, 215, 0,
- 210, 0, 0, 0, 0, 0, 187, 210, 210, 188,
- 210, 210, 210, 189, 190, 191, 192, 193, 194, 0,
- 189, 0, 191, 192, 193, 194, 210, 210, 0, 210,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 232, 0, 191, 192, 193, 194, 0, 0, 0,
- 0, 0, 0, 232, 233, 191, 192, 193, 194, 0,
- 210, 0, 0, 210, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 211, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 210, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 211, 52,
- 53, 0, 0, 0, 0, 211, 211, 0, 211, 211,
- 211, 52, 53, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 211, 211, 0, 211, 0, 0,
- 0, 0, 0, 0, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 0, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 0, 211, 0,
- 0, 211, 0, 77, 78, 79, 80, 0, 0, 0,
- 0, 0, 0, 0, 0, 77, 78, 79, 80, 0,
- 0, 81, 82, 83, 84, 85, 0, 0, 0, 0,
- 211, 0, 0, 81, 82, 83, 84, 85, 0, 0,
- 0, 0, 0, 0, 0, 0, 212, 0, 0, 0,
- 0, 0, 0, 262, 210, 210, 210, 210, 0, 263,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 0, 0, 0, 0, 0, 0, 0, 0, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 0, 0,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 0, 0, 0, 0, 0, 210,
- 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
- 0, 0, 210, 210, 210, 210, 0, 0, 210, 210,
- 0, 210, 0, 0, 210, 210, 210, 210, 210, 210,
- 210, 210, 210, 210, 210, 0, 0, 0, 210, 210,
- 210, 210, 211, 211, 211, 211, 0, 0, 211, 211,
- 211, 211, 211, 211, 211, 211, 211, 211, 0, 0,
- 0, 0, 0, 0, 0, 0, 211, 211, 211, 211,
- 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
- 211, 211, 211, 211, 211, 211, 0, 0, 211, 211,
- 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
- 211, 211, 0, 0, 0, 0, 0, 211, 211, 211,
- 211, 211, 211, 211, 211, 211, 211, 211, 231, 0,
- 211, 211, 211, 211, 0, 0, 211, 211, 0, 211,
- 0, 0, 211, 211, 211, 211, 211, 211, 211, 211,
- 211, 211, 211, 0, 0, 0, 211, 211, 211, 211,
- 259, 231, 0, 0, 0, 0, 260, 0, 231, 231,
- 0, 261, 231, 0, 52, 53, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 231, 231, 0,
- 231, 0, 0, 0, 0, 0, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 0, 0, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 0, 231, 48, 0, 231, 77, 78, 79, 80, 0,
- 0, 0, 0, 0, 0, 0, 233, 0, 77, 78,
- 79, 80, 0, 81, 82, 83, 84, 85, 0, 0,
- 0, 0, 0, 231, 0, 0, 81, 82, 83, 84,
- 85, 0, 0, 48, 0, 0, 48, 0, 0, 233,
- 0, 183, 0, 0, 0, 0, 233, 233, 0, 0,
- 233, 48, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 233, 233, 0, 233, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 48, 256, 257, 258, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 233,
- 0, 0, 233, 0, 0, 0, 0, 0, 0, 0,
- 284, 0, 0, 0, 0, 203, 0, 48, 0, 0,
- 203, 203, 203, 203, 0, 203, 0, 0, 0, 0,
- 0, 233, 0, 0, 0, 0, 0, 0, 203, 0,
- 203, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 313, 0, 0, 0, 231, 231, 231, 231, 321,
- 0, 231, 231, 231, 231, 231, 231, 231, 231, 231,
- 231, 0, 203, 0, 0, 0, 0, 0, 0, 231,
- 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
- 231, 231, 231, 231, 231, 231, 231, 231, 231, 0,
- 0, 231, 231, 231, 231, 231, 231, 231, 231, 231,
- 231, 231, 231, 231, 231, 0, 0, 0, 0, 0,
- 231, 231, 231, 231, 231, 231, 231, 231, 231, 231,
- 231, 0, 0, 231, 231, 231, 231, 0, 0, 231,
- 231, 0, 231, 0, 0, 231, 231, 231, 231, 231,
- 231, 231, 231, 231, 231, 231, 48, 367, 0, 231,
- 231, 231, 231, 233, 233, 233, 233, 0, 0, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 0,
- 0, 14, 48, 0, 0, 0, 0, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 0, 0, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 0, 389, 390, 0, 0, 233, 233,
- 233, 233, 233, 233, 233, 233, 233, 233, 233, 232,
- 14, 233, 233, 233, 233, 0, 0, 233, 233, 0,
- 233, 0, 0, 233, 233, 233, 233, 233, 233, 233,
- 233, 233, 233, 233, 0, 0, 0, 233, 233, 233,
- 233, 0, 232, 0, 14, 0, 0, 188, 203, 232,
- 232, 203, 0, 232, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 232, 232,
- 0, 232, 0, 0, 0, 0, 14, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 203, 203, 203, 203, 203,
- 203, 0, 232, 0, 0, 232, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 230, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 232, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 230, 0, 0, 0, 0, 0, 0, 230, 230, 0,
- 0, 230, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 230, 230, 0, 230,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 188, 0,
- 230, 0, 0, 230, 188, 0, 0, 0, 0, 188,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 230, 0, 0, 0, 0, 0, 0, 0,
- 0, 188, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 232, 232, 232, 232,
- 0, 0, 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 0, 0, 0, 0, 0, 0, 0, 0,
- 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
- 0, 0, 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 0, 0, 0, 0,
- 0, 232, 232, 232, 232, 232, 232, 232, 232, 232,
- 232, 232, 0, 0, 232, 232, 232, 232, 0, 0,
- 232, 232, 0, 232, 0, 0, 232, 232, 232, 232,
- 232, 232, 232, 232, 232, 232, 232, 0, 0, 0,
- 232, 232, 232, 232, 230, 230, 230, 230, 0, 0,
- 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
- 0, 0, 15, 0, 0, 0, 0, 0, 230, 230,
- 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
- 230, 230, 230, 230, 230, 230, 230, 230, 0, 0,
- 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
- 230, 230, 230, 230, 0, 0, 0, 0, 0, 230,
- 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
- 143, 15, 230, 230, 230, 230, 0, 0, 230, 230,
- 0, 230, 0, 0, 230, 230, 230, 230, 230, 230,
- 230, 230, 230, 230, 230, 0, 0, 0, 230, 230,
- 230, 230, 0, 143, 0, 15, 0, 0, 189, 0,
- 143, 143, 0, 143, 143, 143, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 143,
- 0, 0, 143, 0, 0, 0, 0, 15, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 143, 0, 0, 143, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 235, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 143, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 235, 0, 0, 0, 0, 0, 0, 235, 235,
- 0, 0, 235, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 235, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 189,
- 0, 235, 0, 0, 235, 189, 0, 0, 0, 0,
- 189, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 235, 0, 0, 0, 0, 0, 0,
- 0, 0, 189, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 143, 143, 143,
- 143, 0, 0, 143, 0, 143, 143, 143, 143, 143,
- 143, 143, 143, 0, 0, 0, 0, 0, 0, 0,
- 0, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 0, 0, 0, 0, 143, 143, 143, 143, 143, 143,
- 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
- 143, 143, 143, 0, 0, 143, 143, 143, 143, 0,
- 0, 143, 143, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 143, 143, 143, 143, 143, 0, 0,
- 0, 143, 143, 143, 143, 235, 235, 235, 235, 0,
- 0, 235, 235, 235, 235, 235, 235, 235, 235, 235,
- 235, 0, 0, 0, 0, 0, 0, 0, 0, 235,
- 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
- 235, 235, 235, 235, 235, 235, 235, 235, 235, 0,
- 0, 235, 235, 235, 235, 235, 235, 235, 235, 235,
- 235, 235, 235, 235, 235, 0, 0, 0, 0, 0,
- 235, 235, 235, 235, 235, 235, 235, 235, 235, 235,
- 235, 234, 0, 235, 235, 235, 235, 0, 0, 235,
- 235, 0, 235, 0, 0, 235, 235, 235, 235, 0,
- 0, 235, 235, 235, 235, 235, 0, 0, 0, 235,
- 235, 235, 235, 0, 234, 0, 0, 0, 0, 0,
- 0, 234, 234, 0, 0, 234, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 234, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 234, 0, 0, 234, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 144,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 234, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 144, 0, 0, 0, 0, 0, 0, 144,
- 144, 0, 144, 144, 144, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 144, 0,
- 0, 144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 144, 0, 0, 144, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 144, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 234, 234,
- 234, 234, 0, 0, 234, 234, 234, 234, 234, 234,
- 234, 234, 234, 234, 0, 0, 0, 0, 0, 0,
- 0, 0, 234, 234, 234, 234, 234, 234, 234, 234,
- 234, 234, 234, 234, 234, 234, 234, 234, 234, 234,
- 234, 234, 0, 0, 234, 234, 234, 234, 234, 234,
- 234, 234, 234, 234, 234, 234, 234, 234, 0, 0,
- 0, 0, 0, 234, 234, 234, 234, 234, 234, 234,
- 234, 234, 234, 234, 0, 0, 234, 234, 234, 234,
- 0, 0, 234, 234, 0, 234, 0, 0, 234, 234,
- 234, 234, 0, 0, 234, 234, 234, 234, 234, 0,
- 0, 0, 234, 234, 234, 234, 144, 144, 144, 144,
- 0, 0, 144, 0, 144, 144, 144, 144, 144, 144,
- 144, 144, 0, 0, 0, 0, 0, 0, 0, 0,
- 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 144, 144, 144, 144, 144, 0,
- 0, 0, 0, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 144, 144, 144, 144, 144, 144, 144, 144,
- 144, 144, 236, 0, 144, 144, 144, 144, 0, 0,
- 144, 144, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 144, 144, 144, 144, 144, 0, 0, 0,
- 144, 144, 144, 144, 0, 236, 0, 0, 0, 0,
- 0, 0, 236, 236, 0, 0, 236, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 236, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 236, 0, 0, 236, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 237, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 236, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 237, 0, 0, 0, 0, 0, 0,
- 237, 237, 0, 0, 237, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 237,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 237, 0, 0, 237, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 237, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 236,
- 236, 236, 236, 0, 0, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 0, 0, 0, 0, 0,
- 0, 0, 0, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 0, 0, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 236, 236, 236, 236, 0,
- 0, 0, 0, 0, 236, 236, 236, 236, 236, 236,
- 236, 236, 236, 236, 236, 0, 0, 236, 236, 236,
- 236, 0, 0, 236, 236, 0, 236, 0, 0, 236,
- 236, 0, 0, 0, 0, 236, 236, 236, 236, 236,
- 0, 0, 0, 236, 236, 236, 236, 237, 237, 237,
- 237, 0, 0, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 0, 0, 0, 0, 0, 0, 0,
- 0, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 0, 0, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 237, 237, 237, 237, 0, 0, 0,
- 0, 0, 237, 237, 237, 237, 237, 237, 237, 237,
- 237, 237, 237, 130, 0, 237, 237, 237, 237, 0,
- 0, 237, 237, 0, 237, 0, 0, 0, 237, 0,
- 0, 0, 0, 237, 237, 237, 237, 237, 0, 0,
- 0, 237, 237, 237, 237, 0, 130, 0, 0, 0,
- 0, 0, 0, 130, 130, 0, 130, 130, 130, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 130, 0, 0, 130, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 130, 0, 0, 130,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 135, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 130, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 135, 0, 0, 0, 0, 0,
- 0, 135, 135, 0, 0, 135, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 135, 0, 0, 135, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 135, 0, 0, 135, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 135, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 130, 130, 130, 130, 0, 0, 130, 0, 130, 130,
- 130, 130, 130, 130, 130, 130, 0, 0, 0, 0,
- 0, 0, 0, 0, 130, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
- 130, 130, 130, 0, 0, 0, 0, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 130, 130, 130, 130,
- 0, 0, 0, 0, 0, 130, 130, 130, 130, 130,
- 130, 130, 130, 130, 130, 130, 0, 0, 130, 130,
- 130, 130, 0, 0, 130, 130, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 130, 130, 130, 130,
- 130, 0, 0, 0, 130, 130, 130, 130, 135, 135,
- 135, 135, 0, 0, 135, 0, 135, 135, 135, 135,
- 135, 135, 135, 135, 0, 0, 0, 0, 0, 0,
- 0, 0, 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135, 135, 135,
- 135, 0, 0, 0, 0, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 135, 135, 135, 135, 0, 0,
- 0, 0, 0, 135, 135, 135, 135, 135, 135, 135,
- 135, 135, 135, 135, 139, 0, 135, 135, 135, 135,
- 0, 0, 135, 135, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 135, 135, 135, 135, 135, 0,
- 0, 0, 135, 135, 135, 135, 0, 139, 0, 0,
- 0, 0, 0, 0, 139, 139, 0, 0, 139, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 139, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 139, 0, 0,
- 139, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 88, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 139,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 88, 0, 0, 0, 0,
- 0, 0, 88, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 88, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 88, 0, 0, 88, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 88, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 139, 139, 139, 139, 0, 0, 139, 0, 139,
- 139, 139, 139, 139, 139, 139, 139, 0, 0, 0,
- 0, 0, 0, 0, 0, 139, 139, 139, 139, 139,
- 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
- 139, 139, 139, 139, 0, 0, 0, 0, 139, 139,
- 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
- 139, 0, 0, 0, 0, 0, 139, 139, 139, 139,
- 139, 139, 139, 139, 139, 139, 139, 0, 0, 139,
- 139, 139, 139, 0, 0, 139, 139, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 139, 139, 139,
- 139, 139, 0, 0, 0, 139, 139, 139, 139, 88,
- 88, 88, 88, 0, 0, 88, 0, 88, 88, 88,
- 88, 88, 88, 88, 88, 0, 0, 0, 0, 0,
- 0, 0, 0, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 88,
- 88, 88, 90, 0, 0, 0, 0, 88, 88, 88,
- 88, 88, 88, 88, 88, 88, 88, 88, 88, 0,
- 0, 0, 0, 0, 88, 88, 88, 88, 88, 88,
- 88, 88, 88, 88, 88, 90, 0, 88, 88, 88,
- 88, 0, 90, 88, 88, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 88, 88, 88, 88, 88,
- 0, 90, 0, 88, 88, 88, 88, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 90, 0, 0, 90, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 92, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 90, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 92, 0, 0, 0, 0, 0, 0,
- 92, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 92,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 92, 0, 0, 92, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 92, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 90,
- 90, 90, 90, 0, 0, 90, 0, 90, 90, 90,
- 90, 90, 90, 90, 90, 0, 0, 0, 0, 0,
- 0, 0, 0, 90, 90, 90, 90, 90, 90, 90,
- 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
- 90, 90, 0, 0, 0, 0, 0, 90, 90, 90,
- 90, 90, 90, 90, 90, 90, 90, 90, 90, 0,
- 0, 0, 0, 0, 90, 90, 90, 90, 90, 90,
- 90, 90, 90, 90, 90, 0, 0, 90, 90, 90,
- 90, 0, 0, 90, 90, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 90, 90, 90, 90, 90,
- 0, 0, 0, 90, 90, 90, 90, 92, 92, 92,
- 92, 0, 0, 92, 0, 92, 92, 92, 92, 92,
- 92, 92, 92, 0, 0, 0, 0, 0, 0, 0,
- 0, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
- 96, 0, 0, 0, 0, 92, 92, 92, 92, 92,
- 92, 92, 92, 92, 92, 92, 92, 0, 0, 0,
- 0, 0, 92, 92, 92, 92, 92, 92, 92, 92,
- 92, 92, 92, 96, 0, 92, 92, 92, 92, 0,
- 96, 92, 92, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 92, 92, 92, 92, 92, 0, 96,
- 0, 92, 92, 92, 92, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 96, 0, 0, 96, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 94, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 96, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 94, 0, 0, 0, 0, 0, 0, 94, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 94, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 94, 0, 0, 94, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 94, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 96, 96, 96,
- 96, 0, 0, 96, 0, 96, 96, 96, 96, 96,
- 96, 96, 96, 0, 0, 0, 0, 0, 0, 0,
- 0, 96, 96, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 96, 96, 96, 96, 96, 96,
- 0, 0, 0, 0, 0, 96, 96, 96, 96, 96,
- 96, 96, 96, 96, 96, 96, 96, 0, 0, 0,
- 0, 0, 96, 96, 96, 96, 96, 96, 96, 96,
- 96, 96, 96, 0, 0, 96, 96, 96, 96, 0,
- 0, 96, 96, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 96, 96, 96, 96, 96, 0, 0,
- 0, 96, 96, 96, 96, 94, 94, 94, 94, 0,
- 0, 94, 0, 94, 94, 94, 94, 94, 94, 94,
- 94, 0, 0, 0, 0, 0, 0, 0, 0, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 94, 94, 94, 84, 0,
- 0, 0, 0, 94, 94, 94, 94, 94, 94, 94,
- 94, 94, 94, 94, 94, 0, 0, 0, 0, 0,
- 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
- 94, 84, 0, 94, 94, 94, 94, 0, 84, 94,
- 94, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 94, 94, 94, 94, 94, 0, 84, 0, 94,
- 94, 94, 94, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 84, 0, 0, 84, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 85, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 84, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 85,
- 0, 0, 0, 0, 0, 0, 85, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 85, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 85,
- 0, 0, 85, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 85, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 84, 84, 84, 84, 0,
- 0, 84, 0, 84, 84, 84, 84, 84, 84, 84,
- 84, 0, 0, 0, 0, 0, 0, 0, 0, 84,
- 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
- 84, 84, 84, 84, 84, 84, 84, 84, 0, 0,
- 0, 0, 0, 84, 84, 84, 84, 84, 84, 84,
- 84, 84, 84, 84, 84, 0, 0, 0, 0, 0,
- 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
- 84, 0, 0, 84, 84, 84, 84, 0, 0, 84,
- 84, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 84, 84, 84, 84, 84, 0, 0, 0, 84,
- 84, 84, 84, 85, 85, 85, 85, 0, 0, 85,
- 0, 85, 85, 85, 85, 85, 85, 85, 85, 0,
- 0, 0, 0, 0, 0, 0, 0, 85, 85, 85,
- 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
- 85, 85, 85, 85, 85, 85, 86, 0, 0, 0,
- 0, 85, 85, 85, 85, 85, 85, 85, 85, 85,
- 85, 85, 85, 0, 0, 0, 0, 0, 85, 85,
- 85, 85, 85, 85, 85, 85, 85, 85, 85, 86,
- 0, 85, 85, 85, 85, 0, 86, 85, 85, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 85,
- 85, 85, 85, 85, 0, 86, 0, 85, 85, 85,
- 85, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,
- 0, 0, 86, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 87, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 86, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 87, 0, 0,
- 0, 0, 0, 0, 87, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 87, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 87, 0, 0,
- 87, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 86, 86, 86, 86, 0, 0, 86,
- 0, 86, 86, 86, 86, 86, 86, 86, 86, 0,
- 0, 0, 0, 0, 0, 0, 0, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 86, 86, 86, 0, 0, 0, 0,
- 0, 86, 86, 86, 86, 86, 86, 86, 86, 86,
- 86, 86, 86, 0, 0, 0, 0, 0, 86, 86,
- 86, 86, 86, 86, 86, 86, 86, 86, 86, 0,
- 0, 86, 86, 86, 86, 0, 0, 86, 86, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,
- 86, 86, 86, 86, 0, 0, 0, 86, 86, 86,
- 86, 87, 87, 87, 87, 0, 0, 87, 0, 87,
- 87, 87, 87, 87, 87, 87, 87, 0, 0, 0,
- 0, 0, 0, 0, 0, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 87, 87, 87, 97, 0, 0, 0, 0, 87,
- 87, 87, 87, 87, 87, 87, 87, 87, 87, 87,
- 87, 0, 0, 0, 0, 0, 87, 87, 87, 87,
- 87, 87, 87, 87, 87, 87, 87, 97, 0, 87,
- 87, 87, 87, 0, 97, 87, 87, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 87, 87, 87,
- 87, 87, 0, 97, 0, 87, 87, 87, 87, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 97, 0, 0,
- 97, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 98, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 97,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 98, 0, 0, 0, 0,
- 0, 0, 98, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 98, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 98, 0, 0, 98, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 98, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 97, 97, 97, 97, 0, 0, 97, 0, 97,
- 97, 97, 97, 97, 97, 97, 97, 0, 0, 0,
- 0, 0, 0, 0, 0, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 97, 97, 97, 0, 0, 0, 0, 0, 97,
- 97, 97, 97, 97, 97, 97, 97, 97, 97, 97,
- 97, 0, 0, 0, 0, 0, 97, 97, 97, 97,
- 97, 97, 97, 97, 97, 97, 97, 0, 0, 97,
- 97, 97, 97, 0, 0, 97, 97, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 97, 97, 97,
- 97, 97, 0, 0, 0, 97, 97, 97, 97, 98,
- 98, 98, 98, 0, 0, 98, 0, 98, 98, 98,
- 98, 98, 98, 98, 98, 0, 0, 0, 0, 0,
- 0, 0, 0, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
- 98, 98, 99, 0, 0, 0, 0, 98, 98, 98,
- 98, 98, 98, 98, 98, 98, 98, 98, 98, 0,
- 0, 0, 0, 0, 98, 98, 98, 98, 98, 98,
- 98, 98, 98, 98, 98, 99, 0, 98, 98, 98,
- 98, 0, 99, 98, 98, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 98, 98, 98, 98, 98,
- 0, 99, 0, 98, 98, 98, 98, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 99, 0, 0, 99, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 104, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 99, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 104, 0, 0, 0, 0, 0, 0,
- 104, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 104,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 104, 0, 0, 104, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 104, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 99,
- 99, 99, 99, 0, 0, 99, 0, 99, 99, 99,
- 99, 99, 99, 99, 99, 0, 0, 0, 0, 0,
- 0, 0, 0, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 99,
- 99, 99, 0, 0, 0, 0, 0, 99, 99, 99,
- 99, 99, 99, 99, 99, 99, 99, 99, 99, 0,
- 0, 0, 0, 0, 99, 99, 99, 99, 99, 99,
- 99, 99, 99, 99, 99, 0, 0, 99, 99, 99,
- 99, 0, 0, 99, 99, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 99, 99, 99, 99, 99,
- 0, 0, 0, 99, 99, 99, 99, 104, 104, 104,
- 104, 0, 0, 104, 0, 104, 104, 104, 104, 104,
- 104, 104, 104, 0, 0, 0, 0, 0, 0, 0,
- 0, 104, 104, 104, 104, 104, 104, 104, 104, 104,
- 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
- 106, 0, 0, 0, 0, 104, 104, 104, 104, 104,
- 104, 104, 104, 104, 104, 104, 104, 0, 0, 0,
- 0, 0, 104, 104, 104, 104, 104, 104, 104, 104,
- 104, 104, 104, 106, 0, 104, 104, 104, 104, 0,
- 106, 104, 104, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 104, 104, 104, 104, 104, 0, 106,
- 0, 104, 104, 104, 104, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 106, 0, 0, 106, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 110, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 106, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 110, 0, 0, 0, 0, 0, 0, 110, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 110, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 110, 0, 0, 110, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 110, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 106, 106, 106,
- 106, 0, 0, 106, 0, 106, 106, 106, 106, 106,
- 106, 106, 106, 0, 0, 0, 0, 0, 0, 0,
- 0, 106, 106, 106, 106, 106, 106, 106, 106, 106,
- 106, 106, 106, 106, 106, 106, 106, 106, 106, 106,
- 0, 0, 0, 0, 0, 106, 106, 106, 106, 106,
- 106, 106, 106, 106, 106, 106, 106, 0, 0, 0,
- 0, 0, 106, 106, 106, 106, 106, 106, 106, 106,
- 106, 106, 106, 0, 0, 106, 106, 106, 106, 0,
- 0, 106, 106, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 106, 106, 106, 106, 106, 0, 0,
- 0, 106, 106, 106, 106, 110, 110, 110, 110, 0,
- 0, 110, 0, 110, 110, 110, 110, 110, 110, 110,
- 110, 0, 0, 0, 0, 0, 0, 0, 0, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 110, 110, 110, 123, 0,
- 0, 0, 0, 110, 110, 110, 110, 110, 110, 110,
- 110, 110, 110, 110, 110, 0, 0, 0, 0, 0,
- 110, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 123, 0, 110, 110, 110, 110, 0, 123, 110,
- 110, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 110, 110, 110, 110, 110, 0, 123, 0, 110,
- 110, 110, 110, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 123, 0, 0, 123, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 108, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 123, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 108,
- 0, 0, 0, 0, 0, 0, 108, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 108, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 108,
- 0, 0, 108, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 108, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 123, 123, 123, 123, 0,
- 0, 123, 0, 123, 123, 123, 123, 123, 123, 123,
- 123, 0, 0, 0, 0, 0, 0, 0, 0, 123,
- 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 123, 123, 123, 123, 123, 123, 123, 0, 0,
- 0, 0, 0, 123, 123, 123, 123, 123, 123, 123,
- 123, 123, 123, 123, 123, 0, 0, 0, 0, 0,
- 123, 123, 123, 123, 123, 123, 123, 123, 123, 123,
- 123, 0, 0, 123, 123, 123, 123, 0, 0, 123,
- 123, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 123, 123, 123, 123, 123, 0, 0, 0, 123,
- 123, 123, 123, 108, 108, 108, 108, 0, 0, 108,
- 0, 108, 108, 108, 108, 108, 108, 108, 108, 0,
- 0, 0, 0, 0, 0, 0, 0, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 108, 108, 108, 0, 0, 0, 0,
- 0, 108, 108, 108, 108, 108, 108, 108, 108, 108,
- 108, 108, 108, 0, 0, 0, 0, 0, 108, 108,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 141,
- 0, 108, 108, 108, 108, 0, 0, 108, 108, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 108,
- 108, 108, 108, 108, 0, 0, 0, 108, 108, 108,
- 108, 0, 141, 0, 0, 0, 0, 0, 0, 141,
- 141, 0, 141, 141, 141, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 141, 0,
- 0, 141, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 167, 0, 0, 0, 0,
- 0, 0, 141, 0, 0, 141, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 167, 0,
- 0, 0, 0, 0, 141, 167, 167, 0, 230, 167,
- 167, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 167, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 230, 0, 0, 0, 0, 0, 0, 230, 230,
- 0, 0, 230, 0, 0, 0, 0, 0, 167, 0,
- 0, 167, 0, 0, 0, 0, 0, 230, 230, 0,
- 230, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 167, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 230, 0, 0, 230, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 230, 0, 0, 141, 141, 141, 141,
- 0, 0, 141, 0, 141, 141, 141, 141, 141, 141,
- 141, 141, 0, 0, 0, 0, 0, 0, 0, 0,
- 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
- 141, 141, 141, 141, 141, 141, 141, 141, 141, 40,
- 0, 0, 0, 141, 141, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 141, 141, 141, 141,
- 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
- 141, 141, 40, 0, 0, 0, 0, 0, 0, 40,
- 141, 141, 167, 167, 167, 167, 0, 0, 167, 0,
- 167, 167, 167, 167, 167, 167, 0, 0, 40, 0,
- 141, 141, 141, 141, 0, 0, 167, 167, 167, 167,
- 167, 167, 167, 167, 167, 167, 167, 167, 167, 167,
- 167, 167, 167, 167, 167, 230, 230, 230, 230, 0,
- 167, 230, 40, 0, 0, 40, 230, 0, 0, 230,
- 230, 0, 0, 0, 0, 0, 0, 167, 167, 167,
- 167, 167, 167, 167, 167, 167, 167, 167, 0, 0,
- 0, 0, 0, 0, 40, 0, 167, 167, 42, 0,
- 0, 0, 0, 230, 230, 230, 230, 230, 230, 230,
- 230, 230, 230, 230, 230, 0, 167, 167, 167, 167,
- 230, 230, 230, 230, 230, 230, 230, 230, 230, 230,
- 230, 42, 0, 230, 230, 230, 230, 0, 42, 0,
- 0, 0, 0, 0, 0, 230, 230, 230, 230, 230,
- 230, 230, 230, 230, 230, 230, 0, 42, 0, 0,
- 0, 0, 230, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 42, 0, 0, 42, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 95,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 42, 0, 0, 40, 40, 40, 40,
- 0, 0, 40, 0, 0, 0, 0, 40, 0, 0,
- 40, 40, 0, 0, 0, 0, 0, 0, 0, 0,
- 89, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 95, 0,
- 0, 0, 0, 0, 40, 40, 40, 40, 40, 40,
- 40, 40, 40, 40, 40, 40, 0, 0, 0, 0,
- 0, 40, 40, 40, 40, 40, 40, 40, 40, 40,
- 40, 40, 95, 0, 40, 40, 40, 40, 0, 89,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 40, 40, 40, 40, 40, 0, 0, 0,
- 0, 0, 0, 40, 95, 0, 0, 0, 93, 0,
- 0, 0, 0, 89, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 42, 42, 42, 42, 0,
- 0, 42, 0, 0, 0, 0, 42, 0, 0, 42,
- 42, 0, 0, 0, 0, 89, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 93, 0, 0,
- 0, 0, 0, 42, 42, 42, 42, 42, 42, 42,
- 42, 42, 42, 42, 42, 0, 0, 0, 0, 0,
- 42, 42, 42, 42, 42, 42, 42, 42, 42, 42,
- 42, 93, 0, 42, 42, 42, 42, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 42, 42, 42, 42, 42, 0, 0, 0, 91,
- 0, 0, 42, 93, 0, 0, 0, 0, 0, 95,
- 0, 0, 0, 0, 95, 95, 95, 0, 95, 95,
- 95, 95, 0, 0, 0, 0, 0, 0, 0, 0,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
- 95, 95, 95, 95, 95, 95, 95, 95, 95, 188,
- 89, 0, 0, 0, 0, 89, 89, 89, 91, 89,
- 89, 89, 89, 0, 0, 0, 0, 0, 0, 0,
- 0, 89, 89, 89, 89, 89, 89, 89, 89, 89,
- 89, 89, 89, 89, 89, 89, 89, 89, 89, 89,
- 95, 95, 91, 0, 0, 0, 0, 0, 0, 103,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 95, 95, 95, 95, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 91, 0, 0, 0, 0, 0,
- 0, 89, 89, 0, 0, 0, 0, 0, 93, 0,
- 0, 0, 0, 93, 93, 93, 0, 93, 93, 93,
- 93, 89, 89, 89, 89, 0, 0, 0, 103, 93,
- 93, 93, 93, 93, 93, 93, 93, 93, 93, 93,
- 93, 93, 93, 93, 93, 93, 93, 93, 189, 0,
- 0, 0, 0, 0, 105, 0, 146, 0, 0, 0,
- 0, 0, 103, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 93,
- 93, 0, 0, 0, 103, 0, 0, 0, 0, 146,
- 0, 146, 146, 0, 0, 0, 0, 0, 0, 93,
- 93, 93, 93, 105, 0, 146, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 91,
- 0, 0, 0, 0, 91, 91, 91, 0, 91, 91,
- 91, 91, 0, 0, 0, 0, 0, 105, 0, 146,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
- 91, 91, 91, 91, 91, 91, 91, 91, 91, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 109, 105,
- 0, 146, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 91, 91, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 103,
- 91, 91, 91, 91, 103, 103, 103, 109, 103, 103,
- 103, 103, 0, 0, 0, 0, 0, 0, 0, 0,
- 103, 103, 103, 103, 103, 103, 103, 103, 103, 103,
- 103, 103, 103, 103, 103, 103, 103, 103, 103, 0,
- 0, 109, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 107, 0, 0, 0, 0,
- 0, 0, 0, 109, 0, 0, 0, 0, 0, 0,
- 103, 103, 0, 0, 105, 0, 0, 0, 0, 105,
- 105, 105, 0, 105, 105, 105, 105, 146, 146, 0,
- 103, 103, 103, 103, 0, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 105, 105, 105, 105, 105, 105,
- 105, 105, 105, 105, 107, 0, 0, 0, 0, 0,
- 0, 0, 146, 146, 146, 146, 146, 146, 146, 146,
- 146, 146, 146, 146, 146, 146, 146, 146, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 107, 0,
- 0, 146, 146, 146, 146, 105, 105, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 146,
- 146, 146, 146, 146, 0, 105, 105, 105, 105, 0,
- 107, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 109, 0,
- 0, 0, 0, 109, 109, 109, 0, 109, 109, 109,
- 109, 0, 0, 0, 0, 0, 0, 0, 0, 109,
- 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
- 109, 109, 109, 109, 109, 109, 109, 109, 80, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 80, 0, 0, 0, 0, 0, 0, 80, 109,
- 109, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 80, 0, 109,
- 109, 109, 109, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 107, 0, 0, 0, 0,
- 107, 107, 107, 0, 107, 107, 107, 107, 0, 0,
- 0, 80, 0, 0, 80, 0, 107, 107, 107, 107,
- 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
- 107, 107, 107, 107, 107, 0, 0, 0, 0, 0,
- 0, 0, 0, 80, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 89, 0,
- 0, 0, 0, 0, 0, 86, 0, 0, 0, 0,
- 88, 0, 0, 0, 0, 0, 107, 107, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 107, 107, 107, 107,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 32, 0, 0, 0,
- 0, 87, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 31, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 80, 80, 80, 0, 0,
- 0, 80, 0, 80, 80, 80, 80, 80, 80, 80,
- 80, 0, 0, 0, 0, 0, 0, 0, 0, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 80, 80, 80, 0, 0,
- 0, 0, 0, 80, 80, 80, 80, 80, 80, 80,
- 80, 80, 80, 80, 80, 0, 0, 0, 0, 0,
- 80, 80, 80, 80, 80, 80, 80, 80, 80, 80,
- 80, 0, 0, 80, 80, 80, 80, 0, 0, 80,
- 80, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 80, 80, 80, 80, 80, 0, 0, 0, 80,
- 80, 80, 277, 278, 49, 8, 9, 0, 50, 0,
- 0, 0, 0, 51, 10, 11, 279, 280, 14, 15,
- 16, 17, 18, 19, 20, 21, 0, 0, 6, 0,
- 0, 0, 0, 0, 0, 6, 0, 0, 0, 0,
- 6, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
- 64, 65, 0, 0, 0, 0, 0, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 22, 0,
- 77, 78, 79, 80, 23, 24, 6, 0, 25, 0,
- 26, 6, 0, 0, 0, 0, 0, 0, 81, 82,
- 83, 84, 85, 27, 0, 28, 0, 0, 0, 29,
- 30, 0, 0, 0, 0, 0, 0, 0, 6, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 89, 0, 0,
- 0, 0, 0, 0, 104, 0, 0, 0, 0, 88,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 87, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 6, 6, 6, 6, 6, 0, 6, 0,
- 0, 0, 0, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 105, 0, 0, 0,
- 0, 0, 0, 104, 297, 0, 0, 0, 88, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 0, 0, 0, 0, 0, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 0,
- 6, 6, 6, 6, 6, 6, 0, 0, 6, 87,
- 6, 0, 0, 0, 0, 0, 0, 0, 6, 6,
- 6, 6, 6, 6, 0, 6, 0, 0, 0, 6,
- 6, 47, 48, 49, 8, 0, 0, 50, 0, 120,
- 121, 122, 51, 123, 124, 125, 126, 0, 0, 0,
- 0, 0, 0, 0, 0, 127, 128, 129, 130, 131,
- 132, 133, 134, 135, 136, 137, 138, 139, 140, 141,
- 142, 143, 144, 145, 0, 0, 0, 0, 0, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 0, 0, 0, 0, 0, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
- 78, 79, 80, 0, 89, 146, 147, 0, 0, 0,
- 0, 86, 0, 0, 0, 0, 88, 81, 82, 83,
- 84, 85, 0, 0, 0, 148, 149, 150, 29, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 47, 48, 49, 8, 0, 0, 50, 87, 0, 0,
- 0, 51, 0, 0, 52, 53, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 0, 0, 0, 0, 0, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 105, 0, 77, 78,
- 79, 80, 0, 104, 0, 0, 0, 0, 88, 0,
- 0, 0, 0, 0, 0, 0, 81, 82, 83, 84,
- 85, 0, 0, 0, 0, 0, 0, 29, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 87,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
- 49, 8, 0, 0, 50, 0, 0, 0, 0, 51,
- 0, 0, 52, 53, 0, 0, 0, 105, 0, 0,
- 0, 0, 0, 0, 86, 0, 0, 0, 0, 88,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 0, 0,
- 0, 0, 0, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 0, 0, 77, 78, 79, 80,
- 87, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 81, 82, 83, 84, 85, 0,
- 0, 0, 0, 0, 0, 29, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 105, 0, 0,
- 47, 48, 49, 8, 268, 0, 50, 0, 0, 88,
- 0, 51, 0, 0, 52, 53, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 87, 0, 0, 0, 0, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 0, 0, 77, 78,
- 79, 80, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 81, 82, 83, 84,
- 85, 0, 0, 0, 0, 0, 0, 29, 0, 89,
- 0, 47, 48, 49, 8, 0, 104, 50, 406, 0,
- 0, 88, 51, 0, 0, 52, 53, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 0, 87, 0, 0, 0, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
- 78, 79, 80, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 81, 82, 83,
- 84, 85, 0, 0, 0, 0, 0, 0, 29, 89,
- 0, 47, 48, 49, 8, 0, 104, 50, 0, 0,
- 0, 88, 51, 0, 0, 52, 53, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 0, 87, 0, 0, 0, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 0, 0, 77,
- 78, 79, 80, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 81, 82, 83,
- 84, 85, 0, 0, 0, 0, 0, 0, 29, 0,
- 89, 0, 0, 47, 48, 49, 0, 86, 0, 50,
- 0, 0, 88, 0, 51, 0, 0, 52, 53, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 87, 0, 0, 0, 0, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
- 0, 77, 78, 79, 80, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,
- 82, 83, 84, 85, 0, 0, 0, 0, 0, 0,
- 89, 0, 0, 47, 48, 49, 0, 268, 0, 50,
- 0, 0, 88, 0, 51, 0, 0, 52, 53, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 54, 55, 56, 57, 58, 59, 60, 61, 62,
- 63, 64, 65, 87, 0, 0, 0, 0, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
- 0, 77, 78, 79, 80, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 81,
- 82, 83, 84, 85, 0, 0, 0, 0, 0, 0,
- 0, 89, 0, 0, 47, 48, 49, 0, 104, 0,
- 50, 0, 0, 88, 0, 51, 0, 0, 52, 53,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 87, 0, 0, 0, 0, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 0, 0, 77, 78, 79, 80, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 81, 82, 83, 84, 85, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 47, 48, 49, 0, 0, 0,
- 50, 0, 0, 0, 0, 51, 0, 0, 52, 53,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 32, 0, 0, 0, 0, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 0, 0, 77, 78, 79, 80, 0, 0, 0, 0,
- 0, 0, 32, 0, 0, 0, 31, 0, 0, 0,
- 81, 82, 83, 84, 85, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 47, 48, 49, 0, 0,
- 0, 50, 0, 0, 31, 0, 51, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 0, 0, 0, 0, 0,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 0, 0, 77, 78, 79, 80, 0, 0, 0,
- 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
- 0, 81, 82, 83, 84, 85, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 7, 0, 8, 9, 6, 0, 0, 0, 0,
- 0, 0, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 0, 0, 0, 0, 6, 7,
- 0, 8, 9, 0, 0, 0, 0, 0, 0, 0,
- 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 22, 0, 0, 0,
- 0, 0, 23, 24, 0, 0, 25, 0, 26, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 27, 0, 28, 22, 0, 0, 29, 30, 0,
- 23, 24, 0, 0, 25, 0, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 27,
- 0, 28, 0, 0, 0, 29, 30, 0, 0, 6,
- 6, 0, 6, 6, 0, 0, 0, 0, 0, 0,
- 0, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 6, 0, 0, 0, 0,
- 0, 6, 6, 0, 0, 6, 0, 6, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 0, 6, 0, 0, 0, 6, 6,
-};
-short yycheck[] = { 24,
- 43, 119, 45, 28, 44, 30, 0, 260, 271, 272,
- 94, 36, 4, 260, 59, 105, 86, 37, 59, 96,
- 58, 43, 42, 45, 0, 37, 0, 47, 258, 101,
- 42, 43, 24, 45, 99, 47, 0, 155, 30, 258,
- 62, 35, 114, 58, 36, 40, 61, 41, 60, 346,
- 62, 271, 272, 334, 41, 91, 43, 0, 45, 0,
- 43, 86, 45, 88, 89, 135, 262, 41, 41, 0,
- 44, 44, 41, 61, 94, 44, 101, 347, 348, 43,
- 105, 45, 94, 59, 40, 59, 40, 334, 96, 114,
- 353, 354, 0, 40, 0, 59, 115, 116, 123, 124,
- 125, 126, 127, 128, 129, 130, 131, 132, 133, 101,
- 135, 364, 137, 138, 139, 40, 59, 93, 59, 93,
- 112, 205, 114, 148, 149, 33, 40, 119, 59, 93,
- 155, 40, 40, 353, 354, 41, 290, 45, 44, 43,
- 44, 45, 232, 233, 214, 215, 236, 237, 40, 125,
- 93, 125, 93, 59, 317, 318, 319, 320, 321, 40,
- 0, 125, 93, 155, 189, 190, 191, 192, 193, 194,
- 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
- 257, 40, 125, 91, 125, 40, 263, 93, 96, 214,
- 215, 268, 349, 350, 125, 260, 261, 40, 268, 61,
- 260, 0, 258, 0, 229, 0, 41, 232, 233, 234,
- 24, 236, 237, 262, 41, 123, 30, 264, 258, 125,
- 94, 301, 0, 300, 260, 46, 37, 257, 93, 0,
- 125, 42, 43, 93, 45, 262, 47, 273, 274, 275,
- 276, 277, 278, 268, 280, 262, 238, 239, 257, 257,
- 41, 243, 41, 93, 44, 263, 41, 375, 41, 37,
- 268, 304, 59, 41, 42, 43, 44, 45, 41, 47,
- 41, 41, 86, 44, 286, 44, 44, 302, 41, 41,
- 345, 59, 60, 94, 62, 125, 302, 101, 59, 347,
- 264, 262, 91, 43, 44, 45, 93, 44, 93, 257,
- 114, 303, 37, 43, 44, 45, 359, 42, 43, 44,
- 45, 260, 47, 41, 41, 93, 290, 131, 132, 133,
- 41, 41, 93, 344, 123, 60, 300, 62, 125, 303,
- 125, 0, 262, 41, 344, 347, 348, 349, 350, 351,
- 352, 155, 155, 30, 369, 370, 371, 125, 373, 257,
- 258, 259, 260, 261, 125, 263, 35, 381, 264, 94,
- 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
- 278, 279, 280, 347, 348, 0, 344, 344, 403, -1,
- -1, 406, 196, 375, 290, -1, 37, -1, -1, -1,
- 204, 42, 43, 44, 45, -1, 47, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, 60,
- 0, 62, -1, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, 333, -1, 335, 336, 337,
- 338, 339, 340, -1, 59, 343, -1, 345, -1, -1,
- -1, 347, 348, 94, -1, 353, 354, 355, 356, 357,
- 358, -1, 360, 43, 0, 45, 364, 365, 257, 258,
- -1, 260, 261, -1, 0, 0, -1, 0, 93, 59,
- 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
- 279, 280, -1, 0, -1, -1, 264, 33, 302, 300,
- -1, 37, 303, 264, 40, 41, 42, 43, 44, 45,
- 125, 47, -1, 93, -1, -1, 41, -1, -1, 44,
- -1, -1, 290, 59, 60, -1, 62, -1, -1, 290,
- -1, -1, 300, 59, 59, 303, 59, -1, -1, 300,
- -1, -1, 303, -1, 333, 125, -1, -1, -1, -1,
- 339, 340, 59, 37, 343, -1, 345, 93, 42, 43,
- 96, 45, -1, 47, -1, 369, 370, 93, 93, 358,
- 93, 360, 0, -1, -1, 364, 365, -1, -1, 347,
- 348, 349, 350, 351, 352, -1, 93, 348, -1, 125,
- -1, -1, -1, -1, -1, 259, -1, -1, 262, 125,
- 125, -1, 125, -1, -1, 33, -1, -1, -1, 37,
- 94, -1, 40, 41, 42, 43, 44, 45, 125, 47,
- -1, -1, 347, 348, 349, 350, 351, 352, -1, -1,
- -1, 59, 60, -1, 62, -1, -1, -1, -1, -1,
- -1, 37, -1, -1, -1, -1, 42, 43, -1, 45,
- -1, 47, -1, -1, -1, -1, -1, -1, -1, 300,
- -1, -1, 303, -1, 60, 93, 62, -1, 96, 37,
- -1, -1, -1, -1, 42, 43, -1, 45, -1, 47,
- 37, -1, 346, 347, -1, 42, 43, 44, 45, -1,
- 47, -1, 60, -1, 62, -1, -1, 125, 94, -1,
- -1, -1, -1, 60, -1, 62, 347, 348, 349, 350,
- 351, 352, 376, -1, -1, 379, -1, -1, -1, -1,
- -1, 257, 258, 259, 260, -1, 94, 263, 264, 265,
- 266, 267, 268, 269, 270, 271, 272, 94, -1, 264,
- -1, -1, -1, -1, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, 300, 290, -1, 303, 304, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, -1, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, -1, -1, 335,
- 336, 337, 338, -1, -1, 341, 342, -1, 344, -1,
- -1, 347, 348, 349, 350, 351, 352, 353, 354, 355,
- 356, 357, -1, 348, -1, 361, 362, 363, 364, 257,
- 258, 259, 260, -1, 91, 263, 264, 265, 266, 267,
- 268, 269, 270, 271, 272, -1, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
- 298, 299, 300, 96, -1, 303, 304, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, -1,
- -1, -1, 260, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, 0, -1, 335, 336, 337,
- 338, 134, -1, 341, 342, -1, 344, 0, -1, 347,
- 348, 349, 350, 351, 352, 353, 354, 355, 356, 357,
- -1, -1, -1, 361, 362, 363, 364, -1, 33, -1,
- -1, -1, 37, -1, -1, 40, 41, 42, 43, 44,
- 45, -1, 47, -1, 26, 351, 352, -1, 41, -1,
- -1, 44, -1, -1, 59, 60, -1, 62, -1, -1,
- 42, -1, -1, -1, -1, -1, 59, -1, -1, 347,
- 348, 349, 350, 351, 352, -1, -1, -1, -1, -1,
- 347, 348, 349, 350, 351, 352, 364, -1, 93, -1,
- -1, 96, -1, 260, -1, -1, -1, -1, -1, -1,
- 93, 268, -1, 0, -1, 87, 273, 274, 275, 276,
- 277, 278, -1, 280, 0, -1, -1, -1, -1, -1,
- 125, -1, -1, -1, -1, -1, 259, -1, -1, 262,
- -1, -1, 125, 266, -1, -1, 33, -1, -1, -1,
- 37, -1, -1, 40, 41, 42, 43, 44, 45, -1,
- 47, -1, -1, -1, -1, 41, -1, -1, 44, -1,
- -1, -1, 59, 60, -1, 62, -1, -1, -1, -1,
- -1, -1, -1, 59, -1, 157, -1, -1, -1, 161,
- 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
- -1, -1, -1, -1, -1, -1, 93, -1, -1, 96,
- 37, -1, -1, -1, -1, 42, 43, 93, 45, -1,
- 47, 37, -1, 346, 347, -1, 42, 43, -1, 45,
- -1, 47, -1, 60, -1, 62, -1, -1, 125, -1,
- -1, -1, -1, -1, 60, -1, 62, -1, -1, 125,
- -1, -1, -1, 376, -1, -1, 379, -1, -1, -1,
- -1, -1, 257, 258, 259, 260, -1, 94, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, 94, -1,
- -1, 264, -1, -1, -1, -1, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, -1, 290, 303, 304,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, -1, -1, -1, -1, -1, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, -1, -1,
- 335, 336, 337, 338, -1, -1, 341, 342, -1, 344,
- -1, -1, 347, 348, 349, 350, 351, 352, 353, 354,
- 355, 356, 357, -1, -1, 348, 361, 362, 363, 364,
- 257, 258, 259, 260, -1, -1, 263, 264, 265, 266,
- 267, 268, 269, 270, 271, 272, 358, -1, 264, -1,
- 362, 363, 91, -1, 281, 282, 283, 284, 285, 286,
- 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
- 297, 298, 299, 300, 290, -1, 303, 304, 305, 306,
- 307, 308, 309, 310, 311, 312, 313, 314, 315, 316,
- -1, -1, -1, -1, -1, 322, 323, 324, 325, 326,
- 327, 328, 329, 330, 331, 332, 0, -1, 335, 336,
- 337, 338, -1, -1, 341, 342, -1, 344, -1, -1,
- 347, 348, 349, 350, 351, 352, 353, 354, 355, 356,
- 357, -1, 348, 289, 361, 362, 363, 364, -1, 33,
- -1, -1, -1, 37, -1, -1, 40, 41, 42, 43,
- 44, 45, -1, 47, -1, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, -1, 59, 60, -1, 62, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 347, 348, 349, 350, 351, 352, -1, -1, -1, -1,
- -1, 347, 348, 349, 350, 351, 352, -1, -1, 93,
- 41, -1, 96, 44, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 0, -1, -1, -1, 59, -1,
- 37, 260, -1, -1, -1, 42, 43, -1, 45, 268,
- 47, 125, -1, -1, 273, 274, 275, 276, 277, 278,
- -1, 280, -1, 60, -1, 62, -1, 33, -1, -1,
- -1, 37, 93, -1, 40, 41, 42, 43, 44, 45,
- -1, 47, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 59, 60, -1, 62, 94, -1, -1,
- -1, -1, -1, 37, 125, -1, -1, -1, 42, 43,
- 37, 45, -1, 47, -1, 42, 43, -1, 45, -1,
- 47, -1, -1, -1, -1, -1, 60, 93, 62, -1,
- 96, 37, -1, 60, -1, 62, 42, 43, -1, 45,
- -1, 47, -1, 37, -1, -1, -1, -1, 42, 43,
- 44, 45, -1, 47, 60, -1, 62, -1, -1, 125,
- 94, -1, -1, -1, -1, -1, 60, 94, 62, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 257, 258, 259, 260, -1, 94, 263,
- 264, 265, 266, 267, 268, 269, 270, 271, 272, -1,
- 94, -1, -1, -1, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, 296, 297, 298, 299, 300, -1, -1, 303,
- 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, 264, -1, -1, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, -1,
- -1, 335, 336, 337, 338, -1, -1, 341, 342, 290,
- 344, -1, -1, 347, 348, 349, 350, 351, 352, 353,
- 354, 355, 356, 357, 46, -1, -1, 361, 362, 363,
- 364, 257, 258, 259, 260, -1, 46, 263, 264, 265,
- 266, 267, 268, 269, 270, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, 300, -1, -1, 303, 304, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, 349, 350, 351, 352, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, 0, -1, 335,
- 336, 337, 338, -1, -1, 341, 342, -1, 344, -1,
- -1, 347, 348, 349, 350, 351, 352, 353, 354, 355,
- 356, 357, -1, -1, -1, 361, 362, 363, 364, -1,
- 33, -1, -1, -1, -1, -1, 300, 40, 41, 303,
- 43, 44, 45, 347, 348, 349, 350, 351, 352, -1,
- 347, -1, 349, 350, 351, 352, 59, 60, -1, 62,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 347, -1, 349, 350, 351, 352, -1, -1, -1,
- -1, -1, -1, 347, 348, 349, 350, 351, 352, -1,
- 93, -1, -1, 96, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 0, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 125, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 33, 271,
- 272, -1, -1, -1, -1, 40, 41, -1, 43, 44,
- 45, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 59, 60, -1, 62, -1, -1,
- -1, -1, -1, -1, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, 93, -1,
- -1, 96, -1, 335, 336, 337, 338, -1, -1, -1,
- -1, -1, -1, -1, -1, 335, 336, 337, 338, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, -1,
- 125, -1, -1, 353, 354, 355, 356, 357, -1, -1,
- -1, -1, -1, -1, -1, -1, 46, -1, -1, -1,
- -1, -1, -1, 40, 257, 258, 259, 260, -1, 46,
- 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
- -1, -1, -1, -1, -1, -1, -1, -1, 281, 282,
- 283, 284, 285, 286, 287, 288, 289, 290, 291, 292,
- 293, 294, 295, 296, 297, 298, 299, 300, -1, -1,
- 303, 304, 305, 306, 307, 308, 309, 310, 311, 312,
- 313, 314, 315, 316, -1, -1, -1, -1, -1, 322,
- 323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
- -1, -1, 335, 336, 337, 338, -1, -1, 341, 342,
- -1, 344, -1, -1, 347, 348, 349, 350, 351, 352,
- 353, 354, 355, 356, 357, -1, -1, -1, 361, 362,
- 363, 364, 257, 258, 259, 260, -1, -1, 263, 264,
- 265, 266, 267, 268, 269, 270, 271, 272, -1, -1,
- -1, -1, -1, -1, -1, -1, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 300, -1, -1, 303, 304,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, -1, -1, -1, -1, -1, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, 0, -1,
- 335, 336, 337, 338, -1, -1, 341, 342, -1, 344,
- -1, -1, 347, 348, 349, 350, 351, 352, 353, 354,
- 355, 356, 357, -1, -1, -1, 361, 362, 363, 364,
- 257, 33, -1, -1, -1, -1, 263, -1, 40, 41,
- -1, 268, 44, -1, 271, 272, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, 60, -1,
- 62, -1, -1, -1, -1, -1, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, -1, 306,
- 307, 308, 309, 310, 311, 312, 313, 314, 315, 316,
- -1, 93, 0, -1, 96, 335, 336, 337, 338, -1,
- -1, -1, -1, -1, -1, -1, 0, -1, 335, 336,
- 337, 338, -1, 353, 354, 355, 356, 357, -1, -1,
- -1, -1, -1, 125, -1, -1, 353, 354, 355, 356,
- 357, -1, -1, 41, -1, -1, 44, -1, -1, 33,
- -1, 86, -1, -1, -1, -1, 40, 41, -1, -1,
- 44, 59, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 59, 60, -1, 62, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, 131, 132, 133, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 93,
- -1, -1, 96, -1, -1, -1, -1, -1, -1, -1,
- 155, -1, -1, -1, -1, 37, -1, 125, -1, -1,
- 42, 43, 44, 45, -1, 47, -1, -1, -1, -1,
- -1, 125, -1, -1, -1, -1, -1, -1, 60, -1,
- 62, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 196, -1, -1, -1, 257, 258, 259, 260, 204,
- -1, 263, 264, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, 94, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, 300, -1,
- -1, 303, 304, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, -1, -1, 335, 336, 337, 338, -1, -1, 341,
- 342, -1, 344, -1, -1, 347, 348, 349, 350, 351,
- 352, 353, 354, 355, 356, 357, 264, 302, -1, 361,
- 362, 363, 364, 257, 258, 259, 260, -1, -1, 263,
- 264, 265, 266, 267, 268, 269, 270, 271, 272, -1,
- -1, 0, 290, -1, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, 296, 297, 298, 299, 300, -1, -1, 303,
- 304, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, -1, 369, 370, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, 0,
- 59, 335, 336, 337, 338, -1, -1, 341, 342, -1,
- 344, -1, -1, 347, 348, 349, 350, 351, 352, 353,
- 354, 355, 356, 357, -1, -1, -1, 361, 362, 363,
- 364, -1, 33, -1, 93, -1, -1, 96, 300, 40,
- 41, 303, -1, 44, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 59, 60,
- -1, 62, -1, -1, -1, -1, 125, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 347, 348, 349, 350, 351,
- 352, -1, 93, -1, -1, 96, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 0, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 125, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 33, -1, -1, -1, -1, -1, -1, 40, 41, -1,
- -1, 44, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 59, 60, -1, 62,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 257, -1,
- 93, -1, -1, 96, 263, -1, -1, -1, -1, 268,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 125, -1, -1, -1, -1, -1, -1, -1,
- -1, 300, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 257, 258, 259, 260,
- -1, -1, 263, 264, 265, 266, 267, 268, 269, 270,
- 271, 272, -1, -1, -1, -1, -1, -1, -1, -1,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
- -1, -1, 303, 304, 305, 306, 307, 308, 309, 310,
- 311, 312, 313, 314, 315, 316, -1, -1, -1, -1,
- -1, 322, 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, -1, -1, 335, 336, 337, 338, -1, -1,
- 341, 342, -1, 344, -1, -1, 347, 348, 349, 350,
- 351, 352, 353, 354, 355, 356, 357, -1, -1, -1,
- 361, 362, 363, 364, 257, 258, 259, 260, -1, -1,
- 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
- -1, -1, 0, -1, -1, -1, -1, -1, 281, 282,
- 283, 284, 285, 286, 287, 288, 289, 290, 291, 292,
- 293, 294, 295, 296, 297, 298, 299, 300, -1, -1,
- 303, 304, 305, 306, 307, 308, 309, 310, 311, 312,
- 313, 314, 315, 316, -1, -1, -1, -1, -1, 322,
- 323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
- 0, 59, 335, 336, 337, 338, -1, -1, 341, 342,
- -1, 344, -1, -1, 347, 348, 349, 350, 351, 352,
- 353, 354, 355, 356, 357, -1, -1, -1, 361, 362,
- 363, 364, -1, 33, -1, 93, -1, -1, 96, -1,
- 40, 41, -1, 43, 44, 45, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
- -1, -1, 62, -1, -1, -1, -1, 125, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 93, -1, -1, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 0, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, -1, -1, -1, -1, 40, 41,
- -1, -1, 44, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
- -1, 93, -1, -1, 96, 263, -1, -1, -1, -1,
- 268, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- -1, -1, 300, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 257, 258, 259,
- 260, -1, -1, 263, -1, 265, 266, 267, 268, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- -1, -1, -1, -1, 304, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, 317, 318, 319,
- 320, 321, 322, 323, 324, 325, 326, 327, 328, 329,
- 330, 331, 332, -1, -1, 335, 336, 337, 338, -1,
- -1, 341, 342, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 353, 354, 355, 356, 357, -1, -1,
- -1, 361, 362, 363, 364, 257, 258, 259, 260, -1,
- -1, 263, 264, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, 300, -1,
- -1, 303, 304, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, 0, -1, 335, 336, 337, 338, -1, -1, 341,
- 342, -1, 344, -1, -1, 347, 348, 349, 350, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, 361,
- 362, 363, 364, -1, 33, -1, -1, -1, -1, -1,
- -1, 40, 41, -1, -1, 44, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 59, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 93, -1, -1, 96, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 125, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 33, -1, -1, -1, -1, -1, -1, 40,
- 41, -1, 43, 44, 45, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 59, -1,
- -1, 62, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 93, -1, -1, 96, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 125, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 257, 258,
- 259, 260, -1, -1, 263, 264, 265, 266, 267, 268,
- 269, 270, 271, 272, -1, -1, -1, -1, -1, -1,
- -1, -1, 281, 282, 283, 284, 285, 286, 287, 288,
- 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
- 299, 300, -1, -1, 303, 304, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316, -1, -1,
- -1, -1, -1, 322, 323, 324, 325, 326, 327, 328,
- 329, 330, 331, 332, -1, -1, 335, 336, 337, 338,
- -1, -1, 341, 342, -1, 344, -1, -1, 347, 348,
- 349, 350, -1, -1, 353, 354, 355, 356, 357, -1,
- -1, -1, 361, 362, 363, 364, 257, 258, 259, 260,
- -1, -1, 263, -1, 265, 266, 267, 268, 269, 270,
- 271, 272, -1, -1, -1, -1, -1, -1, -1, -1,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, -1,
- -1, -1, -1, 304, 305, 306, 307, 308, 309, 310,
- 311, 312, 313, 314, 315, 316, 317, 318, 319, 320,
- 321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, 0, -1, 335, 336, 337, 338, -1, -1,
- 341, 342, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 353, 354, 355, 356, 357, -1, -1, -1,
- 361, 362, 363, 364, -1, 33, -1, -1, -1, -1,
- -1, -1, 40, 41, -1, -1, 44, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 59, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, -1, -1, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 33, -1, -1, -1, -1, -1, -1,
- 40, 41, -1, -1, 44, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 93, -1, -1, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
- 258, 259, 260, -1, -1, 263, 264, 265, 266, 267,
- 268, 269, 270, 271, 272, -1, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
- 298, 299, 300, -1, -1, 303, 304, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, -1,
- -1, -1, -1, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, -1, -1, 335, 336, 337,
- 338, -1, -1, 341, 342, -1, 344, -1, -1, 347,
- 348, -1, -1, -1, -1, 353, 354, 355, 356, 357,
- -1, -1, -1, 361, 362, 363, 364, 257, 258, 259,
- 260, -1, -1, 263, 264, 265, 266, 267, 268, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- 300, -1, -1, 303, 304, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, -1, -1,
- -1, -1, 322, 323, 324, 325, 326, 327, 328, 329,
- 330, 331, 332, 0, -1, 335, 336, 337, 338, -1,
- -1, 341, 342, -1, 344, -1, -1, -1, 348, -1,
- -1, -1, -1, 353, 354, 355, 356, 357, -1, -1,
- -1, 361, 362, 363, 364, -1, 33, -1, -1, -1,
- -1, -1, -1, 40, 41, -1, 43, 44, 45, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 59, -1, -1, 62, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 93, -1, -1, 96,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 0, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 125, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 33, -1, -1, -1, -1, -1,
- -1, 40, 41, -1, -1, 44, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 59, -1, -1, 62, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 93, -1, -1, 96, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 125, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 257, 258, 259, 260, -1, -1, 263, -1, 265, 266,
- 267, 268, 269, 270, 271, 272, -1, -1, -1, -1,
- -1, -1, -1, -1, 281, 282, 283, 284, 285, 286,
- 287, 288, 289, 290, 291, 292, 293, 294, 295, 296,
- 297, 298, 299, -1, -1, -1, -1, 304, 305, 306,
- 307, 308, 309, 310, 311, 312, 313, 314, 315, 316,
- -1, -1, -1, -1, -1, 322, 323, 324, 325, 326,
- 327, 328, 329, 330, 331, 332, -1, -1, 335, 336,
- 337, 338, -1, -1, 341, 342, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 353, 354, 355, 356,
- 357, -1, -1, -1, 361, 362, 363, 364, 257, 258,
- 259, 260, -1, -1, 263, -1, 265, 266, 267, 268,
- 269, 270, 271, 272, -1, -1, -1, -1, -1, -1,
- -1, -1, 281, 282, 283, 284, 285, 286, 287, 288,
- 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
- 299, -1, -1, -1, -1, 304, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316, -1, -1,
- -1, -1, -1, 322, 323, 324, 325, 326, 327, 328,
- 329, 330, 331, 332, 0, -1, 335, 336, 337, 338,
- -1, -1, 341, 342, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 353, 354, 355, 356, 357, -1,
- -1, -1, 361, 362, 363, 364, -1, 33, -1, -1,
- -1, -1, -1, -1, 40, 41, -1, -1, 44, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 93, -1, -1,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 125,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 33, -1, -1, -1, -1,
- -1, -1, 40, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 59, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, -1, -1, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 257, 258, 259, 260, -1, -1, 263, -1, 265,
- 266, 267, 268, 269, 270, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, -1, -1, -1, -1, 304, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, -1, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, -1, -1, 335,
- 336, 337, 338, -1, -1, 341, 342, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 353, 354, 355,
- 356, 357, -1, -1, -1, 361, 362, 363, 364, 257,
- 258, 259, 260, -1, -1, 263, -1, 265, 266, 267,
- 268, 269, 270, 271, 272, -1, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
- 298, 299, 0, -1, -1, -1, -1, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, -1,
- -1, -1, -1, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, 33, -1, 335, 336, 337,
- 338, -1, 40, 341, 342, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 353, 354, 355, 356, 357,
- -1, 59, -1, 361, 362, 363, 364, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, -1, -1, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 33, -1, -1, -1, -1, -1, -1,
- 40, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 93, -1, -1, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
- 258, 259, 260, -1, -1, 263, -1, 265, 266, 267,
- 268, 269, 270, 271, 272, -1, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
- 298, 299, -1, -1, -1, -1, -1, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, -1,
- -1, -1, -1, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, -1, -1, 335, 336, 337,
- 338, -1, -1, 341, 342, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 353, 354, 355, 356, 357,
- -1, -1, -1, 361, 362, 363, 364, 257, 258, 259,
- 260, -1, -1, 263, -1, 265, 266, 267, 268, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- 0, -1, -1, -1, -1, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, -1, -1,
- -1, -1, 322, 323, 324, 325, 326, 327, 328, 329,
- 330, 331, 332, 33, -1, 335, 336, 337, 338, -1,
- 40, 341, 342, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 353, 354, 355, 356, 357, -1, 59,
- -1, 361, 362, 363, 364, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 93, -1, -1, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 0, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, -1, -1, -1, -1, 40, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 93, -1, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 257, 258, 259,
- 260, -1, -1, 263, -1, 265, 266, 267, 268, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- -1, -1, -1, -1, -1, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, -1, -1,
- -1, -1, 322, 323, 324, 325, 326, 327, 328, 329,
- 330, 331, 332, -1, -1, 335, 336, 337, 338, -1,
- -1, 341, 342, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 353, 354, 355, 356, 357, -1, -1,
- -1, 361, 362, 363, 364, 257, 258, 259, 260, -1,
- -1, 263, -1, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, 0, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, 33, -1, 335, 336, 337, 338, -1, 40, 341,
- 342, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, 59, -1, 361,
- 362, 363, 364, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 93, -1, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 33,
- -1, -1, -1, -1, -1, -1, 40, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 59, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 93,
- -1, -1, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 125, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 257, 258, 259, 260, -1,
- -1, 263, -1, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, -1, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, -1, -1, 335, 336, 337, 338, -1, -1, 341,
- 342, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, 361,
- 362, 363, 364, 257, 258, 259, 260, -1, -1, 263,
- -1, 265, 266, 267, 268, 269, 270, 271, 272, -1,
- -1, -1, -1, -1, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, 296, 297, 298, 299, 0, -1, -1, -1,
- -1, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, -1, -1, -1, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, 33,
- -1, 335, 336, 337, 338, -1, 40, 341, 342, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 353,
- 354, 355, 356, 357, -1, 59, -1, 361, 362, 363,
- 364, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 93,
- -1, -1, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 0, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 125, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 33, -1, -1,
- -1, -1, -1, -1, 40, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 59, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 93, -1, -1,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 125,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 257, 258, 259, 260, -1, -1, 263,
- -1, 265, 266, 267, 268, 269, 270, 271, 272, -1,
- -1, -1, -1, -1, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, 296, 297, 298, 299, -1, -1, -1, -1,
- -1, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, -1, -1, -1, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, -1,
- -1, 335, 336, 337, 338, -1, -1, 341, 342, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 353,
- 354, 355, 356, 357, -1, -1, -1, 361, 362, 363,
- 364, 257, 258, 259, 260, -1, -1, 263, -1, 265,
- 266, 267, 268, 269, 270, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, 0, -1, -1, -1, -1, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, -1, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, 33, -1, 335,
- 336, 337, 338, -1, 40, 341, 342, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 353, 354, 355,
- 356, 357, -1, 59, -1, 361, 362, 363, 364, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 93, -1, -1,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 0, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 125,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 33, -1, -1, -1, -1,
- -1, -1, 40, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 59, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, -1, -1, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 257, 258, 259, 260, -1, -1, 263, -1, 265,
- 266, 267, 268, 269, 270, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, -1, -1, -1, -1, -1, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, -1, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, -1, -1, 335,
- 336, 337, 338, -1, -1, 341, 342, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 353, 354, 355,
- 356, 357, -1, -1, -1, 361, 362, 363, 364, 257,
- 258, 259, 260, -1, -1, 263, -1, 265, 266, 267,
- 268, 269, 270, 271, 272, -1, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
- 298, 299, 0, -1, -1, -1, -1, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, -1,
- -1, -1, -1, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, 33, -1, 335, 336, 337,
- 338, -1, 40, 341, 342, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 353, 354, 355, 356, 357,
- -1, 59, -1, 361, 362, 363, 364, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 93, -1, -1, 96, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 33, -1, -1, -1, -1, -1, -1,
- 40, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 59,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 93, -1, -1, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 257,
- 258, 259, 260, -1, -1, 263, -1, 265, 266, 267,
- 268, 269, 270, 271, 272, -1, -1, -1, -1, -1,
- -1, -1, -1, 281, 282, 283, 284, 285, 286, 287,
- 288, 289, 290, 291, 292, 293, 294, 295, 296, 297,
- 298, 299, -1, -1, -1, -1, -1, 305, 306, 307,
- 308, 309, 310, 311, 312, 313, 314, 315, 316, -1,
- -1, -1, -1, -1, 322, 323, 324, 325, 326, 327,
- 328, 329, 330, 331, 332, -1, -1, 335, 336, 337,
- 338, -1, -1, 341, 342, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 353, 354, 355, 356, 357,
- -1, -1, -1, 361, 362, 363, 364, 257, 258, 259,
- 260, -1, -1, 263, -1, 265, 266, 267, 268, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- 0, -1, -1, -1, -1, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, -1, -1,
- -1, -1, 322, 323, 324, 325, 326, 327, 328, 329,
- 330, 331, 332, 33, -1, 335, 336, 337, 338, -1,
- 40, 341, 342, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 353, 354, 355, 356, 357, -1, 59,
- -1, 361, 362, 363, 364, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 93, -1, -1, 96, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 0, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, -1, -1, -1, -1, 40, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 93, -1, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 257, 258, 259,
- 260, -1, -1, 263, -1, 265, 266, 267, 268, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- -1, -1, -1, -1, -1, 305, 306, 307, 308, 309,
- 310, 311, 312, 313, 314, 315, 316, -1, -1, -1,
- -1, -1, 322, 323, 324, 325, 326, 327, 328, 329,
- 330, 331, 332, -1, -1, 335, 336, 337, 338, -1,
- -1, 341, 342, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 353, 354, 355, 356, 357, -1, -1,
- -1, 361, 362, 363, 364, 257, 258, 259, 260, -1,
- -1, 263, -1, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, 0, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, 33, -1, 335, 336, 337, 338, -1, 40, 341,
- 342, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, 59, -1, 361,
- 362, 363, 364, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 93, -1, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 33,
- -1, -1, -1, -1, -1, -1, 40, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 59, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 93,
- -1, -1, 96, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 125, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 257, 258, 259, 260, -1,
- -1, 263, -1, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, -1, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, -1, -1, 335, 336, 337, 338, -1, -1, 341,
- 342, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, 361,
- 362, 363, 364, 257, 258, 259, 260, -1, -1, 263,
- -1, 265, 266, 267, 268, 269, 270, 271, 272, -1,
- -1, -1, -1, -1, -1, -1, -1, 281, 282, 283,
- 284, 285, 286, 287, 288, 289, 290, 291, 292, 293,
- 294, 295, 296, 297, 298, 299, -1, -1, -1, -1,
- -1, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, -1, -1, -1, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, 0,
- -1, 335, 336, 337, 338, -1, -1, 341, 342, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 353,
- 354, 355, 356, 357, -1, -1, -1, 361, 362, 363,
- 364, -1, 33, -1, -1, -1, -1, -1, -1, 40,
- 41, -1, 43, 44, 45, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 59, -1,
- -1, 62, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 0, -1, -1, -1, -1,
- -1, -1, 93, -1, -1, 96, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 33, -1,
- -1, -1, -1, -1, 125, 40, 41, -1, 0, 44,
- 45, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 59, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, -1, -1, -1, -1, 40, 41,
- -1, -1, 44, -1, -1, -1, -1, -1, 93, -1,
- -1, 96, -1, -1, -1, -1, -1, 59, 60, -1,
- 62, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 125, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 93, -1, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, 257, 258, 259, 260,
- -1, -1, 263, -1, 265, 266, 267, 268, 269, 270,
- 271, 272, -1, -1, -1, -1, -1, -1, -1, -1,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, 0,
- -1, -1, -1, 304, 305, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 317, 318, 319, 320,
- 321, 322, 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, 33, -1, -1, -1, -1, -1, -1, 40,
- 341, 342, 257, 258, 259, 260, -1, -1, 263, -1,
- 265, 266, 267, 268, 269, 270, -1, -1, 59, -1,
- 361, 362, 363, 364, -1, -1, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, 257, 258, 259, 260, -1,
- 305, 263, 93, -1, -1, 96, 268, -1, -1, 271,
- 272, -1, -1, -1, -1, -1, -1, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, -1, -1,
- -1, -1, -1, -1, 125, -1, 341, 342, 0, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, 361, 362, 363, 364,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, 33, -1, 335, 336, 337, 338, -1, 40, -1,
- -1, -1, -1, -1, -1, 347, 348, 349, 350, 351,
- 352, 353, 354, 355, 356, 357, -1, 59, -1, -1,
- -1, -1, 364, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 93, -1, -1, 96, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, 257, 258, 259, 260,
- -1, -1, 263, -1, -1, -1, -1, 268, -1, -1,
- 271, 272, -1, -1, -1, -1, -1, -1, -1, -1,
- 0, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 59, -1,
- -1, -1, -1, -1, 305, 306, 307, 308, 309, 310,
- 311, 312, 313, 314, 315, 316, -1, -1, -1, -1,
- -1, 322, 323, 324, 325, 326, 327, 328, 329, 330,
- 331, 332, 93, -1, 335, 336, 337, 338, -1, 59,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 353, 354, 355, 356, 357, -1, -1, -1,
- -1, -1, -1, 364, 125, -1, -1, -1, 0, -1,
- -1, -1, -1, 93, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 257, 258, 259, 260, -1,
- -1, 263, -1, -1, -1, -1, 268, -1, -1, 271,
- 272, -1, -1, -1, -1, 125, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, -1, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, 93, -1, 335, 336, 337, 338, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, 0,
- -1, -1, 364, 125, -1, -1, -1, -1, -1, 260,
- -1, -1, -1, -1, 265, 266, 267, -1, 269, 270,
- 271, 272, -1, -1, -1, -1, -1, -1, -1, -1,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, 300,
- 260, -1, -1, -1, -1, 265, 266, 267, 59, 269,
- 270, 271, 272, -1, -1, -1, -1, -1, -1, -1,
- -1, 281, 282, 283, 284, 285, 286, 287, 288, 289,
- 290, 291, 292, 293, 294, 295, 296, 297, 298, 299,
- 341, 342, 93, -1, -1, -1, -1, -1, -1, 0,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 361, 362, 363, 364, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 125, -1, -1, -1, -1, -1,
- -1, 341, 342, -1, -1, -1, -1, -1, 260, -1,
- -1, -1, -1, 265, 266, 267, -1, 269, 270, 271,
- 272, 361, 362, 363, 364, -1, -1, -1, 59, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, 300, -1,
- -1, -1, -1, -1, 0, -1, 0, -1, -1, -1,
- -1, -1, 93, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 341,
- 342, -1, -1, -1, 125, -1, -1, -1, -1, 43,
- -1, 45, 46, -1, -1, -1, -1, -1, -1, 361,
- 362, 363, 364, 59, -1, 59, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 260,
- -1, -1, -1, -1, 265, 266, 267, -1, 269, 270,
- 271, 272, -1, -1, -1, -1, -1, 93, -1, 93,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 0, 125,
- -1, 125, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 341, 342, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 260,
- 361, 362, 363, 364, 265, 266, 267, 59, 269, 270,
- 271, 272, -1, -1, -1, -1, -1, -1, -1, -1,
- 281, 282, 283, 284, 285, 286, 287, 288, 289, 290,
- 291, 292, 293, 294, 295, 296, 297, 298, 299, -1,
- -1, 93, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 0, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- 341, 342, -1, -1, 260, -1, -1, -1, -1, 265,
- 266, 267, -1, 269, 270, 271, 272, 271, 272, -1,
- 361, 362, 363, 364, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, 59, -1, -1, -1, -1, -1,
- -1, -1, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, 317, 318, 319, 320, 321, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 93, -1,
- -1, 335, 336, 337, 338, 341, 342, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 353,
- 354, 355, 356, 357, -1, 361, 362, 363, 364, -1,
- 125, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 260, -1,
- -1, -1, -1, 265, 266, 267, -1, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, 0, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, -1, -1, -1, -1, 40, 341,
- 342, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 59, -1, 361,
- 362, 363, 364, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 260, -1, -1, -1, -1,
- 265, 266, 267, -1, 269, 270, 271, 272, -1, -1,
- -1, 93, -1, -1, 96, -1, 281, 282, 283, 284,
- 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
- 295, 296, 297, 298, 299, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 33, -1,
- -1, -1, -1, -1, -1, 40, -1, -1, -1, -1,
- 45, -1, -1, -1, -1, -1, 341, 342, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 361, 362, 363, 364,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 91, -1, -1, -1,
- -1, 96, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 123, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 257, 258, 259, -1, -1,
- -1, 263, -1, 265, 266, 267, 268, 269, 270, 271,
- 272, -1, -1, -1, -1, -1, -1, -1, -1, 281,
- 282, 283, 284, 285, 286, 287, 288, 289, 290, 291,
- 292, 293, 294, 295, 296, 297, 298, 299, -1, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, -1, -1, 335, 336, 337, 338, -1, -1, 341,
- 342, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, 361,
- 362, 363, 257, 258, 259, 260, 261, -1, 263, -1,
- -1, -1, -1, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, -1, -1, 33, -1,
- -1, -1, -1, -1, -1, 40, -1, -1, -1, -1,
- 45, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, -1, -1, -1, -1, -1, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, 333, -1,
- 335, 336, 337, 338, 339, 340, 91, -1, 343, -1,
- 345, 96, -1, -1, -1, -1, -1, -1, 353, 354,
- 355, 356, 357, 358, -1, 360, -1, -1, -1, 364,
- 365, -1, -1, -1, -1, -1, -1, -1, 123, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 33, -1, -1,
- -1, -1, -1, -1, 40, -1, -1, -1, -1, 45,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 257, 258, 259, 260, 261, -1, 263, -1,
- -1, -1, -1, 268, 269, 270, 271, 272, 273, 274,
- 275, 276, 277, 278, 279, 280, 33, -1, -1, -1,
- -1, -1, -1, 40, 41, -1, -1, -1, 45, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
- 315, 316, -1, -1, -1, -1, -1, 322, 323, 324,
- 325, 326, 327, 328, 329, 330, 331, 332, 333, -1,
- 335, 336, 337, 338, 339, 340, -1, -1, 343, 96,
- 345, -1, -1, -1, -1, -1, -1, -1, 353, 354,
- 355, 356, 357, 358, -1, 360, -1, -1, -1, 364,
- 365, 257, 258, 259, 260, -1, -1, 263, -1, 265,
- 266, 267, 268, 269, 270, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, 281, 282, 283, 284, 285,
- 286, 287, 288, 289, 290, 291, 292, 293, 294, 295,
- 296, 297, 298, 299, -1, -1, -1, -1, -1, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, -1, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, -1, -1, 335,
- 336, 337, 338, -1, 33, 341, 342, -1, -1, -1,
- -1, 40, -1, -1, -1, -1, 45, 353, 354, 355,
- 356, 357, -1, -1, -1, 361, 362, 363, 364, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 257, 258, 259, 260, -1, -1, 263, 96, -1, -1,
- -1, 268, -1, -1, 271, 272, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 305, 306,
- 307, 308, 309, 310, 311, 312, 313, 314, 315, 316,
- -1, -1, -1, -1, -1, 322, 323, 324, 325, 326,
- 327, 328, 329, 330, 331, 332, 33, -1, 335, 336,
- 337, 338, -1, 40, -1, -1, -1, -1, 45, -1,
- -1, -1, -1, -1, -1, -1, 353, 354, 355, 356,
- 357, -1, -1, -1, -1, -1, -1, 364, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 96,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 257, 258,
- 259, 260, -1, -1, 263, -1, -1, -1, -1, 268,
- -1, -1, 271, 272, -1, -1, -1, 33, -1, -1,
- -1, -1, -1, -1, 40, -1, -1, -1, -1, 45,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 305, 306, 307, 308,
- 309, 310, 311, 312, 313, 314, 315, 316, -1, -1,
- -1, -1, -1, 322, 323, 324, 325, 326, 327, 328,
- 329, 330, 331, 332, -1, -1, 335, 336, 337, 338,
- 96, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 353, 354, 355, 356, 357, -1,
- -1, -1, -1, -1, -1, 364, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 33, -1, -1,
- 257, 258, 259, 260, 40, -1, 263, -1, -1, 45,
- -1, 268, -1, -1, 271, 272, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 305, 306,
- 307, 308, 309, 310, 311, 312, 313, 314, 315, 316,
- 96, -1, -1, -1, -1, 322, 323, 324, 325, 326,
- 327, 328, 329, 330, 331, 332, -1, -1, 335, 336,
- 337, 338, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 353, 354, 355, 356,
- 357, -1, -1, -1, -1, -1, -1, 364, -1, 33,
- -1, 257, 258, 259, 260, -1, 40, 263, 42, -1,
- -1, 45, 268, -1, -1, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, 96, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, -1, -1, 335,
- 336, 337, 338, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 353, 354, 355,
- 356, 357, -1, -1, -1, -1, -1, -1, 364, 33,
- -1, 257, 258, 259, 260, -1, 40, 263, -1, -1,
- -1, 45, 268, -1, -1, 271, 272, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 305,
- 306, 307, 308, 309, 310, 311, 312, 313, 314, 315,
- 316, -1, 96, -1, -1, -1, 322, 323, 324, 325,
- 326, 327, 328, 329, 330, 331, 332, -1, -1, 335,
- 336, 337, 338, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 353, 354, 355,
- 356, 357, -1, -1, -1, -1, -1, -1, 364, -1,
- 33, -1, -1, 257, 258, 259, -1, 40, -1, 263,
- -1, -1, 45, -1, 268, -1, -1, 271, 272, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, 96, -1, -1, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, -1,
- -1, 335, 336, 337, 338, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 353,
- 354, 355, 356, 357, -1, -1, -1, -1, -1, -1,
- 33, -1, -1, 257, 258, 259, -1, 40, -1, 263,
- -1, -1, 45, -1, 268, -1, -1, 271, 272, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 305, 306, 307, 308, 309, 310, 311, 312, 313,
- 314, 315, 316, 96, -1, -1, -1, -1, 322, 323,
- 324, 325, 326, 327, 328, 329, 330, 331, 332, -1,
- -1, 335, 336, 337, 338, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 353,
- 354, 355, 356, 357, -1, -1, -1, -1, -1, -1,
- -1, 33, -1, -1, 257, 258, 259, -1, 40, -1,
- 263, -1, -1, 45, -1, 268, -1, -1, 271, 272,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 305, 306, 307, 308, 309, 310, 311, 312,
- 313, 314, 315, 316, 96, -1, -1, -1, -1, 322,
- 323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
- -1, -1, 335, 336, 337, 338, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 353, 354, 355, 356, 357, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 257, 258, 259, -1, -1, -1,
- 263, -1, -1, -1, -1, 268, -1, -1, 271, 272,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 59, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 305, 306, 307, 308, 309, 310, 311, 312,
- 313, 314, 315, 316, 91, -1, -1, -1, -1, 322,
- 323, 324, 325, 326, 327, 328, 329, 330, 331, 332,
- -1, -1, 335, 336, 337, 338, -1, -1, -1, -1,
- -1, -1, 91, -1, -1, -1, 123, -1, -1, -1,
- 353, 354, 355, 356, 357, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 257, 258, 259, -1, -1,
- -1, 263, -1, -1, 123, -1, 268, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 305, 306, 307, 308, 309, 310, 311,
- 312, 313, 314, 315, 316, -1, -1, -1, -1, -1,
- 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
- 332, -1, -1, 335, 336, 337, 338, -1, -1, -1,
- -1, -1, -1, 91, -1, -1, -1, -1, -1, -1,
- -1, 353, 354, 355, 356, 357, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 257, 258, -1, 260, 261, 123, -1, -1, -1, -1,
- -1, -1, 269, 270, 271, 272, 273, 274, 275, 276,
- 277, 278, 279, 280, -1, -1, -1, -1, 257, 258,
- -1, 260, 261, -1, -1, -1, -1, -1, -1, -1,
- 269, 270, 271, 272, 273, 274, 275, 276, 277, 278,
- 279, 280, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 333, -1, -1, -1,
- -1, -1, 339, 340, -1, -1, 343, -1, 345, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 358, -1, 360, 333, -1, -1, 364, 365, -1,
- 339, 340, -1, -1, 343, -1, 345, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 358,
- -1, 360, -1, -1, -1, 364, 365, -1, -1, 257,
- 258, -1, 260, 261, -1, -1, -1, -1, -1, -1,
- -1, 269, 270, 271, 272, 273, 274, 275, 276, 277,
- 278, 279, 280, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 333, -1, -1, -1, -1,
- -1, 339, 340, -1, -1, 343, -1, 345, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 358, -1, 360, -1, -1, -1, 364, 365,
-};
-#define YYFINAL 2
-#ifndef YYDEBUG
-#define YYDEBUG 0
-#endif
-#define YYMAXTOKEN 367
-#if YYDEBUG
-char *yyname[] = {
-"end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-"'!'",0,0,0,"'%'",0,0,"'('","')'","'*'","'+'","','","'-'","'.'","'/'",0,0,0,0,0,
-0,0,0,0,0,"':'","';'","'<'","'='","'>'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,"'['",0,"']'","'^'",0,"'`'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,"'{'",0,"'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
-0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"LABEL","VARIABLE","NUMBER",
-"TEXT","COMMAND_LINE","DELIMITED","ORDINAL","TH","LEFT_ARROW_HEAD",
-"RIGHT_ARROW_HEAD","DOUBLE_ARROW_HEAD","LAST","UP","DOWN","LEFT","RIGHT","BOX",
-"CIRCLE","ELLIPSE","ARC","LINE","ARROW","MOVE","SPLINE","HEIGHT","RADIUS",
-"WIDTH","DIAMETER","FROM","TO","AT","WITH","BY","THEN","DOTTED","DASHED","CHOP",
-"SAME","INVISIBLE","LJUST","RJUST","ABOVE","BELOW","OF","THE","WAY","BETWEEN",
-"AND","HERE","DOT_N","DOT_E","DOT_W","DOT_S","DOT_NE","DOT_SE","DOT_NW",
-"DOT_SW","DOT_C","DOT_START","DOT_END","DOT_X","DOT_Y","DOT_HT","DOT_WID",
-"DOT_RAD","SIN","COS","ATAN2","LOG","EXP","SQRT","K_MAX","K_MIN","INT","RAND",
-"SRAND","COPY","THRU","TOP","BOTTOM","UPPER","LOWER","SH","PRINT","CW","CCW",
-"FOR","DO","IF","ELSE","ANDAND","OROR","NOTEQUAL","EQUALEQUAL","LESSEQUAL",
-"GREATEREQUAL","LEFT_CORNER","RIGHT_CORNER","CENTER","END","START","RESET",
-"UNTIL","PLOT","THICKNESS","FILL","ALIGNED","SPRINTF","COMMAND","DEFINE",
-"UNDEF",
-};
-char *yyrule[] = {
-"$accept : top",
-"top : optional_separator",
-"top : element_list",
-"element_list : optional_separator middle_element_list optional_separator",
-"middle_element_list : element",
-"middle_element_list : middle_element_list separator element",
-"optional_separator :",
-"optional_separator : separator",
-"separator : ';'",
-"separator : separator ';'",
-"placeless_element : VARIABLE '=' any_expr",
-"placeless_element : VARIABLE ':' '=' any_expr",
-"placeless_element : UP",
-"placeless_element : DOWN",
-"placeless_element : LEFT",
-"placeless_element : RIGHT",
-"placeless_element : COMMAND_LINE",
-"placeless_element : COMMAND print_args",
-"placeless_element : PRINT print_args",
-"$$1 :",
-"placeless_element : SH $$1 DELIMITED",
-"placeless_element : COPY TEXT",
-"$$2 :",
-"$$3 :",
-"placeless_element : COPY TEXT THRU $$2 DELIMITED $$3 until",
-"$$4 :",
-"$$5 :",
-"placeless_element : COPY THRU $$4 DELIMITED $$5 until",
-"$$6 :",
-"placeless_element : FOR VARIABLE '=' expr TO expr optional_by DO $$6 DELIMITED",
-"placeless_element : simple_if",
-"$$7 :",
-"placeless_element : simple_if ELSE $$7 DELIMITED",
-"placeless_element : reset_variables",
-"placeless_element : RESET",
-"reset_variables : RESET VARIABLE",
-"reset_variables : reset_variables VARIABLE",
-"reset_variables : reset_variables ',' VARIABLE",
-"print_args : print_arg",
-"print_args : print_args print_arg",
-"print_arg : expr",
-"print_arg : text",
-"print_arg : position",
-"$$8 :",
-"simple_if : IF any_expr THEN $$8 DELIMITED",
-"until :",
-"until : UNTIL TEXT",
-"any_expr : expr",
-"any_expr : text_expr",
-"text_expr : text EQUALEQUAL text",
-"text_expr : text NOTEQUAL text",
-"text_expr : text_expr ANDAND text_expr",
-"text_expr : text_expr ANDAND expr",
-"text_expr : expr ANDAND text_expr",
-"text_expr : text_expr OROR text_expr",
-"text_expr : text_expr OROR expr",
-"text_expr : expr OROR text_expr",
-"text_expr : '!' text_expr",
-"optional_by :",
-"optional_by : BY expr",
-"optional_by : BY '*' expr",
-"element : object_spec",
-"element : LABEL ':' optional_separator element",
-"element : LABEL ':' optional_separator position_not_place",
-"element : LABEL ':' optional_separator place",
-"$$9 :",
-"$$10 :",
-"element : '{' $$9 element_list '}' $$10 optional_element",
-"element : placeless_element",
-"optional_element :",
-"optional_element : element",
-"object_spec : BOX",
-"object_spec : CIRCLE",
-"object_spec : ELLIPSE",
-"object_spec : ARC",
-"object_spec : LINE",
-"object_spec : ARROW",
-"object_spec : MOVE",
-"object_spec : SPLINE",
-"object_spec : text",
-"object_spec : PLOT expr",
-"object_spec : PLOT expr text",
-"$$11 :",
-"object_spec : '[' $$11 element_list ']'",
-"object_spec : object_spec HEIGHT expr",
-"object_spec : object_spec RADIUS expr",
-"object_spec : object_spec WIDTH expr",
-"object_spec : object_spec DIAMETER expr",
-"object_spec : object_spec expr",
-"object_spec : object_spec UP",
-"object_spec : object_spec UP expr",
-"object_spec : object_spec DOWN",
-"object_spec : object_spec DOWN expr",
-"object_spec : object_spec RIGHT",
-"object_spec : object_spec RIGHT expr",
-"object_spec : object_spec LEFT",
-"object_spec : object_spec LEFT expr",
-"object_spec : object_spec FROM position",
-"object_spec : object_spec TO position",
-"object_spec : object_spec AT position",
-"object_spec : object_spec WITH path",
-"object_spec : object_spec BY expr_pair",
-"object_spec : object_spec THEN",
-"object_spec : object_spec DOTTED",
-"object_spec : object_spec DOTTED expr",
-"object_spec : object_spec DASHED",
-"object_spec : object_spec DASHED expr",
-"object_spec : object_spec FILL",
-"object_spec : object_spec FILL expr",
-"object_spec : object_spec CHOP",
-"object_spec : object_spec CHOP expr",
-"object_spec : object_spec SAME",
-"object_spec : object_spec INVISIBLE",
-"object_spec : object_spec LEFT_ARROW_HEAD",
-"object_spec : object_spec RIGHT_ARROW_HEAD",
-"object_spec : object_spec DOUBLE_ARROW_HEAD",
-"object_spec : object_spec CW",
-"object_spec : object_spec CCW",
-"object_spec : object_spec text",
-"object_spec : object_spec LJUST",
-"object_spec : object_spec RJUST",
-"object_spec : object_spec ABOVE",
-"object_spec : object_spec BELOW",
-"object_spec : object_spec THICKNESS expr",
-"object_spec : object_spec ALIGNED",
-"text : TEXT",
-"text : SPRINTF '(' TEXT sprintf_args ')'",
-"sprintf_args :",
-"sprintf_args : sprintf_args ',' expr",
-"position : position_not_place",
-"position : place",
-"position_not_place : expr_pair",
-"position_not_place : position '+' expr_pair",
-"position_not_place : position '-' expr_pair",
-"position_not_place : '(' position ',' position ')'",
-"position_not_place : expr between position AND position",
-"position_not_place : expr '<' position ',' position '>'",
-"between : BETWEEN",
-"between : OF THE WAY BETWEEN",
-"expr_pair : expr ',' expr",
-"expr_pair : '(' expr_pair ')'",
-"place : label",
-"place : label corner",
-"place : corner label",
-"place : corner OF label",
-"place : HERE",
-"label : LABEL",
-"label : nth_primitive",
-"label : label '.' LABEL",
-"ordinal : ORDINAL",
-"ordinal : '`' any_expr TH",
-"optional_ordinal_last : LAST",
-"optional_ordinal_last : ordinal LAST",
-"nth_primitive : ordinal object_type",
-"nth_primitive : optional_ordinal_last object_type",
-"object_type : BOX",
-"object_type : CIRCLE",
-"object_type : ELLIPSE",
-"object_type : ARC",
-"object_type : LINE",
-"object_type : ARROW",
-"object_type : SPLINE",
-"object_type : '[' ']'",
-"object_type : TEXT",
-"label_path : '.' LABEL",
-"label_path : label_path '.' LABEL",
-"relative_path : corner",
-"relative_path : label_path",
-"relative_path : label_path corner",
-"path : relative_path",
-"path : '(' relative_path ',' relative_path ')'",
-"path : ORDINAL LAST object_type relative_path",
-"path : LAST object_type relative_path",
-"path : ORDINAL object_type relative_path",
-"path : LABEL relative_path",
-"corner : DOT_N",
-"corner : DOT_E",
-"corner : DOT_W",
-"corner : DOT_S",
-"corner : DOT_NE",
-"corner : DOT_SE",
-"corner : DOT_NW",
-"corner : DOT_SW",
-"corner : DOT_C",
-"corner : DOT_START",
-"corner : DOT_END",
-"corner : TOP",
-"corner : BOTTOM",
-"corner : LEFT",
-"corner : RIGHT",
-"corner : UPPER LEFT",
-"corner : LOWER LEFT",
-"corner : UPPER RIGHT",
-"corner : LOWER RIGHT",
-"corner : LEFT_CORNER",
-"corner : RIGHT_CORNER",
-"corner : UPPER LEFT_CORNER",
-"corner : LOWER LEFT_CORNER",
-"corner : UPPER RIGHT_CORNER",
-"corner : LOWER RIGHT_CORNER",
-"corner : CENTER",
-"corner : START",
-"corner : END",
-"expr : VARIABLE",
-"expr : NUMBER",
-"expr : place DOT_X",
-"expr : place DOT_Y",
-"expr : place DOT_HT",
-"expr : place DOT_WID",
-"expr : place DOT_RAD",
-"expr : expr '+' expr",
-"expr : expr '-' expr",
-"expr : expr '*' expr",
-"expr : expr '/' expr",
-"expr : expr '%' expr",
-"expr : expr '^' expr",
-"expr : '-' expr",
-"expr : '(' any_expr ')'",
-"expr : SIN '(' any_expr ')'",
-"expr : COS '(' any_expr ')'",
-"expr : ATAN2 '(' any_expr ',' any_expr ')'",
-"expr : LOG '(' any_expr ')'",
-"expr : EXP '(' any_expr ')'",
-"expr : SQRT '(' any_expr ')'",
-"expr : K_MAX '(' any_expr ',' any_expr ')'",
-"expr : K_MIN '(' any_expr ',' any_expr ')'",
-"expr : INT '(' any_expr ')'",
-"expr : RAND '(' any_expr ')'",
-"expr : RAND '(' ')'",
-"expr : SRAND '(' any_expr ')'",
-"expr : expr '<' expr",
-"expr : expr LESSEQUAL expr",
-"expr : expr '>' expr",
-"expr : expr GREATEREQUAL expr",
-"expr : expr EQUALEQUAL expr",
-"expr : expr NOTEQUAL expr",
-"expr : expr ANDAND expr",
-"expr : expr OROR expr",
-"expr : '!' expr",
-};
-#endif
-#ifdef YYSTACKSIZE
-#undef YYMAXDEPTH
-#define YYMAXDEPTH YYSTACKSIZE
-#else
-#ifdef YYMAXDEPTH
-#define YYSTACKSIZE YYMAXDEPTH
-#else
-#define YYSTACKSIZE 500
-#define YYMAXDEPTH 500
-#endif
-#endif
-int yydebug;
-int yynerrs;
-int yyerrflag;
-int yychar;
-short *yyssp;
-YYSTYPE *yyvsp;
-YYSTYPE yyval;
-YYSTYPE yylval;
-short yyss[YYSTACKSIZE];
-YYSTYPE yyvs[YYSTACKSIZE];
-#define yystacksize YYSTACKSIZE
-#line 1537 "/home/cjk/groff/pic/pic.y"
-
-/* bison defines const to be empty unless __STDC__ is defined, which it
-isn't under cfront */
-
-#ifdef const
-#undef const
-#endif
-
-static struct {
- const char *name;
- double val;
- int scaled; // non-zero if val should be multiplied by scale
-} defaults_table[] = {
- { "arcrad", .25, 1 },
- { "arrowht", .1, 1 },
- { "arrowwid", .05, 1 },
- { "circlerad", .25, 1 },
- { "boxht", .5, 1 },
- { "boxwid", .75, 1 },
- { "boxrad", 0.0, 1 },
- { "dashwid", .05, 1 },
- { "ellipseht", .5, 1 },
- { "ellipsewid", .75, 1 },
- { "moveht", .5, 1 },
- { "movewid", .5, 1 },
- { "lineht", .5, 1 },
- { "linewid", .5, 1 },
- { "textht", 0.0, 1 },
- { "textwid", 0.0, 1 },
- { "scale", 1.0, 0 },
- { "linethick", -1.0, 0 }, // in points
- { "fillval", .5, 0 },
- { "arrowhead", 1.0, 0 },
- { "maxpswid", 8.5, 0 },
- { "maxpsht", 11.0, 0 },
-};
-
-place *lookup_label(const char *label)
-{
- saved_state *state = current_saved_state;
- PTABLE(place) *tbl = current_table;
- for (;;) {
- place *pl = tbl->lookup(label);
- if (pl)
- return pl;
- if (!state)
- return 0;
- tbl = state->tbl;
- state = state->prev;
- }
-}
-
-void define_label(const char *label, const place *pl)
-{
- place *p = new place;
- *p = *pl;
- current_table->define(label, p);
-}
-
-int lookup_variable(const char *name, double *val)
-{
- place *pl = lookup_label(name);
- if (pl) {
- *val = pl->x;
- return 1;
- }
- return 0;
-}
-
-void define_variable(const char *name, double val)
-{
- place *p = new place;
- p->obj = 0;
- p->x = val;
- p->y = 0.0;
- current_table->define(name, p);
- if (strcmp(name, "scale") == 0) {
- // When the scale changes, reset all scaled pre-defined variables to
- // their default values.
- for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
- if (defaults_table[i].scaled)
- define_variable(defaults_table[i].name, val*defaults_table[i].val);
- }
-}
-
-// called once only (not once per parse)
-
-void parse_init()
-{
- current_direction = RIGHT_DIRECTION;
- current_position.x = 0.0;
- current_position.y = 0.0;
- // This resets everything to its default value.
- reset_all();
-}
-
-void reset(const char *nm)
-{
- for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
- if (strcmp(nm, defaults_table[i].name) == 0) {
- double val = defaults_table[i].val;
- if (defaults_table[i].scaled) {
- double scale;
- lookup_variable("scale", &scale);
- val *= scale;
- }
- define_variable(defaults_table[i].name, val);
- return;
- }
- lex_error("`%1' is not a predefined variable", nm);
-}
-
-void reset_all()
-{
- // We only have to explicitly reset the pre-defined variables that
- // aren't scaled because `scale' is not scaled, and changing the
- // value of `scale' will reset all the pre-defined variables that
- // are scaled.
- for (int i = 0; i < sizeof(defaults_table)/sizeof(defaults_table[0]); i++)
- if (!defaults_table[i].scaled)
- define_variable(defaults_table[i].name, defaults_table[i].val);
-}
-
-// called after each parse
-
-void parse_cleanup()
-{
- while (current_saved_state != 0) {
- delete current_table;
- current_table = current_saved_state->tbl;
- saved_state *tem = current_saved_state;
- current_saved_state = current_saved_state->prev;
- delete tem;
- }
- assert(current_table == &top_table);
- PTABLE_ITERATOR(place) iter(current_table);
- const char *key;
- place *pl;
- while (iter.next(&key, &pl))
- if (pl->obj != 0) {
- position pos = pl->obj->origin();
- pl->obj = 0;
- pl->x = pos.x;
- pl->y = pos.y;
- }
- while (olist.head != 0) {
- object *tem = olist.head;
- olist.head = olist.head->next;
- delete tem;
- }
- olist.tail = 0;
- current_direction = RIGHT_DIRECTION;
- current_position.x = 0.0;
- current_position.y = 0.0;
-}
-
-const char *ordinal_postfix(int n)
-{
- if (n < 10 || n > 20)
- switch (n % 10) {
- case 1:
- return "st";
- case 2:
- return "nd";
- case 3:
- return "rd";
- }
- return "th";
-}
-
-const char *object_type_name(object_type type)
-{
- switch (type) {
- case BOX_OBJECT:
- return "box";
- case CIRCLE_OBJECT:
- return "circle";
- case ELLIPSE_OBJECT:
- return "ellipse";
- case ARC_OBJECT:
- return "arc";
- case SPLINE_OBJECT:
- return "spline";
- case LINE_OBJECT:
- return "line";
- case ARROW_OBJECT:
- return "arrow";
- case MOVE_OBJECT:
- return "move";
- case TEXT_OBJECT:
- return "\"\"";
- case BLOCK_OBJECT:
- return "[]";
- case OTHER_OBJECT:
- case MARK_OBJECT:
- default:
- break;
- }
- return "object";
-}
-
-static char sprintf_buf[1024];
-
-char *format_number(const char *form, double n)
-{
- if (form == 0)
- form = "%g";
- else {
- // this is a fairly feeble attempt at validation of the format
- int nspecs = 0;
- for (const char *p = form; *p != '\0'; p++)
- if (*p == '%') {
- if (p[1] == '%')
- p++;
- else
- nspecs++;
- }
- if (nspecs > 1) {
- lex_error("bad format `%1'", form);
- return strsave(form);
- }
- }
- sprintf(sprintf_buf, form, n);
- return strsave(sprintf_buf);
-}
-
-char *do_sprintf(const char *form, const double *v, int nv)
-{
- string result;
- int i = 0;
- string one_format;
- while (*form) {
- if (*form == '%') {
- one_format += *form++;
- for (; *form != '\0' && strchr("#-+ 0123456789.", *form) != 0; form++)
- one_format += *form;
- if (*form == '\0' || strchr("eEfgG%", *form) == 0) {
- lex_error("bad sprintf format");
- result += one_format;
- result += form;
- break;
- }
- if (*form == '%') {
- one_format += *form++;
- one_format += '\0';
- sprintf(sprintf_buf, one_format.contents());
- }
- else {
- if (i >= nv) {
- lex_error("too few arguments to sprintf");
- result += one_format;
- result += form;
- break;
- }
- one_format += *form++;
- one_format += '\0';
- sprintf(sprintf_buf, one_format.contents(), v[i++]);
- }
- one_format.clear();
- result += sprintf_buf;
- }
- else
- result += *form++;
- }
- result += '\0';
- return strsave(result.contents());
-}
-#line 3419 "y.tab.c"
-#define YYABORT goto yyabort
-#define YYREJECT goto yyabort
-#define YYACCEPT goto yyaccept
-#define YYERROR goto yyerrlab
-int
-#if defined(__STDC__)
-yyparse(void)
-#else
-yyparse()
-#endif
-{
- register int yym, yyn, yystate;
-#if YYDEBUG
- register char *yys;
- extern char *getenv();
-
- if (yys = getenv("YYDEBUG"))
- {
- yyn = *yys;
- if (yyn >= '0' && yyn <= '9')
- yydebug = yyn - '0';
- }
-#endif
-
- yynerrs = 0;
- yyerrflag = 0;
- yychar = (-1);
-
- yyssp = yyss;
- yyvsp = yyvs;
- *yyssp = yystate = 0;
-
-yyloop:
- if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
- if (yychar < 0)
- {
- if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
- if (yydebug)
- {
- yys = 0;
- if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
- if (!yys) yys = "illegal-symbol";
- printf("%sdebug: state %d, reading %d (%s)\n",
- YYPREFIX, yystate, yychar, yys);
- }
-#endif
- }
- if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
- {
-#if YYDEBUG
- if (yydebug)
- printf("%sdebug: state %d, shifting to state %d\n",
- YYPREFIX, yystate, yytable[yyn]);
-#endif
- if (yyssp >= yyss + yystacksize - 1)
- {
- goto yyoverflow;
- }
- *++yyssp = yystate = yytable[yyn];
- *++yyvsp = yylval;
- yychar = (-1);
- if (yyerrflag > 0) --yyerrflag;
- goto yyloop;
- }
- if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == yychar)
- {
- yyn = yytable[yyn];
- goto yyreduce;
- }
- if (yyerrflag) goto yyinrecovery;
- yyerror("syntax error");
-#ifdef lint
- goto yyerrlab;
-#endif
-yyerrlab:
- ++yynerrs;
-yyinrecovery:
- if (yyerrflag < 3)
- {
- yyerrflag = 3;
- for (;;)
- {
- if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == YYERRCODE)
- {
-#if YYDEBUG
- if (yydebug)
- printf("%sdebug: state %d, error recovery shifting\
- to state %d\n", YYPREFIX, *yyssp, yytable[yyn]);
-#endif
- if (yyssp >= yyss + yystacksize - 1)
- {
- goto yyoverflow;
- }
- *++yyssp = yystate = yytable[yyn];
- *++yyvsp = yylval;
- goto yyloop;
- }
- else
- {
-#if YYDEBUG
- if (yydebug)
- printf("%sdebug: error recovery discarding state %d\n",
- YYPREFIX, *yyssp);
-#endif
- if (yyssp <= yyss) goto yyabort;
- --yyssp;
- --yyvsp;
- }
- }
- }
- else
- {
- if (yychar == 0) goto yyabort;
-#if YYDEBUG
- if (yydebug)
- {
- yys = 0;
- if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
- if (!yys) yys = "illegal-symbol";
- printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
- YYPREFIX, yystate, yychar, yys);
- }
-#endif
- yychar = (-1);
- goto yyloop;
- }
-yyreduce:
-#if YYDEBUG
- if (yydebug)
- printf("%sdebug: state %d, reducing by rule %d (%s)\n",
- YYPREFIX, yystate, yyn, yyrule[yyn]);
-#endif
- yym = yylen[yyn];
- yyval = yyvsp[1-yym];
- switch (yyn)
- {
-case 2:
-#line 278 "/home/cjk/groff/pic/pic.y"
-{
- if (olist.head)
- print_picture(olist.head);
- }
-break;
-case 3:
-#line 287 "/home/cjk/groff/pic/pic.y"
-{ yyval.pl = yyvsp[-1].pl; }
-break;
-case 4:
-#line 292 "/home/cjk/groff/pic/pic.y"
-{ yyval.pl = yyvsp[0].pl; }
-break;
-case 5:
-#line 294 "/home/cjk/groff/pic/pic.y"
-{ yyval.pl = yyvsp[-2].pl; }
-break;
-case 10:
-#line 309 "/home/cjk/groff/pic/pic.y"
-{
- define_variable(yyvsp[-2].str, yyvsp[0].x);
- a_delete yyvsp[-2].str;
- }
-break;
-case 11:
-#line 314 "/home/cjk/groff/pic/pic.y"
-{
- place *p = lookup_label(yyvsp[-3].str);
- if (!p) {
- lex_error("variable `%1' not defined", yyvsp[-3].str);
- YYABORT;
- }
- p->obj = 0;
- p->x = yyvsp[0].x;
- p->y = 0.0;
- a_delete yyvsp[-3].str;
- }
-break;
-case 12:
-#line 326 "/home/cjk/groff/pic/pic.y"
-{ current_direction = UP_DIRECTION; }
-break;
-case 13:
-#line 328 "/home/cjk/groff/pic/pic.y"
-{ current_direction = DOWN_DIRECTION; }
-break;
-case 14:
-#line 330 "/home/cjk/groff/pic/pic.y"
-{ current_direction = LEFT_DIRECTION; }
-break;
-case 15:
-#line 332 "/home/cjk/groff/pic/pic.y"
-{ current_direction = RIGHT_DIRECTION; }
-break;
-case 16:
-#line 334 "/home/cjk/groff/pic/pic.y"
-{
- olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
- yyvsp[0].lstr.lineno));
- }
-break;
-case 17:
-#line 339 "/home/cjk/groff/pic/pic.y"
-{
- olist.append(make_command_object(yyvsp[0].lstr.str, yyvsp[0].lstr.filename,
- yyvsp[0].lstr.lineno));
- }
-break;
-case 18:
-#line 344 "/home/cjk/groff/pic/pic.y"
-{
- fprintf(stderr, "%s\n", yyvsp[0].lstr.str);
- a_delete yyvsp[0].lstr.str;
- fflush(stderr);
- }
-break;
-case 19:
-#line 350 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 1; }
-break;
-case 20:
-#line 352 "/home/cjk/groff/pic/pic.y"
-{
- delim_flag = 0;
- if (safer_flag)
- lex_error("unsafe to run command `%1'", yyvsp[0].str);
- else
- system(yyvsp[0].str);
- a_delete yyvsp[0].str;
- }
-break;
-case 21:
-#line 361 "/home/cjk/groff/pic/pic.y"
-{
- if (yychar < 0)
- do_lookahead();
- do_copy(yyvsp[0].lstr.str);
- /* do not delete the filename*/
- }
-break;
-case 22:
-#line 368 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 2; }
-break;
-case 23:
-#line 370 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 0; }
-break;
-case 24:
-#line 372 "/home/cjk/groff/pic/pic.y"
-{
- if (yychar < 0)
- do_lookahead();
- copy_file_thru(yyvsp[-5].lstr.str, yyvsp[-2].str, yyvsp[0].str);
- /* do not delete the filename*/
- a_delete yyvsp[-2].str;
- a_delete yyvsp[0].str;
- }
-break;
-case 25:
-#line 381 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 2; }
-break;
-case 26:
-#line 383 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 0; }
-break;
-case 27:
-#line 385 "/home/cjk/groff/pic/pic.y"
-{
- if (yychar < 0)
- do_lookahead();
- copy_rest_thru(yyvsp[-2].str, yyvsp[0].str);
- a_delete yyvsp[-2].str;
- a_delete yyvsp[0].str;
- }
-break;
-case 28:
-#line 393 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 1; }
-break;
-case 29:
-#line 395 "/home/cjk/groff/pic/pic.y"
-{
- delim_flag = 0;
- if (yychar < 0)
- do_lookahead();
- do_for(yyvsp[-8].str, yyvsp[-6].x, yyvsp[-4].x, yyvsp[-3].by.is_multiplicative, yyvsp[-3].by.val, yyvsp[0].str);
- }
-break;
-case 30:
-#line 402 "/home/cjk/groff/pic/pic.y"
-{
- if (yychar < 0)
- do_lookahead();
- if (yyvsp[0].if_data.x != 0.0)
- push_body(yyvsp[0].if_data.body);
- a_delete yyvsp[0].if_data.body;
- }
-break;
-case 31:
-#line 410 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 1; }
-break;
-case 32:
-#line 412 "/home/cjk/groff/pic/pic.y"
-{
- delim_flag = 0;
- if (yychar < 0)
- do_lookahead();
- if (yyvsp[-3].if_data.x != 0.0)
- push_body(yyvsp[-3].if_data.body);
- else
- push_body(yyvsp[0].str);
- a_delete yyvsp[-3].if_data.body;
- a_delete yyvsp[0].str;
- }
-break;
-case 34:
-#line 425 "/home/cjk/groff/pic/pic.y"
-{ define_variable("scale", 1.0); }
-break;
-case 35:
-#line 430 "/home/cjk/groff/pic/pic.y"
-{ reset(yyvsp[0].str); a_delete yyvsp[0].str; }
-break;
-case 36:
-#line 432 "/home/cjk/groff/pic/pic.y"
-{ reset(yyvsp[0].str); a_delete yyvsp[0].str; }
-break;
-case 37:
-#line 434 "/home/cjk/groff/pic/pic.y"
-{ reset(yyvsp[0].str); a_delete yyvsp[0].str; }
-break;
-case 38:
-#line 439 "/home/cjk/groff/pic/pic.y"
-{ yyval.lstr = yyvsp[0].lstr; }
-break;
-case 39:
-#line 441 "/home/cjk/groff/pic/pic.y"
-{
- yyval.lstr.str = new char[strlen(yyvsp[-1].lstr.str) + strlen(yyvsp[0].lstr.str) + 1];
- strcpy(yyval.lstr.str, yyvsp[-1].lstr.str);
- strcat(yyval.lstr.str, yyvsp[0].lstr.str);
- a_delete yyvsp[-1].lstr.str;
- a_delete yyvsp[0].lstr.str;
- if (yyvsp[-1].lstr.filename) {
- yyval.lstr.filename = yyvsp[-1].lstr.filename;
- yyval.lstr.lineno = yyvsp[-1].lstr.lineno;
- }
- else if (yyvsp[0].lstr.filename) {
- yyval.lstr.filename = yyvsp[0].lstr.filename;
- yyval.lstr.lineno = yyvsp[0].lstr.lineno;
- }
- }
-break;
-case 40:
-#line 460 "/home/cjk/groff/pic/pic.y"
-{
- yyval.lstr.str = new char[GDIGITS + 1];
- sprintf(yyval.lstr.str, "%g", yyvsp[0].x);
- yyval.lstr.filename = 0;
- yyval.lstr.lineno = 0;
- }
-break;
-case 41:
-#line 467 "/home/cjk/groff/pic/pic.y"
-{ yyval.lstr = yyvsp[0].lstr; }
-break;
-case 42:
-#line 469 "/home/cjk/groff/pic/pic.y"
-{
- yyval.lstr.str = new char[GDIGITS + 2 + GDIGITS + 1];
- sprintf(yyval.lstr.str, "%g, %g", yyvsp[0].pair.x, yyvsp[0].pair.y);
- yyval.lstr.filename = 0;
- yyval.lstr.lineno = 0;
- }
-break;
-case 43:
-#line 478 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 1; }
-break;
-case 44:
-#line 480 "/home/cjk/groff/pic/pic.y"
-{ delim_flag = 0; yyval.if_data.x = yyvsp[-3].x; yyval.if_data.body = yyvsp[0].str; }
-break;
-case 45:
-#line 485 "/home/cjk/groff/pic/pic.y"
-{ yyval.str = 0; }
-break;
-case 46:
-#line 487 "/home/cjk/groff/pic/pic.y"
-{ yyval.str = yyvsp[0].lstr.str; }
-break;
-case 47:
-#line 492 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[0].x; }
-break;
-case 48:
-#line 494 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[0].x; }
-break;
-case 49:
-#line 499 "/home/cjk/groff/pic/pic.y"
-{
- yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) == 0;
- a_delete yyvsp[-2].lstr.str;
- a_delete yyvsp[0].lstr.str;
- }
-break;
-case 50:
-#line 505 "/home/cjk/groff/pic/pic.y"
-{
- yyval.x = strcmp(yyvsp[-2].lstr.str, yyvsp[0].lstr.str) != 0;
- a_delete yyvsp[-2].lstr.str;
- a_delete yyvsp[0].lstr.str;
- }
-break;
-case 51:
-#line 511 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); }
-break;
-case 52:
-#line 513 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); }
-break;
-case 53:
-#line 515 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); }
-break;
-case 54:
-#line 517 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); }
-break;
-case 55:
-#line 519 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); }
-break;
-case 56:
-#line 521 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); }
-break;
-case 57:
-#line 523 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[0].x == 0.0); }
-break;
-case 58:
-#line 529 "/home/cjk/groff/pic/pic.y"
-{ yyval.by.val = 1.0; yyval.by.is_multiplicative = 0; }
-break;
-case 59:
-#line 531 "/home/cjk/groff/pic/pic.y"
-{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 0; }
-break;
-case 60:
-#line 533 "/home/cjk/groff/pic/pic.y"
-{ yyval.by.val = yyvsp[0].x; yyval.by.is_multiplicative = 1; }
-break;
-case 61:
-#line 538 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl.obj = yyvsp[0].spec->make_object(¤t_position,
- ¤t_direction);
- if (yyval.pl.obj == 0)
- YYABORT;
- delete yyvsp[0].spec;
- if (yyval.pl.obj)
- olist.append(yyval.pl.obj);
- else {
- yyval.pl.x = current_position.x;
- yyval.pl.y = current_position.y;
- }
- }
-break;
-case 62:
-#line 552 "/home/cjk/groff/pic/pic.y"
-{ yyval.pl = yyvsp[0].pl; define_label(yyvsp[-3].str, & yyval.pl); a_delete yyvsp[-3].str; }
-break;
-case 63:
-#line 554 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl.obj = 0;
- yyval.pl.x = yyvsp[0].pair.x;
- yyval.pl.y = yyvsp[0].pair.y;
- define_label(yyvsp[-3].str, & yyval.pl);
- a_delete yyvsp[-3].str;
- }
-break;
-case 64:
-#line 562 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl = yyvsp[0].pl;
- define_label(yyvsp[-3].str, & yyval.pl);
- a_delete yyvsp[-3].str;
- }
-break;
-case 65:
-#line 568 "/home/cjk/groff/pic/pic.y"
-{
- yyval.state.x = current_position.x;
- yyval.state.y = current_position.y;
- yyval.state.dir = current_direction;
- }
-break;
-case 66:
-#line 574 "/home/cjk/groff/pic/pic.y"
-{
- current_position.x = yyvsp[-2].state.x;
- current_position.y = yyvsp[-2].state.y;
- current_direction = yyvsp[-2].state.dir;
- }
-break;
-case 67:
-#line 580 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl = yyvsp[-3].pl;
- }
-break;
-case 68:
-#line 584 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl.obj = 0;
- yyval.pl.x = current_position.x;
- yyval.pl.y = current_position.y;
- }
-break;
-case 69:
-#line 593 "/home/cjk/groff/pic/pic.y"
-{}
-break;
-case 70:
-#line 595 "/home/cjk/groff/pic/pic.y"
-{}
-break;
-case 71:
-#line 600 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(BOX_OBJECT);
- }
-break;
-case 72:
-#line 604 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(CIRCLE_OBJECT);
- }
-break;
-case 73:
-#line 608 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(ELLIPSE_OBJECT);
- }
-break;
-case 74:
-#line 612 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(ARC_OBJECT);
- yyval.spec->dir = current_direction;
- }
-break;
-case 75:
-#line 617 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(LINE_OBJECT);
- lookup_variable("lineht", & yyval.spec->segment_height);
- lookup_variable("linewid", & yyval.spec->segment_width);
- yyval.spec->dir = current_direction;
- }
-break;
-case 76:
-#line 624 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(ARROW_OBJECT);
- lookup_variable("lineht", & yyval.spec->segment_height);
- lookup_variable("linewid", & yyval.spec->segment_width);
- yyval.spec->dir = current_direction;
- }
-break;
-case 77:
-#line 631 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(MOVE_OBJECT);
- lookup_variable("moveht", & yyval.spec->segment_height);
- lookup_variable("movewid", & yyval.spec->segment_width);
- yyval.spec->dir = current_direction;
- }
-break;
-case 78:
-#line 638 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(SPLINE_OBJECT);
- lookup_variable("lineht", & yyval.spec->segment_height);
- lookup_variable("linewid", & yyval.spec->segment_width);
- yyval.spec->dir = current_direction;
- }
-break;
-case 79:
-#line 645 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(TEXT_OBJECT);
- yyval.spec->text = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
- }
-break;
-case 80:
-#line 650 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(TEXT_OBJECT);
- yyval.spec->text = new text_item(format_number(0, yyvsp[0].x), 0, -1);
- }
-break;
-case 81:
-#line 655 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = new object_spec(TEXT_OBJECT);
- yyval.spec->text = new text_item(format_number(yyvsp[0].lstr.str, yyvsp[-1].x),
- yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
- a_delete yyvsp[0].lstr.str;
- }
-break;
-case 82:
-#line 662 "/home/cjk/groff/pic/pic.y"
-{
- saved_state *p = new saved_state;
- yyval.pstate = p;
- p->x = current_position.x;
- p->y = current_position.y;
- p->dir = current_direction;
- p->tbl = current_table;
- p->prev = current_saved_state;
- current_position.x = 0.0;
- current_position.y = 0.0;
- current_table = new PTABLE(place);
- current_saved_state = p;
- olist.append(make_mark_object());
- }
-break;
-case 83:
-#line 677 "/home/cjk/groff/pic/pic.y"
-{
- current_position.x = yyvsp[-2].pstate->x;
- current_position.y = yyvsp[-2].pstate->y;
- current_direction = yyvsp[-2].pstate->dir;
- yyval.spec = new object_spec(BLOCK_OBJECT);
- olist.wrap_up_block(& yyval.spec->oblist);
- yyval.spec->tbl = current_table;
- current_table = yyvsp[-2].pstate->tbl;
- current_saved_state = yyvsp[-2].pstate->prev;
- delete yyvsp[-2].pstate;
- }
-break;
-case 84:
-#line 689 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->height = yyvsp[0].x;
- yyval.spec->flags |= HAS_HEIGHT;
- }
-break;
-case 85:
-#line 695 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->radius = yyvsp[0].x;
- yyval.spec->flags |= HAS_RADIUS;
- }
-break;
-case 86:
-#line 701 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->width = yyvsp[0].x;
- yyval.spec->flags |= HAS_WIDTH;
- }
-break;
-case 87:
-#line 707 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->radius = yyvsp[0].x/2.0;
- yyval.spec->flags |= HAS_RADIUS;
- }
-break;
-case 88:
-#line 713 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= HAS_SEGMENT;
- switch (yyval.spec->dir) {
- case UP_DIRECTION:
- yyval.spec->segment_pos.y += yyvsp[0].x;
- break;
- case DOWN_DIRECTION:
- yyval.spec->segment_pos.y -= yyvsp[0].x;
- break;
- case RIGHT_DIRECTION:
- yyval.spec->segment_pos.x += yyvsp[0].x;
- break;
- case LEFT_DIRECTION:
- yyval.spec->segment_pos.x -= yyvsp[0].x;
- break;
- }
- }
-break;
-case 89:
-#line 732 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->dir = UP_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.y += yyval.spec->segment_height;
- }
-break;
-case 90:
-#line 739 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->dir = UP_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.y += yyvsp[0].x;
- }
-break;
-case 91:
-#line 746 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->dir = DOWN_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.y -= yyval.spec->segment_height;
- }
-break;
-case 92:
-#line 753 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->dir = DOWN_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.y -= yyvsp[0].x;
- }
-break;
-case 93:
-#line 760 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->dir = RIGHT_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.x += yyval.spec->segment_width;
- }
-break;
-case 94:
-#line 767 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->dir = RIGHT_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.x += yyvsp[0].x;
- }
-break;
-case 95:
-#line 774 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->dir = LEFT_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.x -= yyval.spec->segment_width;
- }
-break;
-case 96:
-#line 781 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->dir = LEFT_DIRECTION;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.x -= yyvsp[0].x;
- }
-break;
-case 97:
-#line 788 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= HAS_FROM;
- yyval.spec->from.x = yyvsp[0].pair.x;
- yyval.spec->from.y = yyvsp[0].pair.y;
- }
-break;
-case 98:
-#line 795 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- if (yyval.spec->flags & HAS_SEGMENT)
- yyval.spec->segment_list = new segment(yyval.spec->segment_pos,
- yyval.spec->segment_is_absolute,
- yyval.spec->segment_list);
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.x = yyvsp[0].pair.x;
- yyval.spec->segment_pos.y = yyvsp[0].pair.y;
- yyval.spec->segment_is_absolute = 1;
- yyval.spec->flags |= HAS_TO;
- yyval.spec->to.x = yyvsp[0].pair.x;
- yyval.spec->to.y = yyvsp[0].pair.y;
- }
-break;
-case 99:
-#line 810 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= HAS_AT;
- yyval.spec->at.x = yyvsp[0].pair.x;
- yyval.spec->at.y = yyvsp[0].pair.y;
- if (yyval.spec->type != ARC_OBJECT) {
- yyval.spec->flags |= HAS_FROM;
- yyval.spec->from.x = yyvsp[0].pair.x;
- yyval.spec->from.y = yyvsp[0].pair.y;
- }
- }
-break;
-case 100:
-#line 822 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= HAS_WITH;
- yyval.spec->with = yyvsp[0].pth;
- }
-break;
-case 101:
-#line 828 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= HAS_SEGMENT;
- yyval.spec->segment_pos.x += yyvsp[0].pair.x;
- yyval.spec->segment_pos.y += yyvsp[0].pair.y;
- }
-break;
-case 102:
-#line 835 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- if (yyval.spec->flags & HAS_SEGMENT) {
- yyval.spec->segment_list = new segment(yyval.spec->segment_pos,
- yyval.spec->segment_is_absolute,
- yyval.spec->segment_list);
- yyval.spec->flags &= ~HAS_SEGMENT;
- yyval.spec->segment_pos.x = yyval.spec->segment_pos.y = 0.0;
- yyval.spec->segment_is_absolute = 0;
- }
- }
-break;
-case 103:
-#line 847 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_DOTTED;
- lookup_variable("dashwid", & yyval.spec->dash_width);
- }
-break;
-case 104:
-#line 853 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= IS_DOTTED;
- yyval.spec->dash_width = yyvsp[0].x;
- }
-break;
-case 105:
-#line 859 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_DASHED;
- lookup_variable("dashwid", & yyval.spec->dash_width);
- }
-break;
-case 106:
-#line 865 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= IS_DASHED;
- yyval.spec->dash_width = yyvsp[0].x;
- }
-break;
-case 107:
-#line 871 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_DEFAULT_FILLED;
- }
-break;
-case 108:
-#line 876 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= IS_FILLED;
- yyval.spec->fill = yyvsp[0].x;
- }
-break;
-case 109:
-#line 882 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- /* line chop chop means line chop 0 chop 0*/
- if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
- yyval.spec->flags |= IS_CHOPPED;
- yyval.spec->flags &= ~IS_DEFAULT_CHOPPED;
- yyval.spec->start_chop = yyval.spec->end_chop = 0.0;
- }
- else if (yyval.spec->flags & IS_CHOPPED) {
- yyval.spec->end_chop = 0.0;
- }
- else {
- yyval.spec->flags |= IS_DEFAULT_CHOPPED;
- }
- }
-break;
-case 110:
-#line 898 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- if (yyval.spec->flags & IS_DEFAULT_CHOPPED) {
- yyval.spec->flags |= IS_CHOPPED;
- yyval.spec->flags &= ~IS_DEFAULT_CHOPPED;
- yyval.spec->start_chop = 0.0;
- yyval.spec->end_chop = yyvsp[0].x;
- }
- else if (yyval.spec->flags & IS_CHOPPED) {
- yyval.spec->end_chop = yyvsp[0].x;
- }
- else {
- yyval.spec->start_chop = yyval.spec->end_chop = yyvsp[0].x;
- yyval.spec->flags |= IS_CHOPPED;
- }
- }
-break;
-case 111:
-#line 915 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_SAME;
- }
-break;
-case 112:
-#line 920 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_INVISIBLE;
- }
-break;
-case 113:
-#line 925 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= HAS_LEFT_ARROW_HEAD;
- }
-break;
-case 114:
-#line 930 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= HAS_RIGHT_ARROW_HEAD;
- }
-break;
-case 115:
-#line 935 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= (HAS_LEFT_ARROW_HEAD|HAS_RIGHT_ARROW_HEAD);
- }
-break;
-case 116:
-#line 940 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_CLOCKWISE;
- }
-break;
-case 117:
-#line 945 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags &= ~IS_CLOCKWISE;
- }
-break;
-case 118:
-#line 950 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- text_item **p;
- for (p = & yyval.spec->text; *p; p = &(*p)->next)
- ;
- *p = new text_item(yyvsp[0].lstr.str, yyvsp[0].lstr.filename, yyvsp[0].lstr.lineno);
- }
-break;
-case 119:
-#line 958 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- if (yyval.spec->text) {
- text_item *p;
- for (p = yyval.spec->text; p->next; p = p->next)
- ;
- p->adj.h = LEFT_ADJUST;
- }
- }
-break;
-case 120:
-#line 968 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- if (yyval.spec->text) {
- text_item *p;
- for (p = yyval.spec->text; p->next; p = p->next)
- ;
- p->adj.h = RIGHT_ADJUST;
- }
- }
-break;
-case 121:
-#line 978 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- if (yyval.spec->text) {
- text_item *p;
- for (p = yyval.spec->text; p->next; p = p->next)
- ;
- p->adj.v = ABOVE_ADJUST;
- }
- }
-break;
-case 122:
-#line 988 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- if (yyval.spec->text) {
- text_item *p;
- for (p = yyval.spec->text; p->next; p = p->next)
- ;
- p->adj.v = BELOW_ADJUST;
- }
- }
-break;
-case 123:
-#line 998 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-2].spec;
- yyval.spec->flags |= HAS_THICKNESS;
- yyval.spec->thickness = yyvsp[0].x;
- }
-break;
-case 124:
-#line 1004 "/home/cjk/groff/pic/pic.y"
-{
- yyval.spec = yyvsp[-1].spec;
- yyval.spec->flags |= IS_ALIGNED;
- }
-break;
-case 125:
-#line 1012 "/home/cjk/groff/pic/pic.y"
-{
- yyval.lstr = yyvsp[0].lstr;
- }
-break;
-case 126:
-#line 1016 "/home/cjk/groff/pic/pic.y"
-{
- yyval.lstr.filename = yyvsp[-2].lstr.filename;
- yyval.lstr.lineno = yyvsp[-2].lstr.lineno;
- yyval.lstr.str = do_sprintf(yyvsp[-2].lstr.str, yyvsp[-1].dv.v, yyvsp[-1].dv.nv);
- a_delete yyvsp[-1].dv.v;
- a_delete yyvsp[-2].lstr.str;
- }
-break;
-case 127:
-#line 1027 "/home/cjk/groff/pic/pic.y"
-{
- yyval.dv.v = 0;
- yyval.dv.nv = 0;
- yyval.dv.maxv = 0;
- }
-break;
-case 128:
-#line 1033 "/home/cjk/groff/pic/pic.y"
-{
- yyval.dv = yyvsp[-2].dv;
- if (yyval.dv.nv >= yyval.dv.maxv) {
- if (yyval.dv.nv == 0) {
- yyval.dv.v = new double[4];
- yyval.dv.maxv = 4;
- }
- else {
- double *oldv = yyval.dv.v;
- yyval.dv.maxv *= 2;
- yyval.dv.v = new double[yyval.dv.maxv];
- memcpy(yyval.dv.v, oldv, yyval.dv.nv*sizeof(double));
- a_delete oldv;
- }
- }
- yyval.dv.v[yyval.dv.nv] = yyvsp[0].x;
- yyval.dv.nv += 1;
- }
-break;
-case 129:
-#line 1055 "/home/cjk/groff/pic/pic.y"
-{ yyval.pair = yyvsp[0].pair; }
-break;
-case 130:
-#line 1057 "/home/cjk/groff/pic/pic.y"
-{
- position pos = yyvsp[0].pl;
- yyval.pair.x = pos.x;
- yyval.pair.y = pos.y;
- }
-break;
-case 131:
-#line 1066 "/home/cjk/groff/pic/pic.y"
-{ yyval.pair = yyvsp[0].pair; }
-break;
-case 132:
-#line 1068 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pair.x = yyvsp[-2].pair.x + yyvsp[0].pair.x;
- yyval.pair.y = yyvsp[-2].pair.y + yyvsp[0].pair.y;
- }
-break;
-case 133:
-#line 1073 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pair.x = yyvsp[-2].pair.x - yyvsp[0].pair.x;
- yyval.pair.y = yyvsp[-2].pair.y - yyvsp[0].pair.y;
- }
-break;
-case 134:
-#line 1078 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pair.x = yyvsp[-3].pair.x;
- yyval.pair.y = yyvsp[-1].pair.y;
- }
-break;
-case 135:
-#line 1083 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pair.x = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.x + yyvsp[-4].x*yyvsp[0].pair.x;
- yyval.pair.y = (1.0 - yyvsp[-4].x)*yyvsp[-2].pair.y + yyvsp[-4].x*yyvsp[0].pair.y;
- }
-break;
-case 136:
-#line 1088 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pair.x = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.x + yyvsp[-5].x*yyvsp[-1].pair.x;
- yyval.pair.y = (1.0 - yyvsp[-5].x)*yyvsp[-3].pair.y + yyvsp[-5].x*yyvsp[-1].pair.y;
- }
-break;
-case 139:
-#line 1101 "/home/cjk/groff/pic/pic.y"
-{ yyval.pair.x = yyvsp[-2].x; yyval.pair.y = yyvsp[0].x; }
-break;
-case 140:
-#line 1103 "/home/cjk/groff/pic/pic.y"
-{ yyval.pair = yyvsp[-1].pair; }
-break;
-case 141:
-#line 1108 "/home/cjk/groff/pic/pic.y"
-{ yyval.pl = yyvsp[0].pl; }
-break;
-case 142:
-#line 1110 "/home/cjk/groff/pic/pic.y"
-{
- path pth(yyvsp[0].crn);
- if (!pth.follow(yyvsp[-1].pl, & yyval.pl))
- YYABORT;
- }
-break;
-case 143:
-#line 1116 "/home/cjk/groff/pic/pic.y"
-{
- path pth(yyvsp[-1].crn);
- if (!pth.follow(yyvsp[0].pl, & yyval.pl))
- YYABORT;
- }
-break;
-case 144:
-#line 1122 "/home/cjk/groff/pic/pic.y"
-{
- path pth(yyvsp[-2].crn);
- if (!pth.follow(yyvsp[0].pl, & yyval.pl))
- YYABORT;
- }
-break;
-case 145:
-#line 1128 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl.x = current_position.x;
- yyval.pl.y = current_position.y;
- yyval.pl.obj = 0;
- }
-break;
-case 146:
-#line 1137 "/home/cjk/groff/pic/pic.y"
-{
- place *p = lookup_label(yyvsp[0].str);
- if (!p) {
- lex_error("there is no place `%1'", yyvsp[0].str);
- YYABORT;
- }
- yyval.pl = *p;
- a_delete yyvsp[0].str;
- }
-break;
-case 147:
-#line 1147 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pl.obj = yyvsp[0].obj;
- }
-break;
-case 148:
-#line 1151 "/home/cjk/groff/pic/pic.y"
-{
- path pth(yyvsp[0].str);
- if (!pth.follow(yyvsp[-2].pl, & yyval.pl))
- YYABORT;
- }
-break;
-case 149:
-#line 1160 "/home/cjk/groff/pic/pic.y"
-{ yyval.n = yyvsp[0].n; }
-break;
-case 150:
-#line 1162 "/home/cjk/groff/pic/pic.y"
-{
- /* XXX Check for overflow (and non-integers?).*/
- yyval.n = (int)yyvsp[-1].x;
- }
-break;
-case 151:
-#line 1170 "/home/cjk/groff/pic/pic.y"
-{ yyval.n = 1; }
-break;
-case 152:
-#line 1172 "/home/cjk/groff/pic/pic.y"
-{ yyval.n = yyvsp[-1].n; }
-break;
-case 153:
-#line 1177 "/home/cjk/groff/pic/pic.y"
-{
- int count = 0;
- object *p;
- for (p = olist.head; p != 0; p = p->next)
- if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) {
- yyval.obj = p;
- break;
- }
- if (p == 0) {
- lex_error("there is no %1%2 %3", yyvsp[-1].n, ordinal_postfix(yyvsp[-1].n),
- object_type_name(yyvsp[0].obtype));
- YYABORT;
- }
- }
-break;
-case 154:
-#line 1192 "/home/cjk/groff/pic/pic.y"
-{
- int count = 0;
- object *p;
- for (p = olist.tail; p != 0; p = p->prev)
- if (p->type() == yyvsp[0].obtype && ++count == yyvsp[-1].n) {
- yyval.obj = p;
- break;
- }
- if (p == 0) {
- lex_error("there is no %1%2 last %3", yyvsp[-1].n,
- ordinal_postfix(yyvsp[-1].n), object_type_name(yyvsp[0].obtype));
- YYABORT;
- }
- }
-break;
-case 155:
-#line 1210 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = BOX_OBJECT; }
-break;
-case 156:
-#line 1212 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = CIRCLE_OBJECT; }
-break;
-case 157:
-#line 1214 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = ELLIPSE_OBJECT; }
-break;
-case 158:
-#line 1216 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = ARC_OBJECT; }
-break;
-case 159:
-#line 1218 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = LINE_OBJECT; }
-break;
-case 160:
-#line 1220 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = ARROW_OBJECT; }
-break;
-case 161:
-#line 1222 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = SPLINE_OBJECT; }
-break;
-case 162:
-#line 1224 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = BLOCK_OBJECT; }
-break;
-case 163:
-#line 1226 "/home/cjk/groff/pic/pic.y"
-{ yyval.obtype = TEXT_OBJECT; }
-break;
-case 164:
-#line 1231 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = new path(yyvsp[0].str);
- }
-break;
-case 165:
-#line 1235 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = yyvsp[-2].pth;
- yyval.pth->append(yyvsp[0].str);
- }
-break;
-case 166:
-#line 1243 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = new path(yyvsp[0].crn);
- }
-break;
-case 167:
-#line 1250 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = yyvsp[0].pth;
- }
-break;
-case 168:
-#line 1254 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = yyvsp[-1].pth;
- yyval.pth->append(yyvsp[0].crn);
- }
-break;
-case 169:
-#line 1262 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = yyvsp[0].pth;
- }
-break;
-case 170:
-#line 1266 "/home/cjk/groff/pic/pic.y"
-{
- yyval.pth = yyvsp[-3].pth;
- yyval.pth->set_ypath(yyvsp[-1].pth);
- }
-break;
-case 171:
-#line 1272 "/home/cjk/groff/pic/pic.y"
-{
- lex_warning("`%1%2 last %3' in `with' argument ignored",
- yyvsp[-3].n, ordinal_postfix(yyvsp[-3].n), object_type_name(yyvsp[-1].obtype));
- yyval.pth = yyvsp[0].pth;
- }
-break;
-case 172:
-#line 1278 "/home/cjk/groff/pic/pic.y"
-{
- lex_warning("`last %1' in `with' argument ignored",
- object_type_name(yyvsp[-1].obtype));
- yyval.pth = yyvsp[0].pth;
- }
-break;
-case 173:
-#line 1284 "/home/cjk/groff/pic/pic.y"
-{
- lex_warning("`%1%2 %3' in `with' argument ignored",
- yyvsp[-2].n, ordinal_postfix(yyvsp[-2].n), object_type_name(yyvsp[-1].obtype));
- yyval.pth = yyvsp[0].pth;
- }
-break;
-case 174:
-#line 1290 "/home/cjk/groff/pic/pic.y"
-{
- lex_warning("initial `%1' in `with' argument ignored", yyvsp[-1].str);
- a_delete yyvsp[-1].str;
- yyval.pth = yyvsp[0].pth;
- }
-break;
-case 175:
-#line 1299 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north; }
-break;
-case 176:
-#line 1301 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::east; }
-break;
-case 177:
-#line 1303 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::west; }
-break;
-case 178:
-#line 1305 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south; }
-break;
-case 179:
-#line 1307 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north_east; }
-break;
-case 180:
-#line 1309 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object:: south_east; }
-break;
-case 181:
-#line 1311 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north_west; }
-break;
-case 182:
-#line 1313 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south_west; }
-break;
-case 183:
-#line 1315 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::center; }
-break;
-case 184:
-#line 1317 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::start; }
-break;
-case 185:
-#line 1319 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::end; }
-break;
-case 186:
-#line 1321 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north; }
-break;
-case 187:
-#line 1323 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south; }
-break;
-case 188:
-#line 1325 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::west; }
-break;
-case 189:
-#line 1327 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::east; }
-break;
-case 190:
-#line 1329 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north_west; }
-break;
-case 191:
-#line 1331 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south_west; }
-break;
-case 192:
-#line 1333 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north_east; }
-break;
-case 193:
-#line 1335 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south_east; }
-break;
-case 194:
-#line 1337 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::west; }
-break;
-case 195:
-#line 1339 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::east; }
-break;
-case 196:
-#line 1341 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north_west; }
-break;
-case 197:
-#line 1343 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south_west; }
-break;
-case 198:
-#line 1345 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::north_east; }
-break;
-case 199:
-#line 1347 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::south_east; }
-break;
-case 200:
-#line 1349 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::center; }
-break;
-case 201:
-#line 1351 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::start; }
-break;
-case 202:
-#line 1353 "/home/cjk/groff/pic/pic.y"
-{ yyval.crn = &object::end; }
-break;
-case 203:
-#line 1358 "/home/cjk/groff/pic/pic.y"
-{
- if (!lookup_variable(yyvsp[0].str, & yyval.x)) {
- lex_error("there is no variable `%1'", yyvsp[0].str);
- YYABORT;
- }
- a_delete yyvsp[0].str;
- }
-break;
-case 204:
-#line 1366 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[0].x; }
-break;
-case 205:
-#line 1368 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[-1].pl.obj != 0)
- yyval.x = yyvsp[-1].pl.obj->origin().x;
- else
- yyval.x = yyvsp[-1].pl.x;
- }
-break;
-case 206:
-#line 1375 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[-1].pl.obj != 0)
- yyval.x = yyvsp[-1].pl.obj->origin().y;
- else
- yyval.x = yyvsp[-1].pl.y;
- }
-break;
-case 207:
-#line 1382 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[-1].pl.obj != 0)
- yyval.x = yyvsp[-1].pl.obj->height();
- else
- yyval.x = 0.0;
- }
-break;
-case 208:
-#line 1389 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[-1].pl.obj != 0)
- yyval.x = yyvsp[-1].pl.obj->width();
- else
- yyval.x = 0.0;
- }
-break;
-case 209:
-#line 1396 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[-1].pl.obj != 0)
- yyval.x = yyvsp[-1].pl.obj->radius();
- else
- yyval.x = 0.0;
- }
-break;
-case 210:
-#line 1403 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[-2].x + yyvsp[0].x; }
-break;
-case 211:
-#line 1405 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[-2].x - yyvsp[0].x; }
-break;
-case 212:
-#line 1407 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[-2].x * yyvsp[0].x; }
-break;
-case 213:
-#line 1409 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[0].x == 0.0) {
- lex_error("division by zero");
- YYABORT;
- }
- yyval.x = yyvsp[-2].x/yyvsp[0].x;
- }
-break;
-case 214:
-#line 1417 "/home/cjk/groff/pic/pic.y"
-{
- if (yyvsp[0].x == 0.0) {
- lex_error("modulus by zero");
- YYABORT;
- }
- yyval.x = fmod(yyvsp[-2].x, yyvsp[0].x);
- }
-break;
-case 215:
-#line 1425 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = pow(yyvsp[-2].x, yyvsp[0].x);
- if (errno == EDOM) {
- lex_error("arguments to `^' operator out of domain");
- YYABORT;
- }
- if (errno == ERANGE) {
- lex_error("result of `^' operator out of range");
- YYABORT;
- }
- }
-break;
-case 216:
-#line 1438 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = -yyvsp[0].x; }
-break;
-case 217:
-#line 1440 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[-1].x; }
-break;
-case 218:
-#line 1442 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = sin(yyvsp[-1].x);
- if (errno == ERANGE) {
- lex_error("sin result out of range");
- YYABORT;
- }
- }
-break;
-case 219:
-#line 1451 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = cos(yyvsp[-1].x);
- if (errno == ERANGE) {
- lex_error("cos result out of range");
- YYABORT;
- }
- }
-break;
-case 220:
-#line 1460 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = atan2(yyvsp[-3].x, yyvsp[-1].x);
- if (errno == EDOM) {
- lex_error("atan2 argument out of domain");
- YYABORT;
- }
- if (errno == ERANGE) {
- lex_error("atan2 result out of range");
- YYABORT;
- }
- }
-break;
-case 221:
-#line 1473 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = log10(yyvsp[-1].x);
- if (errno == ERANGE) {
- lex_error("log result out of range");
- YYABORT;
- }
- }
-break;
-case 222:
-#line 1482 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = pow(10.0, yyvsp[-1].x);
- if (errno == ERANGE) {
- lex_error("exp result out of range");
- YYABORT;
- }
- }
-break;
-case 223:
-#line 1491 "/home/cjk/groff/pic/pic.y"
-{
- errno = 0;
- yyval.x = sqrt(yyvsp[-1].x);
- if (errno == EDOM) {
- lex_error("sqrt argument out of domain");
- YYABORT;
- }
- }
-break;
-case 224:
-#line 1500 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[-3].x > yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; }
-break;
-case 225:
-#line 1502 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = yyvsp[-3].x < yyvsp[-1].x ? yyvsp[-3].x : yyvsp[-1].x; }
-break;
-case 226:
-#line 1504 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = floor(yyvsp[-1].x); }
-break;
-case 227:
-#line 1506 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = 1.0 + floor(((rand()&0x7fff)/double(0x7fff))*yyvsp[-1].x); }
-break;
-case 228:
-#line 1508 "/home/cjk/groff/pic/pic.y"
-{
- /* return a random number in the range [0,1) */
- /* portable, but not very random */
- yyval.x = (rand() & 0x7fff) / double(0x8000);
- }
-break;
-case 229:
-#line 1514 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = 0; srand((unsigned int)yyvsp[-1].x); }
-break;
-case 230:
-#line 1516 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x < yyvsp[0].x); }
-break;
-case 231:
-#line 1518 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x <= yyvsp[0].x); }
-break;
-case 232:
-#line 1520 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x > yyvsp[0].x); }
-break;
-case 233:
-#line 1522 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x >= yyvsp[0].x); }
-break;
-case 234:
-#line 1524 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x == yyvsp[0].x); }
-break;
-case 235:
-#line 1526 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != yyvsp[0].x); }
-break;
-case 236:
-#line 1528 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 && yyvsp[0].x != 0.0); }
-break;
-case 237:
-#line 1530 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[-2].x != 0.0 || yyvsp[0].x != 0.0); }
-break;
-case 238:
-#line 1532 "/home/cjk/groff/pic/pic.y"
-{ yyval.x = (yyvsp[0].x == 0.0); }
-break;
-#line 5165 "y.tab.c"
- }
- yyssp -= yym;
- yystate = *yyssp;
- yyvsp -= yym;
- yym = yylhs[yyn];
- if (yystate == 0 && yym == 0)
- {
-#if YYDEBUG
- if (yydebug)
- printf("%sdebug: after reduction, shifting from state 0 to\
- state %d\n", YYPREFIX, YYFINAL);
-#endif
- yystate = YYFINAL;
- *++yyssp = YYFINAL;
- *++yyvsp = yyval;
- if (yychar < 0)
- {
- if ((yychar = yylex()) < 0) yychar = 0;
-#if YYDEBUG
- if (yydebug)
- {
- yys = 0;
- if (yychar <= YYMAXTOKEN) yys = yyname[yychar];
- if (!yys) yys = "illegal-symbol";
- printf("%sdebug: state %d, reading %d (%s)\n",
- YYPREFIX, YYFINAL, yychar, yys);
- }
-#endif
- }
- if (yychar == 0) goto yyaccept;
- goto yyloop;
- }
- if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
- yyn <= YYTABLESIZE && yycheck[yyn] == yystate)
- yystate = yytable[yyn];
- else
- yystate = yydgoto[yym];
-#if YYDEBUG
- if (yydebug)
- printf("%sdebug: after reduction, shifting from state %d \
-to state %d\n", YYPREFIX, *yyssp, yystate);
-#endif
- if (yyssp >= yyss + yystacksize - 1)
- {
- goto yyoverflow;
- }
- *++yyssp = yystate;
- *++yyvsp = yyval;
- goto yyloop;
-yyoverflow:
- yyerror("yacc stack overflow");
-yyabort:
- return (1);
-yyaccept:
- return (0);
-}
diff --git a/contrib/groff/pic/pic.h b/contrib/groff/pic/pic.h
deleted file mode 100644
index 72485a396333..000000000000
--- a/contrib/groff/pic/pic.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// -*- C++ -*-
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-
-#include
-#include
-#include
-#include
-#include
-
-#ifdef NEED_DECLARATION_HYPOT
-extern "C" {
- double hypot(double, double);
-}
-#endif /* NEED_DECLARATION_HYPOT */
-
-#include "assert.h"
-#include "cset.h"
-#include "lib.h"
-#include "stringclass.h"
-#include "errarg.h"
-#include "error.h"
-#include "position.h"
-#include "text.h"
-#include "output.h"
-
-#ifndef M_SQRT2
-#define M_SQRT2 1.41421356237309504880
-#endif
-
-#ifndef M_PI
-#define M_PI 3.14159265358979323846
-#endif
-
-class input {
- input *next;
-public:
- input();
- virtual ~input();
- virtual int get() = 0;
- virtual int peek() = 0;
- virtual int get_location(const char **, int *);
- friend class input_stack;
- friend class copy_rest_thru_input;
-};
-
-class file_input : public input {
- FILE *fp;
- const char *filename;
- int lineno;
- string line;
- const char *ptr;
- int read_line();
-public:
- file_input(FILE *, const char *);
- ~file_input();
- int get();
- int peek();
- int get_location(const char **, int *);
-};
-
-void lex_init(input *);
-int get_location(char **, int *);
-
-void do_copy(const char *file);
-void parse_init();
-void parse_cleanup();
-
-void lex_error(const char *message,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-void lex_warning(const char *message,
- const errarg &arg1 = empty_errarg,
- const errarg &arg2 = empty_errarg,
- const errarg &arg3 = empty_errarg);
-
-void lex_cleanup();
-
-extern int flyback_flag;
-extern int command_char;
-// zero_length_line_flag is non-zero if zero-length lines are drawn
-// as dots by the output device
-extern int zero_length_line_flag;
-extern int driver_extension_flag;
-extern int compatible_flag;
-extern int safer_flag;
diff --git a/contrib/groff/pic/pic.man b/contrib/groff/pic/pic.man
deleted file mode 100644
index 311a04e609dc..000000000000
--- a/contrib/groff/pic/pic.man
+++ /dev/null
@@ -1,883 +0,0 @@
-.ig \"-*- nroff -*-
-Copyright (C) 1989-2000 Free Software Foundation, Inc.
-
-Permission is granted to make and distribute verbatim copies of
-this manual provided the copyright notice and this permission notice
-are preserved on all copies.
-
-Permission is granted to copy and distribute modified versions of this
-manual under the conditions for verbatim copying, provided that the
-entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
-Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be included in
-translations approved by the Free Software Foundation instead of in
-the original English.
-..
-.\" Like TP, but if specified indent is more than half
-.\" the current line-length - indent, use the default indent.
-.de Tp
-.ie \\n(.$=0:((0\\$1)*2u>(\\n(.lu-\\n(.iu)) .TP
-.el .TP "\\$1"
-..
-.ie t .ds tx T\h'-.1667m'\v'.224m'E\v'-.224m'\h'-.125m'X
-.el .ds tx TeX
-.ie \n(.g .ds ic \/
-.el .ds ic \^
-.\" The BSD man macros can't handle " in arguments to font change macros,
-.\" so use \(ts instead of ".
-.tr \(ts"
-.TH @G@PIC @MAN1EXT@ "@MDATE@" "Groff Version @VERSION@"
-.SH NAME
-@g@pic \- compile pictures for troff or TeX
-.SH SYNOPSIS
-.B @g@pic
-[
-.B \-nvCSU
-]
-[
-.I filename
-\&.\|.\|.
-]
-.br
-.B @g@pic
-.B \-t
-[
-.B \-cvzCSU
-]
-[
-.I filename
-\&.\|.\|.
-]
-.SH DESCRIPTION
-This manual page describes the GNU version of
-.BR pic ,
-which is part of the groff document formatting system.
-.B pic
-compiles descriptions of pictures embedded within
-.B troff
-or \*(tx input files into commands that are understood by \*(tx or
-.BR troff .
-Each picture starts with a line beginning with
-.B .PS
-and ends with a line beginning with
-.BR .PE .
-Anything outside of
-.B .PS
-and
-.B .PE
-is passed through without change.
-.LP
-It is the user's responsibility to provide appropriate definitions of the
-.B PS
-and
-.B PE
-macros.
-When the macro package being used does not supply such definitions
-(for example, old versions of \-ms),
-appropriate definitions can be obtained with
-.BR \-mpic :
-these will center each picture.
-.SH OPTIONS
-Options that do not take arguments may be grouped behind a single
-.BR \- .
-The special option
-.B \-\^\-
-can be used to mark the end of the options.
-A filename of
-.B \-
-refers to the standard input.
-.TP
-.B \-C
-Recognize
-.B .PS
-and
-.B .PE
-even when followed by a character other than space or newline.
-.TP
-.B \-S
-Safer mode; do not execute
-.B sh
-commands.
-This can be useful when operating on untrustworthy input.
-(enabled by default)
-.TP
-.B \-U
-Unsafe mode; revert the default option
-.BR \-S .
-.TP
-.B \-n
-Don't use the groff extensions to the troff drawing commands.
-You should use this if you are using a postprocessor that doesn't support
-these extensions.
-The extensions are described in
-.BR groff_out (@MAN5EXT@).
-The
-.B \-n
-option also causes
-.B pic
-not to use zero-length lines to draw dots in troff mode.
-.TP
-.B \-t
-\*(tx mode.
-.TP
-.B \-c
-Be more compatible with
-.BR tpic .
-Implies
-.BR \-t .
-Lines beginning with
-.B \e
-are not passed through transparently.
-Lines beginning with
-.B .
-are passed through with the initial
-.B .
-changed to
-.BR \e .
-A line beginning with
-.B .ps
-is given special treatment:
-it takes an optional integer argument specifying
-the line thickness (pen size) in milliinches;
-a missing argument restores the previous line thickness;
-the default line thickness is 8 milliinches.
-The line thickness thus specified takes effect only
-when a non-negative line thickness has not been
-specified by use of the
-.B thickness
-attribute or by setting the
-.B linethick
-variable.
-.TP
-.B \-v
-Print the version number.
-.TP
-.B \-z
-In \*(tx mode draw dots using zero-length lines.
-.LP
-The following options supported by other versions of
-.B pic
-are ignored:
-.TP
-.B \-D
-Draw all lines using the \eD escape sequence.
-.B pic
-always does this.
-.TP
-.BI \-T \ dev
-Generate output for the
-.B troff
-device
-.IR dev .
-This is unnecessary because the
-.B troff
-output generated by
-.B pic
-is device-independent.
-.SH USAGE
-This section describes only the differences between GNU
-.B pic
-and the original version of
-.BR pic .
-Many of these differences also apply to newer versions of Unix
-.BR pic .
-.SS \*(tx mode
-.LP
-\*(tx mode is enabled by the
-.B \-t
-option.
-In \*(tx mode,
-.B pic
-will define a vbox called
-.B \egraph
-for each picture.
-You must yourself print that vbox using, for example, the command
-.RS
-.LP
-.B
-\ecenterline{\ebox\egraph}
-.RE
-.LP
-Actually, since the vbox has a height of zero this will produce
-slightly more vertical space above the picture than below it;
-.RS
-.LP
-.B
-\ecenterline{\eraise 1em\ebox\egraph}
-.RE
-.LP
-would avoid this.
-.LP
-You must use a \*(tx driver that supports the
-.B tpic
-specials, version 2.
-.LP
-Lines beginning with
-.B \e
-are passed through transparently; a
-.B %
-is added to the end of the line to avoid unwanted spaces.
-You can safely use this feature to change fonts or to
-change the value of
-.BR \ebaselineskip .
-Anything else may well produce undesirable results; use at your own risk.
-Lines beginning with a period are not given any special treatment.
-.SS Commands
-.TP
-\fBfor\fR \fIvariable\fR \fB=\fR \fIexpr1\fR \fBto\fR \fIexpr2\fR \
-[\fBby\fR [\fB*\fR]\fIexpr3\fR] \fBdo\fR \fIX\fR \fIbody\fR \fIX\fR
-Set
-.I variable
-to
-.IR expr1 .
-While the value of
-.I variable
-is less than or equal to
-.IR expr2 ,
-do
-.I body
-and increment
-.I variable
-by
-.IR expr3 ;
-if
-.B by
-is not given, increment
-.I variable
-by 1.
-If
-.I expr3
-is prefixed by
-.B *
-then
-.I variable
-will instead be multiplied by
-.IR expr3 .
-.I X
-can be any character not occurring in
-.IR body .
-.TP
-\fBif\fR \fIexpr\fR \fBthen\fR \fIX\fR \fIif-true\fR \fIX\fR \
-[\fBelse\fR \fIY\fR \fIif-false\fR \fIY\fR]
-Evaluate
-.IR expr ;
-if it is non-zero then do
-.IR if-true ,
-otherwise do
-.IR if-false .
-.I X
-can be any character not occurring in
-.IR if-true .
-.I Y
-can be any character not occurring in
-.IR if-false .
-.TP
-\fBprint\fR \fIarg\fR\|.\|.\|.
-Concatenate the arguments and print as a line on stderr.
-Each
-.I arg
-must be an expression, a position, or text.
-This is useful for debugging.
-.TP
-\fBcommand\fR \fIarg\fR\|.\|.\|.
-Concatenate the arguments
-and pass them through as a line to troff or\*(tx.
-Each
-.I arg
-must be an expression, a position, or text.
-This has a similar effect to a line beginning with
-.B .
-or
-.BR \e ,
-but allows the values of variables to be passed through.
-.TP
-\fBsh\fR \fIX\fR \fIcommand\fR \fIX\fR
-Pass
-.I command
-to a shell.
-.I X
-can be any character not occurring in
-.IR command .
-.TP
-\fBcopy\fR \fB"\fIfilename\fB"\fR
-Include
-.I filename
-at this point in the file.
-.TP
-\fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fIX\fR \fIbody\fR \fIX\fR \
-[\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
-.ns
-.TP
-\fBcopy\fR [\fB"\fIfilename\fB"\fR] \fBthru\fR \fImacro\fR \
-[\fBuntil\fR \fB"\fIword\*(ic\fB"\fR]
-This construct does
-.I body
-once for each line of
-.IR filename ;
-the line is split into blank-delimited words,
-and occurrences of
-.BI $ i
-in
-.IR body ,
-for
-.I i
-between 1 and 9,
-are replaced by the
-.IR i -th
-word of the line.
-If
-.I filename
-is not given, lines are taken from the current input up to
-.BR .PE .
-If an
-.B until
-clause is specified,
-lines will be read only until a line the first word of which is
-.IR word ;
-that line will then be discarded.
-.I X
-can be any character not occurring in
-.IR body .
-For example,
-.RS
-.IP
-.ft B
-.nf
-\&.PS
-copy thru % circle at ($1,$2) % until "END"
-1 2
-3 4
-5 6
-END
-box
-\&.PE
-.ft
-.fi
-.RE
-.IP
-is equivalent to
-.RS
-.IP
-.ft B
-.nf
-\&.PS
-circle at (1,2)
-circle at (3,4)
-circle at (5,6)
-box
-\&.PE
-.ft
-.fi
-.RE
-.IP
-The commands to be performed for each line can also be taken
-from a macro defined earlier by giving the name of the macro
-as the argument to
-.BR thru .
-.LP
-.B reset
-.br
-.ns
-.TP
-\fBreset\fI variable1\fB,\fI variable2 .\^.\^.
-Reset pre-defined variables
-.IR variable1 ,
-.I variable2
-\&.\^.\^. to their default values.
-If no arguments are given, reset all pre-defined variables
-to their default values.
-Note that assigning a value to
-.B scale
-also causes all pre-defined variables that control dimensions
-to be reset to their default values times the new value of scale.
-.TP
-\fBplot\fR \fIexpr\fR [\fB"\fItext\*(ic\fB"\fR]
-This is a text object which is constructed by using
-.I text
-as a format string for sprintf
-with an argument of
-.IR expr .
-If
-.I text
-is omitted a format string of
-.B "\(ts%g\(ts"
-is used.
-Attributes can be specified in the same way as for a normal text
-object.
-Be very careful that you specify an appropriate format string;
-.B pic
-does only very limited checking of the string.
-This is deprecated in favour of
-.BR sprintf .
-.TP
-.IB variable := expr
-This is similar to
-.B =
-except
-.I variable
-must already be defined,
-and the value of
-.I variable
-will be changed only in the innermost block in which it is defined.
-(By contrast,
-.B =
-defines the variable in the current block if it is not already defined there,
-and then changes the value in the current block.)
-.LP
-Arguments of the form
-.IP
-.IR X\ anything\ X
-.LP
-are also allowed to be of the form
-.IP
-.BI {\ anything\ }
-.LP
-In this case
-.I anything
-can contain balanced occurrences of
-.B {
-and
-.BR } .
-Strings may contain
-.I X
-or imbalanced occurrences of
-.B {
-and
-.BR } .
-.SS Expressions
-The syntax for expressions has been significantly extended:
-.LP
-.IB x\ ^\ y
-(exponentiation)
-.br
-.BI sin( x )
-.br
-.BI cos( x )
-.br
-.BI atan2( y , \ x )
-.br
-.BI log( x )
-(base 10)
-.br
-.BI exp( x )
-(base 10, ie 10\v'-.4m'\fIx\*(ic\fR\v'.4m')
-.br
-.BI sqrt( x )
-.br
-.BI int( x )
-.br
-.B rand()
-(return a random number between 0 and 1)
-.br
-.BI rand( x )
-(return a random number between 1 and
-.IR x ;
-deprecated)
-.br
-.BI srand( x )
-(set the random number seed)
-.br
-.BI max( e1 , \ e2 )
-.br
-.BI min( e1 , \ e2 )
-.br
-.BI ! e
-.br
-\fIe1\fB && \fIe2\fR
-.br
-\fIe1\fB || \fIe2\fR
-.br
-\fIe1\fB == \fIe2\fR
-.br
-\fIe1\fB != \fIe2\fR
-.br
-\fIe1\fB >= \fIe2\fR
-.br
-\fIe1\fB > \fIe2\fR
-.br
-\fIe1\fB <= \fIe2\fR
-.br
-\fIe1\fB < \fIe2\fR
-.br
-\fB"\fIstr1\*(ic\fB" == "\fIstr2\*(ic\fB"\fR
-.br
-\fB"\fIstr1\*(ic\fB" != "\fIstr2\*(ic\fB"\fR
-.br
-.LP
-String comparison expressions must be parenthesised in some contexts
-to avoid ambiguity.
-.SS Other Changes
-.LP
-A bare expression,
-.IR expr ,
-is acceptable as an attribute;
-it is equivalent to
-.IR dir\ expr ,
-where
-.I dir
-is the current direction.
-For example
-.IP
-.B line 2i
-.LP
-means draw a line 2 inches long in the current direction.
-.LP
-The maximum width and height of the picture are taken from the variables
-.B maxpswid
-and
-.BR maxpsht .
-Initially these have values 8.5 and 11.
-.LP
-Scientific notation is allowed for numbers.
-For example
-.RS
-.B
-x = 5e\-2
-.RE
-.LP
-Text attributes can be compounded.
-For example,
-.RS
-.B
-"foo" above ljust
-.RE
-is legal.
-.LP
-There is no limit to the depth to which blocks can be examined.
-For example,
-.RS
-.B
-[A: [B: [C: box ]]] with .A.B.C.sw at 1,2
-.br
-.B
-circle at last [\^].A.B.C
-.RE
-is acceptable.
-.LP
-Arcs now have compass points
-determined by the circle of which the arc is a part.
-.LP
-Circles and arcs can be dotted or dashed.
-In \*(tx mode splines can be dotted or dashed.
-.LP
-Boxes can have rounded corners.
-The
-.B rad
-attribute specifies the radius of the quarter-circles at each corner.
-If no
-.B rad
-or
-.B diam
-attribute is given, a radius of
-.B boxrad
-is used.
-Initially,
-.B boxrad
-has a value of 0.
-A box with rounded corners can be dotted or dashed.
-.LP
-The
-.B .PS
-line can have a second argument specifying a maximum height for
-the picture.
-If the width of zero is specified the width will be ignored in computing
-the scaling factor for the picture.
-Note that GNU
-.B pic
-will always scale a picture by the same amount vertically as horizontally.
-This is different from the
-.SM DWB
-2.0
-.B pic
-which may scale a picture by a different amount vertically than
-horizontally if a height is specified.
-.LP
-Each text object has an invisible box associated with it.
-The compass points of a text object are determined by this box.
-The implicit motion associated with the object is also determined
-by this box.
-The dimensions of this box are taken from the width and height attributes;
-if the width attribute is not supplied then the width will be taken to be
-.BR textwid ;
-if the height attribute is not supplied then the height will be taken to be
-the number of text strings associated with the object
-times
-.BR textht .
-Initially
-.B textwid
-and
-.B textht
-have a value of 0.
-.LP
-In places where a quoted text string can be used,
-an expression of the form
-.IP
-.BI sprintf(\(ts format \(ts,\ arg ,\fR.\|.\|.\fB)
-.LP
-can also be used;
-this will produce the arguments formatted according to
-.IR format ,
-which should be a string as described in
-.BR printf (3)
-appropriate for the number of arguments supplied,
-using only the
-.BR e ,
-.BR f ,
-.B g
-or
-.B %
-format characters.
-.LP
-The thickness of the lines used to draw objects is controlled by the
-.B linethick
-variable.
-This gives the thickness of lines in points.
-A negative value means use the default thickness:
-in \*(tx output mode, this means use a thickness of 8 milliinches;
-in \*(tx output mode with the
-.B -c
-option, this means use the line thickness specified by
-.B .ps
-lines;
-in troff output mode, this means use a thickness proportional
-to the pointsize.
-A zero value means draw the thinnest possible line supported by
-the output device.
-Initially it has a value of -1.
-There is also a
-.BR thick [ ness ]
-attribute.
-For example,
-.RS
-.LP
-.B circle thickness 1.5
-.RE
-.LP
-would draw a circle using a line with a thickness of 1.5 points.
-The thickness of lines is not affected by the
-value of the
-.B scale
-variable, nor by the width or height given in the
-.B .PS
-line.
-.LP
-Boxes (including boxes with rounded corners),
-circles and ellipses can be filled by giving then an attribute of
-.BR fill [ ed ].
-This takes an optional argument of an expression with a value between
-0 and 1; 0 will fill it with white, 1 with black, values in between
-with a proportionally gray shade.
-A value greater than 1 can also be used:
-this means fill with the
-shade of gray that is currently being used for text and lines.
-Normally this will be black, but output devices may provide
-a mechanism for changing this.
-Without an argument, then the value of the variable
-.B fillval
-will be used.
-Initially this has a value of 0.5.
-The invisible attribute does not affect the filling of objects.
-Any text associated with a filled object will be added after the
-object has been filled, so that the text will not be obscured
-by the filling.
-.LP
-Arrow heads will be drawn as solid triangles if the variable
-.B arrowhead
-is non-zero and either \*(tx mode is enabled or
-the
-.B \-x
-option has been given.
-Initially
-.B arrowhead
-has a value of 1.
-.LP
-The troff output of
-.B pic
-is device-independent.
-The
-.B \-T
-option is therefore redundant.
-All numbers are taken to be in inches; numbers are never interpreted
-to be in troff machine units.
-.LP
-Objects can have an
-.B aligned
-attribute.
-This will only work when the postprocessor is
-.BR grops .
-Any text associated with an object having the
-.B aligned
-attribute will be rotated about the center of the object
-so that it is aligned in the direction from the start point
-to the end point of the object.
-Note that this attribute will have no effect for objects whose start and
-end points are coincident.
-.LP
-In places where
-.IB n th
-is allowed
-.BI ` expr 'th
-is also allowed.
-Note that
-.B 'th
-is a single token: no space is allowed between the
-.B '
-and the
-.BR th .
-For example,
-.IP
-.B
-.nf
-for i = 1 to 4 do {
- line from `i'th box.nw to `i+1'th box.se
-}
-.fi
-.SH CONVERSION
-To obtain a stand-alone picture from a
-.B pic
-file, enclose your
-.B pic
-code with
-.B .PS
-and
-.B .PE
-requests;
-.B roff
-configuration commands may be added at the beginning of the file, but no
-.B roff
-text.
-.LP
-It is necessary to feed this file into
-.B groff
-without adding any page information, so you must check which
-.B .PS
-and
-.B .PE
-requests are actually called.
-For example, the mm macro package adds a page number, which is very
-annoying.
-At the moment, calling standard
-.B groff
-without any macro package works.
-Alternatively, you can define your own requests, e.g. to do nothing:
-.LP
-.RS
-.nf
-.ft B
-\&.de PS
-\&..
-\&.de PE
-\&..
-.ft
-.fi
-.RE
-.LP
-.B groff
-itself does not provide direct conversion into other graphics file
-formats.
-But there are lots of possibilities if you first transform your picture
-into PostScript\*R format using the
-.B groff
-option
-.BR -Tps .
-Since this
-.IR ps -file
-lacks BoundingBox information it is not very useful by itself, but it
-may be fed into other conversion programs, usually named
-.BI ps2 other
-or
-.BI psto other
-or the like.
-Moreover, the PostScript interpreter
-.B ghostscript
-.RB ( gs )
-has built-in graphics conversion devices that are called with the option
-.LP
-.RS
-.BI "gs -sDEVICE="
-.RE
-.LP
-Call
-.RS
-.B gs --help
-.RE
-.LP
-for a list of the available devices.
-.LP
-As the Encapsulated PostScript File Format
-.B EPS
-is getting more and more important, and the conversion wasn't regarded
-trivial in the past you might be interested to know that there is a
-conversion tool named
-.B ps2eps
-which does the right job.
-It is much better than the tool
-.B ps2epsi
-packaged with
-.BR gs .
-.LP
-For bitmapped graphic formats, you should use
-.BR pstopnm ;
-the resulting (intermediate)
-.B PNM
-file can be then converted to virtually any graphics format using the tools
-of the
-.B netpbm
-package .
-.SH FILES
-.Tp \w'\fB@MACRODIR@/tmac.pic'u+3n
-.B
-@MACRODIR@/tmac.pic
-Example definitions of the
-.B PS
-and
-.B PE
-macros.
-.SH "SEE ALSO"
-.BR @g@troff (@MAN1EXT@),
-.BR groff_out (@MAN5EXT@),
-.BR tex (1),
-.BR gs (1),
-.BR ps2eps (1),
-.BR pstopnm (1),
-.BR ps2epsi (1),
-.BR pnm (5)
-.LP
-Tpic: Pic for \*(tx
-.LP
-Brian W. Kernighan,
-PIC \(em A Graphics Language for Typesetting (User Manual).
-AT&T Bell Laboratories, Computing Science Technical Report No.\ 116
-
-(revised May, 1991).
-.LP
-.B ps2eps
-is available from CTAN mirrors, e.g.
-.br
-
-.LP
-W. Richard Stevens - Turning PIC Into HTML
-.br
-
-.LP
-W. Richard Stevens - Examples of picMacros
-.br
-
-.SH BUGS
-.LP
-Input characters that are illegal for
-.B groff
-(ie those with
-.SM ASCII
-code 0 or between 013 and 037 octal or between 0200 and 0237 octal)
-are rejected even in \*(tx mode.
-.LP
-The interpretation of
-.B fillval
-is incompatible with the pic in 10th edition Unix,
-which interprets 0 as black and 1 as white.
-.LP
-PostScript\*R is a registered trademark of Adobe Systems Incorporation.
diff --git a/contrib/groff/pic/pic.tab.h b/contrib/groff/pic/pic.tab.h
deleted file mode 100644
index c71bdfd2cd3e..000000000000
--- a/contrib/groff/pic/pic.tab.h
+++ /dev/null
@@ -1,129 +0,0 @@
-#define LABEL 257
-#define VARIABLE 258
-#define NUMBER 259
-#define TEXT 260
-#define COMMAND_LINE 261
-#define DELIMITED 262
-#define ORDINAL 263
-#define TH 264
-#define LEFT_ARROW_HEAD 265
-#define RIGHT_ARROW_HEAD 266
-#define DOUBLE_ARROW_HEAD 267
-#define LAST 268
-#define UP 269
-#define DOWN 270
-#define LEFT 271
-#define RIGHT 272
-#define BOX 273
-#define CIRCLE 274
-#define ELLIPSE 275
-#define ARC 276
-#define LINE 277
-#define ARROW 278
-#define MOVE 279
-#define SPLINE 280
-#define HEIGHT 281
-#define RADIUS 282
-#define WIDTH 283
-#define DIAMETER 284
-#define FROM 285
-#define TO 286
-#define AT 287
-#define WITH 288
-#define BY 289
-#define THEN 290
-#define DOTTED 291
-#define DASHED 292
-#define CHOP 293
-#define SAME 294
-#define INVISIBLE 295
-#define LJUST 296
-#define RJUST 297
-#define ABOVE 298
-#define BELOW 299
-#define OF 300
-#define THE 301
-#define WAY 302
-#define BETWEEN 303
-#define AND 304
-#define HERE 305
-#define DOT_N 306
-#define DOT_E 307
-#define DOT_W 308
-#define DOT_S 309
-#define DOT_NE 310
-#define DOT_SE 311
-#define DOT_NW 312
-#define DOT_SW 313
-#define DOT_C 314
-#define DOT_START 315
-#define DOT_END 316
-#define DOT_X 317
-#define DOT_Y 318
-#define DOT_HT 319
-#define DOT_WID 320
-#define DOT_RAD 321
-#define SIN 322
-#define COS 323
-#define ATAN2 324
-#define LOG 325
-#define EXP 326
-#define SQRT 327
-#define K_MAX 328
-#define K_MIN 329
-#define INT 330
-#define RAND 331
-#define COPY 332
-#define THRU 333
-#define TOP 334
-#define BOTTOM 335
-#define UPPER 336
-#define LOWER 337
-#define SH 338
-#define PRINT 339
-#define CW 340
-#define CCW 341
-#define FOR 342
-#define DO 343
-#define IF 344
-#define ELSE 345
-#define ANDAND 346
-#define OROR 347
-#define NOTEQUAL 348
-#define EQUALEQUAL 349
-#define LESSEQUAL 350
-#define GREATEREQUAL 351
-#define LEFT_CORNER 352
-#define RIGHT_CORNER 353
-#define CENTER 354
-#define END 355
-#define START 356
-#define RESET 357
-#define UNTIL 358
-#define PLOT 359
-#define THICKNESS 360
-#define FILL 361
-#define ALIGNED 362
-#define SPRINTF 363
-#define COMMAND 364
-#define DEFINE 365
-#define UNDEF 366
-typedef union {
- char *str;
- int n;
- double x;
- struct { double x, y; } pair;
- struct { double x; char *body; } if_data;
- struct { char *str; const char *filename; int lineno; } lstr;
- struct { double *v; int nv; int maxv; } dv;
- struct { double val; int is_multiplicative; } by;
- place pl;
- object *obj;
- corner crn;
- path *pth;
- object_spec *spec;
- saved_state *pstate;
- graphics_state state;
- object_type obtype;
-} YYSTYPE;
-extern YYSTYPE yylval;
diff --git a/contrib/groff/pic/pic.y b/contrib/groff/pic/pic.y
deleted file mode 100644
index d9191b459029..000000000000
--- a/contrib/groff/pic/pic.y
+++ /dev/null
@@ -1,1807 +0,0 @@
-/* Copyright (C) 1989, 1990, 1991, 1992 Free Software Foundation, Inc.
- Written by James Clark (jjc@jclark.com)
-
-This file is part of groff.
-
-groff is free software; you can redistribute it and/or modify it under
-the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2, or (at your option) any later
-version.
-
-groff is distributed in the hope that it will be useful, but WITHOUT ANY
-WARRANTY; without even the implied warranty of MERCHANTABILITY or
-FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-for more details.
-
-You should have received a copy of the GNU General Public License along
-with groff; see the file COPYING. If not, write to the Free Software
-Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-%{
-#include "pic.h"
-#include "ptable.h"
-#include "object.h"
-
-extern int delim_flag;
-extern void do_copy(const char *);
-extern void copy_rest_thru(const char *, const char *);
-extern void copy_file_thru(const char *, const char *, const char *);
-extern void push_body(const char *);
-extern void do_for(char *var, double from, double to,
- int by_is_multiplicative, double by, char *body);
-extern void do_lookahead();
-
-#ifndef HAVE_FMOD
-extern "C" {
- double fmod(double, double);
-}
-#endif
-
-#undef rand
-#undef srand
-extern "C" {
- int rand();
-#ifdef RET_TYPE_SRAND_IS_VOID
- void srand(unsigned int);
-#else
- int srand(unsigned int);
-#endif
-}
-
-/* Maximum number of characters produced by printf("%g") */
-#define GDIGITS 14
-
-int yylex();
-void yyerror(const char *);
-
-void reset(const char *nm);
-void reset_all();
-
-place *lookup_label(const char *);
-void define_label(const char *label, const place *pl);
-
-direction current_direction;
-position current_position;
-
-implement_ptable(place)
-
-PTABLE(place) top_table;
-
-PTABLE(place) *current_table = &top_table;
-saved_state *current_saved_state = 0;
-
-object_list olist;
-
-const char *ordinal_postfix(int n);
-const char *object_type_name(object_type type);
-char *format_number(const char *form, double n);
-char *do_sprintf(const char *form, const double *v, int nv);
-
-%}
-
-
-%union {
- char *str;
- int n;
- double x;
- struct { double x, y; } pair;
- struct { double x; char *body; } if_data;
- struct { char *str; const char *filename; int lineno; } lstr;
- struct { double *v; int nv; int maxv; } dv;
- struct { double val; int is_multiplicative; } by;
- place pl;
- object *obj;
- corner crn;
- path *pth;
- object_spec *spec;
- saved_state *pstate;
- graphics_state state;
- object_type obtype;
-}
-
-%token LABEL
-%token VARIABLE
-%token NUMBER
-%token TEXT
-%token COMMAND_LINE
-%token DELIMITED
-%token ORDINAL
-%token TH
-%token LEFT_ARROW_HEAD
-%token RIGHT_ARROW_HEAD
-%token DOUBLE_ARROW_HEAD
-%token LAST
-%token UP
-%token DOWN
-%token LEFT
-%token RIGHT
-%token BOX
-%token CIRCLE
-%token ELLIPSE
-%token ARC
-%token LINE
-%token ARROW
-%token MOVE
-%token SPLINE
-%token HEIGHT
-%token RADIUS
-%token WIDTH
-%token DIAMETER
-%token UP
-%token DOWN
-%token RIGHT
-%token LEFT
-%token FROM
-%token TO
-%token AT
-%token WITH
-%token BY
-%token THEN
-%token DOTTED
-%token DASHED
-%token CHOP
-%token SAME
-%token INVISIBLE
-%token LJUST
-%token RJUST
-%token ABOVE
-%token BELOW
-%token OF
-%token THE
-%token WAY
-%token BETWEEN
-%token AND
-%token HERE
-%token DOT_N
-%token DOT_E
-%token DOT_W
-%token DOT_S
-%token DOT_NE
-%token DOT_SE
-%token DOT_NW
-%token DOT_SW
-%token DOT_C
-%token DOT_START
-%token DOT_END
-%token DOT_X
-%token DOT_Y
-%token DOT_HT
-%token DOT_WID
-%token DOT_RAD
-%token SIN
-%token COS
-%token ATAN2
-%token LOG
-%token EXP
-%token SQRT
-%token K_MAX
-%token K_MIN
-%token INT
-%token RAND
-%token SRAND
-%token COPY
-%token THRU
-%token TOP
-%token BOTTOM
-%token UPPER
-%token LOWER
-%token SH
-%token PRINT
-%token CW
-%token CCW
-%token FOR
-%token DO
-%token IF
-%token ELSE
-%token ANDAND
-%token OROR
-%token NOTEQUAL
-%token EQUALEQUAL
-%token LESSEQUAL
-%token GREATEREQUAL
-%token LEFT_CORNER
-%token RIGHT_CORNER
-%token CENTER
-%token END
-%token START
-%token RESET
-%token UNTIL
-%token PLOT
-%token THICKNESS
-%token FILL
-%token ALIGNED
-%token SPRINTF
-%token COMMAND
-
-%token DEFINE
-%token UNDEF
-
-/* this ensures that plot 17 "%g" parses as (plot 17 "%g") */
-%left PLOT
-%left TEXT SPRINTF
-
-/* give text adjustments higher precedence than TEXT, so that
-box "foo" above ljust == box ("foo" above ljust)
-*/
-
-%left LJUST RJUST ABOVE BELOW
-
-%left LEFT RIGHT
-/* Give attributes that take an optional expression a higher
-precedence than left and right, so that eg `line chop left'
-parses properly. */
-%left CHOP DASHED DOTTED UP DOWN FILL
-%left LABEL
-
-%left VARIABLE NUMBER '(' SIN COS ATAN2 LOG EXP SQRT K_MAX K_MIN INT RAND SRAND LAST
-%left ORDINAL HERE '`'
-
-/* these need to be lower than '-' */
-%left HEIGHT RADIUS WIDTH DIAMETER FROM TO AT THICKNESS
-
-/* these must have higher precedence than CHOP so that `label %prec CHOP'
-works */
-%left DOT_N DOT_E DOT_W DOT_S DOT_NE DOT_SE DOT_NW DOT_SW DOT_C
-%left DOT_START DOT_END TOP BOTTOM LEFT_CORNER RIGHT_CORNER
-%left UPPER LOWER CENTER START END
-
-%left ','
-%left OROR
-%left ANDAND
-%left EQUALEQUAL NOTEQUAL
-%left '<' '>' LESSEQUAL GREATEREQUAL
-
-%left BETWEEN OF
-%left AND
-
-%left '+' '-'
-%left '*' '/' '%'
-%right '!'
-%right '^'
-
-%type expr any_expr text_expr
-%type optional_by
-%type expr_pair position_not_place
-%type simple_if
-%type nth_primitive
-%type corner
-%type path label_path relative_path
-%type place label element element_list middle_element_list
-%type object_spec
-%type position
-%type object_type
-%type optional_ordinal_last ordinal
-%type until
-%type sprintf_args
-%type text print_args print_arg
-
-%%
-
-top:
- optional_separator
- | element_list
- {
- if (olist.head)
- print_picture(olist.head);
- }
- ;
-
-
-element_list:
- optional_separator middle_element_list optional_separator
- { $$ = $2; }
- ;
-
-middle_element_list:
- element
- { $$ = $1; }
- | middle_element_list separator element
- { $$ = $1; }
- ;
-
-optional_separator:
- /* empty */
- | separator
- ;
-
-separator:
- ';'
- | separator ';'
- ;
-
-placeless_element:
- VARIABLE '=' any_expr
- {
- define_variable($1, $3);
- a_delete $1;
- }
- | VARIABLE ':' '=' any_expr
- {
- place *p = lookup_label($1);
- if (!p) {
- lex_error("variable `%1' not defined", $1);
- YYABORT;
- }
- p->obj = 0;
- p->x = $4;
- p->y = 0.0;
- a_delete $1;
- }
- | UP
- { current_direction = UP_DIRECTION; }
- | DOWN
- { current_direction = DOWN_DIRECTION; }
- | LEFT
- { current_direction = LEFT_DIRECTION; }
- | RIGHT
- { current_direction = RIGHT_DIRECTION; }
- | COMMAND_LINE
- {
- olist.append(make_command_object($1.str, $1.filename,
- $1.lineno));
- }
- | COMMAND print_args
- {
- olist.append(make_command_object($2.str, $2.filename,
- $2.lineno));
- }
- | PRINT print_args
- {
- fprintf(stderr, "%s\n", $2.str);
- a_delete $2.str;
- fflush(stderr);
- }
- | SH
- { delim_flag = 1; }
- DELIMITED
- {
- delim_flag = 0;
- if (safer_flag)
- lex_error("unsafe to run command `%1'", $3);
- else
- system($3);
- a_delete $3;
- }
- | COPY TEXT
- {
- if (yychar < 0)
- do_lookahead();
- do_copy($2.str);
- // do not delete the filename
- }
- | COPY TEXT THRU
- { delim_flag = 2; }
- DELIMITED
- { delim_flag = 0; }
- until
- {
- if (yychar < 0)
- do_lookahead();
- copy_file_thru($2.str, $5, $7);
- // do not delete the filename
- a_delete $5;
- a_delete $7;
- }
- | COPY THRU
- { delim_flag = 2; }
- DELIMITED
- { delim_flag = 0; }
- until
- {
- if (yychar < 0)
- do_lookahead();
- copy_rest_thru($4, $6);
- a_delete $4;
- a_delete $6;
- }
- | FOR VARIABLE '=' expr TO expr optional_by DO
- { delim_flag = 1; }
- DELIMITED
- {
- delim_flag = 0;
- if (yychar < 0)
- do_lookahead();
- do_for($2, $4, $6, $7.is_multiplicative, $7.val, $10);
- }
- | simple_if
- {
- if (yychar < 0)
- do_lookahead();
- if ($1.x != 0.0)
- push_body($1.body);
- a_delete $1.body;
- }
- | simple_if ELSE
- { delim_flag = 1; }
- DELIMITED
- {
- delim_flag = 0;
- if (yychar < 0)
- do_lookahead();
- if ($1.x != 0.0)
- push_body($1.body);
- else
- push_body($4);
- a_delete $1.body;
- a_delete $4;
- }
- | reset_variables
- | RESET
- { define_variable("scale", 1.0); }
- ;
-
-reset_variables:
- RESET VARIABLE
- { reset($2); a_delete $2; }
- | reset_variables VARIABLE
- { reset($2); a_delete $2; }
- | reset_variables ',' VARIABLE
- { reset($3); a_delete $3; }
- ;
-
-print_args:
- print_arg
- { $$ = $1; }
- | print_args print_arg
- {
- $$.str = new char[strlen($1.str) + strlen($2.str) + 1];
- strcpy($$.str, $1.str);
- strcat($$.str, $2.str);
- a_delete $1.str;
- a_delete $2.str;
- if ($1.filename) {
- $$.filename = $1.filename;
- $$.lineno = $1.lineno;
- }
- else if ($2.filename) {
- $$.filename = $2.filename;
- $$.lineno = $2.lineno;
- }
- }
- ;
-
-print_arg:
- expr %prec ','
- {
- $$.str = new char[GDIGITS + 1];
- sprintf($$.str, "%g", $1);
- $$.filename = 0;
- $$.lineno = 0;
- }
- | text
- { $$ = $1; }
- | position %prec ','
- {
- $$.str = new char[GDIGITS + 2 + GDIGITS + 1];
- sprintf($$.str, "%g, %g", $1.x, $1.y);
- $$.filename = 0;
- $$.lineno = 0;
- }
-
-simple_if:
- IF any_expr THEN
- { delim_flag = 1; }
- DELIMITED
- { delim_flag = 0; $$.x = $2; $$.body = $5; }
- ;
-
-until:
- /* empty */
- { $$ = 0; }
- | UNTIL TEXT
- { $$ = $2.str; }
- ;
-
-any_expr:
- expr
- { $$ = $1; }
- | text_expr
- { $$ = $1; }
- ;
-
-text_expr:
- text EQUALEQUAL text
- {
- $$ = strcmp($1.str, $3.str) == 0;
- a_delete $1.str;
- a_delete $3.str;
- }
- | text NOTEQUAL text
- {
- $$ = strcmp($1.str, $3.str) != 0;
- a_delete $1.str;
- a_delete $3.str;
- }
- | text_expr ANDAND text_expr
- { $$ = ($1 != 0.0 && $3 != 0.0); }
- | text_expr ANDAND expr
- { $$ = ($1 != 0.0 && $3 != 0.0); }
- | expr ANDAND text_expr
- { $$ = ($1 != 0.0 && $3 != 0.0); }
- | text_expr OROR text_expr
- { $$ = ($1 != 0.0 || $3 != 0.0); }
- | text_expr OROR expr
- { $$ = ($1 != 0.0 || $3 != 0.0); }
- | expr OROR text_expr
- { $$ = ($1 != 0.0 || $3 != 0.0); }
- | '!' text_expr
- { $$ = ($2 == 0.0); }
- ;
-
-
-optional_by:
- /* empty */
- { $$.val = 1.0; $$.is_multiplicative = 0; }
- | BY expr
- { $$.val = $2; $$.is_multiplicative = 0; }
- | BY '*' expr
- { $$.val = $3; $$.is_multiplicative = 1; }
- ;
-
-element:
- object_spec
- {
- $$.obj = $1->make_object(¤t_position,
- ¤t_direction);
- if ($$.obj == 0)
- YYABORT;
- delete $1;
- if ($$.obj)
- olist.append($$.obj);
- else {
- $$.x = current_position.x;
- $$.y = current_position.y;
- }
- }
- | LABEL ':' optional_separator element
- { $$ = $4; define_label($1, & $$); a_delete $1; }
- | LABEL ':' optional_separator position_not_place
- {
- $$.obj = 0;
- $$.x = $4.x;
- $$.y = $4.y;
- define_label($1, & $$);
- a_delete $1;
- }
- | LABEL ':' optional_separator place
- {
- $$ = $4;
- define_label($1, & $$);
- a_delete $1;
- }
- | '{'
- {
- $$.x = current_position.x;
- $$.y = current_position.y;
- $