summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/database.h
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/database.h')
-rw-r--r--crawl-ref/source/database.h31
1 files changed, 18 insertions, 13 deletions
diff --git a/crawl-ref/source/database.h b/crawl-ref/source/database.h
index 71b8474033..364a87c7b6 100644
--- a/crawl-ref/source/database.h
+++ b/crawl-ref/source/database.h
@@ -10,29 +10,34 @@
#ifndef DATABASE_H
#define DATABASE_H
-#undef DEBUG // hack
-#define NDEBUG
+#include "AppHdr.h"
#include "externs.h"
+#include <list>
-#ifdef __cplusplus
extern "C" {
-#endif
+#ifdef DB_NDBM
-#include <ndbm.h>
+# include <ndbm.h>
+# define DPTR_COERCE void *
+
+#else
+
+# define DB_DBM_HSEARCH 1
+# include <db.h>
+# define DPTR_COERCE char *
-// For convenience during shutdown.
-typedef struct dbList_s dbList_t;
-#ifdef __cplusplus
-}
#endif
-extern dbList_t *openDBList;
+}
+
+typedef std::list<DBM *> db_list;
+
+extern db_list openDBList;
void databaseSystemInit();
void databaseSystemShutdown();
DBM *openDB(const char *dbFilename);
-datum *database_fetch(DBM *database, char *key);
-
+datum database_fetch(DBM *database, const std::string &key);
-std::string getLongDescription(const char *key);
+std::string getLongDescription(const std::string &key);
#endif