1166124Srafan/****************************************************************************
2166124Srafan * Copyright (c) 2006 Free Software Foundation, Inc.                        *
3166124Srafan *                                                                          *
4166124Srafan * Permission is hereby granted, free of charge, to any person obtaining a  *
5166124Srafan * copy of this software and associated documentation files (the            *
6166124Srafan * "Software"), to deal in the Software without restriction, including      *
7166124Srafan * without limitation the rights to use, copy, modify, merge, publish,      *
8166124Srafan * distribute, distribute with modifications, sublicense, and/or sell       *
9166124Srafan * copies of the Software, and to permit persons to whom the Software is    *
10166124Srafan * furnished to do so, subject to the following conditions:                 *
11166124Srafan *                                                                          *
12166124Srafan * The above copyright notice and this permission notice shall be included  *
13166124Srafan * in all copies or substantial portions of the Software.                   *
14166124Srafan *                                                                          *
15166124Srafan * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16166124Srafan * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17166124Srafan * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18166124Srafan * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19166124Srafan * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20166124Srafan * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21166124Srafan * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22166124Srafan *                                                                          *
23166124Srafan * Except as contained in this notice, the name(s) of the above copyright   *
24166124Srafan * holders shall not be used in advertising or otherwise to promote the     *
25166124Srafan * sale, use or other dealings in this Software without prior written       *
26166124Srafan * authorization.                                                           *
27166124Srafan ****************************************************************************/
28166124Srafan
29166124Srafan/****************************************************************************
30166124Srafan *  Author: Thomas E. Dickey                        2006                    *
31166124Srafan ****************************************************************************/
32166124Srafan
33166124Srafan/*
34166124Srafan * $Id: hashed_db.h,v 1.5 2006/08/19 15:58:34 tom Exp $
35166124Srafan */
36166124Srafan
37166124Srafan#ifndef HASHED_DB_H
38166124Srafan#define HASHED_DB_H 1
39166124Srafan
40166124Srafan#include <curses.h>
41166124Srafan
42166124Srafan#if USE_HASHED_DB
43166124Srafan
44166124Srafan#include <db.h>
45166124Srafan
46166124Srafan#ifndef DBN_SUFFIX
47166124Srafan#define DBM_SUFFIX ".db"
48166124Srafan#endif
49166124Srafan
50166124Srafan#ifdef DB_VERSION_MAJOR
51166124Srafan#define HASHED_DB_API DB_VERSION_MAJOR
52166124Srafan#else
53166124Srafan#define HASHED_DB_API 1		/* e.g., db 1.8.5 */
54166124Srafan#endif
55166124Srafan
56166124Srafanextern NCURSES_EXPORT(DB *) _nc_db_open(const char * /* path */, bool /* modify */);
57166124Srafanextern NCURSES_EXPORT(bool) _nc_db_have_data(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */);
58166124Srafanextern NCURSES_EXPORT(bool) _nc_db_have_index(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */);
59166124Srafanextern NCURSES_EXPORT(int) _nc_db_close(DB * /* db */);
60166124Srafanextern NCURSES_EXPORT(int) _nc_db_first(DB * /* db */, DBT * /* key */, DBT * /* data */);
61166124Srafanextern NCURSES_EXPORT(int) _nc_db_next(DB * /* db */, DBT * /* key */, DBT * /* data */);
62166124Srafanextern NCURSES_EXPORT(int) _nc_db_get(DB * /* db */, DBT * /* key */, DBT * /* data */);
63166124Srafanextern NCURSES_EXPORT(int) _nc_db_put(DB * /* db */, DBT * /* key */, DBT * /* data */);
64166124Srafan
65166124Srafan#endif
66166124Srafan
67166124Srafan#endif /* HASHED_DB_H */
68