1 # $OpenBSD: README,v 1.4 2002/02/24 21:24:06 millert Exp $
3 This package implements a superset of the hsearch and dbm/ndbm libraries.
6 All test programs which need key/data pairs expect them entered
7 with key and data on separate lines
12 fill factor (ffactor), and
13 initial number of elements (nelem).
14 Creates a hash table named hashtest containing the
15 keys/data pairs entered from standard in.
19 fill factor (ffactor),
20 initial number of elements (nelem)
21 bytes of cache (ncached), and
22 file from which to read data (fname)
23 Creates a table from the key/data pairs on standard in and
24 then does a read of each key/data in fname
27 bucketsize (bsize), and
28 fill factor (ffactor).
29 file from which to read data (fname)
30 Reads each key/data pair from fname and deletes the
31 key from the hash table hashtest
33 Reads the key/data pairs in the file hashtest and writes them
37 butes of cache (ncached).
38 Reads key/data pairs from standard in and looks them up
41 Reads key/data pairs from standard in, looks them up
42 in the file hashtest, and verifies that the data is
47 The man page ../man/db.3 explains the interface to the hashing system.
48 The file hash.ps is a postscript copy of a paper explaining
49 the history, implementation, and performance of the hash package.
51 "bugs" or idiosyncracies
53 If you have a lot of overflows, it is possible to run out of overflow
54 pages. Currently, this will cause a message to be printed on stderr.
55 Eventually, this will be indicated by a return error code.
57 If you are using the ndbm interface and exit without flushing or closing the
58 file, you may lose updates since the package buffers all writes. Also,
59 the db interface only creates a single database file. To avoid overwriting
60 the user's original file, the suffix ".db" is appended to the file name
61 passed to dbm_open. Additionally, if your code "knows" about the historic
62 .dir and .pag files, it will break.
64 There is a fundamental difference between this package and the old hsearch.
65 Hsearch requires the user to maintain the keys and data in the application's
66 allocated memory while hash takes care of all storage management. The down
67 side is that the byte strings passed in the ENTRY structure must be null
68 terminated (both the keys and the data).