1.\"
2.\" Copyright (c) 2011 The DragonFly Project.  All rights reserved.
3.\"
4.\" This code is derived from software contributed to The DragonFly Project
5.\" by Antonio Huete Jimenez <tuxillo@quantumachine.net>
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\"
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in
15.\"    the documentation and/or other materials provided with the
16.\"    distribution.
17.\" 3. Neither the name of The DragonFly Project nor the names of its
18.\"    contributors may be used to endorse or promote products derived
19.\"    from this software without specific, prior written permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
25.\" COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26.\" INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32.\" SUCH DAMAGE.
33.\"
34.Dd February 19, 2015
35.Dt LIBHAMMER 3
36.Os
37.Sh NAME
38.Nm libhammer_get_fsinfo ,
39.Nm libhammer_get_next_pfs ,
40.Nm libhammer_get_prev_pfs ,
41.Nm libhammer_get_first_pfs ,
42.Nm libhammer_get_last_pfs ,
43.Nm libhammer_free_fsinfo
44.Nd libhammer information functions
45.Sh LIBRARY
46.Lb libhammer
47.Sh SYNOPSIS
48.In libhammer.h
49.Ft libhammer_fsinfo_t
50.Fn libhammer_get_fsinfo "const char *path"
51.Ft libhammer_pfsinfo_t
52.Fn libhammer_get_first_pfs "libhammer_fsinfo_t fsinfo"
53.Ft libhammer_pfsinfo_t
54.Fn libhammer_get_last_pfs "libhammer_fsinfo_t fsinfo"
55.Ft libhammer_pfsinfo_t
56.Fn libhammer_get_next_pfs "libhammer_pfsinfo_t pfsinfo"
57.Ft libhammer_pfsinfo_t
58.Fn libhammer_get_prev_pfs "libhammer_pfsinfo_t pfsinfo"
59.Ft void
60.Fn libhammer_free_fsinfo "libhammer_fsinfo_t fsinfo"
61.Sh DESCRIPTION
62The
63.Fn libhammer_get_fsinfo
64iterates all the PFSs from a given path belonging to a
65.Nm HAMMER
66file system and returns
67.Vt libhammer_fsinfo_t
68.Fa fsinfo
69which holds a
70.Nm TAILQ
71of
72.Vt libhammer_pfsinfo
73structs, one per PFS found.
74.Pp
75The list of found PFSs can be iterated with
76.Fn libhammer_get_first_pfs ,
77.Fn libhammer_get_last_pfs ,
78.Fn libhammer_get_next_pfs
79and
80.Fn libhammer_get_prev_pfs .
81.Pp
82Note that to use the next and previous functions described above you need
83to store the returning
84.Vt libhammer_pfsinfo_t
85value from the first and last functions.
86.Pp
87.Fn libhammer_free_fsinfo
88frees up all the resources allocated previously by
89.Fn libhammer_get_fsinfo .
90.Sh RETURN VALUES
91.Fn libhammer_get_fsinfo
92returns a
93.Vt libhammer_fsinfo_t
94in any case where path is in a
95.Nm HAMMER
96file system or
97.Dv NULL
98if there was any other problem.
99You can check
100.Nm errno
101in the error cases.
102.Pp
103.Fn libhammer_get_first_pfs
104and
105.Fn libhammer_get_last_pfs
106must return a
107.Vt libhammer_pfs_t
108if the
109.Fa fsinfo
110passed in is valid.
111.Fn libhammer_get_next_pfs
112and
113.Fn libhammer_get_prev_pfs
114return a
115.Vt libhammer_pfsinfo_t
116or
117.Dv NULL
118in case there are no more elements.
119.Sh SEE ALSO
120.Xr libhammer 3 ,
121.Xr libhammer_snapshot 3 ,
122.Xr libhammer_stats 3 ,
123.Xr HAMMER 5 ,
124.Xr hammer 8
125.Sh AUTHORS
126This man page was written by
127.An Antonio Huete Jimenez Aq Mt tuxillo@quantumachine.net .
128