idxtext.icn: Program for creating indexed text-base

July 9, 1991; Richard L. Goerwitz
This file is in the public domain.
    idxtext turns a file associated with gettext() routine into an
indexed text-base.  Though gettext() will work fine with files
that haven't been indexed via idxtext(), access is faster if the
indexing is done if the file is, say, over 10k (on my system the
crossover point is actually about 5k).

    Usage is simply "idxtext [-a] file1 [file2 [...]]," where file1,
file2, etc are the names of gettext-format files that are to be
(re-)indexed.  The -a flag tells idxtext to abort if an index file
already exists.

    Indexed files have a very simple format: keyname delimiter offset
[delimiter offset [etc.]]\n.  The first line of the index file is a
pointer to the last indexed byte of the text-base file it indexes.

BUGS: Index files are too large.  Also, I've yet to find a portable
way of creating unique index names that are capable of being
uniquely identified with their original text file.  It might be
sensible to hard code the name into the index.  The chances of a
conflict seem remote enough that I haven't bothered.  If you're
worried, use the -a flag. (RLG)

Source code | Program Library Page | Icon Home Page