README 2.6 KB

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