11d102085SJan Lentfer /**************************************************************************** 21d102085SJan Lentfer * Copyright (c) 2006 Free Software Foundation, Inc. * 31d102085SJan Lentfer * * 41d102085SJan Lentfer * Permission is hereby granted, free of charge, to any person obtaining a * 51d102085SJan Lentfer * copy of this software and associated documentation files (the * 61d102085SJan Lentfer * "Software"), to deal in the Software without restriction, including * 71d102085SJan Lentfer * without limitation the rights to use, copy, modify, merge, publish, * 81d102085SJan Lentfer * distribute, distribute with modifications, sublicense, and/or sell * 91d102085SJan Lentfer * copies of the Software, and to permit persons to whom the Software is * 101d102085SJan Lentfer * furnished to do so, subject to the following conditions: * 111d102085SJan Lentfer * * 121d102085SJan Lentfer * The above copyright notice and this permission notice shall be included * 131d102085SJan Lentfer * in all copies or substantial portions of the Software. * 141d102085SJan Lentfer * * 151d102085SJan Lentfer * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * 161d102085SJan Lentfer * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * 171d102085SJan Lentfer * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * 181d102085SJan Lentfer * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 191d102085SJan Lentfer * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * 201d102085SJan Lentfer * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * 211d102085SJan Lentfer * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * 221d102085SJan Lentfer * * 231d102085SJan Lentfer * Except as contained in this notice, the name(s) of the above copyright * 241d102085SJan Lentfer * holders shall not be used in advertising or otherwise to promote the * 251d102085SJan Lentfer * sale, use or other dealings in this Software without prior written * 261d102085SJan Lentfer * authorization. * 271d102085SJan Lentfer ****************************************************************************/ 281d102085SJan Lentfer 291d102085SJan Lentfer /**************************************************************************** 301d102085SJan Lentfer * Author: Thomas E. Dickey 2006 * 311d102085SJan Lentfer ****************************************************************************/ 321d102085SJan Lentfer 331d102085SJan Lentfer /* 34*3468e90cSJohn Marino * $Id: hashed_db.h,v 1.6 2014/04/12 22:41:10 tom Exp $ 351d102085SJan Lentfer */ 361d102085SJan Lentfer 371d102085SJan Lentfer #ifndef HASHED_DB_H 381d102085SJan Lentfer #define HASHED_DB_H 1 391d102085SJan Lentfer 401d102085SJan Lentfer #include <curses.h> 411d102085SJan Lentfer 421d102085SJan Lentfer #if USE_HASHED_DB 431d102085SJan Lentfer 44*3468e90cSJohn Marino #define DB_DBM_HSEARCH 0 /* quiet gcc -Wundef with db6 */ 45*3468e90cSJohn Marino 461d102085SJan Lentfer #include <db.h> 471d102085SJan Lentfer 481d102085SJan Lentfer #ifndef DBN_SUFFIX 491d102085SJan Lentfer #define DBM_SUFFIX ".db" 501d102085SJan Lentfer #endif 511d102085SJan Lentfer 521d102085SJan Lentfer #ifdef DB_VERSION_MAJOR 531d102085SJan Lentfer #define HASHED_DB_API DB_VERSION_MAJOR 541d102085SJan Lentfer #else 551d102085SJan Lentfer #define HASHED_DB_API 1 /* e.g., db 1.8.5 */ 561d102085SJan Lentfer #endif 571d102085SJan Lentfer 581d102085SJan Lentfer extern NCURSES_EXPORT(DB *) _nc_db_open(const char * /* path */, bool /* modify */); 591d102085SJan Lentfer extern NCURSES_EXPORT(bool) _nc_db_have_data(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */); 601d102085SJan Lentfer extern NCURSES_EXPORT(bool) _nc_db_have_index(DBT * /* key */, DBT * /* data */, char ** /* buffer */, int * /* size */); 611d102085SJan Lentfer extern NCURSES_EXPORT(int) _nc_db_close(DB * /* db */); 621d102085SJan Lentfer extern NCURSES_EXPORT(int) _nc_db_first(DB * /* db */, DBT * /* key */, DBT * /* data */); 631d102085SJan Lentfer extern NCURSES_EXPORT(int) _nc_db_next(DB * /* db */, DBT * /* key */, DBT * /* data */); 641d102085SJan Lentfer extern NCURSES_EXPORT(int) _nc_db_get(DB * /* db */, DBT * /* key */, DBT * /* data */); 651d102085SJan Lentfer extern NCURSES_EXPORT(int) _nc_db_put(DB * /* db */, DBT * /* key */, DBT * /* data */); 661d102085SJan Lentfer 671d102085SJan Lentfer #endif 681d102085SJan Lentfer 691d102085SJan Lentfer #endif /* HASHED_DB_H */ 70