about summary refs log blame commit diff
path: root/src/libstore/gc.hh
blob: 838188adeb823e421b866e6254b8ce1e2fc52afb (plain) (tree)
1
2
3
4
5
6
7
8
9


              
                  
 
 

                                                                   
 






                                                                      
 




                                                              
                    
#ifndef __GC_H
#define __GC_H

#include "util.hh"


/* Garbage collector operation. */
typedef enum { gcReturnLive, gcReturnDead, gcDeleteDead } GCAction;

/* If `action' is set to `soReturnLive', return the set of paths
   reachable from (i.e. in the closure of) the specified roots.  If
   `action' is `soReturnDead', return the set of paths not reachable
   from the roots.  If `action' is `soDeleteDead', actually delete the
   latter set. */
void collectGarbage(const PathSet & roots, GCAction action,
    PathSet & result);

/* Register a temporary GC root.  This root will automatically
   disappear when this process exits. */
void addTempRoot(const Path & path);


#endif /* !__GC_H */