README revision 1.6 1 1.6 andvar # $NetBSD: README,v 1.6 2024/02/09 22:08:30 andvar Exp $
2 1.2 cgd # @(#)README 8.1 (Berkeley) 6/4/93
3 1.1 cgd
4 1.1 cgd This package implements a superset of the hsearch and dbm/ndbm libraries.
5 1.1 cgd
6 1.1 cgd Test Programs:
7 1.1 cgd All test programs which need key/data pairs expect them entered
8 1.1 cgd with key and data on separate lines
9 1.1 cgd
10 1.1 cgd tcreat3.c
11 1.1 cgd Takes
12 1.1 cgd bucketsize (bsize),
13 1.1 cgd fill factor (ffactor), and
14 1.1 cgd initial number of elements (nelem).
15 1.1 cgd Creates a hash table named hashtest containing the
16 1.1 cgd keys/data pairs entered from standard in.
17 1.1 cgd thash4.c
18 1.1 cgd Takes
19 1.1 cgd bucketsize (bsize),
20 1.1 cgd fill factor (ffactor),
21 1.1 cgd initial number of elements (nelem)
22 1.1 cgd bytes of cache (ncached), and
23 1.1 cgd file from which to read data (fname)
24 1.1 cgd Creates a table from the key/data pairs on standard in and
25 1.1 cgd then does a read of each key/data in fname
26 1.1 cgd tdel.c
27 1.1 cgd Takes
28 1.1 cgd bucketsize (bsize), and
29 1.1 cgd fill factor (ffactor).
30 1.1 cgd file from which to read data (fname)
31 1.1 cgd Reads each key/data pair from fname and deletes the
32 1.1 cgd key from the hash table hashtest
33 1.1 cgd tseq.c
34 1.1 cgd Reads the key/data pairs in the file hashtest and writes them
35 1.1 cgd to standard out.
36 1.1 cgd tread2.c
37 1.1 cgd Takes
38 1.1 cgd butes of cache (ncached).
39 1.1 cgd Reads key/data pairs from standard in and looks them up
40 1.1 cgd in the file hashtest.
41 1.1 cgd tverify.c
42 1.1 cgd Reads key/data pairs from standard in, looks them up
43 1.1 cgd in the file hashtest, and verifies that the data is
44 1.1 cgd correct.
45 1.1 cgd
46 1.1 cgd NOTES:
47 1.1 cgd
48 1.2 cgd The man page ../man/db.3 explains the interface to the hashing system.
49 1.1 cgd The file hash.ps is a postscript copy of a paper explaining
50 1.1 cgd the history, implementation, and performance of the hash package.
51 1.1 cgd
52 1.6 andvar "bugs" or idiosyncrasies
53 1.1 cgd
54 1.1 cgd If you have a lot of overflows, it is possible to run out of overflow
55 1.1 cgd pages. Currently, this will cause a message to be printed on stderr.
56 1.1 cgd Eventually, this will be indicated by a return error code.
57 1.1 cgd
58 1.1 cgd If you are using the ndbm interface and exit without flushing or closing the
59 1.1 cgd file, you may lose updates since the package buffers all writes. Also,
60 1.1 cgd the db interface only creates a single database file. To avoid overwriting
61 1.1 cgd the user's original file, the suffix ".db" is appended to the file name
62 1.1 cgd passed to dbm_open. Additionally, if your code "knows" about the historic
63 1.1 cgd .dir and .pag files, it will break.
64 1.1 cgd
65 1.1 cgd There is a fundamental difference between this package and the old hsearch.
66 1.1 cgd Hsearch requires the user to maintain the keys and data in the application's
67 1.1 cgd allocated memory while hash takes care of all storage management. The down
68 1.1 cgd side is that the byte strings passed in the ENTRY structure must be null
69 1.1 cgd terminated (both the keys and the data).
70