1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2024-09-20 23:28:26 -04:00
nix/src/libstore/storeexpr.hh

57 lines
969 B
C++
Raw Normal View History

#ifndef __STOREEXPR_H
#define __STOREEXPR_H
#include "aterm.hh"
#include "store.hh"
/* Abstract syntax of store expressions. */
2003-06-27 05:55:31 -04:00
struct ClosureElem
{
PathSet refs;
};
typedef map<Path, ClosureElem> ClosureElems;
struct Closure
{
PathSet roots;
ClosureElems elems;
};
typedef map<string, string> StringPairs;
2003-07-20 15:29:38 -04:00
struct Derivation
2003-07-20 15:29:38 -04:00
{
PathSet outputs;
PathSet inputs; /* Store expressions, not actual inputs */
2003-07-20 15:29:38 -04:00
string platform;
Path builder;
Strings args;
2003-07-20 15:29:38 -04:00
StringPairs env;
};
struct StoreExpr
2003-07-20 15:29:38 -04:00
{
enum { neClosure, neDerivation } type;
Closure closure;
Derivation derivation;
2003-07-20 15:29:38 -04:00
};
/* Hash an aterm. */
Hash hashTerm(ATerm t);
/* Write an aterm to the Nix store directory, and return its path. */
Path writeTerm(ATerm t, const string & suffix);
/* Parse a store expression. */
StoreExpr parseStoreExpr(ATerm t);
2003-07-16 07:05:59 -04:00
/* Parse a store expression. */
ATerm unparseStoreExpr(const StoreExpr & ne);
2003-07-15 18:28:27 -04:00
#endif /* !__STOREEXPR_H */