home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / sources / ndbm.h < prev    next >
C/C++ Source or Header  |  1991-05-23  |  3KB  |  80 lines

  1. /* ndbm.h  -  The include file for ndbm users.  */
  2.  
  3. /*  This file is part of GDBM, the GNU data base manager, by Philip A. Nelson.
  4.     Copyright (C) 1990, 1991  Free Software Foundation, Inc.
  5.  
  6.     GDBM is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; either version 1, or (at your option)
  9.     any later version.
  10.  
  11.     GDBM is distributed in the hope that it will be useful,
  12.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.     GNU General Public License for more details.
  15.  
  16.     You should have received a copy of the GNU General Public License
  17.     along with GDBM; see the file COPYING.  If not, write to
  18.     the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20.     You may contact the author by:
  21.        e-mail:  phil@cs.wwu.edu
  22.       us-mail:  Philip A. Nelson
  23.                 Computer Science Department
  24.                 Western Washington University
  25.                 Bellingham, WA 98226
  26.         phone:  (206) 676-3035
  27.  
  28. *************************************************************************/
  29.  
  30. /* Parameters to dbm_store for simple insertion or replacement. */
  31. #define  DBM_INSERT  0
  32. #define  DBM_REPLACE 1
  33.  
  34.  
  35. /* The data and key structure.  This structure is defined for compatibility. */
  36. #ifdef __STDC__
  37. #include "gdbmdefs.h"
  38. #else /* not __STDC__ */
  39. typedef struct {
  40.     char *dptr;
  41.     int   dsize;
  42.       } datum;
  43. #endif /* not __STDC__ */
  44.  
  45. /* The file information header. This is good enough for most applications. */
  46. #ifdef __STDC__
  47. #define DBM gdbm_file_info
  48. #else /* not __STDC__ */
  49. typedef struct {int dummy[10];} DBM;
  50. #endif /* not __STDC__ */
  51.  
  52. /* These are the routines (with some macros defining them!) */
  53.  
  54. #ifdef __STDC__
  55. extern DBM *dbm_open (char *file, int flags, int mode);
  56. extern void dbm_close (DBM *dbf);
  57. extern datum dbm_fetch (DBM *dbf, datum key);
  58. extern int dbm_store (DBM *dbf, datum key, datum content, int flags);
  59. extern int dbm_delete (DBM *dbf, datum key);
  60. extern datum dbm_firstkey (DBM *dbf);
  61. extern datum dbm_nextkey (DBM *dbf);
  62. extern int dbm_dirfno (DBM *dbf);
  63. extern int dbm_pagfno (DBM *dbf);
  64. #else /* not __STDC__ */
  65. extern DBM     *dbm_open ();
  66. extern void     dbm_close ();
  67. extern datum     dbm_fetch ();
  68. extern int     dbm_store ();
  69. extern int     dbm_delete ();
  70. extern datum     dbm_firstkey ();
  71. extern datum     dbm_nextkey ();
  72. extern int     dbm_dirfno ();
  73. extern int     dbm_pagfno ();
  74. #endif /* not __STDC__ */
  75.  
  76. #define         dbm_error(dbf)  0
  77. #define         dbm_clearerr(dbf)
  78.  
  79.  
  80.