Apply the new ground_level method.
[crawl.git] / crawl-ref / source / database.h
blob95e7bb701975f7a85ca1cf68bea08e1b089e2c0e
1 /*
2 * database.h
4 * Created by Peter Berger on 4/15/07.
5 */
8 #ifndef DATABASE_H
9 #define DATABASE_H
11 #include "externs.h"
12 #include <list>
14 #ifdef DB_NDBM
15 extern "C" {
16 # include <ndbm.h>
18 #elif defined(DB_DBH)
19 extern "C" {
20 # define DB_DBM_HSEARCH 1
21 # include <db.h>
23 #elif defined(USE_SQLITE_DBM)
24 # include "sqldbm.h"
25 #else
26 # error DBM interfaces unavailable!
27 #endif
29 #define DPTR_COERCE char *
31 void databaseSystemInit();
32 void databaseSystemShutdown();
33 datum database_fetch(DBM *database, const std::string &key);
35 typedef bool (*db_find_filter)(std::string key, std::string body);
37 std::vector<std::string> database_find_keys(DBM *database,
38 const std::string &regex,
39 bool ignore_case = false,
40 db_find_filter filter = NULL);
41 std::vector<std::string> database_find_bodies(DBM *database,
42 const std::string &regex,
43 bool ignore_case = false,
44 db_find_filter filter = NULL);
47 std::string getWeightedSpeechString(const std::string &key,
48 const std::string &suffix,
49 const int weight = -1);
51 std::string getQuoteString(const std::string &key);
52 std::string getLongDescription(const std::string &key);
53 std::string getWeightedRandomisedDescription(const std::string &key);
55 std::vector<std::string> getLongDescKeysByRegex(const std::string &regex,
56 db_find_filter filter = NULL);
57 std::vector<std::string> getLongDescBodiesByRegex(const std::string &regex,
58 db_find_filter filter = NULL);
60 std::string getGameStartDescription(const std::string &key);
62 std::string getShoutString(const std::string &monst,
63 const std::string &suffix = "");
64 std::string getSpeakString(const std::string &key);
65 std::string getRandNameString(const std::string &itemtype,
66 const std::string &suffix = "");
67 std::string getHelpString(const std::string &topic);
68 std::string getMiscString(const std::string &misc,
69 const std::string &suffix = "");
71 std::vector<std::string> getAllFAQKeys(void);
72 std::string getFAQ_Question(const std::string &key);
73 std::string getFAQ_Answer(const std::string &question);
74 #endif