X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=snap.h;fp=snap.h;h=eca484a462b6d3ad77c23d75d5b0518058dd5057;hb=0cea2bfa14a7641e6e8e88c177cdb3d10099596d;hp=508bbf9312d9f2a343ac2af265799677a372c6a0;hpb=9967e30b97ef5fb90f31ceb06ac34b974e1788a8;p=dss.git diff --git a/snap.h b/snap.h index 508bbf9..eca484a 100644 --- a/snap.h +++ b/snap.h @@ -98,3 +98,13 @@ _static_inline_ struct snapshot *get_oldest_snapshot(struct snapshot_list *sl) return NULL; return sl->snapshots[0]; } + +/** + * Get the newest snapshot in a snapshot list. + */ +_static_inline_ struct snapshot *get_newest_snapshot(struct snapshot_list *sl) +{ + if (!sl->num_snapshots) + return NULL; + return sl->snapshots[sl->num_snapshots - 1]; +}