Back to index

lightning-sunbird  0.9+nobinonly
ndbm.h
Go to the documentation of this file.
00001 /*-
00002  * Copyright (c) 1990, 1993
00003  *     The Regents of the University of California.  All rights reserved.
00004  *
00005  * This code is derived from software contributed to Berkeley by
00006  * Margo Seltzer.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted provided that the following conditions
00010  * are met:
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. ***REMOVED*** - see 
00017  *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
00018  * 4. Neither the name of the University nor the names of its contributors
00019  *    may be used to endorse or promote products derived from this software
00020  *    without specific prior written permission.
00021  *
00022  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
00023  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00024  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00025  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
00026  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00027  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00028  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00029  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00030  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00031  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00032  * SUCH DAMAGE.
00033  *
00034  *     @(#)ndbm.h    8.1 (Berkeley) 6/2/93
00035  */
00036 
00037 #ifndef _NDBM_H_
00038 #define       _NDBM_H_
00039 
00040 #include "mcom_db.h"
00041 
00042 /* Map dbm interface onto db(3). */
00043 #define DBM_RDONLY   O_RDONLY
00044 
00045 /* Flags to dbm_store(). */
00046 #define DBM_INSERT      0
00047 #define DBM_REPLACE     1
00048 
00049 /*
00050  * The db(3) support for ndbm(3) always appends this suffix to the
00051  * file name to avoid overwriting the user's original database.
00052  */
00053 #define       DBM_SUFFIX    ".db"
00054 
00055 typedef struct {
00056        char *dptr;
00057        int dsize;
00058 } datum;
00059 
00060 typedef DB DBM;
00061 #define       dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE
00062 
00063 __BEGIN_DECLS
00064 void    dbm_close (DBM *);
00065 int     dbm_delete (DBM *, datum);
00066 datum   dbm_fetch (DBM *, datum);
00067 datum   dbm_firstkey (DBM *);
00068 long    dbm_forder (DBM *, datum);
00069 datum   dbm_nextkey (DBM *);
00070 DBM    *dbm_open (const char *, int, int);
00071 int     dbm_store (DBM *, datum, datum, int);
00072 int     dbm_dirfno (DBM *);
00073 __END_DECLS
00074 
00075 #endif /* !_NDBM_H_ */