X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=snap.c;h=ec0449d941c0296b5bb2b7f282a828b3c76d1196;hp=a9383c12cceeb2a29e2113337621ac825af90c49;hb=b76728084d7b36d55e08764c9de42ad59fd6f6fd;hpb=9e6c2f5e801c5b192d8e25987ef1a326dce20d27 diff --git a/snap.c b/snap.c index a9383c1..ec0449d 100644 --- a/snap.c +++ b/snap.c @@ -14,11 +14,11 @@ #include #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; +}