forked from lix-project/lix
863dcff6c5
representation of closures as ATerms in the Nix store. Instead, the file system pointer graph is now stored in the Nix database. This has many advantages: - It greatly simplifies the implementation (we can drop the notion of `successors', and so on). - It makes registering roots for the garbage collector much easier. Instead of specifying the closure expression as a root, you can simply specify the store path that must be retained as a root. This could not be done previously, since there was no way to find the closure store expression containing a given store path. - Better traceability: it is now possible to query what paths are referenced by a path, and what paths refer to a path.
38 lines
697 B
C++
38 lines
697 B
C++
#ifndef __PROFILES_H
|
|
#define __PROFILES_H
|
|
|
|
#include <string>
|
|
|
|
#include "util.hh"
|
|
|
|
|
|
struct Generation
|
|
{
|
|
int number;
|
|
Path path;
|
|
time_t creationTime;
|
|
Generation()
|
|
{
|
|
number = -1;
|
|
}
|
|
operator bool() const
|
|
{
|
|
return number != -1;
|
|
}
|
|
};
|
|
|
|
typedef list<Generation> Generations;
|
|
|
|
|
|
/* Returns the list of currently present generations for the specified
|
|
profile, sorted by generation number. */
|
|
Generations findGenerations(Path profile, int & curGen);
|
|
|
|
Path createGeneration(Path profile, Path outPath, Path drvPath);
|
|
|
|
void deleteGeneration(const Path & profile, unsigned int gen);
|
|
|
|
void switchLink(Path link, Path target);
|
|
|
|
|
|
#endif /* !__PROFILES_H */
|