xref: /netbsd-src/lib/librefuse/refuse/legacy.h (revision a95017a87a910ba9aaf4537e381dba0e6fc34a1d)
1*a95017a8Spho /* $NetBSD: legacy.h,v 1.1 2022/01/22 07:57:30 pho Exp $ */
2*a95017a8Spho 
3*a95017a8Spho /*
4*a95017a8Spho  * Copyright (c) 2021 The NetBSD Foundation, Inc.
5*a95017a8Spho  * All rights reserved.
6*a95017a8Spho  *
7*a95017a8Spho  * Redistribution and use in source and binary forms, with or without
8*a95017a8Spho  * modification, are permitted provided that the following conditions
9*a95017a8Spho  * are met:
10*a95017a8Spho  * 1. Redistributions of source code must retain the above copyright
11*a95017a8Spho  *    notice, this list of conditions and the following disclaimer.
12*a95017a8Spho  * 2. Redistributions in binary form must reproduce the above copyright
13*a95017a8Spho  *    notice, this list of conditions and the following disclaimer in the
14*a95017a8Spho  *    documentation and/or other materials provided with the distribution.
15*a95017a8Spho  * 3. The name of the author may not be used to endorse or promote
16*a95017a8Spho  *    products derived from this software without specific prior written
17*a95017a8Spho  *    permission.
18*a95017a8Spho  *
19*a95017a8Spho  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
20*a95017a8Spho  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21*a95017a8Spho  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22*a95017a8Spho  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
23*a95017a8Spho  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24*a95017a8Spho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
25*a95017a8Spho  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26*a95017a8Spho  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
27*a95017a8Spho  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28*a95017a8Spho  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29*a95017a8Spho  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30*a95017a8Spho  */
31*a95017a8Spho #if !defined(_FUSE_LEGACY_H_)
32*a95017a8Spho #define _FUSE_LEGACY_H_
33*a95017a8Spho 
34*a95017a8Spho #include <sys/fstypes.h>
35*a95017a8Spho 
36*a95017a8Spho /* Legacy data types and functions that had once existed but have been
37*a95017a8Spho  * removed from the FUSE API. */
38*a95017a8Spho 
39*a95017a8Spho #if !defined(FUSE_H_)
40*a95017a8Spho #  error Do not include this header directly. Include <fuse.h> instead.
41*a95017a8Spho #endif
42*a95017a8Spho 
43*a95017a8Spho #ifdef __cplusplus
44*a95017a8Spho extern "C" {
45*a95017a8Spho #endif
46*a95017a8Spho 
47*a95017a8Spho /* statfs structure used by FUSE < 1.9. On 2.1 it's been replaced with
48*a95017a8Spho  * "struct statfs" and later replaced again with struct statvfs on
49*a95017a8Spho  * 2.5. */
50*a95017a8Spho struct fuse_statfs {
51*a95017a8Spho 	long block_size;
52*a95017a8Spho 	long blocks;
53*a95017a8Spho 	long blocks_free;
54*a95017a8Spho 	long files;
55*a95017a8Spho 	long files_free;
56*a95017a8Spho 	long namelen;
57*a95017a8Spho };
58*a95017a8Spho 
59*a95017a8Spho /* Linux-specific struct statfs; used by FUSE >= 2.1 && < 2.5. */
60*a95017a8Spho struct statfs {
61*a95017a8Spho 	long		f_type;
62*a95017a8Spho 	long		f_bsize;
63*a95017a8Spho 	fsblkcnt_t	f_blocks;
64*a95017a8Spho 	fsblkcnt_t	f_bfree;
65*a95017a8Spho 	fsblkcnt_t	f_bavail;
66*a95017a8Spho 	fsfilcnt_t	f_files;
67*a95017a8Spho 	fsfilcnt_t	f_ffree;
68*a95017a8Spho 	fsid_t		f_fsid;
69*a95017a8Spho 	long		f_namelen;
70*a95017a8Spho 	long		f_frsize;
71*a95017a8Spho 	long		f_flags;
72*a95017a8Spho };
73*a95017a8Spho 
74*a95017a8Spho /* Handle for a getdir() operation. Removed as of FUSE 3.0. */
75*a95017a8Spho typedef void *fuse_dirh_t;
76*a95017a8Spho 
77*a95017a8Spho /* Enable debugging output. Removed on FUSE 3.0. */
78*a95017a8Spho #define FUSE_DEBUG	(1 << 1)
79*a95017a8Spho 
80*a95017a8Spho /* Invalidate cached data of a file. Added on FUSE 1.9 and removed on
81*a95017a8Spho  * FUSE 3.0. Not to be confused with fuse_invalidate_path() appeared
82*a95017a8Spho  * on FUSE 3.2. */
83*a95017a8Spho int fuse_invalidate(struct fuse *f, const char *path);
84*a95017a8Spho 
85*a95017a8Spho /* Check whether a mount option should be passed to the kernel or the
86*a95017a8Spho  * library. Added on FUSE 1.9 and removed on FUSE 3.0. */
87*a95017a8Spho int fuse_is_lib_option(const char *opt);
88*a95017a8Spho 
89*a95017a8Spho #ifdef __cplusplus
90*a95017a8Spho }
91*a95017a8Spho #endif
92*a95017a8Spho 
93*a95017a8Spho #endif
94