1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
------------------------------------------------------------------------------
A license is hereby granted to reproduce this software source code and
to create executable versions from this source code for personal,
non-commercial use. The copyright notice included with the software
must be maintained in all copies produced.
THIS PROGRAM IS PROVIDED "AS IS". THE AUTHOR PROVIDES NO WARRANTIES
WHATSOEVER, EXPRESSED OR IMPLIED, INCLUDING WARRANTIES OF
MERCHANTABILITY, TITLE, OR FITNESS FOR ANY PARTICULAR PURPOSE. THE
AUTHOR DOES NOT WARRANT THAT USE OF THIS PROGRAM DOES NOT INFRINGE THE
INTELLECTUAL PROPERTY RIGHTS OF ANY THIRD PARTY IN ANY COUNTRY.
Copyright (c) 1995, 1996, John Conover, All Rights Reserved.
Comments and/or bug reports should be addressed to:
john@johncon.com (John Conover)
------------------------------------------------------------------------------
1996/09/13:
Version 1.3, released. Changes from version 1.2 to version 1.3,
John Conover <john@johncon.com>
I) File searchpath.c:
Added construct to detect circularly linked directories
and subdirectories. This is a safety provision to prevent
continuously searching a circular linked directory,
created with a shell construct like: mkdir my_dir; cd
my_dir; ln -s my_subdir ../my_dir
II) Files bmhsearch.c, postfix.c, rel.c, searchfile.c,
translit.c, and uppercase.c:
Cosmetic changes.
III) Files rel.1, and rel.catman:
Comments regarding using rel(1) to find all documents
NOT containing a keyword or phrase added to WARNINGS:
section.
1995/12/23:
Version 1.2, released. Changes from version 1.1 to version 1.2,
John Conover <john@johncon.com>:
I) File uppercase.c:
Added construct to change all whitespace characters, as
defined in ctype.h and locale.h, to space characters to
facilitate phrase searching.
II) File translit.c:
Added transliteration construct to address whitespace,
backspace, and hyphenation issues.
III) File searchfile.c:
Altered sequence of preparation for transliteration of
page/document to accommodate whitespace, backspace, and
hyphenation issues.
IV) File rel.c:
Altered transliteration of keyword criteria to accommodate
whitespace, backspace, and hyphenation issues.
V) File version.c:
Changes to files: uppercase.c, translit.c, searchfile.c,
rel.c, version.c-specifically to add whitespace,
backspace, and hyphenation capability.
Note: this change formally changes the version of the
program-see version.c
1995/12/23:
Version 1.1, released. Changes from version 1.0 to version 1.1,
John Conover <john@johncon.com>:
I) File Makefile:
Added special GNU gcc option; added compile time option to
control program behavior during file system exceptions.
Note: the GNU gcc option was added because of the
popularity of the GNU gcc compiler. A rigorous lint
facility was added, via gcc options, for verifying
compiler compliance-see the definition of LINT in the
gcc section of the Makefile. The only gcc options not
used were -Wredundant-decls, (because of the many
warnings issued in the gcc *.h files,) and
-Wid-clash*, (which, as mentioned in the man pages for
gcc, is probably not required.)
Note: for the rationale of adding the option to
control program behavior during file system
exceptions, see the next section on modifications to
searchpath.c.
II) File searchpath.c:
Added switch statement to end of function searchpath() to
permit continuation of execution during file system
exceptions, specifically failure to open a file, or
failure to open a directory.
Note: there are implications with this modification
when using the program in client/server architectures:
a) In many cases, there is no provision for a
server to print stderr messages to a
client-whether it is more advantageous for the
program to stop with no output, or continue with
the possibility of no notification to the client
user that a file system exception occurred, is
argumentative. In client/server architectures,
error handling is generally handled through the
Unix system error messaging, and, presumably, it
would be a more conscientious alternative for the
program to stop, with no output to the client,
(other than that an error occurred through the
messaging facilities,) than to output a partial,
or incomplete search during any exceptions.
Unfortunately, most Unix search utilities are not
designed for client/server applications, for
example egrep(1), and print any file system
exceptions to stderr, and continue-presenting an
ambiguous exception handling requirement for a
program that can function in both environments as
a server, or search application. In version 1.0,
it was regarded as the prudent alternative that
file system exceptions be handled by printing any
errors to stderr, (which would then be handled
through the Unix messaging facility,) and then
stopping, as in a client/server architecture.
b) Another alternative would be to add a switch in
the getopt() construct in function main() in rel.c
that would control program behavior in these
scenarios. The integer flag variable would be
defined as global and initialized in searchpath.c
and declared as extern in searchpath.h, with a
switch to define the behavior provided via the
command line. However, the default operation of
the program during file system exceptions is
argumentative.
c) Another alternative would be to add a compile
time switch for defining the specific behavior of
the program during file system exceptions,
allowing the program behavior to be defined for an
anticipated application architecture at compile
time. This compromise method of addressing the
issues involved would seem to be reasonable. The
compile time solution is as follows:
1) If FSE_CONTINUE is "#define'd" at compile
time, either in searchpath.h, searchpath.c, or
via the Makefile, the program will continue
during a failure to open a file or directory.
2) If FSC_CONTINUE is not "#define'd", then
the program behavior, as in release 1.0, will
be to stop, closing all file system
structures, and de-allocating all memory.
III) File searchfile.c:
Changed variable, count, to integer for lint compatability
with 3rd argument of read() in some compilers; changed
cast in third argument of read() to unsigned for lint
compatability with some compilers.
Note: this is a cosmetic change-the function read() is
not an ANSI C function, and there is substantial
variability among compilers in the definitions of the
size of data to be read from a disk. Other definitions
include, integer, unsigned integer, and size_t. This
change provides, arguably, the a general solution to
resolve compatability issues between different
compilers.
IV) File message.c:
Changed mnemonic and message elements of MESSAGE_STRUCT
structure to const char to comply with formal ANSI C
requirements for statically declared character strings.
Note: this is a cosmetic change-the character strings
were not, and could not, be modified-the change was
made to comply with the formalities of ANSI C.
V) File version.c:
Changes to files: Makefile, searchpath.c, searchfile.c,
message.c, version.c-specifically to control program
behavior under certain file system exceptions; specifics
for the GNU gcc compiler, and ANSI C cosmetic formalities.
Note: this change formally changes the version of the
program-see version.c
1995/04/22:
Version 1.0, released, John Conover <john@johncon.com>.
Initial revision.
1994/07/04:
Version 0.0, never formally released to general distribution-based
on various varieties and implementation concepts of the programs
fquery and qt. There are many versions of these programs, which
are still available and maintained as "legacy" applications by
john@johncon.com. The originals were written in the late 1970's in
various programming languages. The chronology of the programs
started with the program qt, which was a "middle ware" search
program for formatting, collating, and reducing data from various
commercial database systems and standard Unix text databases. The
program qt's syntax was changed to be compatible with awk(1) and
the name changed to fquery in 1987. The name qt was reused for a
full text, inverted index, information retrieval system in 1991.
A general and formalized version of the command line search syntax
used in very early versions of qt, with the search functionality
of the later versions of qt, with all new code became rel, version
0.0 in 1994.
|