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