1 : #ifndef __PROFILES_H
2 : #define __PROFILES_H
3 :
4 : #include "types.hh"
5 :
6 : #include <time.h>
7 :
8 :
9 : namespace nix {
10 :
11 :
12 : struct Generation
13 675 : {
14 : int number;
15 : Path path;
16 : time_t creationTime;
17 222 : Generation()
18 222 : {
19 222 : number = -1;
20 222 : }
21 6 : operator bool() const
22 : {
23 6 : return number != -1;
24 : }
25 : };
26 :
27 : typedef list<Generation> Generations;
28 :
29 :
30 : /* Returns the list of currently present generations for the specified
31 : profile, sorted by generation number. */
32 : Generations findGenerations(Path profile, int & curGen);
33 :
34 : Path createGeneration(Path profile, Path outPath);
35 :
36 : void deleteGeneration(const Path & profile, unsigned int gen);
37 :
38 : void switchLink(Path link, Path target);
39 :
40 :
41 : }
42 :
43 :
44 : #endif /* !__PROFILES_H */
|