|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* This file is part of the sj-i/php-fuse package. |
|
5
|
|
|
* |
|
6
|
|
|
* (c) sji <[email protected]> |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
declare(strict_types=1); |
|
13
|
|
|
|
|
14
|
|
|
namespace Fuse; |
|
15
|
|
|
|
|
16
|
|
|
use FFI; |
|
17
|
|
|
use FFI\CData; |
|
18
|
|
|
use Fuse\Libc\Fcntl\Flock; |
|
19
|
|
|
use Fuse\Libc\Fuse\FuseBufVec; |
|
20
|
|
|
use Fuse\Libc\Fuse\FuseConnInfo; |
|
21
|
|
|
use Fuse\Libc\Fuse\FuseDirFill; |
|
22
|
|
|
use Fuse\Libc\Fuse\FuseDirHandle; |
|
23
|
|
|
use Fuse\Libc\Fuse\FuseFileInfo; |
|
24
|
|
|
use Fuse\Libc\Fuse\FuseFillDir; |
|
25
|
|
|
use Fuse\Libc\Fuse\FuseIoctlArgPointer; |
|
26
|
|
|
use Fuse\Libc\Fuse\FuseIoctlDataPointer; |
|
27
|
|
|
use Fuse\Libc\Fuse\FusePollHandle; |
|
28
|
|
|
use Fuse\Libc\Fuse\FusePrivateData; |
|
29
|
|
|
use Fuse\Libc\Fuse\FuseReadDirBuffer; |
|
30
|
|
|
use Fuse\Libc\String\CBytesBuffer; |
|
31
|
|
|
use Fuse\Libc\String\CStringBuffer; |
|
32
|
|
|
use Fuse\Libc\Sys\Stat\Stat; |
|
33
|
|
|
use Fuse\Libc\Sys\StatVfs\StatVfs; |
|
34
|
|
|
use Fuse\Libc\Time\TimeSpec; |
|
35
|
|
|
use Fuse\Libc\Utime\UtimBuf; |
|
36
|
|
|
use ReflectionClass; |
|
37
|
|
|
use TypedCData\TypedCDataArray; |
|
|
|
|
|
|
38
|
|
|
use TypedCData\TypedCDataWrapper; |
|
|
|
|
|
|
39
|
|
|
|
|
40
|
|
|
// phpcs:disable Generic.Files.LineLength |
|
41
|
|
|
/** |
|
42
|
|
|
* @psalm-type TimeSpecArray = TypedCDataArray<TimeSpec> |
|
43
|
|
|
* @psalm-type FuseBufVecArray = TypedCDataArray<FuseBufVec> |
|
44
|
|
|
* @psalm-type getattr_op = callable(string $path, CData $stat): int |
|
45
|
|
|
* @psalm-type getattr_typed_op = callable(string $path, Stat $stat): int |
|
46
|
|
|
* @psalm-type readlink_op = callable(string $path, CData $buffer, int $size): int |
|
47
|
|
|
* @psalm-type readlink_typed_op = callable(string $path, CStringBuffer $buffer, int $size): int |
|
48
|
|
|
* @psalm-type getdir_op = callable(string $path, CData $dirhandle, CData $dirfill): int |
|
49
|
|
|
* @psalm-type getdir_typed_op = callable(string $path, FuseDirHandle $dirhandle, FuseDirFill $dirfill): int |
|
50
|
|
|
* @psalm-type utime_op = callable(string $path, CData $utime_buf): int |
|
51
|
|
|
* @psalm-type utime_typed_op = callable(string $path, UtimBuf $utime_buf): int |
|
52
|
|
|
* @psalm-type open_op = callable(string $path, CData $fuse_file_info): int |
|
53
|
|
|
* @psalm-type open_typed_op = callable(string $path, FuseFileInfo $fuse_file_info): int |
|
54
|
|
|
* @psalm-type read_op = callable(string $path, CData $buffer, int $size, int $offset, CData $fuse_file_info): int |
|
55
|
|
|
* @psalm-type read_typed_op = callable(string $path, CBytesBuffer $buffer, int $size, int $offset, FuseFileInfo $fuse_file_info): int |
|
56
|
|
|
* @psalm-type write_op = callable(string $path, string $buffer, int $size, int $offset, CData $fuse_file_info): int |
|
57
|
|
|
* @psalm-type write_typed_op = callable(string $path, string $buffer, int $size, int $offset, FuseFileInfo $fuse_file_info): int |
|
58
|
|
|
* @psalm-type statfs_op = callable(string $path, CData $statvfs): int |
|
59
|
|
|
* @psalm-type statfs_typed_op = callable(string $path, StatVfs $statvfs): int |
|
60
|
|
|
* @psalm-type flush_op = callable(string $path, CData $fuse_file_info): int |
|
61
|
|
|
* @psalm-type flush_typed_op = callable(string $path, FuseFileInfo $fuse_file_info): int |
|
62
|
|
|
* @psalm-type release_op = callable(string $path, CData $fuse_file_info): int |
|
63
|
|
|
* @psalm-type release_typed_op = callable(string $path, FuseFileInfo $fuse_file_info): int |
|
64
|
|
|
* @psalm-type fsync_op = callable(string $path, int $flags, CData $fuse_file_info): int |
|
65
|
|
|
* @psalm-type fsync_typed_op = callable(string $path, int $flags, FuseFileInfo $fuse_file_info): int |
|
66
|
|
|
* @psalm-type opendir_op = callable(string $path, CData $fuse_file_info): int |
|
67
|
|
|
* @psalm-type opendir_typed_op = callable(string $path, FuseFileInfo $fuse_file_info): int |
|
68
|
|
|
* @psalm-type readdir_op = callable(string $path, CData $buf, CData $filler, int $offset, CData $fuse_file_info): int |
|
69
|
|
|
* @psalm-type readdir_typed_op = callable(string $path, FuseReadDirBuffer $buf, FuseFillDir $filler, int $offset, FuseFileInfo $fuse_file_info): int |
|
70
|
|
|
* @psalm-type releasedir_op = callable(string $path, CData $fuse_file_info): int |
|
71
|
|
|
* @psalm-type releasedir_typed_op = callable(string $path, FuseFileInfo $fuse_file_info): int |
|
72
|
|
|
* @psalm-type fsyncdir_op = callable(string $path, CData $fuse_file_info): int |
|
73
|
|
|
* @psalm-type fsyncdir_typed_op = callable(string $path, FuseFileInfo $fuse_file_info): int |
|
74
|
|
|
* @psalm-type init_op = callable(CData $conn): ?CData |
|
75
|
|
|
* @psalm-type init_typed_op = callable(FuseConnInfo $conn): ?FusePrivateData |
|
76
|
|
|
* @psalm-type destroy_op = callable(CData $private_data): void |
|
77
|
|
|
* @psalm-type destroy_typed_op = callable(?FusePrivateData$private_data): void |
|
78
|
|
|
* @psalm-type create_op = callable(string $path, int $mode, CData $fuse_file_info): int |
|
79
|
|
|
* @psalm-type create_typed_op = callable(string $path, int $mode, FuseFileInfo $fuse_file_info): int |
|
80
|
|
|
* @psalm-type ftruncate_op = callable(string $path, int $offset, CData $fuse_file_info): int |
|
81
|
|
|
* @psalm-type ftruncate_typed_op = callable(string $path, int $offset, FuseFileInfo $fuse_file_info): int |
|
82
|
|
|
* @psalm-type fgetattr_op = callable(string $path, CData $stat, CData $fuse_file_info): int |
|
83
|
|
|
* @psalm-type fgetattr_typed_op = callable(string $path, Stat $stat, FuseFileInfo $fuse_file_info): int |
|
84
|
|
|
* @psalm-type lock_op = callable(string $path, CData $fuse_file_info, int $cmd, CData $flock): int |
|
85
|
|
|
* @psalm-type lock_typed_op = callable(string $path, FuseFileInfo $fuse_file_info, int $cmd, Flock $flock): int |
|
86
|
|
|
* @psalm-type utimens_op = callable(string $path, CData $tv): int |
|
87
|
|
|
* @psalm-type utimens_typed_op = callable(string $path, TimeSpecArray$tv): int |
|
88
|
|
|
* @psalm-type bmap_op = callable(string $path, int $blocksize, CData $idx): int |
|
89
|
|
|
* @psalm-type bmap_typed_op = callable(string $path, int $blocksize, int $idx): int |
|
90
|
|
|
* @psalm-type ioctl_op = callable(string $path, int $cmd, CData $arg, CData $fuse_file_info, int $flags, CData $data): int |
|
91
|
|
|
* @psalm-type ioctl_typed_op = callable(string $path, int $cmd, FuseIoctlArgPointer $arg, FuseFileInfo $fuse_file_info, int $flags, FuseIoctlDataPointer $data): int |
|
92
|
|
|
* @psalm-type poll_op = callable(string $path, CData $fuse_file_info, CData $fuse_pollhandle, int $reventsp): int |
|
93
|
|
|
* @psalm-type poll_typed_op = callable(string $path, FuseFileInfo $fuse_file_info, FusePollHandle $fuse_pollhandle, int $reventsp): int |
|
94
|
|
|
* @psalm-type write_buf_op = callable(string $path, CData $buf, int $offset, CData $fuse_file_info): int |
|
95
|
|
|
* @psalm-type write_buf_typed_op = callable(string $path, FuseBufVec $buf, int $offset, FuseFileInfo $fuse_file_info): int |
|
96
|
|
|
* @psalm-type read_buf_op = callable(string $path, CData $bufp, int $size, int $offset, CData $fuse_file_info): int |
|
97
|
|
|
* @psalm-type read_buf_typed_op = callable(string $path, FuseBufVecArray $bufp, int $size, int $offset, FuseFileInfo $fuse_file_info): int |
|
98
|
|
|
* @psalm-type flock_op = callable(string $path, CData $fuse_file_info, int $op): int |
|
99
|
|
|
* @psalm-type flock_typed_op = callable(string $path, FuseFileInfo $fuse_file_info, int $op): int |
|
100
|
|
|
* @psalm-type fallocate_op = callable(string $path, int $mode, int $offset, CData $fuse_file_info): int |
|
101
|
|
|
* @psalm-type fallocate_typed_op = callable(string $path, int $mode, int $offset, FuseFileInfo $fuse_file_info): int |
|
102
|
|
|
*/ |
|
103
|
|
|
// phpcs:enable Generic.Files.LineLength |
|
104
|
|
|
final class FuseOperations implements Mountable |
|
105
|
|
|
{ |
|
106
|
|
|
/** |
|
107
|
|
|
* int (*getattr) (const char *, struct stat *); |
|
108
|
|
|
* |
|
109
|
|
|
* @var null|getattr_op|getattr_typed_op |
|
|
|
|
|
|
110
|
|
|
*/ |
|
111
|
|
|
public $getattr = null; |
|
112
|
|
|
|
|
113
|
|
|
/** |
|
114
|
|
|
* int (*readlink) (const char *, char *, size_t); |
|
115
|
|
|
* |
|
116
|
|
|
* @var null|readlink_op|readlink_typed_op |
|
|
|
|
|
|
117
|
|
|
*/ |
|
118
|
|
|
public $readlink = null; |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
121
|
|
|
* int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t); |
|
122
|
|
|
* |
|
123
|
|
|
* @deprecated |
|
124
|
|
|
* @var null|getdir_op|getdir_typed_op |
|
|
|
|
|
|
125
|
|
|
*/ |
|
126
|
|
|
public $getdir = null; |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* int (*mknod) (const char *, mode_t, dev_t); |
|
130
|
|
|
* |
|
131
|
|
|
* @var null|callable(string $path, int $mode, int $dev): int |
|
132
|
|
|
*/ |
|
133
|
|
|
public $mknod = null; |
|
134
|
|
|
|
|
135
|
|
|
/** |
|
136
|
|
|
* int (*mkdir) (const char *, mode_t); |
|
137
|
|
|
* |
|
138
|
|
|
* @var null|callable(string $path, int $mode): int |
|
139
|
|
|
*/ |
|
140
|
|
|
public $mkdir = null; |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* int (*unlink) (const char *); |
|
144
|
|
|
* |
|
145
|
|
|
* @var null|callable(string $path): int |
|
146
|
|
|
*/ |
|
147
|
|
|
public $unlink = null; |
|
148
|
|
|
|
|
149
|
|
|
/** |
|
150
|
|
|
* int (*rmdir) (const char *); |
|
151
|
|
|
* |
|
152
|
|
|
* @var null|callable(string $path): int |
|
153
|
|
|
*/ |
|
154
|
|
|
public $rmdir = null; |
|
155
|
|
|
|
|
156
|
|
|
/** |
|
157
|
|
|
* int (*symlink) (const char *, const char *); |
|
158
|
|
|
* |
|
159
|
|
|
* @var null|callable(string $path, string $link): int |
|
160
|
|
|
*/ |
|
161
|
|
|
public $symlink = null; |
|
162
|
|
|
|
|
163
|
|
|
/** |
|
164
|
|
|
* int (*rename) (const char *, const char *); |
|
165
|
|
|
* |
|
166
|
|
|
* @var null|callable(string $from, string $to): int |
|
167
|
|
|
*/ |
|
168
|
|
|
public $rename = null; |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* int (*link) (const char *, const char *); |
|
172
|
|
|
* |
|
173
|
|
|
* @var null|callable(string $path, string $link): int |
|
174
|
|
|
*/ |
|
175
|
|
|
public $link = null; |
|
176
|
|
|
|
|
177
|
|
|
/** |
|
178
|
|
|
* int (*chmod) (const char *, mode_t); |
|
179
|
|
|
* |
|
180
|
|
|
* @var null|callable(string $path, int $mode): int |
|
181
|
|
|
*/ |
|
182
|
|
|
public $chmod = null; |
|
183
|
|
|
|
|
184
|
|
|
/** |
|
185
|
|
|
* int (*chown) (const char *, uid_t, gid_t); |
|
186
|
|
|
* |
|
187
|
|
|
* @var null|callable(string $path, int $uid, int $gid): int |
|
188
|
|
|
*/ |
|
189
|
|
|
public $chown = null; |
|
190
|
|
|
|
|
191
|
|
|
/** |
|
192
|
|
|
* int (*truncate) (const char *, off_t); |
|
193
|
|
|
* |
|
194
|
|
|
* @var null|callable(string $path, int $offset): int |
|
195
|
|
|
*/ |
|
196
|
|
|
public $truncate = null; |
|
197
|
|
|
|
|
198
|
|
|
/** |
|
199
|
|
|
* int (*utime) (const char *, struct utimbuf *); |
|
200
|
|
|
* |
|
201
|
|
|
* @var null|utime_op|utime_typed_op |
|
|
|
|
|
|
202
|
|
|
*/ |
|
203
|
|
|
public $utime = null; |
|
204
|
|
|
|
|
205
|
|
|
/** |
|
206
|
|
|
* int (*open) (const char *, struct fuse_file_info *); |
|
207
|
|
|
* |
|
208
|
|
|
* @var null|open_op|open_typed_op |
|
|
|
|
|
|
209
|
|
|
*/ |
|
210
|
|
|
public $open = null; |
|
211
|
|
|
|
|
212
|
|
|
/** |
|
213
|
|
|
* int (*read) (const char *, char *, size_t, off_t, struct fuse_file_info *); |
|
214
|
|
|
* |
|
215
|
|
|
* @var null|read_op|read_typed_op |
|
|
|
|
|
|
216
|
|
|
*/ |
|
217
|
|
|
public $read = null; |
|
218
|
|
|
|
|
219
|
|
|
/** |
|
220
|
|
|
* int (*write) (const char *, const char *, size_t, off_t, struct fuse_file_info *); |
|
221
|
|
|
* |
|
222
|
|
|
* @var null|write_op|write_typed_op |
|
|
|
|
|
|
223
|
|
|
*/ |
|
224
|
|
|
public $write = null; |
|
225
|
|
|
|
|
226
|
|
|
/** |
|
227
|
|
|
* int (*statfs) (const char *, struct statvfs *); |
|
228
|
|
|
* |
|
229
|
|
|
* @var null|statfs_op|statfs_typed_op |
|
|
|
|
|
|
230
|
|
|
*/ |
|
231
|
|
|
public $statfs = null; |
|
232
|
|
|
|
|
233
|
|
|
/** |
|
234
|
|
|
* int (*flush) (const char *, struct fuse_file_info *); |
|
235
|
|
|
* |
|
236
|
|
|
* @var null|flush_op|flush_typed_op |
|
|
|
|
|
|
237
|
|
|
*/ |
|
238
|
|
|
public $flush = null; |
|
239
|
|
|
|
|
240
|
|
|
/** |
|
241
|
|
|
* int (*release) (const char *, struct fuse_file_info *); |
|
242
|
|
|
* |
|
243
|
|
|
* @var null|release_op|release_typed_op |
|
|
|
|
|
|
244
|
|
|
*/ |
|
245
|
|
|
public $release = null; |
|
246
|
|
|
|
|
247
|
|
|
/** |
|
248
|
|
|
* int (*fsync) (const char *, int, struct fuse_file_info *); |
|
249
|
|
|
* |
|
250
|
|
|
* @var null|fsync_op|fsync_typed_op |
|
|
|
|
|
|
251
|
|
|
*/ |
|
252
|
|
|
public $fsync = null; |
|
253
|
|
|
|
|
254
|
|
|
/** |
|
255
|
|
|
* int (*setxattr) (const char *, const char *, const char *, size_t, int); |
|
256
|
|
|
* |
|
257
|
|
|
* @var null|callable(string $path, string $name, string $value, int $size): int |
|
258
|
|
|
*/ |
|
259
|
|
|
public $setxattr = null; |
|
260
|
|
|
|
|
261
|
|
|
/** |
|
262
|
|
|
* int (*getxattr) (const char *, const char *, char *, size_t); |
|
263
|
|
|
* |
|
264
|
|
|
* @var null|callable(string $path, string $name, string $value, int $size): int |
|
265
|
|
|
*/ |
|
266
|
|
|
public $getxattr = null; |
|
267
|
|
|
|
|
268
|
|
|
/** |
|
269
|
|
|
* int (*listxattr) (const char *, char *, size_t); |
|
270
|
|
|
* |
|
271
|
|
|
* @var null|callable(string $path, string $value, int $size): int |
|
272
|
|
|
*/ |
|
273
|
|
|
public $listxattr = null; |
|
274
|
|
|
|
|
275
|
|
|
/** |
|
276
|
|
|
* int (*removexattr) (const char *, const char *); |
|
277
|
|
|
* |
|
278
|
|
|
* @var null|callable(string $size, string $name): int |
|
279
|
|
|
*/ |
|
280
|
|
|
public $removexattr = null; |
|
281
|
|
|
|
|
282
|
|
|
/** |
|
283
|
|
|
* int (*opendir) (const char *, struct fuse_file_info *); |
|
284
|
|
|
* |
|
285
|
|
|
* @var null|opendir_op|opendir_typed_op |
|
|
|
|
|
|
286
|
|
|
*/ |
|
287
|
|
|
public $opendir = null; |
|
288
|
|
|
|
|
289
|
|
|
/** |
|
290
|
|
|
* int (*readdir) (const char *, void *, fuse_fill_dir_t, off_t, struct fuse_file_info *); |
|
291
|
|
|
* |
|
292
|
|
|
* @var null|readdir_op|readdir_typed_op |
|
|
|
|
|
|
293
|
|
|
*/ |
|
294
|
|
|
public $readdir = null; |
|
295
|
|
|
|
|
296
|
|
|
/** |
|
297
|
|
|
* int (*releasedir) (const char *, struct fuse_file_info *); |
|
298
|
|
|
* |
|
299
|
|
|
* @var null|releasedir_op|releasedir_typed_op |
|
|
|
|
|
|
300
|
|
|
*/ |
|
301
|
|
|
public $releasedir = null; |
|
302
|
|
|
|
|
303
|
|
|
/** |
|
304
|
|
|
* int (*fsyncdir) (const char *, int, struct fuse_file_info *); |
|
305
|
|
|
* |
|
306
|
|
|
* @var null|fsyncdir_op|fsyncdir_typed_op |
|
|
|
|
|
|
307
|
|
|
*/ |
|
308
|
|
|
public $fsyncdir = null; |
|
309
|
|
|
|
|
310
|
|
|
/** |
|
311
|
|
|
* void *(*init) (struct fuse_conn_info *conn); |
|
312
|
|
|
* |
|
313
|
|
|
* @var null|init_op|init_typed_op |
|
|
|
|
|
|
314
|
|
|
*/ |
|
315
|
|
|
public $init = null; |
|
316
|
|
|
|
|
317
|
|
|
/** |
|
318
|
|
|
* void (*destroy) (void *); |
|
319
|
|
|
* |
|
320
|
|
|
* @var null|destroy_op|destroy_typed_op |
|
|
|
|
|
|
321
|
|
|
*/ |
|
322
|
|
|
public $destroy = null; |
|
323
|
|
|
|
|
324
|
|
|
/** |
|
325
|
|
|
* int (*access) (const char *, int); |
|
326
|
|
|
* |
|
327
|
|
|
* @var null|callable(string $path, int $mode): int |
|
328
|
|
|
*/ |
|
329
|
|
|
public $access = null; |
|
330
|
|
|
|
|
331
|
|
|
/** |
|
332
|
|
|
* int (*create) (const char *, mode_t, struct fuse_file_info *); |
|
333
|
|
|
* |
|
334
|
|
|
* @var null|create_op|create_typed_op |
|
|
|
|
|
|
335
|
|
|
*/ |
|
336
|
|
|
public $create = null; |
|
337
|
|
|
|
|
338
|
|
|
/** |
|
339
|
|
|
* int (*ftruncate) (const char *, off_t, struct fuse_file_info *); |
|
340
|
|
|
* |
|
341
|
|
|
* @var null|ftruncate_op|ftruncate_typed_op |
|
|
|
|
|
|
342
|
|
|
*/ |
|
343
|
|
|
public $ftruncate = null; |
|
344
|
|
|
|
|
345
|
|
|
/** |
|
346
|
|
|
* int (*fgetattr) (const char *, struct stat *, struct fuse_file_info *); |
|
347
|
|
|
* |
|
348
|
|
|
* @var null|fgetattr_op|fgetattr_typed_op |
|
|
|
|
|
|
349
|
|
|
*/ |
|
350
|
|
|
public $fgetattr = null; |
|
351
|
|
|
|
|
352
|
|
|
/** |
|
353
|
|
|
* int (*lock) (const char *, struct fuse_file_info *, int cmd, struct flock *); |
|
354
|
|
|
* |
|
355
|
|
|
* @var null|lock_op|lock_typed_op |
|
|
|
|
|
|
356
|
|
|
*/ |
|
357
|
|
|
public $lock = null; |
|
358
|
|
|
|
|
359
|
|
|
/** |
|
360
|
|
|
* int (*utimens) (const char *, const struct timespec tv[2]); |
|
361
|
|
|
* |
|
362
|
|
|
* @var null|utimens_op|utimens_typed_op |
|
|
|
|
|
|
363
|
|
|
*/ |
|
364
|
|
|
public $utimens = null; |
|
365
|
|
|
|
|
366
|
|
|
/** |
|
367
|
|
|
* int (*bmap) (const char *, size_t blocksize, uint64_t *idx); |
|
368
|
|
|
* |
|
369
|
|
|
* @var null|bmap_op|bmap_typed_op |
|
|
|
|
|
|
370
|
|
|
*/ |
|
371
|
|
|
public $bmap = null; |
|
372
|
|
|
|
|
373
|
|
|
/** |
|
374
|
|
|
* unsigned int flag_nullpath_ok:1; |
|
375
|
|
|
* unsigned int flag_nopath:1; |
|
376
|
|
|
* unsigned int flag_utime_omit_ok:1; |
|
377
|
|
|
* unsigned int flag_reserved:29; |
|
378
|
|
|
*/ |
|
379
|
|
|
public bool $flag_nullpath_ok = false; |
|
380
|
|
|
public bool $flag_nopath = false; |
|
381
|
|
|
public bool $flag_utime_omit_ok = false; |
|
382
|
|
|
|
|
383
|
|
|
/** |
|
384
|
|
|
* int (*ioctl) (const char *, int cmd, void *arg, struct fuse_file_info *, unsigned int flags, void *data); |
|
385
|
|
|
* |
|
386
|
|
|
* @var null|ioctl_op|ioctl_typed_op |
|
|
|
|
|
|
387
|
|
|
*/ |
|
388
|
|
|
public $ioctl = null; |
|
389
|
|
|
|
|
390
|
|
|
/** |
|
391
|
|
|
* int (*poll) (const char *, struct fuse_file_info *, struct fuse_pollhandle *ph, unsigned *reventsp); |
|
392
|
|
|
* |
|
393
|
|
|
* @var null|poll_op|poll_typed_op |
|
|
|
|
|
|
394
|
|
|
*/ |
|
395
|
|
|
public $poll = null; |
|
396
|
|
|
|
|
397
|
|
|
/** |
|
398
|
|
|
* int (*write_buf) (const char *, struct fuse_bufvec *buf, off_t off, struct fuse_file_info *); |
|
399
|
|
|
* |
|
400
|
|
|
* @var null|write_buf_op|write_buf_typed_op |
|
|
|
|
|
|
401
|
|
|
*/ |
|
402
|
|
|
public $write_buf = null; |
|
403
|
|
|
|
|
404
|
|
|
/** |
|
405
|
|
|
* int (*read_buf) (const char *, struct fuse_bufvec **bufp, size_t size, off_t off, struct fuse_file_info *); |
|
406
|
|
|
* |
|
407
|
|
|
* @var null|read_buf_op|read_buf_typed_op |
|
|
|
|
|
|
408
|
|
|
*/ |
|
409
|
|
|
public $read_buf = null; |
|
410
|
|
|
|
|
411
|
|
|
/** |
|
412
|
|
|
* int (*flock) (const char *, struct fuse_file_info *, int op); |
|
413
|
|
|
* |
|
414
|
|
|
* @var null|flock_op|flock_typed_op |
|
|
|
|
|
|
415
|
|
|
*/ |
|
416
|
|
|
public $flock = null; |
|
417
|
|
|
|
|
418
|
|
|
/** |
|
419
|
|
|
* int (*fallocate) (const char *, int, off_t, off_t, struct fuse_file_info *); |
|
420
|
|
|
* |
|
421
|
|
|
* @var null|fallocate_op|fallocate_typed_op |
|
|
|
|
|
|
422
|
|
|
*/ |
|
423
|
|
|
public $fallocate = null; |
|
424
|
|
|
|
|
425
|
|
|
private ?CData $cdata_cache = null; |
|
426
|
|
|
|
|
427
|
|
|
|
|
428
|
|
|
public function getCData(): CData |
|
429
|
|
|
{ |
|
430
|
|
|
$fuse_operations = Fuse::getInstance()->ffi->new('struct fuse_operations'); |
|
431
|
|
|
$typed_cdata_wrapper = new TypedCDataWrapper(); |
|
432
|
|
|
/** |
|
433
|
|
|
* @psalm-suppress RawObjectIteration |
|
434
|
|
|
* @var string $name |
|
435
|
|
|
* @var callable|null|bool $callable |
|
436
|
|
|
*/ |
|
437
|
|
|
foreach ($this as $name => $callable) { |
|
438
|
|
|
if (is_null($callable)) { |
|
439
|
|
|
continue; |
|
440
|
|
|
} |
|
441
|
|
|
if (substr_compare($name, 'flag_', 0, 5) === 0) { |
|
442
|
|
|
continue; |
|
443
|
|
|
} |
|
444
|
|
|
assert(is_callable($callable)); |
|
445
|
|
|
$fuse_operations->$name = $typed_cdata_wrapper->createWrapper($callable); |
|
446
|
|
|
} |
|
447
|
|
|
assert(!is_null($fuse_operations)); |
|
448
|
|
|
return $this->cdata_cache = $fuse_operations; |
|
449
|
|
|
} |
|
450
|
|
|
|
|
451
|
|
|
public function getSize(): int |
|
452
|
|
|
{ |
|
453
|
|
|
$typename = 'struct fuse_operations'; |
|
454
|
|
|
$type = Fuse::getInstance()->ffi->type( |
|
455
|
|
|
$typename |
|
456
|
|
|
); |
|
457
|
|
|
assert(!is_null($type)); |
|
458
|
|
|
$size = FFI::sizeof( |
|
459
|
|
|
$type |
|
460
|
|
|
); |
|
461
|
|
|
return $size; |
|
462
|
|
|
} |
|
463
|
|
|
|
|
464
|
|
|
public function getOperations(): FuseOperations |
|
465
|
|
|
{ |
|
466
|
|
|
return $this; |
|
467
|
|
|
} |
|
468
|
|
|
} |
|
469
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths