about summary refs log tree commit diff
path: root/src/globals.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2003-07-31T13·47+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2003-07-31T13·47+0000
commit4a013962bdd08ee0cf285136e4eca0f2c9c76b98 (patch)
treec354204a50cc2c0a5e8873e2e5dab98316f42a5d /src/globals.cc
parent758bd4673a3553fcbd78c8f895d6efe839d3d538 (diff)
* Started using Berkeley DB environments. This is necessary for
  transaction support (but we don't actually use transactions yet).

Diffstat (limited to 'src/globals.cc')
-rw-r--r--src/globals.cc19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/globals.cc b/src/globals.cc
index 1edb38f748..8c3ec38283 100644
--- a/src/globals.cc
+++ b/src/globals.cc
@@ -2,6 +2,9 @@
 #include "db.hh"
 
 
+Database nixDB;
+
+
 string dbPath2Id = "path2id";
 string dbId2Paths = "id2paths";
 string dbSuccessors = "successors";
@@ -11,13 +14,19 @@ string dbSubstitutes = "substitutes";
 string nixStore = "/UNINIT";
 string nixDataDir = "/UNINIT";
 string nixLogDir = "/UNINIT";
-string nixDB = "/UNINIT";
+string nixDBPath = "/UNINIT";
+
+
+void openDB()
+{
+    nixDB.open(nixDBPath);
+}
 
 
 void initDB()
 {
-    createDB(nixDB, dbPath2Id);
-    createDB(nixDB, dbId2Paths);
-    createDB(nixDB, dbSuccessors);
-    createDB(nixDB, dbSubstitutes);
+    nixDB.createTable(dbPath2Id);
+    nixDB.createTable(dbId2Paths);
+    nixDB.createTable(dbSuccessors);
+    nixDB.createTable(dbSubstitutes);
 }