11.6Sandvar#	$NetBSD: README,v 1.6 2024/02/09 22:08:30 andvar Exp $
21.2Scgd#	@(#)README	8.1 (Berkeley) 6/4/93
31.1Scgd
41.1ScgdThis package implements a superset of the hsearch and dbm/ndbm libraries.
51.1Scgd
61.1ScgdTest Programs:
71.1Scgd	All test programs which need key/data pairs expect them entered
81.1Scgd	with key and data on separate lines
91.1Scgd
101.1Scgd	tcreat3.c	
111.1Scgd		Takes 
121.1Scgd			bucketsize (bsize), 
131.1Scgd			fill factor (ffactor), and
141.1Scgd			initial number of elements (nelem).  
151.1Scgd		Creates a hash table named hashtest containing the 
161.1Scgd		keys/data pairs entered from standard in.
171.1Scgd	thash4.c
181.1Scgd		Takes
191.1Scgd			bucketsize (bsize), 
201.1Scgd			fill factor (ffactor), 
211.1Scgd			initial number of elements (nelem)
221.1Scgd			bytes of cache (ncached), and
231.1Scgd			file from which to read data  (fname)
241.1Scgd		Creates a table from the key/data pairs on standard in and
251.1Scgd		then does a read of each key/data in fname
261.1Scgd	tdel.c
271.1Scgd		Takes
281.1Scgd			bucketsize (bsize), and
291.1Scgd			fill factor (ffactor).
301.1Scgd			file from which to read data (fname)
311.1Scgd		Reads each key/data pair from fname and deletes the
321.1Scgd		key from the hash table hashtest
331.1Scgd	tseq.c
341.1Scgd		Reads the key/data pairs in the file hashtest and writes them
351.1Scgd		to standard out.
361.1Scgd	tread2.c
371.1Scgd		Takes
381.1Scgd			butes of cache (ncached).
391.1Scgd		Reads key/data pairs from standard in and looks them up
401.1Scgd		in the file hashtest.
411.1Scgd	tverify.c
421.1Scgd		Reads key/data pairs from standard in, looks them up
431.1Scgd		in the file hashtest, and verifies that the data is
441.1Scgd		correct.
451.1Scgd
461.1ScgdNOTES:
471.1Scgd
481.2ScgdThe man page ../man/db.3 explains the interface to the hashing system.
491.1ScgdThe file hash.ps is a postscript copy of a paper explaining
501.1Scgdthe history, implementation, and performance of the hash package.
511.1Scgd
521.6Sandvar"bugs" or idiosyncrasies
531.1Scgd
541.1ScgdIf you have a lot of overflows, it is possible to run out of overflow
551.1Scgdpages.  Currently, this will cause a message to be printed on stderr.
561.1ScgdEventually, this will be indicated by a return error code.
571.1Scgd
581.1ScgdIf you are using the ndbm interface and exit without flushing or closing the
591.1Scgdfile, you may lose updates since the package buffers all writes.  Also,
601.1Scgdthe db interface only creates a single database file.  To avoid overwriting
611.1Scgdthe user's original file, the suffix ".db" is appended to the file name
621.1Scgdpassed to dbm_open.  Additionally, if your code "knows" about the historic
631.1Scgd.dir and .pag files, it will break.  
641.1Scgd
651.1ScgdThere is a fundamental difference between this package and the old hsearch.
661.1ScgdHsearch requires the user to maintain the keys and data in the application's
671.1Scgdallocated memory while hash takes care of all storage management.  The down
681.1Scgdside is that the byte strings passed in the ENTRY structure must be null
691.1Scgdterminated (both the keys and the data).
70