Debian Codegraph @

vhditools/mount_fuse.h

raw symbols SCIP
1 /*
2 * Mount tool fuse functions
3 *
4 * Copyright (C) 2012-2025, Joachim Metz <[email protected]>
5 *
6 * Refer to AUTHORS for acknowledgements.
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #if !defined( _MOUNT_FUSE_H )
23 #define _MOUNT_FUSE_H
24
25 #include <common.h>
26 #include <types.h>
27
28 #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBFUSE3 ) || defined( HAVE_LIBOSXFUSE )
29
30 #if !defined( FUSE_USE_VERSION ) && !defined( CYGFUSE )
31
32 /* Ensure FUSE_USE_VERSION is defined before including fuse.h
33 */
34 #if defined( HAVE_LIBFUSE3 )
35 #define FUSE_USE_VERSION 30
36 #else
37 #define FUSE_USE_VERSION 26
38 #endif
39
40 #endif /* !defined( FUSE_USE_VERSION ) && !defined( CYGFUSE ) */
41
42 #if defined( HAVE_LIBFUSE )
43 #include <fuse/fuse.h>
44 #elif defined( HAVE_LIBFUSE3 )
45 #include <fuse3/fuse.h>
46 #elif defined( HAVE_LIBOSXFUSE )
47 #include <osxfuse/fuse.h>
48 #endif
49
50 #endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBFUSE3 ) || defined( HAVE_LIBOSXFUSE ) */
51
52 #include "mount_file_entry.h"
53 #include "mount_handle.h"
54 #include "vhditools_libcerror.h"
55 #include "vhditools_libvhdi.h"
56
57 #if defined( __cplusplus )
58 extern "C" {
59 #endif
60
61 #if defined( HAVE_LIBFUSE ) || defined( HAVE_LIBFUSE3 ) || defined( HAVE_LIBOSXFUSE )
62
63 int mount_fuse_set_stat_info(
64 struct stat *stat_info,
65 size64_t size,
66 uint16_t file_mode,
67 int64_t access_time,
68 int64_t inode_change_time,
69 int64_t modification_time,
70 libcerror_error_t **error );
71
72 int mount_fuse_filldir(
73 void *buffer,
74 fuse_fill_dir_t filler,
75 const char *name,
76 struct stat *stat_info,
77 mount_file_entry_t *file_entry,
78 libcerror_error_t **error );
79
80 int mount_fuse_open(
81 const char *path,
82 struct fuse_file_info *file_info );
83
84 int mount_fuse_read(
85 const char *path,
86 char *buffer,
87 size_t size,
88 off_t offset,
89 struct fuse_file_info *file_info );
90
91 int mount_fuse_release(
92 const char *path,
93 struct fuse_file_info *file_info );
94
95 int mount_fuse_opendir(
96 const char *path,
97 struct fuse_file_info *file_info );
98
99 #if defined( HAVE_LIBFUSE3 )
100 int mount_fuse_readdir(
101 const char *path,
102 void *buffer,
103 fuse_fill_dir_t filler,
104 off_t offset,
105 struct fuse_file_info *file_info,
106 enum fuse_readdir_flags flags );
107 #else
108 int mount_fuse_readdir(
109 const char *path,
110 void *buffer,
111 fuse_fill_dir_t filler,
112 off_t offset,
113 struct fuse_file_info *file_info );
114 #endif
115
116 int mount_fuse_releasedir(
117 const char *path,
118 struct fuse_file_info *file_info );
119
120 #if defined( HAVE_LIBFUSE3 )
121 int mount_fuse_getattr(
122 const char *path,
123 struct stat *stat_info,
124 struct fuse_file_info *file_info );
125 #else
126 int mount_fuse_getattr(
127 const char *path,
128 struct stat *stat_info );
129 #endif
130
131 void mount_fuse_destroy(
132 void *private_data );
133
134 #endif /* defined( HAVE_LIBFUSE ) || defined( HAVE_LIBFUSE3 ) || defined( HAVE_LIBOSXFUSE ) */
135
136 #if defined( __cplusplus )
137 }
138 #endif
139
140 #endif /* !defined( _MOUNT_FUSE_H ) */
141