aboutsummaryrefslogtreecommitdiff
path: root/src/globals.hh
blob: fbb020df7c9181b836e7ab139c1cdc0d67510d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef __GLOBALS_H
#define __GLOBALS_H

#include <string>

using namespace std;


/* Database names. */

/* dbPath2Id :: Path -> FSId

   Each pair (p, id) records that path $p$ contains an expansion of
   $id$. */
extern string dbPath2Id;


/* 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$.

   Note that a term $y$ is successor of $x$ iff there exists a
   sequence of rewrite steps that rewrites $x$ into $y$.
*/
extern string dbSuccessors;


/* 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$.

   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;


/* Path names. */

/* nixStore is the directory where we generally store atomic and
   derived files. */
extern string nixStore;

extern string nixDataDir; /* !!! fix */

/* nixLogDir is the directory where we log various operations. */ 
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 */