README revision 1.1 1 1.1 cgd # @(#)README 5.3 (Berkeley) 2/22/91
2 1.1 cgd
3 1.1 cgd This package implements a superset of the hsearch and dbm/ndbm libraries.
4 1.1 cgd
5 1.1 cgd Contents:
6 1.1 cgd
7 1.1 cgd Hashing Package:
8 1.1 cgd dynahash.c
9 1.1 cgd page.c
10 1.1 cgd buf.c
11 1.1 cgd big.c
12 1.1 cgd hfunc.c
13 1.1 cgd log2.c
14 1.1 cgd
15 1.1 cgd hash.h
16 1.1 cgd page.h
17 1.1 cgd db.h
18 1.1 cgd
19 1.1 cgd Backward Compatibility Routines:
20 1.1 cgd ndbm.c
21 1.1 cgd ndbm.h
22 1.1 cgd hsearch.c
23 1.1 cgd search.h
24 1.1 cgd
25 1.1 cgd Misc:
26 1.1 cgd byte_order.c
27 1.1 cgd
28 1.1 cgd Compatibility routines:
29 1.1 cgd mkstemp.c
30 1.1 cgd
31 1.1 cgd ansi.h
32 1.1 cgd bsd.h
33 1.1 cgd cdefs.h
34 1.1 cgd endian.h
35 1.1 cgd posix.h
36 1.1 cgd unistd.h
37 1.1 cgd
38 1.1 cgd DIFFS:
39 1.1 cgd These are diffs since the date of the file (i.e. a file labeled
40 1.1 cgd DIFFS.2.12 are the diffs since the 2.12 version on arpa). The
41 1.1 cgd date of the DIFF file indicates when those diffs were installed.
42 1.1 cgd
43 1.1 cgd Test Programs:
44 1.1 cgd All test programs which need key/data pairs expect them entered
45 1.1 cgd with key and data on separate lines
46 1.1 cgd
47 1.1 cgd tcreat3.c
48 1.1 cgd Takes
49 1.1 cgd bucketsize (bsize),
50 1.1 cgd fill factor (ffactor), and
51 1.1 cgd initial number of elements (nelem).
52 1.1 cgd Creates a hash table named hashtest containing the
53 1.1 cgd keys/data pairs entered from standard in.
54 1.1 cgd thash4.c
55 1.1 cgd Takes
56 1.1 cgd bucketsize (bsize),
57 1.1 cgd fill factor (ffactor),
58 1.1 cgd initial number of elements (nelem)
59 1.1 cgd bytes of cache (ncached), and
60 1.1 cgd file from which to read data (fname)
61 1.1 cgd Creates a table from the key/data pairs on standard in and
62 1.1 cgd then does a read of each key/data in fname
63 1.1 cgd tdel.c
64 1.1 cgd Takes
65 1.1 cgd bucketsize (bsize), and
66 1.1 cgd fill factor (ffactor).
67 1.1 cgd file from which to read data (fname)
68 1.1 cgd Reads each key/data pair from fname and deletes the
69 1.1 cgd key from the hash table hashtest
70 1.1 cgd tseq.c
71 1.1 cgd Reads the key/data pairs in the file hashtest and writes them
72 1.1 cgd to standard out.
73 1.1 cgd tread2.c
74 1.1 cgd Takes
75 1.1 cgd butes of cache (ncached).
76 1.1 cgd Reads key/data pairs from standard in and looks them up
77 1.1 cgd in the file hashtest.
78 1.1 cgd tverify.c
79 1.1 cgd Reads key/data pairs from standard in, looks them up
80 1.1 cgd in the file hashtest, and verifies that the data is
81 1.1 cgd correct.
82 1.1 cgd
83 1.1 cgd NOTES:
84 1.1 cgd
85 1.1 cgd If you are not running a 4.3BSD-Reno or later system, you may need to use
86 1.1 cgd some of the compatibility files provided. The files are as follows:
87 1.1 cgd
88 1.1 cgd mkstemp.c Mkstemp/mktemp library routine.
89 1.1 cgd
90 1.1 cgd ansi.h Map bcopy and friends to memcpy and friends.
91 1.1 cgd bsd.h Map various new BSD things to old things.
92 1.1 cgd cdefs.h Handle the function prototypes in other include files.
93 1.1 cgd endian.h Handle byte ordering. Be sure to set BYTE_ORDER in
94 1.1 cgd endian.h appropriately for your machine. If you don't
95 1.1 cgd know what "endian" your machine is, compile
96 1.1 cgd byte_order.c and run it. It should tell you.
97 1.1 cgd posix.h Map various POSIX 1003.1 things to old-style things.
98 1.1 cgd unistd.h POSIX 1003.1 definitions.
99 1.1 cgd
100 1.1 cgd If you are not running on the current BSD release (4.3BSD-Reno+), you will
101 1.1 cgd need to include bsd.h in hash.h. Depending on what system you are running
102 1.1 cgd on, you will need to add the other compatibility h files in hash.h.
103 1.1 cgd
104 1.1 cgd The file search.h is provided for using the hsearch compatible interface
105 1.1 cgd on BSD systems. On System V derived systems, search.h should appear in
106 1.1 cgd /usr/include.
107 1.1 cgd
108 1.1 cgd The man page db.3 explains the interface to the hashing system.
109 1.1 cgd The file hash.ps is a postscript copy of a paper explaining
110 1.1 cgd the history, implementation, and performance of the hash package.
111 1.1 cgd
112 1.1 cgd "bugs" or idiosyncracies
113 1.1 cgd
114 1.1 cgd If you have a lot of overflows, it is possible to run out of overflow
115 1.1 cgd pages. Currently, this will cause a message to be printed on stderr.
116 1.1 cgd Eventually, this will be indicated by a return error code.
117 1.1 cgd
118 1.1 cgd If you are using the ndbm interface and exit without flushing or closing the
119 1.1 cgd file, you may lose updates since the package buffers all writes. Also,
120 1.1 cgd the db interface only creates a single database file. To avoid overwriting
121 1.1 cgd the user's original file, the suffix ".db" is appended to the file name
122 1.1 cgd passed to dbm_open. Additionally, if your code "knows" about the historic
123 1.1 cgd .dir and .pag files, it will break.
124 1.1 cgd
125 1.1 cgd There is a fundamental difference between this package and the old hsearch.
126 1.1 cgd Hsearch requires the user to maintain the keys and data in the application's
127 1.1 cgd allocated memory while hash takes care of all storage management. The down
128 1.1 cgd side is that the byte strings passed in the ENTRY structure must be null
129 1.1 cgd terminated (both the keys and the data).
130