[llvm-commits] CVS: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Contributors LICENSE Makefile README americanmed+.hash config.h correct.c defmt.c dump.c fields.h good.c hash.c ispell.c ispell.el ispell.h ispell.info large.txt local.h lookup.c makedent.c msgs.h parse.h parse.output proto.h small.txt term.c tgood.c tree.c version.h xgets.c

Chris Lattner sabre at nondot.org
Tue Jan 9 15:57:53 PST 2007



Changes in directory llvm-test/MultiSource/Benchmarks/MiBench/office-ispell:

Contributors added (r1.1)
LICENSE added (r1.1)
Makefile added (r1.1)
README added (r1.1)
americanmed+.hash added (r1.1)
config.h added (r1.1)
correct.c added (r1.1)
defmt.c added (r1.1)
dump.c added (r1.1)
fields.h added (r1.1)
good.c added (r1.1)
hash.c added (r1.1)
ispell.c added (r1.1)
ispell.el added (r1.1)
ispell.h added (r1.1)
ispell.info added (r1.1)
large.txt added (r1.1)
local.h added (r1.1)
lookup.c added (r1.1)
makedent.c added (r1.1)
msgs.h added (r1.1)
parse.h added (r1.1)
parse.output added (r1.1)
proto.h added (r1.1)
small.txt added (r1.1)
term.c added (r1.1)
tgood.c added (r1.1)
tree.c added (r1.1)
version.h added (r1.1)
xgets.c added (r1.1)
---
Log message:

initial recheckin of mibench


---
Diffs of the changes:  (+22444 -0)

 Contributors      |  490 +++
 LICENSE           |    2 
 Makefile          |    8 
 README            |  394 +++
 americanmed+.hash |    0 
 config.h          |  885 ++++++
 correct.c         | 1716 +++++++++++++
 defmt.c           |  907 +++++++
 dump.c            |  198 +
 fields.h          |   68 
 good.c            |  422 +++
 hash.c            |  105 
 ispell.c          | 1012 +++++++
 ispell.el         | 2381 ++++++++++++++++++
 ispell.h          |  652 +++++
 ispell.info       |  404 +++
 large.txt         | 6844 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 local.h           |  104 
 lookup.c          |  486 +++
 makedent.c        | 1112 ++++++++
 msgs.h            |  281 ++
 parse.h           |   36 
 parse.output      | 1225 +++++++++
 proto.h           |  288 ++
 small.txt         |   94 
 term.c            |  639 +++++
 tgood.c           |  667 +++++
 tree.c            |  740 +++++
 version.h         |  130 +
 xgets.c           |  154 +
 30 files changed, 22444 insertions(+)


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Contributors
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Contributors:1.1
*** /dev/null	Tue Jan  9 17:57:28 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Contributors	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,490 ----
+ Ispell has a long and convoluted history.  I have tried to track down
+ as much as possible about it and condense it below.
+ 
+ THE DEVELOPMENT OF SPELL-CHECKING AND THE FIRST ISPELL
+ 
+ The following background information on spelling checkers in general,
+ and ispell in particular, was provided to me by Les Earnest
+ (les at dec-lite.stanford.edu):
+ 
+ > The earliest spelling checker (of sorts) of which I am aware was in a
+ > program that attempted to automatically receive human-keyed Morse
+ > code, which can be ambiguous because of the variable timing between
+ > dots, dashes, intercharacter pauses, and interword pauses.  This
+ > program didn't use a full dictionary; instead, used a table of
+ > digraphs (two-letter sequences) that occur in English and barred
+ > improper letter sequences.  This program was written by someone at MIT
+ > Lincoln Lab around 1959 and, I think, ran on the TX-2 computer there.
+ > Unfortunately, I don't remember his name.  I might still have the
+ > paper he wrote in my files but it would take a major search to find it
+ > and I might not succeed.
+ >
+ > A program that I wrote in 1961 to read cursive writing contained a
+ > real spelling checker, using the 10,000 most common English words.
+ > It is reported in:
+ >   L. Earnest, "Machine Recognition of Cursive Writing," Information
+ >   Processing 62, (Proc. IFIP Congress 1962, Munich), North-Holland,
+ >   Amsterdam, 1963.
+ > and
+ >   N. Lindgren, ``Machine Recognition of Human Language, Part III -
+ >   Cursive Script Recognition'', IEEE Spectrum, May 1965.
+ >
+ > I brought that dictionary to Stanford and got a PhD student to write
+ > a spelling checker for text in Lisp running on our PDP-6 computer at
+ > the Stanford Artificial Intelligence Lab around 1967.
+ > Unfortunately, I do not remember which student it was; it could have
+ > been Gil Falk.  It was a rather simple program (certainly much
+ > simpler than the earlier cursive writing program) and I didn't think
+ > of it as a significant development at the time.
+ >
+ > [Later], I got another PhD student, Ralph Gorin, to do a better and
+ > faster spelling checker sometime in the early '70s, still using my
+ > old dictionary.  Ralph later wrote an article about it in CACM.  I
+ > believe that he later augmented the dictionary.
+ 
+ [note: Ralph has since informed me that he wrote no such article.  The
+ program was called SPELL and was written in 1971.  Ralph provided me
+ with a reference to "Computer Programs for Spelling Correction", by
+ James L. Peterson, Springer-Verlag, Berlin, 1980, No. 96 in the series
+ "Lecture Notes in Computer Science."  This book states that Ralph's
+ SPELL program, which was the direct ancestor of ispell, was the first
+ computer program written for checking the spelling of text documents.
+ The book is also a good source of references on spelling programs.]
+ 
+ > ...
+ >    
+ > [Ispell] was originally written in PDP-10 assembly language and ran
+ > under the WAITS operating system, which is similar to TOPS-10 but existed
+ > only on SAIL (a dual processor KA10/PDP-6 system).  It was and is called
+ > SPELL on that machine.  It later was modified to run under Tenex and
+ > TOPS-20.
+ 
+ [Ralph mentions that SPELL was also ported to MIT's ITS and TOPS-10.]
+    
+ The Tenex version of ispell was later revised by W. E. Matson (1974),
+ and Bill Ackerman (1978).  Bill has provided the following information:
+ 
+ > I came across the SPELL program in 1978 on ITS.  It was a port from
+ > Stanford, and had the names Ralph Gorin (approximately 1971) and
+ > Wayne Matson (1974) associated with it.  I did 3 things to it:
+ >
+ >    Rewrote it as a native program for ITS, and, shortly thereafter,
+ >       TOPS-20.  (I never did anything for TOPS-10, and am not aware
+ >       that it ever ran on TOPS-10, though it may have.)
+ >
+ >    Replaced the heuristics for suffix removal, which I found unreliable
+ >       and unsatisfactory, with an algorithm that was driven by specific
+ >       suffix flags in the dictionary.  This way, the dictionary would have
+ >       complete control over what words were legal, and there would be no
+ >       spurious hits.
+ >
+ >    Apparently most importantly, though I had no idea at time, gave it
+ >       the name "ISPELL", for "ITS version of spell", since I didn't
+ >       consider myself authorized to throw away an existing program
+ >       and overwrite it with a new one under the same name.
+ >
+ > I have not followed the history of the program since then, and do not know
+ > if it still uses the "suffix flags" in its dictionary.  But if it does,
+ > I introduced them.  The Ispell algorithm that uses those flags to make
+ > accurate decisions about the legality of words was documented in great
+ > detail in James Peterson's Springer-Verlag book.  (He spent a semester
+ > at MIT while working on the book, and I provided him with a lot of
+ > information and documentation at that time.)
+ >
+ >                            Bill Ackerman
+ >                            wba at apollo.hp.com
+ 
+ Michael Adler adds:
+ 
+ > I did work on ispell in 1982.  Actually, I stole the ispell
+ > dictionary and suffix compression algorithm and wrote a spelling
+ > checker for CP/M in 8080 assembler that I very creatively called "SPELL."
+ > By sorting the dictionary alphabetically and using a difference encoding
+ > I managed to pack the entire dictionary that Bill was using in about
+ > 56Kb.  The CP/M program read a document, sorted all the words alphabetically
+ > and then checked them.  It then reread the document and compared words as
+ > it found them against the in memory, sorted and checked words.  SPELL was
+ > around in the public domain on CP/M.
+ >
+ > I was in high school at the time and talked to Bill only over email.
+ > We wound up in the same compiler group at Apollo in the late 80's by
+ > coincidence.
+ 
+ DEVELOPMENT OF THE C/UNIX VERSION OF ISPELL
+ 
+ In 1983, Pace Willisson (pace at prep.ai.mit.edu) wrote a C/Unix version
+ from scratch, based on the ispell documentation.
+ 
+ In 1987, Walt Buehring revised and enhanced ispell, and posted it to the
+ Usenet along with a dictionary.  In addition, Walt wrote the first version
+ of "ispell.el", the emacs interface.
+ 
+ Geoff Kuenning (geoff at ITcorp.com, that's me, and by the way I
+ pronounce it "Kenning"; the "u" is silent) picked up this version,
+ fixed some bugs, and added further enhancements, all of which made me
+ the de-facto ispell maintainer for the net.  I also put quite a bit of
+ work into improving the quality of the dictionaries.  In 1987 I began
+ work on the "munchlist" script, which I originally intended to be used
+ to add flags to personal dictionary entries.  At the same time I was
+ studying German, and wanted to use ispell to check the papers I was
+ writing for that class.  After thinking about it for some time, I
+ realized that the suffix flags could be table-driven, which would both
+ add flexibility and would get rid of certain difficult-to-find bugs.
+ In 1988 I rewrote major portions of the code to do this, resulting in
+ the first multi-lingual version.  Ole Bjoern Hessen (obh at ifi.uio.no)
+ in Norway alpha-tested this version and provided several important
+ enhancements.
+ 
+ Bob Devine (vianet!devine) provided two larger dictionaries (which
+ became the basis for english.1 and english.2) to me for inclusion
+ with subsequent releases.
+ 
+ Ashwin Ram (ram at cs.yale.edu) made substantial enhancements to Walt
+ Buehring's emacs interface, and provided them to me for inclusion
+ with an earlier release.
+ 
+ The emacs interface was then completely overhauled by Ken Stevens
+ (stevens at hplabs.hp.com), who also beta-tested the software and
+ without whom this posting would not have been possible.  If there's a
+ feature in the emacs interface that you like, you probably have Ken to
+ thank for it.  His efforts have been tireless for many years.
+ 
+ Martin Boyer made major contributions to the munchlist script,
+ including producing a version that runs under perl (see
+ languages/Where for instructions on how to get that version).
+ Philippe-Andre Prindeville provided xspell (a Motif-based X
+ interface), and Moritz Willers provided a NeXTStep interface.
+ 
+ DEVELOPMENT AND DEATH OF ISPELL 4.0
+ 
+ Meanwhile, and unbeknownst to me, Pace Willisson was working on his
+ own improvements to ispell.  He focused primarily on dictionary size
+ and startup time.  His solution was a dictionary compression algorithm
+ that detected and encoded frequent letter pairs.  This also reduced
+ the time needed to read it in.  Pace also changed some internal data
+ structures to improve startup time.  Pace and I eventually discovered
+ each other's efforts, and discussed re-merging our changes, but we
+ decided that there would be too much work involved.  This was partly
+ because I was close to a release and didn't want to delay it with an
+ extensive and error-prone merge.
+ 
+ In late 1992 (if my memory serves correctly), Richard Stallman
+ contacted me, asking for permission to distribute ispell as part of
+ the GNU suite.  I responded that he was welcome to distribute it, but
+ that I was not willing to place my software under the Gnu Public
+ License.  Through a misunderstanding, neither of us considered the
+ possibility of finding a compromise license that both could live with.
+ So Richard started a search for an alternate version, and found Pace
+ working right in his back yard.
+ 
+ I have been told that when FSF first learned of Pace's version, they
+ again considered using International Ispell instead because it was
+ both more popular and more capable, but this idea was rejected due to
+ the license misunderstanding.  Instead, FSF enhanced Pace's version
+ somewhat and called it ispell 4.0, apparently in the hopes that by
+ numbering the version higher, it would become the standard.
+ 
+ When ispell 4.0 was released, much confusion ensued.  Many ispell
+ users innocently "upgraded" to 4.0 and then screamed when they could
+ not find features to which they had grown accustomed.  Europeans in
+ general were angered by the apparent provincialism shown by the
+ "dropping" of international support.  I found myself inundated with
+ questions about a version I had never heard of or seen.
+ 
+ One of the earliest and most common suggestions was that FSF should
+ rename their version "gispell".  This had a lot of precedent, both in
+ the naming of other FSF utilities and in the then-recent change of the
+ suffix used by gzip from ".z" to ".gz".  Unfortunately, the FSF
+ refused to do this.  I may have inadvertently contributed to this
+ refusal with a Usenet posting in which I tried to clarify what had
+ happened, pointing out that the FSF version was more recently related
+ to Pace's than my own.  This may have been seen as an acknowledgment
+ that FSF should have the rights to the name "ispell," and that I
+ should rename my version.
+ 
+ A flame war arose, and I decided that the only way to solve the
+ problem was to rename my version to eliminate the confusion.  However,
+ at about the same time Richard Stallman and I began negotiating via
+ e-mail.  We itemized and clarified his objections to my license, and I
+ learned from a third party that FSF is willing to distribute software
+ that falls under the University of California license (also known as
+ the Berkeley license).  Richard and I agreed that if I changed my
+ license to be a paraphrase of the UC license, FSF would be willing to
+ distribute my version with no changes.  Since then, ispell 4.0 has
+ been dropped by FSF and has pretty well disappeared from the net,
+ leaving 3.1 as the version of choice for nearly everyone.
+ 
+ OTHER CONTRIBUTORS
+ 
+ Many other enhancements and bug fixes were provided by the numerous
+ people listed below.  Do not assume, because I omit mention of their
+ specific contributions, that these persons were any less instrumental
+ in creating the version of ispell that you see before you.  Every one
+ of them made a significant contribution, and it is only a lack of
+ space that prevents me from detailing these contributions.  This
+ version of ispell is truly a cooperative effort, and it would not
+ exist without the help of the generous souls listed above and below.
+ 
+ A full list of contributors, including those mentioned above, follows.  (I
+ think I have listed everyone, but if you contributed and aren't listed,
+ let me know and I'll correct it):
+ 
+ 	Ivar Aavatsmark
+ 	Per Abrahamsen
+ 	Robert Abramovitz
+ 	Bill Ackerman
+ 	Michael Adler
+ 	Rohit Aggarwal
+ 	Jose Joao Almeida
+ 	Jerry Anders
+ 	Boris Aronov
+ 	Yves Arrouye
+ 	Jamshid Afshar
+ 	Michael C. B. Ashley
+ 	Bertil Askelid
+ 	Eric Backus
+ 	Isaac Balbin
+ 	Neal Becker
+ 	Tony Bennett
+ 	R. Bernstein
+ 	Jim Berry
+ 	Peter A. Bigot
+ 	E. Jay Berkenbilt
+ 	Benno Blumenthal
+ 	Uwe Bonnes
+ 	Marc Boucher
+ 	Martin Boyer
+ 	Ethan Bradford
+ 	David Brooks
+ 	Nicolas Brouard
+ 	Peter Bruells
+ 	Ferd Brundick
+ 	Jack Bryans
+ 	Walt Buehring
+ 	Richard Caley
+ 	John D. Campbell
+ 	Keith Cantrell
+ 	John Capo
+ 	Bill Carpenter
+ 	Jesus Carretero
+ 	Michael W. Chang
+ 	Steven Chaplin
+ 	Wei-Jou Chen
+ 	Peter Chubb
+ 	Stewart Clamen
+ 	Henri Cohen
+ 	Ken Cox
+ 	Robert Crowe
+ 	Damian Cugley
+ 	Ian Dall
+ 	Kevin Dalley
+ 	David Dalton
+ 	Neal Dalton
+ 	Hugh Daniel
+ 	Mark Davies
+ 	Frederic Devernay
+ 	Bob Devine
+ 	Paul Dickson
+ 	Casper H.S. Dik
+ 	Detlev Droege
+ 	Steve Dum
+ 	Alexander Durner
+ 	Jiri Dvorak
+ 	Les Earnest
+ 	John Eaton
+ 	David Edelsohn
+ 	Jeff Edmonds
+ 	Eric Eide
+ 	Orjan Ekeberg
+ 	Kevin Ellwood
+ 	Michael Ernst
+ 	L. Van Eycken
+ 	Rik Faith
+ 	Ralf Fassel
+ 	George Ferguson
+ 	Jeff Finger
+ 	Werner Fink
+ 	John Fitch
+ 	Peter Flatau
+ 	Jeffrey Friedl
+ 	Georg Gieseke
+ 	Ralph. E. Gorin
+ 	Amos A. Gouaux
+ 	Andy Gruss
+ 	Michael Gschwind
+ 	Ron Guilmette
+ 	Bhusan Gupta
+ 	Michael A. Guravage
+ 	Chris Hadley
+ 	Mark Hanning-Lee
+ 	John Heidemann
+ 	Arne Helme
+ 	Ole Bjoern Hessen
+ 	Karl Heuer
+ 	Juergen A. Holm
+ 	Denis Howe
+ 	Joe Huber
+ 	Brian Hunt
+ 	imt3b2!imtsft (true name unknown)
+ 	Lester Ingber
+ 	Nick Ing-Simmons
+ 	Richard L. Jackson, Jr.
+ 	Michal Jaegermann
+ 	John Jendro
+ 	Bob Jewett
+ 	Trevor Jim
+ 	Gary Johnson
+ 	Gjalt de Jong
+ 	Don Kark
+ 	Dan Karron
+ 	Brendan Kehoe
+ 	Steve Kelem
+ 	Vivek Khera
+ 	Axel Kielhorn
+ 	Masahiro Kitagawa
+ 	Peter Knaggs
+ 	Don Knuth
+ 	Jim Knutson
+ 	Heinz Knutzen
+ 	Fred Korz
+ 	Sebastian Kremer
+ 	Geoff Kuenning
+ 	Ralf Lammers
+ 	Markus Lautenbacher
+ 	Jack Lawler
+ 	Cherie N. Lawrence
+ 	Charles Levert
+ 	Doug Lind
+ 	Torbjoern Lindgren
+ 	Michael N. Lipp
+ 	Ernst Lippe
+ 	Richard Lloyd
+ 	John Lu
+ 	Dean Luick
+ 	Erik Luijten
+ 	Ian MacPhedran
+ 	Martin Maechler
+ 	Ross Maloney
+ 	Albrecht Melan
+ 	Lee Melvin
+ 	Evan Marcus
+ 	Simon Marshall
+ 	Dave Mason
+ 	W. E. Matson
+ 	Meinhard E. Mayer
+ 	Rob McMahon
+ 	Bob McQueer
+ 	Dean Messing
+ 	Chris Metcalf
+ 	Jim Meyering
+ 	Hal Miller
+ 	N.O. Monaghan
+ 	Chris Moore
+ 	Bernd Mueller
+ 	Ulrich Mueller
+ 	Guido Muesch
+ 	John Murdie
+ 	Peter Mutsaers
+ 	Erik Toubro Nielsen
+ 	Gaute Nessan
+ 	Keith Neufeld
+ 	Paul Nevai
+ 	David Neves
+ 	Mike Ogush
+ 	Thorstein Ohl
+ 	Piet van Oostrum
+ 	Joe Orost
+ 	Pham Dinh-Tuan
+ 	Gildas Perrot
+ 	Francois Pinard
+ 	Israel Pinkas
+ 	Paul Placeway
+ 	Mick Pont
+ 	Jim Prescott
+ 	Philippe-Andre Prindeville
+ 	Gary Puckering
+ 	Philippe Queinnec
+ 	Ashwin Ram
+ 	Bill Randle
+ 	Christopher Rath
+ 	Joachim Reinert
+ 	Rob Riepel
+ 	Marc Ries
+ 	Loren J. Rittle
+ 	Germic Robert
+ 	Philippe Robert
+ 	Doug Roberts
+ 	Kevin Rodgers
+ 	Santiago Rodriguez
+ 	Hagen Ross
+ 	Jonathan Ross
+ 	Arie Rudich
+ 	Jonathan Ryshpan
+ 	Bruno Salvy
+ 	Rich Salz
+ 	Julio Sanchez
+ 	Paul A. Sand
+ 	Ken Scales
+ 	Bart Schaefer
+ 	Greg Schaffer
+ 	Harald Schlangmann
+ 	Joachim Schrod
+ 	Vernon Schryver
+ 	Martin Schulz
+ 	Gregory Neil Shapiro
+ 	Guy Shaw
+ 	David Shepherd
+ 	Tom Shott
+ 	Joel Shprentz
+ 	Duncan Sinclair
+ 	Vivek P. Singhal
+ 	Klaus Singvogel
+ 	George M. Sipe
+ 	David M. Smith
+ 	Perry Smith
+ 	Luis Soltero
+ 	David Spuler
+ 	Richard Stallman
+ 	Kevin B. Stanton
+ 	Kjartan Stefansson
+ 	Ken Stevens
+ 	Andreas Stolcke
+ 	Thos Sumner
+ 	Bob Sutterfield
+ 	Stefan Taxhet
+ 	Gruppe Thi
+ 	Julian Thompson
+ 	Thomas Tornblom
+ 	Michael Toy
+ 	Bill Triggs
+ 	Goeran (G\366ran) Uddeborg
+ 	Marc Ullman
+ 	Koaunghi Un
+ 	Arjan de Vet
+ 	Andrew Vignaux
+ 	Christoph Vogelsang
+ 	Jochen Voss
+ 	David Waitzman
+ 	Peter Watkins
+ 	Gray Watson
+ 	Patrick Weemeeuw
+ 	Edward Welbourne
+ 	Petri Wessman
+ 	Michael Wester
+ 	Peter Whaite
+ 	Jon L. White
+ 	Johan Widen
+ 	Fredrik Wilhelmsen
+ 	Moritz Willers
+ 	Pace Willisson
+ 	Joerg Winckler
+ 	Bill Wohler
+ 	Michael J. Wolski
+ 	James Woods
+ 	Frank Wuebbeling
+ 	Avishai Yacobi
+ 	Ken Yap
+ 	Benny Yih
+ 	Peter Young
+ 	Jamie Zawinski
+ 	Christos S. Zoulas


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/LICENSE
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/LICENSE:1.1
*** /dev/null	Tue Jan  9 17:57:51 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/LICENSE	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,2 ----
+ It's free.  See the README and Contributors files for any additional
+ information.


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Makefile
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Makefile:1.1
*** /dev/null	Tue Jan  9 17:57:51 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/Makefile	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,8 ----
+ LEVEL = ../../../..
+ 
+ PROG     = office-ispell
+ CPPFLAGS = -Dconst=
+ LDFLAGS  = -lm
+ RUN_OPTIONS = -a -d americanmed+ < large.txt
+ 
+ include $(LEVEL)/MultiSource/Makefile.multisrc


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/README
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/README:1.1
*** /dev/null	Tue Jan  9 17:57:51 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/README	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,394 ----
+     This is ispell version 3.1, an interactive spelling checker.
+ 
+ Contents of this README file:
+ 
+     What Is Ispell and Why Do I Want It?
+     What's New in This Version?
+     Where Can I Get Ispell?
+     OK, How Do I Install It?
+     Who Wrote Ispell?
+     Where Do I Send Bug Reports?
+     How Do I Reference Ispell in Scholarly Papers?
+     Where Do I Get Dictionaries?
+     How Long Does It Take to Make Dictionaries?
+     Special Installation Notes for Certain Machines:
+     What About Ispell for MS-DOS?
+ 
+ ------------------------------------------------------------------------
+ 
+ What Is Ispell and Why Do I Want It?
+ 
+     Ispell is a fast screen-oriented spelling checker that shows you
+     your errors in the context of the original file, and suggests possible
+     corrections when it can figure them out.  Compared to UNIX spell, it
+     is faster and much easier to use.  Ispell can also handle languages
+     other than English.
+     
+ What's New in This Version?
+ 
+     Compared to ispell versions 2 and 4.0 (the latter was the
+     short-lived Gnu version), ispell 3.1 contains many new features,
+     notably TeX support, international language support, and handling
+     of prefixes as well as suffixes.  Compared to ispell version 3.0,
+     ispell 3.1 has many bug fixes, a number of minor improvements, and
+     vastly improved support for multiple languages.
+ 
+     The only truly important difference between 3.0 and 3.1 is in the
+     format of the "defstringtype" and "altstringtype" statements,
+     which now require a deformatter argument.  Existing affix files
+     will have to be converted.  See ispell.4 for documentation, or
+     deutsch.aff for an extended example.  The conversion is very easy
+     to do.  All affix files distributed with ispell have already been
+     converted.
+ 
+     The complete list of bug fixes and improvements is too long to
+     include here (and besides, I'm too overworked to create it).
+     However, users of ispell 2.0 and ispell 4.0 should note that the
+     "x" and "q" commands have been interchanged.
+ 
+ Where Can I Get Ispell?
+ 
+     If you have a Web browser, visit the ispell home page:
+ 
+ 	http://www.cs.ucla.edu/ficus-members/geoff/ispell.html
+ 
+     The current version of ispell is available for anonymous ftp from
+     ftp.cs.ucla.edu (131.179.240.10) or ftp.math.orst.edu
+     (128.193.80.161), in the pub/ispell-3.1 directory.  The latest
+     version is always named "ispell-3.1.xx.tar.gz", where "xx" is
+     the patch level.  There are also sometimes files named
+     "README-patchxx" which contain notes specific to a given version.
+     Announcements of patches to ispell will be posted to comp.text.tex,
+     gnu.announce, and gnu.emacs.help.
+ 
+     A number of ftp mirror sites also store ispell.  Check Archie for
+     "ispell-3.1" to find a site near you.
+     
+     Ispell comes with English dictionaries.  For other languages,
+     check the "Where" and "README" files in the "languages"
+     subdirectory for hints on where to find dictionaries and how to
+     install them.
+ 
+ OK, How Do I Install It?
+ 
+ ## For Mibench install, just type "make ispell" and use the ispell program
+ ## that is compiled for the benchmarking.
+ 
+     Ispell is quite portable (thanks to many people).  If you speak
+     American English and have a BSD-like system, you may be able to
+     get away with simply typing "make all" to finish unpacking
+     the kit and make ispell and a dictionary, all configured to be
+     installed in /usr/local/*.  If you have a USG (System V) system,
+     you will at least have to copy "local.h.samp" to "local.h", then
+     add "#define USG" to local.h before compiling.  Be sure you have
+     at least 10 MB of free space in /tmp, or set your TMPDIR
+     environment variable to point somewhere with that much space.
+ 
+     For more complex installations, you will have to create a fancier
+     local.h file.  All customization of ispell 3.1, even for the
+     Makefile, is done by creating or editing the file "local.h" to
+     override the default definitions of certain variables.  The most
+     common changes will be to the LANGUAGES variable (to set the
+     languages; see also the Makefiles in the various language
+     subdirectories), CC (to choose gcc), and BINDIR through MAN4DIR
+     (to control where ispell is installed).  There are many other
+     configuration parameters; see config.X for the complete list and
+     further instructions.  *DO NOT* make changes to config.X or to any
+     of the Makefiles.  Anything you define in "local.h" will override
+     definitions in those files.
+ 
+     The English-language dictionary comes in four sizes: small,
+     medium, large, and extra-large.  I recommend using the medium
+     dictionary unless you are very short on space.  The small and
+     medium dictionaries have been hand-checked against a paper
+     dictionary to improve their accuracy.  This is not true of the two
+     larger ones.  The large and extra-large dictionaries contain
+     less-frequently-used words, and most sites will not want to pay
+     the price of storing them, especially because they may contain
+     errors.  Also, a large dictionary can hide misspellings of short
+     words because there is some similar word that nobody uses.  (For
+     example, the crossword-puzzle favorite "ort" can hide misspellings
+     of "or".)
+ 
+     For each dictionary size, you can also choose to make a "plus"
+     version, named by adding a plus sign to the size indication.
+     These versions are created by incorporating a dictionary file of
+     your own, usually /usr/dict/words.  (I can't distribute a
+     dictionary based on that file because it's copyrighted.)  Making a
+     plus version requires extra time and disk space, but will give you
+     some computer and technical terms that aren't in the basic ispell
+     word list.  That's why the default dictionary is
+     "americanmed+.hash".
+ 
+     After all edits, you are ready to compile ispell.  Make sure you
+     have set your TMPDIR environment variable, and then type
+     "make all".  This will compile all the programs, put the
+     dictionaries together, and build the hash file.  If you get errors
+     while compiling term.c, change the setting of "#define USG" in
+     your local.h file and try again.
+ 
+     If you chose a "+" version of the dictionary (the LANGUAGES macro
+     in config.X), expect this first make to run for quite a while
+     (usually about half an hour, but as much as 24 hours on a very
+     limited machine) because of the munchlist step.  If you chose a
+     non-plus version, the make will not take long.  The munchlist step
+     will also take a *lot* of disk space (see the table below for more
+     information), so be sure to set TMPDIR in your environment to
+     point to someplace with lots of room.
+ 
+     After your first make completes, you are ready to install ispell.
+     The standard "make install" will install ispell, the auxiliary
+     programs and scripts, the manual page, and the dictionary hash
+     file, all in the directories you have chosen for them.  This
+     usually has to be done as root, and on some systems you will not
+     be able to redirect the output to a file.  (If you're the careful
+     sort, you'll check the output of "make -n install" first to be
+     sure there are no hidden surprises.)  If you don't want to install
+     the dictionary-building tools, you can type "make partial-install"
+     to install just the files needed to use ispell itself.
+ 
+     If you have emacs, note that the installation process does not
+     modify the top-level Info menu to include ispell; you must do this
+     by hand if you want ispell to appear in the top-level menu.  The
+     installation process may clobber emacs-related files from ispell
+     4.0.  If you don't consider this a feature, you should preserve
+     them first.  Also, if you have emacs you can ignore the warnings
+     issued when ispell.el is byte-compiled.  Finally, ispell.el
+     contains some platform-dependent stuff, such as path names and
+     egrep switches.  This is a bug that will be cleaned up someday.
+ 
+     As well as the standard "make clean" and "make realclean" targets,
+     there is also a "make dictclean" target which will get rid of
+     constructed dictionary files such as "english.med+".  This is a
+     separate target because of the time it takes to build
+     dictionaries.
+ 
+     Finally, there is a directory named "addons", which contains shar
+     kits for ispell helper programs that were generously written by
+     other people.  These are not copyrighted or supported by the
+     ispell maintainer.  Contact the original authors (listed in README
+     files in the kits) for more information.
+ 
+ Who Wrote Ispell?
+ 
+     Ispell is a very old program.  The original was written in PDP-10
+     assembly in 1971, by R. E. Gorin.  The C version was written by
+     Pace Willisson of MIT.  Walt Buehring of Texas Instruments added
+     the emacs interface and posted it to the net.  Geoff Kuenning
+     added the international support and created the current release.
+     Many, many other people contributed to the current version; a
+     complete list (with a much more detailed history) can be found in
+     the file "Contributors".
+ 
+ Where Do I Send Bug Reports?
+ 
+     Most ispell bug reports, except bugs related to the emacs-lisp
+     interface, should be sent to "ispell-bugs at itcorp.com".  Bugs in
+     the emacs interface (ispell.el) should be sent to
+     "ispell-el-bugs at itcorp.com".  If you're not sure which address to
+     use, send your report to "ispell-bugs at itcorp.com" and I'll sort it
+     out from there.
+ 
+     Bugs in add-on packages (found in the "addons" subdirectory)
+     should not be sent to itcorp.com.  Instead, send reports to the
+     developers of those packages (see the README file for the package
+     you are using).
+ 
+ How Do I Reference Ispell in Scholarly Papers?
+ 
+     There is no published paper on ispell, so if you make use of
+     ispell in a fashion that requires a reference (e.g., using the
+     dictionary as a word list in a research project), you are limited
+     to an Internet reference.  The full proper title is printed by
+     "ispell -v": "International Ispell Version x.y.z".  Please include
+     the full version number in your reference so that people can
+     discover the exact variant that you used; sometimes it's
+     important.  If you're feeling really nice, you can also credit me,
+     Geoffrey H. Kuenning, as the author.  Usually, you should also
+     include a mention of the master ftp site, ftp.cs.ucla.edu, so that
+     readers of your paper can locate a copy if they wish.
+ 
+ Where Do I Get Dictionaries?
+ 
+     Ispell comes with American and British dictionaries. American-style
+     spellings are the default.  To get British spellings, copy the
+     LANGUAGES and MASTERHASH definitions from config.X into your
+     local.h, and then globally replace "american" with "british".
+ 
+     For other languages, consult the file "languages/Where", which
+     lists everything I know about.  You can also check the ispell home
+     page:
+ 
+ 	http://www.cs.ucla.edu/ficus-members/geoff/ispell.html
+ 
+     which contains pointers to all known dictionaries.
+ 
+     If you create a dictionary of your own and make it available for
+     ftp, please send a notification to ispell-bugs at itcorp.com so that
+     I can add your dictionary to the ftp list.
+ 
+ How Long Does It Take to Make Dictionaries?
+ 
+     The following tables give approximate timings and peak disk usage
+     for making each of the three augmented English dictionaries (the
+     so-called "plus" versions).  The timings were collected on an
+     unloaded 68040.  Your mileage may vary.
+ 
+     Using EXTRADICT=/usr/dict/words:
+ 
+ 			Time to build	Peak temp space	Final size
+ 
+ 	english.sml+	30 minutes	7.1M		306K
+ 	english.med+	35 minutes	8.8M		359K
+ 	english.lrg+	60 minutes	10.7M		680K
+ 
+     Using EXTRADICT=/usr/dict/words and /usr/dict/web2:
+ 
+ 			Time to build	Peak temp space	Final size
+ 
+ 	english.sml+	2-1/2 hours	19.5M		2243K
+ 	english.med+	2-1/2 hours	19.6M		2265K
+ 	english.lrg+	3 hours		20.7M		2347K
+ 
+     The peak disk usage occurs fairly early in the munching process.
+     When creating english.lrg+ with /usr/dict/web2, the peak was
+     reached within 30 minutes.  When web2 was omitted, the peak was
+     always reached within 1/4 of the total running time of munchlist.
+     Again, remember that these times will vary depending on your load
+     and your machine's power.
+ 
+ Special Installation Notes for Certain Machines:
+ 
+     Although I have tried to avoid putting in specific machine
+     dependencies as a general rule, some machine-specific #defines
+     will be found at the end of config.X.
+ 
+     If you get lots of warnings when compiling term.c, check to be
+     sure that you have correctly defined SIGNAL_TYPE in your local.h.
+ 
+     Some versions of ISC Unix have TIOCGWINSZ defined even though it's
+     not supported and the necessary structures are not present.  The
+     solution is to add "#undef TIOCGWINSZ" in your local.h.
+ 
+     Under ISC (Solaris) Unix System V.3, you may have to add includes
+     of <sys/stream.h> and <sys/ptem.h> to your local.h to get around
+     compilation problems in term.c.
+ 
+     Some versions of SCO Unix define "struct winsize" conditionally.
+     The solution is to add "#define _IBCS2" in your local.h.
+ 
+     Some versions of SCO Unix define "struct winsize" in a weird
+     place.  Add #includes of <sys/stream.h> and <sys/ptem.h> to your
+     local.h to get around this.
+ 
+     Suns running 4.1.1 also have a bug in sort which causes core dumps
+     when running munchlist.  Sun users who have the System 5 option
+     can work around this bug by making sure that /usr/5bin precedes
+     /usr/bin in their path, so that /usr/5bin/sort is used by
+     munchlist.
+ 
+     It is reported that some older versions of gnu sort do not
+     recognize the -T option.  (However, as of textutils 1.9 it does.)
+     Define SORTTMP and MAKE_SORTTMP as the null string ("") if you use
+     gnu sort, or change your path to use the manufacturer's sort
+     command (but watch out for Sun's sort bug, above!).
+ 
+     Some versions of gcc for the Sparc have an optimizer bug that
+     causes problems for languages that use 8-bit characters.  The
+     solution is to turn off optimization when compiling at least
+     makedent.c, or for all of ispell.  The bug is known to exist in
+     gcc 2.4.5, and is known to have been fixed in gcc 2.5.8.
+ 
+     There is a report that on Solaris 2.3 for the sparc, buildhash may
+     core dump.  The cure is to use "bison -y" instead of yacc.
+ 
+     On SunOS 4.1.3 using Sun's SPARCompiler C2.0.1, you may have to
+     select static linking (-Bstatic option in CFLAGS).
+ 
+     The AIX RS6000 should use -lcurses for TERMLIB, rather than -ltermcap.
+ 
+     Amiga users will need to #define fork vfork.  Other than this,
+     ispell should compile using gcc on the Amiga.
+ 
+     There have been reports that some BSD releases don't properly
+     declare "extern int errno" in errno.h.  If you suffer from this
+     problem, you'll have to add your own declaration in your local.h.
+ 
+     There are known problems on Ultrix with the interaction between
+     ispell and some versions of elm on Ultrix.  You may be able to fix
+     this by making sure USG is undefined, or you may have to make more
+     extensive changes to term.c to cause it to use the "termios"
+     interface instead of the "termio" one.
+ 
+     The DEC Alpha and Cray have 64-bit longs.  Make sure you define
+     MASKTYPE_WIDTH as 64 for these machines.
+ 
+     Some versions of the DEC Alpha compiler may compile ispell
+     incorrectly.  The cure is to turn optimization off and compile
+     with the -g switch.  The symptoms are segmentation faults and
+     garbage characters in the ~/.ispell_english file.  If you get this
+     symptom, be sure to clean out the garbage before you rerun ispell
+     or recompiling won't help.
+ 
+     Some versions of "uniq" on the DEC Alpha, OSF/1 2.x, generate
+     garbage output if given null input, causing munchlist to loop
+     forever.  This can by checked by running "uniq < /dev/null | wc
+     -c", which ought print zero.  If it does not, you'll have to use
+     GNU uniq (from textutils/1.11) instead, or upgrade to OSF/1 3.0
+     which does not have the bug.
+ 
+     DEC OSF/1 keeps the extra dictionary in a wierd place.  Set
+     EXTRADICT to /usr/share/dict/words.
+ 
+     HP systems will need C compiler patch PHSS_3015 to compile ispell
+     correctly, bringing the revision to A.09.34 or higher.  The
+     symptom of the wrong compiler is incorrect highlighting of
+     misspelled words.  Gcc will also compile ispell correctly on HP
+     systems.
+     
+     I have a report that on HP systems 300-400, you must use either
+     gcc or the non-ansi CCFLAG ("cc +o2"), at least for the ispell.c
+     source.  However, it is possible that this problem has been
+     corrected by a bug fix to term.c.  I'd be interested in hearing
+     whether the report is still true.
+ 
+     Some "internationalized" Unixes (HP, for instance) vary the
+     behavior of sort(1) based on an environment variable such as LANG
+     or LOCALE.  The symptom is that munchlist does not produce an
+     optimal dictionary.  Munchlist tries to protect against this by
+     setting LANG and LOCALE to "C", but if your system uses different
+     environment variables, you may have to do this by hand.
+ 
+     If you get core dumps from the sort command (reported on HP
+     systems building large German dictionaries), try adding the "-y"
+     flag to the appropriate invocation of sort in the Makefile or in
+     munchlist.  This flag is only available on some systems.
+ 
+     SGI Irix systems store /usr/dict/words in /usr/lib/dict or
+     /usr/share/lib/dict.  You may have to install the normal "spell"
+     and associated files from cd-rom before it will exist.  If you get
+     errors compiling with Irix 4.0.5 or others, try defining __STDC__
+     in local.h, to get around problems caused by the fact that the
+     compiler accepts prototypes but doesn't define __STDC__.
+ 
+     Some BSDI systems have a screwy sort command that uses
+     -T to specify the record (as opposed to field) delimiter.  You'll
+     have to disable SORTTMP and enable MAKE_SORTTMP.  You'll also have
+     to be sure that /usr/tmp has lots and lots of free space.
+ 
+ What About Ispell for MS-DOS?
+ 
+     Although ispell is not officially supported on MS-DOS, there are a
+     couple of #defines that you might find useful if you want to do
+     such a thing.  Check the end of config.X.  Several people have
+     reported success building DOS versions using emx/gcc.  Others have
+     used the djgpp package, with bison replacing yacc.  Some places to
+     look for a DOS ispell if you have an x86:
+ 
+ 	ftp.cdrom.com:pub/os2/unix/isp3009b.zip.
+ 	or
+ 	ftp-os2.cdrom.com:pub/os2/2_x/unix/
+ 
+     There is also a program named jspell, which is an ispell
+     lookalike.  Look on ftp.tex.ac.uk, in the directory
+     pub/archive/support/jspell.


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/americanmed+.hash


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/config.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,885 ----
+ /*
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * This is the configuration file for ispell.  Thanks to Bob McQueer
+  * for creating it and making the necessary changes elsewhere to
+  * support it, and to George Sipe for figuring out how to make it easier
+  * to use.
+  *
+  * WARNING:  The Makefile edits this file (config.X) to produce config.h.
+  * If you are looking at config.h, you're in the wrong file.
+  *
+  * Look through this file from top to bottom.  If anything needs changing,
+  * create the header file "local.h" and define the correct values there;
+  * they will override this file.  If you don't make any changes to this
+  * file, future patching will be easier.
+  */
+ 
+ /*
+  * $Id: config.h,v 1.1 2007/01/09 23:57:18 lattner Exp $
+  *
+  * $Log: config.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:48  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.71  1995/01/08  23:23:28  geoff
+  * Add some more configuration variables: HAS_RENAME, MSDOS_BINARY_OPEN,
+  * HOME, PDICTHOME, HASHSUFFIX, STATSUFFIX, and COUNTSUFFIX.  These are
+  * all to make it easier to port ispell to MS-DOS.  Change DEFPAFF back
+  * to "words" so that only .ispell_words will be independent of language.
+  *
+  * Revision 1.70  1994/10/25  05:45:57  geoff
+  * Fix a tiny typo in a comment.  Add a configurable install command.
+  *
+  * Revision 1.69  1994/09/01  06:06:30  geoff
+  * Improve the the documentation of LANGUAGES to include working examples.
+  *
+  * Revision 1.68  1994/07/28  05:11:34  geoff
+  * Log message for previous revision: force MASKBITS to greater than or
+  * equal to MASKTYPE_WIDTH (simplifies configuration for 64-bit
+  * machines).
+  *
+  * Revision 1.67  1994/07/28  04:53:34  geoff
+  *
+  * Revision 1.66  1994/04/27  02:50:46  geoff
+  * Change the documentation and defaults for the languages variable to
+  * reflect the new method of making American and British dictionary
+  * variants.
+  *
+  * Revision 1.65  1994/04/27  01:50:28  geoff
+  * Add MAX_CAPS.
+  *
+  * Revision 1.64  1994/02/07  08:10:42  geoff
+  * Add GENERATE_LIBRARY_PROTOS as a special variable for use only by me.
+  *
+  * Revision 1.63  1994/01/26  07:44:45  geoff
+  * Make yacc configurable through local.h.
+  *
+  * Revision 1.62  1994/01/25  07:11:20  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ /* You may wish to specify your local definitions in this file: */
+ 
+ #include "local.h"	/* local definitions for options */
+ 
+ /*
+ ** Major-differences selection.  The default system is BSD;  for USG
+ ** or non-UNIX systems you should add the appropriate #define to local.h.
+ */
+ #ifndef USG
+ #undef USG		/* Define this in local.h for System V machines */
+ #endif /* USG */
+ 
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #ifndef USG
+ #include <sys/dir.h>
+ #endif /* USG */
+ 
+ /*
+ ** Things that normally go in a Makefile.  Define these just like you
+ ** might in the Makefile, except you should use #define instead of
+ ** make's assignment syntax.  Everything must be double-quoted, and
+ ** (unlike make) you can't use any sort of $-syntax to pick up the
+ ** values of other definitions.
+ */
+ #ifndef CC
+ #define CC	"cc"
+ #endif /* CC */
+ #ifndef EMACS
+ #define EMACS	"emacs"
+ #endif /* EMACS */
+ #ifndef LINT
+ #define LINT	"lint"
+ #endif /* LINT */
+ #ifndef CFLAGS
+ #define CFLAGS	"-O"
+ #endif /* CFLAGS */
+ #ifndef LINTFLAGS
+ #define LINTFLAGS ""
+ #endif /* LINTFLAGS */
+ #ifndef YACC
+ #define YACC	"yacc"
+ #endif /* YACC */
+ 
+ /*
+ ** Libraries that may need to be added to the cc line to get ispell to
+ ** link.  Normally, this should be null.
+ */
+ #ifndef LIBES
+ #define LIBES	""
+ #endif
+ 
+ /*
+ ** TERMLIB - where to get the termcap library.  Should be -ltermcap or
+ ** -lcurses on most systems.
+ */
+ #ifndef TERMLIB
+ #define TERMLIB ""
+ #endif
+ 
+ /*
+ ** REGLIB - where to get the regular-expression routines, if
+ ** REGEX_LOOKUP is defined.  Should be -lPW on USG systems, null on
+ ** BSD systems.
+ */
+ #ifndef REGLIB
+ #define REGLIB	""
+ #endif
+ 
+ /*
+ ** Where to install various components of ispell.  BINDIR contains
+ ** binaries.  LIBDIR contains hash tables and affix files.  ELISPDIR
+ ** contains emacs lisp files (if any) and TEXINFODIR contains emacs
+ ** TeXinfo files.  MAN1DIR and MAN4DIR will hold the chapter-1 and
+ ** chapter-4 manual pages, respectively.
+ **
+ ** If you intend to use multiple dictionary files, I would suggest
+ ** LIBDIR be a directory which will contain nothing else, so sensible
+ ** names can be constructed for the -d option without conflict.
+ */
+ #ifndef BINDIR
+ #define BINDIR	"/usr/local/bin"
+ #endif
+ #ifndef LIBDIR
+ #define LIBDIR	""
+ #endif
+ #ifndef ELISPDIR
+ #define ELISPDIR "/usr/local/lib/emacs/site-lisp"
+ #endif
+ #ifndef TEXINFODIR
+ #define TEXINFODIR "/usr/local/info"
+ #endif
+ #ifndef MAN1DIR
+ #define MAN1DIR	"/usr/local/man/man1"
+ #endif
+ #ifndef MAN4DIR
+ #define MAN4DIR	"/usr/local/man/man4"
+ #endif
+ 
+ /*
+ ** Extensions to put on manual pages.  Usually these are ".1" or ".1l".
+ */
+ #ifndef MAN1EXT
+ #define MAN1EXT	".1"
+ #endif
+ #ifndef MAN4EXT
+ #define MAN4EXT	".4"
+ #endif
+ 
+ /*
+ ** List of all hash files (languages) which will be supported by ispell.
+ **
+ ** This variable has a complex format so that many options can be
+ ** specified.  The format is as follows:
+ **
+ **	<language>[,<make-options>...] [<language> [,<make-options> ...] ...]
+ **
+ ** where
+ **
+ **	language	is the name of a subdirectory of the
+ **			"languages" directory
+ **	make-options	are options that are to be passed to "make" in
+ **			the specified directory.  The make-options
+ **			should not, in general, specify a target, as
+ **			this will be provided by the make process.
+ **
+ ** For example, if LANGUAGES is:
+ **
+ **	"{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=/usr/dict/words /usr/dict/web2} {deutsch,DICTALWAYS=deutsch.sml,DICTOPTIONS=}"
+ **
+ ** then the American-English and Deutsch (German) languages will be supported,
+ ** and the following variable settings will be passed to the two Makefiles:
+ **
+ **	American:
+ **
+ **	    MASTERDICTS='american.med+'
+ **	    HASHFILES='americanmed+.hash'
+ **	    EXTRADICT='/usr/dict/words /usr/dict/web2'
+ **
+ **	Deutsch:
+ **
+ **	    DICTALWAYS='deutsch.sml'
+ **	    DICTOPTIONS=''
+ **
+ ** Notes on the syntax: The makefile is not very robust.  If you have
+ ** make problems, or if make seems to fail in the language-subdirs
+ ** dependency, check your syntax.  The makefile adds single quotes to
+ ** the individual variables in the LANGUAGES specification, so don't
+ ** use quotes of any kind.
+ **
+ ** In the future, the first language listed in this variable will
+ ** become the default, and the DEFHASH, DEFLANG, and DEFPAFF,
+ ** variables will all become obsolete.  So be sure to put your default
+ ** language first, to make later conversion easier!
+ **
+ ** Notes on options for the various languages will be found in the
+ ** Makefiles for those languages.  Some of those languages may require
+ ** you to also change various limits limits like MASKBITS or the
+ ** length parameters.
+ **
+ ** A special note on the English language: because the British and
+ ** American dialects use different spelling, you should usually select
+ ** one or the other of these.  If you select both, the setting of
+ ** MASTERHASH will determine which becomes the language linked to
+ ** DEFHASH (which will usually be named english.hash).
+ */
+ #ifndef LANGUAGES
+ #define LANGUAGES "{american,MASTERDICTS=american.med+,HASHFILES=americanmed+.hash,EXTRADICT=words}"
+ #endif /* LANGUAGES */
+ 
+ /*
+ ** Master hash file for DEFHASH.  This is the name of a hash file
+ ** built by a language Makefile.  It should be the most-popular hash
+ ** file on your system, because it is the one that will be used by
+ ** default.  It must be listed in LANGUAGES, above.
+ */
+ #ifndef MASTERHASH
+ #define MASTERHASH	"americanmed+.hash"
+ #endif
+ 
+ /*
+ ** Default native-language hash file.  This is the name given to the
+ ** hash table that will be used if no language is specified to
+ ** ispell.  It is a link to MASTERHASH, above.
+ */
+ #ifndef DEFHASH
+ #define DEFHASH "english.hash"
+ #endif
+ 
+ /*
+ ** Language tables for the default language.  This must be the name of
+ ** the affix file that was used to generate the MASTERHASH/DEFHASH,
+ ** above.
+ */
+ #ifndef DEFLANG
+ #define DEFLANG	"english.aff"
+ #endif
+ 
+ /*
+ ** Language to use for error messages.  If there are no messages in this
+ ** language, English will be used instead.
+ */
+ #ifndef MSGLANG
+ #define MSGLANG	"english"
+ #endif /* MSGLANG */
+ 
+ /*
+ ** If your sort command accepts the -T switch to set temp file
+ ** locations (try it out; it exists but is undocumented on some
+ ** systems), make the following variable the null string.  Otherwise
+ ** leave it as the sed script.
+ */
+ #ifndef SORTTMP
+ #define SORTTMP	"-e '/!!SORTTMP!!/s/=.*$/=/'"
+ #endif
+ 
+ /*
+ ** If your sort command accepts the -T switch (see above), make the
+ ** following variable refer to a temporary directory with lots of
+ ** space.  Otherwise make it the null string.
+ */
+ #ifndef MAKE_SORTTMP
+ #define MAKE_SORTTMP "-T ${TMPDIR-/tmp}"
+ #endif
+ 
+ /*
+ ** INSTALL program. Could be a copy program like cp or something fancier
+ ** like /usr/ucb/install -c
+ */
+ #ifndef INSTALL
+ #define INSTALL		"cp"
+ #endif
+ 
+ /*
+ ** If your system has the rename(2) system call, define HAS_RENAME and
+ ** ispell will use that call to rename backup files.  Otherwise, it
+ ** will use link/unlink.  There is no harm in this except on MS-DOS,
+ ** which doesn't support link/unlink.
+ */
+ #ifndef HAS_RENAME
+ #undef HAS_RENAME
+ #endif /* HAS_RENAME */
+ 
+ /* Aliases for some routines */
+ #ifdef USG
+ #define bcopy(s, d, n)	(void) memcpy (d, s, n)
+ #define bzero(d, n)	(void) memset (d, 0, n)
+ #define index strchr
+ #define rindex strrchr
+ #endif
+ 
+ /* type given to signal() by signal.h */
+ #ifndef SIGNAL_TYPE
+ #define SIGNAL_TYPE void
+ #endif
+ 
+ /* environment variable for user's word list */
+ #ifndef PDICTVAR
+ #define PDICTVAR "WORDLIST"
+ #endif
+ 
+ /* prefix part of default word list */
+ #ifndef DEFPDICT
+ #define DEFPDICT ".ispell_"
+ #endif
+ 
+ /*
+ ** suffix part of default word list
+ */
+ #ifndef DEFPAFF
+ #define DEFPAFF "words"
+ #endif
+ 
+ /* old place to look for default word list */
+ #ifndef OLDPDICT
+ #define OLDPDICT ".ispell_"
+ #endif /* OLDPDICT */
+ #ifndef OLDPAFF
+ #define OLDPAFF "words"
+ #endif /* OLDPAFF */
+ 
+ /* environment variable for include file string */
+ #ifndef INCSTRVAR
+ #define INCSTRVAR "INCLUDE_STRING"
+ #endif
+ 
+ /* default include string */
+ #ifndef DEFINCSTR
+ #define DEFINCSTR "&Include_File&"
+ #endif
+ 
+ /* mktemp template for temporary file - MUST contain 6 consecutive X's */
+ #ifndef TEMPNAME
+ #define TEMPNAME "/tmp/ispellXXXXXX"
+ #endif
+ 
+ /*
+ ** If REGEX_LOOKUP is undefined, the lookup command (L) will use the look(1)
+ ** command (if available) or the egrep command.  If REGEX_LOOKUP is defined,
+ ** the lookup command will use the internal dictionary and the
+ ** regular-expression library (which you must supply separately.  There is
+ ** a public-domain library available;  libraries are also distributed with
+ ** both BSD and System V.
+ **
+ ** The advantage of no REGEX_LOOKUP is that it is often much faster, especially
+ ** if the look(1) command is available, that the words found are presented
+ ** in alphabetical order, and that the list of words searched is larger.
+ ** The advantage of REGEX_LOOKUP is that ispell doesn't need to spawn another
+ ** program, and the list of words searched is exactly the list of (root) words
+ ** that ispell will accept.  (However, note that words formed with affixes will
+ ** not be found;  this can produce some artifacts.  For example, since
+ ** "brother" can be formed as "broth+er", a lookup command might fail to
+ ** find "brother.")
+ */
+ #ifndef REGEX_LOOKUP
+ #undef REGEX_LOOKUP
+ #endif /* REGEX_LOOKUP */
+ 
+ /*
+ ** Choose the proper type of regular-expression routines here.  BSD
+ ** and public-domain systems have routines called re_comp and re_exec;
+ ** System V uses regcmp and regex.
+ */
+ #ifdef REGEX_LOOKUP
+ #ifndef REGCMP
+ #ifdef USG
+ #define REGCMP(str)		regcmp (str, (char *) 0)
+ #define REGEX(re, str, dummy)	regex (re, str, dummy, dummy, dummy, dummy, \
+ 				    dummy, dummy, dummy, dummy, dummy, dummy)
+ #else /* USG */
+ #define REGCMP(str)		re_comp (str)
+ #define REGEX(re, str, dummy)	re_exec (str)
+ #endif /* USG */
+ #endif /* REGCMP */
+ #endif /* REGEX_LOOKUP */
+ 
+ /* look command (if look(1) MAY BE available - ignored if not) */
+ #ifndef REGEX_LOOKUP
+ #ifndef LOOK
+ #define	LOOK	"look -df"
+ #endif
+ #endif /* REGEX_LOOKUP */
+ 
+ /* path to egrep (use speeded up version if available) */
+ #ifndef EGREPCMD
+ #ifdef	USG
+ #define EGREPCMD "/bin/egrep"
+ #else
+ #define EGREPCMD "/usr/bin/egrep -i"
+ #endif
+ #endif
+ 
+ /* path to wordlist for Lookup command (typically /usr/dict/{words|web2}) */
+ /* note that /usr/dict/web2 is usually a bad idea due to obscure words */
+ #ifndef WORDS
+ #define WORDS	"/usr/dict/words"
+ #endif
+ 
+ /* buffer size to use for file names if not in sys/param.h */
+ #ifndef MAXPATHLEN
+ #define MAXPATHLEN 240
+ #endif
+ 
+ /* max file name length (will truncate to fit BAKEXT) if not in sys/param.h */
+ #ifndef MAXNAMLEN
+ #define MAXNAMLEN 14
+ #endif
+ 
+ /* define if you want .bak file names truncated to MAXNAMLEN characters */
+ #ifndef TRUNCATEBAK
+ #undef TRUNCATEBAK
+ #endif /* TRUNCATEBAK */
+ 
+ /* largest word accepted from a file by any input routine, plus one */
+ #ifndef	INPUTWORDLEN
+ #define INPUTWORDLEN 100
+ #endif
+ 
+ /* largest amount that a word might be extended by adding affixes */
+ #ifndef MAXAFFIXLEN
+ #define MAXAFFIXLEN 20
+ #endif
+ 
+ /*
+ ** Define the following to suppress the 8-bit character feature.
+ ** Unfortunately, this doesn't work as well as it might, because ispell
+ ** only strips the 8th bit in some places.  For example, it calls strcmp()
+ ** quite often without first stripping parity.  However, I really wonder
+ ** about the utility of this option, so I haven't bothered to fix it.  If
+ ** you think the stripping feature of NO8BIT is useful, you might let me
+ ** (Geoff Kuenning) know.
+ **
+ ** Nevertheless, NO8BIT is a useful option for other reasons.  If NO8BIT
+ ** is defined, ispell will probably use 8-bit characters internally;
+ ** this improves time efficiency and saves a small amount of space
+ ** in the hash file.  Thus, I recommend you specify NO8BIT unless you
+ ** actually expect to be spelling files which use a 256-character set.
+ */ 
+ #ifndef NO8BIT
+ #undef NO8BIT
+ #endif /* NO8BIT */
+ 
+ /*
+ ** Number of mask bits (affix flags) supported.  Must be 32, 64, 128, or
+ ** 256.  If MASKBITS is 32 or 64, there are really only 26 or 58 flags
+ ** available, respectively.  If it is 32, the flags are named with the
+ ** 26 English uppercase letters;  lowercase will be converted to uppercase.
+ ** If MASKBITS is 64, the 58 flags are named 'A' through 'z' in ASCII
+ ** order, including the 6 special characters from 'Z' to 'a': "[\]^_`".
+ ** If MASKBITS is 128 or 256, all the 7-bit or 8-bit characters,
+ ** respectively, are theoretically available, though a few (newline, slash,
+ ** null byte) are pretty hard to actually use successfully.
+ **
+ ** Note that a number of non-English affix files depend on having a
+ ** larger value for MASKBITS.  See the affix files for more
+ ** information.
+ */
+ #ifndef MASKBITS
+ #define MASKBITS	32
+ #endif
+ 
+ /*
+ ** C type to use for masks.  This should be a type that the processor
+ ** accesses efficiently.
+ **
+ ** MASKTYPE_WIDTH must correctly reflect the number of bits in a
+ ** MASKTYPE.  Unfortunately, it is also required to be a constant at
+ ** preprocessor time, which means you can't use the sizeof operator to
+ ** define it.
+ **
+ ** Note that MASKTYPE *must* match MASKTYPE_WIDTH or you may get
+ ** division-by-zero errors! 
+ */
+ #ifndef MASKTYPE
+ #define MASKTYPE	long
+ #endif
+ #ifndef MASKTYPE_WIDTH
+ #define MASKTYPE_WIDTH	32
+ #endif
+ #if MASKBITS < MASKTYPE_WIDTH
+ #undef MASKBITS
+ #define MASKBITS	MASKTYPE_WIDTH
+ #endif /* MASKBITS < MASKTYPE_WIDTH */
+ 
+ 
+ /* maximum number of include files supported by xgets;  set to 0 to disable */
+ #ifndef MAXINCLUDEFILES
+ #define MAXINCLUDEFILES	5
+ #endif
+ 
+ /*
+ ** Maximum hash table fullness percentage.  Larger numbers trade space
+ ** for time.
+ **/
+ #ifndef MAXPCT
+ #define MAXPCT	70		/* Expand table when 70% full */
+ #endif
+ 
+ /*
+ ** Maximum number of "string" characters that can be defined in a
+ ** language (affix) file.  Don't forget that an upper/lower string
+ ** character counts as two!
+ */
+ #ifndef MAXSTRINGCHARS
+ #define MAXSTRINGCHARS 100
+ #endif /* MAXSTRINGCHARS */
+ 
+ /*
+ ** Maximum length of a "string" character.  The default is appropriate for
+ ** nroff-style characters starting with a backslash.
+ */
+ #ifndef MAXSTRINGCHARLEN
+ #define MAXSTRINGCHARLEN 10
+ #endif /* MAXSTRINGCHARLEN */
+ 
+ /*
+ ** the NOPARITY mask is applied to user input characters from the terminal
+ ** in order to mask out the parity bit.
+ */
+ #ifdef NO8BIT
+ #define NOPARITY 0x7f
+ #else
+ #define NOPARITY 0xff
+ #endif
+ 
+ 
+ /*
+ ** the terminal mode for ispell, set to CBREAK or RAW
+ **
+ */
+ #ifndef TERM_MODE
+ #define TERM_MODE	CBREAK
+ #endif
+ 
+ /*
+ ** Define this if you want your columns of words to be of equal length.
+ ** This will spread short word lists across the screen instead of down it.
+ */
+ #ifndef EQUAL_COLUMNS
+ #undef EQUAL_COLUMNS
+ #endif /* EQUAL_COLUMNS */
+ 
+ /*
+ ** This is the extension that will be added to backup files
+ */
+ #ifndef	BAKEXT
+ #define	BAKEXT	".bak"
+ #endif
+ 
+ /*
+ ** Define this if you want to suppress the capitalization-checking
+ ** feature.  This will reduce the size of the hashed dictionary on
+ ** most 16-bit and some 32-bit machines.  This option is not
+ ** recommended.
+ */
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ #undef NO_CAPITALIZATION_SUPPORT
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 
+ /*
+ ** Define this if you want your personal dictionary sorted.  This may take
+ ** a long time for very large dictionaries.  Dictionaries larger than
+ ** SORTPERSONAL words will not be sorted.  Define SORTPERSONAL as zero
+ ** to disable this feature.
+ */
+ #ifndef SORTPERSONAL
+ #define SORTPERSONAL	1000
+ #endif
+ 
+ /*
+ ** Define this if you want to use the shell for interpretation of commands
+ ** issued via the "L" command, "^Z" under System V, and "!".  If this is
+ ** not defined then a direct fork()/exec() will be used in place of the
+ ** normal system().  This may speed up these operations greately on some
+ ** systems.
+ */
+ #ifndef USESH
+ #undef USESH
+ #endif /* USESH */
+ 
+ /*
+ ** Maximum language-table search size.  Smaller numbers make ispell
+ ** run faster, at the expense of more memory (the lowest reasonable value
+ ** is 2).  If a given character appears in a significant position in
+ ** more than MAXSEARCH suffixes, it will be given its own index table.
+ ** If you change this, define INDEXDUMP in lookup.c to be sure your
+ ** index table looks reasonable.
+ */
+ #ifndef MAXSEARCH
+ #define MAXSEARCH 4
+ #endif
+ 
+ /*
+ ** Define this if you want to be able to type any command at a "type space
+ ** to continue" prompt.
+ */
+ #ifndef COMMANDFORSPACE
+ #undef COMMANDFORSPACE
+ #endif /* COMMANDFORSPACE */
+ 
+ /*
+ ** Memory-allocation increment.  Buildhash allocates memory in chunks
+ ** of this size, and then subdivides it to get its storage.  This saves
+ ** much malloc execution time.  A good number for this is the system
+ ** page size less the malloc storage overhead.
+ **
+ ** Define this to zero to revert to using malloc/realloc.  This is normally
+ ** useful only on systems with limited memory.
+ */
+ #ifndef MALLOC_INCREMENT
+ #define MALLOC_INCREMENT	(4096 - 8)
+ #endif
+ 
+ /*
+ ** Maximum number of "hits" expected on a word.  This is basically the
+ ** number of different ways different affixes can produce the same word.
+ ** For example, with "english.aff", "brothers" can be produced 3 ways:
+ ** "brothers," "brother+s", or "broth+ers".  If this is too low, no major
+ ** harm will be done, but ispell may occasionally forget a capitalization.
+ */
+ #ifndef MAX_HITS
+ #define MAX_HITS	10
+ #endif
+ 
+ /*
+ ** Maximum number of capitalization variations expected in any word.
+ ** Besides the obvious all-lower, all-upper, and capitalized versions,
+ ** this includes followcase variants.  If this is too low, no real
+ ** harm will be done, but ispell may occasionally fail to suggest a
+ ** correct capitalization.
+ */
+ #ifndef MAX_CAPS
+ #define MAX_CAPS	10
+ #endif /* MAX_CAPS */
+ 
+ /* Define this to ignore spelling check of entire LaTeX bibliography listings */
+ #ifndef IGNOREBIB
+ #undef IGNOREBIB
+ #endif
+ 
+ /*
+ ** Default nroff and TeX special characters.  Normally, you won't want to
+ ** change this;  instead you would override it in the language-definition
+ ** file.
+ */
+ #ifndef TEXSPECIAL
+ #define TEXSPECIAL	"()[]{}<>\\$*.%"
+ #endif
+ 
+ #ifndef NRSPECIAL
+ #define NRSPECIAL	"().\\*"
+ #endif
+ 
+ /*
+ ** Defaults for certain command-line flags.
+ */
+ #ifndef DEFNOBACKUPFLAG
+ #define DEFNOBACKUPFLAG	0		    /* Don't suppress backup file */
+ #endif
+ #ifndef DEFTEXFLAG
+ #define DEFTEXFLAG	0		    /* Default to nroff mode */
+ #endif
+ 
+ /*
+ ** Define this if you want ispell to place a limitation on the maximum
+ ** size of the screen.  On windowed workstations with very large windows,
+ ** the size of the window can be too much of a good thing, forcing the
+ ** user to look back and forth between the bottom and top of the screen.
+ ** If MAX_SCREEN_SIZE is nonzero, screens larger than this will be treated
+ ** as if they have only MAX_SCREEN_SIZE lines.  A good value for this
+ ** variable is 24 or 30.  Define it as zero to suppress the feature.
+ */
+ #ifndef MAX_SCREEN_SIZE
+ #define MAX_SCREEN_SIZE 0
+ #endif
+ 
+ /*
+ ** The next three variables are used to provide a variable-size context
+ ** display at the bottom of the screen.  Normally, the user will see
+ ** a number of lines equal to CONTEXTPCT of his screen, rounded down
+ ** (thus, with CONTEXTPCT == 10, a 24-line screen will produce two lines
+ ** of context).  The context will never be greater than MAXCONTEXT or
+ ** less than MINCONTEXT.  To disable this feature entirely, set MAXCONTEXT
+ ** and MINCONTEXT to the same value.  To round context percentages up,
+ ** define CONTEXTROUNDUP.
+ **
+ ** Warning: don't set MAXCONTEXT ridiculously large.  There is a
+ ** static buffer of size MAXCONTEXT*BUFSIZ; since BUFSIZ is frequently
+ ** 1K or larger, this can create a remarkably large executable.
+ */
+ #ifndef CONTEXTPCT
+ #define CONTEXTPCT	10	/* Use 10% of the screen for context */
+ #endif
+ #ifndef MINCONTEXT
+ #define MINCONTEXT	2	/* Always show at least 2 lines of context */
+ #endif
+ #ifndef MAXCONTEXT
+ #define MAXCONTEXT	10	/* Never show more than 10 lines of context */
+ #endif
+ #ifndef CONTEXTROUNDUP
+ #undef CONTEXTROUNDUP		/* Don't round context up */
+ #endif
+ 
+ /*
+ ** Define this if you want the context lines to be displayed at the
+ ** bottom of the screen, the way they used to be, rather than at the top.
+ */
+ #ifndef BOTTOMCONTEXT
+ #undef BOTTOMCONTEXT
+ #endif /* BOTTOMCONTEXT */
+ 
+ /*
+ ** Define this if you want the "mini-menu," which gives the most important
+ ** options at the bottom of the screen, to be the default (in any case, it
+ ** can be controlled with the "-M" switch).
+ */
+ #ifndef MINIMENU
+ #undef MINIMENU
+ #endif
+ 
+ /*
+ ** You might want to change this to zero if your users want to check
+ ** single-letter words against the dictionary.  However, you should try
+ ** some sample runs using the -W switch before you try it out;  you'd
+ ** be surprised how many single letters appear in documents.  If you increase
+ ** MINWORD beyond 1, don't say I didn't warn you that it was a bad idea.
+ */
+ #ifndef MINWORD
+ #define MINWORD		1	/* Words this short and shorter are always ok */
+ #endif
+ 
+ /*
+ ** ANSI C compilers are supposed to provide an include file,
+ ** "stdlib.h", which gives function prototypes for all library
+ ** routines.  Define NO_STDLIB_H if you have a compiler that claims to
+ ** be ANSI, but doesn't provide this include file.
+ */
+ #ifndef NO_STDLIB_H
+ #ifndef __STDC__
+ #define NO_STDLIB_H
+ #endif /* __STDC__ */
+ #endif /* NO_STDLIB_H */
+ 
+ /*
+ ** The following define is used by the ispell developer to help
+ ** double-check the software.  Leave it undefined on other systems
+ ** unless you are especially fond of warning messages, or are pursuing
+ ** an inexplicable bug that might be related to a type mismatch.
+ */
+ #ifndef GENERATE_LIBARARY_PROTOS
+ #undef GENERATE_LIBARARY_PROTOS
+ #endif /* GENERATE_LIBARARY_PROTOS */
+ 
+ /*
+ ** Symbols below this point are generally intended to cater to
+ ** idiosyncracies of specific machines and operating systems.
+ **
+ ** MS-DOS users should also define HAS_RENAME, above, if appropriate.
+ **
+ ** Define PIECEMEAL_HASH_WRITES if your system can't handle huge write
+ ** operations.  This is known to be a problem on some MS-DOS systems.
+ */
+ #ifndef PIECEMEAL_HASH_WRITES
+ #undef PIECEMEAL_HASH_WRITES
+ #endif /* PIECEMEAL_HASH_WRITES */
+ 
+ /*
+ ** Redefine GETKEYSTROKE() to getkey() on some MS-DOS systems where
+ ** getchar() doesn't operate properly in raw mode.
+ */
+ #ifndef GETKEYSTROKE
+ #define GETKEYSTROKE()	getchar ()
+ #endif /* GETKEYSTROKE */
+ 
+ /*
+ ** Define MSDOS_BINARY_OPEN to 0x8000 on MS-DOS systems.  This can be
+ ** done by adding "#include fcntl.h" to your local.h file.
+ */
+ #ifndef MSDOS_BINARY_OPEN
+ #ifdef O_BINARY
+ #define MSDOS_BINARY_OPEN   O_BINARY
+ #else /* O_BINARY */
+ #define MSDOS_BINARY_OPEN   0
+ #endif /* O_BINARY */
+ #endif /* MSDOS_BINARY_OPEN */
+ 
+ /*
+ ** Environment variable to use to locate the home directory.  On DOS
+ ** systems you might want to set this to ISPELL_HOME to avoid
+ ** conflicts with other programs that look for a HOME environment
+ ** variable; on all other systems it should be just HOME.
+ */
+ #ifndef HOME
+ #define HOME	"HOME"
+ #endif /* HOME */
+ 
+ /*
+ ** On MS-DOS systems, define PDICTHOME to be the name of a directory
+ ** to be used to contain the personal dictionary (.ispell_english,
+ ** etc.).  On other systems, you can leave it undefined.
+ */
+ #ifndef PDICTHOME
+ #undef PDICTHOME
+ #endif /* PDICTHOME */
+ 
+ /*
+ ** On MS-DOS systems, you can rename the following variables so that
+ ** ispell's files have 3-character suffixes.  Note that, if you do
+ ** this, you will have to redefine any variable above that
+ ** incorporates one of the suffixes.
+ */
+ #ifndef HASHSUFFIX
+ #define HASHSUFFIX	".hash"
+ #endif /* HASHSUFFIX */
+ #ifndef STATSUFFIX
+ #define STATSUFFIX	".stat"
+ #endif /* STATSUFFIX */
+ #ifndef COUNTSUFFIX
+ #define COUNTSUFFIX	".cnt"
+ #endif /* COUNTSUFFIX */
+ 
+ /* AUTOMATICALLY-GENERATED SYMBOLS */
+ #define SIGNAL_TYPE_STRING "void"
+ #define MASKTYPE_STRING "long"


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/correct.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/correct.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/correct.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,1716 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: correct.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * correct.c - Routines to manage the higher-level aspects of spell-checking
+  *
+  * This code originally resided in ispell.c, but was moved here to keep
+  * file sizes smaller.
+  *
+  * Copyright (c), 1983, by Pace Willisson
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: correct.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:50  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.59  1995/08/05  23:19:43  geoff
+  * Fix a bug that caused offsets for long lines to be confused if the
+  * line started with a quoting uparrow.
+  *
+  * Revision 1.58  1994/11/02  06:56:00  geoff
+  * Remove the anyword feature, which I've decided is a bad idea.
+  *
+  * Revision 1.57  1994/10/26  05:12:39  geoff
+  * Try boundary characters when inserting or substituting letters, except
+  * (naturally) at word boundaries.
+  *
+  * Revision 1.56  1994/10/25  05:46:30  geoff
+  * Fix an assignment inside a conditional that could generate spurious
+  * warnings (as well as being bad style).  Add support for the FF_ANYWORD
+  * option.
+  *
+  * Revision 1.55  1994/09/16  04:48:24  geoff
+  * Don't pass newlines from the input to various other routines, and
+  * don't assume that those routines leave the input unchanged.
+  *
+  * Revision 1.54  1994/09/01  06:06:41  geoff
+  * Change erasechar/killchar to uerasechar/ukillchar to avoid
+  * shared-library problems on HP systems.
+  *
+  * Revision 1.53  1994/08/31  05:58:38  geoff
+  * Add code to handle extremely long lines in -a mode without splitting
+  * words or reporting incorrect offsets.
+  *
+  * Revision 1.52  1994/05/25  04:29:24  geoff
+  * Fix a bug that caused line widths to be calculated incorrectly when
+  * displaying lines containing tabs.  Fix a couple of places where
+  * characters were sign-extended incorrectly, which could cause 8-bit
+  * characters to be displayed wrong.
+  *
+  * Revision 1.51  1994/05/17  06:44:05  geoff
+  * Add support for controlled compound formation and the COMPOUNDONLY
+  * option to affix flags.
+  *
+  * Revision 1.50  1994/04/27  05:20:14  geoff
+  * Allow compound words to be formed from more than two components
+  *
+  * Revision 1.49  1994/04/27  01:50:31  geoff
+  * Add support to correctly capitalize words generated as a result of a
+  * missing-space suggestion.
+  *
+  * Revision 1.48  1994/04/03  23:23:02  geoff
+  * Clean up the code in missingspace() to be a bit simpler and more
+  * efficient.
+  *
+  * Revision 1.47  1994/03/15  06:24:23  geoff
+  * Fix the +/-/~ commands to be independent.  Allow the + command to
+  * receive a suffix which is a deformatter type (currently hardwired to
+  * be either tex or nroff/troff).
+  *
+  * Revision 1.46  1994/02/21  00:20:03  geoff
+  * Fix some bugs that could cause bad displays in the interaction between
+  * TeX parsing and string characters.  Show_char now will not overrun
+  * the inverse-video display area by accident.
+  *
+  * Revision 1.45  1994/02/14  00:34:51  geoff
+  * Fix correct to accept length parameters for ctok and itok, so that it
+  * can pass them to the to/from ichar routines.
+  *
+  * Revision 1.44  1994/01/25  07:11:22  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include <ctype.h>
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ #include "version.h"
+ 
+ void		givehelp P ((int interactive));
+ void		checkfile P ((void));
+ void		correct P ((char * ctok, int ctokl, ichar_t * itok, int itokl,
+ 		  char ** curchar));
+ static void	show_line P ((char * line, char * invstart, int invlen));
+ static int	show_char P ((char ** cp, int linew, int output, int maxw));
+ static int	line_size P ((char * buf, char * bufend));
+ static void	inserttoken P ((char * buf, char * start, char * tok,
+ 		  char ** curchar));
+ static int	posscmp P ((char * a, char * b));
+ int		casecmp P ((char * a, char * b, int canonical));
+ void		makepossibilities P ((ichar_t * word));
+ static int	insert P ((ichar_t * word));
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ static void	wrongcapital P ((ichar_t * word));
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ static void	wrongletter P ((ichar_t * word));
+ static void	extraletter P ((ichar_t * word));
+ static void	missingletter P ((ichar_t * word));
+ static void	missingspace P ((ichar_t * word));
+ int		compoundgood P ((ichar_t * word, int pfxopts));
+ static void	transposedletter P ((ichar_t * word));
+ static void	tryveryhard P ((ichar_t * word));
+ static int	ins_cap P ((ichar_t * word, ichar_t * pattern));
+ static int	save_cap P ((ichar_t * word, ichar_t * pattern,
+ 		  ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN]));
+ int		ins_root_cap P ((ichar_t * word, ichar_t * pattern,
+ 		  int prestrip, int preadd, int sufstrip, int sufadd,
+ 		  struct dent * firstdent, struct flagent * pfxent,
+ 		  struct flagent * sufent));
+ static void	save_root_cap P ((ichar_t * word, ichar_t * pattern,
+ 		  int prestrip, int preadd, int sufstrip, int sufadd,
+ 		  struct dent * firstdent, struct flagent * pfxent,
+ 		  struct flagent * sufent,
+ 		  ichar_t savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN],
+ 		  int * nsaved));
+ static char *	getline P ((char * buf));
+ void		askmode P ((void));
+ void		copyout P ((char ** cc, int cnt));
+ static void	lookharder P ((char * string));
+ #ifdef REGEX_LOOKUP
+ static void	regex_dict_lookup P ((char * cmd, char * grepstr));
+ #endif /* REGEX_LOOKUP */
+ 
+ void givehelp (interactive)
+     int		    interactive;	/* NZ for interactive-mode help */
+     {
+ #ifdef COMMANDFORSPACE
+     char ch;
+ #endif
+     register FILE *helpout;	/* File to write help to */
+ 
+     if (interactive)
+ 	{
+ 	erase ();
+ 	helpout = stdout;
+ 	}
+     else
+ 	helpout = stderr;
+ 
+     (void) fprintf (helpout, CORR_C_HELP_1);
+     (void) fprintf (helpout, CORR_C_HELP_2);
+     (void) fprintf (helpout, CORR_C_HELP_3);
+     (void) fprintf (helpout, CORR_C_HELP_4);
+     (void) fprintf (helpout, CORR_C_HELP_5);
+     (void) fprintf (helpout, CORR_C_HELP_6);
+     (void) fprintf (helpout, CORR_C_HELP_7);
+     (void) fprintf (helpout, CORR_C_HELP_8);
+     (void) fprintf (helpout, CORR_C_HELP_9);
+ 
+     (void) fprintf (helpout, CORR_C_HELP_COMMANDS);
+ 
+     (void) fprintf (helpout, CORR_C_HELP_R_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_BLANK);
+     (void) fprintf (helpout, CORR_C_HELP_A_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_I_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_U_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_0_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_L_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_X_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_Q_CMD);
+     (void) fprintf (helpout, CORR_C_HELP_BANG);
+     (void) fprintf (helpout, CORR_C_HELP_REDRAW);
+     (void) fprintf (helpout, CORR_C_HELP_SUSPEND);
+     (void) fprintf (helpout, CORR_C_HELP_HELP);
+ 
+     if (interactive)
+ 	{
+ 	(void) fprintf (helpout, "\r\n\r\n");
+ 	(void) fprintf (helpout, CORR_C_HELP_TYPE_SPACE);
+ 	(void) fflush (helpout);
+ #ifdef COMMANDFORSPACE
+ 	ch = GETKEYSTROKE ();
+ 	if (ch != ' ' && ch != '\n' && ch != '\r')
+ 	    (void) ungetc (ch, stdin);
+ #else
+ 	while (GETKEYSTROKE () != ' ')
+ 	    ;
+ #endif
+ 	}
+     }
+ 
+ void checkfile ()
+     {
+     int		bufno;
+     int		bufsize;
+     int		ch;
+ 
+     for (bufno = 0;  bufno < contextsize;  bufno++)
+ 	contextbufs[bufno][0] = '\0';
+ 
+     for (  ;  ;  )
+ 	{
+ 	for (bufno = contextsize;  --bufno > 0;  )
+ 	    (void) strcpy (contextbufs[bufno],
+ 	      contextbufs[bufno - 1]);
+ 	if (quit)	/* quit can't be set in l mode */
+ 	    {
+ 	    while (fgets (contextbufs[0],
+ 	      sizeof contextbufs[0], infile) != NULL)
+ 		(void) fputs (contextbufs[0], outfile);
+ 	    break;
+ 	    }
+ 	/*
+ 	 * Only read in enough characters to fill half this buffer so that any
+ 	 * corrections we make are not likely to cause an overflow.
+ 	 */
+ 	if (fgets (contextbufs[0], (sizeof contextbufs[0]) / 2, infile)
+ 	  == NULL)
+ 	    break;
+ 	/*
+ 	 * If we didn't read to end-of-line, we may have ended the
+ 	 * buffer in the middle of a word.  So keep reading until we
+ 	 * see some sort of character that can't possibly be part of a
+ 	 * word. (or until the buffer is full, which fortunately isn't
+ 	 * all that likely).
+ 	 */
+ 	bufsize = strlen (contextbufs[0]);
+ 	if (bufsize == (sizeof contextbufs[0]) / 2 - 1)
+ 	    {
+ 	    ch = (unsigned char) contextbufs[0][bufsize - 1];
+ 	    while (bufsize < sizeof contextbufs[0] - 1
+ 	      &&  (iswordch ((ichar_t) ch)  ||  isboundarych ((ichar_t) ch)
+ 	      ||  isstringstart (ch)))
+ 		{
+ 		ch = getc (infile);
+ 		if (ch == EOF)
+ 		    break;
+ 		contextbufs[0][bufsize++] = (char) ch;
+ 		contextbufs[0][bufsize] = '\0';
+ 		}
+ 	    }
+ 	checkline (outfile);
+ 	}
+     }
+ 
+ void correct (ctok, ctokl, itok, itokl, curchar)
+     char *		ctok;
+     int			ctokl;
+     ichar_t *		itok;
+     int			itokl;
+     char **		curchar;
+     {
+     register int	c;
+     register int	i;
+     int			col_ht;
+     int			ncols;
+     char *		start_l2;
+     char *		begintoken;
+ 
+     begintoken = *curchar - strlen (ctok);
+ 
+     if (icharlen (itok) <= minword)
+ 	return;			/* Accept very short words */
+ 
+ checkagain:
+     if (good (itok, 0, 0, 0, 0)  ||  compoundgood (itok, 0))
+ 	return;
+ 
+     erase ();
+     (void) printf ("    %s", ctok);
+     if (currentfile)
+ 	(void) printf (CORR_C_FILE_LABEL, currentfile);
+     if (readonly)
+ 	(void) printf (" %s", CORR_C_READONLY);
+     (void) printf ("\r\n\r\n");
+ 
+     makepossibilities (itok);
+ 
+     /*
+      * Make sure we have enough room on the screen to hold the
+      * possibilities.  Reduce the list if necessary.  co / (maxposslen + 8)
+      * is the maximum number of columns that will fit.  col_ht is the
+      * height of the columns.  The constant 4 allows 2 lines (1 blank) at
+      * the top of the screen, plus another blank line between the
+      * columns and the context, plus a final blank line at the bottom
+      * of the screen for command entry (R, L, etc).
+      */
+     col_ht = li - contextsize - 4 - minimenusize;
+     ncols = co / (maxposslen + 8);
+     if (pcount > ncols * col_ht)
+ 	pcount = ncols * col_ht;
+ 
+ #ifdef EQUAL_COLUMNS
+     /*
+      * Equalize the column sizes.  The last column will be short.
+      */
+     col_ht = (pcount + ncols - 1) / ncols;
+ #endif
+ 
+     for (i = 0; i < pcount; i++)
+ 	{
+ #ifdef BOTTOMCONTEXT
+ 	move (2 + (i % col_ht), (maxposslen + 8) * (i / col_ht));
+ #else /* BOTTOMCONTEXT */
+ 	move (3 + contextsize + (i % col_ht), (maxposslen + 8) * (i / col_ht));
+ #endif /* BOTTOMCONTEXT */
+ 	if (i >= easypossibilities)
+ 	    (void) printf ("??: %s", possibilities[i]);
+ 	else if (easypossibilities >= 10  &&  i < 10)
+ 	    (void) printf ("0%d: %s", i, possibilities[i]);
+ 	else
+ 	    (void) printf ("%2d: %s", i, possibilities[i]);
+ 	}
+ 
+ #ifdef BOTTOMCONTEXT
+     move (li - contextsize - 1 - minimenusize, 0);
+ #else /* BOTTOMCONTEXT */
+     move (2, 0);
+ #endif /* BOTTOMCONTEXT */
+     for (i = contextsize;  --i > 0;  )
+ 	show_line (contextbufs[i], contextbufs[i], 0);
+ 
+     start_l2 = contextbufs[0];
+     if (line_size (contextbufs[0], *curchar) > co - (sg << 1) - 1)
+ 	{
+ 	start_l2 = begintoken - (co / 2);
+ 	while (start_l2 < begintoken)
+ 	    {
+ 	    i = line_size (start_l2, *curchar) + 1;
+ 	    if (i + (sg << 1) <= co)
+ 		break;
+ 	    start_l2 += i - co;
+ 	    }
+ 	if (start_l2 > begintoken)
+ 	    start_l2 = begintoken;
+ 	if (start_l2 < contextbufs[0])
+ 	    start_l2 = contextbufs[0];
+ 	}
+     show_line (start_l2, begintoken, (int) strlen (ctok));
+ 
+     if (minimenusize != 0)
+ 	{
+ 	move (li - 2, 0);
+ 	(void) printf (CORR_C_MINI_MENU);
+ 	}
+ 
+     for (  ;  ;  )
+ 	{
+ 	(void) fflush (stdout);
+ 	switch (c = (GETKEYSTROKE () & NOPARITY))
+ 	    {
+ 	    case 'Z' & 037:
+ 		stop ();
+ 		erase ();
+ 		goto checkagain;
+ 	    case ' ':
+ 		erase ();
+ 		(void) fflush (stdout);
+ 		return;
+ 	    case 'q': case 'Q':
+ 		if (changes)
+ 		    {
+ 		    (void) printf (CORR_C_CONFIRM_QUIT);
+ 		    (void) fflush (stdout);
+ 		    c = (GETKEYSTROKE () & NOPARITY);
+ 		    }
+ 		else
+ 		    c = 'y';
+ 		if (c == 'y' || c == 'Y')
+ 		    {
+ 		    erase ();
+ 		    (void) fflush (stdout);
+ 		    done (0);
+ 		    }
+ 		goto checkagain;
+ 	    case 'i': case 'I':
+ 		treeinsert (ichartosstr (strtosichar (ctok, 0), 1),
+ 		 ICHARTOSSTR_SIZE, 1);
+ 		erase ();
+ 		(void) fflush (stdout);
+ 		changes = 1;
+ 		return;
+ 	    case 'u': case 'U':
+ 		itok = strtosichar (ctok, 0);
+ 		lowcase (itok);
+ 		treeinsert (ichartosstr (itok, 1), ICHARTOSSTR_SIZE, 1);
+ 		erase ();
+ 		(void) fflush (stdout);
+ 		changes = 1;
+ 		return;
+ 	    case 'a': case 'A':
+ 		treeinsert (ichartosstr (strtosichar (ctok, 0), 1),
+ 		  ICHARTOSSTR_SIZE, 0);
+ 		erase ();
+ 		(void) fflush (stdout);
+ 		return;
+ 	    case 'L' & 037:
+ 		goto checkagain;
+ 	    case '?':
+ 		givehelp (1);
+ 		goto checkagain;
+ 	    case '!':
+ 		{
+ 		char	buf[200];
+ 
+ 		move (li - 1, 0);
+ 		(void) putchar ('!');
+ 		if (getline (buf) == NULL)
+ 		    {
+ 		    (void) putchar (7);
+ 		    erase ();
+ 		    (void) fflush (stdout);
+ 		    goto checkagain;
+ 		    }
+ 		(void) printf ("\r\n");
+ 		(void) fflush (stdout);
+ #ifdef	USESH
+ 		shescape (buf);
+ #else
+ 		(void) shellescape (buf);
+ #endif
+ 		erase ();
+ 		goto checkagain;
+ 		}
+ 	    case 'r': case 'R':
+ 		move (li - 1, 0);
+ 		if (readonly)
+ 		    {
+ 		    (void) putchar (7);
+ 		    (void) printf ("%s ", CORR_C_READONLY);
+ 		    }
+ 		(void) printf (CORR_C_REPLACE_WITH);
+ 		if (getline (ctok) == NULL)
+ 		    {
+ 		    (void) putchar (7);
+ 		    /* Put it back */
+ 		    (void) ichartostr (ctok, itok, ctokl, 0);
+ 		    }
+ 		else
+ 		    {
+ 		    inserttoken (contextbufs[0],
+ 		      begintoken, ctok, curchar);
+ 		    if (strtoichar (itok, ctok, itokl, 0))
+ 			{
+ 			(void) putchar (7);
+ 			(void) printf (WORD_TOO_LONG (ctok));
+ 			}
+ 		    changes = 1;
+ 		    }
+ 		erase ();
+ 		if (icharlen (itok) <= minword)
+ 		    return;		/* Accept very short replacements */
+ 		goto checkagain;
+ 	    case '0': case '1': case '2': case '3': case '4':
+ 	    case '5': case '6': case '7': case '8': case '9':
+ 		i = c - '0';
+ 		if (easypossibilities >= 10)
+ 		    {
+ 		    c = GETKEYSTROKE () & NOPARITY;
+ 		    if (c >= '0'  &&  c <= '9')
+ 			i = i * 10 + c - '0';
+ 		    else if (c != '\r'  &&  c != '\n')
+ 			{
+ 			(void) putchar (7);
+ 			break;
+ 			}
+ 		    }
+ 		if (i < easypossibilities)
+ 		    {
+ 		    (void) strcpy (ctok, possibilities[i]);
+ 		    changes = 1;
+ 		    inserttoken (contextbufs[0],
+ 			begintoken, ctok, curchar);
+ 		    erase ();
+ 		    if (readonly)
+ 			{
+ 			move (li - 1, 0);
+ 			(void) putchar (7);
+ 			(void) printf ("%s", CORR_C_READONLY);
+ 			(void) fflush (stdout);
+ 			(void) sleep ((unsigned) 2);
+ 			}
+ 		    return;
+ 		    }
+ 		(void) putchar (7);
+ 		break;
+ 	    case '\r':	/* This makes typing \n after single digits */
+ 	    case '\n':	/* ..less obnoxious */
+ 		break;
+ 	    case 'l': case 'L':
+ 		{
+ 		char	buf[100];
+ 		move (li - 1, 0);
+ 		(void) printf (CORR_C_LOOKUP_PROMPT);
+ 		if (getline (buf) == NULL)
+ 		    {
+ 		    (void) putchar (7);
+ 		    erase ();
+ 		    goto checkagain;
+ 		    }
+ 		(void) printf ("\r\n");
+ 		(void) fflush (stdout);
+ 		lookharder (buf);
+ 		erase ();
+ 		goto checkagain;
+ 		}
+ 	    case 'x': case 'X':
+ 		quit = 1;
+ 		erase ();
+ 		(void) fflush (stdout);
+ 		return;
+ 	    default:
+ 		(void) putchar (7);
+ 		break;
+ 	    }
+ 	}
+     }
+ 
+ static void show_line (line, invstart, invlen)
+     char *		line;
+     register char *	invstart;
+     register int	invlen;
+     {
+     register int	width;
+ 
+     width = invlen ? (sg << 1) : 0;
+     while (line < invstart  &&  width < co - 1)
+ 	width += show_char (&line, width, 1, invstart - line);
+     if (invlen)
+ 	{
+ 	inverse ();
+ 	invstart += invlen;
+ 	while (line < invstart  &&  width < co - 1)
+ 	    width += show_char (&line, width, 1, invstart - line);
+ 	normal ();
+ 	}
+     while (*line  &&  width < co - 1)
+ 	width += show_char (&line, width, 1, 0);
+     (void) printf ("\r\n");
+     }
+ 
+ static int show_char (cp, linew, output, maxw)
+     register char **	cp;
+     int			linew;
+     int			output;		/* NZ to actually do output */
+     int			maxw;		/* NZ to limit width shown */
+     {
+     register int	ch;
+     register int	i;
+     int			len;
+     ichar_t		ichar;
+     register int	width;
+ 
+     ch = (unsigned char) **cp;
+     if (l1_isstringch (*cp, len, 0))
+ 	ichar = SET_SIZE + laststringch;
+     else
+ 	ichar = chartoichar (ch);
+     if (!vflag  &&  iswordch (ichar)  &&  len == 1)
+ 	{
+ 	if (output)
+ 	    (void) putchar (ch);
+ 	(*cp)++;
+ 	return 1;
+ 	}
+     if (ch == '\t')
+ 	{
+ 	if (output)
+ 	    (void) putchar ('\t');
+ 	(*cp)++;
+ 	return 8 - (linew & 0x07);
+ 	}
+     /*
+      * Character is non-printing, or it's ISO and vflag is set.  Display
+      * it in "cat -v" form.  For string characters, display every element
+      * separately in that form.
+      */
+     width = 0;
+     if (maxw != 0  &&  len > maxw)
+ 	len = maxw;			/* Don't show too much */
+     for (i = 0;  i < len;  i++)
+ 	{
+ 	ch = (unsigned char) *(*cp)++;
+ 	if (ch > '\177')
+ 	    {
+ 	    if (output)
+ 		{
+ 		(void) putchar ('M');
+ 		(void) putchar ('-');
+ 		}
+ 	    width += 2;
+ 	    ch &= 0x7f;
+ 	    }
+ 	if (ch < ' '  ||  ch == '\177')
+ 	    {
+ 	    if (output)
+ 		{
+ 		(void) putchar ('^');
+ 		if (ch == '\177')
+ 		    (void) putchar ('?');
+ 		else
+ 		    (void) putchar (ch + 'A' - '\001');
+ 		}
+ 	    width += 2;
+ 	    }
+ 	else
+ 	    {
+ 	    if (output)
+ 		(void) putchar (ch);
+ 	    width += 1;
+ 	    }
+ 	}
+     return width;
+     }
+ 
+ static int line_size (buf, bufend)
+     char *		buf;
+     register char *	bufend;
+     {
+     register int	width;
+ 
+     for (width = 0;  buf < bufend  &&  *buf != '\0';  )
+ 	width += show_char (&buf, width, 0, bufend - buf);
+     return width;
+     }
+ 
+ static void inserttoken (buf, start, tok, curchar)
+     char *		buf;
+     char *		start; 
+     register char *	tok;
+     char **		curchar;
+     {
+     char		copy[BUFSIZ];
+     register char *	p;
+     register char *	q;
+     char *		ew;
+ 
+     (void) strcpy (copy, buf);
+ 
+     for (p = buf, q = copy; p != start; p++, q++)
+ 	*p = *q;
+     q += *curchar - start;
+     ew = skipoverword (tok);
+     while (tok < ew)
+ 	*p++ = *tok++;
+     *curchar = p;
+     if (*tok)
+ 	{
+ 
+ 	/*
+ 	** The token changed to two words.  Split it up and save the
+ 	** second one for later.
+ 	*/
+ 
+ 	*p++ = *tok;
+ 	*tok++ = '\0';
+ 	while (*tok)
+ 	    *p++ = *tok++;
+ 	}
+     while ((*p++ = *q++) != '\0')
+ 	;
+     }
+ 
+ static int posscmp (a, b)
+     char *		a;
+     char *		b;
+     {
+ 
+     return casecmp (a, b, 0);
+     }
+ 
+ int casecmp (a, b, canonical)
+     char *		a;
+     char *		b;
+     int			canonical;	/* NZ for canonical string chars */
+     {
+     register ichar_t *	ap;
+     register ichar_t *	bp;
+     ichar_t		inta[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
+     ichar_t		intb[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
+ 
+     (void) strtoichar (inta, a, sizeof inta, canonical);
+     (void) strtoichar (intb, b, sizeof intb, canonical);
+     for (ap = inta, bp = intb;  *ap != 0;  ap++, bp++)
+ 	{
+ 	if (*ap != *bp)
+ 	    {
+ 	    if (*bp == '\0')
+ 		return hashheader.sortorder[*ap];
+ 	    else if (mylower (*ap))
+ 		{
+ 		if (mylower (*bp)  ||  mytoupper (*ap) != *bp)
+ 		    return (int) hashheader.sortorder[*ap]
+ 		      - (int) hashheader.sortorder[*bp];
+ 		}
+ 	    else
+ 		{
+ 		if (myupper (*bp)  ||  mytolower (*ap) != *bp)
+ 		    return (int) hashheader.sortorder[*ap]
+ 		      - (int) hashheader.sortorder[*bp];
+ 		}
+ 	    }
+ 	}
+     if (*bp != '\0')
+ 	return -(int) hashheader.sortorder[*bp];
+     for (ap = inta, bp = intb;  *ap;  ap++, bp++)
+ 	{
+ 	if (*ap != *bp)
+ 	    {
+ 	    return (int) hashheader.sortorder[*ap]
+ 	      - (int) hashheader.sortorder[*bp];
+ 	    }
+ 	}
+     return 0;
+     }
+ 
+ void makepossibilities (word)
+     register ichar_t *	word;
+     {
+     register int	i;
+ 
+     for (i = 0; i < MAXPOSSIBLE; i++)
+ 	possibilities[i][0] = 0;
+     pcount = 0;
+     maxposslen = 0;
+     easypossibilities = 0;
+ 
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     wrongcapital (word);
+ #endif
+ 
+ /* 
+  * according to Pollock and Zamora, CACM April 1984 (V. 27, No. 4),
+  * page 363, the correct order for this is:
+  * OMISSION = TRANSPOSITION > INSERTION > SUBSTITUTION
+  * thus, it was exactly backwards in the old version. -- PWP
+  */
+ 
+     if (pcount < MAXPOSSIBLE)
+ 	missingletter (word);		/* omission */
+     if (pcount < MAXPOSSIBLE)
+ 	transposedletter (word);	/* transposition */
+     if (pcount < MAXPOSSIBLE)
+ 	extraletter (word);		/* insertion */
+     if (pcount < MAXPOSSIBLE)
+ 	wrongletter (word);		/* substitution */
+ 
+     if ((compoundflag != COMPOUND_ANYTIME)  &&  pcount < MAXPOSSIBLE)
+ 	missingspace (word);	/* two words */
+ 
+     easypossibilities = pcount;
+     if (easypossibilities == 0  ||  tryhardflag)
+ 	tryveryhard (word);
+ 
+     if ((sortit  ||  (pcount > easypossibilities))  &&  pcount)
+ 	{
+ 	if (easypossibilities > 0  &&  sortit)
+ 	    qsort ((char *) possibilities,
+ 	      (unsigned) easypossibilities,
+ 	      sizeof (possibilities[0]),
+ 	      (int (*) P ((const void *, const void *))) posscmp);
+ 	if (pcount > easypossibilities)
+ 	    qsort ((char *) &possibilities[easypossibilities][0],
+ 	      (unsigned) (pcount - easypossibilities),
+ 	      sizeof (possibilities[0]),
+ 	      (int (*) P ((const void *, const void *))) posscmp);
+ 	}
+     }
+ 
+ static int insert (word)
+     register ichar_t *	word;
+     {
+     register int	i;
+     register char *	realword;
+ 
+     realword = ichartosstr (word, 0);
+     for (i = 0; i < pcount; i++)
+ 	{
+ 	if (strcmp (possibilities[i], realword) == 0)
+ 	    return (0);
+ 	}
+ 
+     (void) strcpy (possibilities[pcount++], realword);
+     i = strlen (realword);
+     if (i > maxposslen)
+ 	maxposslen = i;
+     if (pcount >= MAXPOSSIBLE)
+ 	return (-1);
+     else
+ 	return (0);
+     }
+ 
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ static void wrongcapital (word)
+     register ichar_t *	word;
+     {
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN];
+ 
+     /*
+     ** When the third parameter to "good" is nonzero, it ignores
+     ** case.  If the word matches this way, "ins_cap" will recapitalize
+     ** it correctly.
+     */
+     if (good (word, 0, 1, 0, 0))
+ 	{
+ 	(void) icharcpy (newword, word);
+ 	upcase (newword);
+ 	(void) ins_cap (newword, word);
+ 	}
+     }
+ #endif
+ 
+ static void wrongletter (word)
+     register ichar_t *	word;
+     {
+     register int	i;
+     register int	j;
+     register int	n;
+     ichar_t		savechar;
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN];
+ 
+     n = icharlen (word);
+     (void) icharcpy (newword, word);
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     upcase (newword);
+ #endif
+ 
+     for (i = 0; i < n; i++)
+ 	{
+ 	savechar = newword[i];
+ 	for (j=0; j < Trynum; ++j)
+ 	    {
+ 	    if (Try[j] == savechar)
+ 		continue;
+ 	    else if (isboundarych (Try[j])  &&  (i == 0  ||  i == n - 1))
+ 		continue;
+ 	    newword[i] = Try[j];
+ 	    if (good (newword, 0, 1, 0, 0))
+ 		{
+ 		if (ins_cap (newword, word) < 0)
+ 		    return;
+ 		}
+ 	    }
+ 	newword[i] = savechar;
+ 	}
+     }
+ 
+ static void extraletter (word)
+     register ichar_t *	word;
+     {
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN];
+     register ichar_t *	p;
+     register ichar_t *	r;
+ 
+     if (icharlen (word) < 2)
+ 	return;
+ 
+     (void) icharcpy (newword, word + 1);
+     for (p = word, r = newword;  *p != 0;  )
+ 	{
+ 	if (good (newword, 0, 1, 0, 0))
+ 	    {
+ 	    if (ins_cap (newword, word) < 0)
+ 		return;
+ 	    }
+ 	*r++ = *p++;
+ 	}
+     }
+ 
+ static void missingletter (word)
+     ichar_t *		word;
+     {
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN + 1];
+     register ichar_t *	p;
+     register ichar_t *	r;
+     register int	i;
+ 
+     (void) icharcpy (newword + 1, word);
+     for (p = word, r = newword;  *p != 0;  )
+ 	{
+ 	for (i = 0;  i < Trynum;  i++)
+ 	    {
+ 	    if (isboundarych (Try[i])  &&  r == newword)
+ 		continue;
+ 	    *r = Try[i];
+ 	    if (good (newword, 0, 1, 0, 0))
+ 		{
+ 		if (ins_cap (newword, word) < 0)
+ 		    return;
+ 		}
+ 	    }
+ 	*r++ = *p++;
+ 	}
+     for (i = 0;  i < Trynum;  i++)
+ 	{
+ 	if (isboundarych (Try[i]))
+ 	    continue;
+ 	*r = Try[i];
+ 	if (good (newword, 0, 1, 0, 0))
+ 	    {
+ 	    if (ins_cap (newword, word) < 0)
+ 		return;
+ 	    }
+ 	}
+     }
+ 
+ static void missingspace (word)
+     ichar_t *		word;
+     {
+     ichar_t		firsthalf[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
+     int			firstno;	/* Index into first */
+     ichar_t *		firstp;		/* Ptr into current firsthalf word */
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN + 1];
+     int			nfirsthalf;	/* No. words saved in 1st half */
+     int			nsecondhalf;	/* No. words saved in 2nd half */
+     register ichar_t *	p;
+     ichar_t		secondhalf[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
+     int			secondno;	/* Index into second */
+ 
+     /*
+     ** We don't do words of length less than 3;  this keeps us from
+     ** splitting all two-letter words into two single letters.  We
+     ** also don't do maximum-length words, since adding the space
+     ** would exceed the size of the "possibilities" array.
+     */
+     nfirsthalf = icharlen (word);
+     if (nfirsthalf < 3  ||  nfirsthalf >= INPUTWORDLEN + MAXAFFIXLEN - 1)
+ 	return;
+     (void) icharcpy (newword + 1, word);
+     for (p = newword + 1;  p[1] != '\0';  p++)
+ 	{
+ 	p[-1] = *p;
+ 	*p = '\0';
+ 	if (good (newword, 0, 1, 0, 0))
+ 	    {
+ 	    /*
+ 	     * Save_cap must be called before good() is called on the
+ 	     * second half, because it uses state left around by
+ 	     * good().  This is unfortunate because it wastes a bit of
+ 	     * time, but I don't think it's a significant performance
+ 	     * problem.
+ 	     */
+ 	    nfirsthalf = save_cap (newword, word, firsthalf);
+ 	    if (good (p + 1, 0, 1, 0, 0))
+ 		{
+ 		nsecondhalf = save_cap (p + 1, p + 1, secondhalf);
+ 		for (firstno = 0;  firstno < nfirsthalf;  firstno++)
+ 		    {
+ 		    firstp = &firsthalf[firstno][p - newword];
+ 		    for (secondno = 0;  secondno < nsecondhalf;  secondno++)
+ 			{
+ 			*firstp = ' ';
+ 			(void) icharcpy (firstp + 1, secondhalf[secondno]);
+ 			if (insert (firsthalf[firstno]) < 0)
+ 			    return;
+ 			*firstp = '-';
+ 			if (insert (firsthalf[firstno]) < 0)
+ 			    return;
+ 			}
+ 		    }
+ 		}
+ 	    }
+ 	}
+     }
+ 
+ int compoundgood (word, pfxopts)
+     ichar_t *		word;
+     int			pfxopts;	/* Options to apply to prefixes */
+     {
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN];
+     register ichar_t *	p;
+     register ichar_t	savech;
+     long		secondcap;	/* Capitalization of 2nd half */
+ 
+     /*
+     ** If compoundflag is COMPOUND_NEVER, compound words are never ok.
+     */
+     if (compoundflag == COMPOUND_NEVER)
+ 	return 0;
+     /*
+     ** Test for a possible compound word (for languages like German that
+     ** form lots of compounds).
+     **
+     ** This is similar to missingspace, except we quit on the first hit,
+     ** and we won't allow either member of the compound to be a single
+     ** letter.
+     **
+     ** We don't do words of length less than 2 * compoundmin, since
+     ** both halves must at least compoundmin letters.
+     */
+     if (icharlen (word) < 2 * hashheader.compoundmin)
+ 	return 0;
+     (void) icharcpy (newword, word);
+     p = newword + hashheader.compoundmin;
+     for (  ;  p[hashheader.compoundmin - 1] != 0;  p++)
+ 	{
+ 	savech = *p;
+ 	*p = 0;
+ 	if (good (newword, 0, 0, pfxopts, FF_COMPOUNDONLY))
+ 	    {
+ 	    *p = savech;
+ 	    if (good (p, 0, 1, FF_COMPOUNDONLY, 0)
+ 	      ||  compoundgood (p, FF_COMPOUNDONLY))
+ 		{
+ 		secondcap = whatcap (p);
+ 		switch (whatcap (newword))
+ 		    {
+ 		    case ANYCASE:
+ 		    case CAPITALIZED:
+ 		    case FOLLOWCASE:	/* Followcase can have l.c. suffix */
+ 			return secondcap == ANYCASE;
+ 		    case ALLCAPS:
+ 			return secondcap == ALLCAPS;
+ 		    }
+ 		}
+ 	    }
+ 	else
+ 	    *p = savech;
+ 	}
+     return 0;
+     }
+ 
+ static void transposedletter (word)
+     register ichar_t *	word;
+     {
+     ichar_t		newword[INPUTWORDLEN + MAXAFFIXLEN];
+     register ichar_t *	p;
+     register ichar_t	temp;
+ 
+     (void) icharcpy (newword, word);
+     for (p = newword;  p[1] != 0;  p++)
+ 	{
+ 	temp = *p;
+ 	*p = p[1];
+ 	p[1] = temp;
+ 	if (good (newword, 0, 1, 0, 0))
+ 	    {
+ 	    if (ins_cap (newword, word) < 0)
+ 		return;
+ 	    }
+ 	temp = *p;
+ 	*p = p[1];
+ 	p[1] = temp;
+ 	}
+     }
+ 
+ static void tryveryhard (word)
+     ichar_t *		word;
+     {
+     (void) good (word, 1, 0, 0, 0);
+     }
+ 
+ /* Insert one or more correctly capitalized versions of word */
+ static int ins_cap (word, pattern)
+     ichar_t *		word;
+     ichar_t *		pattern;
+     {
+     int			i;		/* Index into savearea */
+     int			nsaved;		/* No. of words saved */
+     ichar_t		savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
+ 
+     nsaved = save_cap (word, pattern, savearea);
+     for (i = 0;  i < nsaved;  i++)
+ 	{
+ 	if (insert (savearea[i]) < 0)
+ 	    return -1;
+ 	}
+     return 0;
+     }
+ 
+ /* Save one or more correctly capitalized versions of word */
+ static int save_cap (word, pattern, savearea)
+     ichar_t *		word;		/* Word to save */
+     ichar_t *		pattern;	/* Prototype capitalization pattern */
+     ichar_t		savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
+ 					/* Room to save words */
+     {
+     int			hitno;		/* Index into hits array */
+     int			nsaved;		/* Number of words saved */
+     int			preadd;		/* No. chars added to front of root */
+     int			prestrip;	/* No. chars stripped from front */
+     int			sufadd;		/* No. chars added to back of root */
+     int			sufstrip;	/* No. chars stripped from back */
+ 
+     if (*word == 0)
+ 	return 0;
+ 
+     for (hitno = numhits, nsaved = 0;  --hitno >= 0  &&  nsaved < MAX_CAPS;  )
+ 	{
+ 	if (hits[hitno].prefix)
+ 	    {
+ 	    prestrip = hits[hitno].prefix->stripl;
+ 	    preadd = hits[hitno].prefix->affl;
+ 	    }
+ 	else
+ 	    prestrip = preadd = 0;
+ 	if (hits[hitno].suffix)
+ 	    {
+ 	    sufstrip = hits[hitno].suffix->stripl;
+ 	    sufadd = hits[hitno].suffix->affl;
+ 	    }
+ 	else
+ 	    sufadd = sufstrip = 0;
+ 	save_root_cap (word, pattern, prestrip, preadd,
+ 	    sufstrip, sufadd,
+ 	    hits[hitno].dictent, hits[hitno].prefix, hits[hitno].suffix,
+ 	    savearea, &nsaved);
+ 	}
+     return nsaved;
+     }
+ 
+ int ins_root_cap (word, pattern, prestrip, preadd, sufstrip, sufadd,
+   firstdent, pfxent, sufent)
+     register ichar_t *	word;
+     register ichar_t *	pattern;
+     int			prestrip;
+     int			preadd;
+     int			sufstrip;
+     int			sufadd;
+     struct dent *	firstdent;
+     struct flagent *	pfxent;
+     struct flagent *	sufent;
+     {
+     int			i;		/* Index into savearea */
+     ichar_t		savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
+     int			nsaved;		/* Number of words saved */
+ 
+     nsaved = 0;
+     save_root_cap (word, pattern, prestrip, preadd, sufstrip, sufadd,
+       firstdent, pfxent, sufent, savearea, &nsaved);
+     for (i = 0;  i < nsaved;  i++)
+ 	{
+ 	if (insert (savearea[i]) < 0)
+ 	    return -1;
+ 	}
+     return 0;
+     }
+ 
+ /* ARGSUSED */
+ static void save_root_cap (word, pattern, prestrip, preadd, sufstrip, sufadd,
+   firstdent, pfxent, sufent, savearea, nsaved)
+     register ichar_t *	word;		/* Word to be saved */
+     register ichar_t *	pattern;	/* Capitalization pattern */
+     int			prestrip;	/* No. chars stripped from front */
+     int			preadd;		/* No. chars added to front of root */
+     int			sufstrip;	/* No. chars stripped from back */
+     int			sufadd;		/* No. chars added to back of root */
+     struct dent *	firstdent;	/* First dent for root */
+     struct flagent *	pfxent;		/* Pfx-flag entry for word */
+     struct flagent *	sufent;		/* Sfx-flag entry for word */
+     ichar_t		savearea[MAX_CAPS][INPUTWORDLEN + MAXAFFIXLEN];
+ 					/* Room to save words */
+     int *		nsaved;		/* Number saved so far (updated) */
+     {
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     register struct dent * dent;
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+     int			firstisupper;
+     ichar_t		newword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     register ichar_t *	p;
+     int			len;
+     int			i;
+     int			limit;
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 
+     if (*nsaved >= MAX_CAPS)
+ 	return;
+     (void) icharcpy (newword, word);
+     firstisupper = myupper (pattern[0]);
+ #ifdef NO_CAPITALIZATION_SUPPORT
+     /*
+     ** Apply the old, simple-minded capitalization rules.
+     */
+     if (firstisupper)
+ 	{
+ 	if (myupper (pattern[1]))
+ 	    upcase (newword);
+ 	else
+ 	    {
+ 	    lowcase (newword);
+ 	    newword[0] = mytoupper (newword[0]);
+ 	    }
+ 	}
+     else
+ 	lowcase (newword);
+     (void) icharcpy (savearea[*nsaved], newword);
+     (*nsaved)++;
+     return;
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ #define flagsareok(dent)    \
+     ((pfxent == NULL \
+ 	||  TSTMASKBIT (dent->mask, pfxent->flagbit)) \
+       &&  (sufent == NULL \
+ 	||  TSTMASKBIT (dent->mask, sufent->flagbit)))
+ 
+     dent = firstdent;
+     if ((dent->flagfield & (CAPTYPEMASK | MOREVARIANTS)) == ALLCAPS)
+ 	{
+ 	upcase (newword);	/* Uppercase required */
+ 	(void) icharcpy (savearea[*nsaved], newword);
+ 	(*nsaved)++;
+ 	return;
+ 	}
+     for (p = pattern;  *p;  p++)
+ 	{
+ 	if (mylower (*p))
+ 	    break;
+ 	}
+     if (*p == 0)
+ 	{
+ 	upcase (newword);	/* Pattern was all caps */
+ 	(void) icharcpy (savearea[*nsaved], newword);
+ 	(*nsaved)++;
+ 	return;
+ 	}
+     for (p = pattern + 1;  *p;  p++)
+ 	{
+ 	if (myupper (*p))
+ 	    break;
+ 	}
+     if (*p == 0)
+ 	{
+ 	/*
+ 	** The pattern was all-lower or capitalized.  If that's
+ 	** legal, insert only that version.
+ 	*/
+ 	if (firstisupper)
+ 	    {
+ 	    if (captype (dent->flagfield) == CAPITALIZED
+ 	      ||  captype (dent->flagfield) == ANYCASE)
+ 		{
+ 		lowcase (newword);
+ 		newword[0] = mytoupper (newword[0]);
+ 		(void) icharcpy (savearea[*nsaved], newword);
+ 		(*nsaved)++;
+ 		return;
+ 		}
+ 	    }
+ 	else
+ 	    {
+ 	    if (captype (dent->flagfield) == ANYCASE)
+ 		{
+ 		lowcase (newword);
+ 		(void) icharcpy (savearea[*nsaved], newword);
+ 		(*nsaved)++;
+ 		return;
+ 		}
+ 	    }
+ 	while (dent->flagfield & MOREVARIANTS)
+ 	    {
+ 	    dent = dent->next;
+ 	    if (captype (dent->flagfield) == FOLLOWCASE
+ 	      ||  !flagsareok (dent))
+ 		continue;
+ 	    if (firstisupper)
+ 		{
+ 		if (captype (dent->flagfield) == CAPITALIZED)
+ 		    {
+ 		    lowcase (newword);
+ 		    newword[0] = mytoupper (newword[0]);
+ 		    (void) icharcpy (savearea[*nsaved], newword);
+ 		    (*nsaved)++;
+ 		    return;
+ 		    }
+ 		}
+ 	    else
+ 		{
+ 		if (captype (dent->flagfield) == ANYCASE)
+ 		    {
+ 		    lowcase (newword);
+ 		    (void) icharcpy (savearea[*nsaved], newword);
+ 		    (*nsaved)++;
+ 		    return;
+ 		    }
+ 		}
+ 	    }
+ 	}
+     /*
+     ** Either the sample had complex capitalization, or the simple
+     ** capitalizations (all-lower or capitalized) are illegal.
+     ** Insert all legal capitalizations, including those that are
+     ** all-lower or capitalized.  If the prototype is capitalized,
+     ** capitalized all-lower samples.  Watch out for affixes.
+     */
+     dent = firstdent;
+     p = strtosichar (dent->word, 1);
+     len = icharlen (p);
+     if (dent->flagfield & MOREVARIANTS)
+ 	dent = dent->next;	/* Skip place-holder entry */
+     for (  ;  ;  )
+ 	{
+ 	if (flagsareok (dent))
+ 	    {
+ 	    if (captype (dent->flagfield) != FOLLOWCASE)
+ 		{
+ 		lowcase (newword);
+ 		if (firstisupper  ||  captype (dent->flagfield) == CAPITALIZED)
+ 		    newword[0] = mytoupper (newword[0]);
+ 		(void) icharcpy (savearea[*nsaved], newword);
+ 		(*nsaved)++;
+ 		if (*nsaved >= MAX_CAPS)
+ 		    return;
+ 		}
+ 	    else
+ 		{
+ 		/* Followcase is the tough one. */
+ 		p = strtosichar (dent->word, 1);
+ 		(void) bcopy ((char *) (p + prestrip),
+ 		  (char *) (newword + preadd),
+ 		  (len - prestrip - sufstrip) * sizeof (ichar_t));
+ 		if (myupper (p[prestrip]))
+ 		    {
+ 		    for (i = 0;  i < preadd;  i++)
+ 			newword[i] = mytoupper (newword[i]);
+ 		    }
+ 		else
+ 		    {
+ 		    for (i = 0;  i < preadd;  i++)
+ 			newword[i] = mytolower (newword[i]);
+ 		    }
+ 		limit = len + preadd + sufadd - prestrip - sufstrip;
+ 		i = len + preadd - prestrip - sufstrip;
+ 		p += len - sufstrip - 1;
+ 		if (myupper (*p))
+ 		    {
+ 		    for (p = newword + i;  i < limit;  i++, p++)
+ 			*p = mytoupper (*p);
+ 		    }
+ 		else
+ 		    {
+ 		    for (p = newword + i;  i < limit;  i++, p++)
+ 		      *p = mytolower (*p);
+ 		    }
+ 		(void) icharcpy (savearea[*nsaved], newword);
+ 		(*nsaved)++;
+ 		if (*nsaved >= MAX_CAPS)
+ 		    return;
+ 		}
+ 	    }
+ 	if ((dent->flagfield & MOREVARIANTS) == 0)
+ 	    break;		/* End of the line */
+ 	dent = dent->next;
+ 	}
+     return;
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+     }
+ 
+ static char * getline (s)
+     register char *	s;
+     {
+     register char *	p;
+     register int	c;
+ 
+     p = s;
+ 
+     for (  ;  ;  )
+ 	{
+ 	(void) fflush (stdout);
+ 	c = (GETKEYSTROKE () & NOPARITY);
+ 	if (c == '\\')
+ 	    {
+ 	    (void) putchar ('\\');
+ 	    (void) fflush (stdout);
+ 	    c = (GETKEYSTROKE () & NOPARITY);
+ 	    backup ();
+ 	    (void) putchar (c);
+ 	    *p++ = (char) c;
+ 	    }
+ 	else if (c == ('G' & 037))
+ 	    return (NULL);
+ 	else if (c == '\n' || c == '\r')
+ 	    {
+ 	    *p = 0;
+ 	    return (s);
+ 	    }
+ 	else if (c == uerasechar)
+ 	    {
+ 	    if (p != s)
+ 		{
+ 		p--;
+ 		backup ();
+ 		(void) putchar (' ');
+ 		backup ();
+ 		}
+ 	    }
+ 	else if (c == ukillchar)
+ 	    {
+ 	    while (p != s)
+ 		{
+ 		p--;
+ 		backup ();
+ 		(void) putchar (' ');
+ 		backup ();
+ 		}
+ 	    }
+ 	else
+ 	    {
+ 	    *p++ = (char) c;
+ 	    (void) putchar (c);
+ 	    }
+ 	}
+     }
+ 
+ void askmode ()
+     {
+     int			bufsize;	/* Length of contextbufs[0] */
+     int			ch;		/* Next character read from input */
+     register char *	cp1;
+     register char *	cp2;
+     ichar_t *		itok;		/* Ichar version of current word */
+     int			hadnl;		/* NZ if \n was at end of line */
+ 
+     if (fflag)
+ 	{
+ 	if (freopen (askfilename, "w", stdout) == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, CANT_CREATE, askfilename);
+ 	    exit (1);
+ 	    }
+ 	}
+ 
+     (void) printf ("%s\n", Version_ID[0]);
+ 
+     contextoffset = 0;
+     while (1)
+ 	{
+ 	(void) fflush (stdout);
+ 	/*
+ 	 * Only read in enough characters to fill half this buffer so that any
+ 	 * corrections we make are not likely to cause an overflow.
+ 	 */
+ 	if (contextoffset == 0)
+ 	    {
+ 	    if (xgets (contextbufs[0], (sizeof contextbufs[0]) / 2, stdin)
+ 	      == NULL)
+ 		break;
+ 	    }
+ 	else
+ 	    {
+ 	    if (fgets (contextbufs[0], (sizeof contextbufs[0]) / 2, stdin)
+ 	      == NULL)
+ 		break;
+ 	    }
+ 	/*
+ 	 * If we didn't read to end-of-line, we may have ended the
+ 	 * buffer in the middle of a word.  So keep reading until we
+ 	 * see some sort of character that can't possibly be part of a
+ 	 * word. (or until the buffer is full, which fortunately isn't
+ 	 * all that likely).
+ 	 */
+ 	bufsize = strlen (contextbufs[0]);
+ 	if (contextbufs[0][bufsize - 1] == '\n')
+ 	    {
+ 	    hadnl = 1;
+ 	    contextbufs[0][--bufsize] = '\0';
+ 	    }
+ 	else
+ 	    hadnl = 0;
+ 	if (bufsize == (sizeof contextbufs[0]) / 2 - 1)
+ 	    {
+ 	    ch = (unsigned char) contextbufs[0][bufsize - 1];
+ 	    while (bufsize < sizeof contextbufs[0] - 1
+ 	      &&  (iswordch ((ichar_t) ch)  ||  isboundarych ((ichar_t) ch)
+ 	      ||  isstringstart (ch)))
+ 		{
+ 		ch = getc (stdin);
+ 		if (ch == EOF)
+ 		    break;
+ 		contextbufs[0][bufsize++] = (char) ch;
+ 		contextbufs[0][bufsize] = '\0';
+ 		}
+ 	    }
+ 	/*
+ 	** *line is like `i', @line is like `a', &line is like 'u'
+ 	** `#' is like `Q' (writes personal dictionary)
+ 	** `+' sets tflag, `-' clears tflag
+ 	** `!' sets terse mode, `%' clears terse
+ 	** `~' followed by a filename sets parameters according to file name
+ 	** `^' causes rest of line to be checked after stripping 1st char
+ 	*/
+ 	if (contextoffset != 0)
+ 	    checkline (stdout);
+ 	else
+ 	    {
+ 	    if (contextbufs[0][0] == '*'  ||  contextbufs[0][0] == '@')
+ 		treeinsert(ichartosstr (strtosichar (contextbufs[0] + 1, 0), 1),
+ 		  ICHARTOSSTR_SIZE,
+ 		  contextbufs[0][0] == '*');
+ 	    else if (contextbufs[0][0] == '&')
+ 		{
+ 		itok = strtosichar (contextbufs[0] + 1, 0);
+ 		lowcase (itok);
+ 		treeinsert (ichartosstr (itok, 1), ICHARTOSSTR_SIZE, 1);
+ 		}
+ 	    else if (contextbufs[0][0] == '#')
+ 		{
+ 		treeoutput ();
+ 		math_mode = 0;
+ 		LaTeX_Mode = 'P';
+ 		}
+ 	    else if (contextbufs[0][0] == '!')
+ 		terse = 1;
+ 	    else if (contextbufs[0][0] == '%')
+ 		terse = 0;
+ 	    else if (contextbufs[0][0] == '-')
+ 		{
+ 		math_mode = 0;
+ 		LaTeX_Mode = 'P';
+ 		tflag = 0;
+ 		}
+ 	    else if (contextbufs[0][0] == '+')
+ 		{
+ 		math_mode = 0;
+ 		LaTeX_Mode = 'P';
+ 		tflag = strcmp (&contextbufs[0][1], "nroff") != 0
+ 		  &&  strcmp (&contextbufs[0][1], "troff") != 0;
+ 		}
+ 	    else if (contextbufs[0][0] == '~')
+ 		{
+ 		defdupchar = findfiletype (&contextbufs[0][1], 1, (int *) NULL);
+ 		if (defdupchar < 0)
+ 		    defdupchar = 0;
+ 		}
+ 	    else
+ 		{
+ 		if (contextbufs[0][0] == '^')
+ 		    {
+ 		    /* Strip off leading uparrow */
+ 		    for (cp1 = contextbufs[0], cp2 = contextbufs[0] + 1;
+ 		      (*cp1++ = *cp2++) != '\0';
+ 		      )
+ 			;
+ 		    contextoffset++;
+ 		    bufsize--;
+ 		    }
+ 		checkline (stdout);
+ 		}
+ 	    }
+ 	if (hadnl)
+ 	    contextoffset = 0;
+ 	else
+ 	    contextoffset += bufsize;
+ #ifndef USG
+ 	if (sflag)
+ 	    {
+ 	    stop ();
+ 	    if (fflag)
+ 		{
+ 		rewind (stdout);
+ 		(void) creat (askfilename, 0666);
+ 		}
+ 	    }
+ #endif
+ 	}
+     }
+ 
+ /* Copy/ignore "cnt" number of characters pointed to by *cc. */
+ void copyout (cc, cnt)
+     register char **	cc;
+     register int	cnt;
+     {
+ 
+     while (--cnt >= 0)
+ 	{
+ 	if (**cc == '\0')
+ 	    break;
+ 	if (!aflag && !lflag)
+ 	    (void) putc (**cc, outfile);
+ 	(*cc)++;
+ 	}
+     }
+ 
+ static void lookharder (string)
+     char *		string;
+     {
+     char		cmd[150];
+     char		grepstr[100];
+     register char *	g;
+     register char *	s;
+ #ifndef REGEX_LOOKUP
+     register int	wild = 0;
+ #ifdef LOOK
+     static int		look = -1;
+ #endif /* LOOK */
+ #endif /* REGEX_LOOKUP */
+ 
+     g = grepstr;
+     for (s = string; *s != '\0'; s++)
+ 	{
+ 	if (*s == '*')
+ 	    {
+ #ifndef REGEX_LOOKUP
+ 	    wild++;
+ #endif /* REGEX_LOOKUP */
+ 	    *g++ = '.';
+ 	    *g++ = '*';
+ 	    }
+ 	else
+ 	    *g++ = *s;
+ 	}
+     *g = '\0';
+     if (grepstr[0])
+ 	{
+ #ifdef REGEX_LOOKUP
+ 	regex_dict_lookup (cmd, grepstr);
+ #else /* REGEX_LOOKUP */
+ #ifdef LOOK
+ 	/* now supports automatic use of look - gms */
+ 	if (!wild && look)
+ 	    {
+ 	    /* no wild and look(1) is possibly available */
+ 	    (void) sprintf (cmd, "%s %s %s", LOOK, grepstr, WORDS);
+ 	    if (shellescape (cmd))
+ 		return;
+ 	    else
+ 		look = 0;
+ 	    }
+ #endif /* LOOK */
+ 	/* string has wild card chars or look not avail */
+ 	if (!wild)
+ 	    (void) strcat (grepstr, ".*");	/* work like look */
+ 	(void) sprintf (cmd, "%s ^%s$ %s", EGREPCMD, grepstr, WORDS);
+ 	(void) shellescape (cmd);
+ #endif /* REGEX_LOOKUP */
+ 	}
+     }
+ 
+ #ifdef REGEX_LOOKUP
+ static void regex_dict_lookup (cmd, grepstr)
+     char *		cmd;
+     char *		grepstr;
+     {
+     char *		rval;
+     int			whence = 0;
+     int			quitlookup = 0;
+     int			count = 0;
+     int			ch;
+ 
+     (void) sprintf (cmd, "^%s$", grepstr);
+     while (!quitlookup  &&  (rval = do_regex_lookup (cmd, whence)) != NULL)
+ 	{
+ 	whence = 1;
+         (void) printf ("%s\r\n", rval);;
+ 	if ((++count % (li - 1)) == 0)
+ 	    {
+ 	    inverse ();
+ 	    (void) printf (CORR_C_MORE_PROMPT);
+ 	    normal ();
+ 	    (void) fflush (stdout);
+ 	    if ((ch = GETKEYSTROKE ()) == 'q'
+ 	      ||  ch == 'Q'  ||  ch == 'x'  ||  ch == 'X' )
+ 	         quitlookup = 1;
+ 	    /*
+ 	     * The following line should blank out the -- more -- even on
+ 	     * magic-cookie terminals.
+ 	     */
+ 	    (void) printf (CORR_C_BLANK_MORE);
+ 	    (void) fflush (stdout);
+ 	    }
+ 	}
+     if ( rval == NULL )
+ 	{
+ 	inverse ();
+ 	(void) printf (CORR_C_END_LOOK);
+ 	normal ();
+ 	(void) fflush (stdout);
+ 	(void) GETKEYSTROKE ();    
+ 	}
+     }
+ 
+ #endif /* REGEX_LOOKUP */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/defmt.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/defmt.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/defmt.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,907 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: defmt.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * defmt.c - Handle formatter constructs, mostly by scanning over them.
+  *
+  * This code originally resided in ispell.c, but was moved here to keep
+  * file sizes smaller.
+  *
+  * Copyright (c), 1983, by Pace Willisson
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  *
+  * The TeX code is originally by Greg Schaffer, with many improvements from
+  * Ken Stevens.  The nroff code is primarily from Pace Willisson, although
+  * other people have improved it.
+  */
+ 
+ /*
+  * $Log: defmt.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:50  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.41  1995/08/05  23:19:47  geoff
+  * Get rid of an obsolete comment.  Add recognition of documentclass and
+  * usepackage for Latex2e support.
+  *
+  * Revision 1.40  1995/03/06  02:42:43  geoff
+  * Change TeX backslash processing so that it only assumes alpha
+  * characters and the commonly-used "@" character are part of macro
+  * names, and so that any other backslashed character (specifically
+  * dollar signs) is skipped.
+  *
+  * Revision 1.39  1995/01/08  23:23:54  geoff
+  * Fix typos in a couple of comments.
+  *
+  * Revision 1.38  1995/01/03  19:24:14  geoff
+  * Add code to handle the LaTeX \verb command.
+  *
+  * Revision 1.37  1994/12/27  23:08:54  geoff
+  * Fix a bug in TeX backslash processing that caused ispell to become
+  * confused when it encountered an optional argument to a
+  * double-backslash command.  Be a little smarter about scanning for
+  * curly-brace matches, so that we avoid missing a math-mode transition
+  * during the scan.
+  *
+  * Revision 1.36  1994/10/25  05:46:34  geoff
+  * Recognize a few more Latex commands: pagestyle, pagenumbering,
+  * setcounter, addtocounter, setlength, addtolength, settowidth.
+  *
+  * Revision 1.35  1994/10/18  04:03:19  geoff
+  * Add code to skip hex numbers if they're preceded by '0x'.
+  *
+  * Revision 1.34  1994/10/04  03:51:24  geoff
+  * Modify the parsing so that TeX commands are ignored even within
+  * comments, but do not affect the overall parsing state.  (This is
+  * slightly imperfect, in that some types of modality are ignored when
+  * comments are entered.  But it should solve nearly all the problems
+  * with commented-out TeX commands.)  This also fixes a couple of minor
+  * bugs with TeX deformatting.
+  *
+  * Revision 1.33  1994/10/03  17:06:07  geoff
+  * Remember to use contextoffset when reporting complete misses
+  *
+  * Revision 1.32  1994/08/31  05:58:41  geoff
+  * Report the offset-within-line correctly in -a mode even if the line is
+  * longer than BUFSIZ characters.
+  *
+  * Revision 1.31  1994/05/25  04:29:28  geoff
+  * If two boundary characters appear in a row, consider it the end of the
+  * word.
+  *
+  * Revision 1.30  1994/05/17  06:44:08  geoff
+  * Add the new argument to all calls to good and compoundgood.
+  *
+  * Revision 1.29  1994/03/16  06:30:41  geoff
+  * Don't lose track of math mode when an array environment is embedded.
+  *
+  * Revision 1.28  1994/03/15  05:31:57  geoff
+  * Add TeX_strncmp, which allows us to handle AMS-TeX constructs like
+  * \endroster without getting confused.
+  *
+  * Revision 1.27  1994/02/14  00:34:53  geoff
+  * Pass length arguments to correct().
+  *
+  * Revision 1.26  1994/01/25  07:11:25  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include <ctype.h>
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ 
+ static char *	skiptoword P ((char * bufp));
+ char *		skipoverword P ((char * bufp));
+ void		checkline P ((FILE * ofile));
+ static int	TeX_math_end P ((char ** bufp));
+ static int	TeX_math_begin P ((char ** bufp));
+ static int	TeX_LR_begin P ((char ** bufp));
+ static int	TeX_LR_check P ((int begin_p, char ** bufp));
+ static void	TeX_skip_args P ((char ** bufp));
+ static int	TeX_math_check P ((int cont_char, char ** bufp));
+ static void	TeX_skip_parens P ((char ** bufp));
+ static void	TeX_open_paren P ((char ** bufp));
+ static void	TeX_skip_check P ((char ** bufp));
+ static int	TeX_strncmp P ((char * a, char * b, int n));
+ 
+ #define ISTEXTERM(c)   (((c) == TEXLEFTCURLY) || \
+ 			((c) == TEXRIGHTCURLY) || \
+ 			((c) == TEXLEFTSQUARE) || \
+ 			((c) == TEXRIGHTSQUARE))
+ #define ISMATHCH(c)    (((c) == TEXBACKSLASH) || \
+ 			((c) == TEXDOLLAR) || \
+ 			((c) == TEXPERCENT))
+ 
+ static int	    TeX_comment = 0;
+ 
+ /*
+  * The following variables are used to save the parsing state when
+  * processing comments.  This allows comments to be parsed without
+  * affecting the overall nesting.
+  */
+ 
+ static int save_math_mode;
+ static char save_LaTeX_Mode;
+ 
+ static char * skiptoword (bufp)		/* Skip to beginning of a word */
+     char *	bufp;
+     {
+ 
+     while (*bufp
+       &&  ((!isstringch (bufp, 0)  &&  !iswordch (chartoichar (*bufp)))
+ 	||  isboundarych (chartoichar (*bufp))
+ 	||  (tflag  &&  (math_mode & 1)))
+       )
+ 	{
+ 	/* check paren necessity... */
+ 	if (tflag) /* TeX or LaTeX stuff */
+ 	    {
+ 	    /* Odd numbers mean we are in "math mode" */
+ 	    /* Even numbers mean we are in LR or */
+ 	    /* paragraph mode */
+ 	    if (*bufp == TEXPERCENT)
+ 		{
+ 		if (!TeX_comment)
+ 		    {
+ 		    save_math_mode = math_mode;
+ 		    save_LaTeX_Mode = LaTeX_Mode;
+ 		    math_mode = 0;
+ 		    LaTeX_Mode = 'P';
+ 		    TeX_comment = 1;
+ 		    }
+ 		}
+ 	    else if (math_mode & 1)
+ 		{
+ 		if ((LaTeX_Mode == 'e'  &&  TeX_math_check('e', &bufp))
+ 		  || (LaTeX_Mode == 'm'  &&  TeX_LR_check(1, &bufp)))
+ 		    math_mode--;    /* end math mode */
+ 		else
+ 		    {
+ 		    while (*bufp  && !ISMATHCH(*bufp))
+ 			bufp++;
+ 		    if (*bufp == 0)
+ 			break;
+ 		    if (TeX_math_end(&bufp))
+ 			math_mode--;
+ 		    }
+ 		if (math_mode < 0)
+ 		    {
+ 		    (void) fprintf (stderr,
+ 		     DEFMT_C_TEX_MATH_ERROR);
+ 		    math_mode = 0;
+ 		    }
+ 		}
+ 	    else
+ 		{
+ 		if (math_mode > 1
+ 		  &&  *bufp == TEXRIGHTCURLY
+ 		  &&  (math_mode < (math_mode & 127) * 128))
+ 		    math_mode--;    /* re-enter math */
+ 		else if (LaTeX_Mode == 'm'
+ 		    || (math_mode && (math_mode >= (math_mode & 127) * 128)
+ 		  &&  (TeX_strncmp(bufp, "\\end", 4)
+ 		    == 0)))
+ 		    {
+ 		    if (TeX_LR_check(0, &bufp))
+ 			math_mode--;
+ 		    }
+ 		else if (LaTeX_Mode == 'b'  &&  TeX_math_check('b', &bufp))
+ 		    {
+ 		    /* continued begin */
+ 		    math_mode++;
+ 		    }
+ 		else if (LaTeX_Mode == 'r')
+ 		    {
+ 		    /* continued "reference" */
+ 		    TeX_skip_parens(&bufp);
+ 		    LaTeX_Mode = 'P';
+ 		    }
+ 		else if (TeX_math_begin(&bufp))
+ 		    /* checks references and */
+ 		    /* skips \ commands */
+ 		    math_mode++;
+ 		}
+ 	    if (*bufp == 0)
+ 		break;
+ 	    }
+ 	else			/* formatting escape sequences */
+ 	    {
+ 	    if (*bufp == NRBACKSLASH)
+ 		{
+ 		switch ( bufp[1] )
+ 		    {
+ 		    case 'f':
+ 			if(bufp[2] == NRLEFTPAREN)
+ 			    {
+ 			    /* font change: \f(XY */
+ 			    bufp += 5;
+ 			    }
+ 			else
+ 			    {
+ 			    /* ) */
+ 			    /* font change: \fX */
+ 			    bufp += 3;
+ 			    }
+ 			continue;
+ 		    case 's':
+ 			/* size change */
+ 			bufp += 2;
+ 			if (*bufp == '+'  ||  *bufp == '-')
+ 			    bufp++;
+ 			/* This looks wierd 'cause we
+ 			** assume *bufp is now a digit.
+ 			*/
+ 			bufp++;
+ 			if (isdigit (*bufp))
+ 			    bufp++;
+ 			continue;
+ 		    default:
+ 			if (bufp[1] == NRLEFTPAREN)
+ 			    {
+ 			    /* extended char set */
+ 			    /* escape:  \(XX */
+ 			    /* ) */
+ 			    bufp += 4;
+ 			    continue;
+ 			    }
+ 			else if (bufp[1] == NRSTAR)
+ 			    {
+ 			    if (bufp[2] == NRLEFTPAREN)
+ 				bufp += 5;
+ 			    else
+ 				bufp += 3;
+ 			    continue;
+ 			    }
+ 			break;
+ 		    }
+ 		}
+ 	    }
+ 	/*
+ 	 * Skip hex numbers, but not if we're in non-terse askmode.
+ 	 * (In that case, we'd lose sync if we skipped hex.)
+ 	 */
+ 	if (*bufp == '0'
+ 	  &&  (bufp[1] == 'x'  ||  bufp[1] == 'X')
+ 	  &&  (terse  ||  !aflag))
+ 	    {
+ 	    bufp += 2;
+ 	    while (isxdigit (*bufp))
+ 		bufp++;
+ 	    }
+ 	else
+ 	    bufp++;
+ 	}
+     if (*bufp == '\0')
+ 	{
+ 	if (TeX_comment)
+ 	    {
+ 	    math_mode = save_math_mode;
+ 	    LaTeX_Mode = save_LaTeX_Mode;
+ 	    TeX_comment = 0;
+ 	    }
+ 	}
+     return bufp;
+     }
+ 
+ char * skipoverword (bufp)	/* Return pointer to end of a word */
+     register char *	bufp;	/* Start of word -- MUST BE A REAL START */
+     {
+     register char *	lastboundary;
+     register int	scharlen; /* Length of a string character */
+ 
+     lastboundary = NULL;
+     for (  ;  ;  )
+ 	{
+ 	if (*bufp == '\0')
+ 	    {
+ 	    if (TeX_comment)
+ 		{
+ 		math_mode = save_math_mode;
+ 		LaTeX_Mode = save_LaTeX_Mode;
+ 		TeX_comment = 0;
+ 		}
+ 	    break;
+ 	    }
+ 	else if (l_isstringch(bufp, scharlen, 0))
+ 	    {
+ 	    bufp += scharlen;
+ 	    lastboundary = NULL;
+ 	    }
+ 	/*
+ 	** Note that we get here if a character satisfies
+ 	** isstringstart() but isn't in the string table;  this
+ 	** allows string characters to start with word characters.
+ 	*/
+ 	else if (iswordch (chartoichar (*bufp)))
+ 	    {
+ 	    bufp++;
+ 	    lastboundary = NULL;
+ 	    }
+ 	else if (isboundarych (chartoichar (*bufp)))
+ 	    {
+ 	    if (lastboundary == NULL)
+ 		lastboundary = bufp;
+ 	    else if (lastboundary == bufp - 1)
+ 		break;			/* Double boundary -- end of word */
+ 	    bufp++;
+ 	    }
+ 	else
+ 	    break;			/* End of the word */
+ 	}
+     /*
+     ** If the word ended in one or more boundary characters, 
+     ** the address of the first of these is in lastboundary, and it
+     ** is the end of the word.  Otherwise, bufp is the end.
+     */
+     return (lastboundary != NULL) ? lastboundary : bufp;
+     }
+ 
+ void checkline (ofile)
+     FILE *		ofile;
+     {
+     register char *	p;
+     register char *	endp;
+     int			hadlf;
+     register int	len;
+     register int	i;
+     int			ilen;
+ 
+     currentchar = contextbufs[0];
+     len = strlen (contextbufs[0]) - 1;
+     hadlf = contextbufs[0][len] == '\n';
+     if (hadlf)
+ 	contextbufs[0][len] = 0;
+ 
+     if (!tflag)
+ 	{
+ 	/* skip over .if */
+ 	if (*currentchar == NRDOT
+ 	  &&  (strncmp (currentchar + 1, "if t", 4) == 0
+ 	    ||  strncmp (currentchar + 1, "if n", 4) == 0))
+ 	    {
+ 	    copyout (&currentchar,5);
+ 	    while (*currentchar
+ 	      &&  myspace (chartoichar (*currentchar)))
+ 		copyout (&currentchar, 1);
+ 	    }
+ 
+ 	/* skip over .ds XX or .nr XX */
+ 	if (*currentchar == NRDOT
+ 	  &&  (strncmp (currentchar + 1, "ds ", 3) == 0 
+ 	    ||  strncmp (currentchar + 1, "de ", 3) == 0
+ 	    ||  strncmp (currentchar + 1, "nr ", 3) == 0))
+ 	    {
+ 	    copyout (&currentchar, 4);
+ 	    while (*currentchar
+ 	      &&  myspace (chartoichar (*currentchar)))
+ 		copyout(&currentchar, 1);
+ 	    while (*currentchar
+ 	      &&  !myspace (chartoichar (*currentchar)))
+ 		copyout(&currentchar, 1);
+ 	    if (*currentchar == 0)
+ 		{
+ 		if (!lflag  &&  (aflag  ||  hadlf))
+ 		    (void) putc ('\n', ofile);
+ 		return;
+ 		}
+ 	    }
+ 	}
+ 
+ 
+     /* if this is a formatter command, skip over it */
+     if (!tflag && *currentchar == NRDOT)
+ 	{
+ 	while (*currentchar  &&  !myspace (chartoichar (*currentchar)))
+ 	    {
+ 	    if (!aflag && !lflag)
+ 		(void) putc (*currentchar, ofile);
+ 	    currentchar++;
+ 	    }
+ 	if (*currentchar == 0)
+ 	    {
+ 	    if (!lflag  &&  (aflag  ||  hadlf))
+ 		(void) putc ('\n', ofile);
+ 	    return;
+ 	    }
+ 	}
+ 
+     for (  ;  ;  )
+ 	{
+ 	p = skiptoword (currentchar);
+ 	if (p != currentchar)
+ 	    copyout (&currentchar, p - currentchar);
+ 
+ 	if (*currentchar == 0)
+ 	    break;
+ 
+ 	p = ctoken;
+ 	endp = skipoverword (currentchar);
+ 	while (currentchar < endp  &&  p < ctoken + sizeof ctoken - 1)
+ 	    *p++ = *currentchar++;
+ 	*p = 0;
+ 	if (strtoichar (itoken, ctoken, INPUTWORDLEN * sizeof (ichar_t), 0))
+ 	    (void) fprintf (stderr, WORD_TOO_LONG (ctoken));
+ 	ilen = icharlen (itoken);
+ 
+ 	if (lflag)
+ 	    {
+ 	    if (ilen > minword
+ 	      &&  !good (itoken, 0, 0, 0, 0)
+ 	      &&  !cflag  &&  !compoundgood (itoken, 0))
+ 		(void) fprintf (ofile, "%s\n", ctoken);
+ 	    }
+ 	else
+ 	    {
+ 	    if (aflag)
+ 		{
+ 		if (ilen <= minword)
+ 		    {
+ 		    /* matched because of minword */
+ 		    if (!terse)
+ 			(void) fprintf (ofile, "*\n");
+ 		    continue;
+ 		    }
+ 		if (good (itoken, 0, 0, 0, 0))
+ 		    {
+ 		    if (hits[0].prefix == NULL
+ 		      &&  hits[0].suffix == NULL)
+ 			{
+ 			/* perfect match */
+ 			if (!terse)
+ 			    (void) fprintf (ofile, "*\n");
+ 			}
+ 		    else if (!terse)
+ 			{
+ 			/* matched because of root */
+ 			(void) fprintf (ofile, "+ %s\n",
+ 			  hits[0].dictent->word);
+ 			}
+ 		    }
+ 		else if (compoundgood (itoken, 0))
+ 		    {
+ 		    /* compound-word match */
+ 		    if (!terse)
+ 			(void) fprintf (ofile, "-\n");
+ 		    }
+ 		else
+ 		    {
+ 		    makepossibilities (itoken);
+ 		    if (pcount)
+ 			{
+ 			/*
+ 			** print &  or ?, ctoken, then
+ 			** character offset, possibility
+ 			** count, and the possibilities.
+ 			*/
+ 			(void) fprintf (ofile, "%c %s %d %d",
+ 			  easypossibilities ? '&' : '?',
+ 			  ctoken,
+ 			  easypossibilities,
+ 			  (int) ((currentchar - contextbufs[0])
+ 			    - strlen (ctoken)) + contextoffset);
+ 			for (i = 0;  i < MAXPOSSIBLE;  i++)
+ 			    {
+ 			    if (possibilities[i][0] == 0)
+ 				break;
+ 			    (void) fprintf (ofile, "%c %s",
+ 			      i ? ',' : ':', possibilities[i]);
+ 			    }
+ 			(void) fprintf (ofile, "\n");
+ 			}
+ 		    else
+ 			{
+ 			/*
+ 			** No possibilities found for word TOKEN
+ 			*/
+ 			(void) fprintf (ofile, "# %s %d\n",
+ 			  ctoken,
+ 			  (int) ((currentchar - contextbufs[0])
+ 			    - strlen (ctoken)) + contextoffset);
+ 			}
+ 		    }
+ 		}
+ 	    else
+ 		{
+ 		if (!quit)
+ 		   correct (ctoken, sizeof ctoken, itoken, sizeof itoken,
+ 		     &currentchar);
+ 		}
+ 	    }
+ 	if (!aflag  &&  !lflag)
+ 	   (void) fprintf (ofile, "%s", ctoken);
+ 	}
+ 
+     if (!lflag  &&  (aflag  ||  hadlf))
+        (void) putc ('\n', ofile);
+    }
+ 
+ /* must check for \begin{mbox} or whatever makes new text region. */
+ static int TeX_math_end (bufp)
+     char **	bufp;
+     {
+ 
+     if (**bufp == TEXDOLLAR)
+ 	{
+ 	if ((*bufp)[1] == TEXDOLLAR)
+ 	    (*bufp)++;
+ 	return 1;
+ 	}
+     else if (**bufp == TEXPERCENT)
+ 	{
+ 	if (!TeX_comment)
+ 	    {
+ 	    save_math_mode = math_mode;
+ 	    save_LaTeX_Mode = LaTeX_Mode;
+ 	    math_mode = 0;
+ 	    LaTeX_Mode = 'P';
+ 	    TeX_comment = 1;
+ 	    }
+ 	return 0;
+ 	}
+     /* processing extended TeX command */
+     (*bufp)++;
+     if (**bufp == TEXRIGHTPAREN  ||  **bufp == TEXRIGHTSQUARE)
+ 	return 1;
+     if (TeX_LR_begin (bufp))	/* check for switch back to LR mode */
+ 	return 1;
+     if (TeX_strncmp (*bufp, "end", 3) == 0)
+ 	/* find environment that is ending */
+ 	return TeX_math_check ('e', bufp);
+     else
+ 	return 0;
+     }
+ 
+ static int TeX_math_begin (bufp)
+     char **	bufp;
+     {
+ 
+     if (**bufp == TEXDOLLAR)
+ 	{
+ 	if ((*bufp)[1] == TEXDOLLAR)
+ 	    (*bufp)++;
+ 	return 1;
+ 	}
+     while (**bufp == TEXBACKSLASH)
+ 	{
+ 	(*bufp)++; /* check for null char here? */
+ 	if (**bufp == TEXLEFTPAREN  ||  **bufp == TEXLEFTSQUARE)
+ 	    return 1;
+ 	else if (!isalpha(**bufp)  &&  **bufp != '@')
+ 	    {
+ 	    (*bufp)++;
+ 	    continue;
+ 	    }
+ 	else if (TeX_strncmp (*bufp, "begin", 5) == 0)
+ 	    {
+ 	    if (TeX_math_check ('b', bufp))
+ 		return 1;
+ 	    else
+ 		(*bufp)--;
+ 	    }
+ 	else
+ 	    {
+ 	    TeX_skip_check (bufp);
+ 	    return 0;
+ 	    }
+ 	}
+       /*
+        * Ignore references for the tib (1) bibliography system, that
+        * is, text between a ``[.'' or ``<.'' and ``.]'' or ``.>''.
+        * We don't care whether they match, tib doesn't care either.
+        *
+        * A limitation is that the entire tib reference must be on one
+        * line, or we break down and check the remainder anyway.
+        */ 
+     if ((**bufp == TEXLEFTSQUARE  ||  **bufp == TEXLEFTANGLE)
+       &&  (*bufp)[1] == TEXDOT)
+ 	{
+ 	(*bufp)++;
+ 	while (**bufp)
+ 	    {
+ 	    if (*(*bufp)++ == TEXDOT
+ 	      &&  (**bufp == TEXRIGHTSQUARE  ||  **bufp == TEXRIGHTANGLE))
+ 		return TeX_math_begin (bufp);
+ 	    }
+ 	return 0;
+ 	}
+     else
+ 	return 0;
+     }
+ 
+ static int TeX_LR_begin (bufp)
+     char **	bufp;
+     {
+ 
+     if ((TeX_strncmp (*bufp, "mbox", 4) == 0)
+       ||  (TeX_strncmp (*bufp, "makebox", 7) == 0)
+       ||  (TeX_strncmp (*bufp, "fbox", 4) == 0)
+       || (TeX_strncmp (*bufp, "framebox", 8) == 0))
+ 	math_mode += 2;
+     else if ((TeX_strncmp(*bufp, "parbox", 6) == 0)
+       || (TeX_strncmp(*bufp, "raisebox", 8) == 0))
+ 	{
+ 	math_mode += 2;
+ 	TeX_open_paren (bufp);
+ 	if (**bufp)
+ 	    (*bufp)++;
+ 	else
+ 	    LaTeX_Mode = 'r'; /* same as reference -- skip {} */
+ 	}
+     else if (TeX_strncmp(*bufp, "begin", 5) == 0)
+ 	return TeX_LR_check (1, bufp);	/* minipage */
+     else
+ 	return 0;
+ 
+     /* skip tex command name and optional or width arguments. */
+     TeX_open_paren (bufp);
+     return 1;
+     }
+ 
+ static int TeX_LR_check (begin_p, bufp)
+     int		begin_p;
+     char **	bufp;
+     {
+ 
+     TeX_open_paren (bufp);
+     if (**bufp == 0)	/* { */
+ 	{
+ 	LaTeX_Mode = 'm';
+ 	return 0;	/* remain in math mode until '}' encountered. */
+ 	}
+     else
+ 	LaTeX_Mode = 'P';
+     if (strncmp (++(*bufp), "minipage", 8) == 0)
+ 	{
+ 	TeX_skip_parens (bufp);
+ 	if (**bufp)
+ 	    (*bufp)++;
+ 	if (begin_p)
+ 	    {
+ 	    TeX_skip_parens (bufp); /* now skip opt. args if on this line. */
+ 	    math_mode += 2;
+ 	    /* indicate minipage mode. */
+ 	    math_mode += ((math_mode & 127) - 1) * 128;
+ 	    }
+ 	else
+ 	    {
+ 	    math_mode -= (math_mode & 127) * 128;
+ 	    if (math_mode < 0)
+ 		{
+ 		(void) fprintf (stderr, DEFMT_C_LR_MATH_ERROR);
+ 		math_mode = 1;
+ 		}
+ 	    }
+ 	return 1;
+ 	}
+     (*bufp)--;
+     return 0;
+     }
+ 
+ /* Skips the begin{ARG}, and optionally up to two {PARAM}{PARAM}'s to
+  *  the begin if they are required.  However, Only skips if on this line.
+  */
+ static void TeX_skip_args (bufp)
+     char **	bufp;
+     {
+     register int skip_cnt = 0; /* Max of 2. */
+ 
+     if (strncmp(*bufp, "tabular", 7) == 0
+       ||  strncmp(*bufp, "minipage", 8) == 0)
+ 	skip_cnt++;
+     if (strncmp(*bufp, "tabular*", 8) == 0)
+ 	skip_cnt++;
+     TeX_skip_parens (bufp);	/* Skip to the end of the \begin{} parens */
+     if (**bufp)
+ 	(*bufp)++;
+     else
+ 	return;
+     if (skip_cnt--)
+ 	TeX_skip_parens (bufp);	/* skip 1st {PARAM}. */
+     else
+ 	return;
+     if (**bufp)
+ 	(*bufp)++;
+     else
+ 	return;
+     if (skip_cnt)
+ 	TeX_skip_parens (bufp);	/* skip to end of 2nd {PARAM}. */
+     }
+ 
+ static int TeX_math_check (cont_char, bufp)
+     int		cont_char;
+     char **	bufp;
+     {
+ 
+     TeX_open_paren (bufp);
+     /* Check for end of line, continue later. */
+     if (**bufp == 0)
+ 	{
+ 	LaTeX_Mode = (char) cont_char;
+ 	return 0;
+ 	}
+     else
+ 	LaTeX_Mode = 'P';
+ 
+     if (strncmp (++(*bufp), "equation", 8) == 0
+       ||  strncmp (*bufp, "eqnarray", 8) == 0
+       ||  strncmp (*bufp, "displaymath", 11) == 0
+       ||  strncmp (*bufp, "picture", 7) == 0
+ #ifdef IGNOREBIB
+       ||  strncmp (*bufp, "thebibliography", 15) == 0
+ #endif
+       ||  strncmp (*bufp, "math", 4) == 0)
+ 	{
+ 	(*bufp)--;
+ 	TeX_skip_parens (bufp);
+ 	return 1;
+ 	}
+     if (cont_char == 'b')
+ 	TeX_skip_args (bufp);
+     else
+ 	TeX_skip_parens (bufp);
+     return 0;
+     }
+ 
+ static void TeX_skip_parens (bufp)
+     char **	bufp;
+     {
+ 
+     while (**bufp  &&  **bufp != TEXRIGHTCURLY  &&  **bufp != TEXDOLLAR)
+ 	(*bufp)++;
+     }
+ 
+ static void TeX_open_paren (bufp)
+     char **	bufp;
+     {
+     while (**bufp  &&  **bufp != TEXLEFTCURLY  &&  **bufp != TEXDOLLAR)
+ 	(*bufp)++;
+     }
+ 
+ static void TeX_skip_check (bufp)
+     char **	bufp;
+     {
+     int		skip_ch;
+ 
+     if (TeX_strncmp(*bufp, "end", 3) == 0
+       ||  TeX_strncmp(*bufp, "vspace", 6) == 0
+       ||  TeX_strncmp(*bufp, "hspace", 6) == 0
+       ||  TeX_strncmp(*bufp, "cite", 4) == 0
+       ||  TeX_strncmp(*bufp, "ref", 3) == 0
+       ||  TeX_strncmp(*bufp, "parbox", 6) == 0
+       ||  TeX_strncmp(*bufp, "label", 5) == 0
+       ||  TeX_strncmp(*bufp, "input", 5) == 0
+       ||  TeX_strncmp(*bufp, "nocite", 6) == 0
+       ||  TeX_strncmp(*bufp, "include", 7) == 0
+       ||  TeX_strncmp(*bufp, "includeonly", 11) == 0
+       ||  TeX_strncmp(*bufp, "documentstyle", 13) == 0
+       ||  TeX_strncmp(*bufp, "documentclass", 13) == 0
+       ||  TeX_strncmp(*bufp, "usepackage", 10) == 0
+       ||  TeX_strncmp(*bufp, "pagestyle", 9) == 0
+       ||  TeX_strncmp(*bufp, "pagenumbering", 13) == 0
+ #ifndef IGNOREBIB
+       ||  TeX_strncmp(*bufp, "bibliography", 12) == 0
+       ||  TeX_strncmp(*bufp, "bibitem", 7) == 0
+ #endif
+       ||  TeX_strncmp(*bufp, "hyphenation", 11) == 0
+       ||  TeX_strncmp(*bufp, "pageref", 7) == 0)
+ 	{
+ 	TeX_skip_parens (bufp);
+ 	if (**bufp == 0)
+ 	    LaTeX_Mode = 'r';
+ 	}
+     else if (TeX_strncmp(*bufp, "rule", 4) == 0		/* skip two args. */
+       ||  TeX_strncmp(*bufp, "setcounter", 10) == 0
+       ||  TeX_strncmp(*bufp, "addtocounter", 12) == 0
+       ||  TeX_strncmp(*bufp, "setlength", 9) == 0
+       ||  TeX_strncmp(*bufp, "addtolength", 11) == 0
+       ||  TeX_strncmp(*bufp, "settowidth", 10) == 0)
+ 	{
+ 	TeX_skip_parens (bufp);
+ 	if (**bufp == 0)	/* Only skips one {} if not on same line. */
+ 	    LaTeX_Mode = 'r';
+ 	else			/* Skip second arg. */
+ 	    {
+ 	    (*bufp)++;
+ 	    TeX_skip_parens (bufp);
+ 	    if (**bufp == 0)
+ 		LaTeX_Mode = 'r';
+ 	    }
+ 	}
+     else if (TeX_strncmp (*bufp, "verb", 4) == 0)
+ 	{
+ 	skip_ch = (*bufp)[4];
+ 	*bufp += 5;
+ 	while (**bufp != skip_ch  &&  **bufp != '\0')
+ 	    (*bufp)++;
+ 	}
+     else
+ 	{
+ 	/* Optional tex arguments sometimes should and
+ 	** sometimes shouldn't be checked
+ 	** (eg \section [C Programming] {foo} vs
+ 	**     \rule [3em] {0.015in} {5em})
+ 	** SO -- we'll always spell-check it rather than make a
+ 	** full LaTeX parser.
+ 	*/
+ 
+ 	/* Must look at the space after the command. */
+ 	while (isalpha(**bufp)  ||  **bufp == '@')
+ 	    (*bufp)++;
+ 	/*
+ 	** Our caller expects to skip over a single character.  So we
+ 	** need to back up by one.  Ugh.
+ 	*/
+ 	(*bufp)--;
+ 	}
+     }
+ 
+ /*
+  * TeX_strncmp is like strncmp, except that it returns inequality if
+  * the following character of a is alphabetic.  We do not use
+  * iswordch here because TeX itself won't normally accept
+  * nonalphabetics (except maybe on ISO Latin-1 installations?  I'll
+  * have to look into that).  As a special hack, because LaTeX uses the
+  * @ sign so much, we'll also accept that character.
+  *
+  * Properly speaking, the @ sign should be settable in the hash file
+  * header, but I doubt that it varies, and I don't want to change the
+  * syntax of affix files right now.
+  */
+ static int TeX_strncmp (a, b, n)
+     char *	a;		/* Strings to compare */
+     char *	b;		/* ... */
+     int		n;		/* Number of characters to compare */
+     {
+     int		cmpresult;	/* Result of calling strncmp */
+ 
+     cmpresult = strncmp (a, b, n);
+     if (cmpresult == 0)
+ 	{
+ 	if (isascii (a[n])  &&  isalpha (a[n]))
+ 	    return 1;		/* Force inequality if alpha follows */
+ 	}
+     return cmpresult;
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/dump.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/dump.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/dump.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,198 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: dump.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * dump.c - Ispell's dump mode
+  *
+  * This code originally resided in ispell.c, but was moved here to keep
+  * file sizes smaller.
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: dump.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:50  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.14  1994/01/25  07:11:27  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ 
+ void		dumpmode P ((void));
+ static void	tbldump P ((struct flagent * flagp, int numflags));
+ static void	entdump P ((struct flagent * flagp));
+ static void	setdump P ((char * setp, int mask));
+ static void	subsetdump P ((char * setp, int mask, int dumpval));
+ 
+ void dumpmode ()
+     {
+ 
+     if (hashheader.flagmarker == '\\'
+       ||  hashheader.flagmarker == '#'
+       ||  hashheader.flagmarker == '>'
+       ||  hashheader.flagmarker == ':'
+       ||  hashheader.flagmarker == '-'
+       ||  hashheader.flagmarker == ','
+       ||  hashheader.flagmarker == '[') /* ] */
+ 	(void) printf ("flagmarker \\%c\n", hashheader.flagmarker);
+     else if (hashheader.flagmarker < ' '  ||  hashheader.flagmarker >= 0177)
+ 	(void) printf ("flagmarker \\%3.3o\n",
+ 	 (unsigned int) hashheader.flagmarker & 0xFF);
+     else	    
+ 	(void) printf ("flagmarker %c\n", hashheader.flagmarker);
+     if (numpflags)
+ 	{
+ 	(void) printf ("prefixes\n");
+ 	tbldump (pflaglist, numpflags);
+ 	}
+     if (numsflags)
+ 	{
+ 	(void) printf ("suffixes\n");
+ 	tbldump (sflaglist, numsflags);
+ 	}
+     }
+ 
+ static void tbldump (flagp, numflags)	/* Dump a flag table */
+     register struct flagent *	flagp;	/* First flag entry to dump */
+     register int		numflags; /* Number of flags to dump */
+     {
+ 
+     while (--numflags >= 0)
+ 	entdump (flagp++);
+     }
+ 
+ static void entdump (flagp)		/* Dump one flag entry */
+     register struct flagent *	flagp;	/* Flag entry to dump */
+     {
+     register int		cond;	/* Condition number */
+ 
+     (void) printf ("  flag %s%c: ",
+       (flagp->flagflags & FF_CROSSPRODUCT) ? "*" : " ",
+       BITTOCHAR (flagp->flagbit));
+     for (cond = 0;  cond < flagp->numconds;  cond++)
+ 	{
+ 	setdump (flagp->conds, 1 << cond);
+ 	if (cond < flagp->numconds - 1)
+ 	    (void) putc (' ', stdout);
+ 	}
+     if (cond == 0)			/* No conditions at all? */
+ 	(void) putc ('.', stdout);
+     (void) printf ("\t> ");
+     (void) putc ('\t', stdout);
+     if (flagp->stripl)
+ 	(void) printf ("-%s,", ichartosstr (flagp->strip, 1));
+     (void) printf ("%s\n", flagp->affl ? ichartosstr (flagp->affix, 1) : "-");
+     }
+ 
+ static void setdump (setp, mask)	/* Dump a set specification */
+     register char *		setp;	/* Set to be dumped */
+     register int		mask;	/* Mask for bit to be dumped */
+     {
+     register int		cnum;	/* Next character's number */
+     register int		firstnz; /* Number of first NZ character */
+     register int		numnz;	/* Number of NZ characters */
+ 
+     firstnz = numnz = 0;
+     for (cnum = SET_SIZE;  --cnum >= 0;  )
+ 	{
+ 	if (setp[cnum] & mask)
+ 	    {
+ 	    numnz++;
+ 	    firstnz = cnum;
+ 	    }
+ 	}
+     if (numnz == 1)
+ 	(void) putc (firstnz, stdout);
+     else if (numnz == SET_SIZE)
+ 	(void) putc ('.', stdout);
+     else if (numnz > SET_SIZE / 2)
+ 	{
+ 	(void) printf ("[^");
+ 	subsetdump (setp, mask, 0);
+ 	(void) putc (']', stdout);
+ 	}
+     else
+ 	{
+ 	(void) putc ('[', stdout);
+ 	subsetdump (setp, mask, mask);
+ 	(void) putc (']', stdout);
+ 	}
+     }
+ 
+ static void subsetdump (setp, mask, dumpval) /* Dump part of a set spec */
+     register char *		setp;	/* Set to be dumped */
+     register int		mask;	/* Mask for bit to be dumped */
+     register int		dumpval; /* Value to be printed */
+     {
+     register int		cnum;	/* Next character's number */
+     register int		rangestart; /* Value starting a range */
+ 
+     for (cnum = 0;  cnum < SET_SIZE;  setp++, cnum++)
+ 	{
+ 	if (((*setp ^ dumpval) & mask) == 0)
+ 	    {
+ 	    for (rangestart = cnum;  cnum < SET_SIZE;  setp++, cnum++)
+ 		{
+ 		if ((*setp ^ dumpval) & mask)
+ 		    break;
+ 		}
+ 	    if (cnum == rangestart + 1)
+ 		(void) putc (rangestart, stdout);
+ 	    else if (cnum <= rangestart + 3)
+ 		{
+ 		while (rangestart < cnum)
+ 		    {
+ 		    (void) putc (rangestart, stdout);
+ 		    rangestart++;
+ 		    }
+ 		}
+ 	    else
+ 		(void) printf ("%c-%c", rangestart, cnum - 1);
+ 	    }
+ 	}
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/fields.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/fields.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/fields.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,68 ----
+ /*
+  * $Id: fields.h,v 1.1 2007/01/09 23:57:18 lattner Exp $
+  *
+  * $Log: fields.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:50  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.4  1994/01/05  20:13:43  geoff
+  * Add the maxf parameter
+  *
+  * Revision 1.3  1994/01/04  02:40:22  geoff
+  * Add field_line_inc, field_field_inc, and the FLD_NOSHRINK flag.
+  *
+  * Revision 1.2  1993/09/09  01:11:12  geoff
+  * Add a return value to fieldwrite and support for backquotes.
+  *
+  * Revision 1.1  1993/08/25  21:32:05  geoff
+  * Initial revision
+  *
+  */
+ 
+ /*
+  * Structures used by the field-access package.
+  */
+ 
+ typedef struct
+     {
+     int		nfields;	/* Number of fields in the line */
+     int		hadnl;		/* NZ if line ended with a newline */
+     char *	linebuf;	/* Malloc'ed buffer containing the line */
+     char **	fields;		/* Malloc'ed array of pointers to fields */
+     }
+ 		field_t;
+ 
+ /*
+  * Flags to fieldread and fieldmake
+  */
+ #define FLD_RUNS	0x0001	/* Consider runs of delimiters same as one */
+ #define FLD_SNGLQUOTES	0x0002	/* Accept single-quoted fields */
+ #define FLD_BACKQUOTES	0x0004	/* Accept back-quoted fields */
+ #define FLD_DBLQUOTES	0x0008	/* Accept double-quoted fields */
+ #define FLD_SHQUOTES	0x0010	/* Use shell-style (embedded) quoting rules */
+ #define FLD_STRIPQUOTES	0x0020	/* Strip quotes from fields */
+ #define FLD_BACKSLASH	0x0040	/* Process C-style backslashes */
+ #define FLD_NOSHRINK	0x0080	/* Don't shrink memory before return */
+ 
+ #undef P
+ #ifdef __STDC__
+ #define P(x)	x
+ #else /* __STDC__ */
+ #define P(x)	()
+ #endif /* __STDC__ */
+ 
+ extern field_t *	fieldread P ((FILE * file, char * delims,
+ 			  int flags, int maxf));
+ extern field_t *	fieldmake P ((char * line, int allocated,
+ 			  char * delims, int flags, int maxf));
+ extern int		fieldwrite P ((FILE * file, field_t * fieldp,
+ 			  int delim));
+ extern void		fieldfree P ((field_t * fieldp));
+ 
+ extern unsigned int	field_field_inc;
+ 				/* Increment for expanding fields */
+ extern unsigned int	field_line_inc;
+ 				/* Increment for expanding lines */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/good.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/good.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/good.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,422 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: good.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * good.c - see if a word or its root word
+  * is in the dictionary.
+  *
+  * Pace Willisson, 1983
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: good.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:50  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.43  1994/11/02  06:56:05  geoff
+  * Remove the anyword feature, which I've decided is a bad idea.
+  *
+  * Revision 1.42  1994/10/25  05:45:59  geoff
+  * Add support for an affix that will work with any word, even if there's
+  * no explicit flag.
+  *
+  * Revision 1.41  1994/05/24  06:23:06  geoff
+  * Let tgood decide capitalization questions, rather than doing it ourselves.
+  *
+  * Revision 1.40  1994/05/17  06:44:10  geoff
+  * Add support for controlled compound formation and the COMPOUNDONLY
+  * option to affix flags.
+  *
+  * Revision 1.39  1994/01/25  07:11:31  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include <ctype.h>
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ 
+ int		good P ((ichar_t * word, int ignoreflagbits, int allhits,
+ 		  int pfxopts, int sfxopts));
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ int		cap_ok P ((ichar_t * word, struct success * hit, int len));
+ static int	entryhasaffixes P ((struct dent * dent, struct success * hit));
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ void		flagpr P ((ichar_t * word, int preflag, int prestrip,
+ 		  int preadd, int sufflag, int sufadd));
+ 
+ static ichar_t *	orig_word;
+ 
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ int good (w, ignoreflagbits, allhits, pfxopts, sfxopts)
+     ichar_t *		w;		/* Word to look up */
+     int			ignoreflagbits;	/* NZ to ignore affix flags in dict */
+     int			allhits;	/* NZ to ignore case, get every hit */
+     int			pfxopts;	/* Options to apply to prefixes */
+     int			sfxopts;	/* Options to apply to suffixes */
+ #else
+ /* ARGSUSED */
+ int good (w, ignoreflagbits, dummy, pfxopts, sfxopts)
+     ichar_t *		w;		/* Word to look up */
+     int			ignoreflagbits;	/* NZ to ignore affix flags in dict */
+     int			dummy;
+ #define allhits	0	/* Never actually need more than one hit */
+     int			pfxopts;	/* Options to apply to prefixes */
+     int			sfxopts;	/* Options to apply to suffixes */
+ #endif
+     {
+     ichar_t		nword[INPUTWORDLEN + MAXAFFIXLEN];
+     register ichar_t *	p;
+     register ichar_t *	q;
+     register		n;
+     register struct dent * dp;
+ 
+     /*
+     ** Make an uppercase copy of the word we are checking.
+     */
+     for (p = w, q = nword;  *p;  )
+ 	*q++ = mytoupper (*p++);
+     *q = 0;
+     n = q - nword;
+ 
+     numhits = 0;
+ 
+     if (cflag)
+ 	{
+ 	(void) printf ("%s", ichartosstr (w, 0));
+ 	orig_word = w;
+ 	}
+     else if ((dp = lookup (nword, 1)) != NULL)
+ 	{
+ 	hits[0].dictent = dp;
+ 	hits[0].prefix = NULL;
+ 	hits[0].suffix = NULL;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 	if (allhits  ||  cap_ok (w, &hits[0], n))
+ 	    numhits = 1;
+ #else
+ 	numhits = 1;
+ #endif
+ 	/*
+ 	 * If we're looking for compounds, and this root doesn't
+ 	 * participate in compound formation, undo the hit.
+ 	 */
+ 	if (compoundflag == COMPOUND_CONTROLLED
+ 	  &&  ((pfxopts | sfxopts) & FF_COMPOUNDONLY) != 0
+ 	  &&  hashheader.compoundbit >= 0
+ 	  &&  TSTMASKBIT (dp->mask, hashheader.compoundbit) == 0)
+ 	    numhits = 0;
+ 	}
+     if (numhits  &&  !allhits)
+ 	return 1;
+ 
+     /* try stripping off affixes */
+ 
+ #if 0
+     numchars = icharlen (nword);
+     if (numchars < 4)
+ 	{
+ 	if (cflag)
+ 	    (void) putchar ('\n');
+ 	return numhits  ||  (numchars == 1);
+ 	}
+ #endif
+ 
+     chk_aff (w, nword, n, ignoreflagbits, allhits, pfxopts, sfxopts);
+ 
+     if (cflag)
+ 	(void) putchar ('\n');
+ 
+     return numhits;
+     }
+ 
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ int cap_ok (word, hit, len)
+     register ichar_t *		word;
+     register struct success *	hit;
+     int				len;
+     {
+     register ichar_t *		dword;
+     register ichar_t *		w;
+     register struct dent *	dent;
+     ichar_t			dentword[INPUTWORDLEN + MAXAFFIXLEN];
+     int				preadd;
+     int				prestrip;
+     int				sufadd;
+     ichar_t *			limit;
+     long			thiscap;
+     long			dentcap;
+ 
+     thiscap = whatcap (word);
+     /*
+     ** All caps is always legal, regardless of affixes.
+     */
+     preadd = prestrip = sufadd = 0;
+     if (thiscap == ALLCAPS)
+ 	return 1;
+     else if (thiscap == FOLLOWCASE)
+ 	{
+ 	/* Set up some constants for the while(1) loop below */
+ 	if (hit->prefix)
+ 	    {
+ 	    preadd = hit->prefix->affl;
+ 	    prestrip = hit->prefix->stripl;
+ 	    }
+ 	else
+ 	    preadd = prestrip = 0;
+ 	sufadd = hit->suffix ? hit->suffix->affl : 0;
+ 	}
+     /*
+     ** Search the variants for one that matches what we have.  Note
+     ** that thiscap can't be ALLCAPS, since we already returned
+     ** for that case.
+     */
+     dent = hit->dictent;
+     for (  ;  ;  )
+ 	{
+ 	dentcap = captype (dent->flagfield);
+ 	if (dentcap != thiscap)
+ 	    {
+ 	    if (dentcap == ANYCASE  &&  thiscap == CAPITALIZED
+ 	     &&  entryhasaffixes (dent, hit))
+ 		return 1;
+ 	    }
+ 	else				/* captypes match */
+ 	    {
+ 	    if (thiscap != FOLLOWCASE)
+ 		{
+ 		if (entryhasaffixes (dent, hit))
+ 		    return 1;
+ 		}
+ 	    else
+ 		{
+ 		/*
+ 		** Make sure followcase matches exactly.
+ 		** Life is made more difficult by the
+ 		** possibility of affixes.  Start with
+ 		** the prefix.
+ 		*/
+ 		(void) strtoichar (dentword, dent->word, INPUTWORDLEN, 1);
+ 		dword = dentword;
+ 		limit = word + preadd;
+ 		if (myupper (dword[prestrip]))
+ 		    {
+ 		    for (w = word;  w < limit;  w++)
+ 			{
+ 			if (mylower (*w))
+ 			    goto doublecontinue;
+ 			}
+ 		    }
+ 		else
+ 		    {
+ 		    for (w = word;  w < limit;  w++)
+ 			{
+ 			if (myupper (*w))
+ 			    goto doublecontinue;
+ 			}
+ 		    }
+ 		dword += prestrip;
+ 		/* Do root part of word */
+ 		limit = dword + len - preadd - sufadd;
+ 		while (dword < limit)
+ 		    {
+ 		    if (*dword++ != *w++)
+ 		      goto doublecontinue;
+ 		    }
+ 		/* Do suffix */
+ 		dword = limit - 1;
+ 		if (myupper (*dword))
+ 		    {
+ 		    for (  ;  *w;  w++)
+ 			{
+ 			if (mylower (*w))
+ 			    goto doublecontinue;
+ 			}
+ 		    }
+ 		else
+ 		    {
+ 		    for (  ;  *w;  w++)
+ 			{
+ 			if (myupper (*w))
+ 			    goto doublecontinue;
+ 			}
+ 		    }
+ 		/*
+ 		** All failure paths go to "doublecontinue,"
+ 		** so if we get here it must match.
+ 		*/
+ 		if (entryhasaffixes (dent, hit))
+ 		    return 1;
+ doublecontinue:	;
+ 		}
+ 	    }
+ 	if ((dent->flagfield & MOREVARIANTS) == 0)
+ 	    break;
+ 	dent = dent->next;
+ 	}
+ 
+     /* No matches found */
+     return 0;
+     }
+ 
+ /*
+ ** See if this particular capitalization (dent) is legal with these
+ ** particular affixes.
+ */
+ static int entryhasaffixes (dent, hit)
+     register struct dent *	dent;
+     register struct success *	hit;
+     {
+ 
+     if (hit->prefix  &&  !TSTMASKBIT (dent->mask, hit->prefix->flagbit))
+ 	return 0;
+     if (hit->suffix  &&  !TSTMASKBIT (dent->mask, hit->suffix->flagbit))
+ 	return 0;
+     return 1;			/* Yes, these affixes are legal */
+     }
+ #endif
+ 
+ /*
+  * Print a word and its flag, making sure the case of the output matches
+  * the case of the original found in "orig_word".
+  */
+ void flagpr (word, preflag, prestrip, preadd, sufflag, sufadd)
+     register ichar_t *	word;		/* (Modified) word to print */
+     int			preflag;	/* Prefix flag (if any) */
+     int			prestrip;	/* Lth of pfx stripped off orig_word */
+     int			preadd;		/* Length of prefix added to w */
+     int			sufflag;	/* Suffix flag (if any) */
+     int			sufadd;		/* Length of suffix added to w */
+     {
+     register ichar_t *	origp;		/* Pointer into orig_word */
+     int			orig_len;	/* Length of orig_word */
+ 
+     orig_len = icharlen (orig_word);
+     /*
+      * We refuse to print if the cases outside the modification
+      * points don't match those just inside.  This prevents things
+      * like "OEM's" from being turned into "OEM/S" which expands
+      * only to "OEM'S".
+      */
+     if (preflag > 0)
+ 	{
+ 	origp = orig_word + preadd;
+ 	if (myupper (*origp))
+ 	    {
+ 	    for (origp = orig_word;  origp < orig_word + preadd;  origp++)
+ 		{
+ 		if (mylower (*origp))
+ 		    return;
+ 		}
+ 	    }
+ 	else
+ 	    {
+ 	    for (origp = orig_word;  origp < orig_word + preadd;  origp++)
+ 		{
+ 		if (myupper (*origp))
+ 		    return;
+ 		}
+ 	    }
+ 	}
+     if (sufflag > 0)
+ 	{
+ 	origp = orig_word + orig_len - sufadd;
+ 	if (myupper (origp[-1]))
+ 	    {
+ 	    for (  ;  *origp != 0;  origp++)
+ 		{
+ 		if (mylower (*origp))
+ 		    return;
+ 		}
+ 	    }
+ 	else
+ 	    {
+ 	    origp = orig_word + orig_len - sufadd;
+ 	    for (  ;  *origp != 0;  origp++)
+ 		{
+ 		if (myupper (*origp))
+ 		    return;
+ 		}
+ 	    }
+ 	}
+     /*
+      * The cases are ok.  Put out the word, being careful that the
+      * prefix/suffix cases match those in the original, and that the
+      * unchanged characters from the original actually match it.
+      */
+     (void) putchar (' ');
+     origp = orig_word + preadd;
+     if (myupper (*origp))
+ 	{
+ 	while (--prestrip >= 0)
+ 	    (void) fputs (printichar ((int) *word++), stdout);
+ 	}
+     else
+ 	{
+ 	while (--prestrip >= 0)
+ 	    (void) fputs (printichar ((int) mytolower (*word++)), stdout);
+ 	}
+     for (prestrip = orig_len - preadd - sufadd;  --prestrip >= 0;  word++)
+ 	(void) fputs (printichar ((int) *origp++), stdout);
+     if (origp > orig_word)
+ 	origp--;
+     if (myupper (*origp))
+ 	(void) fputs (ichartosstr (word, 0), stdout);
+     else
+ 	{
+ 	while (*word)
+ 	    {
+ 	    (void) fputs (printichar ((int) mytolower (*word++)), stdout);
+ 	    }
+ 	}
+     /*
+      * Now put out the flags
+      */
+     (void) putchar (hashheader.flagmarker);
+     if (preflag > 0)
+ 	(void) putchar (preflag);
+     if (sufflag > 0)
+ 	(void) putchar (sufflag);
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/hash.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/hash.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/hash.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,105 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: hash.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * hash.c - a simple hash function for ispell
+  *
+  * Pace Willisson, 1983
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: hash.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:51  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.20  1994/01/25  07:11:34  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ 
+ int		hash P ((ichar_t * word, int hashtblsize));
+ 
+ /*
+  * The following hash algorithm is due to Ian Dall, with slight modifications
+  * by Geoff Kuenning to reflect the results of testing with the English
+  * dictionaries actually distributed with ispell.
+  */
+ #define HASHSHIFT   5
+ 
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ #define HASHUPPER(c)	c
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ #define HASHUPPER(c)	mytoupper(c)
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 
+ int hash (s, hashtblsize)
+     register ichar_t *	s;
+     register int	hashtblsize;
+     {
+     register long	h = 0;
+     register int	i;
+ 
+ #ifdef ICHAR_IS_CHAR
+     for (i = 4;  i--  &&  *s != 0;  )
+ 	h = (h << 8) | HASHUPPER (*s++);
+ #else /* ICHAR_IS_CHAR */
+     for (i = 2;  i--  &&  *s != 0;  )
+ 	h = (h << 16) | HASHUPPER (*s++);
+ #endif /* ICHAR_IS_CHAR */
+     while (*s != 0)
+ 	{
+ 	/*
+ 	 * We have to do circular shifts the hard way, since C doesn't
+ 	 * have them even though the hardware probably does.  Oh, well.
+ 	 */
+ 	h = (h << HASHSHIFT)
+ 	  | ((h >> (32 - HASHSHIFT)) & ((1 << HASHSHIFT) - 1));
+ 	h ^= HASHUPPER (*s++);
+ 	}
+     return (unsigned long) h % hashtblsize;
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,1012 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: ispell.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ #define MAIN
+ 
+ /*
+  * ispell.c - An interactive spelling corrector.
+  *
+  * Copyright (c), 1983, by Pace Willisson
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: ispell.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:51  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.133  1995/10/11  04:30:29  geoff
+  * Get rid of an unused variable.
+  *
+  * Revision 1.132  1995/08/05  23:19:36  geoff
+  * If the DICTIONARY environment variable is set, derive the default
+  * personal-dictionary name from it.
+  *
+  * Revision 1.131  1995/01/08  23:23:39  geoff
+  * Support variable hashfile suffixes for DOS purposes.  Report all the
+  * new configuration variables in the -vv switch.  Do some better error
+  * checking for mktemp failures.  Support the rename system call.  All of
+  * this is to help make DOS porting easier.
+  *
+  * Revision 1.130  1995/01/03  19:24:08  geoff
+  * When constructing a personal-dictioary name from the hash file name,
+  * don't stupidly include path directory components.
+  *
+  * Revision 1.129  1995/01/03  02:23:19  geoff
+  * Disable the setbuf call on BSDI systems, sigh.
+  *
+  * Revision 1.128  1994/10/26  05:12:28  geoff
+  * Include boundary characters in the list of characters to be tried in
+  * corrections.
+  *
+  * Revision 1.127  1994/10/25  05:46:07  geoff
+  * Allow the default dictionary to be specified by an environment
+  * variable (DICTIONARY) as well as a switch.
+  *
+  * Revision 1.126  1994/09/16  03:32:34  geoff
+  * Issue an error message for bad affix flags
+  *
+  * Revision 1.125  1994/07/28  05:11:36  geoff
+  * Log message for previous revision: fix backup-file checks to correctly
+  * test for exceeding MAXNAMLEN.
+  *
+  * Revision 1.124  1994/07/28  04:53:39  geoff
+  *
+  * Revision 1.123  1994/05/17  06:44:12  geoff
+  * Add support for controlled compound formation and the COMPOUNDONLY
+  * option to affix flags.
+  *
+  * Revision 1.122  1994/04/27  01:50:37  geoff
+  * Print MAX_CAPS in -vv mode.
+  *
+  * Revision 1.121  1994/03/16  03:49:10  geoff
+  * Fix -vv to display the value of NO_STDLIB_H.
+  *
+  * Revision 1.120  1994/03/15  06:24:28  geoff
+  * Allow the -t, -n, and -T switches to override each other, as follows:
+  * if no switches are given, the deformatter and string characters are
+  * chosen based on the file suffix.  If only -t/-n are given, the
+  * deformatter is forced but string cahracters come from the file suffix.
+  * If only -T is given, the deformatter is chosen based on the value
+  * given in the -T switch.  Finally, if both -T and -t/-n are given,
+  * string characters are controlled by -T and the deformatter by -t/-n.
+  *
+  * Revision 1.119  1994/03/15  05:58:07  geoff
+  * Get rid of a gcc warning
+  *
+  * Revision 1.118  1994/03/15  05:30:37  geoff
+  * Get rid of an unused-variable complaint by proper ifdeffing
+  *
+  * Revision 1.117  1994/03/12  21:26:48  geoff
+  * Correctly limit maximum name lengths for files that have directory paths
+  * included.  Also don't use a wired-in 256 for the size of the backup file
+  * name.
+  *
+  * Revision 1.116  1994/02/07  08:10:44  geoff
+  * Print GENERATE_LIBRARY_PROTOS in the -vv switch.
+  *
+  * Revision 1.115  1994/01/26  07:44:47  geoff
+  * Make yacc configurable through local.h.
+  *
+  * Revision 1.114  1994/01/25  07:11:44  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ #include "version.h"
+ #include <ctype.h>
+ #include <sys/stat.h>
+ 
+ static void	usage P ((void));
+ static void	initckch P ((char * wchars));
+ int		main P ((int argc, char * argv[]));
+ static void	dofile P ((char * filename));
+ static void	update_file P ((char * filename, struct stat * statbuf));
+ static void	expandmode P ((int printorig));
+ 
+ static char *	Cmd;
+ static char *	LibDict = NULL;		/* Pointer to name of $(LIBDIR)/dict */
+ 
+ static void usage ()
+     {
+ 
+     (void) fprintf (stderr, ISPELL_C_USAGE1, Cmd);
+     (void) fprintf (stderr, ISPELL_C_USAGE2, Cmd);
+     (void) fprintf (stderr, ISPELL_C_USAGE3, Cmd);
+     (void) fprintf (stderr, ISPELL_C_USAGE4, Cmd);
+     (void) fprintf (stderr, ISPELL_C_USAGE5, Cmd);
+     (void) fprintf (stderr, ISPELL_C_USAGE6, Cmd);
+     (void) fprintf (stderr, ISPELL_C_USAGE7, Cmd);
+     givehelp (0);
+     exit (1);
+     }
+ 
+ static void initckch (wchars)
+     char *		wchars;		/* Characters in -w option, if any */
+     {
+     register ichar_t	c;
+     char		num[4];
+ 
+     for (c = 0; c < (ichar_t) (SET_SIZE + hashheader.nstrchars); ++c)
+ 	{
+ 	if (iswordch (c))
+ 	    {
+ 	    if (!mylower (c))
+ 		{
+ 		Try[Trynum] = c;
+ 		++Trynum;
+ 		}
+ 	    }
+ 	else if (isboundarych (c))
+ 	    {
+ 	    Try[Trynum] = c;
+ 	    ++Trynum;
+ 	    }
+ 	}
+     if (wchars != NULL)
+ 	{
+ 	while (Trynum < SET_SIZE  &&  *wchars != '\0')
+ 	    {
+ 	    if (*wchars != 'n'  &&  *wchars != '\\')
+ 		{
+ 		c = *wchars;
+ 		++wchars;
+ 		}
+ 	    else
+ 		{
+ 		++wchars;
+ 		num[0] = '\0'; 
+ 		num[1] = '\0'; 
+ 		num[2] = '\0'; 
+ 		num[3] = '\0';
+ 		if (isdigit (wchars[0]))
+ 		    {
+ 		    num[0] = wchars[0];
+ 		    if (isdigit (wchars[1]))
+ 			{
+ 			num[1] = wchars[1];
+ 			if (isdigit (wchars[2]))
+ 			    num[2] = wchars[2];
+ 			}
+ 		    }
+ 		if (wchars[-1] == 'n')
+ 		    {
+ 		    wchars += strlen (num);
+ 		    c = atoi (num);
+ 		    }
+ 		else
+ 		    {
+ 		    wchars += strlen (num);
+ 		    c = 0;
+ 		    if (num[0])
+ 			c = num[0] - '0';
+ 		    if (num[1])
+ 			{
+ 			c <<= 3;
+ 			c += num[1] - '0';
+ 			}
+ 		    if (num[2])
+ 			{
+ 			c <<= 3;
+ 			c += num[2] - '0';
+ 			}
+ 		    }
+ 		}
+ 	    c &= NOPARITY;
+ 	    if (!hashheader.wordchars[c])
+ 		{
+ 		hashheader.wordchars[c] = 1;
+ 		hashheader.sortorder[c] = hashheader.sortval++;
+ 		Try[Trynum] = c;
+ 		++Trynum;
+ 		}
+ 	    }
+ 	}
+     }
+ 
+ int main (argc, argv)
+     int		argc;
+     char *	argv[];
+     {
+     char *	p;
+     char *	cpd;
+     char **	versionp;
+     char *	wchars = NULL;
+     char *	preftype = NULL;
+     static char	libdictname[sizeof DEFHASH];
+     static char	outbuf[BUFSIZ];
+     int		argno;
+     int		arglen;
+ 
+     Cmd = *argv;
+ 
+     Trynum = 0;
+ 
+     p = getenv ("DICTIONARY");
+     if (p != NULL)
+ 	{
+ 	if (index (p, '/') != NULL)
+ 	    (void) strcpy (hashname, p);
+ 	else
+ 	    (void) sprintf (hashname, "%s/%s", LIBDIR, p);
+ 	(void) strcpy (libdictname, p);
+ 	p = rindex (p, '.');
+ 	if (p == NULL  ||  strcmp (p, HASHSUFFIX) != 0)
+ 	    (void) strcat (hashname, HASHSUFFIX);
+ 	LibDict = rindex (libdictname, '/');
+ 	if (LibDict != NULL)
+ 	    LibDict++;
+ 	else
+ 	    LibDict = libdictname;
+ 	p = rindex (libdictname, '.');
+ 	if (p != NULL)
+ 	    *p = '\0';
+ 	}
+     else
+ 	(void) sprintf (hashname, "%s/%s", LIBDIR, DEFHASH);
+ 
+     cpd = NULL;
+ 
+     argv++;
+     argc--;
+     while (argc && **argv == '-')
+ 	{
+ 	/*
+ 	 * Trying to add a new flag?  Can't remember what's been used?
+ 	 * Here's a handy guide:
+ 	 *
+ 	 * Used:
+ 	 *
+ 	 *	ABCDEFGHIJKLMNOPQRSTUVWXYZ 0123456789
+ 	 *	^^^^       ^^^ ^  ^^ ^^
+ 	 *	abcdefghijklmnopqrstuvwxyz
+ 	 *	^^^^^^     ^^^ ^  ^^ ^^^
+ 	 */
+ 	arglen = strlen (*argv);
+ 	switch ((*argv)[1])
+ 	    {
+ 	    case 'v':
+ 		if (arglen > 3)
+ 		    usage ();
+ 		for (versionp = Version_ID;  *versionp;  )
+ 		    {
+ 		    p = *versionp++;
+ 		    if (strncmp (p, "(#) ", 5) == 0)
+ 		      p += 5;
+ 		    (void) printf ("%s\n", p);
+ 		    }
+ 		if ((*argv)[2] == 'v')
+ 		    {
+ 		    (void) printf (ISPELL_C_OPTIONS_ARE);
+ #ifdef USG
+ 		    (void) printf ("\tUSG\n");
+ #else /* USG */
+ 		    (void) printf ("\t!USG (BSD)\n");
+ #endif /* USG */
+ 		    (void) printf ("\tBAKEXT = \"%s\"\n", BAKEXT);
+ 		    (void) printf ("\tBINDIR = \"%s\"\n", BINDIR);
+ #ifdef BOTTOMCONTEXT
+ 		    (void) printf ("\tBOTTOMCONTEXT\n");
+ #else /* BOTTOMCONTEXT */
+ 		    (void) printf ("\t!BOTTOMCONTEXT\n");
+ #endif /* BOTTOMCONTEXT */
+ #if TERM_MODE == CBREAK
+ 		    (void) printf ("\tCBREAK\n");
+ #endif /* TERM_MODE */
+ 		    (void) printf ("\tCC = \"%s\"\n", CC);
+ 		    (void) printf ("\tCFLAGS = \"%s\"\n", CFLAGS);
+ #ifdef COMMANDFORSPACE
+ 		    (void) printf ("\tCOMMANDFORSPACE\n");
+ #else /* COMMANDFORSPACE */
+ 		    (void) printf ("\t!COMMANDFORSPACE\n");
+ #endif /* COMMANDFORSPACE */
+ #ifdef CONTEXTROUNDUP
+ 		    (void) printf ("\tCONTEXTROUNDUP\n");
+ #else /* CONTEXTROUNDUP */
+ 		    (void) printf ("\t!CONTEXTROUNDUP\n");
+ #endif /* CONTEXTROUNDUP */
+ 		    (void) printf ("\tCONTEXTPCT = %d\n", CONTEXTPCT);
+ 		    (void) printf ("\tCOUNTSUFFIX = \"%s\"\n", COUNTSUFFIX);
+ 		    (void) printf ("\tDEFHASH = \"%s\"\n", DEFHASH);
+ 		    (void) printf ("\tDEFINCSTR = \"%s\"\n", DEFINCSTR);
+ 		    (void) printf ("\tDEFLANG = \"%s\"\n", DEFLANG);
+ 		    (void) printf ("\tDEFNOBACKUPFLAG = %d\n",
+ 		      DEFNOBACKUPFLAG);
+ 		    (void) printf ("\tDEFPAFF = \"%s\"\n", DEFPAFF);
+ 		    (void) printf ("\tDEFPDICT = \"%s\"\n", DEFPDICT);
+ 		    (void) printf ("\tDEFTEXFLAG = %d\n", DEFTEXFLAG);
+ 		    (void) printf ("\tEGREPCMD = \"%s\"\n", EGREPCMD);
+ 		    (void) printf ("\tELISPDIR = \"%s\"\n", ELISPDIR);
+ 		    (void) printf ("\tEMACS = \"%s\"\n", EMACS);
+ #ifdef EQUAL_COLUMNS
+ 		    (void) printf ("\tEQUAL_COLUMNS\n");
+ #else /* EQUAL_COLUMNS */
+ 		    (void) printf ("\t!EQUAL_COLUMNS\n");
+ #endif /* EQUAL_COLUMNS */
+ #ifdef GENERATE_LIBRARY_PROTOS
+ 		    (void) printf ("\tGENERATE_LIBRARY_PROTOS\n");
+ #else /* GENERATE_LIBRARY_PROTOS */
+ 		    (void) printf ("\t!GENERATE_LIBRARY_PROTOS\n");
+ #endif /* GENERATE_LIBRARY_PROTOS */
+ #ifdef HAS_RENAME
+ 		    (void) printf ("\tHAS_RENAME\n");
+ #else /* HAS_RENAME */
+ 		    (void) printf ("\t!HAS_RENAME\n");
+ #endif /* HAS_RENAME */
+ 		    (void) printf ("\tHASHSUFFIX = \"%s\"\n", HASHSUFFIX);
+ 		    (void) printf ("\tHOME = \"%s\"\n", HOME);
+ #ifdef IGNOREBIB
+ 		    (void) printf ("\tIGNOREBIB\n");
+ #else /* IGNOREBIB */
+ 		    (void) printf ("\t!IGNOREBIB\n");
+ #endif /* IGNOREBIB */
+ 		    (void) printf ("\tINCSTRVAR = \"%s\"\n", INCSTRVAR);
+ 		    (void) printf ("\tINPUTWORDLEN = %d\n", INPUTWORDLEN);
+ 		    (void) printf ("\tLANGUAGES = \"%s\"\n", LANGUAGES);
+ 		    (void) printf ("\tLIBDIR = \"%s\"\n", LIBDIR);
+ 		    (void) printf ("\tLIBES = \"%s\"\n", LIBES);
+ 		    (void) printf ("\tLINT = \"%s\"\n", LINT);
+ 		    (void) printf ("\tLINTFLAGS = \"%s\"\n", LINTFLAGS);
+ #ifndef REGEX_LOOKUP
+ 		    (void) printf ("\tLOOK = \"%s\"\n", LOOK);
+ #endif /* REGEX_LOOKUP */
+ 		    (void) printf ("\tMAKE_SORTTMP = \"%s\"\n", MAKE_SORTTMP);
+ 		    (void) printf ("\tMALLOC_INCREMENT = %d\n",
+ 		      MALLOC_INCREMENT);
+ 		    (void) printf ("\tMAN1DIR = \"%s\"\n", MAN1DIR);
+ 		    (void) printf ("\tMAN1EXT = \"%s\"\n", MAN1EXT);
+ 		    (void) printf ("\tMAN4DIR = \"%s\"\n", MAN4DIR);
+ 		    (void) printf ("\tMAN4EXT = \"%s\"\n", MAN4EXT);
+ 		    (void) printf ("\tMASKBITS = %d\n", MASKBITS);
+ 		    (void) printf ("\tMASKTYPE = %s\n", MASKTYPE_STRING);
+ 		    (void) printf ("\tMASKTYPE_WIDTH = %d\n", MASKTYPE_WIDTH);
+ 		    (void) printf ("\tMASTERHASH = \"%s\"\n", MASTERHASH);
+ 		    (void) printf ("\tMAXAFFIXLEN = %d\n", MAXAFFIXLEN);
+ 		    (void) printf ("\tMAXCONTEXT = %d\n", MAXCONTEXT);
+ 		    (void) printf ("\tMAXINCLUDEFILES = %d\n",
+ 		      MAXINCLUDEFILES);
+ 		    (void) printf ("\tMAXNAMLEN = %d\n", MAXNAMLEN);
+ 		    (void) printf ("\tMAXPATHLEN = %d\n", MAXPATHLEN);
+ 		    (void) printf ("\tMAXPCT = %d\n", MAXPCT);
+ 		    (void) printf ("\tMAXSEARCH = %d\n", MAXSEARCH);
+ 		    (void) printf ("\tMAXSTRINGCHARLEN = %d\n",
+ 		      MAXSTRINGCHARLEN);
+ 		    (void) printf ("\tMAXSTRINGCHARS = %d\n", MAXSTRINGCHARS);
+ 		    (void) printf ("\tMAX_CAPS = %d\n", MAX_CAPS);
+ 		    (void) printf ("\tMAX_HITS = %d\n", MAX_HITS);
+ 		    (void) printf ("\tMAX_SCREEN_SIZE = %d\n",
+ 		      MAX_SCREEN_SIZE);
+ 		    (void) printf ("\tMINCONTEXT = %d\n", MINCONTEXT);
+ #ifdef MINIMENU
+ 		    (void) printf ("\tMINIMENU\n");
+ #else /* MINIMENU */
+ 		    (void) printf ("\t!MINIMENU\n");
+ #endif /* MINIMENU */
+ 		    (void) printf ("\tMINWORD = %d\n", MINWORD);
+ 		    (void) printf ("\tMSDOS_BINARY_OPEN = 0x%x\n",
+ 		      (unsigned int) MSDOS_BINARY_OPEN);
+ 		    (void) printf ("\tMSGLANG = %s\n", MSGLANG);
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ 		    (void) printf ("\tNO_CAPITALIZATION_SUPPORT\n");
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ 		    (void) printf ("\t!NO_CAPITALIZATION_SUPPORT\n");
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ #ifdef NO_STDLIB_H
+ 		    (void) printf ("\tNO_STDLIB_H\n");
+ #else /* NO_STDLIB_H */
+ 		    (void) printf ("\t!NO_STDLIB_H (STDLIB_H)\n");
+ #endif /* NO_STDLIB_H */
+ #ifdef NO8BIT
+ 		    (void) printf ("\tNO8BIT\n");
+ #else /* NO8BIT */
+ 		    (void) printf ("\t!NO8BIT (8BIT)\n");
+ #endif /* NO8BIT */
+ 		    (void) printf ("\tNRSPECIAL = \"%s\"\n", NRSPECIAL);
+ 		    (void) printf ("\tOLDPAFF = \"%s\"\n", OLDPAFF);
+ 		    (void) printf ("\tOLDPDICT = \"%s\"\n", OLDPDICT);
+ #ifdef PDICTHOME
+ 		    (void) printf ("\tPDICTHOME = \"%s\"\n", PDICTHOME);
+ #else /* PDICTHOME */
+ 		    (void) printf ("\tPDICTHOME = (undefined)\n");
+ #endif /* PDICTHOME */
+ 		    (void) printf ("\tPDICTVAR = \"%s\"\n", PDICTVAR);
+ #ifdef PIECEMEAL_HASH_WRITES
+ 		    (void) printf ("\tPIECEMEAL_HASH_WRITES\n");
+ #else /* PIECEMEAL_HASH_WRITES */
+ 		    (void) printf ("\t!PIECEMEAL_HASH_WRITES\n");
+ #endif /* PIECEMEAL_HASH_WRITES */
+ #if TERM_MODE != CBREAK
+ 		    (void) printf ("\tRAW\n");
+ #endif /* TERM_MODE */
+ #ifdef REGEX_LOOKUP
+ 		    (void) printf ("\tREGEX_LOOKUP\n");
+ #else /* REGEX_LOOKUP */
+ 		    (void) printf ("\t!REGEX_LOOKUP\n");
+ #endif /* REGEX_LOOKUP */
+ 		    (void) printf ("\tREGLIB = \"%s\"\n", REGLIB);
+ 		    (void) printf ("\tSIGNAL_TYPE = %s\n", SIGNAL_TYPE_STRING);
+ 		    (void) printf ("\tSORTPERSONAL = %d\n", SORTPERSONAL);
+ 		    (void) printf ("\tSTATSUFFIX = \"%s\"\n", STATSUFFIX);
+ 		    (void) printf ("\tTEMPNAME = \"%s\"\n", TEMPNAME);
+ 		    (void) printf ("\tTERMLIB = \"%s\"\n", TERMLIB);
+ 		    (void) printf ("\tTEXINFODIR = \"%s\"\n", TEXINFODIR);
+ 		    (void) printf ("\tTEXSPECIAL = \"%s\"\n", TEXSPECIAL);
+ #ifdef TRUNCATEBAK
+ 		    (void) printf ("\tTRUNCATEBAK\n");
+ #else /* TRUNCATEBAK */
+ 		    (void) printf ("\t!TRUNCATEBAK\n");
+ #endif /* TRUNCATEBAK */
+ #ifdef USESH
+ 		    (void) printf ("\tUSESH\n");
+ #else /* USESH */
+ 		    (void) printf ("\t!USESH\n");
+ #endif /* USESH */
+ 		    (void) printf ("\tWORDS = \"%s\"\n", WORDS);
+ 		    (void) printf ("\tYACC = \"%s\"\n", YACC);
+ 		    }
+ 		exit (0);
+ 		break;
+ 	    case 'n':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		tflag = 0;		/* nroff/troff mode */
+ 		deftflag = 0;
+ 		if (preftype == NULL)
+ 		    preftype = "nroff";
+ 		break;
+ 	    case 't':			/* TeX mode */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		tflag = 1;
+ 		deftflag = 1;
+ 		if (preftype == NULL)
+ 		    preftype = "tex";
+ 		break;
+ 	    case 'T':			/* Set preferred file type */
+ 		p = (*argv)+2;
+ 		if (*p == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    p = *argv;
+ 		    }
+ 		preftype = p;
+ 		break;
+ 	    case 'A':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		incfileflag = 1;
+ 		aflag = 1;
+ 		break;
+ 	    case 'a':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		aflag++;
+ 		break;
+ 	    case 'D':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		dumpflag++;
+ 		nodictflag++;
+ 		break;
+ 	    case 'e':
+ 		if (arglen > 3)
+ 		    usage ();
+ 		eflag = 1;
+ 		if ((*argv)[2] == 'e')
+ 		    eflag = 2;
+ 		else if ((*argv)[2] >= '1'  &&  (*argv)[2] <= '4')
+ 		    eflag = (*argv)[2] - '0';
+ 		else if ((*argv)[2] != '\0')
+ 		    usage ();
+ 		nodictflag++;
+ 		break;
+ 	    case 'c':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		cflag++;
+ 		lflag++;
+ 		nodictflag++;
+ 		break;
+ 	    case 'b':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		xflag = 0;		/* Keep a backup file */
+ 		break;
+ 	    case 'x':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		xflag = 1;		/* Don't keep a backup file */
+ 		break;
+ 	    case 'f':
+ 		fflag++;
+ 		p = (*argv)+2;
+ 		if (*p == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    p = *argv;
+ 		    }
+ 		askfilename = p;
+ 		if (*askfilename == '\0')
+ 		    askfilename = NULL;
+ 		break;
+ 	    case 'L':
+ 		p = (*argv)+2;
+ 		if (*p == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    p = *argv;
+ 		    }
+ 		contextsize = atoi (p);
+ 		break;
+ 	    case 'l':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		lflag++;
+ 		break;
+ #ifndef USG
+ 	    case 's':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		sflag++;
+ 		break;
+ #endif
+ 	    case 'S':
+ 		if (arglen > 2)
+ 		    usage ();
+ 		sortit = 0;
+ 		break;
+ 	    case 'B':		/* -B:  report missing blanks */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		compoundflag = COMPOUND_NEVER;
+ 		break;
+ 	    case 'C':		/* -C:  compound words are acceptable */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		compoundflag = COMPOUND_ANYTIME;
+ 		break;
+ 	    case 'P':		/* -P:  don't gen non-dict poss's */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		tryhardflag = 0;
+ 		break;
+ 	    case 'm':		/* -m:  make all poss affix combos */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		tryhardflag = 1;
+ 		break;
+ 	    case 'N':		/* -N:  suppress minimenu */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		minimenusize = 0;
+ 		break;
+ 	    case 'M':		/* -M:  force minimenu */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		minimenusize = 2;
+ 		break;
+ 	    case 'p':
+ 		cpd = (*argv)+2;
+ 		if (*cpd == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    cpd = *argv;
+ 		    if (*cpd == '\0')
+ 			cpd = NULL;
+ 		    }
+ 		LibDict = NULL;
+ 		break;
+ 	    case 'd':
+ 		p = (*argv)+2;
+ 		if (*p == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    p = *argv;
+ 		    }
+ 		if (index (p, '/') != NULL)
+ 		    (void) strcpy (hashname, p);
+ 		else
+ 		    (void) sprintf (hashname, "%s/%s", LIBDIR, p);
+ 		if (cpd == NULL  &&  *p != '\0')
+ 		    LibDict = p;
+ 		p = rindex (p, '.');
+ 		if (p != NULL  &&  strcmp (p, HASHSUFFIX) == 0)
+ 		    *p = '\0';	/* Don't want ext. in LibDict */
+ 		else
+ 		    (void) strcat (hashname, HASHSUFFIX);
+ 		if (LibDict != NULL)
+ 		    {
+ 		    p = rindex (LibDict, '/');
+ 		    if (p != NULL)
+ 			LibDict = p + 1;
+ 		    }
+ 		break;
+ 	    case 'V':		/* Display 8-bit characters as M-xxx */
+ 		if (arglen > 2)
+ 		    usage ();
+ 		vflag = 1;
+ 		break;
+ 	    case 'w':
+ 		wchars = (*argv)+2;
+ 		if (*wchars == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    wchars = *argv;
+ 		    }
+ 		break;
+ 	    case 'W':
+ 		if ((*argv)[2] == '\0')
+ 		    {
+ 		    argv++; argc--;
+ 		    if (argc == 0)
+ 			usage ();
+ 		    minword = atoi (*argv);
+ 		    }
+ 		else
+ 		    minword = atoi (*argv + 2);
+ 		break;
+ 	    default:
+ 		usage ();
+ 	    }
+ 	argv++;
+ 	argc--;
+ 	}
+ 
+     if (!argc  &&  !lflag  &&  !aflag   &&  !eflag  &&  !dumpflag)
+ 	usage ();
+ 
+     /*
+      * Because of the high cost of reading the dictionary, we stat
+      * the files specified first to see if they exist.  If at least
+      * one exists, we continue.
+      */
+     for (argno = 0;  argno < argc;  argno++)
+ 	{
+ 	if (access (argv[argno], 4) >= 0)
+ 	    break;
+ 	}
+     if (argno >= argc  &&  !lflag  &&  !aflag  &&  !eflag  &&  !dumpflag)
+ 	{
+ 	(void) fprintf (stderr,
+ 	  argc == 1 ? ISPELL_C_NO_FILE : ISPELL_C_NO_FILES);
+ 	exit (1);
+ 	}
+     if (linit () < 0)
+ 	exit (1);
+ 
+     if (preftype != NULL)
+ 	{
+ 	prefstringchar =
+ 	  findfiletype (preftype, 1, deftflag < 0 ? &deftflag : (int *) NULL);
+ 	if (prefstringchar < 0
+ 	  &&  strcmp (preftype, "tex") != 0
+ 	  &&  strcmp (preftype, "nroff") != 0)
+ 	    {
+ 	    (void) fprintf (stderr, ISPELL_C_BAD_TYPE, preftype);
+ 	    exit (1);
+ 	    }
+ 	}
+     if (prefstringchar < 0)
+ 	defdupchar = 0;
+     else
+ 	defdupchar = prefstringchar;
+ 
+     if (compoundflag < 0)
+ 	compoundflag = hashheader.compoundflag;
+     if (tryhardflag < 0)
+ 	tryhardflag = hashheader.defhardflag;
+ 
+     initckch(wchars);
+ 
+     if (LibDict == NULL)	
+ 	{
+ 	(void) strcpy (libdictname, DEFHASH);
+ 	LibDict = libdictname;
+ 	p = rindex (libdictname, '.');
+ 	if (p != NULL  &&  strcmp (p, HASHSUFFIX) == 0)
+ 	    *p = '\0';	/* Don't want ext. in LibDict */
+ 	}
+     if (!nodictflag)
+ 	treeinit (cpd, LibDict);
+ 
+     if (aflag)
+ 	{
+ 	askmode ();
+ 	treeoutput ();
+ 	exit (0);
+ 	}
+     else if (eflag)
+ 	{
+ 	expandmode (eflag);
+ 	exit (0);
+ 	}
+     else if (dumpflag)
+ 	{
+ 	dumpmode ();
+ 	exit (0);
+ 	}
+ 
+ #ifndef __bsdi__
+     setbuf (stdout, outbuf);
+ #endif /* __bsdi__ */
+     if (lflag)
+ 	{
+ 	infile = stdin;
+ 	outfile = stdout;
+ 	checkfile ();
+ 	exit (0);
+ 	}
+ 
+     terminit ();
+ 
+     while (argc--)
+ 	dofile (*argv++);
+ 
+     done (0);
+     /* NOTREACHED */
+     return 0;
+     }
+ 
+ static void dofile (filename)
+     char *	filename;
+     {
+     struct stat	statbuf;
+     char *	cp;
+ 
+     currentfile = filename;
+ 
+     /* See if the file is a .tex file.  If so, set the appropriate flags. */
+     tflag = deftflag;
+     if (tflag < 0)
+ 	tflag =
+ 	  (cp = rindex (filename, '.')) != NULL  &&  strcmp (cp, ".tex") == 0;
+ 
+     if (prefstringchar < 0)
+ 	{
+ 	defdupchar =
+ 	  findfiletype (filename, 0, deftflag < 0 ? &tflag : (int *) NULL);
+ 	if (defdupchar < 0)
+ 	    defdupchar = 0;
+ 	}
+ 
+     if ((infile = fopen (filename, "r")) == NULL)
+ 	{
+ 	(void) fprintf (stderr, CANT_OPEN, filename);
+ 	(void) sleep ((unsigned) 2);
+ 	return;
+ 	}
+ 
+     readonly = access (filename, 2) < 0;
+     if (readonly)
+ 	{
+ 	(void) fprintf (stderr, ISPELL_C_CANT_WRITE, filename);
+ 	(void) sleep ((unsigned) 2);
+ 	}
+ 
+     (void) fstat (fileno (infile), &statbuf);
+     (void) strcpy (tempfile, TEMPNAME);
+     if (mktemp (tempfile) == NULL  ||  tempfile[0] == '\0'
+       ||  (outfile = fopen (tempfile, "w")) == NULL)
+ 	{
+ 	(void) fprintf (stderr, CANT_CREATE,
+ 	  (tempfile == NULL  ||  tempfile[0] == '\0')
+ 	    ? "temporary file" : tempfile);
+ 	(void) sleep ((unsigned) 2);
+ 	return;
+ 	}
+     (void) chmod (tempfile, statbuf.st_mode);
+ 
+     quit = 0;
+     changes = 0;
+ 
+     checkfile ();
+ 
+     (void) fclose (infile);
+     (void) fclose (outfile);
+ 
+     if (!cflag)
+ 	treeoutput ();
+ 
+     if (changes && !readonly)
+ 	update_file (filename, &statbuf);
+     (void) unlink (tempfile);
+     }
+ 
+ static void update_file (filename, statbuf)
+     char *		filename;
+     struct stat *	statbuf;
+     {
+     char		bakfile[MAXPATHLEN];
+     int			c;
+     char *		pathtail;
+ 
+     if ((infile = fopen (tempfile, "r")) == NULL)
+ 	{
+ 	(void) fprintf (stderr, ISPELL_C_TEMP_DISAPPEARED, tempfile);
+ 	(void) sleep ((unsigned) 2);
+ 	return;
+ 	}
+ 
+ #ifdef TRUNCATEBAK
+     (void) strncpy (bakfile, filename, sizeof bakfile - 1);
+     bakfile[sizeof bakfile - 1] = '\0';
+     if (strcmp(BAKEXT, filename + strlen(filename) - sizeof BAKEXT - 1) != 0)
+ 	{
+ 	pathtail = rindex (bakfile, '/');
+ 	if (pathtail == NULL)
+ 	    pathtail = bakfile;
+ 	else
+ 	    pathtail++;
+ 	if (strlen (pathtail) > MAXNAMLEN - sizeof BAKEXT - 1)
+ 	    pathtail[MAXNAMLEN - sizeof BAKEXT -1] = '\0';
+ 	(void) strcat (pathtail, BAKEXT);
+ 	}
+ #else
+     (void) sprintf (bakfile, "%.*s%s", (int) (sizeof bakfile - sizeof BAKEXT),
+       filename, BAKEXT);
+ #endif
+ 
+     pathtail = rindex (bakfile, '/');
+     if (pathtail == NULL)
+ 	pathtail = bakfile;
+     else
+ 	pathtail++;
+     if (strncmp (filename, bakfile, pathtail - bakfile + MAXNAMLEN) != 0)
+ 	(void) unlink (bakfile);	/* unlink so we can write a new one. */
+ #ifdef HAS_RENAME
+     (void) rename (filename, bakfile);
+ #else /* HAS_RENAME */
+     if (link (filename, bakfile) == 0)
+ 	(void) unlink (filename);
+ #endif /* HAS_RENAME */
+ 
+     /* if we can't write new, preserve .bak regardless of xflag */
+     if ((outfile = fopen (filename, "w")) == NULL)
+ 	{
+ 	(void) fprintf (stderr, CANT_CREATE, filename);
+ 	(void) sleep ((unsigned) 2);
+ 	return;
+ 	}
+ 
+     (void) chmod (filename, statbuf->st_mode);
+ 
+     while ((c = getc (infile)) != EOF)
+ 	(void) putc (c, outfile);
+ 
+     (void) fclose (infile);
+     (void) fclose (outfile);
+ 
+     if (xflag
+       &&  strncmp (filename, bakfile, pathtail - bakfile + MAXNAMLEN) != 0)
+ 	(void) unlink (bakfile);
+     }
+ 
+ static void expandmode (option)
+     int			option;		/* How to print: */
+ 					/* 1 = expansions only */
+ 					/* 2 = original line + expansions */
+ 					/* 3 = original paired w/ expansions */
+ 					/* 4 = add length ratio */
+     {
+     char		buf[BUFSIZ];
+     int			explength;	/* Total length of all expansions */
+     register char *	flagp;		/* Pointer to next flag char */
+     ichar_t		ibuf[BUFSIZ];
+     MASKTYPE		mask[MASKSIZE];
+     char		origbuf[BUFSIZ]; /* Original contents of buf */
+     char		ratiobuf[20];	/* Expansion/root length ratio */
+     int			rootlength;	/* Length of root word */
+     register int	temp;
+ 
+     while (xgets (buf, sizeof buf, stdin) != NULL)
+ 	{
+ 	rootlength = strlen (buf);
+ 	if (buf[rootlength - 1] == '\n')
+ 	  buf[--rootlength] = '\0';
+ 	(void) strcpy (origbuf, buf);
+ 	if ((flagp = index (buf, hashheader.flagmarker)) != NULL)
+ 	    {
+ 	    rootlength = flagp - buf;
+ 	    *flagp++ = '\0';
+ 	    }
+ 	if (option == 2  ||  option == 3  ||  option == 4)
+ 	    (void) printf ("%s ", origbuf);
+ 	if (flagp != NULL)
+ 	    {
+ 	    if (flagp - buf > INPUTWORDLEN)
+ 		buf[INPUTWORDLEN] = '\0';
+ 	    }
+ 	else
+ 	    {
+ 	    if ((int) strlen (buf) > INPUTWORDLEN - 1)
+ 		buf[INPUTWORDLEN] = '\0';
+ 	    }
+ 	(void) fputs (buf, stdout);
+ 	if (flagp != NULL)
+ 	    {
+ 	    (void) bzero ((char *) mask, sizeof (mask));
+ 	    while (*flagp != '\0'  &&  *flagp != '\n')
+ 		{
+ 		temp = CHARTOBIT ((unsigned char) *flagp);
+ 		if (temp >= 0  &&  temp <= LARGESTFLAG)
+ 		    SETMASKBIT (mask, temp);
+ 		else
+ 		    (void) fprintf (stderr, BAD_FLAG, (unsigned char) *flagp);
+ 		flagp++;
+ 		/* Accept old-format dicts with extra slashes */
+ 		if (*flagp == hashheader.flagmarker)
+ 		    flagp++;
+ 		}
+ 	    if (strtoichar (ibuf, buf, sizeof ibuf, 1))
+ 		(void) fprintf (stderr, WORD_TOO_LONG (buf));
+ 	    explength = expand_pre (origbuf, ibuf, mask, option, "");
+ 	    explength += expand_suf (origbuf, ibuf, mask, 0, option, "");
+ 	    explength += rootlength;
+ 	    if (option == 4)
+ 		{
+ 		(void) sprintf (ratiobuf, " %f",
+ 		  (double) explength / (double) rootlength);
+ 		(void) fputs (ratiobuf, stdout);
+ 		(void) expand_pre (origbuf, ibuf, mask, 3, ratiobuf);
+ 		(void) expand_suf (origbuf, ibuf, mask, 0, 3, ratiobuf);
+ 		}
+ 	    }
+ 	(void) putchar ('\n');
+ 	}
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.el
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.el:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.el	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,2381 ----
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;; -*- Mode: emacs-lisp -*- ;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;; GNU EMACS interface for International Ispell Version 3.1 by Geoff Kuenning.
+ ;;;
+ ;;;
+ ;;; Copyright (C) 1994, 1995 Free Software Foundation, Inc.
+ ;;;
+ ;;;
+ ;;; Authors         : Ken Stevens <k.stevens at ieee.org>
+ ;;; Last Modified On: Tue Jun 13 12:05:28 EDT 1995
+ ;;; Update Revision : 2.37
+ ;;; Syntax          : emacs-lisp
+ ;;; Status	    : Release with 3.1.12+ ispell.
+ ;;; Version	    : International Ispell Version 3.1 by Geoff Kuenning.
+ ;;; Bug Reports	    : ispell-el-bugs at itcorp.com
+ ;;;
+ ;;; Note: version numbers and time stamp are not updated
+ ;;;   when this file is edited for release with GNU emacs.
+ ;;;
+ ;;; This file is part of GNU Emacs.
+ ;;;
+ ;;; GNU Emacs 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.
+ ;;;
+ ;;; GNU Emacs 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 GNU Emacs; see the file COPYING.  If not, write to
+ ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+ ;;;
+ ;;; Commentary:
+ ;;;
+ ;;; INSTRUCTIONS
+ ;;;
+ ;;;  This code contains a section of user-settable variables that you should
+ ;;; inspect prior to installation.  Look past the end of the history list.
+ ;;; Set them up for your locale and the preferences of the majority of the
+ ;;; users.  Otherwise the users may need to set a number of variables
+ ;;; themselves.
+ ;;;  You particularly may want to change the default dictionary for your
+ ;;; country and language.
+ ;;;
+ ;;;
+ ;;; To fully install this, add this file to your Emacs Lisp directory and
+ ;;; compile it with M-X byte-compile-file.  Then add the following to the
+ ;;; appropriate init file:
+ ;;;
+ ;;;  (autoload 'ispell-word "ispell"
+ ;;;    "Check the spelling of word in buffer." t)
+ ;;;  (global-set-key "\e$" 'ispell-word)
+ ;;;  (autoload 'ispell-region "ispell"
+ ;;;    "Check the spelling of region." t)
+ ;;;  (autoload 'ispell-buffer "ispell"
+ ;;;    "Check the spelling of buffer." t)
+ ;;;  (autoload 'ispell-complete-word "ispell"
+ ;;;    "Look up current word in dictionary and try to complete it." t)
+ ;;;  (autoload 'ispell-change-dictionary "ispell"
+ ;;;    "Change ispell dictionary." t)
+ ;;;  (autoload 'ispell-message "ispell"
+ ;;;    "Check spelling of mail message or news post.")
+ ;;;
+ ;;;  Depending on the mail system you use, you may want to include these:
+ ;;;
+ ;;;  (add-hook 'news-inews-hook 'ispell-message)
+ ;;;  (add-hook 'mail-send-hook  'ispell-message)
+ ;;;  (add-hook 'mh-before-send-letter-hook 'ispell-message)
+ ;;;
+ ;;;
+ ;;; Ispell has a TeX parser and a nroff parser (the default).
+ ;;; The parsing is controlled by the variable ispell-parser.  Currently
+ ;;; it is just a "toggle" between TeX and nroff, but if more parsers are
+ ;;; added it will be updated.  See the variable description for more info.
+ ;;;
+ ;;;
+ ;;; TABLE OF CONTENTS
+ ;;;
+ ;;;   ispell-word
+ ;;;   ispell-region
+ ;;;   ispell-buffer
+ ;;;   ispell-message
+ ;;;   ispell-continue
+ ;;;   ispell-complete-word
+ ;;;   ispell-complete-word-interior-frag
+ ;;;   ispell-change-dictionary
+ ;;;   ispell-kill-ispell
+ ;;;   ispell-pdict-save
+ ;;;
+ ;;;
+ ;;; Commands in ispell-region:
+ ;;; Character replacement: Replace word with choice.  May query-replace.
+ ;;; ' ': Accept word this time.
+ ;;; 'i': Accept word and insert into private dictionary.
+ ;;; 'a': Accept word for this session.
+ ;;; 'A': Accept word and place in buffer-local dictionary.
+ ;;; 'r': Replace word with typed-in value.  Rechecked.
+ ;;; 'R': Replace word with typed-in value. Query-replaced in buffer. Rechecked.
+ ;;; '?': Show these commands
+ ;;; 'x': Exit spelling buffer.  Move cursor to original point.
+ ;;; 'X': Exit spelling buffer.  Leave cursor at the current point.
+ ;;; 'q': Quit spelling session (Kills ispell process).
+ ;;; 'l': Look up typed-in replacement in alternate dictionary.  Wildcards okay.
+ ;;; 'u': Like 'i', but the word is lower-cased first.
+ ;;; 'm': Like 'i', but allows one to include dictionary completion info.
+ ;;; 'C-l': redraws screen
+ ;;; 'C-r': recursive edit
+ ;;; 'C-z': suspend emacs or iconify frame
+ ;;;
+ ;;; Buffer-Local features:
+ ;;; There are a number of buffer-local features that can be used to customize
+ ;;;  ispell for the current buffer.  This includes language dictionaries,
+ ;;;  personal dictionaries, parsing, and local word spellings.  Each of these
+ ;;;  local customizations are done either through local variables, or by
+ ;;;  including the keyword and argument(s) at the end of the buffer (usually
+ ;;;  prefixed by the comment characters).  See the end of this file for
+ ;;;  examples.  The local keywords and variables are:
+ ;;;
+ ;;;  ispell-dictionary-keyword   language-dictionary
+ ;;;      uses local variable ispell-local-dictionary
+ ;;;  ispell-pdict-keyword        personal-dictionary
+ ;;;      uses local variable ispell-local-pdict
+ ;;;  ispell-parsing-keyword      mode-arg extended-char-arg
+ ;;;  ispell-words-keyword        any number of local word spellings
+ ;;;
+ ;;;
+ ;;; BUGS:
+ ;;;  Highlighting in version 19 still doesn't work on tty's.
+ ;;;  On some versions of emacs, growing the minibuffer fails.
+ ;;;
+ ;;; HISTORY
+ ;;;
+ ;;; Revision 2.37  1995/6/13 12:05:28	stevens
+ ;;; Removed autoload from ispell-dictionary-alist. *choices* mode-line shows
+ ;;; misspelled word.  Block skip for pgp & forwarded messages added.
+ ;;;
+ ;;; Revision 2.36  1995/2/6 17:39:38	stevens
+ ;;; Properly adjust screen with different ispell-choices-win-default-height
+ ;;; settings.  Skips SGML entity references.
+ ;;;
+ ;;; Revision 2.35  1995/1/13 14:16:46	stevens
+ ;;; Skips SGML tags, ispell-change-dictionary fix for add-hook, assure personal
+ ;;; dictionary is saved when called from the menu
+ ;;;
+ ;;; Revision 2.34  1994/12/08 13:17:41  stevens
+ ;;; Interaction corrected to function with all 3.1 ispell versions.
+ ;;;
+ ;;; Revision 2.33  1994/11/24 02:31:20  stevens
+ ;;; Repaired bug introduced in 2.32 that corrupts buffers when correcting.
+ ;;; Improved buffer scrolling. Nondestructive buffer selections allowed.
+ ;;;
+ ;;; Revision 2.32  1994/10/31 21:10:08  geoff
+ ;;; Many revisions accepted from RMS/FSF.  I think (though I don't know) that
+ ;;; this represents an 'official' version.
+ ;;;
+ ;;; Revision 2.31  1994/5/31 10:18:17  stevens
+ ;;; Repaired comments.  buffer-local commands executed in `ispell-word' now.
+ ;;; German dictionary described for extended character mode.  Dict messages.
+ ;;;
+ ;;; Revision 2.30  1994/5/20 22:18:36  stevens
+ ;;; Continue ispell from ispell-word, C-z functionality fixed.
+ ;;;
+ ;;; Revision 2.29  1994/5/12 09:44:33  stevens
+ ;;; Restored ispell-use-ptys-p, ispell-message aborts sends with interrupt.
+ ;;; defined fn ispell
+ ;;;
+ ;;; Revision 2.28  1994/4/28 16:24:40  stevens
+ ;;; Window checking when ispell-message put on gnus-inews-article-hook jwz.
+ ;;; prefixed ispell- to highlight functions and horiz-scroll fn.
+ ;;; Try and respect case of word in ispell-complete-word.
+ ;;; Ignore non-char events.  Ispell-use-ptys-p commented out. Lucid menu.
+ ;;; Better interrupt handling.  ispell-message improvements from Ethan.
+ ;;;
+ ;;; Revision 2.27
+ ;;; version 18 explicit C-g handling disabled as it didn't work. Added
+ ;;; ispell-extra-args for ispell customization (jwz)
+ ;;;
+ ;;; Revision 2.26  1994/2/15 16:11:14  stevens
+ ;;; name changes for copyright assignment.  Added word-frags in complete-word.
+ ;;; Horizontal scroll (John Conover). Query-replace matches words now.  bugs.
+ ;;;
+ ;;; Revision 2.25
+ ;;; minor mods, upgraded ispell-message
+ ;;;
+ ;;; Revision 2.24
+ ;;; query-replace more robust, messages, defaults, ispell-change-dict.
+ ;;;
+ ;;; Revision 2.23  1993/11/22 23:47:03  stevens
+ ;;; ispell-message, Fixed highlighting, added menu-bar, fixed ispell-help, ...
+ ;;;
+ ;;; Revision 2.22
+ ;;; Added 'u' command.  Fixed default in ispell-local-dictionary.
+ ;;; fixed affix rules display.  Tib skipping more robust.  Contributions by
+ ;;; Per Abraham (parser selection), Denis Howe, and Eberhard Mattes.
+ ;;;
+ ;;; Revision 2.21  1993/06/30 14:09:04  stevens
+ ;;; minor bugs. (nroff word skipping fixed)
+ ;;;
+ ;;; Revision 2.20  1993/06/30 14:09:04  stevens
+ ;;;
+ ;;; Debugging and contributions by: Boris Aronov, Rik Faith, Chris Moore,
+ ;;;  Kevin Rodgers, Malcolm Davis.
+ ;;; Particular thanks to Michael Lipp, Jamie Zawinski, Phil Queinnec
+ ;;;  and John Heidemann for suggestions and code.
+ ;;; Major update including many tweaks.
+ ;;; Many changes were integrations of suggestions.
+ ;;; lookup-words rehacked to use call-process (Jamie).
+ ;;; ispell-complete-word rehacked to be compatible with the rest of the
+ ;;; system for word searching and to include multiple wildcards,
+ ;;; and it's own dictionary.
+ ;;; query-replace capability added.  New options 'X', 'R', and 'A'.
+ ;;; buffer-local modes for dictionary, word-spelling, and formatter-parsing.
+ ;;; Many random bugs, like commented comments being skipped, fix to
+ ;;; keep-choices-win, fix for math mode, added pipe mode choice,
+ ;;; fixed 'q' command, ispell-word checks previous word and leave cursor
+ ;;; in same location.  Fixed tib code which could drop spelling regions.
+ ;;; Cleaned up setq calls for efficiency. Gave more context on window overlays.
+ ;;; Assure context on ispell-command-loop.  Window lossage in look cmd fixed.
+ ;;; Due to pervasive opinion, common-lisp package syntax removed. Display
+ ;;; problem when not highlighting.
+ ;;;
+ ;;; Revision 2.19  1992/01/10  10:54:08  geoff
+ ;;; Make another attempt at fixing the "Bogus, dude" problem.  This one is
+ ;;; less elegant, but has the advantage of working.
+ ;;;
+ ;;; Revision 2.18  1992/01/07  10:04:52  geoff
+ ;;; Fix the "Bogus, Dude" problem in ispell-word.
+ ;;;
+ ;;; Revision 2.17  1991/09/12  00:01:42  geoff
+ ;;; Add some changes to make ispell-complete-word work better, though
+ ;;; still not perfectly.
+ ;;;
+ ;;; Revision 2.16  91/09/04  18:00:52  geoff
+ ;;; More updates from Sebastian, to make the multiple-dictionary support
+ ;;; more flexible.
+ ;;;
+ ;;; Revision 2.15  91/09/04  17:30:02  geoff
+ ;;; Sebastian Kremer's tib support
+ ;;;
+ ;;; Revision 2.14  91/09/04  16:19:37  geoff
+ ;;; Don't do set-window-start if the move-to-window-line moved us
+ ;;; downward, rather than upward.  This prevents getting the buffer all
+ ;;; confused.  Also, don't use the "not-modified" function to clear the
+ ;;; modification flag;  instead use set-buffer-modified-p.  This prevents
+ ;;; extra messages from flashing.
+ ;;;
+ ;;; Revision 2.13  91/09/04  14:35:41  geoff
+ ;;; Fix a spelling error in a comment.  Add code to handshake with the
+ ;;; ispell process before sending anything to it.
+ ;;;
+ ;;; Revision 2.12  91/09/03  20:14:21  geoff
+ ;;; Add Sebastian Kremer's multiple-language support.
+ ;;;
+ ;;;
+ ;;; Walt Buehring
+ ;;; Texas Instruments - Computer Science Center
+ ;;; ARPA:  Buehring%TI-CSL at CSNet-Relay
+ ;;; UUCP:  {smu, texsun, im4u, rice} ! ti-csl ! buehring
+ ;;;
+ ;;; ispell-region and associated routines added by
+ ;;; Perry Smith
+ ;;; pedz at bobkat
+ ;;; Tue Jan 13 20:18:02 CST 1987
+ ;;;
+ ;;; extensively modified by Mark Davies and Andrew Vignaux
+ ;;; {mark,andrew}@vuwcomp
+ ;;; Sun May 10 11:45:04 NZST 1987
+ ;;;
+ ;;; Ken Stevens  ARPA: k.stevens at ieee.org
+ ;;; Tue Jan  3 16:59:07 PST 1989
+ ;;; This file has overgone a major overhaul to be compatible with ispell
+ ;;; version 2.1.  Most of the functions have been totally rewritten, and
+ ;;; many user-accessible variables have been added.  The syntax table has
+ ;;; been removed since it didn't work properly anyway, and a filter is
+ ;;; used rather than a buffer.  Regular expressions are used based on
+ ;;; ispell's internal definition of characters (see ispell(4)).
+ ;;; Some new updates:
+ ;;; - Updated to version 3.0 to include terse processing.
+ ;;; - Added a variable for the look command.
+ ;;; - Fixed a bug in ispell-word when cursor is far away from the word
+ ;;;   that is to be checked.
+ ;;; - Ispell places the incorrect word or guess in the minibuffer now.
+ ;;; - fixed a bug with 'l' option when multiple windows are on the screen.
+ ;;; - lookup-words just didn't work with the process filter.  Fixed.
+ ;;; - Rewrote the process filter to make it cleaner and more robust
+ ;;;   in the event of a continued line not being completed.
+ ;;; - Made ispell-init-process more robust in handling errors.
+ ;;; - Fixed bug in continuation location after a region has been modified by
+ ;;;   correcting a misspelling.
+ ;;; Mon 17 Sept 1990
+ ;;;
+ ;;; Sebastian Kremer <sk at thp.uni-koeln.de>
+ ;;; Wed Aug  7 14:02:17 MET DST 1991
+ ;;; - Ported ispell-complete-word from Ispell 2 to Ispell 3.
+ ;;; - Added ispell-kill-ispell command.
+ ;;; - Added ispell-dictionary and ispell-dictionary-alist variables to
+ ;;;   support other than default language.  See their docstrings and
+ ;;;   command ispell-change-dictionary.
+ ;;; - (ispelled it :-)
+ ;;; - Added ispell-skip-tib variable to support the tib bibliography
+ ;;;   program.
+ ;;;
+ ;;;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ 
+ 
+ 
+ ;;; **********************************************************************
+ ;;; The following variables should be set according to personal preference
+ ;;; and location of binaries:
+ ;;; **********************************************************************
+ 
+ 
+ ;;;  ******* THIS FILE IS WRITTEN FOR ISPELL VERSION 3.1
+ ;;; Code:
+ 
+ (defvar ispell-highlight-p t
+   "*Highlight spelling errors when non-nil.")
+ 
+ (defvar ispell-highlight-face 'highlight
+   "*The face used for Ispell highlighting.  For Emacses with overlays.
+ Possible values are `highlight', `modeline', `secondary-selection',
+ `region', and `underline'.
+ This variable can be set by the user to whatever face they desire.
+ It's most convenient if the cursor color and highlight color are
+ slightly different.")
+ 
+ (defvar ispell-check-comments nil
+   "*Spelling of comments checked when non-nil.")
+ 
+ (defvar ispell-query-replace-choices nil
+   "*Corrections made throughout region when non-nil.
+ Uses `query-replace' (\\[query-replace]) for corrections.")
+ 
+ (defvar ispell-skip-tib nil
+   "*Does not spell check `tib' bibliography references when non-nil.
+ Skips any text between strings matching regular expressions
+ `ispell-tib-ref-beginning' and `ispell-tib-ref-end'.
+ 
+ TeX users beware:  Any field starting with [. will skip until a .] -- even
+ your whole buffer -- unless you set `ispell-skip-tib' to nil.  That includes
+ a [.5mm] type of number....")
+ 
+ (defvar ispell-tib-ref-beginning "[[<]\\."
+   "Regexp matching the beginning of a Tib reference.")
+ 
+ (defvar ispell-tib-ref-end "\\.[]>]"
+   "Regexp matching the end of a Tib reference.")
+ 
+ (defvar ispell-keep-choices-win t
+   "*When not nil, the `*Choices*' window remains for spelling session.
+ This minimizes redisplay thrashing.")
+ 
+ (defvar ispell-choices-win-default-height 2
+   "*The default size of the `*Choices*' window, including status line.
+ Must be greater than 1.")
+ 
+ (defvar ispell-program-name "ispell"
+   "Program invoked by \\[ispell-word] and \\[ispell-region] commands.")
+ 
+ (defvar ispell-alternate-dictionary
+   (cond ((file-exists-p "/usr/dict/web2") "/usr/dict/web2")
+ 	((file-exists-p "/usr/share/dict/web2") "/usr/share/dict/web2")
+ 	((file-exists-p "/usr/dict/words") "/usr/dict/words")
+ 	((file-exists-p "/usr/lib/dict/words") "/usr/lib/dict/words")
+ 	((file-exists-p "/usr/share/dict/words") "/usr/share/dict/words")
+ 	((file-exists-p "/sys/dict") "/sys/dict")
+ 	(t "/usr/dict/words"))
+   "*Alternate dictionary for spelling help.")
+ 
+ (defvar ispell-complete-word-dict ispell-alternate-dictionary
+   "*Dictionary used for word completion.")
+ 
+ (defvar ispell-grep-command "egrep"
+   "Name of the grep command for search processes.")
+ 
+ (defvar ispell-grep-options "-i"
+   "String of options to use when running the program in `ispell-grep-command'.
+ Should probably be \"-i\" or \"-e\".
+ Some machines (like the NeXT) don't support \"-i\"")
+ 
+ (defvar ispell-look-command "look"
+   "Name of the look command for search processes.
+ This must be an absolute file name.")
+ 
+ (defvar ispell-look-p (file-exists-p ispell-look-command)
+   "*Non-nil means use `look' rather than `grep'.
+ Default is based on whether `look' seems to be available.")
+ 
+ (defvar ispell-have-new-look nil
+   "*Non-nil means use the `-r' option (regexp) when running `look'.")
+ 
+ (defvar ispell-look-options (if ispell-have-new-look "-dfr" "-df")
+   "String of command options for `ispell-look-command'.")
+ 
+ (defvar ispell-use-ptys-p nil
+   "When non-nil, Emacs uses ptys to communicate with Ispell.
+ When nil, Emacs uses pipes.")
+ 
+ (defvar ispell-following-word nil
+   "*Non-nil means `ispell-word' checks the word around or after point.
+ Otherwise `ispell-word' checks the preceding word.")
+ 
+ (defvar ispell-help-in-bufferp nil
+   "*Non-nil means display interactive keymap help in a buffer.
+ Otherwise use the minibuffer.")
+ 
+ (defvar ispell-quietly nil
+   "*Non-nil means suppress messages in `ispell-word'.")
+ 
+ (defvar ispell-format-word (function upcase)
+   "*Formatting function for displaying word being spell checked.
+ The function must take one string argument and return a string.")
+ 
+ (defvar ispell-personal-dictionary nil
+   "*File name of your personal spelling dictionary, or nil.
+ If nil, the default personal dictionary, \"~/.ispell_DICTNAME\" is used,
+ where DICTNAME is the name of your default dictionary.")
+ 
+ (defvar ispell-silently-savep nil
+   "*When non-nil, save the personal dictionary without confirmation.")
+ 
+ ;;; This variable contains the current dictionary being used if the ispell
+ ;;; process is running.  Otherwise it contains the global default.
+ (defvar ispell-dictionary nil
+   "If non-nil, a dictionary to use instead of the default one.
+ This is passed to the ispell process using the `-d' switch and is
+ used as key in `ispell-dictionary-alist' (which see).
+ 
+ You should set this variable before your first use of Emacs spell-checking
+ commands in the Emacs session, or else use the \\[ispell-change-dictionary]
+ command to change it.  Otherwise, this variable only takes effect in a newly
+ started Ispell process.")
+ 
+ (defvar ispell-extra-args nil
+   "*If non-nil, a list of extra switches to pass to the Ispell program.
+ For example, '(\"-W\" \"3\") to cause it to accept all 1-3 character
+ words as correct.  See also `ispell-dictionary-alist', which may be used
+ for language-specific arguments.")
+ 
+ ;;; ispell-dictionary-alist is set up from two subvariables above
+ ;;; to avoid having very long lines in loaddefs.el.
+ (defvar ispell-dictionary-alist
+ 
+   '((nil				; default (english.aff)
+      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil)
+     ("english"				; make english explicitly selectable
+      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B") nil)
+     ("british"				; british version
+      "[A-Za-z]" "[^A-Za-z]" "[']" nil ("-B" "-d" "british") nil)
+     ("deutsch"				; deutsch.aff
+      "[a-zA-Z\"]" "[^a-zA-Z\"]" "[']" t ("-C") "~tex")
+     ("deutsch8"
+      "[a-zA-Z\304\326\334\344\366\337\374]"
+      "[^a-zA-Z\304\326\334\344\366\337\374]"
+      "[']" t ("-C" "-d" "deutsch") "~latin1")
+     ("nederlands"				; nederlands.aff
+      "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
+      "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
+      "[']" t ("-C") nil)
+     ("nederlands8"				; dutch8.aff
+      "[A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
+      "[^A-Za-z\300-\305\307\310-\317\322-\326\331-\334\340-\345\347\350-\357\361\362-\366\371-\374]"
+      "[']" t ("-C") nil)
+     ("svenska"				;7 bit swedish mode
+      "[A-Za-z}{|\\133\\135\\\\]" "[^A-Za-z}{|\\133\\135\\\\]"
+      "[']" nil ("-C") nil)
+     ("svenska8"				;8 bit swedish mode
+      "[A-Za-z\345\344\366\305\304\366]"  "[^A-Za-z\345\344\366\305\304\366]"
+      "[']" nil ("-C" "-d" "svenska") "~list") ; Add `"-T" "list"' instead?
+     ("francais7"
+      "[A-Za-z]" "[^A-Za-z]" "[`'^---]" t nil nil)
+     ("francais"				; francais.aff
+      "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
+      "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374]"
+      "[---']" t nil "~list")
+     ("francais-tex"			; francais.aff
+      "[A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
+      "[^A-Za-z\300\302\306\307\310\311\312\313\316\317\324\331\333\334\340\342\347\350\351\352\353\356\357\364\371\373\374\\]"
+      "[---'^`\"]" t nil "~tex")
+     ("dansk"				; dansk.aff
+      "[A-Z\306\330\305a-z\346\370\345]" "[^A-Z\306\330\305a-z\346\370\345]"
+      "" nil ("-C") nil)
+     )
+ 
+   "An alist of dictionaries and their associated parameters.
+ 
+ Each element of this list is also a list:
+ 
+ \(DICTIONARY-NAME CASECHARS NOT-CASECHARS OTHERCHARS MANY-OTHERCHARS-P
+         ISPELL-ARGS EXTENDED-CHARACTER-MODE\)
+ 
+ DICTIONARY-NAME is a possible value of variable `ispell-dictionary', nil
+ means the default dictionary.
+ 
+ CASECHARS is a regular expression of valid characters that comprise a
+ word.
+ 
+ NOT-CASECHARS is the opposite regexp of CASECHARS.
+ 
+ OTHERCHARS is a regular expression of other characters that are valid
+ in word constructs.  Otherchars cannot be adjacent to each other in a
+ word, nor can they begin or end a word.  This implies we can't check
+ \"Stevens'\" as a correct possessive and other correct formations.
+ 
+ Hint: regexp syntax requires the hyphen to be declared first here.
+ 
+ MANY-OTHERCHARS-P is non-nil if many otherchars are to be allowed in a
+ word instead of only one.
+ 
+ ISPELL-ARGS is a list of additional arguments passed to the ispell
+ subprocess.
+ 
+ EXTENDED-CHARACTER-MODE should be used when dictionaries are used which
+ have been configured in an Ispell affix file.  (For example, umlauts
+ can be encoded as \\\"a, a\\\", \"a, ...)  Defaults are ~tex and ~nroff
+ in English.  This has the same effect as the command-line `-T' option.
+ The buffer Major Mode controls Ispell's parsing in tex or nroff mode,
+ but the dictionary can control the extended character mode.
+ Both defaults can be overruled in a buffer-local fashion. See
+ `ispell-parsing-keyword' for details on this.
+ 
+ Note that the CASECHARS and OTHERCHARS slots of the alist should
+ contain the same character set as casechars and otherchars in the
+ language.aff file \(e.g., english.aff\).")
+ 
+ 
+ (defvar ispell-menu-map nil "Key map for ispell menu")
+ 
+ (defvar ispell-menu-lucid nil "Spelling menu for Lucid Emacs.")
+ 
+ ;;; Break out lucid menu and split into several calls to avoid having
+ ;;; long lines in loaddefs.el.  Detect need off following constant.
+ 
+ (defconst ispell-menu-map-needed	; make sure this is not Lucid Emacs
+   (and (not ispell-menu-map)
+        (string-lessp "19" emacs-version)
+        ;; make sure this isn't Lucid Emacs
+        (not (string-match "Lucid" emacs-version))))
+ 
+ 
+ ;;; setup dictionary
+ (if ispell-menu-map-needed
+     (let ((dicts (reverse (cons (cons "default" nil) ispell-dictionary-alist)))
+ 	  name)
+       (setq ispell-menu-map (make-sparse-keymap "Spell"))
+       ;; add the dictionaries to the bottom of the list.
+       (while dicts
+ 	(setq name (car (car dicts))
+ 	      dicts (cdr dicts))
+ 	(if (stringp name)
+ 	    (define-key ispell-menu-map (vector (intern name))
+ 	      (cons (concat "Select " (capitalize name))
+ 		    (list 'lambda () '(interactive)
+ 			  (list 'ispell-change-dictionary name))))))))
+ 
+ ;;; define commands in menu in opposite order you want them to appear.
+ (if ispell-menu-map-needed
+     (progn
+       (define-key ispell-menu-map [ispell-change-dictionary]
+ 	'("Change Dictionary" . ispell-change-dictionary))
+       (define-key ispell-menu-map [ispell-kill-ispell]
+ 	'("Kill Process" . ispell-kill-ispell))
+       (define-key ispell-menu-map [ispell-pdict-save]
+ 	'("Save Dictionary" . (lambda () (interactive) (ispell-pdict-save t t))))
+       (define-key ispell-menu-map [ispell-complete-word]
+ 	'("Complete Word" . ispell-complete-word))
+       (define-key ispell-menu-map [ispell-complete-word-interior-frag]
+ 	'("Complete Word Frag" . ispell-complete-word-interior-frag))))
+ 
+ (if ispell-menu-map-needed
+     (progn
+       (define-key ispell-menu-map [ispell-continue]
+ 	'("Continue Check" . ispell-continue))
+       (define-key ispell-menu-map [ispell-word]
+ 	'("Check Word" . ispell-word))
+       (define-key ispell-menu-map [ispell-region]
+ 	'("Check Region" . ispell-region))
+       (define-key ispell-menu-map [ispell-buffer]
+ 	'("Check Buffer" . ispell-buffer))))
+ 
+ (if ispell-menu-map-needed
+     (progn
+       (define-key ispell-menu-map [ispell-message]
+ 	'("Check Message" . ispell-message))
+       (define-key ispell-menu-map [ispell-help]
+ 	;; use (x-popup-menu last-nonmenu-event(list "" ispell-help-list)) ?
+ 	'("Help" . (lambda () (interactive) (describe-function 'ispell-help))))
+       (put 'ispell-region 'menu-enable 'mark-active)
+       (fset 'ispell-menu-map (symbol-value 'ispell-menu-map))))
+ 
+ ;;; Xemacs version 19
+ (if (and (string-lessp "19" emacs-version)
+ 	 (string-match "Lucid" emacs-version))
+     (let ((dicts (cons (cons "default" nil) ispell-dictionary-alist))
+ 	  (current-menubar (or current-menubar default-menubar))
+ 	  (menu
+ 	   '(["Help"		(describe-function 'ispell-help) t]
+ 	     ;;["Help"		(popup-menu ispell-help-list)	t]
+ 	     ["Check Message"	ispell-message			t]
+ 	     ["Check Buffer"	ispell-buffer			t]
+ 	     ["Check Word"	ispell-word			t]
+ 	     ["Check Region"	ispell-region  (or (not zmacs-regions) (mark))]
+ 	     ["Continue Check"	ispell-continue			t]
+ 	     ["Complete Word Frag"ispell-complete-word-interior-frag t]
+ 	     ["Complete Word"	ispell-complete-word		t]
+ 	     ["Kill Process"	ispell-kill-ispell		t]
+ 	     "-"
+ 	     ["Save Dictionary"	(ispell-pdict-save t t)		t]
+ 	     ["Change Dictionary" ispell-change-dictionary	t]))
+ 	  name)
+       (while dicts
+ 	(setq name (car (car dicts))
+ 	      dicts (cdr dicts))
+ 	(if (stringp name)
+ 	    (setq menu (append menu
+ 			       (list
+ 				(vector (concat "Select " (capitalize name))
+ 					(list 'ispell-change-dictionary name)
+ 					t))))))
+       (setq ispell-menu-lucid menu)
+       (if current-menubar
+ 	  (progn
+ 	    (delete-menu-item '("Edit" "Spell")) ; in case already defined
+ 	    (add-menu '("Edit") "Spell" ispell-menu-lucid)))))
+ 
+ 
+ ;;; **********************************************************************
+ ;;; The following are used by ispell, and should not be changed.
+ ;;; **********************************************************************
+ 
+ 
+ ;;; The version must be 3.1 or greater for this version of ispell.el
+ ;;; There is an incompatibility between version 3.1.12 and lower versions.
+ (defconst ispell-required-version '("3.1." 12)
+   "Ispell versions with which this version of ispell.el is known to work.")
+ (defvar ispell-offset 1
+   "Offset that maps protocol differences between ispell 3.1 versions.")
+ 
+ (defun ispell-get-casechars ()
+   (nth 1 (assoc ispell-dictionary ispell-dictionary-alist)))
+ (defun ispell-get-not-casechars ()
+   (nth 2 (assoc ispell-dictionary ispell-dictionary-alist)))
+ (defun ispell-get-otherchars ()
+   (nth 3 (assoc ispell-dictionary ispell-dictionary-alist)))
+ (defun ispell-get-many-otherchars-p ()
+   (nth 4 (assoc ispell-dictionary ispell-dictionary-alist)))
+ (defun ispell-get-ispell-args ()
+   (nth 5 (assoc ispell-dictionary ispell-dictionary-alist)))
+ (defun ispell-get-extended-character-mode ()
+   (nth 6 (assoc ispell-dictionary ispell-dictionary-alist)))
+ 
+ (defvar ispell-process nil
+   "The process object for Ispell.")
+ 
+ (defvar ispell-pdict-modified-p nil
+   "Non-nil means personal dictionary has modifications to be saved.")
+ 
+ ;;; If you want to save the dictionary when quitting, must do so explicitly.
+ ;;; When non-nil, the spell session is terminated.
+ ;;; When numeric, contains cursor location in buffer, and cursor remains there.
+ (defvar ispell-quit nil)
+ 
+ (defvar ispell-filter nil
+   "Output filter from piped calls to Ispell.")
+ 
+ (defvar ispell-filter-continue nil
+   "Control variable for Ispell filter function.")
+ 
+ (defvar ispell-process-directory nil
+   "The directory where `ispell-process' was started.")
+ 
+ (defvar ispell-query-replace-marker (make-marker)
+   "Marker for `query-replace' processing.")
+ 
+ (defvar ispell-checking-message nil
+   "Non-nil when we're checking a mail message")
+ 
+ (defconst ispell-choices-buffer "*Choices*")
+ 
+ (defvar ispell-overlay nil "Overlay variable for Ispell highlighting.")
+ 
+ ;;; *** Buffer Local Definitions ***
+ 
+ ;;; This is the local dictionary to use.  When nil the default dictionary will
+ ;;; be used.  Do not redefine default value or it will override the global!
+ (defvar ispell-local-dictionary nil
+   "If non-nil, a dictionary to use for Ispell commands in this buffer.
+ The value must be a string dictionary name in `ispell-dictionary-alist'.
+ This variable becomes buffer-local when set in any fashion.
+ 
+ Setting ispell-local-dictionary to a value has the same effect as
+ calling \\[ispell-change-dictionary] with that value.  This variable
+ is automatically set when defined in the file with either
+ `ispell-dictionary-keyword' or the Local Variable syntax.")
+ 
+ (make-variable-buffer-local 'ispell-local-dictionary)
+ 
+ ;; Use default directory, unless locally set.
+ (set-default 'ispell-local-dictionary nil)
+ 
+ (defconst ispell-words-keyword "LocalWords: "				      
+   "The keyword for local oddly-spelled words to accept.
+ The keyword will be followed by any number of local word spellings.
+ There can be multiple of these keywords in the file.")
+ 
+ (defconst ispell-dictionary-keyword "Local IspellDict: "
+   "The keyword for local dictionary definitions.
+ There should be only one dictionary keyword definition per file, and it
+ should be followed by a correct dictionary name in `ispell-dictionary-alist'.")
+ 
+ (defconst ispell-parsing-keyword "Local IspellParsing: "
+   "The keyword for overriding default Ispell parsing.
+ Determined by the buffer's major mode and extended-character mode as well as
+ the default dictionary.
+ 
+ The above keyword string should be followed by `latex-mode' or
+ `nroff-mode' to put the current buffer into the desired parsing mode.
+ 
+ Extended character mode can be changed for this buffer by placing
+ a `~' followed by an extended-character mode -- such as `~.tex'.")
+ 
+ (defvar ispell-skip-sgml nil
+   "Skips spell checking of SGML tags and entity references when non-nil.
+ This variable is set when major-mode is sgml-mode or html-mode.")
+ 
+ (defvar ispell-local-pdict ispell-personal-dictionary
+   "A buffer local variable containing the current personal dictionary.
+ If non-nil, the value must be a string, which is a file name.
+ 
+ If you specify a personal dictionary for the current buffer which is
+ different from the current personal dictionary, the effect is similar
+ to calling \\[ispell-change-dictionary].  This variable is automatically
+ set when defined in the file with either `ispell-pdict-keyword' or the
+ local variable syntax.")
+ 
+ (make-variable-buffer-local 'ispell-local-pdict)
+ 
+ (defconst ispell-pdict-keyword "Local IspellPersDict: "
+   "The keyword for defining buffer local dictionaries.")
+ 
+ (defvar ispell-buffer-local-name nil
+   "Contains the buffer name if local word definitions were used.
+ Ispell is then restarted because the local words could conflict.")
+ 
+ (defvar ispell-parser 'use-mode-name
+    "*Indicates whether ispell should parse the current buffer as TeX Code.
+ Special value `use-mode-name' tries to guess using the name of major-mode.
+ Default parser is 'nroff.
+ Currently the only other valid parser is 'tex.
+ 
+ You can set this variable in hooks in your init file -- eg:
+ 
+ (add-hook 'tex-mode-hook (function (lambda () (setq ispell-parser 'tex))))")
+ 
+ (defvar ispell-region-end (make-marker)
+   "Marker that allows spelling continuations.")
+ 
+ (defvar ispell-check-only nil
+   "If non-nil, `ispell-word' does not try to correct the word.")
+ 
+ 
+ ;;; **********************************************************************
+ ;;; **********************************************************************
+ 
+ 
+ (and (string-lessp "19" emacs-version)
+      (not (boundp 'epoch::version))
+      (defalias 'ispell 'ispell-buffer))
+ 
+ ;;;###autoload
+ (define-key global-map "\M-$" 'ispell-word)
+ 
+ ;;;###autoload
+ (defun ispell-word (&optional following quietly continue)
+   "Check spelling of word under or before the cursor.
+ If the word is not found in dictionary, display possible corrections
+ in a window allowing you to choose one.
+ 
+ With a prefix argument (or if CONTINUE is non-nil),
+ resume interrupted spell-checking of a buffer or region.
+ 
+ If optional argument FOLLOWING is non-nil or if `ispell-following-word'
+ is non-nil when called interactively, then the following word
+ \(rather than preceding\) is checked when the cursor is not over a word.
+ When the optional argument QUIETLY is non-nil or `ispell-quietly' is non-nil
+ when called interactively, non-corrective messages are suppressed.
+ 
+ Word syntax described by `ispell-dictionary-alist' (which see).
+ 
+ This will check or reload the dictionary.  Use \\[ispell-change-dictionary]
+ or \\[ispell-region] to update the Ispell process."
+   (interactive (list nil nil current-prefix-arg))
+   (if continue
+       (ispell-continue)
+     (if (interactive-p)
+ 	(setq following ispell-following-word
+ 	      quietly ispell-quietly))
+     (ispell-accept-buffer-local-defs)	; use the correct dictionary
+     (let ((cursor-location (point))	; retain cursor location
+ 	  (word (ispell-get-word following))
+ 	  start end poss replace)
+       ;; destructure return word info list.
+       (setq start (car (cdr word))
+ 	    end (car (cdr (cdr word)))
+ 	    word (car word))
+ 
+       ;; now check spelling of word.
+       (or quietly
+ 	  (message "Checking spelling of %s..."
+ 		   (funcall ispell-format-word word)))
+       (process-send-string ispell-process "%\n") ;put in verbose mode
+       (process-send-string ispell-process (concat "^" word "\n"))
+       ;; wait until ispell has processed word
+       (while (progn
+ 	       (accept-process-output ispell-process)
+ 	       (not (string= "" (car ispell-filter)))))
+       ;;(process-send-string ispell-process "!\n") ;back to terse mode.
+       (setq ispell-filter (cdr ispell-filter))
+       (if (listp ispell-filter)
+ 	  (setq poss (ispell-parse-output (car ispell-filter))))
+       (cond ((eq poss t)
+ 	     (or quietly
+ 		 (message "%s is correct" (funcall ispell-format-word word))))
+ 	    ((stringp poss)
+ 	     (or quietly
+ 		 (message "%s is correct because of root %s"
+ 			  (funcall ispell-format-word word)
+ 			  (funcall ispell-format-word poss))))
+ 	    ((null poss) (message "Error in ispell process"))
+ 	    (ispell-check-only		; called from ispell minor mode.
+ 	     (beep))
+ 	    (t				; prompt for correct word.
+ 	     (save-window-excursion
+ 	       (setq replace (ispell-command-loop
+ 			      (car (cdr (cdr poss)))
+ 			      (car (cdr (cdr (cdr poss))))
+ 			      (car poss) start end)))
+ 	     (cond ((equal 0 replace)
+ 		    (ispell-add-per-file-word-list (car poss)))
+ 		   (replace
+ 		    (setq word (if (atom replace) replace (car replace))
+ 			  cursor-location (+ (- (length word) (- end start))
+ 					     cursor-location))
+ 		    (if (not (equal word (car poss)))
+ 			(progn
+ 			  (delete-region start end)
+ 			  (insert word)))
+ 		    (if (not (atom replace)) ; recheck spelling of replacement
+ 			(progn
+ 			  (goto-char cursor-location)
+ 			  (ispell-word following quietly)))))
+ 	     (if (get-buffer ispell-choices-buffer)
+ 		 (kill-buffer ispell-choices-buffer))))
+       (goto-char cursor-location)	; return to original location
+       (ispell-pdict-save ispell-silently-savep)
+       (if ispell-quit (setq ispell-quit nil)))))
+ 
+ 
+ (defun ispell-get-word (following &optional extra-otherchars)
+   "Return the word for spell-checking according to ispell syntax.
+ If optional argument FOLLOWING is non-nil or if `ispell-following-word'
+ is non-nil when called interactively, then the following word
+ \(rather than preceding\) is checked when the cursor is not over a word.
+ Optional second argument contains otherchars that can be included in word
+ many times.
+ 
+ Word syntax described by `ispell-dictionary-alist' (which see)."
+   (let* ((ispell-casechars (ispell-get-casechars))
+ 	 (ispell-not-casechars (ispell-get-not-casechars))
+ 	 (ispell-otherchars (ispell-get-otherchars))
+ 	 (ispell-many-otherchars-p (ispell-get-many-otherchars-p))
+ 	 (word-regexp (concat ispell-casechars
+ 			      "+\\("
+ 			      ispell-otherchars
+ 			      "?"
+ 			      (if extra-otherchars
+ 				  (concat extra-otherchars "?"))
+ 			      ispell-casechars
+ 			      "+\\)"
+ 			      (if (or ispell-many-otherchars-p
+ 				      extra-otherchars)
+ 				  "*" "?")))
+ 	 did-it-once
+ 	 start end word)
+     ;; find the word
+     (if (not (looking-at ispell-casechars))
+ 	(if following
+ 	    (re-search-forward ispell-casechars (point-max) t)
+ 	  (re-search-backward ispell-casechars (point-min) t)))
+     ;; move to front of word
+     (re-search-backward ispell-not-casechars (point-min) 'start)
+     (while (and (or (looking-at ispell-otherchars)
+ 		    (and extra-otherchars (looking-at extra-otherchars)))
+ 		(not (bobp))
+ 		(or (not did-it-once)
+ 		    ispell-many-otherchars-p))
+       (if (and extra-otherchars (looking-at extra-otherchars))
+ 	  (progn
+ 	    (backward-char 1)
+ 	    (if (looking-at ispell-casechars)
+ 		(re-search-backward ispell-not-casechars (point-min) 'move)))
+ 	(setq did-it-once t)
+ 	(backward-char 1)
+ 	(if (looking-at ispell-casechars)
+ 	    (re-search-backward ispell-not-casechars (point-min) 'move)
+ 	  (backward-char -1))))
+     ;; Now mark the word and save to string.
+     (or (re-search-forward word-regexp (point-max) t)
+ 	(error "No word found to check!"))
+     (setq start (match-beginning 0)
+ 	  end (point)
+ 	  word (buffer-substring start end))
+     (list word start end)))
+ 
+ 
+ ;;; Global ispell-pdict-modified-p is set by ispell-command-loop and
+ ;;; tracks changes in the dictionary.  The global may either be
+ ;;; a value or a list, whose value is the state of whether the
+ ;;; dictionary needs to be saved.
+ 
+ (defun ispell-pdict-save (&optional no-query force-save)
+   "Check to see if the personal dictionary has been modified.
+ If so, ask if it needs to be saved."
+   (interactive (list ispell-silently-savep t))
+   (if (and ispell-pdict-modified-p (listp ispell-pdict-modified-p))
+       (setq ispell-pdict-modified-p (car ispell-pdict-modified-p)))
+   (if (or ispell-pdict-modified-p force-save)
+       (if (or no-query (y-or-n-p "Personal dictionary modified.  Save? "))
+ 	  (progn
+ 	    (process-send-string ispell-process "#\n")
+ 	    (message "Personal dictionary saved."))))
+   ;; unassert variable, even if not saved to avoid questioning.
+   (setq ispell-pdict-modified-p nil))
+ 
+ 
+ (defun ispell-command-loop (miss guess word start end)
+   "Display possible corrections from list MISS.
+ GUESS lists possibly valid affix construction of WORD.
+ Returns nil to keep word.
+ Returns 0 to insert locally into buffer-local dictionary.
+ Returns string for new chosen word.
+ Returns list for new replacement word (will be rechecked).
+ Highlights the word, which is assumed to run from START to END.
+ Global `ispell-pdict-modified-p' becomes a list where the only value
+ indicates whether the dictionary has been modified when option `a' or `i' is
+ used."
+   (let ((textbuf (current-buffer))
+ 	(count ?0)
+ 	(line 2)
+ 	(max-lines (- (window-height) 4)) ; assure 4 context lines.
+ 	(choices miss)
+ 	(window-min-height (min window-min-height
+ 				ispell-choices-win-default-height))
+ 	(command-characters '( ?  ?i ?a ?A ?r ?R ?? ?x ?X ?q ?l ?u ?m ))
+ 	(skipped 0)
+ 	char num result textwin highlighted)
+ 
+     ;; setup the *Choices* buffer with valid data.
+     (save-excursion
+       (set-buffer (get-buffer-create ispell-choices-buffer))
+       (setq mode-line-format (concat "--  %b  --  word: " word))
+       (erase-buffer)
+       (if guess
+ 	  (progn
+ 	    (insert "Affix rules generate and capitalize "
+ 		    "this word as shown below:\n\t")
+ 	    (while guess
+ 	      (if (> (+ 4 (current-column) (length (car guess)))
+ 		     (window-width))
+ 		  (progn
+ 		    (insert "\n\t")
+ 		    (setq line (1+ line))))
+ 	      (insert (car guess) "    ")
+ 	      (setq guess (cdr guess)))
+ 	    (insert "\nUse option `i' if this is a correct composition"
+ 		    " from the derivative root.\n")
+ 	    (setq line (+ line (if choices 3 2)))))
+       (while (and choices
+ 		  (< (if (> (+ 7 (current-column) (length (car choices))
+ 			       (if (> count ?~) 3 0))
+ 			    (window-width))
+ 			 (progn
+ 			   (insert "\n")
+ 			   (setq line (1+ line)))
+ 		       line)
+ 		     max-lines))
+ 	;; not so good if there are over 20 or 30 options, but then, if
+ 	;; there are that many you don't want to scan them all anyway...
+ 	(while (memq count command-characters) ; skip command characters.
+ 	  (setq count (1+ count)
+ 		skipped (1+ skipped)))
+ 	(insert "(" count ") " (car choices) "  ")
+ 	(setq choices (cdr choices)
+ 	      count (1+ count)))
+       (setq count (- count ?0 skipped)))
+ 
+     ;; Assure word is visible
+     (if (not (pos-visible-in-window-p end))
+ 	(sit-for 0))
+     ;; Display choices for misspelled word.
+     (let ((choices-window (get-buffer-window ispell-choices-buffer)))
+       (if choices-window
+ 	  (if (= line (window-height choices-window))
+ 	      (select-window choices-window)
+ 	    ;; *Choices* window changed size.  Adjust the choices window
+ 	    ;; without scrolling the spelled window when possible
+ 	    (let ((window-line (- line (window-height choices-window)))
+ 		  (visible (progn (forward-line -1) (point))))
+ 	      (if (< line ispell-choices-win-default-height)
+ 		  (setq window-line (+ window-line
+ 				       (- ispell-choices-win-default-height
+ 					  line))))
+ 	      (move-to-window-line 0)
+ 	      (forward-line window-line)
+ 	      (set-window-start (selected-window)
+ 				(if (> (point) visible) visible (point)))
+ 	      (goto-char end)
+ 	      (select-window (previous-window)) ; *Choices* window
+ 	      (enlarge-window window-line)))
+ 	;; Overlay *Choices* window when it isn't showing
+ 	(ispell-overlay-window (max line ispell-choices-win-default-height)))
+       (switch-to-buffer ispell-choices-buffer)
+       (goto-char (point-min)))
+ 
+     (select-window (setq textwin (next-window)))
+ 
+     ;; highlight word, protecting current buffer status
+     (unwind-protect
+ 	(progn
+ 	  (if ispell-highlight-p
+ 	      (ispell-highlight-spelling-error start end t))
+ 	  ;; Loop until a valid choice is made.
+ 	  (while
+ 	      (eq
+ 	       t
+ 	       (setq
+ 		result
+ 		(progn
+ 		  (undo-boundary)
+ 		  (message (concat "C-h or ? for more options; SPC to leave "
+ 				   "unchanged, Character to replace word"))
+ 		  (let ((inhibit-quit t))
+ 		    (setq char (if (fboundp 'read-char-exclusive)
+ 				   (read-char-exclusive)
+ 				 (read-char))
+ 			  skipped 0)
+ 		    (if (or quit-flag (= char ?\C-g)) ; C-g is like typing X
+ 			(setq char ?X
+ 			      quit-flag nil)))
+ 		  ;; Adjust num to array offset skipping command characters.
+ 		  (let ((com-chars command-characters))
+ 		    (while com-chars
+ 		      (if (and (> (car com-chars) ?0) (< (car com-chars) char))
+ 			  (setq skipped (1+ skipped)))
+ 		      (setq com-chars (cdr com-chars)))
+ 		    (setq num (- char ?0 skipped)))
+ 
+ 		  (cond
+ 		   ((= char ? ) nil)	; accept word this time only
+ 		   ((= char ?i)		; accept and insert word into pers dict
+ 		    (process-send-string ispell-process (concat "*" word "\n"))
+ 		    (setq ispell-pdict-modified-p '(t)) ; dictionary modified!
+ 		    nil)
+ 		   ((or (= char ?a) (= char ?A)) ; accept word without insert
+ 		    (process-send-string ispell-process (concat "@" word "\n"))
+ 		    (if (null ispell-pdict-modified-p)
+ 			(setq ispell-pdict-modified-p
+ 			      (list ispell-pdict-modified-p)))
+ 		    (if (= char ?A) 0))	; return 0 for ispell-add buffer-local
+ 		   ((or (= char ?r) (= char ?R)) ; type in replacement
+ 		    (if (or (= char ?R) ispell-query-replace-choices)
+ 			(list (read-string "Query-replacement for: " word) t)
+ 		      (cons (read-string "Replacement for: " word) nil)))
+ 		   ((or (= char ??) (= char help-char) (= char ?\C-h))
+ 		    (ispell-help)
+ 		    t)
+ 		   ;; Quit and move point back.
+ 		   ((= char ?x)
+ 		    (ispell-pdict-save ispell-silently-savep)
+ 		    (message "Exited spell-checking")
+ 		    (setq ispell-quit t)
+ 		    nil)
+ 		   ;; Quit and preserve point.
+ 		   ((= char ?X)
+ 		    (ispell-pdict-save ispell-silently-savep)
+ 		    (message
+ 		     (substitute-command-keys
+ 		      (concat "Spell-checking suspended;"
+ 			      " use C-u \\[ispell-word] to resume")))
+ 		    (setq ispell-quit (max (point-min)
+ 					   (- (point) (length word))))
+ 		    nil)
+ 		   ((= char ?q)
+ 		    (if (y-or-n-p "Really kill Ispell process? ")
+ 			(progn
+ 			  (ispell-kill-ispell t) ; terminate process.
+ 			  (setq ispell-quit (or (not ispell-checking-message)
+ 						(point))
+ 				ispell-pdict-modified-p nil))
+ 		      t))		; continue if they don't quit.
+ 		   ((= char ?l)
+ 		    (let ((new-word (read-string
+ 				     "Lookup string (`*' is wildcard): "
+ 				     word))
+ 			  (new-line 2))
+ 		      (if new-word
+ 			  (progn
+ 			    (save-excursion
+ 			      (set-buffer (get-buffer-create
+ 					   ispell-choices-buffer))
+ 			      (erase-buffer)
+ 			      (setq count ?0
+ 				    skipped 0
+ 				    mode-line-format (concat
+ 						      "--  %b  --  word: "
+ 						      new-word)
+ 				    miss (lookup-words new-word)
+ 				    choices miss)
+ 			      (while (and choices ; adjust choices window.
+ 					  (< (if (> (+ 7 (current-column)
+ 						       (length (car choices))
+ 						       (if (> count ?~) 3 0))
+ 						    (window-width))
+ 						 (progn
+ 						   (insert "\n")
+ 						   (setq new-line
+ 							 (1+ new-line)))
+ 					       new-line)
+ 					     max-lines))
+ 				(while (memq count command-characters)
+ 				  (setq count (1+ count)
+ 					skipped (1+ skipped)))
+ 				(insert "(" count ") " (car choices) "  ")
+ 				(setq choices (cdr choices)
+ 				      count (1+ count)))
+ 			      (setq count (- count ?0 skipped)))
+ 			    (select-window (previous-window))
+ 			    (if (and (/= new-line line)
+ 				     (> (max line new-line)
+ 					ispell-choices-win-default-height))
+ 				(let* ((minh ispell-choices-win-default-height)
+ 				       (gr-bl (if (< line minh) ; blanks
+ 						  (- minh line)
+ 						0))
+ 				       (shr-bl (if (< new-line minh) ; blanks
+ 						   (- minh new-line)
+ 						 0)))
+ 				  (if (> new-line line)
+ 				      (enlarge-window (- new-line line gr-bl))
+ 				    (shrink-window (- line new-line shr-bl)))
+ 				  (setq line new-line)))
+ 			    (select-window (next-window)))))
+ 		    t)			; reselect from new choices
+ 		   ((= char ?u)
+ 		    (process-send-string ispell-process
+ 					 (concat "*" (downcase word) "\n"))
+ 		    (setq ispell-pdict-modified-p '(t)) ; dictionary modified!
+ 		    nil)
+ 		   ((= char ?m)		; type in what to insert
+ 		    (process-send-string
+ 		     ispell-process (concat "*" (read-string "Insert: " word)
+ 					    "\n"))
+ 		    (setq ispell-pdict-modified-p '(t))
+ 		    (cons word nil))
+ 		   ((and (>= num 0) (< num count))
+ 		    (if ispell-query-replace-choices ; Query replace flag
+ 			(list (nth num miss) 'query-replace)
+ 		      (nth num miss)))
+ 		   ((= char ?\C-l)
+ 		    (redraw-display) t)
+ 		   ((= char ?\C-r)
+ 		    (save-window-excursion (recursive-edit)) t)
+ 		   ((= char ?\C-z)
+ 		    (funcall (key-binding "\C-z"))
+ 		    t)
+ 		   (t (ding) t))))))
+ 	  result)
+       ;; protected
+       (if ispell-highlight-p		; unhighlight
+ 	  (save-window-excursion
+ 	    (select-window textwin)
+ 	    (ispell-highlight-spelling-error start end))))))
+ 
+ 
+ ;;;###autoload
+ (defun ispell-help ()
+   "Display a list of the options available when a misspelling is encountered.
+ 
+ Selections are:
+ 
+ DIGIT: Replace the word with a digit offered in the *Choices* buffer.
+ SPC:   Accept word this time.
+ `i':   Accept word and insert into private dictionary.
+ `a':   Accept word for this session.
+ `A':   Accept word and place in `buffer-local dictionary'.
+ `r':   Replace word with typed-in value.  Rechecked.
+ `R':   Replace word with typed-in value. Query-replaced in buffer. Rechecked.
+ `?':   Show these commands.
+ `x':   Exit spelling buffer.  Move cursor to original point.
+ `X':   Exit spelling buffer.  Leaves cursor at the current point, and permits
+         the aborted check to be completed later.
+ `q':   Quit spelling session (Kills ispell process).
+ `l':   Look up typed-in replacement in alternate dictionary.  Wildcards okay.
+ `u':   Like `i', but the word is lower-cased first.
+ `m':   Like `i', but allows one to include dictionary completion information.
+ `C-l':  redraws screen
+ `C-r':  recursive edit
+ `C-z':  suspend emacs or iconify frame"
+ 
+   (let ((help-1 (concat "[r/R]eplace word; [a/A]ccept for this session; "
+ 			"[i]nsert into private dictionary"))
+ 	(help-2 (concat "[l]ook a word up in alternate dictionary;  "
+ 			"e[x/X]it;  [q]uit session"))
+ 	(help-3 (concat "[u]ncapitalized insert into dictionary.  "
+ 			"Type 'C-h d ispell-help' for more help")))
+     (save-window-excursion
+       (if ispell-help-in-bufferp
+ 	  (progn
+ 	    (ispell-overlay-window 4)
+ 	    (switch-to-buffer (get-buffer-create "*Ispell Help*"))
+ 	    (insert (concat help-1 "\n" help-2 "\n" help-3))
+ 	    (sit-for 5)
+ 	    (kill-buffer "*Ispell Help*"))
+ 	(select-window (minibuffer-window))
+ 	;;(enlarge-window 2)
+ 	(erase-buffer)
+ 	(cond ((string-match "Lucid" emacs-version)
+ 	       (message help-3)
+ 	       (enlarge-window 1)
+ 	       (message help-2)
+ 	       (enlarge-window 1)
+ 	       (message help-1)
+ 	       (goto-char (point-min)))
+ 	      (t
+ 	       (if (string-lessp "19" emacs-version)
+ 		   (message nil))
+ 	       (enlarge-window 2)
+ 	       (insert (concat help-1 "\n" help-2 "\n" help-3))))
+ 	(sit-for 5)
+ 	(erase-buffer)))))
+ 
+ 
+ (defun lookup-words (word &optional lookup-dict)
+   "Look up word in word-list dictionary.
+ A `*' serves as a wild card.  If no wild cards, `look' is used if it exists.
+ Otherwise the variable `ispell-grep-command' contains the command used to
+ search for the words (usually egrep).
+ 
+ Optional second argument contains the dictionary to use; the default is
+ `ispell-alternate-dictionary'."
+   ;; We don't use the filter for this function, rather the result is written
+   ;; into a buffer.  Hence there is no need to save the filter values.
+   (if (null lookup-dict)
+       (setq lookup-dict ispell-alternate-dictionary))
+ 
+   (let* ((process-connection-type ispell-use-ptys-p)
+ 	 (wild-p (string-match "\\*" word))
+ 	 (look-p (and ispell-look-p	; Only use look for an exact match.
+ 		      (or ispell-have-new-look (not wild-p))))
+ 	 (ispell-grep-buffer (get-buffer-create "*Ispell-Temp*")) ; result buf
+ 	 (prog (if look-p ispell-look-command ispell-grep-command))
+ 	 (args (if look-p ispell-look-options ispell-grep-options))
+ 	 status results loc)
+     (unwind-protect
+ 	(save-window-excursion
+ 	  (message "Starting \"%s\" process..." (file-name-nondirectory prog))
+ 	  (set-buffer ispell-grep-buffer)
+ 	  (if look-p
+ 	      nil
+ 	    ;; convert * to .*
+ 	    (insert "^" word "$")
+ 	    (while (search-backward "*" nil t) (insert "."))
+ 	    (setq word (buffer-string))
+ 	    (erase-buffer))
+ 	  (setq status (call-process prog nil t nil args word lookup-dict))
+ 	  ;; grep returns status 1 and no output when word not found, which
+ 	  ;; is a perfectly normal thing.
+ 	  (if (stringp status)
+ 	      (setq results (cons (format "error: %s exited with signal %s"
+ 					  (file-name-nondirectory prog) status)
+ 				  results))
+ 	    ;; else collect words into `results' in FIFO order
+ 	    (goto-char (point-max))
+ 	    ;; assure we've ended with \n
+ 	    (or (bobp) (= (preceding-char) ?\n) (insert ?\n))
+ 	    (while (not (bobp))
+ 	      (setq loc (point))
+ 	      (forward-line -1)
+ 	      (setq results (cons (buffer-substring (point) (1- loc))
+ 				  results)))))
+       ;; protected
+       (kill-buffer ispell-grep-buffer)
+       (if (and results (string-match ".+: " (car results)))
+ 	  (error "%s error: %s" ispell-grep-command (car results))))
+     results))
+ 
+ 
+ ;;; "ispell-filter" is a list of output lines from the generating function.
+ ;;;   Each full line (ending with \n) is a separate item on the list.
+ ;;; "output" can contain multiple lines, part of a line, or both.
+ ;;; "start" and "end" are used to keep bounds on lines when "output" contains
+ ;;;   multiple lines.
+ ;;; "ispell-filter-continue" is true when we have received only part of a
+ ;;;   line as output from a generating function ("output" did not end with \n)
+ ;;; NOTE THAT THIS FUNCTION WILL FAIL IF THE PROCESS OUTPUT DOESNT END WITH \n!
+ ;;;   This is the case when a process dies or fails. The default behavior
+ ;;;   in this case treats the next input received as fresh input.
+ 
+ (defun ispell-filter (process output)
+   "Output filter function for ispell, grep, and look."
+   (let ((start 0)
+ 	(continue t)
+ 	end)
+     (while continue
+       (setq end (string-match "\n" output start)) ; get text up to the newline.
+       ;; If we get out of sync and ispell-filter-continue is asserted when we
+       ;; are not continuing, treat the next item as a separate list.  When
+       ;; ispell-filter-continue is asserted, ispell-filter *should* always be a
+       ;; list!
+ 
+       ;; Continue with same line (item)?
+       (if (and ispell-filter-continue ispell-filter (listp ispell-filter))
+ 	  ;; Yes.  Add it to the prev item
+ 	  (setcar ispell-filter
+ 		  (concat (car ispell-filter) (substring output start end)))
+ 	;; No. This is a new line and item.
+ 	(setq ispell-filter
+ 	      (cons (substring output start end) ispell-filter)))
+       (if (null end)
+ 	  ;; We've completed reading the output, but didn't finish the line.
+ 	  (setq ispell-filter-continue t continue nil)
+ 	;; skip over newline, this line complete.
+ 	(setq ispell-filter-continue nil end (1+ end))
+ 	(if (= end (length output))	; No more lines in output
+ 	    (setq continue nil)		;  so we can exit the filter.
+ 	  (setq start end))))))		; else move start to next line of input
+ 
+ 
+ ;;; This function destroys the mark location if it is in the word being
+ ;;; highlighted.
+ (defun ispell-highlight-spelling-error-generic (start end &optional highlight)
+   "Highlight the word from START to END with a kludge using `inverse-video'.
+ When the optional third arg HIGHLIGHT is set, the word is highlighted;
+ otherwise it is displayed normally."
+   (let ((modified (buffer-modified-p))	; don't allow this fn to modify buffer
+ 	(buffer-read-only nil)		; Allow highlighting read-only buffers.
+ 	(text (buffer-substring start end)) ; Save highlight region
+ 	(inhibit-quit t)		; inhibit interrupt processing here.
+ 	(buffer-undo-list t))		; don't clutter the undo list.
+     (delete-region start end)
+     (insert-char ?  (- end start))	; mimimize amount of redisplay
+     (sit-for 0)				; update display
+     (if highlight (setq inverse-video (not inverse-video))) ; toggle video
+     (delete-region start end)		; delete whitespace
+     (insert text)			; insert text in inverse video.
+     (sit-for 0)				; update display showing inverse video.
+     (if highlight (setq inverse-video (not inverse-video))) ; toggle video
+     (set-buffer-modified-p modified)))	; don't modify if flag not set.
+ 
+ 
+ (defun ispell-highlight-spelling-error-lucid (start end &optional highlight)
+   "Highlight the word from START to END using `isearch-highlight'.
+ When the optional third arg HIGHLIGHT is set, the word is highlighted,
+ otherwise it is displayed normally."
+   (if highlight
+       (isearch-highlight start end)
+     (isearch-dehighlight t))
+   ;;(sit-for 0)
+   )
+ 
+ 
+ (defun ispell-highlight-spelling-error-overlay (start end &optional highlight)
+   "Highlight the word from START to END using overlays.
+ When the optional third arg HIGHLIGHT is set, the word is highlighted
+ otherwise it is displayed normally.
+ 
+ The variable `ispell-highlight-face' selects the face to use for highlighting."
+   (if highlight
+       (progn
+ 	(setq ispell-overlay (make-overlay start end))
+ 	(overlay-put ispell-overlay 'face ispell-highlight-face))
+     (delete-overlay ispell-overlay)))
+ 
+ 
+ (defun ispell-highlight-spelling-error (start end &optional highlight)
+   (cond
+    ((string-match "Lucid" emacs-version)
+     (ispell-highlight-spelling-error-lucid start end highlight))
+    ((and (string-lessp "19" emacs-version)
+ 	 (featurep 'faces) window-system)
+     (ispell-highlight-spelling-error-overlay start end highlight))
+    (t (ispell-highlight-spelling-error-generic start end highlight))))
+ 
+ 
+ (defun ispell-overlay-window (height)
+   "Create a window covering the top HEIGHT lines of the current window.
+ Ensure that the line above point is still visible but otherwise avoid
+ scrolling the current window.  Leave the new window selected."
+   (save-excursion
+     (let ((oldot (save-excursion (forward-line -1) (point)))
+ 	  (top (save-excursion (move-to-window-line height) (point))))
+       ;; If line above old point (line starting at olddot) would be
+       ;; hidden by new window, scroll it to just below new win
+       ;; otherwise set top line of other win so it doesn't scroll.
+       (if (< oldot top) (setq top oldot))
+       ;; NB: Lemacs 19.9 bug: If a window of size N (N includes the mode
+       ;; line) is demanded, the last line is not visible.
+       ;; At least this happens on AIX 3.2, lemacs w/ Motif, font 9x15.
+       ;; So we increment the height for this case.
+       (if (string-match "19\.9.*Lucid" (emacs-version))
+ 	  (setq height (1+ height)))
+       (split-window nil height)
+       (set-window-start (next-window) top))))
+ 
+ 
+ ;;; Should we add a compound word match return value?
+ (defun ispell-parse-output (output)
+   "Parse the OUTPUT string from Ispell and return:
+ 1: t for an exact match.
+ 2: A string containing the root word for a match via suffix removal.
+ 3: A list of possible correct spellings of the format:
+    '(\"ORIGINAL-WORD\" OFFSET MISS-LIST GUESS-LIST)
+    ORIGINAL-WORD is a string of the possibly misspelled word.
+    OFFSET is an integer giving the line offset of the word.
+    MISS-LIST and GUESS-LIST are possibly null lists of guesses and misses."
+   (cond
+    ((string= output "") t)		; for startup with pipes...
+    ((string= output "*") t)		; exact match
+    ((string= output "-") t)             ; compound word match
+    ((string= (substring output 0 1) "+") ; found cuz of root word
+     (substring output 2))		; return root word
+    (t					; need to process &, ?, and #'s
+     (let ((type (substring output 0 1))	; &, ?, or #
+ 	  (original-word (substring output 2 (string-match " " output 2)))
+ 	  (cur-count 0)			; contains number of misses + guesses
+ 	  count miss-list guess-list offset)
+       (setq output (substring output (match-end 0))) ; skip over misspelling
+       (if (string= type "#")
+ 	  (setq count 0)		; no misses for type #
+ 	(setq count (string-to-int output) ; get number of misses.
+ 	      output (substring output (1+ (string-match " " output 1)))))
+       (setq offset (string-to-int output))
+       (if (string= type "#")		; No miss or guess list.
+ 	  (setq output nil)
+ 	(setq output (substring output (1+ (string-match " " output 1)))))
+       (while output
+ 	(let ((end (string-match ", \\|\\($\\)" output))) ; end of miss/guess.
+ 	  (setq cur-count (1+ cur-count))
+ 	  (if (> cur-count count)
+ 	      (setq guess-list (cons (substring output 0 end) guess-list))
+ 	    (setq miss-list (cons (substring output 0 end) miss-list)))
+ 	  (if (match-end 1)		; True only when at end of line.
+ 	      (setq output nil)		; no more misses or guesses
+ 	    (setq output (substring output (+ end 2))))))
+       (list original-word offset miss-list guess-list)))))
+ 
+ 
+ (defun check-ispell-version ()
+   ;; This is a little wasteful as we actually launch ispell twice: once
+   ;; to make sure it's the right version, and once for real.  But people
+   ;; get confused by version mismatches *all* the time (and I've got the
+   ;; email to prove it) so I think this is worthwhile.  And the -v[ersion]
+   ;; option is the only way I can think of to do this that works with
+   ;; all versions, since versions earlier than 3.0.09 didn't identify
+   ;; themselves on startup.
+   (save-excursion
+     (let ((case-fold-search t)
+ 	  ;; avoid bugs when syntax of `.' changes in various default modes
+ 	  (default-major-mode 'fundamental-mode)
+ 	  status)
+       (set-buffer (get-buffer-create " *ispell-tmp*"))
+       (erase-buffer)
+       (setq status (call-process ispell-program-name nil t nil "-v"))
+       (goto-char (point-min))
+       (if (not (memq status '(0 nil)))
+ 	  (error "%s exited with %s %s" ispell-program-name
+ 		 (if (stringp status) "signal" "code") status))
+       (if (not (re-search-forward
+ 		(concat "\\b\\("
+ 			(regexp-quote (car ispell-required-version))
+ 			"\\)\\([0-9]*\\)\\b")
+ 		nil t))
+ 	  (error
+ 	   "%s version %s* is required: try renaming ispell4.el to ispell.el"
+ 	   ispell-program-name (car ispell-required-version))
+ 	;; check that it is the correct version.
+ 	(if (< (car (read-from-string (buffer-substring
+ 				       (match-beginning 2) (match-end 2))))
+ 	       (car (cdr ispell-required-version)))
+ 	    (setq ispell-offset 0)))
+       (kill-buffer (current-buffer)))))
+ 
+ 
+ (defun ispell-init-process ()
+   "Check status of Ispell process and start if necessary."
+   (if (and ispell-process
+ 	   (eq (process-status ispell-process) 'run)
+ 	   ;; If we're using a personal dictionary, assure
+ 	   ;; we're in the same default directory!
+ 	   (or (not ispell-personal-dictionary)
+ 	       (equal ispell-process-directory default-directory)))
+       (setq ispell-filter nil ispell-filter-continue nil)
+     ;; may need to restart to select new personal dictionary.
+     (ispell-kill-ispell t)
+     (message "Starting new Ispell process...")
+     (sit-for 0)
+     (check-ispell-version)
+     (setq ispell-process
+ 	  (let ((process-connection-type ispell-use-ptys-p))
+ 	    (apply 'start-process
+ 		   "ispell" nil ispell-program-name
+ 		   "-a"			; accept single input lines
+ 		   "-m"			; make root/affix combos not in dict
+ 		   (let (args)
+ 		     ;; Local dictionary becomes the global dictionary in use.
+ 		     (if ispell-local-dictionary
+ 			 (setq ispell-dictionary ispell-local-dictionary))
+ 		     (setq args (ispell-get-ispell-args))
+ 		     (if ispell-dictionary ; use specified dictionary
+ 			 (setq args
+ 			       (append (list "-d" ispell-dictionary) args)))
+ 		     (if ispell-personal-dictionary ; use specified pers dict
+ 			 (setq args
+ 			       (append args
+ 				       (list "-p"
+ 					     (expand-file-name
+ 					      ispell-personal-dictionary)))))
+ 		     (setq args (append args ispell-extra-args))
+ 		     args)))
+ 	  ispell-filter nil
+ 	  ispell-filter-continue nil
+ 	  ispell-process-directory default-directory)
+     (set-process-filter ispell-process 'ispell-filter)
+     (accept-process-output ispell-process) ; Get version ID line
+     (cond ((null ispell-filter)
+ 	   (error "%s did not output version line" ispell-program-name))
+ 	  ((and
+ 	    (stringp (car ispell-filter))
+ 	    (if (string-match "warning: " (car ispell-filter))
+ 		(progn
+ 		  (accept-process-output ispell-process 5) ; 1st was warn msg.
+ 		  (stringp (car ispell-filter)))
+ 	      (null (cdr ispell-filter)))
+ 	    (string-match "^@(#) " (car ispell-filter)))
+ 	   ;; got the version line as expected (we already know it's the right
+ 	   ;; version, so don't bother checking again.)
+ 	   nil)
+ 	  (t
+ 	   ;; Otherwise, it must be an error message.  Show the user.
+ 	   ;; But first wait to see if some more output is going to arrive.
+ 	   ;; Otherwise we get cool errors like "Can't open ".
+ 	   (sleep-for 1)
+ 	   (accept-process-output)
+ 	   (error "%s" (mapconcat 'identity ispell-filter "\n"))))
+     (setq ispell-filter nil)		; Discard version ID line
+     (let ((extended-char-mode (ispell-get-extended-character-mode)))
+       (if extended-char-mode
+ 	  (process-send-string ispell-process
+ 			       (concat extended-char-mode "\n"))))
+     (process-kill-without-query ispell-process)))
+ 
+ ;;;###autoload
+ (defun ispell-kill-ispell (&optional no-error)
+   "Kill current Ispell process (so that you may start a fresh one).
+ With NO-ERROR, just return non-nil if there was no Ispell running."
+   (interactive)
+   (if (not (and ispell-process
+ 		(eq (process-status ispell-process) 'run)))
+       (or no-error
+ 	  (error "There is no ispell process running!"))
+     (kill-process ispell-process)
+     (setq ispell-process nil)
+     (message "Ispell process killed")
+     nil))
+ 
+ 
+ ;;; ispell-change-dictionary is set in some people's hooks.  Maybe this should
+ ;;;  call ispell-init-process rather than wait for a spell checking command?
+ 
+ ;;;###autoload
+ (defun ispell-change-dictionary (dict &optional arg)
+   "Change `ispell-dictionary' (q.v.) and kill old Ispell process.
+ A new one will be started as soon as necessary.
+ 
+ By just answering RET you can find out what the current dictionary is.
+ 
+ With prefix argument, set the default directory."
+   (interactive
+    (list (completing-read
+ 	  "Use new dictionary (RET for current, SPC to complete): "
+ 	  (cons (cons "default" nil) ispell-dictionary-alist) nil t)
+ 	 current-prefix-arg))
+   (if (equal dict "default") (setq dict nil))
+   ;; This relies on completing-read's bug of returning "" for no match
+   (cond ((equal dict "")
+ 	 (message "Using %s dictionary"
+ 		  (or ispell-local-dictionary ispell-dictionary "default")))
+ 	((and (equal dict ispell-dictionary)
+ 	      (or (null ispell-local-dictionary)
+ 		  (equal dict ispell-local-dictionary)))
+ 	 ;; Specified dictionary is the default already.  No-op
+ 	 (and (interactive-p)
+ 	      (message "No change, using %s dictionary" (or dict "default"))))
+ 	(t				; reset dictionary!
+ 	 (if (assoc dict ispell-dictionary-alist)
+ 	     (progn
+ 	       (if (or arg (null dict))	; set default dictionary
+ 		   (setq ispell-dictionary dict))
+ 	       (if (null arg)		; set local dictionary
+ 		   (setq ispell-local-dictionary dict)))
+ 	   (error "Illegal dictionary: %s" dict))
+ 	 (ispell-kill-ispell t)
+ 	 (message "(Next %sIspell command will use %s dictionary)"
+ 		  (cond ((equal ispell-local-dictionary ispell-dictionary)
+ 			 "")
+ 			(arg "global ")
+ 			(t "local "))
+ 		  (or (if (or (equal ispell-local-dictionary ispell-dictionary)
+ 			      (null arg))
+ 			  ispell-local-dictionary
+ 			ispell-dictionary)
+ 		      "default")))))
+ 
+ 
+ ;;; Spelling of comments are checked when ispell-check-comments is non-nil.
+ 
+ ;;;###autoload
+ (defun ispell-region (reg-start reg-end)
+   "Interactively check a region for spelling errors."
+   (interactive "r")			; Don't flag errors on read-only bufs.
+   (ispell-accept-buffer-local-defs)	; set up dictionary, local words, etc.
+   (unwind-protect
+       (save-excursion
+ 	(message "Spell checking %s using %s dictionary..."
+ 		 (if (and (= reg-start (point-min)) (= reg-end (point-max)))
+ 		     (buffer-name) "region")
+ 		 (or ispell-dictionary "default"))
+ 	;; Returns cursor to original location.
+ 	(save-window-excursion
+ 	  (goto-char reg-start)
+ 	  (let ((transient-mark-mode nil)
+ 		ref-type)
+ 	    (while (and (not ispell-quit) (< (point) reg-end))
+ 	      (let ((start (point))
+ 		    (offset-change 0)
+ 		    (end (save-excursion (end-of-line) (min (point) reg-end)))
+ 		    (ispell-casechars (ispell-get-casechars))
+ 		    string)
+ 		(cond			; LOOK AT THIS LINE AND SKIP OR PROCESS
+ 		 ((eolp)		; END OF LINE, just go to next line.
+ 		  (forward-char 1))
+ 		 ((and (null ispell-check-comments) ; SKIPPING COMMENTS
+ 		       comment-start	; skip comments that start on the line.
+ 		       (search-forward comment-start end t)) ; or found here.
+ 		  (if (= (- (point) start) (length comment-start))
+ 		      ;; comment starts the line.  Skip entire line or region
+ 		      (if (string= "" comment-end) ; skip to next line
+ 			  (beginning-of-line 2)	; or jump to comment end.
+ 			(search-forward comment-end reg-end 'limit))
+ 		    ;; Comment later in line.  Check spelling before comment.
+ 		    (let ((limit (- (point) (length comment-start))))
+ 		      (goto-char (1- limit))
+ 		      (if (looking-at "\\\\") ; "quoted" comment, don't skip
+ 			  ;; quoted comment.  Skip over comment-start
+ 			  (if (= start (1- limit))
+ 			      (setq limit (+ limit (length comment-start)))
+ 			    (setq limit (1- limit))))
+ 		      (goto-char start)
+ 		      ;; Only check when "casechars" or math before comment
+ 		      (if (or (re-search-forward ispell-casechars limit t)
+ 			      (re-search-forward "[][()$]" limit t))
+ 			  (setq string
+ 				(concat "^" (buffer-substring start limit)
+ 					"\n")
+ 				offset-change (- offset-change ispell-offset)))
+ 		      (goto-char limit))))
+ 		 ((looking-at "[---#@*+!%~^]") ; SKIP SPECIAL ISPELL CHARACTERS
+ 		  (forward-char 1))
+ 		 ((or (and ispell-skip-tib ; SKIP TIB REFERENCES OR SGML MARKUP
+ 			   (re-search-forward ispell-tib-ref-beginning end t)
+ 			   (setq ref-type 'tib))
+ 		      (and ispell-skip-sgml
+ 			   (search-forward "[<&]" end t)
+ 			   (setq ref-type 'sgml)))
+ 		  (if (or (and (eq 'tib ref-type) ; tib tag is 2 chars.
+ 			       (= (- (point) 2) start))
+ 			  (and (eq 'sgml ref-type) ; sgml skips 1 char.
+ 			       (= (- (point) 1) start)))
+ 		      ;; Skip to end of reference, not necessarily on this line
+ 		      ;; Return an error if tib/sgml reference not found
+ 		      (if (or
+ 			   (and
+ 			    (eq 'tib ref-type)
+ 			    (not
+ 			     (re-search-forward ispell-tib-ref-end reg-end t)))
+ 			   (and (eq 'sgml ref-type)
+ 				(not (search-forward "[>;]" reg-end t))))
+ 			  (progn
+ 			    (ispell-pdict-save ispell-silently-savep)
+ 			    (ding)
+ 			    (message
+ 			     (concat
+ 			      "Open tib or SGML command.  Fix buffer or set "
+ 			      (if (eq 'tib ref-type)
+ 				  "ispell-skip-tib"
+ 				"ispell-skip-sgml")
+ 			      " to nil"))
+ 			    ;; keep cursor at error location
+ 			    (setq ispell-quit (- (point) 2))))
+ 		    ;; Check spelling between reference and start of the line.
+ 		    (let ((limit (- (point) (if (eq 'tib ref-type) 2 1))))
+ 		      (goto-char start)
+ 		      (if (or (re-search-forward ispell-casechars limit t)
+ 			      (re-search-forward "[][()$]" limit t))
+ 			  (setq string
+ 				(concat "^" (buffer-substring start limit)
+ 					"\n")
+ 				offset-change (- offset-change ispell-offset)))
+ 		      (goto-char limit))))
+ 		 ((or (re-search-forward ispell-casechars end t) ; TEXT EXISTS
+ 		      (re-search-forward "[][()$]" end t)) ; or MATH COMMANDS
+ 		  (setq string (concat "^" (buffer-substring start end) "\n")
+ 			offset-change (- offset-change ispell-offset))
+ 		  (goto-char end))
+ 		 (t (beginning-of-line 2))) ; EMPTY LINE, skip it.
+ 
+ 		(setq end (point))	; "end" tracks end of region to check.
+ 
+ 		(if string		; there is something to spell!
+ 		    (let (poss)
+ 		      ;; send string to spell process and get input.
+ 		      (process-send-string ispell-process string)
+ 		      (while (progn
+ 			       (accept-process-output ispell-process)
+ 			       ;; Last item of output contains a blank line.
+ 			       (not (string= "" (car ispell-filter)))))
+ 		      ;; parse all inputs from the stream one word at a time.
+ 		      ;; Place in FIFO order and remove the blank item.
+ 		      (setq ispell-filter (nreverse (cdr ispell-filter)))
+ 		      (while (and (not ispell-quit) ispell-filter)
+ 			(setq poss (ispell-parse-output (car ispell-filter)))
+ 			(if (listp poss) ; spelling error occurred.
+ 			    (let* ((word-start (+ start offset-change
+ 						  (car (cdr poss))))
+ 				   (word-end (+ word-start
+ 						(length (car poss))))
+ 				   replace)
+ 			      (goto-char word-start)
+ 			      ;; Adjust the horizontal scroll & point
+ 			      (ispell-horiz-scroll)
+ 			      (goto-char word-end)
+ 			      (ispell-horiz-scroll)
+ 			      (goto-char word-start)
+ 			      (ispell-horiz-scroll)
+ 			      (if (/= word-end
+ 				      (progn
+ 					(search-forward (car poss) word-end t)
+ 					(point)))
+ 				  ;; This occurs due to filter pipe problems
+ 				  (error
+ 				   (concat "Ispell misalignment: word "
+ 					   "`%s' point %d; please retry")
+ 				   (car poss) word-start))
+ 			      (if ispell-keep-choices-win
+ 				  (setq replace
+ 					(ispell-command-loop
+ 					 (car (cdr (cdr poss)))
+ 					 (car (cdr (cdr (cdr poss))))
+ 					 (car poss) word-start word-end))
+ 				(save-window-excursion
+ 				  (setq replace
+ 					(ispell-command-loop
+ 					 (car (cdr (cdr poss)))
+ 					 (car (cdr (cdr (cdr poss))))
+ 					 (car poss) word-start word-end))))
+ 			      (cond
+ 			       ((and replace (listp replace))
+ 				;; REPLACEMENT WORD entered.  Recheck line
+ 				;; starting with the replacement word.
+ 				(setq ispell-filter nil
+ 				      string (buffer-substring word-start
+ 							       word-end))
+ 				(let ((change (- (length (car replace))
+ 						 (length (car poss)))))
+ 				  ;; adjust regions
+ 				  (setq reg-end (+ reg-end change)
+ 					offset-change (+ offset-change
+ 							 change)))
+ 				(if (not (equal (car replace) (car poss)))
+ 				    (progn
+ 				      (delete-region word-start word-end)
+ 				      (insert (car replace))))
+ 				;; I only need to recheck typed-in replacements
+ 				(if (not (eq 'query-replace
+ 					     (car (cdr replace))))
+ 				    (backward-char (length (car replace))))
+ 				(setq end (point)) ; reposition for recheck
+ 				;; when second arg exists, query-replace, saving regions
+ 				(if (car (cdr replace))
+ 				    (unwind-protect
+ 					(save-window-excursion
+ 					  (set-marker
+ 					   ispell-query-replace-marker reg-end)
+ 					  ;; Assume case-replace &
+ 					  ;; case-fold-search correct?
+ 					  (query-replace string (car replace)
+ 							 t))
+ 				      (setq reg-end
+ 					    (marker-position
+ 					     ispell-query-replace-marker))
+ 				      (set-marker ispell-query-replace-marker
+ 						  nil))))
+ 			       ((or (null replace)
+ 				    (equal 0 replace)) ; ACCEPT/INSERT
+ 				(if (equal 0 replace) ; BUFFER-LOCAL DICT ADD
+ 				    (setq reg-end
+ 					  (ispell-add-per-file-word-list
+ 					   (car poss) reg-end)))
+ 				;; This avoids pointing out the word that was
+ 				;; just accepted (via 'i' or 'a') if it follows
+ 				;; on the same line.
+ 				;; Redo check following the accepted word.
+ 				(if (and ispell-pdict-modified-p
+ 					 (listp ispell-pdict-modified-p))
+ 				    ;; Word accepted.  Recheck line.
+ 				    (setq ispell-pdict-modified-p ; update flag
+ 					  (car ispell-pdict-modified-p)
+ 					  ispell-filter nil ; discontinue check
+ 					  end word-start))) ; reposition loc.
+ 			       (replace	; STRING REPLACEMENT for this word.
+ 				(delete-region word-start word-end)
+ 				(insert replace)
+ 				(let ((change (- (length replace)
+ 						 (length (car poss)))))
+ 				  (setq reg-end (+ reg-end change)
+ 					offset-change (+ offset-change change)
+ 					end (+ end change)))))
+ 			      (if (not ispell-quit)
+ 				  (message
+ 				   (concat "Continuing spelling check using "
+ 					   (or ispell-dictionary "default")
+ 					   " dictionary...")))
+ 			      (sit-for 0)))
+ 			;; finished with line!
+ 			(setq ispell-filter (cdr ispell-filter)))))
+ 		(goto-char end)))))
+ 	(not ispell-quit))
+     ;; protected
+     (if (get-buffer ispell-choices-buffer)
+ 	(kill-buffer ispell-choices-buffer))
+     (if ispell-quit
+ 	(progn
+ 	  ;; preserve or clear the region for ispell-continue.
+ 	  (if (not (numberp ispell-quit))
+ 	      (set-marker ispell-region-end nil)
+ 	    ;; Enable ispell-continue.
+ 	    (set-marker ispell-region-end reg-end)
+ 	    (goto-char ispell-quit))
+ 	  ;; Check for aborting
+ 	  (if (and ispell-checking-message (numberp ispell-quit))
+ 	      (progn
+ 		(setq ispell-quit nil)
+ 		(error "Message send aborted.")))
+ 	  (setq ispell-quit nil))
+       (set-marker ispell-region-end nil)
+       ;; Only save if successful exit.
+       (ispell-pdict-save ispell-silently-savep)
+       (message "Spell-checking done"))))
+ 
+ 
+ 
+ ;;;###autoload
+ (defun ispell-buffer ()
+   "Check the current buffer for spelling errors interactively."
+   (interactive)
+   (ispell-region (point-min) (point-max)))
+ 
+ 
+ ;;;###autoload
+ (defun ispell-continue ()
+   (interactive)
+   "Continue a spelling session after making some changes."
+   (if (not (marker-position ispell-region-end))
+       (message "No session to continue.  Use 'X' command when checking!")
+     (if (not (equal (marker-buffer ispell-region-end) (current-buffer)))
+ 	(message "Must continue ispell from buffer %s"
+ 		 (buffer-name (marker-buffer ispell-region-end)))
+       (ispell-region (point) (marker-position ispell-region-end)))))
+ 
+ 
+ ;;; Horizontal scrolling
+ (defun ispell-horiz-scroll ()
+   "Places point within the horizontal visibility of its window area."
+   (if truncate-lines			; display truncating lines?
+       ;; See if display needs to be scrolled.
+       (let ((column (- (current-column) (max (window-hscroll) 1))))
+ 	(if (and (< column 0) (> (window-hscroll) 0))
+ 	    (scroll-right (max (- column) 10))
+ 	  (if (>= column (- (window-width) 2))
+ 	      (scroll-left (max (- column (window-width) -3) 10)))))))
+ 
+ 
+ ;;; Interactive word completion.
+ ;;; Forces "previous-word" processing.  Do we want to make this selectable?
+ 
+ ;;;###autoload
+ (defun ispell-complete-word (&optional interior-frag)
+   "Look up word before or under point in dictionary (see lookup-words command)
+ and try to complete it.  If optional INTERIOR-FRAG is non-nil then the word
+ may be a character sequence inside of a word.
+ 
+ Standard ispell choices are then available."
+   (interactive "P")
+   (let ((cursor-location (point))
+ 	case-fold-search
+ 	(word (ispell-get-word nil "\\*")) ; force "previous-word" processing.
+ 	start end possibilities replacement)
+     (setq start (car (cdr word))
+ 	  end (car (cdr (cdr word)))
+ 	  word (car word)
+ 	  possibilities
+ 	  (or (string= word "")		; Will give you every word
+ 	      (lookup-words (concat (if interior-frag "*") word "*")
+ 			    ispell-complete-word-dict)))
+     (cond ((eq possibilities t)
+ 	   (message "No word to complete"))
+ 	  ((null possibilities)
+ 	   (message "No match for \"%s\"" word))
+ 	  (t				; There is a modification...
+ 	   (cond			; Try and respect case of word.
+ 	    ((string-match "^[^A-Z]+$" word)
+ 	     (setq possibilities (mapcar 'downcase possibilities)))
+ 	    ((string-match "^[^a-z]+$" word)
+ 	     (setq possibilities (mapcar 'upcase possibilities)))
+ 	    ((string-match "^[A-Z]" word)
+ 	     (setq possibilities (mapcar 'capitalize possibilities))))
+ 	   (save-window-excursion
+ 	     (setq replacement
+ 		   (ispell-command-loop possibilities nil word start end)))
+ 	   (cond
+ 	    ((equal 0 replacement)	; BUFFER-LOCAL ADDITION
+ 	     (ispell-add-per-file-word-list word))
+ 	    (replacement		; REPLACEMENT WORD
+ 	     (delete-region start end)
+ 	     (setq word (if (atom replacement) replacement (car replacement))
+ 		   cursor-location (+ (- (length word) (- end start))
+ 				      cursor-location))
+ 	     (insert word)
+ 	     (if (not (atom replacement)) ; recheck spelling of replacement.
+ 		 (progn
+ 		   (goto-char cursor-location)
+ 		   (ispell-word nil t)))))
+ 	   (if (get-buffer ispell-choices-buffer)
+ 	       (kill-buffer ispell-choices-buffer))))
+     (ispell-pdict-save ispell-silently-savep)
+     (goto-char cursor-location)))
+ 
+ 
+ ;;;###autoload
+ (defun ispell-complete-word-interior-frag ()
+   "Completes word matching character sequence inside a word."
+   (interactive)
+   (ispell-complete-word t))
+ 
+ 
+ ;;; **********************************************************************
+ ;;; 			Ispell Minor Mode
+ ;;; **********************************************************************
+ 
+ (defvar ispell-minor-mode nil
+   "Non-nil if Ispell minor mode is enabled.")
+ ;; Variable indicating that ispell minor mode is active.
+ (make-variable-buffer-local 'ispell-minor-mode)
+ 
+ (or (assq 'ispell-minor-mode minor-mode-alist)
+     (setq minor-mode-alist
+           (cons '(ispell-minor-mode " Spell") minor-mode-alist)))
+ 
+ (defvar ispell-minor-keymap
+   (let ((map (make-sparse-keymap)))
+     (define-key map " " 'ispell-minor-check)
+     (define-key map "\r" 'ispell-minor-check)
+     map)
+   "Keymap used for Ispell minor mode.")
+ 
+ (or (not (boundp 'minor-mode-map-alist))
+     (assoc 'ispell-minor-mode minor-mode-map-alist)
+     (setq minor-mode-map-alist
+           (cons (cons 'ispell-minor-mode ispell-minor-keymap)
+                 minor-mode-map-alist)))
+ 
+ ;;;###autoload
+ (defun ispell-minor-mode (&optional arg)
+   "Toggle Ispell minor mode.
+ With prefix arg, turn Ispell minor mode on iff arg is positive.
+  
+ In Ispell minor mode, pressing SPC or RET
+ warns you if the previous word is incorrectly spelled."
+   (interactive "P")
+   (setq ispell-minor-mode
+ 	(not (or (and (null arg) ispell-minor-mode)
+ 		 (<= (prefix-numeric-value arg) 0))))
+   (force-mode-line-update))
+  
+ (defun ispell-minor-check ()
+   ;; Check previous word then continue with the normal binding of this key.
+   (interactive "*")
+   (let ((ispell-minor-mode nil)
+ 	(ispell-check-only t))
+     (save-restriction
+       (narrow-to-region (point-min) (point))
+       (ispell-word nil t))
+     (call-interactively (key-binding (this-command-keys)))))
+ 
+ 
+ ;;; **********************************************************************
+ ;;; 			Ispell Message
+ ;;; **********************************************************************
+ ;;; Original from D. Quinlan, E. Bradford, A. Albert, and M. Ernst
+ 
+ 
+ (defvar ispell-message-text-end
+   (mapconcat (function identity)
+ 	     '(
+ 	       ;; Matches postscript files.
+ 	       "^%!PS-Adobe-[123].0"
+ 	       ;; Matches uuencoded text
+ 	       "^begin [0-9][0-9][0-9] .*\nM.*\nM.*\nM"
+ 	       ;; Matches shell files (esp. auto-decoding)
+ 	       "^#! /bin/[ck]?sh"
+ 	       ;; Matches context difference listing
+ 	       "\\(diff -c .*\\)?\n\\*\\*\\* .*\n--- .*\n\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*"
+ 	       ;; Matches "----------------- cut here"
+ 	       "^[-=_]+\\s ?cut here")
+ 	     "\\|")
+   "*End of text which will be checked in ispell-message.
+ If it is a string, limit at first occurrence of that regular expression.
+ Otherwise, it must be a function which is called to get the limit.")
+ 
+ 
+ (defvar ispell-message-start-skip
+   (mapconcat (function identity)
+ 	     '(
+ 	       ;; Matches forwarded messages
+ 	       "^---* Forwarded Message"
+ 	       ;; Matches PGP Public Key block
+ 	       "^---*BEGIN PGP [A-Z ]*--*"
+ 	       )
+ 	     "\\|")
+   "Spelling is skipped inside these start/end groups by ispell-message.
+ Assumed that blocks are not mutually inclusive.")
+ 
+ 
+ (defvar ispell-message-end-skip
+   (mapconcat (function identity)
+ 	     '(
+ 	       ;; Matches forwarded messages
+ 	       "^--- End of Forwarded Message"
+ 	       ;; Matches PGP Public Key block
+ 	       "^---*END PGP [A-Z ]*--*"
+ 	       )
+ 	     "\\|")
+   "Spelling is skipped inside these start/end groups by ispell-message.
+ Assumed that blocks are not mutually inclusive.")
+ 
+ 
+ ;;;###autoload
+ (defun ispell-message ()
+   "Check the spelling of a mail message or news post.
+ Don't check spelling of message headers except the Subject field.
+ Don't check included messages.
+ 
+ To abort spell checking of a message REGION and send the message anyway,
+ use the `x' or `q' command.  (Any subsequent regions will be checked.)
+ The `X' command aborts the message send so that you can edit the buffer.
+ 
+ To spell-check whenever a message is sent, include the appropriate lines
+ in your .emacs file:
+    (add-hook 'news-inews-hook 'ispell-message)
+    (add-hook 'mail-send-hook  'ispell-message)
+    (add-hook 'mh-before-send-letter-hook 'ispell-message)
+ 
+ You can bind this to the key C-c i in GNUS or mail by adding to
+ `news-reply-mode-hook' or `mail-mode-hook' the following lambda expression:
+    (function (lambda () (local-set-key \"\\C-ci\" 'ispell-message)))"
+   (interactive)
+   (save-excursion
+     (goto-char (point-min))
+     (let* ((internal-messagep (save-excursion
+ 				(re-search-forward
+ 				 (concat "^"
+ 					 (regexp-quote mail-header-separator)
+ 					 "$")
+ 				 nil t)))
+ 	   (limit (copy-marker
+ 		   (cond
+ 		    ((not ispell-message-text-end) (point-max))
+ 		    ((char-or-string-p ispell-message-text-end)
+ 		     (if (re-search-forward ispell-message-text-end nil t)
+ 			 (match-beginning 0)
+ 		       (point-max)))
+ 		    (t (min (point-max) (funcall ispell-message-text-end))))))
+ 	   (cite-regexp			;Prefix of inserted text
+ 	    (cond
+ 	     ((featurep 'supercite)	; sc 3.0
+ 	      (concat "\\(" (sc-cite-regexp) "\\)" "\\|"
+ 		      (ispell-non-empty-string sc-reference-tag-string)))
+ 	     ((featurep 'sc)		; sc 2.3
+ 	      (concat "\\(" sc-cite-regexp "\\)" "\\|"
+ 		      (ispell-non-empty-string sc-reference-tag-string)))
+ 	     ((equal major-mode 'news-reply-mode) ;GNUS
+ 	      (concat "In article <" "\\|"
+ 		      (if mail-yank-prefix
+ 			  (ispell-non-empty-string mail-yank-prefix)
+ 			"^   \\|^\t")))
+ 	     ((equal major-mode 'mh-letter-mode) ; mh mail message
+ 	      (ispell-non-empty-string mh-ins-buf-prefix))
+ 	     ((not internal-messagep)	; Assume n sent us this message.
+ 	      (concat "In [a-zA-Z.]+ you write:" "\\|"
+ 		      "In <[^,;&+=]+> [^,;&+=]+ writes:" "\\|"
+ 		      " *> *"))
+ 	     ((boundp 'vm-included-text-prefix) ; VM mail message
+ 	      (concat "[^,;&+=]+ writes:" "\\|"
+ 		      (ispell-non-empty-string vm-included-text-prefix)))
+ 	     (mail-yank-prefix		; vanilla mail message.
+ 	      (ispell-non-empty-string mail-yank-prefix))
+ 	     (t "^   \\|^\t")))
+ 	   (cite-regexp-start (concat "^[ \t]*$\\|" cite-regexp))
+ 	   (cite-regexp-end   (concat "^\\(" cite-regexp "\\)"))
+ 	   (old-case-fold-search case-fold-search)
+ 	   (case-fold-search t)
+ 	   (ispell-checking-message t))
+       (goto-char (point-min))
+       ;; Skip header fields except Subject: without Re:'s
+       ;;(search-forward mail-header-separator nil t)
+       (while (if internal-messagep
+ 		 (< (point) internal-messagep)
+ 	       (and (looking-at "[a-zA-Z---]+:\\|\t\\| ")
+ 		    (not (eobp))))
+ 	(if (looking-at "Subject: *")	; Spell check new subject fields
+ 	    (progn
+ 	      (goto-char (match-end 0))
+ 	      (if (and (not (looking-at ".*Re\\>"))
+ 		       (not (looking-at "\\[")))
+ 		  (let ((case-fold-search old-case-fold-search))
+ 		    (ispell-region (point)
+ 				   (progn
+ 				     (end-of-line)
+ 				     (while (looking-at "\n[ \t]")
+ 				       (end-of-line 2))
+ 				     (point)))))))
+ 	(forward-line 1))
+       (setq case-fold-search nil)
+       ;; Skip mail header, particularly for non-english languages.
+       (if (looking-at (concat (regexp-quote mail-header-separator) "$"))
+ 	  (forward-line 1))
+       (while (< (point) limit)
+ 	;; Skip across text cited from other messages.
+ 	(while (and (looking-at cite-regexp-start)
+ 		    (< (point) limit)
+ 		    (zerop (forward-line 1))))
+ 
+ 	(if (< (point) limit)
+ 	    (let* ((start (point))
+ 		   ;; Check the next batch of lines that *aren't* cited.
+ 		   (end-c (and (re-search-forward cite-regexp-end limit 'end)
+ 			       (match-beginning 0)))
+ 		   ;; Skip a block of included text.
+ 		   (end-fwd (and (goto-char start)
+ 				 (re-search-forward ispell-message-start-skip
+ 						    limit 'end)
+ 				 (progn (beginning-of-line)
+ 					(point))))
+ 		   (end (or (and end-c end-fwd (min end-c end-fwd))
+ 			    end-c end-fwd
+ 			    ;; defalut to limit of text.
+ 			    (marker-position limit))))
+ 	      (goto-char start)
+ 	      (ispell-region start end)
+ 	      (if (and end-fwd (= end end-fwd))
+ 		  (progn
+ 		    (goto-char end)
+ 		    (re-search-forward ispell-message-end-skip limit 'end))
+ 		(goto-char end)))))
+       (set-marker limit nil))))
+ 
+ 
+ (defun ispell-non-empty-string (string)
+   (if (or (not string) (string-equal string ""))
+       "\\'\\`" ; An unmatchable string if string is null.
+     (regexp-quote string)))
+ 
+ 
+ ;;; **********************************************************************
+ ;;; 			Buffer Local Functions
+ ;;; **********************************************************************
+ 
+ 
+ (defun ispell-accept-buffer-local-defs ()
+   "Load all buffer-local information, restarting ispell when necessary."
+   (ispell-buffer-local-dict)		; May kill ispell-process.
+   (ispell-buffer-local-words)		; Will initialize ispell-process.
+   (ispell-buffer-local-parsing))
+ 
+ 
+ (defun ispell-buffer-local-parsing ()
+   "Place Ispell into parsing mode for this buffer.
+ Overrides the default parsing mode.
+ Includes latex/nroff modes and extended character mode."
+   ;; (ispell-init-process) must already be called.
+   (process-send-string ispell-process "!\n") ; Put process in terse mode.
+   ;; We assume all major modes with "tex-mode" in them should use latex parsing
+   (if (or (and (eq ispell-parser 'use-mode-name)
+ 	       (string-match "[Tt][Ee][Xx]-mode" (symbol-name major-mode)))
+ 	  (eq ispell-parser 'tex))
+       (process-send-string ispell-process "+\n") ; set ispell mode to tex
+     (process-send-string ispell-process "-\n"))	; set mode to normal (nroff)
+   ;; Hard-wire test for SGML & HTML mode.
+   (setq ispell-skip-sgml (memq major-mode '(sgml-mode html-mode)))
+   ;; Set default extended character mode for given buffer, if any.
+   (let ((extended-char-mode (ispell-get-extended-character-mode)))
+     (if extended-char-mode
+ 	(process-send-string ispell-process (concat extended-char-mode "\n"))))
+   ;; Set buffer-local parsing mode and extended character mode, if specified.
+   (save-excursion
+     (goto-char (point-min))
+     ;; Uses last valid definition
+     (while (search-forward ispell-parsing-keyword nil t)
+       (let ((end (save-excursion (end-of-line) (point)))
+ 	    (case-fold-search t)
+ 	    string)
+ 	(while (re-search-forward " *\\([^ \"]+\\)" end t)
+ 	  ;; space separated definitions.
+ 	  (setq string (buffer-substring (match-beginning 1) (match-end 1)))
+ 	  (cond ((string-match "latex-mode" string)
+ 		 (process-send-string ispell-process "+\n~tex\n"))
+ 		((string-match "nroff-mode" string)
+ 		 (process-send-string ispell-process "-\n~nroff"))
+ 		((string-match "~" string) ; Set extended character mode.
+ 		 (process-send-string ispell-process (concat string "\n")))
+ 		(t (message "Illegal Ispell Parsing argument!")
+ 		   (sit-for 2))))))))
+ 
+ 
+ ;;; Can kill the current ispell process
+ 
+ (defun ispell-buffer-local-dict ()
+   "Initializes local dictionary.
+ When a dictionary is defined in the buffer (see variable
+ `ispell-dictionary-keyword'), it will override the local setting
+ from \\[ispell-change-dictionary].
+ Both should not be used to define a buffer-local dictionary."
+   (save-excursion
+     (goto-char (point-min))
+     (let (end)
+       ;; Override the local variable definition.
+       ;; Uses last valid definition.
+       (while (search-forward ispell-dictionary-keyword nil t)
+ 	(setq end (save-excursion (end-of-line) (point)))
+ 	(if (re-search-forward " *\\([^ \"]+\\)" end t)
+ 	    (setq ispell-local-dictionary
+ 		  (buffer-substring (match-beginning 1) (match-end 1)))))
+       (goto-char (point-min))
+       (while (search-forward ispell-pdict-keyword nil t)
+ 	(setq end (save-excursion (end-of-line) (point)))
+ 	(if (re-search-forward " *\\([^ \"]+\\)" end t)
+ 	    (setq ispell-local-pdict
+ 		  (buffer-substring (match-beginning 1) (match-end 1)))))))
+   ;; Reload if new personal dictionary defined.
+   (if (and ispell-local-pdict
+ 	   (not (equal ispell-local-pdict ispell-personal-dictionary)))
+       (progn
+ 	(ispell-kill-ispell t)
+ 	(setq ispell-personal-dictionary ispell-local-pdict)))
+   ;; Reload if new dictionary defined.
+   (if (and ispell-local-dictionary
+ 	   (not (equal ispell-local-dictionary ispell-dictionary)))
+       (ispell-change-dictionary ispell-local-dictionary)))
+ 
+ 
+ (defun ispell-buffer-local-words ()
+   "Loads the buffer-local dictionary in the current buffer."
+   (if (and ispell-buffer-local-name
+ 	   (not (equal ispell-buffer-local-name (buffer-name))))
+       (progn
+ 	(ispell-kill-ispell t)
+ 	(setq ispell-buffer-local-name nil)))
+   (ispell-init-process)
+   (save-excursion
+     (goto-char (point-min))
+     (while (search-forward ispell-words-keyword nil t)
+       (or ispell-buffer-local-name
+ 	  (setq ispell-buffer-local-name (buffer-name)))
+       (let ((end (save-excursion (end-of-line) (point)))
+ 	    string)
+ 	;; buffer-local words separated by a space, and can contain
+ 	;; any character other than a space.
+ 	(while (re-search-forward " *\\([^ ]+\\)" end t)
+ 	  (setq string (buffer-substring (match-beginning 1) (match-end 1)))
+ 	  (process-send-string ispell-process (concat "@" string "\n")))))))
+ 
+ 
+ ;;; returns optionally adjusted region-end-point.
+ 
+ (defun ispell-add-per-file-word-list (word &optional reg-end)
+   "Adds new word to the per-file word list."
+   (or ispell-buffer-local-name
+       (setq ispell-buffer-local-name (buffer-name)))
+   (if (null reg-end)
+       (setq reg-end 0))
+   (save-excursion
+     (goto-char (point-min))
+     (let (case-fold-search line-okay search done string)
+       (while (not done)
+ 	(setq search (search-forward ispell-words-keyword nil 'move)
+ 	      line-okay (< (+ (length word) 1 ; 1 for space after word..
+ 			      (progn (end-of-line) (current-column)))
+ 			   80))
+ 	(if (or (and search line-okay)
+ 		(null search))
+ 	    (progn
+ 	      (setq done t)
+ 	      (if (null search)
+ 		  (progn
+ 		    (open-line 1)
+ 		    (setq string (concat comment-start " "
+ 					 ispell-words-keyword))
+ 		    ;; in case the keyword is in the middle of the file....
+ 		    (if (> reg-end (point))
+ 			(setq reg-end (+ reg-end (length string))))
+ 		    (insert string)
+ 		    (if (and comment-end (not (equal "" comment-end)))
+ 			(save-excursion
+ 			  (open-line 1)
+ 			  (forward-line 1)
+ 			  (insert comment-end)))))
+ 	      (if (> reg-end (point))
+ 		  (setq reg-end (+ 1 reg-end (length word))))
+ 	      (insert (concat " " word)))))))
+   reg-end)
+ 
+ 
+ (defconst ispell-version "2.37 -- Tue Jun 13 12:05:28 EDT 1995")
+ 
+ (provide 'ispell)
+ 
+ 
+ ;;; LOCAL VARIABLES AND BUFFER-LOCAL VALUE EXAMPLES.
+ 
+ ;;; Local Variable options:
+ ;;; mode: name(-mode)
+ ;;; eval: expression
+ ;;; local-variable: value
+ 
+ ;;; The following sets the buffer local dictionary to english!
+ 
+ ;;; Local Variables:
+ ;;; mode: emacs-lisp
+ ;;; comment-column: 40
+ ;;; ispell-local-dictionary: "english"
+ ;;; End:
+ 
+ 
+ ;;; MORE EXAMPLES OF ISPELL BUFFER-LOCAL VALUES
+ 
+ ;;; The following places this file in nroff parsing and extended char modes.
+ ;;; Local IspellParsing: nroff-mode ~nroff
+ ;;; Change IspellDict to IspellDict: to enable the following line.
+ ;;; Local IspellDict english
+ ;;; Change IspellPersDict to IspellPersDict: to enable the following line.
+ ;;; Local IspellPersDict ~/.ispell_lisp
+ ;;; The following were automatically generated by ispell using the 'A' command:
+ ; LocalWords:  ispell ispell-highlight-p ispell-check-comments query-replace
+ ; LocalWords:  ispell-query-replace-choices ispell-skip-tib non-nil tib
+ ; LocalWords:  regexps ispell-tib-ref-beginning ispell-tib-ref-end
+ 
+ ;; ispell.el ends here
+ 


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,652 ----
+ /*
+  * $Id: ispell.h,v 1.1 2007/01/09 23:57:18 lattner Exp $
+  */
+ 
+ /*
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: ispell.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:58:54  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.68  1995/03/06  02:42:41  geoff
+  * Be vastly more paranoid about parenthesizing macro arguments.  This
+  * fixes a bug in defmt.c where a complex argument was passed to
+  * isstringch.
+  *
+  * Revision 1.67  1995/01/03  19:24:12  geoff
+  * Get rid of a non-global declaration.
+  *
+  * Revision 1.66  1994/12/27  23:08:49  geoff
+  * Fix a lot of subtly bad assumptions about the widths of ints and longs
+  * which only show up on 64-bit machines like the Cray and the DEC Alpha.
+  *
+  * Revision 1.65  1994/11/02  06:56:10  geoff
+  * Remove the anyword feature, which I've decided is a bad idea.
+  *
+  * Revision 1.64  1994/10/25  05:46:18  geoff
+  * Add the FF_ANYWORD flag for defining an affix that will apply to any
+  * word, even if not explicitly specified.  (Good for French.)
+  *
+  * Revision 1.63  1994/09/16  04:48:28  geoff
+  * Make stringdups and laststringch unsigned ints, and dupnos a plain
+  * int, so that we can handle more than 128 stringchars and stringchar
+  * types.
+  *
+  * Revision 1.62  1994/09/01  06:06:39  geoff
+  * Change erasechar/killchar to uerasechar/ukillchar to avoid
+  * shared-library problems on HP systems.
+  *
+  * Revision 1.61  1994/08/31  05:58:35  geoff
+  * Add contextoffset, used in -a mode to handle extremely long lines.
+  *
+  * Revision 1.60  1994/05/17  06:44:15  geoff
+  * Add support for controlled compound formation and the COMPOUNDONLY
+  * option to affix flags.
+  *
+  * Revision 1.59  1994/03/15  06:25:16  geoff
+  * Change deftflag's initialization so we can tell if -t/-n appeared.
+  *
+  * Revision 1.58  1994/02/07  05:53:28  geoff
+  * Add typecasts to the the 7-bit versions of ichar* routines
+  *
+  * Revision 1.57  1994/01/25  07:11:48  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include <stdio.h>
+ 
+ #ifdef __STDC__
+ #define P(x)	x
+ #define VOID	void
+ #else /* __STDC__ */
+ #define P(x)	()
+ #define VOID	char
+ #define const
+ #endif /* __STDC__ */
+ 
+ #ifdef NO8BIT
+ #define SET_SIZE	128
+ #else
+ #define SET_SIZE	256
+ #endif
+ 
+ #define MASKSIZE	(MASKBITS / MASKTYPE_WIDTH)
+ 
+ #ifdef lint
+ extern void	SETMASKBIT P ((MASKTYPE * mask, int bit));
+ extern void	CLRMASKBIT P ((MASKTYPE * mask, int bit));
+ extern int	TSTMASKBIT P ((MASKTYPE * mask, int bit));
+ #else /* lint */
+ /* The following is really testing for MASKSIZE <= 1, but cpp can't do that */
+ #if MASKBITS <= MASKTYPE_WIDTH
+ #define SETMASKBIT(mask, bit) ((mask)[0] |= (MASKTYPE) 1 << (bit))
+ #define CLRMASKBIT(mask, bit) ((mask)[0] &= (MASKTYPE) ~(1 << (bit)))
+ #define TSTMASKBIT(mask, bit) ((mask)[0] & ((MASKTYPE) 1 << (bit)))
+ #else
+ #define SETMASKBIT(mask, bit) \
+ 		    ((mask)[(bit) / MASKTYPE_WIDTH] |= \
+ 		      (MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1)))
+ #define CLRMASKBIT(mask, bit) \
+ 		    ((mask)[(bit) / MASKTYPE_WIDTH] &= \
+ 		      ~((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
+ #define TSTMASKBIT(mask, bit) \
+ 		    ((mask)[(bit) / MASKTYPE_WIDTH] & \
+ 		      ((MASKTYPE) 1 << ((bit) & (MASKTYPE_WIDTH - 1))))
+ #endif
+ #endif /* lint */
+ 
+ #if MASKBITS > 64
+ #define FULLMASKSET
+ #endif
+ 
+ #ifdef lint
+ extern int	BITTOCHAR P ((int bit));
+ extern int	CHARTOBIT P ((int ch));
+ #endif /* lint */
+ 
+ #if MASKBITS <= 32
+ # ifndef lint
+ #define BITTOCHAR(bit)	((bit) + 'A')
+ #define CHARTOBIT(ch)	((ch) - 'A')
+ # endif /* lint */
+ #define LARGESTFLAG	26	/* 5 are needed for flagfield below */
+ #define FLAGBASE	((MASKTYPE_WIDTH) - 6)
+ #else
+ # if MASKBITS <= 64
+ #  ifndef lint
+ #define BITTOCHAR(bit)	((bit) + 'A')
+ #define CHARTOBIT(ch)	((ch) - 'A')
+ #  endif /* lint */
+ #define LARGESTFLAG	(64 - 6) /* 5 are needed for flagfield below */
+ #define FLAGBASE	((MASKTYPE_WIDTH) - 6)
+ # else
+ #  ifndef lint
+ #define BITTOCHAR(bit)	(bit)
+ #define CHARTOBIT(ch)	(ch)
+ #  endif /* lint */
+ #define LARGESTFLAG	MASKBITS /* flagfield is a separate field */
+ #define FLAGBASE	0
+ # endif
+ #endif
+ 
+ /*
+ ** Data type for internal word storage.  If necessary, we use shorts rather
+ ** than chars so that string characters can be encoded as a single unit.
+ */
+ #if (SET_SIZE + MAXSTRINGCHARS) <= 256
+ #ifndef lint
+ #define ICHAR_IS_CHAR
+ #endif /* lint */
+ #endif
+ 
+ #ifdef ICHAR_IS_CHAR
+ typedef unsigned char	ichar_t;	/* Internal character */
+ #define icharlen(s)	strlen ((char *) (s))
+ #define icharcpy(a, b)	strcpy ((char *) (a), (char *) (b))
+ #define icharcmp(a, b)	strcmp ((char *) (a), (char *) (b))
+ #define icharncmp(a, b, n) strncmp ((char *) (a), (char *) (b), (n))
+ #define chartoichar(x)	((ichar_t) (x))
+ #else
+ typedef unsigned short	ichar_t;	/* Internal character */
+ #define chartoichar(x)	((ichar_t) (unsigned char) (x))
+ #endif
+ 
+ struct dent
+     {
+     struct dent *	next;
+     char *		word;
+     MASKTYPE		mask[MASKSIZE];
+ #ifdef FULLMASKSET
+     char		flags;
+ #endif
+     };
+ 
+ /*
+ ** Flags in the directory entry.  If FULLMASKSET is undefined, these are
+ ** stored in the highest bits of the last longword of the mask field.  If
+ ** FULLMASKSET is defined, they are stored in the extra "flags" field.
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ **
+ ** If a word has only one capitalization form, and that form is not
+ ** FOLLOWCASE, it will have exactly one entry in the dictionary.  The
+ ** legal capitalizations will be indicated by the 2-bit capitalization
+ ** field, as follows:
+ **
+ **	ALLCAPS		The word must appear in all capitals.
+ **	CAPITALIZED	The word must be capitalized (e.g., London).
+ **			It will also be accepted in all capitals.
+ **	ANYCASE		The word may appear in lowercase, capitalized,
+ **			or all-capitals.
+ **
+ ** Regardless of the capitalization flags, the "word" field of the entry
+ ** will point to an all-uppercase copy of the word.  This is to simplify
+ ** the large portion of the code that doesn't care about capitalization.
+ ** Ispell will generate the correct version when needed.
+ **
+ ** If a word has more than one capitalization, there will be multiple
+ ** entries for it, linked together by the "next" field.  The initial
+ ** entry for such words will be a dummy entry, primarily for use by code
+ ** that ignores capitalization.  The "word" field of this entry will
+ ** again point to an all-uppercase copy of the word.  The "mask" field
+ ** will contain the logical OR of the mask fields of all variants.
+ ** A header entry is indicated by a capitalization type of ALLCAPS,
+ ** with the MOREVARIANTS bit set.
+ **
+ ** The following entries will define the individual variants.  Each
+ ** entry except the last has the MOREVARIANTS flag set, and each
+ ** contains one of the following capitalization options:
+ **
+ **	ALLCAPS		The word must appear in all capitals.
+ **	CAPITALIZED	The word must be capitalized (e.g., London).
+ **			It will also be accepted in all capitals.
+ **	FOLLOWCASE	The word must be capitalized exactly like the
+ **			sample in the entry.  Prefix (suffix) characters
+ **			must be rendered in the case of the first (last)
+ **			"alphabetic" character.  It will also be accepted
+ **			in all capitals.  ("Alphabetic" means "mentioned
+ **			in a 'casechars' statement".)
+ **	ANYCASE		The word may appear in lowercase, capitalized,
+ **			or all-capitals.
+ **
+ ** The "mask" field for the entry contains only the affix flag bits that
+ ** are legal for that capitalization.  The "word" field will be null
+ ** except for FOLLOWCASE entries, where it will point to the
+ ** correctly-capitalized spelling of the root word.
+ **
+ ** It is worth discussing why the ALLCAPS option is used in
+ ** the header entry.  The header entry accepts an all-capitals
+ ** version of the root plus every affix (this is always legal, since
+ ** words get capitalized in headers and so forth).  Further, all of
+ ** the following variant entries will reject any all-capitals form
+ ** that is illegal due to an affix.
+ **
+ ** Finally, note that variations in the KEEP flag can cause a multiple-variant
+ ** entry as well.  For example, if the personal dictionary contains "ALPHA",
+ ** (KEEP flag set) and the user adds "alpha" with the KEEP flag clear, a
+ ** multiple-variant entry will be created so that "alpha" will be accepted
+ ** but only "ALPHA" will actually be kept.
+ #endif
+ */
+ #ifdef FULLMASKSET
+ #define flagfield	flags
+ #else
+ #define flagfield	mask[MASKSIZE - 1]
+ #endif
+ #define USED		((MASKTYPE) 1 << (FLAGBASE + 0))
+ #define KEEP		((MASKTYPE) 1 << (FLAGBASE + 1))
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ #define ALLFLAGS	(USED | KEEP)
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ #define ANYCASE		((MASKTYPE) 0 << (FLAGBASE + 2))
+ #define ALLCAPS		((MASKTYPE) 1 << (FLAGBASE + 2))
+ #define CAPITALIZED	((MASKTYPE) 2 << (FLAGBASE + 2))
+ #define FOLLOWCASE	((MASKTYPE) 3 << (FLAGBASE + 2))
+ #define CAPTYPEMASK	((MASKTYPE) 3 << (FLAGBASE + 2))
+ #define MOREVARIANTS	((MASKTYPE) 1 << (FLAGBASE + 4))
+ #define ALLFLAGS	(USED | KEEP | CAPTYPEMASK | MOREVARIANTS)
+ #define captype(x)	((x) & CAPTYPEMASK)
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 
+ /*
+  * Language tables used to encode prefix and suffix information.
+  */
+ struct flagent
+     {
+     ichar_t *		strip;			/* String to strip off */
+     ichar_t *		affix;			/* Affix to append */
+     short		flagbit;		/* Flag bit this ent matches */
+     short		stripl;			/* Length of strip */
+     short		affl;			/* Length of affix */
+     short		numconds;		/* Number of char conditions */
+     short		flagflags;		/* Modifiers on this flag */
+     char		conds[SET_SIZE + MAXSTRINGCHARS]; /* Adj. char conds */
+     };
+ 
+ /*
+  * Bits in flagflags
+  */
+ #define FF_CROSSPRODUCT	(1 << 0)		/* Affix does cross-products */
+ #define FF_COMPOUNDONLY	(1 << 1)		/* Afx works in compounds */
+ 
+ union ptr_union					/* Aid for building flg ptrs */
+     {
+     struct flagptr *	fp;			/* Pointer to more indexing */
+     struct flagent *	ent;			/* First of a list of ents */
+     };
+ 
+ struct flagptr
+     {
+     union ptr_union	pu;			/* Ent list or more indexes */
+     int			numents;		/* If zero, pu.fp is valid */
+     };
+ 
+ /*
+  * Description of a single string character type.
+  */
+ struct strchartype
+     {
+     char *		name;			/* Name of the type */
+     char *		deformatter;		/* Deformatter to use */
+     char *		suffixes;		/* File suffixes, null seps */
+     };
+ 
+ /*
+  * Header placed at the beginning of the hash file.
+  */
+ struct hashheader
+     {
+     unsigned short magic;    	    	    	/* Magic number for ID */
+     unsigned short compileoptions;		/* How we were compiled */
+     short maxstringchars;			/* Max # strchrs we support */
+     short maxstringcharlen;			/* Max strchr len supported */
+     short compoundmin;				/* Min lth of compound parts */
+     short compoundbit;				/* Flag 4 compounding roots */
+     int stringsize;				/* Size of string table */
+     int lstringsize;				/* Size of lang. str tbl */
+     int tblsize;				/* No. entries in hash tbl */
+     int stblsize;				/* No. entries in sfx tbl */
+     int ptblsize;				/* No. entries in pfx tbl */
+     int sortval;				/* Largest sort ID assigned */
+     int nstrchars;				/* No. strchars defined */
+     int nstrchartype;				/* No. strchar types */
+     int strtypestart;				/* Start of strtype table */
+     char nrchars[5];				/* Nroff special characters */
+     char texchars[13];				/* TeX special characters */
+     char compoundflag;				/* Compund-word handling */
+     char defhardflag;				/* Default tryveryhard flag */
+     char flagmarker;				/* "Start-of-flags" char */
+     unsigned short sortorder[SET_SIZE + MAXSTRINGCHARS]; /* Sort ordering */
+     ichar_t lowerconv[SET_SIZE + MAXSTRINGCHARS]; /* Lower-conversion table */
+     ichar_t upperconv[SET_SIZE + MAXSTRINGCHARS]; /* Upper-conversion table */
+     char wordchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for chars found in wrds */
+     char upperchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for uppercase chars */
+     char lowerchars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for lowercase chars */
+     char boundarychars[SET_SIZE + MAXSTRINGCHARS]; /* NZ for boundary chars */
+     char stringstarts[SET_SIZE];		/* NZ if char can start str */
+     char stringchars[MAXSTRINGCHARS][MAXSTRINGCHARLEN + 1]; /* String chars */
+     unsigned int stringdups[MAXSTRINGCHARS];	/* No. of "base" char */
+     int dupnos[MAXSTRINGCHARS];			/* Dup char ID # */
+     unsigned short magic2;			/* Second magic for dbl chk */
+     };
+ 
+ /* hash table magic number */
+ #define MAGIC			0x9602
+ 
+ /* compile options, put in the hash header for consistency checking */
+ #ifdef NO8BIT
+ # define MAGIC8BIT		0x01
+ #else
+ # define MAGIC8BIT		0x00
+ #endif
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ # define MAGICCAPITALIZATION	0x00
+ #else
+ # define MAGICCAPITALIZATION	0x02
+ #endif
+ #if MASKBITS <= 32
+ # define MAGICMASKSET		0x00
+ #else
+ # if MASKBITS <= 64
+ #  define MAGICMASKSET		0x04
+ # else
+ #  if MASKBITS <= 128
+ #   define MAGICMASKSET		0x08
+ #  else
+ #   define MAGICMASKSET		0x0C
+ #  endif
+ # endif
+ #endif
+ 
+ #define COMPILEOPTIONS	(MAGIC8BIT | MAGICCAPITALIZATION | MAGICMASKSET)
+ 
+ /*
+  * Structure used to record data about successful lookups; these values
+  * are used in the ins_root_cap routine to produce correct capitalizations.
+  */
+ struct success
+     {
+     struct dent *	dictent;	/* Header of dict entry chain for wd */
+     struct flagent *	prefix;		/* Prefix flag used, or NULL */
+     struct flagent *	suffix;		/* Suffix flag used, or NULL */
+     };
+ 
+ /*
+ ** Offsets into the nroff special-character array
+ */
+ #define NRLEFTPAREN	hashheader.nrchars[0]
+ #define NRRIGHTPAREN	hashheader.nrchars[1]
+ #define NRDOT		hashheader.nrchars[2]
+ #define NRBACKSLASH	hashheader.nrchars[3]
+ #define NRSTAR		hashheader.nrchars[4]
+ 
+ /*
+ ** Offsets into the TeX special-character array
+ */
+ #define TEXLEFTPAREN	hashheader.texchars[0]
+ #define TEXRIGHTPAREN	hashheader.texchars[1]
+ #define TEXLEFTSQUARE	hashheader.texchars[2]
+ #define TEXRIGHTSQUARE	hashheader.texchars[3]
+ #define TEXLEFTCURLY	hashheader.texchars[4]
+ #define TEXRIGHTCURLY	hashheader.texchars[5]
+ #define TEXLEFTANGLE	hashheader.texchars[6]
+ #define TEXRIGHTANGLE	hashheader.texchars[7]
+ #define TEXBACKSLASH	hashheader.texchars[8]
+ #define TEXDOLLAR	hashheader.texchars[9]
+ #define TEXSTAR		hashheader.texchars[10]
+ #define TEXDOT		hashheader.texchars[11]
+ #define TEXPERCENT	hashheader.texchars[12]
+ 
+ /*
+ ** Values for compoundflag
+ */
+ #define COMPOUND_NEVER		0	/* Compound words are never good */
+ #define COMPOUND_ANYTIME	1	/* Accept run-together words */
+ #define COMPOUND_CONTROLLED	2	/* Compounds controlled by afx flags */
+ 
+ /*
+ ** The isXXXX macros normally only check ASCII range, and don't support
+ ** the character sets of other languages.  These private versions handle
+ ** whatever character sets have been defined in the affix files.
+ */
+ #ifdef lint
+ extern int	myupper P ((unsigned int ch));
+ extern int	mylower P ((unsigned int ch));
+ extern int	myspace P ((unsigned int ch));
+ extern int	iswordch P ((unsigned int ch));
+ extern int	isboundarych P ((unsigned int ch));
+ extern int	isstringstart P ((unsigned int ch));
+ extern ichar_t	mytolower P ((unsigned int ch));
+ extern ichar_t	mytoupper P ((unsigned int ch));
+ #else /* lint */
+ #define myupper(X)	(hashheader.upperchars[(X)])
+ #define mylower(X)	(hashheader.lowerchars[(X)])
+ #define myspace(X)	(((X) > 0)  &&  ((X) < 0x80) \
+ 			  &&  isspace((unsigned char) (X)))
+ #define iswordch(X)	(hashheader.wordchars[(X)])
+ #define isboundarych(X) (hashheader.boundarychars[(X)])
+ #define isstringstart(X) (hashheader.stringstarts[(unsigned char) (X)])
+ #define mytolower(X)	(hashheader.lowerconv[(X)])
+ #define mytoupper(X)	(hashheader.upperconv[(X)])
+ #endif /* lint */
+ 
+ /*
+ ** These macros are similar to the ones above, but they take into account
+ ** the possibility of string characters.  Note well that they take a POINTER,
+ ** not a character.
+ **
+ ** The "l_" versions set "len" to the length of the string character as a
+ ** handy side effect.  (Note that the global "laststringch" is also set,
+ ** and sometimes used, by these macros.)
+ **
+ ** The "l1_" versions go one step further and guarantee that the "len"
+ ** field is valid for *all* characters, being set to 1 even if the macro
+ ** returns false.  This macro is a great example of how NOT to write
+ ** readable C.
+ */
+ #define isstringch(ptr, canon)	(isstringstart (*(ptr)) \
+ 				  &&  stringcharlen ((ptr), (canon)) > 0)
+ #define l_isstringch(ptr, len, canon)	\
+ 				(isstringstart (*(ptr)) \
+ 				  &&  (len = stringcharlen ((ptr), (canon))) \
+ 				    > 0)
+ #define l1_isstringch(ptr, len, canon)	\
+ 				(len = 1, \
+ 				  isstringstart (*(ptr)) \
+ 				    &&  ((len = \
+ 					  stringcharlen ((ptr), (canon))) \
+ 					> 0 \
+ 				      ? 1 : (len = 1, 0)))
+ 
+ /*
+  * Sizes of buffers returned by ichartosstr/strtosichar.
+  */
+ #define ICHARTOSSTR_SIZE (INPUTWORDLEN + 4 * MAXAFFIXLEN + 4)
+ #define STRTOSICHAR_SIZE ((INPUTWORDLEN + 4 * MAXAFFIXLEN + 4) \
+ 			  * sizeof (ichar_t))
+ 
+ /*
+  * termcap variables
+  */
+ #ifdef MAIN
+ # define EXTERN /* nothing */
+ #else
+ # define EXTERN extern
+ #endif
+ 
+ EXTERN char *	BC;	/* backspace if not ^H */
+ EXTERN char *	cd;	/* clear to end of display */
+ EXTERN char *	cl;	/* clear display */
+ EXTERN char *	cm;	/* cursor movement */
+ EXTERN char *	ho;	/* home */
+ EXTERN char *	nd;	/* non-destructive space */
+ EXTERN char *	so;	/* standout */
+ EXTERN char *	se;	/* standout end */
+ EXTERN int	sg;	/* space taken by so/se */
+ EXTERN char *	ti;	/* terminal initialization sequence */
+ EXTERN char *	te;	/* terminal termination sequence */
+ EXTERN int	li;	/* lines */
+ EXTERN int	co;	/* columns */
+ 
+ EXTERN int	contextsize;	/* number of lines of context to show */
+ EXTERN char	contextbufs[MAXCONTEXT][BUFSIZ]; /* Context of current line */
+ EXTERN int	contextoffset;	/* Offset of line start in contextbufs[0] */
+ EXTERN char *	currentchar;	/* Location in contextbufs */
+ EXTERN char	ctoken[INPUTWORDLEN + MAXAFFIXLEN]; /* Current token as char */
+ EXTERN ichar_t	itoken[INPUTWORDLEN + MAXAFFIXLEN]; /* Ctoken as ichar_t str */
+ 
+ EXTERN char	termcap[2048];	/* termcap entry */
+ EXTERN char	termstr[2048];	/* for string values */
+ EXTERN char *	termptr;	/* pointer into termcap, used by tgetstr */
+ 
+ EXTERN int	numhits;	/* number of hits in dictionary lookups */
+ EXTERN struct success
+ 		hits[MAX_HITS]; /* table of hits gotten in lookup */
+ 
+ EXTERN char *	hashstrings;	/* Strings in hash table */
+ EXTERN struct hashheader
+ 		hashheader;	/* Header of hash table */
+ EXTERN struct dent *
+ 		hashtbl;	/* Main hash table, for dictionary */
+ EXTERN int	hashsize;	/* Size of main hash table */
+ 
+ EXTERN char	hashname[MAXPATHLEN]; /* Name of hash table file */
+ 
+ EXTERN int	aflag;		/* NZ if -a or -A option specified */
+ EXTERN int	cflag;		/* NZ if -c (crunch) option */
+ EXTERN int	lflag;		/* NZ if -l (list) option */
+ EXTERN int	incfileflag;	/* whether xgets() acts exactly like gets() */
+ EXTERN int	nodictflag;	/* NZ if dictionary not needed */
+ 
+ EXTERN int	uerasechar;	/* User's erase character, from stty */
+ EXTERN int	ukillchar;	/* User's kill character */
+ 
+ EXTERN unsigned int laststringch; /* Number of last string character */
+ EXTERN int	defdupchar;	/* Default duplicate string type */
+ 
+ EXTERN int	numpflags;		/* Number of prefix flags in table */
+ EXTERN int	numsflags;		/* Number of suffix flags in table */
+ EXTERN struct flagptr pflagindex[SET_SIZE + MAXSTRINGCHARS];
+ 					/* Fast index to pflaglist */
+ EXTERN struct flagent *	pflaglist;	/* Prefix flag control list */
+ EXTERN struct flagptr sflagindex[SET_SIZE + MAXSTRINGCHARS];
+ 					/* Fast index to sflaglist */
+ EXTERN struct flagent *	sflaglist;	/* Suffix flag control list */
+ 
+ EXTERN struct strchartype *		/* String character type collection */
+ 		chartypes;
+ 
+ EXTERN FILE *	infile;			/* File being corrected */
+ EXTERN FILE *	outfile;		/* Corrected copy of infile */
+ 
+ EXTERN char *	askfilename;		/* File specified in -f option */
+ 
+ EXTERN int	changes;		/* NZ if changes made to cur. file */
+ EXTERN int	readonly;		/* NZ if current file is readonly */
+ EXTERN int	quit;			/* NZ if we're done with this file */
+ 
+ #define MAXPOSSIBLE	100	/* Max no. of possibilities to generate */
+ 
+ EXTERN char	possibilities[MAXPOSSIBLE][INPUTWORDLEN + MAXAFFIXLEN];
+ 				/* Table of possible corrections */
+ EXTERN int	pcount;		/* Count of possibilities generated */
+ EXTERN int	maxposslen;	/* Length of longest possibility */
+ EXTERN int	easypossibilities; /* Number of "easy" corrections found */
+ 				/* ..(defined as those using legal affixes) */
+ 
+ /*
+  * The following array contains a list of characters that should be tried
+  * in "missingletter."  Note that lowercase characters are omitted.
+  */
+ EXTERN int	Trynum;		/* Size of "Try" array */
+ EXTERN ichar_t	Try[SET_SIZE + MAXSTRINGCHARS];
+ 
+ /*
+  * Initialized variables.  These are generated using macros so that they
+  * may be consistently declared in all programs.  Numerous examples of
+  * usage are given below.
+  */
+ #ifdef MAIN
+ #define INIT(decl, init)	decl = init
+ #else
+ #define INIT(decl, init)	extern decl
+ #endif
+ 
+ #ifdef MINIMENU
+ INIT (int minimenusize, 2);		/* MUST be either 2 or zero */
+ #else /* MINIMENU */
+ INIT (int minimenusize, 0);		/* MUST be either 2 or zero */
+ #endif /* MINIMENU */
+ 
+ INIT (int eflag, 0);			/* NZ for expand mode */
+ INIT (int dumpflag, 0);			/* NZ to do dump mode */
+ INIT (int fflag, 0);			/* NZ if -f specified */
+ #ifndef USG
+ INIT (int sflag, 0);			/* NZ to stop self after EOF */
+ #endif
+ INIT (int vflag, 0);			/* NZ to display characters as M-xxx */
+ INIT (int xflag, DEFNOBACKUPFLAG);	/* NZ to suppress backups */
+ INIT (int deftflag, -1);		/* NZ for TeX mode by default */
+ INIT (int tflag, DEFTEXFLAG);		/* NZ for TeX mode in current file */
+ INIT (int prefstringchar, -1);		/* Preferred string character type */
+ 
+ INIT (int terse, 0);			/* NZ for "terse" mode */
+ 
+ INIT (char tempfile[MAXPATHLEN], "");	/* Name of file we're spelling into */
+ 
+ INIT (int minword, MINWORD);		/* Longest always-legal word */
+ INIT (int sortit, 1);			/* Sort suggestions alphabetically */
+ INIT (int compoundflag, -1);		/* How to treat compounds: see above */
+ INIT (int tryhardflag, -1);		/* Always call tryveryhard */
+ 
+ INIT (char * currentfile, NULL);	/* Name of current input file */
+ 
+ /* Odd numbers for math mode in LaTeX; even for LR or paragraph mode */
+ INIT (int math_mode, 0);
+ /* P -- paragraph or LR mode
+  * b -- parsing a \begin statement
+  * e -- parsing an \end statement
+  * r -- parsing a \ref type of argument.
+  * m -- looking for a \begin{minipage} argument.
+  */
+ INIT (char LaTeX_Mode, 'P');


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.info
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.info:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/ispell.info	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,404 ----
+ Info file: ispell.info,    -*-Text-*-
+ produced by `texinfo-format-buffer'
+ from file `ispell.texinfo'
+ using `texinfmt.el' version 2.38 of 3 July 1998.
+ 
+ 
+ 
+ This file documents ISPELL, an interactive spelling corrector.
+ 
+ Copyright 1988, 1990, 1991, 1992, 1993 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 stated in a
+ translation approved by the Foundation.
+ 
+ * Menu:
+ 
+ * Emacs::			Using ispell from emacs
+ * Old Emacs::			Old Emacs
+ * Private::			Your private dictionary
+ * Command summary::		All commands in emacs mode
+ * Near misses::			Definition of a near miss
+ * History::			Where it came from
+ 
+  -- The Detailed Node Listing ---
+ 
+ Using ispell from emacs
+ 
+ * Word::			Checking a single word
+ * Buffer::			Checking a whole buffer
+ * Region::			Checking a region
+ * Multiple Dictionaries::	Using Multiple Dictionaries
+ 
+ 
+ 
+ File: ispell.info, Node: Top, Next: Emacs, Prev: (dir), Up: (dir)
+ 
+ 
+ 
+ `Ispell' is a program that helps you to correct spelling errors in a
+ file, and to find the correct spelling of words.  When presented with
+ a word that is not in the dictionary, `ispell' attempts to find "near
+ misses" that might include the word you meant.
+ 
+ This manual describes how to use ispell, as well as a little about its
+ implementation.
+ 
+ 
+ * Menu:
+ 
+ * Emacs::			Using ispell from emacs
+ * Old Emacs::			Old Emacs
+ * Private::			Your private dictionary
+ * Command summary::		All commands in emacs mode
+ * Near misses::			Definition of a near miss
+ * History::			Where it came from
+ 
+ 
+ 
+ 
+ File: ispell.info, Node: Emacs, Next: Old Emacs, Prev: Top, Up: Top
+ 
+ Using ispell from emacs
+ =======================
+ 
+ * Menu:
+ 
+ * Word::			Checking a single word
+ * Buffer::			Checking a whole buffer
+ * Region::			Checking a region
+ * Multiple Dictionaries::	Using Multiple Dictionaries
+ 
+ 
+ 
+ File: ispell.info, Node: Word, Next: Buffer, Prev: Emacs, Up: Emacs
+ 
+ Checking a single word
+ ----------------------
+ 
+ The simplest emacs command for calling ispell is 'M-$' (meta-dollar.
+ On some terminals, you must type ESC-$.) This checks the spelling of
+ the word under the cursor.  If the word is found in the dictionary,
+ then a message is printed in the echo area.  Otherwise, ISPELL
+ attempts to generate near misses.
+ 
+ If any near misses are found, they are displayed in a separate window,
+ each preceded by a digit or character.  If one of these is the word
+ you wanted, just type its digit or character, and it will replace the
+ original word in your buffer.
+ 
+ If no near miss is right, or if none are displayed, you have five
+ choices:
+ 
+ `I'
+ 
+      Insert the word in your private dictionary.  Use this if you know
+      that the word is spelled correctly.
+ 
+ `A'
+ 
+      Accept the word for the duration of this editing session, but do
+      not put it in your private dictionary.  Use this if you are not
+      sure about the spelling of the word, but you do not want to look
+      it up immediately, or for terms that appear in your document but
+      are not truly words.  The next time you start ispell, it will
+      have forgotten any accepted words.
+ 
+ `SPC'
+ 
+      Leave the word alone, and consider it misspelled if it is checked
+      again.
+ 
+ `R'
+ 
+      Replace the word.  This command prompts you for a string in the
+      minibuffer.  You may type more than one word, and each word you
+      type is checked again, possibly finding other near misses.  This
+      command provides a handy way to close in on a word that you have
+      no idea how to spell.  You can keep trying different spellings
+      until you find one that is close enough to get a near miss.
+ 
+ `L'
+ 
+      Lookup.  Display words from the dictionary that contain a
+      specified substring.  The substring is a regular expression,
+      which means it can contain special characters to be more
+      selective about which words get displayed.  *Note Regexps:
+      (emacs)Regexps.
+ 
+      If the only special character in the regular expression is a
+      leading `^', then a very fast binary search will be used, instead
+      of scanning the whole file.
+ 
+      Only a few matching words can be displayed in the ISPELL window.
+      If you want to see more, use the `look' program directly from the
+      shell.
+ 
+ Of course, you can also type `' to stop the command without changing
+ anything.
+ 
+ If you make a change that you don't like, just use emacs' normal undo
+ feature *Note undo: (emacs)undo.
+ 
+ 
+ 
+ File: ispell.info, Node: Buffer, Next: Region, Prev: Word, Up: Emacs
+ 
+ Checking a whole buffer
+ -----------------------
+ 
+ If you want to check the spelling of all the words in a buffer, type
+ the command `M-x ispell-buffer'.  This command scans the file, and
+ makes a list of all the misspelled words.  When it is done, it moves
+ the cursor to the first word on the list, and acts like you just typed
+ M-$ *Note Word::.
+ 
+ When you finish with one word, the cursor is automatically moved to
+ the next.  If you want to stop in the middle of the list type `X' or
+ `'.
+ 
+ 
+ 
+ File: ispell.info, Node: Region, Next: Multiple Dictionaries, Prev: Buffer, Up: Emacs
+ 
+ Checking a region
+ -----------------
+ 
+ You may check the words in the region with the command `M-x
+ ispell-region'.  See *Note mark: (emacs)mark.
+ 
+ The commands available are the same as for checking a whole buffer.
+ 
+ 
+ 
+ File: ispell.info, Node: Multiple Dictionaries, Prev: Region, Up: Emacs
+ 
+ Using Multiple Dictionaries
+ ---------------------------
+ 
+ Your site may have multiple dictionaries installed: a default one
+ (usually `english.hash'), and several others for different languages
+ (e.g. `deutsch.hash') or variations on a language (such as British
+ spelling for English).
+ 
+ 
+ `ispell-change-dictionary'
+ 
+      This is the command to change the dictionary.  It prompts for a
+      new dictionary name, with completion on the elements of
+      `ispell-dictionary'.
+ 
+      It changes `ispell-dictionary' and kills the old ispell process,
+      if one was running.  A new one will be started as soon as
+      necessary.
+ 
+      By just answering `RET' you can find out what the current
+      dictionary is.
+ 
+ `ispell-dictionary'
+ 
+      If non-nil, a dictionary to use instead of the default one.  This
+      is passed to the ispell process using the `-d' switch and is used
+      as key in `ispell-dictionary-alist'.
+ 
+      You should set this variable before your first call to ispell
+      (e.g. in your `.emacs'), or use the `M-x
+      ispell-change-dictionary' command to change it, as changing this
+      variable only takes effect in a newly started ispell process.
+ 
+ `ispell-dictionary-alist'
+ 
+      An alist of dictionaries and their associated parameters.
+ 
+      Each element of this list is also a list:
+ 
+           (DICTIONARY-NAME
+               CASECHARS NOT-CASECHARS OTHERCHARS MANY-OTHERCHARS-P
+               ISPELL-ARGS)
+ 
+      DICTIONARY-NAME is a possible value of variable
+      `ispell-dictionary', `nil' means the default dictionary.
+ 
+      CASECHARS is a regular expression of valid characters that
+      comprise a word.
+ 
+      NOT-CASECHARS is the opposite regexp of CASECHARS.
+ 
+      OTHERCHARS is a regular expression of other characters that are
+      valid in word constructs.  Otherchars cannot be adjacent to each
+      other in a word, nor can they begin or end a word.  This implies
+      we can't check `Stevens'' as a correct possessive and other
+      correct formations.
+ 
+      Hint: regexp syntax requires the hyphen to be declared first
+      here.
+ 
+      MANY-OTHERCHARS-P is non-nil if many otherchars are to be allowed
+      in a word instead of only one.
+ 
+      ISPELL-ARGS is a list of additional arguments passed to the
+      ispell subprocess.
+ 
+      Note that the CASECHARS and OTHERCHARS slots of the alist should
+      contain the same character set as casechars and otherchars in the
+      LANGUAGE`.aff' file (e.g., `english.aff').
+ 
+ 
+ 
+ 
+ File: ispell.info, Node: Old Emacs, Next: Private, Prev: Emacs, Up: Top
+ 
+ Old Emacs
+ =========
+ 
+ Until ispell becomes part of the standard emacs distribution, you will
+ have to explicitly request that it be loaded.  Put the following lines
+ in your emacs init file *Note init file: (emacs)init file.
+ 
+      (autoload 'ispell-word "ispell" "Check the spelling of word in buffer." t)
+      (autoload 'ispell-region "ispell" "Check the spelling of region." t)
+      (autoload 'ispell-buffer "ispell" "Check the spelling of buffer." t)
+      (global-set-key "\e$" 'ispell-word)
+ 
+ (It will do no harm to have these lines in your init file even after
+ ispell is installed by default.)
+ 
+ 
+ 
+ File: ispell.info, Node: Private, Next: Command summary, Prev: Old Emacs, Up: Top
+ 
+ Your private dictionary
+ =======================
+ 
+ Whenever ispell is started the file `.ispell_words' is read from your
+ home directory (if it exists).  This file contains a list of words,
+ one per line.  The order of the words is not important, but the case
+ is.  Ispell will consider all of the words good, and will use them as
+ possible near misses.
+ 
+ The `I' command adds words to `.ispell_words', so normally you don't
+ have to worry about the file.  You may want to check it from time to
+ time to make sure you have not accidentally inserted a misspelled
+ word.
+ 
+ 
+ 
+ File: ispell.info, Node: Command summary, Next: Near misses, Prev: Private, Up: Top
+ 
+ All commands in emacs mode
+ ==========================
+ 
+ `DIGIT'
+      Select a near miss
+ `I'
+      Insert into private dictionary
+ `A'
+      Accept for this session
+ `SPC'
+      Skip this time
+ `R'
+      Replace with one or more words
+ `L'
+      Lookup: search the dictionary using a regular expression
+ `M-$'
+      Check word
+ `M-x ispell-buffer'
+      Check buffer
+ `M-x ispell-region'
+      Check region
+ `M-x ispell-change-dictionary'
+      Select different dictionary.
+ 
+ 
+ 
+ File: ispell.info, Node: Near misses, Next: History, Prev: Command summary, Up: Top
+ 
+ Definition of a near miss
+ =========================
+ 
+ Two words are near each other if they can be made identical with one
+ of the following changes to one of the words:
+ 
+      Insert a blank space
+      Interchange two adjacent letters.
+      Change one letter.
+      Delete one letter.
+      Add one letter.
+ 
+ Someday, perhaps ispell will be extended so that words that sound
+ alike would also be considered near misses.  If you would like to
+ implement this, see Knuth, Volume 3, page 392 for a description of the
+ Soundex algorithm which might apply.
+ 
+ 
+ 
+ File: ispell.info, Node: History, Prev: Near misses, Up: Top
+ 
+ Where it came from
+ ==================
+ 
+ Ispell has a long and convoluted history.  Originally called SPELL, it
+ was written by Ralph E. Gorin in 1971.  That version was written in
+ assembly language for the DEC PDP-10 to run under the WAITS operating
+ system at the Stanford Artificial Intelligence Laboratory.  Subsequent
+ versions, also in PDP-10 assembly language, were developed for the BBN
+ TENEX, MIT ITS, and DEC TOPS-10 and TOPS-20 operating systems.  It was
+ later revised by W. E. Matson (1974), and W. B. Ackerman (1978),
+ changing its name to ISPELL in the process.
+ 
+ In 1983, Pace Willisson (pace at ai.mit.edu) converted this version to
+ the C language and modified it to work under Unix.
+ 
+ In 1987, Walt Buehring revised and enhanced ispell, and posted it to
+ the Usenet along with a dictionary.  In addition, Walt wrote the first
+ version of "ispell.el", the emacs interface.
+ 
+ Geoff Kuenning (geoff at ITcorp.com, that's me, and by the way I
+ pronounce it "Kenning") picked up this version, fixed many bugs, and
+ added further enhancements.  In 1988 I got ambitious and rewrote major
+ portions of the code, resulting in the table-driven multi-lingual
+ version.  Ken Stevens (stevens at hplabs.hp.com) made overwhelming
+ contributions to the elisp support to produce the version you are
+ using now.
+ 
+ Due to a misunderstanding involving the Free Software Foundation, it
+ later became necessary to rename this version to ispell to avoid
+ confusion on the part of users.
+ 
+ Many other enhancements and bug fixes were provided by other people.
+ Although I omit mention here due to space, many of these people have
+ also made significant contributions to the version of ispell you see
+ here.  For a full list of people who have contributed to ispell, refer
+ to the file `Contributors' which is distributed with the ispell
+ sources.
+ 
+ Geoff Kuenning 
+ geoff at ITcorp.com 
+ 
+ 
+ 
+ Tag table:
+ Node: Top1395
+ Node: Emacs2049
+ Node: Word2336
+ Node: Buffer4885
+ Node: Region5445
+ Node: Multiple Dictionaries5748
+ Node: Old Emacs8272
+ Node: Private8944
+ Node: Command summary9590
+ Node: Near misses10134
+ Node: History10767
+ 
+ End tag table


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/large.txt
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/large.txt:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/large.txt	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,6844 ----
+ The Project Gutenberg Etext of H. G. Wells' War of the Worlds
+ 
+ Copyright laws are changing all over the world, be sure to check
+ the laws for your country before redistributing these files!!!
+ 
+ Please take a look at the important information in this header.
+ We encourage you to keep this file on your own disk, keeping an
+ electronic path open for the next readers.
+ 
+ Please do not remove this.
+ 
+ This should be the first thing seen when anyone opens the book.
+ Do not change or edit it without written permission.  The words
+ are carefully chosen to provide users with the information they
+ need about what they can legally do with the texts.
+ 
+ 
+ Welcome To The World of Free Plain Vanilla Electronic Texts
+ 
+ Etexts Readable By Both Humans and By Computers, Since 1971
+ 
+ These Etexts Prepared By Hundreds of Volunteers and Donations
+ 
+ Information on contacting Project Gutenberg to get Etexts, and
+ further information is included below.  We need your donations.
+ The Project Gutenberg Literary Archive Foundation is a 501(c)(3)
+ organization with EIN [Employee Identification Number] 64-6221541
+ 
+ As of 12/12/00 contributions are only being solicited from people in:
+ Colorado, Connecticut, Idaho, Indiana, Iowa,
+ Kentucky, Louisiana, Massachusetts, Montana,
+ Nevada, Oklahoma, South Carolina, South Dakota,
+ Texas, Vermont, and Wyoming.
+ 
+ As the requirements for other states are met,
+ additions to this list will be made and fund raising
+ will begin in the additional states.  Please feel
+ free to ask to check the status of your state.
+ 
+ International donations are accepted,
+ but we don't know ANYTHING about how
+ to make them tax-deductible, or
+ even if they CAN be made deductible,
+ and don't have the staff to handle it
+ even if there are ways.
+ 
+ These donations should be made to:
+ 
+ Project Gutenberg Literary Archive Foundation
+ PMB 113
+ 1739 University Ave.
+ Oxford, MS 38655-4109
+ 
+ 
+ Title: The War of the Worlds
+ 
+ Author: H. G. Wells [Herbert George]
+ 
+ Official Release Date: July, 1992 [Etext #36]
+ 
+ Edition: 12
+ 
+ Language: English
+ 
+ The Project Gutenberg Etext of H.G. Wells' War of the Worlds
+ This file should be named warw12.txt or warw12.zip
+ 
+ Corrected EDITIONS of our etexts get a new NUMBER, warwd11.txt
+ VERSIONS based on separate sources get new LETTER, warwd10a.txt
+ 
+ 
+ Project Gutenberg Etexts are usually created from multiple editions,
+ all of which are in the Public Domain in the United States, unless a
+ copyright notice is included.  Therefore, we usually do NOT keep any
+ of these books in compliance with any particular paper edition.
+ 
+ We are now trying to release all our books one year in advance
+ of the official release dates, leaving time for better editing.
+ Please be encouraged to send us error messages even years after
+ the official publication date.
+ 
+ Please note:  neither this list nor its contents are final till
+ midnight of the last day of the month of any such announcement.
+ The official release date of all Project Gutenberg Etexts is at
+ Midnight, Central Time, of the last day of the stated month.  A
+ preliminary version may often be posted for suggestion, comment
+ and editing by those who wish to do so.
+ 
+ Most people start at our sites at:
+ http://gutenberg.net
+ http://promo.net/pg
+ 
+ 
+ Those of you who want to download any Etext before announcement
+ can surf to them as follows, and just download by date; this is
+ also a good way to get them instantly upon announcement, as the
+ indexes our cataloguers produce obviously take a while after an
+ announcement goes out in the Project Gutenberg Newsletter.
+ 
+ http://www.ibiblio.org/gutenberg/etext03
+ or
+ ftp://ftp.ibiblio.org/pub/docs/books/gutenberg/etext03
+ 
+ Or /etext02, 01, 00, 99, 98, 97, 96, 95, 94, 93, 92, 92, 91 or 90
+ 
+ Just search by the first five letters of the filename you want,
+ as it appears in our Newsletters.
+ 
+ 
+ Information about Project Gutenberg (one page)
+ 
+ We produce about two million dollars for each hour we work.  The
+ time it takes us, a rather conservative estimate, is fifty hours
+ to get any etext selected, entered, proofread, edited, copyright
+ searched and analyzed, the copyright letters written, etc.  This
+ projected audience is one hundred million readers.  If our value
+ per text is nominally estimated at one dollar then we produce $2
+ million dollars per hour this year as we release fifty new Etext
+ files per month, or 500 more Etexts in 2000 for a total of 3000+
+ If they reach just 1-2% of the world's population then the total
+ should reach over 300 billion Etexts given away by year's end.
+ 
+ The Goal of Project Gutenberg is to Give Away One Trillion Etext
+ Files by December 31, 2001.  [10,000 x 100,000,000 = 1 Trillion]
+ This is ten thousand titles each to one hundred million readers,
+ which is only about 4% of the present number of computer users.
+ 
+ At our revised rates of production, we will reach only one-third
+ of that goal by the end of 2001, or about 3,333 Etexts unless we
+ manage to get some real funding.
+ 
+ The Project Gutenberg Literary Archive Foundation has been created
+ to secure a future for Project Gutenberg into the next millennium.
+ 
+ We need your donations more than ever!
+ 
+ As of June 1, 2001 contributions are only being solicited from people in:
+ Arkansas, Colorado, Connecticut, Delaware, Hawaii, Idaho, Indiana, Iowa,
+ Kansas, Louisiana, Maine, Massachusetts, Missouri, Montana, Nebraska, New
+ Jersey, New York, Ohio, Oklahoma, Oregon, South Carolina, South Dakota,
+ Texas, Vermont, Washington West Virginia and Wyoming.
+ 
+ We have filed in about 45 states now, but these are the only ones
+ that have responded.
+ 
+ As the requirements for other states are met,
+ additions to this list will be made and fund raising
+ will begin in the additional states.  Please feel
+ free to ask to check the status of your state.
+ 
+ In answer to various questions we have received on this:
+ 
+ We are constantly working on finishing the paperwork
+ to legally request donations in all 50 states.  If
+ your state is not listed and you would like to know
+ if we have added it since the list you have, just ask.
+ 
+ While we cannot solicit donations from people in
+ states where we are not yet registered, we know
+ of no prohibition against accepting donations
+ from donors in these states who approach us with
+ an offer to donate.
+ 
+ 
+ International donations are accepted,
+ but we don't know ANYTHING about how
+ to make them tax-deductible, or
+ even if they CAN be made deductible,
+ and don't have the staff to handle it
+ even if there are ways.
+ 
+ All donations should be made to:
+ 
+ Project Gutenberg Literary Archive Foundation
+ PMB 113
+ 1739 University Ave.
+ Oxford, MS 38655-4109
+ 
+ 
+ The Project Gutenberg Literary Archive Foundation is a 501(c)(3)
+ organization with EIN [Employee Identification Number] 64-6221541,
+ and has been approved as a 501(c)(3) organization by the US Internal
+ Revenue Service (IRS).  Donations are tax-deductible to the maximum
+ extent permitted by law.  As the requirements for other states are met,
+ additions to this list will be made and fund raising will begin in the
+ additional states.
+ 
+ We need your donations more than ever!
+ 
+ You can get up to date donation information at:
+ 
+ http://www.gutenberg.net/donation.html
+ 
+ 
+ 
+ 
+ If you can't reach Project Gutenberg,
+ you can always email directly to:
+ 
+ Michael S. Hart <hart at pobox.com>
+ 
+ hart at pobox.com forwards to hart at prairienet.org and archive.org
+ if your mail bounces from archive.org, I will still see it, if
+ it bounces from prairienet.org, better resend later on. . . .
+ 
+ Prof. Hart will answer or forward your message.
+ 
+ We would prefer to send you information by email.
+ 
+ 
+ 
+ 
+ 
+ Example command-line FTP session:
+ 
+ ftp ftp.ibiblio.org
+ login: anonymous
+ password: your at login
+ cd pub/docs/books/gutenberg
+ cd etext90 through etext99 or etext00 through etext02, etc.
+ dir [to see files]
+ get or mget [to get files. . .set bin for zip files]
+ GET GUTINDEX.??  [to get a year's listing of books, e.g., GUTINDEX.99]
+ GET GUTINDEX.ALL [to get a listing of ALL books]
+ 
+ 
+ The Legal Small Print
+ 
+ 
+ (Three Pages)
+ 
+ START THE SMALL PRINT! FOR PUBLIC DOMAIN ETEXTS START
+ Why is this "Small Print!" statement here?  You know: lawyers.
+ They tell us you might sue us if there is something wrong with
+ your copy of this etext, even if you got it for free from
+ someone other than us, and even if what's wrong is not our
+ fault.  So, among other things, this "Small Print!" statement
+ disclaims most of our liability to you.  It also tells you how
+ you may distribute copies of this etext if you want to.
+ 
+ BEFORE! YOU USE OR READ THIS ETEXT
+ By using or reading any part of this PROJECT GUTENBERG-tm
+ etext, you indicate that you understand, agree to and accept
+ this "Small Print!" statement.  If you do not, you can receive
+ a refund of the money (if any) you paid for this etext by
+ sending a request within 30 days of receiving it to the person
+ you got it from.  If you received this etext on a physical
+ medium (such as a disk), you must return it with your request.
+ 
+ ABOUT PROJECT GUTENBERG-TM ETEXTS
+ This PROJECT GUTENBERG-tm etext, like most PROJECT GUTENBERG-tm etexts,
+ is a "public domain" work distributed by Professor Michael S. Hart
+ through the Project Gutenberg Association (the "Project").
+ Among other things, this means that no one owns a United States copyright
+ on or for this work, so the Project (and you!) can copy and
+ distribute it in the United States without permission and
+ without paying copyright royalties.  Special rules, set forth
+ below, apply if you wish to copy and distribute this etext
+ under the "PROJECT GUTENBERG" trademark.
+ 
+ Please do not use the "PROJECT GUTENBERG" trademark to market
+ any commercial products without permission.
+ 
+ To create these etexts, the Project expends considerable
+ efforts to identify, transcribe and proofread public domain
+ works.  Despite these efforts, the Project's etexts and any
+ medium they may be on may contain "Defects".  Among other
+ things, Defects may take the form of incomplete, inaccurate or
+ corrupt data, transcription errors, a copyright or other
+ intellectual property infringement, a defective or damaged
+ disk or other etext medium, a computer virus, or computer
+ codes that damage or cannot be read by your equipment.
+ 
+ LIMITED WARRANTY; DISCLAIMER OF DAMAGES
+ But for the "Right of Replacement or Refund" described below,
+ [1] Michael Hart and the Foundation (and any other party you may 
+ receive this etext from as a PROJECT GUTENBERG-tm etext) disclaims
+ all liability to you for damages, costs and expenses, including
+ legal fees, and [2] YOU HAVE NO REMEDIES FOR NEGLIGENCE OR
+ UNDER STRICT LIABILITY, OR FOR BREACH OF WARRANTY OR CONTRACT,
+ INCLUDING BUT NOT LIMITED TO INDIRECT, CONSEQUENTIAL, PUNITIVE
+ OR INCIDENTAL DAMAGES, EVEN IF YOU GIVE NOTICE OF THE
+ POSSIBILITY OF SUCH DAMAGES.
+ 
+ If you discover a Defect in this etext within 90 days of
+ receiving it, you can receive a refund of the money (if any)
+ you paid for it by sending an explanatory note within that
+ time to the person you received it from.  If you received it
+ on a physical medium, you must return it with your note, and
+ such person may choose to alternatively give you a replacement
+ copy.  If you received it electronically, such person may
+ choose to alternatively give you a second opportunity to
+ receive it electronically.
+ 
+ THIS ETEXT IS OTHERWISE PROVIDED TO YOU "AS-IS".  NO OTHER
+ WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, ARE MADE TO YOU AS
+ TO THE ETEXT OR ANY MEDIUM IT MAY BE ON, INCLUDING BUT NOT
+ LIMITED TO WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
+ PARTICULAR PURPOSE.
+ 
+ Some states do not allow disclaimers of implied warranties or
+ the exclusion or limitation of consequential damages, so the
+ above disclaimers and exclusions may not apply to you, and you
+ may have other legal rights.
+ 
+ INDEMNITY
+ You will indemnify and hold Michael Hart, the Foundation,
+ and its trustees and agents, and any volunteers associated
+ with the production and distribution of Project Gutenberg-tm
+ texts harmless, from all liability, cost and expense, including
+ legal fees, that arise directly or indirectly from any of the 
+ following that you do or cause:  [1] distribution of this etext,
+ [2] alteration, modification, or addition to the etext,
+ or [3] any Defect.
+ 
+ DISTRIBUTION UNDER "PROJECT GUTENBERG-tm"
+ You may distribute copies of this etext electronically, or by
+ disk, book or any other medium if you either delete this
+ "Small Print!" and all other references to Project Gutenberg,
+ or:
+ 
+ [1]  Only give exact copies of it.  Among other things, this
+      requires that you do not remove, alter or modify the
+      etext or this "small print!" statement.  You may however,
+      if you wish, distribute this etext in machine readable
+      binary, compressed, mark-up, or proprietary form,
+      including any form resulting from conversion by word
+      processing or hypertext software, but only so long as
+      EITHER:
+ 
+      [*]  The etext, when displayed, is clearly readable, and
+           does *not* contain characters other than those
+           intended by the author of the work, although tilde
+           (~), asterisk (*) and underline (_) characters may
+           be used to convey punctuation intended by the
+           author, and additional characters may be used to
+           indicate hypertext links; OR
+ 
+      [*]  The etext may be readily converted by the reader at
+           no expense into plain ASCII, EBCDIC or equivalent
+           form by the program that displays the etext (as is
+           the case, for instance, with most word processors);
+           OR
+ 
+      [*]  You provide, or agree to also provide on request at
+           no additional cost, fee or expense, a copy of the
+           etext in its original plain ASCII form (or in EBCDIC
+           or other equivalent proprietary form).
+ 
+ [2]  Honor the etext refund and replacement provisions of this
+      "Small Print!" statement.
+ 
+ [3]  Pay a trademark license fee to the Foundation of 20% of the
+      gross profits you derive calculated using the method you
+      already use to calculate your applicable taxes.  If you
+      don't derive profits, no royalty is due.  Royalties are
+      payable to "Project Gutenberg Literary Archive Foundation"
+      the 60 days following each date you prepare (or were
+      legally required to prepare) your annual (or equivalent
+      periodic) tax return.  Please contact us beforehand to
+      let us know your plans and to work out the details.
+ 
+ WHAT IF YOU WANT TO SEND MONEY EVEN IF YOU DON'T HAVE TO?
+ Project Gutenberg is dedicated to increasing the number of
+ public domain and licensed works that can be freely distributed
+ in machine readable form.  
+ 
+ The Project gratefully accepts contributions of money, time, 
+ public domain materials, or royalty free copyright licenses.
+ Money should be paid to the:
+ "Project Gutenberg Literary Archive Foundation."
+ 
+ If you are interested in contributing scanning equipment or
+ software or other items, please contact Michael Hart at:
+ hart at pobox.com
+ 
+ END THE SMALL PRINT! FOR PUBLIC DOMAIN ETEXTS Ver.06/12/01 END
+ [Portions of this header are copyright (C) 2001 by Michael S. Hart
+ and may be reprinted only when these Etexts are free of all fees.]
+ [Project Gutenberg is a TradeMark and may not be used in any sales
+ of Project Gutenberg Etexts or other materials be they hardware or
+ software or any other related product without express permission.]
+ 
+ 
+ 
+ 
+ 
+ The War of the Worlds
+ 
+ by H(erbert) G(eorge) Wells [1898]
+ 
+      But who shall dwell in these worlds if they be
+      inhabited? .  .  .  Are we or they Lords of the
+      World? .  .  .  And how are all things made for man?--
+           KEPLER (quoted in The Anatomy of Melancholy)
+ 
+ 
+ 
+ 
+                           BOOK ONE
+ 
+                  THE COMING OF THE MARTIANS
+ 
+ 
+ 
+                          CHAPTER ONE
+ 
+                      THE EVE OF THE WAR
+ 
+ 
+    No one would have believed in the last years of the nineteenth
+ century that this world was being watched keenly and closely by
+ intelligences greater than man's and yet as mortal as his own; that as
+ men busied themslves about their various concerns they were
+ scrutinised and studied, perhaps almost as narrowly as a man with a
+ microscope might scrutinise the transient creatures that swarm and
+ multiply in a drop of water.  With infinite complacency men went to
+ and fro over this globe about their little affairs, serene in their
+ assurance of their empire over matter.  It is possible that the
+ infusoria under the microscope do the same.  No one gave a thought to
+ the older worlds of space as sources of human danger, or thought of
+ them only to dismiss the idea of life upon them as impossible or
+ improbable.  It is curious to recall some of the mental habits of
+ those departed days.  At most terrestrial men fancied there might be
+ other men upon Mars, perhaps inferior to themselves and ready to
+ welcome a missionary enterprise.  Yet across the gulf of space, minds
+ that are to our minds as ours are to those of the beasts that perish,
+ intellects vast and cool and unsympathetic, regarded this earth with
+ envious eyes, and slowly and surely drew their plans against us.  And
+ early in the twentieth century came the great disillusionment.
+ 
+ The planet Mars, I scarcely need remind the reader, revolves about the
+ sun at a mean distance of 140,000,000 miles, and the light and heat it
+ receives from the sun is barely half of that received by this world.
+ It must be, if the nebular hypothesis has any truth, older than our
+ world; and long before this earth ceased to be molten, life upon its
+ surface must have begun its course.  The fact that it is scarcely one
+ seventh of the vlume of the earth must have accelerated its cooling
+ to the temperature at which life could begin.  It has air and water
+ and all that is necessary for the support of animated existence.
+ 
+    Yet so vain is man, and so blinded by his vanity, that no writer,
+ up to the very end of the nineteenth century, expressed any idea that
+ intelligent life might have developed there far, or indeed at all,
+ beyond its earthly level.  Nor was it generally understood that since
+ Mars is older than our earth, with scarcely a quarter of the
+ superficial area and remoter from the sun, it necessarily follows that
+ it is not only more distant from time's beginning but nearer its end.
+ 
+    The secular cooling that must someday overtake our planet has
+ already gone far indeed with our neighbour.  Its physical condition is
+ still largely a mystery, but we know now that even in its equatorial
+ region the midday temperature barely approaches that of our coldest
+ winter. Its air is much more attenuated than ours, its oceans have
+ shrunk until they cover but a third of its surface, and as its slow
+ seasons change huge snowcaps gather and melt about either pole and
+ periodically inundate its temperate zones.  That last stage of
+ exhaustion, which to us is still incredibly remote, has become a
+ present-day problem for the inhabitants of Mars.  The immediate
+ pressure of necessity has brightened their intellects, enlarged their
+ powers, and hardened their hearts. And looking across space with
+ instruments, and intlligences such as we have scarcely dreamed of,
+ they see, at its nearest distance only 35,000,000 of miles sunward of
+ them, a morning star of hope, our own warmer planet, green with
+ vegetation and grey with water, with a cloudy atmosphere eloquent of
+ fertility, with glimpses through its drifting cloud wisps of broad
+ stretches of populous country and narrow, navy-crowded seas.
+ 
+    And we men, the creatures who inhabit this earth, must be to them
+ at least as alien and lowly as are the monkeys and lemurs to us.  The
+ intellectual side of man already admits that life is an incessant
+ struggle for existence, and it would seem that this too is the belief
+ of the minds upon Mars. Their world is far gone in its cooling and
+ this world is still crowded with life, but crowded only with what they
+ regard as inferior animals.  To carry warfare sunward is, indeed,
+ their only escape from the destruction that, generation after
+ generation, creeps upon them.
+ 
+    And before we judge of them too harshly we must remember what
+ ruthless and utter destruction our own species has wrought, not only
+ upon animals, such as the vanished bison and the dodo, but upon its
+ inferior races.  The Tasmanians, in spite of their human likeness,
+ were entirely swept out of existence in a war of extermination waged
+ by European immigrants, in the space of fifty years.  Are we such
+ apostles of mercy as to complain if the Martians warred in the same
+ sirit?
+ 
+    The Martians seem to have calculated their descent with amazing
+ subtlety--their mathematical learning is evidently far in excess of
+ ours--and to have carried out their preparations with a well-nigh
+ perfect unanimity.  Had our instruments permitted it, we might have
+ seen the gathering trouble far back in the nineteenth century.  Men
+ like Schiaparelli watched the red planet--it is odd, by-the-bye, that
+ for countless centuries Mars has been the star of war--but failed to
+ interpret the fluctuating appearances of the markings they mapped so
+ well.  All that time the Martians must have been getting ready.
+ 
+    During the opposition of 1894 a great light was seen on the
+ illuminated part of the disk, first at the Lick Observatory, then by
+ Perrotin of Nice, and then by other observers.  English readers heard
+ of it first in the issue of NATURE dated August 2. I am inclined to
+ think that this blaze may have been the casting of the huge gun, in
+ the vast pit sunk into their planet, from which their shots were fired
+ at us. Peculiar markings, as yet unexplained, were seen near the site
+ of that outbreak during the next two oppositions.
+ 
+    The storm burst upon us six years ago now.  As Mars approached
+ opposition, Lavelle of Java set the wires of the astronomical exchange
+ palpitating with the amazing intelligence of a huge outbreak of
+ incandescent gas upon the panet. It had ocurred towards midnight of
+ the twelfth; and the spectroscope, to which he had at once resorted,
+ indicated a mass of flaming gas, chiefly hydrogen, moving with an
+ enormous velocity towards this earth.  This jet of fire had become
+ invisible about a quarter past twelve.  He compared it to a colossal
+ puff of flame suddenly and violently squirted out of the planet, "as
+ flaming gases rushed out of a gun."
+ 
+    A singularly appropriate phrase it proved.  Yet the next day there
+ was nothing of this in the papers except a little note in the DAILY
+ TELEGRAPH, and the world went in ignorance of one of the gravest
+ dangers that ever threatened the human race. I might not have heard of
+ the eruption at all had I not met Ogilvy, the well-known astronomer,
+ at Ottershaw.  He was immensely excited at the news, and in the excess
+ of his feelings invited me up to take a turn with him that night in a
+ scrutiny of the red planet.
+ 
+    In spite of all that has happened since, I still remember that
+ vigil very distinctly: the black and silent observatory, the shadowed
+ lantern throwing a feeble glow upon the floor in the corner, the
+ steady ticking of the clockwork of the telescope, the little slit in
+ the roof--an oblong profundity with the stardust streaked across it.
+ Ogilvy moved about, invisible but audible.  Looking through the
+ telescope, one saw a circle of deep blue and the little round planet
+ swimming in the field. It semed such a little thing, so bright and
+ small and still, faintly marked with transverse stripes, and slightly
+ flattened from the perfect round.  But so little it was, so silvery
+ warm--a pin's-head of light! It was as if it quivered, but really this
+ was the telescope vibrating with the activity of the clockwork that
+ kept the planet in view.
+ 
+    As I watched, the planet seemed to grow larger and smaller and to
+ advance and recede, but that was simply that my eye was tired.  Forty
+ millions of miles it was from us--more than forty millions of miles of
+ void.  Few people realise the immensity of vacancy in which the dust
+ of the material universe swims.
+ 
+    Near it in the field, I remember, were three faint points of light,
+ three telescopic stars infinitely remote, and all around it was the
+ unfathomable darkness of empty space.  You know how that blackness
+ looks on a frosty starlight night.  In a telescope it seems far
+ profounder. And invisible to me because it was so remote and small,
+ flying swiftly and steadily towards me across that incredible
+ distance, drawing nearer every minute by so many thousands of miles,
+ came the Thing they were sending us, the Thing that was to bring so
+ much struggle and calamity and death to the earth.  I never dreamed of
+ it then as I watched; no one on earth dreamed of that unerring
+ missile.
+ 
+    That night, too, there was anoher jetting out of gas from the
+ distant planet.  I saw it.  A reddish flash at the edge, the slightest
+ projection of the outline just as the chronometer struck midnight; and
+ at that I told Ogilvy and he took my place.  The night was warm and I
+ was thirsty, and I went stretching my legs clumsily and feeling my way
+ in the darkness, to the little table where the siphon stood, while
+ Ogilvy exclaimed at the streamer of gas that came out towards us.
+ 
+    That night another invisible missile started on its way to the
+ earth from Mars, just a second or so under twenty-four hours after the
+ first one.  I remember how I sat on the table there in the blackness,
+ with patches of green and crimson swimming before my eyes.  I wished I
+ had a light to smoke by, little suspecting the meaning of the minute
+ gleam I had seen and all that it would presently bring me.  Ogilvy
+ watched till one, and then gave it up; and we lit the lantern and
+ walked over to his house.  Down below in the darkness were Ottershaw
+ and Chertsey and all their hundreds of people, sleeping in peace.
+ 
+    He was full of speculation that night about the condition of Mars,
+ and scoffed at the vulgar idea of its having inhabitants who were
+ signalling us.  His idea was that meteorites might be falling in a
+ heavy shower upon the planet, or that a huge volcanic explosion was in
+ progress.  He pointed out to me how unlikely it was that organic
+ evolution had taken the same direction in the two adjacent planets.
+ 
+    "The chances against anything manike on Mars are a million to
+ one," he said.
+ 
+    Hundreds of observers saw the flame that night and the night after
+ about midnight, and again the night after; and so for ten nights, a
+ flame each night.  Why the shots ceased after the tenth no one on
+ earth has attempted to explain. It may be the gases of the firing
+ caused the Martians inconvenience.  Dense clouds of smoke or dust,
+ visible through a powerful telescope on earth as little grey,
+ fluctuating patches, spread through the clearness of the planet's
+ atmosphere and obscured its more familiar features.
+ 
+    Even the daily papers woke up to the disturbances at last, and
+ popular notes appeared here, there, and everywhere concerning the
+ volcanoes upon Mars.  The seriocomic periodical PUNCH, I remember,
+ made a happy use of it in the political cartoon.  And, all
+ unsuspected, those missiles the Martians had fired at us drew
+ earthward, rushing now at a pace of many miles a second through the
+ empty gulf of space, hour by hour and day by day, nearer and nearer.
+ It seems to me now almost incredibly wonderful that, with that swift
+ fate hanging over us, men could go about their petty concerns as they
+ did.  I remember how jubilant Markham was at securing a new photograph
+ of the planet for the illustrated paper he edited in those days.
+ People in these latter times scarcely realise the abundance and
+ enterprise of our ninteenth-century papers.  For my own part, I was
+ much occupied in learning to ride the bicycle, and busy upon a series
+ of papers discussing the probable developments of moral ideas as
+ civilisation progressed.
+ 
+    One night (the first missile then could scarcely have been
+ 10,000,000 miles away) I went for a walk with my wife.  It was
+ starlight and I explained the Signs of the Zodiac to her, and pointed
+ out Mars, a bright dot of light creeping zenithward, towards which so
+ many telescopes were pointed. It was a warm night.  Coming home, a
+ party of excursionists from Chertsey or Isleworth passed us singing
+ and playing music.  There were lights in the upper windows of the
+ houses as the people went to bed.  From the railway station in the
+ distance came the sound of shunting trains, ringing and rumbling,
+ softened almost into melody by the distance.  My wife pointed out to
+ me the brightness of the red, green, and yellow signal lights hanging
+ in a framework against the sky. It seemed so safe and tranquil.
+ 
+ 
+ 
+                         CHAPTER TWO
+ 
+                      THE FALLING STAR
+ 
+    Then came the night of the frst falling star.  It was seen early
+ in the morning, rushing over Winchester eastward, a line of flame high
+ in the atmosphere.  Hundreds must have seen it, and taken it for an
+ ordinary falling star.  Albin described it as leaving a greenish
+ streak behind it that glowed for some seconds.  Denning, our greatest
+ authority on meteorites, stated that the height of its first
+ appearance was about ninety or one hundred miles.  It seemed to him
+ that it fell to earth about one hundred miles east of him.
+ 
+    I was at home at that hour and writing in my study; and although my
+ French windows face towards Ottershaw and the blind was up (for I
+ loved in those days to look up at the night sky), I saw nothing of it.
+ Yet this strangest of all things that ever came to earth from outer
+ space must have fallen while I was sitting there, visible to me had I
+ only looked up as it passed.  Some of those who saw its flight say it
+ travelled with a hissing sound.  I myself heard nothing of that.  Many
+ people in Berkshire, Surrey, and Middlesex must have seen the fall of
+ it, and, at most, have thought that another meteorite had descended.
+ No one seems to have troubled to look for the fallen mass that night.
+ 
+    But very early in the morning poor Ogilvy, who had seen the
+ shooting star and who was persuaded that a meteorite lay somewhere on
+ the common between Horsell, Ottershaw, and Woking, rose early with the
+ idea of finding it.  Find it he did, soon after dawn, and not far from
+ the sand pits.  An enormous hle had been made by the impact of the
+ projectile, and the sand and gravel had been flung violently in every
+ direction over the heath, forming heaps visible a mile and a half
+ away. The heather was on fire eastward, and a thin blue smoke rose
+ against the dawn.
+ 
+    The Thing itself lay almost entirely buried in sand, amidst the
+ scattered splinters of a fir tree it had shivered to fragments in its
+ descent.  The uncovered part had the appearance of a huge cylinder,
+ caked over and its outline softened by a thick scaly dun-coloured
+ incrustation.  It had a diameter of about thirty yards.  He approached
+ the mass, surprised at the size and more so at the shape, since most
+ meteorites are rounded more or less completely.  It was, however,
+ still so hot from its flight through the air as to forbid his near
+ approach. A stirring noise within its cylinder he ascribed to the
+ unequal cooling of its surface; for at that time it had not occurred
+ to him that it might be hollow.
+ 
+    He remained standing at the edge of the pit that the Thing had made
+ for itself, staring at its strange appearance, astonished chiefly at
+ its unusual shape and colour, and dimly perceiving even then some
+ evidence of design in its arrival.  The early morning was wonderfully
+ still, and the sun, just clearing the pine trees towards Weybridge,
+ was already warm.  He did not remember hearing any birds that morning,
+ there ws certanly no breeze stiring, and the only sounds were the
+ faint movements from within the cindery cylinder. He was all alone on
+ the common.
+ 
+    Then suddenly he noticed with a start that some of the grey
+ clinker, the ashy incrustation that covered the meteorite, was falling
+ off the circular edge of the end.  It was dropping off in flakes and
+ raining down upon the sand.  A large piece suddenly came off and fell
+ with a sharp noise that brought his heart into his mouth.
+ 
+    For a minute he scarcely realised what this meant, and, although
+ the heat was excessive, he clambered down into the pit close to the
+ bulk to see the Thing more clearly.  He fancied even then that the
+ cooling of the body might account for this, but what disturbed that
+ idea was the fact that the ash was falling only from the end of the
+ cylinder.
+ 
+    And then he perceived that, very slowly, the circular top of the
+ cylinder was rotating on its body.  It was such a gradual movement
+ that he discovered it only through noticing that a black mark that had
+ been near him five minutes ago was now at the other side of the
+ circumference.  Even then he scarcely understood what this indicated,
+ until he heard a muffled grating sound and saw the black mark jerk
+ forward an inch or so.  Then the thing came upon him in a flash.  The
+ clinder was artificial--holow--with an end that scrwed out!
+ Something within the cylinder was unscrewing the top!
+ 
+    "Good heavens!" said Ogilvy.  "There's a man in it--men in it! Half
+ roasted to death!  Trying to escape!"
+ 
+    At once, with a quick mental leap, he linked the Thing with the
+ flash upon Mars.
+ 
+    The thought of the confined creature was so dreadful to him that he
+ forgot the heat and went forward to the cylinder to help turn.  But
+ luckily the dull radiation arrested him before he could burn his hands
+ on the still-glowing metal.  At that he stood irresolute for a moment,
+ then turned, scrambled out of the pit, and set off running wildly into
+ Woking.  The time then must have been somewhere about six o'clock.  He
+ met a waggoner and tried to make him understand, but the tale he told
+ and his appearance were so wild--his hat had fallen off in the pit--
+ that the man simply drove on.  He was equally unsuccessful with the
+ potman who was just unlocking the doors of the public-house by Horsell
+ Bridge.  The fellow thought he was a lunatic at large and made an
+ unsuccessful attempt to shut him into the taproom.  That sobered him a
+ little; and when he saw Henderson, the London journalist, in his
+ garden, he called over the palings and made himself understood.
+ 
+    "Hederson," he called, "yousaw that shooting star last night?"
+ 
+    "Well?" said Henderson.
+ 
+    "It's out on Horsell Common now."
+ 
+    "Good Lord!" said Henderson.  "Fallen meteorite!  That's good."
+ 
+    "But it's something more than a meteorite.  It's a cylinder--an
+ artificial cylinder, man!  And there's something inside."
+ 
+    Henderson stood up with his spade in his hand.
+ 
+    "What's that?" he said.  He was deaf in one ear.
+ 
+    Ogilvy told him all that he had seen.  Henderson was a minute or so
+ taking it in.  Then he dropped his spade, snatched up his jacket, and
+ came out into the road.  The two men hurried back at once to the
+ common, and found the cylinder still lying in the same position.  But
+ now the sounds inside had ceased, and a thin circle of bright metal
+ showed between the top and the body of the cylinder.  Air was either
+ entering or escaping at the rim with a thin, sizzling sound.
+ 
+    They listened, rapped on the scaly burnt metal with a stick, and,
+ meeting with nwtho response, they both concluded the man or men inside
+ must be insensible or dead.
+ 
+    Of course the two were quite unable to do anything.  They shouted
+ consolation and promises, and went off back to the town again to get
+ help.  One can imagine them, covered with sand, excited and
+ disordered, running up the little street in the bright sunlight just
+ as the shop folks were taking down their shutters and people were
+ opening their bedroom windows.  Henderson went into the railway
+ station at once, in order to telegraph the news to London.  The
+ newspaper articles had prepared men's minds for the reception of the
+ idea.
+ 
+    By eight o'clock a number of boys and unemployed men had already
+ started for the common to see the "dead men from Mars."  That was the
+ form the story took.  I heard of it first from my newspaper boy about
+ a quarter to nine when I went out to get my DAILY CHRONICLE.  I was
+ naturally startled, and lost no time in going out and across the
+ Ottershaw bridge to the sand pits.
+ 
+ 
+ 
+                        CHAPTER THREE
+ 
+                      ON HORSELL COMMON
+ 
+    I found a little crowd of perhaps twenty people surrounding the
+ huge hole in which the cylinder lay.  I have already described the
+ appearance of that colossal bulk, embedded in the ground.  The turf
+ and gravel about it seemed charred as if by a sudden explosion.  No
+ doubt its impact had caused a flash of fire.  Henderson and Ogilvy
+ were not there.  I think they perceived that nothing was to be done
+ for the present, and had gone away to breakfast at Henderson's house.
+ 
+    There were four or five boys sitting on the edge of the Pit, with
+ their feet dangling, and amusing themselves--until I stopped them--by
+ throwing stones at the giant mass. After I had spoken to them about
+ it, they began playing at "touch" in and out of the group of
+ bystanders.
+ 
+    Among these were a couple of cyclists, a jobbing gardener I
+ employed sometimes, a girl carrying a baby, Gregg the butcher and his
+ little boy, and two or three loafers and golf caddies who were
+ accustomed to hang about the railway station.  There was very little
+ talking.  Few of the common people in England had anything but the
+ vaguest astronomical ideas in those days.  Most of them were staring
+ quietly at the big table like end of the cylinder, which was still as
+ Ogilvy and Henderson had left it.  I fancy the popular expectation of
+ a heap of of charred corpses was disappointed at this inanimate bulk.
+ Some went away while I was there, and other people came.  I clambered
+ into the pit and fancied I heard a faint movement under my feet.  The
+ top had certainly ceased to rotate.
+ 
+    It was only when I got thus close to it that the strangeness of
+ this object was at all evident to me.  At the first glance it was
+ really no more exciting than an overturned carriage or a tree blown
+ across the road.  Not so much so, indeed.  It looked like a rusty gas
+ float.  It required a certain amount of scientific education to
+ perceive that the grey scale of the Thing was no common oxide, that
+ the yellowish-white metal that gleamed in the crack between the lid
+ and the cylinder had an unfamiliar hue.  "Extra-terrestrial" had no
+ meaning for most of the onlookers.
+ 
+    At that time it was quite clear in my own mind that the Thing had
+ come from the planet Mars, but I judged it improbable that it
+ contained any living creature.  I thought the unscrewing might be
+ automatic.  In spite of Ogilvy, I still believed that there were men
+ in Mars.  My mind ran fancifully on the possibilities of its
+ containing manuscript, on the difficulties in translation that might
+ arise, whether we should find coins and models in it, and so forth.
+ Yet it was a little too large for assurance on this idea.  I felt an
+ impatience to see it opened.  About eleven, as nothing seemed
+ happening, I waked back, full of such thought, to my home in Maybury.
+ But I found it difficult to get to work upon my abstract
+ investigations.
+ 
+    In the afternoon the appearance of the common had altered very
+ much.  The early editions of the evening papers had startled London
+ with enormous headlines:
+ 
+              "A MESSAGE RECEIVED FROM MARS."
+ 
+              "REMARKABLE STORY FROM WOKING,"
+ 
+ and so forth.  In addition, Ogilvy's wire to the Astronomical Exchange
+ had roused every observatory in the three kingdoms.
+ 
+    There were half a dozen flies or more from the Woking station
+ standing in the road by the sand pits, a basket-chaise from Chobham,
+ and a rather lordly carriage.  Besides that, there was quite a heap of
+ bicycles.  In addition, a large number of people must have walked, in
+ spite of the heat of the day, from Woking and Chertsey, so that there
+ was altogether quite a considerable crowd--one or two gaily dressed
+ ladies among the others.
+ 
+   It was glaringly hot, not a cloud in the sky nor a breath of wind,
+ and the only sadow was that of the few scattered pine trees.  The
+ burning heather had been extinguished, but the level ground towards
+ Ottershaw was blackened as far as one could see, and still giving off
+ vertical streamers of smoke.  An enterprising sweet-stuff dealer in
+ the Chobham Road had sent up his son with a barrow-load of green
+ apples and ginger beer.
+ 
+    Going to the edge of the pit, I found it occupied by a group of
+ about half a dozen men--Henderson, Ogilvy, and a tall, fair-haired man
+ that I afterwards learned was Stent, the Astronomer Royal, with
+ several workmen wielding spades and pickaxes.  Stent was giving
+ directions in a clear, high-pitched voice.  He was standing on the
+ cylinder, which was now evidently much cooler; his face was crimson
+ and streaming with perspiration, and something seemed to have
+ irritated him.
+ 
+    A large portion of the cylinder had been uncovered, though its
+ lower end was still embedded.  As soon as Ogilvy saw me among the
+ staring crowd on the edge of the pit he called to me to come down, and
+ asked me if I would mind going over to see Lord Hilton, the lord of
+ the manor.
+ 
+    The growing crowd, he said, was becoming a serious impediment to
+ their excavations, especially the boys.  They wanted a light railing
+ put up, and help to keep the pexople back.  He told me that a faint
+ stirring was occasionally still audible within the case, but that the
+ workmen had failed to unscrew the top, as it afforded no grip to them.
+ The case appeared to be enormously thick, and it was possible that the
+ faint sounds we heard represented a noisy tumult in the interior.
+ 
+    I was very glad to do as he asked, and so become one of the
+ privileged spectators within the contemplated enclosure. I failed to
+ find Lord Hilton at his house, but I was told he was expected from
+ London by the six o'clock train from Waterloo; and as it was then
+ about a quarter past five, I went home, had some tea, and walked up to
+ the station to waylay him.
+ 
+ 
+ 
+                         CHAPTER FOUR
+ 
+                      THE CYLINDER OPENS
+ 
+    When I returned to the common the sun was setting. Scattered groups
+ were hurrying from the direction of Woking, and one or two persons
+ were returning.  The crowd about the pit had increased, and stood out
+ black against the lemon yellow of the sky--a couple of hundred people,
+ perhaps. There were raised voices, and some sort of struggle appeared
+ to be going on aout the pit.  Strange imaginings passed through my
+ mind.  As I drew nearer I heard Stent's voice:
+ 
+    "Keep back!  Keep back!"
+ 
+    A boy came running towards me.
+ 
+    "It's a-movin'," he said to me as he passed; "a-screwin' and a-
+ screwin' out.  I don't like it.  I'm a-goin' 'ome, I am."
+ 
+    I went on to the crowd.  There were really, I should think, two or
+ three hundred people elbowing and jostling one another, the one or two
+ ladies there being by no means the least active.
+ 
+    "He's fallen in the pit!" cried some one.
+ 
+    "Keep back!" said several.
+ 
+    The crowd swayed a little, and I elbowed my way through. Every one
+ seemed greatly excited.  I heard a peculiar humming sound from the
+ pit.
+ 
+    "I say!" said Ogilvy; "help keep these idiots back.  We don't know
+ what's in the confounded thing, you know!"
+ 
+    I saw a yoxung man, a shop assistant in Woking I believe he was,
+ standing on the cylinder and trying to scramble out of the hole again.
+ The crowd had pushed him in.
+ 
+    The end of the cylinder was being screwed out from within. Nearly
+ two feet of shining screw projected.  Somebody blundered against me,
+ and I narrowly missed being pitched onto the top of the screw.  I
+ turned, and as I did so the screw must have come out, for the lid of
+ the cylinder fell upon the gravel with a ringing concussion.  I stuck
+ my elbow into the person behind me, and turned my head towards the
+ Thing again. For a moment that circular cavity seemed perfectly black.
+ I had the sunset in my eyes.
+ 
+    I think everyone expected to see a man emerge--possibly something a
+ little unlike us terrestrial men, but in all essentials a man.  I know
+ I did.  But, looking, I presently saw something stirring within the
+ shadow: greyish billowy movements, one above another, and then two
+ luminous disks--like eyes. Then something resembling a little grey
+ snake, about the thickness of a walking stick, coiled up out of the
+ writhing middle, and wriggled in the air towards me--and then another.
+ 
+    A sudden chill came over me.  There was a loud shriek from a woman
+ behind.  I half turned, keeping my eyes fixed upon the cylinder still,
+ from which other tentacles were now projecting, and began pushing my
+ way back from the edge of the pit.  I saw astoxnishment giving place to
+ horror on the faces of the people about me.  I heard inarticulate
+ exclamations on all sides.  There was a general movement backwards. I
+ saw the shopman struggling still on the edge of the pit.  I found
+ myself alone, and saw the people on the other side of the pit running
+ off, Stent among them.  I looked again at the cylinder, and
+ ungovernable terror gripped me.  I stood petrified and staring.
+ 
+    A big greyish rounded bulk, the size, perhaps, of a bear, was
+ rising slowly and painfully out of the cylinder.  As it bulged up and
+ caught the light, it glistened like wet leather.
+ 
+    Two large dark-coloured eyes were regarding me steadfastly.  The
+ mass that framed them, the head of the thing, was rounded, and had,
+ one might say, a face.  There was a mouth under the eyes, the lipless
+ brim of which quivered and panted, and dropped saliva.  The whole
+ creature heaved and pulsated convulsively.  A lank tentacular
+ appendage gripped the edge of the cylinder, another swayed in the air.
+ 
+    Those who have never seen a living Martian can scarcely imagine the
+ strange horror of its appearance.  The peculiar V-shaped mouth with
+ its pointed upper lip, the absence of brow ridges, the absence of a
+ chin beneath the wedgelike lower lip, the incessant quivering of this
+ mouth, the Gorgon groups of tentacles, the tumultuous breathing of the
+ lungs in a stange atmosphere, the evident heaviness and painfulness
+ of movement due to the greater gravitational energy of the earth--
+ above all, the extraordinary intensity of the immense eyes--were at
+ once vital, intense, inhuman, crippled and monstrous.  There was
+ something fungoid in the oily brown skin, something in the clumsy
+ deliberation of the tedious movements unspeakably nasty.  Even at this
+ first encounter, this first glimpse, I was overcome with disgust and
+ dread.
+ 
+    Suddenly the monster vanished.  It had toppled over the brim of the
+ cylinder and fallen into the pit, with a thud like the fall of a great
+ mass of leather.  I heard it give a peculiar thick cry, and forthwith
+ another of these creatures appeared darkly in the deep shadow of the
+ aperture.
+ 
+    I turned and, running madly, made for the first group of trees,
+ perhaps a hundred yards away; but I ran slantingly and stumbling, for
+ I could not avert my face from these things.
+ 
+    There, among some young pine trees and furze bushes, I stopped,
+ panting, and waited further developments.  The common round the sand
+ pits was dotted with people, standing like myself in a half-fascinated
+ terror, staring at these creatures, or rather at the heaped gravel at
+ the edge of the pit in which they lay.  And then, with a renewed
+ horror, I saw a round, black obect bobbing up and down on the edge of
+ the pit.  It was the head of the shopman who had fallen in, but
+ showing as a little black object against the hot western sun. Now he
+ got his shoulder and knee up, and again he seemed to slip back until
+ only his head was visible.  Suddenly he vanished, and I could have
+ fancied a faint shriek had reached me.  I had a momentary impulse to
+ go back and help him that my fears overruled.
+ 
+    Everything was then quite invisible, hidden by the deep pit and the
+ heap of sand that the fall of the cylinder had made.  Anyone coming
+ along the road from Chobham or Woking would have been amazed at the
+ sight--a dwindling multitude of perhaps a hundred people or more
+ standing in a great irregular circle, in ditches, behind bushes,
+ behind gates and hedges, saying little to one another and that in
+ short, excited shouts, and staring, staring hard at a few heaps of
+ sand.  The barrow of ginger beer stood, a queer derelict, black
+ against the burning sky, and in the sand pits was a row of deserted
+ vehicles with their horses feeding out of nosebags or pawing the
+ ground.
+ 
+ 
+ 
+                         CHAPTER FIVE
+ 
+                         TE HEAT-RAY
+ 
+    After the glimpse I had had of the Martians emerging from the
+ cylinder in which they had come to the earth from their planet, a kind
+ of fascination paralysed my actions.  I remained standing knee-deep in
+ the heather, staring at the mound that hid them.  I was a battleground
+ of fear and curiosity.
+ 
+    I did not dare to go back towards the pit, but I felt a passionate
+ longing to peer into it.  I began walking, therefore, in a big curve,
+ seeking some point of vantage and continually looking at the sand
+ heaps that hid these new-comers to our earth.  Once a leash of thin
+ black whips, like the arms of an octopus, flashed across the sunset
+ and was immediately withdrawn, and afterwards a thin rod rose up,
+ joint by joint, bearing at its apex a circular disk that spun with a
+ wobbling motion.  What could be going on there?
+ 
+    Most of the spectators had gathered in one or two groups--one a
+ little crowd towards Woking, the other a knot of people in the
+ direction of Chobham.  Evidently they shared my mental conflict. There
+ were few near me.  One man I approached--he was, I perceived, a
+ neighbour of mine, though I did not know his name--and accosted.  But
+ it was scarcely a time for articulate conversation.
+ 
+    "What ugly brues!" he said.  "Good God!  What ugly brutes!"  He
+ repeated this over and over again.
+ 
+    "Did you see a man in the pit?" I said; but he made no answer to
+ that.  We became silent, and stood watching for a time side by side,
+ deriving, I fancy, a certain comfort in one another's company.  Then I
+ shifted my position to a little knoll that gave me the advantage of a
+ yard or more of elevation and when I looked for him presently he was
+ walking towards Woking.
+ 
+    The sunset faded to twilight before anything further happened.  The
+ crowd far away on the left, towards Woking, seemed to grow, and I
+ heard now a faint murmur from it. The little knot of people towards
+ Chobham dispersed.  There was scarcely an intimation of movement from
+ the pit.
+ 
+    It was this, as much as anything, that gave people courage, and I
+ suppose the new arrivals from Woking also helped to restore
+ confidence.  At any rate, as the dusk came on a slow, intermittent
+ movement upon the sand pits began, a movement that seemed to gather
+ force as the stillness of the evening about the cylinder remained
+ unbroken.  Vertical black figures in twos and threes would advance,
+ stop, watch, and advance again, spreading out as they did so in a thin
+ irregular crescent that promised to enclose the pit in its attenuated
+ horns.  I, too, on my side begazn to move towards the pit.
+ 
+    Then I saw some cabmen and others had walked boldly into the sand
+ pits, and heard the clatter of hoofs and the gride of wheels.  I saw a
+ lad trundling off the barrow of apples.  And then, within thirty yards
+ of the pit, advancing from the direction of Horsell, I noted a little
+ black knot of men, the foremost of whom was waving a white flag.
+ 
+    This was the Deputation.  There had been a hasty consultation, and
+ since the Martians were evidently, in spite of their repulsive forms,
+ intelligent creatures, it had been resolved to show them, by
+ approaching them with signals, that we too were intelligent.
+ 
+    Flutter, flutter, went the flag, first to the right, then to the
+ left.  It was too far for me to recognise anyone there, but afterwards
+ I learned that Ogilvy, Stent, and Henderson were with others in this
+ attempt at communication.  This little group had in its advance
+ dragged inward, so to speak, the circumference of the now almost
+ complete circle of people, and a number of dim black figures followed
+ it at discreet distances.
+ 
+    Suddenly there was a flash of light, and a quantity of luminous
+ greenish smoke came out of the pit in three distinct puffs, which
+ drove up, one after the other, straight into the still air.
+ 
+    This smok (or flame, perhaps, would be the better word for it) was
+ so bright that the deep blue sky overhead and the hazy stretches of
+ brown common towards Chertsey, set with black pine trees, seemed to
+ darken abruptly as these puffs arose, and to remain the darker after
+ their dispersal.  At the same time a faint hissing sound became
+ audible.
+ 
+    Beyond the pit stood the little wedge of people with the white flag
+ at its apex, arrested by these phenomena, a little knot of small
+ vertical black shapes upon the black ground. As the green smoke arose,
+ their faces flashed out pallid green, and faded again as it vanished.
+ Then slowly the hissing passed into a humming, into a long, loud,
+ droning noise.  Slowly a humped shape rose out of the pit, and the
+ ghost of a beam of light seemed to flicker out from it.
+ 
+    Forthwith flashes of actual flame, a bright glare leaping from one
+ to another, sprang from the scattered group of men. It was as if some
+ invisible jet impinged upon them and flashed into white flame.  It was
+ as if each man were suddenly and momentarily turned to fire.
+ 
+    Then, by the light of their own destruction, I saw them staggering
+ and falling, and their supporters turning to run.
+ 
+    I stood staring, not as yet realising that this was death leaping
+ from man to man in that little distant crowd.  All I felt was that it
+ was something very strange.  An almost noiseless and blinding flash of
+ light, and a man fell headlong and lay still; and as the unseen shaft
+ of heat passed over them, pine trees burst into fire, and every dry
+ furze bush became with one dull thud a mass of flames.  And far away
+ towards Knaphill I saw the flashes of trees and hedges and wooden
+ buildings suddenly set alight.
+ 
+    It was sweeping round swiftly and steadily, this flaming death,
+ this invisible, inevitable sword of heat.  I perceived it coming
+ towards me by the flashing bushes it touched, and was too astounded
+ and stupefied to stir.  I heard the crackle of fire in the sand pits
+ and the sudden squeal of a horse that was as suddenly stilled.  Then
+ it was as if an invisible yet intensely heated finger were drawn
+ through the heather between me and the Martians, and all along a
+ curving line beyond the sand pits the dark ground smoked and crackled.
+ Something fell with a crash far away to the left where the road from
+ Woking station opens out on the common.  Forth-with the hissing and
+ humming ceased, and the black, dome-like object sank slowly out of
+ sight into the pit.
+ 
+    All this had happened with such swiftness that I had stood
+ motionless, dumbfounded and dazzled by the flashes of light. Had that
+ death swept through a full circle, it must inevitably have slain me in
+ my srprise.  But it passed and spared me, and left the night about me
+ suddenly dark and unfamiliar.
+ 
+    The undulating common seemed now dark almost to blackness, except
+ where its roadways lay grey and pale under the deep blue sky of the
+ early night.  It was dark, and suddenly void of men.  Overhead the
+ stars were mustering, and in the west the sky was still a pale,
+ bright, almost greenish blue.  The tops of the pine trees and the
+ roofs of Horsell came out sharp and black against the western
+ afterglow.  The Martians and their appliances were altogether
+ invisible, save for that thin mast upon which their restless mirror
+ wobbled. Patches of bush and isolated trees here and there smoked and
+ glowed still, and the houses towards Woking station were sending up
+ spires of flame into the stillness of the evening air.
+ 
+    Nothing was changed save for that and a terrible astonishment. The
+ little group of black specks with the flag of white had been swept out
+ of existence, and the stillness of the evening, so it seemed to me,
+ had scarcely been broken.
+ 
+    It came to me that I was upon this dark common, helpless,
+ unprotected, and alone.  Suddenly, like a thing falling upon me from
+ without, came--fear.
+ 
+    With an effort I turned and began a stumbling run through the
+ heather.
+ 
+    The fear I felt was no rational fear, but a panic terror not only
+ of the Martians, but of the dusk and stillness all about me.  Such an
+ extraordinary effect in unmanning me it had that I ran weeping
+ silently as a child might do.  Once I had turned, I did not dare to
+ look back.
+ 
+    I remember I felt an extraordinary persuasion that I was being
+ played with, that presently, when I was upon the very verge of safety,
+ this mysterious death--as swift as the passage of light--would leap
+ after me from the pit about the cylinder and strike me down.
+ 
+ 
+ 
+                         CHAPTER SIX
+ 
+              THE HEAT-RAY IN THE CHOBHAM ROAD
+ 
+    It is still a matter of wonder how the Martians are able to slay
+ men so swiftly and so silently.  Many think that in some way they are
+ able to generate an intense heat in a chamber of practically absolute
+ non-conductivity.  This intense heat they project in a parallel beam
+ against any object they choose, by means of a polished parabolic
+ mirror of unknown composition, much as the parabolic mirror of a
+ lighthouse projects a beam of light.  But no one has absolutely proved
+ these details.  However it is done, it is certain that a beam of heat
+ is the essence of the matter.  Heat, and invisible, instead of
+ visible, light.  Whatever is combustible flashes into flame at its
+ touch, lead runs like water, it softens iron, cracks and melts glass,
+ and when it falls upon water, incontinently that explodes into steam.
+ 
+    That night nearly forty people lay under the starlight about the
+ pit, charred and distorted beyond recognition, and all night long the
+ common from Horsell to Maybury was deserted and brightly ablaze.
+ 
+    The news of the massacre probably reached Chobham, Woking, and
+ Ottershaw about the same time.  In Woking the shops had closed when
+ the tragedy happened, and a number of people, shop people and so
+ forth, attracted by the stories they had heard, were walking over the
+ Horsell Bridge and along the road between the hedges that runs out at
+ last upon the common.  You may imagine the young people brushed up
+ after the labours of the day, and making this novelty, as they would
+ make any novelty, the excuse for walking together and enjoying a
+ trivial flirtation.  You may figure to yourself the hum of voices
+ along the road in the gloaming. . . .
+ 
+    As yet, of course, few people in Woing even knew that the cylinder
+ had opened, though poor Henderson had sent a messenger on a bicycle to
+ the post office with a special wire to an evening paper.
+ 
+    As these folks came out by twos and threes upon the open, they
+ found little knots of people talking excitedly and peering at the
+ spinning mirror over the sand pits, and the newcomers were, no doubt,
+ soon infected by the excitement of the occasion.
+ 
+    By half past eight, when the Deputation was destroyed, there may
+ have been a crowd of three hundred people or more at this place,
+ besides those who had left the road to approach the Martians nearer.
+ There were three policemen too, one of whom was mounted, doing their
+ best, under instructions from Stent, to keep the people back and deter
+ them from approaching the cylinder.  There was some booing from those
+ more thoughtless and excitable souls to whom a crowd is always an
+ occasion for noise and horse-play.
+ 
+    Stent and Ogilvy, anticipating some possibilities of a collision,
+ had telegraphed from Horsell to the barracks as soon as the Martians
+ emerged, for the help of a company of soldiers to protect these
+ strange creatures from violence. After that they returned to lead that
+ ill-fated advance.  The description of their death, as it was seen by
+ the crowd, tallies very closely with my own impressions: the three
+ puffs of green smoke, the deep humming note, and the flashes of flame.
+ 
+    But that crowd of people had a far narrower escape than mine.  Only
+ the fact that a hummock of heathery sand intercepted the lower part of
+ the Heat-Ray saved them.  Had the elevation of the parabolic mirror
+ been a few yards higher, none could have lived to tell the tale.  They
+ saw the flashes and the men falling and an invisible hand, as it were,
+ lit the bushes as it hurried towards them through the twilight.  Then,
+ with a whistling note that rose above the droning of the pit, the beam
+ swung close over their heads, lighting the tops of the beech trees
+ that line the road, and splitting the bricks, smashing the windows,
+ firing the window frames, and bringing down in crumbling ruin a
+ portion of the gable of the house nearest the corner.
+ 
+    In the sudden thud, hiss, and glare of the igniting trees, the
+ panic-stricken crowd seems to have swayed hesitatingly for some
+ moments.  Sparks and burning twigs began to fall into the road, and
+ single leaves like puffs of flame.  Hats and dresses caught fire. Then
+ came a crying from the common. There were shrieks and shouts, and
+ suddenly a mounted policeman came galloping through the confusion with
+ his hands clasped over his head, screaming.
+ 
+    "They're coming!" a woman shrieked, and incontinently everyone was
+ turning and pushing at those behind, in order to clear their way to
+ Woking again.  They must have bolted as blindly as a flock of sheep.
+ Where the road grows narrow and black between the high banks the crowd
+ jammed, and a desperate struggle occurred.  All that crowd did not
+ escape; three persons at least, two women and a little boy, were
+ crushed and trampled there, and left to die amid the terror and the
+ darkness.
+ 
+ 
+ 
+                        CHAPTER SEVEN
+ 
+                     HOW I REACHED HOME
+ 
+    For my own part, I remember nothing of my flight except the stress
+ of blundering against trees and stumbling through the heather.  All
+ about me gathered the invisible terrors of the Martians; that pitiless
+ sword of heat seemed whirling to and fro, flourishing overhead before
+ it descended and smote me out of life.  I came into the road between
+ the crossroads and Horsell, and ran along this to the crossroads.
+ 
+    At last I could go no further; I was exhausted with the violence of
+ my emotion and of my flight, and I staggered and fell by the wayside.
+ That was near the bridge that crosses the canal by the gasworks.  I
+ fell and lay still.
+ 
+    I must have remained there some time.
+ 
+    I sat up, strangely perplexed.  For a moment, perhaps, I could not
+ clearly understand how I came there.  My terror had fallen from me
+ like a garment.  My hat had gone, and my collar had burst away from
+ its fastener.  A few minutes before, there had only been three real
+ things before me--the immensity of the night and space and nature, my
+ own feebleness and anguish, and the near approach of death.  Now it
+ was as if something turned over, and the point of view altered
+ abruptly.  There was no sensible transition from one state of mind to
+ the other.  I was immediately the self of every day again--a decent,
+ ordinary citizen.  The silent common, the impulse of my flight, the
+ starting flames, were as if they had been in a dream.  I asked myself
+ had these latter things indeed happened?  I could not credit it.
+ 
+    I rose and walked unsteadily up the steep incline of the bridge. My
+ mind was blank wonder.  My muscles and nerves seemed drained of their
+ strength.  I dare say I staggered drunkenly.  A head rose over the
+ arch, and the figure of a workman carrying a basket appeared. Beside
+ him ran a little boy.  He passed me, wishing me good night.  I was
+ minded to speak to him, but did not.  I answered his greeting with a
+ meaningless mumble and went on over the bridge.
+ 
+    Over the Maybury arch a train, a billowing tumult of white, firelit
+ smoke, and a long caterpillar of lighted windows, went flying south--
+ clatter, clatter, clap, rap, and it had gone. A dim group of people
+ talked in the gate of one of the houses in the pretty little row of
+ gables that was called Oriental Terrace.  It was all so real and so
+ familiar.  And that behind me!  It was frantic, fantastic!  Such
+ things, I told myself, could not be.
+ 
+    Perhaps I am a man of exceptional moods.  I do not know how far my
+ experience is common.  At times I suffer from the strangest sense of
+ detachment from myself and the world about me; I seem to watch it all
+ from the outside, from somewhere inconceivably remote, out of time,
+ out of space, out of the stress and tragedy of it all.  This feeling
+ was very strong upon me that night.  Here was another side to my
+ dream.
+ 
+    But the trouble was the blank incongruity of this serenity and the
+ swift death flying yonder, not two miles away.  There was a noise of
+ business from the gasworks, and the electric lamps were all alight.  I
+ stopped at the group of people.
+ 
+    "What news from the common?" said I.
+ 
+    There were two men and a woman at the gate.
+ 
+    "Eh?" said one of the men, turning.
+ 
+    "What news from the common?" I said.
+ 
+    "'Ain't yer just BEEN there?" asked the men.
+ 
+    "People seem fair silly about the common," said the woman over the
+ gate.  "What's it all abart?"
+ 
+    "Haven't you heard of the men from Mars?" said I; "the creatures
+ from Mars?"
+ 
+    "Quite enough," said the woman over the gate.  "Thenks"; and all
+ three of them laughed.
+ 
+    I felt foolish and angry.  I tried and found I could not tell them
+ what I had seen.  They laughed again at my broken sentences.
+ 
+    "You'll hear more yet," I said, and went on to my home.
+ 
+    I startled my wife at the doorway, so haggard was I.  I went into
+ the dining room, sat down, drank some wine, and so soon as I could
+ collect myself sufficiently I told her the things I had seen.  The
+ dinner, which was a cold one, had already been served, and remained
+ neglected on the table while I told my story.
+ 
+    "There is one thing," I said, to allay the fears I had aroused;
+ "they are the most sluggish things I ever saw crawl. They may keep the
+ pit and kill people who come near them, but they cannot get out of it.
+ . . .  But the horror of them!"
+ 
+    "Don't, dear!" said my wife, knitting her brows and putting her
+ hand on mine.
+ 
+    "Poor Ogilvy!" I said.  "To think he may be lying dead there!"
+ 
+    My wife at least did not find my experience incredible. When I saw
+ how deadly white her face was, I ceased abruptly.
+ 
+    "They may come here," she said again and again.
+ 
+    I pressed her to take wine, and tried to reassure her.
+ 
+    "They can scarcely move," I said.
+ 
+    I began to comfort her and myself by repeating all that Ogilvy had
+ told me of the impossibility of the Martians establishing themselves
+ on the earth.  In particular I laid stress on the gravitational
+ difficulty.  On the surface of the earth the force of gravity is three
+ times what it is on the surface of Mars.  A Martian, therefore, would
+ weigh three times more than on Mars, albeit his muscular strength
+ would be the same. His own body would be a cope of lead to him.  That,
+ indeed, was the general opinion.  Both THE TIMES and the DAILY
+ TELEGRAPH, for instance, insisted on it the next morning, and both
+ overlooked, just as I did, two obvious modifying influences.
+ 
+    The atmosphere of the earth, we now know, contains far more oxygen
+ or far less argon (whichever way one likes to put it) than does Mars.
+ The invigorating influences of this excess of oxygen upon the Martians
+ indisputably did much to counterbalance the increased weight of their
+ bodies.  And, in the second place, we all overlooked the fact that
+ such mechanical intelligence as the Martian possessed was quite able
+ to dispense with muscular exertion at a pinch.
+ 
+    But I did not consider these points at the time, and so my
+ reasoning was dead against the chances of the invaders. With wine and
+ food, the confidence of my own table, and the necessity of reassuring
+ my wife, I grew by insensible degrees courageous and secure.
+ 
+    "They have done a foolish thing," said I, fingering my wineglass.
+ "They are dangerous because, no doubt, they are mad with terror.
+ Perhaps they expected to find no living things--certainly no
+ intelligent living things."
+ 
+    "A shell in the pit" said I, "if the worst comes to the worst will
+ kill them all."
+ 
+    The intense excitement of the events had no doubt left my
+ perceptive powers in a state of erethism.  I remember that dinner
+ table with extraordinary vividness even now.  My dear wife's sweet
+ anxious face peering at me from under the pink lamp shade, the white
+ cloth with its silver and glass table furniture--for in those days
+ even philosophical writers had many little luxuries--the crimson-
+ purple wine in my glass, are photographically distinct.  At the end of
+ it I sat, tempering nuts with a cigarette, regretting Ogilvy's
+ rashness, and denouncing the shortsighted timidity of the Martians.
+ 
+    So some respectable dodo in the Mauritius might have lorded it in
+ his nest, and discussed the arrival of that shipful of pitiless
+ sailors in want of animal food.  "We will peck them to death tomorrow,
+ my dear."
+ 
+    I did not know it, but that was the last civilised dinner I was to
+ eat for very many strange and terrible days.
+ 
+ 
+ 
+                       CHAPTER EIGHT
+ 
+                       FRIDAY NIGHT
+ 
+    The most extraordinary thing to my mind, of all the strange and
+ wonderful things that happened upon that Friday, was the dovetailing
+ of the commonplace habits of our social order with the first
+ beginnings of the series of events that was to topple that social
+ order headlong.  If on Friday night you had taken a pair of compasses
+ and drawn a circle with a radius of five miles round the Woking sand
+ pits, I doubt if you would have had one human being outside it, unless
+ it were some relation of Stent or of the three or four cyclists or
+ London people lying dead on the common, whose emotions or habits were
+ at all affected by the new-comers. Many people had heard of the
+ cylinder, of course, and talked about it in their leisure, but it
+ certainly did not make the sensation that an ultimatum to Germany
+ would have done.
+ 
+    In London that night poor Henderson's telegram describing the
+ gradual unscrewing of the shot was judged to be a canard, and his
+ evening paper, after wiring for authentication from him and receiving
+ no reply--the man was killed--decided not to print a special edition.
+ 
+    Even within the five-mile circle the great majority of people were
+ inert.  I have already described the behaviour of the men and women to
+ whom I spoke.  All over the district people were dining and supping;
+ working men were gardening after the labours of the day, children were
+ being put to bed, young people were wandering through the lanes love-
+ making, students sat over their books.
+ 
+    Maybe there was a murmur in the village streets, a novel and
+ dominant topic in the public-houses, and here and there a messenger,
+ or even an eye-witness of the later occurrences, caused a whirl of
+ excitement, a shouting, and a running to and fro; but for the most
+ part the daily routine of working, eating, drinking, sleeping, went on
+ as it had done for countless years--as though no planet Mars existed
+ in the sky. Even at Woking station and Horsell and Chobham that was
+ the case.
+ 
+     In Woking junction, until a late hour, trains were stopping and
+ going on, others were shunting on the sidings, passengers were
+ alighting and waiting, and everything was proceeding in the most
+ ordinary way.  A boy from the town, trenching on Smith's monopoly, was
+ selling papers with the afternoon's news.  The ringing impact of
+ trucks, the sharp whistle of the engines from the junction, mingled
+ with their shouts of "Men from Mars!"  Excited men came into the
+ station about nine o'clock with incredible tidings, and caused no more
+ disturbance than drunkards might have done.  People rattling
+ Londonwards peered into the darkness outside the carriage windows, and
+ saw only a rare, flickering, vanishing spark dance up from the
+ direction of Horsell, a red glow and a thin veil of smoke driving
+ across the stars, and thought that nothing more serious than a heath
+ fire was happening.  It was only round the edge of the common that any
+ disturbance was perceptible.  There were half a dozen villas burning
+ on the Woking border.  There were lights in all the houses on the
+ common side of the three villages, and the people there kept awake
+ till dawn.
+ 
+    A curious crowd lingered restlessly, people coming and going but
+ the crowd remaining, both on the Chobham and Horsell bridges.  One or
+ two adventurous souls, it was afterwards found, went into the darkness
+ and crawled quite near the Martians; but they never returned, for now
+ and again a light-ray, like the beam of a warship's searchlight swept
+ the common, and the Heat-Ray was ready to follow. Save for such, that
+ big area of common was silent and desolate, and the charred bodies lay
+ about on it all night under the stars, and all the next day.  A noise
+ of hammering from the pit was heard by many people.
+ 
+    So you have the state of things on Friday night.  In the centre,
+ sticking into the skin of our old planet Earth like a poisoned dart,
+ was this cyinder.  But the poison was scarcely working yet.  Around
+ it was a patch of silent common, smouldering in places, and with a few
+ dark, dimly seen objects lying in contorted attitudes here and there.
+ Here and there was a burning bush or tree.  Beyond was a fringe of
+ excitement, and farther than that fringe the inflammation had not
+ crept as yet.  In the rest of the world the stream of life still
+ flowed as it had flowed for immemorial years.  The fever of war that
+ would presently clog vein and artery, deaden nerve and destroy brain,
+ had still to develop.
+ 
+    All night long the Martians were hammering and stirring, sleepless,
+ indefatigable, at work upon the machines they were making ready, and
+ ever and again a puff of greenish-white smoke whirled up to the
+ starlit sky.
+ 
+    About eleven a company of soldiers came through Horsell, and
+ deployed along the edge of the common to form a cordon.  Later a
+ second company marched through Chobham to deploy on the north side of
+ the common.  Several officers from the Inkerman barracks had been on
+ the common earlier in the day, and one, Major Eden, was reported to be
+ missing. The colonel of the regiment came to the Chobham bridge and
+ was busy questioning the crowd at midnight.  The military authorities
+ were certainly alive to the seriousness of the business.  About
+ eleven, the next morning's papers were able to say, a squadron of
+ hussars, two Maxims, and about four hundred men of the Cardigan
+ regiment started from Aldershot.
+ 
+    A few seconds after midnight the crowd in the Chertsey road,
+ Woking, saw a star fall from heaven into the pine woods to the
+ northwest.  It had a greenish colour, and caused a silent brightness
+ like summer lightning.  This was the second cylinder.
+ 
+ 
+ 
+                        CHAPTER NINE
+ 
+                    THE FIGHTING BEGINS
+ 
+    Saturday lives in my memory as a day of suspense.  It was a day of
+ lassitude too, hot and close, with, I am told, a rapidly fluctuating
+ barometer.  I had slept but little, though my wife had succeeded in
+ sleeping, and I rose early.  I went into my garden before breakfast
+ and stood listening, but towards the common there was nothing stirring
+ but a lark.
+ 
+    The milkman came as usual.  I heard the rattle of his chariot and I
+ went round to the side gate to ask the latest news.  He told me that
+ during the night the Martians had been surrounded by troops, and that
+ guns were expected. Then--a familiar, reassuring note--I heard a train
+ running towards Woking.
+ 
+    "They aren't to be killed," said the milkman, "if that can possibly
+ be avoided."
+ 
+    I saw my neighbour gardening, chatted with him for a time, and then
+ strolled in to breakfast.  It was a most unexceptional morning.  My
+ neighbour was of opinion that the troops would be able to capture or
+ to destroy the Martians during the day.
+ 
+    "It's a pity they make themselves so unapproachable," he said.  "It
+ would be curious to know how they live on another planet; we might
+ learn a thing or two."
+ 
+    He came up to the fence and extended a handful of strawberries, for
+ his gardening was as generous as it was enthusiastic.  At the same
+ time he told me of the burning of the pine woods about the Byfleet
+ Golf Links.
+ 
+    "They say," said he, "that there's another of those blessed things
+ fallen there--number two.  But one's enough, surely. This lot'll cost
+ the insurance people a pretty penny before everything's settled."  He
+ laughed with an air of the greatest good humour as he said this.  The
+ woods, he said, were still burning, and pointed out a haze of smoke to
+ me.  "They will be hot under foot for days, on account of the thick
+ soil of pine needles and turf," he said, and then grew serious over
+ "poor Ogilvy."
+ 
+    After breakfast, instead of working, I decided to walk down towards
+ the common.  Under the railway bridge I found a group of soldiers--
+ sappers, I think, men in small round caps, dirty red jackets
+ unbuttoned, and showing their blue shirts, dark trousers, and boots
+ coming to the calf.  They told me no one was allowed over the canal,
+ and, looking along the road towards the bridge, I saw one of the
+ Cardigan men standing sentinel there.  I talked with these soldiers
+ for a time; I told them of my sight of the Martians on the previous
+ evening.  None of them had seen the Martians, and they had but the
+ vaguest ideas of them, so that they plied me with questions.  They
+ said that they did not know who had authorised the movements of the
+ troops; their idea was that a dispute had arisen at the Horse Guards.
+ The ordinary sapper is a great deal better educated than the common
+ soldier, and they discussed the peculiar conditions of the possible
+ fight with some acuteness.  I described the Heat-Ray to them, and they
+ began to argue among themselves.
+ 
+    "Crawl up under cover and rush 'em, say I," said one.
+ 
+    "Get aht!," said another.  "What's cover against this 'ere 'eat?
+ Sticks to cook yer!  What we got to do is to go as near as the
+ ground'll let us, and then drive a trench."
+ 
+    "Blow yer trenches!  You always want trenches; you ought to ha'
+ been born a rabbit Snippy."
+ 
+    "Ain't they got any necks, then?" said a third, abruptly--a little,
+ contemplative, dark man, smoking a pipe.
+ 
+    I repeated my description.
+ 
+    "Octopuses," said he, "that's what I calls 'em.  Talk about fishers
+ of men--fighters of fish it is this time!"
+ 
+    "It ain't no murder killing beasts like that," said the first
+ speaker.
+ 
+    "Why not shell the darned things strite off and finish 'em?" said
+ the little dark man.  "You carn tell what they might do."
+ 
+    "Where's your shells?" said the first speaker.  "There ain't no
+ time.  Do it in a rush, that's my tip, and do it at once."
+ 
+    So they discussed it.  After a while I left them, and went on to
+ the railway station to get as many morning papers as I could.
+ 
+     But I will not weary the reader with a description of that long
+ morning and of the longer afternoon.  I did not succeed in getting a
+ glimpse of the common, for even Horsell and Chobham church towers were
+ in the hands of the military authorities.  The soldiers I addressed
+ didn't know anything; the officers were mysterious as well as busy.  I
+ found people in the town quite secure again in the presence of the
+ military, and I heard for the first time from Marshall, the
+ tobacconist, that his son was among the dead on the common.  The
+ soldiers had made the people on the outskirts of Horsell lock up and
+ leave their houses.
+ 
+    I got back to lunch about two, very tired for, as I have said, the
+ day was extremely hot and dull; and in order to refresh myself I took
+ a cold bath in the afternoon.  About half past four I went up to the
+ railway station to get an evening paper, for the morning papers had
+ contained only a very inaccurate description of the killing of Stent,
+ Henderson, Ogilvy, and the others.  But there was little I didn't
+ know. The Martians did not show an inch of themselves.  They seemed
+ busy in their pit, and there was a sound of hammering and an almost
+ continuous streamer of smoke.  Apparently they were busy getting ready
+ for a struggle.  "Fresh attempts have been made to signal, but without
+ success," was the stereotyped formula of the papers.  A sapper told me
+ it was done by a man in a ditch with a flag on a long pole.  The
+ Martians took as much notice of such advances as we should of the
+ lowing of a cow.
+ 
+    I must confess the sight of all this armament, all this
+ preparation, greatly excited me.  My imagination became belligerent,
+ and defeated the invaders in a dozen striking ways; something of my
+ schoolboy dreams of battle and heroism came back.  It hardly seemed a
+ fair fight to me at that time. They seemed very helpless in that pit
+ of theirs.
+ 
+    About three o'clock there began the thud of a gun at measured
+ intervals from Chertsey or Addlestone.  I learned that the smouldering
+ pine wood into which the second cylinder had fallen was being shelled,
+ in the hope of destroying that object before it opened.  It was only
+ about five, however, that a field gun reached Chobham for use against
+ the first body of Martians.
+ 
+    About six in the evening, as I sat at tea with my wife in the
+ summerhouse talking vigorously about the battle that was lowering upon
+ us, I heard a muffled detonation from the common, and immediately
+ after a gust of firing.  Close on the heels of that came a violent
+ rattling crash, quite close to us, that shook the ground; and,
+ starting out upon the lawn, I saw the tops of the trees about the
+ Oriental College burst into smoky red flame, and the tower of the
+ little church beside it slide down into ruin.  The pinnacle of the
+ mosque had vanished, and the roof line of the college itself looked as
+ if a hundred-ton gun had been at work upon it.  One of our chimneys
+ cracked as if a shot had hit it, flew, and a piece of it came
+ clattering down the tiles and made a heap of broken red fragments upon
+ the flower bed by my study window.
+ 
+    I and my wife stood amazed.  Then I realised that the crest of
+ Maybury Hill must be within range of the Martians' Heat-Ray now that
+ the college was cleared out of the way.
+ 
+    At that I gripped my wife's arm, and without ceremony ran her out
+ into the road.  Then I fetched out the servant, telling her I would go
+ upstairs myself for the box she was clamouring for.
+ 
+    "We can't possibly stay here," I said; and as I spoke the firing
+ reopened for a moment upon the common.
+ 
+    "But where are we to go?" said my wife in terror.
+ 
+    I thought perplexed.  Then I remembered her cousins at Leatherhead.
+ 
+    "Leatherhead!" I shouted above the sudden noise.
+ 
+    She looked away from me downhill.  The people were coming out of
+ their houses, astonished.
+ 
+    "How are we to get to Leatherhead?" she said.
+ 
+    Down the hill I saw a bevy of hussars ride under the railway
+ bridge; three galloped through the open gates of the Oriental College;
+ two others dismounted, and began running from house to house.  The
+ sun, shining through the smoke that drove up from the tops of the
+ trees, seemed blood red, and threw an unfamiliar lurid light upon
+ everything.
+ 
+    "Stop here," said I; "you are safe here"; and I started off at once
+ for the Spotted Dog, for I knew the landlord had a horse and dog cart.
+ I ran, for I perceived that in a moment everyone upon this side of the
+ hill would be moving.  I found him in his bar, quite unaware of what
+ was going on behind his house.  A man stood with his back to me,
+ talking to him.
+ 
+    "I must have a pound," said the landlord, "and I've no one to drive
+ it."
+ 
+    "I'll give you two," said I, over the stranger's shoulder.
+ 
+    "What for?"
+ 
+    "And I'll bring it back by midnight," I said.
+ 
+    "Lord!" said the landlord; "what's the hurry?  I'm selling my bit
+ of a pig.  Two pounds, and you bring it back?  What's going on now?"
+ 
+    I explained hastily that I had to leave my home, and so secured the
+ dog cart.  At the time it did not seem to me nearly so urgent that the
+ landlord should leave his.  I took care to have the cart there and
+ then, drove it off down the road, and, leaving it in charge of my wife
+ and servant, rushed into my house and packed a few valuables, such
+ plate as we had, and so forth.  The beech trees below the house were
+ burning while I did this, and the palings up the road glowed red.
+ While I was occupied in this way, one of the dismounted hussars came
+ running up.  He was going from house to house, warning people to
+ leave.  He was going on as I came out of my front door, lugging my
+ treasures, done up in a tablecloth.  I shouted after him:
+ 
+    "What news?"
+ 
+    He turned, stared, bawled something about "crawling out in a thing
+ like a dish cover," and ran on to the gate of the house at the crest.
+ A sudden whirl of black smoke driving across the road hid him for a
+ moment.  I ran to my neighbour's door and rapped to satisfy myself of
+ what I already knew, that his wife had gone to London with him and had
+ locked up their house.  I went in again, according to my promise, to
+ get my servant's box, lugged it out, clapped it beside her on the tail
+ of the dog cart, and then caught the reins and jumped up into the
+ driver's seat beside my wife.  In another moment we were clear of the
+ smoke and noise, and spanking down the opposite slope of Maybury Hill
+ towards Old Woking.
+ 
+    In front was a quiet sunny landscape, a wheat field ahead on either
+ side of the road, and the Maybury Inn with its swinging sign.  I saw
+ the doctor's cart ahead of me.  At the bottom of the hill I turned my
+ head to look at the hillside I was leaving.  Thick streamers of black
+ smoke shot with threads of red fire were driving up into the still
+ air, and throwing dark shadows upon the green treetops eastward.  The
+ smoke already extended far away to the east and west--to the Byfleet
+ pine woods eastward, and to Woking on the west.  The road was dotted
+ with people running towards us.  And very faint now, but very distinct
+ through the hot, quiet air, one heard the whirr of a machine-gun that
+ was presently stilled, and an intermittent cracking of rifles.
+ Apparently the Martians were setting fire to everything within range
+ of their Heat-Ray.
+ 
+    I am not an expert driver, and I had immediately to turn my
+ attention to the horse.  When I looked back again the second hill had
+ hidden the black smoke.  I slashed the horse with the whip, and gave
+ him a loose rein until Woking and Send lay between us and that
+ quivering tumult.  I overtook and passed the doctor between Woking and
+ Send.
+ 
+ 
+ 
+                         CHAPTER TEN
+ 
+                        IN THE STORM
+ 
+    Leatherhead is about twelve miles from Maybury Hill. The scent of
+ hay was in the air through the lush meadows beyond Pyrford, and the
+ hedges on either side were sweet and gay with multitudes of dog-roses.
+ The heavy firing that had broken out while we were driving down
+ Maybury Hill ceased as abruptly as it began, leaving the evening very
+ peaceful and still.  We got to Leatherhead without misadventure about
+ nine o'clock, and the horse had an hour's rest while I took supper
+ with my cousins and commended my wife to their care.
+ 
+    My wife was curiously silent throughout the drive, and seemed
+ oppressed with foxrebodings of evil.  I talked to her reassuringly,
+ pointing out that the Martians were tied to the Pit by sheer
+ heaviness, and at the utmost could but crawl a little out of it; but
+ she answered only in monosyllables.  Had it not been for my promise to
+ the innkeeper, she would, I think, have urged me to stay in
+ Leatherhead that night.  Would that I had!  Her face, I remember, was
+ very white as we parted.
+ 
+    For my own part, I had been feverishly excited all day. Something
+ very like the war fever that occasionally runs through a civilised
+ community had got into my blood, and in my heart I was not so very
+ sorry that I had to return to Maybury that night.  I was even afraid
+ that that last fusillade I had heard might mean the extermination of
+ our invaders from Mars.  I can best express my state of mind by saying
+ that I wanted to be in at the death.
+ 
+    It was nearly eleven when I started to return.  The night was
+ unexpectedly dark; to me, walking out of the lighted passage of my
+ cousins' house, it seemed indeed black, and it was as hot and close as
+ the day.  Overhead the clouds were driving fast, albeit not a breath
+ stirred the shrubs about us. My cousins' man lit both lamps.  Happily,
+ I knew the road intimately.  My wife stood in the light of the
+ doorway, and watched me until I jumped up into the dog cart.  Then
+ abruptly she turned and went in, leaving my cousins side by side
+ wishing me good hap.
+ 
+    I was a little depressed at first with the contagion of my wife's
+ fears, but very soon my thoughts reverted to the Martians.  At that
+ time I was absolutely in the dark as to the course of the evening's
+ fighting.  I did not know even the circumstances that had precipitated
+ the conflict.  As I came through Ockham (for that was the way I
+ returned, and not through Send and Old Woking) I saw along the western
+ horizon a blood-red glow, which as I drew nearer, crept slowly up the
+ sky.  The driving clouds of the gathering thunderstorm mingled there
+ with masses of black and red smoke.
+ 
+    Ripley Street was deserted, and except for a lighted window or so
+ the village showed not a sign of life; but I narrowly escaped an
+ accident at the corner of the road to Pyrford, where a knot of people
+ stood with their backs to me.  They said nothing to me as I passed.  I
+ do not know what they knew of the things happening beyond the hill,
+ nor do I know if the silent houses I passed on my way were sleeping
+ securely, or deserted and empty, or harassed and watching against the
+ terror of the night.
+ 
+    From Ripley until I came through Pyrford I was in the valley of the
+ Wey, and the red glare was hidden from me. As I ascended the little
+ hill beyond Pyrford Church the glare came into view again, and the
+ trees about me shivered with the first intimation of the storm that
+ was upon me.  Then I heard midnight pealing out from Pyrford Church
+ behind me, and then came the silhouette of Maybury Hill, with its
+ tree-tops and roofs black and sharp against the red.
+ 
+    Even as I beheld this a lurid green glare lit the road about me and
+ showed the distant woods towards Addlestone.  I felt a tug at the
+ reins.  I saw that the driving clouds had been pierced as it were by a
+ thread of green fire, suddenly lighting their confusion and falling
+ into the field to my left.  It was the third falling star!
+ 
+    Close on its apparition, and blindingly violet by contrast, danced
+ out the first lightning of the gathering storm, and the thunder burst
+ like a rocket overhead.  The horse took the bit between his teeth and
+ bolted.
+ 
+    A moderate incline runs towards the foot of Maybury Hill, and down
+ this we clattered.  Once the lightning had begun, it went on in as
+ rapid a succession of flashes as I have ever seen.  The thunderclaps,
+ treading one on the heels of another and with a strange crackling
+ accompaniment, sounded more like the working of a gigantic electric
+ machine than the usual detonating reverberations.  The flickering
+ light was blinding and confusing, and a thin hail smote gustily at my
+ face as I drove down the slope.
+ 
+    At first I regarded little but the road before me, and then
+ abruptly my attention was arrested by something that was moving
+ rapidly down the opposite slope of Maybury Hill.  At first I took it
+ for the wet roof of a house, but one flash following another showed it
+ to be in swift rolling movement. It was an elusive vision--a moment of
+ bewildering darkness, and then, in a flash like daylight, the red
+ masses of the Orphanage near the crest of the hill, the green tops of
+ the pine trees, and this problematical object came out clear and sharp
+ and bright.
+ 
+    And this Thing I saw!  How can I describe it?  A monstrous tripod,
+ higher than many houses, striding over the young pine trees, and
+ smashing them aside in its career; a walking engine of glittering
+ metal, striding now across the heather; articulate ropes of steel
+ dangling from it, and the clattering tumult of its passage mingling
+ with the riot of the thunder. A flash, and it came out vividly,
+ heeling over one way with two feet in the air, to vanish and reappear
+ almost instantly as it seemed, with the next flash, a hundred yards
+ nearer. Can you imagine a milking stool tilted and bowled violently
+ along the ground?  That was the impression those instant flashes gave.
+ But instead of a milking stool imagine it a great body of machinery on
+ a tripod stand.
+ 
+    Then suddenly the trees in the pine wood ahead of me were parted,
+ as brittle reeds are parted by a man thrusting through them; they were
+ snapped off and driven headlong, and a second huge tripod appeared,
+ rushing, as it seemed, headlong towards me.  And I was galloping hard
+ to meet it! At the sight of the second monster my nerve went
+ altogether. Not stopping to look again, I wrenched the horse's head
+ hard round to the right and in another moment the dog cart had heeled
+ over upon the horse; the shafts smashed noisily, and I was flung
+ sideways and fell heavily into a shallow pool of water.
+ 
+    I crawled out almost immediately, and crouched, my feet still in
+ the water, under a clump of furze.  The horse lay motionless (his neck
+ was broken, poor brute!) and by the lightning flashes I saw the black
+ bulk of the overturned dog cart and the silhouette of the wheel still
+ spinning slowly.  In another moment the colossal mechanism went
+ striding by me, and passed uphill towards Pyrford.
+ 
+    Seen nearer, the Thing was incredibly strange, for it was no mere
+ insensate machine driving on its way.  Machine it was, with a ringing
+ metallic pace, and long, flexible, glittering tentacles (one of which
+ gripped a young pine tree) swinging and rattling about its strange
+ body.  It picked its road as it went striding along, and the brazen
+ hood that surmounted it moved to and fro with the inevitable
+ suggestion of a head looking about.  Behind the main body was a huge
+ mass of white metal like a gigantic fisherman's basket, and puffs of
+ green smoke squirted out from the joints of the limbs as the monster
+ swept by me.  And in an instant it was gone.
+ 
+    So much I saw then, all vaguely for the flickering of the
+ lightning, in blinding highlights and dense black shadows.
+ 
+    As it passed it set up an exultant deafening howl that drowned the
+ thunder--"Aloo!  Aloo!"--and in another minute it was with its
+ companion, half a mile away, stooping over something in the field.  I
+ have no doubt this Thing in the field was the third of the ten
+ cylinders they had fired at us from Mars.
+ 
+    For some minutes I lay there in the rain and darkness watching, by
+ the intermittent light, these monstrous beings of metal moving about
+ in the distance over the hedge tops. A thin hail was now beginning,
+ and as it came and went their figures grew misty and then flashed into
+ clearness again.  Now and then came a gap in the lightning, and the
+ night swallowed them up.
+ 
+    I was soaked with hail above and puddle water below. It was some
+ time before my blank astonishment would let me struggle up the bank to
+ a drier position, or think at all of my imminent peril.
+ 
+    Not far from me was a little one-roomed squatter's hut of wood,
+ surrounded by a patch of potato garden.  I struggled to my feet at
+ last, and, crouching and making use of every chance of cover, I made a
+ run for this.  I hammered at the door, but I could not make the people
+ hear (if there were any people inside), and after a time I desisted,
+ and, availing myself of a ditch for the greater part of the way,
+ succeeded in crawling, unobserved by these monstrous machines, into
+ the pine woods towards Maybury.
+ 
+    Under cover of this I pushed on, wet and shivering now, towards my
+ own house.  I walked among the trees trying to find the footpath.  It
+ was very dark indeed in the wood, for the lightning was now becoming
+ infrequent, and the hail, which was pouring down in a torrent, fell in
+ columns through the gaps in the heavy foliage.
+ 
+    If I had fully realised the meaning of all the things I had seen I
+ should have immediately worked my way round through Byfleet to Street
+ Cobham, and so gone back to rejoin my wife at Leatherhead.  But that
+ night the strangeness of things about me, and my physical
+ wretchedness, prevented me, for I was bruised, weary, wet to the skin,
+ deafened and blinded by the storm.
+ 
+    I had a vague idea of going on to my own house, and that was as
+ much motive as I had.  I staggered through the trees, fell into a
+ ditch and bruised my knees against a plank, and finally splashed out
+ into the lane that ran down from the College Arms.  I say splashed,
+ for the storm water was sweeping the sand down the hill in a muddy
+ torrent.  There in the darkness a man blundered into me and sent me
+ reeling back.
+ 
+    He gave a cry of terror, sprang sideways, and rushed on before I
+ could gather my wits sufficiently to speak to him. So heavy was the
+ stress of the storm just at this place that I had the hardest task to
+ win my way up the hill.  I went close up to the fence on the left and
+ worked my way along its palings.
+ 
+    Near the top I stumbled upon something soft, and, by a flash of
+ lightning, saw between my feet a heap of black broadcloth and a pair
+ of boots.  Before I could distinguish clearly how the man lay, the
+ flicker of light had passed.  I stood over him waiting for the next
+ flash.  When it came, I saw that he was a sturdy man, cheaply but not
+ shabbily dressed; his head was bent under his body, and he lay
+ crumpled up close to the fence, as though he had been flung violently
+ against it.
+ 
+    Overcoming the repugnance natural to one who had never before
+ touched a dead body, I stooped and turned him over to feel for his
+ heart.  He was quite dead.  Apparently his neck had been broken.  The
+ lightning flashed for a third time, and his face leaped upon me.  I
+ sprang to my feet.  It was the landlord of the Spotted Dog, whose
+ conveyance I had taken.
+ 
+    I stepped over him gingerly and pushed on up the hill.  I made my
+ way by the police station and the College Arms towards my own house.
+ Nothing was burning on the hillside, though from the common there
+ still came a red glare and a rolling tumult of ruddy smoke beating up
+ against the drenching hail.  So far as I could see by the flashes, the
+ houses about me were mostly uninjured.  By the College Arms a dark
+ heap lay in the road.
+ 
+    Down the road towards Maybury Bridge there were voices and the
+ sound of feet, but I had not the courage to shout or to go to them.  I
+ let myself in with my latchkey, closed, locked and bolted the door,
+ staggered to the foot of the staircase, and sat down.  My imagination
+ was full of those striding metallic monsters, and of the dead body
+ smashed against the fence.
+ 
+    I crouched at the foot of the staircase with my back to the wall,
+ shivering violently.
+ 
+ 
+ 
+                      CHAPTER ELEVEN
+ 
+                      AT THE WINDOW
+ 
+    I have already said that my storms of emotion have a trick of
+ exhausting themselves.  After a time I discovered that I was cold and
+ wet, and with little pools of water about me on the stair carpet.  I
+ got up almost mechanically, went into the dining room and drank some
+ whiskey, and then I was moved to change my clothes.
+ 
+    After I had done that I went upstairs to my study, but why I did so
+ I do not know.  The window of my study looks over the trees and the
+ railway towards Horsell Common.  In the hurry of our departure this
+ window had been left open. The passage was dark, and, by contrast with
+ the picture the window frame enclosed, the side of the room seemed
+ impenetrably dark.  I stopped short in the doorway.
+ 
+    The thunderstorm had passed.  The towers of the Oriental College
+ and the pine trees about it had gone, and very far away, lit by a
+ vivid red glare, the common about the sand pits was visible.  Across
+ the light huge black shapes, grotesque and strange, moved busily to
+ and fro.
+ 
+    It seemed indeed as if the whole country in that direction was on
+ fire--a broad hillside set with minute tongues of flame, swaying and
+ writhing with the gusts of the dying storm, and throwing a red
+ reflection upon the cloud scud above.  Every now and then a haze of
+ smoke from some nearer conflagration drove across the window and hid
+ the Martian shapes. I could not see what they were doing, nor the
+ clear form of them, nor recognise the black objects they were busied
+ upon. Neither could I see the nearer fire, though the reflections of
+ it danced on the wall and ceiling of the study.  A sharp, resinous
+ tang of burning was in the air.
+ 
+    I closed the door noiselessly and crept towards the window. As I
+ did so, the view opened out until, on the one hand, it reached to the
+ houses about Woking station, and on the other to the charred and
+ blackened pine woods of Byfleet.  There was a light down below the
+ hill, on the railway, near the arch, and several of the houses along
+ the Maybury road and the streets near the station were glowing ruins.
+ The light upon the railway puzzled me at first; there were a black
+ heap and a vivid glare, and to the right of that a row of yellow
+ oblongs.  Then I perceived this was a wrecked train, the fore part
+ smashed and on fire, the hinder carriages still upon the rails.
+ 
+    Between these three main centres of light--the houses, the train,
+ and the burning county towards Chobham--stretched irregular patches of
+ dark country, broken here and there by intervals of dimly glowing and
+ smoking ground. It was the strangest spectacle, that black expanse set
+ with fire.  It reminded me, more than anything else, of the Potteries
+ at night.  At first I could distinguish no people at all, though I
+ peered intently for them.  Later I saw against the light of Woking
+ station a number of black figures hurrying one after the other across
+ the line.
+ 
+    And this was the little world in which I had been living securely
+ for years, this fiery chaos!  What had happened in the last seven
+ hours I still did not know; nor did I know, though I was beginning to
+ guess, the relation between these mechanical colossi and the sluggish
+ lumps I had seen disgorged from the cylinder.  With a queer feeling of
+ impersonal interest I turned my desk chair to the window, sat down,
+ and stared at the blackened country, and particularly at the three
+ gigantic black things that were going to and fro in the glare about
+ the sand pits.
+ 
+    They seemed amazingly busy.  I began to ask myself what they could
+ be.  Were they intelligent mechanisms?  Such a thing I felt was
+ impossible.  Or did a Martian sit within each, ruling, directing,
+ using, much as a man's brain sits and rules in his body?  I began to
+ compare the things to human machines, to ask myself for the first time
+ in my life how an ironclad or a steam engine would seem to an
+ intelligent lower animal.
+ 
+    The storm had left the sky clear, and ovxer the smoke of the burning
+ land the little fading pinpoint of Mars was dropping into the west,
+ when a soldier came into my garden.  I heard a slight scraping at the
+ fence, and rousing myself from the lethargy that had fallen upon me, I
+ looked down and saw him dimly, clambering over the palings.  At the
+ sight of another human being my torpor passed, and I leaned out of the
+ window eagerly.
+ 
+    "Hist!" said I, in a whisper.
+ 
+    He stopped astride of the fence in doubt.  Then he came over and
+ across the lawn to the corner of the house.  He bent down and stepped
+ softly.
+ 
+    "Who's there?" he said, also whispering, standing under the window
+ and peering up.
+ 
+    "Where are you going?" I asked.
+ 
+    "God knows."
+ 
+    "Are you trying to hide?"
+ 
+    "That's it."
+ 
+    "Come into the house," I said.
+ 
+    I went down, unfastened the door, and let him in, and locked the
+ door again.  I could not see his face.  He was hatless, and his coat
+ was unbuttoned.
+ 
+    "My God!" he said, as I drew him in.
+ 
+    "What has happened?" I asked.
+ 
+    "What hasn't?"  In the obscurity I could see he made a gesture of
+ despair.  "They wiped us out--simply wiped us out," he repeated again
+ and again.
+ 
+    He followed me, almost mechanically, into the dining room.
+ 
+    "Take some whiskey," I said, pouring out a stiff dose.
+ 
+    He drank it.  Then abruptly he sat down before the table, put his
+ head on his arms, and began to sob and weep like a little boy, in a
+ perfect passion of emotion, while I, with a curious forgetfulness of
+ my own recent despair, stood beside him, wondering.
+ 
+    It was a long time before he could steady his nerves to answer my
+ questions, and then he answered perplexingly and brokenly.  He was a
+ driver in the artillery, and had only come into action about seven. At
+ that time firing was going on across the common, and it was said the
+ first party of Martians were crawling slowly towards their second
+ cylinder under cover of a metal shield.
+ 
+    Later this shield staggered up on tripod legs and became the first
+ of the fighting-machines I had seen.  The gun he drove had been
+ unlimbered near Horsell, in order to command the sand pits, and its
+ arrival it was that had precipitated the action.  As the limber
+ gunners went to the rear, his horse trod in a rabbit hole and came
+ down, throwing him into a depression of the ground.  At the same
+ moment the gun exploded behind him, the ammunition blew up, there was
+ fire all about him, and he found himself lying under a heap of charred
+ dead men and dead horses.
+ 
+    "I lay still," he said, "scared out of my wits, with the fore
+ quarter of a horse atop of me.  We'd been wiped out.  And the smell--
+ good God!  Like burnt meat!  I was hurt across the back by the fall of
+ the horse, and there I had to lie until I felt better.  Just like
+ parade it had been a minute before--then stumble, bang, swish!"
+ 
+    "Wiped out!" he said.
+ 
+    He had hid under the dead horse for a long time, peeping out
+ furtively across the common.  The Cardigan men had tried a rush, in
+ skirmishing order, at the pit, simply to be swept out of existence.
+ Then the monster had risen to its feet and had begun to walk leisurely
+ to and fro across the common among the few fugitives, with its
+ headlike hood turning about exactly like the head of a cowled human
+ being. A kind of arm carried a complicated metallic case, about which
+ green flashes scintillated, and out of the funnel of this there smoked
+ the Heat-Ray.
+ 
+    In a few minutes there was, so far as the soldier could see, not a
+ living thing left upon the common, and every bush and tree upon it
+ that was not already a blackened skeleton was burning.  The hussars
+ had been on the road beyond the curvature of the ground, and he saw
+ nothing of them.  He heard the Martians rattle for a time and then
+ become still. The giant saved Woking station and its cluster of houses
+ until the last; then in a moment the Heat-Ray was brought to bear, and
+ the town became a heap of fiery ruins.  Then the Thing shut off the
+ Heat-Ray, and turning its back upon the artilleryman, began to waddle
+ away towards the smouldering pine woods that sheltered the second
+ cylinder.  As it did so a second glittering Titan built itself up out
+ of the pit.
+ 
+    The second monster followed the first, and at that the artilleryman
+ began to crawl very cautiously across the hot heather ash towards
+ Horsell.  He managed to get alive into the ditch by the side of the
+ road, and so escaped to Woking. There his story became ejaculatory.
+ The place was impassable. It seems there were a few people alive
+ there, frantic for the most part and many burned and scalded.  He was
+ turned aside by the fire, and hid among some almost scorching heaps of
+ broken wall as one of the Martian giants returned.  He saw this one
+ pursue a man, catch him up in one of its steely tentacles, and knock
+ his head against the trunk of a pine tree.  At last, after nightfall,
+ the artilleryman made a rush for it and got over the railway
+ embankment.
+ 
+    Since then he had been skulking along towards Maybury, in the hope
+ of getting out of danger Londonward.  People were hiding in trenches
+ and cellars, and many of the survivors had made off towards Woking
+ village and Send.  He had been consumed with thirst until he found one
+ of the water mains near the railway arch smashed, and the water
+ bubbling out like a spring upon the road.
+ 
+    That was the story I got from him, bit by bit.  He grew calmer
+ telling me and trying to make me see the things he had seen.  He had
+ eaten no food since midday, he told me early in his narrative, and I
+ found some mutton and bread in the pantry and brought it into the
+ room.  We lit no lamp for fear of attracting the Martians, and ever
+ and again our hands would touch upon bread or meat.  As he talked,
+ things about us came darkly out of the darkness, and the trampled
+ bushes and broken rose trees outside the window grew distinct.  It
+ would seem that a number of men or animals had rushed across the lawn.
+ I began to see his face, blackened and haggard, as no doubt mine was
+ also.
+ 
+    When we had finished eating we went softly upstairs to my study,
+ and I looked again out of the open window.  In one night the valley
+ had become a valley of ashes.  The fires had dwindled now.  Where
+ flames had been there were now streamers of smoke; but the countless
+ ruins of shattered and gutted houses and blasted and blackened trees
+ that the night had hidden stood out now gaunt and terrible in the
+ pitiless light of dawn.  Yet here and there some object had had the
+ luck to escape--a white railway signal here, the end of a greenhouse
+ there, white and fresh amid the wreckage.  Never before in the history
+ of warfare had destruction been so indiscriminate and so universal.
+ And shining with the growing light of the east, three of the metallic
+ giants stood about the pit, their cowls rotating as though they were
+ surveying the desolation they had made.
+ 
+    It seemed to me that the pit had been enlarged, and ever and again
+ puffs of vivid green vapour streamed up and out of it towards the
+ brightening dawn--streamed up, whirled, broke, and vanished.
+ 
+    Beyond were the pillars of fire about Chobham.  They became pillars
+ of bloodshot smoke at the first touch of day.
+ 
+ 
+ 
+                       CHAPTER TWELVE
+ 
+               WHAT I SAW OF THE DESTRUCTION
+ 
+                OF WEYBRIDGE AND SHEPPERTON
+ 
+    As the dawn grew brighter we withdrew from the window from which we
+ had watched the Martians, and went very quietly downstairs.
+ 
+    The artilleryman agreed with me that the house was no place to stay
+ in.  He proposed, he said, to make his way Londonward, and thence
+ rejoin his battery--No. 12, of the Horse Artillery.  My plan was to
+ return at once to Leatherhead; and so greatly had the strength of the
+ Martians impressed me that I had determined to take my wife to
+ Newhaven, and go with her out of the country forthwith.  For I already
+ perceived clearly that the country about London must inevitably be the
+ scene of a disastrous struggle before such creatures as these could be
+ destroyed.
+ 
+    Between us and Leatherhead, however, lay the third cylinder, with
+ its guarding giants.  Had I been alone, I think I should have taken my
+ chance and struck across country.  But the artilleryman dissuaded me:
+ "It's no kindness to the right sort of wife," he said, "to make her a
+ widow"; and in the end I agreed to go with him, under cover of the
+ woods, northward as far as Street Cobham before I parted with him.
+ Thence I would make a big detour by Epsom to reach Leatherhead.
+ 
+    I should have started at once, but my companion had been in active
+ service and he knew better than that.  He made me ransack the house
+ for a flask, which he filled with whiskey; and we lined every
+ available pocket with packets of biscuits and slices of meat.  Then we
+ crept out of the house, and ran as quickly as we could down the ill-
+ made road by which I had come overnight.  The houses seemed deserted.
+ In the road lay a group of three charred bodies close together, struck
+ dead by the Heat-Ray; and here and there were things that people had
+ dropped--a clock, a slipper, a silver spoon, and the like poor
+ valuables.  At the corner turning up towards the post office a little
+ cart, filled with boxes and furniture, and horseless, heeled over on a
+ broken wheel.  A cash box had been hastily smashed open and thrown
+ under the debris.
+ 
+    Except the lodge at the Orphanage, which was still on fire, none of
+ the houses had suffered very greatly here.  The Heat-Ray had shaved
+ the chimney tops and passed.  Yet, save ourselves, there did not seem
+ to be a living soul on Maybury Hill.  The majority of the inhabitants
+ had escaped, I suppose, by way of the Old Woking road--the road I had
+ taken when I drove to Leatherhead--or they had hidden.
+ 
+    We went down the lane, by the body of the man in black, sodden now
+ from the overnight hail, and broke into the woods at the foot of the
+ hill.  We pushed through these towards the railway without meeting a
+ soul.  The woods across the line were but the scarred and blackened
+ ruins of woods; for the most part the trees had fallen, but a certain
+ proportion still stood, dismal grey stems, with dark brown foliage
+ instead of green.
+ 
+    On our side the fire had done no more than scorch the nearer trees;
+ it had failed to secure its footing.  In one place the woodmen had
+ been at work on Saturday; trees, felled and freshly trimmed, lay in a
+ clearing, with heaps of sawdust by the sawing-machine and its engine.
+ Hard by was a temporary hut, deserted.  There was not a breath of wind
+ this morning, and everything was strangely still.  Even the birds were
+ hushed, and as we hurried along I and the artilleryman talked in
+ whispers and looked now and again over our shoulders.  Once or twice
+ we stopped to listen.
+ 
+    After a time we drew near the road, and as we did so we heard the
+ clatter of hoofs and saw through the tree stems three cavalry soldiers
+ riding slowly towards Woking.  We hailed them, and they halted while
+ we hurried towards them. It was a lieutenant and a couple of privates
+ of the 8th Hussars, with a stand like a theodolite, which the
+ artilleryman told me was a heliograph.
+ 
+    "You are the first men I've seen coming this way this morning,"
+ said the lieutenant.  "What's brewing?"
+ 
+    His voice and face were eager.  The men behind him stared
+ curiously.  The artilleryman jumped down the bank into the road and
+ saluted.
+ 
+    "Gun destroyed last night, sir.  Have been hiding.  Trying to
+ rejoin battery, sir.  You'll come in sight of the Martians, I expect,
+ about half a mile along this road."
+ 
+    "What the dickens are they like?" asked the lieutenant.
+ 
+    "Giants in armour, sir.  Hundred feet high.  Three legs and a body
+ like 'luminium, with a mighty great head in a hood, sir."
+ 
+    "Get out!" said the lieutenant.  "What confounded nonsense!"
+ 
+    "You'll see, sir.  They carry a kind of box, sir, that shoots fire
+ and strikes you dead."
+ 
+    "What d'ye mean--a gun?"
+ 
+    "No, sir," and the artilleryman began a vivid account of the Heat-
+ Ray.  Halfway through, the lieutenant interrupted him and looked up at
+ me.  I was still standing on the bank by the side of the road.
+ 
+    "It's perfectly true," I said.
+ 
+    "Well," said the lieutenant, "I suppose it's my business to see it
+ too.  Look here"--to the artilleryman--"we're detailed here clearing
+ people out of their houses.  You'd better go along and report yourself
+ to Brigadier-General Marvin, and tell him all you know.  He's at
+ Weybridge.  Know the way?"
+ 
+    "I do," I said; and he turned his horse southward again.
+ 
+    "Half a mile, you say?" said he.
+ 
+    "At most," I answered, and pointed over the treetops southward. He
+ thanked me and rode on, and we saw them no more.
+ 
+    Farther along we came upon a group of three women and two children
+ in the road, busy clearing out a labourer's cottage.  They had got
+ hold of a little hand truck, and were piling it up with unclean-
+ looking bundles and shabby furniture. They were all too assiduously
+ engaged to talk to us as we passed.
+ 
+    By Byfleet station we emerged from the pine trees, and found the
+ country calm and peaceful under the morning sunlight.  We were far
+ beyond the range of the Heat-Ray there, and had it not been for the
+ silent desertion of some of the houses, the stirring movement of
+ packing in others, and the knot of soldiers standing on the bridge
+ over the railway and staring down the line towards Woking, the day
+ would have seemed very like any other Sunday.
+ 
+    Several farm waggons and carts were moving creakily along the road
+ to Addlestone, and suddenly through the gate of a field we saw, across
+ a stretch of flat meadow, six twelve-pounders standing neatly at equal
+ distances pointing towards Woking.  The gunners stood by the guns
+ waiting, and the ammunition waggons were at a business-like distance.
+ The men stood almost as if under inspection.
+ 
+    "That's good!" said I.  "They will get one fair shot, at any rate."
+ 
+    The artilleryman hesitated at the gate.
+ 
+    "I shall go on," he said.
+ 
+    Farther on towards Weybridge, just over the bridge, there were a
+ number of men in white fatigue jackets throwing up a long rampart, and
+ more guns behind.
+ 
+    "It's bows and arrows against the lightning, anyhow," said the
+ artilleryman.  "They 'aven't seen that fire-beam yet."
+ 
+    The officers who were not actively engaged stood and stared over
+ the treetops southwestward, and the men digging would stop every now
+ and again to stare in the same direction.
+ 
+    Byfleet was in a tumult; people packing, and a score of hussars,
+ some of them dismounted, some on horseback, were hunting them about.
+ Three or four black government waggons, with crosses in white circles,
+ and an old omnibus, among other vehicles, were being loaded in the
+ village street.  There were scores of people, most of them
+ sufficiently sabbatical to have assumed their best clothes.  The
+ soldiers were having the greatest difficulty in making them realise
+ the gravity of their position.  We saw one shrivelled old fellow with
+ a huge box and a score or more of flower pots containing orchids,
+ angrily expostulating with the corporal who would leave them behind. I
+ stopped and gripped his arm.
+ 
+    "Do you know what's over there?" I said, pointing at the pine tops
+ that hid the Martians.
+ 
+    "Eh?" said he, turning.  "I was explainin' these is vallyble."
+ 
+    "Death!" I shouted.  "Death is coming!  Death!" and leaving him to
+ digest that if he could, I hurried on after the artillery-man.  At the
+ corner I looked back.  The soldier had left him, and he was still
+ standing by his box, with the pots of orchids on the lid of it, and
+ staring vaguely over the trees.
+ 
+     No one in Weybridge could tell us where the headquarters were
+ established; the whole place was in such confusion as I had never seen
+ in any town before.  Carts, carriages everywhere, the most astonishing
+ miscellany of conveyances and horseflesh.  The respectable inhabitants
+ of the place, men in golf and boating costumes, wives prettily
+ dressed, were packing, river-side loafers energetically helping,
+ children excited, and, for the most part, highly delighted at this
+ astonishing variation of their Sunday experiences.  In the midst of it
+ all the worthy vicar was very pluckily holding an early celebration,
+ and his bell was jangling out above the excitement.
+ 
+    I and the artilleryman, seated on the step of the drinking
+ fountain, made a very passable meal upon what we had brought with us.
+ Patrols of soldiers--here no longer hussars, but grenadiers in white--
+ were warning people to move now or to take refuge in their cellars as
+ soon as the firing began. We saw as we crossed the railway bridge that
+ a growing crowd of people had assembled in and about the railway
+ station, and the swarming platform was piled with boxes and packages.
+ The ordinary traffic had been stopped, I believe, in order to allow of
+ the passage of troops and guns to Chertsey, and I have heard since
+ that a savage struggle occurred for places in the special trains that
+ were put on at a later hour.
+ 
+    We remained at Weybridge until midday, and at that hour we found
+ ourselves at the place near Shepperton Lock where the Wey and Thames
+ join.  Part of the time we spent helping two old women to pack a
+ little cart.  The Wey has a treble mouth, and at this point boats are
+ to be hired, and there was a ferry across the river.  On the
+ Shepperton side was an inn with a lawn, and beyond that the tower of
+ Shepperton Church--it has been replaced by a spire--rose above the
+ trees.
+ 
+    Here we found an excited and noisy crowd of fugitives.  As yet the
+ flight had not grown to a panic, but there were already far more
+ people than all the boats going to and fro could enable to cross.
+ People came panting along under heavy burdens; one husband and wife
+ were even carrying a small outhouse door between them, with some of
+ their household goods piled thereon.  One man told us he meant to try
+ to get away from Shepperton station.
+ 
+    There was a lot of shouting, and one man was even jesting. The idea
+ people seemed to have here was that the Martians were simply
+ formidable human beings, who might attack and sack the town, to be
+ certainly destroyed in the end.  Every now and then people would
+ glance nervously across the Wey, at the meadows towards Chertsey, but
+ everything over there was still.
+ 
+    Across the Thames, except just where the boats landed, everything
+ was quiet, in vivid contrast with the Surrey side. The people who
+ landed there from the boats went tramping off down the lane.  The big
+ ferryboat had just made a journey.  Three or four soldiers stood on
+ the lawn of the inn, staring and jesting at the fugitives, without
+ offering to help. The inn was closed, as it was now within prohibited
+ hours.
+ 
+    "What's that?" cried a boatman, and "Shut up, you fool!" said a man
+ near me to a yelping dog.  Then the sound came again, this time from
+ the direction of Chertsey, a muffled thud--the sound of a gun.
+ 
+    The fighting was beginning.  Almost immediately unseen batteries
+ across the river to our right, unseen because of the trees, took up
+ the chorus, firing heavily one after the other. A woman screamed.
+ Everyone stood arrested by the sudden stir of battle, near us and yet
+ invisible to us.  Nothing was to be seen save flat meadows, cows
+ feeding unconcernedly for the most part, and silvery pollard willows
+ motionless in the warm sunlight.
+ 
+    "The sojers'll stop 'em," said a woman beside me, doubtfully.  A
+ haziness rose over the treetops.
+ 
+    Then suddenly we saw a rush of smoke far away up the river, a puff
+ of smoke that jerked up into the air and hung; and forthwith the
+ ground heaved under foot and a heavy explosion shook the air, smashing
+ two or three windows in the houses near, and leaving us astonished.
+ 
+    "Here they are!" shouted a man in a blue jersey.  "Yonder! D'yer
+ see them?  Yonder!"
+ 
+    Quickly, one after the other, one, two, three, four of the armoured
+ Martians appeared, far away over the little trees, across the flat
+ meadows that stretched towards Chertsey, and striding hurriedly
+ towards the river.  Little cowled figures they seemed at first, going
+ with a rolling motion and as fast as flying birds.
+ 
+    Then, advancing obliquely towards us, came a fifth.  Their armoured
+ bodies glittered in the sun as they swept swiftly forward upon the
+ guns, growing rapidly larger as they drew nearer.  One on the extreme
+ left, the remotest that is, flourished a huge case high in the air,
+ and the ghostly, terrible Heat-Ray I had already seen on Friday night
+ smote towards Chertsey, and struck the town.
+ 
+    At sight of these strange, swift, and terrible creatures the crowd
+ near the water's edge seemed to me to be for a moment horror-struck.
+ There was no screaming or shouting, but a silence.  Then a hoarse
+ murmur and a movement of feet--a splashing from the water.  A man, too
+ frightened to drop the portmanteau he carried on his shoulder, swung
+ round and sent me staggering with a blow from the corner of his
+ burden. A woman thrust at me with her hand and rushed past me.  I
+ turned with the rush of the people, but I was not too terrified for
+ thought.  The terrible Heat-Ray was in my mind.  To get under water!
+ That was it!
+ 
+    "Get under water!" I shouted, unheeded.
+ 
+    I faced about again, and rushed towards the approaching Martian,
+ rushed right down the gravelly beach and headlong into the water.
+ Others did the same.  A boatload of people putting back came leaping
+ out as I rushed past.  The stones under my feet were muddy and
+ slippery, and the river was so low that I ran perhaps twenty feet
+ scarcely waist-deep. Then, as the Martian towered overhead scarcely a
+ couple of hundred yards away, I flung myself forward under the
+ surface.  The splashes of the people in the boats leaping into the
+ river sounded like thunderclaps in my ears.  People were landing
+ hastily on both sides of the river. But the Martian machine took no
+ more notice for the moment of the people running this way and that
+ than a man would of the confusion of ants in a nest against which his
+ foot has kicked.  When, half suffocated, I raised my head above water,
+ the Martian's hood pointed at the batteries that were still firing
+ across the river, and as it advanced it swung loose what must have
+ been the generator of the Heat-Ray.
+ 
+    In another moment it was on the bank, and in a stride wading
+ halfway across.  The knees of its foremost legs bent at the farther
+ bank, and in another moment it had raised itself to its full height
+ again, close to the village of Shepperton. Forthwith the six guns
+ which, unknown to anyone on the right bank, had been hidden behind the
+ outskirts of that village, fired simultaneously.  The sudden near
+ concussion, the last close upon the first, made my heart jump.  The
+ monster was already raising the case generating the Heat-Ray as the
+ first shell burst six yards above the hood.
+ 
+    I gave a cry of astonishment.  I saw and thought nothing of the
+ other four Martian monsters; my attention was riveted upon the nearer
+ incident.  Simultaneously two other shells burst in the air near the
+ body as the hood twisted round in time to receive, but not in time to
+ dodge, the fourth shell.
+ 
+    The shell burst clean in the face of the Thing.  The hood bulged,
+ flashed, was whirled off in a dozen tattered fragments of red flesh
+ and glittering metal.
+ 
+    "Hit!" shouted I, with something between a scream and a cheer.
+ 
+    I heard answering shouts from the people in the water about me.  I
+ could have leaped out of the water with that momentary exultation.
+ 
+    The decapitated colossus reeled like a drunken giant; but it did
+ not fall over.  It recovered its balance by a miracle, and, no longer
+ heeding its steps and with the camera that fired the Heat-Ray now
+ rigidly upheld, it reeled swiftly upon Shepperton.  The living
+ intelligence, the Martian within the hood, was slain and splashed to
+ the four winds of heaven, and the Thing was now but a mere intricate
+ device of metal whirling to destruction.  It drove along in a straight
+ line, incapable of guidance.  It struck the tower of Shepperton
+ Church, smashing it down as the impact of a battering ram might have
+ done, swerved aside, blundered on and collapsed with tremendous force
+ into the river out of my sight.
+ 
+    A violent explosion shook the air, and a spout of water, steam,
+ mud, and shattered metal shot far up into the sky. As the camera of
+ the Heat-Ray hit the water, the latter had immediately flashed into
+ steam.  In another moment a huge wave, like a muddy tidal bore but
+ almost scaldingly hot, came sweeping round the bend upstream.  I saw
+ people struggling shorewards, and heard their screaming and shouting
+ faintly above the seething and roar of the Martian's collapse.
+ 
+    For a moment I heeded nothing of the heat, forgot the patent need
+ of self-preservation.  I splashed through the tumultuous water,
+ pushing aside a man in black to do so, until I could see round the
+ bend.  Half a dozen deserted boats pitched aimlessly upon the
+ confusion of the waves.  The fallen Martian came into sight
+ downstream, lying across the river, and for the most part submerged.
+ 
+    Thick clouds of steam were pouring off the wreckage, and through
+ the tumultuously whirling wisps I could see, intermittently and
+ vaguely, the gigantic limbs churning the water and flinging a splash
+ and spray of mud and froth into the air. The tentacles swayed and
+ struck like living arms, and, save for the helpless purposelessness of
+ these movements, it was as if some wounded thing were struggling for
+ its life amid the waves.  Enormous quantities of a ruddy-brown fluid
+ were spurting up in noisy jets out of the machine.
+ 
+    My attention was diverted from this death flurry by a furious
+ yelling, like that of the thing called a siren in our manufacturing
+ towns.  A man, knee-deep near the towing path, shouted inaudibly to me
+ and pointed.  Looking back, I saw the other Martians advancing with
+ gigantic strides down the riverbank from the direction of Chertsey.
+ The Shepperton guns spoke this time unavailingly.
+ 
+    At that I ducked at once under water, and, holding my breath until
+ movement was an agony, blundered painfully ahead under the surface as
+ long as I could.  The water was in a tumult about me, and rapidly
+ growing hotter.
+ 
+    When for a moment I raised my head to take breath and throw the
+ hair and water from my eyes, the steam was rising in a whirling white
+ fog that at first hid the Martians altogether.  The noise was
+ deafening.  Then I saw them dimly, colossal figures of grey, magnified
+ by the mist.  They had passed by me, and two were stooping over the
+ frothing, tumultuous ruins of their comrade.
+ 
+    The third and fourth stood beside him in the water, one perhaps two
+ hundred yards from me, the other towards Laleham.  The generators of
+ the Heat-Rays waved high, and the hissing beams smote down this way
+ and that.
+ 
+    The air was full of sound, a deafening and confusing conflict of
+ noises--the clangorous din of the Martians, the crash of falling
+ houses, the thud of trees, fences, sheds flashing into flame, and the
+ crackling and roaring of fire.  Dense black smoke was leaping up to
+ mingle with the steam from the river, and as the Heat-Ray went to and
+ fro over Weybridge its impact was marked by flashes of incandescent
+ white, that gave place at once to a smoky dance of lurid flames.  The
+ nearer houses still stood intact, awaiting their fate, shadowy, faint
+ and pallid in the steam, with the fire behind them going to and fro.
+ 
+    For a moment perhaps I stood there, breast-high in the almost
+ boiling water, dumbfounded at my position, hopeless of escape. Through
+ the reek I could see the people who had been with me in the river
+ scrambling out of the water through the reeds, like little frogs
+ hurrying through grass from the advance of a man, or running to and
+ fro in utter dismay on the towing path.
+ 
+    Then suddenly the white flashes of the Heat-Ray came leaping
+ towards me.  The houses caved in as they dissolved at its touch, and
+ darted out flames; the txrees changed to fire with a roar.  The Ray
+ flickered up and down the towing path, licking off the people who ran
+ this way and that, and came down to the water's edge not fifty yards
+ from where I stood. It swept across the river to Shepperton, and the
+ water in its track rose in a boiling weal crested with steam.  I
+ turned shoreward.
+ 
+    In another moment the huge wave, well-nigh at the boiling-point had
+ rushed upon me.  I screamed aloud, and scalded, half blinded,
+ agonised, I staggered through the leaping, hissing water towards the
+ shore.  Had my foot stumbled, it would have been the end.  I fell
+ helplessly, in full sight of the Martians, upon the broad, bare
+ gravelly spit that runs down to mark the angle of the Wey and Thames.
+ I expected nothing but death.
+ 
+    I have a dim memory of the foot of a Martian coming down within a
+ score of yards of my head, driving straight into the loose gravel,
+ whirling it this way and that and lifting again; of a long suspense,
+ and then of the four carrying the debris of their comrade between
+ them, now clear and then presently faint through a veil of smoke,
+ receding interminably, as it seemed to me, across a vast space of
+ river and meadow.  And then, very slowly, I realised that by a miracle
+ I had escaped.
+ 
+ 
+ 
+                      CHAPTER THIRTEEN
+ 
+               HOW I FELL IN WITH THE CURATE
+ 
+    After getting this sudden lesson in the power of terrestrial
+ weapons, the Martians retreated to their original position upon
+ Horsell Common; and in their haste, and encumbered with the debris of
+ their smashed companion, they no doubt overlooked many such a stray
+ and negligible victim as myself. Had they left their comrade and
+ pushed on forthwith, there was nothing at that time between them and
+ London but batteries of twelve-pounder guns, and they would certainly
+ have reached the capital in advance of the tidings of their approach;
+ as sudden, dreadful, and destructive their advent would have been as
+ the earthquake that destroyed Lisbon a century ago.
+ 
+    But they were in no hurry.  Cylinder followed cylinder on its
+ interplanetary flight; every twenty-four hours brought them
+ reinforcement.  And meanwhile the military and naval authorities, now
+ fully alive to the tremendous power of their antagonists, worked with
+ furious energy.  Every minute a fresh gun came into position until,
+ before twilight, every copse, every row of suburban villas on the
+ hilly slopes about Kingston and Richmond, masked an expectant black
+ muzzle. And through the charred and desolated area--perhaps twenty
+ square miles altogether--that encircled the Martian encampment on
+ Horsell Common, through charred and ruined villages among the green
+ trees, through the blackened and smoking arcades that had been but a
+ day ago pine spinneys, crawled the devoted scouts with the heliographs
+ that were presently to warn the gunners of the Martian approach.  But
+ the Martians now understood our command of artillery and the danger of
+ human proximity, and not a man ventured within a mile of either
+ cylinder, save at the price of his life.
+ 
+    It would seem that these giants spent the earlier part of the
+ afternoon in going to and fro, transferring everything from the second
+ and third cylinders--the second in Addlestone Golf Links and the third
+ at Pyrford--to their original pit on Horsell Common.  Over that, above
+ the blackened heather and ruined buildings that stretched far and
+ wide, stood one as sentinel, while the rest abandoned their vast
+ fighting-machines and descended into the pit.  They were hard at work
+ there far into the night, and the towering pillar of dense green smoke
+ that rose therefrom could be seen from the hills about Merrow, and
+ even, it is said, from Banstead and Epsom Downs.
+ 
+    And while the Martians behind me were thus preparing for their next
+ sally, and in front of me Humanity gathered for the battle, I made my
+ way with infinite pains and labour from the fire and smoke of burning
+ Weybridge towards London.
+ 
+    I saw an abandoned boat, very small and remote, drifting down-
+ stream; and throwing off the most of my sodden clothes, I went after
+ it, gained it, and so escaped out of that destruction.  There were no
+ oars in the boat, but I contrived to paddle, as well as my parboiled
+ hands would allow, down the river towards Halliford and Walton, going
+ very tediously and continually looking behind me, as you may well
+ understand.  I followed the river, because I considered that the water
+ gave me my best chance of escape should these giants return.
+ 
+    The hot water from the Martian's overthrow drifted downstream with
+ me, so that for the best part of a mile I could see little of either
+ bank.  Once, however, I made out a string of black figures hurrying
+ across the meadows from the direction of Weybridge. Halliford, it
+ seemed, was deserted, and several of the houses facing the river were
+ on fire.  It was strange to see the place quite tranquil, quite
+ desolate under the hot blue sky, with the smoke and little threads of
+ flame going straight up into the heat of the afternoon.  Never before
+ had I seen houses burning without the accompaniment of an obstructive
+ crowd.  A little farther on the dry reeds up the bank were smoking and
+ glowing, and a line of fire inland was marching steadily across a late
+ field of hay.
+ 
+    For a long time I drifted, so painful and weary was I after the
+ violence I had been through, and so intense the heat upon the water.
+ Then my fears got the better of me again, and I resumed my paddling.
+ The sun scorched my bare back.  At last, as the bridge at Walton was
+ coming into sight round the bend, my fever and faintness overcame my
+ fears, and I landed on the Middlesex bank and lay down, deadly sick,
+ amid the long grass.  I suppose the time was then about four or five
+ o'clock.  I got up presently, walked perhaps half a mile without
+ meeting a soul, and then lay down again in the shadow of a hedge.  I
+ seem to remember talking, wanderingly, to myself during that last
+ spurt.  I was also very thirsty, and bitterly regretful I had drunk no
+ more water.  It is a curious thing that I felt angry with my wife; I
+ cannot account for it, but my impotent desire to reach Leatherhead
+ worried me excessively.
+ 
+    I do not clearly remember the arrival of the curate, so that
+ probably I dozed.  I became aware of him as a seated figure in soot-
+ smudged shirt sleeves, and with his upturned, clean-shaven face
+ staring at a faint flickering that danced over the sky.  The sky was
+ what is called a mackerel sky--rows and rows of faint down-plumes of
+ cloud, just tinted with the midsummer sunset.
+ 
+    I sat up, and at the rustle of my motion he looked at me quickly.
+ 
+    "Have you any water?" I asked abruptly.
+ 
+    He shook his head.
+ 
+    "You have been asking for water for the last hour," he said.
+ 
+    For a moment we were silent, taking stock of each other.  I dare
+ say he found me a strange enough figure, naked, save for my water-
+ soaked trousers and socks, scalded, and my face and shoulders
+ blackened by the smoke.  His face was a fair weakness, his chin
+ retreated, and his hair lay in crisp, almost flaxen curls on his low
+ forehead; his eyes were rather large, pale blue, and blankly staring.
+ He spoke abruptly, looking vacantly away from me.
+ 
+    "What does it mean?" he said.  "What do these things mean?"
+ 
+    I stared at him and made no answer.
+ 
+    He extended a thin white hand and spoke in almost a complaining
+ tone.
+ 
+    "Why are these things permitted?  What sins have we done?  The
+ morning service was over, I was walking through the roads to clear my
+ brain for the afternoon, and then--fire, earthquake, death!  As if it
+ were Sodom and Gomorrah!  All our work undone, all the work---- What
+ are these Martians?"
+ 
+    "What are we?" I answered, clearing my throat.
+ 
+    He gripped his knees and turned to look at me again.  For half a
+ minute, perhaps, he stared silently.
+ 
+    "I was walking through the roads to clear my brain," he said.  "And
+ suddenly--fire, earthquake, death!"
+ 
+    He relapsed into silence, with his chin now sunken almost to his
+ knees.
+ 
+    Presently he began waving his hand.
+ 
+    "All the work--all the Sunday schools--What have we done--what has
+ Weybridge done?  Everything gone--everything destroyed.  The church!
+ We rebuilt it only three years ago.  Gone!  Swept out of existence!
+ Why?"
+ 
+    Another pause, and he broke out again like one demented.
+ 
+    "The smoke of her burning goeth up for ever and ever!" he shouted.
+ 
+    His eyes flamed, and he pointed a lean finger in the direction of
+ Weybridge.
+ 
+    By this time I was beginning to take his measure.  The tremendous
+ tragedy in which he had been involved--it was evident he was a
+ fugitive from Weybridge--had driven him to the very verge of his
+ reason.
+ 
+    "Are we far from Sunbury?" I said, in a matter-of-fact tone.
+ 
+    "What are we to do?" he asked.  "Are these creatures everywhere?
+ Has the earth been given over to them?"
+ 
+    "Are we far from Sunbury?"
+ 
+    "Only this morning I officiated at early celebration----"
+ 
+    "Things have changed," I said, quietly.  "You must keep your head.
+ There is still hope."
+ 
+    "Hope!"
+ 
+    "Yes.  Plentiful hope--for all this destruction!"
+ 
+    I began to explain my view of our position.  He listened at first,
+ but as I went on the interest dawning in his eyes gave place to their
+ former stare, and his regard wandered from me.
+ 
+    "This must be the beginning of the end," he said, interrupting me.
+ "The end!  The great and terrible day of the Lord!  When men shall
+ call upon the mountains and the rocks to fall upon them and hide
+ them--hide them from the face of Him that sitteth upon the throne!"
+ 
+    I began to understand the position.  I ceased my laboured
+ reasoning, struggled to my feet, and, standing over him, laid my hand
+ on his shoulder.
+ 
+    "Be a man!" said I.  "You are scared out of your wits!  What good
+ is religion if it collapses under calamity?  Think of what earthquakes
+ and floods, wars and volcanoes, have done before to men!  Did you
+ think God had exempted Weybridge?  He is not an insurance agent."
+ 
+    For a time he sat in blank silence.
+ 
+    "But how can we escape?" he asked, suddenly.  "They are
+ invulnerable, they are pitiless."
+ 
+    "Neither the one nor, perhaps, the other," I answered. "And the
+ mightier they are the more sane and wary should we be.  One of them
+ was killed yonder not three hours ago."
+ 
+    "Killed!" he said, staring about him.  "How can God's ministers be
+ killed?"
+ 
+    "I saw it happen." I proceeded to tell him.  "We have chanced to
+ come in for the thick of it," said I, "and that is all."
+ 
+    "What is that flicker in the sky?" he asked abruptly.
+ 
+    I told him it was the heliograph signalling--that it was the sign
+ of human help and effort in the sky.
+ 
+    "We are in the midst of it," I said, "quiet as it is.  That flicker
+ in the sky tells of the gathering storm.  Yonder, I take it are the
+ Martians, and Londonward, where those hills rise about Richmond and
+ Kingston and the trees give cover, earthworks are being thrown up and
+ guns are being placed.  Presently the Martians will be coming this way
+ again."
+ 
+    And even as I spoke he sprang to his feet and stopped me by a
+ gesture.
+ 
+    "Listen!" he said.
+ 
+    From beyond the low hills across the water came the dull resonance
+ of distant guns and a remote weird crying.  Then everything was still.
+ A cockchafer came droning over the hedge and past us.  High in the
+ west the crescent moon hung faint and pale above the smoke of
+ Weybridge and Shepperton and the hot, still splendour of the sunset.
+ 
+    "We had better follow this path," I said, "northward."
+ 
+ 
+ 
+                       CHAPTER FOURTEEN
+ 
+                          IN LONDON
+ 
+    My younger brother was in London when the Martians fell at Woking.
+ He was a medical student working for an imminent examination, and he
+ heard nothing of the arrival until Saturday morning.  The morning
+ papers on Saturday contained, in addition to lengthy special articles
+ on the planet Mars, on life in the planets, and so forth, a brief and
+ vaguely worded telegram, all the more striking for its brevity.
+ 
+    The Martians, alarmed by the approach of a crowd, had killed a
+ number of people with a quick-firing gun, so the story ran.  The
+ telegram concluded with the words: "Formidable as they seem to be, the
+ Martians have not moved from the pit into which they have fallen, and,
+ indeed, seem incapable of doing so.  Probably this is due to the
+ relative strength of the earth's gravitational energy."  On that last
+ text their leader-writer expanded very comfortingly.
+ 
+    Of course all the students in the crammer's biology class, to which
+ my brother went that day, were intensely interested, but there were no
+ signs of any unusual excitement in the streets.  The afternoon papers
+ puffed scraps of news under big headlines.  They had nothing to tell
+ beyond the movements of troops about the common, and the burning of
+ the pine woods between Woking and Weybridge, until eight.  Then the
+ ST. JAMES'S GAZETTE, in an extra-special edition, announced the bare
+ fact of the interruption of telegraphic communication.  This was
+ thought to be due to the falling of burning pine trees across the
+ line.  Nothing more of the fighting was known that night, the night of
+ my drive to Leatherhead and back.
+ 
+    My brother felt no anxiety about us, as he knew from the
+ description in the papers that the cylinder was a good two miles from
+ my house.  He made up his mind to run down that night to me, in order,
+ as he says, to see the Things before they were killed.  He dispatched
+ a telegram, which never reached me, about four o'clock, and spent the
+ evening at a music hall.
+ 
+    In London, also, on Saturday night there was a thunderstorm, and my
+ brother reached Waterloo in a cab.  On the platform from which the
+ midnight train usually starts he learned, after some waiting, that an
+ accident prevented trains from reaching Woking that night.  The nature
+ of the accident he could not ascertain; indeed, the railway
+ authorities did not clearly know at that time.  There was very little
+ excitement in the station, as the officials, failing to realise that
+ anything further than a breakdown between Byfleet and Woking junction
+ had occurred, were running the theatre trains which usually passed
+ through Woking round by Virginia Water or Guildford.  They were busy
+ making the necessary arrangements to alter the route of the
+ Southampton and Portsmouth Sunday League excursions.  A nocturnal
+ newspaper reporter, mistaking my brother for the traffic manager, to
+ whom he bears a slight resemblance, waylaid and tried to interview
+ him.  Few people, excepting the railway officials, connected the
+ breakdown with the Martians.
+ 
+    I have read, in another account of these events, that on Sunday
+ morning "all London was electrified by the news from Woking."  As a
+ matter of fact, there was nothing to justify that very extravagant
+ phrase.  Plenty of Londoners did not hear of the Martians until the
+ panic of Monday morning.  Those who did took some time to realise all
+ that the hastily worded telegrams in the Sunday papers conveyed. The
+ majority of people in London do not read Sunday papers.
+ 
+    The habit of personal security, moreover, is so deeply fixed in the
+ Londoner's mind, and startling intelligence so much a matter of course
+ in the papers, that they could read without any personal tremors:
+ "About seven o'clock last night the Martians came out of the cylinder,
+ and, moving about under an armour of metallic shields, have completely
+ wrecked Woking station with the adjacent houses, and massacred an
+ entire battalion of the Cardigan Regiment.  No details are known.
+ Maxims have been absolutely useless against their armour; the field
+ guns have been disabled by them.  Flying hussars have been galloping
+ into Chertsey.  The Martians appear to be moving slowly towards
+ Chertsey or Windsor. Great anxiety prevails in West Surrey, and
+ earthworks are being thrown up to check the advance Londonward."  That
+ was how the Sunday SUN put it, and a clever and remarkably prompt
+ "handbook" article in the REFEREE compared the affair to a menagerie
+ suddenly let loose in a village.
+ 
+    No one in London knew positively of the nature of the armoured
+ Martians, and there was still a fixed idea that these monsters must be
+ sluggish: "crawling," "creeping painfully"--such expressions occurred
+ in almost all the earlier reports. None of the telegrams could have
+ been written by an eyewitness of their advance.  The Sunday papers
+ printed separate editions as further news came to hand, some even in
+ default of it.  But there was practically nothing more to tell people
+ until late in the afternoon, when the authorities gave the press
+ agencies the news in their possession.  It was stated that the people
+ of Walton and Weybridge, and all the district were pouring along the
+ roads Londonward, and that was all.
+ 
+    My brother went to church at the Foundling Hospital in the morning,
+ still in ignorance of what had happened on the previous night.  There
+ he heard allusions made to the invasion, and a special prayer for
+ peace.  Coming out, he bought a REFEREE.  He became alarmed at the
+ news in this, and went again to Waterloo station to find out if
+ communication were restored.  The omnibuses, carriages, cyclists, and
+ innumerable people walking in their best clothes seemed scarcely
+ affected by the strange intelligence that the news venders were
+ disseminating.  People were interested, or, if alarmed, alarmed only
+ on account of the local residents.  At the station he heard for the
+ first time that the Windsor and Chertsey lines were now interrupted.
+ The porters told him that several remarkable telegrams had been
+ received in the morning from Byfleet and Chertsey stations, but that
+ these had abruptly ceased.  My brother could get very little precise
+ detail out of them.
+ 
+    "There's fighting going on about Weybridge" was the extent of their
+ information.
+ 
+    The train service was now very much disorganised.  Quite a number
+ of people who had been expecting friends from places on the South-
+ Western network were standing about the station.  One grey-headed old
+ gentleman came and abused the South-Western Company bitterly to my
+ brother.  "It wants showing up," he said.
+ 
+    One or two trains came in from Richmond, Putney, and Kingston,
+ containing people who had gone out for a day's boating and found the
+ locks closed and a feeling of panic in the air.  A man in a blue and
+ white blazer addressed my brother, full of strange tidings.
+ 
+    "There's hosts of people driving into Kingston in traps and carts
+ and things, with boxes of valuables and all that," he said.  "They
+ come from Molesey and Weybridge and Walton, and they say there's been
+ guns heard at Chertsey, heavy firing, and that mounted soldiers have
+ told them to get off at once because the Martians are coming.  We
+ heard guns firing at Hampton Court station, but we thought it was
+ thunder. What the dickens does it all mean?  The Martians can't get
+ out of their pit, can they?"
+ 
+    My brother could not tell him.
+ 
+    Afterwards he found that the vague feeling of alarm had spread to
+ the clients of the underground railway, and that the Sunday
+ excursionists began to return from all over the South-Western "lung"--
+ Barnes, Wimbledon, Richmond Park, Kew, and so forth--at unnaturally
+ early hours; but not a soul had anything more than vague hearsay to
+ tell of.  Everyone connected with the terminus seemed ill-tempered.
+ 
+    About five o'clock the gathering crowd in the station was immensely
+ excited by the opening of the line of communication, which is almost
+ invariably closed, between the South-Eastern and the South-Western
+ stations, and the passage of carriage trucks bearing huge guns and
+ carriages crammed with soldiers.  These were the guns that were
+ brought up from Woolwich and Chatham to cover Kingston.  There was an
+ exchange of pleasantries: "You'll get eaten!"  "We're the beast-
+ tamers!" and so forth.  A little while after that a squad of police
+ came into the station and began to clear the public off the platforms,
+ and my brother went out into the street again.
+ 
+    The church bells were ringing for evensong, and a squad of
+ Salvation Army lassies came singing down Waterloo Road. On the bridge
+ a number of loafers were watching a curious brown scum that came
+ drifting down the stream in patches. The sun was just setting, and the
+ Clock Tower and the Houses of Parliament rose against one of the most
+ peaceful skies it is possible to imagine, a sky of gold, barred with
+ long transverse stripes of reddish-purple cloud.  There was talk of a
+ floating body.  One of the men there, a reservist he said he was, told
+ my brother he had seen the heliograph flickering in the west.
+ 
+    In Wellington Street my brother met a couple of sturdy roughs who
+ had just been rushed out of Fleet Street with still-wet newspapers and
+ staring placards.  "Dreadful catastrophe!" they bawled one to the
+ other down Wellington Street.  "Fighting at Weybridge!  Full
+ description!  Repulse of the Martians! London in Danger!"  He had to
+ give threepence for a copy of that paper.
+ 
+    Then it was, and then only, that he realised something of the full
+ power and terror of these monsters.  He learned that they were not
+ merely a handful of small sluggish creatures, but that they were minds
+ swaying vast mechanical bodies; and that they could move swiftly and
+ smite with such power that even the mightiest guns could not stand
+ against them.
+ 
+    They were described as "vast spiderlike machines, nearly a hundred
+ feet high, capable of the speed of an express train, and able to shoot
+ out a beam of intense heat."  Masked batteries, chiefly of field guns,
+ had been planted in the country about Horsell Common, and especially
+ between the Woking district and London.  Five of the machines had been
+ seen moving towards the Thames, and one, by a happy chance, had been
+ destroyed.  In the other cases the shells had missed, and the
+ batteries had been at once annihilated by the Heat-Rays. Heavy losses
+ of soldiers were mentioned, but the tone of the dispatch was
+ optimistic.
+ 
+    The Martians had been repulsed; they were not invulnerable.  They
+ had retreated to their triangle of cylinders again, in the circle
+ about Woking.  Signallers with heliographs were pushing forward upon
+ them from all sides.  Guns were in rapid transit from Windsor,
+ Portsmouth, Aldershot, Woolwich--even from the north; among others,
+ long wire-guns of ninety-five tons from Woolwich.  Altogether one
+ hundred and sixteen were in position or being hastily placed, chiefly
+ covering London.  Never before in England had there been such a vast
+ or rapid concentration of military material.
+ 
+    Any further cylinders that fell, it was hoped, could be destroyed
+ at once by high explosives, which were being rapidly manufactured and
+ distributed.  No doubt, ran the report, the situation was of the
+ strangest and gravest description, but the public was exhorted to
+ avoid and discourage panic.  No doubt the Martians were strange and
+ terrible in the extreme, but at the outside there could not be more
+ than twenty of them against our millions.
+ 
+    The authorities had reason to suppose, from the size of the
+ cylinders, that at the outside there could not be more than five in
+ each cylinder--fifteen altogether.  And one at least was disposed of--
+ perhaps more.  The public would be fairly warned of the approach of
+ danger, and elaborate measures were being taken for the protection of
+ the people in the threatened southwestern suburbs.  And so, with
+ reiterated assurances of the safety of London and the ability of the
+ authorities to cope with the difficulty, this quasi-proclamation
+ closed.
+ 
+    This was printed in enormous type on paper so fresh that it was
+ still wet, and there had been no time to add a word of comment.  It
+ was curious, my brother said, to see how ruthlessly the usual contents
+ of the paper had been hacked and taken out to give this place.
+ 
+    All down Wellington Street people could be seen fluttering out the
+ pink sheets and reading, and the Strand was suddenly noisy with the
+ voices of an army of hawkers following these pioneers.  Men came
+ scrambling off buses to secure copies. Certainly this news excited
+ people intensely, whatever their previous apathy.  The shutters of a
+ map shop in the Strand were being taken down, my brother said, and a
+ man in his Sunday raiment, lemon-yellow gloves even, was visible
+ inside the window hastily fastening maps of Surrey to the glass.
+ 
+    Going on along the Strand to Trafalgar Square, the paper in his
+ hand, my brother saw some of the fugitives from West Surrey.  There
+ was a man with his wife and two boys and some articles of furniture in
+ a cart such as greengrocers use. He was driving from the direction of
+ Westminster Bridge; and close behind him came a hay waggon with five
+ or six respectable-looking people in it, and some boxes and bundles.
+ The faces of these people were haggard, and their entire appearance
+ contrasted conspicuously with the Sabbath-best appearance of the
+ people on the omnibuses.  People in fashionable clothing peeped at
+ them out of cabs.  They stopped at the Square as if undecided which
+ way to take, and finally turned eastward along the Strand.  Some way
+ behind these came a man in workday clothes, riding one of those old-
+ fashioned tricycles with a small front wheel.  He was dirty and white
+ in the face.
+ 
+    My brother turned down towards Victoria, and met a number of such
+ people.  He had a vague idea that he might see something of me.  He
+ noticed an unusual number of police regulating the traffic.  Some of
+ the refugees were exchanging news with the people on the omnibuses.
+ One was professing to have seen the Martians.  "Boilers on stilts, I
+ tell you, striding along like men."  Most of them were excited and
+ animated by their strange experience.
+ 
+    Beyond Victoria the public-houses were doing a lively trade with
+ these arrivals.  At all the street corners groups of people were
+ reading papers, talking excitedly, or staring at these unusual Sunday
+ visitors.  They seemed to increase as night drew on, until at last the
+ roads, my brother said, were like Epsom High Street on a Derby Day. My
+ brother addressed several of these fugitives and got unsatisfactory
+ answers from most.
+ 
+    None of them could tell him any news of Woking except one man, who
+ assured him that Woking had been entirely destroyed on the previous
+ night.
+ 
+    "I come from Byfleet," he said; "man on a bicycle came through the
+ place in the early morning, and ran from door to door warning us to
+ come away.  Then came soldiers.  We went out to look, and there were
+ clouds of smoke to the south--nothing but smoke, and not a soul coming
+ that way.  Then we heard the guns at Chertsey, and folks coming from
+ Weybridge.  So I've locked up my house and come on."
+ 
+    At the time there was a strong feeling in the streets that the
+ authorities were to blame for their incapacity to dispose of the
+ invaders without all this inconvenience.
+ 
+    About eight o'clock a noise of heavy firing was distinctly audible
+ all over the south of London.  My brother could not hear it for the
+ traffic in the main thoroughfares, but by striking through the quiet
+ back streets to the river he was able to distinguish it quite plainly.
+ 
+    He walked from Westminster to his apartments near Regent's Park,
+ about two.  He was now very anxious on my account, and disturbed at
+ the evident magnitude of the trouble.  His mind was inclined to run,
+ even as mine had run on Saturday, on military details.  He thought of
+ all those silent, expectant guns, of the suddenly nomadic countryside;
+ he tried to imagine "boilers on stilts" a hundred feet high.
+ 
+    There were one or two cartloads of refugees passing along Oxford
+ Street, and several in the Marylebone Road, but so slowly was the news
+ spreading that Regent Street and Portland Place were full of their
+ usual Sunday-night promenaders, albeit they talked in groups, and
+ along the edge of Regent's Park there were as many silent couples
+ "walking out" together under the scattered gas lamps as ever there had
+ been.  The night was warm and still, and a little oppressive; the
+ sound of guns continued intermittently, and after midnight there
+ seemed to be sheet lightning in the south.
+ 
+    He read and re-read the paper, fearing the worst had happened to
+ me.  He was restless, and after supper prowled out again aimlessly. He
+ returned and tried in vain to divert his attention to his examination
+ notes.  He went to bed a little after midnight, and was awakened from
+ lurid dreams in the small hours of Monday by the sound of door
+ knockers, feet running in the street, distant drumming, and a clamour
+ of bells.  Red reflections danced on the ceiling.  For a moment he lay
+ astonished, wondering whether day had come or the world gone mad.
+ Then he jumped out of bed and ran to the window.
+ 
+    His room was an attic and as he thrust his head out, up and down
+ the street there were a dozen echoes to the noise of his window sash,
+ and heads in every kind of night disarray appeared.  Enquiries were
+ being shouted.  "They are coming!" bawled a policeman, hammering at
+ the door; "the Martians are coming!" and hurried to the next door.
+ 
+    The sound of drumming and trumpeting came from the Albany Street
+ Barracks, and every church within earshot was hard at work killing
+ sleep with a vehement disorderly tocsin. There was a noise of doors
+ opening, and window after window in the houses opposite flashed from
+ darkness into yellow illumination.
+ 
+    Up the street came galloping a closed carriage, bursting abruptly
+ into noise at the corner, rising to a clattering climax under the
+ window, and dying away slowly in the distance. Close on the rear of
+ this came a couple of cabs, the forerunners of a long procession of
+ flying vehicles, going for the most part to Chalk Farm station, where
+ the North-Western special trains were loading up, instead of coming
+ down the gradient into Euston.
+ 
+    For a long time my brother stared out of the window in blank
+ astonishment, watching the policemen hammering at door after door, and
+ delivering their incomprehensible message.  Then the door behind him
+ opened, and the man who lodged across the landing came in, dressed
+ only in shirt, trousers, and slippers, his braces loose about his
+ waist, his hair disordered from his pillow.
+ 
+    "What the devil is it?" he asked.  "A fire?  What a devil of a
+ row!"
+ 
+    They both craned their heads out of the window, straining to hear
+ what the policemen were shouting.  People were coming out of the side
+ streets, and standing in groups at the corners talking.
+ 
+    "What the devil is it all about?" said my brother's fellow lodger.
+ 
+    My brother answered him vaguely and began to dress, running with
+ each garment to the window in order to miss nothing of the growing
+ excitement.  And presently men selling unnaturally early newspapers
+ came bawling into the street:
+ 
+    "London in danger of suffocation!  The Kingston and Richmond
+ defences forced!  Fearful massacres in the Thames Valley!"
+ 
+    And all about him--in the rooms below, in the houses on each side
+ and across the road, and behind in the Park Terraces and in the
+ hundred other streets of that part of Marylebone, and the Westbourne
+ Park district and St. Pancras, and westward and northward in Kilburn
+ and St. John's Wood and Hampstead, and eastward in Shoreditch and
+ Highbury and Haggerston and Hoxton, and, indeed, through all the
+ vastness of London from Ealing to East Ham--people were rubbing their
+ eyes, and opening windows to stare out and ask aimless questions,
+ dressing hastily as the first breath of the coming storm of Fear blew
+ through the streets.  It was the dawn of the great panic.  London,
+ which had gone to bed on Sunday night oblivious and inert, was
+ awakened, in the small hours of Monday morning, to a vivid sense of
+ danger.
+ 
+    Unable from his window to learn what was happening, my brother went
+ down and out into the street, just as the sky between the parapets of
+ the houses grew pink with the early dawn.  The flying people on foot
+ and in vehicles grew more numerous every moment.  "Black Smoke!" he
+ heard people crying, and again "Black Smoke!"  The contagion of such a
+ unanimous fear was inevitable.  As my brother hesitated on the door-
+ step, he saw another news vender approaching, and got a paper
+ forthwith.  The man was running away with the rest, and selling his
+ papers for a shilling each as he ran--a grotesque mingling of profit
+ and panic.
+ 
+    And from this paper my brother read that catastrophic dispatch of
+ the Commander-in-Chief:
+ 
+    "The Martians are able to discharge enormous clouds of a black and
+ poisonous vapour by means of rockets.  They have smothered our
+ batteries, destroyed Richmond, Kingston, and Wimbledon, and are
+ advancing slowly towards London, destroying everything on the way. It
+ is impossible to stop them. There is no safety from the Black Smoke
+ but in instant flight."
+ 
+    That was all, but it was enough.  The whole population of the great
+ six-million city was stirring, slipping, running; presently it would
+ be pouring EN MASSE northward.
+ 
+    "Black Smoke!" the voices cried.  "Fire!"
+ 
+    The bells of the neighbouring church made a jangling tumult, a cart
+ carelessly driven smashed, amid shrieks and curses, against the water
+ trough up the street.  Sickly yellow lights went to and fro in the
+ houses, and some of the passing cabs flaunted unextinguished lamps.
+ And overhead the dawn was growing brighter, clear and steady and calm.
+ 
+    He heard footsteps running to and fro in the rooms, and up and down
+ stairs behind him.  His landlady came to the door, loosely wrapped in
+ dressing gown and shawl; her husband followed ejaculating.
+ 
+    As my brother began to realise the import of all these things, he
+ turned hastily to his own room, put all his available money--some ten
+ pounds altogether--into his pockets, and went out again into the
+ streets.
+ 
+ 
+ 
+                       CHAPTER FIFTEEN
+ 
+                 WHAT HAD HAPPENED IN SURREY
+ 
+    It was while the curate had sat and talked so wildly to me under
+ the hedge in the flat meadows near Halliford, and while my brother was
+ watching the fugitives stream over Westminster Bridge, that the
+ Martians had resumed the offensive.  So far as one can ascertain from
+ the conflicting accounts that have been put forth, the majority of
+ them remained busied with preparations in the Horsell pit until nine
+ that night, hurrying on some operation that disengaged huge volumes of
+ green smoke.
+ 
+    But three certainly came out about eight o'clock and, advancing
+ slowly and cautiously, made their way through Byfleet and Pyrford
+ towards Ripley and Weybridge, and so came in sight of the expectant
+ batteries against the setting sun.  These Martians did not advance in
+ a body, but in a line, each perhaps a mile and a half from his nearest
+ fellow.  They communicated with one another by means of sirenlike
+ howls, running up and down the scale from one note to another.
+ 
+    It was this howling and firing of the guns at Ripley and St.
+ George's Hill that we had heard at Upper Halliford.  The Ripley
+ gunners, unseasoned artillery volunteers who ought never to have been
+ placed in such a position, fired one wild, premature, ineffectual
+ volley, and bolted on horse and foot through the deserted village,
+ while the Martian, without using his Heat-Ray, walked serenely over
+ their guns, stepped gingerly among them, passed in front of them, and
+ so came unexpectedly upon the guns in Painshill Park, which he
+ destroyed.
+ 
+    The St. George's Hill men, however, were better led or of a better
+ mettle.  Hidden by a pine wood as they were, they seem to have been
+ quite unsuspected by the Martian nearest to them.  They laid their
+ guns as deliberately as if they had been on parade, and fired at about
+ a thousand yards' range.
+ 
+    The shells flashed all round him, and he was seen to advance a few
+ paces, stagger, and go down.  Everybody yelled together, and the guns
+ were reloaded in frantic haste.  The overthrown Martian set up a
+ prolonged ululation, and immediately a second glittering giant,
+ answering him, appeared over the trees to the south.  It would seem
+ that a leg of the tripod had been smashed by one of the shells.  The
+ whole of the second volley flew wide of the Martian on the ground,
+ and, simultaneously, both his companions brought their Heat-Rays to
+ bear on the battery.  The ammunition blew up, the pine trees all about
+ the guns flashed into fire, and only one or two of the men who were
+ already running over the crest of the hill escaped.
+ 
+    After this it would seem that the three took counsel together and
+ halted, and the scouts who were watching them report that they
+ remained absolutely stationary for the next half hour.  The Martian
+ who had been overthrown crawled tediously out of his hood, a small
+ brown figure, oddly suggestive from that distance of a speck of
+ blight, and apparently engaged in the repair of his support.  About
+ nine he had finished, for his cowl was then seen above the trees
+ again.
+ 
+    It was a few minutes past nine that night when these three
+ sentinels were joined by four other Martians, each carrying a thick
+ black tube.  A similar tube was handed to each of the three, and the
+ seven proceeded to distribute themselves at equal distances along a
+ curved line between St. George's Hill, Weybridge, and the village of
+ Send, southwest of Ripley.
+ 
+    A dozen rockets sprang out of the hills before them so soon as they
+ began to move, and warned the waiting batteries about Ditton and
+ Esher.  At the same time four of their fighting machines, similarly
+ armed with tubes, crossed the river, and two of them, black against
+ the western sky, came into sight of myself and the curate as we
+ hurried wearily and painfully along the road that runs northward out
+ of Halliford. They moved, as it seemed to us, upon a cloud, for a
+ milky mist covered the fields and rose to a third of their height.
+ 
+    At this sight the curate cried faintly in his throat, and began
+ running; but I knew it was no good running from a Martian, and I
+ turned aside and crawled through dewy nettles and brambles into the
+ broad ditch by the side of the road. He looked back, saw what I was
+ doing, and turned to join me.
+ 
+    The two halted, the nearer to us standing and facing Sunbury, the
+ remoter being a grey indistinctness towards the evening star, away
+ towards Staines.
+ 
+    The occasional howling of the Martians had ceased; they took up
+ their positions in the huge crescent about their cylinders in absolute
+ silence.  It was a crescent with twelve miles between its horns. Never
+ since the devising of gunpowder was the beginning of a battle so
+ still.  To us and to an observer about Ripley it would have had
+ precisely the same effect--the Martians seemed in solitary possession
+ of the darkling night, lit only as it was by the slender moon, the
+ stars, the afterglow of the daylight, and the ruddy glare from St.
+ George's Hill and the woods of Painshill.
+ 
+    But facing that crescent everywhere--at Staines, Hounslow, Ditton,
+ Esher, Ockham, behind hills and woods south of the river, and across
+ the flat grass meadows to the north of it, wherever a cluster of trees
+ or village houses gave sufficient cover--the guns were waiting.  The
+ signal rockets burst and rained their sparks through the night and
+ vanished, and the spirit of all those watching batteries rose to a
+ tense expectation.  The Martians had but to advance into the line of
+ fire, and instantly those motionless black forms of men, those guns
+ glittering so darkly in the early night, would explode into a
+ thunderous fury of battle.
+ 
+    No doubt the thought that was uppermost in a thousand of those
+ vigilant minds, even as it was uppermost in mine, was the riddle--how
+ much they understood of us.  Did they grasp that we in our millions
+ ere organized, disiplined, working together?  Or did they interpret
+ our spurts of fire, the sudden stinging of our shells, our steady
+ investment of their encampment, as we should the furious unanimity of
+ onslaught in a disturbed hive of bees?  Did they dream they might
+ exterminate us?  (At that time no one knew what food they needed.)  A
+ hundred such questions struggled together in my mind as I watched that
+ vast sentinel shape.  And in the back of my mind was the sense of all
+ the huge unknown and hidden forces Londonward.  Had they prepared
+ pitfalls? Were the powder mills at Hounslow ready as a snare?  Would
+ the Londoners have the heart and courage to make a greater Moscow of
+ their mighty province of houses?
+ 
+    Then, after an interminable time, as it seemed to us, crouching and
+ peering through the hedge, came a sound like the distant concussion of
+ a gun.  Another nearer, and then another.  And then the Martian beside
+ us raised his tube on high and discharged it, gunwise, with a heavy
+ report that made the ground heave.  The one towards Staines answered
+ him.  There was no flash, no smoke, simply that loaded detonation.
+ 
+    I was so excited by these heavy minute-guns following one another
+ that I so far forgot my personal safety and my scalded hands as to
+ clamber up into the hedge and stare towards Sunbury.  As I did so a
+ second report followed, and a big projectile hurtled overhead towards
+ Hounslow.  I expected at least to see smoke or fire, or some such
+ evidence of its work.  But all I saw was the deep blue sky above, with
+ one solitary star, and the white mist spreading wide and low beneath.
+ And there had been no crash, no answering explosion.  The silence was
+ restored; the minute lengthened to three.
+ 
+    "What has happened?" said the curate, standing up beside me.
+ 
+    "Heaven knows!" said I.
+ 
+    A bat flickered by and vanished.  A distant tumult of shouting
+ began and ceased.  I looked again at the Martian, and saw he was now
+ moving eastward along the riverbank, with a swift, rolling motion,
+ 
+    Every moment I expected the fire of some hidden battery to spring
+ upon him; but the evening calm was unbroken. The figure of the Martian
+ grew smaller as he receded, and presently the mist and the gathering
+ night had swallowed him up.  By a common impulse we clambered higher.
+ Towards Sunbury was a dark appearance, as though a conical hill had
+ suddenly come into being there, hiding our view of the farther
+ country; and then, remoter across the river, over Walton, we saw
+ another such summit.  These hill-like forms grew lower and broader
+ even as we stared.
+ 
+    Moved by a sudden thought, I looked northward, and there I
+ perceived a third of these cloudy black kopjes had risen.
+ 
+    Everything had suddenly become very still.  Far away to the
+ southeast, marking the quiet, we heard the Martians hooting to one
+ another, and then the air quivered again with the distant thud of
+ their guns.  But the earthly artillery made no reply.
+ 
+    Now at the time we could not understand these things, but later I
+ was to learn the meaning of these ominous kopjes that gathered in the
+ twilight.  Each of the Martians, standing in the great crescent I have
+ described, had discharged, by means of the gunlike tube he carried, a
+ huge canister over whatever hill, copse, cluster of houses, or other
+ possible cover for guns, chanced to be in front of him.  Some fired
+ only one of these, some two--as in the case of the one we had seen;
+ the one at Ripley is said to have discharged no fewer than five at
+ that time.  These canisters smashed on striking the ground--they did
+ not explode--and incontinently disengaged an enormous volume of heavy,
+ inky vapour, coiling and pouring upward in a huge and ebony cumulus
+ cloud, a gaseous hill that sank and spread itself slowly over the
+ surrounding country.  And the touch of that vapour, the inhaling of
+ its pungent wisps, was death to all that breathes.
+ 
+    It was heavy, this vapour, heavier than the densest smoke, so that,
+ after the first tumultuous uprush and outflow of its impact, it sank
+ down through the air and poured over the ground in a manner rather
+ liquid than gaseous, abandoning the hills, and streaming into the
+ valleys and ditches and watercourses even as I have heard the
+ carbonic-acid gas that pours from volcanic clefts is wont to do.  And
+ where it came upon water some chemical action occurred, and the
+ surface would be instantly covered with a powdery scum that sank
+ slowly and made way for more.  The scum was absolutely insoluble, and
+ it is a strange thing, seeing the instant effect of the gas, that one
+ could drink without hurt the water from which it had been strained.
+ The vapour did not diffuse as a true gas would do.  It hung together
+ in banks, flowing sluggishly down the slope of the land and driving
+ reluctantly before the wind, and very slowly it combined with the mist
+ and moisture of the air, and sank to the earth in the form of dust.
+ Save that an unknown element giving a group of four lines in the blue
+ of the spectrum is concerned, we are still entirely ignorant of the
+ nature of this substance.
+ 
+    Once the tumultuous upheaval of its dispersion was over, the black
+ smoke clung so closely to the ground, even before its precipitation,
+ that fifty feet up in the air, on the roofs and upper stories of high
+ houses and on great trees, there was a chance of escaping its poison
+ altogether, as was proved even that night at Street Cobham and Ditton.
+ 
+    The man who escaped at the former place tells a wonderful story of
+ the strangeness of its coiling flow, and how he looked down from the
+ church spire and saw the houses of the village rising like ghosts out
+ of its inky nothingness.  For a day and a half he remained there,
+ weary, starving and sun-scorched, the earth under the blue sky and
+ against the prospect of the distant hills a velvet-black expanse, with
+ red roofs, green trees, and, later, black-veiled shrubs and gates,
+ barns, outhouses, and walls, rising here and there into the sunlight.
+ 
+    But that was at Street Cobham, where the black vapour was allowed
+ to remain until it sank of its own accord into the ground.  As a rule
+ the Martians, when it had served its purpose, cleared the air of it
+ again by wading into it and directing a jet of steam upon it.
+ 
+    This they did with the vapour banks near us, as we saw in the
+ starlight from the window of a deserted house at Upper Halliford,
+ whither we had returned.  From there we could see the searchlights on
+ Richmond Hill and Kingston Hill going to and fro, and about eleven the
+ windows rattled, and we heard the sound of the huge siege guns that
+ had been put in position there.  These continued intermittently for
+ the space of a quarter of an hour, sending chance shots at the
+ invisible Martians at Hampton and Ditton, and then the pale beams of
+ the electric light vanished, and were replaced by a bright red glow.
+ 
+    Then the fourth cylinder fell--a brilliant green meteor--as I
+ learned afterwards, in Bushey Park.  Before the guns on the Richmond
+ and Kingston line of hills began, there was a fitful cannonade far
+ away in the southwest, due, I believe, to guns being fired haphazard
+ before the black vapour could overwhelm the gunners.
+ 
+    So, setting about it as methodically as men might smoke out a
+ wasps' nest, the Martians spread this strange stifling vapour over the
+ Londonward country.  The horns of the crescent slowly moved apart,
+ until at last they formed a line from Hanwell to Coombe and Malden.
+ All night through their destructive tubes advanced.  Never once, after
+ the Martian at St. George's Hill was brought down, did they give the
+ artillery the ghost of a chance against them.  Wherever there was a
+ possibility of guns being laid for them unseen, a fresh canister of
+ the black vapour was discharged, and where the guns were openly
+ displayed the Heat-Ray was brought to bear.
+ 
+    By midnight the blazing trees along the slopes of Richmond Park and
+ the glare of Kingston Hill threw their light upon a network of black
+ smoke, blotting out the whole valley of the Thames and extending as
+ far as the eye could reach. And through this two Martians slowly
+ waded, and turned their hissing steam jets this way and that.
+ 
+    They were sparing of the Heat-Ray that night, either because they
+ had but a limited supply of material for its production or because
+ they did not wish to destroy the country but only to crush and overawe
+ the opposition they had aroused.  In the latter aim they certainly
+ succeeded.  Sunday night was the end of the organised opposition to
+ their movements.  After that no body of men would stand against them,
+ so hopeless was the enterprise.  Even the crews of the torpedo-boats
+ and destroyers that had brought their quick-firers up the Thames
+ refused to stop, mutinied, and went down again.  The only offensive
+ operation men ventured upon after that night was the preparation of
+ mines and pitfalls, and even in that their energies were frantic and
+ spasmodic.
+ 
+    One has to imagine, as well as one may, the fate of those batteries
+ towards Esher, waiting so tensely in the twilight. Survivors there
+ were none.  One may picture the orderly expectation, the officers
+ alert and watchful, the gunners ready, the ammunition piled to hand,
+ the limber gunners with their horses and waggons, the groups of
+ civilian spectators standing as near as they were permitted, the
+ evening stillness, the ambulances and hospital tents with the burned
+ and wounded from Weybridge; then the dull resonance of the shots the
+ Martians fired, and the clumsy projectile whirling over the trees and
+ houses and smashing amid the neighbouring fields.
+ 
+    One may picture, too, the sudden shifting of the attention, the
+ swiftly spreading coils and bellyings of that blackness advancing
+ headlong, towering heavenward, turning the twilight to a palpable
+ darkness, a strange and horrible antagonist of vapour striding upon
+ its victims, men and horses near it seen dimly, running, shrieking,
+ falling headlong, shouts of dismay, the guns suddenly abandoned, men
+ choking and writhing on the ground, and the swift broadening-out of
+ the opaque cone of smoke.  And then night and extinction--nothing but
+ a silent mass of impenetrable vapour hiding its dead.
+ 
+    Before dawn the black vapour was pouring through the streets of
+ Richmond, and the disintegrating organism of government was, with a
+ last expiring effort, rousing the population of London to the
+ necessity of flight.
+ 
+ 
+ 
+                       CHAPTER SIXTEEN
+ 
+                   THE EXODUS FROM LONDON
+ 
+    So you understand the roaring wave of fear that swept through the
+ greatest city in the world just as Monday was dawning--the stream of
+ flight rising swiftly to a torrent, lashing in a foaming tumult round
+ the railway stations, banked up into a horrible struggle about the
+ shipping in the Thames, and hurrying by every available channel
+ northward and eastward.  By ten o'clock the police organisation, and
+ by midday even the railway organisations, were losing coherency,
+ losing shape and efficiency, guttering, softening, running at last in
+ that swift liquefaction of the social body.
+ 
+    All the railway lines north of the Thames and the South-Eastern
+ people at Cannon Street had been warned by midnight on Sunday, and
+ trains were being filled.  People were fighting savagely for standing-
+ room in the carriages even at two o'clock.  By three, people were
+ being trampled and crushed even in Bishopsgate Street, a couple of
+ hundred yards or more from Liverpool Street station; revolvers were
+ fired, people stabbed, and the policemen who had been sent to direct
+ the traffic, exhausted and infuriated, were breaking the heads of the
+ people they were called out to protect.
+ 
+    And as the day advanced and the engine drivers and stokers refused
+ to return to London, the pressure of the flight drove the people in an
+ ever-thickening multitude away from the stations and along the
+ northward-running roads.  By midday a Martian had been seen at Barnes,
+ and a cloud of slowly sinking black vapour drove along the Thames and
+ across the flats of Lambeth, cutting off all escape over the bridges
+ in its sluggish advance.  Another bank drove over Ealing, and
+ surrounded a little island of survivors on Castle Hill, alive, but
+ unable to escape.
+ 
+    After a fruitless struggle to get aboard a North-Western train at
+ Chalk Farm--the engines of the trains that had loaded in the goods
+ yard there PLOUGHED through shrieking people, and a dozen stalwart men
+ fought to keep the crowd from crushing the driver against his
+ furnace--my brother emerged upon the Chalk Farm road, dodged across
+ through a hurrying swarm of vehicles, and had the luck to be foremost
+ in the sack of a cycle shop.  The front tire of the machine he got was
+ punctured in dragging it through the window, but he got up and off,
+ notwithstanding, with no further injury than a cut wrist.  The steep
+ foot of Haverstock Hill was impassable owing to several overturned
+ horses, and my brother struck into Belsize Road.
+ 
+    So he got out of the fury of the panic, and, skirting the Edgware
+ Road, reached Edgware about seven, fasting and wearied, but well ahead
+ of the crowd.  Along the road people were standing in the roadway,
+ curious, wondering.  He was passed by a number of cyclists, some
+ horsemen, and two motor cars.  A mile from Edgware the rim of the
+ wheel broke, and the machine became unridable.  He left it by the
+ roadside and trudged through the village.  There were shops half
+ opened in the main street of the place, and people crowded on the
+ pavement and in the doorways and windows, staring astonished at this
+ extraordinary procession of fugitives that was beginning.  He
+ succeeded in getting some food at an inn.
+ 
+    For a time he remained in Edgware not knowing what next to do.  The
+ flying people increased in number.  Many of them, like my brother,
+ seemed inclined to loiter in the place.  There was no fresh news of
+ the invaders from Mars.
+ 
+    At that time the road was crowded, but as yet far from congested.
+ Most of the fugitives at that hour were mounted on cycles, but there
+ were soon motor cars, hansom cabs, and carriages hurrying along, and
+ the dust hung in heavy clouds along the road to St. Albans.
+ 
+    It was perhaps a vague idea of making his way to Chelmsford, where
+ some friends of his lived, that at last induced my brother to strike
+ into a quiet lane running eastward.  Presently he came upon a stile,
+ and, crossing it, followed a footpath northeastward.  He passed near
+ several farmhouses and some little places whose names he did not
+ learn.  He saw few fugitives until, in a grass lane towards High
+ Barnet, he happened upon two ladies who became his fellow travellers.
+ He came upon them just in time to save them.
+ 
+    He heard their screams, and, hurrying round the corner, saw a
+ couple of men struggling to drag them out of the little pony-chaise in
+ which they had been driving, while a third with difficulty held the
+ frightened pony's head.  One of the ladies, a short woman dressed in
+ white, was simply screaming; the other, a dark, slender figure,
+ slashed at the man who gripped her arm with a whip she held in her
+ disengaged hand.
+ 
+    My brother immediately grasped the situation, shouted, and hurried
+ towards the struggle.  One of the men desisted and turned towards him,
+ and my brother, realising from his antagonist's face that a fight was
+ unavoidable, and being an expert boxer, went into him forthwith and
+ sent him down against the wheel of the chaise.
+ 
+    It was no time for pugilistic chivalry and my brother laid him
+ quiet with a kick, and gripped the collar of the man who pulled at the
+ slender lady's arm.  He heard the clatter of hoofs, the whip stung
+ across his face, a third antagonist struck him between the eyes, and
+ the man he held wrenched himself free and made off down the lane in
+ the direction from which he had come.
+ 
+    Partly stunned, he found himself facing the man who had held the
+ horse's head, and became aware of the chaise receding from him down
+ the lane, swaying from side to side, and with the women in it looking
+ back.  The man before him, a burly rough, tried to close, and he
+ stopped him with a blow in the face.  Then, realising that he was
+ deserted, he dodged round and made off down the lane after the chaise,
+ with the sturdy man close behind him, and the fugitive, who had turned
+ now, following remotely.
+ 
+    Suddenly he stumbled and fell; his immediate pursuer went headlong,
+ and he rose to his feet to find himself with a couple of antagonists
+ again.  He would have had little chance against them had not the
+ slender lady very pluckily pulled up and returned to his help.  It
+ seems she had had a revolver all this time, but it had been under the
+ seat when she and her companion were attacked.  She fired at six
+ yards' distance, narrowly missing my brother.  The less courageous of
+ the robbers made off, and his companion followed him, cursing his
+ cowardice.  They both stopped in sight down the lane, where the third
+ man lay insensible.
+ 
+    "Take this!" said the slender lady, and she gave my brother her
+ revolver.
+ 
+    "Go back to the chaise," said my brother, wiping the blood from his
+ split lip.
+ 
+    She turned without a word--they were both panting--and they went
+ back to where the lady in white struggled to hold back the frightened
+ pony.
+ 
+    The robbers had evidently had enough of it.  When my brother looked
+ again they were retreating.
+ 
+    "I'll sit here," said my brother, "if I may"; and he got upon the
+ empty front seat.  The lady looked over her shoulder.
+ 
+    "Give me the reins," she said, and laid the whip along the pony's
+ side.  In another moment a bend in the road hid the three men from my
+ brother's eyes.
+ 
+    So, quite unexpectedly, my brother found himself, panting, with a
+ cut mouth, a bruised jaw, and bloodstained knuckles, driving along an
+ unknown lane with these two women.
+ 
+    He learned they were the wife and the younger sister of a surgeon
+ living at Stanmore, who had come in the small hours from a dangerous
+ case at Pinner, and heard at some railway station on his way of the
+ Martian advance.  He had hurried home, roused the women--their servant
+ had left them two days before--packed some provisions, put his
+ revolver under the seat--luckily for my brother--and told them to
+ drive on to Edgware, with the idea of getting a train there. He
+ stopped behind to tell the neighbours.  He would overtake them, he
+ said, at about half past four in the morning, and now it was nearly
+ nine and they had seen nothing of him. They could not stop in Edgware
+ because of the growing traffic through the place, and so they had come
+ into this side lane.
+ 
+    That was the story they told my brother in fragments when presently
+ they stopped again, nearer to New Barnet.  He promised to stay with
+ them, at least until they could determine what to do, or until the
+ missing man arrived, and professed to be an expert shot with the
+ revolver--a weapon strange to him--in order to give them confidence.
+ 
+    They made a sort of encampment by the wayside, and the pony became
+ happy in the hedge.  He told them of his own escape out of London, and
+ all that he knew of these Martians and their ways.  The sun crept
+ higher in the sky, and after a time their talk died out and gave place
+ to an uneasy state of anticipation.  Several wayfarers came along the
+ lane, and of these my brother gathered such news as he could.  Every
+ broken answer he had deepened his impression of the great disaster
+ that had come on humanity, deepened his persuasion of the immediate
+ necessity for prosecuting this flight.  He urged the matter upon them.
+ 
+    "We have money," said the slender woman, and hesitated.
+ 
+    Her eyes met my brother's, and her hesitation ended.
+ 
+    "So have I," said my brother.
+ 
+    She explained that they had as much as thirty pounds in gold,
+ besides a five-pound note, and suggested that with that they might get
+ upon a train at St. Albans or New Barnet.  My brother thought that was
+ hopeless, seeing the fury of the Londoners to crowd upon the trains,
+ and broached his own idea of striking across Essex towards Harwich and
+ thence escaping from the country altogether.
+ 
+    Mrs. Elphinstone--that was the name of the woman in white--would
+ listen to no reasoning, and kept calling upon "George"; but her
+ sister-in-law was astonishingly quiet and deliberate, and at last
+ agreed to my brother's suggestion.  So, designing to cross the Great
+ North Road, they went on towards Barnet, my brother leading the pony
+ to save it as much as possible. As the sun crept up the sky the day
+ became excessively hot, and under foot a thick, whitish sand grew
+ burning and blinding, so that they travelled only very slowly.  The
+ hedges were grey with dust.  And as they advanced towards Barnet a
+ tumultuous murmuring grew stronger.
+ 
+    They began to meet more people.  For the most part these were
+ staring before them, murmuring indistinct questions, jaded, haggard,
+ unclean.  One man in evening dress passed them on foot, his eyes on
+ the ground.  They heard his voice, and, looking back at him, saw one
+ hand clutched in his hair and the other beating invisible things.  His
+ paroxysm of rage over, he went on his way without once looking back.
+ 
+    As my brother's party went on towards the crossroads to the south
+ of Barnet they saw a woman approaching the road across some fields on
+ their left, carrying a child and with two other children; and then
+ passed a man in dirty black, with a thick stick in one hand and a
+ small portmanteau in the other. Then round the corner of the lane,
+ from between the villas that guarded it at its confluence with the
+ high road, came a little cart drawn by a sweating black pony and
+ driven by a sallow youth in a bowler hat, grey with dust.  There were
+ three girls, East End factory girls, and a couple of little children
+ crowded in the cart.
+ 
+    "This'll tike us rahnd Edgware?" asked the driver, wild-eyed,
+ white-faced; and when my brother told him it would if he turned to the
+ left, he whipped up at once without the formality of thanks.
+ 
+    My brother noticed a pale grey smoke or haze rising among the
+ houses in front of them, and veiling the white facade of a terrace
+ beyond the road that appeared between the backs of the villas.  Mrs.
+ Elphinstone suddenly cried out at a number of tongues of smoky red
+ flame leaping up above the houses in front of them against the hot,
+ blue sky.  The tumultuous noise resolved itself now into the
+ disorderly mingling of many voices, the gride of many wheels, the
+ creaking of waggons, and the staccato of hoofs.  The lane came round
+ sharply not fifty yards from the crossroads.
+ 
+    "Good heavens!" cried Mrs. Elphinstone.  "What is this you are
+ driving us into?"
+ 
+    My brother stopped.
+ 
+    For the main road was a boiling stream of people, a torrent of
+ human beings rushing northward, one pressing on another.  A great bank
+ of dust, white and luminous in the blaze of the sun, made everything
+ within twenty feet of the ground grey and indistinct and was
+ perpetually renewed by the hurrying feet of a dense crowd of horses
+ and of men and women on foot, and by the wheels of vehicles of every
+ description.
+ 
+    "Way!" my brother heard voices crying.  "Make way!"
+ 
+    It was like riding into the smoke of a fire to approach the meeting
+ point of the lane and road; the crowd roared like a fire, and the dust
+ was hot and pungent.  And, indeed, a little way up the road a villa
+ was burning and sending rolling masses of black smoke across the road
+ to add to the confusion.
+ 
+    Two men came past them.  Then a dirty woman, carrying a heavy
+ bundle and weeping.  A lost retriever dog, with hanging tongue,
+ circled dubiously round them, scared and wretched, and fled at my
+ brother's threat.
+ 
+    So much as they could see of the road Londonward between the houses
+ to the right was a tumultuous stream of dirty, hurrying people, pent
+ in between the villas on either side; the black heads, the crowded
+ forms, grew into distinctness as they rushed towards the corner,
+ hurried past, and merged their individuality again in a receding
+ multitude that was swallowed up at last in a cloud of dust.
+ 
+    "Go on!  Go on!" cried the voices.  "Way!  Way!"
+ 
+    One man's hands pressed on the back of another.  My brother stood
+ at the pony's head.  Irresistibly attracted, he advanced slowly, pace
+ by pace, down the lane.
+ 
+    Edgware had been a scene of confusion, Chalk Farm a riotous tumult,
+ but this was a whole population in movement. It is hard to imagine
+ that host.  It had no character of its own. The figures poured out
+ past the corner, and receded with their backs to the group in the
+ lane.  Along the margin came those who were on foot threatened by the
+ wheels, stumbling in the ditches, blundering into one another.
+ 
+    The carts and carriages crowded close upon one another, making
+ little way for those swifter and more impatient vehicles that darted
+ forward every now and then when an opportunity showed itself of doing
+ so, sending the people scattering against the fences and gates of the
+ villas.
+ 
+    "Push on!" was the cry.  "Push on!  They are coming!"
+ 
+    In one cart stood a blind man in the uniform of the Salvation Army,
+ gesticulating with his crooked fingers and bawling, "Eternity!
+ Eternity!"  His voice was hoarse and very loud so that my brother
+ could hear him long after he was lost to sight in the dust.  Some of
+ the people who crowded in the carts whipped stupidly at their horses
+ and quarrelled with other drivers; some sat motionless, staring at
+ nothing with miserable eyes; some gnawed their hands with thirst, or
+ lay prostrate in the bottoms of their conveyances.  The horses' bits
+ were covered with foam, their eyes bloodshot.
+ 
+    There were cabs, carriages, shop cars, waggons, beyond counting; a
+ mail cart, a road-cleaner's cart marked "Vestry of St. Pancras," a
+ huge timber waggon crowded with roughs. A brewer's dray rumbled by
+ with its two near wheels splashed with fresh blood.
+ 
+    "Clear the way!" cried the voices.  "Clear the way!"
+ 
+    "Eter-nity!  Eter-nity!" came echoing down the road.
+ 
+    There were sad, haggard women tramping by, well dressed, with
+ children that cried and stumbled, their dainty clothes smothered in
+ dust, their weary faces smeared with tears.  With many of these came
+ men, sometimes helpful, sometimes lowering and savage.  Fighting side
+ by side with them pushed some weary street outcast in faded black
+ rags, wide-eyed, loud-voiced, and foul-mouthed.  There were sturdy
+ workmen thrusting their way along, wretched, unkempt men, clothed like
+ clerks or shopmen, struggling spasmodically; a wounded soldier my
+ brother noticed, men dressed in the clothes of railway porters, one
+ wretched creature in a nightshirt with a coat thrown over it.
+ 
+    But varied as its composition was, certain things all that host had
+ in common.  There were fear and pain on their faces, and fear behind
+ them.  A tumult up the road, a quarrel for a place in a waggon, sent
+ the whole host of them quickening their pace; even a man so scared and
+ broken that his knees bent under him was galvanised for a moment into
+ renewed activity.  The heat and dust had already been at work upon
+ this multitude.  Their skins were dry, their lips black and cracked.
+ They were all thirsty, weary, and footsore.  And amid the various
+ cries one heard disputes, reproaches, groans of weariness and fatigue;
+ the voices of most of them were hoarse and weak.  Through it all ran a
+ refrain:
+ 
+    "Way!  Way!  The Martians are coming!"
+ 
+    Few stopped and came aside from that flood.  The lane opened
+ slantingly into the main road with a narrow opening, and had a
+ delusive appearance of coming from the direction of London.  Yet a
+ kind of eddy of people drove into its mouth; weaklings elbowed out of
+ the stream, who for the most part rested but a moment before plunging
+ into it again.  A little way down the lane, with two friends bending
+ over him, lay a man with a bare leg, wrapped about with bloody rags.
+ He was a lucky man to have friends.
+ 
+    A little old man, with a grey military moustache and a filthy black
+ frock coat, limped out and sat down beside the trap, removed his
+ boot--his sock was blood-stained--shook out a pebble, and hobbled on
+ again; and then a little girl of eight or nine, all alone, threw
+ herself under the hedge close by my brother, weeping.
+ 
+    "I can't go on!  I can't go on!"
+ 
+    My brother woke from his torpor of astonishment and lifted her up,
+ speaking gently to her, and carried her to Miss Elphinstone.  So soon
+ as my brother touched her she became quite still, as if frightened.
+ 
+    "Ellen!" shrieked a woman in the crowd, with tears in her
+ voice--"Ellen!"  And the child suddenly darted away from my brother,
+ crying "Mother!"
+ 
+    "They are coming," said a man on horseback, riding past along the
+ lane.
+ 
+    "Out of the way, there!" bawled a coachman, towering high; and my
+ brother saw a closed carriage turning into the lane.
+ 
+    The people crushed back on one another to avoid the horse.  My
+ brother pushed the pony and chaise back into the hedge, and the man
+ drove by and stopped at the turn of the way.  It was a carriage, with
+ a pole for a pair of horses, but only one was in the traces.  My
+ brother saw dimly through the dust that two men lifted out something
+ on a white stretcher and put it gently on the grass beneath the privet
+ hedge.
+ 
+    One of the men came running to my brother.
+ 
+    "Where is there any water?" he said.  "He is dying fast, and very
+ thirsty.  It is Lord Garrick."
+ 
+    "Lord Garrick!" said my broter; "the Chief Justice?"
+ 
+    "The water?" he said.
+ 
+    "There may be a tap," said my brother, "in some of the houses.  We
+ have no water.  I dare not leave my people."
+ 
+    The man pushed against the crowd towards the gate of the corner
+ house.
+ 
+    "Go on!" said the people, thrusting at him.  "They are coming!  Go
+ on!"
+ 
+    Then my brother's attention was distracted by a bearded, eagle-
+ faced man lugging a small handbag, which split even as my brother's
+ eyes rested on it and disgorged a mass of sovereigns that seemed to
+ break up into separate coins as it struck the ground.  They rolled
+ hither and thither among the struggling feet of men and horses.  The
+ man stopped and looked stupidly at the heap, and the shaft of a cab
+ struck his shoulder and sent him reeling.  He gave a shriek and dodged
+ back, and a cartwheel shaved him narrowly.
+ 
+    "Way!" cried the men all about him.  "Make way!"
+ 
+    So soon as the cab had passed, he flung himself, with both hands
+ open, upon the heap of coins, and began thrusting handfuls in his
+ pocket.  A horse rose close upon him, and in another moment, half
+ rising, he had been borne down under the horse's hoofs.
+ 
+    "Stop!" screamed my brother, and pushing a woman out of his way,
+ tried to clutch the bit of the horse.
+ 
+    Before he could get to it, he heard a scream under the wheels, and
+ saw through the dust the rim passing over the poor wretch's back.  The
+ driver of the cart slashed his whip at my brother, who ran round
+ behind the cart.  The multitudinous shouting confused his ears.  The
+ man was writhing in the dust among his scattered money, unable to
+ rise, for the wheel had broken his back, and his lower limbs lay limp
+ and dead.  My brother stood up and yelled at the next driver, and a
+ man on a black horse came to his assistance.
+ 
+    "Get him out of the road," said he; and, clutching the man's collar
+ with his free hand, my brother lugged him sideways.  But he still
+ clutched after his money, and regarded my brother fiercely, hammering
+ at his arm with a handful of gold.  "Go on!  Go on!" shouted angry
+ voices behind.
+ 
+    "Way!  Way!"
+ 
+    There was a smash as the pole of a carriage crashed into the cart
+ that the man on horseback stopped.  My brother looked up, and the man
+ with the gold twisted his head round and bit the wrist that held his
+ collar.  There was a concussion, and the black horse came staggering
+ sideways, and the carthorse pushed beside it.  A hoof missed my
+ brother's foot by a hair's breadth.  He released his grip on the
+ fallen man and jumped back.  He saw anger change to terror on the face
+ of the poor wretch on the ground, and in a moment he was hidden and my
+ brother was borne backward and carried past the entrance of the lane,
+ and had to fight hard in the torrent to recover it.
+ 
+    He saw Miss Elphinstone covering her eyes, and a little child, with
+ all a child's want of sympathetic imagination, staring with dilated
+ eyes at a dusty something that lay black and still, ground and crushed
+ under the rolling wheels.  "Let us go back!" he shouted, and began
+ turning the pony round. "We cannot cross this--hell," he said and they
+ went back a hundred yards the way they had come, until the fighting
+ crowd was hidden.  As they passed the bend in the lane my brother saw
+ the face of the dying man in the ditch under the privet, deadly white
+ and drawn, and shining with perspiration.  The two women sat silent,
+ crouching in their seat and shivering.
+ 
+    Then beyond the bend my brother stopped again.  Miss Elphinstone
+ was white and pale, and her sister-in-law sat weeping, too wretched
+ even to call upon "George."  My brother was horrified and perplexed.
+ So soon as they had retreated he realised how urgent and unavoidable
+ it was to attempt this crossing.  He turned to Miss Elphinstone,
+ suddenly resolute.
+ 
+    "We must go that way," he said, and led the pony round again.
+ 
+    For the second time that day this girl proved her quality. To force
+ their way into the torrent of people, my brother plunged into the
+ traffic and held back a cab horse, while she drove the pony across its
+ head.  A waggon locked wheels for a moment and ripped a long splinter
+ from the chaise. In another moment they were caught and swept forward
+ by the stream.  My brother, with the cabman's whip marks red across
+ his face and hands, scrambled into the chaise and took the reins from
+ her.
+ 
+    "Point the revolver at the man behind," he said, giving it to her,
+ "if he presses us too hard.  No!--point it at his horse."
+ 
+    Then he began to look out for a chance of edging to the right
+ across the road.  But once in the stream he seemed to lose volition,
+ to become a part of that dusty rout.  They swept through Chipping
+ Barnet with the torrent; they were nearly a mile beyond the centre of
+ the town before they had fought across to the opposite side of the
+ way.  It was din and confusion indescribable; but in and beyond the
+ town the road forks repeatedly, and this to some extent relieved the
+ stress.
+ 
+    They struck eastward through Hadley, and there on either side of
+ the road, and at another place farther on they came upon a great
+ multitude of people drinking at the stream, some fighting to come at
+ the water.  And farther on, from a lull near East Barnet, they saw two
+ trains running slowly one after the other without signal or order--
+ trains swarming with people, with men even among the coals behind the
+ engines--going northward along the Great Northern Railway. My brother
+ supposes they must have filled outside London, for at that time the
+ furious terror of the people had rendered the central termini
+ impossible.
+ 
+    Near this place they halted for the rest of the afternoon, for the
+ violence of the day had already utterly exhausted all three of them.
+ They began to suffer the beginnings of hunger; the night was cold, and
+ none of them dared to sleep.  And in the evening many people came
+ hurrying along the road nearby their stopping place, fleeing from
+ unknown dangers before them, and going in the direction from which my
+ brother had come.
+ 
+ 
+ 
+                     CHAPTER SEVENTEEN
+ 
+                    THE "THUNDER CHILD"
+ 
+    Had the Martians aimed only at destruction, they might on Monday
+ have annihilated the entire population of London, as it spread itself
+ slowly through the home counties.  Not only along the road through
+ Barnet, but also through Edgware and Waltham Abbey, and along the
+ roads eastward to Southend and Shoeburyness, and south of the Thames
+ to Deal and Broadstairs, poured the same frantic rout.  If one could
+ have hung that June morning in a balloon in the blazing blue above
+ London every northward and eastward road running out of the tangled
+ maze of streets would have seemed stippled black with the streaming
+ fugitives, each dot a human agony of terror and physical distress.  I
+ have set forth at length in the last chapter my brother's account of
+ the road through Chipping Barnet, in order that my readers may realise
+ how that swarming of black dots appeared to one of those concerned.
+ Never before in the history of the world had such a mass of human
+ beings moved and suffered together.  The legendary hosts of Goths and
+ Huns, the hugest armies Asia has ever seen, would have been but a drop
+ in that current. And this was no disciplined march; it was a
+ stampede--a stampede gigantic and terrible--without order and without
+ a goal, six million people unarmed and unprovisioned, driving
+ headlong.  It was the beginning of the rout of civilisation, of the
+ massacre of mankind.
+ 
+    Directly below him the balloonist would have seen the network of
+ streets far and wide, houses, churches, squares, crescents, gardens--
+ already derelict--spread out like a huge map, and in the southward
+ BLOTTED.  Over Ealing, Richmond, Wimbledon, it would have seemed as if
+ some monstrous pen had flung ink upon the chart.  Steadily,
+ incessantly, each black splash grew and spread, shooting out
+ ramifications this way and that, now banking itself against rising
+ ground, now pouring swiftly over a crest into a new-found valley,
+ exactly as a gout of ink would spread itself upon blotting paper.
+ 
+    And beyond, over the blue hills that rise southward of the river,
+ the glittering Martians went to and fro, calmly and methodically
+ spreading their poison cloud over this patch of country and then over
+ that, laying it again with their steam jets when it had served its
+ purpose, and taking possession of the conquered country.  They do not
+ seem to have aimed at extermination so much as at complete
+ demoralisation and the destruction of any opposition.  They exploded
+ any stores of powder they came upon, cut every telegraph, and wrecked
+ the railways here and there.  They were hamstringing mankind.  They
+ seemed in no hurry to extend the field of their operations, and did
+ not come beyond the central part of London all that day.  It is
+ possible that a very considerable number of people in London stuck to
+ their houses through Monday morning.  Certain it is that many died at
+ home suffocated by the Black Smoke.
+ 
+    Until about midday the Pool of London was an astonishing scene.
+ Steamboats and shipping of all sorts lay there, tempted by the
+ enormous sums of money offered by fugitives, and it is said that many
+ who swam out to these vessels were thrust off with boathooks and
+ drowned.  About one o'clock in the afternoon the thinning remnant of a
+ cloud of the black vapour appeared between the arches of Blackfriars
+ Bridge.  At that the Pool became a scene of mad confusion, fighting,
+ and collision, and for some time a multitude of boats and barges
+ jammed in the northern arch of the Tower Bridge, and the sailors and
+ lightermen had to fight savagely against the people who swarmed upon
+ them from the riverfront.  People were actually clambering down the
+ piers of the bridge from above.
+ 
+    When, an hour later, a Martian appeared beyond the Clock Tower and
+ waded down the river, nothing but wreckage floated above Limehouse.
+ 
+    Of the falling of the fifth cylinder I have presently to tell. The
+ sixth star fell at Wimbledon.  My brother, keeping watch beside the
+ women in the chaise in a meadow, saw the green flash of it far beyond
+ the hills.  On Tuesday the little party, still set upon getting across
+ the sea, made its way through the swarming country towards Colchester.
+ The news that the Martians were now in possession of the whole of
+ London was confirmed.  They had been seen at Highgate, and even, it
+ was said, at Neasden.  But they did not come into my brother's view
+ until the morrow.
+ 
+    That day the scattered multitudes began to realise the urgent need
+ of provisions.  As they grew hungry the rights of property ceased to
+ be regarded.  Farmers were out to defend their cattle-sheds,
+ granaries, and ripening root crops with arms in their hands.  A number
+ of people now, like my brother, had their faces eastward, and there
+ were some desperate souls even going back towards London to get food.
+ These were chiefly people from the northern suburbs, whose knowledge
+ of the Black Smoke came by hearsay.  He heard that about half the
+ members of the government had gathered at Birmingham, and that
+ enormous quantities of high explosives were being prepared to be used
+ in automatic mines across the Midland counties.
+ 
+    He was also told that the Midland Railway Company had replaced the
+ desertions of the first day's panic, had resumed traffic, and was
+ running northward trains from St. Albans to relieve the congestion of
+ the home counties.  There was also a placard in Chipping Ongar
+ announcing that large stores of flour were available in the northern
+ towns and that within twenty-four hours bread would be distributed
+ among the starving people in the neighbourhood.  But this intelligence
+ did not deter him from the plan of escape he had formed, and the three
+ pressed eastward all day, and heard no more of the bread distribution
+ than this promise.  Nor, as a matter of fact, did anyone else hear
+ more of it.  That night fell the seventh star, falling upon Primrose
+ Hill.  It fell while Miss Elphinstone was watching, for she took that
+ duty alternately with my brother.  She saw it.
+ 
+    On Wednesday the three fugitives--they had passed the night in a
+ field of unripe wheat--reached Chelmsford, and there a body of the
+ inhabitants, calling itself the Committee of Public Supply, seized the
+ pony as provisions, and would give nothing in exchange for it but the
+ promise of a share in it the next day.  Here there were rumours of
+ Martians at Epping, and news of the destruction of Waltham Abbey
+ Powder Mills in a vain attempt to blow up one of the invaders.
+ 
+    People were watching for Martians here from the church towers.  My
+ brother, very luckily for him as it chanced, preferred to push on at
+ once to the coast rather than wait for food, although all three of
+ them were very hungry.  By midday they passed through Tillingham,
+ which, strangely enough, seemed to be quite silent and deserted, save
+ for a few furtive plunderers hunting for food.  Near Tillingham they
+ suddenly came in sight of the sea, and the most amazing crowd of
+ shipping of all sorts that it is possible to imagine.
+ 
+    For after the sailors could no longer come up the Thames, they came
+ on to the Essex coast, to Harwich and Walton and Clacton, and
+ afterwards to Foulness and Shoebury, to bring off the people.  They
+ lay in a huge sickle-shaped curve that vanished into mist at last
+ towards the Naze.  Close inshore was a multitude of fishing smacks--
+ English, Scotch, French, Dutch, and Swedish; steam launches from the
+ Thames, yachts, electric boats; and beyond were ships of large burden,
+ a multitude of filthy colliers, trim merchantmen, cattle ships,
+ passenger boats, petroleum tanks, ocean tramps, an old white transport
+ even, neat white and grey liners from Southampton and Hamburg; and
+ along the blue coast across the Blackwater my brother could make out
+ dimly a dense swarm of boats chaffering with the people on the beach,
+ a swarm which also extended up the Blackwater almost to Maldon.
+ 
+    About a couple of miles out lay an ironclad, very low in the water,
+ almost, to my brother's perception, like a water-logged ship.  This
+ was the ram THUNDER CHILD.  It was the only warship in sight, but far
+ away to the right over the smooth surface of the sea--for that day
+ there was a dead calm--lay a serpent of black smoke to mark the next
+ ironclads of the Channel Fleet, which hovered in an extended line,
+ steam up and ready for action, across the Thames estuary during the
+ course of the Martian conquest, vigilant and yet powerless to prevent
+ it.
+ 
+    At the sight of the sea, Mrs. Elphinstone, in spite of the
+ assurances of her sister-in-law, gave way to panic.  She had never
+ been out of England before, she would rather die than trust herself
+ friendless in a foreign country, and so forth. She seemed, poor woman,
+ to imagine that the French and the Martians might prove very similar.
+ She had been growing increasingly hysterical, fearful, and depressed
+ during the two days' journeyings.  Her great idea was to return to
+ Stanmore. Things had been always well and safe at Stanmore.  They
+ would find George at Stanmore.
+ 
+    It was with the greatest difficulty they could get her down to the
+ beach, where presently my brother succeeded in attracting the
+ attention of some men on a paddle steamer from the Thames.  They sent
+ a boat and drove a bargain for thirty-six pounds for the three.  The
+ steamer was going, these men said, to Ostend.
+ 
+    It was about two o'clock when my brother, having paid their fares
+ at the gangway, found himself safely aboard the steamboat with his
+ charges.  There was food aboard, albeit at exorbitant prices, and the
+ three of them contrived to eat a meal on one of the seats forward.
+ 
+    There were already a couple of score of passengers aboard, some of
+ whom had expended their last money in securing a passage, but the
+ captain lay off the Blackwater until five in the afternoon, picking up
+ passengers until the seated decks were even dangerously crowded.  He
+ would probably have remained longer had it not been for the sound of
+ guns that began about that hour in the south.  As if in answer, the
+ ironclad seaward fired a small gun and hoisted a string of flags.  A
+ jet of smoke sprang out of her funnels.
+ 
+    Some of the passengers were of opinion that this firing came from
+ Shoeburyness, until it was noticed that it was growing louder.  At the
+ same time, far away in the southeast the masts and upperworks of three
+ ironclads rose one after the other out of the sea, beneath clouds of
+ black smoke.  But my brother's attention speedily reverted to the
+ distant firing in the south.  He fancied he saw a column of smoke
+ rising out of the distant grey haze.
+ 
+    The little steamer was already flapping her way eastward of the big
+ crescent of shipping, and the low Essex coast was growing blue and
+ hazy, when a Martian appeared, small and faint in the remote distance,
+ advancing along the muddy coast from the direction of Foulness.  At
+ that the captain on the bridge swore at the top of his voice with fear
+ and anger at his own delay, and the paddles seemed infected with his
+ terror.  Every soul aboard stood at the bulwarks or on the seats of
+ the steamer and stared at that distant shape, higher than the trees or
+ church towers inland, and advancing with a leisurely parody of a human
+ stride.
+ 
+    It was the first Martian my brother had seen, and he stood, more
+ amazed than terrified, watching this Titan advancing deliberately
+ towards the shipping, wading farther and farther into the water as the
+ coast fell away.  Then, far away beyond the Crouch, came another,
+ striding over some stunted trees, and then yet another, still farther
+ off, wading deeply through a shiny mudflat that seemed to hang halfway
+ up between sea and sky.  They were all stalking seaward, as if to
+ intercept the escape of the multitudinous vessels that were crowded
+ between Foulness and the Naze.  In spite of the throbbing exertions of
+ the engines of the little paddle-boat, and the pouring foam that her
+ wheels flung behind her, she receded with terrifying slowness from
+ this ominous advance.
+ 
+    Glancing northwestward, my brother saw the large crescent of
+ shipping already writhing with the approaching terror; one ship
+ passing behind another, another coming round from broadside to end on,
+ steamships whistling and giving off volumes of steam, sails being let
+ out, launches rushing hither and thither.  He was so fascinated by
+ this and by the creeping danger away to the left that he had no eyes
+ for anything seaward.  And then a swift movement of the steamboat (she
+ had suddenly come round to avoid being run down) flung him headlong
+ rom the seat upon which he was standing. There was a shouing all
+ about him, a trampling of feet, and a cheer that seemed to be answered
+ faintly.  The steamboat lurched and rolled him over upon his hands.
+ 
+    He sprang to his feet and saw to starboard, and not a hundred yards
+ from their heeling, pitching boat, a vast iron bulk like the blade of
+ a plough tearing through the water, tossing it on either side in huge
+ waves of foam that leaped towards the steamer, flinging her paddles
+ helplessly in the air, and then sucking her deck down almost to the
+ waterline.
+ 
+    A douche of spray blinded my brother for a moment. When his eyes
+ were clear again he saw the monster had passed and was rushing
+ landward.  Big iron upperworks rose out of this headlong structure,
+ and from that twin funnels projected and spat a smoking blast shot
+ with fire.  It was the torpedo ram, THUNDER CHILD, steaming headlong,
+ coming to the rescue of the threatened shipping.
+ 
+    Keeping his footing on the heaving deck by clutching the bulwarks,
+ my brother looked past this charging leviathan at the Martians again,
+ and he saw the three of them now close together, and standing so far
+ out to sea that their tripod supports were almost entirely submerged.
+ Thus sunken, and seen in remote perspective, they appeared far less
+ formidable than the huge iron bulk in whose wake the steamer was
+ pitching so helplessly.  It would seem they were regarding this new
+ antagonist with astonishment.  To their intelligence, it may be, the
+ giant was even such another as themselves. The THUNDER CHILD fired no
+ gun, but simply drove full speed towards them.  It was probably her
+ not firing that enabled her to get so near the enemy as she did.  They
+ did not know what to make of her.  One shell, and they would have sent
+ her to the bottom forthwith with the Heat-Ray.
+ 
+    She was steaming at such a pace that in a minute she seemed halfway
+ between the steamboat and the Martians--a diminishing black bulk
+ against the receding horizontal expanse of the Essex coast.
+ 
+    Suddenly the foremost Martian lowered his tube and discharged a
+ canister of the black gas at the ironclad.  It hit her larboard side
+ and glanced off in an inky jet that rolled away to seaward, an
+ unfolding torrent of Black Smoke, from which the ironclad drove clear.
+ To the watchers from the steamer, low in the water and with the sun in
+ their eyes, it seemed as though she were already among the Martians.
+ 
+    They saw the gaunt figures separating and rising out of the water
+ as they retreated shoreward, and one of them raised the camera-like
+ generator of the Heat-Ray.  He held it pointing obliquely downward,
+ and a bank of steam sprang from the water at its touch.  It must have
+ driven through the iron of the ship's side like a white-hot iron rod
+ through paper.
+ 
+    A flicker of flame went up through the rising steam, and then the
+ Martian reeled and staggered.  In another moment he was cut down, and
+ a great body of water and steam shot high in the air.  The guns of the
+ THUNDER CHILD sounded through the reek, going off one after the other,
+ and one shot splashed the water high close by the steamer, ricocheted
+ towards the other flying ships to the north, and smashed a smack to
+ matchwood.
+ 
+    But no one heeded that very much.  At the sight of the Martian's
+ collapse the captain on the bridge yelled inarticulately, and all the
+ crowding passengers on the steamer's stern shouted together.  And then
+ they yelled again.  For, surging out beyond the white tumult, drove
+ something long and black, the flames streaming from its middle parts,
+ its ventilators and funnels spouting fire.
+ 
+     She was alive still; the steering gear, it seems, was intact and
+ her engines working.  She headed straight for a second Martian, and
+ was within a hundred yards of him when the Heat-Ray came to bear. Then
+ with a violent thud, a blinding flash, her decks, her funnels, leaped
+ upward.  The Martian staggered with the violence of her explosion, and
+ in another moment the flaming wreckage, still driving forward with the
+ impetus of its pace, had struck him and crumpled him up like a thing
+ of cardboard.  My brother shouted involuntarily. A boiling tumult of
+ steam hid everything again.
+ 
+    "Two!," yelled the captain.
+ 
+    Everyone was shouting.  The whole steamer from end to end rang with
+ frantic cheering that was taken up first by one and then by all in the
+ crowding multitude of ships and boats that was driving out to sea.
+ 
+    The steam hung upon the water for many minutes, hiding the third
+ Martian and the coast altogether.  And all this time the boat was
+ paddling steadily out to sea and away from the fight; and when at last
+ the confusion cleared, the drifting bank of black vapour intervened,
+ and nothing of the THUNDER CHILD could be made out, nor could the
+ third Martian be seen.  But the ironclads to seaward were now quite
+ close and standing in towards shore past the steamboat.
+ 
+    The little vessel continued to beat its way seaward, and the
+ ironclads receded slowly towards the coast, which was hidden still by
+ a marbled bank of vapour, part steam, part black gas, eddying and
+ combining in the strangest way.  The fleet of refugees was scattering
+ to the northeast; several smacks were sailing between the ironclads
+ and the steamboat. After a time, and before they reached the sinking
+ cloud bank, the warships turned northward, and then abruptly went
+ about and passed into the thickening haze of evening southward.  The
+ coast grew faint, and at last indistinguishable amid the low banks of
+ clouds that were gathering about the sinking sun.
+ 
+    Then suddenly out of the golden haze of the sunset came the
+ vibration of guns, and a form of black shadows moving. Everyone
+ struggled to the rail of the steamer and peered into the blinding
+ furnace of the west, but nothing was to be distinguished clearly.  A
+ mass of smoke rose slanting and barred the face of the sun.  The
+ steamboat throbbed on its way through an interminable suspense.
+ 
+    The sun sank into grey clouds, the sky flushed and darkened, the
+ evening star trembled into sight.  It was deep twilight when the
+ captain cried out and pointed.  My brother strained his eyes.
+ Something rushed up into the sky out of the greyness--rushed
+ slantingly upward and very swiftly into the luminous clearness above
+ the clouds in the western sky; something flat and broad, and very
+ large, that swept round in a vast curve, grew smaller, sank slowly,
+ and vanished again into the grey mystery of the night.  And as it flew
+ it rained down darkness upon the land.
+ 
+ 
+ 
+                           BOOK TWO
+ 
+                 THE EARTH UNDER THE MARTIANS
+ 
+ 
+ 
+                         CHAPTER ONE
+ 
+                         UNDER FOOT
+ 
+    In the first book I have wandered so much from my own adventures to
+ tell of the experiences of my brother that all through the last two
+ chapters I and the curate have been lurking in the empty house at
+ Halliford whither we fled to escape the Black Smoke.  There I will
+ resume.  We stopped there all Sunday night and all the next day--the
+ day of the panic--in a little island of daylight, cut off by the Black
+ Smoke from the rest of the world.  We could do nothing but wait in
+ aching inactivity during those two weary days.
+ 
+    My mind was occupied by anxiety for my wife.  I figured her at
+ Leatherhead, terrified, in danger, mourning me already as a dead man.
+ I paced the rooms and cried aloud when I thought of how I was cut off
+ from her, of all that might happen to her in my absence.  My cousin I
+ knew was brave enough for any emergency, but he was not the sort of
+ man to realise danger quickly, to rise promptly.  What was needed now
+ was not bravery, but circumspection.  My only consolation was to
+ believe that the Martians were moving London-ward and away from her.
+ Such vague anxieties keep the mind sensitive and painful.  I grew very
+ weary and irritable with the curate's perpetual ejaculations; I tired
+ of the sight of his selfish despair.  After some ineffectual
+ remonstrance I kept away from him, staying in a room--evidently a
+ children's schoolroom--containing globes, forms, and copybooks.  When
+ he followed me thither, I went to a box room at the top of the house
+ and, in order to be alone with my aching miseries, locked myself in.
+ 
+    We were hopelessly hemmed in by the Black Smoke all that day and
+ the morning of the next.  There were signs of people in the next house
+ on Sunday evening--a face at a window and moving lights, and later the
+ slamming of a door. But I do not know who these people were, nor what
+ became of them.  We saw nothing of them next day.  The Black Smoke
+ drifted slowly riverward all through Monday morning, creeping nearer
+ and nearer to us, driving at last along the roadway outside the house
+ that hid us.
+ 
+    A Martian came across the fields about midday, laying the stuff
+ with a jet of superheated steam that hissed against the walls, smashed
+ all the windows it touched, and scalded the curate's hand as he fled
+ out of the front room.  When at last we crept across the sodden rooms
+ and looked out again, the country northward was as though a black
+ snowstorm had passed over it.  Looking towards the river, we were
+ astonished to see an unaccountable redness mingling with the black of
+ the scorched meadows.
+ 
+    For a time we did not see how this change affected our position,
+ save that we were relieved of our fear of the Black Smoke.  But later
+ I perceived that we were no longer hemmed in, that now we might get
+ away.  So soon as I realised that the way of escape was open, my dream
+ of action returned.  But the curate was lethargic, unreasonable.
+ 
+    "We are safe here," he repeated; "safe here."
+ 
+    I resolved to leave him--would that I had!  Wiser now for the
+ artilleryman's teaching, I sought out food and drink.  I had found oil
+ and rags for my burns, and I also took a hat and a flannel shirt that
+ I found in one of the bedrooms.  When it was clear to him that I meant
+ to go alone--had reconciled myself to going alone--he suddenly roused
+ himself to come. And all being quiet throughout the afternoon, we
+ started about five o'clock, as I should judge, along the blackened
+ road to Sunbury.
+ 
+    In Sunbury, and at intervals along the road, were dead bodies lying
+ in contorted attitudes, horses as well as men, overturned carts and
+ luggage, all covered thickly with black dust.  That pal of cindery
+ powder made me think of what I had read of the destruction of Pompeii.
+ We got to Hampton Court without misadventure, our minds full of
+ strange and unfamiliar appearances, and at Hampton Court our eyes were
+ relieved to find a patch of green that had escaped the suffocating
+ drift.  We went through Bushey Park, with its deer going to and fro
+ under the chestnuts, and some men and women hurrying in the distance
+ towards Hampton, and so we came to Twickenham.  These were the first
+ people we saw.
+ 
+    Away across the road the woods beyond Ham and Petersham were still
+ afire.  Twickenham was uninjured by either Heat-Ray or Black Smoke,
+ and there were more people about here, though none could give us news.
+ For the most part they were like ourselves, taking advantage of a lull
+ to shift their quarters.  I have an impression that many of the houses
+ here were still occupied by scared inhabitants, too frightened even
+ for flight.  Here too the evidence of a hasty rout was abundant along
+ the road.  I remember most vividly three smashed bicycles in a heap,
+ pounded into the road by the wheels of subsequent carts.  We crossed
+ Richmond Bridge about half past eight.  We hurried across the exposed
+ bridge, of course, but I noticed floating down the stream a number of
+ red masses, some many feet across.  I did not know what these were--
+ there was no time for scrutiny--and I put a more horrible
+ interpretation on them than they deserved.  Here again on the Surrey
+ side were black dust that had once been smoke, and dead bodies--a heap
+ near the approach to the station; but we had no glimpse of the
+ Martians until we were some way towards Barnes.
+ 
+    We saw in the blackened distance a group of three people running
+ down a side street towards the river, but otherwise it seemed
+ deserted.  Up the hill Richmond town was burning briskly; outside the
+ town of Richmond there was no trace of the Black Smoke.
+ 
+    Then suddenly, as we approached Kew, came a number of people
+ running, and the upperworks of a Martian fighting-machine loomed in
+ sight over the housetops, not a hundred yards away from us.  We stood
+ aghast at our danger, and had the Martian looked down we must
+ immediately have perished. We were so terrified that we dared not go
+ on, but turned aside and hid in a shed in a garden.  There the curate
+ crouched, weeping silently, and refusing to stir again.
+ 
+    But my fixed idea of reaching Leatherhead would not let me rest,
+ and in the twilight I ventured out again.  I went through a shrubbery,
+ and along a passage beside a big house standing in its own grounds,
+ and so emerged upon the road towards Kew.  The curate I left in the
+ shed, but he came hurrying after me.
+ 
+    That second start was the most foolhardy thing I ever did. For it
+ was manifest the Martians were about us.  No sooner had the curate
+ overtaken me than we saw either the fighting-machine we had seen
+ before or another, far away across the meadows in the direction of Kew
+ Lodge.  Four or five little black figures hurried before it across the
+ green-grey of the field, and in a moment it was evident this Martian
+ pursued them.  In three strides he was among them, and they ran
+ radiating from his feet in all directions.  He used no Heat-Ray to
+ destroy them, but picked them up one by one.  Apparently he tossed
+ them into the great metallic carrier which projected behind him, much
+ as a workman's basket hangs over his shoulder.
+ 
+    It was the first time I realised that the Martians might have any
+ other purpose than destruction with defeated humanity. We stood for a
+ moment petrified, then turned and fled through a gate behind us into a
+ walled garden, fell into, rather than found, a fortunate ditch, and
+ lay there, scarce daring to whisper to each other until the stars were
+ out.
+ 
+    I suppose it was nearly eleven o'clock before we gathered courage
+ to start again, no longer venturing into the road, but sneaking along
+ hedgerows and through plantations, and watching keenly through the
+ darkness, he on the right and I on the left, for the Martians, who
+ seemed to be all about us. In one place we blundered upon a scorched
+ and blackened area, now cooling and ashen, and a number of scattered
+ dead bodies of men, burned horribly about the heads and trunks but
+ with their legs and boots mostly intact; and of dead horses, fifty
+ feet, perhaps, behind a line of four ripped guns and smashed gun
+ carriages.
+ 
+    Sheen, it seemed, had escaped destruction, but the place was silent
+ and deserted.  Here we happened on no dead, though the night was too
+ dark for us to see into the side roads of the place.  In Sheen my
+ companion suddenly complained of faintness and thirst, and we decided
+ to try one of the houses.
+ 
+    The first house we entered, after a little difficulty with the
+ window, was a small semi-detached villa, and I found nothing eatable
+ left in the place but some mouldy cheese.  There was, however, water
+ to drink; and I took a hatchet, which promised to be useful in our
+ next house-breaking.
+ 
+    We then crossed to a place where the road turns towards Mortlake.
+ Here there stood a white house within a walled garden, and in the
+ pantry of this domicile we found a store of food--two loaves of bread
+ in a pan, an uncooked steak, and the half of a ham.  I give this
+ catalogue so precisely because, as it happened, we were destined to
+ subsist upon this store for the next fortnight.  Bottled beer stood
+ under a shelf, and there were two bags of haricot beans and some limp
+ lettuces. This pantry opened into a kind of wash-up kitchen, and in
+ this was firewood; there was also a cupboard, in which we found nearly
+ a dozen of burgundy, tinned soups and salmon, and two tins of
+ biscuits.
+ 
+    We sat in the adjacent kitchen in the dark--for we dared not strike
+ a light--and ate bread and ham, and drank beer out of the same bottle.
+ The curate, who was still timorous and restless, was now, oddly
+ enough, for pushing on, and I was urging him to keep up his strength
+ by eating when the thing happened that was to imprison us.
+ 
+    "It can't be midnight yet," I said, and then came a blinding glare
+ of vivid green light.  Everything in the kitchen leaped out, clearly
+ visible in green and black, and vanished again. And then followed such
+ a concussion as I have never heard before or since.  So close on the
+ heels of this as to seem instantaneous came a thud behind me, a clash
+ of glass, a crash and rattle of falling masonry all about us, and the
+ plaster of the ceiling came down upon us, smashing into a multitude of
+ fragments upon our heads.  I was knocked headlong across the floor
+ against the oven handle and stunned.  I was insensible for a long
+ time, the curate told me, and when I came to we were in darkness
+ again, and he, with a face wet, as I found afterwards, with blood from
+ a cut forehead, was dabbing water over me.
+ 
+    For some time I could not recollect what had happened. Then things
+ came to me slowly.  A bruise on my temple asserted itself.
+ 
+    "Are you better?" asked the curate in a whisper.
+ 
+    At last I answered him.  I sat up.
+ 
+    "Don't move," he said.  "The floor is covered with smashed crockery
+ from the dresser.  You can't possibly move without making a noise, and
+ I fancy THEY are outside."
+ 
+    We both sat quite silent, so that we could scarcely hear each other
+ breathing.  Everything seemed deadly still, but once something near
+ us, some plaster or broken brickwork, slid down with a rumbling sound.
+ Outside and very near was an intermittent, metallic rattle.
+ 
+    "That!" said the curate, when presently it happened again.
+ 
+    "Yes," I said.  "But what is it?"
+ 
+    "A Martian!" said the curate.
+ 
+    I listened again.
+ 
+    "It was not like the Heat-Ray," I said, and for a time I was
+ inclined to think one of the great fighting-machines had stumbled
+ against the house, as I had seen one stumble against the tower of
+ Shepperton Church.
+ 
+    Our situation was so strange and incomprehensible that for three or
+ four hours, until the dawn came, we scarcely moved. And then the light
+ filtered in, not through the window, which remained black, but through
+ a triangular aperture between a beam and a heap of broken bricks in
+ the wall behind us. The interior of the kitchen we now saw greyly for
+ the first time.
+ 
+     The window had been burst in by a mass of garden mould, which
+ flowed over the table upon which we had been sitting and lay about our
+ feet.  Outside, the soil was banked high against the house.  At the
+ top of the window frame we could see an uprooted drainpipe.  The floor
+ was littered with smashed hardware; the end of the kitchen towards the
+ house was broken into, and since the daylight shone in there, it was
+ evident the greater part of the house had collapsed.  Contrasting
+ vividly with this ruin was the neat dresser, stained in the fashion,
+ pale green, and with a number of copper and tin vessels below it, the
+ wallpaper imitating blue and white tiles, and a couple of coloured
+ supplements fluttering from the walls above the kitchen range.
+ 
+    As the dawn grew clearer, we saw through the gap in the wall the
+ body of a Martian, standing sentinel, I suppose, over the still
+ glowing cylinder.  At the sight of that we crawled as circumspectly as
+ possible out of the twilight of the kitchen into the darkness of the
+ scullery.
+ 
+    Abruptly the right interpretation dawned upon my mind.
+ 
+    "The fifth cylinder," I whispered, "the fifth shot from Mars, has
+ struck this house and buried us under the ruins!"
+ 
+    For a time the curate was silent, and then he whispered:
+ 
+    "God have mercy upon us!"
+ 
+    I heard him presently whimpering to himself.
+ 
+    Save for that sound we lay quite still in the scullery; I for my
+ part scarce dared breathe, and sat with my eyes fixed on the faint
+ light of the kitchen door.  I could just see the curate's face, a dim,
+ oval shape, and his collar and cuffs. Outside there began a metallic
+ hammering, then a violent hooting, and then again, after a quiet
+ interval, a hissing like the hissing of an engine.  These noises, for
+ the most part problematical, continued intermittently, and seemed if
+ anything to increase in number as time wore on.  Presently a measured
+ thudding and a vibration that made everything about us quiver and the
+ vessels in the pantry ring and shift, began and continued. Once the
+ light was eclipsed, and the ghostly kitchen doorway became absolutely
+ dark.  For many hours we must have crouched there, silent and
+ shivering, until our tired attention failed. . . .
+ 
+    At last I found myself awake and very hungry.  I am inclined to
+ believe we must have spent the greater portion of a day before that
+ awakening.  My hunger was at a stride so insistent that it moved me to
+ action.  I told the curate I was going to seek food, and felt my way
+ towards the pantry. He made me no answer, but so soon as I began
+ eating the faint noise I made stirred him up and I heard him crawling
+ after me.
+ 
+ 
+ 
+                         CHAPTER TWO
+ 
+              WHAT WE SAW FROM THE RUINED HOUSE
+ 
+    After eating we crept back to the scullery, and there I must have
+ dozed again, for when presently I looked round I was alone.  The
+ thudding vibration continued with wearisome persistence.  I whispered
+ for the curate several times, and at last felt my way to the door of
+ the kitchen.  It was still daylight, and I perceived him across the
+ room, lying against the triangular hole that looked out upon the
+ Martians.  His shoulders were hunched, so that his head was hidden
+ from me.
+ 
+    I could hear a number of noises almost like those in an engine
+ shed; and the place rocked with that beating thud. Through the
+ aperture in the wall I could see the top of a tree touched with gold
+ and the warm blue of a tranquil evening sky.  For a minute or so I
+ remained watching the curate, and then I advanced, crouching and
+ stepping with extreme care amid the broken crockery that littered the
+ floor.
+ 
+    I touched the curate's leg, and he started so violently that a mass
+ of plaster went sliding down outside and fell with a loud impact.  I
+ gripped his arm, fearing he might cry out, and for a long time we
+ crouched motionless.  Then I turned to see how much of our rampart
+ remained.  The detachment of the plaster had left a vertical slit open
+ in the debris, and by raising myself cautiously across a beam I was
+ able to see out of this gap into what had been overnight a quiet
+ suburban roadway.  Vast, indeed, was the change that we beheld.
+ 
+    The fifth cylinder must have fallen right into the midst of the
+ house we had first visited.  The building had vanished, completely
+ smashed, pulverised, and dispersed by the blow. The cylinder lay now
+ far beneath the original foundations--deep in a hole, already vastly
+ larger than the pit I had looked into at Woking.  The earth all round
+ it had splashed under that tremendous impact--"splashed" is the only
+ word--and lay in heaped piles that hid the masses of the adjacent
+ houses.  It had behaved exactly like mud under the violent blow of a
+ hammer.  Our house had collapsed backward; the front portion, even on
+ the ground floor, had been destroyed completely; by a chance the
+ kitchen and scullery had escaped, and stood buried now under soil and
+ ruins, closed in by tons of earth on every side save towards the
+ cylinder.  Over that aspect we hung now on the very edge of the great
+ circular pit the Martians were engaged in making.  The heavy beating
+ sound was evidently just behind us, and ever and again a bright green
+ vapour drove up like a veil across our peephole.
+ 
+    The cylinder was already opened in the centre of the pit, and on
+ the farther edge of the pit, amid the smashed and gravel-heaped
+ shrubbery, one of the great fighting-machines, deserted by its
+ occupant, stood stiff and tall against the evening sky.  At first I
+ scarcely noticed the pit and the cylinder, although it has been
+ convenient to describe them first, on account of the extraordinary
+ glittering mechanism I saw busy in the excavation, and on account of
+ the strange creatures that were crawling slowly and painfully across
+ the heaped mould near it.
+ 
+    The mechanism it certainly was that held my attention first. It was
+ one of those complicated fabrics that have since been called handling-
+ machines, and the study of which has already given such an enormous
+ impetus to terrestrial invention.  As it dawned upon me first, it
+ presented a sort of metallic spider with five jointed, agile legs, and
+ with an extraordinary number of jointed levers, bars, and reaching and
+ clutching tentacles about its body.  Most of its arms were retracted,
+ but with three long tentacles it was fishing out a number of rods,
+ plates, and bars which lined the covering and apparently strengthened
+ the walls of the cylinder.  These, as it extracted them, were lifted
+ out and deposited upon a level surface of earth behind it.
+ 
+    Its motion was so swift, complex, and perfect that at first I did
+ not see it as a machine, in spite of its metallic glitter. The
+ fighting-machines were coordinated and animated to an extraordinary
+ pitch, but nothing to compare with this. People who have never seen
+ these structures, and have only the ill-imagined efforts of artists or
+ the imperfect descriptions of such eye-witnesses as myself to go upon,
+ scarcely realise that living quality.
+ 
+    I recall particularly the illustration of one of the first
+ pamphlets to give a consecutive account of the war.  The artist had
+ evidently made a hasty study of one of the fighting-machines, and
+ there his knowledge ended.  He presented them as tilted, stiff
+ tripods, without either flexibility or subtlety, and with an
+ altogether misleading monotony of effect.  The pamphlet containing
+ these renderings had a considerable vogue, and I mention them here
+ simply to warn the reader against the impression they may have
+ created. They were no more like the Martians I saw in action than a
+ Dutch doll is like a human being.  To my mind, the pamphlet would have
+ been much better without them.
+ 
+    At first, I say, the handling-machine did not impress me as a
+ machine, but as a crablike creature with a glittering integument, the
+ controlling Martian whose delicate tentacles actuated its movements
+ seeming to be simply the equivalent of the crab's cerebral portion.
+ But then I perceived the resemblance of its grey-brown, shiny,
+ leathery integument to that of the other sprawling bodies beyond, and
+ the true nature of this dexterous workman dawned upon me.  With that
+ realisation my interest shifted to those other creatures, the real
+ Martians.  Already I had had a transient impression of these, and the
+ first nausea no longer obscured my observation.  Moreover, I was
+ concealed and motionless, and under no urgency of action.
+ 
+    They were, I now saw, the most unearthly creatures it is possible
+ to conceive.  They were huge round bodies--or, rather, heads--about
+ four feet in diameter, each body having in front of it a face.  This
+ face had no nostrils--indeed, the Martians do not seem to have had any
+ sense of smell, but it had a pair of very large dark-coloured eyes,
+ and just beneath this a kind of fleshy beak.  In the back of this head
+ or body--I scarcely know how to speak of it--was the single tight
+ tympanic surface, since known to be anatomically an ear, though it
+ must have been almost useless in our dense air. In a group round the
+ mouth were sixteen slender, almost whiplike tentacles, arranged in two
+ bunches of eight each. These bunches have since been named rather
+ aptly, by that distinguished anatomist, Professor Howes, the HANDS.
+ Even as I saw these Martians for the first time they seemed to be
+ endeavouring to raise themselves on these hands, but of course, with
+ the increased weight of terrestrial conditions, this was impossible.
+ There is reason to suppose that on Mars they may have progressed upon
+ them with some facility.
+ 
+    The internal anatomy, I may remark here, as dissection has since
+ shown, was almost equally simple.  The greater part of the structure
+ was the brain, sending enormous nerves to the eyes, ear, and tactile
+ tentacles.  Besides this were the bulky lungs, into which the mouth
+ opened, and the heart and its vessels.  The pulmonary distress caused
+ by the denser atmosphere and greater gravitational attraction was only
+ too evident in the convulsive movements of the outer skin.
+ 
+    And this was the sum of the Martian organs.  Strange as it may seem
+ to a human being, all the complex apparatus of digestion, which makes
+ up the bulk of our bodies, did not exist in the Martians.  They were
+ heads--merely heads. Entrails they had none.  They did not eat, much
+ less digest. Instead, they took the fresh, living blood of other
+ creatures, and INJECTED it into their own veins.  I have myself seen
+ this being done, as I shall mention in its place.  But, squeamish as I
+ may seem, I cannot bring myself to describe what I could not endure
+ even to continue watching.  Let it suffice to say, blood obtained from
+ a still living animal, in most cases from a human being, was run
+ directly by means of a little pipette into the recipient canal. . . .
+ 
+    The bare idea of this is no doubt horribly repulsive to us, but at
+ the same time I think that we should remember how repulsive our
+ carnivorous habits would seem to an intelligent rabbit.
+ 
+    The physiological advantages of the practice of injection are
+ undeniable, if one thinks of the tremendous waste of human time and
+ energy occasioned by eating and the digestive process.  Our bodies are
+ half made up of glands and tubes and organs, occupied in turning
+ heterogeneous food into blood.  The digestive processes and their
+ reaction upon the nervous system sap our strength and colour our
+ minds.  Men go happy or miserable as they have healthy or unhealthy
+ livers, or sound gastric glands.  But the Martians were lifted above
+ all these organic fluctuations of mood and emotion.
+ 
+    Their undeniable preference for men as their source of nourishment
+ is partly explained by the nature of the remains of the victims they
+ had brought with them as provisions from Mars.  These creatures, to
+ judge from the shrivelled remains that have fallen into human hands,
+ were bipeds with flimsy, silicious skeletons (almost like those of the
+ silicious sponges) and feeble musculature, standing about six feet
+ high and having round, erect heads, and large eyes in flinty sockets.
+ Two or three of these seem to have been brought in each cylinder, and
+ all were killed before earth was reached.  It was just as well for
+ them, for the mere attempt to stand upright upon our planet would have
+ broken every bone in their bodies.
+ 
+    And while I am engaged in this description, I may add in this place
+ certain further details which, although they were not all evident to
+ us at the time, will enable the reader who is unacquainted with them
+ to form a clearer picture of these offensive creatures.
+ 
+    In three other points their physiology differed strangely from
+ ours.  Their organisms did not sleep, any more than the heart of man
+ sleeps.  Since they had no extensive muscular mechanism to recuperate,
+ that periodical extinction was unknown to them.  They had little or no
+ sense of fatigue, it would seem.  On earth they could never have moved
+ without efort, yet even to the last they kept in action.  In twenty-
+ four hours they did twenty-four hours of work, as even on earth is
+ perhaps the case with the ants.
+ 
+    In the next place, wonderful as it seems in a sexual world, the
+ Martians were absolutely without sex, and therefore without any of the
+ tumultuous emotions that arise from that difference among men.  A
+ young Martian, there can now be no dispute, was really born upon earth
+ during the war, and it was found attached to its parent, partially
+ BUDDED off, just as young lilybulbs bud off, or like the young animals
+ in the fresh-water polyp.
+ 
+    In man, in all the higher terrestrial animals, such a method of
+ increase has disappeared; but even on this earth it was certainly the
+ primitive method.  Among the lower animals, up even to those first
+ cousins of the vertebrated animals, the Tunicates, the two processes
+ occur side by side, but finally the sexual method superseded its
+ competitor altogether.  On Mars, however, just the reverse has
+ apparently been the case.
+ 
+    It is worthy of remark that a certain speculative writer of quasi-
+ scientific repute, writing long before the Martian invasion, did
+ forecast for man a final structure not unlike the actual Martian
+ condition.  His prophecy, I remember, appeared in November or
+ December, 1893, in a long-defunct publication, the PALL MALL BUDGET,
+ and I recall a caricature of it in a pre-Martian periodical called
+ PUNCH.  He pointed out--writing in a foolish, facetious tone--that the
+ perfection of mechanical appliances must ultimately supersede limbs;
+ the perfection of chemical devices, digestion; that such organs as
+ hair, external nose, teeth, ears, and chin were no longer essential
+ parts of the human being, and that the tendency of natural selection
+ would lie in the direction of their steady diminution through the
+ coming ages.  The brain alone remained a cardinal necessity.  Only one
+ other part of the body had a strong case for survival, and that was
+ the hand, "teacher and agent of the brain."  While the rest of the
+ body dwindled, the hands would grow larger.
+ 
+    There is many a true word written in jest, and here in the Martians
+ we have beyond dispute the actual accomplishment of such a suppression
+ of the animal side of the organism by the intelligence. To me it is
+ quite credible that the Martians may be descended from beings not
+ unlike ourselves, by a gradual development of brain and hands (the
+ latter giving rise to the two bunches of delicate tentacles at last)
+ at the expense of the rest of the body.  Without the body the brain
+ would, of course, become a mere selfish intelligence, without any of
+ the emotional substratum of the human being.
+ 
+    The last salient point in which the systems of these creatures
+ differed from ours was in what one might have thought a very trivial
+ particular.  Micro-organisms, which cause so much disease and pain on
+ earth, have either never appeared upon Mars or Martian sanitary
+ science eliminated them ages ago.  A hundred diseases, all the fevers
+ and contagions of human life, consumption, cancers, tumours and such
+ morbidities, never enter the scheme of their life.  And speaking of
+ the differences between the life on Mars and terrestrial life, I may
+ allude here to the curious suggestions of the red weed.
+ 
+    Apparently the vegetable kingdom in Mars, instead of having green
+ for a dominant colour, is of a vivid blood-red tint.  At any rate, the
+ seeds which the Martians (intentionally or accidentally) brought with
+ them gave rise in all cases to red-coloured growths.  Only that known
+ popularly as the red weed, however, gained any footing in competition
+ with terrestrial forms.  The red creeper was quite a transitory
+ growth, and few people have seen it growing.  For a time, however, the
+ red weed grew with astonishing vigour and luxuriance.  It spread up
+ the sides of the pit by the third or fourth day of our imprisonment,
+ and its cactus-like branches formed a carmine fringe to the edges of
+ our triangular window.  And afterwards I found it broadcast throughout
+ the country, and especially wherever there was a stream of water.
+ 
+    The Martians had what appears to have been an auditory organ, a
+ single round drum at the back of the head-body, and eyes with a visual
+ range not very different from ours except that, according to Philips,
+ blue and violet were as black to them.  It is commonly supposed that
+ they communicated by sounds and tentacular gesticulations; this is
+ asserted, for instance, in the able but hastily compiled pamphlet
+ (written evidently by someone not an eye-witness of Martian actions)
+ to which I have already alluded, and which, so far, has been the chief
+ source of information concerning them.  Now no surviving human being
+ saw so much of the Martians in action as I did.  I take no credit to
+ myself for an accident, but the fact is so.  And I assert that I
+ watched them closely time after time, and that I have seen four, five,
+ and (once) six of them sluggishly performing the most elaborately
+ complicated operations together without either sound or gesture. Their
+ peculiar hooting invariably preceded feeding; it had no modulation,
+ and was, I believe, in no sense a signal, but merely the expiration of
+ air preparatory to the suctional operation.  I have a certain claim to
+ at least an elementary knowledge of psychology, and in this matter I
+ am convinced--as firmly as I am convinced of anything--that the
+ Martians interchanged thoughts without any physical intermediation.
+ And I have been convinced of this in spite of strong preconceptions.
+ Before the Martian invasion, as an occasional reader here or there may
+ remember, I had written with some little vehemence against the
+ telepathic theory.
+ 
+    The Martians wore no clothing.  Their conceptions of ornament and
+ decorum were necessarily different from ours; and not only were they
+ evidently much less sensible of changes of temperature than we are,
+ but changes of pressure do not seem to have affected their health at
+ all seriously.  Yet though they wore no clothing, it was in the other
+ artificial additions to their bodily resources that their great
+ superiority over man lay.  We men, with our bicycles and road-skates,
+ our Lilienthal soaring-machines, our guns and sticks and so forth, are
+ just in the beginning of the evolution that the Martians have worked
+ out.  They have become practically mere brains, wearing different
+ bodies according to their needs just as men wear suits of clothes and
+ take a bicycle in a hurry or an umbrella in the wet.  And of their
+ appliances, perhaps nothing is more wonderful to a man than the
+ curious fact that what is the dominant feature of almost all human
+ devices in mechanism is absent--the WHEEL is absent; among all the
+ things they brought to earth there is no trace or suggestion of their
+ use of wheels.  One would have at least expected it in locomotion. And
+ in this connection it is curious to remark that even on this earth
+ Nature has never hit upon the wheel, or has preferred other expedients
+ to its development.  And not only did the Martians either not know of
+ (which is incredible), or abstain from, the wheel, but in their
+ apparatus singularly little use is made of the fixed pivot or
+ relatively fixed pivot, with circular motions thereabout confined to
+ one plane.  Almost all the joints of the machinery present a
+ complicated system of sliding parts moving over small but beautifully
+ curved friction bearings.  And while upon this matter of detail, it is
+ remarkable that the long leverages of their machines are in most cases
+ actuated by a sort of sham musculature of the disks in an elastic
+ sheath; these disks become polarised and drawn closely and powerfully
+ together when traversed by a current of electricity.  In this way the
+ curious parallelism to animal motions, which was so striking and
+ disturbing to the human beholder, was attained.  Such quasi-muscles
+ abounded in the crablike handling-machine which, on my first peeping
+ out of the slit, I watched unpacking the cylinder.  It seemed
+ infinitely more alive than the actual Martians lying beyond it in the
+ sunset light, panting, stirring ineffectual tentacles, and moving
+ feebly after their vast journey across space.
+ 
+    While I was still watching their sluggish motions in the sunlight,
+ and noting each strange detail of their form, the curate reminded me
+ of his presence by pulling violently at my arm.  I turned to a
+ scowling face, and silent, eloquent lips.  He wanted the slit, which
+ permitted only one of us to peep through; and so I had to forego
+ watching them for a time while he enjoyed that privilege.
+ 
+    When I looked again, the busy handling-machine had already put
+ together several of the pieces of apparatus it had taken out of the
+ cylinder into a shape having an unmistakable likeness to its own; and
+ down on the left a busy little digging mechanism had come into view,
+ emitting jets of green vapour and working its way round the pit,
+ excavating and embanking in a methodical and discriminating manner.
+ This it was which had caused the regular beating noise, and the
+ rhythmic shocks that had kept our ruinous refuge quivering.  It piped
+ and whistled as it worked.  So far as I could see, the thing was
+ without a directing Martian at all.
+ 
+ 
+ 
+                        CHAPTER THREE
+ 
+                  THE DAYS OF IMPRISONMENT
+ 
+    The arrival of a second fighting-machine drove us from our peephole
+ into the scullery, for we feared that from his elevation the Martian
+ might see down upon us behind our barrier.  At a later date we began
+ to feel less in danger of their eyes, for to an eye in the dazzle of
+ the sunlight outside our refuge must have been blank blackness, but at
+ first the slightest suggestion of approach drove us into the scullery
+ in heart-throbbing retreat.  Yet terrible as was the danger we
+ incurred, the attraction of peeping was for both of us irresistible.
+ And I recall now with a sort of wonder that, in spite of the infinite
+ danger in which we were between starvation and a still more terrible
+ death, we could yet struggle bitterly for that horrible privilege of
+ sight.  We would race across the kitchen in a grotesque way between
+ eagerness and the dread of making a noise, and strike each other, and
+ thrust add kick, within a few inches of exposure.
+ 
+    The fact is that we had absolutely incompatible dispositions and
+ habits of thought and action, and our danger and isolation only
+ accentuated the incompatibility.  At Halliford I had already come to
+ hate the curate's trick of helpless exclamation, his stupid rigidity
+ of mind.  His endless muttering monologue vitiated every effort I made
+ to think out a line of action, and drove me at times, thus pent up and
+ intensified, almost to the verge of craziness.  He was as lacking in
+ restraint as a silly woman.  He would weep for hours together, and I
+ verily believe that to the very end this spoiled child of life thought
+ his weak tears in some way efficacious.  And I would sit in the
+ darkness unable to keep my mind off him by reason of his
+ importunities.  He ate more than I did, and it was in vain I pointed
+ out that our only chance of life was to stop in the house until the
+ Martians had done with their pit, that in that long patience a time
+ might presently come when we should need food.  He ate and drank
+ impulsively in heavy meals at long intervals.  He slept little.
+ 
+    As the days wore on, his utter carelessness of any consideration so
+ intensified our distress and danger that I had, much as I loathed
+ doing it, to resort to threats, and at last to blows. That brought him
+ to reason for a time.  But he was one of those weak creatures, void of
+ pride, timorous, anaemic, hateful souls, full of shifty cunning, who
+ face neither God nor man, who face not even themselves.
+ 
+     It is disagreeable for me to recall and write these things, but I
+ set them down that my story may lack nothing.  Those who have escaped
+ the dark and terrible aspects of life will find my brutality, my flash
+ of rage in our final tragedy, easy enough to blame; for they know what
+ is wrong as well as any, but not what is possible to tortured men. But
+ those who have been under the shadow, who have gone down at last to
+ elemental things, will have a wider charity.
+ 
+    And while within we fought out our dark, dim contest of whispers,
+ snatched food and drink, and gripping hands and blows, without, in the
+ pitiless sunlight of that terrible June, was the strange wonder, the
+ unfamiliar routine of the Martians in the pit.  Let me return to those
+ first new experiences of mine.  After a long time I ventured back to
+ the peephole, to find that the new-comers had been reinforced by the
+ occupants of no fewer than three of the fighting-machines.  These last
+ had brought with them certain fresh appliances that stood in an
+ orderly manner about the cylinder. The second handling-machine was now
+ completed, and was busied in serving one of the novel contrivances the
+ big machine had brought.  This was a body resembling a milk can in its
+ general form, above which oscillated a pear-shaped receptacle, and
+ from which a stream of white powder flowed into a circular basin
+ below.
+ 
+    The oscillatory motion was imparted to this by one tentacle of the
+ handling-machine.  With two spatulate hands the handling-machine was
+ digging out and flinging masses of clay into the pear-shaped
+ receptacle above, while with another arm it periodically opened a door
+ and removed rusty and blackened clinkers from the middle part of the
+ machine.  Another steely tentacle directed the powder from the basin
+ along a ribbed channel towards some receiver that was hidden from me
+ by the mound of bluish dust.  From this unseen receiver a little
+ thread of green smoke rose vertically into the quiet air. As I looked,
+ the handling-machine, with a faint and musical clinking, extended,
+ telescopic fashion, a tentacle that had been a moment before a mere
+ blunt projection, until its end was hidden behind the mound of clay.
+ In another second it had lifted a bar of white aluminium into sight,
+ untarnished as yet, and shining dazzlingly, and deposited it in a
+ growing stack of bars that stood at the side of the pit.  Between
+ sunset and starlight this dexterous machine must have made more than a
+ hundred such bars out of the crude clay, and the mound of bluish dust
+ rose steadily until it topped the side of the pit.
+ 
+    The contrast between the swift and complex movements of these
+ contrivances and the inert panting clumsiness of their masters was
+ acute, and for days I had to tell myself repeatedly that these latter
+ were indeed the living of the two things.
+ 
+    The curate had possession of the slit when the first men were
+ brought to the pit.  I was sitting below, huddled up, listening with
+ all my ears.  He made a sudden movement backward, and I, fearful that
+ we were observed, crouched in a spasm of terror.  He came sliding down
+ the rubbish and crept beside me in the darkness, inarticulate,
+ gesticulating, and for a moment I shared his panic.  His gesture
+ suggested a resignation of the slit, and after a little while my
+ curiosity gave me courage, and I rose up, stepped across him, and
+ clambered up to it.  At first I could see no reason for his frantic
+ behaviour.  The twilight had now come, the stars were little and
+ faint, but the pit was illuminated by the flickering green fire that
+ came from the aluminium-making.  The whole picture was a flickering
+ scheme of green gleams and shifting rusty black shadows, strangely
+ trying to the eyes.  Over and through it all went the bats, heeding it
+ not at all.  The sprawling Martians were no longer to be seen, the
+ mound of blue-green powder had risen to cover them from sight, and a
+ fighting-machine, with its legs contracted, crumpled, and abbreviated,
+ stood across the corner of the pit.  And then, amid the clangour of
+ the machinery, came a drifting suspicion of human voices, that I
+ entertained at first only to dismiss.
+ 
+    I crouched, watching this fighting-machine closely, satisfying
+ myself now for the first time that the hood did indeed contain a
+ Martian.  As the green flames lifted I could see the oily gleam of his
+ integument and the brightness of his eyes. And suddenly I heard a
+ yell, and saw a long tentacle reaching over the shoulder of the
+ machine to the little cage that hunched upon its back.  Then
+ something--something struggling violently--was lifted high against the
+ sky, a black, vague enigma against the starlight; and as this black
+ object came down again, I saw by the green brightness that it was a
+ man.  For an instant he was clearly visible.  He was a stout, ruddy,
+ middle-aged man, well dressed; three days before, he must have been
+ walking the world, a man of considerable consequence.  I could see his
+ staring eyes and gleams of light on his studs and watch chain. He
+ vanished behind the mound, and for a moment there was silence.  And
+ then began a shrieking and a sustained and cheerful hooting from the
+ Martians.
+ 
+    I slid down the rubbish, struggled to my feet, clapped my hands
+ over my ears, and bolted into the scullery.  The curate, who had been
+ crouching silently with his arms over his head, looked up as I passed,
+ cried out quite loudly at my desertion of him, and came running after
+ me.
+ 
+    That night, as we lurked in the scullery, balanced between our
+ orror and the terrible fascination this peeping had, although I felt
+ an urgent need of action I tried in vain to conceive some plan of
+ escape; but afterwards, during the second day, I was able to consider
+ our position with great clearness.  The curate, I found, was quite
+ incapable of discussion; this new and culminating atrocity had robbed
+ him of all vestiges of reason or forethought.  Practically he had
+ already sunk to the level of an animal.  But as the saying goes, I
+ gripped myself with both hands.  It grew upon my mind, once I could
+ face the facts, that terrible as our position was, there was as yet no
+ justification for absolute despair. Our chief chance lay in the
+ possibility of the Martians making the pit nothing more than a
+ temporary encampment.  Or even if they kept it permanently, they might
+ not consider it necessary to guard it, and a chance of escape might be
+ afforded us.  I also weighed very carefully the possibility of our
+ digging a way out in a direction away from the pit, but the chances of
+ our emerging within sight of some sentinel fighting-machine seemed at
+ first too great.  And I should have had to do all the digging myself.
+ The curate would certainly have failed me.
+ 
+    It was on the third day, if my memory serves me right, that I saw
+ the lad killed.  It was the only occasion on which I actually saw the
+ Martians feed.  After that experience I avoided the hole in the wall
+ for the better part of a day. I went into the scullery, removed the
+ door, and spent some hours digging with my hatchet as silently as
+ possible; but when I had made a hole about a couple of feet deep the
+ loose earth collapsed noisily, and I did not dare continue.  I lost
+ heart, and lay down on the scullery floor for a long time, having no
+ spirit even to move.  And after that I abandoned altogether the idea
+ of escaping by excavation.
+ 
+    It says much for the impression the Martians had made upon me that
+ at first I entertained little or no hope of our escape being brought
+ about by their overthrow through any human effort.  But on the fourth
+ or fifth night I heard a sound like heavy guns.
+ 
+    It was very late in the night, and the moon was shining brightly.
+ The Martians had taken away the excavating-machine, and, save for a
+ fighting-machine that stood in the remoter bank of the pit and a
+ handling-machine that was buried out of my sight in a corner of the
+ pit immediately beneath my peephole, the place was deserted by them.
+ Except for the pale glow from the handling-machine and the bars and
+ patches of white moonlight the pit was in darkness, and, except for
+ the clinking of the handling-machine, quite still.  That night was a
+ beautiful serenity; save for one planet, the moon seemed to have the
+ sky to herself.  I heard a dog howling, and that familiar sound it was
+ that made me listen.  Then I heard quite distinctly a booming exactly
+ like the sound of great guns.  Six distinct reports I counted, and
+ after a long interval six again.  And that was all.
+ 
+ 
+ 
+                         CHAPTER FOUR
+ 
+                   THE DEATH OF THE CURATE
+ 
+    It was on the sixth day of our imprisonment that I peeped for the
+ last time, and presently found myself alone. Instead of keeping close
+ to me and trying to oust me from the slit, the curate had gone back
+ into the scullery.  I was struck by a sudden thought.  I went back
+ quickly and quietly into the scullery.  In the darkness I heard the
+ curate drinking.  I snatched in the darkness, and my fingers caught a
+ bottle of burgundy.
+ 
+    For a few minutes there was a tussle.  The bottle struck the floor
+ and broke, and I desisted and rose.  We stood panting and threatening
+ each other.  In the end I planted myself between him and the food, and
+ told him of my determination to begin a discipline.  I divided the
+ food in the pantry, into rations to last us ten days.  I would not let
+ him eat any more that day.  In the afternoon he made a feeble effort
+ to get at the food.  I had been dozing, but in an instant I was awake.
+ All day and all night we sat face to face, I weary but resolute, and
+ he weeping and complaining of his immediate hunger.  It was, I know, a
+ night and a day, but to me it seemed--it seems now--an inter- minable
+ length of time.
+ 
+    And so our widened incompatibility ended at last in open conflict.
+ For two vast days we struggled in undertones and wrestling contests.
+ There were times when I beat and kicked him madly, times when I
+ cajoled and persuaded him, and once I tried to bribe him with the last
+ bottle of burgundy, for there was a rain-water pump from which I could
+ get water.  But neither force nor kindness availed; he was indeed
+ beyond reason.  He would neither desist from his attacks on the food
+ nor from his noisy babbling to himself.  The rudimentary precautions
+ to keep our imprisonment endurable he would not observe.  Slowly I
+ began to realise the complete overthrow of his intelligence, to
+ perceive that my sole companion in this close and sickly darkness was
+ a man insane.
+ 
+    From certain vague memories I am inclined to think my own mind
+ wandered at times.  I had strange and hideous dreams whenever I slept.
+ It sounds paradoxical, but I am inclined to think that the weakness
+ and insanity of the curate warned me, braced me, and kept me a sane
+ man.
+ 
+    On the eighth day he began to talk aloud instead of whispering, and
+ nothing I could do would moderate his speech.
+ 
+    "It is just, O God!" he would say, over and over again. "It is
+ just.  On me and mine be the punishment laid.  We have sinned, we have
+ fallen short.  There was poverty, sorrow; the poor were trodden in the
+ dust, and I held my peace.  I preached acceptable folly--my God, what
+ folly!--when I should have stood up, though I died for it, and called
+ upon them to repent-repent! . . . Oppressors of the poor and needy . .
+ . !  The wine press of God!"
+ 
+    Then he would suddenly revert to the matter of the food I withheld
+ from him, praying, begging, weeping, at last threatening.  He began to
+ raise his voice--I prayed him not to.  He perceived a hold on me--he
+ threatened he would shout and bring the Martians upon us.  For a time
+ that scared me; but any concession would have shortened our chance of
+ escape beyond estimating.  I defied him, although I felt no assurance
+ that he might not do this thing.  But that day, at any rate, he did
+ not.  He talked with his voice rising slowly, through the greater part
+ of the eighth and ninth days--threats, entreaties, mingled with a
+ torrent of half-sane and always frothy repentance for his vacant sham
+ of God's service, such as made me pity him.  Then he slept awhile, and
+ began again with renewed strength, so loudly that I must needs make
+ him desist.
+ 
+    "Be still!" I implored.
+ 
+    He rose to his knees, for he had been sitting in the darkness near
+ the copper.
+ 
+    "I have been still too long," he said, in a tone that must have
+ reached the pit, "and now I must bear my witness. Woe unto this
+ unfaithful city!  Woe!  Woe!  Woe!  Woe!  Woe! To the inhabitants of
+ the earth by reason of the other voices of the trumpet----"
+ 
+    "Shut up!" I said, rising to my feet, and in a terror lest the
+ Martians should hear us.  "For God's sake----"
+ 
+    "Nay," shouted the curate, at the top of his voice, standing
+ likewise and extending his arms.  "Speak!  The word of the Lord is
+ upon me!"
+ 
+    In three strides he was at the door leading into the kitchen.
+ 
+    "I must bear my witness!  I go!  It has already been too long
+ delayed."
+ 
+    I put out my hand and felt the meat chopper hanging to the wall. In
+ a flash I was after him.  I was fierce with fear. Before he was
+ halfway across the kitchen I had overtaken him.  With one last touch
+ of humanity I turned the blade back and struck him with the butt.  He
+ went headlong forward and lay stretched on the ground.  I stumbled
+ over him and stood panting.  He lay still.
+ 
+    Suddenly I heard a noise without, the run and smash of slipping
+ plaster, and the triangular aperture in the wall was darkened.  I
+ looked up and saw the lower surface of a handling-machine coming
+ slowly across the hole.  One of its gripping limbs curled amid the
+ debris; another limb appeared, feeling its way over the fallen beams.
+ I stood petrified, staring.  Then I saw through a sort of glass plate
+ near the edge of the body the face, as we may call it, and the large
+ dark eyes of a Martian, peering, and then a long metallic snake of
+ tentacle came feeling slowly through the hole.
+ 
+    I turned by an effort, stumbled over the curate, and stopped at the
+ scullery door.  The tentacle was now some way, two yards or more, in
+ the room, and twisting and turning, with queer sudden movements, this
+ way and that.  For a while I stood fascinated by that slow, fitful
+ advance.  Then, with a faint, hoarse cry, I forced myself across the
+ scullery. I trembled violently; I could scarcely stand upright.  I
+ opened the door of the coal cellar, and stood there in the darkness
+ staring at the faintly lit doorway into the kitchen, and listening.
+ Had the Martian seen me?  What was it doing now?
+ 
+    Something was moving to and fro there, very quietly; every now and
+ then it tapped against the wall, or started on its movements with a
+ faint metallic ringing, like the movements of keys on a split-ring.
+ Then a heavy body--I knew too well what--was dragged across the floor
+ of the kitchen towards the opening.  Irresistibly attracted, I crept
+ to the door and peeped into the kitchen.  In the triangle of bright
+ outer sunlight I saw the Martian, in its Briareus of a handling-
+ machine, scrutinizing the curate's head.  I thought at once that it
+ would infer my presence from the mark of the blow I had given him.
+ 
+    I crept back to the coal cellar, shut the door, and began to cover
+ myself up as much as I could, and as noiselessly as possible in the
+ darkness, among the firewood and coal therein.  Every now and then I
+ paused, rigid, to hear if the Martian had thrust its tentacles through
+ the opening again.
+ 
+    Then the faint metallic jingle returned.  I traced it slowly
+ feeling over the kitchen.  Presently I heard it nearer--in the
+ scullery, as I judged.  I thought that its length might be
+ insufficient to reach me.  I prayed copiously.  It passed, scraping
+ faintly across the cellar door.  An age of almost intolerable suspense
+ intervened; then I heard it fumbling at the latch! It had found the
+ door!  The Martians understood doors!
+ 
+    It worried at the catch for a minute, perhaps, and then the door
+ opened.
+ 
+    In the darkness I could just see the thing--like an elephant's
+ trunk more than anything else--waving towards me and touching and
+ examining the wall, coals, wood and ceiling.  It was like a black worm
+ swaying its blind head to and fro.
+ 
+    Once, even, it touched the heel of my boot.  I was on the verge of
+ screaming; I bit my hand.  For a time the tentacle was silent.  I
+ could have fancied it had been withdrawn. Presently, with an abrupt
+ click, it gripped something--I thought it had me!--and seemed to go
+ out of the cellar again. For a minute I was not sure.  Apparently it
+ had taken a lump of coal to examine.
+ 
+    I seized the opportunity of slightly shifting my position, which
+ had become cramped, and then listened.  I whispered passionate prayers
+ for safety.
+ 
+    Then I heard the slow, deliberate sound creeping towards me again.
+ Slowly, slowly it drew near, scratching against the walls and tapping
+ the furniture.
+ 
+    While I was still doubtful, it rapped smartly against the cellar
+ door and closed it.  I heard it go into the pantry, and the biscuit-
+ tins rattled and a bottle smashed, and then came a heavy bump against
+ the cellar door.  Then silence that passed into an infinity of
+ suspense.
+ 
+    Had it gone?
+ 
+    At last I decided that it had.
+ 
+    It came into the scullery no more; but I lay all the tenth day in
+ the close darkness, buried among coals and firewood, not daring even
+ to crawl out for the drink for which I craved. It was the eleventh day
+ before I ventured so far from my security.
+ 
+ 
+ 
+                        CHAPTER FIVE
+ 
+                        THE STILLNESS
+ 
+    My first act before I went into the pantry was to fasten the door
+ between the kitchen and the scullery.  But the pantry was empty; every
+ scrap of food had gone.  Apparently, the Martian had taken it all on
+ the previous day.  At that discovery I despaired for the first time. I
+ took no food, or no drink either, on the eleventh or the twelfth day.
+ 
+    At first my mouth and throat were parched, and my strength ebbed
+ sensibly.  I sat about in the darkness of the scullery, in a state of
+ despondent wretchedness.  My mind ran on eating.  I thought I had
+ become deaf, for the noises of movement I had been accustomed to hear
+ from the pit had ceased absolutely.  I did not feel strong enough to
+ crawl noiselessly to the peephole, or I would have gone there.
+ 
+    On the twelfth day my throat was so painful that, taking the chance
+ of alarming the Martians, I attacked the creaking rain-water pump that
+ stood by the sink, and got a couple of glassfuls of blackened and
+ tainted rain water.  I was greatly refreshed by this, and emboldened
+ by the fact that no enquiring tentacle followed the noise of my
+ pumping.
+ 
+    During these days, in a rambling, inconclusive way, I thought much
+ of the curate and of the manner of his death.
+ 
+    On the thirteenth day I drank some more water, and dozed and
+ thought disjointedly of eating and of vague impossible plans of
+ escape.  Whenever I dozed I dreamt of horrible phantasms, of the death
+ of the curate, or of sumptuous dinners; but, asleep or awake, I felt a
+ keen pain that urged me to drink again and again.  The light that came
+ into the scullery was no longer grey, but red.  To my disordered
+ imagination it seemed the colour of blood.
+ 
+    On the fourteenth day I went into the kitchen, and I was surprised
+ to find that the fronds of the red weed had grown right across the
+ hole in the wall, turning the half-light of the place into a crimson-
+ coloured obscurity.
+ 
+    It was early on the fifteenth day that I heard a curious, familiar
+ sequence of sounds in the kitchen, and, listening, identified it as
+ the snuffing and scratching of a dog.  Going into the kitchen, I saw a
+ dog's nose peering in through a break among the ruddy fronds.  This
+ greatly surprised me. At the scent of me he barked shortly.
+ 
+    I thought if I could induce him to come into the place quietly I
+ should be able, perhaps, to kill and eat him; and in any case, it
+ would be advisable to kill him, lest his actions attracted the
+ attention of the Martians.
+ 
+    I crept forward, saying "Good dog!" very softly; but he suddenly
+ withdrew his head and disappeared.
+ 
+    I listened--I was not deaf--but certainly the pit was still. I
+ heard a sound like the flutter of a bird's wings, and a hoarse
+ croaking, but that was all.
+ 
+    For a long while I lay close to the peephole, but not daring to
+ move aside the red plants that obscured it.  Once or twice I heard a
+ faint pitter-patter like the feet of the dog going hither and thither
+ on the sand far below me, and there were more birdlike sounds, but
+ that was all.  At length, encouraged by the silence, I looked out.
+ 
+    Except in the corner, where a multitude of crows hopped and fought
+ over the skeletons of the dead the Martians had consumed, there was
+ not a living thing in the pit.
+ 
+    I stared about me, scarcely believing my eyes.  All the machinery
+ had gone.  Save for the big mound of greyish-blue powder in one
+ corner, certain bars of aluminium in another, the black birds, and the
+ skeletons of the killed, the place was merely an empty circular pit in
+ the sand.
+ 
+    Slowly I thrust myself out through the red weed, and stood upon the
+ mound of rubble.  I could see in any direction save behind me, to the
+ north, and neither Martians nor sign of Martians were to be seen.  The
+ pit dropped sheerly from my feet, but a little way along the rubbish
+ afforded a practicable slope to the summit of the ruins.  My chance of
+ escape had come.  I began to tremble.
+ 
+    I hesitated for some time, and then, in a gust of desperate
+ resolution, and with a heart that throbbed violently, I scrambled to
+ the top of the mound in which I had been buried so long.
+ 
+    I looked about again.  To the northward, too, no Martian was
+ visible.
+ 
+    When I had last seen this part of Sheen in the daylight it had been
+ a straggling street of comfortable white and red houses, interspersed
+ with abundant shady trees.  Now I stood on a mound of smashed
+ brickwork, clay, and gravel, over which spread a multitude of red
+ cactus-shaped plants, knee-high, without a solitary terrestrial growth
+ to dispute their footing.  The trees near me were dead and brown, but
+ further a network of red thread scaled the still living stems.
+ 
+    The neighbouring houses had all been wrecked, but none had been
+ burned; their walls stood, sometimes to the second story, with smashed
+ windows and shattered doors.  The red weed grew tumultuously in their
+ roofless rooms.  Below me was the great pit, with the crows struggling
+ for its refuse. A number of other birds hopped about among the ruins.
+ Far away I saw a gaunt cat slink crouchingly along a wall, but traces
+ of men there were none.
+ 
+    The day seemed, by contrast with my recent confinement, dazzlingly
+ bright, the sky a glowing blue.  A gentle breeze kept the red weed
+ that covered every scrap of unoccupied ground gently swaying.  And oh!
+ the sweetness of the air!
+ 
+ 
+ 
+                         CHAPTER SIX
+ 
+                  THE WORK OF FIFTEEN DAYS
+ 
+    For some time I stood tottering on the mound regardless of my
+ safety.  Within that noisome den from which I had emerged I had
+ thought with a narrow intensity only of our immediate security.  I had
+ not realised what had been happening to the world, had not anticipated
+ this startling vision of unfamiliar things.  I had expected to see
+ Sheen in ruins--I found about me the landscape, weird and lurid, of
+ another planet.
+ 
+    For that moment I touched an emotion beyond the common range of
+ men, yet one that the poor brutes we dominate know only too well.  I
+ felt as a rabbit might feel returning to his burrow and suddenly
+ confronted by the work of a dozen busy navvies digging the foundations
+ of a house.  I felt the first inkling of a thing that presently grew
+ quite clear in my mind, that oppressed me for many days, a sense of
+ dethronement, a persuasion that I was no longer a master, but an
+ animal among the animals, under the Martian heel. With us it would be
+ as with them, to lurk and watch, to run and hide; the fear and empire
+ of man had passed away.
+ 
+    But so soon as this strangeness had been realised it passed, and my
+ dominant motive became the hunger of my long and dismal fast.  In the
+ direction away from the pit I saw, beyond a red-covered wall, a patch
+ of garden ground unburied.  This gave me a hint, and I went knee-
+ deep, and sometimes neck-deep, in the red weed.  The density of the
+ weed gave me a reassuring sense of hiding.  The wall was some six feet
+ high, and when I attempted to clamber it I found I could not lift my
+ feet to the crest.  So I went along by the side of it, and came to a
+ corner and a rockwork that enabled me to get to the top, and tumble
+ into the garden I coveted.  Here I found some young onions, a couple
+ of gladiolus bulbs, and a quantity of immature carrots, all of which I
+ secured, and, scrambling over a ruined wall, went on my way through
+ scarlet and crimson trees towards Kew--it was like walking through an
+ avenue of gigantic blood drops--possessed with two ideas: to get more
+ food, and to limp, as soon and as far as my strength permitted, out of
+ this accursed unearthly region of the pit.
+ 
+    Some way farther, in a grassy place, was a group of mushrooms which
+ also I devoured, and then I came upon a bron sheet of flowing shallow
+ water, where meadows used to be. These fragments of nourishment served
+ only to whet my hunger.  At first I was surprised at this flood in a
+ hot, dry summer, but afterwards I discovered that it was caused by the
+ tropical exuberance of the red weed.  Directly this extraordinary
+ growth encountered water it straightway became gigantic and of
+ unparalleled fecundity.  Its seeds were simply poured down into the
+ water of the Wey and Thames, and its swiftly growing and Titanic water
+ fronds speedily choked both those rivers.
+ 
+    At Putney, as I afterwards saw, the bridge was almost lost in a
+ tangle of this weed, and at Richmond, too, the Thames water poured in
+ a broad and shallow stream across the meadows of Hampton and
+ Twickenham.  As the water spread the weed followed them, until the
+ ruined villas of the Thames valley were for a time lost in this red
+ swamp, whose margin I explored, and much of the desolation the
+ Martians had caused was concealed.
+ 
+    In the end the red weed succumbed almost as quickly as it had
+ spread.  A cankering disease, due, it is believed, to the action of
+ certain bacteria, presently seized upon it.  Now by the action of
+ natural selection, all terrestrial plants have acquired a resisting
+ power against bacterial diseases--they never succumb without a severe
+ struggle, but the red weed rotted like a thing already dead.  The
+ fronds became bleached, and then shrivelled and brittle.  They broke
+ off at the least touch, and the waters that had stimulated their early
+ growth carried their last vestiges out to sea.
+ 
+    My first act on coming to this water was, of course, to slake my
+ thirst.  I drank a great deal of it and, moved by an impulse, gnawed
+ some fronds of red weed; but they were watery, and had a sickly,
+ metallic taste.  I found the water was sufficiently shallow for me to
+ wade securely, although the red weed impeded my feet a little; but the
+ flood evidently got deeper towards the river, and I turned back to
+ Mortlake. I managed to make out the road by means of occasional ruins
+ of its villas and fences and lamps, and so presently I got out of this
+ spate and made my way to the hill going up towards Roehampton and came
+ out on Putney Common.
+ 
+    Here the scenery changed from the strange and unfamiliar to the
+ wreckage of the familiar: patches of ground exhibited the devastation
+ of a cyclone, and in a few score yards I would come upon perfectly
+ undisturbed spaces, houses with their blinds trimly drawn and doors
+ closed, as if they had been left for a day by the owners, or as if
+ their inhabitants slept within.  The red weed was less abundant; the
+ tall trees along the lane were free from the red creeper.  I hunted
+ for food among the trees, finding nothing, and I also raided a couple
+ of silent houses, but they had already been broken into and ransacked.
+ I rested for the remainder of the daylight in a shrubbery, being, in
+ my enfeebled condition, too fatigued to push on.
+ 
+    All this time I saw no human beings, and no signs of the Martians.
+ I encountered a couple of hungry-looking dogs, but both hurried
+ circuitously away from the advances I made them.  Near Roehampton I
+ had seen two human skeletons--not bodies, but skeletons, picked
+ clean--and in the wood by me I found the crushed and scattered bones
+ of several cats and rabbits and the skull of a sheep.  But though I
+ gnawed parts of these in my mouth, there was nothing to be got from
+ them.
+ 
+    After sunset I struggled on along the road towards Putney, where I
+ think the Heat-Ray must have been used for some reason.  And in the
+ garden beyond Roehampton I got a quantity of immature potatoes,
+ sufficient to stay my hunger.  From this garden one looked down upon
+ Putney and the river.  The aspect of the place in the dusk was
+ singularly desolate: blackened trees, blackened, desolate ruins, and
+ down the hill the sheets of the flooded river, red-tinged with the
+ weed. And over all--silence.  It filled me with indescribable terror
+ to think how swiftly that desolating change had come.
+ 
+    For a time I believed that mankind had been swept out of existence,
+ and that I stood there alone, the last man left alive.  Hard by the
+ top of Putney Hill I came upon another skeleton, with the arms
+ dislocated and removed several yards from the rest of the body.  As I
+ proceeded I became more and more convinced that the extermination of
+ mankind was, save for such stragglers as myself, already accomplished
+ in this part of the world.  The Martians, I thought, had gone on and
+ left the country desolated, seeking food elsewhere. Perhaps even now
+ they were destroying Berlin or Paris, or it might be they had gone
+ northward.
+ 
+ 
+ 
+                        CHAPTER SEVEN
+ 
+                   THE MAN ON PUTNEY HILL
+ 
+    I spent that night in the inn that stands at the top of Putney
+ Hill, sleeping in a made bed for the first time since my flight to
+ Leatherhead.  I will not tell the needless trouble I had breaking into
+ that house--afterwards I found the front door was on the latch--nor
+ how I ransacked every room for food, until just on the verge of
+ despair, in what seemed to me to be a servant's bedroom, I found a
+ rat-gnawed crust and two tins of pineapple.  The place had been
+ already searched and emptied.  In the bar I afterwards found some
+ biscuits and sandwiches that had been overlooked.  The latter I could
+ not eat, they were too rotten, but the former not only stayed my
+ hunger, but filled my pockets. I lit no lamps, fearing some Martian
+ might come beating that part of London for food in the night.  Before
+ I went to bed I had an interval of restlessness, and prowled from
+ window to window, peering out for some sign of these monsters.  I
+ slept little.  As I lay in bed I found myself thinking consecutively--
+ a thing I do not remember to have done since my last argument with the
+ curate.  During all the intervening time my mental condition had been
+ a hurrying succession of vague emotional states or a sort of stupid
+ receptivity.  But in the night my brain, reinforced, I suppose, by the
+ food I had eaten, grew clear again, and I thought.
+ 
+    Three things struggled for possession of my mind: the killing of
+ the curate, the whereabouts of the Martians, and the possible fate of
+ my wife.  The former gave me no sensation of horror or remorse to
+ recall; I saw it simply as a thing done, a memory infinitely
+ disagreeable but quite without the quality of remorse.  I saw myself
+ then as I see myself now, driven step by step towards that hasty blow,
+ the creature of a sequence of accidents leading inevitably to that.  I
+ felt no condemnation; yet the memory, static, unprogressive, haunted
+ me.  In the silence of the night, with that sense of the nearness of
+ God that sometimes comes into the stillness and the darkness, I stood
+ my trial, my only trial, for that moment of wrath and fear.  I
+ retraced every step of our conversation from the moment when I had
+ found him crouching beside me, heedless of my thirst, and pointing to
+ the fire and smoke that streamed up from the ruins of Weybridge.  We
+ had been incapable of co-operation--grim chance had taken no heed of
+ that.  Had I foreseen, I should have left him at Halliford. But I did
+ not foresee; and crime is to foresee and do.  And I set this down as I
+ have set all this story down, as it was. There were no witnesses--all
+ these things I might have concealed.  But I set it down, and the
+ reader must form his judgment as he will.
+ 
+    And when, by an effort, I had set aside that picture of a prostrate
+ body, I faced the problem of the Martians and the fate of my wife. For
+ the former I had no data; I could imagine a hundred things, and so,
+ unhappily, I could for the latter.  And suddenly that night became
+ terrible.  I found myself sitting up in bed, staring at the dark.  I
+ found myself praying that the Heat-Ray might have suddenly and
+ painlessly struck her out of being.  Since the night of my return from
+ Leatherhead I had not prayed.  I had uttered prayers, fetish prayers,
+ had prayed as heathens mutter charms when I was in extremity; but now
+ I prayed indeed, pleading steadfastly and sanely, face to face with
+ the darkness of God.  Strange night!  Strangest in this, that so soon
+ as dawn had come, I, who had talked with God, crept out of the house
+ like a rat leaving its hiding place--a creature scarcely larger, an
+ inferior animal, a thing that for any passing whim of our masters
+ might be hunted and killed.  Perhaps they also prayed confidently to
+ God.  Surely, ixf we have learned nothing else, this war has taught us
+ pity--pity for those witless souls that suffer our dominion.
+ 
+    The morning was bright and fine, and the eastern sky glowed pink,
+ and was fretted with little golden clouds.  In the road that runs from
+ the top of Putney Hill to Wimbledon was a number of poor vestiges of
+ the panic torrent that must have poured Londonward on the Sunday night
+ after the fighting began.  There was a little two-wheeled cart
+ inscribed with the name of Thomas Lobb, Greengrocer, New Malden, with
+ a smashed wheel and an abandoned tin trunk; there was a straw hat
+ trampled into the now hardened mud, and at the top of West Hill a lot
+ of blood-stained glass about the overturned water trough.  My
+ movements were languid, my plans of the vaguest.  I had an idea of
+ going to Leatherhead, though I knew that there I had the poorest
+ chance of finding my wife.  Certainly, unless death had overtaken them
+ suddenly, my cousins and she would have fled thence; but it seemed to
+ me I might find or learn there whither the Surrey people had fled.  I
+ knew I wanted to find my wife, that my heart ached for her and the
+ world of men, but I had no clear idea how the finding might be done. I
+ was also sharply aware now of my intense loneliness.  From the corner
+ I went, under cover of a thicket of trees and bushes, to the edge of
+ Wimbledon Common, stretching wide and far.
+ 
+    That dark expanse was lit in patches by yellow gorse and broom;
+ there was no red weed to be seen, and as I prowled, hesitating, on the
+ verge of the open, the sun rose, flooding it all with light and
+ vitality.  I came upon a busy swarm of little frogs in a swampy place
+ among the trees.  I stopped to look at them, drawing a lesson from
+ their stout resolve to live.  And presently, turning suddenly, with an
+ odd feeling of being watched, I beheld something crouching amid a
+ clump of bushes.  I stood regarding this.  I made a step towards it,
+ and it rose up and became a man armed with a cutlass.  I approached
+ him slowly.  He stood silent and motionless, regarding me.
+ 
+    As I drew nearer I perceived he was dressed in clothes as dusty and
+ filthy as my own; he looked, indeed, as though he had been dragged
+ through a culvert.  Nearer, I distinguished the green slime of ditches
+ mixing with the pale drab of dried clay and shiny, coaly patches.  His
+ black hair fell over his eyes, and his face was dark and dirty and
+ sunken, so that at first I did not recognise him.  There was a red cut
+ across the lower part of his face.
+ 
+    "Stop!" he cried, when I was within ten yards of him, and I
+ stopped.  His voice was hoarse.  "Where do you come from?" he said.
+ 
+    I thought, surveying him.
+ 
+    "I come from Mortlake," I said.  "I was buried near the pit the
+ Martians made about their cylinder.  I have worked my way out and
+ escaped."
+ 
+    "There is no food about here," he said.  "This is my country.  All
+ this hill down to the river, and back to Clapham, and up to the edge
+ of the common.  There is only food for one. Which way are you going?"
+ 
+    I answered slowly.
+ 
+    "I don't know," I said.  "I have been buried in the ruins of a
+ house thirteen or fourteen days.  I don't know what has happened."
+ 
+    He looked at me doubtfully, then started, and looked with a changed
+ expression.
+ 
+    "I've no wish to stop about here," said I.  "I think I shall go to
+ Leatherhead, for my wife was there."
+ 
+    He shot out a pointing finger.
+ 
+    "It is you," said he; "the man from Woking.  And you weren't killed
+ at Weybridge?"
+ 
+    I recognised him at the same moment.
+ 
+    "You are the artilleryman who came into my garden."
+ 
+    "Good luck!" he said.  "We are lucky ones!  Fancy YOU!"  He put out
+ a hand, and I took it.  "I crawled up a drain," he said. "But they
+ didn't kill everyone.  And after they went away I got off towards
+ Walton across the fields.  But---- It's not sixteen days altogether--
+ and your hair is grey."  He looked over his shoulder suddenly.  "Only
+ a rook," he said.  "One gets to know that birds have shadows these
+ days.  This is a bit open.  Let us crawl under those bushes and talk."
+ 
+    "Have you seen any Martians?" I said.  "Since I crawled out----"
+ 
+    "They've gone away across London," he said.  "I guess they've got a
+ bigger camp there.  Of a night, all over there, Hampstead way, the sky
+ is alive with their lights.  It's like a great city, and in the glare
+ you can just see them moving. By daylight you can't.  But nearer--I
+ haven't seen them--" (he counted on his fingers) "five days.  Then I
+ saw a couple across Hammersmith way carrying something big.  And the
+ night before last"--he stopped and spoke impressively--"it was just a
+ matter of lights, but it was something up in the air.  I believe
+ they've built a flying-machine, and are learning to fly."
+ 
+    I stopped, on hands and knees, for we had come to the bushes.
+ 
+    "Fly!"
+ 
+    "Yes," he said, "fly."
+ 
+    I went on into a little bower, and sat down.
+ 
+    "It is all over with humanity," I said.  "If they can do that they
+ will simply go round the world."
+ 
+    He nodded.
+ 
+    "They will.  But---- It will relieve things over here a bit. And
+ besides----"  He looked at me.  "Aren't you satisfied it IS up with
+ humanity?  I am.  We're down; we're beat."
+ 
+    I stared.  Strange as it may seem, I had not arrived at this fact--
+ a fact perfectly obvious so soon as he spoke.  I had still held a
+ vague hope; rather, I had kept a lifelong habit of mind.  He repeated
+ his words, "We're beat."  They carried absolute conviction.
+ 
+    "It's all over," he said.  "They've lost ONE--just ONE. And they've
+ made their footing good and crippled the greatest power in the world.
+ They've walked over us.  The death of that one at Weybridge was an
+ accident.  And these are only pioneers.  They kept on coming.  These
+ green stars--I've seen none these five or six days, but I've no doubt
+ they're falling somewhere every night.  Nothing's to be done.  We're
+ under! We're beat!"
+ 
+    I made him no answer.  I sat staring before me, trying in vain to
+ devise some countervailing thought.
+ 
+    "This isn't a war," said the artilleryman.  "It never was a war,
+ any more than there's war between man and ants."
+ 
+    Suddenly I recalled the night in the observatory.
+ 
+    "After the tenth shot they fired no more--at least, until the first
+ cylinder came."
+ 
+    "How do you know?" said the artilleryman.  I explained. He thought.
+ "Something wrong with the gun," he said.  "But what if there is?
+ They'll get it right again.  And even if there's a delay, how can it
+ alter the end?  It's just men and ants.  There's the ants builds their
+ cities, live their lives, have wars, revolutions, until the men want
+ them out of the way, and then they go out of the way.  That's what we
+ are now--just ants.  Only----"
+ 
+    "Yes," I sid.
+ 
+    "We're eatable ants."
+ 
+    We sat looking at each other.
+ 
+    "And what will they do with us?" I said.
+ 
+    "That's what I've been thinking," he said; "that's what I've been
+ thinking.  After Weybridge I went south--thinking.  I saw what was up.
+ Most of the people were hard at it squealing and exciting themselves.
+ But I'm not so fond of squealing.  I've been in sight of death once or
+ twice; I'm not an ornamental soldier, and at the best and worst,
+ death--it's just death.  And it's the man that keeps on thinking comes
+ through.  I saw everyone tracking away south.  Says I, "Food won't
+ last this way," and I turned right back.  I went for the Martians like
+ a sparrow goes for man.  All round"--he waved a hand to the
+ horizon--"they're starving in heaps, bolting, treading on each other.
+ . . ."
+ 
+    He saw my face, and halted awkwardly.
+ 
+    "No doubt lots who had money have gone away to France," he said. He
+ seemed to hesitate whether to apologise, met my eyes, and went on:
+ "There's food all about here. Canned things in shops; wines, spirits,
+ mineral waters; and the water mains and drains are empty.  Well, I was
+ telling you what I was thinking.  "Here's intelligent things," I said,
+ "and it seems they want us for food.  First, they'll smash us up--
+ ships, machines, guns, cities, all the order and organisation. All
+ that will go.  If we were the size of ants we might pull through.  But
+ we're not.  It's all too bulky to stop. That's the first certainty."
+ Eh?"
+ 
+    I assented.
+ 
+    "It is; I've thought it out.  Very well, then--next; at present
+ we're caught as we're wanted.  A Martian has only to go a few miles to
+ get a crowd on the run.  And I saw one, one day, out by Wandsworth,
+ picking houses to pieces and routing among the wreckage.  But they
+ won't keep on doing that. So soon as they've settled all our guns and
+ ships, and smashed our railways, and done all the things they are
+ doing over there, they will begin catching us systematic, picking the
+ best and storing us in cages and things.  That's what they will start
+ doing in a bit.  Lord!  They haven't begun on us yet.  Don't you see
+ that?"
+ 
+    "Not begun!" I exclaimed.
+ 
+    "Not begun.  All that's happened so far is through our not having
+ the sense to keep quiet--worrying them with guns and such foolery. And
+ losing our heads, and rushing off in crowds to where there wasn't any
+ more safety than where we were.  They don't want to bother us yet.
+ They're making their things--making all the things they couldn't bring
+ with them, getting things ready for the rest of their people.  Very
+ likely that's why the cylinders have stopped for a bit, for fear of
+ hitting those who are here.  And instead of our rushing about blind,
+ on the howl, or getting dynamite on the chance of busting them up,
+ we've got to fix ourselves up according to the new state of affairs.
+ That's how I figure it out.  It isn't quite according to what a man
+ wants for his species, but it's about what the facts point to.  And
+ that's the principle I acted upon.  Cities, nations, civilisation,
+ progress--it's all over.  That game's up.  We're beat."
+ 
+    "But if that is so, what is there to live for?"
+ 
+    The artilleryman looked at me for a moment.
+ 
+    "There won't be any more blessed concerts for a million years or
+ so; there won't be any Royal Academy of Arts, and no nice little feeds
+ at restaurants.  If it's amusement you're after, I reckon the game is
+ up.  If you've got any drawing-room manners or a dislike to eating
+ peas with a knife or dropping aitches, you'd better chuck 'em away.
+ They ain't no further use."
+ 
+    "You mean----"
+ 
+    "I mean that men like me are going on living--for the sake of the
+ breed.  I tell you, I'm grim set on living.  And if I'm not mistaken,
+ you'll show what insides YOU'VE got, too, before long.  We aren't
+ going to be exterminated.  And I don't mean to be caught either, and
+ tamed and fattened and bred like a thundering ox.  Ugh! Fancy those
+ brown creepers!"
+ 
+    "You don't mean to say----"
+ 
+    "I do.  I'm going on, under their feet.  I've got it planned; I've
+ thought it out.  We men are beat.  We don't know enough.  We've got to
+ learn before we've got a chance.  And we've got to live and keep
+ independent while we learn.  See! That's what has to be done."
+ 
+    I stared, astonished, and stirred profoundly by the man's
+ resolution.
+ 
+    "Great God!," cried I.  "But you are a man indeed!"  And suddenly I
+ gripped his hand.
+ 
+    "Eh!" he said, with his eyes shining.  "I've thought it out, eh?"
+ 
+    "Go on," I said.
+ 
+    "Well, those who mean to escape their catching must get ready.  I'm
+ getting ready.  Mind you, it isn't all of us that are made for wild
+ beasts; and that's what it's got to be. That's why I watched you.  I
+ had my doubts.  You're slender. I didn't know that it was you, you
+ see, or just how you'd been buried.  All these--the sort of people
+ that lived in these houses, and all those damn little clerks that used
+ to live down that way--they'd be no good.  They haven't any spirit in
+ them--no proud dreams and no proud lusts; and a man who hasn't one or
+ the other--Lord!  What is he but funk and precautions?  They just used
+ to skedaddle off to work--I've seen hundreds of 'em, bit of breakfast
+ in hand, running wild and shining to catch their little season-ticket
+ train, for fear they'd get dismissed if they didn't; working at
+ businesses they were afraid to take the trouble to understand;
+ skedaddling back for fear they wouldn't be in time for dinner; keeping
+ indoors after dinner for fear of the back streets, and sleeping with
+ the wives they married, not because they wanted them, but because they
+ had a bit of money that would make for safety in their one little
+ miserable skedaddle through the world.  Lives insured and a bit
+ invested for fear of accidents.  And on Sundays--fear of the
+ hereafter.  As if hell was built for rabbits!  Well, the Martians will
+ just be a godend to these.  Nice roomy cages, fattening food, careful
+ breeding, no worry.  After a week or so chasing about the fields and
+ lands on empty stomachs, they'll come and be caught cheerful.  They'll
+ be quite glad after a bit.  They'll wonder what people did before
+ there were Martians to take care of them.  And the bar loafers, and
+ mashers, and singers--I can imagine them.  I can imagine them," he
+ said, with a sort of sombre gratification.  "There'll be any amount of
+ sentiment and religion loose among them. There's hundreds of things I
+ saw with my eyes that I've only begun to see clearly these last few
+ days.  There's lots will take things as they are--fat and stupid; and
+ lots will be worried by a sort of feeling that it's all wrong, and
+ that they ought to be doing something.  Now whenever things are so
+ that a lot of people feel they ought to be doing something, the weak,
+ and those who go weak with a lot of complicated thinking, always make
+ for a sort of do-nothing religion, very pious and superior, and submit
+ to persecution and the will of the Lord.  Very likely you've seen the
+ same thing.  It's energy in a gale of funk, and turned clean inside
+ out.  These cages will be full of psalms and hymns and piety. And
+ those of a less simple sort will work in a bit of--what is it?--
+ eroticism."
+ 
+    He paused.
+ 
+    "Very likely these Martians will make pets of some of them; train
+ them to do tricks--who knows?--get sentimental over the pet boy who
+ grew up and had to be killed.  And some, maybe, they will train to
+ hunt us."
+ 
+    "No," I cried, "that's impossible!  No human being----"
+ 
+    "What's the good of going on with such lies?" said the
+ artilleryman.  "There's men who'd do it cheerful.  What nonsense to
+ pretend there isn't!"
+ 
+    And I succumbed to his conviction.
+ 
+    "If they come after me," he said; "Lord, if they come after me!"
+ and subsided into a grim meditation.
+ 
+    I sat contemplating these things.  I could find nothing to bring
+ against this man's reasoning.  In the days before the invasion no one
+ would have questioned my intellectual superiority to his--I, a
+ professed and recognised writer on philosophical themes, and he, a
+ common soldier; and yet he had already formulated a situation that I
+ had scarcely realised.
+ 
+    "What are you doing?" I said presently.  "What plans have you
+ made?"
+ 
+    He hesitated.
+ 
+    "Well, it's like this," he said.  "What have we to do?  We have to
+ invent a sort of life where men can live and breed, and be
+ sufficiently secure to bring the children up.  Yes--wait a bit, and
+ I'll make it clearer what I think ought to be done. The tame ones will
+ go like all tame beasts; in a few generations they'll be big,
+ beautiful, rich-blooded, stupid--rubbish! The risk is that we who keep
+ wild will go savage--degenerate into a sort of big, savage rat. . . .
+ You see, how I mean to live is underground.  I've been thinking about
+ the drains.  Of course those who don't know drains think horrible
+ things; but under this London are miles and miles--hundreds of miles--
+ and a few days rain and London empty will leave them sweet and clean.
+ The main drains are big enough and airy enough for anyone.  Then
+ there's cellars, vaults, stores, from which bolting passages may be
+ made to the drains. And the railway tunnels and subways.  Eh?  You
+ begin to see? And we form a band--able-bodied, clean-minded men. We're
+ not going to pick up any rubbish that drifts in.  Weaklings go out
+ again."
+ 
+    "As you meant me to go?"
+ 
+    "Well--l parleyed, didn't I?"
+ 
+    "We won't quarrel about that.  Go on."
+ 
+    "Those who stop obey orders.  Able-bodied, clean-minded women we
+ want also--mothers and teachers.  No lackadaisical ladies--no blasted
+ rolling eyes.  We can't have any weak or silly.  Life is real again,
+ and the useless and cumbersome and mischievous have to die.  They
+ ought to die.  They ought to be willing to die.  It's a sort of
+ disloyalty, after all, to live and taint the race.  And they can't be
+ happy.  Moreover, dying's none so dreadful; it's the funking makes it
+ bad.  And in all those places we shall gather.  Our district will be
+ London. And we may even be able to keep a watch, and run about in the
+ open when the Martians keep away.  Play cricket, perhaps. That's how
+ we shall save the race.  Eh?  It's a possible thing?  But saving the
+ race is nothing in itself.  As I say, that's only being rats.  It's
+ saving our knowledge and adding to it is the thing.  There men like
+ you come in.  There's books, there's models.  We must make great safe
+ places down deep, and get all the books we can; not novels and poetry
+ swipes, but ideas, science books.  That's where men like you come in.
+ We must go to the British Museum and pick all those books through.
+ Especially we must keep up our science--learn more. We must watch
+ these Martians.  Some of us must go as spies.  When it's all working,
+ perhaps I will.  Get caught, I mean.  And the great thing is, we must
+ leave the Martians alone.  We mustn't even steal.  If we get in their
+ way, we clear out.  We must show them we mean no harm. Yes, I know.
+ But they're intelligent things, and they won't hunt us down if they
+ have all they want, and think we're just harmless vermin."
+ 
+    The artilleryman paused and laid a brown hand upon my arm.
+ 
+    "After all, it may not be so much we may have to learn before--Just
+ imagine this: four or five of their fighting machines suddenly
+ starting off--Heat-Rays right and left, and not a Martian in 'em.  Not
+ a Martian in 'em, but men--men who have learned the way how.  It may
+ be in my time, even--those men.  Fancy having one of them lovely
+ things, with its Heat-Ray wide and free!  Fancy having it in control!
+ What would it matter if you smashed to smithereens at the end of the
+ run, after a bust like that?  I reckon the Martians'll open their
+ beautiful eyes!  Can't you see them, man?  Can't you see them
+ hurrying, hurrying--puffing and blowing and hooting to their other
+ mechanical affairs?  Something out of gear in every case.  And swish,
+ bang, rattle, swish!  Just as they are fumbling over it, SWISH comes
+ the Heat-Ray, and, behold! man has come back to his own."
+ 
+    For a while the imaginative daring of the artilleryman, and the
+ tone of assurance and courage he assumed, completely dominated my
+ mind.  I believed unhesitatingly both in his forecast of human destiny
+ and in the practicability of his astonishing scheme, and the reader
+ who thinks me susceptible and foolish must contrast his position,
+ reading steadily with all his thoughts about his subject, and mine,
+ crouching fearfully in the bushes and listening, distracted by
+ apprehension.  We talked in this manner through the early morning
+ time, and later crept out of the bushes, and, after scanning the sky
+ for Martians, hurried precipitately to the house on Putney Hill where
+ he had made his lair.  It was the coal cellar of the place, and when I
+ saw the work he had spent a week upon--it was a burrow scarcely ten
+ yards long, which he designed to reach to the main drain on Putney
+ Hill--I had my first inkling of the gulf between his dreams and his
+ powers.  Such a hole I could have dug in a day.  But I believed in him
+ sufficiently to work with him all that morning until past midday at
+ his digging.  We had a garden barrow and shot the earth we removed
+ against the kitchen range.  We refreshed ourselves with a tin of mock-
+ turtle soup and wine from the neighbouring pantry.  I found a curious
+ relief from the aching strangeness of the world in this steady labour.
+ As we worked, I turned his project over in my mind, and presently
+ objections and doubts began to arise; but I worked there all the
+ morning, so glad was I to find myself with a purpose again.  After
+ working an hour I began to speculate on the distance one had to go
+ before the cloaca was reached, the chances we had of missing it
+ altogether.  My immediate trouble was why we should dig this long
+ tunnel, when it was possible to get into the drain at once down one of
+ the manholes, and work back to the house.  It seemed to me, too, that
+ the house was inconveniently chosen, and required a needless length of
+ tunnel.  And just as I was beginning to face these things, the
+ artilleryman stopped digging, and looked at me.
+ 
+    "We're working well," he said.  He put down his spade. "Let us
+ knock off a bit" he said.  "I think it's time we reconnoitred from the
+ roof of the house."
+ 
+    I was for going on, and after a little hesitation he resumed his
+ spade; and then suddenly I was struck by a thought. I stopped, and so
+ did he at once.
+ 
+    "Why were you walking about the common," I said, "instead of being
+ here?"
+ 
+    "Taking the air," he said.  "I was coming back.  It's safer by
+ night."
+ 
+    "But the work?"
+ 
+    "Oh, one can't always work," he said, and in a flash I saw the man
+ plain.  He hesitated, holding his spade.  "We ought to reconnoitre
+ now," he said, "because if any come near they may hear the spades and
+ drop upon us unawares."
+ 
+    I was no longer disposed to object.  We went together to the roof
+ and stood on a ladder peeping out of the roof door. No Martians were
+ to be seen, and we ventured out on the tiles, and slipped down under
+ shelter of the parapet.
+ 
+    From this position a shrubbery hid the greater portion of Putney,
+ but we could see the river below, a bubbly mass of red weed, and the
+ low parts of Lambeth flooded and red. The red creeper swarmed up the
+ trees about the old palace, and their branches stretched gaunt and
+ dead, and set with shrivelled leaves, from amid its clusters.  It was
+ strange how entirely dependent both these things were upon flowing
+ water for their propagation.  About us neither had gained a footing;
+ laburnums, pink mays, snowballs, and trees of arbor-vitae, rose out of
+ laurels and hydrangeas, green and brilliant into the sunlight.  Beyond
+ Kensington dense smoke was rising, and that and a blue haze hid the
+ northward hills.
+ 
+    The artilleryman began to tell me of the sort of people who still
+ remained in London.
+ 
+    "One night last week," he said, "some fools got the electric light
+ in order, and there was all Regent Street and the Circus ablaze,
+ crowded with painted and ragged drunkards, men and women, dancing and
+ shouting till dawn.  A man who was there told me.  And as the day came
+ they became aware of a fighting-machine standing near by the Langham
+ and looking down at them.  Heaven knows how long he had been there. It
+ must have given some of them a nasty turn.  He came down the road
+ towards them, and picked up nearly a hundred too drunk or frightened
+ to run away."
+ 
+    Grotesque gleam of a time no history will ever fully describe!
+ 
+    From that, in answer to my questions, he came round to his
+ grandiose plans again.  He grew enthusiastic.  He talked so eloquently
+ of the possibility of capturing a fighting-machine that I more than
+ half believed in him again.  But now that I was beginning to
+ understand something of his quality, I could divine the stress he laid
+ on doing nothing precipitately.  And I noted that now there was no
+ question that he personally was to capture and fight the great
+ machine.
+ 
+    After a time we went down to the cellar.  Neither of us seemed
+ disposed to resume digging, and when he suggested a meal, I was
+ nothing loath.  He became suddenly very generous, and when we had
+ eaten he went away and returned with some excellent cigars.  We lit
+ these, and his optimism glowed.  He was inclined to regard my coming
+ as a great occasion.
+ 
+    "There's some champane in the cellar," he said.
+ 
+    "We can dig better on this Thames-side burgundy," said I.
+ 
+    "No," said he; "I am host today.  Champagne!  Great God! We've a
+ heavy enough task before us!  Let us take a rest and gather strength
+ while we may.  Look at these blistered hands!"
+ 
+    And pursuant to this idea of a holiday, he insisted upon playing
+ cards after we had eaten.  He taught me euchre, and after dividing
+ London between us, I taking the northern side and he the southern, we
+ played for parish points.  Grotesque and foolish as this will seem to
+ the sober reader, it is absolutely true, and what is more remarkable,
+ I found the card game and several others we played extremely
+ interesting.
+ 
+    Strange mind of man! that, with our species upon the edge of
+ extermination or appalling degradation, with no clear prospect before
+ us but the chance of a horrible death, we could sit following the
+ chance of this painted pasteboard, and playing the "joker" with vivid
+ delight.  Afterwards he taught me poker, and I beat him at three tough
+ chess games.  When dark came we decided to take the risk, and lit a
+ lamp.
+ 
+    After an interminable string of games, we supped, and the
+ artilleryman finished the champagne.  We went on smoking the cigars.
+ He was no longer the energetic regenerator of his species I had
+ encountered in the morning.  He was still optimistic, but it was a
+ less kinetic, a more thoughtful optimism.  I remember he wound up with
+ my health, proposed in a speech of small variety and considerable
+ intermittence. I took a cigar, and went upstairs to look at the lights
+ of which he had spoken that blazed so greenly along the Highgate
+ hills.
+ 
+    At first I stared unintelligently across the London valley. The
+ northern hills were shrouded in darkness; the fires near Kensington
+ glowed redly, and now and then an orange-red tongue of flame flashed
+ up and vanished in the deep blue night.  All the rest of London was
+ black.  Then, nearer, I perceived a strange light, a pale, violet-
+ purple fluorescent glow, quivering under the night breeze.  For a
+ space I could not understand it, and then I knew that it must be the
+ red weed from which this faint irradiation proceeded.  With that
+ realisation my dormant sense of wonder, my sense of the proportion of
+ things, awoke again.  I glanced from that to Mars, red and clear,
+ glowing high in the west, and then gazed long and earnestly at the
+ darkness of Hampstead and Highgate.
+ 
+    I remained a very long time upon the roof, wondering at the
+ grotesque changes of the day.  I recalled my mental states from the
+ midnight prayer to the foolish card-playing.  I had a violent
+ revulsion of feeling.  I remember I flung away the cigar with a
+ certain wasteful symbolism.  My folly came to me with glaring
+ exaggeration.  I seemed a traitor to my wife and to my kind; I was
+ filled with remorse.  I resolved to leave this strange undisciplined
+ dreamer of great things to his drink and gluttony, and to go on into
+ London.  There, it seemed to me, I had the best chance of learning
+ what the Martians and my fellowmen were doing.  I was still upon the
+ roof when the late moon rose.
+ 
+ 
+ 
+                        CHAPTER EIGHT
+ 
+                         DEAD LONDON
+ 
+    After I had parted from the artilleryman, I went down the hill, and
+ by the High Street across the bridge to Fulham. The red weed was
+ tumultuous at that time, and nearly choked the bridge roadway; but its
+ fronds were already whitened in patches by the spreading disease that
+ presently removed it so swiftly.
+ 
+    At the corner of the lane that runs to Putney Bridge station I
+ found a man lying.  He was as black as a sweep with the black dust,
+ alive, but helplessly and speechlessly drunk.  I could get nothing
+ from him but curses and furious lunges at my head.  I think I should
+ have stayed by him but for the brutal expression of his face.
+ 
+    There was black dust along the roadway from the bridge onwards, and
+ it grew thicker in Fulham.  The streets were horribly quiet.  I got
+ food--sour, hard, and mouldy, but quite eatable--in a baker's shop
+ here.  Some way towards Walham Green the streets became clear of
+ powder, and I passed a white terrace of houses on fire; the noise of
+ the burning was an absolute relief.  Going on towards Brompton, the
+ streets were quiet again.
+ 
+    Here I came once more upon the black powder in the streets and upon
+ dead bodies.  I saw altogether about a dozen in the length of the
+ Fulham Road.  They had been dead many days, so that I hurried quickly
+ past them.  The black powder covered them over, and softened their
+ outlines.  One or two had been disturbed by dogs.
+ 
+    Where there was no black powder, it was curiously like a Sunday in
+ the City, with the closed shops, the houses locked up and the blinds
+ drawn, the desertion, and the stillness.  In some places plunderers
+ had been at work, but rarely at other than the provision and wine
+ shops.  A jeweller's window had been broken open in one place, but
+ apparently the thief had been disturbed, and a number of gold chains
+ and a watch lay scattered on the pavement.  I did not trouble to touch
+ them.  Farther on was a tattered woman in a heap on a doorstep; the
+ hand that hung over her knee was gashed and bled down her rusty brown
+ dress, and a smashed magnum of champagne formed a pool across the
+ pavement.  She seemed asleep, but she was dead.
+ 
+    The farther I penetrated into London, the profounder grew the
+ stillness.  But it was not so much the stillness of death--it was the
+ stillness of suspense, of expectation.  At any time the destruction
+ that had already singed the northwestern borders of the metropolis,
+ and had annihilated Ealing and Kilburn, might strike among these
+ houses and leave them smoking ruins.  It was a city condemned and
+ derelict. . . .
+ 
+    In South Kensington the streets were clear of dead and of black
+ powder.  It was near South Kensington that I first heard the howling.
+ It crept almost imperceptibly upon my senses. It was a sobbing
+ alternation of two notes, "Ulla, ulla, ulla, ulla," keeping on
+ perpetually.  When I passed streets that ran northward it grew in
+ volume, and houses and buildings seemed to deaden and cut it off
+ again.  It came in a full tide down Exhibition Road.  I stopped,
+ staring towards Kensington Gardens, wondering at this strange, remote
+ wailing.  It was as if that mighty desert of houses had found a voice
+ for its fear and solitude.
+ 
+    "Ulla, ulla, ulla, ulla," wailed that superhuman note--great waves
+ of sound sweeping down the broad, sunlit roadway, between the tall
+ buildings on each side.  I turned northwards, marvelling, towards the
+ iron gates of Hyde Park.  I had half a mind to break into the Natural
+ History Museum and find my way up to the summits of the towers, in
+ order to see across the park.  But I decided to keep to the ground,
+ where quick hiding was possible, and so went on up the Exhibition
+ Road.  All the large mansions on each side of the road were empty and
+ still, and my footsteps echoed against the sides of the houses.  At
+ the top, near the park gate, I came upon a strange sight--a bus
+ overturned, and the skeleton of a horse picked clean.  I puzzled over
+ this for a time, and then went on to the bridge over the Serpentine.
+ The voice grew stronger and stronger, though I could see nothing above
+ the housetops on the north side of the park, save a haze of smoke to
+ the northwest.
+ 
+    "Ulla, ulla, ulla, ulla," cried the voice, coming, as it seemed to
+ me, from the district about Regent's Park.  The desolating cry worked
+ upon my mind.  The mood that had sustained me passed.  The wailing
+ took possession of me.  I found I was intensely weary, footsore, and
+ now again hungry and thirsty.
+ 
+    It was already past noon.  Why was I wandering alone in this city
+ of the dead?  Why was I alone when all London was lying in state, and
+ in its black shroud?  I felt intolerably lonely.  My mind ran on old
+ friends that I had forgotten for years.  I thought of the poisons in
+ the chemists' shops, of the liquors the wine merchants stored; I
+ recalled the two sodden creatures of despair, who so far as I knew,
+ shared the city with myself. . . .
+ 
+     I came into Oxford Street by the Marble Arch, and here again were
+ black powder and several bodies, and an evil, ominous smell from the
+ gratings of the cellars of some of the houses.  I grew very thirsty
+ after the heat of my long walk. With infinite trouble I managed to
+ break into a public-house and get food and drink.  I was weary after
+ eating, and went into the parlour behind the bar, and slept on a black
+ horsehair sofa I found there.
+ 
+    I awoke to find that dismal howling still in my ears, "Ulla, ulla,
+ ulla, ulla."  It was now dusk, and after I had routed out some
+ biscuits and a cheese in the bar--there was a meat safe, but it
+ contained nothing but maggots--I wandered on through the silent
+ residential squares to Baker Street--Portman Square is the only one I
+ can name--and so came out at last upon Regent's Park.  And as I
+ emerged from the top of Baker Street, I saw far away over the trees in
+ the clearness of the sunset the hood of the Martian giant from which
+ this howling proceeded.  I was not terrified.  I came upon him as if
+ it were a matter of course.  I watched him for some time, but he did
+ not move.  He appeared to be standing and yelling, for no reason that
+ I could discover.
+ 
+    I tried to formulate a plan of action.  That perpetual sound of
+ "Ulla, ulla, ulla, ulla," confused my mind.  Perhaps I was too tired
+ to be very fearful.  Certainly I was more curious to know the reason
+ of this monotonous crying than afraid.  I turned back away from the
+ park and struck into Park Road, intending to skirt the park, went
+ along under the shelter of the terraces, and got a view of this
+ stationary, howling Martian from the direction of St. John's Wood.  A
+ couple of hundred yards out of Baker Street I heard a yelping chorus,
+ and saw, first a dog with a piece of putrescent red meat in his jaws
+ coming headlong towards me, and then a pack of starving mongrels in
+ pursuit of him.  He made a wide curve to avoid me, as though he feared
+ I might prove a fresh competitor.  As the yelping died away down the
+ silent road, the wailing sound of "Ulla, ulla, ulla, ulla," reasserted
+ itself.
+ 
+    I came upon the wrecked handling-machine halfway to St. John's Wood
+ station.  At first I thought a house had fallen across the road.  It
+ was only as I clambered among the ruins that I saw, with a start, this
+ mechanical Samson lying, with its tentacles bent and smashed and
+ twisted, among the ruins it had made.  The forepart was shattered.  It
+ seemed as if it had driven blindly straight at the house, and had been
+ overwhelmed in its overthrow.  It seemed to me then that this might
+ have happened by a handling-machine escaping from the guidance of its
+ Martian.  I could not clamber among the ruins to see it, and the
+ twilight was now so far advanced that the blood with which its seat
+ was smeared, and the gnawed gristle of the Martian that the dogs had
+ left, were invisible to me.
+ 
+    Wondering still more at all that I had seen, I pushed on towards
+ Primrose Hill.  Far away, through a gap in the trees, I saw a second
+ Martian, as motionless as the first, standing in the park towards the
+ Zoological Gardens, and silent.  A little beyond the ruins about the
+ smashed handling-machine I came upon the red weed again, and found the
+ Regent's Canal, a spongy mass of dark-red vegetation.
+ 
+    As I crossed the bridge, the sound of "Ulla, ulla, ulla, ulla,"
+ ceased.  It was, as it were, cut off.  The silence came like a
+ thunderclap.
+ 
+    The dusky houses about me stood faint and tall and dim; the trees
+ towards the park were growing black.  All about me the red weed
+ clambered among the ruins, writhing to get above me in the dimness.
+ Night, the mother of fear and mystery, was coming upon me.  But while
+ that voice sounded the solitude, the desolation, had been endurable;
+ by virtue of it London had still seemed alive, and the sense of life
+ about me had upheld me.  Then suddenly a change, the passing of
+ something--I knew not what--and then a stillness that could be felt.
+ Nothing but this gaunt quiet.
+ 
+    London about me gazed at me spectrally.  The windows in the white
+ houses were like the eye sockets of skulls.  About me my imagination
+ found a thousand noiseless enemies moving.  Terror seized me, a horror
+ of my temerity.  In front of me the road became pitchy black as though
+ it was tarred, and I saw a contorted shape lying across the pathway. I
+ could not bring myself to go on.  I turned down St. John's Wood Road,
+ and ran headlong from this unendurable stillness towards Kilburn.  I
+ hid from the night and the silence, until long after midnight, in a
+ cabmen's shelter in Harrow Road. But before the dawn my courage
+ returned, and while the stars were still in the sky I turned once more
+ towards Regent's Park.  I missed my way among the streets, and
+ presently saw down a long avenue, in the half-light of the early dawn,
+ the curve of Primrose Hill.  On the summit, towering up to the fading
+ stars, was a third Martian, erect and motionless like the others.
+ 
+    An insane resolve possessed me.  I would die and end it. And I
+ would save myself even the trouble of killing myself. I marched on
+ recklessly towards this Titan, and then, as I drew nearer and the
+ light grew, I saw that a multitude of black birds was circling and
+ clustering about the hood.  At that my heart gave a bound, and I began
+ running along the road.
+ 
+    I hurried through the red weed that choked St. Edmund's Terrace (I
+ waded breast-high across a torrent of water that was rushing down from
+ the waterworks towards the Albert Road), and emerged upon the grass
+ before the rising of the sun.  Great mounds had been heaped about the
+ crest of the hill, making a huge redoubt of it--it was the final and
+ largest place the Martians had made--and from behind these heaps there
+ rose a thin smoke against the sky.  Against the sky line an eager dog
+ ran and disappeared.  The thought that had flashed into my mind grew
+ real, grew credible.  I felt no fear, only a wild, trembling
+ exultation, as I ran up the hill towards the motionless monster.  Out
+ of the hood hung lank shreds of brown, at which the hungry birds
+ pecked and tore.
+ 
+    In another moment I had scrambled up the earthen rampart and stood
+ upon its crest, and the interior of the redoubt was below me.  A
+ mighty space it was, with gigantic machines here and there within it,
+ huge mounds of material and strange shelter places.  And scattered
+ about it, some in their overturned war-machines, some in the now rigid
+ handling-machines, and a dozen of them stark and silent and laid in a
+ row, were the Martians--DEAD!--slain by the putrefactive and disease
+ bacteria against whic their systems were unprepared; slain as the red
+ weed was being slain; slain, after all man's devices had failed, by
+ the humblest things that God, in his wisdom, has put upon this earth.
+ 
+    For so it had come about, as indeed I and many men might have
+ foreseen had not terror and disaster blinded our minds.  These germs
+ of disease have taken toll of humanity since the beginning of things--
+ taken toll of our prehuman ancestors since life began here.  But by
+ virtue of this natural selection of our kind we have developed
+ resisting power; to no germs do we succumb without a struggle, and to
+ many--those that cause putrefaction in dead matter, for instance --our
+ living frames are altogether immune.  But there are no bacteria in
+ Mars, and directly these invaders arrived, directly they drank and
+ fed, our microscopic allies began to work their overthrow.  Already
+ when I watched them they were irrevocably doomed, dying and rotting
+ even as they went to and fro.  It was inevitable.  By the toll of a
+ billion deaths man has bought his birthright of the earth, and it is
+ his against all comers; it would still be his were the Martians ten
+ times as mighty as they are.  For neither do men live nor die in vain.
+ 
+    Here and there they were scattered, nearly fifty altogether, in
+ that great gulf they had made, overtaken by a death that must have
+ seemed to them as incomprehensible as any death could be.  To me also
+ at that time this death was incomprehensible. All I knew was that
+ these things that had been alve and so terrible to men were dead. For
+ a moment I believed that the destruction of Sennacherib had been
+ repeated, that God had repented, that the Angel of Death had slain
+ them in the night.
+ 
+    I stood staring into the pit, and my heart lightened gloriously,
+ even as the rising sun struck the world to fire about me with his
+ rays.  The pit was still in darkness; the mighty engines, so great and
+ wonderful in their power and complexity, so unearthly in their
+ tortuous forms, rose weird and vague and strange out of the shadows
+ towards the light.  A multitude of dogs, I could hear, fought over the
+ bodies that lay darkly in the depth of the pit, far below me.  Across
+ the pit on its farther lip, flat and vast and strange, lay the great
+ flying-machine with which they had been experimenting upon our denser
+ atmosphere when decay and death arrested them.  Death had come not a
+ day too soon.  At the sound of a cawing overhead I looked up at the
+ huge fighting-machine that would fight no more for ever, at the
+ tattered red shreds of flesh that dripped down upon the overturned
+ seats on the summit of Primrose Hill.
+ 
+    I turned and looked down the slope of the hill to where, enhaloed
+ now in birds, stood those other two Martians that I had seen
+ overnight, just as death had overtaken them.  The one had died, even
+ as it had been crying to its companions; perhaps it was the last to
+ die, and its voice had gone on perpetually until the force of its
+ machinery was exhausted. They glittered now, harmless tripod towers of
+ shining metal, in the brightness of the rising sun.
+ 
+    All about the pit, and saved as by a miracle from everlasting
+ destruction, stretched the great Mother of Cities. Those who have only
+ seen London veiled in her sombre robes of smoke can scarcely imagine
+ the naked clearness and beauty of the silent wilderness of houses.
+ 
+    Eastward, over the blackened ruins of the Albert Terrace and the
+ splintered spire of the church, the sun blazed dazzling in a clear
+ sky, and here and there some facet in the great wilderness of roofs
+ caught the light and glared with a white intensity.
+ 
+    Northward were Kilburn and Hampsted, blue and crowded with houses;
+ westward the great city was dimmed; and southward, beyond the
+ Martians, the green waves of Regent's Park, the Langham Hotel, the
+ dome of the Albert Hall, the Imperial Institute, and the giant
+ mansions of the Brompton Road came out clear and little in the
+ sunrise, the jagged ruins of Westminster rising hazily beyond.  Far
+ away and blue were the Surrey hills, and the towers of the Crystal
+ Palace glittered like two silver rods.  The dome of St. Paul's was
+ dark against the sunrise, and injured, I saw for the first time, by a
+ huge gaping cavity on its western side.
+ 
+    And as I looked at this wide expanse of houses and factories and
+ churches, silent and abandoned; as I thought of the multitudinous
+ hopes and efforts, the innumerable hosts of lives that had gone to
+ build this human reef, and of the swift and ruthless destruction that
+ had hung over it all; when I realised that the shadow had been rolled
+ back, and that men might still live in the streets, and this dear vast
+ dead city of mine be once more alive and powerful, I felt a wave of
+ emotion that was near akin to tears.
+ 
+    The torment was over.  Even that day the healing would begin.  The
+ survivors of the people scattered over the country--leaderless,
+ lawless, foodless, like sheep without a shepherd--the thousands who
+ had fled by sea, would begin to return; the pulse of life, growing
+ stronger and stronger, would beat again in the empty streets and pour
+ across the vacant squares.  Whatever destruction was done, the hand of
+ the destroyer was stayed.  All the gaunt wrecks, the blackened
+ skeletons of houses that stared so dismally at the sunlit grass of the
+ hill, would presently be echoing with the hammers of the restorers and
+ ringing with the tapping of their trowels.  At the thought I extended
+ my hands towards the sky and began thanking God.  In a year, thought
+ I--in a year. . .
+ 
+    With overwhelming force came the thought of myself, of my wife, and
+ the old life of hope and tender helpfulness that had ceased for ever.
+ 
+ 
+ 
+                         CHAPTER NINE
+ 
+                           WRECKAGE
+ 
+    And now comes the strangest thing in my story.  Yet, perhaps, it is
+ not altogether strange.  I remember, clearly and coldly and vividly,
+ all that I did that day until the time that I stood weeping and
+ praising God upon the summit of Primrose Hill. And then I forget.
+ 
+    Of the next three days I know nothing.  I have learned since that,
+ so far from my being the first discoverer of the Martian overthrow,
+ several such wanderers as myself had already discovered this on the
+ previous night.  One man--the first--had gone to St. Martin's-le-
+ Grand, and, while I sheltered in the cabmen's hut, had contrived to
+ telegraph to Paris.  Thence the joyful news had flashed all over the
+ world; a thousand cities, chilled by ghastly apprehensions, suddenly
+ flashed into frantic illuminations; they knew of it in Dublin,
+ Edinburgh, Manchester, Birmingham, at the time when I stood upon the
+ verge of the pit.  Already men, weeping with joy, as I have heard,
+ shouting and staying their work to shake hands and shout, were making
+ up trains, even as near as Crewe, to descen upon London.  The church
+ bells that had ceased a fortnight since suddenly caught the news,
+ until all England was bell-ringing.  Men on cycles, lean-faced,
+ unkempt, scorched along every country lane shouting of unhoped
+ deliverance, shouting to gaunt, staring figures of despair.  And for
+ the food!  Across the Channel, across the Irish Sea, across the
+ Atlantic, corn, bread, and meat were tearing to our relief.  All the
+ shipping in the world seemed going Londonward in those days.  But of
+ all this I have no memory.  I drifted--a demented man.  I found myself
+ in a house of kindly people, who had found me on the third day
+ wandering, weeping, and raving through the streets of St. John's Wood.
+ They have told me since that I was singing some insane doggerel about
+ "The Last Man Left Alive! Hurrah!  The Last Man Left Alive!"  Troubled
+ as they were with their own affairs, these people, whose name, much as
+ I would like to express my gratitude to them, I may not even give
+ here, nevertheless cumbered themselves with me, sheltered me, and
+ protected me from myself.  Apparently they had learned something of my
+ story from me during the days of my lapse.
+ 
+    Very gently, when my mind was assured again, did they break to me
+ what they had learned of the fate of Leatherhead.  Two days after I
+ was imprisoned it had been destroyed, with every soul in it, by a
+ Martian.  He had swept it out of existence, as it seemed, without any
+ provocation, as a boy might crush an ant hill, in the mere wantonness
+ of power.
+ 
+    I was a lonely man, and they were very kind to me.  I was a lonely
+ man and a sad one, and they bore with me.  I remained with them four
+ days after my recovery.  All that time I felt a vague, a growing
+ craving to look once more on whatever remained of the little life that
+ seemed so happy and bright in my past.  It was a mere hopeless desire
+ to feast upon my misery.  They dissuaded me.  They did all they could
+ to divert me from this morbidity.  But at last I could resist the
+ impulse no longer, and, promising faithfully to return to them, and
+ parting, as I will confess, from these four-day friends with tears, I
+ went out again into the streets that had lately been so dark and
+ strange and empty.
+ 
+    Already they were busy with returning people; in places even there
+ were shops open, and I saw a drinking fountain running water.
+ 
+    I remember how mockingly bright the day seemed as I went back on my
+ melancholy pilgrimage to the little house at Woking, how busy the
+ streets and vivid the moving life about me.  So many people were
+ abroad everywhere, busied in a thousand activities, that it seemed
+ incredible that any great proportion of the population could have been
+ slain. But then I noticed how yellow were the skins of the people I
+ met, how shaggy the hair of the men, how large and bright their eyes,
+ and that every other man still wore his dirty rags.  Their faces
+ seemed all with one of two expressions--a leaping exultation and
+ energy or a grim resolution.  Save for the expression of the faces,
+ London seemed a city of tramps.  The vestries were indiscriminately
+ distributing bread sent us by the French government.  The ribs of the
+ few horses showed dismally.  Haggard special constables with white
+ badges stood at the corners of every street.  I saw little of the
+ mischief wrought by the Martians until I reached Wellington Street,
+ and there I saw the red weed clambering over the buttresses of
+ Waterloo Bridge.
+ 
+    At the corner of the bridge, too, I saw one of the common contrasts
+ of that grotesque time--a sheet of paper flaunting against a thicket
+ of the red weed, transfixed by a stick that kept it in place.  It was
+ the placard of the first newspaper to resume publication--the DAILY
+ MAIL.  I bought a copy for a blackened shilling I found in my pocket.
+ Most of it was in blank, but the solitary compositor who did the thing
+ had amused himself by making a grotesque scheme of advertisement
+ stereo on the back page.  The matter he printed was emotional; the
+ news organisation had not as yet found its way back.  I learned
+ nothing fresh except that already in one week the examination of the
+ Martian mechanisms had yielded astonishing results.  Among other
+ things, the article assured me what I did not believe at the time,
+ that the "Secret of Flying," was discovered.  At Waterloo I found the
+ free trains that were taking people to their homes.  The first rush
+ was already over.  There were few people in the train, and I was in no
+ mood for casual conversation.  I got a compartment to myself, and sat
+ with folded arms, looking greyly at the sunlit devastation that flowed
+ past the windows.  And just outside the terminus the train jolted over
+ temporary rails, and on either side of the railway the houses were
+ blackened ruins.  To Clapham Junction the face of London was grimy
+ with powder of the Black Smoke, in spite of two days of thunderstorms
+ and rain, and at Clapham Junction the line had been wrecked again;
+ there were hundreds of out-of-work clerks and shopmen working side by
+ side with the customary navvies, and we were jolted over a hasty
+ relaying.
+ 
+    All down the line from there the aspect of the country was gaunt
+ and unfamiliar; Wimbledon particularly had suffered. Walton, by virtue
+ of its unburned pine woods, seemed the least hurt of any place along
+ the line.  The Wandle, the Mole, every little stream, was a heaped
+ mass of red weed, in appearance between butcher's meat and pickled
+ cabbage. The Surrey pine woods were too dry, however, for the festoons
+ of the red climber.  Beyond Wimbledon, within sight of the line, in
+ certain nursery grounds, were the heaped masses of earth about the
+ sixth cylinder.  A number of people were standing about it, and some
+ sappers were busy in the midst of it.  Over it flaunted a Union Jack,
+ flapping cheerfully in the morning breeze.  The nursery grounds were
+ everywhere crimson with the weed, a wide expanse of livid colour cut
+ with purple shadows, and very painful to the eye.  One's gaze went
+ with infinite relief from the scorched greys and sullen reds of the
+ foreground to the blue-green softness of the eastward hills.
+ 
+    The line on the London side of Woking station was still undergoing
+ repair, so I descended at Byfleet station and took the road to
+ Maybury, past the place where I and the artilleryman had talked to the
+ hussars, and on by the spot where the Martian had appeared to me in
+ the thunderstorm. Here, moved by curiosity, I turned aside to find,
+ among a tangle of red fronds, the warped and broken dog cart with the
+ whitened bones of the horse scattered and gnawed.  For a time I stood
+ regarding these vestiges. . . .
+ 
+    Then I returned through the pine wood, neck-high with red weed here
+ and there, to find the landlord of the Spotted Dog had already found
+ burial, and so came home past the College Arms.  A man standing at an
+ open cottage door greeted me by name as I passed.
+ 
+    I looked at my house with a quick flash of hope that faded
+ immediately.  The door had been forced; it was unfast and was opening
+ slowly as I approached.
+ 
+    It slammed again.  The curtains of my study fluttered out of the
+ open wxindow from which I and the artilleryman had watched the dawn. No
+ one had closed it since.  The smashed bushes were just as I had left
+ them nearly four weeks ago.  I stumbled into the hall, and the house
+ felt empty.  The stair carpet was ruffled and discoloured where I had
+ crouched, soaked to the skin from the thunderstorm the night of the
+ catastrophe.  Our muddy footsteps I saw still went up the stairs.
+ 
+    I followed them to my study, and found lying on my writing-table
+ still, with the selenite paper weight upon it, the sheet of work I had
+ left on the afternoon of the opening of the cylinder.  For a space I
+ stood reading over my abandoned arguments.  It was a paper on the
+ probable development of Moral Ideas with the development of the
+ civilising process; and the last sentence was the opening of a
+ prophecy: "In about two hundred years," I had written, "we may
+ expect----"  The sentence ended abruptly.  I remembered my inability
+ to fix my mind that morning, scarcely a month gone by, and how I had
+ broken off to get my DAILY CHRONICLE from the newsboy.  I remembered
+ how I went down to the garden gate as he came along, and how I had
+ listened to his odd story of "Men from Mars."
+ 
+    I came down and went into the dining room.  There were the mutton
+ and the bread, both far gone now in decay, and a beer bottle
+ overturned, just as I and the artilleryman had left them.  My home was
+ desolate.  I perceived the folly of the faint hope I had cherished so
+ long.  And then a strange thing occurred.  "It is no use," said a
+ voice.  "The house is deserted.  No one has been here these ten days.
+ Do not stay here to torment yourself.  No one escaped but you."
+ 
+    I was startled.  Had I spoken my thought aloud?  I turned, and the
+ French window was open behind me.  I made a step to it, and stood
+ looking out.
+ 
+    And there, amazed and afraid, even as I stood amazed and afraid,
+ were my cousin and my wife--my wife white and tearless.  She gave a
+ faint cry.
+ 
+    "I came," she said.  "I knew--knew----"
+ 
+    She put her hand to her throat--swayed.  I made a step forward, and
+ caught her in my arms.
+ 
+ 
+ 
+                         CHAPTER TEN
+ 
+                         THE EPILOGUE
+ 
+    I cannot but regret, now that I am concluding my story, how little
+ I am able to contribute to the discussion of the many debatable
+ questions which are still unsettled.  In one respect I shall certainly
+ provoke criticism.  My particular province is speculative philosophy.
+ My knowledge of comparative physiology is confined to a book or two,
+ but it seems to me that Carver's suggestions as to the reason of the
+ rapid death of the Martians is so probable as to be regarded almost as
+ a proven conclusion.  I have assumed that in the body of my narrative.
+ 
+    At any rate, in all the bodies of the Martians that were examined
+ after the war, no bacteria except those already known as terrestrial
+ species were found.  That they did not bury any of their dead, and the
+ reckless slaughter they perpetrated, point also to an entire ignorance
+ of the putrefactive process.  But probable as this seems, it is by no
+ means a proven conclusion.
+ 
+    Neither is the composition of the Black Smoke known, which the
+ Martians used with such deadly effect, and the generator of the Heat-
+ Rays remains a puzzle.  The terrible disasters at the Ealing and South
+ Kensington laboratories have disinclined analysts for further
+ investigations upon the latter.  Spectrum analysis of the black powder
+ points unmistakably to the presence of an unknown element with a
+ brilliant group of three lines in the green, and it is possible that
+ it combines with argon to form a compound which acts at once with
+ deadly effect upon some constituent in the blood.  But such unproven
+ speculations will scarcely be of interest to the general reader, to
+ whom this story is addressed.  None of the brown scum that drifted
+ down the Thames after the destruction of Shepperton was examined at
+ the time, and now none is forthcoming.
+ 
+     The results of an anatomical examination of the Martians, so far
+ as the prowling dogs had left such an examination possible, I have
+ already given.  But everyone is familiar with the magnificent and
+ almost complete specimen in spirits at the Natural History Museum, and
+ the countless drawings that have been made from it; and beyond that
+ the interest of their physiology and structure is purely scientific.
+ 
+    A question of graver and universal interest is the possibility of
+ another attack from the Martians.  I do not think that nearly enough
+ attention is being given to this aspect of the matter.  At present the
+ planet Mars is in conjunction, but with every return to opposition I,
+ for one, anticipate a renewal of their adventure.  In any case, we
+ should be prepared.  It seems to me that it should be possible to
+ define the position of the gun from which the shots are discharged, to
+ keep a sustained watch upon this part of the planet, and to anticipate
+ the arrival of the next attack.
+ 
+    In that case the cylinder might be destroyed with dynamite or
+ artillery before it was sufficiently cool for the Martians to emerge,
+ or they mght be butchered by means of guns so soon as the screw
+ opened.  It seems to me that they have lost a vast advantage in the
+ failure of their first surprise.  Possibly they see it in the same
+ light.
+ 
+    Lessing has advanced excellent reasons for supposing that the
+ Martians have actually succeeded in effecting a landing on the planet
+ Venus.  Seven months ago now, Venus and Mars were in alignment with
+ the sun; that is to say, Mars was in opposition from the point of view
+ of an observer on Venus.  Subsequently a peculiar luminous and sinuous
+ marking appeared on the unillumined half of the inner planet, and
+ almost simultaneously a faint dark mark of a similar sinuous character
+ was detected upon a photograph of the Martian disk.  One needs to see
+ the drawings of these appearances in order to appreciate fully their
+ remarkable resemblance in character.
+ 
+    At any rate, whether we expect another invasion or not, our views
+ of the human future must be greatly modified by these events.  We have
+ learned now that we cannot regard this planet as being fenced in and a
+ secure abiding place for Man; we can never anticipate the unseen good
+ or evil that may come upon us suddenly out of space.  It may be that
+ in the larger design of the universe this invasion from Mars is not
+ without its ultimate benefit for men; it has robbed us of that serene
+ confidence in the future which is the most fruitful source of
+ decadence, the gifts to human science it has brought are enormous, and
+ it has done much to promote the conception of the commonweal of
+ mankind.  It may be that across the immensity of space the Martians
+ have watched the fate of these pioneers of theirs and learned their
+ lesson, and that on the planet Venus they have found a securer
+ settlement.  Be that as it may, for many years yet there will
+ certainly be no relaxation of the eager scrutiny of the Martian disk,
+ and those fiery darts of the sky, the shooting stars, will bring with
+ them as they fall an unavoidable apprehension to all the sons of men.
+ 
+    The broadening of men's views that has resulted can scarcely be
+ exaggerated.  Before the cylinder fell there was a general persuasion
+ that through all the deep of space no life existed beyond the petty
+ surface of our minute sphere. Now we see further.  If the Martians can
+ reach Venus, there is no reason to suppose that the thing is
+ impossible for men, and when the slow cooling of the sun makes this
+ earth uninhabitable, as at last it must do, it may be that the thread
+ of life that has begun here will have streamed out and caught our
+ sister planet within its toils.
+ 
+    Dim and wonderful is the vision I have conjured up in my mind of
+ life spreading slowly from this little seed bed of the solar system
+ throughout the inanimate vastness of sidereal space.  But that is a
+ remote dream.  It may be, on the other hand, that the destruction of
+ the Matians is only a reprieve.  To them, and not to us, perhaps, is
+ the future ordained.
+ 
+    I must confess the stress and danger of the time have left an
+ abiding sense of doubt and insecurity in my mind.  I sit in my study
+ writing by lamplight, and suddenly I see again the healing valley
+ below set with writhing flames, and feel the house behind and about me
+ empty and desolate.  I go out into the Byfleet Road, and vehicles pass
+ me, a butcher boy in a cart, a cabful of visitors, a workman on a
+ bicycle, children going to school, and suddenly they become vague and
+ unreal, and I hurry again with the artilleryman through the hot,
+ brooding silence.  Of a night I see the black powder darkening the
+ silent streets, and the contorted bodies shrouded in that layer; they
+ rise upon me tattered and dog-bitten.  They gibber and grow fiercer,
+ paler, uglier, mad distortions of humanity at last, and I wake, cold
+ and wretched, in the darkness of the night.
+ 
+    I go to London and see the busy multitudes in Fleet Street and the
+ Strand, and it comes across my mind that they are but the ghosts of
+ the past, haunting the streets that I have seen silent and wretched,
+ going to and fro, phantasms in a dead city, the mockery of life in a
+ galvanised body.  And strange, too, it is to stand on Primrose Hill,
+ as I did but a day before writing this last chapter, to see the great
+ province of houses, dim and blue through the haze of the smoke and
+ mist, vanishing at last into the vague lower sky, to see the people
+ walking to and fro among the flower beds on the hill, to see the
+ sight-seers about the Martian machine that stands there still, to hear
+ the tumult of playing children, and to recall the time when I saw it
+ all bright and clear-cut, hard and silent, under the dawn of that last
+ great day. . . .
+ 
+    And strangest of all is it to hold my wife's hand again, and to think
+ that I have counted her, and that she has counted me, among the dead.
+ 
+ 
+ 
+ 
+ 
+ End of The Project Gutenberg Etext of War of the Worlds by H. G. Wells
+ 
+ 
+ 


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/local.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/local.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/local.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,104 ----
+ /*
+  * $Id: local.h,v 1.1 2007/01/09 23:57:18 lattner Exp $
+  */
+ 
+ /*
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * This file is a sample local.h file.  It shows what I believe nearly every
+  * site will want to include in their local.h.  You will probably want to
+  * expand this file;  see "config.X" to learn of #defines that you might
+  * like to add to.
+  */
+ 
+ /*
+  * $Log: local.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:02  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.14  1995/01/08  23:23:56  geoff
+  * Do some minor clarification of the instructional comments.
+  *
+  * Revision 1.13  1994/05/17  06:37:25  geoff
+  * Add one more item of warning advice to the comments.
+  *
+  * Revision 1.12  1994/02/07  06:00:00  geoff
+  * Add a warning about shell processing restrictions
+  *
+  * Revision 1.11  1994/01/25  07:11:50  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ /*
+  * WARNING WARNING WARNING
+  *
+  * This file is *NOT* a normal C header file!  Although it uses C
+  * syntax and is included in C programs, it is also processed by shell
+  * scripts that are very stupid about format.
+  *
+  * Do not try to use #if constructs to configure this file for more
+  * than one configuration.  Do not place whitespace after the "#" in
+  * "#define".  Do not attempt to disable lines by commenting them out.
+  * Do not use backslashes to reduce the length of long lines.
+  * None of these things will work the way you expect them to.
+  *
+  * WARNING WARNING WARNING
+  */
+ 
+ #define MINIMENU	/* Display a mini-menu at the bottom of the screen */
+ #define NO8BIT		/* Remove this if you use ISO character sets */
+ #undef USG		/* Define this on System V */
+ 
+ /*
+  * Important directory paths
+  */
+ #define BINDIR	"/usr/local/bin"
+ #define LIBDIR	"."
+ #define ELISPDIR "/usr/local/lib/emacs/site-lisp"
+ #define TEXINFODIR "/usr/local/info"
+ #define MAN1DIR	"/usr/local/man/man1"
+ #define MAN4DIR	"/usr/local/man/man4"
+ 
+ /*
+  * Place any locally-required #include statements here
+  */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/lookup.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,486 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: lookup.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * lookup.c - see if a word appears in the dictionary
+  *
+  * Pace Willisson, 1983
+  *
+  * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: lookup.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:02  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.42  1995/01/08  23:23:42  geoff
+  * Support MSDOS_BINARY_OPEN when opening the hash file to read it in.
+  *
+  * Revision 1.41  1994/01/25  07:11:51  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ 
+ int		linit P ((void));
+ #ifdef INDEXDUMP
+ static void	dumpindex P ((struct flagptr * indexp, int depth));
+ #endif /* INDEXDUMP */
+ struct dent *	lookup P ((ichar_t * word, int dotree));
+ 
+ static		inited = 0;
+ 
+ int linit ()
+     {
+     int			hashfd;
+     register int	i;
+     register struct dent * dp;
+     struct flagent *	entry;
+     struct flagptr *	ind;
+     int			nextchar;
+     int			viazero;
+     register ichar_t *	cp;
+ 
+     if (inited)
+ 	return 0;
+ 
+     if ((hashfd = open (hashname, 0 | MSDOS_BINARY_OPEN)) < 0)
+ 	{
+ 	(void) fprintf (stderr, CANT_OPEN, hashname);
+ 	return (-1);
+ 	}
+ 
+     hashsize = read (hashfd, (char *) &hashheader, sizeof hashheader);
+     if (hashsize < sizeof hashheader)
+ 	{
+ 	if (hashsize < 0)
+ 	    (void) fprintf (stderr, LOOKUP_C_CANT_READ, hashname);
+ 	else if (hashsize == 0)
+ 	    (void) fprintf (stderr, LOOKUP_C_NULL_HASH, hashname);
+ 	else
+ 	    (void) fprintf (stderr,
+ 	      LOOKUP_C_SHORT_HASH (hashname, hashsize,
+ 	        (int) sizeof hashheader));
+ 	return (-1);
+ 	}
+     else if (hashheader.magic != MAGIC)
+ 	{
+ 	(void) fprintf (stderr,
+ 	  LOOKUP_C_BAD_MAGIC (hashname, (unsigned int) MAGIC,
+ 	    (unsigned int) hashheader.magic));
+ 	return (-1);
+ 	}
+     else if (hashheader.magic2 != MAGIC)
+ 	{
+ 	(void) fprintf (stderr,
+ 	  LOOKUP_C_BAD_MAGIC2 (hashname, (unsigned int) MAGIC,
+ 	    (unsigned int) hashheader.magic2));
+ 	return (-1);
+ 	}
+     else if (hashheader.compileoptions != COMPILEOPTIONS
+       ||  hashheader.maxstringchars != MAXSTRINGCHARS
+       ||  hashheader.maxstringcharlen != MAXSTRINGCHARLEN)
+ 	{
+ 	(void) fprintf (stderr,
+ 	  LOOKUP_C_BAD_OPTIONS ((unsigned int) hashheader.compileoptions,
+ 	    hashheader.maxstringchars, hashheader.maxstringcharlen,
+ 	    (unsigned int) COMPILEOPTIONS, MAXSTRINGCHARS, MAXSTRINGCHARLEN));
+ 	return (-1);
+ 	}
+     if (nodictflag)
+ 	{
+ 	/*
+ 	 * Dictionary is not needed - create an empty dummy table.  We
+ 	 * actually have to have one entry since the hash
+ 	 * algorithm involves a divide by the table size
+ 	 * (actually modulo, but zero is still unacceptable).
+ 	 * So we create an empty entry.
+ 	 */
+ 	hashsize = 1;		/* This prevents divides by zero */
+ 	hashtbl = (struct dent *) calloc (1, sizeof (struct dent));
+ 	if (hashtbl == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, LOOKUP_C_NO_HASH_SPACE);
+ 	    return (-1);
+ 	    }
+ 	hashtbl[0].word = NULL;
+ 	hashtbl[0].next = NULL;
+ 	hashtbl[0].flagfield &= ~(USED | KEEP);
+ 	/* The flag bits don't matter, but calloc cleared them. */
+ 	hashstrings = (char *) malloc ((unsigned) hashheader.lstringsize);
+ 	}
+     else
+ 	{
+ 	hashtbl =
+ 	 (struct dent *)
+ 	    malloc ((unsigned) hashheader.tblsize * sizeof (struct dent));
+ 	hashsize = hashheader.tblsize;
+ 	hashstrings = (char *) malloc ((unsigned) hashheader.stringsize);
+ 	}
+     numsflags = hashheader.stblsize;
+     numpflags = hashheader.ptblsize;
+     sflaglist = (struct flagent *)
+       malloc ((numsflags + numpflags) * sizeof (struct flagent));
+     if (hashtbl == NULL  ||  hashstrings == NULL  ||  sflaglist == NULL)
+ 	{
+ 	(void) fprintf (stderr, LOOKUP_C_NO_HASH_SPACE);
+ 	return (-1);
+ 	}
+     pflaglist = sflaglist + numsflags;
+ 
+     if (nodictflag)
+ 	{
+ 	/*
+ 	 * Read just the strings for the language table, and
+ 	 * skip over the rest of the strings and all of the
+ 	 * hash table.
+ 	 */
+ 	if (read (hashfd, hashstrings, (unsigned) hashheader.lstringsize)
+ 	  != hashheader.lstringsize)
+ 	    {
+ 	    (void) fprintf (stderr, LOOKUP_C_BAD_FORMAT);
+ 	    return (-1);
+ 	    }
+ 	(void) lseek (hashfd,
+ 	  (long) hashheader.stringsize - (long) hashheader.lstringsize
+ 	    + (long) hashheader.tblsize * (long) sizeof (struct dent),
+ 	  1);
+ 	}
+     else
+ 	{
+ 	if (read (hashfd, hashstrings, (unsigned) hashheader.stringsize)
+ 	    != hashheader.stringsize
+ 	  ||  read (hashfd, (char *) hashtbl,
+ 	      (unsigned) hashheader.tblsize * sizeof (struct dent))
+ 	    != hashheader.tblsize * sizeof (struct dent))
+ 	    {
+ 	    (void) fprintf (stderr, LOOKUP_C_BAD_FORMAT);
+ 	    return (-1);
+ 	    }
+ 	}
+     if (read (hashfd, (char *) sflaglist,
+ 	(unsigned) (numsflags + numpflags) * sizeof (struct flagent))
+       != (numsflags + numpflags) * sizeof (struct flagent))
+ 	{
+ 	(void) fprintf (stderr, LOOKUP_C_BAD_FORMAT);
+ 	return (-1);
+ 	}
+     (void) close (hashfd);
+ 
+     if (!nodictflag)
+ 	{
+ 	for (i = hashsize, dp = hashtbl;  --i >= 0;  dp++)
+ 	    {
+ 	    if (dp->word == (char *) -1)
+ 		dp->word = NULL;
+ 	    else
+ 		dp->word = &hashstrings [ (int)(dp->word) ];
+ 	    if (dp->next == (struct dent *) -1)
+ 		dp->next = NULL;
+ 	    else
+ 		dp->next = &hashtbl [ (int)(dp->next) ];
+ 	    }
+ 	}
+ 
+     for (i = numsflags + numpflags, entry = sflaglist; --i >= 0; entry++)
+ 	{
+ 	if (entry->stripl)
+ 	    entry->strip = (ichar_t *) &hashstrings[(int) entry->strip];
+ 	else
+ 	    entry->strip = NULL;
+ 	if (entry->affl)
+ 	    entry->affix = (ichar_t *) &hashstrings[(int) entry->affix];
+ 	else
+ 	    entry->affix = NULL;
+ 	}
+     /*
+     ** Warning - 'entry' and 'i' are reset in the body of the loop
+     ** below.  Don't try to optimize it by (e.g.) moving the decrement
+     ** of i into the loop condition.
+     */
+     for (i = numsflags, entry = sflaglist;  i > 0;  i--, entry++)
+ 	{
+ 	if (entry->affl == 0)
+ 	    {
+ 	    cp = NULL;
+ 	    ind = &sflagindex[0];
+ 	    viazero = 1;
+ 	    }
+ 	else
+ 	    {
+ 	    cp = entry->affix + entry->affl - 1;
+ 	    ind = &sflagindex[*cp];
+ 	    viazero = 0;
+ 	    while (ind->numents == 0  &&  ind->pu.fp != NULL)
+ 		{
+ 		if (cp == entry->affix)
+ 		    {
+ 		    ind = &ind->pu.fp[0];
+ 		    viazero = 1;
+ 		    }
+ 		else
+ 		    {
+ 		    ind = &ind->pu.fp[*--cp];
+ 		    viazero = 0;
+ 		    }
+ 		}
+ 	    }
+ 	if (ind->numents == 0)
+ 	    ind->pu.ent = entry;
+ 	ind->numents++;
+ 	/*
+ 	** If this index entry has more than MAXSEARCH flags in
+ 	** it, we will split it into subentries to reduce the
+ 	** searching.  However, the split doesn't make sense in
+ 	** two cases:  (a) if we are already at the end of the
+ 	** current affix, or (b) if all the entries in the list
+ 	** have identical affixes.  Since the list is sorted, (b)
+ 	** is true if the first and last affixes in the list
+ 	** are identical.
+ 	*/
+ 	if (!viazero  &&  ind->numents >= MAXSEARCH
+ 	  &&  icharcmp (entry->affix, ind->pu.ent->affix) != 0)
+ 	    {
+ 	    /* Sneaky trick:  back up and reprocess */
+ 	    entry = ind->pu.ent - 1; /* -1 is for entry++ in loop */
+ 	    i = numsflags - (entry - sflaglist);
+ 	    ind->pu.fp =
+ 	      (struct flagptr *)
+ 		calloc ((unsigned) (SET_SIZE + hashheader.nstrchars),
+ 		  sizeof (struct flagptr));
+ 	    if (ind->pu.fp == NULL)
+ 		{
+ 		(void) fprintf (stderr, LOOKUP_C_NO_LANG_SPACE);
+ 		return (-1);
+ 		}
+ 	    ind->numents = 0;
+ 	    }
+ 	}
+     /*
+     ** Warning - 'entry' and 'i' are reset in the body of the loop
+     ** below.  Don't try to optimize it by (e.g.) moving the decrement
+     ** of i into the loop condition.
+     */
+     for (i = numpflags, entry = pflaglist;  i > 0;  i--, entry++)
+ 	{
+ 	if (entry->affl == 0)
+ 	    {
+ 	    cp = NULL;
+ 	    ind = &pflagindex[0];
+ 	    viazero = 1;
+ 	    }
+ 	else
+ 	    {
+ 	    cp = entry->affix;
+ 	    ind = &pflagindex[*cp++];
+ 	    viazero = 0;
+ 	    while (ind->numents == 0  &&  ind->pu.fp != NULL)
+ 		{
+ 		if (*cp == 0)
+ 		    {
+ 		    ind = &ind->pu.fp[0];
+ 		    viazero = 1;
+ 		    }
+ 		else
+ 		    {
+ 		    ind = &ind->pu.fp[*cp++];
+ 		    viazero = 0;
+ 		    }
+ 		}
+ 	    }
+ 	if (ind->numents == 0)
+ 	    ind->pu.ent = entry;
+ 	ind->numents++;
+ 	/*
+ 	** If this index entry has more than MAXSEARCH flags in
+ 	** it, we will split it into subentries to reduce the
+ 	** searching.  However, the split doesn't make sense in
+ 	** two cases:  (a) if we are already at the end of the
+ 	** current affix, or (b) if all the entries in the list
+ 	** have identical affixes.  Since the list is sorted, (b)
+ 	** is true if the first and last affixes in the list
+ 	** are identical.
+ 	*/
+ 	if (!viazero  &&  ind->numents >= MAXSEARCH
+ 	  &&  icharcmp (entry->affix, ind->pu.ent->affix) != 0)
+ 	    {
+ 	    /* Sneaky trick:  back up and reprocess */
+ 	    entry = ind->pu.ent - 1; /* -1 is for entry++ in loop */
+ 	    i = numpflags - (entry - pflaglist);
+ 	    ind->pu.fp =
+ 	      (struct flagptr *) calloc (SET_SIZE + hashheader.nstrchars,
+ 	        sizeof (struct flagptr));
+ 	    if (ind->pu.fp == NULL)
+ 		{
+ 		(void) fprintf (stderr, LOOKUP_C_NO_LANG_SPACE);
+ 		return (-1);
+ 		}
+ 	    ind->numents = 0;
+ 	    }
+ 	}
+ #ifdef INDEXDUMP
+     (void) fprintf (stderr, "Prefix index table:\n");
+     dumpindex (pflagindex, 0);
+     (void) fprintf (stderr, "Suffix index table:\n");
+     dumpindex (sflagindex, 0);
+ #endif
+     if (hashheader.nstrchartype == 0)
+ 	chartypes = NULL;
+     else
+ 	{
+ 	chartypes = (struct strchartype *)
+ 	  malloc (hashheader.nstrchartype * sizeof (struct strchartype));
+ 	if (chartypes == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, LOOKUP_C_NO_LANG_SPACE);
+ 	    return (-1);
+ 	    }
+ 	for (i = 0, nextchar = hashheader.strtypestart;
+ 	  i < hashheader.nstrchartype;
+ 	  i++)
+ 	    {
+ 	    chartypes[i].name = &hashstrings[nextchar];
+ 	    nextchar += strlen (chartypes[i].name) + 1;
+ 	    chartypes[i].deformatter = &hashstrings[nextchar];
+ 	    nextchar += strlen (chartypes[i].deformatter) + 1;
+ 	    chartypes[i].suffixes = &hashstrings[nextchar];
+ 	    while (hashstrings[nextchar] != '\0')
+ 		nextchar += strlen (&hashstrings[nextchar]) + 1;
+ 	    nextchar++;
+ 	    }
+ 	}
+     inited = 1;
+     return (0);
+     }
+ 
+ #ifdef INDEXDUMP
+ static void dumpindex (indexp, depth)
+     register struct flagptr *	indexp;
+     register int		depth;
+     {
+     register int		i;
+     int				j;
+     int				k;
+     char			stripbuf[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4];
+ 
+     for (i = 0;  i < SET_SIZE + hashheader.nstrchars;  i++, indexp++)
+ 	{
+ 	if (indexp->numents == 0  &&  indexp->pu.fp != NULL)
+ 	    {
+ 	    for (j = depth;  --j >= 0;  )
+ 		(void) putc (' ', stderr);
+ 	    if (i >= ' '  &&  i <= '~')
+ 		(void) putc (i, stderr);
+ 	    else
+ 		(void) fprintf (stderr, "0x%x", i);
+ 	    (void) putc ('\n', stderr);
+ 	    dumpindex (indexp->pu.fp, depth + 1);
+ 	    }
+ 	else if (indexp->numents)
+ 	    {
+ 	    for (j = depth;  --j >= 0;  )
+ 		(void) putc (' ', stderr);
+ 	    if (i >= ' '  &&  i <= '~')
+ 		(void) putc (i, stderr);
+ 	    else
+ 		(void) fprintf (stderr, "0x%x", i);
+ 	    (void) fprintf (stderr, " -> %d entries\n", indexp->numents);
+ 	    for (k = 0;  k < indexp->numents;  k++)
+ 		{
+ 		for (j = depth;  --j >= 0;  )
+ 		    (void) putc (' ', stderr);
+ 		if (indexp->pu.ent[k].stripl)
+ 		    {
+ 		    (void) ichartostr (stripbuf, indexp->pu.ent[k].strip,
+ 		      sizeof stripbuf, 1);
+ 		    (void) fprintf (stderr, "     entry %d (-%s,%s)\n",
+ 		      &indexp->pu.ent[k] - sflaglist,
+ 		      stripbuf,
+ 		      indexp->pu.ent[k].affl
+ 			? ichartosstr (indexp->pu.ent[k].affix, 1) : "-");
+ 		    }
+ 		else
+ 		    (void) fprintf (stderr, "     entry %d (%s)\n",
+ 		      &indexp->pu.ent[k] - sflaglist,
+ 		      ichartosstr (indexp->pu.ent[k].affix, 1));
+ 		}
+ 	    }
+ 	}
+     }
+ #endif
+ 
+ /* n is length of s */
+ struct dent * lookup (s, dotree)
+     register ichar_t *		s;
+     int				dotree;
+     {
+     register struct dent *	dp;
+     register char *		s1;
+     char			schar[INPUTWORDLEN + MAXAFFIXLEN];
+ 
+     dp = &hashtbl[hash (s, hashsize)];
+     if (ichartostr (schar, s, sizeof schar, 1))
+ 	(void) fprintf (stderr, WORD_TOO_LONG (schar));
+     for (  ;  dp != NULL;  dp = dp->next)
+ 	{
+ 	/* quick strcmp, but only for equality */
+ 	s1 = dp->word;
+ 	if (s1  &&  s1[0] == schar[0]  &&  strcmp (s1 + 1, schar + 1) == 0)
+ 	    return dp;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 	while (dp->flagfield & MOREVARIANTS)	/* Skip variations */
+ 	    dp = dp->next;
+ #endif
+ 	}
+     if (dotree)
+ 	{
+ 	dp = treelookup (s);
+ 	return dp;
+ 	}
+     else
+ 	return NULL;
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/makedent.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/makedent.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/makedent.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,1112 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+ 	"$Id: makedent.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * Copyright 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: makedent.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:03  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.45  1994/12/27  23:08:52  geoff
+  * Add code to makedent to reject words that contain non-word characters.
+  * This helps protect people who use ISO 8-bit characters when ispell
+  * isn't configured for that option.
+  *
+  * Revision 1.44  1994/10/25  05:46:20  geoff
+  * Fix some incorrect declarations in the lint versions of some routines.
+  *
+  * Revision 1.43  1994/09/16  03:32:34  geoff
+  * Issue an error message for bad affix flags
+  *
+  * Revision 1.42  1994/02/07  04:23:43  geoff
+  * Correctly identify the deformatter when changing file types
+  *
+  * Revision 1.41  1994/01/25  07:11:55  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ 
+ int		makedent P ((char * lbuf, int lbuflen, struct dent * ent));
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ long		whatcap P ((ichar_t * word));
+ #endif
+ int		addvheader P ((struct dent * ent));
+ int		combinecaps P ((struct dent * hdr, struct dent * newent));
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ static void	forcevheader P ((struct dent * hdrp, struct dent * oldp,
+ 		  struct dent * newp));
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ static int	combine_two_entries P ((struct dent * hdrp,
+ 		  struct dent * oldp, struct dent * newp));
+ static int	acoversb P ((struct dent * enta, struct dent * entb));
+ void		upcase P ((ichar_t * string));
+ void		lowcase P ((ichar_t * string));
+ void		chupcase P ((char * s));
+ static int	issubset P ((struct dent * ent1, struct dent * ent2));
+ static void	combineaffixes P ((struct dent * ent1, struct dent * ent2));
+ void		toutent P ((FILE * outfile, struct dent * hent,
+ 		  int onlykeep));
+ static void	toutword P ((FILE * outfile, char * word,
+ 		  struct dent * cent));
+ static void	flagout P ((FILE * outfile, int flag));
+ int		stringcharlen P ((char * bufp, int canonical));
+ int		strtoichar P ((ichar_t * out, char * in, int outlen,
+ 		  int canonical));
+ int		ichartostr P ((char * out, ichar_t * in, int outlen,
+ 		  int canonical));
+ ichar_t *	strtosichar P ((char * in, int canonical));
+ char *		ichartosstr P ((ichar_t * in, int canonical));
+ char *		printichar P ((int in));
+ #ifndef ICHAR_IS_CHAR
+ ichar_t *	icharcpy P ((ichar_t * out, ichar_t * in));
+ int		icharlen P ((ichar_t * str));
+ int		icharcmp P ((ichar_t * s1, ichar_t * s2));
+ int		icharncmp P ((ichar_t * s1, ichar_t * s2, int n));
+ #endif /* ICHAR_IS_CHAR */
+ int		findfiletype P ((char * name, int searchnames,
+ 		  int * deformatter));
+ 
+ static int  	has_marker;
+ 
+ /*
+  * Fill in a directory entry, including setting the capitalization flags, and
+  * allocate and initialize memory for the d->word field.  Returns -1
+  * if there was trouble.  The input word must be in canonical form.
+  */
+ 
+ int makedent (lbuf, lbuflen, d)
+     char *		lbuf;
+     int			lbuflen;
+     struct dent *	d;
+     {
+     ichar_t		ibuf[INPUTWORDLEN + MAXAFFIXLEN];
+     ichar_t *		ip;
+     char *		p;
+     int			bit;
+     int			len;
+ 
+     /* Strip off any trailing newline */
+     len = strlen (lbuf) - 1;
+     if (lbuf[len] == '\n')
+ 	lbuf[len] = '\0';
+ 
+     d->next = NULL;
+     /* WARNING:  flagfield might be the same as mask! See ispell.h. */
+     d->flagfield = 0;
+     (void) bzero ((char *) d->mask, sizeof (d->mask));
+     d->flagfield |= USED;
+     d->flagfield &= ~KEEP;
+ 
+     p = index (lbuf, hashheader.flagmarker);
+     if (p != NULL)
+ 	*p = 0;
+ 
+     /*
+     ** Convert the word to an ichar_t and back;  this makes sure that
+     ** it is in canonical form and thus that the length is correct.
+     */
+     if (strtoichar (ibuf, lbuf, INPUTWORDLEN * sizeof (ichar_t), 1)
+       ||  ichartostr (lbuf, ibuf, lbuflen, 1))
+ 	{
+ 	(void) fprintf (stderr, WORD_TOO_LONG (lbuf));
+ 	return (-1);
+ 	}
+     /*
+     ** Make sure the word is well-formed (contains only legal characters).
+     */
+     for (ip = ibuf;  *ip != 0;  ip++)
+ 	{
+ 	if (!iswordch (*ip))
+ 	    {
+ 	    /* Boundary characters are legal as long as they're not at edges */
+ 	    if (!isboundarych (*ip)
+ 	      ||  ip == ibuf  ||  ip[1] == 0)
+ 		{
+ 		(void) fprintf (stderr, MAKEDENT_C_BAD_WORD_CHAR, lbuf);
+ 		return -1;
+ 		}
+ 	    }
+ 	}
+     len = strlen (lbuf);
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     /*
+     ** Figure out the capitalization rules from the capitalization of
+     ** the sample entry.
+     */
+     d->flagfield |= whatcap (ibuf);
+ #endif
+ 
+     if (len > INPUTWORDLEN - 1)
+ 	{
+ 	(void) fprintf (stderr, WORD_TOO_LONG (lbuf));
+ 	return (-1);
+ 	}
+ 
+     d->word = mymalloc ((unsigned) len + 1);
+     if (d->word == NULL)
+ 	{
+ 	(void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, lbuf);
+ 	return -1;
+ 	}
+ 
+     (void) strcpy (d->word, lbuf);
+ #ifdef NO_CAPITALIZATION_SUPPORT
+     chupcase (d->word);
+ #else /* NO_CAPITALIZATION_SUPPORT */
+     if (captype (d->flagfield) != FOLLOWCASE)
+ 	chupcase (d->word);
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+     if (p == NULL)
+ 	return (0);
+ 
+     p++;
+     while (*p != '\0'  &&  *p != '\n')
+ 	{
+ 	bit = CHARTOBIT ((unsigned char) *p);
+ 	if (bit >= 0  &&  bit <= LARGESTFLAG)
+ 	    SETMASKBIT (d->mask, bit);
+ 	else
+ 	    (void) fprintf (stderr, BAD_FLAG, (unsigned char) *p);
+ 	p++;
+ 	if (*p == hashheader.flagmarker)
+ 	    p++;		/* Handle old-format dictionaries too */
+ 	}
+     return (0);
+     }
+ 
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ /*
+ ** Classify the capitalization of a sample entry.  Returns one of the
+ ** four capitalization codes ANYCASE, ALLCAPS, CAPITALIZED, or FOLLOWCASE.
+ */
+ 
+ long whatcap (word)
+     register ichar_t *	word;
+     {
+     register ichar_t *	p;
+ 
+     for (p = word;  *p;  p++)
+ 	{
+ 	if (mylower (*p))
+ 	    break;
+ 	}
+     if (*p == '\0')
+ 	return ALLCAPS;
+     else
+ 	{
+ 	for (  ;  *p;  p++)
+ 	    {
+ 	    if (myupper (*p))
+ 		break;
+ 	    }
+ 	if (*p == '\0')
+ 	    {
+ 	    /*
+ 	    ** No uppercase letters follow the lowercase ones.
+ 	    ** If there is more than one uppercase letter, it's
+ 	    ** "followcase". If only the first one is capitalized,
+ 	    ** it's "capitalize".  If there are no capitals
+ 	    ** at all, it's ANYCASE.
+ 	    */
+ 	    if (myupper (word[0]))
+ 		{
+ 		for (p = word + 1;  *p != '\0';  p++)
+ 		    {
+ 		    if (myupper (*p))
+ 			return FOLLOWCASE;
+ 		    }
+ 		return CAPITALIZED;
+ 		}
+ 	    else
+ 		return ANYCASE;
+ 	    }
+ 	else
+ 	    return FOLLOWCASE;	/* .../lower/upper */
+ 	}
+     }
+ 
+ /*
+ ** Add a variant-capitalization header to a word.  This routine may be
+ ** called even for a followcase word that doesn't yet have a header.
+ **
+ ** Returns 0 if all was ok, -1 if allocation error.
+ */
+ int addvheader (dp)
+     register struct dent *	dp;	/* Entry to update */
+     {
+     register struct dent *	tdent; /* Copy of entry */
+ 
+     /*
+     ** Add a second entry with the correct capitalization, and then make
+     ** dp into a special dummy entry.
+     */
+     tdent = (struct dent *) mymalloc (sizeof (struct dent));
+     if (tdent == NULL)
+ 	{
+ 	(void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, dp->word);
+ 	return -1;
+ 	}
+     *tdent = *dp;
+     if (captype (tdent->flagfield) != FOLLOWCASE)
+ 	tdent->word = NULL;
+     else
+ 	{
+ 	/* Followcase words need a copy of the capitalization */
+ 	tdent->word = mymalloc ((unsigned int) strlen (tdent->word) + 1);
+ 	if (tdent->word == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, dp->word);
+ 	    myfree ((char *) tdent);
+ 	    return -1;
+ 	    }
+ 	(void) strcpy (tdent->word, dp->word);
+ 	}
+     chupcase (dp->word);
+     dp->next = tdent;
+     dp->flagfield &= ~CAPTYPEMASK;
+     dp->flagfield |= (ALLCAPS | MOREVARIANTS);
+     return 0;
+     }
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 
+ /*
+ ** Combine and resolve the entries describing two capitalizations of the same
+ ** word.  This may require allocating yet more entries.
+ **
+ ** Hdrp is a pointer into a hash table.  If the word covered by hdrp has
+ ** variations, hdrp must point to the header.  Newp is a pointer to temporary
+ ** storage, and space is malloc'ed if newp is to be kept.  The newp->word
+ ** field must have been allocated with mymalloc, so that this routine may free
+ ** the space if it keeps newp but not the word.
+ **
+ ** Return value:  0 if the word was added, 1 if the word was combined
+ ** with an existing entry, and -1 if trouble occurred (e.g., malloc).
+ ** If 1 is returned, newp->word may have been be freed using myfree.
+ **
+ ** Life is made much more difficult by the KEEP flag's possibilities.  We
+ ** must ensure that a !KEEP word doesn't find its way into the personal
+ ** dictionary as a result of this routine's actions.  However, a !KEEP
+ ** word that has affixes must have come from the main dictionary, so it
+ ** is acceptable to combine entries in that case (got that?).
+ **
+ ** The net result of all this is a set of rules that is a bloody pain
+ ** to figure out.  Basically, we want to choose one of the following actions:
+ **
+ **	(1) Add newp's affixes and KEEP flag to oldp, and discard newp.
+ **	(2) Add oldp's affixes and KEEP flag to newp, replace oldp with
+ **	    newp, and discard newp.
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ **	(3) Insert newp as a new entry in the variants list.  If there is
+ **	    currently no variant header, this requires adding one.  Adding a
+ **	    header splits into two sub-cases:
+ **
+ **	    (3a) If oldp is ALLCAPS and the KEEP flags match, just turn it
+ **		into the header.
+ **	    (3b) Otherwise, add a new entry to serve as the header.
+ **		To ease list linking, this is done by copying oldp into
+ **		the new entry, and then performing (3a).
+ **
+ **	    After newp has been added as a variant, its affixes and KEEP
+ **	    flag are OR-ed into the variant header.
+ #endif
+ **
+ ** So how to choose which?  The default is always case (3), which adds newp
+ ** as a new entry in the variants list.  Cases (1) and (2) are symmetrical
+ ** except for which entry is discarded.  We can use case (1) or (2) whenever
+ ** one entry "covers" the other.  "Covering" is defined as follows:
+ **
+ **	(4) For entries with matching capitalization types, A covers B
+ **	    if:
+ **
+ **	    (4a) B's affix flags are a subset of A's, or the KEEP flags
+ **		 match, and
+ **	    (4b) either the KEEP flags match, or A's KEEP flag is set.
+ **		(Since A has more suffixes, combining B with it won't
+ **		cause any extra suffixes to be added to the dictionary.)
+ **	    (4c) If the words are FOLLOWCASE, the capitalizations match
+ **		exactly.
+ **
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ **	(5) For entries with mismatched capitalization types, A covers B
+ **	    if (4a) and (4b) are true, and:
+ **
+ **	    (5a) B is ALLCAPS, or
+ **	    (5b) A is ANYCASE, and B is CAPITALIZED.
+ #endif
+ **
+ ** For any "hdrp" without variants, oldp is the same as hdrp.  Otherwise,
+ ** the above tests are applied using each variant in turn for oldp.
+ */
+ int combinecaps (hdrp, newp)
+     struct dent *	hdrp;	/* Header of entry currently in dictionary */
+     register struct dent *
+ 			newp;	/* Entry to add */
+     {
+     register struct dent *
+ 			oldp;	/* Current "oldp" entry */
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     register struct dent *
+ 			tdent; /* Entry we'll add to the dictionary */
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+     register int	retval = 0; /* Return value from combine_two_entries */
+ 
+     /*
+     ** First, see if we can combine the two entries (cases 1 and 2).  If
+     ** combine_two_entries does so, it will return 1.  If it has trouble,
+     ** it will return zero.
+     */
+     oldp = hdrp;
+ #ifdef NO_CAPITALIZATION_SUPPORT
+     retval = combine_two_entries (hdrp, oldp, newp);
+ #else /* NO_CAPITALIZATION_SUPPORT */
+     if ((oldp->flagfield & (CAPTYPEMASK | MOREVARIANTS))
+       == (ALLCAPS | MOREVARIANTS))
+ 	{
+ 	while (oldp->flagfield & MOREVARIANTS)
+ 	    {
+ 	    oldp = oldp->next;
+ 	    retval = combine_two_entries (hdrp, oldp, newp);
+ 	    if (retval != 0)		/* Did we combine them? */
+ 		break;
+ 	    }
+ 	}
+     else
+ 	retval = combine_two_entries (hdrp, oldp, newp);
+     if (retval == 0)
+ 	{
+ 	/*
+ 	** Couldn't combine the two entries.  Add a new variant.  For
+ 	** ease, we'll stick it right behind the header, rather than
+ 	** at the end of the list.
+ 	*/
+ 	forcevheader (hdrp, oldp, newp);
+ 	tdent = (struct dent *) mymalloc (sizeof (struct dent));
+ 	if (tdent == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, MAKEDENT_C_NO_WORD_SPACE, newp->word);
+ 	    return -1;
+ 	    }
+ 	*tdent = *newp;
+ 	tdent->next = hdrp->next;
+ 	hdrp->next = tdent;
+ 	tdent->flagfield |= (hdrp->flagfield & MOREVARIANTS);
+ 	hdrp->flagfield |= MOREVARIANTS;
+ 	combineaffixes (hdrp, newp);
+ 	hdrp->flagfield |= (newp->flagfield & KEEP);
+ 	if (captype (newp->flagfield) == FOLLOWCASE)
+ 	    tdent->word = newp->word;
+ 	else
+ 	    {
+ 	    tdent->word = NULL;
+ 	    myfree (newp->word);		/* newp->word isn't needed */
+ 	    }
+ 	}
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+     return retval;
+     }
+ 
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ /*
+ ** The following routine implements steps 3a and 3b in the commentary
+ ** for "combinecaps".
+ */
+ static void forcevheader (hdrp, oldp, newp)
+     register struct dent *	hdrp;
+     struct dent *		oldp;
+     struct dent *		newp;
+     {
+ 
+     if ((hdrp->flagfield & (CAPTYPEMASK | MOREVARIANTS)) == ALLCAPS
+       &&  ((oldp->flagfield ^ newp->flagfield) & KEEP) == 0)
+ 	return;			/* Caller will set MOREVARIANTS */
+     else if ((hdrp->flagfield & (CAPTYPEMASK | MOREVARIANTS))
+       != (ALLCAPS | MOREVARIANTS))
+ 	(void) addvheader (hdrp);
+     }
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 
+ /*
+ ** This routine implements steps 4 and 5 of the commentary for "combinecaps".
+ **
+ ** Returns 1 if newp can be discarded, 0 if nothing done.
+ */
+ static int combine_two_entries (hdrp, oldp, newp)
+     struct dent *	hdrp;	/* (Possible) header of variant chain */
+     register struct dent *
+ 			oldp;	/* Pre-existing dictionary entry */
+     register struct dent *
+ 			newp;	/* Entry to possibly combine */
+     {
+ 
+     if (acoversb (oldp, newp))
+ 	{
+ 	/* newp is superfluous.  Drop it, preserving affixes and keep flag */
+ 	combineaffixes (oldp, newp);
+ 	oldp->flagfield |= (newp->flagfield & KEEP);
+ 	hdrp->flagfield |= (newp->flagfield & KEEP);
+ 	myfree (newp->word);
+ 	return 1;
+ 	}
+     else if (acoversb (newp, oldp))
+ 	{
+ 	/*
+ 	** oldp is superfluous.  Replace it with newp, preserving affixes and
+ 	** the keep flag.
+ 	*/
+ 	combineaffixes (newp, oldp);
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ 	newp->flagfield |= (oldp->flagfield & KEEP);
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ 	newp->flagfield |= (oldp->flagfield & (KEEP | MOREVARIANTS));
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 	hdrp->flagfield |= (newp->flagfield & KEEP);
+ 	newp->next = oldp->next;
+ 	/*
+ 	** We really want to free oldp->word, but that might be part of
+ 	** "hashstrings".  So we'll futz around to arrange things so we can
+ 	** free newp->word instead.  This depends very much on the fact
+ 	** that both words are the same length.
+ 	*/
+ 	if (oldp->word != NULL)
+ 	    (void) strcpy (oldp->word, newp->word);
+ 	myfree (newp->word);	/* No longer needed */
+ 	newp->word = oldp->word;
+ 	*oldp = *newp;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 	/* We may need to add a header if newp is followcase */
+ 	if (captype (newp->flagfield) == FOLLOWCASE
+ 	  &&  (hdrp->flagfield & (CAPTYPEMASK | MOREVARIANTS))
+ 	    != (ALLCAPS | MOREVARIANTS))
+ 	    (void) addvheader (hdrp);
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 	return 1;
+ 	}
+     else
+ 	return 0;
+     }
+ 
+ /*
+ ** Determine if enta covers entb, according to the rules in steps 4 and 5
+ ** of the commentary for "combinecaps".
+ */
+ static int acoversb (enta, entb)
+     register struct dent *	enta;	/* "A" in the rules */
+     register struct dent *	entb;	/* "B" in the rules */
+     {
+     int				subset;	/* NZ if entb is a subset of enta */
+ 
+     if ((subset = issubset (entb, enta)) != 0)
+ 	{
+ 	/* entb is a subset of enta;  thus enta might cover entb */
+ 	if (((enta->flagfield ^ entb->flagfield) & KEEP) != 0
+ 	  &&  (enta->flagfield & KEEP) == 0)	/* Inverse of condition (4b) */
+ 	    return 0;
+ 	}
+     else
+ 	{
+ 	/* not a subset;  KEEP flags must match exactly (both (4a) and (4b)) */
+ 	if (((enta->flagfield ^ entb->flagfield) & KEEP) != 0)
+ 	    return 0;
+ 	}
+ 
+     /* Rules (4a) and (4b) are satisfied;  check for capitalization match */
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ #ifdef lint
+     return subset;				/* Just so it gets used */
+ #else /* lint */
+     return 1;					/* All words match */
+ #endif /* lint */
+ #else /* NO_CAPITALIZATION_SUPPORT */
+     if (((enta->flagfield ^ entb->flagfield) & CAPTYPEMASK) == 0)
+ 	{
+ 	if (captype (enta->flagfield) != FOLLOWCASE	/* Condition (4c) */
+ 	  ||  strcmp (enta->word, entb->word) == 0)
+ 	    return 1;				/* Perfect match */
+ 	else
+ 	    return 0;
+ 	}
+     else if (subset == 0)			/* No flag subset, refuse */
+ 	return 0;				/* ..near matches */
+     else if (captype (entb->flagfield) == ALLCAPS)
+ 	return 1;
+     else if (captype (enta->flagfield) == ANYCASE
+       &&  captype (entb->flagfield) == CAPITALIZED)
+ 	return 1;
+     else
+ 	return 0;
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+     }
+ 
+ void upcase (s)
+     register ichar_t *	s;
+     {
+ 
+     while (*s)
+ 	{
+ 	*s = mytoupper (*s);
+ 	s++;
+ 	}
+     }
+ 
+ void lowcase (s)
+     register ichar_t *	s;
+     {
+ 
+     while (*s)
+ 	{
+ 	*s = mytolower (*s);
+ 	s++;
+ 	}
+     }
+ 
+ /*
+  * Upcase variant that works on normal strings.  Note that it is a lot
+  * slower than the normal upcase.  The input must be in canonical form.
+  */
+ void chupcase (s)
+     char *	s;
+     {
+     ichar_t *	is;
+ 
+     is = strtosichar (s, 1);
+     upcase (is);
+     (void) ichartostr (s, is, strlen (s) + 1, 1);
+     }
+ 
+ /*
+ ** See if one affix field is a subset of another.  Returns NZ if ent1
+ ** is a subset of ent2.  The KEEP flag is not taken into consideration.
+ */
+ static int issubset (ent1, ent2)
+     register struct dent *	ent1;
+     register struct dent *	ent2;
+     {
+ /* The following is really testing for MASKSIZE > 1, but cpp can't do that */
+ #if MASKBITS > 32
+     register int		flagword;
+ 
+ #ifdef FULLMASKSET
+ #define MASKMAX	MASKSIZE
+ #else
+ #define MASKMAX	MASKSIZE - 1
+ #endif /* FULLMASKSET */
+     for (flagword = MASKMAX;  --flagword >= 0;  )
+ 	{
+ 	if ((ent1->mask[flagword] & ent2->mask[flagword])
+ 	  != ent1->mask[flagword])
+ 	    return 0;
+ 	}
+ #endif /* MASKBITS > 32 */
+ #ifdef FULLMASKSET
+     return ((ent1->mask[MASKSIZE - 1] & ent2->mask[MASKSIZE - 1])
+       == ent1->mask[MASKSIZE - 1]);
+ #else
+     if (((ent1->mask[MASKSIZE - 1] & ent2->mask[MASKSIZE - 1])
+       ^ ent1->mask[MASKSIZE - 1]) & ~ALLFLAGS)
+ 	return 0;
+     else
+ 	return 1;
+ #endif /* FULLMASKSET */
+     }
+ 
+ /*
+ ** Add ent2's affix flags to ent1.
+ */
+ static void combineaffixes (ent1, ent2)
+     register struct dent *	ent1;
+     register struct dent *	ent2;
+     {
+ /* The following is really testing for MASKSIZE > 1, but cpp can't do that */
+ #if MASKBITS > 32
+     register int		flagword;
+ 
+     if (ent1 == ent2)
+ 	return;
+     /* MASKMAX is defined in issubset, just above */
+     for (flagword = MASKMAX;  --flagword >= 0;  )
+ 	ent1->mask[flagword] |= ent2->mask[flagword];
+ #endif /* MASKBITS > 32 */
+ #ifndef FULLMASKSET
+     ent1->mask[MASKSIZE - 1] |= ent2->mask[MASKSIZE - 1] & ~ALLFLAGS;
+ #endif
+     }
+ 
+ /*
+ ** Write out a dictionary entry, including capitalization variants.
+ ** If onlykeep is true, only those variants with KEEP set will be
+ ** written.
+ */
+ void toutent (toutfile, hent, onlykeep)
+     register FILE *	toutfile;
+     struct dent *	hent;
+     register int	onlykeep;
+     {
+ #ifdef NO_CAPITALIZATION_SUPPORT
+     if (!onlykeep  ||  (hent->flagfield & KEEP))
+ 	toutword (toutfile, hent->word, hent);
+ #else
+     register struct dent * cent;
+     ichar_t		wbuf[INPUTWORDLEN + MAXAFFIXLEN];
+ 
+     cent = hent;
+     if (strtoichar (wbuf, cent->word, INPUTWORDLEN, 1))
+ 	(void) fprintf (stderr, WORD_TOO_LONG (cent->word));
+     for (  ;  ;  )
+ 	{
+ 	if (!onlykeep  ||  (cent->flagfield & KEEP))
+ 	    {
+ 	    switch (captype (cent->flagfield))
+ 		{
+ 		case ANYCASE:
+ 		    lowcase (wbuf);
+ 		    toutword (toutfile, ichartosstr (wbuf, 1), cent);
+ 		    break;
+ 		case ALLCAPS:
+ 		    if ((cent->flagfield & MOREVARIANTS) == 0
+ 		      ||  cent != hent)
+ 			{
+ 			upcase (wbuf);
+ 			toutword (toutfile, ichartosstr (wbuf, 1), cent);
+ 			}
+ 		    break;
+ 		case CAPITALIZED:
+ 		    lowcase (wbuf);
+ 		    wbuf[0] = mytoupper (wbuf[0]);
+ 		    toutword (toutfile, ichartosstr (wbuf, 1), cent);
+ 		    break;
+ 		case FOLLOWCASE:
+ 		    toutword (toutfile, cent->word, cent);
+ 		    break;
+ 		}
+ 	    }
+ 	if (cent->flagfield & MOREVARIANTS)
+ 	    cent = cent->next;
+ 	else
+ 	    break;
+ 	}
+ #endif
+     }
+ 		
+ static void toutword (toutfile, word, cent)
+     register FILE *	toutfile;
+     char *		word;
+     register struct dent * cent;
+     {
+     register int	bit;
+ 
+     has_marker = 0;
+     (void) fprintf (toutfile, "%s", word);
+     for (bit = 0;  bit < LARGESTFLAG;  bit++)
+ 	{
+ 	if (TSTMASKBIT (cent->mask, bit))
+ 	  flagout (toutfile, BITTOCHAR (bit));
+ 	}
+     (void) fprintf (toutfile, "\n");
+     }
+ 
+ static void flagout (toutfile, flag)
+     register FILE *	toutfile;
+     int			flag;
+     {
+     if (!has_marker)
+ 	(void) putc (hashheader.flagmarker, toutfile);
+     has_marker = 1;
+     (void) putc (flag, toutfile);
+     }
+ 
+ /*
+  * If the string under the given pointer begins with a string character,
+  * return the length of that "character".  If not, return 0.
+  * May be called any time, but it's best if "isstrstart" is first
+  * used to filter out unnecessary calls.
+  *
+  * As a side effect, "laststringch" is set to the number of the string
+  * found, or to -1 if none was found.  This can be useful for such things
+  * as case conversion.
+  */
+ int stringcharlen (bufp, canonical)
+     char *		bufp;
+     int			canonical;	/* NZ if input is in canonical form */
+     {
+ #ifdef SLOWMULTIPLY
+     static char *	sp[MAXSTRINGCHARS];
+     static int		inited = 0;
+ #endif /* SLOWMULTIPLY */
+     register char *	bufcur;
+     register char *	stringcur;
+     register int	stringno;
+     register int	lowstringno;
+     register int	highstringno;
+     int			dupwanted;
+ 
+ #ifdef SLOWMULTIPLY
+     if (!inited)
+ 	{
+ 	inited = 1;
+ 	for (stringno = 0;  stringno < MAXSTRINGCHARS;  stringno++)
+ 	    sp[stringno] = &hashheader.stringchars[stringno][0];
+ 	}
+ #endif /* SLOWMULTIPLY */
+     lowstringno = 0;
+     highstringno = hashheader.nstrchars - 1;
+     dupwanted = canonical ? 0 : defdupchar;
+     while (lowstringno <= highstringno)
+ 	{
+ 	stringno = (lowstringno + highstringno) >> 1;
+ #ifdef SLOWMULTIPLY
+ 	stringcur = sp[stringno];
+ #else /* SLOWMULTIPLY */
+ 	stringcur = &hashheader.stringchars[stringno][0];
+ #endif /* SLOWMULTIPLY */
+ 	bufcur = bufp;
+ 	while (*stringcur)
+ 	    {
+ #ifdef NO8BIT
+ 	    if (((*bufcur++ ^ *stringcur) & 0x7F) != 0)
+ #else /* NO8BIT */
+ 	    if (*bufcur++ != *stringcur)
+ #endif /* NO8BIT */
+ 		break;
+ 	    /*
+ 	    ** We can't use autoincrement above because of the
+ 	    ** test below.
+ 	    */
+ 	    stringcur++;
+ 	    }
+ 	if (*stringcur == '\0')
+ 	    {
+ 	    if (hashheader.dupnos[stringno] == dupwanted)
+ 		{
+ 		/* We have a match */
+ 		laststringch = hashheader.stringdups[stringno];
+ #ifdef SLOWMULTIPLY
+ 		return stringcur - sp[stringno];
+ #else /* SLOWMULTIPLY */
+ 		return stringcur - &hashheader.stringchars[stringno][0];
+ #endif /* SLOWMULTIPLY */
+ 		}
+ 	    else
+ 		--stringcur;
+ 	    }
+ 	/* No match - choose which side to search on */
+ #ifdef NO8BIT
+ 	if ((*--bufcur & 0x7F) < (*stringcur & 0x7F))
+ 	    highstringno = stringno - 1;
+ 	else if ((*bufcur & 0x7F) > (*stringcur & 0x7F))
+ 	    lowstringno = stringno + 1;
+ #else /* NO8BIT */
+ 	if (*--bufcur < *stringcur)
+ 	    highstringno = stringno - 1;
+ 	else if (*bufcur > *stringcur)
+ 	    lowstringno = stringno + 1;
+ #endif /* NO8BIT */
+ 	else if (dupwanted < hashheader.dupnos[stringno])
+ 	    highstringno = stringno - 1;
+ 	else
+ 	    lowstringno = stringno + 1;
+ 	}
+     laststringch = -1;
+     return 0;			/* Not a string character */
+     }
+ 
+ /*
+  * Convert an external string to an ichar_t string.  If necessary, the parity
+  * bit is stripped off as part of the process.
+  *
+  * Returns NZ if the output string overflowed.
+  */
+ int strtoichar (out, in, outlen, canonical)
+     register ichar_t *	out;		/* Where to put result */
+     register char *	in;		/* String to convert */
+     int			outlen;		/* Size of output buffer, *BYTES* */
+     int			canonical;	/* NZ if input is in canonical form */
+     {
+     register int	len;		/* Length of next character */
+ 
+     outlen /= sizeof (ichar_t);		/* Convert to an ichar_t count */
+     for (  ;  --outlen > 0  &&  *in != '\0';  in += len)
+ 	{
+ 	if (l1_isstringch (in, len, canonical))
+ 	    *out++ = SET_SIZE + laststringch;
+ 	else
+ 	    *out++ = *in & NOPARITY;
+ 	}
+     *out = 0;
+     return outlen <= 0;
+     }
+ 
+ /*
+  * Convert an ichar_t string to an external string.
+  *
+  * WARNING: the resulting string may wind up being longer than the
+  * original.  In fact, even the sequence strtoichar->ichartostr may
+  * produce a result longer than the original, because the output form
+  * may use a different string type set than the original input form.
+  *
+  * Returns NZ if the output string overflowed.
+  */
+ int ichartostr (out, in, outlen, canonical)
+     register char *	out;		/* Where to put result */
+     register ichar_t *	in;		/* String to convert */
+     int			outlen;		/* Size of output buffer, bytes */
+     int			canonical;	/* NZ for canonical form */
+     {
+     register int	ch;		/* Next character to store */
+     register int	i;		/* Index into duplicates list */
+     register char *	scharp;		/* Pointer into a string char */
+ 
+     while (--outlen > 0  &&  (ch = *in++) != 0)
+ 	{
+ 	if (ch < SET_SIZE)
+ 	    *out++ = (char) ch;
+ 	else
+ 	    {
+ 	    ch -= SET_SIZE;
+ 	    if (!canonical)
+ 		{
+ 		for (i = hashheader.nstrchars;  --i >= 0;  )
+ 		    {
+ 		    if (hashheader.dupnos[i] == defdupchar
+ 		      &&  hashheader.stringdups[i] == ch)
+ 			{
+ 			ch = i;
+ 			break;
+ 			}
+ 		    }
+ 		}
+ 	    scharp = hashheader.stringchars[(unsigned) ch];
+ 	    while ((*out++ = *scharp++) != '\0')
+ 		;
+ 	    out--;
+ 	    }
+ 	}
+     *out = '\0';
+     return outlen <= 0;
+     }
+ 
+ /*
+  * Convert a string to an ichar_t, storing the result in a static area.
+  */
+ ichar_t * strtosichar (in, canonical)
+     char *		in;		/* String to convert */
+     int			canonical;	/* NZ if input is in canonical form */
+     {
+     static ichar_t	out[STRTOSICHAR_SIZE / sizeof (ichar_t)];
+ 
+     if (strtoichar (out, in, sizeof out, canonical))
+ 	(void) fprintf (stderr, WORD_TOO_LONG (in));
+     return out;
+     }
+ 
+ /*
+  * Convert an ichar_t to a string, storing the result in a static area.
+  */
+ char * ichartosstr (in, canonical)
+     ichar_t *		in;		/* Internal string to convert */
+     int			canonical;	/* NZ for canonical conversion */
+     {
+     static char		out[ICHARTOSSTR_SIZE];
+ 
+     if (ichartostr (out, in, sizeof out, canonical))
+ 	(void) fprintf (stderr, WORD_TOO_LONG (out));
+     return out;
+     }
+ 
+ /*
+  * Convert a single ichar to a printable string, storing the result in
+  * a static area.
+  */
+ char * printichar (in)
+     int			in;
+     {
+     static char		out[MAXSTRINGCHARLEN + 1];
+ 
+     if (in < SET_SIZE)
+ 	{
+ 	out[0] = (char) in;
+ 	out[1] = '\0';
+ 	}
+     else
+ 	(void) strcpy (out, hashheader.stringchars[(unsigned) in - SET_SIZE]);
+     return out;
+     }
+ 
+ #ifndef ICHAR_IS_CHAR
+ /*
+  * Copy an ichar_t.
+  */
+ ichar_t * icharcpy (out, in)
+     register ichar_t *	out;		/* Destination */
+     register ichar_t *	in;		/* Source */
+     {
+     ichar_t *		origout;	/* Copy of destination for return */
+ 
+     origout = out;
+     while ((*out++ = *in++) != 0)
+ 	;
+     return origout;
+     }
+ 
+ /*
+  * Return the length of an ichar_t.
+  */
+ int icharlen (in)
+     register ichar_t *	in;		/* String to count */
+     {
+     register int	len;		/* Length so far */
+ 
+     for (len = 0;  *in++ != 0;  len++)
+ 	;
+     return len;
+     }
+ 
+ /*
+  * Compare two ichar_t's.
+  */
+ int icharcmp (s1, s2)
+     register ichar_t *	s1;
+     register ichar_t *	s2;
+     {
+ 
+     while (*s1 != 0)
+ 	{
+ 	if (*s1++ != *s2++)
+ 	    return *--s1 - *--s2;
+ 	}
+     return *s1 - *s2;
+     }
+ 
+ /*
+  * Strncmp for two ichar_t's.
+  */
+ int icharncmp (s1, s2, n)
+     register ichar_t *	s1;
+     register ichar_t *	s2;
+     register int	n;
+     {
+ 
+     while (--n >= 0  &&  *s1 != 0)
+ 	{
+ 	if (*s1++ != *s2++)
+ 	    return *--s1 - *--s2;
+ 	}
+     if (n < 0)
+ 	return 0;
+     else
+ 	return *s1 - *s2;
+     }
+ 
+ #endif /* ICHAR_IS_CHAR */
+ 
+ int findfiletype (name, searchnames, deformatter)
+     char *		name;		/* Name to look up in suffix table */
+     int			searchnames;	/* NZ to search name field of table */
+     int *		deformatter;	/* Where to set deformatter type */
+     {
+     char *		cp;		/* Pointer into suffix list */
+     int			cplen;		/* Length of current suffix */
+     register int	i;		/* Index into type table */
+     int			len;		/* Length of the name */
+ 
+     /*
+      * Note:  for now, the deformatter is set to 1 for tex, 0 for nroff.
+      * Further, we assume that it's one or the other, so that a test
+      * for tex is sufficient.  This needs to be generalized.
+      */
+     len = strlen (name);
+     if (searchnames)
+ 	{
+ 	for (i = 0;  i < hashheader.nstrchartype;  i++)
+ 	    {
+ 	    if (strcmp (name, chartypes[i].name) == 0)
+ 		{
+ 		if (deformatter != NULL)
+ 		    *deformatter =
+ 		      (strcmp (chartypes[i].deformatter, "tex") == 0);
+ 		return i;
+ 		}
+ 	    }
+ 	}
+     for (i = 0;  i < hashheader.nstrchartype;  i++)
+ 	{
+ 	for (cp = chartypes[i].suffixes;  *cp != '\0';  cp += cplen + 1)
+ 	    {
+ 	    cplen = strlen (cp);
+ 	    if (len >= cplen  &&  strcmp (&name[len - cplen], cp) == 0)
+ 		{
+ 		if (deformatter != NULL)
+ 		    *deformatter =
+ 		      (strcmp (chartypes[i].deformatter, "tex") == 0);
+ 		return i;
+ 		}
+ 	    }
+ 	}
+     return -1;
+     }
+ 
+ /*
+  * The following routines are all dummies for the benefit of lint.
+  */
+ #ifdef lint
+ int TSTMASKBIT (mask, bit) MASKTYPE * mask; int bit;
+     { return bit + (int) *mask; }
+ void CLRMASKBIT (mask, bit) MASKTYPE * mask; int bit; { bit += (int) *mask; }
+ void SETMASKBIT (mask, bit) MASKTYPE * mask; int bit; { bit += (int) *mask; }
+ int BITTOCHAR (bit) int bit; { return bit; }
+ int CHARTOBIT (ch) int ch; { return ch; }
+ int myupper (ch) unsigned int ch; { return (int) ch; }
+ int mylower (ch) unsigned int ch; { return (int) ch; }
+ int myspace (ch) unsigned int ch; { return (int) ch; }
+ int iswordch (ch) unsigned int ch; { return (int) ch; }
+ int isboundarych (ch) unsigned int ch; { return (int) ch; }
+ int isstringstart (ch) unsigned int ch; { return ch; }
+ ichar_t mytolower (ch) unsigned int ch; { return (ichar_t) ch; }
+ ichar_t mytoupper (ch) unsigned int ch; { return (ichar_t) ch; }
+ #endif /* lint */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/msgs.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/msgs.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/msgs.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,281 ----
+ /*
+  * $Id: msgs.h,v 1.1 2007/01/09 23:57:18 lattner Exp $
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  *
+  */
+ 
+ /*
+  * Messages header file.
+  *
+  * This file contains all text strings that are written by any of the
+  * C programs in the ispell package.  The strings are collected here so that
+  * you can have the option of translating them into your local language for
+  * the benefit of your users.
+  *
+  * Anyone who goes to the effort of making a translation may wish to return
+  * the translated strings to me, geoff at ITcorp.com, so that I can include
+  * them in a later distribution under #ifdef control.
+  *
+  * Besides the strings in this header file, you may also want to translate
+  * the strings in version.h, which give the version and copyright information.
+  * However, any translation of these strings MUST accurately preserve the
+  * legal rights under international law;  you may wish to consult a lawyer
+  * about this since you will be responsible for the results of any
+  * incorrect translation.
+  *
+  * Most of the strings below are simple printf format strings.  If the printf
+  * takes more than one parameter, the string is given as a parameterized
+  * macro in case your local language needs a different word order.
+  */
+ 
+ /*
+  * $Log: msgs.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:03  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.31  1994/12/27  23:08:57  geoff
+  * Add a message to be issued if a word contains illegal characters.
+  *
+  * Revision 1.30  1994/10/25  05:46:40  geoff
+  * Improve a couple of error messages relating to affix flags.
+  *
+  * Revision 1.29  1994/10/04  03:46:23  geoff
+  * Add a missing carriage return in the help message
+  *
+  * Revision 1.28  1994/09/16  05:07:00  geoff
+  * Add the BAD_FLAG message, and start a sentence in another message with
+  * an uppercase letter.
+  *
+  * Revision 1.27  1994/07/28  05:11:38  geoff
+  * Log message for previous revision: add BHASH_C_ZERO_COUNT.
+  *
+  * Revision 1.26  1994/07/28  04:53:49  geoff
+  *
+  * Revision 1.25  1994/05/24  04:54:36  geoff
+  * Add error messages for affix-flag checking.
+  *
+  * Revision 1.24  1994/01/25  07:12:42  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ /*
+  * The following strings are used in numerous places:
+  */
+ #define BAD_FLAG	"\r\nIllegal affix flag character '%c'\r\n"
+ #define CANT_OPEN	"Can't open %s\r\n"
+ #define CANT_CREATE	"Can't create %s\r\n"
+ #define WORD_TOO_LONG(w) "\r\nWord '%s' too long at line %d of %s, truncated\r\n", \
+ 			  w, __LINE__, __FILE__
+ 
+ /*
+  * The following strings are used in buildhash.c:
+  */
+ #define BHASH_C_NO_DICT		"No dictionary (%s)\n"
+ #define BHASH_C_NO_COUNT	"No count file\n"
+ #define BHASH_C_BAD_COUNT	"Bad count file\n"
+ #define BHASH_C_ZERO_COUNT	"No words in dictionary\n"
+     /* I think this message looks better when it's nearly 80 characters wide,
+      * thus the ugly formatting in the next two defines.  GK 9-87 */
+ #define BHASH_C_BAFF_1(max, excess) \
+   "    Warning:  this language table may exceed the maximum total affix length\nof %d by up to %d bytes.  You should either increase MAXAFFIXLEN in config.X\nor shorten your largest affix/strip string difference.  (This is the\n", \
+ 				  max, excess
+ #define BHASH_C_BAFF_2 \
+   "difference between the affix length and the strip length in a given\nreplacement rule, or the affix length if there is no strip string\nin that rule.)\n"
+ #define BHASH_C_OVERFLOW	"Hash table overflowed by %d words\n"
+ #define BHASH_C_CANT_OPEN_DICT "Can't open dictionary\n"
+ #define BHASH_C_NO_SPACE	"Couldn't allocate hash table\n"
+ #define BHASH_C_COLLISION_SPACE "\ncouldn't allocate space for collision\n"
+ #define BHASH_C_COUNTING	"Counting words in dictionary ...\n"
+ #define BHASH_C_WORD_COUNT	"\n%d words\n"
+ #define BHASH_C_USAGE		"Usage:  buildhash [-s] dict-file aff-file hash-file\n\tbuildhash -c count aff-file\n"
+ 
+ /*
+  * The following strings are used in correct.c:
+  */
+ #define CORR_C_HELP_1		"Whenever a word is found that is not in the dictionary,\r\n"
+ #define CORR_C_HELP_2		"it is printed on the first line of the screen.  If the dictionary\r\n"
+ #define CORR_C_HELP_3		"contains any similar words, they are listed with a number\r\n"
+ #define CORR_C_HELP_4		"next to each one.  You have the option of replacing the word\r\n"
+ #define CORR_C_HELP_5		"completely, or choosing one of the suggested words.\r\n"
+     /* You may add HELP_6 through HELP_9 if your language needs more lines */
+ #define CORR_C_HELP_6		""
+ #define CORR_C_HELP_7		""
+ #define CORR_C_HELP_8		""
+ #define CORR_C_HELP_9		""
+ #define CORR_C_HELP_COMMANDS	"\r\nCommands are:\r\n\r\n"
+ #define CORR_C_HELP_R_CMD	"R       Replace the misspelled word completely.\r\n"
+ #define CORR_C_HELP_BLANK	"Space   Accept the word this time only.\r\n"
+ #define CORR_C_HELP_A_CMD	"A       Accept the word for the rest of this session.\r\n"
+ #define CORR_C_HELP_I_CMD	"I       Accept the word, and put it in your private dictionary.\r\n"
+ #define CORR_C_HELP_U_CMD	"U       Accept and add lowercase version to private dictionary.\r\n"
+ #define CORR_C_HELP_0_CMD	"0-n     Replace with one of the suggested words.\r\n"
+ #define CORR_C_HELP_L_CMD	"L       Look up words in system dictionary.\r\n"
+ #define CORR_C_HELP_X_CMD	"X       Write the rest of this file, ignoring misspellings,\r\n        and start next file.\r\n"
+ #define CORR_C_HELP_Q_CMD	"Q       Quit immediately.  Asks for confirmation.\r\n        Leaves file unchanged.\r\n"
+ #define CORR_C_HELP_BANG	"!       Shell escape.\r\n"
+ #define CORR_C_HELP_REDRAW	"^L      Redraw screen.\r\n"
+ #define CORR_C_HELP_SUSPEND	"^Z      Suspend program.\r\n"
+ #define CORR_C_HELP_HELP	"?       Show this help screen.\r\n"
+ #define CORR_C_HELP_TYPE_SPACE	"-- Type space to continue --"
+ 
+ #define CORR_C_FILE_LABEL	"              File: %s"
+ #define CORR_C_READONLY		"[READONLY]"
+ #define CORR_C_MINI_MENU	"[SP] <number> R)epl A)ccept I)nsert L)ookup U)ncap Q)uit e(X)it or ? for help\r\n"
+ #define CORR_C_CONFIRM_QUIT	"Are you sure you want to throw away your changes? "
+ #define CORR_C_REPLACE_WITH	"Replace with: "
+ #define CORR_C_LOOKUP_PROMPT	"Lookup string ('*' is wildcard): "
+ #define CORR_C_MORE_PROMPT	"-- more --"
+ #define CORR_C_BLANK_MORE	"\r           \r"
+ #define CORR_C_END_LOOK		"--end--"
+ 
+ /*
+  * The following strings are used in defmt.c:
+  */
+ #define DEFMT_C_TEX_MATH_ERROR	"****ERROR in parsing TeX math mode!\r\n"
+ #define DEFMT_C_LR_MATH_ERROR	"***ERROR in LR to math-mode switch.\n"
+ 
+ /*
+  * The following strings are used in icombine.c:
+  */
+ #define ICOMBINE_C_BAD_TYPE	"icombine:  unrecognized formatter type '%s'\n"
+ #define ICOMBINE_C_USAGE	"Usage:  icombine [-T suffix] [aff-file] < wordlist\n"
+ 
+ /*
+  * The following strings are used in ispell.c:
+  */
+ #define ISPELL_C_USAGE1		"Usage: %s [-dfile | -pfile | -wchars | -Wn | -t | -n | -x | -b | -S | -B | -C | -P | -m | -Lcontext | -M | -N | -Ttype | -V] file .....\n"
+ #define ISPELL_C_USAGE2		"       %s [-dfile | -pfile | -wchars | -Wn | -t | -n | -Ttype] -l\n"
+ #ifndef USG
+ #define ISPELL_C_USAGE3		"       %s [-dfile | -pfile | -ffile | -Wn | -t | -n | -s | -B | -C | -P | -m | -Ttype] {-a | -A}\n"
+ #else
+ #define ISPELL_C_USAGE3		"       %s [-dfile | -pfile | -ffile | -Wn | -t | -n | -B | -C | -P | -m | -Ttype] {-a | -A}\n"
+ #endif
+ #define ISPELL_C_USAGE4		"       %s [-dfile] [-wchars | -Wn] -c\n"
+ #define ISPELL_C_USAGE5		"       %s [-dfile] [-wchars] -e[1-4]\n"
+ #define ISPELL_C_USAGE6		"       %s [-dfile] [-wchars] -D\n"
+ #define ISPELL_C_USAGE7		"       %s -v\n"
+ #define ISPELL_C_TEMP_DISAPPEARED "temporary file disappeared (%s)\r\n"
+ #define ISPELL_C_BAD_TYPE	"ispell:  unrecognized formatter type '%s'\n"
+ #define ISPELL_C_NO_FILE	"ispell:  specified file does not exist\n"
+ #define ISPELL_C_NO_FILES	"ispell:  specified files do not exist\n"
+ #define ISPELL_C_CANT_WRITE	"Warning:  Can't write to %s\r\n"
+ #define ISPELL_C_OPTIONS_ARE	"Compiled-in options:\n"
+ 
+ /*
+  * The following strings are used in lookup.c:
+  */
+ #define LOOKUP_C_CANT_READ	"Trouble reading hash table %s\r\n"
+ #define LOOKUP_C_NULL_HASH	"Null hash table %s\r\n"
+ #define LOOKUP_C_SHORT_HASH(name, gotten, wanted) \
+ 				"Truncated hash table %s:  got %d bytes, expected %d\r\n", \
+ 				  name, gotten, wanted
+ #define LOOKUP_C_BAD_MAGIC(name, wanted, gotten) \
+ 				"Illegal format hash table %s - expected magic 0x%x, got 0x%x\r\n", \
+ 				  name, wanted, gotten
+ #define LOOKUP_C_BAD_MAGIC2(name, wanted, gotten) \
+ 				"Illegal format hash table %s - expected magic2 0x%x, got 0x%x\r\n", \
+ 				  name, wanted, gotten
+ #define LOOKUP_C_BAD_OPTIONS(gotopts, gotchars, gotlen, wantedopts, wantedchars, wantedlen) \
+ 				"Hash table options don't agree with buildhash - 0x%x/%d/%d vs. 0x%x/%d/%d\r\n", \
+ 				  gotopts, gotchars, gotlen, \
+ 				  wantedopts, wantedchars, wantedlen
+ #define LOOKUP_C_NO_HASH_SPACE	"Couldn't allocate space for hash table\r\n"
+ #define LOOKUP_C_BAD_FORMAT	"Illegal format hash table\r\n"
+ #define LOOKUP_C_NO_LANG_SPACE	"Couldn't allocate space for language tables\r\n"
+ 
+ /*
+  * The following strings are used in makedent.c:
+  */
+ #define MAKEDENT_C_NO_WORD_SPACE "\r\nCouldn't allocate space for word '%s'\r\n"
+ #define MAKEDENT_C_BAD_WORD_CHAR "\r\nWord '%s' contains illegal characters\r\n"
+ 
+ /*
+  * The following strings are used in parse.y:
+  */
+ #define PARSE_Y_8_BIT		"Eighth bit ignored (recompile ispell without NO8BIT)"
+ #define PARSE_Y_NO_WORD_STRINGS	"wordchars statement may not specify string characters"
+ #define PARSE_Y_UNMATCHED	"Unmatched charset lengths"
+ #define PARSE_Y_NO_BOUNDARY_STRINGS "boundarychars statement may not specify string characters"
+ #define PARSE_Y_LONG_STRING	"String character is too long"
+ #define PARSE_Y_NULL_STRING	"String character must have nonzero length"
+ #define PARSE_Y_MANY_STRINGS	"Too many string characters"
+ #define PARSE_Y_NO_SUCH_STRING	"No such string character"
+ #define PARSE_Y_MULTIPLE_STRINGS "Alternate string character was already defined"
+ #define PARSE_Y_LENGTH_MISMATCH	"Upper and lower versions of string character must be same length"
+ #define PARSE_Y_WRONG_NROFF	"Incorrect character count in nroffchars statement"
+ #define PARSE_Y_WRONG_TEX	"Incorrect character count in TeXchars statement"
+ #define PARSE_Y_DOUBLE_COMPOUND	"Compoundwords option may only appear once"
+ #define PARSE_Y_LONG_FLAG	"Flag must be single character"
+ #define PARSE_Y_BAD_FLAG	"Flag must be alphabetic"
+ #define PARSE_Y_DUP_FLAG	"Duplicate flag"
+ #define PARSE_Y_NO_SPACE	"Out of memory"
+ #define PARSE_Y_NEED_BLANK	"Single characters must be separated by a blank"
+ #define PARSE_Y_MANY_CONDS	"Too many conditions;  8 maximum"
+ #define PARSE_Y_EOF		"Unexpected EOF in quoted string"
+ #define PARSE_Y_LONG_QUOTE	"Quoted string too long, max 256 characters"
+ #define PARSE_Y_ERROR_FORMAT(file, lineno, error) \
+ 				"%s line %d: %s\n", file, lineno, error
+ #define PARSE_Y_MALLOC_TROUBLE	"yyopen:  trouble allocating memory\n"
+ #define PARSE_Y_UNGRAB_PROBLEM	"Internal error:  ungrab buffer overflow"
+ #define PARSE_Y_BAD_DEFORMATTER	"Deformatter must be either 'nroff' or 'tex'"
+ #define PARSE_Y_BAD_NUMBER	"Illegal digit in number"
+ 
+ /*
+  * The following strings are used in term.c:
+  */
+ #define TERM_C_SMALL_SCREEN	"Screen too small:  need at least %d lines\n"
+ #define TERM_C_NO_BATCH		"Can't deal with non-interactive use yet.\n"
+ #define TERM_C_CANT_FORK	"Couldn't fork, try later.\r\n"
+ #define TERM_C_TYPE_SPACE	"\n-- Type space to continue --"
+ 
+ /*
+  * The following strings are used in tree.c:
+  */
+ #define TREE_C_CANT_UPDATE	"Warning: Cannot update personal dictionary (%s)\r\n"
+ #define TREE_C_NO_SPACE		"Ran out of space for personal dictionary\r\n"
+ #define TREE_C_TRY_ANYWAY	"Continuing anyway (with reduced performance).\r\n"
+ 
+ /*
+  * The following strings are used in unsq.c:
+  */
+ #define UNSQ_C_BAD_COUNT	"Illegal count character 0x%x\n"
+ #define UNSQ_C_SURPRISE_EOF	"Unexpected EOF\n"


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/parse.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/parse.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/parse.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,36 ----
+ typedef union
+     {
+     int			simple;		/* Simple char or lval from yylex */
+     struct
+ 	{
+ 	char *		set;		/* Character set */
+ 	int		complement;	/* NZ if it is a complement set */
+ 	}
+ 			charset;
+     unsigned char *	string;		/* String */
+     ichar_t *		istr;		/* Internal string */
+     struct flagent *	entry;		/* Flag entry */
+     } YYSTYPE;
+ #define	ALLAFFIXES	257
+ #define	ALTSTRINGCHAR	258
+ #define	ALTSTRINGTYPE	259
+ #define	BOUNDARYCHARS	260
+ #define	COMPOUNDMIN	261
+ #define	COMPOUNDWORDS	262
+ #define	CONTROLLED	263
+ #define	DEFSTRINGTYPE	264
+ #define	FLAG	265
+ #define	FLAGMARKER	266
+ #define	NROFFCHARS	267
+ #define	OFF	268
+ #define	ON	269
+ #define	PREFIXES	270
+ #define	RANGE	271
+ #define	SUFFIXES	272
+ #define	STRING	273
+ #define	STRINGCHAR	274
+ #define	TEXCHARS	275
+ #define	WORDCHARS	276
+ 
+ 
+ extern YYSTYPE parse.ylval;


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/parse.output
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/parse.output:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/parse.output	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,1225 ----
+ 
+ Grammar
+ rule 1    file -> headers tables
+ rule 2    file -> tables
+ rule 3    headers -> option_group charset_group
+ rule 4    headers -> option_group charset_group altchar_group
+ rule 5    headers -> charset_group
+ rule 6    headers -> charset_group altchar_group
+ rule 7    option_group -> option_stmt
+ rule 8    option_group -> option_group option_stmt
+ rule 9    charset_group -> deftype_stmt charset_stmt
+ rule 10   charset_group -> charset_stmt
+ rule 11   charset_group -> charset_group charset_stmt
+ rule 12   deftype_stmt -> DEFSTRINGTYPE stringtype_info
+ rule 13   altchar_group -> altchar_stmt
+ rule 14   altchar_group -> altchar_group altchar_stmt
+ rule 15   charset_stmt -> WORDCHARS char_set char_set
+ rule 16   charset_stmt -> WORDCHARS char_set
+ rule 17   charset_stmt -> BOUNDARYCHARS char_set char_set
+ rule 18   charset_stmt -> BOUNDARYCHARS char_set
+ rule 19   charset_stmt -> STRINGCHAR STRING
+ rule 20   charset_stmt -> STRINGCHAR STRING STRING
+ rule 21   altchar_stmt -> ALTSTRINGTYPE stringtype_info
+ rule 22   altchar_stmt -> ALTSTRINGTYPE stringtype_info altchar_spec_group
+ rule 23   stringtype_info -> STRING STRING filesuf_list
+ rule 24   filesuf_list -> filesuf
+ rule 25   filesuf_list -> filesuf_list filesuf
+ rule 26   filesuf -> STRING
+ rule 27   altchar_spec_group -> altchar_spec
+ rule 28   altchar_spec_group -> altchar_spec_group altchar_spec
+ rule 29   altchar_spec -> ALTSTRINGCHAR STRING STRING
+ rule 30   option_stmt -> NROFFCHARS STRING
+ rule 31   option_stmt -> TEXCHARS STRING
+ rule 32   option_stmt -> COMPOUNDMIN STRING
+ rule 33   option_stmt -> COMPOUNDWORDS on_or_off
+ rule 34   option_stmt -> COMPOUNDWORDS CONTROLLED STRING
+ rule 35   option_stmt -> ALLAFFIXES on_or_off
+ rule 36   option_stmt -> FLAGMARKER STRING
+ rule 37   char_set -> '.'
+ rule 38   char_set -> STRING
+ rule 39   char_set -> RANGE
+ rule 40   on_or_off -> ON
+ rule 41   on_or_off -> OFF
+ rule 42   tables -> prefix_table suffix_table
+ rule 43   tables -> suffix_table prefix_table
+ rule 44   tables -> prefix_table
+ rule 45   tables -> suffix_table
+ rule 46   prefix_table -> PREFIXES table
+ rule 47   suffix_table -> SUFFIXES table
+ rule 48   table -> flagdef
+ rule 49   table -> table flagdef
+ rule 50   flagdef -> FLAG STRING ':' rules
+ rule 51   flagdef -> FLAG flagoptions STRING ':' rules
+ rule 52   flagdef -> error
+ rule 53   flagoptions -> flagoption
+ rule 54   flagoptions -> flagoptions flagoption
+ rule 55   flagoption -> '*'
+ rule 56   flagoption -> '~'
+ rule 57   rules -> affix_rule
+ rule 58   rules -> rules affix_rule
+ rule 59   affix_rule -> cond_or_null '>' ichar_string
+ rule 60   affix_rule -> cond_or_null '>' '-' ichar_string ',' ichar_string
+ rule 61   affix_rule -> cond_or_null '>' '-' ichar_string ',' '-'
+ rule 62   affix_rule -> cond_or_null '>' '-' ',' '-'
+ rule 63   cond_or_null ->		/* empty */
+ rule 64   cond_or_null -> conditions
+ rule 65   conditions -> char_set
+ rule 66   conditions -> conditions char_set
+ rule 67   ichar_string -> STRING
+ 
+ Terminals, with rules where they appear
+ 
+ $ (-1)
+ '*' (42) 55
+ ',' (44) 60 61 62
+ '-' (45) 60 61 62
+ '.' (46) 37
+ ':' (58) 50 51
+ '>' (62) 59 60 61 62
+ '~' (126) 56
+ error (256) 52
+ ALLAFFIXES (257) 35
+ ALTSTRINGCHAR (258) 29
+ ALTSTRINGTYPE (259) 21 22
+ BOUNDARYCHARS (260) 17 18
+ COMPOUNDMIN (261) 32
+ COMPOUNDWORDS (262) 33 34
+ CONTROLLED (263) 34
+ DEFSTRINGTYPE (264) 12
+ FLAG (265) 50 51
+ FLAGMARKER (266) 36
+ NROFFCHARS (267) 30
+ OFF (268) 41
+ ON (269) 40
+ PREFIXES (270) 46
+ RANGE (271) 39
+ SUFFIXES (272) 47
+ STRING (273) 19 20 23 26 29 30 31 32 34 36 38 50 51 67
+ STRINGCHAR (274) 19 20
+ TEXCHARS (275) 31
+ WORDCHARS (276) 15 16
+ 
+ Nonterminals, with rules where they appear
+ 
+ file (30)
+     on left: 1 2
+ headers (31)
+     on left: 3 4 5 6, on right: 1
+ option_group (32)
+     on left: 7 8, on right: 3 4 8
+ charset_group (33)
+     on left: 9 10 11, on right: 3 4 5 6 11
+ deftype_stmt (34)
+     on left: 12, on right: 9
+ altchar_group (35)
+     on left: 13 14, on right: 4 6 14
+ charset_stmt (36)
+     on left: 15 16 17 18 19 20, on right: 9 10 11
+ altchar_stmt (37)
+     on left: 21 22, on right: 13 14
+ stringtype_info (38)
+     on left: 23, on right: 12 21 22
+ filesuf_list (39)
+     on left: 24 25, on right: 23 25
+ filesuf (40)
+     on left: 26, on right: 24 25
+ altchar_spec_group (41)
+     on left: 27 28, on right: 22 28
+ altchar_spec (42)
+     on left: 29, on right: 27 28
+ option_stmt (43)
+     on left: 30 31 32 33 34 35 36, on right: 7 8
+ char_set (44)
+     on left: 37 38 39, on right: 15 16 17 18 65 66
+ on_or_off (45)
+     on left: 40 41, on right: 33 35
+ tables (46)
+     on left: 42 43 44 45, on right: 1 2
+ prefix_table (47)
+     on left: 46, on right: 42 43 44
+ suffix_table (48)
+     on left: 47, on right: 42 43 45
+ table (49)
+     on left: 48 49, on right: 46 47 49
+ flagdef (50)
+     on left: 50 51 52, on right: 48 49
+ flagoptions (51)
+     on left: 53 54, on right: 51 54
+ flagoption (52)
+     on left: 55 56, on right: 53 54
+ rules (53)
+     on left: 57 58, on right: 50 51 58
+ affix_rule (54)
+     on left: 59 60 61 62, on right: 57 58
+ cond_or_null (55)
+     on left: 63 64, on right: 59 60 61 62
+ conditions (56)
+     on left: 65 66, on right: 64 66
+ ichar_string (57)
+     on left: 67, on right: 59 60 61
+ 
+ 
+ state 0
+ 
+     ALLAFFIXES	shift, and go to state 1
+     BOUNDARYCHARS	shift, and go to state 2
+     COMPOUNDMIN	shift, and go to state 3
+     COMPOUNDWORDS	shift, and go to state 4
+     DEFSTRINGTYPE	shift, and go to state 5
+     FLAGMARKER	shift, and go to state 6
+     NROFFCHARS	shift, and go to state 7
+     PREFIXES	shift, and go to state 8
+     SUFFIXES	shift, and go to state 9
+     STRINGCHAR	shift, and go to state 10
+     TEXCHARS	shift, and go to state 11
+     WORDCHARS	shift, and go to state 12
+ 
+     file	go to state 100
+     headers	go to state 13
+     option_group	go to state 14
+     charset_group	go to state 15
+     deftype_stmt	go to state 16
+     charset_stmt	go to state 17
+     option_stmt	go to state 18
+     tables	go to state 19
+     prefix_table	go to state 20
+     suffix_table	go to state 21
+ 
+ 
+ 
+ state 1
+ 
+     option_stmt  ->  ALLAFFIXES . on_or_off   (rule 35)
+ 
+     OFF 	shift, and go to state 22
+     ON  	shift, and go to state 23
+ 
+     on_or_off	go to state 24
+ 
+ 
+ 
+ state 2
+ 
+     charset_stmt  ->  BOUNDARYCHARS . char_set char_set   (rule 17)
+     charset_stmt  ->  BOUNDARYCHARS . char_set   (rule 18)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     char_set	go to state 28
+ 
+ 
+ 
+ state 3
+ 
+     option_stmt  ->  COMPOUNDMIN . STRING   (rule 32)
+ 
+     STRING	shift, and go to state 29
+ 
+ 
+ 
+ state 4
+ 
+     option_stmt  ->  COMPOUNDWORDS . on_or_off   (rule 33)
+     option_stmt  ->  COMPOUNDWORDS . CONTROLLED STRING   (rule 34)
+ 
+     CONTROLLED	shift, and go to state 30
+     OFF 	shift, and go to state 22
+     ON  	shift, and go to state 23
+ 
+     on_or_off	go to state 31
+ 
+ 
+ 
+ state 5
+ 
+     deftype_stmt  ->  DEFSTRINGTYPE . stringtype_info   (rule 12)
+ 
+     STRING	shift, and go to state 32
+ 
+     stringtype_info	go to state 33
+ 
+ 
+ 
+ state 6
+ 
+     option_stmt  ->  FLAGMARKER . STRING   (rule 36)
+ 
+     STRING	shift, and go to state 34
+ 
+ 
+ 
+ state 7
+ 
+     option_stmt  ->  NROFFCHARS . STRING   (rule 30)
+ 
+     STRING	shift, and go to state 35
+ 
+ 
+ 
+ state 8
+ 
+     prefix_table  ->  PREFIXES . table   (rule 46)
+ 
+     error	shift, and go to state 36
+     FLAG	shift, and go to state 37
+ 
+     table	go to state 38
+     flagdef	go to state 39
+ 
+ 
+ 
+ state 9
+ 
+     suffix_table  ->  SUFFIXES . table   (rule 47)
+ 
+     error	shift, and go to state 36
+     FLAG	shift, and go to state 37
+ 
+     table	go to state 40
+     flagdef	go to state 39
+ 
+ 
+ 
+ state 10
+ 
+     charset_stmt  ->  STRINGCHAR . STRING   (rule 19)
+     charset_stmt  ->  STRINGCHAR . STRING STRING   (rule 20)
+ 
+     STRING	shift, and go to state 41
+ 
+ 
+ 
+ state 11
+ 
+     option_stmt  ->  TEXCHARS . STRING   (rule 31)
+ 
+     STRING	shift, and go to state 42
+ 
+ 
+ 
+ state 12
+ 
+     charset_stmt  ->  WORDCHARS . char_set char_set   (rule 15)
+     charset_stmt  ->  WORDCHARS . char_set   (rule 16)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     char_set	go to state 43
+ 
+ 
+ 
+ state 13
+ 
+     file  ->  headers . tables   (rule 1)
+ 
+     PREFIXES	shift, and go to state 8
+     SUFFIXES	shift, and go to state 9
+ 
+     tables	go to state 44
+     prefix_table	go to state 20
+     suffix_table	go to state 21
+ 
+ 
+ 
+ state 14
+ 
+     headers  ->  option_group . charset_group   (rule 3)
+     headers  ->  option_group . charset_group altchar_group   (rule 4)
+     option_group  ->  option_group . option_stmt   (rule 8)
+ 
+     ALLAFFIXES	shift, and go to state 1
+     BOUNDARYCHARS	shift, and go to state 2
+     COMPOUNDMIN	shift, and go to state 3
+     COMPOUNDWORDS	shift, and go to state 4
+     DEFSTRINGTYPE	shift, and go to state 5
+     FLAGMARKER	shift, and go to state 6
+     NROFFCHARS	shift, and go to state 7
+     STRINGCHAR	shift, and go to state 10
+     TEXCHARS	shift, and go to state 11
+     WORDCHARS	shift, and go to state 12
+ 
+     charset_group	go to state 45
+     deftype_stmt	go to state 16
+     charset_stmt	go to state 17
+     option_stmt	go to state 46
+ 
+ 
+ 
+ state 15
+ 
+     headers  ->  charset_group .   (rule 5)
+     headers  ->  charset_group . altchar_group   (rule 6)
+     charset_group  ->  charset_group . charset_stmt   (rule 11)
+ 
+     ALTSTRINGTYPE	shift, and go to state 47
+     BOUNDARYCHARS	shift, and go to state 2
+     STRINGCHAR	shift, and go to state 10
+     WORDCHARS	shift, and go to state 12
+ 
+     $default	reduce using rule 5 (headers)
+ 
+     altchar_group	go to state 48
+     charset_stmt	go to state 49
+     altchar_stmt	go to state 50
+ 
+ 
+ 
+ state 16
+ 
+     charset_group  ->  deftype_stmt . charset_stmt   (rule 9)
+ 
+     BOUNDARYCHARS	shift, and go to state 2
+     STRINGCHAR	shift, and go to state 10
+     WORDCHARS	shift, and go to state 12
+ 
+     charset_stmt	go to state 51
+ 
+ 
+ 
+ state 17
+ 
+     charset_group  ->  charset_stmt .   (rule 10)
+ 
+     $default	reduce using rule 10 (charset_group)
+ 
+ 
+ 
+ state 18
+ 
+     option_group  ->  option_stmt .   (rule 7)
+ 
+     $default	reduce using rule 7 (option_group)
+ 
+ 
+ 
+ state 19
+ 
+     file  ->  tables .   (rule 2)
+ 
+     $default	reduce using rule 2 (file)
+ 
+ 
+ 
+ state 20
+ 
+     tables  ->  prefix_table . suffix_table   (rule 42)
+     tables  ->  prefix_table .   (rule 44)
+ 
+     SUFFIXES	shift, and go to state 9
+ 
+     $default	reduce using rule 44 (tables)
+ 
+     suffix_table	go to state 52
+ 
+ 
+ 
+ state 21
+ 
+     tables  ->  suffix_table . prefix_table   (rule 43)
+     tables  ->  suffix_table .   (rule 45)
+ 
+     PREFIXES	shift, and go to state 8
+ 
+     $default	reduce using rule 45 (tables)
+ 
+     prefix_table	go to state 53
+ 
+ 
+ 
+ state 22
+ 
+     on_or_off  ->  OFF .   (rule 41)
+ 
+     $default	reduce using rule 41 (on_or_off)
+ 
+ 
+ 
+ state 23
+ 
+     on_or_off  ->  ON .   (rule 40)
+ 
+     $default	reduce using rule 40 (on_or_off)
+ 
+ 
+ 
+ state 24
+ 
+     option_stmt  ->  ALLAFFIXES on_or_off .   (rule 35)
+ 
+     $default	reduce using rule 35 (option_stmt)
+ 
+ 
+ 
+ state 25
+ 
+     char_set  ->  '.' .   (rule 37)
+ 
+     $default	reduce using rule 37 (char_set)
+ 
+ 
+ 
+ state 26
+ 
+     char_set  ->  RANGE .   (rule 39)
+ 
+     $default	reduce using rule 39 (char_set)
+ 
+ 
+ 
+ state 27
+ 
+     char_set  ->  STRING .   (rule 38)
+ 
+     $default	reduce using rule 38 (char_set)
+ 
+ 
+ 
+ state 28
+ 
+     charset_stmt  ->  BOUNDARYCHARS char_set . char_set   (rule 17)
+     charset_stmt  ->  BOUNDARYCHARS char_set .   (rule 18)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     $default	reduce using rule 18 (charset_stmt)
+ 
+     char_set	go to state 54
+ 
+ 
+ 
+ state 29
+ 
+     option_stmt  ->  COMPOUNDMIN STRING .   (rule 32)
+ 
+     $default	reduce using rule 32 (option_stmt)
+ 
+ 
+ 
+ state 30
+ 
+     option_stmt  ->  COMPOUNDWORDS CONTROLLED . STRING   (rule 34)
+ 
+     STRING	shift, and go to state 55
+ 
+ 
+ 
+ state 31
+ 
+     option_stmt  ->  COMPOUNDWORDS on_or_off .   (rule 33)
+ 
+     $default	reduce using rule 33 (option_stmt)
+ 
+ 
+ 
+ state 32
+ 
+     stringtype_info  ->  STRING . STRING filesuf_list   (rule 23)
+ 
+     STRING	shift, and go to state 56
+ 
+ 
+ 
+ state 33
+ 
+     deftype_stmt  ->  DEFSTRINGTYPE stringtype_info .   (rule 12)
+ 
+     $default	reduce using rule 12 (deftype_stmt)
+ 
+ 
+ 
+ state 34
+ 
+     option_stmt  ->  FLAGMARKER STRING .   (rule 36)
+ 
+     $default	reduce using rule 36 (option_stmt)
+ 
+ 
+ 
+ state 35
+ 
+     option_stmt  ->  NROFFCHARS STRING .   (rule 30)
+ 
+     $default	reduce using rule 30 (option_stmt)
+ 
+ 
+ 
+ state 36
+ 
+     flagdef  ->  error .   (rule 52)
+ 
+     $default	reduce using rule 52 (flagdef)
+ 
+ 
+ 
+ state 37
+ 
+     flagdef  ->  FLAG . STRING ':' rules   (rule 50)
+     flagdef  ->  FLAG . flagoptions STRING ':' rules   (rule 51)
+ 
+     '*' 	shift, and go to state 57
+     '~' 	shift, and go to state 58
+     STRING	shift, and go to state 59
+ 
+     flagoptions	go to state 60
+     flagoption	go to state 61
+ 
+ 
+ 
+ state 38
+ 
+     prefix_table  ->  PREFIXES table .   (rule 46)
+     table  ->  table . flagdef   (rule 49)
+ 
+     error	shift, and go to state 36
+     FLAG	shift, and go to state 37
+ 
+     $   	reduce using rule 46 (prefix_table)
+     SUFFIXES	reduce using rule 46 (prefix_table)
+ 
+     flagdef	go to state 62
+ 
+ 
+ 
+ state 39
+ 
+     table  ->  flagdef .   (rule 48)
+ 
+     $default	reduce using rule 48 (table)
+ 
+ 
+ 
+ state 40
+ 
+     suffix_table  ->  SUFFIXES table .   (rule 47)
+     table  ->  table . flagdef   (rule 49)
+ 
+     error	shift, and go to state 36
+     FLAG	shift, and go to state 37
+ 
+     $   	reduce using rule 47 (suffix_table)
+     PREFIXES	reduce using rule 47 (suffix_table)
+ 
+     flagdef	go to state 62
+ 
+ 
+ 
+ state 41
+ 
+     charset_stmt  ->  STRINGCHAR STRING .   (rule 19)
+     charset_stmt  ->  STRINGCHAR STRING . STRING   (rule 20)
+ 
+     STRING	shift, and go to state 63
+ 
+     $default	reduce using rule 19 (charset_stmt)
+ 
+ 
+ 
+ state 42
+ 
+     option_stmt  ->  TEXCHARS STRING .   (rule 31)
+ 
+     $default	reduce using rule 31 (option_stmt)
+ 
+ 
+ 
+ state 43
+ 
+     charset_stmt  ->  WORDCHARS char_set . char_set   (rule 15)
+     charset_stmt  ->  WORDCHARS char_set .   (rule 16)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     $default	reduce using rule 16 (charset_stmt)
+ 
+     char_set	go to state 64
+ 
+ 
+ 
+ state 44
+ 
+     file  ->  headers tables .   (rule 1)
+ 
+     $default	reduce using rule 1 (file)
+ 
+ 
+ 
+ state 45
+ 
+     headers  ->  option_group charset_group .   (rule 3)
+     headers  ->  option_group charset_group . altchar_group   (rule 4)
+     charset_group  ->  charset_group . charset_stmt   (rule 11)
+ 
+     ALTSTRINGTYPE	shift, and go to state 47
+     BOUNDARYCHARS	shift, and go to state 2
+     STRINGCHAR	shift, and go to state 10
+     WORDCHARS	shift, and go to state 12
+ 
+     $default	reduce using rule 3 (headers)
+ 
+     altchar_group	go to state 65
+     charset_stmt	go to state 49
+     altchar_stmt	go to state 50
+ 
+ 
+ 
+ state 46
+ 
+     option_group  ->  option_group option_stmt .   (rule 8)
+ 
+     $default	reduce using rule 8 (option_group)
+ 
+ 
+ 
+ state 47
+ 
+     altchar_stmt  ->  ALTSTRINGTYPE . stringtype_info   (rule 21)
+     altchar_stmt  ->  ALTSTRINGTYPE . stringtype_info altchar_spec_group   (rule 22)
+ 
+     STRING	shift, and go to state 32
+ 
+     stringtype_info	go to state 66
+ 
+ 
+ 
+ state 48
+ 
+     headers  ->  charset_group altchar_group .   (rule 6)
+     altchar_group  ->  altchar_group . altchar_stmt   (rule 14)
+ 
+     ALTSTRINGTYPE	shift, and go to state 47
+ 
+     $default	reduce using rule 6 (headers)
+ 
+     altchar_stmt	go to state 67
+ 
+ 
+ 
+ state 49
+ 
+     charset_group  ->  charset_group charset_stmt .   (rule 11)
+ 
+     $default	reduce using rule 11 (charset_group)
+ 
+ 
+ 
+ state 50
+ 
+     altchar_group  ->  altchar_stmt .   (rule 13)
+ 
+     $default	reduce using rule 13 (altchar_group)
+ 
+ 
+ 
+ state 51
+ 
+     charset_group  ->  deftype_stmt charset_stmt .   (rule 9)
+ 
+     $default	reduce using rule 9 (charset_group)
+ 
+ 
+ 
+ state 52
+ 
+     tables  ->  prefix_table suffix_table .   (rule 42)
+ 
+     $default	reduce using rule 42 (tables)
+ 
+ 
+ 
+ state 53
+ 
+     tables  ->  suffix_table prefix_table .   (rule 43)
+ 
+     $default	reduce using rule 43 (tables)
+ 
+ 
+ 
+ state 54
+ 
+     charset_stmt  ->  BOUNDARYCHARS char_set char_set .   (rule 17)
+ 
+     $default	reduce using rule 17 (charset_stmt)
+ 
+ 
+ 
+ state 55
+ 
+     option_stmt  ->  COMPOUNDWORDS CONTROLLED STRING .   (rule 34)
+ 
+     $default	reduce using rule 34 (option_stmt)
+ 
+ 
+ 
+ state 56
+ 
+     stringtype_info  ->  STRING STRING . filesuf_list   (rule 23)
+ 
+     STRING	shift, and go to state 68
+ 
+     filesuf_list	go to state 69
+     filesuf	go to state 70
+ 
+ 
+ 
+ state 57
+ 
+     flagoption  ->  '*' .   (rule 55)
+ 
+     $default	reduce using rule 55 (flagoption)
+ 
+ 
+ 
+ state 58
+ 
+     flagoption  ->  '~' .   (rule 56)
+ 
+     $default	reduce using rule 56 (flagoption)
+ 
+ 
+ 
+ state 59
+ 
+     flagdef  ->  FLAG STRING . ':' rules   (rule 50)
+ 
+     ':' 	shift, and go to state 71
+ 
+ 
+ 
+ state 60
+ 
+     flagdef  ->  FLAG flagoptions . STRING ':' rules   (rule 51)
+     flagoptions  ->  flagoptions . flagoption   (rule 54)
+ 
+     '*' 	shift, and go to state 57
+     '~' 	shift, and go to state 58
+     STRING	shift, and go to state 72
+ 
+     flagoption	go to state 73
+ 
+ 
+ 
+ state 61
+ 
+     flagoptions  ->  flagoption .   (rule 53)
+ 
+     $default	reduce using rule 53 (flagoptions)
+ 
+ 
+ 
+ state 62
+ 
+     table  ->  table flagdef .   (rule 49)
+ 
+     $default	reduce using rule 49 (table)
+ 
+ 
+ 
+ state 63
+ 
+     charset_stmt  ->  STRINGCHAR STRING STRING .   (rule 20)
+ 
+     $default	reduce using rule 20 (charset_stmt)
+ 
+ 
+ 
+ state 64
+ 
+     charset_stmt  ->  WORDCHARS char_set char_set .   (rule 15)
+ 
+     $default	reduce using rule 15 (charset_stmt)
+ 
+ 
+ 
+ state 65
+ 
+     headers  ->  option_group charset_group altchar_group .   (rule 4)
+     altchar_group  ->  altchar_group . altchar_stmt   (rule 14)
+ 
+     ALTSTRINGTYPE	shift, and go to state 47
+ 
+     $default	reduce using rule 4 (headers)
+ 
+     altchar_stmt	go to state 67
+ 
+ 
+ 
+ state 66
+ 
+     altchar_stmt  ->  ALTSTRINGTYPE stringtype_info .   (rule 21)
+     altchar_stmt  ->  ALTSTRINGTYPE stringtype_info . altchar_spec_group   (rule 22)
+ 
+     ALTSTRINGCHAR	shift, and go to state 74
+ 
+     $default	reduce using rule 21 (altchar_stmt)
+ 
+     altchar_spec_group	go to state 75
+     altchar_spec	go to state 76
+ 
+ 
+ 
+ state 67
+ 
+     altchar_group  ->  altchar_group altchar_stmt .   (rule 14)
+ 
+     $default	reduce using rule 14 (altchar_group)
+ 
+ 
+ 
+ state 68
+ 
+     filesuf  ->  STRING .   (rule 26)
+ 
+     $default	reduce using rule 26 (filesuf)
+ 
+ 
+ 
+ state 69
+ 
+     stringtype_info  ->  STRING STRING filesuf_list .   (rule 23)
+     filesuf_list  ->  filesuf_list . filesuf   (rule 25)
+ 
+     STRING	shift, and go to state 68
+ 
+     $default	reduce using rule 23 (stringtype_info)
+ 
+     filesuf	go to state 77
+ 
+ 
+ 
+ state 70
+ 
+     filesuf_list  ->  filesuf .   (rule 24)
+ 
+     $default	reduce using rule 24 (filesuf_list)
+ 
+ 
+ 
+ state 71
+ 
+     flagdef  ->  FLAG STRING ':' . rules   (rule 50)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     $default	reduce using rule 63 (cond_or_null)
+ 
+     char_set	go to state 78
+     rules	go to state 79
+     affix_rule	go to state 80
+     cond_or_null	go to state 81
+     conditions	go to state 82
+ 
+ 
+ 
+ state 72
+ 
+     flagdef  ->  FLAG flagoptions STRING . ':' rules   (rule 51)
+ 
+     ':' 	shift, and go to state 83
+ 
+ 
+ 
+ state 73
+ 
+     flagoptions  ->  flagoptions flagoption .   (rule 54)
+ 
+     $default	reduce using rule 54 (flagoptions)
+ 
+ 
+ 
+ state 74
+ 
+     altchar_spec  ->  ALTSTRINGCHAR . STRING STRING   (rule 29)
+ 
+     STRING	shift, and go to state 84
+ 
+ 
+ 
+ state 75
+ 
+     altchar_stmt  ->  ALTSTRINGTYPE stringtype_info altchar_spec_group .   (rule 22)
+     altchar_spec_group  ->  altchar_spec_group . altchar_spec   (rule 28)
+ 
+     ALTSTRINGCHAR	shift, and go to state 74
+ 
+     $default	reduce using rule 22 (altchar_stmt)
+ 
+     altchar_spec	go to state 85
+ 
+ 
+ 
+ state 76
+ 
+     altchar_spec_group  ->  altchar_spec .   (rule 27)
+ 
+     $default	reduce using rule 27 (altchar_spec_group)
+ 
+ 
+ 
+ state 77
+ 
+     filesuf_list  ->  filesuf_list filesuf .   (rule 25)
+ 
+     $default	reduce using rule 25 (filesuf_list)
+ 
+ 
+ 
+ state 78
+ 
+     conditions  ->  char_set .   (rule 65)
+ 
+     $default	reduce using rule 65 (conditions)
+ 
+ 
+ 
+ state 79
+ 
+     flagdef  ->  FLAG STRING ':' rules .   (rule 50)
+     rules  ->  rules . affix_rule   (rule 58)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     '>' 	reduce using rule 63 (cond_or_null)
+     $default	reduce using rule 50 (flagdef)
+ 
+     char_set	go to state 78
+     affix_rule	go to state 86
+     cond_or_null	go to state 81
+     conditions	go to state 82
+ 
+ 
+ 
+ state 80
+ 
+     rules  ->  affix_rule .   (rule 57)
+ 
+     $default	reduce using rule 57 (rules)
+ 
+ 
+ 
+ state 81
+ 
+     affix_rule  ->  cond_or_null . '>' ichar_string   (rule 59)
+     affix_rule  ->  cond_or_null . '>' '-' ichar_string ',' ichar_string   (rule 60)
+     affix_rule  ->  cond_or_null . '>' '-' ichar_string ',' '-'   (rule 61)
+     affix_rule  ->  cond_or_null . '>' '-' ',' '-'   (rule 62)
+ 
+     '>' 	shift, and go to state 87
+ 
+ 
+ 
+ state 82
+ 
+     cond_or_null  ->  conditions .   (rule 64)
+     conditions  ->  conditions . char_set   (rule 66)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     $default	reduce using rule 64 (cond_or_null)
+ 
+     char_set	go to state 88
+ 
+ 
+ 
+ state 83
+ 
+     flagdef  ->  FLAG flagoptions STRING ':' . rules   (rule 51)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     $default	reduce using rule 63 (cond_or_null)
+ 
+     char_set	go to state 78
+     rules	go to state 89
+     affix_rule	go to state 80
+     cond_or_null	go to state 81
+     conditions	go to state 82
+ 
+ 
+ 
+ state 84
+ 
+     altchar_spec  ->  ALTSTRINGCHAR STRING . STRING   (rule 29)
+ 
+     STRING	shift, and go to state 90
+ 
+ 
+ 
+ state 85
+ 
+     altchar_spec_group  ->  altchar_spec_group altchar_spec .   (rule 28)
+ 
+     $default	reduce using rule 28 (altchar_spec_group)
+ 
+ 
+ 
+ state 86
+ 
+     rules  ->  rules affix_rule .   (rule 58)
+ 
+     $default	reduce using rule 58 (rules)
+ 
+ 
+ 
+ state 87
+ 
+     affix_rule  ->  cond_or_null '>' . ichar_string   (rule 59)
+     affix_rule  ->  cond_or_null '>' . '-' ichar_string ',' ichar_string   (rule 60)
+     affix_rule  ->  cond_or_null '>' . '-' ichar_string ',' '-'   (rule 61)
+     affix_rule  ->  cond_or_null '>' . '-' ',' '-'   (rule 62)
+ 
+     '-' 	shift, and go to state 91
+     STRING	shift, and go to state 92
+ 
+     ichar_string	go to state 93
+ 
+ 
+ 
+ state 88
+ 
+     conditions  ->  conditions char_set .   (rule 66)
+ 
+     $default	reduce using rule 66 (conditions)
+ 
+ 
+ 
+ state 89
+ 
+     flagdef  ->  FLAG flagoptions STRING ':' rules .   (rule 51)
+     rules  ->  rules . affix_rule   (rule 58)
+ 
+     '.' 	shift, and go to state 25
+     RANGE	shift, and go to state 26
+     STRING	shift, and go to state 27
+ 
+     '>' 	reduce using rule 63 (cond_or_null)
+     $default	reduce using rule 51 (flagdef)
+ 
+     char_set	go to state 78
+     affix_rule	go to state 86
+     cond_or_null	go to state 81
+     conditions	go to state 82
+ 
+ 
+ 
+ state 90
+ 
+     altchar_spec  ->  ALTSTRINGCHAR STRING STRING .   (rule 29)
+ 
+     $default	reduce using rule 29 (altchar_spec)
+ 
+ 
+ 
+ state 91
+ 
+     affix_rule  ->  cond_or_null '>' '-' . ichar_string ',' ichar_string   (rule 60)
+     affix_rule  ->  cond_or_null '>' '-' . ichar_string ',' '-'   (rule 61)
+     affix_rule  ->  cond_or_null '>' '-' . ',' '-'   (rule 62)
+ 
+     ',' 	shift, and go to state 94
+     STRING	shift, and go to state 92
+ 
+     ichar_string	go to state 95
+ 
+ 
+ 
+ state 92
+ 
+     ichar_string  ->  STRING .   (rule 67)
+ 
+     $default	reduce using rule 67 (ichar_string)
+ 
+ 
+ 
+ state 93
+ 
+     affix_rule  ->  cond_or_null '>' ichar_string .   (rule 59)
+ 
+     $default	reduce using rule 59 (affix_rule)
+ 
+ 
+ 
+ state 94
+ 
+     affix_rule  ->  cond_or_null '>' '-' ',' . '-'   (rule 62)
+ 
+     '-' 	shift, and go to state 96
+ 
+ 
+ 
+ state 95
+ 
+     affix_rule  ->  cond_or_null '>' '-' ichar_string . ',' ichar_string   (rule 60)
+     affix_rule  ->  cond_or_null '>' '-' ichar_string . ',' '-'   (rule 61)
+ 
+     ',' 	shift, and go to state 97
+ 
+ 
+ 
+ state 96
+ 
+     affix_rule  ->  cond_or_null '>' '-' ',' '-' .   (rule 62)
+ 
+     $default	reduce using rule 62 (affix_rule)
+ 
+ 
+ 
+ state 97
+ 
+     affix_rule  ->  cond_or_null '>' '-' ichar_string ',' . ichar_string   (rule 60)
+     affix_rule  ->  cond_or_null '>' '-' ichar_string ',' . '-'   (rule 61)
+ 
+     '-' 	shift, and go to state 98
+     STRING	shift, and go to state 92
+ 
+     ichar_string	go to state 99
+ 
+ 
+ 
+ state 98
+ 
+     affix_rule  ->  cond_or_null '>' '-' ichar_string ',' '-' .   (rule 61)
+ 
+     $default	reduce using rule 61 (affix_rule)
+ 
+ 
+ 
+ state 99
+ 
+     affix_rule  ->  cond_or_null '>' '-' ichar_string ',' ichar_string .   (rule 60)
+ 
+     $default	reduce using rule 60 (affix_rule)
+ 
+ 
+ 
+ state 100
+ 
+     $   	go to state 101
+ 
+ 
+ 
+ state 101
+ 
+     $   	go to state 102
+ 
+ 
+ 
+ state 102
+ 
+     $default	accept


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/proto.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/proto.h:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/proto.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,288 ----
+ /*
+  * $Id: proto.h,v 1.1 2007/01/09 23:57:18 lattner Exp $
+  *
+  * Copyright 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  *
+  */
+ 
+ /*
+  * $Log: proto.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:04  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.15  1994/10/25  05:46:38  geoff
+  * Protoize bzero the way 4.1.1 does it (which I hope is the standard).
+  *
+  * Revision 1.14  1994/05/24  06:23:10  geoff
+  * Make cap_ok a global routine.
+  *
+  * Revision 1.13  1994/05/17  06:44:20  geoff
+  * Add the new arguments to chk_aff, good, and compoundgood.
+  *
+  * Revision 1.12  1994/03/16  03:49:15  geoff
+  * Add an ifdef so that there won't be a conflict with the definition of
+  * free() on braindamaged Sun systems.
+  *
+  * Revision 1.11  1994/02/14  00:34:55  geoff
+  * Add new arguments to the prototype for correct().
+  *
+  * Revision 1.10  1994/02/08  05:45:34  geoff
+  * Don't undef P unless we're going to redefine it
+  *
+  * Revision 1.9  1994/02/07  08:10:47  geoff
+  * Add the GENERATE_LIBRARY_PROTOS option.  Put the definitions of
+  * index/rindex back the way they were, because that's what's needed on
+  * my system (sigh).
+  *
+  * Revision 1.8  1994/02/07  05:45:25  geoff
+  * Change the second parameter of index/rindex to be a char
+  *
+  * Revision 1.7  1994/01/25  07:12:05  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ extern int	addvheader P ((struct dent * ent));
+ extern void	askmode P ((void));
+ extern void	backup P ((void));
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ extern int	cap_ok P ((ichar_t * word, struct success * hit, int len));
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ extern int	casecmp P ((char * a, char * b, int canonical));
+ extern void	chupcase P ((char * s));
+ extern void	checkfile P ((void));
+ extern void	checkline P ((FILE * ofile));
+ extern void	chk_aff P ((ichar_t * word, ichar_t * ucword, int len,
+ 		  int ignoreflagbits, int allhits, int pfxopts, int sfxopts));
+ extern int	combinecaps P ((struct dent * hdr, struct dent * newent));
+ extern int	compoundgood P ((ichar_t * word, int pfxopts));
+ extern void	copyout P ((char ** cc, int cnt));
+ extern void	correct P ((char * ctok, int ctokl, ichar_t * itok, int itokl,
+ 		  char ** curchar));
+ extern char *	do_regex_lookup P ((char * expr, int whence));
+ extern SIGNAL_TYPE done P ((int));
+ extern void	dumpmode P ((void));
+ extern void	erase P ((void));
+ extern int	expand_pre P ((char * croot, ichar_t * rootword,
+ 		  MASKTYPE mask[], int option, char *extra));
+ extern int	expand_suf P ((char * croot, ichar_t * rootword,
+ 		  MASKTYPE mask[], int crossonly, int option, char * extra));
+ extern int	findfiletype P ((char * name, int searchnames,
+ 		  int * deformatter));
+ extern void	flagpr P ((ichar_t * word, int preflag, int prestrip,
+ 		  int preadd, int sufflag, int sufadd));
+ extern void	givehelp P ((int interactive));
+ extern int	good P ((ichar_t * word, int ignoreflagbits, int allhits,
+ 		  int pfxopts, int sfxopts));
+ extern int	hash P ((ichar_t * word, int hashtablesize));
+ #ifndef ICHAR_IS_CHAR
+ extern int	icharcmp P ((ichar_t * s1, ichar_t * s2));
+ extern ichar_t * icharcpy P ((ichar_t * out, ichar_t * in));
+ extern int	icharlen P ((ichar_t * str));
+ extern int	icharncmp P ((ichar_t * s1, ichar_t * s2, int n));
+ #endif /* ICHAR_IS_CHAR */
+ extern int	ichartostr P ((char * out, ichar_t * in, int outlen,
+ 		  int canonical));
+ extern char *	ichartosstr P ((ichar_t * in, int canonical));
+ extern int	ins_root_cap P ((ichar_t * word, ichar_t * pattern,
+ 		  int prestrip, int preadd, int sufstrip, int sufadd,
+ 		  struct dent * firstdent, struct flagent * pfxent,
+ 		  struct flagent * sufent));
+ extern void	inverse P ((void));
+ extern int	linit P ((void));
+ extern struct dent * lookup P ((ichar_t * word, int dotree));
+ extern void	lowcase P ((ichar_t * string));
+ extern int	makedent P ((char * lbuf, int lbuflen, struct dent * d));
+ extern void	makepossibilities P ((ichar_t * word));
+ extern void	move P ((int row, int col));
+ extern void	normal P ((void));
+ extern char *	printichar P ((int in));
+ #ifdef USESH
+ extern int	shellescape P ((char * buf));
+ extern void	shescape P ((char * buf));
+ #else /* USESH */
+ #ifndef REGEX_LOOKUP
+ extern int	shellescape P ((char * buf));
+ #endif /* REGEX_LOOKUP */
+ #endif /* USESH */
+ extern char *	skipoverword P ((char * bufp));
+ extern void	stop P ((void));
+ extern int	stringcharlen P ((char * bufp, int canonical));
+ extern int	strtoichar P ((ichar_t * out, char * in, int outlen,
+ 		  int canonical));
+ extern ichar_t * strtosichar P ((char * in, int canonical));
+ extern void	terminit P ((void));
+ extern void	toutent P ((FILE * outfile, struct dent * hent,
+ 		  int onlykeep));
+ extern void	treeinit P ((char * persdict, char * LibDict));
+ extern void	treeinsert P ((char * word, int wordlen, int keep));
+ extern struct dent * treelookup P ((ichar_t * word));
+ extern void	treeoutput P ((void));
+ extern void	upcase P ((ichar_t * string));
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ extern long	whatcap P ((ichar_t * word));
+ #endif
+ extern char *	xgets P ((char * string, int size, FILE * stream));
+ extern void	yyinit P ((void));
+ extern int	yyopen P ((char * file));
+ extern int	yyparse P ((void));
+ 
+ extern void	myfree P ((VOID * area));
+ extern VOID *	mymalloc P ((unsigned int));
+ extern VOID *	myrealloc P ((VOID * area, unsigned int size,
+ 		  unsigned int oldsize));
+ 
+ /*
+  * C library functions.  If possible, we get these from stdlib.h.
+  *
+  * Even if stdlib.h doesn't exist, we don't generate proper prototypes
+  * on most systems.  This protects us against minor differences in
+  * declarations that break the compilation unnecessarily.
+  * GENERATE_LIBRARY_PROTOS is mostly for the benefit of the ispell
+  * developer.
+  */
+ #ifndef GENERATE_LIBRARY_PROTOS
+ #undef P
+ #define P(x)	()
+ #endif /* GENERATE_LIBRARY_PROTOS */
+ 
+ #ifdef NO_STDLIB_H
+ extern int	access P ((const char * file, int mode));
+ extern int	atoi P ((const char * string));
+ #ifndef USG
+ extern VOID *	bcopy P ((const VOID * src, VOID * dest, unsigned int size));
+ extern void	bzero P ((VOID * dest, int size));
+ #endif /* USG */
+ extern VOID *	calloc P ((unsigned int nelems, unsigned int elemsize));
+ #ifdef _POSIX_SOURCE
+ extern int	chmod P ((const char * file, unsigned int mode));
+ #else /* _POSIX_SOURCE */
+ extern int	chmod P ((const char * file, unsigned long mode));
+ #endif /* POSIX_SOURCE */
+ extern int	close P ((int fd));
+ extern int	creat P ((const char * file, int mode));
+ extern int	execvp P ((const char * name, const char * argv[]));
+ extern void	_exit P ((int status));
+ extern void	exit P ((int status));
+ extern char *	fgets P ((char * string, int size, FILE * stream));
+ extern int	fork P ((void));
+ #ifdef __STDC__
+ /*
+  * Some flaming cretin at Sun decided that free() should be declared
+  * as returning an int in /usr/include/malloc.h, so the following
+  * declaration causes a conflict.  Fortunately, it doesn't really do a
+  * lot of harm to leave it undeclared, since (a) we always properly
+  * ignore the return value and (b) any machine that really needs
+  * special code to handle ignoring the return value is likely to also
+  * provide a correct declaration.
+  *
+  * (Why is this ifdef'ed on __STDC__?  Because I want it to be correct
+  * on my development machine, so I can catch lint problems.)
+  *
+  * A pox on those who violate long-established standards!
+  */
+ extern void	free P ((VOID * area));
+ #endif /* __STDC__ */
+ extern char *	getenv P ((const char * varname));
+ extern int	ioctl P ((int fd, int func, char * arg));
+ extern int	kill P ((int pid, int sig));
+ extern int	link P ((const char * existing, const char * new));
+ extern long	lseek P ((int fd, long offset, int whence));
+ extern VOID *	malloc P ((unsigned int size));
+ #ifdef USG
+ extern VOID *	memcpy P ((VOID * dest, const VOID * src));
+ extern VOID *	memset P ((VOID * dest, int val, unsigned int len));
+ #endif /* USG */
+ extern char *	mktemp P ((char * prototype));
+ extern int	open P ((const char * file, int mode));
+ extern void	perror P ((const char * msg));
+ extern void	qsort P ((VOID * array, unsigned int nelems,
+ 		  unsigned int elemsize,
+ 		  int (*cmp) (const VOID * a, const VOID * b)));
+ extern int	read P ((int fd, VOID * buf, unsigned int n));
+ extern VOID *	realloc P ((VOID * area, unsigned int size));
+ extern unsigned int
+ 		sleep P ((unsigned int));
+ extern char *	strcat P ((char * dest, const char * src));
+ #ifdef USG
+ extern char *	strchr P ((const char * string, int ch));
+ #endif /* USG */
+ extern int	strcmp P ((const char * s1, const char * s2));
+ extern char *	strcpy P ((char * dest, const char * src));
+ extern unsigned	int
+ 		strlen P ((const char * str));
+ extern int	strncmp P ((const char * s1, const char * s2,
+ 		  unsigned int len));
+ #ifdef USG
+ extern char *	strrchr P ((const char * string, int ch));
+ #endif /* USG */
+ extern int	system P ((const char * command));
+ extern int	unlink P ((const char * file));
+ extern int	wait P ((int * statusp));
+ #else /* NO_STDLIB_H */
+ #include <stdlib.h>
+ #include <string.h>
+ #endif /* NO_STDLIB_H */
+ 
+ #ifndef USG
+ extern char *	index P ((const char * string, int ch));
+ extern char *	rindex P ((const char * string, int ch));
+ #endif /* USG */
+ #ifdef REGEX_LOOKUP
+ #ifdef USG
+ extern char *	regcmp P ((const char * expr, const char * terminator, ...));
+ extern char *	regex P ((const char * pat, const char * subject, ...));
+ #else /* USG */
+ extern char *	re_comp P ((const char * expr));
+ extern int *	re_exec P ((const char * pat));
+ #endif /* USG */
+ #endif /* REGEX_LOOKUP */
+ extern int	tgetent P ((char * buf, const char * termname));
+ extern int	tgetnum P ((const char * id));
+ extern char *	tgetstr P ((const char * id, char ** area));
+ extern char *	tgoto P ((const char * cm, int col, int row));
+ extern char *	tputs P ((const char * str, int pad, int (*func) (int ch)));
+ 
+ #ifndef GENERATE_LIBRARY_PROTOS
+ #ifdef __STDC__
+ #undef P
+ #define P(x)	x
+ #endif /* __STDC__ */
+ #endif /* GENERATE_LIBRARY_PROTOS */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/small.txt
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/small.txt:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/small.txt	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,94 ----
+ Kurt Vonnegut's Commencement Address at MIT
+ 
+   "Ladies and gentlemen of the class of '97: 
+ 
+   Wear sunscreen. 
+ 
+   If I could offer you only one tip for the future, sunscreen would be it. The
+   long-term benefits of sunscreen have been proved by scientists, whereas the
+   rest of my advice has no bsis more reliable than my own meandering
+   experience. I will dispense this advice now.
+ 
+   Enjoy the power and beauty of your youth. Oh, never mind. You will not
+   understand the power and beauty of your youth until they've faded. But trust
+   me, in 20 years, you'll look back at photos of yourself and recall in a way
+   you can't grasp now how much possibility lay before you and how fabulous you
+   really looked. You are not as fat as you imagine.
+ 
+   Don't worry about the future. Or worry, but know that worrying is as
+   effective as trying to solve an algera equation by chewing bubble gum. The
+   real troubles in your life are apt to be things that never crossed your
+   worried mind, the kind that blindside you at 4 pm on some idle Tuesday.
+ 
+   Do one thing every day that scares you. 
+ 
+   Sing. 
+ 
+   Don't be reckless with other people's hearts. Don't put up with people who
+   are reckless with yours.
+ 
+   Floss. 
+ 
+   Don't waste your time on jealousy. Sometimes you're ahead, sometimes you're
+   behind. The race is long and, in the end, it's only with yourself.
+ 
+   Remember compliments you receive. Forget the insults. If you succeed in
+   doing this, tell me how.
+ 
+   Keep your old love letters. Throw away your old bank statemnts. 
+ 
+   Stretch. 
+ 
+   Don't feel guilty if you don't know what you want to do with your life. The
+   most interesting people I know didn't know at 22 what they wanted to do with
+   their lives. Some of the most interesting 40-year-olds I know still don't.
+ 
+   Get plenty of calcium. Be kind to your knees. You'll miss them when they're
+   gone.
+ 
+   Maybe you'll marry, maybe you won't. Maybe you'll have children, maybe you
+   won't. Maybe you'll divorce at 40, maybe you'll dance the funky chicken on
+   your 75th wedding anniversary. Whatever you do, don't congratulate yourself
+   too much, or berate yourself either. Your choices are half chance. So are
+   everybody else's.
+ 
+   Enjoy your body. Use it every way you can. Don't be afraid of it or of what
+   other people think of it. It's the greatest instrment you'll ever own.
+ 
+   Dance, even if you have nowhere to do it but your living room. 
+ 
+   Read the directions, even if you don't follow them. 
+ 
+   Do not read beauty magazines. They will only make you feel ugly. 
+ 
+   Get to know your parents. You never know when they'll be gone for good. Be
+   nice to your siblings. They're your best link to your past and the people
+   most likely to stick with you in the future.
+ 
+   Understand that friends come and go, but with a precious few you should hold
+   on. Work hard to bridge the gaps in geography and lifestyle, because the
+   older you get, the more you need the people whoi who knew you when you were
+   young.
+ 
+   Live in New York City once, but leave before it makes you hard. Live in
+   Northern California once, but leave before it makes you soft. Travel.
+ 
+   Accept certain inalienable truths: Prices will rise. Politicians will
+   philander. You, too, will get old. And when you do, you'll fantasize that
+   when you were young, prices were reasonable, politicians were noble, and
+   children respected their elders.
+ 
+   Respect your elders. 
+ 
+   Don't expect anyone else to support you. Maybe you have a trust fund. Maybe
+   you'll have a wealthy spouse. But you never know when either one might run
+   out.
+ 
+   Don't mess too much with your hair or by the time you're 40 it will look 85. 
+ 
+   Be creful whose advice you buy, but be patient with those who supply
+   it. Advice is a form of nostalgia. Dispensing it is a way of fishing the
+   past from the disposal, wiping it off, painting over the ugly parts and
+   recycling it for more than it's worth.
+ 
+   But trst me on the sunscreen."


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/term.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/term.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/term.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,639 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: term.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * term.c - deal with termcap, and unix terminal mode settings
+  *
+  * Pace Willisson, 1983
+  *
+  * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: term.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:05  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.48  1994/10/25  05:46:11  geoff
+  * Fix a couple of places where ifdefs were omitted, though apparently
+  * harmlessly.
+  *
+  * Revision 1.47  1994/09/01  06:06:32  geoff
+  * Change erasechar/killchar to uerasechar/ukillchar to avoid
+  * shared-library problems on HP systems.
+  *
+  * Revision 1.46  1994/01/25  07:12:11  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ #include <signal.h>
+ 
+ #ifdef __GLIBC__
+ /* Use termios under at least glibc */
+ #include <termios.h>
+ #define USE_TERMIOS
+ #ifndef USG
+ #define USG
+ #endif
+ #else
+ #ifdef USG
+ #include <termio.h>
+ #else
+ #include <sgtty.h>
+ #endif
+ #endif
+ 
+ void		erase P ((void));
+ void		move P ((int row, int col));
+ void		inverse P ((void));
+ void		normal P ((void));
+ void		backup P ((void));
+ static int	putch P ((int c));
+ void		terminit P ((void));
+ SIGNAL_TYPE	done P ((int signo));
+ #ifdef SIGTSTP
+ static SIGNAL_TYPE onstop P ((int signo));
+ #endif /* SIGTSTP */
+ void		stop P ((void));
+ int		shellescape P ((char * buf));
+ #ifdef USESH
+ void		shescape P ((char * buf));
+ #endif /* USESH */
+ 
+ void erase ()
+     {
+ #ifdef FIXME
+     if (cl)
+ 	tputs (cl, li, putch);
+     else
+ 	{
+ 	if (ho)
+ 	    tputs (ho, 100, putch);
+ 	else if (cm)
+ 	    tputs (tgoto (cm, 0, 0), 100, putch);
+ 	tputs (cd, li, putch);
+ 	}
+ #endif
+     }
+ 
+ void move (row, col)
+     int		row;
+     int		col;
+     {
+ #ifdef FIXME
+     tputs (tgoto (cm, col, row), 100, putch);
+ #endif
+     }
+ 
+ void inverse ()
+     {
+ #ifdef FIXME
+     tputs (so, 10, putch);
+ #endif
+     }
+ 
+ void normal ()
+     {
+ #ifdef FIXME
+     tputs (se, 10, putch);
+ #endif
+     }
+ 
+ void backup ()
+     {
+ #ifdef FIXME
+     if (BC)
+ 	tputs (BC, 1, putch);
+     else
+ 	(void) putchar ('\b');
+ #endif
+     }
+ 
+ static int putch (c)
+     int			c;
+     {
+ 
+     return putchar (c);
+     }
+ 
+ #ifdef USE_TERMIOS
+ static struct termios	sbuf;
+ static struct termios	osbuf;
+ #else
+ #ifdef USG
+ static struct termio	sbuf;
+ static struct termio	osbuf;
+ #else
+ static struct sgttyb	sbuf;
+ static struct sgttyb	osbuf;
+ #ifdef TIOCSLTC
+ static struct ltchars	ltc;
+ static struct ltchars	oltc;
+ #endif
+ #endif
+ #endif
+ static int		termchanged = 0;
+ static SIGNAL_TYPE	(*oldint) ();
+ static SIGNAL_TYPE	(*oldterm) ();
+ #ifdef SIGTSTP
+ static SIGNAL_TYPE	(*oldttin) ();
+ static SIGNAL_TYPE	(*oldttou) ();
+ static SIGNAL_TYPE	(*oldtstp) ();
+ #endif
+ 
+ void terminit ()
+     {
+ #ifdef TIOCPGRP
+     int			tpgrp;
+ #else
+ #ifdef TIOCGPGRP
+     int			tpgrp;
+ #endif
+ #endif
+ #ifdef TIOCGWINSZ
+     struct winsize	wsize;
+ #endif /* TIOCGWINSZ */
+ 
+ #ifdef FIXME
+     tgetent (termcap, getenv ("TERM"));
+     termptr = termstr;
+     BC = tgetstr ("bc", &termptr);
+     cd = tgetstr ("cd", &termptr);
+     cl = tgetstr ("cl", &termptr);
+     cm = tgetstr ("cm", &termptr);
+     ho = tgetstr ("ho", &termptr);
+     nd = tgetstr ("nd", &termptr);
+     so = tgetstr ("so", &termptr);	/* inverse video on */
+     se = tgetstr ("se", &termptr);	/* inverse video off */
+     if ((sg = tgetnum ("sg")) < 0)	/* space taken by so/se */
+ 	sg = 0;
+     ti = tgetstr ("ti", &termptr);	/* terminal initialization */
+     te = tgetstr ("te", &termptr);	/* terminal termination */
+     co = tgetnum ("co");
+     li = tgetnum ("li");
+ #endif
+ #ifdef TIOCGWINSZ
+     if (ioctl (0, TIOCGWINSZ, (char *) &wsize) >= 0)
+ 	{
+ 	if (wsize.ws_col != 0)
+ 	    co = wsize.ws_col;
+ 	if (wsize.ws_row != 0)
+ 	    li = wsize.ws_row;
+ 	}
+ #endif /* TIOCGWINSZ */
+     /*
+      * Let the variables "LINES" and "COLUMNS" override the termcap
+      * entry.  Technically, this is a terminfo-ism, but I think the
+      * vast majority of users will find it pretty handy.
+      */
+     if (getenv ("COLUMNS") != NULL)
+ 	co = atoi (getenv ("COLUMNS"));
+     if (getenv ("LINES") != NULL)
+ 	li = atoi (getenv ("LINES"));
+ #if MAX_SCREEN_SIZE > 0
+     if (li > MAX_SCREEN_SIZE)
+ 	li = MAX_SCREEN_SIZE;
+ #endif /* MAX_SCREEN_SIZE > 0 */
+ #if MAXCONTEXT == MINCONTEXT
+     contextsize = MINCONTEXT;
+ #else /* MAXCONTEXT == MINCONTEXT */
+     if (contextsize == 0)
+ #ifdef CONTEXTROUNDUP
+ 	contextsize = (li * CONTEXTPCT + 99) / 100;
+ #else /* CONTEXTROUNDUP */
+ 	contextsize = (li * CONTEXTPCT) / 100;
+ #endif /* CONTEXTROUNDUP */
+     if (contextsize > MAXCONTEXT)
+ 	contextsize = MAXCONTEXT;
+     else if (contextsize < MINCONTEXT)
+ 	contextsize = MINCONTEXT;
+ #endif /* MAX_CONTEXT == MIN_CONTEXT */
+     /*
+      * Insist on 2 lines for the screen header, 2 for blank lines
+      * separating areas of the screen, 2 for word choices, and 2 for
+      * the minimenu, plus however many are needed for context.  If
+      * possible, make the context smaller to fit on the screen.
+      */
+     if (li < contextsize + 8  &&  contextsize > MINCONTEXT)
+ 	{
+ 	contextsize = li - 8;
+ 	if (contextsize < MINCONTEXT)
+ 	    contextsize = MINCONTEXT;
+ 	}
+     if (li < MINCONTEXT + 8)
+ 	(void) fprintf (stderr, TERM_C_SMALL_SCREEN, MINCONTEXT + 8);
+ 
+ #ifdef SIGTSTP
+ #ifdef TIOCPGRP
+ retry:
+ #endif /* SIGTSTP */
+ #endif /* TIOCPGRP */
+ 
+ #ifdef USG
+     if (!isatty (0))
+ 	{
+ 	(void) fprintf (stderr, TERM_C_NO_BATCH);
+ 	exit (1);
+ 	}
+ #ifdef USE_TERMIOS
+     (void) tcgetattr (0, &osbuf);
+ #else
+     (void) ioctl (0, TCGETA, (char *) &osbuf);
+ #endif
+     termchanged = 1;
+ 
+     sbuf = osbuf;
+     sbuf.c_lflag &= ~(ECHO | ECHOK | ECHONL | ICANON);
+     sbuf.c_oflag &= ~(OPOST);
+     sbuf.c_iflag &= ~(INLCR | IGNCR | ICRNL);
+     sbuf.c_cc[VMIN] = 1;
+     sbuf.c_cc[VTIME] = 1;
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &sbuf);
+ #else
+     (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #endif
+ 
+     uerasechar = osbuf.c_cc[VERASE];
+     ukillchar = osbuf.c_cc[VKILL];
+ 
+ #endif
+ 
+ #ifdef SIGTSTP
+ #ifndef USG
+     (void) sigsetmask (1<<(SIGTSTP-1) | 1<<(SIGTTIN-1) | 1<<(SIGTTOU-1));
+ #endif
+ #endif
+ #ifdef TIOCGPGRP
+     if (ioctl (0, TIOCGPGRP, (char *) &tpgrp) != 0)
+ 	{
+ 	(void) fprintf (stderr, TERM_C_NO_BATCH);
+ 	exit (1);
+ 	}
+ #endif
+ #ifdef SIGTSTP
+ #ifdef TIOCPGRP
+     if (tpgrp != getpgrp(0)) /* not in foreground */
+ 	{
+ #ifndef USG
+ 	(void) sigsetmask (1 << (SIGTSTP - 1) | 1 << (SIGTTIN - 1));
+ #endif
+ 	(void) signal (SIGTTOU, SIG_DFL);
+ 	(void) kill (0, SIGTTOU);
+ 	/* job stops here waiting for SIGCONT */
+ 	goto retry;
+ 	}
+ #endif
+ #endif
+ 
+ #ifndef USG
+     (void) ioctl (0, TIOCGETP, (char *) &osbuf);
+ #ifdef TIOCGLTC
+     (void) ioctl (0, TIOCGLTC, (char *) &oltc);
+ #endif
+     termchanged = 1;
+ 
+     sbuf = osbuf;
+     sbuf.sg_flags &= ~ECHO;
+     sbuf.sg_flags |= TERM_MODE;
+     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
+ 
+     uerasechar = sbuf.sg_erase;
+     ukillchar = sbuf.sg_kill;
+ 
+ #ifdef TIOCSLTC
+     ltc = oltc;
+     ltc.t_suspc = -1;
+     (void) ioctl (0, TIOCSLTC, (char *) &ltc);
+ #endif
+ 
+ #endif /* USG */
+ 
+     if ((oldint = signal (SIGINT, SIG_IGN)) != SIG_IGN)
+ 	(void) signal (SIGINT, done);
+     if ((oldterm = signal (SIGTERM, SIG_IGN)) != SIG_IGN)
+ 	(void) signal (SIGTERM, done);
+ 
+ #ifdef SIGTSTP
+ #ifndef USG
+     (void) sigsetmask (0);
+ #endif
+     if ((oldttin = signal (SIGTTIN, SIG_IGN)) != SIG_IGN)
+ 	(void) signal (SIGTTIN, onstop);
+     if ((oldttou = signal (SIGTTOU, SIG_IGN)) != SIG_IGN)
+ 	(void) signal (SIGTTOU, onstop);
+     if ((oldtstp = signal (SIGTSTP, SIG_IGN)) != SIG_IGN)
+ 	(void) signal (SIGTSTP, onstop);
+ #endif
+ #ifdef FIXME
+     if (ti)
+ 	tputs (ti, 1, putch);
+ #endif
+     }
+ 
+ /* ARGSUSED */
+ SIGNAL_TYPE done (signo)
+     int		signo;
+     {
+     if (tempfile[0] != '\0')
+ 	(void) unlink (tempfile);
+     if (termchanged)
+ 	{
+ #ifdef FIXME
+ 	if (te)
+ 	    tputs (te, 1, putch);
+ #ifdef USE_TERMIOS
+ 	(void) tcsetattr (0, TCSADRAIN, &osbuf);
+ #else
+ #ifdef USG
+ 	(void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+ 	(void) ioctl (0, TIOCSETP, (char *) &osbuf);
+ #ifdef TIOCSLTC
+ 	(void) ioctl (0, TIOCSLTC, (char *) &oltc);
+ #endif
+ #endif
+ #endif
+ #endif
+ 	}
+     exit (0);
+     }
+ 
+ #ifdef SIGTSTP
+ static SIGNAL_TYPE onstop (signo)
+     int		signo;
+     {
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &osbuf);
+ #else
+ #ifdef USG
+     (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+ #ifdef TIOCSLTC
+     (void) ioctl (0, TIOCSLTC, (char *) &oltc);
+ #endif
+ #endif
+ #endif
+     (void) signal (signo, SIG_DFL);
+ #ifndef USG
+     (void) sigsetmask (sigblock (0) & ~(1 << (signo - 1)));
+ #endif
+     (void) kill (0, signo);
+     /* stop here until continued */
+     (void) signal (signo, onstop);
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &sbuf);
+ #else
+ #ifdef USG
+     (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #else
+     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
+ #ifdef TIOCSLTC
+     (void) ioctl (0, TIOCSLTC, (char *) &ltc);
+ #endif
+ #endif
+ #endif
+     }
+ #endif
+ 
+ void stop ()
+     {
+ #ifdef SIGTSTP
+     onstop (SIGTSTP);
+ #else
+     /* for System V */
+     move (li - 1, 0);
+     (void) fflush (stdout);
+     if (getenv ("SHELL"))
+ 	(void) shellescape (getenv ("SHELL"));
+     else
+ 	(void) shellescape ("sh");
+ #endif
+     }
+ 
+ /* Fork and exec a process.  Returns NZ if command found, regardless of
+ ** command's return status.  Returns zero if command was not found.
+ ** Doesn't use a shell.
+ */
+ #ifndef USESH
+ #define NEED_SHELLESCAPE
+ #endif /* USESH */
+ #ifndef REGEX_LOOKUP
+ #define NEED_SHELLESCAPE
+ #endif /* REGEX_LOOKUP */
+ #ifdef NEED_SHELLESCAPE
+ int shellescape	(buf)
+     char *	buf;
+     {
+     char *	argv[100];
+     char *	cp = buf;
+     int		i = 0;
+     int		termstat;
+ 
+     /* parse buf to args (destroying it in the process) */
+     while (*cp != '\0')
+ 	{
+ 	while (*cp == ' '  ||  *cp == '\t')
+ 	    ++cp;
+ 	if (*cp == '\0')
+ 	    break;
+ 	argv[i++] = cp;
+ 	while (*cp != ' '  &&  *cp != '\t'  &&  *cp != '\0')
+ 	    ++cp;
+ 	if (*cp != '\0')
+ 	    *cp++ = '\0';
+ 	}
+     argv[i] = NULL;
+ 
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &osbuf);
+ #else
+ #ifdef USG
+     (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+ #ifdef TIOCSLTC
+     (void) ioctl (0, TIOCSLTC, (char *) &oltc);
+ #endif /* TIOCSLTC */
+ #endif
+ #endif
+     (void) signal (SIGINT, oldint);
+     (void) signal (SIGTERM, oldterm);
+ #ifdef SIGTSTP
+     (void) signal (SIGTTIN, oldttin);
+     (void) signal (SIGTTOU, oldttou);
+     (void) signal (SIGTSTP, oldtstp);
+ #endif
+     if ((i = fork ()) == 0)
+ 	{
+ 	(void) execvp (argv[0], (char **) argv);
+ 	_exit (123);		/* Command not found */
+ 	}
+     else if (i > 0)
+ 	{
+ 	while (wait (&termstat) != i)
+ 	    ;
+ 	termstat = (termstat == (123 << 8)) ? 0 : -1;
+ 	}
+     else
+ 	{
+ 	(void) printf (TERM_C_CANT_FORK);
+ 	termstat = -1;		/* Couldn't fork */
+ 	}
+ 
+     if (oldint != SIG_IGN)
+ 	(void) signal (SIGINT, done);
+     if (oldterm != SIG_IGN)
+ 	(void) signal (SIGTERM, done);
+ 
+ #ifdef SIGTSTP
+     if (oldttin != SIG_IGN)
+ 	(void) signal (SIGTTIN, onstop);
+     if (oldttou != SIG_IGN)
+ 	(void) signal (SIGTTOU, onstop);
+     if (oldtstp != SIG_IGN)
+ 	(void) signal (SIGTSTP, onstop);
+ #endif
+ 
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &sbuf);
+ #else
+ #ifdef USG
+     (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #else
+     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
+ #ifdef TIOCSLTC
+     (void) ioctl (0, TIOCSLTC, (char *) &ltc);
+ #endif /* TIOCSLTC */
+ #endif
+ #endif
+     if (termstat)
+ 	{
+ 	(void) printf (TERM_C_TYPE_SPACE);
+ 	(void) fflush (stdout);
+ #ifdef COMMANDFORSPACE
+ 	i = GETKEYSTROKE ();
+ 	if (i != ' ' && i != '\n' && i != '\r')
+ 	    (void) ungetc (i, stdin);
+ #else
+ 	while (GETKEYSTROKE () != ' ')
+ 	    ;
+ #endif
+ 	}
+     return (termstat);
+     }
+ #endif /* NEED_SHELLESCAPE */
+ 
+ #ifdef	USESH
+ void shescape (buf)
+     char *	buf;
+     {
+ #ifdef COMMANDFORSPACE
+     int		ch;
+ #endif
+ 
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &osbuf);
+ #else
+ #ifdef USG
+     (void) ioctl (0, TCSETAW, (char *) &osbuf);
+ #else
+     (void) ioctl (0, TIOCSETP, (char *) &osbuf);
+ #ifdef TIOCSLTC
+     (void) ioctl (0, TIOCSLTC, (char *) &oltc);
+ #endif
+ #endif
+ #endif
+     (void) signal (SIGINT, oldint);
+     (void) signal (SIGTERM, oldterm);
+ #ifdef SIGTSTP
+     (void) signal (SIGTTIN, oldttin);
+     (void) signal (SIGTTOU, oldttou);
+     (void) signal (SIGTSTP, oldtstp);
+ #endif
+ 
+     (void) system (buf);
+ 
+     if (oldint != SIG_IGN)
+ 	(void) signal (SIGINT, done);
+     if (oldterm != SIG_IGN)
+ 	(void) signal (SIGTERM, done);
+ 
+ #ifdef SIGTSTP
+     if (oldttin != SIG_IGN)
+ 	(void) signal (SIGTTIN, onstop);
+     if (oldttou != SIG_IGN)
+ 	(void) signal (SIGTTOU, onstop);
+     if (oldtstp != SIG_IGN)
+ 	(void) signal (SIGTSTP, onstop);
+ #endif
+ 
+ #ifdef USE_TERMIOS
+     (void) tcsetattr (0, TCSANOW, &sbuf);
+ #else
+ #ifdef USG
+     (void) ioctl (0, TCSETAW, (char *) &sbuf);
+ #else
+     (void) ioctl (0, TIOCSETP, (char *) &sbuf);
+ #ifdef TIOCSLTC
+     (void) ioctl (0, TIOCSLTC, (char *) &ltc);
+ #endif
+ #endif
+ #endif
+     (void) printf (TERM_C_TYPE_SPACE);
+     (void) fflush (stdout);
+ #ifdef COMMANDFORSPACE
+     ch = GETKEYSTROKE ();
+     if (ch != ' '  &&  ch != '\n'  &&  ch != '\r')
+ 	(void) ungetc (ch, stdin);
+ #else
+     while (GETKEYSTROKE () != ' ')
+ 	;
+ #endif
+     }
+ #endif


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/tgood.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/tgood.c:1.1
*** /dev/null	Tue Jan  9 17:57:52 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/tgood.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,667 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: tgood.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * Table-driven version of good.c.
+  *
+  * Geoff Kuenning, July 1987
+  */
+ 
+ /*
+  * $Log: tgood.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:05  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.32  1994/11/02  06:56:16  geoff
+  * Remove the anyword feature, which I've decided is a bad idea.
+  *
+  * Revision 1.31  1994/10/25  05:46:25  geoff
+  * Add support for the FF_ANYWORD (affix applies to all words, even if
+  * flag bit isn't set) flag option.
+  *
+  * Revision 1.30  1994/05/24  06:23:08  geoff
+  * Don't create a hit if "allhits" is clear and capitalization
+  * mismatches.  This cures a bug where a word could be in the dictionary
+  * and yet not found.
+  *
+  * Revision 1.29  1994/05/17  06:44:21  geoff
+  * Add support for controlled compound formation and the COMPOUNDONLY
+  * option to affix flags.
+  *
+  * Revision 1.28  1994/01/25  07:12:13  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include <ctype.h>
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ 
+ void		chk_aff P ((ichar_t * word, ichar_t * ucword, int len,
+ 		  int ignoreflagbits, int allhits, int pfxopts, int sfxopts));
+ static void	pfx_list_chk P ((ichar_t * word, ichar_t * ucword,
+ 		  int len, int optflags, int sfxopts, struct flagptr * ind,
+ 		  int ignoreflagbits, int allhits));
+ static void	chk_suf P ((ichar_t * word, ichar_t * ucword, int len,
+ 		  int optflags, struct flagent * pfxent, int ignoreflagbits,
+ 		  int allhits));
+ static void	suf_list_chk P ((ichar_t * word, ichar_t * ucword, int len,
+ 		  struct flagptr * ind, int optflags, struct flagent * pfxent,
+ 		  int ignoreflagbits, int allhits));
+ int		expand_pre P ((char * croot, ichar_t * rootword,
+ 		  MASKTYPE mask[], int option, char * extra));
+ static int	pr_pre_expansion P ((char * croot, ichar_t * rootword,
+ 		  struct flagent * flent, MASKTYPE mask[], int option,
+ 		  char * extra));
+ int		expand_suf P ((char * croot, ichar_t * rootword,
+ 		  MASKTYPE mask[], int optflags, int option, char * extra));
+ static int	pr_suf_expansion P ((char * croot, ichar_t * rootword,
+ 		  struct flagent * flent, int option, char * extra));
+ static void	forcelc P ((ichar_t * dst, int len));
+ 
+ /* Check possible affixes */
+ void chk_aff (word, ucword, len, ignoreflagbits, allhits, pfxopts, sfxopts)
+     ichar_t *		word;		/* Word to be checked */
+     ichar_t *		ucword;		/* Upper-case-only copy of word */
+     int			len;		/* The length of word/ucword */
+     int			ignoreflagbits;	/* Ignore whether affix is legal */
+     int			allhits;	/* Keep going after first hit */
+     int			pfxopts;	/* Options to apply to prefixes */
+     int			sfxopts;	/* Options to apply to suffixes */
+     {
+     register ichar_t *	cp;		/* Pointer to char to index on */
+     struct flagptr *	ind;		/* Flag index table to test */
+ 
+     pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &pflagindex[0],
+       ignoreflagbits, allhits);
+     cp = ucword;
+     ind = &pflagindex[*cp++];
+     while (ind->numents == 0  &&  ind->pu.fp != NULL)
+ 	{
+ 	if (*cp == 0)
+ 	    return;
+ 	if (ind->pu.fp[0].numents)
+ 	    {
+ 	    pfx_list_chk (word, ucword, len, pfxopts, sfxopts, &ind->pu.fp[0],
+ 	      ignoreflagbits, allhits);
+ 	    if (numhits  &&  !allhits  &&  !cflag  &&  !ignoreflagbits)
+ 		return;
+ 	    }
+ 	ind = &ind->pu.fp[*cp++];
+ 	}
+     pfx_list_chk (word, ucword, len, pfxopts, sfxopts, ind, ignoreflagbits,
+       allhits);
+     if (numhits  &&  !allhits  &&  !cflag  &&  !ignoreflagbits)
+ 	return;
+     chk_suf (word, ucword, len, sfxopts, (struct flagent *) NULL,
+       ignoreflagbits, allhits);
+     }
+ 
+ /* Check some prefix flags */
+ static void pfx_list_chk (word, ucword, len, optflags, sfxopts, ind,
+   ignoreflagbits, allhits)
+     ichar_t *		word;		/* Word to be checked */
+     ichar_t *		ucword;		/* Upper-case-only word */
+     int			len;		/* The length of ucword */
+     int			optflags;	/* Options to apply */
+     int			sfxopts;	/* Options to apply to suffixes */
+     struct flagptr *	ind;		/* Flag index table */
+     int			ignoreflagbits;	/* Ignore whether affix is legal */
+     int			allhits;	/* Keep going after first hit */
+     {
+     int			cond;		/* Condition number */
+     register ichar_t *	cp;		/* Pointer into end of ucword */
+     struct dent *	dent;		/* Dictionary entry we found */
+     int			entcount;	/* Number of entries to process */
+     register struct flagent *
+ 			flent;		/* Current table entry */
+     int			preadd;		/* Length added to tword2 as prefix */
+     register int	tlen;		/* Length of tword */
+     ichar_t		tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */
+     ichar_t		tword2[sizeof tword]; /* 2nd copy for ins_root_cap */
+ 
+     for (flent = ind->pu.ent, entcount = ind->numents;
+       entcount > 0;
+       flent++, entcount--)
+ 	{
+ 	/*
+ 	 * If this is a compound-only affix, ignore it unless we're
+ 	 * looking for that specific thing.
+ 	 */
+ 	if ((flent->flagflags & FF_COMPOUNDONLY) != 0
+ 	  &&  (optflags & FF_COMPOUNDONLY) == 0)
+ 	    continue;
+ 	/*
+ 	 * In COMPOUND_CONTROLLED mode, the FF_COMPOUNDONLY bit must
+ 	 * match exactly.
+ 	 */
+ 	if (compoundflag == COMPOUND_CONTROLLED
+ 	  &&  ((flent->flagflags ^ optflags) & FF_COMPOUNDONLY) != 0)
+ 	    continue;
+ 	/*
+ 	 * See if the prefix matches.
+ 	 */
+ 	tlen = len - flent->affl;
+ 	if (tlen > 0
+ 	  &&  (flent->affl == 0
+ 	    ||  icharncmp (flent->affix, ucword, flent->affl) == 0)
+ 	  &&  tlen + flent->stripl >= flent->numconds)
+ 	    {
+ 	    /*
+ 	     * The prefix matches.  Remove it, replace it by the "strip"
+ 	     * string (if any), and check the original conditions.
+ 	     */
+ 	    if (flent->stripl)
+ 		(void) icharcpy (tword, flent->strip);
+ 	    (void) icharcpy (tword + flent->stripl, ucword + flent->affl);
+ 	    cp = tword;
+ 	    for (cond = 0;  cond < flent->numconds;  cond++)
+ 		{
+ 		if ((flent->conds[*cp++] & (1 << cond)) == 0)
+ 		    break;
+ 		}
+ 	    if (cond >= flent->numconds)
+ 		{
+ 		/*
+ 		 * The conditions match.  See if the word is in the
+ 		 * dictionary.
+ 		 */
+ 		tlen += flent->stripl;
+ 		if (cflag)
+ 		    flagpr (tword, BITTOCHAR (flent->flagbit), flent->stripl,
+ 		      flent->affl, -1, 0);
+ 		else if (ignoreflagbits)
+ 		    {
+ 		    if ((dent = lookup (tword, 1)) != NULL)
+ 			{
+ 			cp = tword2;
+ 			if (flent->affl)
+ 			    {
+ 			    (void) icharcpy (cp, flent->affix);
+ 			    cp += flent->affl;
+ 			    *cp++ = '+';
+ 			    }
+ 			preadd = cp - tword2;
+ 			(void) icharcpy (cp, tword);
+ 			cp += tlen;
+ 			if (flent->stripl)
+ 			    {
+ 			    *cp++ = '-';
+ 			    (void) icharcpy (cp, flent->strip);
+ 			    }
+ 			(void) ins_root_cap (tword2, word,
+ 			  flent->stripl, preadd,
+ 			  0, (cp - tword2) - tlen - preadd,
+ 			  dent, flent, (struct flagent *) NULL);
+ 			}
+ 		    }
+ 		else if ((dent = lookup (tword, 1)) != NULL
+ 		  &&  TSTMASKBIT (dent->mask, flent->flagbit))
+ 		    {
+ 		    if (numhits < MAX_HITS)
+ 			{
+ 			hits[numhits].dictent = dent;
+ 			hits[numhits].prefix = flent;
+ 			hits[numhits].suffix = NULL;
+ 			numhits++;
+ 			}
+ 		    if (!allhits)
+ 			{
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 			if (cap_ok (word, &hits[0], len))
+ 			    return;
+ 			numhits = 0;
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ 			return;
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 			}
+ 		    }
+ 		/*
+ 		 * Handle cross-products.
+ 		 */
+ 		if (flent->flagflags & FF_CROSSPRODUCT)
+ 		    chk_suf (word, tword, tlen, sfxopts | FF_CROSSPRODUCT,
+ 		      flent, ignoreflagbits, allhits);
+ 		}
+ 	    }
+ 	}
+     }
+ 
+ /* Check possible suffixes */
+ static void chk_suf (word, ucword, len, optflags, pfxent, ignoreflagbits,
+   allhits)
+     ichar_t *		word;		/* Word to be checked */
+     ichar_t *		ucword;		/* Upper-case-only word */
+     int			len;		/* The length of ucword */
+     int			optflags;	/* Affix option flags */
+     struct flagent *	pfxent;		/* Prefix flag entry if cross-prod */
+     int			ignoreflagbits;	/* Ignore whether affix is legal */
+     int			allhits;	/* Keep going after first hit */
+     {
+     register ichar_t *	cp;		/* Pointer to char to index on */
+     struct flagptr *	ind;		/* Flag index table to test */
+ 
+     suf_list_chk (word, ucword, len, &sflagindex[0], optflags, pfxent,
+       ignoreflagbits, allhits);
+     cp = ucword + len - 1;
+     ind = &sflagindex[*cp];
+     while (ind->numents == 0  &&  ind->pu.fp != NULL)
+ 	{
+ 	if (cp == ucword)
+ 	    return;
+ 	if (ind->pu.fp[0].numents)
+ 	    {
+ 	    suf_list_chk (word, ucword, len, &ind->pu.fp[0],
+ 	      optflags, pfxent, ignoreflagbits, allhits);
+ 	    if (numhits != 0  &&  !allhits  &&  !cflag  &&  !ignoreflagbits)
+ 		return;
+ 	    }
+ 	ind = &ind->pu.fp[*--cp];
+ 	}
+     suf_list_chk (word, ucword, len, ind, optflags, pfxent,
+       ignoreflagbits, allhits);
+     }
+     
+ static void suf_list_chk (word, ucword, len, ind, optflags, pfxent,
+   ignoreflagbits, allhits)
+     ichar_t *		word;		/* Word to be checked */
+     ichar_t *		ucword;		/* Upper-case-only word */
+     int			len;		/* The length of ucword */
+     struct flagptr *	ind;		/* Flag index table */
+     int			optflags;	/* Affix option flags */
+     struct flagent *	pfxent;		/* Prefix flag entry if crossonly */
+     int			ignoreflagbits;	/* Ignore whether affix is legal */
+     int			allhits;	/* Keep going after first hit */
+     {
+     register ichar_t *	cp;		/* Pointer into end of ucword */
+     int			cond;		/* Condition number */
+     struct dent *	dent;		/* Dictionary entry we found */
+     int			entcount;	/* Number of entries to process */
+     register struct flagent *
+ 			flent;		/* Current table entry */
+     int			preadd;		/* Length added to tword2 as prefix */
+     register int	tlen;		/* Length of tword */
+     ichar_t		tword[INPUTWORDLEN + 4 * MAXAFFIXLEN + 4]; /* Tmp cpy */
+     ichar_t		tword2[sizeof tword]; /* 2nd copy for ins_root_cap */
+ 
+     (void) icharcpy (tword, ucword);
+     for (flent = ind->pu.ent, entcount = ind->numents;
+       entcount > 0;
+       flent++, entcount--)
+ 	{
+ 	if ((optflags & FF_CROSSPRODUCT) != 0
+ 	  &&  (flent->flagflags & FF_CROSSPRODUCT) == 0)
+ 	    continue;
+ 	/*
+ 	 * If this is a compound-only affix, ignore it unless we're
+ 	 * looking for that specific thing.
+ 	 */
+ 	if ((flent->flagflags & FF_COMPOUNDONLY) != 0
+ 	  &&  (optflags & FF_COMPOUNDONLY) == 0)
+ 	    continue;
+ 	/*
+ 	 * In COMPOUND_CONTROLLED mode, the FF_COMPOUNDONLY bit must
+ 	 * match exactly.
+ 	 */
+ 	if (compoundflag == COMPOUND_CONTROLLED
+ 	  &&  ((flent->flagflags ^ optflags) & FF_COMPOUNDONLY) != 0)
+ 	    continue;
+ 	/*
+ 	 * See if the suffix matches.
+ 	 */
+ 	tlen = len - flent->affl;
+ 	if (tlen > 0
+ 	  &&  (flent->affl == 0
+ 	    ||  icharcmp (flent->affix, ucword + tlen) == 0)
+ 	  &&  tlen + flent->stripl >= flent->numconds)
+ 	    {
+ 	    /*
+ 	     * The suffix matches.  Remove it, replace it by the "strip"
+ 	     * string (if any), and check the original conditions.
+ 	     */
+ 	    (void) icharcpy (tword, ucword);
+ 	    cp = tword + tlen;
+ 	    if (flent->stripl)
+ 		{
+ 		(void) icharcpy (cp, flent->strip);
+ 		tlen += flent->stripl;
+ 		cp = tword + tlen;
+ 		}
+ 	    else
+ 		*cp = '\0';
+ 	    for (cond = flent->numconds;  --cond >= 0;  )
+ 		{
+ 		if ((flent->conds[*--cp] & (1 << cond)) == 0)
+ 		    break;
+ 		}
+ 	    if (cond < 0)
+ 		{
+ 		/*
+ 		 * The conditions match.  See if the word is in the
+ 		 * dictionary.
+ 		 */
+ 		if (cflag)
+ 		    {
+ 		    if (optflags & FF_CROSSPRODUCT)
+ 			flagpr (tword, BITTOCHAR (pfxent->flagbit),
+ 			  pfxent->stripl, pfxent->affl,
+ 			  BITTOCHAR (flent->flagbit), flent->affl);
+ 		    else
+ 			flagpr (tword, -1, 0, 0,
+ 			  BITTOCHAR (flent->flagbit), flent->affl);
+ 		    }
+ 		else if (ignoreflagbits)
+ 		    {
+ 		    if ((dent = lookup (tword, 1)) != NULL)
+ 			{
+ 			cp = tword2;
+ 			if ((optflags & FF_CROSSPRODUCT)
+ 			  &&  pfxent->affl != 0)
+ 			    {
+ 			    (void) icharcpy (cp, pfxent->affix);
+ 			    cp += pfxent->affl;
+ 			    *cp++ = '+';
+ 			    }
+ 			preadd = cp - tword2;
+ 			(void) icharcpy (cp, tword);
+ 			cp += tlen;
+ 			if ((optflags & FF_CROSSPRODUCT)
+ 			  &&  pfxent->stripl != 0)
+ 			    {
+ 			    *cp++ = '-';
+ 			    (void) icharcpy (cp, pfxent->strip);
+ 			    cp += pfxent->stripl;
+ 			    }
+ 			if (flent->stripl)
+ 			    {
+ 			    *cp++ = '-';
+ 			    (void) icharcpy (cp, flent->strip);
+ 			    cp += flent->stripl;
+ 			    }
+ 			if (flent->affl)
+ 			    {
+ 			    *cp++ = '+';
+ 			    (void) icharcpy (cp, flent->affix);
+ 			    cp += flent->affl;
+ 			    }
+ 			(void) ins_root_cap (tword2, word,
+ 			  (optflags & FF_CROSSPRODUCT) ? pfxent->stripl : 0,
+ 			  preadd,
+ 			  flent->stripl, (cp - tword2) - tlen - preadd,
+ 			  dent, pfxent, flent);
+ 			}
+ 		    }
+ 		else if ((dent = lookup (tword, 1)) != NULL
+ 		  &&  TSTMASKBIT (dent->mask, flent->flagbit)
+ 		  &&  ((optflags & FF_CROSSPRODUCT) == 0
+ 		    || TSTMASKBIT (dent->mask, pfxent->flagbit)))
+ 		    {
+ 		    if (numhits < MAX_HITS)
+ 			{
+ 			hits[numhits].dictent = dent;
+ 			hits[numhits].prefix = pfxent;
+ 			hits[numhits].suffix = flent;
+ 			numhits++;
+ 			}
+ 		    if (!allhits)
+ 			{
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 			if (cap_ok (word, &hits[0], len))
+ 			    return;
+ 			numhits = 0;
+ #else /* NO_CAPITALIZATION_SUPPORT */
+ 			return;
+ #endif /* NO_CAPITALIZATION_SUPPORT */
+ 			}
+ 		    }
+ 		}
+ 	    }
+ 	}
+     }
+ 
+ /*
+  * Expand a dictionary prefix entry
+  */
+ int expand_pre (croot, rootword, mask, option, extra)
+     char *			croot;		/* Char version of rootword */
+     ichar_t *			rootword;	/* Root word to expand */
+     register MASKTYPE		mask[];		/* Mask bits to expand on */
+     int				option;		/* Option, see expandmode */
+     char *			extra;		/* Extra info to add to line */
+     {
+     int				entcount;	/* No. of entries to process */
+     int				explength;	/* Length of expansions */
+     register struct flagent *
+ 				flent;		/* Current table entry */
+ 
+     for (flent = pflaglist, entcount = numpflags, explength = 0;
+       entcount > 0;
+       flent++, entcount--)
+ 	{
+ 	if (TSTMASKBIT (mask, flent->flagbit))
+ 	    explength +=
+ 	      pr_pre_expansion (croot, rootword, flent, mask, option, extra);
+ 	}
+     return explength;
+     }
+ 
+ /* Print a prefix expansion */
+ static int pr_pre_expansion (croot, rootword, flent, mask, option, extra)
+     char *			croot;		/* Char version of rootword */
+     register ichar_t *		rootword;	/* Root word to expand */
+     register struct flagent *	flent;		/* Current table entry */
+     MASKTYPE			mask[];		/* Mask bits to expand on */
+     int				option;		/* Option, see	expandmode */
+     char *			extra;		/* Extra info to add to line */
+     {
+     int				cond;		/* Current condition number */
+     register ichar_t *		nextc;		/* Next case choice */
+     int				tlen;		/* Length of tword */
+     ichar_t			tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */
+ 
+     tlen = icharlen (rootword);
+     if (flent->numconds > tlen)
+ 	return 0;
+     tlen -= flent->stripl;
+     if (tlen <= 0)
+ 	return 0;
+     tlen += flent->affl;
+     for (cond = 0, nextc = rootword;  cond < flent->numconds;  cond++)
+ 	{
+ 	if ((flent->conds[mytoupper (*nextc++)] & (1 << cond)) == 0)
+ 	    return 0;
+ 	}
+     /*
+      * The conditions are satisfied.  Copy the word, add the prefix,
+      * and make it the proper case.   This code is carefully written
+      * to match that ins_cap and cap_ok.  Note that the affix, as
+      * inserted, is uppercase.
+      *
+      * There is a tricky bit here:  if the root is capitalized, we
+      * want a capitalized result.  If the root is followcase, however,
+      * we want to duplicate the case of the first remaining letter
+      * of the root.  In other words, "Loved/U" should generate "Unloved",
+      * but "LOved/U" should generate "UNLOved" and "lOved/U" should
+      * produce "unlOved".
+      */
+     if (flent->affl)
+ 	{
+ 	(void) icharcpy (tword, flent->affix);
+ 	nextc = tword + flent->affl;
+ 	}
+     (void) icharcpy (nextc, rootword + flent->stripl);
+     if (myupper (rootword[0]))
+ 	{
+ 	/* We must distinguish followcase from capitalized and all-upper */
+ 	for (nextc = rootword + 1;  *nextc;  nextc++)
+ 	    {
+ 	    if (!myupper (*nextc))
+ 		break;
+ 	    }
+ 	if (*nextc)
+ 	    {
+ 	    /* It's a followcase or capitalized word.  Figure out which. */
+ 	    for (  ;  *nextc;  nextc++)
+ 		{
+ 		if (myupper (*nextc))
+ 		    break;
+ 		}
+ 	    if (*nextc)
+ 		{
+ 		/* It's followcase. */
+ 		if (!myupper (tword[flent->affl]))
+ 		    forcelc (tword, flent->affl);
+ 		}
+ 	    else
+ 		{
+ 		/* It's capitalized */
+ 		forcelc (tword + 1, tlen - 1);
+ 		}
+ 	    }
+ 	}
+     else
+ 	{
+ 	/* Followcase or all-lower, we don't care which */
+ 	if (!myupper (*nextc))
+ 	    forcelc (tword, flent->affl);
+ 	}
+     if (option == 3)
+ 	(void) printf ("\n%s", croot);
+     if (option != 4)
+ 	(void) printf (" %s%s", ichartosstr (tword, 1), extra);
+     if (flent->flagflags & FF_CROSSPRODUCT)
+ 	return tlen
+ 	  + expand_suf (croot, tword, mask, FF_CROSSPRODUCT, option, extra);
+     else
+ 	return tlen;
+     }
+ 
+ /*
+  * Expand a dictionary suffix entry
+  */
+ int expand_suf (croot, rootword, mask, optflags, option, extra)
+     char *			croot;		/* Char version of rootword */
+     ichar_t *			rootword;	/* Root word to expand */
+     register MASKTYPE		mask[];		/* Mask bits to expand on */
+     int				optflags;	/* Affix option flags */
+     int				option;		/* Option, see expandmode */
+     char *			extra;		/* Extra info to add to line */
+     {
+     int				entcount;	/* No. of entries to process */
+     int				explength;	/* Length of expansions */
+     register struct flagent *
+ 				flent;		/* Current table entry */
+ 
+     for (flent = sflaglist, entcount = numsflags, explength = 0;
+       entcount > 0;
+       flent++, entcount--)
+ 	{
+ 	if (TSTMASKBIT (mask, flent->flagbit))
+ 	    {
+ 	    if ((optflags & FF_CROSSPRODUCT) == 0
+ 	      ||  (flent->flagflags & FF_CROSSPRODUCT))
+ 		explength +=
+ 		  pr_suf_expansion (croot, rootword, flent, option, extra);
+ 	    }
+ 	}
+     return explength;
+     }
+ 
+ /* Print a suffix expansion */
+ static int pr_suf_expansion (croot, rootword, flent, option, extra)
+     char *			croot;		/* Char version of rootword */
+     register ichar_t *		rootword;	/* Root word to expand */
+     register struct flagent *	flent;		/* Current table entry */
+     int				option;		/* Option, see expandmode */
+     char *			extra;		/* Extra info to add to line */
+     {
+     int				cond;		/* Current condition number */
+     register ichar_t *		nextc;		/* Next case choice */
+     int				tlen;		/* Length of tword */
+     ichar_t			tword[INPUTWORDLEN + MAXAFFIXLEN]; /* Temp */
+ 
+     tlen = icharlen (rootword);
+     cond = flent->numconds;
+     if (cond > tlen)
+ 	return 0;
+     if (tlen - flent->stripl <= 0)
+ 	return 0;
+     for (nextc = rootword + tlen;  --cond >= 0;  )
+ 	{
+ 	if ((flent->conds[mytoupper (*--nextc)] & (1 << cond)) == 0)
+ 	    return 0;
+ 	}
+     /*
+      * The conditions are satisfied.  Copy the word, add the suffix,
+      * and make it match the case of the last remaining character of the
+      * root.  Again, this code carefully matches ins_cap and cap_ok.
+      */
+     (void) icharcpy (tword, rootword);
+     nextc = tword + tlen - flent->stripl;
+     if (flent->affl)
+ 	{
+ 	(void) icharcpy (nextc, flent->affix);
+ 	if (!myupper (nextc[-1]))
+ 	    forcelc (nextc, flent->affl);
+ 	}
+     else
+ 	*nextc = 0;
+     if (option == 3)
+ 	(void) printf ("\n%s", croot);
+     if (option != 4)
+ 	(void) printf (" %s%s", ichartosstr (tword, 1), extra);
+     return tlen + flent->affl - flent->stripl;
+     }
+ 
+ static void forcelc (dst, len)			/* Force to lowercase */
+     register ichar_t *		dst;		/* Destination to modify */
+     register int		len;		/* Length to copy */
+     {
+ 
+     for (  ;  --len >= 0;  dst++)
+ 	*dst = mytolower (*dst);
+     }


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/tree.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/tree.c:1.1
*** /dev/null	Tue Jan  9 17:57:53 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/tree.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,740 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: tree.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * tree.c - a hash style dictionary for user's personal words
+  *
+  * Pace Willisson, 1983
+  * Hash support added by Geoff Kuenning, 1987
+  *
+  * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: tree.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:06  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.56  1995/01/08  23:23:49  geoff
+  * Support PDICTHOME for DOS purposes.
+  *
+  * Revision 1.55  1994/10/25  05:46:27  geoff
+  * Fix a comment that looked to some compilers like it might be nested.
+  *
+  * Revision 1.54  1994/01/25  07:12:15  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include <ctype.h>
+ #include <errno.h>
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ #include "msgs.h"
+ 
+ void		treeinit P ((char * p, char * LibDict));
+ static FILE *	trydict P ((char * dictname, char * home,
+ 		  char * prefix, char * suffix));
+ static void	treeload P ((FILE * dictf));
+ void		treeinsert P ((char * word, int wordlen, int keep));
+ static struct dent * tinsert P ((struct dent * proto));
+ struct dent *	treelookup P ((ichar_t * word));
+ #if SORTPERSONAL != 0
+ static int	pdictcmp P ((struct dent ** enta, struct dent **entb));
+ #endif /* SORTPERSONAL != 0 */
+ void		treeoutput P ((void));
+ VOID *		mymalloc P ((unsigned int size));
+ void		myfree P ((VOID * ptr));
+ #ifdef REGEX_LOOKUP
+ char *		do_regex_lookup P ((char * expr, int whence));
+ #endif /* REGEX_LOOKUP */
+ 
+ static int		cantexpand = 0;	/* NZ if an expansion fails */
+ static struct dent *	pershtab;	/* Aux hash table for personal dict */
+ static int		pershsize = 0;	/* Space available in aux hash table */
+ static int		hcount = 0;	/* Number of items in hash table */
+ 
+ /*
+  * Hash table sizes.  Prime is probably a good idea, though in truth I
+  * whipped the algorithm up on the spot rather than looking it up, so
+  * who knows what's really best?  If we overflow the table, we just
+  * use a double-and-add-1 algorithm.
+  */
+ static int goodsizes[] =
+     {
+     53, 223, 907, 3631
+     };
+ 
+ static char		personaldict[MAXPATHLEN];
+ static FILE *		dictf;
+ static			newwords = 0;
+ 
+ void treeinit (p, LibDict)
+     char *		p;		/* Value specified in -p switch */
+     char *		LibDict;	/* Root of default dict name */
+     {
+     int			abspath;	/* NZ if p is abs path name */
+     char *		h;		/* Home directory name */
+     char		seconddict[MAXPATHLEN]; /* Name of secondary dict */
+     FILE *		secondf;	/* Access to second dict file */
+ 
+     /*
+     ** If -p was not specified, try to get a default name from the
+     ** environment.  After this point, if p is null, the the value in
+     ** personaldict is the only possible name for the personal dictionary.
+     ** If p is non-null, then there is a possibility that we should
+     ** prepend HOME to get the correct dictionary name.
+     */
+     if (p == NULL)
+ 	p = getenv (PDICTVAR);
+     /*
+     ** if p exists and begins with '/' we don't really need HOME,
+     ** but it's not very likely that HOME isn't set anyway (on non-DOS
+     ** systems).
+     */
+     if ((h = getenv (HOME)) == NULL)
+ 	{
+ #ifdef PDICTHOME
+ 	h = PDICTHOME;
+ #else /* PDICTHOME */
+ 	return;
+ #endif /* PDICTHOME */
+ 	}
+ 
+     if (p == NULL)
+ 	{
+ 	/*
+ 	 * No -p and no PDICTVAR.  We will use LibDict and DEFPAFF to
+ 	 * figure out the name of the personal dictionary and where it
+ 	 * is.  The rules are as follows:
+ 	 *
+ 	 * (1) If there is a local dictionary and a HOME dictionary,
+ 	 *     both are loaded, but changes are saved in the local one.
+ 	 *     The dictionary to save changes in is named "personaldict".
+ 	 * (2) Dictionaries named after the affix file take precedence
+ 	 *     over dictionaries with the default suffix (DEFPAFF).
+ 	 * (3) Dictionaries named with the new default names
+ 	 *     (DEFPDICT/DEFPAFF) take precedence over the old ones
+ 	 *     (OLDPDICT/OLDPAFF).
+ 	 * (4) Dictionaries aren't combined unless they follow the same
+ 	 *     naming scheme.
+ 	 * (5) If no dictionary can be found, a new one is created in
+ 	 *     the home directory, named after DEFPDICT and the affix
+ 	 *     file.
+ 	 */
+ 	dictf = trydict (personaldict, (char *) NULL, DEFPDICT, LibDict);
+ 	secondf = trydict (seconddict, h, DEFPDICT, LibDict);
+ 	if (dictf == NULL  &&  secondf == NULL)
+ 	    {
+ 	    dictf = trydict (personaldict, (char *) NULL, DEFPDICT, DEFPAFF);
+ 	    secondf = trydict (seconddict, h, DEFPDICT, DEFPAFF);
+ 	    }
+ 	if (dictf == NULL  &&  secondf == NULL)
+ 	    {
+ 	    dictf = trydict (personaldict, (char *) NULL, OLDPDICT, LibDict);
+ 	    secondf = trydict (seconddict, h, OLDPDICT, LibDict);
+ 	    }
+ 	if (dictf == NULL  &&  secondf == NULL)
+ 	    {
+ 	    dictf = trydict (personaldict, (char *) NULL, OLDPDICT, OLDPAFF);
+ 	    secondf = trydict (seconddict, h, OLDPDICT, OLDPAFF);
+ 	    }
+ 	if (personaldict[0] == '\0')
+ 	    {
+ 	    if (seconddict[0] != '\0')
+ 		(void) strcpy (personaldict, seconddict);
+ 	    else
+ 		(void) sprintf (personaldict, "%s/%s%s", h, DEFPDICT, LibDict);
+ 	    }
+ 	if (dictf != NULL)
+ 	    {
+ 	    treeload (dictf);
+ 	    (void) fclose (dictf);
+ 	    }
+ 	if (secondf != NULL)
+ 	    {
+ 	    treeload (secondf);
+ 	    (void) fclose (secondf);
+ 	    }
+ 	}
+     else
+ 	{
+ 	/*
+ 	** Figure out if p is an absolute path name.  Note that beginning
+ 	** with "./" and "../" is considered an absolute path, since this
+ 	** still means we can't prepend HOME.
+ 	*/
+ 	abspath = (*p == '/'  ||  strncmp (p, "./", 2) == 0
+ 	  ||  strncmp (p, "../", 3) == 0);
+ 	if (abspath)
+ 	    {
+ 	    (void) strcpy (personaldict, p);
+ 	    if ((dictf = fopen (personaldict, "r")) != NULL)
+ 		{
+ 		treeload (dictf);
+ 		(void) fclose (dictf);
+ 		}
+ 	    }
+ 	else
+ 	    {
+ 	    /*
+ 	    ** The user gave us a relative pathname.  We will try it
+ 	    ** locally, and if that doesn't work, we'll try the home
+ 	    ** directory.  If neither exists, it will be created in
+ 	    ** the home directory if words are added.
+ 	    */
+ 	    (void) strcpy (personaldict, p);
+ 	    if ((dictf = fopen (personaldict, "r")) != NULL)
+ 		{
+ 		treeload (dictf);
+ 		(void) fclose (dictf);
+ 		}
+ 	    else if (!abspath)
+ 		{
+ 		/* Try the home */
+ 		(void) sprintf (personaldict, "%s/%s", h, p);
+ 		if ((dictf = fopen (personaldict, "r")) != NULL)
+ 		    {
+ 		    treeload (dictf);
+ 		    (void) fclose (dictf);
+ 		    }
+ 		}
+ 	    /*
+ 	     * If dictf is null, we couldn't open the dictionary
+ 	     * specified in the -p switch.  Complain.
+ 	     */
+ 	    if (dictf == NULL)
+ 		{
+ 		(void) fprintf (stderr, CANT_OPEN, p);
+ 		perror ("");
+ 		return;
+ 		}
+ 	    }
+ 	}
+ 
+     if (!lflag  &&  !aflag
+       &&  access (personaldict, 2) < 0  &&  errno != ENOENT)
+ 	{
+ 	(void) fprintf (stderr, TREE_C_CANT_UPDATE, personaldict);
+ 	(void) sleep ((unsigned) 2);
+ 	}
+     }
+ 
+ /*
+  * Try to open a dictionary.  As a side effect, leaves the dictionary
+  * name in "filename" if one is found, and leaves a null string there
+  * otherwise.
+  */
+ static FILE * trydict (filename, home, prefix, suffix)
+     char *		filename;	/* Where to store the file name */
+     char *		home;		/* Home directory */
+     char *		prefix;		/* Prefix for dictionary */
+     char *		suffix;		/* Suffix for dictionary */
+     {
+     FILE *		dictf;		/* Access to dictionary file */
+ 
+     if (home == NULL)
+ 	(void) sprintf (filename, "%s%s", prefix, suffix);
+     else
+ 	(void) sprintf (filename, "%s/%s%s", home, prefix, suffix);
+     dictf = fopen (filename, "r");
+     if (dictf == NULL)
+ 	filename[0] = '\0';
+     return dictf;
+     }
+ 
+ static void treeload (loadfile)
+     register FILE *	loadfile;	/* File to load words from */
+     {
+     char		buf[BUFSIZ];	/* Buffer for reading pers dict */
+ 
+     while (fgets (buf, sizeof buf, loadfile) != NULL)
+ 	treeinsert (buf, sizeof buf, 1);
+     newwords = 0;
+     }
+ 
+ void treeinsert (word, wordlen, keep)
+     char *		word;	/* Word to insert - must be canonical */
+     int			wordlen; /* Length of the word buffer */
+     int			keep;
+     {
+     register int	i;
+     struct dent		wordent;
+     register struct dent * dp;
+     struct dent *	olddp;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     struct dent *	newdp;
+ #endif
+     struct dent *	oldhtab;
+     int			oldhsize;
+     ichar_t		nword[INPUTWORDLEN + MAXAFFIXLEN];
+ #ifndef NO_CAPITALIZATION_SUPPORT
+     int			isvariant;
+ #endif
+ 
+     /*
+      * Expand hash table when it is MAXPCT % full.
+      */
+     if (!cantexpand  &&  (hcount * 100) / MAXPCT >= pershsize)
+ 	{
+ 	oldhsize = pershsize;
+ 	oldhtab = pershtab;
+ 	for (i = 0;  i < sizeof goodsizes / sizeof (goodsizes[0]);  i++)
+ 	    {
+ 	    if (goodsizes[i] > pershsize)
+ 		break;
+ 	    }
+ 	if (i >= sizeof goodsizes / sizeof goodsizes[0])
+ 	    pershsize += pershsize + 1;
+ 	else
+ 	    pershsize = goodsizes[i];
+ 	pershtab =
+ 	  (struct dent *) calloc ((unsigned) pershsize, sizeof (struct dent));
+ 	if (pershtab == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, TREE_C_NO_SPACE);
+ 	    /*
+ 	     * Try to continue anyway, since our overflow
+ 	     * algorithm can handle an overfull (100%+) table,
+ 	     * and the malloc very likely failed because we
+ 	     * already have such a huge table, so small mallocs
+ 	     * for overflow entries will still work.
+ 	     */
+ 	    if (oldhtab == NULL)
+ 		exit (1);		/* No old table, can't go on */
+ 	    (void) fprintf (stderr, TREE_C_TRY_ANYWAY);
+ 	    cantexpand = 1;		/* Suppress further messages */
+ 	    pershsize = oldhsize;	/* Put things back */
+ 	    pershtab = oldhtab;		/* ... */
+ 	    newwords = 1;		/* And pretend it worked */
+ 	    }
+ 	else
+ 	    {
+ 	    /*
+ 	     * Re-insert old entries into new table
+ 	     */
+ 	    for (i = 0;  i < oldhsize;  i++)
+ 		{
+ 		dp = &oldhtab[i];
+ 		if (dp->flagfield & USED)
+ 		    {
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ 		    (void) tinsert (dp);
+ #else
+ 		    newdp = tinsert (dp);
+ 		    isvariant = (dp->flagfield & MOREVARIANTS);
+ #endif
+ 		    dp = dp->next;
+ #ifdef NO_CAPITALIZATION_SUPPORT
+ 		    while (dp != NULL)
+ 			{
+ 			(void) tinsert (dp);
+ 			olddp = dp;
+ 			dp = dp->next;
+ 			free ((char *) olddp);
+ 			}
+ #else
+ 		    while (dp != NULL)
+ 			{
+ 			if (isvariant)
+ 			    {
+ 			    isvariant = dp->flagfield & MOREVARIANTS;
+ 			    olddp = newdp->next;
+ 			    newdp->next = dp;
+ 			    newdp = dp;
+ 			    dp = dp->next;
+ 			    newdp->next = olddp;
+ 			    }
+ 			else
+ 			    {
+ 			    isvariant = dp->flagfield & MOREVARIANTS;
+ 			    newdp = tinsert (dp);
+ 			    olddp = dp;
+ 			    dp = dp->next;
+ 			    free ((char *) olddp);
+ 			    }
+ 			}
+ #endif
+ 		    }
+ 		}
+ 	    if (oldhtab != NULL)
+ 		free ((char *) oldhtab);
+ 	    }
+ 	}
+ 
+     /*
+     ** We're ready to do the insertion.  Start by creating a sample
+     ** entry for the word.
+     */
+     if (makedent (word, wordlen, &wordent) < 0)
+ 	return;			/* Word must be too big or something */
+     if (keep)
+ 	wordent.flagfield |= KEEP;
+     /*
+     ** Now see if word or a variant is already in the table.  We use the
+     ** capitalized version so we'll find the header, if any.
+     **/
+     (void) strtoichar (nword, word, sizeof nword, 1);
+     upcase (nword);
+     if ((dp = lookup (nword, 1)) != NULL)
+ 	{
+ 	/* It exists.  Combine caps and set the keep flag. */
+ 	if (combinecaps (dp, &wordent) < 0)
+ 	    {
+ 	    free (wordent.word);
+ 	    return;
+ 	    }
+ 	}
+     else
+ 	{
+ 	/* It's new. Insert the word. */
+ 	dp = tinsert (&wordent);
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 	if (captype (dp->flagfield) == FOLLOWCASE)
+ 	   (void) addvheader (dp);
+ #endif
+ 	}
+     newwords |= keep;
+     }
+ 
+ static struct dent * tinsert (proto)
+     struct dent *	proto;		/* Prototype entry to copy */
+     {
+     ichar_t		iword[INPUTWORDLEN + MAXAFFIXLEN];
+     register int	hcode;
+     register struct dent * hp;		/* Next trial entry in hash table */
+     register struct dent * php;		/* Prev. value of hp, for chaining */
+ 
+     if (strtoichar (iword, proto->word, sizeof iword, 1))
+ 	(void) fprintf (stderr, WORD_TOO_LONG (proto->word));
+ #ifdef NO_CAPITALIZATION_SUPPORT
+     upcase (iword);
+ #endif
+     hcode = hash (iword, pershsize);
+     php = NULL;
+     hp = &pershtab[hcode];
+     if (hp->flagfield & USED)
+ 	{
+ 	while (hp != NULL)
+ 	    {
+ 	    php = hp;
+ 	    hp = hp->next;
+ 	    }
+ 	hp = (struct dent *) calloc (1, sizeof (struct dent));
+ 	if (hp == NULL)
+ 	    {
+ 	    (void) fprintf (stderr, TREE_C_NO_SPACE);
+ 	    exit (1);
+ 	    }
+ 	}
+     *hp = *proto;
+     if (php != NULL)
+ 	php->next = hp;
+     hp->next = NULL;
+     return hp;
+     }
+ 
+ struct dent * treelookup (word)
+     register ichar_t *	word;
+     {
+     register int	hcode;
+     register struct dent * hp;
+     char		chword[INPUTWORDLEN + MAXAFFIXLEN];
+ 
+     if (pershsize <= 0)
+ 	return NULL;
+     (void) ichartostr (chword, word, sizeof chword, 1);
+     hcode = hash (word, pershsize);
+     hp = &pershtab[hcode];
+     while (hp != NULL  &&  (hp->flagfield & USED))
+ 	{
+ 	if (strcmp (chword, hp->word) == 0)
+ 	    break;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 	while (hp->flagfield & MOREVARIANTS)
+ 	    hp = hp->next;
+ #endif
+ 	hp = hp->next;
+ 	}
+     if (hp != NULL  &&  (hp->flagfield & USED))
+ 	return hp;
+     else
+ 	return NULL;
+     }
+ 
+ #if SORTPERSONAL != 0
+ /* Comparison routine for sorting the personal dictionary with qsort */
+ static int pdictcmp (enta, entb)
+     struct dent **	enta;
+     struct dent **	entb;
+     {
+ 
+     /* The parentheses around *enta and *entb below are NECESSARY!
+     ** Otherwise the compiler reads it as *(enta->word), or
+     ** enta->word[0], which is illegal (but pcc takes it and
+     ** produces wrong code).
+     **/
+     return casecmp ((*enta)->word, (*entb)->word, 1);
+     }
+ #endif
+ 
+ void treeoutput ()
+     {
+     register struct dent *	cent;	/* Current entry */
+     register struct dent *	lent;	/* Linked entry */
+ #if SORTPERSONAL != 0
+     int				pdictsize; /* Number of entries to write */
+     struct dent **		sortlist; /* List of entries to be sorted */
+     register struct dent **	sortptr; /* Handy pointer into sortlist */
+ #endif
+     register struct dent *	ehtab;	/* End of pershtab, for fast looping */
+ 
+     if (newwords == 0)
+ 	return;
+ 
+     if ((dictf = fopen (personaldict, "w")) == NULL)
+ 	{
+ 	(void) fprintf (stderr, CANT_CREATE, personaldict);
+ 	return;
+ 	}
+ 
+ #if SORTPERSONAL != 0
+     /*
+     ** If we are going to sort the personal dictionary, we must know
+     ** how many items are going to be sorted.
+     */
+     pdictsize = 0;
+     if (hcount >= SORTPERSONAL)
+ 	sortlist = NULL;
+     else
+ 	{
+ 	for (cent = pershtab, ehtab = pershtab + pershsize;
+ 	  cent < ehtab;
+ 	  cent++)
+ 	    {
+ 	    for (lent = cent;  lent != NULL;  lent = lent->next)
+ 		{
+ 		if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
+ 		    pdictsize++;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 		while (lent->flagfield & MOREVARIANTS)
+ 		  lent = lent->next;
+ #endif
+ 		}
+ 	    }
+ 	for (cent = hashtbl, ehtab = hashtbl + hashsize;
+ 	  cent < ehtab;
+ 	  cent++)
+ 	    {
+ 	    if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
+ 		{
+ 		/*
+ 		** We only want to count variant headers
+ 		** and standalone entries.  These happen
+ 		** to share the characteristics in the
+ 		** test below.  This test will appear
+ 		** several more times in this routine.
+ 		*/
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 		if (captype (cent->flagfield) != FOLLOWCASE
+ 		  &&  cent->word != NULL)
+ #endif
+ 		    pdictsize++;
+ 		}
+ 	    }
+ 	sortlist = (struct dent **) malloc (pdictsize * sizeof (struct dent));
+ 	}
+     if (sortlist == NULL)
+ 	{
+ #endif
+ 	for (cent = pershtab, ehtab = pershtab + pershsize;
+ 	  cent < ehtab;
+ 	  cent++)
+ 	    {
+ 	    for (lent = cent;  lent != NULL;  lent = lent->next)
+ 		{
+ 		if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
+ 		    {
+ 		    toutent (dictf, lent, 1);
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 		    while (lent->flagfield & MOREVARIANTS)
+ 			lent = lent->next;
+ #endif
+ 		    }
+ 		}
+ 	    }
+ 	for (cent = hashtbl, ehtab = hashtbl + hashsize;
+ 	  cent < ehtab;
+ 	  cent++)
+ 	    {
+ 	    if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
+ 		{
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 		if (captype (cent->flagfield) != FOLLOWCASE
+ 		  &&  cent->word != NULL)
+ #endif
+ 		    toutent (dictf, cent, 1);
+ 		}
+ 	    }
+ #if SORTPERSONAL != 0
+ 	return;
+ 	}
+     /*
+     ** Produce dictionary in sorted order.  We used to do this
+     ** destructively, but that turns out to fail because in some modes
+     ** the dictionary is written more than once.  So we build an
+     ** auxiliary pointer table (in sortlist) and sort that.  This
+     ** is faster anyway, though it uses more memory. 
+     */
+     sortptr = sortlist;
+     for (cent = pershtab, ehtab = pershtab + pershsize;  cent < ehtab;  cent++)
+ 	{
+ 	for (lent = cent;  lent != NULL;  lent = lent->next)
+ 	    {
+ 	    if ((lent->flagfield & (USED | KEEP)) == (USED | KEEP))
+ 		{
+ 		*sortptr++ = lent;
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 		while (lent->flagfield & MOREVARIANTS)
+ 		    lent = lent->next;
+ #endif
+ 		}
+ 	    }
+ 	}
+     for (cent = hashtbl, ehtab = hashtbl + hashsize;  cent < ehtab;  cent++)
+ 	{
+ 	if ((cent->flagfield & (USED | KEEP)) == (USED | KEEP))
+ 	    {
+ #ifndef NO_CAPITALIZATION_SUPPORT
+ 	    if (captype (cent->flagfield) != FOLLOWCASE
+ 	      &&  cent->word != NULL)
+ #endif
+ 		*sortptr++ = cent;
+ 	    }
+ 	}
+     /* Sort the list */
+     qsort ((char *) sortlist, (unsigned) pdictsize,
+       sizeof (sortlist[0]),
+       (int (*) P ((const void *, const void *))) pdictcmp);
+     /* Write it out */
+     for (sortptr = sortlist;  --pdictsize >= 0;  )
+ 	toutent (dictf, *sortptr++, 1);
+     free ((char *) sortlist);
+ #endif
+ 
+     newwords = 0;
+ 
+     (void) fclose (dictf);
+     }
+ 
+ VOID * mymalloc (size)
+     unsigned int	size;
+     {
+ 
+     return malloc ((unsigned) size);
+     }
+ 
+ void myfree (ptr)
+     VOID * ptr;
+     {
+     if (hashstrings != NULL  &&  (char *) ptr >= hashstrings
+       &&  (char *) ptr <= hashstrings + hashheader.stringsize)
+ 	return;			/* Can't free stuff in hashstrings */
+     free (ptr);
+     }
+ 
+ #ifdef REGEX_LOOKUP
+ 
+ /* check the hashed dictionary for words matching the regex. return the */
+ /* a matching string if found else return NULL */
+ char * do_regex_lookup (expr, whence)
+     char *	expr;	/* regular expression to use in the match   */
+     int		whence;	/* 0 = start at the beg with new regx, else */
+ 			/* continue from cur point w/ old regex     */
+     {
+     static struct dent *    curent;
+     static int		    curindex;
+     static struct dent *    curpersent;
+     static int		    curpersindex;
+     static char *	    cmp_expr;
+     char		    dummy[INPUTWORDLEN + MAXAFFIXLEN];
+     ichar_t *		    is;
+ 
+     if (whence == 0)
+ 	{
+ 	is = strtosichar (expr, 0);
+ 	upcase (is);
+ 	expr = ichartosstr (is, 1);
+         cmp_expr = REGCMP (expr);
+         curent = hashtbl;
+         curindex = 0;
+         curpersent = pershtab;
+         curpersindex = 0;
+ 	}
+     
+     /* search the dictionary until the word is found or the words run out */
+     for (  ; curindex < hashsize;  curent++, curindex++)
+ 	{
+         if (curent->word != NULL
+           &&  REGEX (cmp_expr, curent->word, dummy) != NULL)
+ 	    {
+ 	    curindex++;
+ 	    /* Everybody's gotta write a wierd expression once in a while! */
+ 	    return curent++->word;
+ 	    }
+ 	}
+     /* Try the personal dictionary too */
+     for (  ; curpersindex < pershsize;  curpersent++, curpersindex++)
+ 	{
+         if ((curpersent->flagfield & USED) != 0
+           &&  curpersent->word != NULL
+           &&  REGEX (cmp_expr, curpersent->word, dummy) != NULL)
+ 	    {
+ 	    curpersindex++;
+ 	    /* Everybody's gotta write a wierd expression once in a while! */
+ 	    return curpersent++->word;
+ 	    }
+ 	}
+     return NULL;
+     }
+ #endif /* REGEX_LOOKUP */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/version.h
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/version.h:1.1
*** /dev/null	Tue Jan  9 17:57:53 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/version.h	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,130 ----
+ /*
+  * Since the strings in this file are printed out when the "-v" switch is
+  * given to ispell, you may want to translate them into your native language.
+  * However, any translation of these strings MUST accurately preserve the
+  * legal rights under international law;  you may wish to consult a lawyer
+  * about this since you will be responsible for the results of any
+  * incorrect translation.
+  */
+ 
+ static char * Version_ID[] = {
+     "@(#) International Ispell Version 3.1.20 10/10/95",
+     "@(#) Copyright (c), 1983, by Pace Willisson",
+     "@(#) International version Copyright (c) 1987, 1988, 1990-1995,",
+     "@(#) by Geoff Kuenning, Granada Hills, CA.  All rights reserved.",
+     "@(#)",
+     "@(#) Redistribution and use in source and binary forms, with or without",
+     "@(#) modification, are permitted provided that the following conditions",
+     "@(#) are met:",
+     "@(#)",
+     "@(#) 1. Redistributions of source code must retain the above copyright",
+     "@(#)    notice, this list of conditions and the following disclaimer.",
+     "@(#) 2. Redistributions in binary form must reproduce the above",
+     "@(#)    copyright notice, this list of conditions and the following",
+     "@(#)    disclaimer in the documentation and/or other materials provided",
+     "@(#)    with the distribution.",
+     "@(#) 3. All modifications to the source code must be clearly marked as",
+     "@(#)    such.  Binary redistributions based on modified source code",
+     "@(#)    must be clearly marked as modified versions in the documentation",
+     "@(#)    and/or other materials provided with the distribution.",
+     "@(#) 4. All advertising materials mentioning features or use of this",
+     "@(#)    software must display the following acknowledgment:",
+     "@(#)      This product includes software developed by Geoff Kuenning and",
+     "@(#)      other unpaid contributors.",
+     "@(#) 5. The name of Geoff Kuenning may not be used to endorse or promote",
+     "@(#)    products derived from this software without specific prior",
+     "@(#)    written permission.",
+     "@(#)",
+     "@(#) THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS",
+     "@(#) IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT",
+     "@(#) LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS",
+     "@(#) FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF",
+     "@(#) KUENNING OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,",
+     "@(#) INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES",
+     "@(#) (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR",
+     "@(#) SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)",
+     "@(#) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,",
+     "@(#) STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)",
+     "@(#) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED",
+     "@(#) OF THE POSSIBILITY OF SUCH DAMAGE.",
+     NULL
+ };
+ 
+ static char RCS_Version_ID[] =
+     "$Id: version.h,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ 
+ /*
+  * $Log: version.h,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:06  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.44  1995/10/11  05:03:28  geoff
+  * Upgrade to patch level 20
+  *
+  * Revision 1.43  1995/10/11  04:58:26  geoff
+  * Upgrade to patch 19
+  *
+  * Revision 1.42  1995/01/15  01:23:26  geoff
+  * Upgrade to patch level 18
+  *
+  * Revision 1.41  1995/01/15  01:14:30  geoff
+  * Upgrade to patch level 17
+  *
+  * Revision 1.40  1995/01/15  01:03:55  geoff
+  * Upgrade to patch level 16
+  *
+  * Revision 1.39  1995/01/15  01:01:01  geoff
+  * Upgrade to patch level 15
+  *
+  * Revision 1.38  1995/01/15  00:54:19  geoff
+  * Upgrade to patch level 14
+  *
+  * Revision 1.37  1994/11/21  07:03:01  geoff
+  * Update to patch level 13.
+  *
+  * Revision 1.36  1994/11/01  06:28:31  geoff
+  * Update to patch level 12
+  *
+  * Revision 1.35  1994/11/01  06:12:42  geoff
+  * Update to patch level 11
+  *
+  * Revision 1.34  1994/11/01  06:01:15  geoff
+  * Update to patch level 10
+  *
+  * Revision 1.33  1994/11/01  05:36:43  geoff
+  * Update to patch level 9
+  *
+  * Revision 1.32  1994/05/25  04:38:59  geoff
+  * Update to patch level 8
+  *
+  * Revision 1.31  1994/05/18  03:07:26  geoff
+  * Update to patch level 7
+  *
+  * Revision 1.30  1994/05/17  06:21:05  geoff
+  * Version update for ispell.el release
+  *
+  * Revision 1.29  1994/04/27  04:14:18  geoff
+  * Update to patch level 5
+  *
+  * Revision 1.28  1994/03/21  02:00:50  geoff
+  * Update to patch level 4
+  *
+  * Revision 1.27  1994/02/23  04:52:31  geoff
+  * Update to latest version.
+  *
+  * Revision 1.26  1994/02/08  05:59:20  geoff
+  * Update version
+  *
+  * Revision 1.25  1994/02/07  08:58:28  geoff
+  * Get rid of a comma that confuses patch
+  *
+  * Revision 1.24  1994/02/07  08:24:23  geoff
+  * Upate patch level
+  *
+  * Revision 1.23  1994/01/25  07:12:21  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */


Index: llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/xgets.c
diff -c /dev/null llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/xgets.c:1.1
*** /dev/null	Tue Jan  9 17:57:53 2007
--- llvm-test/MultiSource/Benchmarks/MiBench/office-ispell/xgets.c	Tue Jan  9 17:57:18 2007
***************
*** 0 ****
--- 1,154 ----
+ #ifndef lint
+ static char Rcs_Id[] =
+     "$Id: xgets.c,v 1.1 2007/01/09 23:57:18 lattner Exp $";
+ #endif
+ 
+ /*
+  * Copyright 1987, 1988, 1989, 1992, 1993, Geoff Kuenning, Granada Hills, CA
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  *
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. All modifications to the source code must be clearly marked as
+  *    such.  Binary redistributions based on modified source code
+  *    must be clearly marked as modified versions in the documentation
+  *    and/or other materials provided with the distribution.
+  * 4. All advertising materials mentioning features or use of this software
+  *    must display the following acknowledgment:
+  *      This product includes software developed by Geoff Kuenning and
+  *      other unpaid contributors.
+  * 5. The name of Geoff Kuenning may not be used to endorse or promote
+  *    products derived from this software without specific prior
+  *    written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY GEOFF KUENNING AND CONTRIBUTORS ``AS IS'' AND
+  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+  * ARE DISCLAIMED.  IN NO EVENT SHALL GEOFF KUENNING OR CONTRIBUTORS BE LIABLE
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+  * SUCH DAMAGE.
+  */
+ 
+ /*
+  * $Log: xgets.c,v $
+  * Revision 1.1  2007/01/09 23:57:18  lattner
+  * initial recheckin of mibench
+  *
+  * Revision 1.1.1.1  2007/01/09 02:59:06  evancheng
+  * Add selected tests from MiBench 1.0 to LLVM test suite.
+  *
+  * Revision 1.22  1994/09/16  04:48:34  geoff
+  * Be sure to deliver newlines to the caller, so that it can tell whether
+  * or not a complete line was read.
+  *
+  * Revision 1.21  1994/01/25  07:12:22  geoff
+  * Get rid of all old RCS log lines in preparation for the 3.1 release.
+  *
+  */
+ 
+ #include "config.h"
+ #include "ispell.h"
+ #include "proto.h"
+ 
+ char *		xgets P ((char * string, int size, FILE * stream));
+ 
+ #ifndef MAXINCLUDEFILES
+ #define MAXINCLUDEFILES	1	/* maximum number of new files in stack */
+ #endif
+ 
+ /*
+  * xgets () acts just like gets () except that if a line matches
+  * "&Include_File&<something>" xgets () will start reading from the
+  * file <something>.
+  *
+  *  Andrew Vignaux -- andrew at vuwcomp  Fri May  8 16:40:23 NZST 1987
+  * modified
+  *  Mark Davies -- mark at vuwcomp  Mon May 11 22:38:10 NZST 1987
+  */
+ 
+ char * xgets (str, size, stream)
+     char		str[];
+     int			size;
+     FILE *		stream;
+     {
+ #if MAXINCLUDEFILES == 0
+     return fgets (str, size, stream);
+ #else
+     static char *	Include_File = DEFINCSTR;
+     static int		Include_Len = 0;
+     static FILE *	F[MAXINCLUDEFILES+1];
+     static FILE **	current_F = F;
+     char *		s = str;
+     int			c;
+ 
+     /* read the environment variable if we havent already */
+     if (Include_Len == 0)
+ 	{
+ 	char *		env_variable;
+ 
+ 	if ((env_variable = getenv (INCSTRVAR)) != NULL)
+ 	    Include_File = env_variable;
+ 	Include_Len = strlen (Include_File);
+ 
+ 	/* initialise the file stack */
+ 	*current_F = stream;
+ 	}
+ 
+     for (  ;  ;  )
+ 	{
+ 	c = '\0';
+         if ((s - str) + 1 < size
+           &&  (c = getc (*current_F)) != EOF)
+ 	    {
+ 	    *s++ = (char) c;
+ 	    if (c != '\n')
+ 		continue;
+ 	    }
+ 	*s = '\0';		/* end of line */
+ 	if (c == EOF)
+ 	    {
+ 	    if (current_F == F) /* if end of standard input */
+ 		{
+ 		if (s == str)
+ 		    return (NULL);
+ 		}
+ 	    else
+ 		{
+ 	        (void) fclose (*(current_F--));
+ 	      	if (s == str) continue;
+ 		}
+ 	    }
+ 
+ 	if (incfileflag != 0
+ 	  &&  strncmp (str, Include_File, (unsigned int) Include_Len) == 0)
+ 	    {
+ 	    char *	file_name = str + Include_Len;
+ 
+ 	    if (current_F - F < MAXINCLUDEFILES  &&  strlen (file_name) != 0)
+ 		{
+ 		FILE *	f;
+ 
+ 		if (f = fopen (file_name, "r"))
+ 		    *(++current_F) = f;
+ 		}
+ 	    s = str;
+ 	    continue;
+ 	    }
+ 	break;
+ 	}
+     
+     return (str);
+ #endif
+     }






More information about the llvm-commits mailing list