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