2003-07-20 21:29:38 +02:00
|
|
|
#ifndef __NORMALISE_H
|
|
|
|
#define __NORMALISE_H
|
|
|
|
|
2003-10-07 14:27:49 +02:00
|
|
|
#include "expr.hh"
|
2003-07-20 21:29:38 +02:00
|
|
|
|
|
|
|
|
2003-10-07 14:27:49 +02:00
|
|
|
/* Normalise a Nix expression, that is, return an equivalent
|
|
|
|
closure. (For the meaning of `pending', see expandId()). */
|
|
|
|
FSId normaliseNixExpr(FSId id, FSIdSet pending = FSIdSet());
|
2003-07-20 21:29:38 +02:00
|
|
|
|
2003-10-07 14:27:49 +02:00
|
|
|
/* Realise a Closure in the file system. */
|
|
|
|
void realiseClosure(const FSId & id, FSIdSet pending = FSIdSet());
|
2003-07-20 21:29:38 +02:00
|
|
|
|
2003-10-07 14:27:49 +02:00
|
|
|
/* Get the list of root (output) paths of the given Nix expression. */
|
|
|
|
Strings nixExprPaths(const FSId & id);
|
2003-07-20 21:29:38 +02:00
|
|
|
|
2003-07-29 16:28:17 +02:00
|
|
|
/* Get the list of paths that are required to realise the given
|
|
|
|
expression. For a derive expression, this is the union of
|
2003-10-07 14:27:49 +02:00
|
|
|
requisites of the inputs; for a closure expression, it is the path of
|
|
|
|
each element in the closure. If `includeExprs' is true, include the
|
2003-07-29 16:28:17 +02:00
|
|
|
paths of the Nix expressions themselves. If `includeSuccessors' is
|
|
|
|
true, include the requisites of successors. */
|
2003-10-07 14:27:49 +02:00
|
|
|
Strings nixExprRequisites(const FSId & id,
|
2003-07-29 16:28:17 +02:00
|
|
|
bool includeExprs, bool includeSuccessors);
|
2003-07-21 16:46:01 +02:00
|
|
|
|
2003-10-07 14:27:49 +02:00
|
|
|
/* Return the list of the ids of all known Nix expressions whose
|
2003-07-21 16:46:01 +02:00
|
|
|
output ids are completely contained in `ids'. */
|
|
|
|
FSIds findGenerators(const FSIds & ids);
|
2003-07-20 21:29:38 +02:00
|
|
|
|
|
|
|
/* Register a successor. */
|
2003-08-01 17:41:47 +02:00
|
|
|
void registerSuccessor(const Transaction & txn,
|
|
|
|
const FSId & id1, const FSId & id2);
|
2003-07-20 21:29:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
#endif /* !__NORMALISE_H */
|