1 | /* ndbm.h,v 1.2 2004/09/14 22:27:34 bird Exp */
|
---|
2 | /** @file
|
---|
3 | * FreeBSD 5.1
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*-
|
---|
7 | * Copyright (c) 1990, 1993
|
---|
8 | * The Regents of the University of California. All rights reserved.
|
---|
9 | *
|
---|
10 | * This code is derived from software contributed to Berkeley by
|
---|
11 | * Margo Seltzer.
|
---|
12 | *
|
---|
13 | * Redistribution and use in source and binary forms, with or without
|
---|
14 | * modification, are permitted provided that the following conditions
|
---|
15 | * are met:
|
---|
16 | * 1. Redistributions of source code must retain the above copyright
|
---|
17 | * notice, this list of conditions and the following disclaimer.
|
---|
18 | * 2. Redistributions in binary form must reproduce the above copyright
|
---|
19 | * notice, this list of conditions and the following disclaimer in the
|
---|
20 | * documentation and/or other materials provided with the distribution.
|
---|
21 | * 3. All advertising materials mentioning features or use of this software
|
---|
22 | * must display the following acknowledgement:
|
---|
23 | * This product includes software developed by the University of
|
---|
24 | * California, Berkeley and its contributors.
|
---|
25 | * 4. Neither the name of the University nor the names of its contributors
|
---|
26 | * may be used to endorse or promote products derived from this software
|
---|
27 | * without specific prior written permission.
|
---|
28 | *
|
---|
29 | * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
---|
30 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
---|
31 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
---|
32 | * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
---|
33 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
---|
34 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
---|
35 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
---|
36 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
---|
37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
---|
38 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
---|
39 | * SUCH DAMAGE.
|
---|
40 | *
|
---|
41 | * @(#)ndbm.h 8.1 (Berkeley) 6/2/93
|
---|
42 | * $FreeBSD: src/include/ndbm.h,v 1.4 2002/03/23 17:24:53 imp Exp $
|
---|
43 | */
|
---|
44 |
|
---|
45 | #ifndef _NDBM_H_
|
---|
46 | #define _NDBM_H_
|
---|
47 |
|
---|
48 | #include <db.h>
|
---|
49 |
|
---|
50 | /* Map dbm interface onto db(3). */
|
---|
51 | #define DBM_RDONLY O_RDONLY
|
---|
52 |
|
---|
53 | /* Flags to dbm_store(). */
|
---|
54 | #define DBM_INSERT 0
|
---|
55 | #define DBM_REPLACE 1
|
---|
56 |
|
---|
57 | /*
|
---|
58 | * The db(3) support for ndbm always appends this suffix to the
|
---|
59 | * file name to avoid overwriting the user's original database.
|
---|
60 | */
|
---|
61 | #define DBM_SUFFIX ".db"
|
---|
62 |
|
---|
63 | typedef struct {
|
---|
64 | char *dptr;
|
---|
65 | int dsize;
|
---|
66 | } datum;
|
---|
67 |
|
---|
68 | typedef DB DBM;
|
---|
69 | #define dbm_pagfno(a) DBM_PAGFNO_NOT_AVAILABLE
|
---|
70 |
|
---|
71 | __BEGIN_DECLS
|
---|
72 | int dbm_clearerr(DBM *);
|
---|
73 | void dbm_close(DBM *);
|
---|
74 | int dbm_delete(DBM *, datum);
|
---|
75 | int dbm_error(DBM *);
|
---|
76 | datum dbm_fetch(DBM *, datum);
|
---|
77 | datum dbm_firstkey(DBM *);
|
---|
78 | long dbm_forder(DBM *, datum);
|
---|
79 | datum dbm_nextkey(DBM *);
|
---|
80 | DBM *dbm_open(const char *, int, int);
|
---|
81 | int dbm_store(DBM *, datum, datum, int);
|
---|
82 | int dbm_dirfno(DBM *);
|
---|
83 | __END_DECLS
|
---|
84 |
|
---|
85 | #endif /* !_NDBM_H_ */
|
---|