minix/lib/libc/db/hash
Ben Gras 2fe8fb192f Full switch to clang/ELF. Drop ack. Simplify.
There is important information about booting non-ack images in
docs/UPDATING. ack/aout-format images can't be built any more, and
booting clang/ELF-format ones is a little different. Updating to the
new boot monitor is recommended.

Changes in this commit:

	. drop boot monitor -> allowing dropping ack support
	. facility to copy ELF boot files to /boot so that old boot monitor
	  can still boot fairly easily, see UPDATING
	. no more ack-format libraries -> single-case libraries
	. some cleanup of OBJECT_FMT, COMPILER_TYPE, etc cases
	. drop several ack toolchain commands, but not all support
	  commands (e.g. aal is gone but acksize is not yet).
	. a few libc files moved to netbsd libc dir
	. new /bin/date as minix date used code in libc/
	. test compile fix
	. harmonize includes
	. /usr/lib is no longer special: without ack, /usr/lib plays no
	  kind of special bootstrapping role any more and bootstrapping
	  is done exclusively through packages, so releases depend even
	  less on the state of the machine making them now.
	. rename nbsd_lib* to lib*
	. reduce mtree
2012-02-14 14:52:02 +01:00
..
extern.h libc: add db code from netbsd 2010-07-14 17:46:18 +00:00
hash.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
hash.h libc: add db code from netbsd 2010-07-14 17:46:18 +00:00
hash_bigkey.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
hash_buf.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
hash_func.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
hash_log2.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
hash_page.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
Makefile.inc libc: add db code from netbsd 2010-07-14 17:46:18 +00:00
ndbm.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
ndbmdatum.c Full switch to clang/ELF. Drop ack. Simplify. 2012-02-14 14:52:02 +01:00
page.h libc: add db code from netbsd 2010-07-14 17:46:18 +00:00
README libc: add db code from netbsd 2010-07-14 17:46:18 +00:00

#	$NetBSD: README,v 1.5 1999/02/16 17:59:18 kleink Exp $
#	@(#)README	8.1 (Berkeley) 6/4/93

This package implements a superset of the hsearch and dbm/ndbm libraries.

Test Programs:
	All test programs which need key/data pairs expect them entered
	with key and data on separate lines

	tcreat3.c	
		Takes 
			bucketsize (bsize), 
			fill factor (ffactor), and
			initial number of elements (nelem).  
		Creates a hash table named hashtest containing the 
		keys/data pairs entered from standard in.
	thash4.c
		Takes
			bucketsize (bsize), 
			fill factor (ffactor), 
			initial number of elements (nelem)
			bytes of cache (ncached), and
			file from which to read data  (fname)
		Creates a table from the key/data pairs on standard in and
		then does a read of each key/data in fname
	tdel.c
		Takes
			bucketsize (bsize), and
			fill factor (ffactor).
			file from which to read data (fname)
		Reads each key/data pair from fname and deletes the
		key from the hash table hashtest
	tseq.c
		Reads the key/data pairs in the file hashtest and writes them
		to standard out.
	tread2.c
		Takes
			butes of cache (ncached).
		Reads key/data pairs from standard in and looks them up
		in the file hashtest.
	tverify.c
		Reads key/data pairs from standard in, looks them up
		in the file hashtest, and verifies that the data is
		correct.

NOTES:

The man page ../man/db.3 explains the interface to the hashing system.
The file hash.ps is a postscript copy of a paper explaining
the history, implementation, and performance of the hash package.

"bugs" or idiosyncracies

If you have a lot of overflows, it is possible to run out of overflow
pages.  Currently, this will cause a message to be printed on stderr.
Eventually, this will be indicated by a return error code.

If you are using the ndbm interface and exit without flushing or closing the
file, you may lose updates since the package buffers all writes.  Also,
the db interface only creates a single database file.  To avoid overwriting
the user's original file, the suffix ".db" is appended to the file name
passed to dbm_open.  Additionally, if your code "knows" about the historic
.dir and .pag files, it will break.  

There is a fundamental difference between this package and the old hsearch.
Hsearch requires the user to maintain the keys and data in the application's
allocated memory while hash takes care of all storage management.  The down
side is that the byte strings passed in the ENTRY structure must be null
terminated (both the keys and the data).