Introduce --min-complete.
[dss.git] / snap.c
diff --git a/snap.c b/snap.c
index a9383c12cceeb2a29e2113337621ac825af90c49..ec0449d941c0296b5bb2b7f282a828b3c76d1196 100644 (file)
--- a/snap.c
+++ b/snap.c
 #include <sys/time.h>
 
 #include "gcc-compat.h"
-#include "error.h"
+#include "err.h"
 #include "snap.h"
-#include "string.h"
-#include "time.h"
-#include "fd.h"
+#include "str.h"
+#include "tv.h"
+#include "file.h"
 
 /**
  * Wrapper for isdigit.
@@ -232,3 +232,13 @@ __malloc char *name_of_newest_complete_snapshot(struct snapshot_list *sl)
        return name;
 }
 
+int num_complete_snapshots(struct snapshot_list *sl)
+{
+       struct snapshot *s;
+       int i, ret = 0;
+
+       FOR_EACH_SNAPSHOT(s, i, sl)
+               if (s->flags & SS_COMPLETE)
+                       ret++;
+       return ret;
+}