jughead is copyright 1993, University of Utah Computer Center. This source may be freely distributed as long as this copyright notice remains intact, and distribution is in no way used for any monetary gain, by any institution, business, person, or persons. jughead is a tool for getting menu information from various gopher servers, and is an acronym for: Jonzy's Universal Gopher Hierarchy Excavation And Display jughead was written in ANSI C, developed on both an IBM RS6000, and a Sun spark-10, and should port easily to any ANSI C conformant environment. jughead has been successfuly ported to a Mac running A/UX, RS6000 running AIX, sun running SunOS 4.1.2, and a DEC running ultrix. It is anticipated this program will be a tool for administrators in gopherspace. If you make any changes to the sources, please send me a copy. Release: version 0.9, released: May 24, 1993. jughead now supports some special commands, where each special command must be preceeded by a question mark '?', and are listed below: ?all what ?help [what] ?limit=n what ?version [what] ?range=start-stop what where 'what' is a standard search string, anything enclosed in square brackets is optional, and all special commands must be preceeded with '?'. Each command is described below: ?all what returns all the hits on 'what'. Otherwise items are only returned if there are less than 1024 items. ?help [what] Gives you the "About.jughead" document and any optional hits on 'what'. ?limit=n what Returns the first 'n' items on 'what'. ?version [what] Returns the version of jughead and any optional hits on 'what'. ?range=start-stop what Returns the 'start' to 'stop' range of items on 'what'. Only 1 special command is supported per query, and if any syntax error is encountered it is reported as the title to the help document. To supports this feature you need to edit JUGHEADHELPDOC in the Makefile to specify where and what gopher server is serving the help document. At the request of doylej@liberty.uc.wlu.edu modified the code to return a link when there are more than 1024 items found. The link has the form: Name=xxx items found. Please consolidate your request Type=1 Port=the port number jughead was started under Path=?all [the requested search] Host=THEHOST as now defined in the Makefile And a special command of "?" now gets mapped to "?help". Added support for the "?range=start-stop what" special command. Revamped the man page. Tweeked the Makefile by making the default location for jughead be /usr/local/etc instead /usr/local/bin. And fixed a problem of the RS6000 not handling a conditional macro expansion. Thank you Utermann@Uni-Augsburg.DE for bringing this to my attention. Release: version 0.8.2a, released: May 23, 1993. doyle@liberty.uc.wlu.edu reported the Makefile was passing the null string to the complier for the DEFAULTBOOLOP define. Release: version 0.8.2, released: May 22, 1993. Added DEFAULTBOOLOP to the Makefile to allow one to alter the default boolean operation if none is given seperating words to search on. Thank danj@welchgate.welch.jhu.edu for this one. Gave support for multiple -x and -X flags. You can now specify more than one of each, example: jughead -x buckwheat 70 -X "1/A" -X "1/B" -X "ftp:*" gopher.server Release: version 0.8.1, released: May 21, 1993. Had to fix problem with use of the -m flag. The menus would not be displayed regardless if the flag was set or not. Release: version 0.8, released: May 20, 1993. When compiling under A/UX altered the use of sending data to the client to prevent a core dump. Thanks hagberg@cumc.cornell.edu for the info. Completely rewrote the routine that gets the arguments from the command line. The order of the arguments is no longer required with the exception the dataFile or host to connect with must be the last argument. This means the following is now valid: jughead -x site.X 9999 -m site.A -b data site.B site.C site.C This implies to show the menu as we traverse the gopher tree with the initial connection to site.C, and follow gopherspace to site.A, site.B, and site.C, but don't follow anything from site.X out port 9999, while building the initial database for future use with the -B flag. Added support for -u username to allow jughead to act as a search engine with the uid username. Thank riddle@is.rice.edu for this suggestion. Fixed a problem of reading the database and tables if they exist in a location other than jughead itself. Thank you rzakon@mitre.org for bringing this to my attention. Release: version 0.7.3, released: May 14, 1993. doyle@liberty.uc.wlu.edu reported that "a AND b" returned "a" if "b" did not exist. I believe things are now working. Release: version 0.7.2, released: May 12, 1993. doyle@liberty.uc.wlu.edu reported that "a AND b" returned "b" if "a" did not exist, so I had to fix it. Release: version 0.7.1, released: May 11, 1993. Fixed a problem where "a AND b AND c" would be evaluated to "a AND b OR c" if "a AND b" evaluated to nothing. Altered the way the information gets logged by logging the port jughead is using, to support determine which jughead logged the information when using multiple jugheads are logging to the same file. The bug and logging feature was reported and suggested by: doyle@liberty.uc.wlu.edu. Release: version 0.7, released: May 8, 1993. Fixed a problem that gave incorrect results when boolean searching on 3 or more words. Thank you doyle@liberty.uc.wlu.edu for bringing this to my attention. Moved jughead out beta state. Release: version 0.6_beta, released: May 7, 1993. Fixed a bug that would dump core when talking to a PC Gopher server that was not following gopher protocol. Added the use of the -m flag. This flag will suppress printing of the menus when not building the dataFile, indexes or running as a server. This flag will also enable the printing of the menus when building the dataFile. Fixed a bug that would not acknowlege an invalid port for the exceptions hosts, which is the host and port not to traverse. Gave support for porting jughead to A/UX, thank you hagberg@cumc.cornell.edu for bringing this to my attention. Fixed a bug that would dump core when attempting to retrieve an empty directory from a gopher+ server, thank you lindner@boombox.micro.umn.edu for bringing this to my attention. Added support for partial word searches, where the form of partial word searches is "matchPart*", "*" is invalid, and any characters following the asterik are ignored. Gave support for a selector string to not traverse with use of the -X flag. This flag supports a wildcard and will not traverse any of these items. Example: jughead some.gopher.site -X "ftp:*" will not traverse any ftp items pointed to by some.gopher.site. Fixed a bug the would dump core if jughead received more than one SIGHUP signal before being shutdown. Did some code cleaning up and optimization. Release: version 0.5_beta, released: April 9, 1993. Modified the code to support a secondary hash table. The table that gets read into memory is much smaller than previously, while the time to do the boolean operations and search the tables takes slightly longer, however, I doubt users will notice the difference. Note: This is a major change with the index tables. When running jughead with the -B flag, you no longer direct stdout to a file. What happens now is 2 files automaticlly get created, 1 with a ".ix" and the other with a ".ih" extention on the file created with the -b option. Furthermore when invoking jughead as a search engine with the -S flag you only need to give the name of the database file created with the -b flag. Release: version 0.4_beta, released: April 3, 1993. Added support for the 'a', 'A', and 't' options, which prints the port, host, number of directories, or port, host, the directories, and the time required to process a menu or build the index table or load the index table into memory respectively. Added the code from Mic Kaczmarczik: mic@bongo.cc.utexas.edu, which supports an optional -p port flag when running as a search engine. When using the -b option the datafile now gets sorted to remove all duplicates, and no longer gets written to datafile.sorted. The -o and -O flags are now meaningless and may soon disappear. Release: version 0.3.1_beta, released: March 28, 1993. Fixed a problem using vsprintf compiled on sun. Release: version 0.3_beta, released: March 28, 1993. Modifications include consolidating various #defines into the Makefile. Now keeps track of hosts we can't connect to and will not attempt to connect to these hosts again. Added support for compilation on a sun. Initial release: version 0.2_beta, released: March 25, 1993. jughead can be acquired via gopher by gophering to gopher.cc.utah.edu and looking in: About U of U Gopher Gopher Tools jughead as jughead.ReadMe and jughead.VERS.tar.Z or via anonymous ftp from ftp.cc.utah.edu in /pub/gopher/GopherTools as jughead.ReadMe and jughead.VERS.tar.Z, where ".VERS" is the current version. The file jughead.VERS.tar.Z is a compressed tar file which contains: About.jughead dirTree.c dirTree.h getargs.c jughead.1 jughead.c jughead.h jughead.survey Makefile searchCmnds.c search.c sockets.c tree.c tree.h utils.c utils.h Create yourself a directory for jughead, which should not be in a gopher data directory, and download the file jughead.VERS.tar.Z. Once you have downloaded jughead.VERS.tar.Z, where "VERS" is the version of jughead, the following command will uncompress and untar the files: uncompress -c < jughead.VERS.tar.Z | tar xfv - To view the man page, prior to running make install you can: make viewman To make the jughead application you should edit the Makefile and verify the following values are correct: THEVERSION The version of jughead, only edit this if you make changes. THEHOST The fully qualified name of the machine running jughead. JUGHEADHELPDOC The gopher server serving the jughead help document. DEFBOOLOP The default boolean operator if none is given between words. THECATCOMMAND The cat system command, the %s is required. THERMCOMMAND The rm system command, the %s is required. THESORTCOMMAND The sort system command, the %s is required. THETMPFILENAME The location and name of jughead's temporary file. THEPORT2USE The port to use when jughead is a search engine. MANSUFF The suffix of the man page and where to install the manpage. DESTDIR The location of the jughead executable. You may not want this to be publicly accessible. DESTMAN The location of the jughead man page. PERMISSIONS The permissions for the jughead executable. VARARGS Commented out if you have . VSPRINTTYPE The type vsprintf() returns. PROTOTYPES Uncommented if you want to use prototypes. POSIXSOURCE Needed when compiling under A/UX. NOWARNINGS Uncommented if you don't want to see any compiler warnings. OPTIMIZATION Any optimization flags you want to have. CC The C compiler to use. LINT The lint program to use if need me. LINTFLAGS Any lint flags you want to set. You will want to place the "About.jughead" document on your somewhere on your gopher server, and then give the proper definition of JUGHEADHELPDOC in the Makefile. You may want to copy the file "About.jughead" in the same directory as the jughead link, so the users will have knowlege how to search the tables built by jughead. Create a link file somewhere in your gopher data directory. Mine looks like: Name=Search all UofU menus using jughead Numb=4 Type=7 Port=3000 Path= Host=gopher.cc.utah.edu Now do a "make", "make all", or "make install" to compile jughead. If you get any compilation errors please inform me of the problem. The steps I did to get jughead running as a server follow: jughead -tb data -X "ftp:*" .utah.edu gopher.cc.utah.edu jughead -tB data jughead -tS -l data.log data & jughead is not inetd compatible. There exists a mailing list for discussion about jughead called: jughead-news@lists.utah.edu To get on this mailing list send mail to: jughead-news-request@lists.utah.edu Things still to do: 1) Move the Makefile macro THEHOST and JUGHEADHELPDOC to a .rc or .conf file or something like that. 2) Add support for the following special commands: ?pathway selectorString returns the gopher pathway of 'selectorString'. ?type t returns only items of type 't'. Allow an optional [=n] to return the first 'n' items. 3) Make jughead inetd compatible. 4) Use the Path field in the link file to specify which database to use, load the database into memory, do the search, and release the memory. Maybe have this as an option. How about initialy start up with no tables cached in memory, when we receive a query read the appropriate table into memory if there is none, and only release the memory if a new query refers to an alternate database? 5) Add the ability to query other jugheads. 6) Consolidate the tree.c and dirTree.c files. 7) Either reenable or remove support for the -o and -O flags? 8) Use vfork() instead of fork() when acting as a search engine to eliminate, as much as possible, any memory duplication. 9) Implement a no feed back flag which will give no feed back when building the hash tables, which will make the creation of the hash tables speed up by approximately 20 percent. 10) Implement the use of a synonym table. Please email source changes, complaints, or suggestions to: Rhett "Jonzy" Jones jonzy@cc.utah.edu