{Begin SubSec WHEREIS Package}
{Title WHEREIS Package}
{Text

{index WHEREIS package}

{Tag WHEREISpackage}

The WHEREIS package extends the function {fn WHEREIS} ({PageRef Fn WHEREIS}) such that, when asked about a given name as a function, {fn WHEREIS} will consult not only the commands of files that have been noticed by the file package ({PageRef Tag FilePkg}) but also hashfile databases ({PageRef Tag Hashfile}) that associate function names with filenames.


{FnDef {FnName WHEREIS} {FnArgs NAME TYPE FILES FN}
{Text
Behaves exactly like the definition on {PageRef Fn WHEREIS} unless {arg TYPE}={lisp FNS} (or {lisp NIL}) and {arg FILES}={lisp T}.  In this case, {fn WHEREIS} will consult, in addition to the files on {var FILELST}, the hashfiles that are on the value of {index WHEREIS.HASH Var}{var WHEREIS.HASH}.  [note: normally the user will just enter the fullname of a file onto {var WHEREIS.HASH}, but as the {fn WHEREIS} begins to use it, it will convert the entry into a cons of the name and the hash file handle.]

Many system functions, such as the editors, call {fn WHEREIS} with {arg FILES}={lisp T}, so loading this package automatically makes any information contained in the {fn WHEREIS} database files available throughout the system.

Information may be added to an existing WHEREIS hashfile, or by creating new databases.  It is often useful to have a separate database for large user systems.  explicitly calling the following function:

{FnDef {FnName WHEREISNOTICE} {FnArgs FILEGROUP NEWFLG DATABASEFILE}
{Text
Inserts the information about all of the functions on the files in {arg FILEGROUP} into the {fn WHEREIS} data base contained on {arg DATABASEFILE}.  If {arg DATABASEFILE} is {lisp NIL}, the first entry on {var WHEREIS.HASH} is used.

{arg FILEGROUP} may be simply a list of files, in which case each file thereon is handled directly; but it may also be a pattern to be given as a filegroup argument to {fn DIRECTORY} ({PageRef Fn DIRECTORY}), so {lisp &}, {lisp $}, etc. may be used.    

If {arg NEWFLG} is non-{lisp NIL}, a new version of {arg DATABASEFILE} will be created containing the database for the functions specified in {arg FILEGROUP}.  If {arg NEWFLG} is a number, the hash file will be created with {arg NEWFLG} entries.  Otherwise, it will be created to allow 20000 entries.

Example:
The following sequence of actions will cause all of the files on the PROJECT directory to be noticed by the WHEREIS package.

(WHEREISNOTICE '<PROJECT>*. T '<PROJECT>PROJECTWHEREIS.HASH)
(push WHEREIS.HASH (FINDFILE '<PROJECT>PROJECTWHEREIS.HASH))
}}

}{End SubSec WHEREIS Package}