home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / news / cnews.tar / libdbz / dbzdbm.c < prev    next >
C/C++ Source or Header  |  1993-05-27  |  622b  |  46 lines

  1. /*
  2.  * dbm emulation on top of dbz
  3.  */
  4.  
  5. #include <dbz.h>
  6.  
  7. /*
  8.  - dbminit - open a database, creating it (using defaults) if necessary
  9.  */
  10. int                 /* 0 success, -1 failure */
  11. dbminit(name)
  12. char *name;
  13. {
  14.     return(dbzdbminit(name));
  15. }
  16.  
  17. /*
  18.  - dbmclose - close a database
  19.  */
  20. int
  21. dbmclose()
  22. {
  23.     return(dbzdbmclose());
  24. }
  25.  
  26. /*
  27.  - fetch - get an entry from the database
  28.  */
  29. datum                /* dptr NULL, dsize 0 means failure */
  30. fetch(key)
  31. datum key;
  32. {
  33.     return(dbzdbmfetch(key));
  34. }
  35.  
  36. /*
  37.  - store - add an entry to the database
  38.  */
  39. int                /* 0 success, -1 failure */
  40. store(key, data)
  41. datum key;
  42. datum data;
  43. {
  44.     return(dbzdbmstore(key, data));
  45. }
  46.