.\" .\" Copyright (c) 2015 The DragonFly Project. All rights reserved. .\" .\" This code is derived from software contributed to The DragonFly Project .\" by Antonio Huete Jimenez .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in .\" the documentation and/or other materials provided with the .\" distribution. .\" 3. Neither the name of The DragonFly Project nor the names of its .\" contributors may be used to endorse or promote products derived .\" from this software without specific, prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT .\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS .\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE .\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, .\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED .\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, .\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT .\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd February 19, 2015 .Dt LIBHAMMER 3 .Os .Sh NAME .Nm libhammer_pfs_get_snapshots , .Nm libhammer_get_next_snap , .Nm libhammer_get_prev_snap , .Nm libhammer_get_first_snap , .Nm libhammer_get_last_snap , .Nm libhammer_pfs_free_snapshots .Nd libhammer snapshot functions .Sh LIBRARY .Lb libhammer .Sh SYNOPSIS .In libhammer.h .Ft int .Fn libhammer_pfs_get_snapshots "libhammer_fsinfo_t fsinfo" "libhammer_pfsinfo_t pip" .Ft libhammer_snapinfo_t .Fn libhammer_get_first_snap "libhammer_pfsinfo_t pip" .Ft libhammer_snapinfo_t .Fn libhammer_get_last_snap "libhammer_pfsinfo_t pip" .Ft libhammer_snapinfo_t .Fn libhammer_get_next_snap "libhammer_snapinfo_t sip" .Ft libhammer_snapinfo_t .Fn libhammer_get_prev_snap "libhammer_snapinfo_t sip" .Ft void .Fn libhammer_pfs_free_snapshots "libhammer_pfsinfo_t pip" .Sh DESCRIPTION The .Fn libhammer_pfs_get_snapshots gathers all the snapshot information for the PFS specified in .Fa pip . .Pp The list of snapshots can be iterated with .Fn libhammer_get_first_snap , .Fn libhammer_get_last_snap , .Fn libhammer_get_next_snap and .Fn libhammer_get_prev_snap . .Pp Note that to use the next and previous functions described above you need to store the returning .Vt libhammer_snapinfo_t value from the first and last functions. .Pp The .Fn libhammer_pfs_free_snapshots function releases all the resources used to hold the information of the snapshots for a particular PFS. .Sh RETURN VALUES .Fn libhammer_pfs_get_snapshots returns 0 when successful and -1 in the case of failure. The .Vt errno value indicating the error is stored within the passed .Vt libhammer_pfsinfo_t in the .Vt libhammer_head struct. .Pp .Fn libhammer_get_first_snap and .Fn libhammer_get_last_snap must return a .Vt libhammer_snapinfo_t if the .Fa pip passed in is valid. .Fn libhammer_get_next_snap and .Fn libhammer_get_prev_snap return a .Vt libhammer_snapinfo_t or .Dv NULL in case there are no more elements. .Sh SEE ALSO .Xr libhammer 3 , .Xr libhammer_fsinfo 3 , .Xr libhammer_stats 3 , .Xr HAMMER 5 , .Xr hammer 8 .Sh AUTHORS This man page was written by .An Antonio Huete Jimenez Aq Mt tuxillo@quantumachine.net .