home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / mcom_ndbm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.5 KB  |  95 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /*-
  19.  * Copyright (c) 1990, 1993
  20.  *    The Regents of the University of California.  All rights reserved.
  21.  *
  22.  * This code is derived from software contributed to Berkeley by
  23.  * Margo Seltzer.
  24.  *
  25.  * Redistribution and use in source and binary forms, with or without
  26.  * modification, are permitted provided that the following conditions
  27.  * are met:
  28.  * 1. Redistributions of source code must retain the above copyright
  29.  *    notice, this list of conditions and the following disclaimer.
  30.  * 2. Redistributions in binary form must reproduce the above copyright
  31.  *    notice, this list of conditions and the following disclaimer in the
  32.  *    documentation and/or other materials provided with the distribution.
  33.  * 3. All advertising materials mentioning features or use of this software
  34.  *    must display the following acknowledgement:
  35.  *    This product includes software developed by the University of
  36.  *    California, Berkeley and its contributors.
  37.  * 4. Neither the name of the University nor the names of its contributors
  38.  *    may be used to endorse or promote products derived from this software
  39.  *    without specific prior written permission.
  40.  *
  41.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  42.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  43.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  44.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  45.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  46.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  47.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  48.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  49.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  50.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  51.  * SUCH DAMAGE.
  52.  *
  53.  *    @(#)ndbm.h    8.1 (Berkeley) 6/2/93
  54.  */
  55.  
  56. #ifndef _NDBM_H_
  57. #define    _NDBM_H_
  58.  
  59. #include "mcom_db.h"
  60.  
  61. /* Map dbm interface onto db(3). */
  62. #define DBM_RDONLY    O_RDONLY
  63.  
  64. /* Flags to dbm_store(). */
  65. #define DBM_INSERT      0
  66. #define DBM_REPLACE     1
  67.  
  68. /*
  69.  * The db(3) support for ndbm(3) always appends this suffix to the
  70.  * file name to avoid overwriting the user's original database.
  71.  */
  72. #define    DBM_SUFFIX    ".db"
  73.  
  74. typedef struct {
  75.     char *dptr;
  76.     int dsize;
  77. } datum;
  78.  
  79. typedef DB DBM;
  80. #define    dbm_pagfno(a)    DBM_PAGFNO_NOT_AVAILABLE
  81.  
  82. __BEGIN_DECLS
  83. void     dbm_close (DBM *);
  84. int     dbm_delete (DBM *, datum);
  85. datum     dbm_fetch (DBM *, datum);
  86. datum     dbm_firstkey (DBM *);
  87. long     dbm_forder (DBM *, datum);
  88. datum     dbm_nextkey (DBM *);
  89. DBM    *dbm_open (const char *, int, int);
  90. int     dbm_store (DBM *, datum, datum, int);
  91. int     dbm_dirfno (DBM *);
  92. __END_DECLS
  93.  
  94. #endif /* !_NDBM_H_ */
  95.