2003-06-16 15:33:38 +02:00
|
|
|
#ifndef __GLOBALS_H
|
|
|
|
#define __GLOBALS_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
/* Database names. */
|
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
/* dbPath2Id :: Path -> FSId
|
2003-06-27 15:55:12 +02:00
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
Each pair (p, id) records that path $p$ contains an expansion of
|
|
|
|
$id$. */
|
|
|
|
extern string dbPath2Id;
|
2003-06-16 15:33:38 +02:00
|
|
|
|
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
/* dbId2Paths :: FSId -> [Path]
|
|
|
|
|
|
|
|
A mapping from ids to lists of paths. */
|
|
|
|
extern string dbId2Paths;
|
|
|
|
|
|
|
|
|
|
|
|
/* dbSuccessors :: FSId -> FSId
|
|
|
|
|
|
|
|
Each pair $(id_1, id_2)$ in this mapping records the fact that a
|
|
|
|
successor of an fstate expression stored in a file with identifier
|
|
|
|
$id_1$ is stored in a file with identifier $id_2$.
|
2003-06-17 17:45:43 +02:00
|
|
|
|
2003-07-04 14:18:06 +02:00
|
|
|
Note that a term $y$ is successor of $x$ iff there exists a
|
2003-07-04 17:29:58 +02:00
|
|
|
sequence of rewrite steps that rewrites $x$ into $y$.
|
|
|
|
*/
|
2003-07-04 14:18:06 +02:00
|
|
|
extern string dbSuccessors;
|
2003-06-16 15:33:38 +02:00
|
|
|
|
2003-07-09 18:12:40 +02:00
|
|
|
|
2003-07-15 18:28:54 +02:00
|
|
|
/* dbSubstitutes :: FSId -> [FSId]
|
|
|
|
|
|
|
|
Each pair $(id, [ids])$ tells Nix that it can realise any of the
|
|
|
|
fstate expressions referenced by the identifiers in $ids$ to
|
|
|
|
generate a path with identifier $id$.
|
2003-07-09 18:12:40 +02:00
|
|
|
|
|
|
|
The main purpose of this is for distributed caching of derivates.
|
|
|
|
One system can compute a derivate with hash $h$ and put it on a
|
|
|
|
website (as a Nix archive), for instance, and then another system
|
|
|
|
can register a substitute for that derivate. The substitute in
|
|
|
|
this case might be an fstate expression that fetches the Nix
|
|
|
|
archive.
|
|
|
|
*/
|
|
|
|
extern string dbSubstitutes;
|
|
|
|
|
2003-06-16 15:33:38 +02:00
|
|
|
|
|
|
|
/* Path names. */
|
|
|
|
|
2003-06-27 15:55:12 +02:00
|
|
|
/* nixStore is the directory where we generally store atomic and
|
|
|
|
derived files. */
|
|
|
|
extern string nixStore;
|
2003-06-16 15:33:38 +02:00
|
|
|
|
2003-07-10 15:41:28 +02:00
|
|
|
extern string nixDataDir; /* !!! fix */
|
|
|
|
|
2003-06-27 15:55:12 +02:00
|
|
|
/* nixLogDir is the directory where we log various operations. */
|
2003-06-16 15:33:38 +02:00
|
|
|
extern string nixLogDir;
|
|
|
|
|
|
|
|
/* nixDB is the file name of the Berkeley DB database where we
|
|
|
|
maintain the dbXXX mappings. */
|
|
|
|
extern string nixDB;
|
|
|
|
|
|
|
|
|
|
|
|
/* Initialize the databases. */
|
|
|
|
void initDB();
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* !__GLOBALS_H */
|