2N/A/*-
2N/A * Copyright (c) 1990, 1993
2N/A * The Regents of the University of California. All rights reserved.
2N/A *
2N/A * This code is derived from software contributed to Berkeley by
2N/A * Margo Seltzer.
2N/A *
2N/A * Redistribution and use in source and binary forms, with or without
2N/A * modification, are permitted provided that the following conditions
2N/A * are met:
2N/A * 1. Redistributions of source code must retain the above copyright
2N/A * notice, this list of conditions and the following disclaimer.
2N/A * 2. Redistributions in binary form must reproduce the above copyright
2N/A * notice, this list of conditions and the following disclaimer in the
2N/A * documentation and/or other materials provided with the distribution.
2N/A * 3. All advertising materials mentioning features or use of this software
2N/A * must display the following acknowledgement:
2N/A * This product includes software developed by the University of
2N/A * California, Berkeley and its contributors.
2N/A * 4. Neither the name of the University nor the names of its contributors
2N/A * may be used to endorse or promote products derived from this software
2N/A * without specific prior written permission.
2N/A *
2N/A * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2N/A * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2N/A * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2N/A * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2N/A * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2N/A * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2N/A * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2N/A * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2N/A * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2N/A * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2N/A * SUCH DAMAGE.
2N/A *
2N/A * @(#)ndbm.h 8.1 (Berkeley) 6/2/93
2N/A */
2N/A
2N/A#ifndef _NDBM_H_
2N/A#define _NDBM_H_
2N/A
2N/A#include "db.h"
2N/A
2N/A/* Map dbm interface onto db(3). */
2N/A#define DBM_RDONLY O_RDONLY
2N/A
2N/A/* Flags to dbm_store(). */
2N/A#define DBM_INSERT 0
2N/A#define DBM_REPLACE 1
2N/A
2N/A/*
2N/A * The db(3) support for ndbm(3) always appends this suffix to the
2N/A * file name to avoid overwriting the user's original database.
2N/A */
2N/A#define DBM_SUFFIX ".db"
2N/A
2N/Atypedef struct {
2N/A void *dptr;
2N/A size_t dsize;
2N/A} datum;
2N/A
2N/Atypedef DB DBM;
2N/A#define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE
2N/A
2N/A#define dbm_close kdb2_dbm_close
2N/A#define dbm_delete kdb2_dbm_delete
2N/A#define dbm_fetch kdb2_dbm_fetch
2N/A#define dbm_firstkey kdb2_dbm_firstkey
2N/A#define dbm_forder kdb2_dbm_forder
2N/A#define dbm_nextkey kdb2_dbm_nextkey
2N/A#define dbm_open kdb2_dbm_open
2N/A#define dbm_store kdb2_dbm_store
2N/A#define dbm_dirfno kdb2_dbm_dirfno
2N/A#define dbm_error kdb2_dbm_error
2N/A#define dbm_clearerr kdb2_dbm_clearerr
2N/A
2N/A__BEGIN_DECLS
2N/Avoid dbm_close __P((DBM *));
2N/Aint dbm_delete __P((DBM *, datum));
2N/Adatum dbm_fetch __P((DBM *, datum));
2N/Adatum dbm_firstkey __P((DBM *));
2N/Along dbm_forder __P((DBM *, datum));
2N/Adatum dbm_nextkey __P((DBM *));
2N/ADBM *dbm_open __P((const char *, int, int));
2N/Aint dbm_store __P((DBM *, datum, datum, int));
2N/Aint dbm_dirfno __P((DBM *));
2N/Aint dbm_error __P((DBM *db));
2N/Aint dbm_clearerr __P((DBM *db));
2N/A__END_DECLS
2N/A
2N/A#endif /* !_NDBM_H_ */