README revision 1.1
11.1Scgd#	@(#)README	5.3 (Berkeley) 2/22/91
21.1Scgd
31.1ScgdThis package implements a superset of the hsearch and dbm/ndbm libraries.
41.1Scgd
51.1ScgdContents:
61.1Scgd
71.1ScgdHashing Package:
81.1Scgd	dynahash.c
91.1Scgd	page.c
101.1Scgd	buf.c
111.1Scgd	big.c
121.1Scgd	hfunc.c
131.1Scgd	log2.c
141.1Scgd
151.1Scgd	hash.h
161.1Scgd	page.h
171.1Scgd	db.h
181.1Scgd
191.1ScgdBackward Compatibility Routines:
201.1Scgd	ndbm.c
211.1Scgd	ndbm.h
221.1Scgd	hsearch.c
231.1Scgd	search.h
241.1Scgd
251.1ScgdMisc:
261.1Scgd	byte_order.c
271.1Scgd
281.1ScgdCompatibility routines:
291.1Scgd	mkstemp.c
301.1Scgd
311.1Scgd	ansi.h
321.1Scgd	bsd.h
331.1Scgd	cdefs.h
341.1Scgd	endian.h
351.1Scgd	posix.h
361.1Scgd	unistd.h
371.1Scgd
381.1ScgdDIFFS:
391.1Scgd	These are diffs since the date of the file (i.e. a file labeled
401.1Scgd	DIFFS.2.12 are the diffs since the 2.12 version on arpa).  The
411.1Scgd	date of the DIFF file indicates when those diffs were installed.
421.1Scgd
431.1ScgdTest Programs:
441.1Scgd	All test programs which need key/data pairs expect them entered
451.1Scgd	with key and data on separate lines
461.1Scgd
471.1Scgd	tcreat3.c	
481.1Scgd		Takes 
491.1Scgd			bucketsize (bsize), 
501.1Scgd			fill factor (ffactor), and
511.1Scgd			initial number of elements (nelem).  
521.1Scgd		Creates a hash table named hashtest containing the 
531.1Scgd		keys/data pairs entered from standard in.
541.1Scgd	thash4.c
551.1Scgd		Takes
561.1Scgd			bucketsize (bsize), 
571.1Scgd			fill factor (ffactor), 
581.1Scgd			initial number of elements (nelem)
591.1Scgd			bytes of cache (ncached), and
601.1Scgd			file from which to read data  (fname)
611.1Scgd		Creates a table from the key/data pairs on standard in and
621.1Scgd		then does a read of each key/data in fname
631.1Scgd	tdel.c
641.1Scgd		Takes
651.1Scgd			bucketsize (bsize), and
661.1Scgd			fill factor (ffactor).
671.1Scgd			file from which to read data (fname)
681.1Scgd		Reads each key/data pair from fname and deletes the
691.1Scgd		key from the hash table hashtest
701.1Scgd	tseq.c
711.1Scgd		Reads the key/data pairs in the file hashtest and writes them
721.1Scgd		to standard out.
731.1Scgd	tread2.c
741.1Scgd		Takes
751.1Scgd			butes of cache (ncached).
761.1Scgd		Reads key/data pairs from standard in and looks them up
771.1Scgd		in the file hashtest.
781.1Scgd	tverify.c
791.1Scgd		Reads key/data pairs from standard in, looks them up
801.1Scgd		in the file hashtest, and verifies that the data is
811.1Scgd		correct.
821.1Scgd
831.1ScgdNOTES:
841.1Scgd
851.1ScgdIf you are not running a 4.3BSD-Reno or later system, you may need to use
861.1Scgdsome of the compatibility files provided.  The files are as follows:
871.1Scgd
881.1Scgd	mkstemp.c	Mkstemp/mktemp library routine.
891.1Scgd
901.1Scgd	ansi.h		Map bcopy and friends to memcpy and friends.
911.1Scgd	bsd.h		Map various new BSD things to old things.
921.1Scgd	cdefs.h		Handle the function prototypes in other include files.
931.1Scgd	endian.h	Handle byte ordering.  Be sure to set BYTE_ORDER in
941.1Scgd			endian.h appropriately for your machine.  If you don't
951.1Scgd			know what "endian" your machine is, compile
961.1Scgd			byte_order.c and run it.  It should tell you.
971.1Scgd	posix.h		Map various POSIX 1003.1 things to old-style things.
981.1Scgd	unistd.h	POSIX 1003.1 definitions.
991.1Scgd
1001.1ScgdIf you are not running on the current BSD release (4.3BSD-Reno+), you will
1011.1Scgdneed to include bsd.h in hash.h.  Depending on what system you are running
1021.1Scgdon, you will need to add the other compatibility h files in hash.h.
1031.1Scgd
1041.1ScgdThe file search.h is provided for using the hsearch compatible interface
1051.1Scgdon BSD systems.  On System V derived systems, search.h should appear in 
1061.1Scgd/usr/include.
1071.1Scgd
1081.1ScgdThe man page db.3 explains the interface to the hashing system.
1091.1ScgdThe file hash.ps is a postscript copy of a paper explaining
1101.1Scgdthe history, implementation, and performance of the hash package.
1111.1Scgd
1121.1Scgd"bugs" or idiosyncracies
1131.1Scgd
1141.1ScgdIf you have a lot of overflows, it is possible to run out of overflow
1151.1Scgdpages.  Currently, this will cause a message to be printed on stderr.
1161.1ScgdEventually, this will be indicated by a return error code.
1171.1Scgd
1181.1ScgdIf you are using the ndbm interface and exit without flushing or closing the
1191.1Scgdfile, you may lose updates since the package buffers all writes.  Also,
1201.1Scgdthe db interface only creates a single database file.  To avoid overwriting
1211.1Scgdthe user's original file, the suffix ".db" is appended to the file name
1221.1Scgdpassed to dbm_open.  Additionally, if your code "knows" about the historic
1231.1Scgd.dir and .pag files, it will break.  
1241.1Scgd
1251.1ScgdThere is a fundamental difference between this package and the old hsearch.
1261.1ScgdHsearch requires the user to maintain the keys and data in the application's
1271.1Scgdallocated memory while hash takes care of all storage management.  The down
1281.1Scgdside is that the byte strings passed in the ENTRY structure must be null
1291.1Scgdterminated (both the keys and the data).
130