diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-31T13·47+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-07-31T13·47+0000 |
commit | 4a013962bdd08ee0cf285136e4eca0f2c9c76b98 (patch) | |
tree | c354204a50cc2c0a5e8873e2e5dab98316f42a5d /src/globals.cc | |
parent | 758bd4673a3553fcbd78c8f895d6efe839d3d538 (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.cc | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/globals.cc b/src/globals.cc index 1edb38f7483e..8c3ec38283ec 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); } |