diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b6c3ac7a..6b932ef4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: 20 + java-version: 21-ea distribution: 'zulu' cache: 'maven' - name: Setup fuse @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: 20 + java-version: 21-ea distribution: 'zulu' cache: 'maven' - name: Setup fuse @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: 20 + java-version: 21-ea distribution: 'zulu' cache: 'maven' - name: Setup fuse @@ -83,7 +83,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-java@v3 with: - java-version: 20 + java-version: 21-ea distribution: 'zulu' cache: 'maven' - name: Cache SonarCloud packages diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index b890f58c..1f285408 100644 --- a/.github/workflows/publish-central.yml +++ b/.github/workflows/publish-central.yml @@ -15,7 +15,7 @@ jobs: ref: "refs/tags/${{ github.event.inputs.tag }}" - uses: actions/setup-java@v3 with: - java-version: 20 + java-version: 21-ea distribution: 'zulu' cache: 'maven' server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml diff --git a/.github/workflows/publish-github.yml b/.github/workflows/publish-github.yml index bdcc2f6d..d28dbb31 100644 --- a/.github/workflows/publish-github.yml +++ b/.github/workflows/publish-github.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: - java-version: 20 + java-version: 21-ea distribution: 'zulu' cache: 'maven' gpg-private-key: ${{ secrets.RELEASES_GPG_PRIVATE_KEY }} # Value of the GPG private key to import diff --git a/.idea/misc.xml b/.idea/misc.xml index 3ff4034e..fe432516 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file diff --git a/README.md b/README.md index 2358d28d..b55786c7 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ # jFUSE -Zero-Dependency Java bindings for FUSE using [JEP 434](https://openjdk.org/jeps/434). +Zero-Dependency Java bindings for FUSE using [JEP 4442](https://openjdk.org/jeps/442). ## Status -This is currently an experimental library requiring JDK 20. As long as the [Foreign Function & Memory API](https://openjdk.org/jeps/434) is incubating, the required JDK will increase. +This is currently an experimental library requiring JDK 21. As long as the [Foreign Function & Memory API](https://openjdk.org/jeps/442) is incubating, the required JDK will increase. Older JDK versions are *not supported*. Please refer to an older version of this lib, if you are interested in using it with an older JDK. Older versions will not receive patches or any kind of support, though! We attempt to support libfuse 3.x on Linux and Windows while also remaining compatible with libfuse 2.x on macOS, leading to some compromises in the API. diff --git a/jfuse-api/pom.xml b/jfuse-api/pom.xml index 624eb7f5..67ee6fe0 100644 --- a/jfuse-api/pom.xml +++ b/jfuse-api/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse-api diff --git a/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Errno.java b/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Errno.java index dd62c590..0bb1c812 100644 --- a/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Errno.java +++ b/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Errno.java @@ -124,4 +124,11 @@ public interface Errno { */ int enametoolong(); + /** + * The named attribute does not exist, or the process has no access to this attribute; + * + * @return error constant {@code ENODATA} + */ + int enodata(); + } diff --git a/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Fuse.java b/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Fuse.java index 37cf8c9b..6f74899b 100644 --- a/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Fuse.java +++ b/jfuse-api/src/main/java/org/cryptomator/jfuse/api/Fuse.java @@ -23,7 +23,6 @@ import java.util.concurrent.ThreadFactory; import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeoutException; -import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Function; @@ -43,7 +42,7 @@ public abstract class Fuse implements AutoCloseable { /** * The memory session associated with the lifecycle of this Fuse instance. */ - protected final Arena fuseArena = Arena.openShared(); + protected final Arena fuseArena = Arena.ofShared(); /** * The file system operations invoked by this FUSE file system. @@ -125,7 +124,7 @@ public synchronized void mount(String progName, Path mountPoint, String... flags try { var fuseMount = this.mount(args); - Future fuseLoop = executor.submit(() -> fuseLoop(fuseMount)); + Future fuseLoop = executor.submit(fuseMount::loop); waitForMountingToComplete(mountPoint, fuseLoop); if (fuseLoop.isDone()) { throw new FuseMountFailedException("fuse_loop() returned prematurely with non-zero exit code " + fuseLoop.get()); @@ -153,16 +152,6 @@ void waitForMountingToComplete(Path mountPoint, Future fuseLoop) throws } while (!fuseLoop.isDone() && !mountProbeSucceeded.await(200, TimeUnit.MILLISECONDS)); } - @Blocking - private int fuseLoop(FuseMount mount) { - AtomicInteger result = new AtomicInteger(); - fuseArena.scope().whileAlive(() -> { - int r = mount.loop(); - result.set(r); - }); - return result.get(); - } - /** * Mounts the fuse file system. * diff --git a/jfuse-examples/pom.xml b/jfuse-examples/pom.xml index f73183a2..7d7255b0 100644 --- a/jfuse-examples/pom.xml +++ b/jfuse-examples/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse-examples diff --git a/jfuse-linux-aarch64/pom.xml b/jfuse-linux-aarch64/pom.xml index a174b7b5..7bd9e844 100644 --- a/jfuse-linux-aarch64/pom.xml +++ b/jfuse-linux-aarch64/pom.xml @@ -5,7 +5,7 @@ jfuse-parent org.cryptomator - 0.5.1 + 0.6.0 4.0.0 jfuse-linux-aarch64 @@ -71,10 +71,9 @@ jextract-maven-plugin 0.3.0 - /Users/sebastian/Documents/Cryptomator/jextract/build/jextract/bin/jextract + /Users/sebastian/git/github.com/openjdk/jextract/build/jextract/bin/jextract ${linux.headerSearchPath} ${project.build.sourceDirectory} - org.cryptomator.jfuse.linux.aarch64.extr @@ -84,6 +83,7 @@ ${project.parent.basedir}/libfuse3/include/fuse.h + org.cryptomator.jfuse.linux.aarch64.extr.fuse3 fuse_h _FILE_OFFSET_BITS=64 @@ -128,7 +128,7 @@ ${project.parent.basedir}/libfuse3/include/fuse_lowlevel.h - org.cryptomator.jfuse.linux.aarch64.extr + org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel fuse_lowlevel_h _FILE_OFFSET_BITS=64 @@ -146,6 +146,7 @@ ${linux.headerSearchPath}/errno.h + org.cryptomator.jfuse.linux.aarch64.extr.errno errno_h ENOENT @@ -164,6 +165,7 @@ ERANGE ENOLCK ENAMETOOLONG + ENODATA @@ -174,6 +176,7 @@ ${linux.headerSearchPath}/sys/stat.h + org.cryptomator.jfuse.linux.aarch64.extr.stat stat_h UTIME_NOW @@ -188,6 +191,7 @@ ${linux.headerSearchPath}/fcntl.h + org.cryptomator.jfuse.linux.aarch64.extr.fcntl fcntl_h O_RDONLY @@ -209,6 +213,7 @@ ${linux.headerSearchPath}/stdio.h + org.cryptomator.jfuse.linux.aarch64.extr.stdio stdio_h _GNU_SOURCE=1 @@ -227,5 +232,4 @@ - - \ No newline at end of file + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/DirFillerImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/DirFillerImpl.java index 29d67f3a..a6388ed3 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/DirFillerImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/DirFillerImpl.java @@ -2,18 +2,17 @@ import org.cryptomator.jfuse.api.DirFiller; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_fill_dir_t; -import org.cryptomator.jfuse.linux.aarch64.extr.stat; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_fill_dir_t; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.stat; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; import java.util.function.Consumer; record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller { DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { - this(buf, fuse_fill_dir_t.ofAddress(callback, arena.scope()), arena); + this(buf, fuse_fill_dir_t.ofAddress(callback, arena), arena); } @Override diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImpl.java index 5b8dc84c..9f83c786 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImpl.java @@ -1,11 +1,11 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FileInfo; -import org.cryptomator.jfuse.linux.aarch64.extr.fcntl_h; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_file_info; +import org.cryptomator.jfuse.linux.aarch64.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_file_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -22,7 +22,7 @@ record FileInfoImpl(MemorySegment segment) implements FileInfo { private static final int O_SYNC = fcntl_h.O_SYNC(); private static final int O_DSYNC = fcntl_h.O_DSYNC(); - public FileInfoImpl(MemorySegment address, SegmentScope scope) { + public FileInfoImpl(MemorySegment address, Arena scope) { this(fuse_file_info.ofAddress(address, scope)); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseArgs.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseArgs.java index b4876e90..d3c1c1ef 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseArgs.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseArgs.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_args; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_cmdline_opts; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_args; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel.fuse_cmdline_opts; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -14,7 +14,7 @@ public String toString() { var argc = fuse_args.argc$get(args); var argv = fuse_args.argv$get(args); for (int i = 0; i < argc; i++) { - var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS, i).reinterpret(Long.MAX_VALUE); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } sb.append("mountPoint = ").append(mountPoint().getUtf8String(0)); diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImpl.java index 4d7e3d57..ea8a2e50 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FuseConfig; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_config; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_config; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConfigImpl(MemorySegment segment) implements FuseConfig { - public FuseConfigImpl(MemorySegment address, SegmentScope scope) { + public FuseConfigImpl(MemorySegment address, Arena scope) { this(fuse_config.ofAddress(address, scope)); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImpl.java index 68784682..6b9f393f 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_conn_info; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_conn_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) { + public FuseConnInfoImpl(MemorySegment address, Arena scope) { this(fuse_conn_info.ofAddress(address, scope)); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseImpl.java index c5518b25..5442c7f0 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseImpl.java @@ -5,12 +5,12 @@ import org.cryptomator.jfuse.api.FuseMount; import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_args; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_cmdline_opts; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_h; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_operations; -import org.cryptomator.jfuse.linux.aarch64.extr.stat_h; -import org.cryptomator.jfuse.linux.aarch64.extr.timespec; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_args; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_operations; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.timespec; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel.fuse_cmdline_opts; +import org.cryptomator.jfuse.linux.aarch64.extr.stat.stat_h; import org.jetbrains.annotations.VisibleForTesting; import java.lang.foreign.Arena; @@ -66,45 +66,45 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { @Override protected void bind(FuseOperations.Operation operation) { switch (operation) { - case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseArena.scope())); - case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseArena.scope())); - case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseArena.scope())); - case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseArena.scope())); - case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseArena.scope())); - case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseArena.scope())); - case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseArena.scope())); - case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseArena.scope())); - case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseArena.scope())); - case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseArena.scope())); - case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseArena.scope())); - case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseArena.scope())); - case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseArena.scope())); - case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseArena.scope())); - case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseArena.scope())); - case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseArena.scope())); - case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseArena.scope())); - case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseArena.scope())); - case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseArena.scope())); - case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseArena.scope())); - case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseArena.scope())); - case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseArena.scope())); - case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseArena.scope())); - case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseArena.scope())); - case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseArena.scope())); - case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseArena.scope())); - case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseArena.scope())); - case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseArena.scope())); - case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseArena.scope())); - case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseArena.scope())); + case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseArena)); + case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseArena)); + case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseArena)); + case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseArena)); + case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseArena)); + case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseArena)); + case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseArena)); + case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseArena)); + case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseArena)); + case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseArena)); + case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseArena)); + case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseArena)); + case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseArena)); + case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseArena)); + case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseArena)); + case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseArena)); + case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseArena)); + case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseArena)); + case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseArena)); + case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseArena)); + case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseArena)); + case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseArena)); + case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseArena)); + case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseArena)); + case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseArena)); + case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseArena)); + case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseArena)); + case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseArena)); + case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseArena)); + case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseArena)); } } @VisibleForTesting MemorySegment init(MemorySegment conn, MemorySegment cfg) { - try (var arena = Arena.openConfined()) { - var connInfo = new FuseConnInfoImpl(conn, arena.scope()); + try (var arena = Arena.ofConfined()) { + var connInfo = new FuseConnInfoImpl(conn, arena); connInfo.setWant(connInfo.want() | FuseConnInfo.FUSE_CAP_READDIRPLUS); - var config = new FuseConfigImpl(cfg, arena.scope()); + var config = new FuseConfigImpl(cfg, arena); fuseOperations.init(connInfo, config); } return MemorySegment.NULL; @@ -115,21 +115,21 @@ private int access(MemorySegment path, int mask) { } private int chmod(MemorySegment path, int mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int chown(MemorySegment path, int uid, int gid, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, arena)); } } private int create(MemorySegment path, int mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @@ -139,53 +139,47 @@ private void destroy(MemorySegment addr) { @VisibleForTesting int flush(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsync(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsyncdir(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } private int getattr(MemorySegment path, MemorySegment stat, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena.scope()), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int getxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), buffer); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), val); } @VisibleForTesting int setxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size, int flags) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), buffer, flags); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), val, flags); } @VisibleForTesting int listxattr(MemorySegment path, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.listxattr(path.getUtf8String(0), buffer); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.listxattr(path.getUtf8String(0), val); } @VisibleForTesting @@ -198,46 +192,44 @@ private int mkdir(MemorySegment path, int mode) { } private int open(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int opendir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int read(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } private int readdir(MemorySegment path, MemorySegment buf, MemorySegment filler, long offset, MemorySegment fi, int flags) { - try (var arena = Arena.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena.scope()), flags); + try (var arena = Arena.ofConfined()) { + return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena), flags); } } private int readlink(MemorySegment path, MemorySegment buf, long len) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), len, arena.scope()).asByteBuffer(); - return fuseOperations.readlink(path.getUtf8String(0), buffer, len); - } + var buffer = buf.reinterpret(len).asByteBuffer(); + return fuseOperations.readlink(path.getUtf8String(0), buffer, len); } private int release(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int releasedir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @@ -250,8 +242,8 @@ private int rmdir(MemorySegment path) { } private int statfs(MemorySegment path, MemorySegment statvfs) { - try (var arena = Arena.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena)); } } @@ -260,8 +252,8 @@ private int symlink(MemorySegment linkname, MemorySegment target) { } private int truncate(MemorySegment path, long size, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena)); } } @@ -272,26 +264,26 @@ private int unlink(MemorySegment path) { @VisibleForTesting int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { if (MemorySegment.NULL.equals(times)) { - // set both times to current time (using on-heap memory segments) - var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), arena.scope()); + // set both times to current time + var segment = arena.allocate(timespec.$LAYOUT()); timespec.tv_sec$set(segment, 0); timespec.tv_nsec$set(segment, stat_h.UTIME_NOW()); var time = new TimeSpecImpl(segment); - return fuseOperations.utimens(path.getUtf8String(0), time, time, new FileInfoImpl(fi, arena.scope())); + return fuseOperations.utimens(path.getUtf8String(0), time, time, new FileInfoImpl(fi, arena)); } else { var time0 = times.asSlice(0, timespec.$LAYOUT().byteSize()); var time1 = times.asSlice(timespec.$LAYOUT().byteSize(), timespec.$LAYOUT().byteSize()); - return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena.scope())); + return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena)); } } } private int write(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImpl.java index 6d464cd2..4e485909 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImpl.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_h; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_loop_config_v1; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_loop_config_v1; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -20,7 +20,7 @@ public int loop() { return fuse_h.fuse_loop(fuse); } else if (fuse_h.fuse_version() < FUSE_3_12) { // FUSE 3.2 - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var loopCfg = fuse_loop_config_v1.allocate(arena); fuse_loop_config_v1.clone_fd$set(loopCfg, fuseArgs.cloneFd()); fuse_loop_config_v1.max_idle_threads$set(loopCfg, fuseArgs.maxIdleThreads()); diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrno.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrno.java index 8470da28..70bbab60 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrno.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrno.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.Errno; -import org.cryptomator.jfuse.linux.aarch64.extr.errno_h; +import org.cryptomator.jfuse.linux.aarch64.extr.errno.errno_h; record LinuxErrno() implements Errno { @@ -84,4 +84,9 @@ public int enolck() { public int enametoolong() { return errno_h.ENAMETOOLONG(); } + + @Override + public int enodata() { + return errno_h.ENODATA(); + } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatImpl.java index 80a201a8..885b9650 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatImpl.java @@ -3,14 +3,14 @@ import org.cryptomator.jfuse.api.Stat; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.linux.aarch64.extr.stat; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.stat; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemorySegment address, SegmentScope scope) { + public StatImpl(MemorySegment address, Arena scope) { this(stat.ofAddress(address, scope)); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatvfsImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatvfsImpl.java index 6f0c9bd5..7e6f1997 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatvfsImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/StatvfsImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.Statvfs; -import org.cryptomator.jfuse.linux.aarch64.extr.statvfs; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.statvfs; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemorySegment address, SegmentScope scope) { + public StatvfsImpl(MemorySegment address, Arena scope) { this(statvfs.ofAddress(address, scope)); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImpl.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImpl.java index aa3c759b..ddd72f6d 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImpl.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImpl.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.linux.aarch64.extr.stat_h; -import org.cryptomator.jfuse.linux.aarch64.extr.timespec; +import org.cryptomator.jfuse.linux.aarch64.extr.stat.stat_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.timespec; import java.lang.foreign.MemorySegment; import java.time.Instant; diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/Constants$root.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/Constants$root.java deleted file mode 100644 index 16f3a77f..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/Constants$root.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class Constants$root { - - // Suppresses default constructor, ensuring non-instantiability. - private Constants$root() {} - static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; - static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; - static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; - static final OfInt C_INT$LAYOUT = JAVA_INT; - static final OfLong C_LONG$LAYOUT = JAVA_LONG; - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded(); -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$0.java deleted file mode 100644 index 937be913..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$0.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$0 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$0() {} - static final FunctionDescriptor fuse_version$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); - static final MethodHandle fuse_version$MH = RuntimeHelper.downcallHandle( - "fuse_version", - constants$0.fuse_version$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_create$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT); - static final MethodHandle fuse_loop_cfg_create$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_create", - constants$0.fuse_loop_cfg_create$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop_cfg_destroy$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_destroy", - constants$0.fuse_loop_cfg_destroy$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_set_max_threads$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle fuse_loop_cfg_set_max_threads$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_set_max_threads", - constants$0.fuse_loop_cfg_set_max_threads$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_set_clone_fd$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle fuse_loop_cfg_set_clone_fd$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_set_clone_fd", - constants$0.fuse_loop_cfg_set_clone_fd$FUNC - ); - static final FunctionDescriptor fuse_fill_dir_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$1.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$1.java deleted file mode 100644 index e98767b7..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$1.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$1 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$1() {} - static final FunctionDescriptor fuse_fill_dir_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle fuse_fill_dir_t$MH = RuntimeHelper.downcallHandle( - constants$1.fuse_fill_dir_t$FUNC - ); - static final FunctionDescriptor fuse_lib_help$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_lib_help$MH = RuntimeHelper.downcallHandle( - "fuse_lib_help", - constants$1.fuse_lib_help$FUNC - ); - static final FunctionDescriptor fuse_new$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_new$MH = RuntimeHelper.downcallHandle( - "fuse_new", - constants$1.fuse_new$FUNC - ); - static final FunctionDescriptor fuse_mount$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_mount$MH = RuntimeHelper.downcallHandle( - "fuse_mount", - constants$1.fuse_mount$FUNC - ); - static final FunctionDescriptor fuse_unmount$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_unmount$MH = RuntimeHelper.downcallHandle( - "fuse_unmount", - constants$1.fuse_unmount$FUNC - ); - static final FunctionDescriptor fuse_destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_destroy$MH = RuntimeHelper.downcallHandle( - "fuse_destroy", - constants$1.fuse_destroy$FUNC - ); -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$2.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$2.java deleted file mode 100644 index ecf675c6..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$2.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$2 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$2() {} - static final FunctionDescriptor fuse_loop$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop$MH = RuntimeHelper.downcallHandle( - "fuse_loop", - constants$2.fuse_loop$FUNC - ); - static final FunctionDescriptor fuse_exit$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_exit$MH = RuntimeHelper.downcallHandle( - "fuse_exit", - constants$2.fuse_exit$FUNC - ); - static final FunctionDescriptor fuse_loop_mt$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop_mt$MH = RuntimeHelper.downcallHandle( - "fuse_loop_mt", - constants$2.fuse_loop_mt$FUNC - ); - static final FunctionDescriptor fuse_get_session$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_get_session$MH = RuntimeHelper.downcallHandle( - "fuse_get_session", - constants$2.fuse_get_session$FUNC - ); -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/RuntimeHelper.java new file mode 100644 index 00000000..f2a17a5f --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.aarch64.extr.errno; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/constants$0.java new file mode 100644 index 00000000..1b6e78d3 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.errno; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/errno_h.java similarity index 78% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/errno_h.java index 76e19057..8d7dc15b 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno/errno_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.errno; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define ENOENT 2 @@ -137,6 +137,14 @@ public static int ENOSYS() { public static int ENOTEMPTY() { return (int)39L; } + /** + * {@snippet : + * #define ENODATA 61 + * } + */ + public static int ENODATA() { + return (int)61L; + } /** * {@snippet : * #define ENOTSUP 95 diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/RuntimeHelper.java new file mode 100644 index 00000000..d7be6bf9 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.aarch64.extr.fcntl; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/constants$0.java new file mode 100644 index 00000000..7438ade1 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fcntl; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/fcntl_h.java similarity index 69% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/fcntl_h.java index 6c0c3898..403bbb02 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl/fcntl_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fcntl; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define O_RDONLY 0 diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/RuntimeHelper.java new file mode 100644 index 00000000..0422b28f --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$0.java new file mode 100644 index 00000000..a562930a --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$0.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("argc"), + MemoryLayout.paddingLayout(4), + RuntimeHelper.POINTER.withName("argv"), + JAVA_INT.withName("allocated"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_args"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argc")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argv")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("allocated")); + static final StructLayout const$4 = MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("timespec"); + static final VarHandle const$5 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$1.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$1.java new file mode 100644 index 00000000..a54155cc --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$1.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final VarHandle const$0 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); + static final StructLayout const$1 = MemoryLayout.structLayout( + JAVA_INT.withName("flags"), + MemoryLayout.paddingLayout(12), + JAVA_LONG.withName("fh"), + JAVA_LONG.withName("lock_owner"), + JAVA_INT.withName("poll_events"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_file_info"); + static final VarHandle const$2 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("flags")); + static final VarHandle const$3 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("fh")); + static final VarHandle const$4 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); + static final VarHandle const$5 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("poll_events")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$10.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$10.java new file mode 100644 index 00000000..cdc5f05e --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$10.java @@ -0,0 +1,58 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$10 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$10() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_INT + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_fill_dir_t.class, "apply", constants$10.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$10.const$0 + ); + static final StructLayout const$3 = MemoryLayout.structLayout( + JAVA_INT.withName("set_gid"), + JAVA_INT.withName("gid"), + JAVA_INT.withName("set_uid"), + JAVA_INT.withName("uid"), + JAVA_INT.withName("set_mode"), + JAVA_INT.withName("umask"), + JAVA_DOUBLE.withName("entry_timeout"), + JAVA_DOUBLE.withName("negative_timeout"), + JAVA_DOUBLE.withName("attr_timeout"), + JAVA_INT.withName("intr"), + JAVA_INT.withName("intr_signal"), + JAVA_INT.withName("remember"), + JAVA_INT.withName("hard_remove"), + JAVA_INT.withName("use_ino"), + JAVA_INT.withName("readdir_ino"), + JAVA_INT.withName("direct_io"), + JAVA_INT.withName("kernel_cache"), + JAVA_INT.withName("auto_cache"), + JAVA_INT.withName("no_rofd_flush"), + JAVA_INT.withName("ac_attr_timeout_set"), + MemoryLayout.paddingLayout(4), + JAVA_DOUBLE.withName("ac_attr_timeout"), + JAVA_INT.withName("nullpath_ok"), + JAVA_INT.withName("show_help"), + RuntimeHelper.POINTER.withName("modules"), + JAVA_INT.withName("debug"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_config"); + static final VarHandle const$4 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("set_gid")); + static final VarHandle const$5 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("gid")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$11.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$11.java new file mode 100644 index 00000000..e1aff91d --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$11.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$11 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$11() {} + static final VarHandle const$0 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("set_uid")); + static final VarHandle const$1 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("uid")); + static final VarHandle const$2 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("set_mode")); + static final VarHandle const$3 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("umask")); + static final VarHandle const$4 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("entry_timeout")); + static final VarHandle const$5 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("negative_timeout")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$12.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$12.java new file mode 100644 index 00000000..c02651b0 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$12.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$12 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$12() {} + static final VarHandle const$0 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("attr_timeout")); + static final VarHandle const$1 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("intr")); + static final VarHandle const$2 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("intr_signal")); + static final VarHandle const$3 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("remember")); + static final VarHandle const$4 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("hard_remove")); + static final VarHandle const$5 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("use_ino")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$13.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$13.java new file mode 100644 index 00000000..657796ed --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$13.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$13 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$13() {} + static final VarHandle const$0 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("readdir_ino")); + static final VarHandle const$1 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("direct_io")); + static final VarHandle const$2 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("kernel_cache")); + static final VarHandle const$3 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("auto_cache")); + static final VarHandle const$4 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("no_rofd_flush")); + static final VarHandle const$5 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout_set")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$14.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$14.java new file mode 100644 index 00000000..8ed08413 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$14.java @@ -0,0 +1,65 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$14 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$14() {} + static final VarHandle const$0 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout")); + static final VarHandle const$1 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("nullpath_ok")); + static final VarHandle const$2 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("show_help")); + static final VarHandle const$3 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("modules")); + static final VarHandle const$4 = constants$10.const$3.varHandle(MemoryLayout.PathElement.groupElement("debug")); + static final StructLayout const$5 = MemoryLayout.structLayout( + RuntimeHelper.POINTER.withName("getattr"), + RuntimeHelper.POINTER.withName("readlink"), + RuntimeHelper.POINTER.withName("mknod"), + RuntimeHelper.POINTER.withName("mkdir"), + RuntimeHelper.POINTER.withName("unlink"), + RuntimeHelper.POINTER.withName("rmdir"), + RuntimeHelper.POINTER.withName("symlink"), + RuntimeHelper.POINTER.withName("rename"), + RuntimeHelper.POINTER.withName("link"), + RuntimeHelper.POINTER.withName("chmod"), + RuntimeHelper.POINTER.withName("chown"), + RuntimeHelper.POINTER.withName("truncate"), + RuntimeHelper.POINTER.withName("open"), + RuntimeHelper.POINTER.withName("read"), + RuntimeHelper.POINTER.withName("write"), + RuntimeHelper.POINTER.withName("statfs"), + RuntimeHelper.POINTER.withName("flush"), + RuntimeHelper.POINTER.withName("release"), + RuntimeHelper.POINTER.withName("fsync"), + RuntimeHelper.POINTER.withName("setxattr"), + RuntimeHelper.POINTER.withName("getxattr"), + RuntimeHelper.POINTER.withName("listxattr"), + RuntimeHelper.POINTER.withName("removexattr"), + RuntimeHelper.POINTER.withName("opendir"), + RuntimeHelper.POINTER.withName("readdir"), + RuntimeHelper.POINTER.withName("releasedir"), + RuntimeHelper.POINTER.withName("fsyncdir"), + RuntimeHelper.POINTER.withName("init"), + RuntimeHelper.POINTER.withName("destroy"), + RuntimeHelper.POINTER.withName("access"), + RuntimeHelper.POINTER.withName("create"), + RuntimeHelper.POINTER.withName("lock"), + RuntimeHelper.POINTER.withName("utimens"), + RuntimeHelper.POINTER.withName("bmap"), + RuntimeHelper.POINTER.withName("ioctl"), + RuntimeHelper.POINTER.withName("poll"), + RuntimeHelper.POINTER.withName("write_buf"), + RuntimeHelper.POINTER.withName("read_buf"), + RuntimeHelper.POINTER.withName("flock"), + RuntimeHelper.POINTER.withName("fallocate"), + RuntimeHelper.POINTER.withName("copy_file_range"), + RuntimeHelper.POINTER.withName("lseek") + ).withName("fuse_operations"); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$15.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$15.java new file mode 100644 index 00000000..bdca941e --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$15.java @@ -0,0 +1,32 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$15 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$15() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.getattr.class, "apply", constants$15.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$15.const$0 + ); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("getattr")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.readlink.class, "apply", constants$15.const$4); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$16.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$16.java new file mode 100644 index 00000000..25ce7679 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$16.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$16 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$16() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$15.const$4 + ); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("readlink")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_LONG + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.mknod.class, "apply", constants$16.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$16.const$2 + ); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("mknod")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$17.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$17.java new file mode 100644 index 00000000..ac2c0ca7 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$17.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$17 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$17() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.mkdir.class, "apply", constants$17.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$17.const$0 + ); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.unlink.class, "apply", constants$17.const$4); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$18.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$18.java new file mode 100644 index 00000000..49fa93f1 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$18.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$18 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$18() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$17.const$4 + ); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("unlink")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.rmdir.class, "apply", constants$17.const$4); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.symlink.class, "apply", constants$18.const$4); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$19.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$19.java new file mode 100644 index 00000000..2394bd0b --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$19.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$19 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$19() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$18.const$4 + ); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("symlink")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.rename.class, "apply", constants$19.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$19.const$2 + ); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("rename")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$2.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$2.java new file mode 100644 index 00000000..085bb1af --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$2.java @@ -0,0 +1,37 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$2 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$2() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("clone_fd"), + JAVA_INT.withName("max_idle_threads") + ).withName("fuse_loop_config_v1"); + static final VarHandle const$1 = constants$2.const$0.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); + static final VarHandle const$2 = constants$2.const$0.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); + static final StructLayout const$3 = MemoryLayout.structLayout( + JAVA_INT.withName("proto_major"), + JAVA_INT.withName("proto_minor"), + JAVA_INT.withName("max_write"), + JAVA_INT.withName("max_read"), + JAVA_INT.withName("max_readahead"), + JAVA_INT.withName("capable"), + JAVA_INT.withName("want"), + JAVA_INT.withName("max_background"), + JAVA_INT.withName("congestion_threshold"), + JAVA_INT.withName("time_gran"), + MemoryLayout.sequenceLayout(22, JAVA_INT).withName("reserved") + ).withName("fuse_conn_info"); + static final VarHandle const$4 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); + static final VarHandle const$5 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$20.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$20.java new file mode 100644 index 00000000..7c0cbe6c --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$20.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$20 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$20() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.link.class, "apply", constants$18.const$4); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("link")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.chmod.class, "apply", constants$20.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$20.const$2 + ); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("chmod")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$21.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$21.java new file mode 100644 index 00000000..e41c328c --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$21.java @@ -0,0 +1,33 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$21 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$21() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.chown.class, "apply", constants$21.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$21.const$0 + ); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("chown")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.truncate.class, "apply", constants$21.const$4); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$22.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$22.java new file mode 100644 index 00000000..e575bc0a --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$22.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$22 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$22() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$21.const$4 + ); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("truncate")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.open.class, "apply", constants$18.const$4); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("open")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.read.class, "apply", constants$22.const$4); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$23.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$23.java new file mode 100644 index 00000000..be4be51a --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$23.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$23 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$23() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$22.const$4 + ); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("read")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.write.class, "apply", constants$22.const$4); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("write")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.statfs.class, "apply", constants$18.const$4); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("statfs")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$24.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$24.java new file mode 100644 index 00000000..daf306e2 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$24.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$24 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$24() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.flush.class, "apply", constants$18.const$4); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("flush")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.release.class, "apply", constants$18.const$4); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("release")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.fsync.class, "apply", constants$20.const$2); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("fsync")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$25.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$25.java new file mode 100644 index 00000000..84cd32de --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$25.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$25 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$25() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.setxattr.class, "apply", constants$10.const$0); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.getxattr.class, "apply", constants$25.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$25.const$2 + ); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$26.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$26.java new file mode 100644 index 00000000..459dcc55 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$26.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$26 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$26() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.listxattr.class, "apply", constants$15.const$4); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.removexattr.class, "apply", constants$18.const$4); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.opendir.class, "apply", constants$18.const$4); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("opendir")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$27.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$27.java new file mode 100644 index 00000000..b12c5d99 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$27.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$27 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$27() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.readdir.class, "apply", constants$27.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$27.const$0 + ); + static final VarHandle const$3 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("readdir")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.releasedir.class, "apply", constants$18.const$4); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$28.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$28.java new file mode 100644 index 00000000..e0d4545a --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$28.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$28 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$28() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.fsyncdir.class, "apply", constants$20.const$2); + static final VarHandle const$1 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.init.class, "apply", constants$28.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$28.const$2 + ); + static final VarHandle const$5 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("init")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$29.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$29.java new file mode 100644 index 00000000..0fcf4628 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$29.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$29 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$29() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.destroy.class, "apply", constants$5.const$0); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$5.const$0 + ); + static final VarHandle const$2 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("destroy")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.access.class, "apply", constants$17.const$0); + static final VarHandle const$4 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("access")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.create.class, "apply", constants$20.const$2); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$3.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$3.java new file mode 100644 index 00000000..0d9c12cf --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$3.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$3 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$3() {} + static final VarHandle const$0 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_write")); + static final VarHandle const$1 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_read")); + static final VarHandle const$2 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); + static final VarHandle const$3 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("capable")); + static final VarHandle const$4 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("want")); + static final VarHandle const$5 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_background")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$30.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$30.java new file mode 100644 index 00000000..a40b0ce3 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$30.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$30 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$30() {} + static final VarHandle const$0 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("create")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.lock.class, "apply", constants$30.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$30.const$1 + ); + static final VarHandle const$4 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("lock")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.utimens.class, "apply", constants$15.const$0); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$31.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$31.java new file mode 100644 index 00000000..88b03af5 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$31.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$31 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$31() {} + static final VarHandle const$0 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("utimens")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.bmap.class, "apply", constants$21.const$4); + static final VarHandle const$2 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("bmap")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.ioctl.class, "apply", constants$31.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$31.const$3 + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$32.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$32.java new file mode 100644 index 00000000..fba5108f --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$32.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$32 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$32() {} + static final VarHandle const$0 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.poll.class, "apply", constants$32.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$32.const$1 + ); + static final VarHandle const$4 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("poll")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$33.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$33.java new file mode 100644 index 00000000..321bbe6e --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$33.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$33 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$33() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.write_buf.class, "apply", constants$32.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$32.const$5 + ); + static final VarHandle const$2 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.read_buf.class, "apply", constants$22.const$4); + static final VarHandle const$4 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.flock.class, "apply", constants$19.const$2); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$34.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$34.java new file mode 100644 index 00000000..06528fa4 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$34.java @@ -0,0 +1,39 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$34 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$34() {} + static final VarHandle const$0 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("flock")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.fallocate.class, "apply", constants$34.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$34.const$1 + ); + static final VarHandle const$4 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_LONG, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_LONG, + JAVA_INT + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$35.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$35.java new file mode 100644 index 00000000..cdab26e9 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$35.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$35 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$35() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.copy_file_range.class, "apply", constants$34.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$34.const$5 + ); + static final VarHandle const$2 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("copy_file_range")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_LONG, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.lseek.class, "apply", constants$35.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$35.const$3 + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$36.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$36.java new file mode 100644 index 00000000..99fe7878 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$36.java @@ -0,0 +1,39 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$36 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$36() {} + static final VarHandle const$0 = constants$14.const$5.varHandle(MemoryLayout.PathElement.groupElement("lseek")); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_lib_help", + constants$5.const$0 + ); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_new", + constants$36.const$2 + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse_mount", + constants$18.const$4 + ); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_unmount", + constants$5.const$0 + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$37.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$37.java new file mode 100644 index 00000000..e1d45d61 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$37.java @@ -0,0 +1,39 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$37 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$37() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + "fuse_destroy", + constants$5.const$0 + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_loop", + constants$17.const$4 + ); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + "fuse_exit", + constants$5.const$0 + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_loop_mt", + constants$18.const$4 + ); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_get_session", + constants$37.const$4 + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$4.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$4.java new file mode 100644 index 00000000..24a608b4 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$4.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$4 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$4() {} + static final VarHandle const$0 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); + static final VarHandle const$1 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("time_gran")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_version", + constants$4.const$2 + ); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(RuntimeHelper.POINTER); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_create", + constants$4.const$4 + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$5.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$5.java new file mode 100644 index 00000000..67198842 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$5.java @@ -0,0 +1,62 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$5 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$5() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_destroy", + constants$5.const$0 + ); + static final FunctionDescriptor const$2 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_set_max_threads", + constants$5.const$2 + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_set_clone_fd", + constants$5.const$2 + ); + static final StructLayout const$5 = MemoryLayout.structLayout( + JAVA_LONG.withName("st_dev"), + JAVA_LONG.withName("st_ino"), + JAVA_INT.withName("st_mode"), + JAVA_INT.withName("st_nlink"), + JAVA_INT.withName("st_uid"), + JAVA_INT.withName("st_gid"), + JAVA_LONG.withName("st_rdev"), + JAVA_LONG.withName("__pad1"), + JAVA_LONG.withName("st_size"), + JAVA_INT.withName("st_blksize"), + JAVA_INT.withName("__pad2"), + JAVA_LONG.withName("st_blocks"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_atim"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_mtim"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_ctim"), + MemoryLayout.sequenceLayout(2, JAVA_INT).withName("__glibc_reserved") + ).withName("stat"); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$6.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$6.java new file mode 100644 index 00000000..f5764a52 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$6.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$6 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$6() {} + static final VarHandle const$0 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); + static final VarHandle const$1 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); + static final VarHandle const$2 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); + static final VarHandle const$3 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); + static final VarHandle const$4 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); + static final VarHandle const$5 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$7.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$7.java new file mode 100644 index 00000000..03bcc49e --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$7.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$7 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$7() {} + static final VarHandle const$0 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); + static final VarHandle const$1 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("__pad1")); + static final VarHandle const$2 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_size")); + static final VarHandle const$3 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); + static final VarHandle const$4 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("__pad2")); + static final VarHandle const$5 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$8.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$8.java new file mode 100644 index 00000000..f88e1dd7 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$8.java @@ -0,0 +1,35 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$8 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$8() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_LONG.withName("f_bsize"), + JAVA_LONG.withName("f_frsize"), + JAVA_LONG.withName("f_blocks"), + JAVA_LONG.withName("f_bfree"), + JAVA_LONG.withName("f_bavail"), + JAVA_LONG.withName("f_files"), + JAVA_LONG.withName("f_ffree"), + JAVA_LONG.withName("f_favail"), + JAVA_LONG.withName("f_fsid"), + JAVA_LONG.withName("f_flag"), + JAVA_LONG.withName("f_namemax"), + MemoryLayout.sequenceLayout(6, JAVA_INT).withName("__f_spare") + ).withName("statvfs"); + static final VarHandle const$1 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); + static final VarHandle const$2 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); + static final VarHandle const$3 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); + static final VarHandle const$4 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); + static final VarHandle const$5 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$9.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$9.java new file mode 100644 index 00000000..05e7d44f --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/constants$9.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$9 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$9() {} + static final VarHandle const$0 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_files")); + static final VarHandle const$1 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); + static final VarHandle const$2 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); + static final VarHandle const$3 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); + static final VarHandle const$4 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); + static final VarHandle const$5 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_args.java similarity index 56% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_args.java index 92d59647..29a132ac 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_args.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -18,19 +18,11 @@ */ public class fuse_args { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("argc"), - MemoryLayout.paddingLayout(32), - Constants$root.C_POINTER$LAYOUT.withName("argv"), - Constants$root.C_INT$LAYOUT.withName("allocated"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_args"); public static MemoryLayout $LAYOUT() { - return fuse_args.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle argc$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argc")); public static VarHandle argc$VH() { - return fuse_args.argc$VH; + return constants$0.const$1; } /** * Getter for field: @@ -39,7 +31,7 @@ public class fuse_args { * } */ public static int argc$get(MemorySegment seg) { - return (int)fuse_args.argc$VH.get(seg); + return (int)constants$0.const$1.get(seg); } /** * Setter for field: @@ -48,17 +40,16 @@ public class fuse_args { * } */ public static void argc$set(MemorySegment seg, int x) { - fuse_args.argc$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { - return (int)fuse_args.argc$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void argc$set(MemorySegment seg, long index, int x) { - fuse_args.argc$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle argv$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argv")); public static VarHandle argv$VH() { - return fuse_args.argv$VH; + return constants$0.const$2; } /** * Getter for field: @@ -67,7 +58,7 @@ public class fuse_args { * } */ public static MemorySegment argv$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg); } /** * Setter for field: @@ -76,17 +67,16 @@ public class fuse_args { * } */ public static void argv$set(MemorySegment seg, MemorySegment x) { - fuse_args.argv$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static MemorySegment argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void argv$set(MemorySegment seg, long index, MemorySegment x) { - fuse_args.argv$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle allocated$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("allocated")); public static VarHandle allocated$VH() { - return fuse_args.allocated$VH; + return constants$0.const$3; } /** * Getter for field: @@ -95,7 +85,7 @@ public class fuse_args { * } */ public static int allocated$get(MemorySegment seg) { - return (int)fuse_args.allocated$VH.get(seg); + return (int)constants$0.const$3.get(seg); } /** * Setter for field: @@ -104,20 +94,20 @@ public class fuse_args { * } */ public static void allocated$set(MemorySegment seg, int x) { - fuse_args.allocated$VH.set(seg, x); + constants$0.const$3.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { - return (int)fuse_args.allocated$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$3.get(seg.asSlice(index*sizeof())); } public static void allocated$set(MemorySegment seg, long index, int x) { - fuse_args.allocated$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_config.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_config.java similarity index 54% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_config.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_config.java index cd68db51..6d6a4bda 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_config.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_config.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -40,41 +40,11 @@ */ public class fuse_config { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("set_gid"), - Constants$root.C_INT$LAYOUT.withName("gid"), - Constants$root.C_INT$LAYOUT.withName("set_uid"), - Constants$root.C_INT$LAYOUT.withName("uid"), - Constants$root.C_INT$LAYOUT.withName("set_mode"), - Constants$root.C_INT$LAYOUT.withName("umask"), - Constants$root.C_DOUBLE$LAYOUT.withName("entry_timeout"), - Constants$root.C_DOUBLE$LAYOUT.withName("negative_timeout"), - Constants$root.C_DOUBLE$LAYOUT.withName("attr_timeout"), - Constants$root.C_INT$LAYOUT.withName("intr"), - Constants$root.C_INT$LAYOUT.withName("intr_signal"), - Constants$root.C_INT$LAYOUT.withName("remember"), - Constants$root.C_INT$LAYOUT.withName("hard_remove"), - Constants$root.C_INT$LAYOUT.withName("use_ino"), - Constants$root.C_INT$LAYOUT.withName("readdir_ino"), - Constants$root.C_INT$LAYOUT.withName("direct_io"), - Constants$root.C_INT$LAYOUT.withName("kernel_cache"), - Constants$root.C_INT$LAYOUT.withName("auto_cache"), - Constants$root.C_INT$LAYOUT.withName("no_rofd_flush"), - Constants$root.C_INT$LAYOUT.withName("ac_attr_timeout_set"), - MemoryLayout.paddingLayout(32), - Constants$root.C_DOUBLE$LAYOUT.withName("ac_attr_timeout"), - Constants$root.C_INT$LAYOUT.withName("nullpath_ok"), - Constants$root.C_INT$LAYOUT.withName("show_help"), - Constants$root.C_POINTER$LAYOUT.withName("modules"), - Constants$root.C_INT$LAYOUT.withName("debug"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_config"); public static MemoryLayout $LAYOUT() { - return fuse_config.$struct$LAYOUT; + return constants$10.const$3; } - static final VarHandle set_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_gid")); public static VarHandle set_gid$VH() { - return fuse_config.set_gid$VH; + return constants$10.const$4; } /** * Getter for field: @@ -83,7 +53,7 @@ public class fuse_config { * } */ public static int set_gid$get(MemorySegment seg) { - return (int)fuse_config.set_gid$VH.get(seg); + return (int)constants$10.const$4.get(seg); } /** * Setter for field: @@ -92,17 +62,16 @@ public class fuse_config { * } */ public static void set_gid$set(MemorySegment seg, int x) { - fuse_config.set_gid$VH.set(seg, x); + constants$10.const$4.set(seg, x); } public static int set_gid$get(MemorySegment seg, long index) { - return (int)fuse_config.set_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$4.get(seg.asSlice(index*sizeof())); } public static void set_gid$set(MemorySegment seg, long index, int x) { - fuse_config.set_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gid")); public static VarHandle gid$VH() { - return fuse_config.gid$VH; + return constants$10.const$5; } /** * Getter for field: @@ -111,7 +80,7 @@ public class fuse_config { * } */ public static int gid$get(MemorySegment seg) { - return (int)fuse_config.gid$VH.get(seg); + return (int)constants$10.const$5.get(seg); } /** * Setter for field: @@ -120,17 +89,16 @@ public class fuse_config { * } */ public static void gid$set(MemorySegment seg, int x) { - fuse_config.gid$VH.set(seg, x); + constants$10.const$5.set(seg, x); } public static int gid$get(MemorySegment seg, long index) { - return (int)fuse_config.gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$5.get(seg.asSlice(index*sizeof())); } public static void gid$set(MemorySegment seg, long index, int x) { - fuse_config.gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle set_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_uid")); public static VarHandle set_uid$VH() { - return fuse_config.set_uid$VH; + return constants$11.const$0; } /** * Getter for field: @@ -139,7 +107,7 @@ public class fuse_config { * } */ public static int set_uid$get(MemorySegment seg) { - return (int)fuse_config.set_uid$VH.get(seg); + return (int)constants$11.const$0.get(seg); } /** * Setter for field: @@ -148,17 +116,16 @@ public class fuse_config { * } */ public static void set_uid$set(MemorySegment seg, int x) { - fuse_config.set_uid$VH.set(seg, x); + constants$11.const$0.set(seg, x); } public static int set_uid$get(MemorySegment seg, long index) { - return (int)fuse_config.set_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$0.get(seg.asSlice(index*sizeof())); } public static void set_uid$set(MemorySegment seg, long index, int x) { - fuse_config.set_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("uid")); public static VarHandle uid$VH() { - return fuse_config.uid$VH; + return constants$11.const$1; } /** * Getter for field: @@ -167,7 +134,7 @@ public class fuse_config { * } */ public static int uid$get(MemorySegment seg) { - return (int)fuse_config.uid$VH.get(seg); + return (int)constants$11.const$1.get(seg); } /** * Setter for field: @@ -176,17 +143,16 @@ public class fuse_config { * } */ public static void uid$set(MemorySegment seg, int x) { - fuse_config.uid$VH.set(seg, x); + constants$11.const$1.set(seg, x); } public static int uid$get(MemorySegment seg, long index) { - return (int)fuse_config.uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$1.get(seg.asSlice(index*sizeof())); } public static void uid$set(MemorySegment seg, long index, int x) { - fuse_config.uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle set_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_mode")); public static VarHandle set_mode$VH() { - return fuse_config.set_mode$VH; + return constants$11.const$2; } /** * Getter for field: @@ -195,7 +161,7 @@ public class fuse_config { * } */ public static int set_mode$get(MemorySegment seg) { - return (int)fuse_config.set_mode$VH.get(seg); + return (int)constants$11.const$2.get(seg); } /** * Setter for field: @@ -204,17 +170,16 @@ public class fuse_config { * } */ public static void set_mode$set(MemorySegment seg, int x) { - fuse_config.set_mode$VH.set(seg, x); + constants$11.const$2.set(seg, x); } public static int set_mode$get(MemorySegment seg, long index) { - return (int)fuse_config.set_mode$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$2.get(seg.asSlice(index*sizeof())); } public static void set_mode$set(MemorySegment seg, long index, int x) { - fuse_config.set_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle umask$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("umask")); public static VarHandle umask$VH() { - return fuse_config.umask$VH; + return constants$11.const$3; } /** * Getter for field: @@ -223,7 +188,7 @@ public class fuse_config { * } */ public static int umask$get(MemorySegment seg) { - return (int)fuse_config.umask$VH.get(seg); + return (int)constants$11.const$3.get(seg); } /** * Setter for field: @@ -232,17 +197,16 @@ public class fuse_config { * } */ public static void umask$set(MemorySegment seg, int x) { - fuse_config.umask$VH.set(seg, x); + constants$11.const$3.set(seg, x); } public static int umask$get(MemorySegment seg, long index) { - return (int)fuse_config.umask$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$3.get(seg.asSlice(index*sizeof())); } public static void umask$set(MemorySegment seg, long index, int x) { - fuse_config.umask$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle entry_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("entry_timeout")); public static VarHandle entry_timeout$VH() { - return fuse_config.entry_timeout$VH; + return constants$11.const$4; } /** * Getter for field: @@ -251,7 +215,7 @@ public class fuse_config { * } */ public static double entry_timeout$get(MemorySegment seg) { - return (double)fuse_config.entry_timeout$VH.get(seg); + return (double)constants$11.const$4.get(seg); } /** * Setter for field: @@ -260,17 +224,16 @@ public class fuse_config { * } */ public static void entry_timeout$set(MemorySegment seg, double x) { - fuse_config.entry_timeout$VH.set(seg, x); + constants$11.const$4.set(seg, x); } public static double entry_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.entry_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$11.const$4.get(seg.asSlice(index*sizeof())); } public static void entry_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.entry_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle negative_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("negative_timeout")); public static VarHandle negative_timeout$VH() { - return fuse_config.negative_timeout$VH; + return constants$11.const$5; } /** * Getter for field: @@ -279,7 +242,7 @@ public class fuse_config { * } */ public static double negative_timeout$get(MemorySegment seg) { - return (double)fuse_config.negative_timeout$VH.get(seg); + return (double)constants$11.const$5.get(seg); } /** * Setter for field: @@ -288,17 +251,16 @@ public class fuse_config { * } */ public static void negative_timeout$set(MemorySegment seg, double x) { - fuse_config.negative_timeout$VH.set(seg, x); + constants$11.const$5.set(seg, x); } public static double negative_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.negative_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$11.const$5.get(seg.asSlice(index*sizeof())); } public static void negative_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.negative_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle attr_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("attr_timeout")); public static VarHandle attr_timeout$VH() { - return fuse_config.attr_timeout$VH; + return constants$12.const$0; } /** * Getter for field: @@ -307,7 +269,7 @@ public class fuse_config { * } */ public static double attr_timeout$get(MemorySegment seg) { - return (double)fuse_config.attr_timeout$VH.get(seg); + return (double)constants$12.const$0.get(seg); } /** * Setter for field: @@ -316,17 +278,16 @@ public class fuse_config { * } */ public static void attr_timeout$set(MemorySegment seg, double x) { - fuse_config.attr_timeout$VH.set(seg, x); + constants$12.const$0.set(seg, x); } public static double attr_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.attr_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$12.const$0.get(seg.asSlice(index*sizeof())); } public static void attr_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.attr_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle intr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("intr")); public static VarHandle intr$VH() { - return fuse_config.intr$VH; + return constants$12.const$1; } /** * Getter for field: @@ -335,7 +296,7 @@ public class fuse_config { * } */ public static int intr$get(MemorySegment seg) { - return (int)fuse_config.intr$VH.get(seg); + return (int)constants$12.const$1.get(seg); } /** * Setter for field: @@ -344,17 +305,16 @@ public class fuse_config { * } */ public static void intr$set(MemorySegment seg, int x) { - fuse_config.intr$VH.set(seg, x); + constants$12.const$1.set(seg, x); } public static int intr$get(MemorySegment seg, long index) { - return (int)fuse_config.intr$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$1.get(seg.asSlice(index*sizeof())); } public static void intr$set(MemorySegment seg, long index, int x) { - fuse_config.intr$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle intr_signal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("intr_signal")); public static VarHandle intr_signal$VH() { - return fuse_config.intr_signal$VH; + return constants$12.const$2; } /** * Getter for field: @@ -363,7 +323,7 @@ public class fuse_config { * } */ public static int intr_signal$get(MemorySegment seg) { - return (int)fuse_config.intr_signal$VH.get(seg); + return (int)constants$12.const$2.get(seg); } /** * Setter for field: @@ -372,17 +332,16 @@ public class fuse_config { * } */ public static void intr_signal$set(MemorySegment seg, int x) { - fuse_config.intr_signal$VH.set(seg, x); + constants$12.const$2.set(seg, x); } public static int intr_signal$get(MemorySegment seg, long index) { - return (int)fuse_config.intr_signal$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$2.get(seg.asSlice(index*sizeof())); } public static void intr_signal$set(MemorySegment seg, long index, int x) { - fuse_config.intr_signal$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle remember$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("remember")); public static VarHandle remember$VH() { - return fuse_config.remember$VH; + return constants$12.const$3; } /** * Getter for field: @@ -391,7 +350,7 @@ public class fuse_config { * } */ public static int remember$get(MemorySegment seg) { - return (int)fuse_config.remember$VH.get(seg); + return (int)constants$12.const$3.get(seg); } /** * Setter for field: @@ -400,17 +359,16 @@ public class fuse_config { * } */ public static void remember$set(MemorySegment seg, int x) { - fuse_config.remember$VH.set(seg, x); + constants$12.const$3.set(seg, x); } public static int remember$get(MemorySegment seg, long index) { - return (int)fuse_config.remember$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$3.get(seg.asSlice(index*sizeof())); } public static void remember$set(MemorySegment seg, long index, int x) { - fuse_config.remember$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle hard_remove$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hard_remove")); public static VarHandle hard_remove$VH() { - return fuse_config.hard_remove$VH; + return constants$12.const$4; } /** * Getter for field: @@ -419,7 +377,7 @@ public class fuse_config { * } */ public static int hard_remove$get(MemorySegment seg) { - return (int)fuse_config.hard_remove$VH.get(seg); + return (int)constants$12.const$4.get(seg); } /** * Setter for field: @@ -428,17 +386,16 @@ public class fuse_config { * } */ public static void hard_remove$set(MemorySegment seg, int x) { - fuse_config.hard_remove$VH.set(seg, x); + constants$12.const$4.set(seg, x); } public static int hard_remove$get(MemorySegment seg, long index) { - return (int)fuse_config.hard_remove$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$4.get(seg.asSlice(index*sizeof())); } public static void hard_remove$set(MemorySegment seg, long index, int x) { - fuse_config.hard_remove$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle use_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("use_ino")); public static VarHandle use_ino$VH() { - return fuse_config.use_ino$VH; + return constants$12.const$5; } /** * Getter for field: @@ -447,7 +404,7 @@ public class fuse_config { * } */ public static int use_ino$get(MemorySegment seg) { - return (int)fuse_config.use_ino$VH.get(seg); + return (int)constants$12.const$5.get(seg); } /** * Setter for field: @@ -456,17 +413,16 @@ public class fuse_config { * } */ public static void use_ino$set(MemorySegment seg, int x) { - fuse_config.use_ino$VH.set(seg, x); + constants$12.const$5.set(seg, x); } public static int use_ino$get(MemorySegment seg, long index) { - return (int)fuse_config.use_ino$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$5.get(seg.asSlice(index*sizeof())); } public static void use_ino$set(MemorySegment seg, long index, int x) { - fuse_config.use_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle readdir_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir_ino")); public static VarHandle readdir_ino$VH() { - return fuse_config.readdir_ino$VH; + return constants$13.const$0; } /** * Getter for field: @@ -475,7 +431,7 @@ public class fuse_config { * } */ public static int readdir_ino$get(MemorySegment seg) { - return (int)fuse_config.readdir_ino$VH.get(seg); + return (int)constants$13.const$0.get(seg); } /** * Setter for field: @@ -484,17 +440,16 @@ public class fuse_config { * } */ public static void readdir_ino$set(MemorySegment seg, int x) { - fuse_config.readdir_ino$VH.set(seg, x); + constants$13.const$0.set(seg, x); } public static int readdir_ino$get(MemorySegment seg, long index) { - return (int)fuse_config.readdir_ino$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$0.get(seg.asSlice(index*sizeof())); } public static void readdir_ino$set(MemorySegment seg, long index, int x) { - fuse_config.readdir_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle direct_io$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("direct_io")); public static VarHandle direct_io$VH() { - return fuse_config.direct_io$VH; + return constants$13.const$1; } /** * Getter for field: @@ -503,7 +458,7 @@ public class fuse_config { * } */ public static int direct_io$get(MemorySegment seg) { - return (int)fuse_config.direct_io$VH.get(seg); + return (int)constants$13.const$1.get(seg); } /** * Setter for field: @@ -512,17 +467,16 @@ public class fuse_config { * } */ public static void direct_io$set(MemorySegment seg, int x) { - fuse_config.direct_io$VH.set(seg, x); + constants$13.const$1.set(seg, x); } public static int direct_io$get(MemorySegment seg, long index) { - return (int)fuse_config.direct_io$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$1.get(seg.asSlice(index*sizeof())); } public static void direct_io$set(MemorySegment seg, long index, int x) { - fuse_config.direct_io$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle kernel_cache$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("kernel_cache")); public static VarHandle kernel_cache$VH() { - return fuse_config.kernel_cache$VH; + return constants$13.const$2; } /** * Getter for field: @@ -531,7 +485,7 @@ public class fuse_config { * } */ public static int kernel_cache$get(MemorySegment seg) { - return (int)fuse_config.kernel_cache$VH.get(seg); + return (int)constants$13.const$2.get(seg); } /** * Setter for field: @@ -540,17 +494,16 @@ public class fuse_config { * } */ public static void kernel_cache$set(MemorySegment seg, int x) { - fuse_config.kernel_cache$VH.set(seg, x); + constants$13.const$2.set(seg, x); } public static int kernel_cache$get(MemorySegment seg, long index) { - return (int)fuse_config.kernel_cache$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$2.get(seg.asSlice(index*sizeof())); } public static void kernel_cache$set(MemorySegment seg, long index, int x) { - fuse_config.kernel_cache$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle auto_cache$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("auto_cache")); public static VarHandle auto_cache$VH() { - return fuse_config.auto_cache$VH; + return constants$13.const$3; } /** * Getter for field: @@ -559,7 +512,7 @@ public class fuse_config { * } */ public static int auto_cache$get(MemorySegment seg) { - return (int)fuse_config.auto_cache$VH.get(seg); + return (int)constants$13.const$3.get(seg); } /** * Setter for field: @@ -568,17 +521,16 @@ public class fuse_config { * } */ public static void auto_cache$set(MemorySegment seg, int x) { - fuse_config.auto_cache$VH.set(seg, x); + constants$13.const$3.set(seg, x); } public static int auto_cache$get(MemorySegment seg, long index) { - return (int)fuse_config.auto_cache$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$3.get(seg.asSlice(index*sizeof())); } public static void auto_cache$set(MemorySegment seg, long index, int x) { - fuse_config.auto_cache$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle no_rofd_flush$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("no_rofd_flush")); public static VarHandle no_rofd_flush$VH() { - return fuse_config.no_rofd_flush$VH; + return constants$13.const$4; } /** * Getter for field: @@ -587,7 +539,7 @@ public class fuse_config { * } */ public static int no_rofd_flush$get(MemorySegment seg) { - return (int)fuse_config.no_rofd_flush$VH.get(seg); + return (int)constants$13.const$4.get(seg); } /** * Setter for field: @@ -596,17 +548,16 @@ public class fuse_config { * } */ public static void no_rofd_flush$set(MemorySegment seg, int x) { - fuse_config.no_rofd_flush$VH.set(seg, x); + constants$13.const$4.set(seg, x); } public static int no_rofd_flush$get(MemorySegment seg, long index) { - return (int)fuse_config.no_rofd_flush$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$4.get(seg.asSlice(index*sizeof())); } public static void no_rofd_flush$set(MemorySegment seg, long index, int x) { - fuse_config.no_rofd_flush$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle ac_attr_timeout_set$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout_set")); public static VarHandle ac_attr_timeout_set$VH() { - return fuse_config.ac_attr_timeout_set$VH; + return constants$13.const$5; } /** * Getter for field: @@ -615,7 +566,7 @@ public class fuse_config { * } */ public static int ac_attr_timeout_set$get(MemorySegment seg) { - return (int)fuse_config.ac_attr_timeout_set$VH.get(seg); + return (int)constants$13.const$5.get(seg); } /** * Setter for field: @@ -624,17 +575,16 @@ public class fuse_config { * } */ public static void ac_attr_timeout_set$set(MemorySegment seg, int x) { - fuse_config.ac_attr_timeout_set$VH.set(seg, x); + constants$13.const$5.set(seg, x); } public static int ac_attr_timeout_set$get(MemorySegment seg, long index) { - return (int)fuse_config.ac_attr_timeout_set$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$5.get(seg.asSlice(index*sizeof())); } public static void ac_attr_timeout_set$set(MemorySegment seg, long index, int x) { - fuse_config.ac_attr_timeout_set$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle ac_attr_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout")); public static VarHandle ac_attr_timeout$VH() { - return fuse_config.ac_attr_timeout$VH; + return constants$14.const$0; } /** * Getter for field: @@ -643,7 +593,7 @@ public class fuse_config { * } */ public static double ac_attr_timeout$get(MemorySegment seg) { - return (double)fuse_config.ac_attr_timeout$VH.get(seg); + return (double)constants$14.const$0.get(seg); } /** * Setter for field: @@ -652,17 +602,16 @@ public class fuse_config { * } */ public static void ac_attr_timeout$set(MemorySegment seg, double x) { - fuse_config.ac_attr_timeout$VH.set(seg, x); + constants$14.const$0.set(seg, x); } public static double ac_attr_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.ac_attr_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$14.const$0.get(seg.asSlice(index*sizeof())); } public static void ac_attr_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.ac_attr_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle nullpath_ok$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("nullpath_ok")); public static VarHandle nullpath_ok$VH() { - return fuse_config.nullpath_ok$VH; + return constants$14.const$1; } /** * Getter for field: @@ -671,7 +620,7 @@ public class fuse_config { * } */ public static int nullpath_ok$get(MemorySegment seg) { - return (int)fuse_config.nullpath_ok$VH.get(seg); + return (int)constants$14.const$1.get(seg); } /** * Setter for field: @@ -680,17 +629,16 @@ public class fuse_config { * } */ public static void nullpath_ok$set(MemorySegment seg, int x) { - fuse_config.nullpath_ok$VH.set(seg, x); + constants$14.const$1.set(seg, x); } public static int nullpath_ok$get(MemorySegment seg, long index) { - return (int)fuse_config.nullpath_ok$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$14.const$1.get(seg.asSlice(index*sizeof())); } public static void nullpath_ok$set(MemorySegment seg, long index, int x) { - fuse_config.nullpath_ok$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_help$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_help")); public static VarHandle show_help$VH() { - return fuse_config.show_help$VH; + return constants$14.const$2; } /** * Getter for field: @@ -699,7 +647,7 @@ public class fuse_config { * } */ public static int show_help$get(MemorySegment seg) { - return (int)fuse_config.show_help$VH.get(seg); + return (int)constants$14.const$2.get(seg); } /** * Setter for field: @@ -708,17 +656,16 @@ public class fuse_config { * } */ public static void show_help$set(MemorySegment seg, int x) { - fuse_config.show_help$VH.set(seg, x); + constants$14.const$2.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { - return (int)fuse_config.show_help$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$14.const$2.get(seg.asSlice(index*sizeof())); } public static void show_help$set(MemorySegment seg, long index, int x) { - fuse_config.show_help$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle modules$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("modules")); public static VarHandle modules$VH() { - return fuse_config.modules$VH; + return constants$14.const$3; } /** * Getter for field: @@ -727,7 +674,7 @@ public class fuse_config { * } */ public static MemorySegment modules$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$14.const$3.get(seg); } /** * Setter for field: @@ -736,17 +683,16 @@ public class fuse_config { * } */ public static void modules$set(MemorySegment seg, MemorySegment x) { - fuse_config.modules$VH.set(seg, x); + constants$14.const$3.set(seg, x); } public static MemorySegment modules$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$14.const$3.get(seg.asSlice(index*sizeof())); } public static void modules$set(MemorySegment seg, long index, MemorySegment x) { - fuse_config.modules$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle debug$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("debug")); public static VarHandle debug$VH() { - return fuse_config.debug$VH; + return constants$14.const$4; } /** * Getter for field: @@ -755,7 +701,7 @@ public class fuse_config { * } */ public static int debug$get(MemorySegment seg) { - return (int)fuse_config.debug$VH.get(seg); + return (int)constants$14.const$4.get(seg); } /** * Setter for field: @@ -764,20 +710,20 @@ public class fuse_config { * } */ public static void debug$set(MemorySegment seg, int x) { - fuse_config.debug$VH.set(seg, x); + constants$14.const$4.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { - return (int)fuse_config.debug$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$14.const$4.get(seg.asSlice(index*sizeof())); } public static void debug$set(MemorySegment seg, long index, int x) { - fuse_config.debug$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$4.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_conn_info.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_conn_info.java similarity index 55% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_conn_info.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_conn_info.java index 7cbbeb6f..c09c54e8 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_conn_info.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_conn_info.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,25 +26,11 @@ */ public class fuse_conn_info { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("proto_major"), - Constants$root.C_INT$LAYOUT.withName("proto_minor"), - Constants$root.C_INT$LAYOUT.withName("max_write"), - Constants$root.C_INT$LAYOUT.withName("max_read"), - Constants$root.C_INT$LAYOUT.withName("max_readahead"), - Constants$root.C_INT$LAYOUT.withName("capable"), - Constants$root.C_INT$LAYOUT.withName("want"), - Constants$root.C_INT$LAYOUT.withName("max_background"), - Constants$root.C_INT$LAYOUT.withName("congestion_threshold"), - Constants$root.C_INT$LAYOUT.withName("time_gran"), - MemoryLayout.sequenceLayout(22, Constants$root.C_INT$LAYOUT).withName("reserved") - ).withName("fuse_conn_info"); public static MemoryLayout $LAYOUT() { - return fuse_conn_info.$struct$LAYOUT; + return constants$2.const$3; } - static final VarHandle proto_major$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); public static VarHandle proto_major$VH() { - return fuse_conn_info.proto_major$VH; + return constants$2.const$4; } /** * Getter for field: @@ -53,7 +39,7 @@ public class fuse_conn_info { * } */ public static int proto_major$get(MemorySegment seg) { - return (int)fuse_conn_info.proto_major$VH.get(seg); + return (int)constants$2.const$4.get(seg); } /** * Setter for field: @@ -62,17 +48,16 @@ public class fuse_conn_info { * } */ public static void proto_major$set(MemorySegment seg, int x) { - fuse_conn_info.proto_major$VH.set(seg, x); + constants$2.const$4.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.proto_major$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$4.get(seg.asSlice(index*sizeof())); } public static void proto_major$set(MemorySegment seg, long index, int x) { - fuse_conn_info.proto_major$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle proto_minor$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); public static VarHandle proto_minor$VH() { - return fuse_conn_info.proto_minor$VH; + return constants$2.const$5; } /** * Getter for field: @@ -81,7 +66,7 @@ public class fuse_conn_info { * } */ public static int proto_minor$get(MemorySegment seg) { - return (int)fuse_conn_info.proto_minor$VH.get(seg); + return (int)constants$2.const$5.get(seg); } /** * Setter for field: @@ -90,17 +75,16 @@ public class fuse_conn_info { * } */ public static void proto_minor$set(MemorySegment seg, int x) { - fuse_conn_info.proto_minor$VH.set(seg, x); + constants$2.const$5.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.proto_minor$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$5.get(seg.asSlice(index*sizeof())); } public static void proto_minor$set(MemorySegment seg, long index, int x) { - fuse_conn_info.proto_minor$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_write")); public static VarHandle max_write$VH() { - return fuse_conn_info.max_write$VH; + return constants$3.const$0; } /** * Getter for field: @@ -109,7 +93,7 @@ public class fuse_conn_info { * } */ public static int max_write$get(MemorySegment seg) { - return (int)fuse_conn_info.max_write$VH.get(seg); + return (int)constants$3.const$0.get(seg); } /** * Setter for field: @@ -118,17 +102,16 @@ public class fuse_conn_info { * } */ public static void max_write$set(MemorySegment seg, int x) { - fuse_conn_info.max_write$VH.set(seg, x); + constants$3.const$0.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_write$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$0.get(seg.asSlice(index*sizeof())); } public static void max_write$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_write$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_read")); public static VarHandle max_read$VH() { - return fuse_conn_info.max_read$VH; + return constants$3.const$1; } /** * Getter for field: @@ -137,7 +120,7 @@ public class fuse_conn_info { * } */ public static int max_read$get(MemorySegment seg) { - return (int)fuse_conn_info.max_read$VH.get(seg); + return (int)constants$3.const$1.get(seg); } /** * Setter for field: @@ -146,17 +129,16 @@ public class fuse_conn_info { * } */ public static void max_read$set(MemorySegment seg, int x) { - fuse_conn_info.max_read$VH.set(seg, x); + constants$3.const$1.set(seg, x); } public static int max_read$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_read$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$1.get(seg.asSlice(index*sizeof())); } public static void max_read$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_read$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_readahead$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); public static VarHandle max_readahead$VH() { - return fuse_conn_info.max_readahead$VH; + return constants$3.const$2; } /** * Getter for field: @@ -165,7 +147,7 @@ public class fuse_conn_info { * } */ public static int max_readahead$get(MemorySegment seg) { - return (int)fuse_conn_info.max_readahead$VH.get(seg); + return (int)constants$3.const$2.get(seg); } /** * Setter for field: @@ -174,17 +156,16 @@ public class fuse_conn_info { * } */ public static void max_readahead$set(MemorySegment seg, int x) { - fuse_conn_info.max_readahead$VH.set(seg, x); + constants$3.const$2.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_readahead$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$2.get(seg.asSlice(index*sizeof())); } public static void max_readahead$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_readahead$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle capable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("capable")); public static VarHandle capable$VH() { - return fuse_conn_info.capable$VH; + return constants$3.const$3; } /** * Getter for field: @@ -193,7 +174,7 @@ public class fuse_conn_info { * } */ public static int capable$get(MemorySegment seg) { - return (int)fuse_conn_info.capable$VH.get(seg); + return (int)constants$3.const$3.get(seg); } /** * Setter for field: @@ -202,17 +183,16 @@ public class fuse_conn_info { * } */ public static void capable$set(MemorySegment seg, int x) { - fuse_conn_info.capable$VH.set(seg, x); + constants$3.const$3.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.capable$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$3.get(seg.asSlice(index*sizeof())); } public static void capable$set(MemorySegment seg, long index, int x) { - fuse_conn_info.capable$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle want$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("want")); public static VarHandle want$VH() { - return fuse_conn_info.want$VH; + return constants$3.const$4; } /** * Getter for field: @@ -221,7 +201,7 @@ public class fuse_conn_info { * } */ public static int want$get(MemorySegment seg) { - return (int)fuse_conn_info.want$VH.get(seg); + return (int)constants$3.const$4.get(seg); } /** * Setter for field: @@ -230,17 +210,16 @@ public class fuse_conn_info { * } */ public static void want$set(MemorySegment seg, int x) { - fuse_conn_info.want$VH.set(seg, x); + constants$3.const$4.set(seg, x); } public static int want$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.want$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$4.get(seg.asSlice(index*sizeof())); } public static void want$set(MemorySegment seg, long index, int x) { - fuse_conn_info.want$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_background$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_background")); public static VarHandle max_background$VH() { - return fuse_conn_info.max_background$VH; + return constants$3.const$5; } /** * Getter for field: @@ -249,7 +228,7 @@ public class fuse_conn_info { * } */ public static int max_background$get(MemorySegment seg) { - return (int)fuse_conn_info.max_background$VH.get(seg); + return (int)constants$3.const$5.get(seg); } /** * Setter for field: @@ -258,17 +237,16 @@ public class fuse_conn_info { * } */ public static void max_background$set(MemorySegment seg, int x) { - fuse_conn_info.max_background$VH.set(seg, x); + constants$3.const$5.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_background$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$5.get(seg.asSlice(index*sizeof())); } public static void max_background$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_background$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle congestion_threshold$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); public static VarHandle congestion_threshold$VH() { - return fuse_conn_info.congestion_threshold$VH; + return constants$4.const$0; } /** * Getter for field: @@ -277,7 +255,7 @@ public class fuse_conn_info { * } */ public static int congestion_threshold$get(MemorySegment seg) { - return (int)fuse_conn_info.congestion_threshold$VH.get(seg); + return (int)constants$4.const$0.get(seg); } /** * Setter for field: @@ -286,17 +264,16 @@ public class fuse_conn_info { * } */ public static void congestion_threshold$set(MemorySegment seg, int x) { - fuse_conn_info.congestion_threshold$VH.set(seg, x); + constants$4.const$0.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.congestion_threshold$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$4.const$0.get(seg.asSlice(index*sizeof())); } public static void congestion_threshold$set(MemorySegment seg, long index, int x) { - fuse_conn_info.congestion_threshold$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle time_gran$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("time_gran")); public static VarHandle time_gran$VH() { - return fuse_conn_info.time_gran$VH; + return constants$4.const$1; } /** * Getter for field: @@ -305,7 +282,7 @@ public class fuse_conn_info { * } */ public static int time_gran$get(MemorySegment seg) { - return (int)fuse_conn_info.time_gran$VH.get(seg); + return (int)constants$4.const$1.get(seg); } /** * Setter for field: @@ -314,13 +291,13 @@ public class fuse_conn_info { * } */ public static void time_gran$set(MemorySegment seg, int x) { - fuse_conn_info.time_gran$VH.set(seg, x); + constants$4.const$1.set(seg, x); } public static int time_gran$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.time_gran$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$4.const$1.get(seg.asSlice(index*sizeof())); } public static void time_gran$set(MemorySegment seg, long index, int x) { - fuse_conn_info.time_gran$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$1.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment reserved$slice(MemorySegment seg) { return seg.asSlice(40, 88); @@ -330,7 +307,7 @@ public class fuse_conn_info { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_file_info.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_file_info.java new file mode 100644 index 00000000..c70836fb --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_file_info.java @@ -0,0 +1,151 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_file_info { + * int flags; + * * unsigned int writepage; + * unsigned int direct_io; + * unsigned int keep_cache; + * unsigned int flush; + * unsigned int nonseekable; + * unsigned int flock_release; + * unsigned int cache_readdir; + * unsigned int noflush; + * unsigned int padding; + * unsigned int padding2; + * unsigned long fh; + * unsigned long lock_owner; + * unsigned int poll_events; + * }; + * } + */ +public class fuse_file_info { + + public static MemoryLayout $LAYOUT() { + return constants$1.const$1; + } + public static VarHandle flags$VH() { + return constants$1.const$2; + } + /** + * Getter for field: + * {@snippet : + * int flags; + * } + */ + public static int flags$get(MemorySegment seg) { + return (int)constants$1.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int flags; + * } + */ + public static void flags$set(MemorySegment seg, int x) { + constants$1.const$2.set(seg, x); + } + public static int flags$get(MemorySegment seg, long index) { + return (int)constants$1.const$2.get(seg.asSlice(index*sizeof())); + } + public static void flags$set(MemorySegment seg, long index, int x) { + constants$1.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static VarHandle fh$VH() { + return constants$1.const$3; + } + /** + * Getter for field: + * {@snippet : + * unsigned long fh; + * } + */ + public static long fh$get(MemorySegment seg) { + return (long)constants$1.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned long fh; + * } + */ + public static void fh$set(MemorySegment seg, long x) { + constants$1.const$3.set(seg, x); + } + public static long fh$get(MemorySegment seg, long index) { + return (long)constants$1.const$3.get(seg.asSlice(index*sizeof())); + } + public static void fh$set(MemorySegment seg, long index, long x) { + constants$1.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static VarHandle lock_owner$VH() { + return constants$1.const$4; + } + /** + * Getter for field: + * {@snippet : + * unsigned long lock_owner; + * } + */ + public static long lock_owner$get(MemorySegment seg) { + return (long)constants$1.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned long lock_owner; + * } + */ + public static void lock_owner$set(MemorySegment seg, long x) { + constants$1.const$4.set(seg, x); + } + public static long lock_owner$get(MemorySegment seg, long index) { + return (long)constants$1.const$4.get(seg.asSlice(index*sizeof())); + } + public static void lock_owner$set(MemorySegment seg, long index, long x) { + constants$1.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static VarHandle poll_events$VH() { + return constants$1.const$5; + } + /** + * Getter for field: + * {@snippet : + * unsigned int poll_events; + * } + */ + public static int poll_events$get(MemorySegment seg) { + return (int)constants$1.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int poll_events; + * } + */ + public static void poll_events$set(MemorySegment seg, int x) { + constants$1.const$5.set(seg, x); + } + public static int poll_events$get(MemorySegment seg, long index) { + return (int)constants$1.const$5.get(seg.asSlice(index*sizeof())); + } + public static void poll_events$set(MemorySegment seg, long index, int x) { + constants$1.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_fill_dir_t.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_fill_dir_t.java similarity index 62% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_fill_dir_t.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_fill_dir_t.java index 1468d8e5..8c869235 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_fill_dir_t.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_fill_dir_t.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -15,14 +15,14 @@ public interface fuse_fill_dir_t { int apply(java.lang.foreign.MemorySegment buf, java.lang.foreign.MemorySegment name, java.lang.foreign.MemorySegment stbuf, long off, int flags); - static MemorySegment allocate(fuse_fill_dir_t fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fuse_fill_dir_t.class, fi, constants$0.fuse_fill_dir_t$FUNC, scope); + static MemorySegment allocate(fuse_fill_dir_t fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$10.const$1, fi, constants$10.const$0, scope); } - static fuse_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + static fuse_fill_dir_t ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); return (java.lang.foreign.MemorySegment _buf, java.lang.foreign.MemorySegment _name, java.lang.foreign.MemorySegment _stbuf, long _off, int _flags) -> { try { - return (int)constants$1.fuse_fill_dir_t$MH.invokeExact(symbol, _buf, _name, _stbuf, _off, _flags); + return (int)constants$10.const$2.invokeExact(symbol, _buf, _name, _stbuf, _off, _flags); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_h.java similarity index 76% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_h.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_h.java index 59babf88..75f5107e 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,16 +9,16 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; public static MethodHandle fuse_version$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_version$MH,"fuse_version"); + return RuntimeHelper.requireNonNull(constants$4.const$3,"fuse_version"); } /** * {@snippet : @@ -34,7 +34,7 @@ public static int fuse_version() { } } public static MethodHandle fuse_loop_cfg_create$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_create$MH,"fuse_loop_cfg_create"); + return RuntimeHelper.requireNonNull(constants$4.const$5,"fuse_loop_cfg_create"); } /** * {@snippet : @@ -50,7 +50,7 @@ public static MemorySegment fuse_loop_cfg_create() { } } public static MethodHandle fuse_loop_cfg_destroy$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_destroy$MH,"fuse_loop_cfg_destroy"); + return RuntimeHelper.requireNonNull(constants$5.const$1,"fuse_loop_cfg_destroy"); } /** * {@snippet : @@ -66,7 +66,7 @@ public static void fuse_loop_cfg_destroy(MemorySegment config) { } } public static MethodHandle fuse_loop_cfg_set_max_threads$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_set_max_threads$MH,"fuse_loop_cfg_set_max_threads"); + return RuntimeHelper.requireNonNull(constants$5.const$3,"fuse_loop_cfg_set_max_threads"); } /** * {@snippet : @@ -82,7 +82,7 @@ public static void fuse_loop_cfg_set_max_threads(MemorySegment config, int value } } public static MethodHandle fuse_loop_cfg_set_clone_fd$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_set_clone_fd$MH,"fuse_loop_cfg_set_clone_fd"); + return RuntimeHelper.requireNonNull(constants$5.const$4,"fuse_loop_cfg_set_clone_fd"); } /** * {@snippet : @@ -98,7 +98,7 @@ public static void fuse_loop_cfg_set_clone_fd(MemorySegment config, int value) { } } public static MethodHandle fuse_lib_help$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_lib_help$MH,"fuse_lib_help"); + return RuntimeHelper.requireNonNull(constants$36.const$1,"fuse_lib_help"); } /** * {@snippet : @@ -114,11 +114,11 @@ public static void fuse_lib_help(MemorySegment args) { } } public static MethodHandle fuse_new$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_new$MH,"fuse_new"); + return RuntimeHelper.requireNonNull(constants$36.const$3,"fuse_new"); } /** * {@snippet : - * struct fuse* fuse_new(struct fuse_args* args, struct fuse_operations* op, size_t op_size, void* private_data); + * struct fuse* fuse_new(struct fuse_args* args, struct fuse_operations* op, unsigned long op_size, void* private_data); * } */ public static MemorySegment fuse_new(MemorySegment args, MemorySegment op, long op_size, MemorySegment private_data) { @@ -130,7 +130,7 @@ public static MemorySegment fuse_new(MemorySegment args, MemorySegment op, long } } public static MethodHandle fuse_mount$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_mount$MH,"fuse_mount"); + return RuntimeHelper.requireNonNull(constants$36.const$4,"fuse_mount"); } /** * {@snippet : @@ -146,7 +146,7 @@ public static int fuse_mount(MemorySegment f, MemorySegment mountpoint) { } } public static MethodHandle fuse_unmount$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_unmount$MH,"fuse_unmount"); + return RuntimeHelper.requireNonNull(constants$36.const$5,"fuse_unmount"); } /** * {@snippet : @@ -162,7 +162,7 @@ public static void fuse_unmount(MemorySegment f) { } } public static MethodHandle fuse_destroy$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_destroy$MH,"fuse_destroy"); + return RuntimeHelper.requireNonNull(constants$37.const$0,"fuse_destroy"); } /** * {@snippet : @@ -178,7 +178,7 @@ public static void fuse_destroy(MemorySegment f) { } } public static MethodHandle fuse_loop$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_loop$MH,"fuse_loop"); + return RuntimeHelper.requireNonNull(constants$37.const$1,"fuse_loop"); } /** * {@snippet : @@ -194,7 +194,7 @@ public static int fuse_loop(MemorySegment f) { } } public static MethodHandle fuse_exit$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_exit$MH,"fuse_exit"); + return RuntimeHelper.requireNonNull(constants$37.const$2,"fuse_exit"); } /** * {@snippet : @@ -210,7 +210,7 @@ public static void fuse_exit(MemorySegment f) { } } public static MethodHandle fuse_loop_mt$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_loop_mt$MH,"fuse_loop_mt"); + return RuntimeHelper.requireNonNull(constants$37.const$3,"fuse_loop_mt"); } /** * {@snippet : @@ -226,7 +226,7 @@ public static int fuse_loop_mt(MemorySegment f, MemorySegment config) { } } public static MethodHandle fuse_get_session$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_get_session$MH,"fuse_get_session"); + return RuntimeHelper.requireNonNull(constants$37.const$5,"fuse_get_session"); } /** * {@snippet : diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_loop_config_v1.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_loop_config_v1.java similarity index 56% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_loop_config_v1.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_loop_config_v1.java index 4414356b..cb426eca 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_loop_config_v1.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_loop_config_v1.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -17,16 +17,11 @@ */ public class fuse_loop_config_v1 { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("clone_fd"), - Constants$root.C_INT$LAYOUT.withName("max_idle_threads") - ).withName("fuse_loop_config_v1"); public static MemoryLayout $LAYOUT() { - return fuse_loop_config_v1.$struct$LAYOUT; + return constants$2.const$0; } - static final VarHandle clone_fd$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); public static VarHandle clone_fd$VH() { - return fuse_loop_config_v1.clone_fd$VH; + return constants$2.const$1; } /** * Getter for field: @@ -35,7 +30,7 @@ public class fuse_loop_config_v1 { * } */ public static int clone_fd$get(MemorySegment seg) { - return (int)fuse_loop_config_v1.clone_fd$VH.get(seg); + return (int)constants$2.const$1.get(seg); } /** * Setter for field: @@ -44,17 +39,16 @@ public class fuse_loop_config_v1 { * } */ public static void clone_fd$set(MemorySegment seg, int x) { - fuse_loop_config_v1.clone_fd$VH.set(seg, x); + constants$2.const$1.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { - return (int)fuse_loop_config_v1.clone_fd$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$1.get(seg.asSlice(index*sizeof())); } public static void clone_fd$set(MemorySegment seg, long index, int x) { - fuse_loop_config_v1.clone_fd$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_idle_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); public static VarHandle max_idle_threads$VH() { - return fuse_loop_config_v1.max_idle_threads$VH; + return constants$2.const$2; } /** * Getter for field: @@ -63,7 +57,7 @@ public class fuse_loop_config_v1 { * } */ public static int max_idle_threads$get(MemorySegment seg) { - return (int)fuse_loop_config_v1.max_idle_threads$VH.get(seg); + return (int)constants$2.const$2.get(seg); } /** * Setter for field: @@ -72,20 +66,20 @@ public class fuse_loop_config_v1 { * } */ public static void max_idle_threads$set(MemorySegment seg, int x) { - fuse_loop_config_v1.max_idle_threads$VH.set(seg, x); + constants$2.const$2.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { - return (int)fuse_loop_config_v1.max_idle_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$2.get(seg.asSlice(index*sizeof())); } public static void max_idle_threads$set(MemorySegment seg, long index, int x) { - fuse_loop_config_v1.max_idle_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$2.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_operations.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_operations.java new file mode 100644 index 00000000..389b6326 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/fuse_operations.java @@ -0,0 +1,2297 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_operations { + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * int (*readlink)(char*,char*,unsigned long); + * int (*mknod)(char*,unsigned int,unsigned long); + * int (*mkdir)(char*,unsigned int); + * int (*unlink)(char*); + * int (*rmdir)(char*); + * int (*symlink)(char*,char*); + * int (*rename)(char*,char*,unsigned int); + * int (*link)(char*,char*); + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * int (*truncate)(char*,long,struct fuse_file_info*); + * int (*open)(char*,struct fuse_file_info*); + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * int (*statfs)(char*,struct statvfs*); + * int (*flush)(char*,struct fuse_file_info*); + * int (*release)(char*,struct fuse_file_info*); + * int (*fsync)(char*,int,struct fuse_file_info*); + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * int (*getxattr)(char*,char*,char*,unsigned long); + * int (*listxattr)(char*,char*,unsigned long); + * int (*removexattr)(char*,char*); + * int (*opendir)(char*,struct fuse_file_info*); + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * int (*releasedir)(char*,struct fuse_file_info*); + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * void (*destroy)(void*); + * int (*access)(char*,int); + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * int (*bmap)(char*,unsigned long,unsigned long*); + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * int (*flock)(char*,struct fuse_file_info*,int); + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * }; + * } + */ +public class fuse_operations { + + public static MemoryLayout $LAYOUT() { + return constants$14.const$5; + } + /** + * {@snippet : + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public interface getattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(getattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$1, fi, constants$15.const$0, scope); + } + static getattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$15.const$2.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getattr$VH() { + return constants$15.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public static MemorySegment getattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$15.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public static void getattr$set(MemorySegment seg, MemorySegment x) { + constants$15.const$3.set(seg, x); + } + public static MemorySegment getattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$15.const$3.get(seg.asSlice(index*sizeof())); + } + public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$15.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static getattr getattr(MemorySegment segment, Arena scope) { + return getattr.ofAddress(getattr$get(segment), scope); + } + /** + * {@snippet : + * int (*readlink)(char*,char*,unsigned long); + * } + */ + public interface readlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(readlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$5, fi, constants$15.const$4, scope); + } + static readlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$16.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readlink$VH() { + return constants$16.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*readlink)(char*,char*,unsigned long); + * } + */ + public static MemorySegment readlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readlink)(char*,char*,unsigned long); + * } + */ + public static void readlink$set(MemorySegment seg, MemorySegment x) { + constants$16.const$1.set(seg, x); + } + public static MemorySegment readlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$1.get(seg.asSlice(index*sizeof())); + } + public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static readlink readlink(MemorySegment segment, Arena scope) { + return readlink.ofAddress(readlink$get(segment), scope); + } + /** + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned long); + * } + */ + public interface mknod { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2); + static MemorySegment allocate(mknod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$16.const$3, fi, constants$16.const$2, scope); + } + static mknod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2) -> { + try { + return (int)constants$16.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mknod$VH() { + return constants$16.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned long); + * } + */ + public static MemorySegment mknod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned long); + * } + */ + public static void mknod$set(MemorySegment seg, MemorySegment x) { + constants$16.const$5.set(seg, x); + } + public static MemorySegment mknod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$5.get(seg.asSlice(index*sizeof())); + } + public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static mknod mknod(MemorySegment segment, Arena scope) { + return mknod.ofAddress(mknod$get(segment), scope); + } + /** + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public interface mkdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(mkdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$1, fi, constants$17.const$0, scope); + } + static mkdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$17.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mkdir$VH() { + return constants$17.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public static MemorySegment mkdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$17.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public static void mkdir$set(MemorySegment seg, MemorySegment x) { + constants$17.const$3.set(seg, x); + } + public static MemorySegment mkdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$17.const$3.get(seg.asSlice(index*sizeof())); + } + public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$17.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static mkdir mkdir(MemorySegment segment, Arena scope) { + return mkdir.ofAddress(mkdir$get(segment), scope); + } + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ + public interface unlink { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(unlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$5, fi, constants$17.const$4, scope); + } + static unlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$18.const$0.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle unlink$VH() { + return constants$18.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static MemorySegment unlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static void unlink$set(MemorySegment seg, MemorySegment x) { + constants$18.const$1.set(seg, x); + } + public static MemorySegment unlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$1.get(seg.asSlice(index*sizeof())); + } + public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static unlink unlink(MemorySegment segment, Arena scope) { + return unlink.ofAddress(unlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public interface rmdir { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(rmdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$2, fi, constants$17.const$4, scope); + } + static rmdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$18.const$0.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rmdir$VH() { + return constants$18.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static MemorySegment rmdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static void rmdir$set(MemorySegment seg, MemorySegment x) { + constants$18.const$3.set(seg, x); + } + public static MemorySegment rmdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$3.get(seg.asSlice(index*sizeof())); + } + public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static rmdir rmdir(MemorySegment segment, Arena scope) { + return rmdir.ofAddress(rmdir$get(segment), scope); + } + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public interface symlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(symlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$5, fi, constants$18.const$4, scope); + } + static symlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle symlink$VH() { + return constants$19.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static MemorySegment symlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static void symlink$set(MemorySegment seg, MemorySegment x) { + constants$19.const$1.set(seg, x); + } + public static MemorySegment symlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$1.get(seg.asSlice(index*sizeof())); + } + public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static symlink symlink(MemorySegment segment, Arena scope) { + return symlink.ofAddress(symlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public interface rename { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(rename fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$3, fi, constants$19.const$2, scope); + } + static rename ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$19.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rename$VH() { + return constants$19.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public static MemorySegment rename$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public static void rename$set(MemorySegment seg, MemorySegment x) { + constants$19.const$5.set(seg, x); + } + public static MemorySegment rename$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$5.get(seg.asSlice(index*sizeof())); + } + public static void rename$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static rename rename(MemorySegment segment, Arena scope) { + return rename.ofAddress(rename$get(segment), scope); + } + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public interface link { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(link fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$0, fi, constants$18.const$4, scope); + } + static link ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle link$VH() { + return constants$20.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static MemorySegment link$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static void link$set(MemorySegment seg, MemorySegment x) { + constants$20.const$1.set(seg, x); + } + public static MemorySegment link$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$1.get(seg.asSlice(index*sizeof())); + } + public static void link$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static link link(MemorySegment segment, Arena scope) { + return link.ofAddress(link$get(segment), scope); + } + /** + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public interface chmod { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(chmod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$3, fi, constants$20.const$2, scope); + } + static chmod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chmod$VH() { + return constants$20.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static MemorySegment chmod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static void chmod$set(MemorySegment seg, MemorySegment x) { + constants$20.const$5.set(seg, x); + } + public static MemorySegment chmod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$5.get(seg.asSlice(index*sizeof())); + } + public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static chmod chmod(MemorySegment segment, Arena scope) { + return chmod.ofAddress(chmod$get(segment), scope); + } + /** + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * } + */ + public interface chown { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(chown fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$1, fi, constants$21.const$0, scope); + } + static chown ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$21.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chown$VH() { + return constants$21.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * } + */ + public static MemorySegment chown$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * } + */ + public static void chown$set(MemorySegment seg, MemorySegment x) { + constants$21.const$3.set(seg, x); + } + public static MemorySegment chown$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$3.get(seg.asSlice(index*sizeof())); + } + public static void chown$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static chown chown(MemorySegment segment, Arena scope) { + return chown.ofAddress(chown$get(segment), scope); + } + /** + * {@snippet : + * int (*truncate)(char*,long,struct fuse_file_info*); + * } + */ + public interface truncate { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(truncate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$5, fi, constants$21.const$4, scope); + } + static truncate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$22.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle truncate$VH() { + return constants$22.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*truncate)(char*,long,struct fuse_file_info*); + * } + */ + public static MemorySegment truncate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*truncate)(char*,long,struct fuse_file_info*); + * } + */ + public static void truncate$set(MemorySegment seg, MemorySegment x) { + constants$22.const$1.set(seg, x); + } + public static MemorySegment truncate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$1.get(seg.asSlice(index*sizeof())); + } + public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static truncate truncate(MemorySegment segment, Arena scope) { + return truncate.ofAddress(truncate$get(segment), scope); + } + /** + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public interface open { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(open fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$2, fi, constants$18.const$4, scope); + } + static open ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle open$VH() { + return constants$22.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment open$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public static void open$set(MemorySegment seg, MemorySegment x) { + constants$22.const$3.set(seg, x); + } + public static MemorySegment open$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$3.get(seg.asSlice(index*sizeof())); + } + public static void open$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static open open(MemorySegment segment, Arena scope) { + return open.ofAddress(open$get(segment), scope); + } + /** + * {@snippet : + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public interface read { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$5, fi, constants$22.const$4, scope); + } + static read ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$23.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read$VH() { + return constants$23.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment read$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static void read$set(MemorySegment seg, MemorySegment x) { + constants$23.const$1.set(seg, x); + } + public static MemorySegment read$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$1.get(seg.asSlice(index*sizeof())); + } + public static void read$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static read read(MemorySegment segment, Arena scope) { + return read.ofAddress(read$get(segment), scope); + } + /** + * {@snippet : + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public interface write { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(write fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$2, fi, constants$22.const$4, scope); + } + static write ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$23.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write$VH() { + return constants$23.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment write$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static void write$set(MemorySegment seg, MemorySegment x) { + constants$23.const$3.set(seg, x); + } + public static MemorySegment write$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$3.get(seg.asSlice(index*sizeof())); + } + public static void write$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static write write(MemorySegment segment, Arena scope) { + return write.ofAddress(write$get(segment), scope); + } + /** + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public interface statfs { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(statfs fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$4, fi, constants$18.const$4, scope); + } + static statfs ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle statfs$VH() { + return constants$23.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public static MemorySegment statfs$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public static void statfs$set(MemorySegment seg, MemorySegment x) { + constants$23.const$5.set(seg, x); + } + public static MemorySegment statfs$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$5.get(seg.asSlice(index*sizeof())); + } + public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static statfs statfs(MemorySegment segment, Arena scope) { + return statfs.ofAddress(statfs$get(segment), scope); + } + /** + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public interface flush { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(flush fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$0, fi, constants$18.const$4, scope); + } + static flush ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flush$VH() { + return constants$24.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment flush$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public static void flush$set(MemorySegment seg, MemorySegment x) { + constants$24.const$1.set(seg, x); + } + public static MemorySegment flush$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$1.get(seg.asSlice(index*sizeof())); + } + public static void flush$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static flush flush(MemorySegment segment, Arena scope) { + return flush.ofAddress(flush$get(segment), scope); + } + /** + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public interface release { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(release fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$2, fi, constants$18.const$4, scope); + } + static release ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle release$VH() { + return constants$24.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment release$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public static void release$set(MemorySegment seg, MemorySegment x) { + constants$24.const$3.set(seg, x); + } + public static MemorySegment release$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$3.get(seg.asSlice(index*sizeof())); + } + public static void release$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static release release(MemorySegment segment, Arena scope) { + return release.ofAddress(release$get(segment), scope); + } + /** + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public interface fsync { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsync fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$4, fi, constants$20.const$2, scope); + } + static fsync ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsync$VH() { + return constants$24.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public static MemorySegment fsync$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public static void fsync$set(MemorySegment seg, MemorySegment x) { + constants$24.const$5.set(seg, x); + } + public static MemorySegment fsync$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$5.get(seg.asSlice(index*sizeof())); + } + public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static fsync fsync(MemorySegment segment, Arena scope) { + return fsync.ofAddress(fsync$get(segment), scope); + } + /** + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * } + */ + public interface setxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); + static MemorySegment allocate(setxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$0, fi, constants$10.const$0, scope); + } + static setxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { + try { + return (int)constants$10.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle setxattr$VH() { + return constants$25.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * } + */ + public static MemorySegment setxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * } + */ + public static void setxattr$set(MemorySegment seg, MemorySegment x) { + constants$25.const$1.set(seg, x); + } + public static MemorySegment setxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$1.get(seg.asSlice(index*sizeof())); + } + public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static setxattr setxattr(MemorySegment segment, Arena scope) { + return setxattr.ofAddress(setxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long); + * } + */ + public interface getxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); + static MemorySegment allocate(getxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$3, fi, constants$25.const$2, scope); + } + static getxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { + try { + return (int)constants$25.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getxattr$VH() { + return constants$25.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long); + * } + */ + public static MemorySegment getxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long); + * } + */ + public static void getxattr$set(MemorySegment seg, MemorySegment x) { + constants$25.const$5.set(seg, x); + } + public static MemorySegment getxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$5.get(seg.asSlice(index*sizeof())); + } + public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static getxattr getxattr(MemorySegment segment, Arena scope) { + return getxattr.ofAddress(getxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long); + * } + */ + public interface listxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(listxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$0, fi, constants$15.const$4, scope); + } + static listxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$16.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle listxattr$VH() { + return constants$26.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long); + * } + */ + public static MemorySegment listxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long); + * } + */ + public static void listxattr$set(MemorySegment seg, MemorySegment x) { + constants$26.const$1.set(seg, x); + } + public static MemorySegment listxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$1.get(seg.asSlice(index*sizeof())); + } + public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static listxattr listxattr(MemorySegment segment, Arena scope) { + return listxattr.ofAddress(listxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public interface removexattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(removexattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$2, fi, constants$18.const$4, scope); + } + static removexattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle removexattr$VH() { + return constants$26.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static MemorySegment removexattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static void removexattr$set(MemorySegment seg, MemorySegment x) { + constants$26.const$3.set(seg, x); + } + public static MemorySegment removexattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$3.get(seg.asSlice(index*sizeof())); + } + public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static removexattr removexattr(MemorySegment segment, Arena scope) { + return removexattr.ofAddress(removexattr$get(segment), scope); + } + /** + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public interface opendir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(opendir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$4, fi, constants$18.const$4, scope); + } + static opendir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle opendir$VH() { + return constants$26.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment opendir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public static void opendir$set(MemorySegment seg, MemorySegment x) { + constants$26.const$5.set(seg, x); + } + public static MemorySegment opendir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$5.get(seg.asSlice(index*sizeof())); + } + public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static opendir opendir(MemorySegment segment, Arena scope) { + return opendir.ofAddress(opendir$get(segment), scope); + } + /** + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * } + */ + public interface readdir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4, int _x5); + static MemorySegment allocate(readdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$1, fi, constants$27.const$0, scope); + } + static readdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4, int __x5) -> { + try { + return (int)constants$27.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readdir$VH() { + return constants$27.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * } + */ + public static MemorySegment readdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * } + */ + public static void readdir$set(MemorySegment seg, MemorySegment x) { + constants$27.const$3.set(seg, x); + } + public static MemorySegment readdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$3.get(seg.asSlice(index*sizeof())); + } + public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static readdir readdir(MemorySegment segment, Arena scope) { + return readdir.ofAddress(readdir$get(segment), scope); + } + /** + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public interface releasedir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(releasedir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$4, fi, constants$18.const$4, scope); + } + static releasedir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$19.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle releasedir$VH() { + return constants$27.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment releasedir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public static void releasedir$set(MemorySegment seg, MemorySegment x) { + constants$27.const$5.set(seg, x); + } + public static MemorySegment releasedir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$5.get(seg.asSlice(index*sizeof())); + } + public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static releasedir releasedir(MemorySegment segment, Arena scope) { + return releasedir.ofAddress(releasedir$get(segment), scope); + } + /** + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public interface fsyncdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsyncdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$0, fi, constants$20.const$2, scope); + } + static fsyncdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsyncdir$VH() { + return constants$28.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public static MemorySegment fsyncdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { + constants$28.const$1.set(seg, x); + } + public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$1.get(seg.asSlice(index*sizeof())); + } + public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static fsyncdir fsyncdir(MemorySegment segment, Arena scope) { + return fsyncdir.ofAddress(fsyncdir$get(segment), scope); + } + /** + * {@snippet : + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * } + */ + public interface init { + + java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(init fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$3, fi, constants$28.const$2, scope); + } + static init ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (java.lang.foreign.MemorySegment)constants$28.const$4.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle init$VH() { + return constants$28.const$5; + } + /** + * Getter for field: + * {@snippet : + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * } + */ + public static MemorySegment init$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * } + */ + public static void init$set(MemorySegment seg, MemorySegment x) { + constants$28.const$5.set(seg, x); + } + public static MemorySegment init$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$5.get(seg.asSlice(index*sizeof())); + } + public static void init$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static init init(MemorySegment segment, Arena scope) { + return init.ofAddress(init$get(segment), scope); + } + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ + public interface destroy { + + void apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(destroy fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$0, fi, constants$5.const$0, scope); + } + static destroy ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + constants$29.const$1.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle destroy$VH() { + return constants$29.const$2; + } + /** + * Getter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static MemorySegment destroy$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static void destroy$set(MemorySegment seg, MemorySegment x) { + constants$29.const$2.set(seg, x); + } + public static MemorySegment destroy$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$2.get(seg.asSlice(index*sizeof())); + } + public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static destroy destroy(MemorySegment segment, Arena scope) { + return destroy.ofAddress(destroy$get(segment), scope); + } + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ + public interface access { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(access fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$3, fi, constants$17.const$0, scope); + } + static access ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$17.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle access$VH() { + return constants$29.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static MemorySegment access$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static void access$set(MemorySegment seg, MemorySegment x) { + constants$29.const$4.set(seg, x); + } + public static MemorySegment access$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$4.get(seg.asSlice(index*sizeof())); + } + public static void access$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static access access(MemorySegment segment, Arena scope) { + return access.ofAddress(access$get(segment), scope); + } + /** + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public interface create { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(create fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$5, fi, constants$20.const$2, scope); + } + static create ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle create$VH() { + return constants$30.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static MemorySegment create$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static void create$set(MemorySegment seg, MemorySegment x) { + constants$30.const$0.set(seg, x); + } + public static MemorySegment create$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$0.get(seg.asSlice(index*sizeof())); + } + public static void create$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static create create(MemorySegment segment, Arena scope) { + return create.ofAddress(create$get(segment), scope); + } + /** + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public interface lock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(lock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$2, fi, constants$30.const$1, scope); + } + static lock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$30.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle lock$VH() { + return constants$30.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public static MemorySegment lock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public static void lock$set(MemorySegment seg, MemorySegment x) { + constants$30.const$4.set(seg, x); + } + public static MemorySegment lock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$4.get(seg.asSlice(index*sizeof())); + } + public static void lock$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static lock lock(MemorySegment segment, Arena scope) { + return lock.ofAddress(lock$get(segment), scope); + } + /** + * {@snippet : + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * } + */ + public interface utimens { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(utimens fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$5, fi, constants$15.const$0, scope); + } + static utimens ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$15.const$2.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle utimens$VH() { + return constants$31.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * } + */ + public static MemorySegment utimens$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * } + */ + public static void utimens$set(MemorySegment seg, MemorySegment x) { + constants$31.const$0.set(seg, x); + } + public static MemorySegment utimens$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$0.get(seg.asSlice(index*sizeof())); + } + public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static utimens utimens(MemorySegment segment, Arena scope) { + return utimens.ofAddress(utimens$get(segment), scope); + } + /** + * {@snippet : + * int (*bmap)(char*,unsigned long,unsigned long*); + * } + */ + public interface bmap { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(bmap fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$1, fi, constants$21.const$4, scope); + } + static bmap ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$22.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle bmap$VH() { + return constants$31.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*bmap)(char*,unsigned long,unsigned long*); + * } + */ + public static MemorySegment bmap$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*bmap)(char*,unsigned long,unsigned long*); + * } + */ + public static void bmap$set(MemorySegment seg, MemorySegment x) { + constants$31.const$2.set(seg, x); + } + public static MemorySegment bmap$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$2.get(seg.asSlice(index*sizeof())); + } + public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static bmap bmap(MemorySegment segment, Arena scope) { + return bmap.ofAddress(bmap$get(segment), scope); + } + /** + * {@snippet : + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public interface ioctl { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); + static MemorySegment allocate(ioctl fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$4, fi, constants$31.const$3, scope); + } + static ioctl ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { + try { + return (int)constants$31.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle ioctl$VH() { + return constants$32.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public static MemorySegment ioctl$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$32.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public static void ioctl$set(MemorySegment seg, MemorySegment x) { + constants$32.const$0.set(seg, x); + } + public static MemorySegment ioctl$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$32.const$0.get(seg.asSlice(index*sizeof())); + } + public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { + constants$32.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static ioctl ioctl(MemorySegment segment, Arena scope) { + return ioctl.ofAddress(ioctl$get(segment), scope); + } + /** + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public interface poll { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(poll fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$32.const$2, fi, constants$32.const$1, scope); + } + static poll ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$32.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle poll$VH() { + return constants$32.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public static MemorySegment poll$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$32.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public static void poll$set(MemorySegment seg, MemorySegment x) { + constants$32.const$4.set(seg, x); + } + public static MemorySegment poll$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$32.const$4.get(seg.asSlice(index*sizeof())); + } + public static void poll$set(MemorySegment seg, long index, MemorySegment x) { + constants$32.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static poll poll(MemorySegment segment, Arena scope) { + return poll.ofAddress(poll$get(segment), scope); + } + /** + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * } + */ + public interface write_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(write_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$33.const$0, fi, constants$32.const$5, scope); + } + static write_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$33.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write_buf$VH() { + return constants$33.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * } + */ + public static MemorySegment write_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$33.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * } + */ + public static void write_buf$set(MemorySegment seg, MemorySegment x) { + constants$33.const$2.set(seg, x); + } + public static MemorySegment write_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$33.const$2.get(seg.asSlice(index*sizeof())); + } + public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$33.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static write_buf write_buf(MemorySegment segment, Arena scope) { + return write_buf.ofAddress(write_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * } + */ + public interface read_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$33.const$3, fi, constants$22.const$4, scope); + } + static read_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$23.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read_buf$VH() { + return constants$33.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment read_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$33.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * } + */ + public static void read_buf$set(MemorySegment seg, MemorySegment x) { + constants$33.const$4.set(seg, x); + } + public static MemorySegment read_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$33.const$4.get(seg.asSlice(index*sizeof())); + } + public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$33.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static read_buf read_buf(MemorySegment segment, Arena scope) { + return read_buf.ofAddress(read_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public interface flock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(flock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$33.const$5, fi, constants$19.const$2, scope); + } + static flock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$19.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flock$VH() { + return constants$34.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public static MemorySegment flock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$34.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public static void flock$set(MemorySegment seg, MemorySegment x) { + constants$34.const$0.set(seg, x); + } + public static MemorySegment flock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$34.const$0.get(seg.asSlice(index*sizeof())); + } + public static void flock$set(MemorySegment seg, long index, MemorySegment x) { + constants$34.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static flock flock(MemorySegment segment, Arena scope) { + return flock.ofAddress(flock$get(segment), scope); + } + /** + * {@snippet : + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * } + */ + public interface fallocate { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(fallocate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$34.const$2, fi, constants$34.const$1, scope); + } + static fallocate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$34.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fallocate$VH() { + return constants$34.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment fallocate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$34.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * } + */ + public static void fallocate$set(MemorySegment seg, MemorySegment x) { + constants$34.const$4.set(seg, x); + } + public static MemorySegment fallocate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$34.const$4.get(seg.asSlice(index*sizeof())); + } + public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { + constants$34.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static fallocate fallocate(MemorySegment segment, Arena scope) { + return fallocate.ofAddress(fallocate$get(segment), scope); + } + /** + * {@snippet : + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * } + */ + public interface copy_file_range { + + long apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4, long _x5, long _x6, int _x7); + static MemorySegment allocate(copy_file_range fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$35.const$0, fi, constants$34.const$5, scope); + } + static copy_file_range ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4, long __x5, long __x6, int __x7) -> { + try { + return (long)constants$35.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5, __x6, __x7); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle copy_file_range$VH() { + return constants$35.const$2; + } + /** + * Getter for field: + * {@snippet : + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * } + */ + public static MemorySegment copy_file_range$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$35.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * } + */ + public static void copy_file_range$set(MemorySegment seg, MemorySegment x) { + constants$35.const$2.set(seg, x); + } + public static MemorySegment copy_file_range$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$35.const$2.get(seg.asSlice(index*sizeof())); + } + public static void copy_file_range$set(MemorySegment seg, long index, MemorySegment x) { + constants$35.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static copy_file_range copy_file_range(MemorySegment segment, Arena scope) { + return copy_file_range.ofAddress(copy_file_range$get(segment), scope); + } + /** + * {@snippet : + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * } + */ + public interface lseek { + + long apply(java.lang.foreign.MemorySegment _x0, long _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(lseek fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$35.const$4, fi, constants$35.const$3, scope); + } + static lseek ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (long)constants$35.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle lseek$VH() { + return constants$36.const$0; + } + /** + * Getter for field: + * {@snippet : + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * } + */ + public static MemorySegment lseek$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$36.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * } + */ + public static void lseek$set(MemorySegment seg, MemorySegment x) { + constants$36.const$0.set(seg, x); + } + public static MemorySegment lseek$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$36.const$0.get(seg.asSlice(index*sizeof())); + } + public static void lseek$set(MemorySegment seg, long index, MemorySegment x) { + constants$36.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static lseek lseek(MemorySegment segment, Arena scope) { + return lseek.ofAddress(lseek$get(segment), scope); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/stat.java similarity index 50% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/stat.java index b3df1ad7..73ab0361 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/stat.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -10,18 +10,18 @@ /** * {@snippet : * struct stat { - * __dev_t st_dev; - * __ino64_t st_ino; - * __mode_t st_mode; - * __nlink_t st_nlink; - * __uid_t st_uid; - * __gid_t st_gid; - * __dev_t st_rdev; - * __dev_t __pad1; - * __off64_t st_size; - * __blksize_t st_blksize; + * unsigned long st_dev; + * unsigned long st_ino; + * unsigned int st_mode; + * unsigned int st_nlink; + * unsigned int st_uid; + * unsigned int st_gid; + * unsigned long st_rdev; + * unsigned long __pad1; + * long st_size; + * int st_blksize; * int __pad2; - * __blkcnt64_t st_blocks; + * long st_blocks; * struct timespec st_atim; * struct timespec st_mtim; * struct timespec st_ctim; @@ -31,319 +31,281 @@ */ public class stat { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("st_dev"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_ino"), - Constants$root.C_INT$LAYOUT.withName("st_mode"), - Constants$root.C_INT$LAYOUT.withName("st_nlink"), - Constants$root.C_INT$LAYOUT.withName("st_uid"), - Constants$root.C_INT$LAYOUT.withName("st_gid"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_rdev"), - Constants$root.C_LONG_LONG$LAYOUT.withName("__pad1"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_size"), - Constants$root.C_INT$LAYOUT.withName("st_blksize"), - Constants$root.C_INT$LAYOUT.withName("__pad2"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_blocks"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_atim"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_mtim"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_ctim"), - MemoryLayout.sequenceLayout(2, Constants$root.C_INT$LAYOUT).withName("__glibc_reserved") - ).withName("stat"); public static MemoryLayout $LAYOUT() { - return stat.$struct$LAYOUT; + return constants$5.const$5; } - static final VarHandle st_dev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); public static VarHandle st_dev$VH() { - return stat.st_dev$VH; + return constants$6.const$0; } /** * Getter for field: * {@snippet : - * __dev_t st_dev; + * unsigned long st_dev; * } */ public static long st_dev$get(MemorySegment seg) { - return (long)stat.st_dev$VH.get(seg); + return (long)constants$6.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __dev_t st_dev; + * unsigned long st_dev; * } */ public static void st_dev$set(MemorySegment seg, long x) { - stat.st_dev$VH.set(seg, x); + constants$6.const$0.set(seg, x); } public static long st_dev$get(MemorySegment seg, long index) { - return (long)stat.st_dev$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$0.get(seg.asSlice(index*sizeof())); } public static void st_dev$set(MemorySegment seg, long index, long x) { - stat.st_dev$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); public static VarHandle st_ino$VH() { - return stat.st_ino$VH; + return constants$6.const$1; } /** * Getter for field: * {@snippet : - * __ino64_t st_ino; + * unsigned long st_ino; * } */ public static long st_ino$get(MemorySegment seg) { - return (long)stat.st_ino$VH.get(seg); + return (long)constants$6.const$1.get(seg); } /** * Setter for field: * {@snippet : - * __ino64_t st_ino; + * unsigned long st_ino; * } */ public static void st_ino$set(MemorySegment seg, long x) { - stat.st_ino$VH.set(seg, x); + constants$6.const$1.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { - return (long)stat.st_ino$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$1.get(seg.asSlice(index*sizeof())); } public static void st_ino$set(MemorySegment seg, long index, long x) { - stat.st_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); public static VarHandle st_mode$VH() { - return stat.st_mode$VH; + return constants$6.const$2; } /** * Getter for field: * {@snippet : - * __mode_t st_mode; + * unsigned int st_mode; * } */ public static int st_mode$get(MemorySegment seg) { - return (int)stat.st_mode$VH.get(seg); + return (int)constants$6.const$2.get(seg); } /** * Setter for field: * {@snippet : - * __mode_t st_mode; + * unsigned int st_mode; * } */ public static void st_mode$set(MemorySegment seg, int x) { - stat.st_mode$VH.set(seg, x); + constants$6.const$2.set(seg, x); } public static int st_mode$get(MemorySegment seg, long index) { - return (int)stat.st_mode$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$2.get(seg.asSlice(index*sizeof())); } public static void st_mode$set(MemorySegment seg, long index, int x) { - stat.st_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_nlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); public static VarHandle st_nlink$VH() { - return stat.st_nlink$VH; + return constants$6.const$3; } /** * Getter for field: * {@snippet : - * __nlink_t st_nlink; + * unsigned int st_nlink; * } */ public static int st_nlink$get(MemorySegment seg) { - return (int)stat.st_nlink$VH.get(seg); + return (int)constants$6.const$3.get(seg); } /** * Setter for field: * {@snippet : - * __nlink_t st_nlink; + * unsigned int st_nlink; * } */ public static void st_nlink$set(MemorySegment seg, int x) { - stat.st_nlink$VH.set(seg, x); + constants$6.const$3.set(seg, x); } public static int st_nlink$get(MemorySegment seg, long index) { - return (int)stat.st_nlink$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$3.get(seg.asSlice(index*sizeof())); } public static void st_nlink$set(MemorySegment seg, long index, int x) { - stat.st_nlink$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); public static VarHandle st_uid$VH() { - return stat.st_uid$VH; + return constants$6.const$4; } /** * Getter for field: * {@snippet : - * __uid_t st_uid; + * unsigned int st_uid; * } */ public static int st_uid$get(MemorySegment seg) { - return (int)stat.st_uid$VH.get(seg); + return (int)constants$6.const$4.get(seg); } /** * Setter for field: * {@snippet : - * __uid_t st_uid; + * unsigned int st_uid; * } */ public static void st_uid$set(MemorySegment seg, int x) { - stat.st_uid$VH.set(seg, x); + constants$6.const$4.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { - return (int)stat.st_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$4.get(seg.asSlice(index*sizeof())); } public static void st_uid$set(MemorySegment seg, long index, int x) { - stat.st_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); public static VarHandle st_gid$VH() { - return stat.st_gid$VH; + return constants$6.const$5; } /** * Getter for field: * {@snippet : - * __gid_t st_gid; + * unsigned int st_gid; * } */ public static int st_gid$get(MemorySegment seg) { - return (int)stat.st_gid$VH.get(seg); + return (int)constants$6.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __gid_t st_gid; + * unsigned int st_gid; * } */ public static void st_gid$set(MemorySegment seg, int x) { - stat.st_gid$VH.set(seg, x); + constants$6.const$5.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { - return (int)stat.st_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$5.get(seg.asSlice(index*sizeof())); } public static void st_gid$set(MemorySegment seg, long index, int x) { - stat.st_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_rdev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); public static VarHandle st_rdev$VH() { - return stat.st_rdev$VH; + return constants$7.const$0; } /** * Getter for field: * {@snippet : - * __dev_t st_rdev; + * unsigned long st_rdev; * } */ public static long st_rdev$get(MemorySegment seg) { - return (long)stat.st_rdev$VH.get(seg); + return (long)constants$7.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __dev_t st_rdev; + * unsigned long st_rdev; * } */ public static void st_rdev$set(MemorySegment seg, long x) { - stat.st_rdev$VH.set(seg, x); + constants$7.const$0.set(seg, x); } public static long st_rdev$get(MemorySegment seg, long index) { - return (long)stat.st_rdev$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$0.get(seg.asSlice(index*sizeof())); } public static void st_rdev$set(MemorySegment seg, long index, long x) { - stat.st_rdev$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle __pad1$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("__pad1")); public static VarHandle __pad1$VH() { - return stat.__pad1$VH; + return constants$7.const$1; } /** * Getter for field: * {@snippet : - * __dev_t __pad1; + * unsigned long __pad1; * } */ public static long __pad1$get(MemorySegment seg) { - return (long)stat.__pad1$VH.get(seg); + return (long)constants$7.const$1.get(seg); } /** * Setter for field: * {@snippet : - * __dev_t __pad1; + * unsigned long __pad1; * } */ public static void __pad1$set(MemorySegment seg, long x) { - stat.__pad1$VH.set(seg, x); + constants$7.const$1.set(seg, x); } public static long __pad1$get(MemorySegment seg, long index) { - return (long)stat.__pad1$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$1.get(seg.asSlice(index*sizeof())); } public static void __pad1$set(MemorySegment seg, long index, long x) { - stat.__pad1$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_size$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_size")); public static VarHandle st_size$VH() { - return stat.st_size$VH; + return constants$7.const$2; } /** * Getter for field: * {@snippet : - * __off64_t st_size; + * long st_size; * } */ public static long st_size$get(MemorySegment seg) { - return (long)stat.st_size$VH.get(seg); + return (long)constants$7.const$2.get(seg); } /** * Setter for field: * {@snippet : - * __off64_t st_size; + * long st_size; * } */ public static void st_size$set(MemorySegment seg, long x) { - stat.st_size$VH.set(seg, x); + constants$7.const$2.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { - return (long)stat.st_size$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$2.get(seg.asSlice(index*sizeof())); } public static void st_size$set(MemorySegment seg, long index, long x) { - stat.st_size$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blksize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); public static VarHandle st_blksize$VH() { - return stat.st_blksize$VH; + return constants$7.const$3; } /** * Getter for field: * {@snippet : - * __blksize_t st_blksize; + * int st_blksize; * } */ public static int st_blksize$get(MemorySegment seg) { - return (int)stat.st_blksize$VH.get(seg); + return (int)constants$7.const$3.get(seg); } /** * Setter for field: * {@snippet : - * __blksize_t st_blksize; + * int st_blksize; * } */ public static void st_blksize$set(MemorySegment seg, int x) { - stat.st_blksize$VH.set(seg, x); + constants$7.const$3.set(seg, x); } public static int st_blksize$get(MemorySegment seg, long index) { - return (int)stat.st_blksize$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$3.get(seg.asSlice(index*sizeof())); } public static void st_blksize$set(MemorySegment seg, long index, int x) { - stat.st_blksize$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle __pad2$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("__pad2")); public static VarHandle __pad2$VH() { - return stat.__pad2$VH; + return constants$7.const$4; } /** * Getter for field: @@ -352,7 +314,7 @@ public class stat { * } */ public static int __pad2$get(MemorySegment seg) { - return (int)stat.__pad2$VH.get(seg); + return (int)constants$7.const$4.get(seg); } /** * Setter for field: @@ -361,41 +323,40 @@ public class stat { * } */ public static void __pad2$set(MemorySegment seg, int x) { - stat.__pad2$VH.set(seg, x); + constants$7.const$4.set(seg, x); } public static int __pad2$get(MemorySegment seg, long index) { - return (int)stat.__pad2$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$4.get(seg.asSlice(index*sizeof())); } public static void __pad2$set(MemorySegment seg, long index, int x) { - stat.__pad2$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); public static VarHandle st_blocks$VH() { - return stat.st_blocks$VH; + return constants$7.const$5; } /** * Getter for field: * {@snippet : - * __blkcnt64_t st_blocks; + * long st_blocks; * } */ public static long st_blocks$get(MemorySegment seg) { - return (long)stat.st_blocks$VH.get(seg); + return (long)constants$7.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __blkcnt64_t st_blocks; + * long st_blocks; * } */ public static void st_blocks$set(MemorySegment seg, long x) { - stat.st_blocks$VH.set(seg, x); + constants$7.const$5.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { - return (long)stat.st_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$5.get(seg.asSlice(index*sizeof())); } public static void st_blocks$set(MemorySegment seg, long index, long x) { - stat.st_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$5.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment st_atim$slice(MemorySegment seg) { return seg.asSlice(72, 16); @@ -414,7 +375,7 @@ public class stat { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/statvfs.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/statvfs.java similarity index 53% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/statvfs.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/statvfs.java index ecfdea65..8a5317f7 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/statvfs.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/statvfs.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -12,12 +12,12 @@ * struct statvfs { * unsigned long f_bsize; * unsigned long f_frsize; - * __fsblkcnt64_t f_blocks; - * __fsblkcnt64_t f_bfree; - * __fsblkcnt64_t f_bavail; - * __fsfilcnt64_t f_files; - * __fsfilcnt64_t f_ffree; - * __fsfilcnt64_t f_favail; + * unsigned long f_blocks; + * unsigned long f_bfree; + * unsigned long f_bavail; + * unsigned long f_files; + * unsigned long f_ffree; + * unsigned long f_favail; * unsigned long f_fsid; * unsigned long f_flag; * unsigned long f_namemax; @@ -27,26 +27,11 @@ */ public class statvfs { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_frsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_blocks"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bfree"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bavail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_files"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_ffree"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_favail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_fsid"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_flag"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_namemax"), - MemoryLayout.sequenceLayout(6, Constants$root.C_INT$LAYOUT).withName("__f_spare") - ).withName("statvfs"); public static MemoryLayout $LAYOUT() { - return statvfs.$struct$LAYOUT; + return constants$8.const$0; } - static final VarHandle f_bsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); public static VarHandle f_bsize$VH() { - return statvfs.f_bsize$VH; + return constants$8.const$1; } /** * Getter for field: @@ -55,7 +40,7 @@ public class statvfs { * } */ public static long f_bsize$get(MemorySegment seg) { - return (long)statvfs.f_bsize$VH.get(seg); + return (long)constants$8.const$1.get(seg); } /** * Setter for field: @@ -64,17 +49,16 @@ public class statvfs { * } */ public static void f_bsize$set(MemorySegment seg, long x) { - statvfs.f_bsize$VH.set(seg, x); + constants$8.const$1.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { - return (long)statvfs.f_bsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$1.get(seg.asSlice(index*sizeof())); } public static void f_bsize$set(MemorySegment seg, long index, long x) { - statvfs.f_bsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_frsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); public static VarHandle f_frsize$VH() { - return statvfs.f_frsize$VH; + return constants$8.const$2; } /** * Getter for field: @@ -83,7 +67,7 @@ public class statvfs { * } */ public static long f_frsize$get(MemorySegment seg) { - return (long)statvfs.f_frsize$VH.get(seg); + return (long)constants$8.const$2.get(seg); } /** * Setter for field: @@ -92,185 +76,178 @@ public class statvfs { * } */ public static void f_frsize$set(MemorySegment seg, long x) { - statvfs.f_frsize$VH.set(seg, x); + constants$8.const$2.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { - return (long)statvfs.f_frsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$2.get(seg.asSlice(index*sizeof())); } public static void f_frsize$set(MemorySegment seg, long index, long x) { - statvfs.f_frsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); public static VarHandle f_blocks$VH() { - return statvfs.f_blocks$VH; + return constants$8.const$3; } /** * Getter for field: * {@snippet : - * __fsblkcnt64_t f_blocks; + * unsigned long f_blocks; * } */ public static long f_blocks$get(MemorySegment seg) { - return (long)statvfs.f_blocks$VH.get(seg); + return (long)constants$8.const$3.get(seg); } /** * Setter for field: * {@snippet : - * __fsblkcnt64_t f_blocks; + * unsigned long f_blocks; * } */ public static void f_blocks$set(MemorySegment seg, long x) { - statvfs.f_blocks$VH.set(seg, x); + constants$8.const$3.set(seg, x); } public static long f_blocks$get(MemorySegment seg, long index) { - return (long)statvfs.f_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$3.get(seg.asSlice(index*sizeof())); } public static void f_blocks$set(MemorySegment seg, long index, long x) { - statvfs.f_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bfree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); public static VarHandle f_bfree$VH() { - return statvfs.f_bfree$VH; + return constants$8.const$4; } /** * Getter for field: * {@snippet : - * __fsblkcnt64_t f_bfree; + * unsigned long f_bfree; * } */ public static long f_bfree$get(MemorySegment seg) { - return (long)statvfs.f_bfree$VH.get(seg); + return (long)constants$8.const$4.get(seg); } /** * Setter for field: * {@snippet : - * __fsblkcnt64_t f_bfree; + * unsigned long f_bfree; * } */ public static void f_bfree$set(MemorySegment seg, long x) { - statvfs.f_bfree$VH.set(seg, x); + constants$8.const$4.set(seg, x); } public static long f_bfree$get(MemorySegment seg, long index) { - return (long)statvfs.f_bfree$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$4.get(seg.asSlice(index*sizeof())); } public static void f_bfree$set(MemorySegment seg, long index, long x) { - statvfs.f_bfree$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bavail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); public static VarHandle f_bavail$VH() { - return statvfs.f_bavail$VH; + return constants$8.const$5; } /** * Getter for field: * {@snippet : - * __fsblkcnt64_t f_bavail; + * unsigned long f_bavail; * } */ public static long f_bavail$get(MemorySegment seg) { - return (long)statvfs.f_bavail$VH.get(seg); + return (long)constants$8.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __fsblkcnt64_t f_bavail; + * unsigned long f_bavail; * } */ public static void f_bavail$set(MemorySegment seg, long x) { - statvfs.f_bavail$VH.set(seg, x); + constants$8.const$5.set(seg, x); } public static long f_bavail$get(MemorySegment seg, long index) { - return (long)statvfs.f_bavail$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$5.get(seg.asSlice(index*sizeof())); } public static void f_bavail$set(MemorySegment seg, long index, long x) { - statvfs.f_bavail$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_files$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_files")); public static VarHandle f_files$VH() { - return statvfs.f_files$VH; + return constants$9.const$0; } /** * Getter for field: * {@snippet : - * __fsfilcnt64_t f_files; + * unsigned long f_files; * } */ public static long f_files$get(MemorySegment seg) { - return (long)statvfs.f_files$VH.get(seg); + return (long)constants$9.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __fsfilcnt64_t f_files; + * unsigned long f_files; * } */ public static void f_files$set(MemorySegment seg, long x) { - statvfs.f_files$VH.set(seg, x); + constants$9.const$0.set(seg, x); } public static long f_files$get(MemorySegment seg, long index) { - return (long)statvfs.f_files$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$0.get(seg.asSlice(index*sizeof())); } public static void f_files$set(MemorySegment seg, long index, long x) { - statvfs.f_files$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_ffree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); public static VarHandle f_ffree$VH() { - return statvfs.f_ffree$VH; + return constants$9.const$1; } /** * Getter for field: * {@snippet : - * __fsfilcnt64_t f_ffree; + * unsigned long f_ffree; * } */ public static long f_ffree$get(MemorySegment seg) { - return (long)statvfs.f_ffree$VH.get(seg); + return (long)constants$9.const$1.get(seg); } /** * Setter for field: * {@snippet : - * __fsfilcnt64_t f_ffree; + * unsigned long f_ffree; * } */ public static void f_ffree$set(MemorySegment seg, long x) { - statvfs.f_ffree$VH.set(seg, x); + constants$9.const$1.set(seg, x); } public static long f_ffree$get(MemorySegment seg, long index) { - return (long)statvfs.f_ffree$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$1.get(seg.asSlice(index*sizeof())); } public static void f_ffree$set(MemorySegment seg, long index, long x) { - statvfs.f_ffree$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_favail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); public static VarHandle f_favail$VH() { - return statvfs.f_favail$VH; + return constants$9.const$2; } /** * Getter for field: * {@snippet : - * __fsfilcnt64_t f_favail; + * unsigned long f_favail; * } */ public static long f_favail$get(MemorySegment seg) { - return (long)statvfs.f_favail$VH.get(seg); + return (long)constants$9.const$2.get(seg); } /** * Setter for field: * {@snippet : - * __fsfilcnt64_t f_favail; + * unsigned long f_favail; * } */ public static void f_favail$set(MemorySegment seg, long x) { - statvfs.f_favail$VH.set(seg, x); + constants$9.const$2.set(seg, x); } public static long f_favail$get(MemorySegment seg, long index) { - return (long)statvfs.f_favail$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$2.get(seg.asSlice(index*sizeof())); } public static void f_favail$set(MemorySegment seg, long index, long x) { - statvfs.f_favail$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_fsid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); public static VarHandle f_fsid$VH() { - return statvfs.f_fsid$VH; + return constants$9.const$3; } /** * Getter for field: @@ -279,7 +256,7 @@ public class statvfs { * } */ public static long f_fsid$get(MemorySegment seg) { - return (long)statvfs.f_fsid$VH.get(seg); + return (long)constants$9.const$3.get(seg); } /** * Setter for field: @@ -288,17 +265,16 @@ public class statvfs { * } */ public static void f_fsid$set(MemorySegment seg, long x) { - statvfs.f_fsid$VH.set(seg, x); + constants$9.const$3.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { - return (long)statvfs.f_fsid$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$3.get(seg.asSlice(index*sizeof())); } public static void f_fsid$set(MemorySegment seg, long index, long x) { - statvfs.f_fsid$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_flag$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); public static VarHandle f_flag$VH() { - return statvfs.f_flag$VH; + return constants$9.const$4; } /** * Getter for field: @@ -307,7 +283,7 @@ public class statvfs { * } */ public static long f_flag$get(MemorySegment seg) { - return (long)statvfs.f_flag$VH.get(seg); + return (long)constants$9.const$4.get(seg); } /** * Setter for field: @@ -316,17 +292,16 @@ public class statvfs { * } */ public static void f_flag$set(MemorySegment seg, long x) { - statvfs.f_flag$VH.set(seg, x); + constants$9.const$4.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { - return (long)statvfs.f_flag$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$4.get(seg.asSlice(index*sizeof())); } public static void f_flag$set(MemorySegment seg, long index, long x) { - statvfs.f_flag$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_namemax$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); public static VarHandle f_namemax$VH() { - return statvfs.f_namemax$VH; + return constants$9.const$5; } /** * Getter for field: @@ -335,7 +310,7 @@ public class statvfs { * } */ public static long f_namemax$get(MemorySegment seg) { - return (long)statvfs.f_namemax$VH.get(seg); + return (long)constants$9.const$5.get(seg); } /** * Setter for field: @@ -344,13 +319,13 @@ public class statvfs { * } */ public static void f_namemax$set(MemorySegment seg, long x) { - statvfs.f_namemax$VH.set(seg, x); + constants$9.const$5.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { - return (long)statvfs.f_namemax$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$5.get(seg.asSlice(index*sizeof())); } public static void f_namemax$set(MemorySegment seg, long index, long x) { - statvfs.f_namemax$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$5.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment __f_spare$slice(MemorySegment seg) { return seg.asSlice(88, 24); @@ -360,7 +335,7 @@ public class statvfs { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/timespec.java similarity index 54% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/timespec.java index 1e316e27..99610261 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3/timespec.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -10,82 +10,76 @@ /** * {@snippet : * struct timespec { - * __time_t tv_sec; - * __syscall_slong_t tv_nsec; + * long tv_sec; + * long tv_nsec; * }; * } */ public class timespec { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("timespec"); public static MemoryLayout $LAYOUT() { - return timespec.$struct$LAYOUT; + return constants$0.const$4; } - static final VarHandle tv_sec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); public static VarHandle tv_sec$VH() { - return timespec.tv_sec$VH; + return constants$0.const$5; } /** * Getter for field: * {@snippet : - * __time_t tv_sec; + * long tv_sec; * } */ public static long tv_sec$get(MemorySegment seg) { - return (long)timespec.tv_sec$VH.get(seg); + return (long)constants$0.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __time_t tv_sec; + * long tv_sec; * } */ public static void tv_sec$set(MemorySegment seg, long x) { - timespec.tv_sec$VH.set(seg, x); + constants$0.const$5.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { - return (long)timespec.tv_sec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$0.const$5.get(seg.asSlice(index*sizeof())); } public static void tv_sec$set(MemorySegment seg, long index, long x) { - timespec.tv_sec$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle tv_nsec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); public static VarHandle tv_nsec$VH() { - return timespec.tv_nsec$VH; + return constants$1.const$0; } /** * Getter for field: * {@snippet : - * __syscall_slong_t tv_nsec; + * long tv_nsec; * } */ public static long tv_nsec$get(MemorySegment seg) { - return (long)timespec.tv_nsec$VH.get(seg); + return (long)constants$1.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __syscall_slong_t tv_nsec; + * long tv_nsec; * } */ public static void tv_nsec$set(MemorySegment seg, long x) { - timespec.tv_nsec$VH.set(seg, x); + constants$1.const$0.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { - return (long)timespec.tv_nsec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$1.const$0.get(seg.asSlice(index*sizeof())); } public static void tv_nsec$set(MemorySegment seg, long index, long x) { - timespec.tv_nsec$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$0.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/RuntimeHelper.java new file mode 100644 index 00000000..9fb80431 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/constants$0.java new file mode 100644 index 00000000..209311fc --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/constants$0.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("singlethread"), + JAVA_INT.withName("foreground"), + JAVA_INT.withName("debug"), + JAVA_INT.withName("nodefault_subtype"), + RuntimeHelper.POINTER.withName("mountpoint"), + JAVA_INT.withName("show_version"), + JAVA_INT.withName("show_help"), + JAVA_INT.withName("clone_fd"), + JAVA_INT.withName("max_idle_threads"), + JAVA_INT.withName("max_threads"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_cmdline_opts"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("singlethread")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("foreground")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("debug")); + static final VarHandle const$4 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("nodefault_subtype")); + static final VarHandle const$5 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("mountpoint")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/constants$1.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/constants$1.java new file mode 100644 index 00000000..4060249a --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/constants$1.java @@ -0,0 +1,21 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final VarHandle const$0 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("show_version")); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("show_help")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); + static final VarHandle const$4 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("max_threads")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_cmdline_opts.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/fuse_cmdline_opts.java similarity index 53% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_cmdline_opts.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/fuse_cmdline_opts.java index c88d9cee..3e30b0c6 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_cmdline_opts.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/fuse_cmdline_opts.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -25,25 +25,11 @@ */ public class fuse_cmdline_opts { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("singlethread"), - Constants$root.C_INT$LAYOUT.withName("foreground"), - Constants$root.C_INT$LAYOUT.withName("debug"), - Constants$root.C_INT$LAYOUT.withName("nodefault_subtype"), - Constants$root.C_POINTER$LAYOUT.withName("mountpoint"), - Constants$root.C_INT$LAYOUT.withName("show_version"), - Constants$root.C_INT$LAYOUT.withName("show_help"), - Constants$root.C_INT$LAYOUT.withName("clone_fd"), - Constants$root.C_INT$LAYOUT.withName("max_idle_threads"), - Constants$root.C_INT$LAYOUT.withName("max_threads"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_cmdline_opts"); public static MemoryLayout $LAYOUT() { - return fuse_cmdline_opts.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle singlethread$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("singlethread")); public static VarHandle singlethread$VH() { - return fuse_cmdline_opts.singlethread$VH; + return constants$0.const$1; } /** * Getter for field: @@ -52,7 +38,7 @@ public class fuse_cmdline_opts { * } */ public static int singlethread$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.singlethread$VH.get(seg); + return (int)constants$0.const$1.get(seg); } /** * Setter for field: @@ -61,17 +47,16 @@ public class fuse_cmdline_opts { * } */ public static void singlethread$set(MemorySegment seg, int x) { - fuse_cmdline_opts.singlethread$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static int singlethread$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.singlethread$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void singlethread$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.singlethread$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle foreground$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("foreground")); public static VarHandle foreground$VH() { - return fuse_cmdline_opts.foreground$VH; + return constants$0.const$2; } /** * Getter for field: @@ -80,7 +65,7 @@ public class fuse_cmdline_opts { * } */ public static int foreground$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.foreground$VH.get(seg); + return (int)constants$0.const$2.get(seg); } /** * Setter for field: @@ -89,17 +74,16 @@ public class fuse_cmdline_opts { * } */ public static void foreground$set(MemorySegment seg, int x) { - fuse_cmdline_opts.foreground$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static int foreground$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.foreground$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void foreground$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.foreground$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle debug$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("debug")); public static VarHandle debug$VH() { - return fuse_cmdline_opts.debug$VH; + return constants$0.const$3; } /** * Getter for field: @@ -108,7 +92,7 @@ public class fuse_cmdline_opts { * } */ public static int debug$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.debug$VH.get(seg); + return (int)constants$0.const$3.get(seg); } /** * Setter for field: @@ -117,17 +101,16 @@ public class fuse_cmdline_opts { * } */ public static void debug$set(MemorySegment seg, int x) { - fuse_cmdline_opts.debug$VH.set(seg, x); + constants$0.const$3.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.debug$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$3.get(seg.asSlice(index*sizeof())); } public static void debug$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.debug$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle nodefault_subtype$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("nodefault_subtype")); public static VarHandle nodefault_subtype$VH() { - return fuse_cmdline_opts.nodefault_subtype$VH; + return constants$0.const$4; } /** * Getter for field: @@ -136,7 +119,7 @@ public class fuse_cmdline_opts { * } */ public static int nodefault_subtype$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.nodefault_subtype$VH.get(seg); + return (int)constants$0.const$4.get(seg); } /** * Setter for field: @@ -145,17 +128,16 @@ public class fuse_cmdline_opts { * } */ public static void nodefault_subtype$set(MemorySegment seg, int x) { - fuse_cmdline_opts.nodefault_subtype$VH.set(seg, x); + constants$0.const$4.set(seg, x); } public static int nodefault_subtype$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.nodefault_subtype$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$4.get(seg.asSlice(index*sizeof())); } public static void nodefault_subtype$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.nodefault_subtype$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle mountpoint$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mountpoint")); public static VarHandle mountpoint$VH() { - return fuse_cmdline_opts.mountpoint$VH; + return constants$0.const$5; } /** * Getter for field: @@ -164,7 +146,7 @@ public class fuse_cmdline_opts { * } */ public static MemorySegment mountpoint$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$0.const$5.get(seg); } /** * Setter for field: @@ -173,17 +155,16 @@ public class fuse_cmdline_opts { * } */ public static void mountpoint$set(MemorySegment seg, MemorySegment x) { - fuse_cmdline_opts.mountpoint$VH.set(seg, x); + constants$0.const$5.set(seg, x); } public static MemorySegment mountpoint$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$0.const$5.get(seg.asSlice(index*sizeof())); } public static void mountpoint$set(MemorySegment seg, long index, MemorySegment x) { - fuse_cmdline_opts.mountpoint$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_version$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_version")); public static VarHandle show_version$VH() { - return fuse_cmdline_opts.show_version$VH; + return constants$1.const$0; } /** * Getter for field: @@ -192,7 +173,7 @@ public class fuse_cmdline_opts { * } */ public static int show_version$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.show_version$VH.get(seg); + return (int)constants$1.const$0.get(seg); } /** * Setter for field: @@ -201,17 +182,16 @@ public class fuse_cmdline_opts { * } */ public static void show_version$set(MemorySegment seg, int x) { - fuse_cmdline_opts.show_version$VH.set(seg, x); + constants$1.const$0.set(seg, x); } public static int show_version$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.show_version$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$0.get(seg.asSlice(index*sizeof())); } public static void show_version$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.show_version$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_help$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_help")); public static VarHandle show_help$VH() { - return fuse_cmdline_opts.show_help$VH; + return constants$1.const$1; } /** * Getter for field: @@ -220,7 +200,7 @@ public class fuse_cmdline_opts { * } */ public static int show_help$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.show_help$VH.get(seg); + return (int)constants$1.const$1.get(seg); } /** * Setter for field: @@ -229,17 +209,16 @@ public class fuse_cmdline_opts { * } */ public static void show_help$set(MemorySegment seg, int x) { - fuse_cmdline_opts.show_help$VH.set(seg, x); + constants$1.const$1.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.show_help$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$1.get(seg.asSlice(index*sizeof())); } public static void show_help$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.show_help$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle clone_fd$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); public static VarHandle clone_fd$VH() { - return fuse_cmdline_opts.clone_fd$VH; + return constants$1.const$2; } /** * Getter for field: @@ -248,7 +227,7 @@ public class fuse_cmdline_opts { * } */ public static int clone_fd$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.clone_fd$VH.get(seg); + return (int)constants$1.const$2.get(seg); } /** * Setter for field: @@ -257,17 +236,16 @@ public class fuse_cmdline_opts { * } */ public static void clone_fd$set(MemorySegment seg, int x) { - fuse_cmdline_opts.clone_fd$VH.set(seg, x); + constants$1.const$2.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.clone_fd$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$2.get(seg.asSlice(index*sizeof())); } public static void clone_fd$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.clone_fd$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_idle_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); public static VarHandle max_idle_threads$VH() { - return fuse_cmdline_opts.max_idle_threads$VH; + return constants$1.const$3; } /** * Getter for field: @@ -276,7 +254,7 @@ public class fuse_cmdline_opts { * } */ public static int max_idle_threads$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.max_idle_threads$VH.get(seg); + return (int)constants$1.const$3.get(seg); } /** * Setter for field: @@ -285,17 +263,16 @@ public class fuse_cmdline_opts { * } */ public static void max_idle_threads$set(MemorySegment seg, int x) { - fuse_cmdline_opts.max_idle_threads$VH.set(seg, x); + constants$1.const$3.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.max_idle_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$3.get(seg.asSlice(index*sizeof())); } public static void max_idle_threads$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.max_idle_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_threads")); public static VarHandle max_threads$VH() { - return fuse_cmdline_opts.max_threads$VH; + return constants$1.const$4; } /** * Getter for field: @@ -304,7 +281,7 @@ public class fuse_cmdline_opts { * } */ public static int max_threads$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.max_threads$VH.get(seg); + return (int)constants$1.const$4.get(seg); } /** * Setter for field: @@ -313,20 +290,20 @@ public class fuse_cmdline_opts { * } */ public static void max_threads$set(MemorySegment seg, int x) { - fuse_cmdline_opts.max_threads$VH.set(seg, x); + constants$1.const$4.set(seg, x); } public static int max_threads$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.max_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$4.get(seg.asSlice(index*sizeof())); } public static void max_threads$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.max_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$4.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/fuse_lowlevel_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/fuse_lowlevel_h.java new file mode 100644 index 00000000..0d0c510c --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse3_lowlevel/fuse_lowlevel_h.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class fuse_lowlevel_h { + + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_file_info.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_file_info.java deleted file mode 100644 index 6fc89b7c..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_file_info.java +++ /dev/null @@ -1,175 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -/** - * {@snippet : - * struct fuse_file_info { - * int flags; - * * unsigned int writepage; - * unsigned int direct_io; - * unsigned int keep_cache; - * unsigned int flush; - * unsigned int nonseekable; - * unsigned int flock_release; - * unsigned int cache_readdir; - * unsigned int noflush; - * unsigned int padding; - * unsigned int padding2; - * uint64_t fh; - * uint64_t lock_owner; - * uint32_t poll_events; - * }; - * } - */ -public class fuse_file_info { - - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("flags"), - MemoryLayout.structLayout( - MemoryLayout.paddingLayout(1).withName("writepage"), - MemoryLayout.paddingLayout(1).withName("direct_io"), - MemoryLayout.paddingLayout(1).withName("keep_cache"), - MemoryLayout.paddingLayout(1).withName("flush"), - MemoryLayout.paddingLayout(1).withName("nonseekable"), - MemoryLayout.paddingLayout(1).withName("flock_release"), - MemoryLayout.paddingLayout(1).withName("cache_readdir"), - MemoryLayout.paddingLayout(1).withName("noflush"), - MemoryLayout.paddingLayout(24).withName("padding"), - MemoryLayout.paddingLayout(32).withName("padding2"), - MemoryLayout.paddingLayout(32) - ), - Constants$root.C_LONG_LONG$LAYOUT.withName("fh"), - Constants$root.C_LONG_LONG$LAYOUT.withName("lock_owner"), - Constants$root.C_INT$LAYOUT.withName("poll_events"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_file_info"); - public static MemoryLayout $LAYOUT() { - return fuse_file_info.$struct$LAYOUT; - } - static final VarHandle flags$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flags")); - public static VarHandle flags$VH() { - return fuse_file_info.flags$VH; - } - /** - * Getter for field: - * {@snippet : - * int flags; - * } - */ - public static int flags$get(MemorySegment seg) { - return (int)fuse_file_info.flags$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int flags; - * } - */ - public static void flags$set(MemorySegment seg, int x) { - fuse_file_info.flags$VH.set(seg, x); - } - public static int flags$get(MemorySegment seg, long index) { - return (int)fuse_file_info.flags$VH.get(seg.asSlice(index*sizeof())); - } - public static void flags$set(MemorySegment seg, long index, int x) { - fuse_file_info.flags$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle fh$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fh")); - public static VarHandle fh$VH() { - return fuse_file_info.fh$VH; - } - /** - * Getter for field: - * {@snippet : - * uint64_t fh; - * } - */ - public static long fh$get(MemorySegment seg) { - return (long)fuse_file_info.fh$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * uint64_t fh; - * } - */ - public static void fh$set(MemorySegment seg, long x) { - fuse_file_info.fh$VH.set(seg, x); - } - public static long fh$get(MemorySegment seg, long index) { - return (long)fuse_file_info.fh$VH.get(seg.asSlice(index*sizeof())); - } - public static void fh$set(MemorySegment seg, long index, long x) { - fuse_file_info.fh$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle lock_owner$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); - public static VarHandle lock_owner$VH() { - return fuse_file_info.lock_owner$VH; - } - /** - * Getter for field: - * {@snippet : - * uint64_t lock_owner; - * } - */ - public static long lock_owner$get(MemorySegment seg) { - return (long)fuse_file_info.lock_owner$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * uint64_t lock_owner; - * } - */ - public static void lock_owner$set(MemorySegment seg, long x) { - fuse_file_info.lock_owner$VH.set(seg, x); - } - public static long lock_owner$get(MemorySegment seg, long index) { - return (long)fuse_file_info.lock_owner$VH.get(seg.asSlice(index*sizeof())); - } - public static void lock_owner$set(MemorySegment seg, long index, long x) { - fuse_file_info.lock_owner$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle poll_events$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll_events")); - public static VarHandle poll_events$VH() { - return fuse_file_info.poll_events$VH; - } - /** - * Getter for field: - * {@snippet : - * uint32_t poll_events; - * } - */ - public static int poll_events$get(MemorySegment seg) { - return (int)fuse_file_info.poll_events$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * uint32_t poll_events; - * } - */ - public static void poll_events$set(MemorySegment seg, int x) { - fuse_file_info.poll_events$VH.set(seg, x); - } - public static int poll_events$get(MemorySegment seg, long index) { - return (int)fuse_file_info.poll_events$VH.get(seg.asSlice(index*sizeof())); - } - public static void poll_events$set(MemorySegment seg, long index, int x) { - fuse_file_info.poll_events$VH.set(seg.asSlice(index*sizeof()), x); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_lowlevel_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_lowlevel_h.java deleted file mode 100644 index de75bf11..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_lowlevel_h.java +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class fuse_lowlevel_h { - - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_operations.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_operations.java deleted file mode 100644 index df3e2cfd..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_operations.java +++ /dev/null @@ -1,2728 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -/** - * {@snippet : - * struct fuse_operations { - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * int (*readlink)(char*,char*,size_t); - * int (*mknod)(char*,mode_t,dev_t); - * int (*mkdir)(char*,mode_t); - * int (*unlink)(char*); - * int (*rmdir)(char*); - * int (*symlink)(char*,char*); - * int (*rename)(char*,char*,unsigned int); - * int (*link)(char*,char*); - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * int (*open)(char*,struct fuse_file_info*); - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * int (*statfs)(char*,struct statvfs*); - * int (*flush)(char*,struct fuse_file_info*); - * int (*release)(char*,struct fuse_file_info*); - * int (*fsync)(char*,int,struct fuse_file_info*); - * int (*setxattr)(char*,char*,char*,size_t,int); - * int (*getxattr)(char*,char*,char*,size_t); - * int (*listxattr)(char*,char*,size_t); - * int (*removexattr)(char*,char*); - * int (*opendir)(char*,struct fuse_file_info*); - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * int (*releasedir)(char*,struct fuse_file_info*); - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * void (*destroy)(void*); - * int (*access)(char*,int); - * int (*create)(char*,mode_t,struct fuse_file_info*); - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * int (*bmap)(char*,size_t,uint64_t*); - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * int (*flock)(char*,struct fuse_file_info*,int); - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * }; - * } - */ -public class fuse_operations { - - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_POINTER$LAYOUT.withName("getattr"), - Constants$root.C_POINTER$LAYOUT.withName("readlink"), - Constants$root.C_POINTER$LAYOUT.withName("mknod"), - Constants$root.C_POINTER$LAYOUT.withName("mkdir"), - Constants$root.C_POINTER$LAYOUT.withName("unlink"), - Constants$root.C_POINTER$LAYOUT.withName("rmdir"), - Constants$root.C_POINTER$LAYOUT.withName("symlink"), - Constants$root.C_POINTER$LAYOUT.withName("rename"), - Constants$root.C_POINTER$LAYOUT.withName("link"), - Constants$root.C_POINTER$LAYOUT.withName("chmod"), - Constants$root.C_POINTER$LAYOUT.withName("chown"), - Constants$root.C_POINTER$LAYOUT.withName("truncate"), - Constants$root.C_POINTER$LAYOUT.withName("open"), - Constants$root.C_POINTER$LAYOUT.withName("read"), - Constants$root.C_POINTER$LAYOUT.withName("write"), - Constants$root.C_POINTER$LAYOUT.withName("statfs"), - Constants$root.C_POINTER$LAYOUT.withName("flush"), - Constants$root.C_POINTER$LAYOUT.withName("release"), - Constants$root.C_POINTER$LAYOUT.withName("fsync"), - Constants$root.C_POINTER$LAYOUT.withName("setxattr"), - Constants$root.C_POINTER$LAYOUT.withName("getxattr"), - Constants$root.C_POINTER$LAYOUT.withName("listxattr"), - Constants$root.C_POINTER$LAYOUT.withName("removexattr"), - Constants$root.C_POINTER$LAYOUT.withName("opendir"), - Constants$root.C_POINTER$LAYOUT.withName("readdir"), - Constants$root.C_POINTER$LAYOUT.withName("releasedir"), - Constants$root.C_POINTER$LAYOUT.withName("fsyncdir"), - Constants$root.C_POINTER$LAYOUT.withName("init"), - Constants$root.C_POINTER$LAYOUT.withName("destroy"), - Constants$root.C_POINTER$LAYOUT.withName("access"), - Constants$root.C_POINTER$LAYOUT.withName("create"), - Constants$root.C_POINTER$LAYOUT.withName("lock"), - Constants$root.C_POINTER$LAYOUT.withName("utimens"), - Constants$root.C_POINTER$LAYOUT.withName("bmap"), - Constants$root.C_POINTER$LAYOUT.withName("ioctl"), - Constants$root.C_POINTER$LAYOUT.withName("poll"), - Constants$root.C_POINTER$LAYOUT.withName("write_buf"), - Constants$root.C_POINTER$LAYOUT.withName("read_buf"), - Constants$root.C_POINTER$LAYOUT.withName("flock"), - Constants$root.C_POINTER$LAYOUT.withName("fallocate"), - Constants$root.C_POINTER$LAYOUT.withName("copy_file_range"), - Constants$root.C_POINTER$LAYOUT.withName("lseek") - ).withName("fuse_operations"); - public static MemoryLayout $LAYOUT() { - return fuse_operations.$struct$LAYOUT; - } - static final FunctionDescriptor getattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.getattr$FUNC - ); - /** - * {@snippet : - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public interface getattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(getattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse_operations.getattr$FUNC, scope); - } - static getattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.getattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getattr")); - public static VarHandle getattr$VH() { - return fuse_operations.getattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public static MemorySegment getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public static void getattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getattr$VH.set(seg, x); - } - public static MemorySegment getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getattr getattr(MemorySegment segment, SegmentScope scope) { - return getattr.ofAddress(getattr$get(segment), scope); - } - static final FunctionDescriptor readlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle readlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.readlink$FUNC - ); - /** - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public interface readlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(readlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse_operations.readlink$FUNC, scope); - } - static readlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readlink")); - public static VarHandle readlink$VH() { - return fuse_operations.readlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public static MemorySegment readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.readlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public static void readlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.readlink$VH.set(seg, x); - } - public static MemorySegment readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.readlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.readlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readlink readlink(MemorySegment segment, SegmentScope scope) { - return readlink.ofAddress(readlink$get(segment), scope); - } - static final FunctionDescriptor mknod$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle mknod$MH = RuntimeHelper.downcallHandle( - fuse_operations.mknod$FUNC - ); - /** - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public interface mknod { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2); - static MemorySegment allocate(mknod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse_operations.mknod$FUNC, scope); - } - static mknod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2) -> { - try { - return (int)fuse_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mknod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mknod")); - public static VarHandle mknod$VH() { - return fuse_operations.mknod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public static MemorySegment mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.mknod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public static void mknod$set(MemorySegment seg, MemorySegment x) { - fuse_operations.mknod$VH.set(seg, x); - } - public static MemorySegment mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.mknod$VH.get(seg.asSlice(index*sizeof())); - } - public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.mknod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mknod mknod(MemorySegment segment, SegmentScope scope) { - return mknod.ofAddress(mknod$get(segment), scope); - } - static final FunctionDescriptor mkdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle mkdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.mkdir$FUNC - ); - /** - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public interface mkdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(mkdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse_operations.mkdir$FUNC, scope); - } - static mkdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mkdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); - public static VarHandle mkdir$VH() { - return fuse_operations.mkdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public static MemorySegment mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.mkdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public static void mkdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.mkdir$VH.set(seg, x); - } - public static MemorySegment mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.mkdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mkdir mkdir(MemorySegment segment, SegmentScope scope) { - return mkdir.ofAddress(mkdir$get(segment), scope); - } - static final FunctionDescriptor unlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.unlink$FUNC - ); - /** - * {@snippet : - * int (*unlink)(char*); - * } - */ - public interface unlink { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(unlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse_operations.unlink$FUNC, scope); - } - static unlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse_operations.unlink$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle unlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("unlink")); - public static VarHandle unlink$VH() { - return fuse_operations.unlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static MemorySegment unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.unlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static void unlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.unlink$VH.set(seg, x); - } - public static MemorySegment unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.unlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.unlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static unlink unlink(MemorySegment segment, SegmentScope scope) { - return unlink.ofAddress(unlink$get(segment), scope); - } - static final FunctionDescriptor rmdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.rmdir$FUNC - ); - /** - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public interface rmdir { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(rmdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse_operations.rmdir$FUNC, scope); - } - static rmdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse_operations.rmdir$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rmdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); - public static VarHandle rmdir$VH() { - return fuse_operations.rmdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static MemorySegment rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.rmdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static void rmdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.rmdir$VH.set(seg, x); - } - public static MemorySegment rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.rmdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rmdir rmdir(MemorySegment segment, SegmentScope scope) { - return rmdir.ofAddress(rmdir$get(segment), scope); - } - static final FunctionDescriptor symlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.symlink$FUNC - ); - /** - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public interface symlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(symlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse_operations.symlink$FUNC, scope); - } - static symlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.symlink$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle symlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("symlink")); - public static VarHandle symlink$VH() { - return fuse_operations.symlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static MemorySegment symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.symlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static void symlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.symlink$VH.set(seg, x); - } - public static MemorySegment symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.symlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.symlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static symlink symlink(MemorySegment segment, SegmentScope scope) { - return symlink.ofAddress(symlink$get(segment), scope); - } - static final FunctionDescriptor rename$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( - fuse_operations.rename$FUNC - ); - /** - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public interface rename { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(rename fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse_operations.rename$FUNC, scope); - } - static rename ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse_operations.rename$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rename$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rename")); - public static VarHandle rename$VH() { - return fuse_operations.rename$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public static MemorySegment rename$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.rename$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public static void rename$set(MemorySegment seg, MemorySegment x) { - fuse_operations.rename$VH.set(seg, x); - } - public static MemorySegment rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.rename$VH.get(seg.asSlice(index*sizeof())); - } - public static void rename$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.rename$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rename rename(MemorySegment segment, SegmentScope scope) { - return rename.ofAddress(rename$get(segment), scope); - } - static final FunctionDescriptor link$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle link$MH = RuntimeHelper.downcallHandle( - fuse_operations.link$FUNC - ); - /** - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public interface link { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(link fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(link.class, fi, fuse_operations.link$FUNC, scope); - } - static link ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.link$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle link$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("link")); - public static VarHandle link$VH() { - return fuse_operations.link$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static MemorySegment link$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.link$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static void link$set(MemorySegment seg, MemorySegment x) { - fuse_operations.link$VH.set(seg, x); - } - public static MemorySegment link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.link$VH.get(seg.asSlice(index*sizeof())); - } - public static void link$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.link$VH.set(seg.asSlice(index*sizeof()), x); - } - public static link link(MemorySegment segment, SegmentScope scope) { - return link.ofAddress(link$get(segment), scope); - } - static final FunctionDescriptor chmod$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle chmod$MH = RuntimeHelper.downcallHandle( - fuse_operations.chmod$FUNC - ); - /** - * {@snippet : - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * } - */ - public interface chmod { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(chmod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse_operations.chmod$FUNC, scope); - } - static chmod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.chmod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chmod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chmod")); - public static VarHandle chmod$VH() { - return fuse_operations.chmod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static MemorySegment chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.chmod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static void chmod$set(MemorySegment seg, MemorySegment x) { - fuse_operations.chmod$VH.set(seg, x); - } - public static MemorySegment chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.chmod$VH.get(seg.asSlice(index*sizeof())); - } - public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.chmod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chmod chmod(MemorySegment segment, SegmentScope scope) { - return chmod.ofAddress(chmod$get(segment), scope); - } - static final FunctionDescriptor chown$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle chown$MH = RuntimeHelper.downcallHandle( - fuse_operations.chown$FUNC - ); - /** - * {@snippet : - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * } - */ - public interface chown { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(chown fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse_operations.chown$FUNC, scope); - } - static chown ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chown$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chown")); - public static VarHandle chown$VH() { - return fuse_operations.chown$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * } - */ - public static MemorySegment chown$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.chown$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * } - */ - public static void chown$set(MemorySegment seg, MemorySegment x) { - fuse_operations.chown$VH.set(seg, x); - } - public static MemorySegment chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.chown$VH.get(seg.asSlice(index*sizeof())); - } - public static void chown$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.chown$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chown chown(MemorySegment segment, SegmentScope scope) { - return chown.ofAddress(chown$get(segment), scope); - } - static final FunctionDescriptor truncate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle truncate$MH = RuntimeHelper.downcallHandle( - fuse_operations.truncate$FUNC - ); - /** - * {@snippet : - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public interface truncate { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(truncate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse_operations.truncate$FUNC, scope); - } - static truncate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.truncate$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle truncate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("truncate")); - public static VarHandle truncate$VH() { - return fuse_operations.truncate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.truncate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public static void truncate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.truncate$VH.set(seg, x); - } - public static MemorySegment truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.truncate$VH.get(seg.asSlice(index*sizeof())); - } - public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.truncate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static truncate truncate(MemorySegment segment, SegmentScope scope) { - return truncate.ofAddress(truncate$get(segment), scope); - } - static final FunctionDescriptor open$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle open$MH = RuntimeHelper.downcallHandle( - fuse_operations.open$FUNC - ); - /** - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public interface open { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(open fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(open.class, fi, fuse_operations.open$FUNC, scope); - } - static open ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.open$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle open$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("open")); - public static VarHandle open$VH() { - return fuse_operations.open$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment open$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.open$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public static void open$set(MemorySegment seg, MemorySegment x) { - fuse_operations.open$VH.set(seg, x); - } - public static MemorySegment open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.open$VH.get(seg.asSlice(index*sizeof())); - } - public static void open$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.open$VH.set(seg.asSlice(index*sizeof()), x); - } - public static open open(MemorySegment segment, SegmentScope scope) { - return open.ofAddress(open$get(segment), scope); - } - static final FunctionDescriptor read$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read$MH = RuntimeHelper.downcallHandle( - fuse_operations.read$FUNC - ); - /** - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface read { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read.class, fi, fuse_operations.read$FUNC, scope); - } - static read ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read")); - public static VarHandle read$VH() { - return fuse_operations.read$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment read$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.read$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void read$set(MemorySegment seg, MemorySegment x) { - fuse_operations.read$VH.set(seg, x); - } - public static MemorySegment read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.read$VH.get(seg.asSlice(index*sizeof())); - } - public static void read$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.read$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read read(MemorySegment segment, SegmentScope scope) { - return read.ofAddress(read$get(segment), scope); - } - static final FunctionDescriptor write$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write$MH = RuntimeHelper.downcallHandle( - fuse_operations.write$FUNC - ); - /** - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface write { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(write fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write.class, fi, fuse_operations.write$FUNC, scope); - } - static write ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write")); - public static VarHandle write$VH() { - return fuse_operations.write$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment write$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.write$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void write$set(MemorySegment seg, MemorySegment x) { - fuse_operations.write$VH.set(seg, x); - } - public static MemorySegment write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.write$VH.get(seg.asSlice(index*sizeof())); - } - public static void write$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.write$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write write(MemorySegment segment, SegmentScope scope) { - return write.ofAddress(write$get(segment), scope); - } - static final FunctionDescriptor statfs$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle statfs$MH = RuntimeHelper.downcallHandle( - fuse_operations.statfs$FUNC - ); - /** - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public interface statfs { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(statfs fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse_operations.statfs$FUNC, scope); - } - static statfs ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.statfs$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle statfs$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("statfs")); - public static VarHandle statfs$VH() { - return fuse_operations.statfs$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public static MemorySegment statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.statfs$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public static void statfs$set(MemorySegment seg, MemorySegment x) { - fuse_operations.statfs$VH.set(seg, x); - } - public static MemorySegment statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.statfs$VH.get(seg.asSlice(index*sizeof())); - } - public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.statfs$VH.set(seg.asSlice(index*sizeof()), x); - } - public static statfs statfs(MemorySegment segment, SegmentScope scope) { - return statfs.ofAddress(statfs$get(segment), scope); - } - static final FunctionDescriptor flush$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle flush$MH = RuntimeHelper.downcallHandle( - fuse_operations.flush$FUNC - ); - /** - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public interface flush { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(flush fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse_operations.flush$FUNC, scope); - } - static flush ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.flush$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flush$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flush")); - public static VarHandle flush$VH() { - return fuse_operations.flush$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment flush$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.flush$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public static void flush$set(MemorySegment seg, MemorySegment x) { - fuse_operations.flush$VH.set(seg, x); - } - public static MemorySegment flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.flush$VH.get(seg.asSlice(index*sizeof())); - } - public static void flush$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.flush$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flush flush(MemorySegment segment, SegmentScope scope) { - return flush.ofAddress(flush$get(segment), scope); - } - static final FunctionDescriptor release$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle release$MH = RuntimeHelper.downcallHandle( - fuse_operations.release$FUNC - ); - /** - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public interface release { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(release fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(release.class, fi, fuse_operations.release$FUNC, scope); - } - static release ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.release$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle release$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("release")); - public static VarHandle release$VH() { - return fuse_operations.release$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment release$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.release$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public static void release$set(MemorySegment seg, MemorySegment x) { - fuse_operations.release$VH.set(seg, x); - } - public static MemorySegment release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.release$VH.get(seg.asSlice(index*sizeof())); - } - public static void release$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.release$VH.set(seg.asSlice(index*sizeof()), x); - } - public static release release(MemorySegment segment, SegmentScope scope) { - return release.ofAddress(release$get(segment), scope); - } - static final FunctionDescriptor fsync$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsync$MH = RuntimeHelper.downcallHandle( - fuse_operations.fsync$FUNC - ); - /** - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public interface fsync { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsync fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse_operations.fsync$FUNC, scope); - } - static fsync ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsync$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsync")); - public static VarHandle fsync$VH() { - return fuse_operations.fsync$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public static MemorySegment fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsync$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public static void fsync$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fsync$VH.set(seg, x); - } - public static MemorySegment fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsync$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fsync$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsync fsync(MemorySegment segment, SegmentScope scope) { - return fsync.ofAddress(fsync$get(segment), scope); - } - static final FunctionDescriptor setxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle setxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.setxattr$FUNC - ); - /** - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public interface setxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse_operations.setxattr$FUNC, scope); - } - static setxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { - try { - return (int)fuse_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle setxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); - public static VarHandle setxattr$VH() { - return fuse_operations.setxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public static MemorySegment setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.setxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public static void setxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.setxattr$VH.set(seg, x); - } - public static MemorySegment setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.setxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static setxattr setxattr(MemorySegment segment, SegmentScope scope) { - return setxattr.ofAddress(setxattr$get(segment), scope); - } - static final FunctionDescriptor getxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle getxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.getxattr$FUNC - ); - /** - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public interface getxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); - static MemorySegment allocate(getxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse_operations.getxattr$FUNC, scope); - } - static getxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { - try { - return (int)fuse_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); - public static VarHandle getxattr$VH() { - return fuse_operations.getxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public static MemorySegment getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public static void getxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getxattr$VH.set(seg, x); - } - public static MemorySegment getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getxattr getxattr(MemorySegment segment, SegmentScope scope) { - return getxattr.ofAddress(getxattr$get(segment), scope); - } - static final FunctionDescriptor listxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle listxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.listxattr$FUNC - ); - /** - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public interface listxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(listxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse_operations.listxattr$FUNC, scope); - } - static listxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle listxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); - public static VarHandle listxattr$VH() { - return fuse_operations.listxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public static MemorySegment listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.listxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public static void listxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.listxattr$VH.set(seg, x); - } - public static MemorySegment listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.listxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static listxattr listxattr(MemorySegment segment, SegmentScope scope) { - return listxattr.ofAddress(listxattr$get(segment), scope); - } - static final FunctionDescriptor removexattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.removexattr$FUNC - ); - /** - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public interface removexattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(removexattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse_operations.removexattr$FUNC, scope); - } - static removexattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle removexattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); - public static VarHandle removexattr$VH() { - return fuse_operations.removexattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static MemorySegment removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.removexattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static void removexattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.removexattr$VH.set(seg, x); - } - public static MemorySegment removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.removexattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static removexattr removexattr(MemorySegment segment, SegmentScope scope) { - return removexattr.ofAddress(removexattr$get(segment), scope); - } - static final FunctionDescriptor opendir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle opendir$MH = RuntimeHelper.downcallHandle( - fuse_operations.opendir$FUNC - ); - /** - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public interface opendir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(opendir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse_operations.opendir$FUNC, scope); - } - static opendir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.opendir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle opendir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("opendir")); - public static VarHandle opendir$VH() { - return fuse_operations.opendir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.opendir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public static void opendir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.opendir$VH.set(seg, x); - } - public static MemorySegment opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.opendir$VH.get(seg.asSlice(index*sizeof())); - } - public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.opendir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static opendir opendir(MemorySegment segment, SegmentScope scope) { - return opendir.ofAddress(opendir$get(segment), scope); - } - static final FunctionDescriptor readdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle readdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.readdir$FUNC - ); - /** - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * } - */ - public interface readdir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4, int _x5); - static MemorySegment allocate(readdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse_operations.readdir$FUNC, scope); - } - static readdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4, int __x5) -> { - try { - return (int)fuse_operations.readdir$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir")); - public static VarHandle readdir$VH() { - return fuse_operations.readdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * } - */ - public static MemorySegment readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.readdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * } - */ - public static void readdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.readdir$VH.set(seg, x); - } - public static MemorySegment readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.readdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.readdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readdir readdir(MemorySegment segment, SegmentScope scope) { - return readdir.ofAddress(readdir$get(segment), scope); - } - static final FunctionDescriptor releasedir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle releasedir$MH = RuntimeHelper.downcallHandle( - fuse_operations.releasedir$FUNC - ); - /** - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public interface releasedir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(releasedir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse_operations.releasedir$FUNC, scope); - } - static releasedir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle releasedir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); - public static VarHandle releasedir$VH() { - return fuse_operations.releasedir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.releasedir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public static void releasedir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.releasedir$VH.set(seg, x); - } - public static MemorySegment releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); - } - public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.releasedir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static releasedir releasedir(MemorySegment segment, SegmentScope scope) { - return releasedir.ofAddress(releasedir$get(segment), scope); - } - static final FunctionDescriptor fsyncdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsyncdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.fsyncdir$FUNC - ); - /** - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public interface fsyncdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsyncdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse_operations.fsyncdir$FUNC, scope); - } - static fsyncdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsyncdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); - public static VarHandle fsyncdir$VH() { - return fuse_operations.fsyncdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public static MemorySegment fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsyncdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fsyncdir$VH.set(seg, x); - } - public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fsyncdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsyncdir fsyncdir(MemorySegment segment, SegmentScope scope) { - return fsyncdir.ofAddress(fsyncdir$get(segment), scope); - } - static final FunctionDescriptor init$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle init$MH = RuntimeHelper.downcallHandle( - fuse_operations.init$FUNC - ); - /** - * {@snippet : - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * } - */ - public interface init { - - java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(init fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(init.class, fi, fuse_operations.init$FUNC, scope); - } - static init ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (java.lang.foreign.MemorySegment)fuse_operations.init$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle init$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("init")); - public static VarHandle init$VH() { - return fuse_operations.init$VH; - } - /** - * Getter for field: - * {@snippet : - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * } - */ - public static MemorySegment init$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.init$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * } - */ - public static void init$set(MemorySegment seg, MemorySegment x) { - fuse_operations.init$VH.set(seg, x); - } - public static MemorySegment init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.init$VH.get(seg.asSlice(index*sizeof())); - } - public static void init$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.init$VH.set(seg.asSlice(index*sizeof()), x); - } - public static init init(MemorySegment segment, SegmentScope scope) { - return init.ofAddress(init$get(segment), scope); - } - static final FunctionDescriptor destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( - fuse_operations.destroy$FUNC - ); - /** - * {@snippet : - * void (*destroy)(void*); - * } - */ - public interface destroy { - - void apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(destroy fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse_operations.destroy$FUNC, scope); - } - static destroy ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - fuse_operations.destroy$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle destroy$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("destroy")); - public static VarHandle destroy$VH() { - return fuse_operations.destroy$VH; - } - /** - * Getter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static MemorySegment destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.destroy$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static void destroy$set(MemorySegment seg, MemorySegment x) { - fuse_operations.destroy$VH.set(seg, x); - } - public static MemorySegment destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.destroy$VH.get(seg.asSlice(index*sizeof())); - } - public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.destroy$VH.set(seg.asSlice(index*sizeof()), x); - } - public static destroy destroy(MemorySegment segment, SegmentScope scope) { - return destroy.ofAddress(destroy$get(segment), scope); - } - static final FunctionDescriptor access$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle access$MH = RuntimeHelper.downcallHandle( - fuse_operations.access$FUNC - ); - /** - * {@snippet : - * int (*access)(char*,int); - * } - */ - public interface access { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(access fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(access.class, fi, fuse_operations.access$FUNC, scope); - } - static access ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse_operations.access$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle access$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("access")); - public static VarHandle access$VH() { - return fuse_operations.access$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static MemorySegment access$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.access$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static void access$set(MemorySegment seg, MemorySegment x) { - fuse_operations.access$VH.set(seg, x); - } - public static MemorySegment access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.access$VH.get(seg.asSlice(index*sizeof())); - } - public static void access$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.access$VH.set(seg.asSlice(index*sizeof()), x); - } - public static access access(MemorySegment segment, SegmentScope scope) { - return access.ofAddress(access$get(segment), scope); - } - static final FunctionDescriptor create$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle create$MH = RuntimeHelper.downcallHandle( - fuse_operations.create$FUNC - ); - /** - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public interface create { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(create fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(create.class, fi, fuse_operations.create$FUNC, scope); - } - static create ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle create$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("create")); - public static VarHandle create$VH() { - return fuse_operations.create$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static MemorySegment create$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.create$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static void create$set(MemorySegment seg, MemorySegment x) { - fuse_operations.create$VH.set(seg, x); - } - public static MemorySegment create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.create$VH.get(seg.asSlice(index*sizeof())); - } - public static void create$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.create$VH.set(seg.asSlice(index*sizeof()), x); - } - public static create create(MemorySegment segment, SegmentScope scope) { - return create.ofAddress(create$get(segment), scope); - } - static final FunctionDescriptor lock$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle lock$MH = RuntimeHelper.downcallHandle( - fuse_operations.lock$FUNC - ); - /** - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public interface lock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(lock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse_operations.lock$FUNC, scope); - } - static lock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle lock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock")); - public static VarHandle lock$VH() { - return fuse_operations.lock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public static MemorySegment lock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.lock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public static void lock$set(MemorySegment seg, MemorySegment x) { - fuse_operations.lock$VH.set(seg, x); - } - public static MemorySegment lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.lock$VH.get(seg.asSlice(index*sizeof())); - } - public static void lock$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.lock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static lock lock(MemorySegment segment, SegmentScope scope) { - return lock.ofAddress(lock$get(segment), scope); - } - static final FunctionDescriptor utimens$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle utimens$MH = RuntimeHelper.downcallHandle( - fuse_operations.utimens$FUNC - ); - /** - * {@snippet : - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * } - */ - public interface utimens { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(utimens fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse_operations.utimens$FUNC, scope); - } - static utimens ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.utimens$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle utimens$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("utimens")); - public static VarHandle utimens$VH() { - return fuse_operations.utimens$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * } - */ - public static MemorySegment utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.utimens$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * } - */ - public static void utimens$set(MemorySegment seg, MemorySegment x) { - fuse_operations.utimens$VH.set(seg, x); - } - public static MemorySegment utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.utimens$VH.get(seg.asSlice(index*sizeof())); - } - public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.utimens$VH.set(seg.asSlice(index*sizeof()), x); - } - public static utimens utimens(MemorySegment segment, SegmentScope scope) { - return utimens.ofAddress(utimens$get(segment), scope); - } - static final FunctionDescriptor bmap$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle bmap$MH = RuntimeHelper.downcallHandle( - fuse_operations.bmap$FUNC - ); - /** - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public interface bmap { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(bmap fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse_operations.bmap$FUNC, scope); - } - static bmap ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle bmap$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("bmap")); - public static VarHandle bmap$VH() { - return fuse_operations.bmap$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public static MemorySegment bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.bmap$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public static void bmap$set(MemorySegment seg, MemorySegment x) { - fuse_operations.bmap$VH.set(seg, x); - } - public static MemorySegment bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.bmap$VH.get(seg.asSlice(index*sizeof())); - } - public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.bmap$VH.set(seg.asSlice(index*sizeof()), x); - } - public static bmap bmap(MemorySegment segment, SegmentScope scope) { - return bmap.ofAddress(bmap$get(segment), scope); - } - static final FunctionDescriptor ioctl$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ioctl$MH = RuntimeHelper.downcallHandle( - fuse_operations.ioctl$FUNC - ); - /** - * {@snippet : - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public interface ioctl { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); - static MemorySegment allocate(ioctl fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse_operations.ioctl$FUNC, scope); - } - static ioctl ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { - try { - return (int)fuse_operations.ioctl$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle ioctl$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); - public static VarHandle ioctl$VH() { - return fuse_operations.ioctl$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public static MemorySegment ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.ioctl$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public static void ioctl$set(MemorySegment seg, MemorySegment x) { - fuse_operations.ioctl$VH.set(seg, x); - } - public static MemorySegment ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); - } - public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.ioctl$VH.set(seg.asSlice(index*sizeof()), x); - } - public static ioctl ioctl(MemorySegment segment, SegmentScope scope) { - return ioctl.ofAddress(ioctl$get(segment), scope); - } - static final FunctionDescriptor poll$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle poll$MH = RuntimeHelper.downcallHandle( - fuse_operations.poll$FUNC - ); - /** - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public interface poll { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(poll fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse_operations.poll$FUNC, scope); - } - static poll ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle poll$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll")); - public static VarHandle poll$VH() { - return fuse_operations.poll$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public static MemorySegment poll$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.poll$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public static void poll$set(MemorySegment seg, MemorySegment x) { - fuse_operations.poll$VH.set(seg, x); - } - public static MemorySegment poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.poll$VH.get(seg.asSlice(index*sizeof())); - } - public static void poll$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.poll$VH.set(seg.asSlice(index*sizeof()), x); - } - public static poll poll(MemorySegment segment, SegmentScope scope) { - return poll.ofAddress(poll$get(segment), scope); - } - static final FunctionDescriptor write_buf$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write_buf$MH = RuntimeHelper.downcallHandle( - fuse_operations.write_buf$FUNC - ); - /** - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public interface write_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(write_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse_operations.write_buf$FUNC, scope); - } - static write_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); - public static VarHandle write_buf$VH() { - return fuse_operations.write_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.write_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public static void write_buf$set(MemorySegment seg, MemorySegment x) { - fuse_operations.write_buf$VH.set(seg, x); - } - public static MemorySegment write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.write_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write_buf write_buf(MemorySegment segment, SegmentScope scope) { - return write_buf.ofAddress(write_buf$get(segment), scope); - } - static final FunctionDescriptor read_buf$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read_buf$MH = RuntimeHelper.downcallHandle( - fuse_operations.read_buf$FUNC - ); - /** - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface read_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse_operations.read_buf$FUNC, scope); - } - static read_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.read_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); - public static VarHandle read_buf$VH() { - return fuse_operations.read_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.read_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void read_buf$set(MemorySegment seg, MemorySegment x) { - fuse_operations.read_buf$VH.set(seg, x); - } - public static MemorySegment read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.read_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read_buf read_buf(MemorySegment segment, SegmentScope scope) { - return read_buf.ofAddress(read_buf$get(segment), scope); - } - static final FunctionDescriptor flock$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle flock$MH = RuntimeHelper.downcallHandle( - fuse_operations.flock$FUNC - ); - /** - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public interface flock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(flock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse_operations.flock$FUNC, scope); - } - static flock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flock")); - public static VarHandle flock$VH() { - return fuse_operations.flock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public static MemorySegment flock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.flock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public static void flock$set(MemorySegment seg, MemorySegment x) { - fuse_operations.flock$VH.set(seg, x); - } - public static MemorySegment flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.flock$VH.get(seg.asSlice(index*sizeof())); - } - public static void flock$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.flock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flock flock(MemorySegment segment, SegmentScope scope) { - return flock.ofAddress(flock$get(segment), scope); - } - static final FunctionDescriptor fallocate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fallocate$MH = RuntimeHelper.downcallHandle( - fuse_operations.fallocate$FUNC - ); - /** - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public interface fallocate { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(fallocate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse_operations.fallocate$FUNC, scope); - } - static fallocate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fallocate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); - public static VarHandle fallocate$VH() { - return fuse_operations.fallocate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fallocate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public static void fallocate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fallocate$VH.set(seg, x); - } - public static MemorySegment fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); - } - public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fallocate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fallocate fallocate(MemorySegment segment, SegmentScope scope) { - return fallocate.ofAddress(fallocate$get(segment), scope); - } - static final FunctionDescriptor copy_file_range$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle copy_file_range$MH = RuntimeHelper.downcallHandle( - fuse_operations.copy_file_range$FUNC - ); - /** - * {@snippet : - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * } - */ - public interface copy_file_range { - - long apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4, long _x5, long _x6, int _x7); - static MemorySegment allocate(copy_file_range fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(copy_file_range.class, fi, fuse_operations.copy_file_range$FUNC, scope); - } - static copy_file_range ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4, long __x5, long __x6, int __x7) -> { - try { - return (long)fuse_operations.copy_file_range$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5, __x6, __x7); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle copy_file_range$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("copy_file_range")); - public static VarHandle copy_file_range$VH() { - return fuse_operations.copy_file_range$VH; - } - /** - * Getter for field: - * {@snippet : - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * } - */ - public static MemorySegment copy_file_range$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.copy_file_range$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * } - */ - public static void copy_file_range$set(MemorySegment seg, MemorySegment x) { - fuse_operations.copy_file_range$VH.set(seg, x); - } - public static MemorySegment copy_file_range$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.copy_file_range$VH.get(seg.asSlice(index*sizeof())); - } - public static void copy_file_range$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.copy_file_range$VH.set(seg.asSlice(index*sizeof()), x); - } - public static copy_file_range copy_file_range(MemorySegment segment, SegmentScope scope) { - return copy_file_range.ofAddress(copy_file_range$get(segment), scope); - } - static final FunctionDescriptor lseek$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle lseek$MH = RuntimeHelper.downcallHandle( - fuse_operations.lseek$FUNC - ); - /** - * {@snippet : - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * } - */ - public interface lseek { - - long apply(java.lang.foreign.MemorySegment _x0, long _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(lseek fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(lseek.class, fi, fuse_operations.lseek$FUNC, scope); - } - static lseek ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (long)fuse_operations.lseek$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle lseek$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lseek")); - public static VarHandle lseek$VH() { - return fuse_operations.lseek$VH; - } - /** - * Getter for field: - * {@snippet : - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * } - */ - public static MemorySegment lseek$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.lseek$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * } - */ - public static void lseek$set(MemorySegment seg, MemorySegment x) { - fuse_operations.lseek$VH.set(seg, x); - } - public static MemorySegment lseek$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.lseek$VH.get(seg.asSlice(index*sizeof())); - } - public static void lseek$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.lseek$VH.set(seg.asSlice(index*sizeof()), x); - } - public static lseek lseek(MemorySegment segment, SegmentScope scope) { - return lseek.ofAddress(lseek$get(segment), scope); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/RuntimeHelper.java new file mode 100644 index 00000000..b3d594c2 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.aarch64.extr.stat; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/constants$0.java new file mode 100644 index 00000000..eb233780 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.stat; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/stat_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/stat_h.java new file mode 100644 index 00000000..95891ee4 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat/stat_h.java @@ -0,0 +1,38 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.stat; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class stat_h { + + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; + /** + * {@snippet : + * #define UTIME_NOW 1073741823 + * } + */ + public static long UTIME_NOW() { + return 1073741823L; + } + /** + * {@snippet : + * #define UTIME_OMIT 1073741822 + * } + */ + public static long UTIME_OMIT() { + return 1073741822L; + } +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat_h.java deleted file mode 100644 index 61aa8be5..00000000 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat_h.java +++ /dev/null @@ -1,38 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.aarch64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class stat_h { - - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; - /** - * {@snippet : - * #define UTIME_NOW 1073741823 - * } - */ - public static long UTIME_NOW() { - return 1073741823L; - } - /** - * {@snippet : - * #define UTIME_OMIT 1073741822 - * } - */ - public static long UTIME_OMIT() { - return 1073741822L; - } -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/RuntimeHelper.java new file mode 100644 index 00000000..9ff06ef0 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.aarch64.extr.stdio; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/constants$0.java new file mode 100644 index 00000000..94f9f592 --- /dev/null +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.aarch64.extr.stdio; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/stdio_h.java similarity index 51% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio_h.java rename to jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/stdio_h.java index ed219643..31b44a8b 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio/stdio_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.aarch64.extr.stdio; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class stdio_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define RENAME_NOREPLACE 1 diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImplTest.java index bb758895..6a465a61 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FileInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; -import org.cryptomator.jfuse.linux.aarch64.extr.fcntl_h; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_file_info; +import org.cryptomator.jfuse.linux.aarch64.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_file_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; @@ -20,7 +20,7 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var fi = new FileInfoImpl(fuse_file_info.allocate(arena)); fuse_file_info.flags$set(fi.segment(), flags); diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImplTest.java index 86667494..841ea8b0 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConfigImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FuseConfig; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_config; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_config; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConfigImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInFuseConfig getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_config.allocate(arena); - var fuseConfig = new FuseConfigImpl(segment, arena.scope()); + var fuseConfig = new FuseConfigImpl(segment, arena); setter.accept(segment, value); diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImplTest.java index c0712567..c1b72fd4 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseConnInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_conn_info; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_conn_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(segment, 42); @@ -54,9 +54,9 @@ private interface GetInConnInfo extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInConnInfo setter, GetInMemorySegment getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(connInfo, 42); diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseImplTest.java index 16443c63..c6295b13 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseImplTest.java @@ -4,12 +4,12 @@ import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_cmdline_opts; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_config; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_conn_info; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_file_info; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_h; -import org.cryptomator.jfuse.linux.aarch64.extr.timespec; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3_lowlevel.fuse_cmdline_opts; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_config; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_conn_info; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_file_info; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.timespec; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -100,7 +100,7 @@ public void testParseArgsHelp(String arg) { @DisplayName("parseArgs") public void testParseArgs() { try (var fuseFunctionsClass = Mockito.mockStatic(FuseFunctions.class); - var arena = Arena.openConfined()) { + var arena = Arena.ofConfined()) { fuseFunctionsClass.when(() -> FuseFunctions.fuse_parse_cmdline(Mockito.any(), Mockito.any())).then(invocation -> { MemorySegment opts = invocation.getArgument(1); fuse_cmdline_opts.singlethread$set(opts, 0); @@ -128,7 +128,7 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); @@ -142,7 +142,7 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsync(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -156,7 +156,7 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsyncdir(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -172,7 +172,7 @@ public void testFsyncdir() { @DisplayName("init() sets fuse_conn_info.wants |= FUSE_CAP_READDIRPLUS") @Test public void testInit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var result = new AtomicInteger(); Mockito.doAnswer(invocation -> { FuseConnInfo connInfo = invocation.getArgument(0); @@ -195,7 +195,7 @@ public class Utimens { @DisplayName("utimens(\"/foo\", UTIME_NOW, UTIME_NOW)") @Test public void testUtimensNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = arena.allocate(fuse_file_info.$LAYOUT()); var times = MemorySegment.NULL; @@ -216,7 +216,7 @@ public void testUtimensNow() { public void testUtimens(long sec0, long nsec0, long sec1, long nsec1) { Instant expectedATime = Instant.ofEpochSecond(sec0, nsec0); Instant expectedMTime = Instant.ofEpochSecond(sec1, nsec1); - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = arena.allocate(fuse_file_info.$LAYOUT()); var times = timespec.allocateArray(2, arena); @@ -240,7 +240,7 @@ public class Attr { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -256,7 +256,7 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -272,7 +272,7 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var list = arena.allocate(100); @@ -287,7 +287,7 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); @@ -304,7 +304,7 @@ public void testRemovexattr() { @Test @DisplayName("chown") public void testChown() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).chown(Mockito.eq("/foo"), Mockito.eq(42), Mockito.eq(1337), Mockito.any()); diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImplTest.java index f87d2324..12501da9 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/FuseMountImplTest.java @@ -1,6 +1,6 @@ package org.cryptomator.jfuse.linux.aarch64; -import org.cryptomator.jfuse.linux.aarch64.extr.fuse_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.fuse_h; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrnoTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrnoTest.java index 34cb8b02..45ff047a 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrnoTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/LinuxErrnoTest.java @@ -1,15 +1,21 @@ package org.cryptomator.jfuse.linux.aarch64; +import org.cryptomator.jfuse.api.Errno; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.stream.Stream; + public class LinuxErrnoTest { @DisplayName("make sure method is not a stub") @ParameterizedTest(name = "{0}()") - @ValueSource(strings = {"enoent", "enosys", "enomem", "eacces", "eio", "erofs", "ebadf", "eexist", "enotdir", "eisdir", "enotempty", "einval"}) + @MethodSource("errnoNameProvider") public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationException { var errno = new LinuxErrno(); var method = LinuxErrno.class.getMethod(methodName); @@ -19,4 +25,8 @@ public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationExce Assertions.assertNotEquals(0, result); } + static Stream errnoNameProvider() { + return Arrays.stream(Errno.class.getDeclaredMethods()).map(Method::getName); + } + } \ No newline at end of file diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/StatImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/StatImplTest.java index e252fdc4..5a422c7f 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/StatImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/StatImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.linux.aarch64.extr.stat; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.stat; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(segment, value); @@ -49,9 +49,9 @@ private interface GetInStat extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInStat setter, GetInMemorySegment getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(stat, value); diff --git a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImplTest.java b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImplTest.java index fa2b8031..fc2893f9 100644 --- a/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImplTest.java +++ b/jfuse-linux-aarch64/src/test/java/org/cryptomator/jfuse/linux/aarch64/TimeSpecImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.aarch64; -import org.cryptomator.jfuse.linux.aarch64.extr.stat_h; -import org.cryptomator.jfuse.linux.aarch64.extr.timespec; +import org.cryptomator.jfuse.linux.aarch64.extr.stat.stat_h; +import org.cryptomator.jfuse.linux.aarch64.extr.fuse3.timespec; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -14,7 +14,7 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,7 +29,7 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 0L); timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,7 +44,7 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), stat_h.UTIME_OMIT()); @@ -57,7 +57,7 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), stat_h.UTIME_NOW()); diff --git a/jfuse-linux-amd64/pom.xml b/jfuse-linux-amd64/pom.xml index b4168ae5..c1a1049f 100644 --- a/jfuse-linux-amd64/pom.xml +++ b/jfuse-linux-amd64/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse-linux-amd64 @@ -71,10 +71,9 @@ jextract-maven-plugin 0.3.0 - /Users/sebastian/Documents/Cryptomator/jextract/build/jextract/bin/jextract + /Users/sebastian/git/github.com/openjdk/jextract/build/jextract/bin/jextract ${linux.headerSearchPath} ${project.build.sourceDirectory} - org.cryptomator.jfuse.linux.amd64.extr @@ -85,6 +84,7 @@ ${project.parent.basedir}/libfuse3/include/fuse.h fuse_h + org.cryptomator.jfuse.linux.amd64.extr.fuse3 _FILE_OFFSET_BITS=64 FUSE_USE_VERSION=312 @@ -128,7 +128,7 @@ ${project.parent.basedir}/libfuse3/include/fuse_lowlevel.h - org.cryptomator.jfuse.linux.amd64.extr + org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel fuse_lowlevel_h _FILE_OFFSET_BITS=64 @@ -146,6 +146,7 @@ ${linux.headerSearchPath}/errno.h + org.cryptomator.jfuse.linux.amd64.extr.errno errno_h ENOENT @@ -164,6 +165,7 @@ ERANGE ENOLCK ENAMETOOLONG + ENODATA @@ -174,6 +176,7 @@ ${linux.headerSearchPath}/sys/stat.h + org.cryptomator.jfuse.linux.amd64.extr.stat stat_h UTIME_NOW @@ -189,6 +192,7 @@ ${linux.headerSearchPath}/fcntl.h fcntl_h + org.cryptomator.jfuse.linux.amd64.extr.fcntl O_RDONLY O_WRONLY @@ -209,6 +213,7 @@ ${linux.headerSearchPath}/stdio.h + org.cryptomator.jfuse.linux.amd64.extr.stdio stdio_h _GNU_SOURCE=1 @@ -227,5 +232,4 @@ - - \ No newline at end of file + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/DirFillerImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/DirFillerImpl.java index 4f427eb4..9f55bcee 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/DirFillerImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/DirFillerImpl.java @@ -2,8 +2,8 @@ import org.cryptomator.jfuse.api.DirFiller; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_fill_dir_t; -import org.cryptomator.jfuse.linux.amd64.extr.stat; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_fill_dir_t; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.stat; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -12,7 +12,7 @@ record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller { DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { - this(buf, fuse_fill_dir_t.ofAddress(callback, arena.scope()), arena); + this(buf, fuse_fill_dir_t.ofAddress(callback, arena), arena); } @Override diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FileInfoImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FileInfoImpl.java index 4e8575ac..eda24c72 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FileInfoImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FileInfoImpl.java @@ -1,11 +1,11 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FileInfo; -import org.cryptomator.jfuse.linux.amd64.extr.fcntl_h; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_file_info; +import org.cryptomator.jfuse.linux.amd64.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_file_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -22,7 +22,7 @@ record FileInfoImpl(MemorySegment segment) implements FileInfo { private static final int O_SYNC = fcntl_h.O_SYNC(); private static final int O_DSYNC = fcntl_h.O_DSYNC(); - public FileInfoImpl(MemorySegment address, SegmentScope scope) { + public FileInfoImpl(MemorySegment address, Arena scope) { this(fuse_file_info.ofAddress(address, scope)); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseArgs.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseArgs.java index 30fe77cf..732c7e4e 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseArgs.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseArgs.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_args; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_cmdline_opts; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_args; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel.fuse_cmdline_opts; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -14,7 +14,7 @@ public String toString() { var argc = fuse_args.argc$get(args); var argv = fuse_args.argv$get(args); for (int i = 0; i < argc; i++) { - var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS, i).reinterpret(Long.MAX_VALUE); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } sb.append("mountPoint = ").append(mountPoint().getUtf8String(0)); diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImpl.java index 15005dd3..ef4ecb26 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FuseConfig; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_config; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_config; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConfigImpl(MemorySegment segment) implements FuseConfig { - public FuseConfigImpl(MemorySegment address, SegmentScope scope) { + public FuseConfigImpl(MemorySegment address, Arena scope) { this(fuse_config.ofAddress(address, scope)); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImpl.java index 2ca4078e..f886c9a7 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_conn_info; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_conn_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) { + public FuseConnInfoImpl(MemorySegment address, Arena scope) { this(fuse_conn_info.ofAddress(address, scope)); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseImpl.java index e15dc323..e6dfe26c 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseImpl.java @@ -5,12 +5,12 @@ import org.cryptomator.jfuse.api.FuseMount; import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_args; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_cmdline_opts; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_h; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_operations; -import org.cryptomator.jfuse.linux.amd64.extr.stat_h; -import org.cryptomator.jfuse.linux.amd64.extr.timespec; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_args; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_operations; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.timespec; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel.fuse_cmdline_opts; +import org.cryptomator.jfuse.linux.amd64.extr.stat.stat_h; import org.jetbrains.annotations.VisibleForTesting; import java.lang.foreign.Arena; @@ -66,45 +66,45 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { @Override protected void bind(FuseOperations.Operation operation) { switch (operation) { - case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseArena.scope())); - case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseArena.scope())); - case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseArena.scope())); - case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseArena.scope())); - case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseArena.scope())); - case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseArena.scope())); - case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseArena.scope())); - case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseArena.scope())); - case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseArena.scope())); - case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseArena.scope())); - case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseArena.scope())); - case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseArena.scope())); - case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseArena.scope())); - case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseArena.scope())); - case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseArena.scope())); - case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseArena.scope())); - case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseArena.scope())); - case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseArena.scope())); - case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseArena.scope())); - case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseArena.scope())); - case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseArena.scope())); - case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseArena.scope())); - case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseArena.scope())); - case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseArena.scope())); - case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseArena.scope())); - case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseArena.scope())); - case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseArena.scope())); - case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseArena.scope())); - case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseArena.scope())); - case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseArena.scope())); + case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseArena)); + case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseArena)); + case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseArena)); + case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseArena)); + case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseArena)); + case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseArena)); + case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseArena)); + case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseArena)); + case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseArena)); + case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseArena)); + case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseArena)); + case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseArena)); + case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseArena)); + case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseArena)); + case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseArena)); + case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseArena)); + case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseArena)); + case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseArena)); + case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseArena)); + case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseArena)); + case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseArena)); + case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseArena)); + case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseArena)); + case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseArena)); + case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseArena)); + case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseArena)); + case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseArena)); + case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseArena)); + case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseArena)); + case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseArena)); } } @VisibleForTesting MemorySegment init(MemorySegment conn, MemorySegment cfg) { - try (var arena = Arena.openConfined()) { - var connInfo = new FuseConnInfoImpl(conn, arena.scope()); + try (var arena = Arena.ofConfined()) { + var connInfo = new FuseConnInfoImpl(conn, arena); connInfo.setWant(connInfo.want() | FuseConnInfo.FUSE_CAP_READDIRPLUS); - var config = new FuseConfigImpl(cfg, arena.scope()); + var config = new FuseConfigImpl(cfg, arena); fuseOperations.init(connInfo, config); } return MemorySegment.NULL; @@ -115,21 +115,21 @@ private int access(MemorySegment path, int mask) { } private int chmod(MemorySegment path, int mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int chown(MemorySegment path, int uid, int gid, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, arena)); } } private int create(MemorySegment path, int mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @@ -139,53 +139,47 @@ private void destroy(MemorySegment addr) { @VisibleForTesting int flush(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsync(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsyncdir(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } private int getattr(MemorySegment path, MemorySegment stat, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena.scope()), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int getxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), buffer); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), val); } @VisibleForTesting int setxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size, int flags) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), buffer, flags); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), val, flags); } @VisibleForTesting int listxattr(MemorySegment path, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.listxattr(path.getUtf8String(0), buffer); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.listxattr(path.getUtf8String(0), val); } @VisibleForTesting @@ -198,46 +192,44 @@ private int mkdir(MemorySegment path, int mode) { } private int open(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int opendir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int read(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } private int readdir(MemorySegment path, MemorySegment buf, MemorySegment filler, long offset, MemorySegment fi, int flags) { - try (var arena = Arena.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena.scope()), flags); + try (var arena = Arena.ofConfined()) { + return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena), flags); } } private int readlink(MemorySegment path, MemorySegment buf, long len) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), len, arena.scope()).asByteBuffer(); - return fuseOperations.readlink(path.getUtf8String(0), buffer, len); - } + var buffer = buf.reinterpret(len).asByteBuffer(); + return fuseOperations.readlink(path.getUtf8String(0), buffer, len); } private int release(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int releasedir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @@ -250,8 +242,8 @@ private int rmdir(MemorySegment path) { } private int statfs(MemorySegment path, MemorySegment statvfs) { - try (var arena = Arena.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena)); } } @@ -260,8 +252,8 @@ private int symlink(MemorySegment linkname, MemorySegment target) { } private int truncate(MemorySegment path, long size, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena)); } } @@ -271,26 +263,26 @@ private int unlink(MemorySegment path) { @VisibleForTesting int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { if (MemorySegment.NULL.equals(times)) { - // set both times to current time (using on-heap memory segments) - var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), arena.scope()); + // set both times to current time + var segment = arena.allocate(timespec.$LAYOUT()); timespec.tv_sec$set(segment, 0); timespec.tv_nsec$set(segment, stat_h.UTIME_NOW()); var time = new TimeSpecImpl(segment); - return fuseOperations.utimens(path.getUtf8String(0), time, time, new FileInfoImpl(fi, arena.scope())); + return fuseOperations.utimens(path.getUtf8String(0), time, time, new FileInfoImpl(fi, arena)); } else { var time0 = times.asSlice(0, timespec.$LAYOUT().byteSize()); var time1 = times.asSlice(timespec.$LAYOUT().byteSize(), timespec.$LAYOUT().byteSize()); - return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena.scope())); + return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena)); } } } private int write(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseMountImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseMountImpl.java index 13d79896..22bf954f 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseMountImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseMountImpl.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_h; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_loop_config_v1; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_loop_config_v1; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -20,7 +20,7 @@ public int loop() { return fuse_h.fuse_loop(fuse); } else if (fuse_h.fuse_version() < FUSE_3_12) { // FUSE 3.2 - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var loopCfg = fuse_loop_config_v1.allocate(arena); fuse_loop_config_v1.clone_fd$set(loopCfg, fuseArgs.cloneFd()); fuse_loop_config_v1.max_idle_threads$set(loopCfg, fuseArgs.maxIdleThreads()); diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/LinuxErrno.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/LinuxErrno.java index 643bd01d..ba51b4f1 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/LinuxErrno.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/LinuxErrno.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.Errno; -import org.cryptomator.jfuse.linux.amd64.extr.errno_h; +import org.cryptomator.jfuse.linux.amd64.extr.errno.errno_h; record LinuxErrno() implements Errno { @@ -84,4 +84,9 @@ public int enolck() { public int enametoolong() { return errno_h.ENAMETOOLONG(); } + + @Override + public int enodata() { + return errno_h.ENODATA(); + } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatImpl.java index a9dcee21..0cb34ff4 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatImpl.java @@ -2,14 +2,14 @@ import org.cryptomator.jfuse.api.Stat; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.linux.amd64.extr.stat; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.stat; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemorySegment address, SegmentScope scope) { + public StatImpl(MemorySegment address, Arena scope) { this(stat.ofAddress(address, scope)); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatvfsImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatvfsImpl.java index aa7cabd5..27c54a4c 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatvfsImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/StatvfsImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.Statvfs; -import org.cryptomator.jfuse.linux.amd64.extr.statvfs; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.statvfs; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemorySegment address, SegmentScope scope) { + public StatvfsImpl(MemorySegment address, Arena scope) { this(statvfs.ofAddress(address, scope)); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImpl.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImpl.java index c5fdac5e..ecbd5f5e 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImpl.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImpl.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.linux.amd64.extr.stat_h; -import org.cryptomator.jfuse.linux.amd64.extr.timespec; +import org.cryptomator.jfuse.linux.amd64.extr.stat.stat_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.timespec; import java.lang.foreign.MemorySegment; import java.time.Instant; diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/Constants$root.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/Constants$root.java deleted file mode 100644 index 839fe764..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/Constants$root.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class Constants$root { - - // Suppresses default constructor, ensuring non-instantiability. - private Constants$root() {} - static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; - static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; - static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; - static final OfInt C_INT$LAYOUT = JAVA_INT; - static final OfLong C_LONG$LAYOUT = JAVA_LONG; - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded(); -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$0.java deleted file mode 100644 index cdcb2206..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$0.java +++ /dev/null @@ -1,56 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$0 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$0() {} - static final FunctionDescriptor fuse_version$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT); - static final MethodHandle fuse_version$MH = RuntimeHelper.downcallHandle( - "fuse_version", - constants$0.fuse_version$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_create$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT); - static final MethodHandle fuse_loop_cfg_create$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_create", - constants$0.fuse_loop_cfg_create$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop_cfg_destroy$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_destroy", - constants$0.fuse_loop_cfg_destroy$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_set_max_threads$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle fuse_loop_cfg_set_max_threads$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_set_max_threads", - constants$0.fuse_loop_cfg_set_max_threads$FUNC - ); - static final FunctionDescriptor fuse_loop_cfg_set_clone_fd$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle fuse_loop_cfg_set_clone_fd$MH = RuntimeHelper.downcallHandle( - "fuse_loop_cfg_set_clone_fd", - constants$0.fuse_loop_cfg_set_clone_fd$FUNC - ); - static final FunctionDescriptor fuse_fill_dir_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$1.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$1.java deleted file mode 100644 index 1c12d74d..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$1.java +++ /dev/null @@ -1,65 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$1 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$1() {} - static final FunctionDescriptor fuse_fill_dir_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle fuse_fill_dir_t$MH = RuntimeHelper.downcallHandle( - constants$1.fuse_fill_dir_t$FUNC - ); - static final FunctionDescriptor fuse_lib_help$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_lib_help$MH = RuntimeHelper.downcallHandle( - "fuse_lib_help", - constants$1.fuse_lib_help$FUNC - ); - static final FunctionDescriptor fuse_new$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_new$MH = RuntimeHelper.downcallHandle( - "fuse_new", - constants$1.fuse_new$FUNC - ); - static final FunctionDescriptor fuse_mount$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_mount$MH = RuntimeHelper.downcallHandle( - "fuse_mount", - constants$1.fuse_mount$FUNC - ); - static final FunctionDescriptor fuse_unmount$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_unmount$MH = RuntimeHelper.downcallHandle( - "fuse_unmount", - constants$1.fuse_unmount$FUNC - ); - static final FunctionDescriptor fuse_destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_destroy$MH = RuntimeHelper.downcallHandle( - "fuse_destroy", - constants$1.fuse_destroy$FUNC - ); -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$2.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$2.java deleted file mode 100644 index 5d054754..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$2.java +++ /dev/null @@ -1,45 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$2 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$2() {} - static final FunctionDescriptor fuse_loop$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop$MH = RuntimeHelper.downcallHandle( - "fuse_loop", - constants$2.fuse_loop$FUNC - ); - static final FunctionDescriptor fuse_exit$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_exit$MH = RuntimeHelper.downcallHandle( - "fuse_exit", - constants$2.fuse_exit$FUNC - ); - static final FunctionDescriptor fuse_loop_mt$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop_mt$MH = RuntimeHelper.downcallHandle( - "fuse_loop_mt", - constants$2.fuse_loop_mt$FUNC - ); - static final FunctionDescriptor fuse_get_session$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_get_session$MH = RuntimeHelper.downcallHandle( - "fuse_get_session", - constants$2.fuse_get_session$FUNC - ); -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/RuntimeHelper.java new file mode 100644 index 00000000..3125b985 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.amd64.extr.errno; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/constants$0.java new file mode 100644 index 00000000..9c6903e6 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.errno; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/errno_h.java similarity index 78% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/errno_h.java index 2276b805..0dd69db9 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno/errno_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.errno; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define ENOENT 2 @@ -137,6 +137,14 @@ public static int ENOSYS() { public static int ENOTEMPTY() { return (int)39L; } + /** + * {@snippet : + * #define ENODATA 61 + * } + */ + public static int ENODATA() { + return (int)61L; + } /** * {@snippet : * #define ENOTSUP 95 diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/RuntimeHelper.java new file mode 100644 index 00000000..ef3f7ede --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.amd64.extr.fcntl; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/constants$0.java new file mode 100644 index 00000000..e37d6684 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fcntl; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/fcntl_h.java similarity index 69% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/fcntl_h.java index 4f896dd5..021214e9 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl/fcntl_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fcntl; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define O_RDONLY 0 diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/RuntimeHelper.java new file mode 100644 index 00000000..e2850da1 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$0.java new file mode 100644 index 00000000..c9669cf4 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$0.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("argc"), + MemoryLayout.paddingLayout(4), + RuntimeHelper.POINTER.withName("argv"), + JAVA_INT.withName("allocated"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_args"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argc")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argv")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("allocated")); + static final StructLayout const$4 = MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("timespec"); + static final VarHandle const$5 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$1.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$1.java new file mode 100644 index 00000000..35a52a80 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$1.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final VarHandle const$0 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); + static final StructLayout const$1 = MemoryLayout.structLayout( + JAVA_INT.withName("flags"), + MemoryLayout.paddingLayout(12), + JAVA_LONG.withName("fh"), + JAVA_LONG.withName("lock_owner"), + JAVA_INT.withName("poll_events"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_file_info"); + static final VarHandle const$2 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("flags")); + static final VarHandle const$3 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("fh")); + static final VarHandle const$4 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); + static final VarHandle const$5 = constants$1.const$1.varHandle(MemoryLayout.PathElement.groupElement("poll_events")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$10.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$10.java new file mode 100644 index 00000000..03b5bfde --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$10.java @@ -0,0 +1,52 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$10 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$10() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_fill_dir_t.class, "apply", constants$9.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$9.const$5 + ); + static final StructLayout const$2 = MemoryLayout.structLayout( + JAVA_INT.withName("set_gid"), + JAVA_INT.withName("gid"), + JAVA_INT.withName("set_uid"), + JAVA_INT.withName("uid"), + JAVA_INT.withName("set_mode"), + JAVA_INT.withName("umask"), + JAVA_DOUBLE.withName("entry_timeout"), + JAVA_DOUBLE.withName("negative_timeout"), + JAVA_DOUBLE.withName("attr_timeout"), + JAVA_INT.withName("intr"), + JAVA_INT.withName("intr_signal"), + JAVA_INT.withName("remember"), + JAVA_INT.withName("hard_remove"), + JAVA_INT.withName("use_ino"), + JAVA_INT.withName("readdir_ino"), + JAVA_INT.withName("direct_io"), + JAVA_INT.withName("kernel_cache"), + JAVA_INT.withName("auto_cache"), + JAVA_INT.withName("no_rofd_flush"), + JAVA_INT.withName("ac_attr_timeout_set"), + MemoryLayout.paddingLayout(4), + JAVA_DOUBLE.withName("ac_attr_timeout"), + JAVA_INT.withName("nullpath_ok"), + JAVA_INT.withName("show_help"), + RuntimeHelper.POINTER.withName("modules"), + JAVA_INT.withName("debug"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_config"); + static final VarHandle const$3 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("set_gid")); + static final VarHandle const$4 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("gid")); + static final VarHandle const$5 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("set_uid")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$11.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$11.java new file mode 100644 index 00000000..f3aabb71 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$11.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$11 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$11() {} + static final VarHandle const$0 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("uid")); + static final VarHandle const$1 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("set_mode")); + static final VarHandle const$2 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("umask")); + static final VarHandle const$3 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("entry_timeout")); + static final VarHandle const$4 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("negative_timeout")); + static final VarHandle const$5 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("attr_timeout")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$12.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$12.java new file mode 100644 index 00000000..0a37088e --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$12.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$12 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$12() {} + static final VarHandle const$0 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("intr")); + static final VarHandle const$1 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("intr_signal")); + static final VarHandle const$2 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("remember")); + static final VarHandle const$3 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("hard_remove")); + static final VarHandle const$4 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("use_ino")); + static final VarHandle const$5 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("readdir_ino")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$13.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$13.java new file mode 100644 index 00000000..f45c8842 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$13.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$13 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$13() {} + static final VarHandle const$0 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("direct_io")); + static final VarHandle const$1 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("kernel_cache")); + static final VarHandle const$2 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("auto_cache")); + static final VarHandle const$3 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("no_rofd_flush")); + static final VarHandle const$4 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout_set")); + static final VarHandle const$5 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$14.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$14.java new file mode 100644 index 00000000..e7fc4933 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$14.java @@ -0,0 +1,69 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$14 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$14() {} + static final VarHandle const$0 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("nullpath_ok")); + static final VarHandle const$1 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("show_help")); + static final VarHandle const$2 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("modules")); + static final VarHandle const$3 = constants$10.const$2.varHandle(MemoryLayout.PathElement.groupElement("debug")); + static final StructLayout const$4 = MemoryLayout.structLayout( + RuntimeHelper.POINTER.withName("getattr"), + RuntimeHelper.POINTER.withName("readlink"), + RuntimeHelper.POINTER.withName("mknod"), + RuntimeHelper.POINTER.withName("mkdir"), + RuntimeHelper.POINTER.withName("unlink"), + RuntimeHelper.POINTER.withName("rmdir"), + RuntimeHelper.POINTER.withName("symlink"), + RuntimeHelper.POINTER.withName("rename"), + RuntimeHelper.POINTER.withName("link"), + RuntimeHelper.POINTER.withName("chmod"), + RuntimeHelper.POINTER.withName("chown"), + RuntimeHelper.POINTER.withName("truncate"), + RuntimeHelper.POINTER.withName("open"), + RuntimeHelper.POINTER.withName("read"), + RuntimeHelper.POINTER.withName("write"), + RuntimeHelper.POINTER.withName("statfs"), + RuntimeHelper.POINTER.withName("flush"), + RuntimeHelper.POINTER.withName("release"), + RuntimeHelper.POINTER.withName("fsync"), + RuntimeHelper.POINTER.withName("setxattr"), + RuntimeHelper.POINTER.withName("getxattr"), + RuntimeHelper.POINTER.withName("listxattr"), + RuntimeHelper.POINTER.withName("removexattr"), + RuntimeHelper.POINTER.withName("opendir"), + RuntimeHelper.POINTER.withName("readdir"), + RuntimeHelper.POINTER.withName("releasedir"), + RuntimeHelper.POINTER.withName("fsyncdir"), + RuntimeHelper.POINTER.withName("init"), + RuntimeHelper.POINTER.withName("destroy"), + RuntimeHelper.POINTER.withName("access"), + RuntimeHelper.POINTER.withName("create"), + RuntimeHelper.POINTER.withName("lock"), + RuntimeHelper.POINTER.withName("utimens"), + RuntimeHelper.POINTER.withName("bmap"), + RuntimeHelper.POINTER.withName("ioctl"), + RuntimeHelper.POINTER.withName("poll"), + RuntimeHelper.POINTER.withName("write_buf"), + RuntimeHelper.POINTER.withName("read_buf"), + RuntimeHelper.POINTER.withName("flock"), + RuntimeHelper.POINTER.withName("fallocate"), + RuntimeHelper.POINTER.withName("copy_file_range"), + RuntimeHelper.POINTER.withName("lseek") + ).withName("fuse_operations"); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$15.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$15.java new file mode 100644 index 00000000..35bb354f --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$15.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$15 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$15() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.getattr.class, "apply", constants$14.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$14.const$5 + ); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("getattr")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.readlink.class, "apply", constants$15.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$15.const$3 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$16.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$16.java new file mode 100644 index 00000000..9a075268 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$16.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$16 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$16() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("readlink")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_LONG + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.mknod.class, "apply", constants$16.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$16.const$1 + ); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("mknod")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$17.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$17.java new file mode 100644 index 00000000..a329fbfd --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$17.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$17 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$17() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.mkdir.class, "apply", constants$16.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$16.const$5 + ); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.unlink.class, "apply", constants$17.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$17.const$3 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$18.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$18.java new file mode 100644 index 00000000..fb3256c3 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$18.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$18 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$18() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("unlink")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.rmdir.class, "apply", constants$17.const$3); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.symlink.class, "apply", constants$18.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$18.const$3 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$19.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$19.java new file mode 100644 index 00000000..36c7ca8d --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$19.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$19 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$19() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("symlink")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.rename.class, "apply", constants$19.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$19.const$1 + ); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("rename")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.link.class, "apply", constants$18.const$3); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$2.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$2.java new file mode 100644 index 00000000..9c25df74 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$2.java @@ -0,0 +1,37 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$2 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$2() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("clone_fd"), + JAVA_INT.withName("max_idle_threads") + ).withName("fuse_loop_config_v1"); + static final VarHandle const$1 = constants$2.const$0.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); + static final VarHandle const$2 = constants$2.const$0.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); + static final StructLayout const$3 = MemoryLayout.structLayout( + JAVA_INT.withName("proto_major"), + JAVA_INT.withName("proto_minor"), + JAVA_INT.withName("max_write"), + JAVA_INT.withName("max_read"), + JAVA_INT.withName("max_readahead"), + JAVA_INT.withName("capable"), + JAVA_INT.withName("want"), + JAVA_INT.withName("max_background"), + JAVA_INT.withName("congestion_threshold"), + JAVA_INT.withName("time_gran"), + MemoryLayout.sequenceLayout(22, JAVA_INT).withName("reserved") + ).withName("fuse_conn_info"); + static final VarHandle const$4 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); + static final VarHandle const$5 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$20.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$20.java new file mode 100644 index 00000000..c638c8a8 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$20.java @@ -0,0 +1,33 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$20 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$20() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("link")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.chmod.class, "apply", constants$20.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$20.const$1 + ); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("chmod")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_INT, + RuntimeHelper.POINTER + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$21.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$21.java new file mode 100644 index 00000000..2b2d719e --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$21.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$21 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$21() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.chown.class, "apply", constants$20.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$20.const$5 + ); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("chown")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.truncate.class, "apply", constants$21.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$21.const$3 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$22.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$22.java new file mode 100644 index 00000000..52466492 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$22.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$22 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$22() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("truncate")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.open.class, "apply", constants$18.const$3); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("open")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.read.class, "apply", constants$22.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$22.const$3 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$23.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$23.java new file mode 100644 index 00000000..f8d07f1c --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$23.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$23 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$23() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("read")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.write.class, "apply", constants$22.const$3); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("write")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.statfs.class, "apply", constants$18.const$3); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("statfs")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.flush.class, "apply", constants$18.const$3); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$24.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$24.java new file mode 100644 index 00000000..6d43f50c --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$24.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$24 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$24() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("flush")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.release.class, "apply", constants$18.const$3); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("release")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.fsync.class, "apply", constants$20.const$1); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("fsync")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.setxattr.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$25.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$25.java new file mode 100644 index 00000000..85551e6f --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$25.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$25 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$25() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.getxattr.class, "apply", constants$25.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$25.const$1 + ); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.listxattr.class, "apply", constants$15.const$3); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$26.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$26.java new file mode 100644 index 00000000..aea96d63 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$26.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$26 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$26() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.removexattr.class, "apply", constants$18.const$3); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.opendir.class, "apply", constants$18.const$3); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("opendir")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER, + JAVA_INT + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$27.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$27.java new file mode 100644 index 00000000..ef269e70 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$27.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$27 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$27() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.readdir.class, "apply", constants$26.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$26.const$5 + ); + static final VarHandle const$2 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("readdir")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.releasedir.class, "apply", constants$18.const$3); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.fsyncdir.class, "apply", constants$20.const$1); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$28.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$28.java new file mode 100644 index 00000000..c2ae527c --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$28.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$28 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$28() {} + static final VarHandle const$0 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.init.class, "apply", constants$28.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$28.const$1 + ); + static final VarHandle const$4 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("init")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.destroy.class, "apply", constants$5.const$0); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$29.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$29.java new file mode 100644 index 00000000..b6ca8874 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$29.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$29 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$29() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$5.const$0 + ); + static final VarHandle const$1 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("destroy")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.access.class, "apply", constants$16.const$5); + static final VarHandle const$3 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("access")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.create.class, "apply", constants$20.const$1); + static final VarHandle const$5 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("create")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$3.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$3.java new file mode 100644 index 00000000..b1084b81 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$3.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$3 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$3() {} + static final VarHandle const$0 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_write")); + static final VarHandle const$1 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_read")); + static final VarHandle const$2 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); + static final VarHandle const$3 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("capable")); + static final VarHandle const$4 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("want")); + static final VarHandle const$5 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("max_background")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$30.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$30.java new file mode 100644 index 00000000..63022da1 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$30.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$30 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$30() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.lock.class, "apply", constants$30.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$30.const$0 + ); + static final VarHandle const$3 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("lock")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.utimens.class, "apply", constants$14.const$5); + static final VarHandle const$5 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("utimens")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$31.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$31.java new file mode 100644 index 00000000..d79dd51d --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$31.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$31 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$31() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.bmap.class, "apply", constants$21.const$3); + static final VarHandle const$1 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("bmap")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.ioctl.class, "apply", constants$31.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$31.const$2 + ); + static final VarHandle const$5 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$32.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$32.java new file mode 100644 index 00000000..4a3430b9 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$32.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$32 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$32() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.poll.class, "apply", constants$32.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$32.const$0 + ); + static final VarHandle const$3 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("poll")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.write_buf.class, "apply", constants$32.const$4); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$33.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$33.java new file mode 100644 index 00000000..6d0ed668 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$33.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$33 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$33() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$32.const$4 + ); + static final VarHandle const$1 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.read_buf.class, "apply", constants$22.const$3); + static final VarHandle const$3 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.flock.class, "apply", constants$19.const$1); + static final VarHandle const$5 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("flock")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$34.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$34.java new file mode 100644 index 00000000..e1028ee9 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$34.java @@ -0,0 +1,39 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$34 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$34() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.fallocate.class, "apply", constants$34.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$34.const$0 + ); + static final VarHandle const$3 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_LONG, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_LONG, + JAVA_INT + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.copy_file_range.class, "apply", constants$34.const$4); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$35.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$35.java new file mode 100644 index 00000000..83f7d046 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$35.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$35 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$35() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$34.const$4 + ); + static final VarHandle const$1 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("copy_file_range")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_LONG, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.lseek.class, "apply", constants$35.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$35.const$2 + ); + static final VarHandle const$5 = constants$14.const$4.varHandle(MemoryLayout.PathElement.groupElement("lseek")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$36.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$36.java new file mode 100644 index 00000000..01ef8642 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$36.java @@ -0,0 +1,42 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$36 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$36() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + "fuse_lib_help", + constants$5.const$0 + ); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + "fuse_new", + constants$36.const$1 + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_mount", + constants$18.const$3 + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse_unmount", + constants$5.const$0 + ); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_destroy", + constants$5.const$0 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$37.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$37.java new file mode 100644 index 00000000..c99ef5f0 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$37.java @@ -0,0 +1,35 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$37 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$37() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + "fuse_loop", + constants$17.const$3 + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_exit", + constants$5.const$0 + ); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + "fuse_loop_mt", + constants$18.const$3 + ); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse_get_session", + constants$37.const$3 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$4.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$4.java new file mode 100644 index 00000000..aa08fb26 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$4.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$4 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$4() {} + static final VarHandle const$0 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); + static final VarHandle const$1 = constants$2.const$3.varHandle(MemoryLayout.PathElement.groupElement("time_gran")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_version", + constants$4.const$2 + ); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(RuntimeHelper.POINTER); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_create", + constants$4.const$4 + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$5.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$5.java new file mode 100644 index 00000000..bef6a785 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$5.java @@ -0,0 +1,61 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$5 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$5() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_destroy", + constants$5.const$0 + ); + static final FunctionDescriptor const$2 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_set_max_threads", + constants$5.const$2 + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse_loop_cfg_set_clone_fd", + constants$5.const$2 + ); + static final StructLayout const$5 = MemoryLayout.structLayout( + JAVA_LONG.withName("st_dev"), + JAVA_LONG.withName("st_ino"), + JAVA_LONG.withName("st_nlink"), + JAVA_INT.withName("st_mode"), + JAVA_INT.withName("st_uid"), + JAVA_INT.withName("st_gid"), + JAVA_INT.withName("__pad0"), + JAVA_LONG.withName("st_rdev"), + JAVA_LONG.withName("st_size"), + JAVA_LONG.withName("st_blksize"), + JAVA_LONG.withName("st_blocks"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_atim"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_mtim"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_ctim"), + MemoryLayout.sequenceLayout(3, JAVA_LONG).withName("__glibc_reserved") + ).withName("stat"); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$6.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$6.java new file mode 100644 index 00000000..3411c098 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$6.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$6 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$6() {} + static final VarHandle const$0 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); + static final VarHandle const$1 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); + static final VarHandle const$2 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); + static final VarHandle const$3 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); + static final VarHandle const$4 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); + static final VarHandle const$5 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$7.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$7.java new file mode 100644 index 00000000..7d827211 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$7.java @@ -0,0 +1,35 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$7 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$7() {} + static final VarHandle const$0 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("__pad0")); + static final VarHandle const$1 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); + static final VarHandle const$2 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_size")); + static final VarHandle const$3 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); + static final VarHandle const$4 = constants$5.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); + static final StructLayout const$5 = MemoryLayout.structLayout( + JAVA_LONG.withName("f_bsize"), + JAVA_LONG.withName("f_frsize"), + JAVA_LONG.withName("f_blocks"), + JAVA_LONG.withName("f_bfree"), + JAVA_LONG.withName("f_bavail"), + JAVA_LONG.withName("f_files"), + JAVA_LONG.withName("f_ffree"), + JAVA_LONG.withName("f_favail"), + JAVA_LONG.withName("f_fsid"), + JAVA_LONG.withName("f_flag"), + JAVA_LONG.withName("f_namemax"), + MemoryLayout.sequenceLayout(6, JAVA_INT).withName("__f_spare") + ).withName("statvfs"); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$8.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$8.java new file mode 100644 index 00000000..e6ba9c20 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$8.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$8 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$8() {} + static final VarHandle const$0 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); + static final VarHandle const$1 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); + static final VarHandle const$2 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); + static final VarHandle const$3 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); + static final VarHandle const$4 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); + static final VarHandle const$5 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_files")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$9.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$9.java new file mode 100644 index 00000000..7214ca38 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/constants$9.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$9 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$9() {} + static final VarHandle const$0 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); + static final VarHandle const$1 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); + static final VarHandle const$2 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); + static final VarHandle const$3 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); + static final VarHandle const$4 = constants$7.const$5.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_INT + ); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_args.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_args.java similarity index 56% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_args.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_args.java index 6628429d..7f32d0dd 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_args.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_args.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -18,19 +18,11 @@ */ public class fuse_args { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("argc"), - MemoryLayout.paddingLayout(32), - Constants$root.C_POINTER$LAYOUT.withName("argv"), - Constants$root.C_INT$LAYOUT.withName("allocated"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_args"); public static MemoryLayout $LAYOUT() { - return fuse_args.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle argc$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argc")); public static VarHandle argc$VH() { - return fuse_args.argc$VH; + return constants$0.const$1; } /** * Getter for field: @@ -39,7 +31,7 @@ public class fuse_args { * } */ public static int argc$get(MemorySegment seg) { - return (int)fuse_args.argc$VH.get(seg); + return (int)constants$0.const$1.get(seg); } /** * Setter for field: @@ -48,17 +40,16 @@ public class fuse_args { * } */ public static void argc$set(MemorySegment seg, int x) { - fuse_args.argc$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { - return (int)fuse_args.argc$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void argc$set(MemorySegment seg, long index, int x) { - fuse_args.argc$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle argv$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argv")); public static VarHandle argv$VH() { - return fuse_args.argv$VH; + return constants$0.const$2; } /** * Getter for field: @@ -67,7 +58,7 @@ public class fuse_args { * } */ public static MemorySegment argv$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg); } /** * Setter for field: @@ -76,17 +67,16 @@ public class fuse_args { * } */ public static void argv$set(MemorySegment seg, MemorySegment x) { - fuse_args.argv$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static MemorySegment argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void argv$set(MemorySegment seg, long index, MemorySegment x) { - fuse_args.argv$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle allocated$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("allocated")); public static VarHandle allocated$VH() { - return fuse_args.allocated$VH; + return constants$0.const$3; } /** * Getter for field: @@ -95,7 +85,7 @@ public class fuse_args { * } */ public static int allocated$get(MemorySegment seg) { - return (int)fuse_args.allocated$VH.get(seg); + return (int)constants$0.const$3.get(seg); } /** * Setter for field: @@ -104,20 +94,20 @@ public class fuse_args { * } */ public static void allocated$set(MemorySegment seg, int x) { - fuse_args.allocated$VH.set(seg, x); + constants$0.const$3.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { - return (int)fuse_args.allocated$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$3.get(seg.asSlice(index*sizeof())); } public static void allocated$set(MemorySegment seg, long index, int x) { - fuse_args.allocated$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_config.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_config.java similarity index 54% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_config.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_config.java index 34efb8e9..24565554 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_config.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_config.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -40,41 +40,11 @@ */ public class fuse_config { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("set_gid"), - Constants$root.C_INT$LAYOUT.withName("gid"), - Constants$root.C_INT$LAYOUT.withName("set_uid"), - Constants$root.C_INT$LAYOUT.withName("uid"), - Constants$root.C_INT$LAYOUT.withName("set_mode"), - Constants$root.C_INT$LAYOUT.withName("umask"), - Constants$root.C_DOUBLE$LAYOUT.withName("entry_timeout"), - Constants$root.C_DOUBLE$LAYOUT.withName("negative_timeout"), - Constants$root.C_DOUBLE$LAYOUT.withName("attr_timeout"), - Constants$root.C_INT$LAYOUT.withName("intr"), - Constants$root.C_INT$LAYOUT.withName("intr_signal"), - Constants$root.C_INT$LAYOUT.withName("remember"), - Constants$root.C_INT$LAYOUT.withName("hard_remove"), - Constants$root.C_INT$LAYOUT.withName("use_ino"), - Constants$root.C_INT$LAYOUT.withName("readdir_ino"), - Constants$root.C_INT$LAYOUT.withName("direct_io"), - Constants$root.C_INT$LAYOUT.withName("kernel_cache"), - Constants$root.C_INT$LAYOUT.withName("auto_cache"), - Constants$root.C_INT$LAYOUT.withName("no_rofd_flush"), - Constants$root.C_INT$LAYOUT.withName("ac_attr_timeout_set"), - MemoryLayout.paddingLayout(32), - Constants$root.C_DOUBLE$LAYOUT.withName("ac_attr_timeout"), - Constants$root.C_INT$LAYOUT.withName("nullpath_ok"), - Constants$root.C_INT$LAYOUT.withName("show_help"), - Constants$root.C_POINTER$LAYOUT.withName("modules"), - Constants$root.C_INT$LAYOUT.withName("debug"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_config"); public static MemoryLayout $LAYOUT() { - return fuse_config.$struct$LAYOUT; + return constants$10.const$2; } - static final VarHandle set_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_gid")); public static VarHandle set_gid$VH() { - return fuse_config.set_gid$VH; + return constants$10.const$3; } /** * Getter for field: @@ -83,7 +53,7 @@ public class fuse_config { * } */ public static int set_gid$get(MemorySegment seg) { - return (int)fuse_config.set_gid$VH.get(seg); + return (int)constants$10.const$3.get(seg); } /** * Setter for field: @@ -92,17 +62,16 @@ public class fuse_config { * } */ public static void set_gid$set(MemorySegment seg, int x) { - fuse_config.set_gid$VH.set(seg, x); + constants$10.const$3.set(seg, x); } public static int set_gid$get(MemorySegment seg, long index) { - return (int)fuse_config.set_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$3.get(seg.asSlice(index*sizeof())); } public static void set_gid$set(MemorySegment seg, long index, int x) { - fuse_config.set_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gid")); public static VarHandle gid$VH() { - return fuse_config.gid$VH; + return constants$10.const$4; } /** * Getter for field: @@ -111,7 +80,7 @@ public class fuse_config { * } */ public static int gid$get(MemorySegment seg) { - return (int)fuse_config.gid$VH.get(seg); + return (int)constants$10.const$4.get(seg); } /** * Setter for field: @@ -120,17 +89,16 @@ public class fuse_config { * } */ public static void gid$set(MemorySegment seg, int x) { - fuse_config.gid$VH.set(seg, x); + constants$10.const$4.set(seg, x); } public static int gid$get(MemorySegment seg, long index) { - return (int)fuse_config.gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$4.get(seg.asSlice(index*sizeof())); } public static void gid$set(MemorySegment seg, long index, int x) { - fuse_config.gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle set_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_uid")); public static VarHandle set_uid$VH() { - return fuse_config.set_uid$VH; + return constants$10.const$5; } /** * Getter for field: @@ -139,7 +107,7 @@ public class fuse_config { * } */ public static int set_uid$get(MemorySegment seg) { - return (int)fuse_config.set_uid$VH.get(seg); + return (int)constants$10.const$5.get(seg); } /** * Setter for field: @@ -148,17 +116,16 @@ public class fuse_config { * } */ public static void set_uid$set(MemorySegment seg, int x) { - fuse_config.set_uid$VH.set(seg, x); + constants$10.const$5.set(seg, x); } public static int set_uid$get(MemorySegment seg, long index) { - return (int)fuse_config.set_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$5.get(seg.asSlice(index*sizeof())); } public static void set_uid$set(MemorySegment seg, long index, int x) { - fuse_config.set_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("uid")); public static VarHandle uid$VH() { - return fuse_config.uid$VH; + return constants$11.const$0; } /** * Getter for field: @@ -167,7 +134,7 @@ public class fuse_config { * } */ public static int uid$get(MemorySegment seg) { - return (int)fuse_config.uid$VH.get(seg); + return (int)constants$11.const$0.get(seg); } /** * Setter for field: @@ -176,17 +143,16 @@ public class fuse_config { * } */ public static void uid$set(MemorySegment seg, int x) { - fuse_config.uid$VH.set(seg, x); + constants$11.const$0.set(seg, x); } public static int uid$get(MemorySegment seg, long index) { - return (int)fuse_config.uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$0.get(seg.asSlice(index*sizeof())); } public static void uid$set(MemorySegment seg, long index, int x) { - fuse_config.uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle set_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_mode")); public static VarHandle set_mode$VH() { - return fuse_config.set_mode$VH; + return constants$11.const$1; } /** * Getter for field: @@ -195,7 +161,7 @@ public class fuse_config { * } */ public static int set_mode$get(MemorySegment seg) { - return (int)fuse_config.set_mode$VH.get(seg); + return (int)constants$11.const$1.get(seg); } /** * Setter for field: @@ -204,17 +170,16 @@ public class fuse_config { * } */ public static void set_mode$set(MemorySegment seg, int x) { - fuse_config.set_mode$VH.set(seg, x); + constants$11.const$1.set(seg, x); } public static int set_mode$get(MemorySegment seg, long index) { - return (int)fuse_config.set_mode$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$1.get(seg.asSlice(index*sizeof())); } public static void set_mode$set(MemorySegment seg, long index, int x) { - fuse_config.set_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle umask$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("umask")); public static VarHandle umask$VH() { - return fuse_config.umask$VH; + return constants$11.const$2; } /** * Getter for field: @@ -223,7 +188,7 @@ public class fuse_config { * } */ public static int umask$get(MemorySegment seg) { - return (int)fuse_config.umask$VH.get(seg); + return (int)constants$11.const$2.get(seg); } /** * Setter for field: @@ -232,17 +197,16 @@ public class fuse_config { * } */ public static void umask$set(MemorySegment seg, int x) { - fuse_config.umask$VH.set(seg, x); + constants$11.const$2.set(seg, x); } public static int umask$get(MemorySegment seg, long index) { - return (int)fuse_config.umask$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$2.get(seg.asSlice(index*sizeof())); } public static void umask$set(MemorySegment seg, long index, int x) { - fuse_config.umask$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle entry_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("entry_timeout")); public static VarHandle entry_timeout$VH() { - return fuse_config.entry_timeout$VH; + return constants$11.const$3; } /** * Getter for field: @@ -251,7 +215,7 @@ public class fuse_config { * } */ public static double entry_timeout$get(MemorySegment seg) { - return (double)fuse_config.entry_timeout$VH.get(seg); + return (double)constants$11.const$3.get(seg); } /** * Setter for field: @@ -260,17 +224,16 @@ public class fuse_config { * } */ public static void entry_timeout$set(MemorySegment seg, double x) { - fuse_config.entry_timeout$VH.set(seg, x); + constants$11.const$3.set(seg, x); } public static double entry_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.entry_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$11.const$3.get(seg.asSlice(index*sizeof())); } public static void entry_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.entry_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle negative_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("negative_timeout")); public static VarHandle negative_timeout$VH() { - return fuse_config.negative_timeout$VH; + return constants$11.const$4; } /** * Getter for field: @@ -279,7 +242,7 @@ public class fuse_config { * } */ public static double negative_timeout$get(MemorySegment seg) { - return (double)fuse_config.negative_timeout$VH.get(seg); + return (double)constants$11.const$4.get(seg); } /** * Setter for field: @@ -288,17 +251,16 @@ public class fuse_config { * } */ public static void negative_timeout$set(MemorySegment seg, double x) { - fuse_config.negative_timeout$VH.set(seg, x); + constants$11.const$4.set(seg, x); } public static double negative_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.negative_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$11.const$4.get(seg.asSlice(index*sizeof())); } public static void negative_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.negative_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle attr_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("attr_timeout")); public static VarHandle attr_timeout$VH() { - return fuse_config.attr_timeout$VH; + return constants$11.const$5; } /** * Getter for field: @@ -307,7 +269,7 @@ public class fuse_config { * } */ public static double attr_timeout$get(MemorySegment seg) { - return (double)fuse_config.attr_timeout$VH.get(seg); + return (double)constants$11.const$5.get(seg); } /** * Setter for field: @@ -316,17 +278,16 @@ public class fuse_config { * } */ public static void attr_timeout$set(MemorySegment seg, double x) { - fuse_config.attr_timeout$VH.set(seg, x); + constants$11.const$5.set(seg, x); } public static double attr_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.attr_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$11.const$5.get(seg.asSlice(index*sizeof())); } public static void attr_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.attr_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle intr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("intr")); public static VarHandle intr$VH() { - return fuse_config.intr$VH; + return constants$12.const$0; } /** * Getter for field: @@ -335,7 +296,7 @@ public class fuse_config { * } */ public static int intr$get(MemorySegment seg) { - return (int)fuse_config.intr$VH.get(seg); + return (int)constants$12.const$0.get(seg); } /** * Setter for field: @@ -344,17 +305,16 @@ public class fuse_config { * } */ public static void intr$set(MemorySegment seg, int x) { - fuse_config.intr$VH.set(seg, x); + constants$12.const$0.set(seg, x); } public static int intr$get(MemorySegment seg, long index) { - return (int)fuse_config.intr$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$0.get(seg.asSlice(index*sizeof())); } public static void intr$set(MemorySegment seg, long index, int x) { - fuse_config.intr$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle intr_signal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("intr_signal")); public static VarHandle intr_signal$VH() { - return fuse_config.intr_signal$VH; + return constants$12.const$1; } /** * Getter for field: @@ -363,7 +323,7 @@ public class fuse_config { * } */ public static int intr_signal$get(MemorySegment seg) { - return (int)fuse_config.intr_signal$VH.get(seg); + return (int)constants$12.const$1.get(seg); } /** * Setter for field: @@ -372,17 +332,16 @@ public class fuse_config { * } */ public static void intr_signal$set(MemorySegment seg, int x) { - fuse_config.intr_signal$VH.set(seg, x); + constants$12.const$1.set(seg, x); } public static int intr_signal$get(MemorySegment seg, long index) { - return (int)fuse_config.intr_signal$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$1.get(seg.asSlice(index*sizeof())); } public static void intr_signal$set(MemorySegment seg, long index, int x) { - fuse_config.intr_signal$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle remember$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("remember")); public static VarHandle remember$VH() { - return fuse_config.remember$VH; + return constants$12.const$2; } /** * Getter for field: @@ -391,7 +350,7 @@ public class fuse_config { * } */ public static int remember$get(MemorySegment seg) { - return (int)fuse_config.remember$VH.get(seg); + return (int)constants$12.const$2.get(seg); } /** * Setter for field: @@ -400,17 +359,16 @@ public class fuse_config { * } */ public static void remember$set(MemorySegment seg, int x) { - fuse_config.remember$VH.set(seg, x); + constants$12.const$2.set(seg, x); } public static int remember$get(MemorySegment seg, long index) { - return (int)fuse_config.remember$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$2.get(seg.asSlice(index*sizeof())); } public static void remember$set(MemorySegment seg, long index, int x) { - fuse_config.remember$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle hard_remove$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hard_remove")); public static VarHandle hard_remove$VH() { - return fuse_config.hard_remove$VH; + return constants$12.const$3; } /** * Getter for field: @@ -419,7 +377,7 @@ public class fuse_config { * } */ public static int hard_remove$get(MemorySegment seg) { - return (int)fuse_config.hard_remove$VH.get(seg); + return (int)constants$12.const$3.get(seg); } /** * Setter for field: @@ -428,17 +386,16 @@ public class fuse_config { * } */ public static void hard_remove$set(MemorySegment seg, int x) { - fuse_config.hard_remove$VH.set(seg, x); + constants$12.const$3.set(seg, x); } public static int hard_remove$get(MemorySegment seg, long index) { - return (int)fuse_config.hard_remove$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$3.get(seg.asSlice(index*sizeof())); } public static void hard_remove$set(MemorySegment seg, long index, int x) { - fuse_config.hard_remove$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle use_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("use_ino")); public static VarHandle use_ino$VH() { - return fuse_config.use_ino$VH; + return constants$12.const$4; } /** * Getter for field: @@ -447,7 +404,7 @@ public class fuse_config { * } */ public static int use_ino$get(MemorySegment seg) { - return (int)fuse_config.use_ino$VH.get(seg); + return (int)constants$12.const$4.get(seg); } /** * Setter for field: @@ -456,17 +413,16 @@ public class fuse_config { * } */ public static void use_ino$set(MemorySegment seg, int x) { - fuse_config.use_ino$VH.set(seg, x); + constants$12.const$4.set(seg, x); } public static int use_ino$get(MemorySegment seg, long index) { - return (int)fuse_config.use_ino$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$4.get(seg.asSlice(index*sizeof())); } public static void use_ino$set(MemorySegment seg, long index, int x) { - fuse_config.use_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle readdir_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir_ino")); public static VarHandle readdir_ino$VH() { - return fuse_config.readdir_ino$VH; + return constants$12.const$5; } /** * Getter for field: @@ -475,7 +431,7 @@ public class fuse_config { * } */ public static int readdir_ino$get(MemorySegment seg) { - return (int)fuse_config.readdir_ino$VH.get(seg); + return (int)constants$12.const$5.get(seg); } /** * Setter for field: @@ -484,17 +440,16 @@ public class fuse_config { * } */ public static void readdir_ino$set(MemorySegment seg, int x) { - fuse_config.readdir_ino$VH.set(seg, x); + constants$12.const$5.set(seg, x); } public static int readdir_ino$get(MemorySegment seg, long index) { - return (int)fuse_config.readdir_ino$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$5.get(seg.asSlice(index*sizeof())); } public static void readdir_ino$set(MemorySegment seg, long index, int x) { - fuse_config.readdir_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle direct_io$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("direct_io")); public static VarHandle direct_io$VH() { - return fuse_config.direct_io$VH; + return constants$13.const$0; } /** * Getter for field: @@ -503,7 +458,7 @@ public class fuse_config { * } */ public static int direct_io$get(MemorySegment seg) { - return (int)fuse_config.direct_io$VH.get(seg); + return (int)constants$13.const$0.get(seg); } /** * Setter for field: @@ -512,17 +467,16 @@ public class fuse_config { * } */ public static void direct_io$set(MemorySegment seg, int x) { - fuse_config.direct_io$VH.set(seg, x); + constants$13.const$0.set(seg, x); } public static int direct_io$get(MemorySegment seg, long index) { - return (int)fuse_config.direct_io$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$0.get(seg.asSlice(index*sizeof())); } public static void direct_io$set(MemorySegment seg, long index, int x) { - fuse_config.direct_io$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle kernel_cache$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("kernel_cache")); public static VarHandle kernel_cache$VH() { - return fuse_config.kernel_cache$VH; + return constants$13.const$1; } /** * Getter for field: @@ -531,7 +485,7 @@ public class fuse_config { * } */ public static int kernel_cache$get(MemorySegment seg) { - return (int)fuse_config.kernel_cache$VH.get(seg); + return (int)constants$13.const$1.get(seg); } /** * Setter for field: @@ -540,17 +494,16 @@ public class fuse_config { * } */ public static void kernel_cache$set(MemorySegment seg, int x) { - fuse_config.kernel_cache$VH.set(seg, x); + constants$13.const$1.set(seg, x); } public static int kernel_cache$get(MemorySegment seg, long index) { - return (int)fuse_config.kernel_cache$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$1.get(seg.asSlice(index*sizeof())); } public static void kernel_cache$set(MemorySegment seg, long index, int x) { - fuse_config.kernel_cache$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle auto_cache$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("auto_cache")); public static VarHandle auto_cache$VH() { - return fuse_config.auto_cache$VH; + return constants$13.const$2; } /** * Getter for field: @@ -559,7 +512,7 @@ public class fuse_config { * } */ public static int auto_cache$get(MemorySegment seg) { - return (int)fuse_config.auto_cache$VH.get(seg); + return (int)constants$13.const$2.get(seg); } /** * Setter for field: @@ -568,17 +521,16 @@ public class fuse_config { * } */ public static void auto_cache$set(MemorySegment seg, int x) { - fuse_config.auto_cache$VH.set(seg, x); + constants$13.const$2.set(seg, x); } public static int auto_cache$get(MemorySegment seg, long index) { - return (int)fuse_config.auto_cache$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$2.get(seg.asSlice(index*sizeof())); } public static void auto_cache$set(MemorySegment seg, long index, int x) { - fuse_config.auto_cache$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle no_rofd_flush$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("no_rofd_flush")); public static VarHandle no_rofd_flush$VH() { - return fuse_config.no_rofd_flush$VH; + return constants$13.const$3; } /** * Getter for field: @@ -587,7 +539,7 @@ public class fuse_config { * } */ public static int no_rofd_flush$get(MemorySegment seg) { - return (int)fuse_config.no_rofd_flush$VH.get(seg); + return (int)constants$13.const$3.get(seg); } /** * Setter for field: @@ -596,17 +548,16 @@ public class fuse_config { * } */ public static void no_rofd_flush$set(MemorySegment seg, int x) { - fuse_config.no_rofd_flush$VH.set(seg, x); + constants$13.const$3.set(seg, x); } public static int no_rofd_flush$get(MemorySegment seg, long index) { - return (int)fuse_config.no_rofd_flush$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$3.get(seg.asSlice(index*sizeof())); } public static void no_rofd_flush$set(MemorySegment seg, long index, int x) { - fuse_config.no_rofd_flush$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle ac_attr_timeout_set$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout_set")); public static VarHandle ac_attr_timeout_set$VH() { - return fuse_config.ac_attr_timeout_set$VH; + return constants$13.const$4; } /** * Getter for field: @@ -615,7 +566,7 @@ public class fuse_config { * } */ public static int ac_attr_timeout_set$get(MemorySegment seg) { - return (int)fuse_config.ac_attr_timeout_set$VH.get(seg); + return (int)constants$13.const$4.get(seg); } /** * Setter for field: @@ -624,17 +575,16 @@ public class fuse_config { * } */ public static void ac_attr_timeout_set$set(MemorySegment seg, int x) { - fuse_config.ac_attr_timeout_set$VH.set(seg, x); + constants$13.const$4.set(seg, x); } public static int ac_attr_timeout_set$get(MemorySegment seg, long index) { - return (int)fuse_config.ac_attr_timeout_set$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$13.const$4.get(seg.asSlice(index*sizeof())); } public static void ac_attr_timeout_set$set(MemorySegment seg, long index, int x) { - fuse_config.ac_attr_timeout_set$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle ac_attr_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout")); public static VarHandle ac_attr_timeout$VH() { - return fuse_config.ac_attr_timeout$VH; + return constants$13.const$5; } /** * Getter for field: @@ -643,7 +593,7 @@ public class fuse_config { * } */ public static double ac_attr_timeout$get(MemorySegment seg) { - return (double)fuse_config.ac_attr_timeout$VH.get(seg); + return (double)constants$13.const$5.get(seg); } /** * Setter for field: @@ -652,17 +602,16 @@ public class fuse_config { * } */ public static void ac_attr_timeout$set(MemorySegment seg, double x) { - fuse_config.ac_attr_timeout$VH.set(seg, x); + constants$13.const$5.set(seg, x); } public static double ac_attr_timeout$get(MemorySegment seg, long index) { - return (double)fuse_config.ac_attr_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$13.const$5.get(seg.asSlice(index*sizeof())); } public static void ac_attr_timeout$set(MemorySegment seg, long index, double x) { - fuse_config.ac_attr_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$13.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle nullpath_ok$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("nullpath_ok")); public static VarHandle nullpath_ok$VH() { - return fuse_config.nullpath_ok$VH; + return constants$14.const$0; } /** * Getter for field: @@ -671,7 +620,7 @@ public class fuse_config { * } */ public static int nullpath_ok$get(MemorySegment seg) { - return (int)fuse_config.nullpath_ok$VH.get(seg); + return (int)constants$14.const$0.get(seg); } /** * Setter for field: @@ -680,17 +629,16 @@ public class fuse_config { * } */ public static void nullpath_ok$set(MemorySegment seg, int x) { - fuse_config.nullpath_ok$VH.set(seg, x); + constants$14.const$0.set(seg, x); } public static int nullpath_ok$get(MemorySegment seg, long index) { - return (int)fuse_config.nullpath_ok$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$14.const$0.get(seg.asSlice(index*sizeof())); } public static void nullpath_ok$set(MemorySegment seg, long index, int x) { - fuse_config.nullpath_ok$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_help$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_help")); public static VarHandle show_help$VH() { - return fuse_config.show_help$VH; + return constants$14.const$1; } /** * Getter for field: @@ -699,7 +647,7 @@ public class fuse_config { * } */ public static int show_help$get(MemorySegment seg) { - return (int)fuse_config.show_help$VH.get(seg); + return (int)constants$14.const$1.get(seg); } /** * Setter for field: @@ -708,17 +656,16 @@ public class fuse_config { * } */ public static void show_help$set(MemorySegment seg, int x) { - fuse_config.show_help$VH.set(seg, x); + constants$14.const$1.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { - return (int)fuse_config.show_help$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$14.const$1.get(seg.asSlice(index*sizeof())); } public static void show_help$set(MemorySegment seg, long index, int x) { - fuse_config.show_help$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle modules$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("modules")); public static VarHandle modules$VH() { - return fuse_config.modules$VH; + return constants$14.const$2; } /** * Getter for field: @@ -727,7 +674,7 @@ public class fuse_config { * } */ public static MemorySegment modules$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$14.const$2.get(seg); } /** * Setter for field: @@ -736,17 +683,16 @@ public class fuse_config { * } */ public static void modules$set(MemorySegment seg, MemorySegment x) { - fuse_config.modules$VH.set(seg, x); + constants$14.const$2.set(seg, x); } public static MemorySegment modules$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$14.const$2.get(seg.asSlice(index*sizeof())); } public static void modules$set(MemorySegment seg, long index, MemorySegment x) { - fuse_config.modules$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle debug$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("debug")); public static VarHandle debug$VH() { - return fuse_config.debug$VH; + return constants$14.const$3; } /** * Getter for field: @@ -755,7 +701,7 @@ public class fuse_config { * } */ public static int debug$get(MemorySegment seg) { - return (int)fuse_config.debug$VH.get(seg); + return (int)constants$14.const$3.get(seg); } /** * Setter for field: @@ -764,20 +710,20 @@ public class fuse_config { * } */ public static void debug$set(MemorySegment seg, int x) { - fuse_config.debug$VH.set(seg, x); + constants$14.const$3.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { - return (int)fuse_config.debug$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$14.const$3.get(seg.asSlice(index*sizeof())); } public static void debug$set(MemorySegment seg, long index, int x) { - fuse_config.debug$VH.set(seg.asSlice(index*sizeof()), x); + constants$14.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_conn_info.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_conn_info.java similarity index 55% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_conn_info.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_conn_info.java index 9b193291..0b5bddb2 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_conn_info.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_conn_info.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,25 +26,11 @@ */ public class fuse_conn_info { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("proto_major"), - Constants$root.C_INT$LAYOUT.withName("proto_minor"), - Constants$root.C_INT$LAYOUT.withName("max_write"), - Constants$root.C_INT$LAYOUT.withName("max_read"), - Constants$root.C_INT$LAYOUT.withName("max_readahead"), - Constants$root.C_INT$LAYOUT.withName("capable"), - Constants$root.C_INT$LAYOUT.withName("want"), - Constants$root.C_INT$LAYOUT.withName("max_background"), - Constants$root.C_INT$LAYOUT.withName("congestion_threshold"), - Constants$root.C_INT$LAYOUT.withName("time_gran"), - MemoryLayout.sequenceLayout(22, Constants$root.C_INT$LAYOUT).withName("reserved") - ).withName("fuse_conn_info"); public static MemoryLayout $LAYOUT() { - return fuse_conn_info.$struct$LAYOUT; + return constants$2.const$3; } - static final VarHandle proto_major$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); public static VarHandle proto_major$VH() { - return fuse_conn_info.proto_major$VH; + return constants$2.const$4; } /** * Getter for field: @@ -53,7 +39,7 @@ public class fuse_conn_info { * } */ public static int proto_major$get(MemorySegment seg) { - return (int)fuse_conn_info.proto_major$VH.get(seg); + return (int)constants$2.const$4.get(seg); } /** * Setter for field: @@ -62,17 +48,16 @@ public class fuse_conn_info { * } */ public static void proto_major$set(MemorySegment seg, int x) { - fuse_conn_info.proto_major$VH.set(seg, x); + constants$2.const$4.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.proto_major$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$4.get(seg.asSlice(index*sizeof())); } public static void proto_major$set(MemorySegment seg, long index, int x) { - fuse_conn_info.proto_major$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle proto_minor$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); public static VarHandle proto_minor$VH() { - return fuse_conn_info.proto_minor$VH; + return constants$2.const$5; } /** * Getter for field: @@ -81,7 +66,7 @@ public class fuse_conn_info { * } */ public static int proto_minor$get(MemorySegment seg) { - return (int)fuse_conn_info.proto_minor$VH.get(seg); + return (int)constants$2.const$5.get(seg); } /** * Setter for field: @@ -90,17 +75,16 @@ public class fuse_conn_info { * } */ public static void proto_minor$set(MemorySegment seg, int x) { - fuse_conn_info.proto_minor$VH.set(seg, x); + constants$2.const$5.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.proto_minor$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$5.get(seg.asSlice(index*sizeof())); } public static void proto_minor$set(MemorySegment seg, long index, int x) { - fuse_conn_info.proto_minor$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_write")); public static VarHandle max_write$VH() { - return fuse_conn_info.max_write$VH; + return constants$3.const$0; } /** * Getter for field: @@ -109,7 +93,7 @@ public class fuse_conn_info { * } */ public static int max_write$get(MemorySegment seg) { - return (int)fuse_conn_info.max_write$VH.get(seg); + return (int)constants$3.const$0.get(seg); } /** * Setter for field: @@ -118,17 +102,16 @@ public class fuse_conn_info { * } */ public static void max_write$set(MemorySegment seg, int x) { - fuse_conn_info.max_write$VH.set(seg, x); + constants$3.const$0.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_write$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$0.get(seg.asSlice(index*sizeof())); } public static void max_write$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_write$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_read")); public static VarHandle max_read$VH() { - return fuse_conn_info.max_read$VH; + return constants$3.const$1; } /** * Getter for field: @@ -137,7 +120,7 @@ public class fuse_conn_info { * } */ public static int max_read$get(MemorySegment seg) { - return (int)fuse_conn_info.max_read$VH.get(seg); + return (int)constants$3.const$1.get(seg); } /** * Setter for field: @@ -146,17 +129,16 @@ public class fuse_conn_info { * } */ public static void max_read$set(MemorySegment seg, int x) { - fuse_conn_info.max_read$VH.set(seg, x); + constants$3.const$1.set(seg, x); } public static int max_read$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_read$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$1.get(seg.asSlice(index*sizeof())); } public static void max_read$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_read$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_readahead$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); public static VarHandle max_readahead$VH() { - return fuse_conn_info.max_readahead$VH; + return constants$3.const$2; } /** * Getter for field: @@ -165,7 +147,7 @@ public class fuse_conn_info { * } */ public static int max_readahead$get(MemorySegment seg) { - return (int)fuse_conn_info.max_readahead$VH.get(seg); + return (int)constants$3.const$2.get(seg); } /** * Setter for field: @@ -174,17 +156,16 @@ public class fuse_conn_info { * } */ public static void max_readahead$set(MemorySegment seg, int x) { - fuse_conn_info.max_readahead$VH.set(seg, x); + constants$3.const$2.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_readahead$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$2.get(seg.asSlice(index*sizeof())); } public static void max_readahead$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_readahead$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle capable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("capable")); public static VarHandle capable$VH() { - return fuse_conn_info.capable$VH; + return constants$3.const$3; } /** * Getter for field: @@ -193,7 +174,7 @@ public class fuse_conn_info { * } */ public static int capable$get(MemorySegment seg) { - return (int)fuse_conn_info.capable$VH.get(seg); + return (int)constants$3.const$3.get(seg); } /** * Setter for field: @@ -202,17 +183,16 @@ public class fuse_conn_info { * } */ public static void capable$set(MemorySegment seg, int x) { - fuse_conn_info.capable$VH.set(seg, x); + constants$3.const$3.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.capable$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$3.get(seg.asSlice(index*sizeof())); } public static void capable$set(MemorySegment seg, long index, int x) { - fuse_conn_info.capable$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle want$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("want")); public static VarHandle want$VH() { - return fuse_conn_info.want$VH; + return constants$3.const$4; } /** * Getter for field: @@ -221,7 +201,7 @@ public class fuse_conn_info { * } */ public static int want$get(MemorySegment seg) { - return (int)fuse_conn_info.want$VH.get(seg); + return (int)constants$3.const$4.get(seg); } /** * Setter for field: @@ -230,17 +210,16 @@ public class fuse_conn_info { * } */ public static void want$set(MemorySegment seg, int x) { - fuse_conn_info.want$VH.set(seg, x); + constants$3.const$4.set(seg, x); } public static int want$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.want$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$4.get(seg.asSlice(index*sizeof())); } public static void want$set(MemorySegment seg, long index, int x) { - fuse_conn_info.want$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_background$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_background")); public static VarHandle max_background$VH() { - return fuse_conn_info.max_background$VH; + return constants$3.const$5; } /** * Getter for field: @@ -249,7 +228,7 @@ public class fuse_conn_info { * } */ public static int max_background$get(MemorySegment seg) { - return (int)fuse_conn_info.max_background$VH.get(seg); + return (int)constants$3.const$5.get(seg); } /** * Setter for field: @@ -258,17 +237,16 @@ public class fuse_conn_info { * } */ public static void max_background$set(MemorySegment seg, int x) { - fuse_conn_info.max_background$VH.set(seg, x); + constants$3.const$5.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_background$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$5.get(seg.asSlice(index*sizeof())); } public static void max_background$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_background$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle congestion_threshold$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); public static VarHandle congestion_threshold$VH() { - return fuse_conn_info.congestion_threshold$VH; + return constants$4.const$0; } /** * Getter for field: @@ -277,7 +255,7 @@ public class fuse_conn_info { * } */ public static int congestion_threshold$get(MemorySegment seg) { - return (int)fuse_conn_info.congestion_threshold$VH.get(seg); + return (int)constants$4.const$0.get(seg); } /** * Setter for field: @@ -286,17 +264,16 @@ public class fuse_conn_info { * } */ public static void congestion_threshold$set(MemorySegment seg, int x) { - fuse_conn_info.congestion_threshold$VH.set(seg, x); + constants$4.const$0.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.congestion_threshold$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$4.const$0.get(seg.asSlice(index*sizeof())); } public static void congestion_threshold$set(MemorySegment seg, long index, int x) { - fuse_conn_info.congestion_threshold$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle time_gran$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("time_gran")); public static VarHandle time_gran$VH() { - return fuse_conn_info.time_gran$VH; + return constants$4.const$1; } /** * Getter for field: @@ -305,7 +282,7 @@ public class fuse_conn_info { * } */ public static int time_gran$get(MemorySegment seg) { - return (int)fuse_conn_info.time_gran$VH.get(seg); + return (int)constants$4.const$1.get(seg); } /** * Setter for field: @@ -314,13 +291,13 @@ public class fuse_conn_info { * } */ public static void time_gran$set(MemorySegment seg, int x) { - fuse_conn_info.time_gran$VH.set(seg, x); + constants$4.const$1.set(seg, x); } public static int time_gran$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.time_gran$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$4.const$1.get(seg.asSlice(index*sizeof())); } public static void time_gran$set(MemorySegment seg, long index, int x) { - fuse_conn_info.time_gran$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$1.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment reserved$slice(MemorySegment seg) { return seg.asSlice(40, 88); @@ -330,7 +307,7 @@ public class fuse_conn_info { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_file_info.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_file_info.java new file mode 100644 index 00000000..95f965b3 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_file_info.java @@ -0,0 +1,151 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_file_info { + * int flags; + * * unsigned int writepage; + * unsigned int direct_io; + * unsigned int keep_cache; + * unsigned int flush; + * unsigned int nonseekable; + * unsigned int flock_release; + * unsigned int cache_readdir; + * unsigned int noflush; + * unsigned int padding; + * unsigned int padding2; + * unsigned long fh; + * unsigned long lock_owner; + * unsigned int poll_events; + * }; + * } + */ +public class fuse_file_info { + + public static MemoryLayout $LAYOUT() { + return constants$1.const$1; + } + public static VarHandle flags$VH() { + return constants$1.const$2; + } + /** + * Getter for field: + * {@snippet : + * int flags; + * } + */ + public static int flags$get(MemorySegment seg) { + return (int)constants$1.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int flags; + * } + */ + public static void flags$set(MemorySegment seg, int x) { + constants$1.const$2.set(seg, x); + } + public static int flags$get(MemorySegment seg, long index) { + return (int)constants$1.const$2.get(seg.asSlice(index*sizeof())); + } + public static void flags$set(MemorySegment seg, long index, int x) { + constants$1.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static VarHandle fh$VH() { + return constants$1.const$3; + } + /** + * Getter for field: + * {@snippet : + * unsigned long fh; + * } + */ + public static long fh$get(MemorySegment seg) { + return (long)constants$1.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned long fh; + * } + */ + public static void fh$set(MemorySegment seg, long x) { + constants$1.const$3.set(seg, x); + } + public static long fh$get(MemorySegment seg, long index) { + return (long)constants$1.const$3.get(seg.asSlice(index*sizeof())); + } + public static void fh$set(MemorySegment seg, long index, long x) { + constants$1.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static VarHandle lock_owner$VH() { + return constants$1.const$4; + } + /** + * Getter for field: + * {@snippet : + * unsigned long lock_owner; + * } + */ + public static long lock_owner$get(MemorySegment seg) { + return (long)constants$1.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned long lock_owner; + * } + */ + public static void lock_owner$set(MemorySegment seg, long x) { + constants$1.const$4.set(seg, x); + } + public static long lock_owner$get(MemorySegment seg, long index) { + return (long)constants$1.const$4.get(seg.asSlice(index*sizeof())); + } + public static void lock_owner$set(MemorySegment seg, long index, long x) { + constants$1.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static VarHandle poll_events$VH() { + return constants$1.const$5; + } + /** + * Getter for field: + * {@snippet : + * unsigned int poll_events; + * } + */ + public static int poll_events$get(MemorySegment seg) { + return (int)constants$1.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int poll_events; + * } + */ + public static void poll_events$set(MemorySegment seg, int x) { + constants$1.const$5.set(seg, x); + } + public static int poll_events$get(MemorySegment seg, long index) { + return (int)constants$1.const$5.get(seg.asSlice(index*sizeof())); + } + public static void poll_events$set(MemorySegment seg, long index, int x) { + constants$1.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_fill_dir_t.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_fill_dir_t.java similarity index 62% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_fill_dir_t.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_fill_dir_t.java index 601ff15c..e836d2aa 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_fill_dir_t.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_fill_dir_t.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -15,14 +15,14 @@ public interface fuse_fill_dir_t { int apply(java.lang.foreign.MemorySegment buf, java.lang.foreign.MemorySegment name, java.lang.foreign.MemorySegment stbuf, long off, int flags); - static MemorySegment allocate(fuse_fill_dir_t fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fuse_fill_dir_t.class, fi, constants$0.fuse_fill_dir_t$FUNC, scope); + static MemorySegment allocate(fuse_fill_dir_t fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$10.const$0, fi, constants$9.const$5, scope); } - static fuse_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + static fuse_fill_dir_t ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); return (java.lang.foreign.MemorySegment _buf, java.lang.foreign.MemorySegment _name, java.lang.foreign.MemorySegment _stbuf, long _off, int _flags) -> { try { - return (int)constants$1.fuse_fill_dir_t$MH.invokeExact(symbol, _buf, _name, _stbuf, _off, _flags); + return (int)constants$10.const$1.invokeExact(symbol, _buf, _name, _stbuf, _off, _flags); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_h.java similarity index 76% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_h.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_h.java index fc570944..00882bba 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,16 +9,16 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; public static MethodHandle fuse_version$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_version$MH,"fuse_version"); + return RuntimeHelper.requireNonNull(constants$4.const$3,"fuse_version"); } /** * {@snippet : @@ -34,7 +34,7 @@ public static int fuse_version() { } } public static MethodHandle fuse_loop_cfg_create$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_create$MH,"fuse_loop_cfg_create"); + return RuntimeHelper.requireNonNull(constants$4.const$5,"fuse_loop_cfg_create"); } /** * {@snippet : @@ -50,7 +50,7 @@ public static MemorySegment fuse_loop_cfg_create() { } } public static MethodHandle fuse_loop_cfg_destroy$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_destroy$MH,"fuse_loop_cfg_destroy"); + return RuntimeHelper.requireNonNull(constants$5.const$1,"fuse_loop_cfg_destroy"); } /** * {@snippet : @@ -66,7 +66,7 @@ public static void fuse_loop_cfg_destroy(MemorySegment config) { } } public static MethodHandle fuse_loop_cfg_set_max_threads$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_set_max_threads$MH,"fuse_loop_cfg_set_max_threads"); + return RuntimeHelper.requireNonNull(constants$5.const$3,"fuse_loop_cfg_set_max_threads"); } /** * {@snippet : @@ -82,7 +82,7 @@ public static void fuse_loop_cfg_set_max_threads(MemorySegment config, int value } } public static MethodHandle fuse_loop_cfg_set_clone_fd$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_loop_cfg_set_clone_fd$MH,"fuse_loop_cfg_set_clone_fd"); + return RuntimeHelper.requireNonNull(constants$5.const$4,"fuse_loop_cfg_set_clone_fd"); } /** * {@snippet : @@ -98,7 +98,7 @@ public static void fuse_loop_cfg_set_clone_fd(MemorySegment config, int value) { } } public static MethodHandle fuse_lib_help$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_lib_help$MH,"fuse_lib_help"); + return RuntimeHelper.requireNonNull(constants$36.const$0,"fuse_lib_help"); } /** * {@snippet : @@ -114,11 +114,11 @@ public static void fuse_lib_help(MemorySegment args) { } } public static MethodHandle fuse_new$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_new$MH,"fuse_new"); + return RuntimeHelper.requireNonNull(constants$36.const$2,"fuse_new"); } /** * {@snippet : - * struct fuse* fuse_new(struct fuse_args* args, struct fuse_operations* op, size_t op_size, void* private_data); + * struct fuse* fuse_new(struct fuse_args* args, struct fuse_operations* op, unsigned long op_size, void* private_data); * } */ public static MemorySegment fuse_new(MemorySegment args, MemorySegment op, long op_size, MemorySegment private_data) { @@ -130,7 +130,7 @@ public static MemorySegment fuse_new(MemorySegment args, MemorySegment op, long } } public static MethodHandle fuse_mount$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_mount$MH,"fuse_mount"); + return RuntimeHelper.requireNonNull(constants$36.const$3,"fuse_mount"); } /** * {@snippet : @@ -146,7 +146,7 @@ public static int fuse_mount(MemorySegment f, MemorySegment mountpoint) { } } public static MethodHandle fuse_unmount$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_unmount$MH,"fuse_unmount"); + return RuntimeHelper.requireNonNull(constants$36.const$4,"fuse_unmount"); } /** * {@snippet : @@ -162,7 +162,7 @@ public static void fuse_unmount(MemorySegment f) { } } public static MethodHandle fuse_destroy$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_destroy$MH,"fuse_destroy"); + return RuntimeHelper.requireNonNull(constants$36.const$5,"fuse_destroy"); } /** * {@snippet : @@ -178,7 +178,7 @@ public static void fuse_destroy(MemorySegment f) { } } public static MethodHandle fuse_loop$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_loop$MH,"fuse_loop"); + return RuntimeHelper.requireNonNull(constants$37.const$0,"fuse_loop"); } /** * {@snippet : @@ -194,7 +194,7 @@ public static int fuse_loop(MemorySegment f) { } } public static MethodHandle fuse_exit$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_exit$MH,"fuse_exit"); + return RuntimeHelper.requireNonNull(constants$37.const$1,"fuse_exit"); } /** * {@snippet : @@ -210,7 +210,7 @@ public static void fuse_exit(MemorySegment f) { } } public static MethodHandle fuse_loop_mt$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_loop_mt$MH,"fuse_loop_mt"); + return RuntimeHelper.requireNonNull(constants$37.const$2,"fuse_loop_mt"); } /** * {@snippet : @@ -226,7 +226,7 @@ public static int fuse_loop_mt(MemorySegment f, MemorySegment config) { } } public static MethodHandle fuse_get_session$MH() { - return RuntimeHelper.requireNonNull(constants$2.fuse_get_session$MH,"fuse_get_session"); + return RuntimeHelper.requireNonNull(constants$37.const$4,"fuse_get_session"); } /** * {@snippet : diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_loop_config_v1.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_loop_config_v1.java similarity index 56% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_loop_config_v1.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_loop_config_v1.java index f6c7114b..d67ec659 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_loop_config_v1.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_loop_config_v1.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -17,16 +17,11 @@ */ public class fuse_loop_config_v1 { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("clone_fd"), - Constants$root.C_INT$LAYOUT.withName("max_idle_threads") - ).withName("fuse_loop_config_v1"); public static MemoryLayout $LAYOUT() { - return fuse_loop_config_v1.$struct$LAYOUT; + return constants$2.const$0; } - static final VarHandle clone_fd$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); public static VarHandle clone_fd$VH() { - return fuse_loop_config_v1.clone_fd$VH; + return constants$2.const$1; } /** * Getter for field: @@ -35,7 +30,7 @@ public class fuse_loop_config_v1 { * } */ public static int clone_fd$get(MemorySegment seg) { - return (int)fuse_loop_config_v1.clone_fd$VH.get(seg); + return (int)constants$2.const$1.get(seg); } /** * Setter for field: @@ -44,17 +39,16 @@ public class fuse_loop_config_v1 { * } */ public static void clone_fd$set(MemorySegment seg, int x) { - fuse_loop_config_v1.clone_fd$VH.set(seg, x); + constants$2.const$1.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { - return (int)fuse_loop_config_v1.clone_fd$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$1.get(seg.asSlice(index*sizeof())); } public static void clone_fd$set(MemorySegment seg, long index, int x) { - fuse_loop_config_v1.clone_fd$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_idle_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); public static VarHandle max_idle_threads$VH() { - return fuse_loop_config_v1.max_idle_threads$VH; + return constants$2.const$2; } /** * Getter for field: @@ -63,7 +57,7 @@ public class fuse_loop_config_v1 { * } */ public static int max_idle_threads$get(MemorySegment seg) { - return (int)fuse_loop_config_v1.max_idle_threads$VH.get(seg); + return (int)constants$2.const$2.get(seg); } /** * Setter for field: @@ -72,20 +66,20 @@ public class fuse_loop_config_v1 { * } */ public static void max_idle_threads$set(MemorySegment seg, int x) { - fuse_loop_config_v1.max_idle_threads$VH.set(seg, x); + constants$2.const$2.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { - return (int)fuse_loop_config_v1.max_idle_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$2.get(seg.asSlice(index*sizeof())); } public static void max_idle_threads$set(MemorySegment seg, long index, int x) { - fuse_loop_config_v1.max_idle_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$2.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_operations.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_operations.java new file mode 100644 index 00000000..ec8aef1c --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/fuse_operations.java @@ -0,0 +1,2297 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_operations { + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * int (*readlink)(char*,char*,unsigned long); + * int (*mknod)(char*,unsigned int,unsigned long); + * int (*mkdir)(char*,unsigned int); + * int (*unlink)(char*); + * int (*rmdir)(char*); + * int (*symlink)(char*,char*); + * int (*rename)(char*,char*,unsigned int); + * int (*link)(char*,char*); + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * int (*truncate)(char*,long,struct fuse_file_info*); + * int (*open)(char*,struct fuse_file_info*); + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * int (*statfs)(char*,struct statvfs*); + * int (*flush)(char*,struct fuse_file_info*); + * int (*release)(char*,struct fuse_file_info*); + * int (*fsync)(char*,int,struct fuse_file_info*); + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * int (*getxattr)(char*,char*,char*,unsigned long); + * int (*listxattr)(char*,char*,unsigned long); + * int (*removexattr)(char*,char*); + * int (*opendir)(char*,struct fuse_file_info*); + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * int (*releasedir)(char*,struct fuse_file_info*); + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * void (*destroy)(void*); + * int (*access)(char*,int); + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * int (*bmap)(char*,unsigned long,unsigned long*); + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * int (*flock)(char*,struct fuse_file_info*,int); + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * }; + * } + */ +public class fuse_operations { + + public static MemoryLayout $LAYOUT() { + return constants$14.const$4; + } + /** + * {@snippet : + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public interface getattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(getattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$0, fi, constants$14.const$5, scope); + } + static getattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$15.const$1.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getattr$VH() { + return constants$15.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public static MemorySegment getattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$15.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public static void getattr$set(MemorySegment seg, MemorySegment x) { + constants$15.const$2.set(seg, x); + } + public static MemorySegment getattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$15.const$2.get(seg.asSlice(index*sizeof())); + } + public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$15.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static getattr getattr(MemorySegment segment, Arena scope) { + return getattr.ofAddress(getattr$get(segment), scope); + } + /** + * {@snippet : + * int (*readlink)(char*,char*,unsigned long); + * } + */ + public interface readlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(readlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$4, fi, constants$15.const$3, scope); + } + static readlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$15.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readlink$VH() { + return constants$16.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*readlink)(char*,char*,unsigned long); + * } + */ + public static MemorySegment readlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readlink)(char*,char*,unsigned long); + * } + */ + public static void readlink$set(MemorySegment seg, MemorySegment x) { + constants$16.const$0.set(seg, x); + } + public static MemorySegment readlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$0.get(seg.asSlice(index*sizeof())); + } + public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static readlink readlink(MemorySegment segment, Arena scope) { + return readlink.ofAddress(readlink$get(segment), scope); + } + /** + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned long); + * } + */ + public interface mknod { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2); + static MemorySegment allocate(mknod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$16.const$2, fi, constants$16.const$1, scope); + } + static mknod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2) -> { + try { + return (int)constants$16.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mknod$VH() { + return constants$16.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned long); + * } + */ + public static MemorySegment mknod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned long); + * } + */ + public static void mknod$set(MemorySegment seg, MemorySegment x) { + constants$16.const$4.set(seg, x); + } + public static MemorySegment mknod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$4.get(seg.asSlice(index*sizeof())); + } + public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static mknod mknod(MemorySegment segment, Arena scope) { + return mknod.ofAddress(mknod$get(segment), scope); + } + /** + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public interface mkdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(mkdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$0, fi, constants$16.const$5, scope); + } + static mkdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$17.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mkdir$VH() { + return constants$17.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public static MemorySegment mkdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$17.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public static void mkdir$set(MemorySegment seg, MemorySegment x) { + constants$17.const$2.set(seg, x); + } + public static MemorySegment mkdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$17.const$2.get(seg.asSlice(index*sizeof())); + } + public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$17.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static mkdir mkdir(MemorySegment segment, Arena scope) { + return mkdir.ofAddress(mkdir$get(segment), scope); + } + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ + public interface unlink { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(unlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$4, fi, constants$17.const$3, scope); + } + static unlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$17.const$5.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle unlink$VH() { + return constants$18.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static MemorySegment unlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static void unlink$set(MemorySegment seg, MemorySegment x) { + constants$18.const$0.set(seg, x); + } + public static MemorySegment unlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$0.get(seg.asSlice(index*sizeof())); + } + public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static unlink unlink(MemorySegment segment, Arena scope) { + return unlink.ofAddress(unlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public interface rmdir { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(rmdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$1, fi, constants$17.const$3, scope); + } + static rmdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$17.const$5.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rmdir$VH() { + return constants$18.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static MemorySegment rmdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static void rmdir$set(MemorySegment seg, MemorySegment x) { + constants$18.const$2.set(seg, x); + } + public static MemorySegment rmdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$2.get(seg.asSlice(index*sizeof())); + } + public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static rmdir rmdir(MemorySegment segment, Arena scope) { + return rmdir.ofAddress(rmdir$get(segment), scope); + } + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public interface symlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(symlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$4, fi, constants$18.const$3, scope); + } + static symlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle symlink$VH() { + return constants$19.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static MemorySegment symlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static void symlink$set(MemorySegment seg, MemorySegment x) { + constants$19.const$0.set(seg, x); + } + public static MemorySegment symlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$0.get(seg.asSlice(index*sizeof())); + } + public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static symlink symlink(MemorySegment segment, Arena scope) { + return symlink.ofAddress(symlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public interface rename { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(rename fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$2, fi, constants$19.const$1, scope); + } + static rename ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$19.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rename$VH() { + return constants$19.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public static MemorySegment rename$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public static void rename$set(MemorySegment seg, MemorySegment x) { + constants$19.const$4.set(seg, x); + } + public static MemorySegment rename$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$4.get(seg.asSlice(index*sizeof())); + } + public static void rename$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static rename rename(MemorySegment segment, Arena scope) { + return rename.ofAddress(rename$get(segment), scope); + } + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public interface link { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(link fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$5, fi, constants$18.const$3, scope); + } + static link ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle link$VH() { + return constants$20.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static MemorySegment link$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static void link$set(MemorySegment seg, MemorySegment x) { + constants$20.const$0.set(seg, x); + } + public static MemorySegment link$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$0.get(seg.asSlice(index*sizeof())); + } + public static void link$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static link link(MemorySegment segment, Arena scope) { + return link.ofAddress(link$get(segment), scope); + } + /** + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public interface chmod { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(chmod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$2, fi, constants$20.const$1, scope); + } + static chmod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chmod$VH() { + return constants$20.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static MemorySegment chmod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static void chmod$set(MemorySegment seg, MemorySegment x) { + constants$20.const$4.set(seg, x); + } + public static MemorySegment chmod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$4.get(seg.asSlice(index*sizeof())); + } + public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static chmod chmod(MemorySegment segment, Arena scope) { + return chmod.ofAddress(chmod$get(segment), scope); + } + /** + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * } + */ + public interface chown { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(chown fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$0, fi, constants$20.const$5, scope); + } + static chown ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$21.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chown$VH() { + return constants$21.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * } + */ + public static MemorySegment chown$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse_file_info*); + * } + */ + public static void chown$set(MemorySegment seg, MemorySegment x) { + constants$21.const$2.set(seg, x); + } + public static MemorySegment chown$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$2.get(seg.asSlice(index*sizeof())); + } + public static void chown$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static chown chown(MemorySegment segment, Arena scope) { + return chown.ofAddress(chown$get(segment), scope); + } + /** + * {@snippet : + * int (*truncate)(char*,long,struct fuse_file_info*); + * } + */ + public interface truncate { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(truncate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$4, fi, constants$21.const$3, scope); + } + static truncate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$21.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle truncate$VH() { + return constants$22.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*truncate)(char*,long,struct fuse_file_info*); + * } + */ + public static MemorySegment truncate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*truncate)(char*,long,struct fuse_file_info*); + * } + */ + public static void truncate$set(MemorySegment seg, MemorySegment x) { + constants$22.const$0.set(seg, x); + } + public static MemorySegment truncate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$0.get(seg.asSlice(index*sizeof())); + } + public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static truncate truncate(MemorySegment segment, Arena scope) { + return truncate.ofAddress(truncate$get(segment), scope); + } + /** + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public interface open { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(open fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$1, fi, constants$18.const$3, scope); + } + static open ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle open$VH() { + return constants$22.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment open$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public static void open$set(MemorySegment seg, MemorySegment x) { + constants$22.const$2.set(seg, x); + } + public static MemorySegment open$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$2.get(seg.asSlice(index*sizeof())); + } + public static void open$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static open open(MemorySegment segment, Arena scope) { + return open.ofAddress(open$get(segment), scope); + } + /** + * {@snippet : + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public interface read { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$4, fi, constants$22.const$3, scope); + } + static read ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$22.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read$VH() { + return constants$23.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment read$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static void read$set(MemorySegment seg, MemorySegment x) { + constants$23.const$0.set(seg, x); + } + public static MemorySegment read$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$0.get(seg.asSlice(index*sizeof())); + } + public static void read$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static read read(MemorySegment segment, Arena scope) { + return read.ofAddress(read$get(segment), scope); + } + /** + * {@snippet : + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public interface write { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(write fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$1, fi, constants$22.const$3, scope); + } + static write ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$22.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write$VH() { + return constants$23.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment write$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write)(char*,char*,unsigned long,long,struct fuse_file_info*); + * } + */ + public static void write$set(MemorySegment seg, MemorySegment x) { + constants$23.const$2.set(seg, x); + } + public static MemorySegment write$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$2.get(seg.asSlice(index*sizeof())); + } + public static void write$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static write write(MemorySegment segment, Arena scope) { + return write.ofAddress(write$get(segment), scope); + } + /** + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public interface statfs { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(statfs fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$3, fi, constants$18.const$3, scope); + } + static statfs ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle statfs$VH() { + return constants$23.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public static MemorySegment statfs$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public static void statfs$set(MemorySegment seg, MemorySegment x) { + constants$23.const$4.set(seg, x); + } + public static MemorySegment statfs$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$4.get(seg.asSlice(index*sizeof())); + } + public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static statfs statfs(MemorySegment segment, Arena scope) { + return statfs.ofAddress(statfs$get(segment), scope); + } + /** + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public interface flush { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(flush fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$5, fi, constants$18.const$3, scope); + } + static flush ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flush$VH() { + return constants$24.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment flush$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public static void flush$set(MemorySegment seg, MemorySegment x) { + constants$24.const$0.set(seg, x); + } + public static MemorySegment flush$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$0.get(seg.asSlice(index*sizeof())); + } + public static void flush$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static flush flush(MemorySegment segment, Arena scope) { + return flush.ofAddress(flush$get(segment), scope); + } + /** + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public interface release { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(release fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$1, fi, constants$18.const$3, scope); + } + static release ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle release$VH() { + return constants$24.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment release$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public static void release$set(MemorySegment seg, MemorySegment x) { + constants$24.const$2.set(seg, x); + } + public static MemorySegment release$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$2.get(seg.asSlice(index*sizeof())); + } + public static void release$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static release release(MemorySegment segment, Arena scope) { + return release.ofAddress(release$get(segment), scope); + } + /** + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public interface fsync { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsync fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$3, fi, constants$20.const$1, scope); + } + static fsync ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsync$VH() { + return constants$24.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public static MemorySegment fsync$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public static void fsync$set(MemorySegment seg, MemorySegment x) { + constants$24.const$4.set(seg, x); + } + public static MemorySegment fsync$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$4.get(seg.asSlice(index*sizeof())); + } + public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static fsync fsync(MemorySegment segment, Arena scope) { + return fsync.ofAddress(fsync$get(segment), scope); + } + /** + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * } + */ + public interface setxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); + static MemorySegment allocate(setxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$5, fi, constants$9.const$5, scope); + } + static setxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle setxattr$VH() { + return constants$25.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * } + */ + public static MemorySegment setxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long,int); + * } + */ + public static void setxattr$set(MemorySegment seg, MemorySegment x) { + constants$25.const$0.set(seg, x); + } + public static MemorySegment setxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$0.get(seg.asSlice(index*sizeof())); + } + public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static setxattr setxattr(MemorySegment segment, Arena scope) { + return setxattr.ofAddress(setxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long); + * } + */ + public interface getxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); + static MemorySegment allocate(getxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$2, fi, constants$25.const$1, scope); + } + static getxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { + try { + return (int)constants$25.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getxattr$VH() { + return constants$25.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long); + * } + */ + public static MemorySegment getxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long); + * } + */ + public static void getxattr$set(MemorySegment seg, MemorySegment x) { + constants$25.const$4.set(seg, x); + } + public static MemorySegment getxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$4.get(seg.asSlice(index*sizeof())); + } + public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static getxattr getxattr(MemorySegment segment, Arena scope) { + return getxattr.ofAddress(getxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long); + * } + */ + public interface listxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(listxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$5, fi, constants$15.const$3, scope); + } + static listxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$15.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle listxattr$VH() { + return constants$26.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long); + * } + */ + public static MemorySegment listxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long); + * } + */ + public static void listxattr$set(MemorySegment seg, MemorySegment x) { + constants$26.const$0.set(seg, x); + } + public static MemorySegment listxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$0.get(seg.asSlice(index*sizeof())); + } + public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static listxattr listxattr(MemorySegment segment, Arena scope) { + return listxattr.ofAddress(listxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public interface removexattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(removexattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$1, fi, constants$18.const$3, scope); + } + static removexattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle removexattr$VH() { + return constants$26.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static MemorySegment removexattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static void removexattr$set(MemorySegment seg, MemorySegment x) { + constants$26.const$2.set(seg, x); + } + public static MemorySegment removexattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$2.get(seg.asSlice(index*sizeof())); + } + public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static removexattr removexattr(MemorySegment segment, Arena scope) { + return removexattr.ofAddress(removexattr$get(segment), scope); + } + /** + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public interface opendir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(opendir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$3, fi, constants$18.const$3, scope); + } + static opendir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle opendir$VH() { + return constants$26.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment opendir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public static void opendir$set(MemorySegment seg, MemorySegment x) { + constants$26.const$4.set(seg, x); + } + public static MemorySegment opendir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$4.get(seg.asSlice(index*sizeof())); + } + public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static opendir opendir(MemorySegment segment, Arena scope) { + return opendir.ofAddress(opendir$get(segment), scope); + } + /** + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * } + */ + public interface readdir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4, int _x5); + static MemorySegment allocate(readdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$0, fi, constants$26.const$5, scope); + } + static readdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4, int __x5) -> { + try { + return (int)constants$27.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readdir$VH() { + return constants$27.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * } + */ + public static MemorySegment readdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct stat*,long,enum fuse_fill_dir_flags),long,struct fuse_file_info*,enum fuse_readdir_flags); + * } + */ + public static void readdir$set(MemorySegment seg, MemorySegment x) { + constants$27.const$2.set(seg, x); + } + public static MemorySegment readdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$2.get(seg.asSlice(index*sizeof())); + } + public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static readdir readdir(MemorySegment segment, Arena scope) { + return readdir.ofAddress(readdir$get(segment), scope); + } + /** + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public interface releasedir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(releasedir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$3, fi, constants$18.const$3, scope); + } + static releasedir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$18.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle releasedir$VH() { + return constants$27.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment releasedir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public static void releasedir$set(MemorySegment seg, MemorySegment x) { + constants$27.const$4.set(seg, x); + } + public static MemorySegment releasedir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$4.get(seg.asSlice(index*sizeof())); + } + public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static releasedir releasedir(MemorySegment segment, Arena scope) { + return releasedir.ofAddress(releasedir$get(segment), scope); + } + /** + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public interface fsyncdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsyncdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$5, fi, constants$20.const$1, scope); + } + static fsyncdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsyncdir$VH() { + return constants$28.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public static MemorySegment fsyncdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { + constants$28.const$0.set(seg, x); + } + public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$0.get(seg.asSlice(index*sizeof())); + } + public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static fsyncdir fsyncdir(MemorySegment segment, Arena scope) { + return fsyncdir.ofAddress(fsyncdir$get(segment), scope); + } + /** + * {@snippet : + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * } + */ + public interface init { + + java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(init fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$2, fi, constants$28.const$1, scope); + } + static init ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (java.lang.foreign.MemorySegment)constants$28.const$3.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle init$VH() { + return constants$28.const$4; + } + /** + * Getter for field: + * {@snippet : + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * } + */ + public static MemorySegment init$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void* (*init)(struct fuse_conn_info*,struct fuse_config*); + * } + */ + public static void init$set(MemorySegment seg, MemorySegment x) { + constants$28.const$4.set(seg, x); + } + public static MemorySegment init$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$4.get(seg.asSlice(index*sizeof())); + } + public static void init$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static init init(MemorySegment segment, Arena scope) { + return init.ofAddress(init$get(segment), scope); + } + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ + public interface destroy { + + void apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(destroy fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$5, fi, constants$5.const$0, scope); + } + static destroy ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + constants$29.const$0.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle destroy$VH() { + return constants$29.const$1; + } + /** + * Getter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static MemorySegment destroy$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static void destroy$set(MemorySegment seg, MemorySegment x) { + constants$29.const$1.set(seg, x); + } + public static MemorySegment destroy$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$1.get(seg.asSlice(index*sizeof())); + } + public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static destroy destroy(MemorySegment segment, Arena scope) { + return destroy.ofAddress(destroy$get(segment), scope); + } + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ + public interface access { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(access fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$2, fi, constants$16.const$5, scope); + } + static access ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$17.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle access$VH() { + return constants$29.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static MemorySegment access$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static void access$set(MemorySegment seg, MemorySegment x) { + constants$29.const$3.set(seg, x); + } + public static MemorySegment access$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$3.get(seg.asSlice(index*sizeof())); + } + public static void access$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static access access(MemorySegment segment, Arena scope) { + return access.ofAddress(access$get(segment), scope); + } + /** + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public interface create { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(create fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$4, fi, constants$20.const$1, scope); + } + static create ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$20.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle create$VH() { + return constants$29.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static MemorySegment create$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse_file_info*); + * } + */ + public static void create$set(MemorySegment seg, MemorySegment x) { + constants$29.const$5.set(seg, x); + } + public static MemorySegment create$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$5.get(seg.asSlice(index*sizeof())); + } + public static void create$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static create create(MemorySegment segment, Arena scope) { + return create.ofAddress(create$get(segment), scope); + } + /** + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public interface lock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(lock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$1, fi, constants$30.const$0, scope); + } + static lock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$30.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle lock$VH() { + return constants$30.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public static MemorySegment lock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public static void lock$set(MemorySegment seg, MemorySegment x) { + constants$30.const$3.set(seg, x); + } + public static MemorySegment lock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$3.get(seg.asSlice(index*sizeof())); + } + public static void lock$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static lock lock(MemorySegment segment, Arena scope) { + return lock.ofAddress(lock$get(segment), scope); + } + /** + * {@snippet : + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * } + */ + public interface utimens { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(utimens fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$4, fi, constants$14.const$5, scope); + } + static utimens ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$15.const$1.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle utimens$VH() { + return constants$30.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * } + */ + public static MemorySegment utimens$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); + * } + */ + public static void utimens$set(MemorySegment seg, MemorySegment x) { + constants$30.const$5.set(seg, x); + } + public static MemorySegment utimens$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$5.get(seg.asSlice(index*sizeof())); + } + public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static utimens utimens(MemorySegment segment, Arena scope) { + return utimens.ofAddress(utimens$get(segment), scope); + } + /** + * {@snippet : + * int (*bmap)(char*,unsigned long,unsigned long*); + * } + */ + public interface bmap { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(bmap fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$0, fi, constants$21.const$3, scope); + } + static bmap ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$21.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle bmap$VH() { + return constants$31.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*bmap)(char*,unsigned long,unsigned long*); + * } + */ + public static MemorySegment bmap$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*bmap)(char*,unsigned long,unsigned long*); + * } + */ + public static void bmap$set(MemorySegment seg, MemorySegment x) { + constants$31.const$1.set(seg, x); + } + public static MemorySegment bmap$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$1.get(seg.asSlice(index*sizeof())); + } + public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static bmap bmap(MemorySegment segment, Arena scope) { + return bmap.ofAddress(bmap$get(segment), scope); + } + /** + * {@snippet : + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public interface ioctl { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); + static MemorySegment allocate(ioctl fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$3, fi, constants$31.const$2, scope); + } + static ioctl ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { + try { + return (int)constants$31.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle ioctl$VH() { + return constants$31.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public static MemorySegment ioctl$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public static void ioctl$set(MemorySegment seg, MemorySegment x) { + constants$31.const$5.set(seg, x); + } + public static MemorySegment ioctl$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$5.get(seg.asSlice(index*sizeof())); + } + public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static ioctl ioctl(MemorySegment segment, Arena scope) { + return ioctl.ofAddress(ioctl$get(segment), scope); + } + /** + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public interface poll { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(poll fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$32.const$1, fi, constants$32.const$0, scope); + } + static poll ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$32.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle poll$VH() { + return constants$32.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public static MemorySegment poll$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$32.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public static void poll$set(MemorySegment seg, MemorySegment x) { + constants$32.const$3.set(seg, x); + } + public static MemorySegment poll$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$32.const$3.get(seg.asSlice(index*sizeof())); + } + public static void poll$set(MemorySegment seg, long index, MemorySegment x) { + constants$32.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static poll poll(MemorySegment segment, Arena scope) { + return poll.ofAddress(poll$get(segment), scope); + } + /** + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * } + */ + public interface write_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(write_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$32.const$5, fi, constants$32.const$4, scope); + } + static write_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$33.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write_buf$VH() { + return constants$33.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * } + */ + public static MemorySegment write_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$33.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,long,struct fuse_file_info*); + * } + */ + public static void write_buf$set(MemorySegment seg, MemorySegment x) { + constants$33.const$1.set(seg, x); + } + public static MemorySegment write_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$33.const$1.get(seg.asSlice(index*sizeof())); + } + public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$33.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static write_buf write_buf(MemorySegment segment, Arena scope) { + return write_buf.ofAddress(write_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * } + */ + public interface read_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$33.const$2, fi, constants$22.const$3, scope); + } + static read_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$22.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read_buf$VH() { + return constants$33.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment read_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$33.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,unsigned long,long,struct fuse_file_info*); + * } + */ + public static void read_buf$set(MemorySegment seg, MemorySegment x) { + constants$33.const$3.set(seg, x); + } + public static MemorySegment read_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$33.const$3.get(seg.asSlice(index*sizeof())); + } + public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$33.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static read_buf read_buf(MemorySegment segment, Arena scope) { + return read_buf.ofAddress(read_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public interface flock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(flock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$33.const$4, fi, constants$19.const$1, scope); + } + static flock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$19.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flock$VH() { + return constants$33.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public static MemorySegment flock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$33.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public static void flock$set(MemorySegment seg, MemorySegment x) { + constants$33.const$5.set(seg, x); + } + public static MemorySegment flock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$33.const$5.get(seg.asSlice(index*sizeof())); + } + public static void flock$set(MemorySegment seg, long index, MemorySegment x) { + constants$33.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static flock flock(MemorySegment segment, Arena scope) { + return flock.ofAddress(flock$get(segment), scope); + } + /** + * {@snippet : + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * } + */ + public interface fallocate { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(fallocate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$34.const$1, fi, constants$34.const$0, scope); + } + static fallocate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$34.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fallocate$VH() { + return constants$34.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * } + */ + public static MemorySegment fallocate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$34.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fallocate)(char*,int,long,long,struct fuse_file_info*); + * } + */ + public static void fallocate$set(MemorySegment seg, MemorySegment x) { + constants$34.const$3.set(seg, x); + } + public static MemorySegment fallocate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$34.const$3.get(seg.asSlice(index*sizeof())); + } + public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { + constants$34.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static fallocate fallocate(MemorySegment segment, Arena scope) { + return fallocate.ofAddress(fallocate$get(segment), scope); + } + /** + * {@snippet : + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * } + */ + public interface copy_file_range { + + long apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4, long _x5, long _x6, int _x7); + static MemorySegment allocate(copy_file_range fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$34.const$5, fi, constants$34.const$4, scope); + } + static copy_file_range ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4, long __x5, long __x6, int __x7) -> { + try { + return (long)constants$35.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5, __x6, __x7); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle copy_file_range$VH() { + return constants$35.const$1; + } + /** + * Getter for field: + * {@snippet : + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * } + */ + public static MemorySegment copy_file_range$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$35.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * long (*copy_file_range)(char*,struct fuse_file_info*,long,char*,struct fuse_file_info*,long,unsigned long,int); + * } + */ + public static void copy_file_range$set(MemorySegment seg, MemorySegment x) { + constants$35.const$1.set(seg, x); + } + public static MemorySegment copy_file_range$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$35.const$1.get(seg.asSlice(index*sizeof())); + } + public static void copy_file_range$set(MemorySegment seg, long index, MemorySegment x) { + constants$35.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static copy_file_range copy_file_range(MemorySegment segment, Arena scope) { + return copy_file_range.ofAddress(copy_file_range$get(segment), scope); + } + /** + * {@snippet : + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * } + */ + public interface lseek { + + long apply(java.lang.foreign.MemorySegment _x0, long _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(lseek fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$35.const$3, fi, constants$35.const$2, scope); + } + static lseek ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (long)constants$35.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle lseek$VH() { + return constants$35.const$5; + } + /** + * Getter for field: + * {@snippet : + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * } + */ + public static MemorySegment lseek$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$35.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * long (*lseek)(char*,long,int,struct fuse_file_info*); + * } + */ + public static void lseek$set(MemorySegment seg, MemorySegment x) { + constants$35.const$5.set(seg, x); + } + public static MemorySegment lseek$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$35.const$5.get(seg.asSlice(index*sizeof())); + } + public static void lseek$set(MemorySegment seg, long index, MemorySegment x) { + constants$35.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static lseek lseek(MemorySegment segment, Arena scope) { + return lseek.ofAddress(lseek$get(segment), scope); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/stat.java similarity index 50% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/stat.java index ac7bee4e..28dc4ce4 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/stat.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -10,226 +10,193 @@ /** * {@snippet : * struct stat { - * __dev_t st_dev; - * __ino_t st_ino; - * __nlink_t st_nlink; - * __mode_t st_mode; - * __uid_t st_uid; - * __gid_t st_gid; + * unsigned long st_dev; + * unsigned long st_ino; + * unsigned long st_nlink; + * unsigned int st_mode; + * unsigned int st_uid; + * unsigned int st_gid; * int __pad0; - * __dev_t st_rdev; - * __off_t st_size; - * __blksize_t st_blksize; - * __blkcnt_t st_blocks; + * unsigned long st_rdev; + * long st_size; + * long st_blksize; + * long st_blocks; * struct timespec st_atim; * struct timespec st_mtim; * struct timespec st_ctim; - * __syscall_slong_t __glibc_reserved[3]; + * long __glibc_reserved[3]; * }; * } */ public class stat { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("st_dev"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_ino"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_nlink"), - Constants$root.C_INT$LAYOUT.withName("st_mode"), - Constants$root.C_INT$LAYOUT.withName("st_uid"), - Constants$root.C_INT$LAYOUT.withName("st_gid"), - Constants$root.C_INT$LAYOUT.withName("__pad0"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_rdev"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_size"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_blksize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_blocks"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_atim"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_mtim"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_ctim"), - MemoryLayout.sequenceLayout(3, Constants$root.C_LONG_LONG$LAYOUT).withName("__glibc_reserved") - ).withName("stat"); public static MemoryLayout $LAYOUT() { - return stat.$struct$LAYOUT; + return constants$5.const$5; } - static final VarHandle st_dev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); public static VarHandle st_dev$VH() { - return stat.st_dev$VH; + return constants$6.const$0; } /** * Getter for field: * {@snippet : - * __dev_t st_dev; + * unsigned long st_dev; * } */ public static long st_dev$get(MemorySegment seg) { - return (long)stat.st_dev$VH.get(seg); + return (long)constants$6.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __dev_t st_dev; + * unsigned long st_dev; * } */ public static void st_dev$set(MemorySegment seg, long x) { - stat.st_dev$VH.set(seg, x); + constants$6.const$0.set(seg, x); } public static long st_dev$get(MemorySegment seg, long index) { - return (long)stat.st_dev$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$0.get(seg.asSlice(index*sizeof())); } public static void st_dev$set(MemorySegment seg, long index, long x) { - stat.st_dev$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); public static VarHandle st_ino$VH() { - return stat.st_ino$VH; + return constants$6.const$1; } /** * Getter for field: * {@snippet : - * __ino_t st_ino; + * unsigned long st_ino; * } */ public static long st_ino$get(MemorySegment seg) { - return (long)stat.st_ino$VH.get(seg); + return (long)constants$6.const$1.get(seg); } /** * Setter for field: * {@snippet : - * __ino_t st_ino; + * unsigned long st_ino; * } */ public static void st_ino$set(MemorySegment seg, long x) { - stat.st_ino$VH.set(seg, x); + constants$6.const$1.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { - return (long)stat.st_ino$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$1.get(seg.asSlice(index*sizeof())); } public static void st_ino$set(MemorySegment seg, long index, long x) { - stat.st_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_nlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); public static VarHandle st_nlink$VH() { - return stat.st_nlink$VH; + return constants$6.const$2; } /** * Getter for field: * {@snippet : - * __nlink_t st_nlink; + * unsigned long st_nlink; * } */ public static long st_nlink$get(MemorySegment seg) { - return (long)stat.st_nlink$VH.get(seg); + return (long)constants$6.const$2.get(seg); } /** * Setter for field: * {@snippet : - * __nlink_t st_nlink; + * unsigned long st_nlink; * } */ public static void st_nlink$set(MemorySegment seg, long x) { - stat.st_nlink$VH.set(seg, x); + constants$6.const$2.set(seg, x); } public static long st_nlink$get(MemorySegment seg, long index) { - return (long)stat.st_nlink$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$2.get(seg.asSlice(index*sizeof())); } public static void st_nlink$set(MemorySegment seg, long index, long x) { - stat.st_nlink$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); public static VarHandle st_mode$VH() { - return stat.st_mode$VH; + return constants$6.const$3; } /** * Getter for field: * {@snippet : - * __mode_t st_mode; + * unsigned int st_mode; * } */ public static int st_mode$get(MemorySegment seg) { - return (int)stat.st_mode$VH.get(seg); + return (int)constants$6.const$3.get(seg); } /** * Setter for field: * {@snippet : - * __mode_t st_mode; + * unsigned int st_mode; * } */ public static void st_mode$set(MemorySegment seg, int x) { - stat.st_mode$VH.set(seg, x); + constants$6.const$3.set(seg, x); } public static int st_mode$get(MemorySegment seg, long index) { - return (int)stat.st_mode$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$3.get(seg.asSlice(index*sizeof())); } public static void st_mode$set(MemorySegment seg, long index, int x) { - stat.st_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); public static VarHandle st_uid$VH() { - return stat.st_uid$VH; + return constants$6.const$4; } /** * Getter for field: * {@snippet : - * __uid_t st_uid; + * unsigned int st_uid; * } */ public static int st_uid$get(MemorySegment seg) { - return (int)stat.st_uid$VH.get(seg); + return (int)constants$6.const$4.get(seg); } /** * Setter for field: * {@snippet : - * __uid_t st_uid; + * unsigned int st_uid; * } */ public static void st_uid$set(MemorySegment seg, int x) { - stat.st_uid$VH.set(seg, x); + constants$6.const$4.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { - return (int)stat.st_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$4.get(seg.asSlice(index*sizeof())); } public static void st_uid$set(MemorySegment seg, long index, int x) { - stat.st_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); public static VarHandle st_gid$VH() { - return stat.st_gid$VH; + return constants$6.const$5; } /** * Getter for field: * {@snippet : - * __gid_t st_gid; + * unsigned int st_gid; * } */ public static int st_gid$get(MemorySegment seg) { - return (int)stat.st_gid$VH.get(seg); + return (int)constants$6.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __gid_t st_gid; + * unsigned int st_gid; * } */ public static void st_gid$set(MemorySegment seg, int x) { - stat.st_gid$VH.set(seg, x); + constants$6.const$5.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { - return (int)stat.st_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$5.get(seg.asSlice(index*sizeof())); } public static void st_gid$set(MemorySegment seg, long index, int x) { - stat.st_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle __pad0$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("__pad0")); public static VarHandle __pad0$VH() { - return stat.__pad0$VH; + return constants$7.const$0; } /** * Getter for field: @@ -238,7 +205,7 @@ public class stat { * } */ public static int __pad0$get(MemorySegment seg) { - return (int)stat.__pad0$VH.get(seg); + return (int)constants$7.const$0.get(seg); } /** * Setter for field: @@ -247,125 +214,121 @@ public class stat { * } */ public static void __pad0$set(MemorySegment seg, int x) { - stat.__pad0$VH.set(seg, x); + constants$7.const$0.set(seg, x); } public static int __pad0$get(MemorySegment seg, long index) { - return (int)stat.__pad0$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$0.get(seg.asSlice(index*sizeof())); } public static void __pad0$set(MemorySegment seg, long index, int x) { - stat.__pad0$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_rdev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); public static VarHandle st_rdev$VH() { - return stat.st_rdev$VH; + return constants$7.const$1; } /** * Getter for field: * {@snippet : - * __dev_t st_rdev; + * unsigned long st_rdev; * } */ public static long st_rdev$get(MemorySegment seg) { - return (long)stat.st_rdev$VH.get(seg); + return (long)constants$7.const$1.get(seg); } /** * Setter for field: * {@snippet : - * __dev_t st_rdev; + * unsigned long st_rdev; * } */ public static void st_rdev$set(MemorySegment seg, long x) { - stat.st_rdev$VH.set(seg, x); + constants$7.const$1.set(seg, x); } public static long st_rdev$get(MemorySegment seg, long index) { - return (long)stat.st_rdev$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$1.get(seg.asSlice(index*sizeof())); } public static void st_rdev$set(MemorySegment seg, long index, long x) { - stat.st_rdev$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_size$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_size")); public static VarHandle st_size$VH() { - return stat.st_size$VH; + return constants$7.const$2; } /** * Getter for field: * {@snippet : - * __off_t st_size; + * long st_size; * } */ public static long st_size$get(MemorySegment seg) { - return (long)stat.st_size$VH.get(seg); + return (long)constants$7.const$2.get(seg); } /** * Setter for field: * {@snippet : - * __off_t st_size; + * long st_size; * } */ public static void st_size$set(MemorySegment seg, long x) { - stat.st_size$VH.set(seg, x); + constants$7.const$2.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { - return (long)stat.st_size$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$2.get(seg.asSlice(index*sizeof())); } public static void st_size$set(MemorySegment seg, long index, long x) { - stat.st_size$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blksize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); public static VarHandle st_blksize$VH() { - return stat.st_blksize$VH; + return constants$7.const$3; } /** * Getter for field: * {@snippet : - * __blksize_t st_blksize; + * long st_blksize; * } */ public static long st_blksize$get(MemorySegment seg) { - return (long)stat.st_blksize$VH.get(seg); + return (long)constants$7.const$3.get(seg); } /** * Setter for field: * {@snippet : - * __blksize_t st_blksize; + * long st_blksize; * } */ public static void st_blksize$set(MemorySegment seg, long x) { - stat.st_blksize$VH.set(seg, x); + constants$7.const$3.set(seg, x); } public static long st_blksize$get(MemorySegment seg, long index) { - return (long)stat.st_blksize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$3.get(seg.asSlice(index*sizeof())); } public static void st_blksize$set(MemorySegment seg, long index, long x) { - stat.st_blksize$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); public static VarHandle st_blocks$VH() { - return stat.st_blocks$VH; + return constants$7.const$4; } /** * Getter for field: * {@snippet : - * __blkcnt_t st_blocks; + * long st_blocks; * } */ public static long st_blocks$get(MemorySegment seg) { - return (long)stat.st_blocks$VH.get(seg); + return (long)constants$7.const$4.get(seg); } /** * Setter for field: * {@snippet : - * __blkcnt_t st_blocks; + * long st_blocks; * } */ public static void st_blocks$set(MemorySegment seg, long x) { - stat.st_blocks$VH.set(seg, x); + constants$7.const$4.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { - return (long)stat.st_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$4.get(seg.asSlice(index*sizeof())); } public static void st_blocks$set(MemorySegment seg, long index, long x) { - stat.st_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$4.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment st_atim$slice(MemorySegment seg) { return seg.asSlice(72, 16); @@ -384,7 +347,7 @@ public class stat { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/statvfs.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/statvfs.java similarity index 53% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/statvfs.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/statvfs.java index 288a7d68..9ba19be0 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/statvfs.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/statvfs.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -12,12 +12,12 @@ * struct statvfs { * unsigned long f_bsize; * unsigned long f_frsize; - * __fsblkcnt64_t f_blocks; - * __fsblkcnt64_t f_bfree; - * __fsblkcnt64_t f_bavail; - * __fsfilcnt64_t f_files; - * __fsfilcnt64_t f_ffree; - * __fsfilcnt64_t f_favail; + * unsigned long f_blocks; + * unsigned long f_bfree; + * unsigned long f_bavail; + * unsigned long f_files; + * unsigned long f_ffree; + * unsigned long f_favail; * unsigned long f_fsid; * unsigned long f_flag; * unsigned long f_namemax; @@ -27,26 +27,11 @@ */ public class statvfs { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_frsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_blocks"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bfree"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bavail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_files"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_ffree"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_favail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_fsid"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_flag"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_namemax"), - MemoryLayout.sequenceLayout(6, Constants$root.C_INT$LAYOUT).withName("__f_spare") - ).withName("statvfs"); public static MemoryLayout $LAYOUT() { - return statvfs.$struct$LAYOUT; + return constants$7.const$5; } - static final VarHandle f_bsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); public static VarHandle f_bsize$VH() { - return statvfs.f_bsize$VH; + return constants$8.const$0; } /** * Getter for field: @@ -55,7 +40,7 @@ public class statvfs { * } */ public static long f_bsize$get(MemorySegment seg) { - return (long)statvfs.f_bsize$VH.get(seg); + return (long)constants$8.const$0.get(seg); } /** * Setter for field: @@ -64,17 +49,16 @@ public class statvfs { * } */ public static void f_bsize$set(MemorySegment seg, long x) { - statvfs.f_bsize$VH.set(seg, x); + constants$8.const$0.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { - return (long)statvfs.f_bsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$0.get(seg.asSlice(index*sizeof())); } public static void f_bsize$set(MemorySegment seg, long index, long x) { - statvfs.f_bsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_frsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); public static VarHandle f_frsize$VH() { - return statvfs.f_frsize$VH; + return constants$8.const$1; } /** * Getter for field: @@ -83,7 +67,7 @@ public class statvfs { * } */ public static long f_frsize$get(MemorySegment seg) { - return (long)statvfs.f_frsize$VH.get(seg); + return (long)constants$8.const$1.get(seg); } /** * Setter for field: @@ -92,185 +76,178 @@ public class statvfs { * } */ public static void f_frsize$set(MemorySegment seg, long x) { - statvfs.f_frsize$VH.set(seg, x); + constants$8.const$1.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { - return (long)statvfs.f_frsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$1.get(seg.asSlice(index*sizeof())); } public static void f_frsize$set(MemorySegment seg, long index, long x) { - statvfs.f_frsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); public static VarHandle f_blocks$VH() { - return statvfs.f_blocks$VH; + return constants$8.const$2; } /** * Getter for field: * {@snippet : - * __fsblkcnt64_t f_blocks; + * unsigned long f_blocks; * } */ public static long f_blocks$get(MemorySegment seg) { - return (long)statvfs.f_blocks$VH.get(seg); + return (long)constants$8.const$2.get(seg); } /** * Setter for field: * {@snippet : - * __fsblkcnt64_t f_blocks; + * unsigned long f_blocks; * } */ public static void f_blocks$set(MemorySegment seg, long x) { - statvfs.f_blocks$VH.set(seg, x); + constants$8.const$2.set(seg, x); } public static long f_blocks$get(MemorySegment seg, long index) { - return (long)statvfs.f_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$2.get(seg.asSlice(index*sizeof())); } public static void f_blocks$set(MemorySegment seg, long index, long x) { - statvfs.f_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bfree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); public static VarHandle f_bfree$VH() { - return statvfs.f_bfree$VH; + return constants$8.const$3; } /** * Getter for field: * {@snippet : - * __fsblkcnt64_t f_bfree; + * unsigned long f_bfree; * } */ public static long f_bfree$get(MemorySegment seg) { - return (long)statvfs.f_bfree$VH.get(seg); + return (long)constants$8.const$3.get(seg); } /** * Setter for field: * {@snippet : - * __fsblkcnt64_t f_bfree; + * unsigned long f_bfree; * } */ public static void f_bfree$set(MemorySegment seg, long x) { - statvfs.f_bfree$VH.set(seg, x); + constants$8.const$3.set(seg, x); } public static long f_bfree$get(MemorySegment seg, long index) { - return (long)statvfs.f_bfree$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$3.get(seg.asSlice(index*sizeof())); } public static void f_bfree$set(MemorySegment seg, long index, long x) { - statvfs.f_bfree$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bavail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); public static VarHandle f_bavail$VH() { - return statvfs.f_bavail$VH; + return constants$8.const$4; } /** * Getter for field: * {@snippet : - * __fsblkcnt64_t f_bavail; + * unsigned long f_bavail; * } */ public static long f_bavail$get(MemorySegment seg) { - return (long)statvfs.f_bavail$VH.get(seg); + return (long)constants$8.const$4.get(seg); } /** * Setter for field: * {@snippet : - * __fsblkcnt64_t f_bavail; + * unsigned long f_bavail; * } */ public static void f_bavail$set(MemorySegment seg, long x) { - statvfs.f_bavail$VH.set(seg, x); + constants$8.const$4.set(seg, x); } public static long f_bavail$get(MemorySegment seg, long index) { - return (long)statvfs.f_bavail$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$4.get(seg.asSlice(index*sizeof())); } public static void f_bavail$set(MemorySegment seg, long index, long x) { - statvfs.f_bavail$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_files$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_files")); public static VarHandle f_files$VH() { - return statvfs.f_files$VH; + return constants$8.const$5; } /** * Getter for field: * {@snippet : - * __fsfilcnt64_t f_files; + * unsigned long f_files; * } */ public static long f_files$get(MemorySegment seg) { - return (long)statvfs.f_files$VH.get(seg); + return (long)constants$8.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __fsfilcnt64_t f_files; + * unsigned long f_files; * } */ public static void f_files$set(MemorySegment seg, long x) { - statvfs.f_files$VH.set(seg, x); + constants$8.const$5.set(seg, x); } public static long f_files$get(MemorySegment seg, long index) { - return (long)statvfs.f_files$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$5.get(seg.asSlice(index*sizeof())); } public static void f_files$set(MemorySegment seg, long index, long x) { - statvfs.f_files$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_ffree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); public static VarHandle f_ffree$VH() { - return statvfs.f_ffree$VH; + return constants$9.const$0; } /** * Getter for field: * {@snippet : - * __fsfilcnt64_t f_ffree; + * unsigned long f_ffree; * } */ public static long f_ffree$get(MemorySegment seg) { - return (long)statvfs.f_ffree$VH.get(seg); + return (long)constants$9.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __fsfilcnt64_t f_ffree; + * unsigned long f_ffree; * } */ public static void f_ffree$set(MemorySegment seg, long x) { - statvfs.f_ffree$VH.set(seg, x); + constants$9.const$0.set(seg, x); } public static long f_ffree$get(MemorySegment seg, long index) { - return (long)statvfs.f_ffree$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$0.get(seg.asSlice(index*sizeof())); } public static void f_ffree$set(MemorySegment seg, long index, long x) { - statvfs.f_ffree$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_favail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); public static VarHandle f_favail$VH() { - return statvfs.f_favail$VH; + return constants$9.const$1; } /** * Getter for field: * {@snippet : - * __fsfilcnt64_t f_favail; + * unsigned long f_favail; * } */ public static long f_favail$get(MemorySegment seg) { - return (long)statvfs.f_favail$VH.get(seg); + return (long)constants$9.const$1.get(seg); } /** * Setter for field: * {@snippet : - * __fsfilcnt64_t f_favail; + * unsigned long f_favail; * } */ public static void f_favail$set(MemorySegment seg, long x) { - statvfs.f_favail$VH.set(seg, x); + constants$9.const$1.set(seg, x); } public static long f_favail$get(MemorySegment seg, long index) { - return (long)statvfs.f_favail$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$1.get(seg.asSlice(index*sizeof())); } public static void f_favail$set(MemorySegment seg, long index, long x) { - statvfs.f_favail$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_fsid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); public static VarHandle f_fsid$VH() { - return statvfs.f_fsid$VH; + return constants$9.const$2; } /** * Getter for field: @@ -279,7 +256,7 @@ public class statvfs { * } */ public static long f_fsid$get(MemorySegment seg) { - return (long)statvfs.f_fsid$VH.get(seg); + return (long)constants$9.const$2.get(seg); } /** * Setter for field: @@ -288,17 +265,16 @@ public class statvfs { * } */ public static void f_fsid$set(MemorySegment seg, long x) { - statvfs.f_fsid$VH.set(seg, x); + constants$9.const$2.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { - return (long)statvfs.f_fsid$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$2.get(seg.asSlice(index*sizeof())); } public static void f_fsid$set(MemorySegment seg, long index, long x) { - statvfs.f_fsid$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_flag$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); public static VarHandle f_flag$VH() { - return statvfs.f_flag$VH; + return constants$9.const$3; } /** * Getter for field: @@ -307,7 +283,7 @@ public class statvfs { * } */ public static long f_flag$get(MemorySegment seg) { - return (long)statvfs.f_flag$VH.get(seg); + return (long)constants$9.const$3.get(seg); } /** * Setter for field: @@ -316,17 +292,16 @@ public class statvfs { * } */ public static void f_flag$set(MemorySegment seg, long x) { - statvfs.f_flag$VH.set(seg, x); + constants$9.const$3.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { - return (long)statvfs.f_flag$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$3.get(seg.asSlice(index*sizeof())); } public static void f_flag$set(MemorySegment seg, long index, long x) { - statvfs.f_flag$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_namemax$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); public static VarHandle f_namemax$VH() { - return statvfs.f_namemax$VH; + return constants$9.const$4; } /** * Getter for field: @@ -335,7 +310,7 @@ public class statvfs { * } */ public static long f_namemax$get(MemorySegment seg) { - return (long)statvfs.f_namemax$VH.get(seg); + return (long)constants$9.const$4.get(seg); } /** * Setter for field: @@ -344,13 +319,13 @@ public class statvfs { * } */ public static void f_namemax$set(MemorySegment seg, long x) { - statvfs.f_namemax$VH.set(seg, x); + constants$9.const$4.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { - return (long)statvfs.f_namemax$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$4.get(seg.asSlice(index*sizeof())); } public static void f_namemax$set(MemorySegment seg, long index, long x) { - statvfs.f_namemax$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$4.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment __f_spare$slice(MemorySegment seg) { return seg.asSlice(88, 24); @@ -360,7 +335,7 @@ public class statvfs { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/timespec.java similarity index 54% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/timespec.java index 98490e19..e02fdb57 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3/timespec.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -10,82 +10,76 @@ /** * {@snippet : * struct timespec { - * __time_t tv_sec; - * __syscall_slong_t tv_nsec; + * long tv_sec; + * long tv_nsec; * }; * } */ public class timespec { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("timespec"); public static MemoryLayout $LAYOUT() { - return timespec.$struct$LAYOUT; + return constants$0.const$4; } - static final VarHandle tv_sec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); public static VarHandle tv_sec$VH() { - return timespec.tv_sec$VH; + return constants$0.const$5; } /** * Getter for field: * {@snippet : - * __time_t tv_sec; + * long tv_sec; * } */ public static long tv_sec$get(MemorySegment seg) { - return (long)timespec.tv_sec$VH.get(seg); + return (long)constants$0.const$5.get(seg); } /** * Setter for field: * {@snippet : - * __time_t tv_sec; + * long tv_sec; * } */ public static void tv_sec$set(MemorySegment seg, long x) { - timespec.tv_sec$VH.set(seg, x); + constants$0.const$5.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { - return (long)timespec.tv_sec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$0.const$5.get(seg.asSlice(index*sizeof())); } public static void tv_sec$set(MemorySegment seg, long index, long x) { - timespec.tv_sec$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle tv_nsec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); public static VarHandle tv_nsec$VH() { - return timespec.tv_nsec$VH; + return constants$1.const$0; } /** * Getter for field: * {@snippet : - * __syscall_slong_t tv_nsec; + * long tv_nsec; * } */ public static long tv_nsec$get(MemorySegment seg) { - return (long)timespec.tv_nsec$VH.get(seg); + return (long)constants$1.const$0.get(seg); } /** * Setter for field: * {@snippet : - * __syscall_slong_t tv_nsec; + * long tv_nsec; * } */ public static void tv_nsec$set(MemorySegment seg, long x) { - timespec.tv_nsec$VH.set(seg, x); + constants$1.const$0.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { - return (long)timespec.tv_nsec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$1.const$0.get(seg.asSlice(index*sizeof())); } public static void tv_nsec$set(MemorySegment seg, long index, long x) { - timespec.tv_nsec$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$0.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/RuntimeHelper.java new file mode 100644 index 00000000..a6e405b1 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/constants$0.java new file mode 100644 index 00000000..88d8ae32 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/constants$0.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("singlethread"), + JAVA_INT.withName("foreground"), + JAVA_INT.withName("debug"), + JAVA_INT.withName("nodefault_subtype"), + RuntimeHelper.POINTER.withName("mountpoint"), + JAVA_INT.withName("show_version"), + JAVA_INT.withName("show_help"), + JAVA_INT.withName("clone_fd"), + JAVA_INT.withName("max_idle_threads"), + JAVA_INT.withName("max_threads"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_cmdline_opts"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("singlethread")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("foreground")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("debug")); + static final VarHandle const$4 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("nodefault_subtype")); + static final VarHandle const$5 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("mountpoint")); +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/constants$1.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/constants$1.java new file mode 100644 index 00000000..2af20545 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/constants$1.java @@ -0,0 +1,21 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final VarHandle const$0 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("show_version")); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("show_help")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); + static final VarHandle const$4 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("max_threads")); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_cmdline_opts.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/fuse_cmdline_opts.java similarity index 53% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_cmdline_opts.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/fuse_cmdline_opts.java index 08c4f18e..872bda74 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_cmdline_opts.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/fuse_cmdline_opts.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -25,25 +25,11 @@ */ public class fuse_cmdline_opts { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("singlethread"), - Constants$root.C_INT$LAYOUT.withName("foreground"), - Constants$root.C_INT$LAYOUT.withName("debug"), - Constants$root.C_INT$LAYOUT.withName("nodefault_subtype"), - Constants$root.C_POINTER$LAYOUT.withName("mountpoint"), - Constants$root.C_INT$LAYOUT.withName("show_version"), - Constants$root.C_INT$LAYOUT.withName("show_help"), - Constants$root.C_INT$LAYOUT.withName("clone_fd"), - Constants$root.C_INT$LAYOUT.withName("max_idle_threads"), - Constants$root.C_INT$LAYOUT.withName("max_threads"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_cmdline_opts"); public static MemoryLayout $LAYOUT() { - return fuse_cmdline_opts.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle singlethread$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("singlethread")); public static VarHandle singlethread$VH() { - return fuse_cmdline_opts.singlethread$VH; + return constants$0.const$1; } /** * Getter for field: @@ -52,7 +38,7 @@ public class fuse_cmdline_opts { * } */ public static int singlethread$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.singlethread$VH.get(seg); + return (int)constants$0.const$1.get(seg); } /** * Setter for field: @@ -61,17 +47,16 @@ public class fuse_cmdline_opts { * } */ public static void singlethread$set(MemorySegment seg, int x) { - fuse_cmdline_opts.singlethread$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static int singlethread$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.singlethread$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void singlethread$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.singlethread$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle foreground$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("foreground")); public static VarHandle foreground$VH() { - return fuse_cmdline_opts.foreground$VH; + return constants$0.const$2; } /** * Getter for field: @@ -80,7 +65,7 @@ public class fuse_cmdline_opts { * } */ public static int foreground$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.foreground$VH.get(seg); + return (int)constants$0.const$2.get(seg); } /** * Setter for field: @@ -89,17 +74,16 @@ public class fuse_cmdline_opts { * } */ public static void foreground$set(MemorySegment seg, int x) { - fuse_cmdline_opts.foreground$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static int foreground$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.foreground$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void foreground$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.foreground$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle debug$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("debug")); public static VarHandle debug$VH() { - return fuse_cmdline_opts.debug$VH; + return constants$0.const$3; } /** * Getter for field: @@ -108,7 +92,7 @@ public class fuse_cmdline_opts { * } */ public static int debug$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.debug$VH.get(seg); + return (int)constants$0.const$3.get(seg); } /** * Setter for field: @@ -117,17 +101,16 @@ public class fuse_cmdline_opts { * } */ public static void debug$set(MemorySegment seg, int x) { - fuse_cmdline_opts.debug$VH.set(seg, x); + constants$0.const$3.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.debug$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$3.get(seg.asSlice(index*sizeof())); } public static void debug$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.debug$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle nodefault_subtype$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("nodefault_subtype")); public static VarHandle nodefault_subtype$VH() { - return fuse_cmdline_opts.nodefault_subtype$VH; + return constants$0.const$4; } /** * Getter for field: @@ -136,7 +119,7 @@ public class fuse_cmdline_opts { * } */ public static int nodefault_subtype$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.nodefault_subtype$VH.get(seg); + return (int)constants$0.const$4.get(seg); } /** * Setter for field: @@ -145,17 +128,16 @@ public class fuse_cmdline_opts { * } */ public static void nodefault_subtype$set(MemorySegment seg, int x) { - fuse_cmdline_opts.nodefault_subtype$VH.set(seg, x); + constants$0.const$4.set(seg, x); } public static int nodefault_subtype$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.nodefault_subtype$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$4.get(seg.asSlice(index*sizeof())); } public static void nodefault_subtype$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.nodefault_subtype$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle mountpoint$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mountpoint")); public static VarHandle mountpoint$VH() { - return fuse_cmdline_opts.mountpoint$VH; + return constants$0.const$5; } /** * Getter for field: @@ -164,7 +146,7 @@ public class fuse_cmdline_opts { * } */ public static MemorySegment mountpoint$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$0.const$5.get(seg); } /** * Setter for field: @@ -173,17 +155,16 @@ public class fuse_cmdline_opts { * } */ public static void mountpoint$set(MemorySegment seg, MemorySegment x) { - fuse_cmdline_opts.mountpoint$VH.set(seg, x); + constants$0.const$5.set(seg, x); } public static MemorySegment mountpoint$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$0.const$5.get(seg.asSlice(index*sizeof())); } public static void mountpoint$set(MemorySegment seg, long index, MemorySegment x) { - fuse_cmdline_opts.mountpoint$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_version$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_version")); public static VarHandle show_version$VH() { - return fuse_cmdline_opts.show_version$VH; + return constants$1.const$0; } /** * Getter for field: @@ -192,7 +173,7 @@ public class fuse_cmdline_opts { * } */ public static int show_version$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.show_version$VH.get(seg); + return (int)constants$1.const$0.get(seg); } /** * Setter for field: @@ -201,17 +182,16 @@ public class fuse_cmdline_opts { * } */ public static void show_version$set(MemorySegment seg, int x) { - fuse_cmdline_opts.show_version$VH.set(seg, x); + constants$1.const$0.set(seg, x); } public static int show_version$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.show_version$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$0.get(seg.asSlice(index*sizeof())); } public static void show_version$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.show_version$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_help$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_help")); public static VarHandle show_help$VH() { - return fuse_cmdline_opts.show_help$VH; + return constants$1.const$1; } /** * Getter for field: @@ -220,7 +200,7 @@ public class fuse_cmdline_opts { * } */ public static int show_help$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.show_help$VH.get(seg); + return (int)constants$1.const$1.get(seg); } /** * Setter for field: @@ -229,17 +209,16 @@ public class fuse_cmdline_opts { * } */ public static void show_help$set(MemorySegment seg, int x) { - fuse_cmdline_opts.show_help$VH.set(seg, x); + constants$1.const$1.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.show_help$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$1.get(seg.asSlice(index*sizeof())); } public static void show_help$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.show_help$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle clone_fd$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); public static VarHandle clone_fd$VH() { - return fuse_cmdline_opts.clone_fd$VH; + return constants$1.const$2; } /** * Getter for field: @@ -248,7 +227,7 @@ public class fuse_cmdline_opts { * } */ public static int clone_fd$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.clone_fd$VH.get(seg); + return (int)constants$1.const$2.get(seg); } /** * Setter for field: @@ -257,17 +236,16 @@ public class fuse_cmdline_opts { * } */ public static void clone_fd$set(MemorySegment seg, int x) { - fuse_cmdline_opts.clone_fd$VH.set(seg, x); + constants$1.const$2.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.clone_fd$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$2.get(seg.asSlice(index*sizeof())); } public static void clone_fd$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.clone_fd$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_idle_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); public static VarHandle max_idle_threads$VH() { - return fuse_cmdline_opts.max_idle_threads$VH; + return constants$1.const$3; } /** * Getter for field: @@ -276,7 +254,7 @@ public class fuse_cmdline_opts { * } */ public static int max_idle_threads$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.max_idle_threads$VH.get(seg); + return (int)constants$1.const$3.get(seg); } /** * Setter for field: @@ -285,17 +263,16 @@ public class fuse_cmdline_opts { * } */ public static void max_idle_threads$set(MemorySegment seg, int x) { - fuse_cmdline_opts.max_idle_threads$VH.set(seg, x); + constants$1.const$3.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.max_idle_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$3.get(seg.asSlice(index*sizeof())); } public static void max_idle_threads$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.max_idle_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_threads")); public static VarHandle max_threads$VH() { - return fuse_cmdline_opts.max_threads$VH; + return constants$1.const$4; } /** * Getter for field: @@ -304,7 +281,7 @@ public class fuse_cmdline_opts { * } */ public static int max_threads$get(MemorySegment seg) { - return (int)fuse_cmdline_opts.max_threads$VH.get(seg); + return (int)constants$1.const$4.get(seg); } /** * Setter for field: @@ -313,20 +290,20 @@ public class fuse_cmdline_opts { * } */ public static void max_threads$set(MemorySegment seg, int x) { - fuse_cmdline_opts.max_threads$VH.set(seg, x); + constants$1.const$4.set(seg, x); } public static int max_threads$get(MemorySegment seg, long index) { - return (int)fuse_cmdline_opts.max_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$4.get(seg.asSlice(index*sizeof())); } public static void max_threads$set(MemorySegment seg, long index, int x) { - fuse_cmdline_opts.max_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$4.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/fuse_lowlevel_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/fuse_lowlevel_h.java new file mode 100644 index 00000000..03df7411 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse3_lowlevel/fuse_lowlevel_h.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class fuse_lowlevel_h { + + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_file_info.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_file_info.java deleted file mode 100644 index 221e4db7..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_file_info.java +++ /dev/null @@ -1,175 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -/** - * {@snippet : - * struct fuse_file_info { - * int flags; - * * unsigned int writepage; - * unsigned int direct_io; - * unsigned int keep_cache; - * unsigned int flush; - * unsigned int nonseekable; - * unsigned int flock_release; - * unsigned int cache_readdir; - * unsigned int noflush; - * unsigned int padding; - * unsigned int padding2; - * uint64_t fh; - * uint64_t lock_owner; - * uint32_t poll_events; - * }; - * } - */ -public class fuse_file_info { - - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("flags"), - MemoryLayout.structLayout( - MemoryLayout.paddingLayout(1).withName("writepage"), - MemoryLayout.paddingLayout(1).withName("direct_io"), - MemoryLayout.paddingLayout(1).withName("keep_cache"), - MemoryLayout.paddingLayout(1).withName("flush"), - MemoryLayout.paddingLayout(1).withName("nonseekable"), - MemoryLayout.paddingLayout(1).withName("flock_release"), - MemoryLayout.paddingLayout(1).withName("cache_readdir"), - MemoryLayout.paddingLayout(1).withName("noflush"), - MemoryLayout.paddingLayout(24).withName("padding"), - MemoryLayout.paddingLayout(32).withName("padding2"), - MemoryLayout.paddingLayout(32) - ), - Constants$root.C_LONG_LONG$LAYOUT.withName("fh"), - Constants$root.C_LONG_LONG$LAYOUT.withName("lock_owner"), - Constants$root.C_INT$LAYOUT.withName("poll_events"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_file_info"); - public static MemoryLayout $LAYOUT() { - return fuse_file_info.$struct$LAYOUT; - } - static final VarHandle flags$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flags")); - public static VarHandle flags$VH() { - return fuse_file_info.flags$VH; - } - /** - * Getter for field: - * {@snippet : - * int flags; - * } - */ - public static int flags$get(MemorySegment seg) { - return (int)fuse_file_info.flags$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int flags; - * } - */ - public static void flags$set(MemorySegment seg, int x) { - fuse_file_info.flags$VH.set(seg, x); - } - public static int flags$get(MemorySegment seg, long index) { - return (int)fuse_file_info.flags$VH.get(seg.asSlice(index*sizeof())); - } - public static void flags$set(MemorySegment seg, long index, int x) { - fuse_file_info.flags$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle fh$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fh")); - public static VarHandle fh$VH() { - return fuse_file_info.fh$VH; - } - /** - * Getter for field: - * {@snippet : - * uint64_t fh; - * } - */ - public static long fh$get(MemorySegment seg) { - return (long)fuse_file_info.fh$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * uint64_t fh; - * } - */ - public static void fh$set(MemorySegment seg, long x) { - fuse_file_info.fh$VH.set(seg, x); - } - public static long fh$get(MemorySegment seg, long index) { - return (long)fuse_file_info.fh$VH.get(seg.asSlice(index*sizeof())); - } - public static void fh$set(MemorySegment seg, long index, long x) { - fuse_file_info.fh$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle lock_owner$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); - public static VarHandle lock_owner$VH() { - return fuse_file_info.lock_owner$VH; - } - /** - * Getter for field: - * {@snippet : - * uint64_t lock_owner; - * } - */ - public static long lock_owner$get(MemorySegment seg) { - return (long)fuse_file_info.lock_owner$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * uint64_t lock_owner; - * } - */ - public static void lock_owner$set(MemorySegment seg, long x) { - fuse_file_info.lock_owner$VH.set(seg, x); - } - public static long lock_owner$get(MemorySegment seg, long index) { - return (long)fuse_file_info.lock_owner$VH.get(seg.asSlice(index*sizeof())); - } - public static void lock_owner$set(MemorySegment seg, long index, long x) { - fuse_file_info.lock_owner$VH.set(seg.asSlice(index*sizeof()), x); - } - static final VarHandle poll_events$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll_events")); - public static VarHandle poll_events$VH() { - return fuse_file_info.poll_events$VH; - } - /** - * Getter for field: - * {@snippet : - * uint32_t poll_events; - * } - */ - public static int poll_events$get(MemorySegment seg) { - return (int)fuse_file_info.poll_events$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * uint32_t poll_events; - * } - */ - public static void poll_events$set(MemorySegment seg, int x) { - fuse_file_info.poll_events$VH.set(seg, x); - } - public static int poll_events$get(MemorySegment seg, long index) { - return (int)fuse_file_info.poll_events$VH.get(seg.asSlice(index*sizeof())); - } - public static void poll_events$set(MemorySegment seg, long index, int x) { - fuse_file_info.poll_events$VH.set(seg.asSlice(index*sizeof()), x); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_lowlevel_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_lowlevel_h.java deleted file mode 100644 index 12b15489..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_lowlevel_h.java +++ /dev/null @@ -1,22 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class fuse_lowlevel_h { - - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_operations.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_operations.java deleted file mode 100644 index 84819230..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_operations.java +++ /dev/null @@ -1,2728 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -/** - * {@snippet : - * struct fuse_operations { - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * int (*readlink)(char*,char*,size_t); - * int (*mknod)(char*,mode_t,dev_t); - * int (*mkdir)(char*,mode_t); - * int (*unlink)(char*); - * int (*rmdir)(char*); - * int (*symlink)(char*,char*); - * int (*rename)(char*,char*,unsigned int); - * int (*link)(char*,char*); - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * int (*open)(char*,struct fuse_file_info*); - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * int (*statfs)(char*,struct statvfs*); - * int (*flush)(char*,struct fuse_file_info*); - * int (*release)(char*,struct fuse_file_info*); - * int (*fsync)(char*,int,struct fuse_file_info*); - * int (*setxattr)(char*,char*,char*,size_t,int); - * int (*getxattr)(char*,char*,char*,size_t); - * int (*listxattr)(char*,char*,size_t); - * int (*removexattr)(char*,char*); - * int (*opendir)(char*,struct fuse_file_info*); - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * int (*releasedir)(char*,struct fuse_file_info*); - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * void (*destroy)(void*); - * int (*access)(char*,int); - * int (*create)(char*,mode_t,struct fuse_file_info*); - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * int (*bmap)(char*,size_t,uint64_t*); - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * int (*flock)(char*,struct fuse_file_info*,int); - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * }; - * } - */ -public class fuse_operations { - - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_POINTER$LAYOUT.withName("getattr"), - Constants$root.C_POINTER$LAYOUT.withName("readlink"), - Constants$root.C_POINTER$LAYOUT.withName("mknod"), - Constants$root.C_POINTER$LAYOUT.withName("mkdir"), - Constants$root.C_POINTER$LAYOUT.withName("unlink"), - Constants$root.C_POINTER$LAYOUT.withName("rmdir"), - Constants$root.C_POINTER$LAYOUT.withName("symlink"), - Constants$root.C_POINTER$LAYOUT.withName("rename"), - Constants$root.C_POINTER$LAYOUT.withName("link"), - Constants$root.C_POINTER$LAYOUT.withName("chmod"), - Constants$root.C_POINTER$LAYOUT.withName("chown"), - Constants$root.C_POINTER$LAYOUT.withName("truncate"), - Constants$root.C_POINTER$LAYOUT.withName("open"), - Constants$root.C_POINTER$LAYOUT.withName("read"), - Constants$root.C_POINTER$LAYOUT.withName("write"), - Constants$root.C_POINTER$LAYOUT.withName("statfs"), - Constants$root.C_POINTER$LAYOUT.withName("flush"), - Constants$root.C_POINTER$LAYOUT.withName("release"), - Constants$root.C_POINTER$LAYOUT.withName("fsync"), - Constants$root.C_POINTER$LAYOUT.withName("setxattr"), - Constants$root.C_POINTER$LAYOUT.withName("getxattr"), - Constants$root.C_POINTER$LAYOUT.withName("listxattr"), - Constants$root.C_POINTER$LAYOUT.withName("removexattr"), - Constants$root.C_POINTER$LAYOUT.withName("opendir"), - Constants$root.C_POINTER$LAYOUT.withName("readdir"), - Constants$root.C_POINTER$LAYOUT.withName("releasedir"), - Constants$root.C_POINTER$LAYOUT.withName("fsyncdir"), - Constants$root.C_POINTER$LAYOUT.withName("init"), - Constants$root.C_POINTER$LAYOUT.withName("destroy"), - Constants$root.C_POINTER$LAYOUT.withName("access"), - Constants$root.C_POINTER$LAYOUT.withName("create"), - Constants$root.C_POINTER$LAYOUT.withName("lock"), - Constants$root.C_POINTER$LAYOUT.withName("utimens"), - Constants$root.C_POINTER$LAYOUT.withName("bmap"), - Constants$root.C_POINTER$LAYOUT.withName("ioctl"), - Constants$root.C_POINTER$LAYOUT.withName("poll"), - Constants$root.C_POINTER$LAYOUT.withName("write_buf"), - Constants$root.C_POINTER$LAYOUT.withName("read_buf"), - Constants$root.C_POINTER$LAYOUT.withName("flock"), - Constants$root.C_POINTER$LAYOUT.withName("fallocate"), - Constants$root.C_POINTER$LAYOUT.withName("copy_file_range"), - Constants$root.C_POINTER$LAYOUT.withName("lseek") - ).withName("fuse_operations"); - public static MemoryLayout $LAYOUT() { - return fuse_operations.$struct$LAYOUT; - } - static final FunctionDescriptor getattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.getattr$FUNC - ); - /** - * {@snippet : - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public interface getattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(getattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse_operations.getattr$FUNC, scope); - } - static getattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.getattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getattr")); - public static VarHandle getattr$VH() { - return fuse_operations.getattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public static MemorySegment getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public static void getattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getattr$VH.set(seg, x); - } - public static MemorySegment getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getattr getattr(MemorySegment segment, SegmentScope scope) { - return getattr.ofAddress(getattr$get(segment), scope); - } - static final FunctionDescriptor readlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle readlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.readlink$FUNC - ); - /** - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public interface readlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(readlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse_operations.readlink$FUNC, scope); - } - static readlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readlink")); - public static VarHandle readlink$VH() { - return fuse_operations.readlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public static MemorySegment readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.readlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public static void readlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.readlink$VH.set(seg, x); - } - public static MemorySegment readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.readlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.readlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readlink readlink(MemorySegment segment, SegmentScope scope) { - return readlink.ofAddress(readlink$get(segment), scope); - } - static final FunctionDescriptor mknod$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle mknod$MH = RuntimeHelper.downcallHandle( - fuse_operations.mknod$FUNC - ); - /** - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public interface mknod { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2); - static MemorySegment allocate(mknod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse_operations.mknod$FUNC, scope); - } - static mknod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2) -> { - try { - return (int)fuse_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mknod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mknod")); - public static VarHandle mknod$VH() { - return fuse_operations.mknod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public static MemorySegment mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.mknod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public static void mknod$set(MemorySegment seg, MemorySegment x) { - fuse_operations.mknod$VH.set(seg, x); - } - public static MemorySegment mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.mknod$VH.get(seg.asSlice(index*sizeof())); - } - public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.mknod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mknod mknod(MemorySegment segment, SegmentScope scope) { - return mknod.ofAddress(mknod$get(segment), scope); - } - static final FunctionDescriptor mkdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle mkdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.mkdir$FUNC - ); - /** - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public interface mkdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(mkdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse_operations.mkdir$FUNC, scope); - } - static mkdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mkdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); - public static VarHandle mkdir$VH() { - return fuse_operations.mkdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public static MemorySegment mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.mkdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public static void mkdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.mkdir$VH.set(seg, x); - } - public static MemorySegment mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.mkdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mkdir mkdir(MemorySegment segment, SegmentScope scope) { - return mkdir.ofAddress(mkdir$get(segment), scope); - } - static final FunctionDescriptor unlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.unlink$FUNC - ); - /** - * {@snippet : - * int (*unlink)(char*); - * } - */ - public interface unlink { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(unlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse_operations.unlink$FUNC, scope); - } - static unlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse_operations.unlink$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle unlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("unlink")); - public static VarHandle unlink$VH() { - return fuse_operations.unlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static MemorySegment unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.unlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static void unlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.unlink$VH.set(seg, x); - } - public static MemorySegment unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.unlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.unlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static unlink unlink(MemorySegment segment, SegmentScope scope) { - return unlink.ofAddress(unlink$get(segment), scope); - } - static final FunctionDescriptor rmdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.rmdir$FUNC - ); - /** - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public interface rmdir { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(rmdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse_operations.rmdir$FUNC, scope); - } - static rmdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse_operations.rmdir$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rmdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); - public static VarHandle rmdir$VH() { - return fuse_operations.rmdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static MemorySegment rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.rmdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static void rmdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.rmdir$VH.set(seg, x); - } - public static MemorySegment rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.rmdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rmdir rmdir(MemorySegment segment, SegmentScope scope) { - return rmdir.ofAddress(rmdir$get(segment), scope); - } - static final FunctionDescriptor symlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.symlink$FUNC - ); - /** - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public interface symlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(symlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse_operations.symlink$FUNC, scope); - } - static symlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.symlink$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle symlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("symlink")); - public static VarHandle symlink$VH() { - return fuse_operations.symlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static MemorySegment symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.symlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static void symlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.symlink$VH.set(seg, x); - } - public static MemorySegment symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.symlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.symlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static symlink symlink(MemorySegment segment, SegmentScope scope) { - return symlink.ofAddress(symlink$get(segment), scope); - } - static final FunctionDescriptor rename$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( - fuse_operations.rename$FUNC - ); - /** - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public interface rename { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(rename fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse_operations.rename$FUNC, scope); - } - static rename ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse_operations.rename$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rename$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rename")); - public static VarHandle rename$VH() { - return fuse_operations.rename$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public static MemorySegment rename$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.rename$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public static void rename$set(MemorySegment seg, MemorySegment x) { - fuse_operations.rename$VH.set(seg, x); - } - public static MemorySegment rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.rename$VH.get(seg.asSlice(index*sizeof())); - } - public static void rename$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.rename$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rename rename(MemorySegment segment, SegmentScope scope) { - return rename.ofAddress(rename$get(segment), scope); - } - static final FunctionDescriptor link$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle link$MH = RuntimeHelper.downcallHandle( - fuse_operations.link$FUNC - ); - /** - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public interface link { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(link fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(link.class, fi, fuse_operations.link$FUNC, scope); - } - static link ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.link$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle link$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("link")); - public static VarHandle link$VH() { - return fuse_operations.link$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static MemorySegment link$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.link$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static void link$set(MemorySegment seg, MemorySegment x) { - fuse_operations.link$VH.set(seg, x); - } - public static MemorySegment link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.link$VH.get(seg.asSlice(index*sizeof())); - } - public static void link$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.link$VH.set(seg.asSlice(index*sizeof()), x); - } - public static link link(MemorySegment segment, SegmentScope scope) { - return link.ofAddress(link$get(segment), scope); - } - static final FunctionDescriptor chmod$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle chmod$MH = RuntimeHelper.downcallHandle( - fuse_operations.chmod$FUNC - ); - /** - * {@snippet : - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * } - */ - public interface chmod { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(chmod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse_operations.chmod$FUNC, scope); - } - static chmod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.chmod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chmod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chmod")); - public static VarHandle chmod$VH() { - return fuse_operations.chmod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static MemorySegment chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.chmod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chmod)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static void chmod$set(MemorySegment seg, MemorySegment x) { - fuse_operations.chmod$VH.set(seg, x); - } - public static MemorySegment chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.chmod$VH.get(seg.asSlice(index*sizeof())); - } - public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.chmod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chmod chmod(MemorySegment segment, SegmentScope scope) { - return chmod.ofAddress(chmod$get(segment), scope); - } - static final FunctionDescriptor chown$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle chown$MH = RuntimeHelper.downcallHandle( - fuse_operations.chown$FUNC - ); - /** - * {@snippet : - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * } - */ - public interface chown { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(chown fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse_operations.chown$FUNC, scope); - } - static chown ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chown$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chown")); - public static VarHandle chown$VH() { - return fuse_operations.chown$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * } - */ - public static MemorySegment chown$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.chown$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chown)(char*,uid_t,gid_t,struct fuse_file_info*); - * } - */ - public static void chown$set(MemorySegment seg, MemorySegment x) { - fuse_operations.chown$VH.set(seg, x); - } - public static MemorySegment chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.chown$VH.get(seg.asSlice(index*sizeof())); - } - public static void chown$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.chown$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chown chown(MemorySegment segment, SegmentScope scope) { - return chown.ofAddress(chown$get(segment), scope); - } - static final FunctionDescriptor truncate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle truncate$MH = RuntimeHelper.downcallHandle( - fuse_operations.truncate$FUNC - ); - /** - * {@snippet : - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public interface truncate { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(truncate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse_operations.truncate$FUNC, scope); - } - static truncate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.truncate$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle truncate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("truncate")); - public static VarHandle truncate$VH() { - return fuse_operations.truncate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.truncate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*truncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public static void truncate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.truncate$VH.set(seg, x); - } - public static MemorySegment truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.truncate$VH.get(seg.asSlice(index*sizeof())); - } - public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.truncate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static truncate truncate(MemorySegment segment, SegmentScope scope) { - return truncate.ofAddress(truncate$get(segment), scope); - } - static final FunctionDescriptor open$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle open$MH = RuntimeHelper.downcallHandle( - fuse_operations.open$FUNC - ); - /** - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public interface open { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(open fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(open.class, fi, fuse_operations.open$FUNC, scope); - } - static open ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.open$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle open$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("open")); - public static VarHandle open$VH() { - return fuse_operations.open$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment open$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.open$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public static void open$set(MemorySegment seg, MemorySegment x) { - fuse_operations.open$VH.set(seg, x); - } - public static MemorySegment open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.open$VH.get(seg.asSlice(index*sizeof())); - } - public static void open$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.open$VH.set(seg.asSlice(index*sizeof()), x); - } - public static open open(MemorySegment segment, SegmentScope scope) { - return open.ofAddress(open$get(segment), scope); - } - static final FunctionDescriptor read$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read$MH = RuntimeHelper.downcallHandle( - fuse_operations.read$FUNC - ); - /** - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface read { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read.class, fi, fuse_operations.read$FUNC, scope); - } - static read ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read")); - public static VarHandle read$VH() { - return fuse_operations.read$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment read$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.read$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void read$set(MemorySegment seg, MemorySegment x) { - fuse_operations.read$VH.set(seg, x); - } - public static MemorySegment read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.read$VH.get(seg.asSlice(index*sizeof())); - } - public static void read$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.read$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read read(MemorySegment segment, SegmentScope scope) { - return read.ofAddress(read$get(segment), scope); - } - static final FunctionDescriptor write$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write$MH = RuntimeHelper.downcallHandle( - fuse_operations.write$FUNC - ); - /** - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface write { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(write fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write.class, fi, fuse_operations.write$FUNC, scope); - } - static write ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write")); - public static VarHandle write$VH() { - return fuse_operations.write$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment write$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.write$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void write$set(MemorySegment seg, MemorySegment x) { - fuse_operations.write$VH.set(seg, x); - } - public static MemorySegment write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.write$VH.get(seg.asSlice(index*sizeof())); - } - public static void write$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.write$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write write(MemorySegment segment, SegmentScope scope) { - return write.ofAddress(write$get(segment), scope); - } - static final FunctionDescriptor statfs$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle statfs$MH = RuntimeHelper.downcallHandle( - fuse_operations.statfs$FUNC - ); - /** - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public interface statfs { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(statfs fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse_operations.statfs$FUNC, scope); - } - static statfs ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.statfs$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle statfs$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("statfs")); - public static VarHandle statfs$VH() { - return fuse_operations.statfs$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public static MemorySegment statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.statfs$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public static void statfs$set(MemorySegment seg, MemorySegment x) { - fuse_operations.statfs$VH.set(seg, x); - } - public static MemorySegment statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.statfs$VH.get(seg.asSlice(index*sizeof())); - } - public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.statfs$VH.set(seg.asSlice(index*sizeof()), x); - } - public static statfs statfs(MemorySegment segment, SegmentScope scope) { - return statfs.ofAddress(statfs$get(segment), scope); - } - static final FunctionDescriptor flush$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle flush$MH = RuntimeHelper.downcallHandle( - fuse_operations.flush$FUNC - ); - /** - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public interface flush { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(flush fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse_operations.flush$FUNC, scope); - } - static flush ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.flush$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flush$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flush")); - public static VarHandle flush$VH() { - return fuse_operations.flush$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment flush$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.flush$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public static void flush$set(MemorySegment seg, MemorySegment x) { - fuse_operations.flush$VH.set(seg, x); - } - public static MemorySegment flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.flush$VH.get(seg.asSlice(index*sizeof())); - } - public static void flush$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.flush$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flush flush(MemorySegment segment, SegmentScope scope) { - return flush.ofAddress(flush$get(segment), scope); - } - static final FunctionDescriptor release$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle release$MH = RuntimeHelper.downcallHandle( - fuse_operations.release$FUNC - ); - /** - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public interface release { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(release fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(release.class, fi, fuse_operations.release$FUNC, scope); - } - static release ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.release$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle release$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("release")); - public static VarHandle release$VH() { - return fuse_operations.release$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment release$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.release$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public static void release$set(MemorySegment seg, MemorySegment x) { - fuse_operations.release$VH.set(seg, x); - } - public static MemorySegment release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.release$VH.get(seg.asSlice(index*sizeof())); - } - public static void release$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.release$VH.set(seg.asSlice(index*sizeof()), x); - } - public static release release(MemorySegment segment, SegmentScope scope) { - return release.ofAddress(release$get(segment), scope); - } - static final FunctionDescriptor fsync$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsync$MH = RuntimeHelper.downcallHandle( - fuse_operations.fsync$FUNC - ); - /** - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public interface fsync { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsync fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse_operations.fsync$FUNC, scope); - } - static fsync ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsync$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsync")); - public static VarHandle fsync$VH() { - return fuse_operations.fsync$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public static MemorySegment fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsync$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public static void fsync$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fsync$VH.set(seg, x); - } - public static MemorySegment fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsync$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fsync$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsync fsync(MemorySegment segment, SegmentScope scope) { - return fsync.ofAddress(fsync$get(segment), scope); - } - static final FunctionDescriptor setxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle setxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.setxattr$FUNC - ); - /** - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public interface setxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse_operations.setxattr$FUNC, scope); - } - static setxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { - try { - return (int)fuse_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle setxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); - public static VarHandle setxattr$VH() { - return fuse_operations.setxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public static MemorySegment setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.setxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public static void setxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.setxattr$VH.set(seg, x); - } - public static MemorySegment setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.setxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static setxattr setxattr(MemorySegment segment, SegmentScope scope) { - return setxattr.ofAddress(setxattr$get(segment), scope); - } - static final FunctionDescriptor getxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle getxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.getxattr$FUNC - ); - /** - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public interface getxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); - static MemorySegment allocate(getxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse_operations.getxattr$FUNC, scope); - } - static getxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { - try { - return (int)fuse_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); - public static VarHandle getxattr$VH() { - return fuse_operations.getxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public static MemorySegment getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public static void getxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getxattr$VH.set(seg, x); - } - public static MemorySegment getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getxattr getxattr(MemorySegment segment, SegmentScope scope) { - return getxattr.ofAddress(getxattr$get(segment), scope); - } - static final FunctionDescriptor listxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle listxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.listxattr$FUNC - ); - /** - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public interface listxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(listxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse_operations.listxattr$FUNC, scope); - } - static listxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle listxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); - public static VarHandle listxattr$VH() { - return fuse_operations.listxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public static MemorySegment listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.listxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public static void listxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.listxattr$VH.set(seg, x); - } - public static MemorySegment listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.listxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static listxattr listxattr(MemorySegment segment, SegmentScope scope) { - return listxattr.ofAddress(listxattr$get(segment), scope); - } - static final FunctionDescriptor removexattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.removexattr$FUNC - ); - /** - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public interface removexattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(removexattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse_operations.removexattr$FUNC, scope); - } - static removexattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle removexattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); - public static VarHandle removexattr$VH() { - return fuse_operations.removexattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static MemorySegment removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.removexattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static void removexattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.removexattr$VH.set(seg, x); - } - public static MemorySegment removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.removexattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static removexattr removexattr(MemorySegment segment, SegmentScope scope) { - return removexattr.ofAddress(removexattr$get(segment), scope); - } - static final FunctionDescriptor opendir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle opendir$MH = RuntimeHelper.downcallHandle( - fuse_operations.opendir$FUNC - ); - /** - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public interface opendir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(opendir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse_operations.opendir$FUNC, scope); - } - static opendir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.opendir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle opendir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("opendir")); - public static VarHandle opendir$VH() { - return fuse_operations.opendir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.opendir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public static void opendir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.opendir$VH.set(seg, x); - } - public static MemorySegment opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.opendir$VH.get(seg.asSlice(index*sizeof())); - } - public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.opendir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static opendir opendir(MemorySegment segment, SegmentScope scope) { - return opendir.ofAddress(opendir$get(segment), scope); - } - static final FunctionDescriptor readdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle readdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.readdir$FUNC - ); - /** - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * } - */ - public interface readdir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4, int _x5); - static MemorySegment allocate(readdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse_operations.readdir$FUNC, scope); - } - static readdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4, int __x5) -> { - try { - return (int)fuse_operations.readdir$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir")); - public static VarHandle readdir$VH() { - return fuse_operations.readdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * } - */ - public static MemorySegment readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.readdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*,enum fuse_readdir_flags); - * } - */ - public static void readdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.readdir$VH.set(seg, x); - } - public static MemorySegment readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.readdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.readdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readdir readdir(MemorySegment segment, SegmentScope scope) { - return readdir.ofAddress(readdir$get(segment), scope); - } - static final FunctionDescriptor releasedir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle releasedir$MH = RuntimeHelper.downcallHandle( - fuse_operations.releasedir$FUNC - ); - /** - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public interface releasedir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(releasedir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse_operations.releasedir$FUNC, scope); - } - static releasedir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle releasedir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); - public static VarHandle releasedir$VH() { - return fuse_operations.releasedir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.releasedir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public static void releasedir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.releasedir$VH.set(seg, x); - } - public static MemorySegment releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); - } - public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.releasedir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static releasedir releasedir(MemorySegment segment, SegmentScope scope) { - return releasedir.ofAddress(releasedir$get(segment), scope); - } - static final FunctionDescriptor fsyncdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsyncdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.fsyncdir$FUNC - ); - /** - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public interface fsyncdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsyncdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse_operations.fsyncdir$FUNC, scope); - } - static fsyncdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsyncdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); - public static VarHandle fsyncdir$VH() { - return fuse_operations.fsyncdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public static MemorySegment fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsyncdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fsyncdir$VH.set(seg, x); - } - public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fsyncdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsyncdir fsyncdir(MemorySegment segment, SegmentScope scope) { - return fsyncdir.ofAddress(fsyncdir$get(segment), scope); - } - static final FunctionDescriptor init$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle init$MH = RuntimeHelper.downcallHandle( - fuse_operations.init$FUNC - ); - /** - * {@snippet : - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * } - */ - public interface init { - - java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(init fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(init.class, fi, fuse_operations.init$FUNC, scope); - } - static init ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (java.lang.foreign.MemorySegment)fuse_operations.init$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle init$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("init")); - public static VarHandle init$VH() { - return fuse_operations.init$VH; - } - /** - * Getter for field: - * {@snippet : - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * } - */ - public static MemorySegment init$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.init$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void* (*init)(struct fuse_conn_info*,struct fuse_config*); - * } - */ - public static void init$set(MemorySegment seg, MemorySegment x) { - fuse_operations.init$VH.set(seg, x); - } - public static MemorySegment init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.init$VH.get(seg.asSlice(index*sizeof())); - } - public static void init$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.init$VH.set(seg.asSlice(index*sizeof()), x); - } - public static init init(MemorySegment segment, SegmentScope scope) { - return init.ofAddress(init$get(segment), scope); - } - static final FunctionDescriptor destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( - fuse_operations.destroy$FUNC - ); - /** - * {@snippet : - * void (*destroy)(void*); - * } - */ - public interface destroy { - - void apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(destroy fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse_operations.destroy$FUNC, scope); - } - static destroy ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - fuse_operations.destroy$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle destroy$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("destroy")); - public static VarHandle destroy$VH() { - return fuse_operations.destroy$VH; - } - /** - * Getter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static MemorySegment destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.destroy$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static void destroy$set(MemorySegment seg, MemorySegment x) { - fuse_operations.destroy$VH.set(seg, x); - } - public static MemorySegment destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.destroy$VH.get(seg.asSlice(index*sizeof())); - } - public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.destroy$VH.set(seg.asSlice(index*sizeof()), x); - } - public static destroy destroy(MemorySegment segment, SegmentScope scope) { - return destroy.ofAddress(destroy$get(segment), scope); - } - static final FunctionDescriptor access$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle access$MH = RuntimeHelper.downcallHandle( - fuse_operations.access$FUNC - ); - /** - * {@snippet : - * int (*access)(char*,int); - * } - */ - public interface access { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(access fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(access.class, fi, fuse_operations.access$FUNC, scope); - } - static access ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse_operations.access$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle access$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("access")); - public static VarHandle access$VH() { - return fuse_operations.access$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static MemorySegment access$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.access$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static void access$set(MemorySegment seg, MemorySegment x) { - fuse_operations.access$VH.set(seg, x); - } - public static MemorySegment access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.access$VH.get(seg.asSlice(index*sizeof())); - } - public static void access$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.access$VH.set(seg.asSlice(index*sizeof()), x); - } - public static access access(MemorySegment segment, SegmentScope scope) { - return access.ofAddress(access$get(segment), scope); - } - static final FunctionDescriptor create$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle create$MH = RuntimeHelper.downcallHandle( - fuse_operations.create$FUNC - ); - /** - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public interface create { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(create fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(create.class, fi, fuse_operations.create$FUNC, scope); - } - static create ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle create$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("create")); - public static VarHandle create$VH() { - return fuse_operations.create$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static MemorySegment create$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.create$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static void create$set(MemorySegment seg, MemorySegment x) { - fuse_operations.create$VH.set(seg, x); - } - public static MemorySegment create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.create$VH.get(seg.asSlice(index*sizeof())); - } - public static void create$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.create$VH.set(seg.asSlice(index*sizeof()), x); - } - public static create create(MemorySegment segment, SegmentScope scope) { - return create.ofAddress(create$get(segment), scope); - } - static final FunctionDescriptor lock$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle lock$MH = RuntimeHelper.downcallHandle( - fuse_operations.lock$FUNC - ); - /** - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public interface lock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(lock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse_operations.lock$FUNC, scope); - } - static lock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle lock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock")); - public static VarHandle lock$VH() { - return fuse_operations.lock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public static MemorySegment lock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.lock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public static void lock$set(MemorySegment seg, MemorySegment x) { - fuse_operations.lock$VH.set(seg, x); - } - public static MemorySegment lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.lock$VH.get(seg.asSlice(index*sizeof())); - } - public static void lock$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.lock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static lock lock(MemorySegment segment, SegmentScope scope) { - return lock.ofAddress(lock$get(segment), scope); - } - static final FunctionDescriptor utimens$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle utimens$MH = RuntimeHelper.downcallHandle( - fuse_operations.utimens$FUNC - ); - /** - * {@snippet : - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * } - */ - public interface utimens { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(utimens fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse_operations.utimens$FUNC, scope); - } - static utimens ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.utimens$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle utimens$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("utimens")); - public static VarHandle utimens$VH() { - return fuse_operations.utimens$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * } - */ - public static MemorySegment utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.utimens$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*utimens)(char*,struct timespec*,struct fuse_file_info*); - * } - */ - public static void utimens$set(MemorySegment seg, MemorySegment x) { - fuse_operations.utimens$VH.set(seg, x); - } - public static MemorySegment utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.utimens$VH.get(seg.asSlice(index*sizeof())); - } - public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.utimens$VH.set(seg.asSlice(index*sizeof()), x); - } - public static utimens utimens(MemorySegment segment, SegmentScope scope) { - return utimens.ofAddress(utimens$get(segment), scope); - } - static final FunctionDescriptor bmap$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle bmap$MH = RuntimeHelper.downcallHandle( - fuse_operations.bmap$FUNC - ); - /** - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public interface bmap { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(bmap fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse_operations.bmap$FUNC, scope); - } - static bmap ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle bmap$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("bmap")); - public static VarHandle bmap$VH() { - return fuse_operations.bmap$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public static MemorySegment bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.bmap$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public static void bmap$set(MemorySegment seg, MemorySegment x) { - fuse_operations.bmap$VH.set(seg, x); - } - public static MemorySegment bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.bmap$VH.get(seg.asSlice(index*sizeof())); - } - public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.bmap$VH.set(seg.asSlice(index*sizeof()), x); - } - public static bmap bmap(MemorySegment segment, SegmentScope scope) { - return bmap.ofAddress(bmap$get(segment), scope); - } - static final FunctionDescriptor ioctl$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ioctl$MH = RuntimeHelper.downcallHandle( - fuse_operations.ioctl$FUNC - ); - /** - * {@snippet : - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public interface ioctl { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); - static MemorySegment allocate(ioctl fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse_operations.ioctl$FUNC, scope); - } - static ioctl ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { - try { - return (int)fuse_operations.ioctl$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle ioctl$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); - public static VarHandle ioctl$VH() { - return fuse_operations.ioctl$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public static MemorySegment ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.ioctl$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*ioctl)(char*,unsigned int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public static void ioctl$set(MemorySegment seg, MemorySegment x) { - fuse_operations.ioctl$VH.set(seg, x); - } - public static MemorySegment ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); - } - public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.ioctl$VH.set(seg.asSlice(index*sizeof()), x); - } - public static ioctl ioctl(MemorySegment segment, SegmentScope scope) { - return ioctl.ofAddress(ioctl$get(segment), scope); - } - static final FunctionDescriptor poll$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle poll$MH = RuntimeHelper.downcallHandle( - fuse_operations.poll$FUNC - ); - /** - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public interface poll { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(poll fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse_operations.poll$FUNC, scope); - } - static poll ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle poll$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll")); - public static VarHandle poll$VH() { - return fuse_operations.poll$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public static MemorySegment poll$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.poll$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public static void poll$set(MemorySegment seg, MemorySegment x) { - fuse_operations.poll$VH.set(seg, x); - } - public static MemorySegment poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.poll$VH.get(seg.asSlice(index*sizeof())); - } - public static void poll$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.poll$VH.set(seg.asSlice(index*sizeof()), x); - } - public static poll poll(MemorySegment segment, SegmentScope scope) { - return poll.ofAddress(poll$get(segment), scope); - } - static final FunctionDescriptor write_buf$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write_buf$MH = RuntimeHelper.downcallHandle( - fuse_operations.write_buf$FUNC - ); - /** - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public interface write_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(write_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse_operations.write_buf$FUNC, scope); - } - static write_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); - public static VarHandle write_buf$VH() { - return fuse_operations.write_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.write_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public static void write_buf$set(MemorySegment seg, MemorySegment x) { - fuse_operations.write_buf$VH.set(seg, x); - } - public static MemorySegment write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.write_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write_buf write_buf(MemorySegment segment, SegmentScope scope) { - return write_buf.ofAddress(write_buf$get(segment), scope); - } - static final FunctionDescriptor read_buf$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read_buf$MH = RuntimeHelper.downcallHandle( - fuse_operations.read_buf$FUNC - ); - /** - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface read_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse_operations.read_buf$FUNC, scope); - } - static read_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.read_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); - public static VarHandle read_buf$VH() { - return fuse_operations.read_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.read_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void read_buf$set(MemorySegment seg, MemorySegment x) { - fuse_operations.read_buf$VH.set(seg, x); - } - public static MemorySegment read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.read_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read_buf read_buf(MemorySegment segment, SegmentScope scope) { - return read_buf.ofAddress(read_buf$get(segment), scope); - } - static final FunctionDescriptor flock$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle flock$MH = RuntimeHelper.downcallHandle( - fuse_operations.flock$FUNC - ); - /** - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public interface flock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(flock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse_operations.flock$FUNC, scope); - } - static flock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flock")); - public static VarHandle flock$VH() { - return fuse_operations.flock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public static MemorySegment flock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.flock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public static void flock$set(MemorySegment seg, MemorySegment x) { - fuse_operations.flock$VH.set(seg, x); - } - public static MemorySegment flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.flock$VH.get(seg.asSlice(index*sizeof())); - } - public static void flock$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.flock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flock flock(MemorySegment segment, SegmentScope scope) { - return flock.ofAddress(flock$get(segment), scope); - } - static final FunctionDescriptor fallocate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fallocate$MH = RuntimeHelper.downcallHandle( - fuse_operations.fallocate$FUNC - ); - /** - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public interface fallocate { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(fallocate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse_operations.fallocate$FUNC, scope); - } - static fallocate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fallocate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); - public static VarHandle fallocate$VH() { - return fuse_operations.fallocate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fallocate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public static void fallocate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fallocate$VH.set(seg, x); - } - public static MemorySegment fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); - } - public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fallocate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fallocate fallocate(MemorySegment segment, SegmentScope scope) { - return fallocate.ofAddress(fallocate$get(segment), scope); - } - static final FunctionDescriptor copy_file_range$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle copy_file_range$MH = RuntimeHelper.downcallHandle( - fuse_operations.copy_file_range$FUNC - ); - /** - * {@snippet : - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * } - */ - public interface copy_file_range { - - long apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4, long _x5, long _x6, int _x7); - static MemorySegment allocate(copy_file_range fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(copy_file_range.class, fi, fuse_operations.copy_file_range$FUNC, scope); - } - static copy_file_range ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4, long __x5, long __x6, int __x7) -> { - try { - return (long)fuse_operations.copy_file_range$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5, __x6, __x7); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle copy_file_range$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("copy_file_range")); - public static VarHandle copy_file_range$VH() { - return fuse_operations.copy_file_range$VH; - } - /** - * Getter for field: - * {@snippet : - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * } - */ - public static MemorySegment copy_file_range$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.copy_file_range$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * ssize_t (*copy_file_range)(char*,struct fuse_file_info*,off_t,char*,struct fuse_file_info*,off_t,size_t,int); - * } - */ - public static void copy_file_range$set(MemorySegment seg, MemorySegment x) { - fuse_operations.copy_file_range$VH.set(seg, x); - } - public static MemorySegment copy_file_range$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.copy_file_range$VH.get(seg.asSlice(index*sizeof())); - } - public static void copy_file_range$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.copy_file_range$VH.set(seg.asSlice(index*sizeof()), x); - } - public static copy_file_range copy_file_range(MemorySegment segment, SegmentScope scope) { - return copy_file_range.ofAddress(copy_file_range$get(segment), scope); - } - static final FunctionDescriptor lseek$FUNC = FunctionDescriptor.of(Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle lseek$MH = RuntimeHelper.downcallHandle( - fuse_operations.lseek$FUNC - ); - /** - * {@snippet : - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * } - */ - public interface lseek { - - long apply(java.lang.foreign.MemorySegment _x0, long _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(lseek fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(lseek.class, fi, fuse_operations.lseek$FUNC, scope); - } - static lseek ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (long)fuse_operations.lseek$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle lseek$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lseek")); - public static VarHandle lseek$VH() { - return fuse_operations.lseek$VH; - } - /** - * Getter for field: - * {@snippet : - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * } - */ - public static MemorySegment lseek$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.lseek$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * off_t (*lseek)(char*,off_t,int,struct fuse_file_info*); - * } - */ - public static void lseek$set(MemorySegment seg, MemorySegment x) { - fuse_operations.lseek$VH.set(seg, x); - } - public static MemorySegment lseek$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.lseek$VH.get(seg.asSlice(index*sizeof())); - } - public static void lseek$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.lseek$VH.set(seg.asSlice(index*sizeof()), x); - } - public static lseek lseek(MemorySegment segment, SegmentScope scope) { - return lseek.ofAddress(lseek$get(segment), scope); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/RuntimeHelper.java new file mode 100644 index 00000000..3fe963f3 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.amd64.extr.stat; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/constants$0.java new file mode 100644 index 00000000..dccfb7d8 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.stat; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/stat_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/stat_h.java new file mode 100644 index 00000000..a4bd2686 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat/stat_h.java @@ -0,0 +1,38 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.stat; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class stat_h { + + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; + /** + * {@snippet : + * #define UTIME_NOW 1073741823 + * } + */ + public static long UTIME_NOW() { + return 1073741823L; + } + /** + * {@snippet : + * #define UTIME_OMIT 1073741822 + * } + */ + public static long UTIME_OMIT() { + return 1073741822L; + } +} + + diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat_h.java deleted file mode 100644 index 16ec9d10..00000000 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat_h.java +++ /dev/null @@ -1,38 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.linux.amd64.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class stat_h { - - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; - /** - * {@snippet : - * #define UTIME_NOW 1073741823 - * } - */ - public static long UTIME_NOW() { - return 1073741823L; - } - /** - * {@snippet : - * #define UTIME_OMIT 1073741822 - * } - */ - public static long UTIME_OMIT() { - return 1073741822L; - } -} - - diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/RuntimeHelper.java new file mode 100644 index 00000000..9db43b24 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.linux.amd64.extr.stdio; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/constants$0.java new file mode 100644 index 00000000..5e033479 --- /dev/null +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.linux.amd64.extr.stdio; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/stdio_h.java similarity index 51% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio_h.java rename to jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/stdio_h.java index 010a704c..77a3b805 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio/stdio_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.linux.amd64.extr.stdio; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class stdio_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define RENAME_NOREPLACE 1 diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FileInfoImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FileInfoImplTest.java index 7a653b27..d3a1ff3b 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FileInfoImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FileInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; -import org.cryptomator.jfuse.linux.amd64.extr.fcntl_h; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_file_info; +import org.cryptomator.jfuse.linux.amd64.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_file_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; @@ -20,7 +20,7 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var fi = new FileInfoImpl(fuse_file_info.allocate(arena)); fuse_file_info.flags$set(fi.segment(), flags); diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImplTest.java index f8b8b9eb..a7de2cd4 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConfigImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FuseConfig; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_config; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_config; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConfigImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInFuseConfig getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_config.allocate(arena); - var fuseConfig = new FuseConfigImpl(segment, arena.scope()); + var fuseConfig = new FuseConfigImpl(segment, arena); setter.accept(segment, value); diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImplTest.java index 36739a01..214089af 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseConnInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_conn_info; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_conn_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(segment, 42); @@ -54,9 +54,9 @@ private interface GetInConnInfo extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInConnInfo setter, GetInMemorySegment getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(connInfo, 42); diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseImplTest.java index 1aabbe75..124e962c 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseImplTest.java @@ -4,12 +4,12 @@ import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_cmdline_opts; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_config; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_conn_info; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_file_info; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_h; -import org.cryptomator.jfuse.linux.amd64.extr.timespec; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3_lowlevel.fuse_cmdline_opts; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_config; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_conn_info; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_file_info; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.timespec; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -100,7 +100,7 @@ public void testParseArgsHelp(String arg) { @DisplayName("parseArgs") public void testParseArgs() { try (var fuseFunctionsClass = Mockito.mockStatic(FuseFunctions.class); - var arena = Arena.openConfined()) { + var arena = Arena.ofConfined()) { fuseFunctionsClass.when(() -> FuseFunctions.fuse_parse_cmdline(Mockito.any(), Mockito.any())).then(invocation -> { MemorySegment opts = invocation.getArgument(1); fuse_cmdline_opts.singlethread$set(opts, 0); @@ -128,7 +128,7 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); @@ -142,7 +142,7 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsync(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -156,7 +156,7 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsyncdir(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -172,7 +172,7 @@ public void testFsyncdir() { @DisplayName("init() sets fuse_conn_info.wants |= FUSE_CAP_READDIRPLUS") @Test public void testInit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var result = new AtomicInteger(); Mockito.doAnswer(invocation -> { FuseConnInfo connInfo = invocation.getArgument(0); @@ -195,7 +195,7 @@ public class Utimens { @DisplayName("utimens(\"/foo\", UTIME_NOW, UTIME_NOW)") @Test public void testUtimensNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = arena.allocate(fuse_file_info.$LAYOUT()); var times = MemorySegment.NULL; @@ -216,7 +216,7 @@ public void testUtimensNow() { public void testUtimens(long sec0, long nsec0, long sec1, long nsec1) { Instant expectedATime = Instant.ofEpochSecond(sec0, nsec0); Instant expectedMTime = Instant.ofEpochSecond(sec1, nsec1); - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = arena.allocate(fuse_file_info.$LAYOUT()); var times = timespec.allocateArray(2, arena); @@ -240,7 +240,7 @@ public class Attr { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -256,7 +256,7 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -272,7 +272,7 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var list = arena.allocate(100); @@ -287,7 +287,7 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); @@ -304,7 +304,7 @@ public void testRemovexattr() { @Test @DisplayName("chown") public void testChown() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).chown(Mockito.eq("/foo"), Mockito.eq(42), Mockito.eq(1337), Mockito.any()); diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseMountImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseMountImplTest.java index 1322534a..08128a9d 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseMountImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/FuseMountImplTest.java @@ -1,6 +1,6 @@ package org.cryptomator.jfuse.linux.amd64; -import org.cryptomator.jfuse.linux.amd64.extr.fuse_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.fuse_h; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/LinuxErrnoTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/LinuxErrnoTest.java index e7980c46..e15bbd14 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/LinuxErrnoTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/LinuxErrnoTest.java @@ -1,15 +1,21 @@ package org.cryptomator.jfuse.linux.amd64; +import org.cryptomator.jfuse.api.Errno; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.stream.Stream; + public class LinuxErrnoTest { @DisplayName("make sure method is not a stub") @ParameterizedTest(name = "{0}()") - @ValueSource(strings = {"enoent", "enosys", "enomem", "eacces", "eio", "erofs", "ebadf", "eexist", "enotdir", "eisdir", "enotempty", "einval"}) + @MethodSource("errnoNameProvider") public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationException { var errno = new LinuxErrno(); var method = LinuxErrno.class.getMethod(methodName); @@ -19,4 +25,8 @@ public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationExce Assertions.assertNotEquals(0, result); } + static Stream errnoNameProvider() { + return Arrays.stream(Errno.class.getDeclaredMethods()).map(Method::getName); + } + } \ No newline at end of file diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/StatImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/StatImplTest.java index 720c4a0a..352bd598 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/StatImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/StatImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.linux.amd64.extr.stat; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.stat; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(segment, value); @@ -49,9 +49,9 @@ private interface GetInStat extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInStat setter, GetInMemorySegment getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(stat, value); diff --git a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImplTest.java b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImplTest.java index ee293331..ea1ad14d 100644 --- a/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImplTest.java +++ b/jfuse-linux-amd64/src/test/java/org/cryptomator/jfuse/linux/amd64/TimeSpecImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.linux.amd64; -import org.cryptomator.jfuse.linux.amd64.extr.stat_h; -import org.cryptomator.jfuse.linux.amd64.extr.timespec; +import org.cryptomator.jfuse.linux.amd64.extr.stat.stat_h; +import org.cryptomator.jfuse.linux.amd64.extr.fuse3.timespec; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -14,7 +14,7 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,7 +29,7 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 0L); timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,7 +44,7 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), stat_h.UTIME_OMIT()); @@ -57,7 +57,7 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), stat_h.UTIME_NOW()); diff --git a/jfuse-mac/pom.xml b/jfuse-mac/pom.xml index da8ea343..59ddac12 100644 --- a/jfuse-mac/pom.xml +++ b/jfuse-mac/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse-mac @@ -71,10 +71,9 @@ jextract-maven-plugin 0.3.0 - /Users/sebastian/Documents/Cryptomator/jextract/build/jextract/bin/jextract + /Users/sebastian/git/github.com/openjdk/jextract/build/jextract/bin/jextract ${mac.headerSearchPath} ${project.build.sourceDirectory} - org.cryptomator.jfuse.mac.extr @@ -84,6 +83,7 @@ ${project.parent.basedir}/libfuse2/include/fuse.h + org.cryptomator.jfuse.mac.extr.fuse fuse_h _FILE_OFFSET_BITS=64 @@ -120,6 +120,7 @@ ${mac.headerSearchPath}/errno.h + org.cryptomator.jfuse.mac.extr.errno errno_h ENOENT @@ -138,6 +139,7 @@ ERANGE ENOLCK ENAMETOOLONG + ENODATA @@ -148,6 +150,7 @@ ${mac.headerSearchPath}/sys/stat.h + org.cryptomator.jfuse.mac.extr.stat stat_h UTIME_NOW @@ -162,6 +165,7 @@ ${mac.headerSearchPath}/fcntl.h + org.cryptomator.jfuse.mac.extr.fcntl fcntl_h O_RDONLY diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/DirFillerImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/DirFillerImpl.java index 69ae1a74..b905fc45 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/DirFillerImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/DirFillerImpl.java @@ -2,18 +2,17 @@ import org.cryptomator.jfuse.api.DirFiller; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.mac.extr.fuse_fill_dir_t; -import org.cryptomator.jfuse.mac.extr.stat; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_fill_dir_t; +import org.cryptomator.jfuse.mac.extr.fuse.stat; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; import java.util.function.Consumer; record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller { DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { - this(buf, fuse_fill_dir_t.ofAddress(callback, arena.scope()), arena); + this(buf, fuse_fill_dir_t.ofAddress(callback, arena), arena); } @Override diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FileInfoImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FileInfoImpl.java index 97d5f1d7..e29b1f42 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FileInfoImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FileInfoImpl.java @@ -1,11 +1,11 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.FileInfo; -import org.cryptomator.jfuse.mac.extr.fcntl_h; -import org.cryptomator.jfuse.mac.extr.fuse_file_info; +import org.cryptomator.jfuse.mac.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_file_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -22,7 +22,7 @@ record FileInfoImpl(MemorySegment segment) implements FileInfo { private static final int O_SYNC = fcntl_h.O_SYNC(); private static final int O_DSYNC = fcntl_h.O_DSYNC(); - public FileInfoImpl(MemorySegment address, SegmentScope scope) { + public FileInfoImpl(MemorySegment address, Arena scope) { this(fuse_file_info.ofAddress(address, scope)); } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseArgs.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseArgs.java index f264fcd0..11cc667a 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseArgs.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseArgs.java @@ -1,6 +1,6 @@ package org.cryptomator.jfuse.mac; -import org.cryptomator.jfuse.mac.extr.fuse_args; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_args; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -13,7 +13,7 @@ public String toString() { var argc = fuse_args.argc$get(args); var argv = fuse_args.argv$get(args); for (int i = 0; i < argc; i++) { - var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS, i).reinterpret(Long.MAX_VALUE); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } sb.append("mountPoint = ").append(mountPoint.getUtf8String(0)).append(", "); diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseConnInfoImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseConnInfoImpl.java index 07c69b1f..4efffc90 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseConnInfoImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseConnInfoImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.mac.extr.fuse_conn_info; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_conn_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) { + public FuseConnInfoImpl(MemorySegment address, Arena scope) { this(fuse_conn_info.ofAddress(address, scope)); } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseImpl.java index ca0c6764..5bf21d69 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseImpl.java @@ -4,11 +4,11 @@ import org.cryptomator.jfuse.api.FuseMount; import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; -import org.cryptomator.jfuse.mac.extr.fuse_args; -import org.cryptomator.jfuse.mac.extr.fuse_h; -import org.cryptomator.jfuse.mac.extr.fuse_operations; -import org.cryptomator.jfuse.mac.extr.stat_h; -import org.cryptomator.jfuse.mac.extr.timespec; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_args; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_h; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_operations; +import org.cryptomator.jfuse.mac.extr.fuse.timespec; +import org.cryptomator.jfuse.mac.extr.stat.stat_h; import org.jetbrains.annotations.VisibleForTesting; import java.lang.foreign.Arena; @@ -61,56 +61,55 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { throw new IllegalArgumentException("fuse_parse_cmdline failed to parse " + String.join(" ", cmdLineArgs)); } var isMultiThreaded = multithreaded.get(JAVA_INT, 0) == 1; - var mountPoint = mountPointPtr.get(ValueLayout.ADDRESS.asUnbounded(), 0); + var mountPoint = mountPointPtr.get(ValueLayout.ADDRESS, 0).reinterpret(Long.MAX_VALUE); // unbounded return new FuseArgs(args, mountPoint, isMultiThreaded); } @Override protected void bind(FuseOperations.Operation operation) { - var fuseScope = this.fuseArena.scope(); switch (operation) { - case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseScope)); - case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseScope)); - case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseScope)); - case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseScope)); - case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseScope)); - case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseScope)); - case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseScope)); - case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseScope)); - case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseScope)); + case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseArena)); + case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseArena)); + case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseArena)); + case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseArena)); + case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseArena)); + case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseArena)); + case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseArena)); + case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseArena)); + case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseArena)); case GET_ATTR -> { - fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope)); - fuse_operations.fgetattr$set(fuseOperationsStruct, fuse_operations.fgetattr.allocate(this::fgetattr, fuseScope)); + fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseArena)); + fuse_operations.fgetattr$set(fuseOperationsStruct, fuse_operations.fgetattr.allocate(this::fgetattr, fuseArena)); } - case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseScope)); - case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseScope)); - case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseScope)); - case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseScope)); - case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseScope)); - case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseScope)); - case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseScope)); - case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseScope)); - case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseScope)); - case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseScope)); - case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseScope)); - case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseScope)); - case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseScope)); - case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseScope)); - case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseScope)); - case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseScope)); + case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseArena)); + case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseArena)); + case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseArena)); + case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseArena)); + case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseArena)); + case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseArena)); + case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseArena)); + case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseArena)); + case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseArena)); + case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseArena)); + case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseArena)); + case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseArena)); + case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseArena)); + case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseArena)); + case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseArena)); + case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseArena)); case TRUNCATE -> { - fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope)); - fuse_operations.ftruncate$set(fuseOperationsStruct, fuse_operations.ftruncate.allocate(this::ftruncate, fuseScope)); + fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseArena)); + fuse_operations.ftruncate$set(fuseOperationsStruct, fuse_operations.ftruncate.allocate(this::ftruncate, fuseArena)); } - case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseScope)); - case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseScope)); - case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseScope)); + case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseArena)); + case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseArena)); + case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseArena)); } } private MemorySegment init(MemorySegment conn) { - try (var arena = Arena.openConfined()) { - fuseOperations.init(new FuseConnInfoImpl(conn, arena.scope()), null); + try (var arena = Arena.ofConfined()) { + fuseOperations.init(new FuseConnInfoImpl(conn, arena), null); } return MemorySegment.NULL; } @@ -129,8 +128,8 @@ int chown(MemorySegment path, int uid, int gid) { } private int create(MemorySegment path, short mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @@ -140,61 +139,55 @@ private void destroy(MemorySegment addr) { @VisibleForTesting int flush(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsync(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsyncdir(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int getattr(MemorySegment path, MemorySegment stat) { - try (var arena = Arena.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena.scope()), null); + try (var arena = Arena.ofConfined()) { + return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena), null); } } @VisibleForTesting int fgetattr(MemorySegment path, MemorySegment stat, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena.scope()), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int getxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), buffer); - } + var buffer = value.reinterpret(size).asByteBuffer(); + return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), buffer); } @VisibleForTesting int setxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size, int flags) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), buffer, flags); - } + var buffer = value.reinterpret(size).asByteBuffer(); + return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), buffer, flags); } @VisibleForTesting int listxattr(MemorySegment path, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(value.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.listxattr(path.getUtf8String(0), buffer); - } + var buffer = value.reinterpret(size).asByteBuffer(); + return fuseOperations.listxattr(path.getUtf8String(0), buffer); } @VisibleForTesting @@ -207,46 +200,44 @@ private int mkdir(MemorySegment path, short mode) { } private int open(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int opendir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int read(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } private int readdir(MemorySegment path, MemorySegment buf, MemorySegment filler, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena.scope()), 0); + try (var arena = Arena.ofConfined()) { + return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena), 0); } } private int readlink(MemorySegment path, MemorySegment buf, long len) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), len, arena.scope()).asByteBuffer(); - return fuseOperations.readlink(path.getUtf8String(0), buffer, len); - } + var buffer = buf.reinterpret(len).asByteBuffer(); + return fuseOperations.readlink(path.getUtf8String(0), buffer, len); } private int release(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int releasedir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @@ -259,8 +250,8 @@ private int rmdir(MemorySegment path) { } private int statfs(MemorySegment path, MemorySegment statvfs) { - try (var arena = Arena.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena)); } } @@ -275,8 +266,8 @@ int truncate(MemorySegment path, long size) { @VisibleForTesting int ftruncate(MemorySegment path, long size, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena)); } } @@ -286,10 +277,10 @@ private int unlink(MemorySegment path) { @VisibleForTesting int utimens(MemorySegment path, MemorySegment times) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { if (MemorySegment.NULL.equals(times)) { - // set both times to current time (using on-heap memory segments) - var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), arena.scope()); + // set both times to current time + var segment = arena.allocate(timespec.$LAYOUT()); timespec.tv_sec$set(segment, 0); timespec.tv_nsec$set(segment, stat_h.UTIME_NOW()); var time = new TimeSpecImpl(segment); @@ -303,9 +294,9 @@ int utimens(MemorySegment path, MemorySegment times) { } private int write(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseMountImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseMountImpl.java index 73eb1063..2de3cbab 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseMountImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/FuseMountImpl.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.mac.extr.fuse_h; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_h; import java.lang.foreign.MemorySegment; diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/MacErrno.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/MacErrno.java index 69b9aa28..436cdb1e 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/MacErrno.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/MacErrno.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.Errno; -import org.cryptomator.jfuse.mac.extr.errno_h; +import org.cryptomator.jfuse.mac.extr.errno.errno_h; record MacErrno() implements Errno { @@ -84,4 +84,9 @@ public int enolck() { public int enametoolong() { return errno_h.ENAMETOOLONG(); } + + @Override + public int enodata() { + return errno_h.ENODATA(); + } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatImpl.java index 7d23368f..a6895cf1 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatImpl.java @@ -2,14 +2,14 @@ import org.cryptomator.jfuse.api.Stat; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.mac.extr.stat; +import org.cryptomator.jfuse.mac.extr.fuse.stat; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemorySegment address, SegmentScope scope) { + public StatImpl(MemorySegment address, Arena scope) { this(stat.ofAddress(address, scope)); } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatvfsImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatvfsImpl.java index f7bb2948..feb1bfda 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatvfsImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/StatvfsImpl.java @@ -1,16 +1,16 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.Statvfs; -import org.cryptomator.jfuse.mac.extr.statvfs; +import org.cryptomator.jfuse.mac.extr.fuse.statvfs; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { private static final long MAX_UINT = 0xFFFFFFFFL; - public StatvfsImpl(MemorySegment address, SegmentScope scope) { + public StatvfsImpl(MemorySegment address, Arena scope) { this(statvfs.ofAddress(address, scope)); } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/TimeSpecImpl.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/TimeSpecImpl.java index bed054b1..b0e03d74 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/TimeSpecImpl.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/TimeSpecImpl.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.mac.extr.stat_h; -import org.cryptomator.jfuse.mac.extr.timespec; +import org.cryptomator.jfuse.mac.extr.stat.stat_h; +import org.cryptomator.jfuse.mac.extr.fuse.timespec; import java.lang.foreign.MemorySegment; import java.time.Instant; diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/Constants$root.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/Constants$root.java deleted file mode 100644 index f5765118..00000000 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/Constants$root.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.mac.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class Constants$root { - - // Suppresses default constructor, ensuring non-instantiability. - private Constants$root() {} - static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; - static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; - static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; - static final OfInt C_INT$LAYOUT = JAVA_INT; - static final OfLong C_LONG$LAYOUT = JAVA_LONG; - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded(); -} - - diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/constants$0.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/constants$0.java deleted file mode 100644 index 80110212..00000000 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/constants$0.java +++ /dev/null @@ -1,62 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.mac.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$0 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$0() {} - static final FunctionDescriptor fuse_mount$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_mount$MH = RuntimeHelper.downcallHandle( - "fuse_mount", - constants$0.fuse_mount$FUNC - ); - static final FunctionDescriptor fuse_unmount$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_unmount$MH = RuntimeHelper.downcallHandle( - "fuse_unmount", - constants$0.fuse_unmount$FUNC - ); - static final FunctionDescriptor fuse_parse_cmdline$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_parse_cmdline$MH = RuntimeHelper.downcallHandle( - "fuse_parse_cmdline", - constants$0.fuse_parse_cmdline$FUNC - ); - static final FunctionDescriptor fuse_fill_dir_t$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle fuse_fill_dir_t$MH = RuntimeHelper.downcallHandle( - constants$0.fuse_fill_dir_t$FUNC - ); - static final FunctionDescriptor fuse_new$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_new$MH = RuntimeHelper.downcallHandle( - "fuse_new", - constants$0.fuse_new$FUNC - ); -} - - diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/constants$1.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/constants$1.java deleted file mode 100644 index ed018bc7..00000000 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/constants$1.java +++ /dev/null @@ -1,44 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.mac.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$1 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$1() {} - static final FunctionDescriptor fuse_destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_destroy$MH = RuntimeHelper.downcallHandle( - "fuse_destroy", - constants$1.fuse_destroy$FUNC - ); - static final FunctionDescriptor fuse_loop$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop$MH = RuntimeHelper.downcallHandle( - "fuse_loop", - constants$1.fuse_loop$FUNC - ); - static final FunctionDescriptor fuse_exit$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_exit$MH = RuntimeHelper.downcallHandle( - "fuse_exit", - constants$1.fuse_exit$FUNC - ); - static final FunctionDescriptor fuse_loop_mt$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse_loop_mt$MH = RuntimeHelper.downcallHandle( - "fuse_loop_mt", - constants$1.fuse_loop_mt$FUNC - ); -} - - diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/RuntimeHelper.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/RuntimeHelper.java similarity index 88% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/RuntimeHelper.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/RuntimeHelper.java index dd2e6580..2eec54fb 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/RuntimeHelper.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/RuntimeHelper.java @@ -1,4 +1,4 @@ -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.errno; // Generated by jextract import java.lang.foreign.Linker; @@ -7,7 +7,7 @@ import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; +import java.lang.foreign.Arena; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -20,6 +20,9 @@ import java.util.Optional; import java.util.stream.Stream; +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + import static java.lang.foreign.Linker.*; import static java.lang.foreign.ValueLayout.*; @@ -30,9 +33,10 @@ final class RuntimeHelper { private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); private static final SymbolLookup SYMBOL_LOOKUP; private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); + (size, align) -> Arena.ofAuto().allocate(size, align); static { @@ -51,7 +55,9 @@ static T requireNonNull(T obj, String symbolName) { } static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); } static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { @@ -70,18 +76,25 @@ static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc orElse(null); } - static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); - handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, scope); + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { - return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); } // Internals only below this point diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/constants$0.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/constants$0.java new file mode 100644 index 00000000..8aaaa0a5 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.errno; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno_h.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/errno_h.java similarity index 78% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno_h.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/errno_h.java index dfddf79e..bf71ae55 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno_h.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/errno/errno_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.errno; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define ENOENT 2 @@ -145,6 +145,14 @@ public static int ENOLCK() { public static int ENOSYS() { return (int)78L; } + /** + * {@snippet : + * #define ENODATA 96 + * } + */ + public static int ENODATA() { + return (int)96L; + } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/RuntimeHelper.java similarity index 88% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/RuntimeHelper.java index 4519d7b5..8a8de728 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/RuntimeHelper.java @@ -1,4 +1,4 @@ -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.mac.extr.fcntl; // Generated by jextract import java.lang.foreign.Linker; @@ -7,7 +7,7 @@ import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; +import java.lang.foreign.Arena; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -20,6 +20,9 @@ import java.util.Optional; import java.util.stream.Stream; +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + import static java.lang.foreign.Linker.*; import static java.lang.foreign.ValueLayout.*; @@ -30,9 +33,10 @@ final class RuntimeHelper { private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); private static final SymbolLookup SYMBOL_LOOKUP; private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); + (size, align) -> Arena.ofAuto().allocate(size, align); static { @@ -51,7 +55,9 @@ static T requireNonNull(T obj, String symbolName) { } static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); } static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { @@ -70,18 +76,25 @@ static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc orElse(null); } - static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); - handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, scope); + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { - return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); } // Internals only below this point diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/constants$0.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/constants$0.java new file mode 100644 index 00000000..9948108a --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fcntl; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl_h.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/fcntl_h.java similarity index 69% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl_h.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/fcntl_h.java index 85723847..30498529 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl_h.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fcntl/fcntl_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fcntl; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define O_RDONLY 0 diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/RuntimeHelper.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/RuntimeHelper.java similarity index 88% rename from jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/RuntimeHelper.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/RuntimeHelper.java index 70bb6da0..7ae43fa5 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/RuntimeHelper.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/RuntimeHelper.java @@ -1,4 +1,4 @@ -package org.cryptomator.jfuse.linux.amd64.extr; +package org.cryptomator.jfuse.mac.extr.fuse; // Generated by jextract import java.lang.foreign.Linker; @@ -7,7 +7,7 @@ import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; +import java.lang.foreign.Arena; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -20,6 +20,9 @@ import java.util.Optional; import java.util.stream.Stream; +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + import static java.lang.foreign.Linker.*; import static java.lang.foreign.ValueLayout.*; @@ -30,9 +33,10 @@ final class RuntimeHelper { private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); private static final SymbolLookup SYMBOL_LOOKUP; private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); + (size, align) -> Arena.ofAuto().allocate(size, align); static { @@ -51,7 +55,9 @@ static T requireNonNull(T obj, String symbolName) { } static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); } static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { @@ -70,18 +76,25 @@ static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc orElse(null); } - static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); - handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, scope); + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { - return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); } // Internals only below this point diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$0.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$0.java new file mode 100644 index 00000000..77c67a8c --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$0.java @@ -0,0 +1,36 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("argc"), + MemoryLayout.paddingLayout(4), + RuntimeHelper.POINTER.withName("argv"), + JAVA_INT.withName("allocated"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_args"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argc")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argv")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("allocated")); + static final StructLayout const$4 = MemoryLayout.structLayout( + JAVA_INT.withName("flags"), + MemoryLayout.paddingLayout(4), + JAVA_LONG.withName("fh_old"), + JAVA_INT.withName("writepage"), + MemoryLayout.paddingLayout(4), + JAVA_LONG.withName("fh"), + JAVA_LONG.withName("lock_owner") + ).withName("fuse_file_info"); + static final VarHandle const$5 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("flags")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$1.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$1.java new file mode 100644 index 00000000..b3ff4be3 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$1.java @@ -0,0 +1,33 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final VarHandle const$0 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("fh_old")); + static final VarHandle const$1 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("writepage")); + static final VarHandle const$2 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("fh")); + static final VarHandle const$3 = constants$0.const$4.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); + static final StructLayout const$4 = MemoryLayout.structLayout( + JAVA_INT.withName("proto_major"), + JAVA_INT.withName("proto_minor"), + JAVA_INT.withName("async_read"), + JAVA_INT.withName("max_write"), + JAVA_INT.withName("max_readahead"), + JAVA_INT.withName("capable"), + JAVA_INT.withName("want"), + JAVA_INT.withName("max_background"), + JAVA_INT.withName("congestion_threshold"), + MemoryLayout.sequenceLayout(23, JAVA_INT).withName("reserved") + ).withName("fuse_conn_info"); + static final VarHandle const$5 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$10.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$10.java new file mode 100644 index 00000000..5e63fdd9 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$10.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$10 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$10() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.getattr.class, "apply", constants$9.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$9.const$5 + ); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("getattr")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.readlink.class, "apply", constants$10.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$10.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$11.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$11.java new file mode 100644 index 00000000..c24cadc0 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$11.java @@ -0,0 +1,32 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$11 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$11() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("readlink")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.getdir.class, "apply", constants$11.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$11.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("getdir")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_SHORT, + JAVA_INT + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$12.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$12.java new file mode 100644 index 00000000..b5d4e837 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$12.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$12 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$12() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.mknod.class, "apply", constants$11.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$11.const$5 + ); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("mknod")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_SHORT + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.mkdir.class, "apply", constants$12.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$12.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$13.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$13.java new file mode 100644 index 00000000..0ee2a864 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$13.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$13 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$13() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.unlink.class, "apply", constants$13.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$13.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("unlink")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.rmdir.class, "apply", constants$13.const$1); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$14.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$14.java new file mode 100644 index 00000000..27f688af --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$14.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$14 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$14() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.symlink.class, "apply", constants$9.const$5); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("symlink")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.rename.class, "apply", constants$9.const$5); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("rename")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.link.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$15.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$15.java new file mode 100644 index 00000000..2f782098 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$15.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$15 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$15() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("link")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.chmod.class, "apply", constants$12.const$3); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("chmod")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_INT + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.chown.class, "apply", constants$15.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$15.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$16.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$16.java new file mode 100644 index 00000000..fb649ce0 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$16.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$16 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$16() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("chown")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.truncate.class, "apply", constants$16.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$16.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("truncate")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.utime.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$17.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$17.java new file mode 100644 index 00000000..a4b8e806 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$17.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$17 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$17() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("utime")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.open.class, "apply", constants$9.const$5); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("open")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.read.class, "apply", constants$17.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$17.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$18.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$18.java new file mode 100644 index 00000000..b4e353f3 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$18.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$18 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$18() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("read")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.write.class, "apply", constants$17.const$3); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("write")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.statfs.class, "apply", constants$9.const$5); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("statfs")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.flush.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$19.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$19.java new file mode 100644 index 00000000..51298c39 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$19.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$19 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$19() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("flush")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.release.class, "apply", constants$9.const$5); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("release")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.fsync.class, "apply", constants$19.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$19.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$2.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$2.java new file mode 100644 index 00000000..c899ac48 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$2.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$2 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$2() {} + static final VarHandle const$0 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); + static final VarHandle const$1 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("async_read")); + static final VarHandle const$2 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_write")); + static final VarHandle const$3 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); + static final VarHandle const$4 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("capable")); + static final VarHandle const$5 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("want")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$20.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$20.java new file mode 100644 index 00000000..75406c12 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$20.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$20 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$20() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("fsync")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_INT + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.setxattr.class, "apply", constants$20.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$20.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.getxattr.class, "apply", constants$9.const$1); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$21.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$21.java new file mode 100644 index 00000000..449b9791 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$21.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$21 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$21() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.listxattr.class, "apply", constants$10.const$3); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.removexattr.class, "apply", constants$9.const$5); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.opendir.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$22.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$22.java new file mode 100644 index 00000000..9a077192 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$22.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$22 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$22() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("opendir")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.readdir.class, "apply", constants$22.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$22.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("readdir")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.releasedir.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$23.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$23.java new file mode 100644 index 00000000..fe6b26b0 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$23.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$23 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$23() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.fsyncdir.class, "apply", constants$19.const$3); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.init.class, "apply", constants$23.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$23.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$24.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$24.java new file mode 100644 index 00000000..81b7ae76 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$24.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$24 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$24() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("init")); + static final FunctionDescriptor const$1 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.destroy.class, "apply", constants$24.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$24.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("destroy")); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$25.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$25.java new file mode 100644 index 00000000..b98e3493 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$25.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$25 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$25() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse_operations.access.class, "apply", constants$24.const$5); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + constants$24.const$5 + ); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("access")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_SHORT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.create.class, "apply", constants$25.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$25.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$26.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$26.java new file mode 100644 index 00000000..daebe13a --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$26.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$26 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$26() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("create")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.ftruncate.class, "apply", constants$26.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$26.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("ftruncate")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.fgetattr.class, "apply", constants$11.const$1); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$27.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$27.java new file mode 100644 index 00000000..83f4e9eb --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$27.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$27 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$27() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("fgetattr")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.lock.class, "apply", constants$27.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$27.const$1 + ); + static final VarHandle const$4 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("lock")); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.utimens.class, "apply", constants$9.const$5); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$28.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$28.java new file mode 100644 index 00000000..2d23c879 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$28.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$28 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$28() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("utimens")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.bmap.class, "apply", constants$26.const$1); + static final VarHandle const$2 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("bmap")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse_operations.ioctl.class, "apply", constants$28.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$28.const$3 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$29.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$29.java new file mode 100644 index 00000000..03131b7b --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$29.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$29 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$29() {} + static final VarHandle const$0 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse_operations.poll.class, "apply", constants$4.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$4.const$0 + ); + static final VarHandle const$3 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("poll")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.write_buf.class, "apply", constants$29.const$4); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$3.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$3.java new file mode 100644 index 00000000..5727f9da --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$3.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$3 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$3() {} + static final VarHandle const$0 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_background")); + static final VarHandle const$1 = constants$1.const$4.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_mount", + constants$3.const$2 + ); + static final FunctionDescriptor const$4 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_unmount", + constants$3.const$4 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$30.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$30.java new file mode 100644 index 00000000..a4ca5553 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$30.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$30 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$30() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$29.const$4 + ); + static final VarHandle const$1 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_operations.read_buf.class, "apply", constants$17.const$3); + static final VarHandle const$3 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse_operations.flock.class, "apply", constants$30.const$4); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$31.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$31.java new file mode 100644 index 00000000..c5558141 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$31.java @@ -0,0 +1,32 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$31 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$31() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$30.const$4 + ); + static final VarHandle const$1 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("flock")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse_operations.fallocate.class, "apply", constants$31.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$31.const$2 + ); + static final VarHandle const$5 = constants$9.const$4.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$32.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$32.java new file mode 100644 index 00000000..8cb30bd0 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$32.java @@ -0,0 +1,43 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$32 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$32() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_new", + constants$32.const$0 + ); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + "fuse_destroy", + constants$24.const$1 + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse_loop", + constants$13.const$1 + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse_exit", + constants$24.const$1 + ); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse_loop_mt", + constants$13.const$1 + ); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$4.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$4.java new file mode 100644 index 00000000..1320e1df --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$4.java @@ -0,0 +1,65 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$4 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$4() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse_parse_cmdline", + constants$4.const$0 + ); + static final StructLayout const$2 = MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("timespec"); + static final VarHandle const$3 = constants$4.const$2.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); + static final VarHandle const$4 = constants$4.const$2.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); + static final StructLayout const$5 = MemoryLayout.structLayout( + JAVA_INT.withName("st_dev"), + JAVA_SHORT.withName("st_mode"), + JAVA_SHORT.withName("st_nlink"), + JAVA_LONG.withName("st_ino"), + JAVA_INT.withName("st_uid"), + JAVA_INT.withName("st_gid"), + JAVA_INT.withName("st_rdev"), + MemoryLayout.paddingLayout(4), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_atimespec"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_mtimespec"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_ctimespec"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_birthtimespec"), + JAVA_LONG.withName("st_size"), + JAVA_LONG.withName("st_blocks"), + JAVA_INT.withName("st_blksize"), + JAVA_INT.withName("st_flags"), + JAVA_INT.withName("st_gen"), + JAVA_INT.withName("st_lspare"), + MemoryLayout.sequenceLayout(2, JAVA_LONG).withName("st_qspare") + ).withName("stat"); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$5.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$5.java new file mode 100644 index 00000000..b443e181 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$5.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$5 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$5() {} + static final VarHandle const$0 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); + static final VarHandle const$1 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); + static final VarHandle const$2 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); + static final VarHandle const$3 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); + static final VarHandle const$4 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); + static final VarHandle const$5 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$6.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$6.java new file mode 100644 index 00000000..2512b58e --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$6.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$6 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$6() {} + static final VarHandle const$0 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); + static final VarHandle const$1 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_size")); + static final VarHandle const$2 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); + static final VarHandle const$3 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); + static final VarHandle const$4 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_flags")); + static final VarHandle const$5 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_gen")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$7.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$7.java new file mode 100644 index 00000000..e3688f85 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$7.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$7 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$7() {} + static final VarHandle const$0 = constants$4.const$5.varHandle(MemoryLayout.PathElement.groupElement("st_lspare")); + static final StructLayout const$1 = MemoryLayout.structLayout( + JAVA_LONG.withName("f_bsize"), + JAVA_LONG.withName("f_frsize"), + JAVA_INT.withName("f_blocks"), + JAVA_INT.withName("f_bfree"), + JAVA_INT.withName("f_bavail"), + JAVA_INT.withName("f_files"), + JAVA_INT.withName("f_ffree"), + JAVA_INT.withName("f_favail"), + JAVA_LONG.withName("f_fsid"), + JAVA_LONG.withName("f_flag"), + JAVA_LONG.withName("f_namemax") + ).withName("statvfs"); + static final VarHandle const$2 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); + static final VarHandle const$3 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); + static final VarHandle const$4 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); + static final VarHandle const$5 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$8.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$8.java new file mode 100644 index 00000000..da5ccfd7 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$8.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$8 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$8() {} + static final VarHandle const$0 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); + static final VarHandle const$1 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_files")); + static final VarHandle const$2 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); + static final VarHandle const$3 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); + static final VarHandle const$4 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); + static final VarHandle const$5 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$9.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$9.java new file mode 100644 index 00000000..a417567b --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/constants$9.java @@ -0,0 +1,78 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$9 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$9() {} + static final VarHandle const$0 = constants$7.const$1.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); + static final FunctionDescriptor const$1 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse_fill_dir_t.class, "apply", constants$9.const$1); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + constants$9.const$1 + ); + static final StructLayout const$4 = MemoryLayout.structLayout( + RuntimeHelper.POINTER.withName("getattr"), + RuntimeHelper.POINTER.withName("readlink"), + RuntimeHelper.POINTER.withName("getdir"), + RuntimeHelper.POINTER.withName("mknod"), + RuntimeHelper.POINTER.withName("mkdir"), + RuntimeHelper.POINTER.withName("unlink"), + RuntimeHelper.POINTER.withName("rmdir"), + RuntimeHelper.POINTER.withName("symlink"), + RuntimeHelper.POINTER.withName("rename"), + RuntimeHelper.POINTER.withName("link"), + RuntimeHelper.POINTER.withName("chmod"), + RuntimeHelper.POINTER.withName("chown"), + RuntimeHelper.POINTER.withName("truncate"), + RuntimeHelper.POINTER.withName("utime"), + RuntimeHelper.POINTER.withName("open"), + RuntimeHelper.POINTER.withName("read"), + RuntimeHelper.POINTER.withName("write"), + RuntimeHelper.POINTER.withName("statfs"), + RuntimeHelper.POINTER.withName("flush"), + RuntimeHelper.POINTER.withName("release"), + RuntimeHelper.POINTER.withName("fsync"), + RuntimeHelper.POINTER.withName("setxattr"), + RuntimeHelper.POINTER.withName("getxattr"), + RuntimeHelper.POINTER.withName("listxattr"), + RuntimeHelper.POINTER.withName("removexattr"), + RuntimeHelper.POINTER.withName("opendir"), + RuntimeHelper.POINTER.withName("readdir"), + RuntimeHelper.POINTER.withName("releasedir"), + RuntimeHelper.POINTER.withName("fsyncdir"), + RuntimeHelper.POINTER.withName("init"), + RuntimeHelper.POINTER.withName("destroy"), + RuntimeHelper.POINTER.withName("access"), + RuntimeHelper.POINTER.withName("create"), + RuntimeHelper.POINTER.withName("ftruncate"), + RuntimeHelper.POINTER.withName("fgetattr"), + RuntimeHelper.POINTER.withName("lock"), + RuntimeHelper.POINTER.withName("utimens"), + RuntimeHelper.POINTER.withName("bmap"), + MemoryLayout.paddingLayout(8), + RuntimeHelper.POINTER.withName("ioctl"), + RuntimeHelper.POINTER.withName("poll"), + RuntimeHelper.POINTER.withName("write_buf"), + RuntimeHelper.POINTER.withName("read_buf"), + RuntimeHelper.POINTER.withName("flock"), + RuntimeHelper.POINTER.withName("fallocate") + ).withName("fuse_operations"); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); +} + + diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_args.java similarity index 56% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_args.java index 97103c5b..73d6241d 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_args.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -18,19 +18,11 @@ */ public class fuse_args { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("argc"), - MemoryLayout.paddingLayout(32), - Constants$root.C_POINTER$LAYOUT.withName("argv"), - Constants$root.C_INT$LAYOUT.withName("allocated"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_args"); public static MemoryLayout $LAYOUT() { - return fuse_args.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle argc$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argc")); public static VarHandle argc$VH() { - return fuse_args.argc$VH; + return constants$0.const$1; } /** * Getter for field: @@ -39,7 +31,7 @@ public class fuse_args { * } */ public static int argc$get(MemorySegment seg) { - return (int)fuse_args.argc$VH.get(seg); + return (int)constants$0.const$1.get(seg); } /** * Setter for field: @@ -48,17 +40,16 @@ public class fuse_args { * } */ public static void argc$set(MemorySegment seg, int x) { - fuse_args.argc$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { - return (int)fuse_args.argc$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void argc$set(MemorySegment seg, long index, int x) { - fuse_args.argc$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle argv$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argv")); public static VarHandle argv$VH() { - return fuse_args.argv$VH; + return constants$0.const$2; } /** * Getter for field: @@ -67,7 +58,7 @@ public class fuse_args { * } */ public static MemorySegment argv$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg); } /** * Setter for field: @@ -76,17 +67,16 @@ public class fuse_args { * } */ public static void argv$set(MemorySegment seg, MemorySegment x) { - fuse_args.argv$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static MemorySegment argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void argv$set(MemorySegment seg, long index, MemorySegment x) { - fuse_args.argv$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle allocated$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("allocated")); public static VarHandle allocated$VH() { - return fuse_args.allocated$VH; + return constants$0.const$3; } /** * Getter for field: @@ -95,7 +85,7 @@ public class fuse_args { * } */ public static int allocated$get(MemorySegment seg) { - return (int)fuse_args.allocated$VH.get(seg); + return (int)constants$0.const$3.get(seg); } /** * Setter for field: @@ -104,20 +94,20 @@ public class fuse_args { * } */ public static void allocated$set(MemorySegment seg, int x) { - fuse_args.allocated$VH.set(seg, x); + constants$0.const$3.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { - return (int)fuse_args.allocated$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$3.get(seg.asSlice(index*sizeof())); } public static void allocated$set(MemorySegment seg, long index, int x) { - fuse_args.allocated$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_conn_info.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_conn_info.java similarity index 55% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_conn_info.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_conn_info.java index 2c5e30d6..306c464d 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_conn_info.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_conn_info.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -25,24 +25,11 @@ */ public class fuse_conn_info { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("proto_major"), - Constants$root.C_INT$LAYOUT.withName("proto_minor"), - Constants$root.C_INT$LAYOUT.withName("async_read"), - Constants$root.C_INT$LAYOUT.withName("max_write"), - Constants$root.C_INT$LAYOUT.withName("max_readahead"), - Constants$root.C_INT$LAYOUT.withName("capable"), - Constants$root.C_INT$LAYOUT.withName("want"), - Constants$root.C_INT$LAYOUT.withName("max_background"), - Constants$root.C_INT$LAYOUT.withName("congestion_threshold"), - MemoryLayout.sequenceLayout(23, Constants$root.C_INT$LAYOUT).withName("reserved") - ).withName("fuse_conn_info"); public static MemoryLayout $LAYOUT() { - return fuse_conn_info.$struct$LAYOUT; + return constants$1.const$4; } - static final VarHandle proto_major$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); public static VarHandle proto_major$VH() { - return fuse_conn_info.proto_major$VH; + return constants$1.const$5; } /** * Getter for field: @@ -51,7 +38,7 @@ public class fuse_conn_info { * } */ public static int proto_major$get(MemorySegment seg) { - return (int)fuse_conn_info.proto_major$VH.get(seg); + return (int)constants$1.const$5.get(seg); } /** * Setter for field: @@ -60,17 +47,16 @@ public class fuse_conn_info { * } */ public static void proto_major$set(MemorySegment seg, int x) { - fuse_conn_info.proto_major$VH.set(seg, x); + constants$1.const$5.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.proto_major$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$5.get(seg.asSlice(index*sizeof())); } public static void proto_major$set(MemorySegment seg, long index, int x) { - fuse_conn_info.proto_major$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle proto_minor$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); public static VarHandle proto_minor$VH() { - return fuse_conn_info.proto_minor$VH; + return constants$2.const$0; } /** * Getter for field: @@ -79,7 +65,7 @@ public class fuse_conn_info { * } */ public static int proto_minor$get(MemorySegment seg) { - return (int)fuse_conn_info.proto_minor$VH.get(seg); + return (int)constants$2.const$0.get(seg); } /** * Setter for field: @@ -88,17 +74,16 @@ public class fuse_conn_info { * } */ public static void proto_minor$set(MemorySegment seg, int x) { - fuse_conn_info.proto_minor$VH.set(seg, x); + constants$2.const$0.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.proto_minor$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$0.get(seg.asSlice(index*sizeof())); } public static void proto_minor$set(MemorySegment seg, long index, int x) { - fuse_conn_info.proto_minor$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle async_read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("async_read")); public static VarHandle async_read$VH() { - return fuse_conn_info.async_read$VH; + return constants$2.const$1; } /** * Getter for field: @@ -107,7 +92,7 @@ public class fuse_conn_info { * } */ public static int async_read$get(MemorySegment seg) { - return (int)fuse_conn_info.async_read$VH.get(seg); + return (int)constants$2.const$1.get(seg); } /** * Setter for field: @@ -116,17 +101,16 @@ public class fuse_conn_info { * } */ public static void async_read$set(MemorySegment seg, int x) { - fuse_conn_info.async_read$VH.set(seg, x); + constants$2.const$1.set(seg, x); } public static int async_read$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.async_read$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$1.get(seg.asSlice(index*sizeof())); } public static void async_read$set(MemorySegment seg, long index, int x) { - fuse_conn_info.async_read$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_write")); public static VarHandle max_write$VH() { - return fuse_conn_info.max_write$VH; + return constants$2.const$2; } /** * Getter for field: @@ -135,7 +119,7 @@ public class fuse_conn_info { * } */ public static int max_write$get(MemorySegment seg) { - return (int)fuse_conn_info.max_write$VH.get(seg); + return (int)constants$2.const$2.get(seg); } /** * Setter for field: @@ -144,17 +128,16 @@ public class fuse_conn_info { * } */ public static void max_write$set(MemorySegment seg, int x) { - fuse_conn_info.max_write$VH.set(seg, x); + constants$2.const$2.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_write$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$2.get(seg.asSlice(index*sizeof())); } public static void max_write$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_write$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_readahead$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); public static VarHandle max_readahead$VH() { - return fuse_conn_info.max_readahead$VH; + return constants$2.const$3; } /** * Getter for field: @@ -163,7 +146,7 @@ public class fuse_conn_info { * } */ public static int max_readahead$get(MemorySegment seg) { - return (int)fuse_conn_info.max_readahead$VH.get(seg); + return (int)constants$2.const$3.get(seg); } /** * Setter for field: @@ -172,17 +155,16 @@ public class fuse_conn_info { * } */ public static void max_readahead$set(MemorySegment seg, int x) { - fuse_conn_info.max_readahead$VH.set(seg, x); + constants$2.const$3.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_readahead$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$3.get(seg.asSlice(index*sizeof())); } public static void max_readahead$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_readahead$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle capable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("capable")); public static VarHandle capable$VH() { - return fuse_conn_info.capable$VH; + return constants$2.const$4; } /** * Getter for field: @@ -191,7 +173,7 @@ public class fuse_conn_info { * } */ public static int capable$get(MemorySegment seg) { - return (int)fuse_conn_info.capable$VH.get(seg); + return (int)constants$2.const$4.get(seg); } /** * Setter for field: @@ -200,17 +182,16 @@ public class fuse_conn_info { * } */ public static void capable$set(MemorySegment seg, int x) { - fuse_conn_info.capable$VH.set(seg, x); + constants$2.const$4.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.capable$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$4.get(seg.asSlice(index*sizeof())); } public static void capable$set(MemorySegment seg, long index, int x) { - fuse_conn_info.capable$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle want$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("want")); public static VarHandle want$VH() { - return fuse_conn_info.want$VH; + return constants$2.const$5; } /** * Getter for field: @@ -219,7 +200,7 @@ public class fuse_conn_info { * } */ public static int want$get(MemorySegment seg) { - return (int)fuse_conn_info.want$VH.get(seg); + return (int)constants$2.const$5.get(seg); } /** * Setter for field: @@ -228,17 +209,16 @@ public class fuse_conn_info { * } */ public static void want$set(MemorySegment seg, int x) { - fuse_conn_info.want$VH.set(seg, x); + constants$2.const$5.set(seg, x); } public static int want$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.want$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$5.get(seg.asSlice(index*sizeof())); } public static void want$set(MemorySegment seg, long index, int x) { - fuse_conn_info.want$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_background$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_background")); public static VarHandle max_background$VH() { - return fuse_conn_info.max_background$VH; + return constants$3.const$0; } /** * Getter for field: @@ -247,7 +227,7 @@ public class fuse_conn_info { * } */ public static int max_background$get(MemorySegment seg) { - return (int)fuse_conn_info.max_background$VH.get(seg); + return (int)constants$3.const$0.get(seg); } /** * Setter for field: @@ -256,17 +236,16 @@ public class fuse_conn_info { * } */ public static void max_background$set(MemorySegment seg, int x) { - fuse_conn_info.max_background$VH.set(seg, x); + constants$3.const$0.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.max_background$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$0.get(seg.asSlice(index*sizeof())); } public static void max_background$set(MemorySegment seg, long index, int x) { - fuse_conn_info.max_background$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle congestion_threshold$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); public static VarHandle congestion_threshold$VH() { - return fuse_conn_info.congestion_threshold$VH; + return constants$3.const$1; } /** * Getter for field: @@ -275,7 +254,7 @@ public class fuse_conn_info { * } */ public static int congestion_threshold$get(MemorySegment seg) { - return (int)fuse_conn_info.congestion_threshold$VH.get(seg); + return (int)constants$3.const$1.get(seg); } /** * Setter for field: @@ -284,13 +263,13 @@ public class fuse_conn_info { * } */ public static void congestion_threshold$set(MemorySegment seg, int x) { - fuse_conn_info.congestion_threshold$VH.set(seg, x); + constants$3.const$1.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { - return (int)fuse_conn_info.congestion_threshold$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$3.const$1.get(seg.asSlice(index*sizeof())); } public static void congestion_threshold$set(MemorySegment seg, long index, int x) { - fuse_conn_info.congestion_threshold$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$1.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment reserved$slice(MemorySegment seg) { return seg.asSlice(36, 92); @@ -300,7 +279,7 @@ public class fuse_conn_info { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_file_info.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_file_info.java similarity index 53% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_file_info.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_file_info.java index bdea7ac3..7252af4f 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_file_info.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_file_info.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,28 +26,11 @@ */ public class fuse_file_info { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("flags"), - MemoryLayout.paddingLayout(32), - Constants$root.C_LONG_LONG$LAYOUT.withName("fh_old"), - Constants$root.C_INT$LAYOUT.withName("writepage"), - MemoryLayout.structLayout( - MemoryLayout.paddingLayout(1).withName("direct_io"), - MemoryLayout.paddingLayout(1).withName("keep_cache"), - MemoryLayout.paddingLayout(1).withName("flush"), - MemoryLayout.paddingLayout(1).withName("nonseekable"), - MemoryLayout.paddingLayout(1).withName("flock_release"), - MemoryLayout.paddingLayout(27).withName("padding") - ), - Constants$root.C_LONG_LONG$LAYOUT.withName("fh"), - Constants$root.C_LONG_LONG$LAYOUT.withName("lock_owner") - ).withName("fuse_file_info"); public static MemoryLayout $LAYOUT() { - return fuse_file_info.$struct$LAYOUT; + return constants$0.const$4; } - static final VarHandle flags$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flags")); public static VarHandle flags$VH() { - return fuse_file_info.flags$VH; + return constants$0.const$5; } /** * Getter for field: @@ -56,7 +39,7 @@ public class fuse_file_info { * } */ public static int flags$get(MemorySegment seg) { - return (int)fuse_file_info.flags$VH.get(seg); + return (int)constants$0.const$5.get(seg); } /** * Setter for field: @@ -65,17 +48,16 @@ public class fuse_file_info { * } */ public static void flags$set(MemorySegment seg, int x) { - fuse_file_info.flags$VH.set(seg, x); + constants$0.const$5.set(seg, x); } public static int flags$get(MemorySegment seg, long index) { - return (int)fuse_file_info.flags$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$5.get(seg.asSlice(index*sizeof())); } public static void flags$set(MemorySegment seg, long index, int x) { - fuse_file_info.flags$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle fh_old$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fh_old")); public static VarHandle fh_old$VH() { - return fuse_file_info.fh_old$VH; + return constants$1.const$0; } /** * Getter for field: @@ -84,7 +66,7 @@ public class fuse_file_info { * } */ public static long fh_old$get(MemorySegment seg) { - return (long)fuse_file_info.fh_old$VH.get(seg); + return (long)constants$1.const$0.get(seg); } /** * Setter for field: @@ -93,17 +75,16 @@ public class fuse_file_info { * } */ public static void fh_old$set(MemorySegment seg, long x) { - fuse_file_info.fh_old$VH.set(seg, x); + constants$1.const$0.set(seg, x); } public static long fh_old$get(MemorySegment seg, long index) { - return (long)fuse_file_info.fh_old$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$1.const$0.get(seg.asSlice(index*sizeof())); } public static void fh_old$set(MemorySegment seg, long index, long x) { - fuse_file_info.fh_old$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle writepage$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("writepage")); public static VarHandle writepage$VH() { - return fuse_file_info.writepage$VH; + return constants$1.const$1; } /** * Getter for field: @@ -112,7 +93,7 @@ public class fuse_file_info { * } */ public static int writepage$get(MemorySegment seg) { - return (int)fuse_file_info.writepage$VH.get(seg); + return (int)constants$1.const$1.get(seg); } /** * Setter for field: @@ -121,17 +102,16 @@ public class fuse_file_info { * } */ public static void writepage$set(MemorySegment seg, int x) { - fuse_file_info.writepage$VH.set(seg, x); + constants$1.const$1.set(seg, x); } public static int writepage$get(MemorySegment seg, long index) { - return (int)fuse_file_info.writepage$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$1.get(seg.asSlice(index*sizeof())); } public static void writepage$set(MemorySegment seg, long index, int x) { - fuse_file_info.writepage$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle fh$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fh")); public static VarHandle fh$VH() { - return fuse_file_info.fh$VH; + return constants$1.const$2; } /** * Getter for field: @@ -140,7 +120,7 @@ public class fuse_file_info { * } */ public static long fh$get(MemorySegment seg) { - return (long)fuse_file_info.fh$VH.get(seg); + return (long)constants$1.const$2.get(seg); } /** * Setter for field: @@ -149,17 +129,16 @@ public class fuse_file_info { * } */ public static void fh$set(MemorySegment seg, long x) { - fuse_file_info.fh$VH.set(seg, x); + constants$1.const$2.set(seg, x); } public static long fh$get(MemorySegment seg, long index) { - return (long)fuse_file_info.fh$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$1.const$2.get(seg.asSlice(index*sizeof())); } public static void fh$set(MemorySegment seg, long index, long x) { - fuse_file_info.fh$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle lock_owner$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); public static VarHandle lock_owner$VH() { - return fuse_file_info.lock_owner$VH; + return constants$1.const$3; } /** * Getter for field: @@ -168,7 +147,7 @@ public class fuse_file_info { * } */ public static long lock_owner$get(MemorySegment seg) { - return (long)fuse_file_info.lock_owner$VH.get(seg); + return (long)constants$1.const$3.get(seg); } /** * Setter for field: @@ -177,20 +156,20 @@ public class fuse_file_info { * } */ public static void lock_owner$set(MemorySegment seg, long x) { - fuse_file_info.lock_owner$VH.set(seg, x); + constants$1.const$3.set(seg, x); } public static long lock_owner$get(MemorySegment seg, long index) { - return (long)fuse_file_info.lock_owner$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$1.const$3.get(seg.asSlice(index*sizeof())); } public static void lock_owner$set(MemorySegment seg, long index, long x) { - fuse_file_info.lock_owner$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_fill_dir_t.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_fill_dir_t.java similarity index 62% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_fill_dir_t.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_fill_dir_t.java index ddcc1b05..be068f64 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_fill_dir_t.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_fill_dir_t.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -15,14 +15,14 @@ public interface fuse_fill_dir_t { int apply(java.lang.foreign.MemorySegment buf, java.lang.foreign.MemorySegment name, java.lang.foreign.MemorySegment stbuf, long off); - static MemorySegment allocate(fuse_fill_dir_t fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fuse_fill_dir_t.class, fi, constants$0.fuse_fill_dir_t$FUNC, scope); + static MemorySegment allocate(fuse_fill_dir_t fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$9.const$2, fi, constants$9.const$1, scope); } - static fuse_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + static fuse_fill_dir_t ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); return (java.lang.foreign.MemorySegment _buf, java.lang.foreign.MemorySegment _name, java.lang.foreign.MemorySegment _stbuf, long _off) -> { try { - return (int)constants$0.fuse_fill_dir_t$MH.invokeExact(symbol, _buf, _name, _stbuf, _off); + return (int)constants$9.const$3.invokeExact(symbol, _buf, _name, _stbuf, _off); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_h.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_h.java similarity index 75% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_h.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_h.java index 45a04638..85ac08c4 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_h.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,16 +9,16 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; public static MethodHandle fuse_mount$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_mount$MH,"fuse_mount"); + return RuntimeHelper.requireNonNull(constants$3.const$3,"fuse_mount"); } /** * {@snippet : @@ -34,7 +34,7 @@ public static MemorySegment fuse_mount(MemorySegment mountpoint, MemorySegment a } } public static MethodHandle fuse_unmount$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_unmount$MH,"fuse_unmount"); + return RuntimeHelper.requireNonNull(constants$3.const$5,"fuse_unmount"); } /** * {@snippet : @@ -50,7 +50,7 @@ public static void fuse_unmount(MemorySegment mountpoint, MemorySegment ch) { } } public static MethodHandle fuse_parse_cmdline$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_parse_cmdline$MH,"fuse_parse_cmdline"); + return RuntimeHelper.requireNonNull(constants$4.const$1,"fuse_parse_cmdline"); } /** * {@snippet : @@ -66,7 +66,7 @@ public static int fuse_parse_cmdline(MemorySegment args, MemorySegment mountpoin } } public static MethodHandle fuse_new$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_new$MH,"fuse_new"); + return RuntimeHelper.requireNonNull(constants$32.const$1,"fuse_new"); } /** * {@snippet : @@ -82,7 +82,7 @@ public static MemorySegment fuse_new(MemorySegment ch, MemorySegment args, Memor } } public static MethodHandle fuse_destroy$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_destroy$MH,"fuse_destroy"); + return RuntimeHelper.requireNonNull(constants$32.const$2,"fuse_destroy"); } /** * {@snippet : @@ -98,7 +98,7 @@ public static void fuse_destroy(MemorySegment f) { } } public static MethodHandle fuse_loop$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_loop$MH,"fuse_loop"); + return RuntimeHelper.requireNonNull(constants$32.const$3,"fuse_loop"); } /** * {@snippet : @@ -114,7 +114,7 @@ public static int fuse_loop(MemorySegment f) { } } public static MethodHandle fuse_exit$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_exit$MH,"fuse_exit"); + return RuntimeHelper.requireNonNull(constants$32.const$4,"fuse_exit"); } /** * {@snippet : @@ -130,7 +130,7 @@ public static void fuse_exit(MemorySegment f) { } } public static MethodHandle fuse_loop_mt$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse_loop_mt$MH,"fuse_loop_mt"); + return RuntimeHelper.requireNonNull(constants$32.const$5,"fuse_loop_mt"); } /** * {@snippet : diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_operations.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_operations.java new file mode 100644 index 00000000..999ba4ec --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/fuse_operations.java @@ -0,0 +1,2409 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.fuse; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_operations { + * int (*getattr)(char*,struct stat*); + * int (*readlink)(char*,char*,size_t); + * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); + * int (*mknod)(char*,mode_t,dev_t); + * int (*mkdir)(char*,mode_t); + * int (*unlink)(char*); + * int (*rmdir)(char*); + * int (*symlink)(char*,char*); + * int (*rename)(char*,char*); + * int (*link)(char*,char*); + * int (*chmod)(char*,mode_t); + * int (*chown)(char*,uid_t,gid_t); + * int (*truncate)(char*,off_t); + * int (*utime)(char*,struct utimbuf*); + * int (*open)(char*,struct fuse_file_info*); + * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); + * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); + * int (*statfs)(char*,struct statvfs*); + * int (*flush)(char*,struct fuse_file_info*); + * int (*release)(char*,struct fuse_file_info*); + * int (*fsync)(char*,int,struct fuse_file_info*); + * int (*setxattr)(char*,char*,char*,size_t,int); + * int (*getxattr)(char*,char*,char*,size_t); + * int (*listxattr)(char*,char*,size_t); + * int (*removexattr)(char*,char*); + * int (*opendir)(char*,struct fuse_file_info*); + * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); + * int (*releasedir)(char*,struct fuse_file_info*); + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * void* (*init)(struct fuse_conn_info*); + * void (*destroy)(void*); + * int (*access)(char*,int); + * int (*create)(char*,mode_t,struct fuse_file_info*); + * int (*ftruncate)(char*,off_t,struct fuse_file_info*); + * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * int (*utimens)(char*,struct timespec*); + * int (*bmap)(char*,size_t,uint64_t*); + * * unsigned int flag_nullpath_ok; + * unsigned int flag_nopath; + * unsigned int flag_utime_omit_ok; + * unsigned int flag_reserved; + * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); + * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); + * int (*flock)(char*,struct fuse_file_info*,int); + * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); + * }; + * } + */ +public class fuse_operations { + + public static MemoryLayout $LAYOUT() { + return constants$9.const$4; + } + /** + * {@snippet : + * int (*getattr)(char*,struct stat*); + * } + */ + public interface getattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(getattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$10.const$0, fi, constants$9.const$5, scope); + } + static getattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getattr$VH() { + return constants$10.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*getattr)(char*,struct stat*); + * } + */ + public static MemorySegment getattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$10.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getattr)(char*,struct stat*); + * } + */ + public static void getattr$set(MemorySegment seg, MemorySegment x) { + constants$10.const$2.set(seg, x); + } + public static MemorySegment getattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$10.const$2.get(seg.asSlice(index*sizeof())); + } + public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$10.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static getattr getattr(MemorySegment segment, Arena scope) { + return getattr.ofAddress(getattr$get(segment), scope); + } + /** + * {@snippet : + * int (*readlink)(char*,char*,size_t); + * } + */ + public interface readlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(readlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$10.const$4, fi, constants$10.const$3, scope); + } + static readlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$10.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readlink$VH() { + return constants$11.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*readlink)(char*,char*,size_t); + * } + */ + public static MemorySegment readlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$11.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readlink)(char*,char*,size_t); + * } + */ + public static void readlink$set(MemorySegment seg, MemorySegment x) { + constants$11.const$0.set(seg, x); + } + public static MemorySegment readlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$11.const$0.get(seg.asSlice(index*sizeof())); + } + public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$11.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static readlink readlink(MemorySegment segment, Arena scope) { + return readlink.ofAddress(readlink$get(segment), scope); + } + /** + * {@snippet : + * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); + * } + */ + public interface getdir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(getdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$11.const$2, fi, constants$11.const$1, scope); + } + static getdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$11.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getdir$VH() { + return constants$11.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); + * } + */ + public static MemorySegment getdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$11.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); + * } + */ + public static void getdir$set(MemorySegment seg, MemorySegment x) { + constants$11.const$4.set(seg, x); + } + public static MemorySegment getdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$11.const$4.get(seg.asSlice(index*sizeof())); + } + public static void getdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$11.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static getdir getdir(MemorySegment segment, Arena scope) { + return getdir.ofAddress(getdir$get(segment), scope); + } + /** + * {@snippet : + * int (*mknod)(char*,mode_t,dev_t); + * } + */ + public interface mknod { + + int apply(java.lang.foreign.MemorySegment _x0, short _x1, int _x2); + static MemorySegment allocate(mknod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$12.const$0, fi, constants$11.const$5, scope); + } + static mknod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, short __x1, int __x2) -> { + try { + return (int)constants$12.const$1.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mknod$VH() { + return constants$12.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*mknod)(char*,mode_t,dev_t); + * } + */ + public static MemorySegment mknod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$12.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mknod)(char*,mode_t,dev_t); + * } + */ + public static void mknod$set(MemorySegment seg, MemorySegment x) { + constants$12.const$2.set(seg, x); + } + public static MemorySegment mknod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$12.const$2.get(seg.asSlice(index*sizeof())); + } + public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { + constants$12.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static mknod mknod(MemorySegment segment, Arena scope) { + return mknod.ofAddress(mknod$get(segment), scope); + } + /** + * {@snippet : + * int (*mkdir)(char*,mode_t); + * } + */ + public interface mkdir { + + int apply(java.lang.foreign.MemorySegment _x0, short _x1); + static MemorySegment allocate(mkdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$12.const$4, fi, constants$12.const$3, scope); + } + static mkdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, short __x1) -> { + try { + return (int)constants$12.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mkdir$VH() { + return constants$13.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*mkdir)(char*,mode_t); + * } + */ + public static MemorySegment mkdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$13.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mkdir)(char*,mode_t); + * } + */ + public static void mkdir$set(MemorySegment seg, MemorySegment x) { + constants$13.const$0.set(seg, x); + } + public static MemorySegment mkdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$13.const$0.get(seg.asSlice(index*sizeof())); + } + public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$13.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static mkdir mkdir(MemorySegment segment, Arena scope) { + return mkdir.ofAddress(mkdir$get(segment), scope); + } + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ + public interface unlink { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(unlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$13.const$2, fi, constants$13.const$1, scope); + } + static unlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$13.const$3.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle unlink$VH() { + return constants$13.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static MemorySegment unlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$13.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static void unlink$set(MemorySegment seg, MemorySegment x) { + constants$13.const$4.set(seg, x); + } + public static MemorySegment unlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$13.const$4.get(seg.asSlice(index*sizeof())); + } + public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$13.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static unlink unlink(MemorySegment segment, Arena scope) { + return unlink.ofAddress(unlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public interface rmdir { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(rmdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$13.const$5, fi, constants$13.const$1, scope); + } + static rmdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$13.const$3.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rmdir$VH() { + return constants$14.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static MemorySegment rmdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$14.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static void rmdir$set(MemorySegment seg, MemorySegment x) { + constants$14.const$0.set(seg, x); + } + public static MemorySegment rmdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$14.const$0.get(seg.asSlice(index*sizeof())); + } + public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$14.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static rmdir rmdir(MemorySegment segment, Arena scope) { + return rmdir.ofAddress(rmdir$get(segment), scope); + } + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public interface symlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(symlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$14.const$1, fi, constants$9.const$5, scope); + } + static symlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle symlink$VH() { + return constants$14.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static MemorySegment symlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$14.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static void symlink$set(MemorySegment seg, MemorySegment x) { + constants$14.const$2.set(seg, x); + } + public static MemorySegment symlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$14.const$2.get(seg.asSlice(index*sizeof())); + } + public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$14.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static symlink symlink(MemorySegment segment, Arena scope) { + return symlink.ofAddress(symlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rename)(char*,char*); + * } + */ + public interface rename { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(rename fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$14.const$3, fi, constants$9.const$5, scope); + } + static rename ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rename$VH() { + return constants$14.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*rename)(char*,char*); + * } + */ + public static MemorySegment rename$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$14.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rename)(char*,char*); + * } + */ + public static void rename$set(MemorySegment seg, MemorySegment x) { + constants$14.const$4.set(seg, x); + } + public static MemorySegment rename$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$14.const$4.get(seg.asSlice(index*sizeof())); + } + public static void rename$set(MemorySegment seg, long index, MemorySegment x) { + constants$14.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static rename rename(MemorySegment segment, Arena scope) { + return rename.ofAddress(rename$get(segment), scope); + } + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public interface link { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(link fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$14.const$5, fi, constants$9.const$5, scope); + } + static link ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle link$VH() { + return constants$15.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static MemorySegment link$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$15.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static void link$set(MemorySegment seg, MemorySegment x) { + constants$15.const$0.set(seg, x); + } + public static MemorySegment link$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$15.const$0.get(seg.asSlice(index*sizeof())); + } + public static void link$set(MemorySegment seg, long index, MemorySegment x) { + constants$15.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static link link(MemorySegment segment, Arena scope) { + return link.ofAddress(link$get(segment), scope); + } + /** + * {@snippet : + * int (*chmod)(char*,mode_t); + * } + */ + public interface chmod { + + int apply(java.lang.foreign.MemorySegment _x0, short _x1); + static MemorySegment allocate(chmod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$1, fi, constants$12.const$3, scope); + } + static chmod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, short __x1) -> { + try { + return (int)constants$12.const$5.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chmod$VH() { + return constants$15.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*chmod)(char*,mode_t); + * } + */ + public static MemorySegment chmod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$15.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chmod)(char*,mode_t); + * } + */ + public static void chmod$set(MemorySegment seg, MemorySegment x) { + constants$15.const$2.set(seg, x); + } + public static MemorySegment chmod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$15.const$2.get(seg.asSlice(index*sizeof())); + } + public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { + constants$15.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static chmod chmod(MemorySegment segment, Arena scope) { + return chmod.ofAddress(chmod$get(segment), scope); + } + /** + * {@snippet : + * int (*chown)(char*,uid_t,gid_t); + * } + */ + public interface chown { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2); + static MemorySegment allocate(chown fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$4, fi, constants$15.const$3, scope); + } + static chown ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2) -> { + try { + return (int)constants$15.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chown$VH() { + return constants$16.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*chown)(char*,uid_t,gid_t); + * } + */ + public static MemorySegment chown$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chown)(char*,uid_t,gid_t); + * } + */ + public static void chown$set(MemorySegment seg, MemorySegment x) { + constants$16.const$0.set(seg, x); + } + public static MemorySegment chown$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$0.get(seg.asSlice(index*sizeof())); + } + public static void chown$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static chown chown(MemorySegment segment, Arena scope) { + return chown.ofAddress(chown$get(segment), scope); + } + /** + * {@snippet : + * int (*truncate)(char*,off_t); + * } + */ + public interface truncate { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1); + static MemorySegment allocate(truncate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$16.const$2, fi, constants$16.const$1, scope); + } + static truncate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1) -> { + try { + return (int)constants$16.const$3.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle truncate$VH() { + return constants$16.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*truncate)(char*,off_t); + * } + */ + public static MemorySegment truncate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*truncate)(char*,off_t); + * } + */ + public static void truncate$set(MemorySegment seg, MemorySegment x) { + constants$16.const$4.set(seg, x); + } + public static MemorySegment truncate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$4.get(seg.asSlice(index*sizeof())); + } + public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static truncate truncate(MemorySegment segment, Arena scope) { + return truncate.ofAddress(truncate$get(segment), scope); + } + /** + * {@snippet : + * int (*utime)(char*,struct utimbuf*); + * } + */ + public interface utime { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(utime fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$16.const$5, fi, constants$9.const$5, scope); + } + static utime ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle utime$VH() { + return constants$17.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*utime)(char*,struct utimbuf*); + * } + */ + public static MemorySegment utime$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$17.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*utime)(char*,struct utimbuf*); + * } + */ + public static void utime$set(MemorySegment seg, MemorySegment x) { + constants$17.const$0.set(seg, x); + } + public static MemorySegment utime$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$17.const$0.get(seg.asSlice(index*sizeof())); + } + public static void utime$set(MemorySegment seg, long index, MemorySegment x) { + constants$17.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static utime utime(MemorySegment segment, Arena scope) { + return utime.ofAddress(utime$get(segment), scope); + } + /** + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public interface open { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(open fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$1, fi, constants$9.const$5, scope); + } + static open ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle open$VH() { + return constants$17.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment open$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$17.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*open)(char*,struct fuse_file_info*); + * } + */ + public static void open$set(MemorySegment seg, MemorySegment x) { + constants$17.const$2.set(seg, x); + } + public static MemorySegment open$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$17.const$2.get(seg.asSlice(index*sizeof())); + } + public static void open$set(MemorySegment seg, long index, MemorySegment x) { + constants$17.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static open open(MemorySegment segment, Arena scope) { + return open.ofAddress(open$get(segment), scope); + } + /** + * {@snippet : + * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); + * } + */ + public interface read { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$4, fi, constants$17.const$3, scope); + } + static read ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$17.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read$VH() { + return constants$18.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment read$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); + * } + */ + public static void read$set(MemorySegment seg, MemorySegment x) { + constants$18.const$0.set(seg, x); + } + public static MemorySegment read$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$0.get(seg.asSlice(index*sizeof())); + } + public static void read$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static read read(MemorySegment segment, Arena scope) { + return read.ofAddress(read$get(segment), scope); + } + /** + * {@snippet : + * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); + * } + */ + public interface write { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(write fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$1, fi, constants$17.const$3, scope); + } + static write ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$17.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write$VH() { + return constants$18.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment write$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); + * } + */ + public static void write$set(MemorySegment seg, MemorySegment x) { + constants$18.const$2.set(seg, x); + } + public static MemorySegment write$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$2.get(seg.asSlice(index*sizeof())); + } + public static void write$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static write write(MemorySegment segment, Arena scope) { + return write.ofAddress(write$get(segment), scope); + } + /** + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public interface statfs { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(statfs fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$3, fi, constants$9.const$5, scope); + } + static statfs ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle statfs$VH() { + return constants$18.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public static MemorySegment statfs$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*statfs)(char*,struct statvfs*); + * } + */ + public static void statfs$set(MemorySegment seg, MemorySegment x) { + constants$18.const$4.set(seg, x); + } + public static MemorySegment statfs$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$4.get(seg.asSlice(index*sizeof())); + } + public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static statfs statfs(MemorySegment segment, Arena scope) { + return statfs.ofAddress(statfs$get(segment), scope); + } + /** + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public interface flush { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(flush fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$5, fi, constants$9.const$5, scope); + } + static flush ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flush$VH() { + return constants$19.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment flush$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flush)(char*,struct fuse_file_info*); + * } + */ + public static void flush$set(MemorySegment seg, MemorySegment x) { + constants$19.const$0.set(seg, x); + } + public static MemorySegment flush$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$0.get(seg.asSlice(index*sizeof())); + } + public static void flush$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static flush flush(MemorySegment segment, Arena scope) { + return flush.ofAddress(flush$get(segment), scope); + } + /** + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public interface release { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(release fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$1, fi, constants$9.const$5, scope); + } + static release ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle release$VH() { + return constants$19.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment release$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*release)(char*,struct fuse_file_info*); + * } + */ + public static void release$set(MemorySegment seg, MemorySegment x) { + constants$19.const$2.set(seg, x); + } + public static MemorySegment release$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$2.get(seg.asSlice(index*sizeof())); + } + public static void release$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static release release(MemorySegment segment, Arena scope) { + return release.ofAddress(release$get(segment), scope); + } + /** + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public interface fsync { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsync fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$4, fi, constants$19.const$3, scope); + } + static fsync ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$19.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsync$VH() { + return constants$20.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public static MemorySegment fsync$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse_file_info*); + * } + */ + public static void fsync$set(MemorySegment seg, MemorySegment x) { + constants$20.const$0.set(seg, x); + } + public static MemorySegment fsync$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$0.get(seg.asSlice(index*sizeof())); + } + public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static fsync fsync(MemorySegment segment, Arena scope) { + return fsync.ofAddress(fsync$get(segment), scope); + } + /** + * {@snippet : + * int (*setxattr)(char*,char*,char*,size_t,int); + * } + */ + public interface setxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); + static MemorySegment allocate(setxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$2, fi, constants$20.const$1, scope); + } + static setxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { + try { + return (int)constants$20.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle setxattr$VH() { + return constants$20.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,size_t,int); + * } + */ + public static MemorySegment setxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,size_t,int); + * } + */ + public static void setxattr$set(MemorySegment seg, MemorySegment x) { + constants$20.const$4.set(seg, x); + } + public static MemorySegment setxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$4.get(seg.asSlice(index*sizeof())); + } + public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static setxattr setxattr(MemorySegment segment, Arena scope) { + return setxattr.ofAddress(setxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*getxattr)(char*,char*,char*,size_t); + * } + */ + public interface getxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); + static MemorySegment allocate(getxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$5, fi, constants$9.const$1, scope); + } + static getxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { + try { + return (int)constants$9.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getxattr$VH() { + return constants$21.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,size_t); + * } + */ + public static MemorySegment getxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,size_t); + * } + */ + public static void getxattr$set(MemorySegment seg, MemorySegment x) { + constants$21.const$0.set(seg, x); + } + public static MemorySegment getxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$0.get(seg.asSlice(index*sizeof())); + } + public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static getxattr getxattr(MemorySegment segment, Arena scope) { + return getxattr.ofAddress(getxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*listxattr)(char*,char*,size_t); + * } + */ + public interface listxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(listxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$1, fi, constants$10.const$3, scope); + } + static listxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$10.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle listxattr$VH() { + return constants$21.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*listxattr)(char*,char*,size_t); + * } + */ + public static MemorySegment listxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*listxattr)(char*,char*,size_t); + * } + */ + public static void listxattr$set(MemorySegment seg, MemorySegment x) { + constants$21.const$2.set(seg, x); + } + public static MemorySegment listxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$2.get(seg.asSlice(index*sizeof())); + } + public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static listxattr listxattr(MemorySegment segment, Arena scope) { + return listxattr.ofAddress(listxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public interface removexattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(removexattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$3, fi, constants$9.const$5, scope); + } + static removexattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle removexattr$VH() { + return constants$21.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static MemorySegment removexattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static void removexattr$set(MemorySegment seg, MemorySegment x) { + constants$21.const$4.set(seg, x); + } + public static MemorySegment removexattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$4.get(seg.asSlice(index*sizeof())); + } + public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static removexattr removexattr(MemorySegment segment, Arena scope) { + return removexattr.ofAddress(removexattr$get(segment), scope); + } + /** + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public interface opendir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(opendir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$5, fi, constants$9.const$5, scope); + } + static opendir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle opendir$VH() { + return constants$22.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment opendir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse_file_info*); + * } + */ + public static void opendir$set(MemorySegment seg, MemorySegment x) { + constants$22.const$0.set(seg, x); + } + public static MemorySegment opendir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$0.get(seg.asSlice(index*sizeof())); + } + public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static opendir opendir(MemorySegment segment, Arena scope) { + return opendir.ofAddress(opendir$get(segment), scope); + } + /** + * {@snippet : + * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); + * } + */ + public interface readdir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(readdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$2, fi, constants$22.const$1, scope); + } + static readdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$22.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readdir$VH() { + return constants$22.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment readdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); + * } + */ + public static void readdir$set(MemorySegment seg, MemorySegment x) { + constants$22.const$4.set(seg, x); + } + public static MemorySegment readdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$4.get(seg.asSlice(index*sizeof())); + } + public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static readdir readdir(MemorySegment segment, Arena scope) { + return readdir.ofAddress(readdir$get(segment), scope); + } + /** + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public interface releasedir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(releasedir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$5, fi, constants$9.const$5, scope); + } + static releasedir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle releasedir$VH() { + return constants$23.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public static MemorySegment releasedir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse_file_info*); + * } + */ + public static void releasedir$set(MemorySegment seg, MemorySegment x) { + constants$23.const$0.set(seg, x); + } + public static MemorySegment releasedir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$0.get(seg.asSlice(index*sizeof())); + } + public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static releasedir releasedir(MemorySegment segment, Arena scope) { + return releasedir.ofAddress(releasedir$get(segment), scope); + } + /** + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public interface fsyncdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsyncdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$1, fi, constants$19.const$3, scope); + } + static fsyncdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$19.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsyncdir$VH() { + return constants$23.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public static MemorySegment fsyncdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse_file_info*); + * } + */ + public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { + constants$23.const$2.set(seg, x); + } + public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$2.get(seg.asSlice(index*sizeof())); + } + public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static fsyncdir fsyncdir(MemorySegment segment, Arena scope) { + return fsyncdir.ofAddress(fsyncdir$get(segment), scope); + } + /** + * {@snippet : + * void* (*init)(struct fuse_conn_info*); + * } + */ + public interface init { + + java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(init fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$4, fi, constants$23.const$3, scope); + } + static init ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (java.lang.foreign.MemorySegment)constants$23.const$5.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle init$VH() { + return constants$24.const$0; + } + /** + * Getter for field: + * {@snippet : + * void* (*init)(struct fuse_conn_info*); + * } + */ + public static MemorySegment init$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void* (*init)(struct fuse_conn_info*); + * } + */ + public static void init$set(MemorySegment seg, MemorySegment x) { + constants$24.const$0.set(seg, x); + } + public static MemorySegment init$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$0.get(seg.asSlice(index*sizeof())); + } + public static void init$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static init init(MemorySegment segment, Arena scope) { + return init.ofAddress(init$get(segment), scope); + } + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ + public interface destroy { + + void apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(destroy fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$2, fi, constants$24.const$1, scope); + } + static destroy ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + constants$24.const$3.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle destroy$VH() { + return constants$24.const$4; + } + /** + * Getter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static MemorySegment destroy$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static void destroy$set(MemorySegment seg, MemorySegment x) { + constants$24.const$4.set(seg, x); + } + public static MemorySegment destroy$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$4.get(seg.asSlice(index*sizeof())); + } + public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static destroy destroy(MemorySegment segment, Arena scope) { + return destroy.ofAddress(destroy$get(segment), scope); + } + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ + public interface access { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(access fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$0, fi, constants$24.const$5, scope); + } + static access ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$25.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle access$VH() { + return constants$25.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static MemorySegment access$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static void access$set(MemorySegment seg, MemorySegment x) { + constants$25.const$2.set(seg, x); + } + public static MemorySegment access$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$2.get(seg.asSlice(index*sizeof())); + } + public static void access$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static access access(MemorySegment segment, Arena scope) { + return access.ofAddress(access$get(segment), scope); + } + /** + * {@snippet : + * int (*create)(char*,mode_t,struct fuse_file_info*); + * } + */ + public interface create { + + int apply(java.lang.foreign.MemorySegment _x0, short _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(create fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$4, fi, constants$25.const$3, scope); + } + static create ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, short __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$25.const$5.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle create$VH() { + return constants$26.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*create)(char*,mode_t,struct fuse_file_info*); + * } + */ + public static MemorySegment create$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*create)(char*,mode_t,struct fuse_file_info*); + * } + */ + public static void create$set(MemorySegment seg, MemorySegment x) { + constants$26.const$0.set(seg, x); + } + public static MemorySegment create$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$0.get(seg.asSlice(index*sizeof())); + } + public static void create$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static create create(MemorySegment segment, Arena scope) { + return create.ofAddress(create$get(segment), scope); + } + /** + * {@snippet : + * int (*ftruncate)(char*,off_t,struct fuse_file_info*); + * } + */ + public interface ftruncate { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(ftruncate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$2, fi, constants$26.const$1, scope); + } + static ftruncate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$26.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle ftruncate$VH() { + return constants$26.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*ftruncate)(char*,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment ftruncate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*ftruncate)(char*,off_t,struct fuse_file_info*); + * } + */ + public static void ftruncate$set(MemorySegment seg, MemorySegment x) { + constants$26.const$4.set(seg, x); + } + public static MemorySegment ftruncate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$4.get(seg.asSlice(index*sizeof())); + } + public static void ftruncate$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static ftruncate ftruncate(MemorySegment segment, Arena scope) { + return ftruncate.ofAddress(ftruncate$get(segment), scope); + } + /** + * {@snippet : + * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public interface fgetattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fgetattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$5, fi, constants$11.const$1, scope); + } + static fgetattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$11.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fgetattr$VH() { + return constants$27.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public static MemorySegment fgetattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); + * } + */ + public static void fgetattr$set(MemorySegment seg, MemorySegment x) { + constants$27.const$0.set(seg, x); + } + public static MemorySegment fgetattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$0.get(seg.asSlice(index*sizeof())); + } + public static void fgetattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static fgetattr fgetattr(MemorySegment segment, Arena scope) { + return fgetattr.ofAddress(fgetattr$get(segment), scope); + } + /** + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public interface lock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(lock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$2, fi, constants$27.const$1, scope); + } + static lock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$27.const$3.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle lock$VH() { + return constants$27.const$4; + } + /** + * Getter for field: + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public static MemorySegment lock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$4.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); + * } + */ + public static void lock$set(MemorySegment seg, MemorySegment x) { + constants$27.const$4.set(seg, x); + } + public static MemorySegment lock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$4.get(seg.asSlice(index*sizeof())); + } + public static void lock$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$4.set(seg.asSlice(index*sizeof()), x); + } + public static lock lock(MemorySegment segment, Arena scope) { + return lock.ofAddress(lock$get(segment), scope); + } + /** + * {@snippet : + * int (*utimens)(char*,struct timespec*); + * } + */ + public interface utimens { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(utimens fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$5, fi, constants$9.const$5, scope); + } + static utimens ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$10.const$1.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle utimens$VH() { + return constants$28.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*utimens)(char*,struct timespec*); + * } + */ + public static MemorySegment utimens$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*utimens)(char*,struct timespec*); + * } + */ + public static void utimens$set(MemorySegment seg, MemorySegment x) { + constants$28.const$0.set(seg, x); + } + public static MemorySegment utimens$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$0.get(seg.asSlice(index*sizeof())); + } + public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static utimens utimens(MemorySegment segment, Arena scope) { + return utimens.ofAddress(utimens$get(segment), scope); + } + /** + * {@snippet : + * int (*bmap)(char*,size_t,uint64_t*); + * } + */ + public interface bmap { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(bmap fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$1, fi, constants$26.const$1, scope); + } + static bmap ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$26.const$3.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle bmap$VH() { + return constants$28.const$2; + } + /** + * Getter for field: + * {@snippet : + * int (*bmap)(char*,size_t,uint64_t*); + * } + */ + public static MemorySegment bmap$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$2.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*bmap)(char*,size_t,uint64_t*); + * } + */ + public static void bmap$set(MemorySegment seg, MemorySegment x) { + constants$28.const$2.set(seg, x); + } + public static MemorySegment bmap$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$2.get(seg.asSlice(index*sizeof())); + } + public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$2.set(seg.asSlice(index*sizeof()), x); + } + public static bmap bmap(MemorySegment segment, Arena scope) { + return bmap.ofAddress(bmap$get(segment), scope); + } + /** + * {@snippet : + * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public interface ioctl { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); + static MemorySegment allocate(ioctl fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$4, fi, constants$28.const$3, scope); + } + static ioctl ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { + try { + return (int)constants$28.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle ioctl$VH() { + return constants$29.const$0; + } + /** + * Getter for field: + * {@snippet : + * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public static MemorySegment ioctl$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$0.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); + * } + */ + public static void ioctl$set(MemorySegment seg, MemorySegment x) { + constants$29.const$0.set(seg, x); + } + public static MemorySegment ioctl$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$0.get(seg.asSlice(index*sizeof())); + } + public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$0.set(seg.asSlice(index*sizeof()), x); + } + public static ioctl ioctl(MemorySegment segment, Arena scope) { + return ioctl.ofAddress(ioctl$get(segment), scope); + } + /** + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public interface poll { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(poll fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$1, fi, constants$4.const$0, scope); + } + static poll ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$29.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle poll$VH() { + return constants$29.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public static MemorySegment poll$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); + * } + */ + public static void poll$set(MemorySegment seg, MemorySegment x) { + constants$29.const$3.set(seg, x); + } + public static MemorySegment poll$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$3.get(seg.asSlice(index*sizeof())); + } + public static void poll$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static poll poll(MemorySegment segment, Arena scope) { + return poll.ofAddress(poll$get(segment), scope); + } + /** + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); + * } + */ + public interface write_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(write_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$5, fi, constants$29.const$4, scope); + } + static write_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$30.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write_buf$VH() { + return constants$30.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment write_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); + * } + */ + public static void write_buf$set(MemorySegment seg, MemorySegment x) { + constants$30.const$1.set(seg, x); + } + public static MemorySegment write_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$1.get(seg.asSlice(index*sizeof())); + } + public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static write_buf write_buf(MemorySegment segment, Arena scope) { + return write_buf.ofAddress(write_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); + * } + */ + public interface read_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$2, fi, constants$17.const$3, scope); + } + static read_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$17.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read_buf$VH() { + return constants$30.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment read_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); + * } + */ + public static void read_buf$set(MemorySegment seg, MemorySegment x) { + constants$30.const$3.set(seg, x); + } + public static MemorySegment read_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$3.get(seg.asSlice(index*sizeof())); + } + public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static read_buf read_buf(MemorySegment segment, Arena scope) { + return read_buf.ofAddress(read_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public interface flock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(flock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$5, fi, constants$30.const$4, scope); + } + static flock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$31.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flock$VH() { + return constants$31.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public static MemorySegment flock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flock)(char*,struct fuse_file_info*,int); + * } + */ + public static void flock$set(MemorySegment seg, MemorySegment x) { + constants$31.const$1.set(seg, x); + } + public static MemorySegment flock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$1.get(seg.asSlice(index*sizeof())); + } + public static void flock$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static flock flock(MemorySegment segment, Arena scope) { + return flock.ofAddress(flock$get(segment), scope); + } + /** + * {@snippet : + * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); + * } + */ + public interface fallocate { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(fallocate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$3, fi, constants$31.const$2, scope); + } + static fallocate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$31.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fallocate$VH() { + return constants$31.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); + * } + */ + public static MemorySegment fallocate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); + * } + */ + public static void fallocate$set(MemorySegment seg, MemorySegment x) { + constants$31.const$5.set(seg, x); + } + public static MemorySegment fallocate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$5.get(seg.asSlice(index*sizeof())); + } + public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static fallocate fallocate(MemorySegment segment, Arena scope) { + return fallocate.ofAddress(fallocate$get(segment), scope); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/stat.java similarity index 55% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/stat.java index 822fa12b..1a1e0380 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/stat.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -33,45 +33,11 @@ */ public class stat { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_INT$LAYOUT.withName("st_dev"), - Constants$root.C_SHORT$LAYOUT.withName("st_mode"), - Constants$root.C_SHORT$LAYOUT.withName("st_nlink"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_ino"), - Constants$root.C_INT$LAYOUT.withName("st_uid"), - Constants$root.C_INT$LAYOUT.withName("st_gid"), - Constants$root.C_INT$LAYOUT.withName("st_rdev"), - MemoryLayout.paddingLayout(32), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_atimespec"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_mtimespec"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_ctimespec"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_birthtimespec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_size"), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_blocks"), - Constants$root.C_INT$LAYOUT.withName("st_blksize"), - Constants$root.C_INT$LAYOUT.withName("st_flags"), - Constants$root.C_INT$LAYOUT.withName("st_gen"), - Constants$root.C_INT$LAYOUT.withName("st_lspare"), - MemoryLayout.sequenceLayout(2, Constants$root.C_LONG_LONG$LAYOUT).withName("st_qspare") - ).withName("stat"); public static MemoryLayout $LAYOUT() { - return stat.$struct$LAYOUT; + return constants$4.const$5; } - static final VarHandle st_dev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); public static VarHandle st_dev$VH() { - return stat.st_dev$VH; + return constants$5.const$0; } /** * Getter for field: @@ -80,7 +46,7 @@ public class stat { * } */ public static int st_dev$get(MemorySegment seg) { - return (int)stat.st_dev$VH.get(seg); + return (int)constants$5.const$0.get(seg); } /** * Setter for field: @@ -89,17 +55,16 @@ public class stat { * } */ public static void st_dev$set(MemorySegment seg, int x) { - stat.st_dev$VH.set(seg, x); + constants$5.const$0.set(seg, x); } public static int st_dev$get(MemorySegment seg, long index) { - return (int)stat.st_dev$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$0.get(seg.asSlice(index*sizeof())); } public static void st_dev$set(MemorySegment seg, long index, int x) { - stat.st_dev$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); public static VarHandle st_mode$VH() { - return stat.st_mode$VH; + return constants$5.const$1; } /** * Getter for field: @@ -108,7 +73,7 @@ public class stat { * } */ public static short st_mode$get(MemorySegment seg) { - return (short)stat.st_mode$VH.get(seg); + return (short)constants$5.const$1.get(seg); } /** * Setter for field: @@ -117,17 +82,16 @@ public class stat { * } */ public static void st_mode$set(MemorySegment seg, short x) { - stat.st_mode$VH.set(seg, x); + constants$5.const$1.set(seg, x); } public static short st_mode$get(MemorySegment seg, long index) { - return (short)stat.st_mode$VH.get(seg.asSlice(index*sizeof())); + return (short)constants$5.const$1.get(seg.asSlice(index*sizeof())); } public static void st_mode$set(MemorySegment seg, long index, short x) { - stat.st_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_nlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); public static VarHandle st_nlink$VH() { - return stat.st_nlink$VH; + return constants$5.const$2; } /** * Getter for field: @@ -136,7 +100,7 @@ public class stat { * } */ public static short st_nlink$get(MemorySegment seg) { - return (short)stat.st_nlink$VH.get(seg); + return (short)constants$5.const$2.get(seg); } /** * Setter for field: @@ -145,17 +109,16 @@ public class stat { * } */ public static void st_nlink$set(MemorySegment seg, short x) { - stat.st_nlink$VH.set(seg, x); + constants$5.const$2.set(seg, x); } public static short st_nlink$get(MemorySegment seg, long index) { - return (short)stat.st_nlink$VH.get(seg.asSlice(index*sizeof())); + return (short)constants$5.const$2.get(seg.asSlice(index*sizeof())); } public static void st_nlink$set(MemorySegment seg, long index, short x) { - stat.st_nlink$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); public static VarHandle st_ino$VH() { - return stat.st_ino$VH; + return constants$5.const$3; } /** * Getter for field: @@ -164,7 +127,7 @@ public class stat { * } */ public static long st_ino$get(MemorySegment seg) { - return (long)stat.st_ino$VH.get(seg); + return (long)constants$5.const$3.get(seg); } /** * Setter for field: @@ -173,17 +136,16 @@ public class stat { * } */ public static void st_ino$set(MemorySegment seg, long x) { - stat.st_ino$VH.set(seg, x); + constants$5.const$3.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { - return (long)stat.st_ino$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$5.const$3.get(seg.asSlice(index*sizeof())); } public static void st_ino$set(MemorySegment seg, long index, long x) { - stat.st_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); public static VarHandle st_uid$VH() { - return stat.st_uid$VH; + return constants$5.const$4; } /** * Getter for field: @@ -192,7 +154,7 @@ public class stat { * } */ public static int st_uid$get(MemorySegment seg) { - return (int)stat.st_uid$VH.get(seg); + return (int)constants$5.const$4.get(seg); } /** * Setter for field: @@ -201,17 +163,16 @@ public class stat { * } */ public static void st_uid$set(MemorySegment seg, int x) { - stat.st_uid$VH.set(seg, x); + constants$5.const$4.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { - return (int)stat.st_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$4.get(seg.asSlice(index*sizeof())); } public static void st_uid$set(MemorySegment seg, long index, int x) { - stat.st_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); public static VarHandle st_gid$VH() { - return stat.st_gid$VH; + return constants$5.const$5; } /** * Getter for field: @@ -220,7 +181,7 @@ public class stat { * } */ public static int st_gid$get(MemorySegment seg) { - return (int)stat.st_gid$VH.get(seg); + return (int)constants$5.const$5.get(seg); } /** * Setter for field: @@ -229,17 +190,16 @@ public class stat { * } */ public static void st_gid$set(MemorySegment seg, int x) { - stat.st_gid$VH.set(seg, x); + constants$5.const$5.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { - return (int)stat.st_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$5.get(seg.asSlice(index*sizeof())); } public static void st_gid$set(MemorySegment seg, long index, int x) { - stat.st_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_rdev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); public static VarHandle st_rdev$VH() { - return stat.st_rdev$VH; + return constants$6.const$0; } /** * Getter for field: @@ -248,7 +208,7 @@ public class stat { * } */ public static int st_rdev$get(MemorySegment seg) { - return (int)stat.st_rdev$VH.get(seg); + return (int)constants$6.const$0.get(seg); } /** * Setter for field: @@ -257,13 +217,13 @@ public class stat { * } */ public static void st_rdev$set(MemorySegment seg, int x) { - stat.st_rdev$VH.set(seg, x); + constants$6.const$0.set(seg, x); } public static int st_rdev$get(MemorySegment seg, long index) { - return (int)stat.st_rdev$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$0.get(seg.asSlice(index*sizeof())); } public static void st_rdev$set(MemorySegment seg, long index, int x) { - stat.st_rdev$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$0.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment st_atimespec$slice(MemorySegment seg) { return seg.asSlice(32, 16); @@ -277,9 +237,8 @@ public class stat { public static MemorySegment st_birthtimespec$slice(MemorySegment seg) { return seg.asSlice(80, 16); } - static final VarHandle st_size$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_size")); public static VarHandle st_size$VH() { - return stat.st_size$VH; + return constants$6.const$1; } /** * Getter for field: @@ -288,7 +247,7 @@ public class stat { * } */ public static long st_size$get(MemorySegment seg) { - return (long)stat.st_size$VH.get(seg); + return (long)constants$6.const$1.get(seg); } /** * Setter for field: @@ -297,17 +256,16 @@ public class stat { * } */ public static void st_size$set(MemorySegment seg, long x) { - stat.st_size$VH.set(seg, x); + constants$6.const$1.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { - return (long)stat.st_size$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$1.get(seg.asSlice(index*sizeof())); } public static void st_size$set(MemorySegment seg, long index, long x) { - stat.st_size$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); public static VarHandle st_blocks$VH() { - return stat.st_blocks$VH; + return constants$6.const$2; } /** * Getter for field: @@ -316,7 +274,7 @@ public class stat { * } */ public static long st_blocks$get(MemorySegment seg) { - return (long)stat.st_blocks$VH.get(seg); + return (long)constants$6.const$2.get(seg); } /** * Setter for field: @@ -325,17 +283,16 @@ public class stat { * } */ public static void st_blocks$set(MemorySegment seg, long x) { - stat.st_blocks$VH.set(seg, x); + constants$6.const$2.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { - return (long)stat.st_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$6.const$2.get(seg.asSlice(index*sizeof())); } public static void st_blocks$set(MemorySegment seg, long index, long x) { - stat.st_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blksize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); public static VarHandle st_blksize$VH() { - return stat.st_blksize$VH; + return constants$6.const$3; } /** * Getter for field: @@ -344,7 +301,7 @@ public class stat { * } */ public static int st_blksize$get(MemorySegment seg) { - return (int)stat.st_blksize$VH.get(seg); + return (int)constants$6.const$3.get(seg); } /** * Setter for field: @@ -353,17 +310,16 @@ public class stat { * } */ public static void st_blksize$set(MemorySegment seg, int x) { - stat.st_blksize$VH.set(seg, x); + constants$6.const$3.set(seg, x); } public static int st_blksize$get(MemorySegment seg, long index) { - return (int)stat.st_blksize$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$3.get(seg.asSlice(index*sizeof())); } public static void st_blksize$set(MemorySegment seg, long index, int x) { - stat.st_blksize$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_flags$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_flags")); public static VarHandle st_flags$VH() { - return stat.st_flags$VH; + return constants$6.const$4; } /** * Getter for field: @@ -372,7 +328,7 @@ public class stat { * } */ public static int st_flags$get(MemorySegment seg) { - return (int)stat.st_flags$VH.get(seg); + return (int)constants$6.const$4.get(seg); } /** * Setter for field: @@ -381,17 +337,16 @@ public class stat { * } */ public static void st_flags$set(MemorySegment seg, int x) { - stat.st_flags$VH.set(seg, x); + constants$6.const$4.set(seg, x); } public static int st_flags$get(MemorySegment seg, long index) { - return (int)stat.st_flags$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$4.get(seg.asSlice(index*sizeof())); } public static void st_flags$set(MemorySegment seg, long index, int x) { - stat.st_flags$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_gen$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_gen")); public static VarHandle st_gen$VH() { - return stat.st_gen$VH; + return constants$6.const$5; } /** * Getter for field: @@ -400,7 +355,7 @@ public class stat { * } */ public static int st_gen$get(MemorySegment seg) { - return (int)stat.st_gen$VH.get(seg); + return (int)constants$6.const$5.get(seg); } /** * Setter for field: @@ -409,17 +364,16 @@ public class stat { * } */ public static void st_gen$set(MemorySegment seg, int x) { - stat.st_gen$VH.set(seg, x); + constants$6.const$5.set(seg, x); } public static int st_gen$get(MemorySegment seg, long index) { - return (int)stat.st_gen$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$5.get(seg.asSlice(index*sizeof())); } public static void st_gen$set(MemorySegment seg, long index, int x) { - stat.st_gen$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_lspare$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_lspare")); public static VarHandle st_lspare$VH() { - return stat.st_lspare$VH; + return constants$7.const$0; } /** * Getter for field: @@ -428,7 +382,7 @@ public class stat { * } */ public static int st_lspare$get(MemorySegment seg) { - return (int)stat.st_lspare$VH.get(seg); + return (int)constants$7.const$0.get(seg); } /** * Setter for field: @@ -437,13 +391,13 @@ public class stat { * } */ public static void st_lspare$set(MemorySegment seg, int x) { - stat.st_lspare$VH.set(seg, x); + constants$7.const$0.set(seg, x); } public static int st_lspare$get(MemorySegment seg, long index) { - return (int)stat.st_lspare$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$0.get(seg.asSlice(index*sizeof())); } public static void st_lspare$set(MemorySegment seg, long index, int x) { - stat.st_lspare$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$0.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment st_qspare$slice(MemorySegment seg) { return seg.asSlice(128, 16); @@ -453,7 +407,7 @@ public class stat { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/statvfs.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/statvfs.java similarity index 57% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/statvfs.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/statvfs.java index ae5a11e2..ad181f48 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/statvfs.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/statvfs.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,25 +26,11 @@ */ public class statvfs { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_frsize"), - Constants$root.C_INT$LAYOUT.withName("f_blocks"), - Constants$root.C_INT$LAYOUT.withName("f_bfree"), - Constants$root.C_INT$LAYOUT.withName("f_bavail"), - Constants$root.C_INT$LAYOUT.withName("f_files"), - Constants$root.C_INT$LAYOUT.withName("f_ffree"), - Constants$root.C_INT$LAYOUT.withName("f_favail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_fsid"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_flag"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_namemax") - ).withName("statvfs"); public static MemoryLayout $LAYOUT() { - return statvfs.$struct$LAYOUT; + return constants$7.const$1; } - static final VarHandle f_bsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); public static VarHandle f_bsize$VH() { - return statvfs.f_bsize$VH; + return constants$7.const$2; } /** * Getter for field: @@ -53,7 +39,7 @@ public class statvfs { * } */ public static long f_bsize$get(MemorySegment seg) { - return (long)statvfs.f_bsize$VH.get(seg); + return (long)constants$7.const$2.get(seg); } /** * Setter for field: @@ -62,17 +48,16 @@ public class statvfs { * } */ public static void f_bsize$set(MemorySegment seg, long x) { - statvfs.f_bsize$VH.set(seg, x); + constants$7.const$2.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { - return (long)statvfs.f_bsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$2.get(seg.asSlice(index*sizeof())); } public static void f_bsize$set(MemorySegment seg, long index, long x) { - statvfs.f_bsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_frsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); public static VarHandle f_frsize$VH() { - return statvfs.f_frsize$VH; + return constants$7.const$3; } /** * Getter for field: @@ -81,7 +66,7 @@ public class statvfs { * } */ public static long f_frsize$get(MemorySegment seg) { - return (long)statvfs.f_frsize$VH.get(seg); + return (long)constants$7.const$3.get(seg); } /** * Setter for field: @@ -90,17 +75,16 @@ public class statvfs { * } */ public static void f_frsize$set(MemorySegment seg, long x) { - statvfs.f_frsize$VH.set(seg, x); + constants$7.const$3.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { - return (long)statvfs.f_frsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$7.const$3.get(seg.asSlice(index*sizeof())); } public static void f_frsize$set(MemorySegment seg, long index, long x) { - statvfs.f_frsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); public static VarHandle f_blocks$VH() { - return statvfs.f_blocks$VH; + return constants$7.const$4; } /** * Getter for field: @@ -109,7 +93,7 @@ public class statvfs { * } */ public static int f_blocks$get(MemorySegment seg) { - return (int)statvfs.f_blocks$VH.get(seg); + return (int)constants$7.const$4.get(seg); } /** * Setter for field: @@ -118,17 +102,16 @@ public class statvfs { * } */ public static void f_blocks$set(MemorySegment seg, int x) { - statvfs.f_blocks$VH.set(seg, x); + constants$7.const$4.set(seg, x); } public static int f_blocks$get(MemorySegment seg, long index) { - return (int)statvfs.f_blocks$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$4.get(seg.asSlice(index*sizeof())); } public static void f_blocks$set(MemorySegment seg, long index, int x) { - statvfs.f_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bfree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); public static VarHandle f_bfree$VH() { - return statvfs.f_bfree$VH; + return constants$7.const$5; } /** * Getter for field: @@ -137,7 +120,7 @@ public class statvfs { * } */ public static int f_bfree$get(MemorySegment seg) { - return (int)statvfs.f_bfree$VH.get(seg); + return (int)constants$7.const$5.get(seg); } /** * Setter for field: @@ -146,17 +129,16 @@ public class statvfs { * } */ public static void f_bfree$set(MemorySegment seg, int x) { - statvfs.f_bfree$VH.set(seg, x); + constants$7.const$5.set(seg, x); } public static int f_bfree$get(MemorySegment seg, long index) { - return (int)statvfs.f_bfree$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$5.get(seg.asSlice(index*sizeof())); } public static void f_bfree$set(MemorySegment seg, long index, int x) { - statvfs.f_bfree$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bavail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); public static VarHandle f_bavail$VH() { - return statvfs.f_bavail$VH; + return constants$8.const$0; } /** * Getter for field: @@ -165,7 +147,7 @@ public class statvfs { * } */ public static int f_bavail$get(MemorySegment seg) { - return (int)statvfs.f_bavail$VH.get(seg); + return (int)constants$8.const$0.get(seg); } /** * Setter for field: @@ -174,17 +156,16 @@ public class statvfs { * } */ public static void f_bavail$set(MemorySegment seg, int x) { - statvfs.f_bavail$VH.set(seg, x); + constants$8.const$0.set(seg, x); } public static int f_bavail$get(MemorySegment seg, long index) { - return (int)statvfs.f_bavail$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$0.get(seg.asSlice(index*sizeof())); } public static void f_bavail$set(MemorySegment seg, long index, int x) { - statvfs.f_bavail$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_files$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_files")); public static VarHandle f_files$VH() { - return statvfs.f_files$VH; + return constants$8.const$1; } /** * Getter for field: @@ -193,7 +174,7 @@ public class statvfs { * } */ public static int f_files$get(MemorySegment seg) { - return (int)statvfs.f_files$VH.get(seg); + return (int)constants$8.const$1.get(seg); } /** * Setter for field: @@ -202,17 +183,16 @@ public class statvfs { * } */ public static void f_files$set(MemorySegment seg, int x) { - statvfs.f_files$VH.set(seg, x); + constants$8.const$1.set(seg, x); } public static int f_files$get(MemorySegment seg, long index) { - return (int)statvfs.f_files$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$1.get(seg.asSlice(index*sizeof())); } public static void f_files$set(MemorySegment seg, long index, int x) { - statvfs.f_files$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_ffree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); public static VarHandle f_ffree$VH() { - return statvfs.f_ffree$VH; + return constants$8.const$2; } /** * Getter for field: @@ -221,7 +201,7 @@ public class statvfs { * } */ public static int f_ffree$get(MemorySegment seg) { - return (int)statvfs.f_ffree$VH.get(seg); + return (int)constants$8.const$2.get(seg); } /** * Setter for field: @@ -230,17 +210,16 @@ public class statvfs { * } */ public static void f_ffree$set(MemorySegment seg, int x) { - statvfs.f_ffree$VH.set(seg, x); + constants$8.const$2.set(seg, x); } public static int f_ffree$get(MemorySegment seg, long index) { - return (int)statvfs.f_ffree$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$2.get(seg.asSlice(index*sizeof())); } public static void f_ffree$set(MemorySegment seg, long index, int x) { - statvfs.f_ffree$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_favail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); public static VarHandle f_favail$VH() { - return statvfs.f_favail$VH; + return constants$8.const$3; } /** * Getter for field: @@ -249,7 +228,7 @@ public class statvfs { * } */ public static int f_favail$get(MemorySegment seg) { - return (int)statvfs.f_favail$VH.get(seg); + return (int)constants$8.const$3.get(seg); } /** * Setter for field: @@ -258,17 +237,16 @@ public class statvfs { * } */ public static void f_favail$set(MemorySegment seg, int x) { - statvfs.f_favail$VH.set(seg, x); + constants$8.const$3.set(seg, x); } public static int f_favail$get(MemorySegment seg, long index) { - return (int)statvfs.f_favail$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$3.get(seg.asSlice(index*sizeof())); } public static void f_favail$set(MemorySegment seg, long index, int x) { - statvfs.f_favail$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_fsid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); public static VarHandle f_fsid$VH() { - return statvfs.f_fsid$VH; + return constants$8.const$4; } /** * Getter for field: @@ -277,7 +255,7 @@ public class statvfs { * } */ public static long f_fsid$get(MemorySegment seg) { - return (long)statvfs.f_fsid$VH.get(seg); + return (long)constants$8.const$4.get(seg); } /** * Setter for field: @@ -286,17 +264,16 @@ public class statvfs { * } */ public static void f_fsid$set(MemorySegment seg, long x) { - statvfs.f_fsid$VH.set(seg, x); + constants$8.const$4.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { - return (long)statvfs.f_fsid$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$4.get(seg.asSlice(index*sizeof())); } public static void f_fsid$set(MemorySegment seg, long index, long x) { - statvfs.f_fsid$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_flag$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); public static VarHandle f_flag$VH() { - return statvfs.f_flag$VH; + return constants$8.const$5; } /** * Getter for field: @@ -305,7 +282,7 @@ public class statvfs { * } */ public static long f_flag$get(MemorySegment seg) { - return (long)statvfs.f_flag$VH.get(seg); + return (long)constants$8.const$5.get(seg); } /** * Setter for field: @@ -314,17 +291,16 @@ public class statvfs { * } */ public static void f_flag$set(MemorySegment seg, long x) { - statvfs.f_flag$VH.set(seg, x); + constants$8.const$5.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { - return (long)statvfs.f_flag$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$8.const$5.get(seg.asSlice(index*sizeof())); } public static void f_flag$set(MemorySegment seg, long index, long x) { - statvfs.f_flag$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_namemax$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); public static VarHandle f_namemax$VH() { - return statvfs.f_namemax$VH; + return constants$9.const$0; } /** * Getter for field: @@ -333,7 +309,7 @@ public class statvfs { * } */ public static long f_namemax$get(MemorySegment seg) { - return (long)statvfs.f_namemax$VH.get(seg); + return (long)constants$9.const$0.get(seg); } /** * Setter for field: @@ -342,20 +318,20 @@ public class statvfs { * } */ public static void f_namemax$set(MemorySegment seg, long x) { - statvfs.f_namemax$VH.set(seg, x); + constants$9.const$0.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { - return (long)statvfs.f_namemax$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$9.const$0.get(seg.asSlice(index*sizeof())); } public static void f_namemax$set(MemorySegment seg, long index, long x) { - statvfs.f_namemax$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$0.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/timespec.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/timespec.java similarity index 59% rename from jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/timespec.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/timespec.java index be70f479..d52b58b4 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/timespec.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse/timespec.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.mac.extr; +package org.cryptomator.jfuse.mac.extr.fuse; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -17,16 +17,11 @@ */ public class timespec { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("timespec"); public static MemoryLayout $LAYOUT() { - return timespec.$struct$LAYOUT; + return constants$4.const$2; } - static final VarHandle tv_sec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); public static VarHandle tv_sec$VH() { - return timespec.tv_sec$VH; + return constants$4.const$3; } /** * Getter for field: @@ -35,7 +30,7 @@ public class timespec { * } */ public static long tv_sec$get(MemorySegment seg) { - return (long)timespec.tv_sec$VH.get(seg); + return (long)constants$4.const$3.get(seg); } /** * Setter for field: @@ -44,17 +39,16 @@ public class timespec { * } */ public static void tv_sec$set(MemorySegment seg, long x) { - timespec.tv_sec$VH.set(seg, x); + constants$4.const$3.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { - return (long)timespec.tv_sec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$4.const$3.get(seg.asSlice(index*sizeof())); } public static void tv_sec$set(MemorySegment seg, long index, long x) { - timespec.tv_sec$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle tv_nsec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); public static VarHandle tv_nsec$VH() { - return timespec.tv_nsec$VH; + return constants$4.const$4; } /** * Getter for field: @@ -63,7 +57,7 @@ public class timespec { * } */ public static long tv_nsec$get(MemorySegment seg) { - return (long)timespec.tv_nsec$VH.get(seg); + return (long)constants$4.const$4.get(seg); } /** * Setter for field: @@ -72,20 +66,20 @@ public class timespec { * } */ public static void tv_nsec$set(MemorySegment seg, long x) { - timespec.tv_nsec$VH.set(seg, x); + constants$4.const$4.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { - return (long)timespec.tv_nsec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$4.const$4.get(seg.asSlice(index*sizeof())); } public static void tv_nsec$set(MemorySegment seg, long index, long x) { - timespec.tv_nsec$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$4.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_operations.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_operations.java deleted file mode 100644 index 15889d82..00000000 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_operations.java +++ /dev/null @@ -1,2852 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.mac.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -/** - * {@snippet : - * struct fuse_operations { - * int (*getattr)(char*,struct stat*); - * int (*readlink)(char*,char*,size_t); - * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); - * int (*mknod)(char*,mode_t,dev_t); - * int (*mkdir)(char*,mode_t); - * int (*unlink)(char*); - * int (*rmdir)(char*); - * int (*symlink)(char*,char*); - * int (*rename)(char*,char*); - * int (*link)(char*,char*); - * int (*chmod)(char*,mode_t); - * int (*chown)(char*,uid_t,gid_t); - * int (*truncate)(char*,off_t); - * int (*utime)(char*,struct utimbuf*); - * int (*open)(char*,struct fuse_file_info*); - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * int (*statfs)(char*,struct statvfs*); - * int (*flush)(char*,struct fuse_file_info*); - * int (*release)(char*,struct fuse_file_info*); - * int (*fsync)(char*,int,struct fuse_file_info*); - * int (*setxattr)(char*,char*,char*,size_t,int); - * int (*getxattr)(char*,char*,char*,size_t); - * int (*listxattr)(char*,char*,size_t); - * int (*removexattr)(char*,char*); - * int (*opendir)(char*,struct fuse_file_info*); - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); - * int (*releasedir)(char*,struct fuse_file_info*); - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * void* (*init)(struct fuse_conn_info*); - * void (*destroy)(void*); - * int (*access)(char*,int); - * int (*create)(char*,mode_t,struct fuse_file_info*); - * int (*ftruncate)(char*,off_t,struct fuse_file_info*); - * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * int (*utimens)(char*,struct timespec*); - * int (*bmap)(char*,size_t,uint64_t*); - * * unsigned int flag_nullpath_ok; - * unsigned int flag_nopath; - * unsigned int flag_utime_omit_ok; - * unsigned int flag_reserved; - * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * int (*flock)(char*,struct fuse_file_info*,int); - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * }; - * } - */ -public class fuse_operations { - - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_POINTER$LAYOUT.withName("getattr"), - Constants$root.C_POINTER$LAYOUT.withName("readlink"), - Constants$root.C_POINTER$LAYOUT.withName("getdir"), - Constants$root.C_POINTER$LAYOUT.withName("mknod"), - Constants$root.C_POINTER$LAYOUT.withName("mkdir"), - Constants$root.C_POINTER$LAYOUT.withName("unlink"), - Constants$root.C_POINTER$LAYOUT.withName("rmdir"), - Constants$root.C_POINTER$LAYOUT.withName("symlink"), - Constants$root.C_POINTER$LAYOUT.withName("rename"), - Constants$root.C_POINTER$LAYOUT.withName("link"), - Constants$root.C_POINTER$LAYOUT.withName("chmod"), - Constants$root.C_POINTER$LAYOUT.withName("chown"), - Constants$root.C_POINTER$LAYOUT.withName("truncate"), - Constants$root.C_POINTER$LAYOUT.withName("utime"), - Constants$root.C_POINTER$LAYOUT.withName("open"), - Constants$root.C_POINTER$LAYOUT.withName("read"), - Constants$root.C_POINTER$LAYOUT.withName("write"), - Constants$root.C_POINTER$LAYOUT.withName("statfs"), - Constants$root.C_POINTER$LAYOUT.withName("flush"), - Constants$root.C_POINTER$LAYOUT.withName("release"), - Constants$root.C_POINTER$LAYOUT.withName("fsync"), - Constants$root.C_POINTER$LAYOUT.withName("setxattr"), - Constants$root.C_POINTER$LAYOUT.withName("getxattr"), - Constants$root.C_POINTER$LAYOUT.withName("listxattr"), - Constants$root.C_POINTER$LAYOUT.withName("removexattr"), - Constants$root.C_POINTER$LAYOUT.withName("opendir"), - Constants$root.C_POINTER$LAYOUT.withName("readdir"), - Constants$root.C_POINTER$LAYOUT.withName("releasedir"), - Constants$root.C_POINTER$LAYOUT.withName("fsyncdir"), - Constants$root.C_POINTER$LAYOUT.withName("init"), - Constants$root.C_POINTER$LAYOUT.withName("destroy"), - Constants$root.C_POINTER$LAYOUT.withName("access"), - Constants$root.C_POINTER$LAYOUT.withName("create"), - Constants$root.C_POINTER$LAYOUT.withName("ftruncate"), - Constants$root.C_POINTER$LAYOUT.withName("fgetattr"), - Constants$root.C_POINTER$LAYOUT.withName("lock"), - Constants$root.C_POINTER$LAYOUT.withName("utimens"), - Constants$root.C_POINTER$LAYOUT.withName("bmap"), - MemoryLayout.structLayout( - MemoryLayout.paddingLayout(1).withName("flag_nullpath_ok"), - MemoryLayout.paddingLayout(1).withName("flag_nopath"), - MemoryLayout.paddingLayout(1).withName("flag_utime_omit_ok"), - MemoryLayout.paddingLayout(29).withName("flag_reserved"), - MemoryLayout.paddingLayout(32) - ), - Constants$root.C_POINTER$LAYOUT.withName("ioctl"), - Constants$root.C_POINTER$LAYOUT.withName("poll"), - Constants$root.C_POINTER$LAYOUT.withName("write_buf"), - Constants$root.C_POINTER$LAYOUT.withName("read_buf"), - Constants$root.C_POINTER$LAYOUT.withName("flock"), - Constants$root.C_POINTER$LAYOUT.withName("fallocate") - ).withName("fuse_operations"); - public static MemoryLayout $LAYOUT() { - return fuse_operations.$struct$LAYOUT; - } - static final FunctionDescriptor getattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.getattr$FUNC - ); - /** - * {@snippet : - * int (*getattr)(char*,struct stat*); - * } - */ - public interface getattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(getattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse_operations.getattr$FUNC, scope); - } - static getattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.getattr$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getattr")); - public static VarHandle getattr$VH() { - return fuse_operations.getattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getattr)(char*,struct stat*); - * } - */ - public static MemorySegment getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getattr)(char*,struct stat*); - * } - */ - public static void getattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getattr$VH.set(seg, x); - } - public static MemorySegment getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getattr getattr(MemorySegment segment, SegmentScope scope) { - return getattr.ofAddress(getattr$get(segment), scope); - } - static final FunctionDescriptor readlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle readlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.readlink$FUNC - ); - /** - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public interface readlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(readlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse_operations.readlink$FUNC, scope); - } - static readlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readlink")); - public static VarHandle readlink$VH() { - return fuse_operations.readlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public static MemorySegment readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.readlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readlink)(char*,char*,size_t); - * } - */ - public static void readlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.readlink$VH.set(seg, x); - } - public static MemorySegment readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.readlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.readlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readlink readlink(MemorySegment segment, SegmentScope scope) { - return readlink.ofAddress(readlink$get(segment), scope); - } - static final FunctionDescriptor getdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.getdir$FUNC - ); - /** - * {@snippet : - * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); - * } - */ - public interface getdir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(getdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getdir.class, fi, fuse_operations.getdir$FUNC, scope); - } - static getdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.getdir$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getdir")); - public static VarHandle getdir$VH() { - return fuse_operations.getdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); - * } - */ - public static MemorySegment getdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getdir)(char*,fuse_dirh_t,fuse_dirfil_t); - * } - */ - public static void getdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getdir$VH.set(seg, x); - } - public static MemorySegment getdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void getdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getdir getdir(MemorySegment segment, SegmentScope scope) { - return getdir.ofAddress(getdir$get(segment), scope); - } - static final FunctionDescriptor mknod$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_SHORT$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle mknod$MH = RuntimeHelper.downcallHandle( - fuse_operations.mknod$FUNC - ); - /** - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public interface mknod { - - int apply(java.lang.foreign.MemorySegment _x0, short _x1, int _x2); - static MemorySegment allocate(mknod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse_operations.mknod$FUNC, scope); - } - static mknod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, short __x1, int __x2) -> { - try { - return (int)fuse_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mknod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mknod")); - public static VarHandle mknod$VH() { - return fuse_operations.mknod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public static MemorySegment mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.mknod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mknod)(char*,mode_t,dev_t); - * } - */ - public static void mknod$set(MemorySegment seg, MemorySegment x) { - fuse_operations.mknod$VH.set(seg, x); - } - public static MemorySegment mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.mknod$VH.get(seg.asSlice(index*sizeof())); - } - public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.mknod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mknod mknod(MemorySegment segment, SegmentScope scope) { - return mknod.ofAddress(mknod$get(segment), scope); - } - static final FunctionDescriptor mkdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_SHORT$LAYOUT - ); - static final MethodHandle mkdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.mkdir$FUNC - ); - /** - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public interface mkdir { - - int apply(java.lang.foreign.MemorySegment _x0, short _x1); - static MemorySegment allocate(mkdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse_operations.mkdir$FUNC, scope); - } - static mkdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, short __x1) -> { - try { - return (int)fuse_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mkdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); - public static VarHandle mkdir$VH() { - return fuse_operations.mkdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public static MemorySegment mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.mkdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mkdir)(char*,mode_t); - * } - */ - public static void mkdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.mkdir$VH.set(seg, x); - } - public static MemorySegment mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.mkdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mkdir mkdir(MemorySegment segment, SegmentScope scope) { - return mkdir.ofAddress(mkdir$get(segment), scope); - } - static final FunctionDescriptor unlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.unlink$FUNC - ); - /** - * {@snippet : - * int (*unlink)(char*); - * } - */ - public interface unlink { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(unlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse_operations.unlink$FUNC, scope); - } - static unlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse_operations.unlink$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle unlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("unlink")); - public static VarHandle unlink$VH() { - return fuse_operations.unlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static MemorySegment unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.unlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static void unlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.unlink$VH.set(seg, x); - } - public static MemorySegment unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.unlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.unlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static unlink unlink(MemorySegment segment, SegmentScope scope) { - return unlink.ofAddress(unlink$get(segment), scope); - } - static final FunctionDescriptor rmdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.rmdir$FUNC - ); - /** - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public interface rmdir { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(rmdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse_operations.rmdir$FUNC, scope); - } - static rmdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse_operations.rmdir$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rmdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); - public static VarHandle rmdir$VH() { - return fuse_operations.rmdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static MemorySegment rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.rmdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static void rmdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.rmdir$VH.set(seg, x); - } - public static MemorySegment rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.rmdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rmdir rmdir(MemorySegment segment, SegmentScope scope) { - return rmdir.ofAddress(rmdir$get(segment), scope); - } - static final FunctionDescriptor symlink$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( - fuse_operations.symlink$FUNC - ); - /** - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public interface symlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(symlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse_operations.symlink$FUNC, scope); - } - static symlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.symlink$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle symlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("symlink")); - public static VarHandle symlink$VH() { - return fuse_operations.symlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static MemorySegment symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.symlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static void symlink$set(MemorySegment seg, MemorySegment x) { - fuse_operations.symlink$VH.set(seg, x); - } - public static MemorySegment symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.symlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.symlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static symlink symlink(MemorySegment segment, SegmentScope scope) { - return symlink.ofAddress(symlink$get(segment), scope); - } - static final FunctionDescriptor rename$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( - fuse_operations.rename$FUNC - ); - /** - * {@snippet : - * int (*rename)(char*,char*); - * } - */ - public interface rename { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(rename fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse_operations.rename$FUNC, scope); - } - static rename ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.rename$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rename$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rename")); - public static VarHandle rename$VH() { - return fuse_operations.rename$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rename)(char*,char*); - * } - */ - public static MemorySegment rename$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.rename$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rename)(char*,char*); - * } - */ - public static void rename$set(MemorySegment seg, MemorySegment x) { - fuse_operations.rename$VH.set(seg, x); - } - public static MemorySegment rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.rename$VH.get(seg.asSlice(index*sizeof())); - } - public static void rename$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.rename$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rename rename(MemorySegment segment, SegmentScope scope) { - return rename.ofAddress(rename$get(segment), scope); - } - static final FunctionDescriptor link$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle link$MH = RuntimeHelper.downcallHandle( - fuse_operations.link$FUNC - ); - /** - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public interface link { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(link fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(link.class, fi, fuse_operations.link$FUNC, scope); - } - static link ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.link$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle link$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("link")); - public static VarHandle link$VH() { - return fuse_operations.link$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static MemorySegment link$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.link$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static void link$set(MemorySegment seg, MemorySegment x) { - fuse_operations.link$VH.set(seg, x); - } - public static MemorySegment link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.link$VH.get(seg.asSlice(index*sizeof())); - } - public static void link$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.link$VH.set(seg.asSlice(index*sizeof()), x); - } - public static link link(MemorySegment segment, SegmentScope scope) { - return link.ofAddress(link$get(segment), scope); - } - static final FunctionDescriptor chmod$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_SHORT$LAYOUT - ); - static final MethodHandle chmod$MH = RuntimeHelper.downcallHandle( - fuse_operations.chmod$FUNC - ); - /** - * {@snippet : - * int (*chmod)(char*,mode_t); - * } - */ - public interface chmod { - - int apply(java.lang.foreign.MemorySegment _x0, short _x1); - static MemorySegment allocate(chmod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse_operations.chmod$FUNC, scope); - } - static chmod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, short __x1) -> { - try { - return (int)fuse_operations.chmod$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chmod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chmod")); - public static VarHandle chmod$VH() { - return fuse_operations.chmod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chmod)(char*,mode_t); - * } - */ - public static MemorySegment chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.chmod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chmod)(char*,mode_t); - * } - */ - public static void chmod$set(MemorySegment seg, MemorySegment x) { - fuse_operations.chmod$VH.set(seg, x); - } - public static MemorySegment chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.chmod$VH.get(seg.asSlice(index*sizeof())); - } - public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.chmod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chmod chmod(MemorySegment segment, SegmentScope scope) { - return chmod.ofAddress(chmod$get(segment), scope); - } - static final FunctionDescriptor chown$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle chown$MH = RuntimeHelper.downcallHandle( - fuse_operations.chown$FUNC - ); - /** - * {@snippet : - * int (*chown)(char*,uid_t,gid_t); - * } - */ - public interface chown { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2); - static MemorySegment allocate(chown fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse_operations.chown$FUNC, scope); - } - static chown ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2) -> { - try { - return (int)fuse_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chown$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chown")); - public static VarHandle chown$VH() { - return fuse_operations.chown$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chown)(char*,uid_t,gid_t); - * } - */ - public static MemorySegment chown$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.chown$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chown)(char*,uid_t,gid_t); - * } - */ - public static void chown$set(MemorySegment seg, MemorySegment x) { - fuse_operations.chown$VH.set(seg, x); - } - public static MemorySegment chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.chown$VH.get(seg.asSlice(index*sizeof())); - } - public static void chown$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.chown$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chown chown(MemorySegment segment, SegmentScope scope) { - return chown.ofAddress(chown$get(segment), scope); - } - static final FunctionDescriptor truncate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle truncate$MH = RuntimeHelper.downcallHandle( - fuse_operations.truncate$FUNC - ); - /** - * {@snippet : - * int (*truncate)(char*,off_t); - * } - */ - public interface truncate { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1); - static MemorySegment allocate(truncate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse_operations.truncate$FUNC, scope); - } - static truncate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1) -> { - try { - return (int)fuse_operations.truncate$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle truncate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("truncate")); - public static VarHandle truncate$VH() { - return fuse_operations.truncate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*truncate)(char*,off_t); - * } - */ - public static MemorySegment truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.truncate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*truncate)(char*,off_t); - * } - */ - public static void truncate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.truncate$VH.set(seg, x); - } - public static MemorySegment truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.truncate$VH.get(seg.asSlice(index*sizeof())); - } - public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.truncate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static truncate truncate(MemorySegment segment, SegmentScope scope) { - return truncate.ofAddress(truncate$get(segment), scope); - } - static final FunctionDescriptor utime$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle utime$MH = RuntimeHelper.downcallHandle( - fuse_operations.utime$FUNC - ); - /** - * {@snippet : - * int (*utime)(char*,struct utimbuf*); - * } - */ - public interface utime { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(utime fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(utime.class, fi, fuse_operations.utime$FUNC, scope); - } - static utime ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.utime$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle utime$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("utime")); - public static VarHandle utime$VH() { - return fuse_operations.utime$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*utime)(char*,struct utimbuf*); - * } - */ - public static MemorySegment utime$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.utime$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*utime)(char*,struct utimbuf*); - * } - */ - public static void utime$set(MemorySegment seg, MemorySegment x) { - fuse_operations.utime$VH.set(seg, x); - } - public static MemorySegment utime$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.utime$VH.get(seg.asSlice(index*sizeof())); - } - public static void utime$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.utime$VH.set(seg.asSlice(index*sizeof()), x); - } - public static utime utime(MemorySegment segment, SegmentScope scope) { - return utime.ofAddress(utime$get(segment), scope); - } - static final FunctionDescriptor open$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle open$MH = RuntimeHelper.downcallHandle( - fuse_operations.open$FUNC - ); - /** - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public interface open { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(open fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(open.class, fi, fuse_operations.open$FUNC, scope); - } - static open ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.open$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle open$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("open")); - public static VarHandle open$VH() { - return fuse_operations.open$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment open$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.open$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*open)(char*,struct fuse_file_info*); - * } - */ - public static void open$set(MemorySegment seg, MemorySegment x) { - fuse_operations.open$VH.set(seg, x); - } - public static MemorySegment open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.open$VH.get(seg.asSlice(index*sizeof())); - } - public static void open$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.open$VH.set(seg.asSlice(index*sizeof()), x); - } - public static open open(MemorySegment segment, SegmentScope scope) { - return open.ofAddress(open$get(segment), scope); - } - static final FunctionDescriptor read$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read$MH = RuntimeHelper.downcallHandle( - fuse_operations.read$FUNC - ); - /** - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface read { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read.class, fi, fuse_operations.read$FUNC, scope); - } - static read ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read")); - public static VarHandle read$VH() { - return fuse_operations.read$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment read$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.read$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void read$set(MemorySegment seg, MemorySegment x) { - fuse_operations.read$VH.set(seg, x); - } - public static MemorySegment read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.read$VH.get(seg.asSlice(index*sizeof())); - } - public static void read$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.read$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read read(MemorySegment segment, SegmentScope scope) { - return read.ofAddress(read$get(segment), scope); - } - static final FunctionDescriptor write$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write$MH = RuntimeHelper.downcallHandle( - fuse_operations.write$FUNC - ); - /** - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface write { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(write fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write.class, fi, fuse_operations.write$FUNC, scope); - } - static write ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write")); - public static VarHandle write$VH() { - return fuse_operations.write$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment write$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.write$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write)(char*,char*,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void write$set(MemorySegment seg, MemorySegment x) { - fuse_operations.write$VH.set(seg, x); - } - public static MemorySegment write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.write$VH.get(seg.asSlice(index*sizeof())); - } - public static void write$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.write$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write write(MemorySegment segment, SegmentScope scope) { - return write.ofAddress(write$get(segment), scope); - } - static final FunctionDescriptor statfs$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle statfs$MH = RuntimeHelper.downcallHandle( - fuse_operations.statfs$FUNC - ); - /** - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public interface statfs { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(statfs fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse_operations.statfs$FUNC, scope); - } - static statfs ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.statfs$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle statfs$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("statfs")); - public static VarHandle statfs$VH() { - return fuse_operations.statfs$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public static MemorySegment statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.statfs$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*statfs)(char*,struct statvfs*); - * } - */ - public static void statfs$set(MemorySegment seg, MemorySegment x) { - fuse_operations.statfs$VH.set(seg, x); - } - public static MemorySegment statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.statfs$VH.get(seg.asSlice(index*sizeof())); - } - public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.statfs$VH.set(seg.asSlice(index*sizeof()), x); - } - public static statfs statfs(MemorySegment segment, SegmentScope scope) { - return statfs.ofAddress(statfs$get(segment), scope); - } - static final FunctionDescriptor flush$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle flush$MH = RuntimeHelper.downcallHandle( - fuse_operations.flush$FUNC - ); - /** - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public interface flush { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(flush fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse_operations.flush$FUNC, scope); - } - static flush ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.flush$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flush$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flush")); - public static VarHandle flush$VH() { - return fuse_operations.flush$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment flush$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.flush$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flush)(char*,struct fuse_file_info*); - * } - */ - public static void flush$set(MemorySegment seg, MemorySegment x) { - fuse_operations.flush$VH.set(seg, x); - } - public static MemorySegment flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.flush$VH.get(seg.asSlice(index*sizeof())); - } - public static void flush$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.flush$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flush flush(MemorySegment segment, SegmentScope scope) { - return flush.ofAddress(flush$get(segment), scope); - } - static final FunctionDescriptor release$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle release$MH = RuntimeHelper.downcallHandle( - fuse_operations.release$FUNC - ); - /** - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public interface release { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(release fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(release.class, fi, fuse_operations.release$FUNC, scope); - } - static release ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.release$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle release$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("release")); - public static VarHandle release$VH() { - return fuse_operations.release$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment release$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.release$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*release)(char*,struct fuse_file_info*); - * } - */ - public static void release$set(MemorySegment seg, MemorySegment x) { - fuse_operations.release$VH.set(seg, x); - } - public static MemorySegment release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.release$VH.get(seg.asSlice(index*sizeof())); - } - public static void release$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.release$VH.set(seg.asSlice(index*sizeof()), x); - } - public static release release(MemorySegment segment, SegmentScope scope) { - return release.ofAddress(release$get(segment), scope); - } - static final FunctionDescriptor fsync$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsync$MH = RuntimeHelper.downcallHandle( - fuse_operations.fsync$FUNC - ); - /** - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public interface fsync { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsync fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse_operations.fsync$FUNC, scope); - } - static fsync ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsync$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsync")); - public static VarHandle fsync$VH() { - return fuse_operations.fsync$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public static MemorySegment fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsync$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse_file_info*); - * } - */ - public static void fsync$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fsync$VH.set(seg, x); - } - public static MemorySegment fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsync$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fsync$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsync fsync(MemorySegment segment, SegmentScope scope) { - return fsync.ofAddress(fsync$get(segment), scope); - } - static final FunctionDescriptor setxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle setxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.setxattr$FUNC - ); - /** - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public interface setxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse_operations.setxattr$FUNC, scope); - } - static setxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { - try { - return (int)fuse_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle setxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); - public static VarHandle setxattr$VH() { - return fuse_operations.setxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public static MemorySegment setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.setxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,size_t,int); - * } - */ - public static void setxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.setxattr$VH.set(seg, x); - } - public static MemorySegment setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.setxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static setxattr setxattr(MemorySegment segment, SegmentScope scope) { - return setxattr.ofAddress(setxattr$get(segment), scope); - } - static final FunctionDescriptor getxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle getxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.getxattr$FUNC - ); - /** - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public interface getxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); - static MemorySegment allocate(getxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse_operations.getxattr$FUNC, scope); - } - static getxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { - try { - return (int)fuse_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); - public static VarHandle getxattr$VH() { - return fuse_operations.getxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public static MemorySegment getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.getxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,size_t); - * } - */ - public static void getxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.getxattr$VH.set(seg, x); - } - public static MemorySegment getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.getxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getxattr getxattr(MemorySegment segment, SegmentScope scope) { - return getxattr.ofAddress(getxattr$get(segment), scope); - } - static final FunctionDescriptor listxattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle listxattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.listxattr$FUNC - ); - /** - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public interface listxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(listxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse_operations.listxattr$FUNC, scope); - } - static listxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle listxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); - public static VarHandle listxattr$VH() { - return fuse_operations.listxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public static MemorySegment listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.listxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*listxattr)(char*,char*,size_t); - * } - */ - public static void listxattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.listxattr$VH.set(seg, x); - } - public static MemorySegment listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.listxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static listxattr listxattr(MemorySegment segment, SegmentScope scope) { - return listxattr.ofAddress(listxattr$get(segment), scope); - } - static final FunctionDescriptor removexattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.removexattr$FUNC - ); - /** - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public interface removexattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(removexattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse_operations.removexattr$FUNC, scope); - } - static removexattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle removexattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); - public static VarHandle removexattr$VH() { - return fuse_operations.removexattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static MemorySegment removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.removexattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static void removexattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.removexattr$VH.set(seg, x); - } - public static MemorySegment removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.removexattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static removexattr removexattr(MemorySegment segment, SegmentScope scope) { - return removexattr.ofAddress(removexattr$get(segment), scope); - } - static final FunctionDescriptor opendir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle opendir$MH = RuntimeHelper.downcallHandle( - fuse_operations.opendir$FUNC - ); - /** - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public interface opendir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(opendir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse_operations.opendir$FUNC, scope); - } - static opendir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.opendir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle opendir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("opendir")); - public static VarHandle opendir$VH() { - return fuse_operations.opendir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.opendir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse_file_info*); - * } - */ - public static void opendir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.opendir$VH.set(seg, x); - } - public static MemorySegment opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.opendir$VH.get(seg.asSlice(index*sizeof())); - } - public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.opendir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static opendir opendir(MemorySegment segment, SegmentScope scope) { - return opendir.ofAddress(opendir$get(segment), scope); - } - static final FunctionDescriptor readdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle readdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.readdir$FUNC - ); - /** - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); - * } - */ - public interface readdir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(readdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse_operations.readdir$FUNC, scope); - } - static readdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.readdir$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir")); - public static VarHandle readdir$VH() { - return fuse_operations.readdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.readdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readdir)(char*,void*,fuse_fill_dir_t,off_t,struct fuse_file_info*); - * } - */ - public static void readdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.readdir$VH.set(seg, x); - } - public static MemorySegment readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.readdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.readdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readdir readdir(MemorySegment segment, SegmentScope scope) { - return readdir.ofAddress(readdir$get(segment), scope); - } - static final FunctionDescriptor releasedir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle releasedir$MH = RuntimeHelper.downcallHandle( - fuse_operations.releasedir$FUNC - ); - /** - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public interface releasedir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(releasedir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse_operations.releasedir$FUNC, scope); - } - static releasedir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle releasedir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); - public static VarHandle releasedir$VH() { - return fuse_operations.releasedir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public static MemorySegment releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.releasedir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse_file_info*); - * } - */ - public static void releasedir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.releasedir$VH.set(seg, x); - } - public static MemorySegment releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); - } - public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.releasedir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static releasedir releasedir(MemorySegment segment, SegmentScope scope) { - return releasedir.ofAddress(releasedir$get(segment), scope); - } - static final FunctionDescriptor fsyncdir$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsyncdir$MH = RuntimeHelper.downcallHandle( - fuse_operations.fsyncdir$FUNC - ); - /** - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public interface fsyncdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsyncdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse_operations.fsyncdir$FUNC, scope); - } - static fsyncdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsyncdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); - public static VarHandle fsyncdir$VH() { - return fuse_operations.fsyncdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public static MemorySegment fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsyncdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse_file_info*); - * } - */ - public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fsyncdir$VH.set(seg, x); - } - public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fsyncdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsyncdir fsyncdir(MemorySegment segment, SegmentScope scope) { - return fsyncdir.ofAddress(fsyncdir$get(segment), scope); - } - static final FunctionDescriptor init$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle init$MH = RuntimeHelper.downcallHandle( - fuse_operations.init$FUNC - ); - /** - * {@snippet : - * void* (*init)(struct fuse_conn_info*); - * } - */ - public interface init { - - java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(init fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(init.class, fi, fuse_operations.init$FUNC, scope); - } - static init ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (java.lang.foreign.MemorySegment)fuse_operations.init$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle init$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("init")); - public static VarHandle init$VH() { - return fuse_operations.init$VH; - } - /** - * Getter for field: - * {@snippet : - * void* (*init)(struct fuse_conn_info*); - * } - */ - public static MemorySegment init$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.init$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void* (*init)(struct fuse_conn_info*); - * } - */ - public static void init$set(MemorySegment seg, MemorySegment x) { - fuse_operations.init$VH.set(seg, x); - } - public static MemorySegment init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.init$VH.get(seg.asSlice(index*sizeof())); - } - public static void init$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.init$VH.set(seg.asSlice(index*sizeof()), x); - } - public static init init(MemorySegment segment, SegmentScope scope) { - return init.ofAddress(init$get(segment), scope); - } - static final FunctionDescriptor destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( - fuse_operations.destroy$FUNC - ); - /** - * {@snippet : - * void (*destroy)(void*); - * } - */ - public interface destroy { - - void apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(destroy fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse_operations.destroy$FUNC, scope); - } - static destroy ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - fuse_operations.destroy$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle destroy$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("destroy")); - public static VarHandle destroy$VH() { - return fuse_operations.destroy$VH; - } - /** - * Getter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static MemorySegment destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.destroy$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static void destroy$set(MemorySegment seg, MemorySegment x) { - fuse_operations.destroy$VH.set(seg, x); - } - public static MemorySegment destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.destroy$VH.get(seg.asSlice(index*sizeof())); - } - public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.destroy$VH.set(seg.asSlice(index*sizeof()), x); - } - public static destroy destroy(MemorySegment segment, SegmentScope scope) { - return destroy.ofAddress(destroy$get(segment), scope); - } - static final FunctionDescriptor access$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle access$MH = RuntimeHelper.downcallHandle( - fuse_operations.access$FUNC - ); - /** - * {@snippet : - * int (*access)(char*,int); - * } - */ - public interface access { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(access fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(access.class, fi, fuse_operations.access$FUNC, scope); - } - static access ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse_operations.access$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle access$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("access")); - public static VarHandle access$VH() { - return fuse_operations.access$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static MemorySegment access$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.access$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static void access$set(MemorySegment seg, MemorySegment x) { - fuse_operations.access$VH.set(seg, x); - } - public static MemorySegment access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.access$VH.get(seg.asSlice(index*sizeof())); - } - public static void access$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.access$VH.set(seg.asSlice(index*sizeof()), x); - } - public static access access(MemorySegment segment, SegmentScope scope) { - return access.ofAddress(access$get(segment), scope); - } - static final FunctionDescriptor create$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_SHORT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle create$MH = RuntimeHelper.downcallHandle( - fuse_operations.create$FUNC - ); - /** - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public interface create { - - int apply(java.lang.foreign.MemorySegment _x0, short _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(create fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(create.class, fi, fuse_operations.create$FUNC, scope); - } - static create ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, short __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle create$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("create")); - public static VarHandle create$VH() { - return fuse_operations.create$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static MemorySegment create$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.create$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*create)(char*,mode_t,struct fuse_file_info*); - * } - */ - public static void create$set(MemorySegment seg, MemorySegment x) { - fuse_operations.create$VH.set(seg, x); - } - public static MemorySegment create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.create$VH.get(seg.asSlice(index*sizeof())); - } - public static void create$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.create$VH.set(seg.asSlice(index*sizeof()), x); - } - public static create create(MemorySegment segment, SegmentScope scope) { - return create.ofAddress(create$get(segment), scope); - } - static final FunctionDescriptor ftruncate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ftruncate$MH = RuntimeHelper.downcallHandle( - fuse_operations.ftruncate$FUNC - ); - /** - * {@snippet : - * int (*ftruncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public interface ftruncate { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(ftruncate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(ftruncate.class, fi, fuse_operations.ftruncate$FUNC, scope); - } - static ftruncate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.ftruncate$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle ftruncate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ftruncate")); - public static VarHandle ftruncate$VH() { - return fuse_operations.ftruncate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*ftruncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment ftruncate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.ftruncate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*ftruncate)(char*,off_t,struct fuse_file_info*); - * } - */ - public static void ftruncate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.ftruncate$VH.set(seg, x); - } - public static MemorySegment ftruncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.ftruncate$VH.get(seg.asSlice(index*sizeof())); - } - public static void ftruncate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.ftruncate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static ftruncate ftruncate(MemorySegment segment, SegmentScope scope) { - return ftruncate.ofAddress(ftruncate$get(segment), scope); - } - static final FunctionDescriptor fgetattr$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fgetattr$MH = RuntimeHelper.downcallHandle( - fuse_operations.fgetattr$FUNC - ); - /** - * {@snippet : - * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public interface fgetattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fgetattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fgetattr.class, fi, fuse_operations.fgetattr$FUNC, scope); - } - static fgetattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.fgetattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fgetattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fgetattr")); - public static VarHandle fgetattr$VH() { - return fuse_operations.fgetattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public static MemorySegment fgetattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fgetattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fgetattr)(char*,struct stat*,struct fuse_file_info*); - * } - */ - public static void fgetattr$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fgetattr$VH.set(seg, x); - } - public static MemorySegment fgetattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fgetattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void fgetattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fgetattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fgetattr fgetattr(MemorySegment segment, SegmentScope scope) { - return fgetattr.ofAddress(fgetattr$get(segment), scope); - } - static final FunctionDescriptor lock$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle lock$MH = RuntimeHelper.downcallHandle( - fuse_operations.lock$FUNC - ); - /** - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public interface lock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(lock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse_operations.lock$FUNC, scope); - } - static lock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle lock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock")); - public static VarHandle lock$VH() { - return fuse_operations.lock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public static MemorySegment lock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.lock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*lock)(char*,struct fuse_file_info*,int,struct flock*); - * } - */ - public static void lock$set(MemorySegment seg, MemorySegment x) { - fuse_operations.lock$VH.set(seg, x); - } - public static MemorySegment lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.lock$VH.get(seg.asSlice(index*sizeof())); - } - public static void lock$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.lock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static lock lock(MemorySegment segment, SegmentScope scope) { - return lock.ofAddress(lock$get(segment), scope); - } - static final FunctionDescriptor utimens$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle utimens$MH = RuntimeHelper.downcallHandle( - fuse_operations.utimens$FUNC - ); - /** - * {@snippet : - * int (*utimens)(char*,struct timespec*); - * } - */ - public interface utimens { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(utimens fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse_operations.utimens$FUNC, scope); - } - static utimens ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse_operations.utimens$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle utimens$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("utimens")); - public static VarHandle utimens$VH() { - return fuse_operations.utimens$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*utimens)(char*,struct timespec*); - * } - */ - public static MemorySegment utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.utimens$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*utimens)(char*,struct timespec*); - * } - */ - public static void utimens$set(MemorySegment seg, MemorySegment x) { - fuse_operations.utimens$VH.set(seg, x); - } - public static MemorySegment utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.utimens$VH.get(seg.asSlice(index*sizeof())); - } - public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.utimens$VH.set(seg.asSlice(index*sizeof()), x); - } - public static utimens utimens(MemorySegment segment, SegmentScope scope) { - return utimens.ofAddress(utimens$get(segment), scope); - } - static final FunctionDescriptor bmap$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle bmap$MH = RuntimeHelper.downcallHandle( - fuse_operations.bmap$FUNC - ); - /** - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public interface bmap { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(bmap fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse_operations.bmap$FUNC, scope); - } - static bmap ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle bmap$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("bmap")); - public static VarHandle bmap$VH() { - return fuse_operations.bmap$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public static MemorySegment bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.bmap$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*bmap)(char*,size_t,uint64_t*); - * } - */ - public static void bmap$set(MemorySegment seg, MemorySegment x) { - fuse_operations.bmap$VH.set(seg, x); - } - public static MemorySegment bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.bmap$VH.get(seg.asSlice(index*sizeof())); - } - public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.bmap$VH.set(seg.asSlice(index*sizeof()), x); - } - public static bmap bmap(MemorySegment segment, SegmentScope scope) { - return bmap.ofAddress(bmap$get(segment), scope); - } - static final FunctionDescriptor ioctl$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ioctl$MH = RuntimeHelper.downcallHandle( - fuse_operations.ioctl$FUNC - ); - /** - * {@snippet : - * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public interface ioctl { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); - static MemorySegment allocate(ioctl fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse_operations.ioctl$FUNC, scope); - } - static ioctl ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { - try { - return (int)fuse_operations.ioctl$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle ioctl$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); - public static VarHandle ioctl$VH() { - return fuse_operations.ioctl$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public static MemorySegment ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.ioctl$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*ioctl)(char*,int,void*,struct fuse_file_info*,unsigned int,void*); - * } - */ - public static void ioctl$set(MemorySegment seg, MemorySegment x) { - fuse_operations.ioctl$VH.set(seg, x); - } - public static MemorySegment ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); - } - public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.ioctl$VH.set(seg.asSlice(index*sizeof()), x); - } - public static ioctl ioctl(MemorySegment segment, SegmentScope scope) { - return ioctl.ofAddress(ioctl$get(segment), scope); - } - static final FunctionDescriptor poll$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle poll$MH = RuntimeHelper.downcallHandle( - fuse_operations.poll$FUNC - ); - /** - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public interface poll { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(poll fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse_operations.poll$FUNC, scope); - } - static poll ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle poll$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll")); - public static VarHandle poll$VH() { - return fuse_operations.poll$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public static MemorySegment poll$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.poll$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*poll)(char*,struct fuse_file_info*,struct fuse_pollhandle*,unsigned int*); - * } - */ - public static void poll$set(MemorySegment seg, MemorySegment x) { - fuse_operations.poll$VH.set(seg, x); - } - public static MemorySegment poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.poll$VH.get(seg.asSlice(index*sizeof())); - } - public static void poll$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.poll$VH.set(seg.asSlice(index*sizeof()), x); - } - public static poll poll(MemorySegment segment, SegmentScope scope) { - return poll.ofAddress(poll$get(segment), scope); - } - static final FunctionDescriptor write_buf$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write_buf$MH = RuntimeHelper.downcallHandle( - fuse_operations.write_buf$FUNC - ); - /** - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public interface write_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(write_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse_operations.write_buf$FUNC, scope); - } - static write_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); - public static VarHandle write_buf$VH() { - return fuse_operations.write_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.write_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse_bufvec*,off_t,struct fuse_file_info*); - * } - */ - public static void write_buf$set(MemorySegment seg, MemorySegment x) { - fuse_operations.write_buf$VH.set(seg, x); - } - public static MemorySegment write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.write_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write_buf write_buf(MemorySegment segment, SegmentScope scope) { - return write_buf.ofAddress(write_buf$get(segment), scope); - } - static final FunctionDescriptor read_buf$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read_buf$MH = RuntimeHelper.downcallHandle( - fuse_operations.read_buf$FUNC - ); - /** - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public interface read_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse_operations.read_buf$FUNC, scope); - } - static read_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.read_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); - public static VarHandle read_buf$VH() { - return fuse_operations.read_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.read_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse_bufvec**,size_t,off_t,struct fuse_file_info*); - * } - */ - public static void read_buf$set(MemorySegment seg, MemorySegment x) { - fuse_operations.read_buf$VH.set(seg, x); - } - public static MemorySegment read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.read_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read_buf read_buf(MemorySegment segment, SegmentScope scope) { - return read_buf.ofAddress(read_buf$get(segment), scope); - } - static final FunctionDescriptor flock$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT - ); - static final MethodHandle flock$MH = RuntimeHelper.downcallHandle( - fuse_operations.flock$FUNC - ); - /** - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public interface flock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(flock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse_operations.flock$FUNC, scope); - } - static flock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flock")); - public static VarHandle flock$VH() { - return fuse_operations.flock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public static MemorySegment flock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.flock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flock)(char*,struct fuse_file_info*,int); - * } - */ - public static void flock$set(MemorySegment seg, MemorySegment x) { - fuse_operations.flock$VH.set(seg, x); - } - public static MemorySegment flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.flock$VH.get(seg.asSlice(index*sizeof())); - } - public static void flock$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.flock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flock flock(MemorySegment segment, SegmentScope scope) { - return flock.ofAddress(flock$get(segment), scope); - } - static final FunctionDescriptor fallocate$FUNC = FunctionDescriptor.of(Constants$root.C_INT$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_INT$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fallocate$MH = RuntimeHelper.downcallHandle( - fuse_operations.fallocate$FUNC - ); - /** - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public interface fallocate { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(fallocate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse_operations.fallocate$FUNC, scope); - } - static fallocate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fallocate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); - public static VarHandle fallocate$VH() { - return fuse_operations.fallocate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public static MemorySegment fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_operations.fallocate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fallocate)(char*,int,off_t,off_t,struct fuse_file_info*); - * } - */ - public static void fallocate$set(MemorySegment seg, MemorySegment x) { - fuse_operations.fallocate$VH.set(seg, x); - } - public static MemorySegment fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); - } - public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { - fuse_operations.fallocate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fallocate fallocate(MemorySegment segment, SegmentScope scope) { - return fallocate.ofAddress(fallocate$get(segment), scope); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } -} - - diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/RuntimeHelper.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/RuntimeHelper.java similarity index 88% rename from jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/RuntimeHelper.java rename to jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/RuntimeHelper.java index 49c02a4f..bfaad500 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/RuntimeHelper.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/RuntimeHelper.java @@ -1,4 +1,4 @@ -package org.cryptomator.jfuse.linux.aarch64.extr; +package org.cryptomator.jfuse.mac.extr.stat; // Generated by jextract import java.lang.foreign.Linker; @@ -7,7 +7,7 @@ import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; +import java.lang.foreign.Arena; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -20,6 +20,9 @@ import java.util.Optional; import java.util.stream.Stream; +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + import static java.lang.foreign.Linker.*; import static java.lang.foreign.ValueLayout.*; @@ -30,9 +33,10 @@ final class RuntimeHelper { private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); private static final SymbolLookup SYMBOL_LOOKUP; private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); + (size, align) -> Arena.ofAuto().allocate(size, align); static { @@ -51,7 +55,9 @@ static T requireNonNull(T obj, String symbolName) { } static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); } static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { @@ -70,18 +76,25 @@ static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc orElse(null); } - static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); - handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, scope); + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { - return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); } // Internals only below this point diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/constants$0.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/constants$0.java new file mode 100644 index 00000000..dffba8a2 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.stat; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/stat_h.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/stat_h.java new file mode 100644 index 00000000..ec133788 --- /dev/null +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat/stat_h.java @@ -0,0 +1,38 @@ +// Generated by jextract + +package org.cryptomator.jfuse.mac.extr.stat; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +public class stat_h { + + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfLong C_LONG = JAVA_LONG; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; + /** + * {@snippet : + * #define UTIME_NOW -1 + * } + */ + public static int UTIME_NOW() { + return (int)-1L; + } + /** + * {@snippet : + * #define UTIME_OMIT -2 + * } + */ + public static int UTIME_OMIT() { + return (int)-2L; + } +} + + diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat_h.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat_h.java deleted file mode 100644 index 5b7a498d..00000000 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/stat_h.java +++ /dev/null @@ -1,38 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.mac.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -public class stat_h { - - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static final OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; - /** - * {@snippet : - * #define UTIME_NOW -1 - * } - */ - public static int UTIME_NOW() { - return (int)-1L; - } - /** - * {@snippet : - * #define UTIME_OMIT -2 - * } - */ - public static int UTIME_OMIT() { - return (int)-2L; - } -} - - diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FileInfoImplTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FileInfoImplTest.java index 043e7690..6ee83401 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FileInfoImplTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FileInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; -import org.cryptomator.jfuse.mac.extr.fcntl_h; -import org.cryptomator.jfuse.mac.extr.fuse_file_info; +import org.cryptomator.jfuse.mac.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_file_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; @@ -20,7 +20,7 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var fi = new FileInfoImpl(fuse_file_info.allocate(arena)); fuse_file_info.flags$set(fi.segment(), flags); diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseConnInfoImplTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseConnInfoImplTest.java index 5cbbd332..12347845 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseConnInfoImplTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseConnInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.mac.extr.fuse_conn_info; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_conn_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(segment, 42); @@ -53,9 +53,9 @@ private interface GetInConnInfo extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInConnInfo setter, GetInMemorySegment getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(connInfo, 42); diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseImplTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseImplTest.java index 66817242..9fbf5d0b 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseImplTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/FuseImplTest.java @@ -3,10 +3,10 @@ import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.mac.extr.fuse_file_info; -import org.cryptomator.jfuse.mac.extr.fuse_h; -import org.cryptomator.jfuse.mac.extr.stat; -import org.cryptomator.jfuse.mac.extr.timespec; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_file_info; +import org.cryptomator.jfuse.mac.extr.fuse.fuse_h; +import org.cryptomator.jfuse.mac.extr.fuse.stat; +import org.cryptomator.jfuse.mac.extr.fuse.timespec; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -79,7 +79,7 @@ public void testFuseMountFails() { @DisplayName("parseArgs") public void testParseArgs() { try (var fuseH = Mockito.mockStatic(fuse_h.class); - var arena = Arena.openConfined()) { + var arena = Arena.ofConfined()) { fuseH.when(() -> fuse_h.fuse_parse_cmdline(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).then(invocation -> { MemorySegment mp = invocation.getArgument(1); MemorySegment mt = invocation.getArgument(2); @@ -107,7 +107,7 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); @@ -121,7 +121,7 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsync(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -135,7 +135,7 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsyncdir(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -155,7 +155,7 @@ public class Utimens { @DisplayName("utimens(\"/foo\", UTIME_NOW, UTIME_NOW)") @Test public void testUtimensNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var times = MemorySegment.NULL; Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(TimeSpec::isUtimeNow), Mockito.argThat(TimeSpec::isUtimeNow), Mockito.isNull()); @@ -175,7 +175,7 @@ public void testUtimensNow() { public void testUtimens(long sec0, long nsec0, long sec1, long nsec1) { Instant expectedATime = Instant.ofEpochSecond(sec0, nsec0); Instant expectedMTime = Instant.ofEpochSecond(sec1, nsec1); - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var times = timespec.allocateArray(2, arena); timespec.tv_sec$set(times, 0, sec0); @@ -198,7 +198,7 @@ public class Attr { @Test @DisplayName("getattr") public void testGetattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var attr = stat.allocate(arena); Mockito.doReturn(42).when(fuseOps).getattr(Mockito.eq("/foo"), Mockito.any(), Mockito.isNull()); @@ -212,7 +212,7 @@ public void testGetattr() { @Test @DisplayName("fgetattr") public void testFgetattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var attr = stat.allocate(arena); var fi = fuse_file_info.allocate(arena); @@ -227,7 +227,7 @@ public void testFgetattr() { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -243,7 +243,7 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -259,7 +259,7 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var list = arena.allocate(100); @@ -274,7 +274,7 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); @@ -295,7 +295,7 @@ public class Truncate { @Test @DisplayName("truncate") public void testTruncate() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); Mockito.doReturn(42).when(fuseOps).truncate(Mockito.eq("/foo"), Mockito.eq(1337L), Mockito.isNull()); @@ -308,7 +308,7 @@ public void testTruncate() { @Test @DisplayName("ftruncate") public void testFtruncate() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).truncate(Mockito.eq("/foo"), Mockito.eq(1337L), Mockito.notNull()); @@ -324,7 +324,7 @@ public void testFtruncate() { @Test @DisplayName("chown") public void testChown() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); Mockito.doReturn(42).when(fuseOps).chown("/foo", 42, 1337, null); diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/MacErrnoTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/MacErrnoTest.java index 6d40c6ea..87c40311 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/MacErrnoTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/MacErrnoTest.java @@ -1,15 +1,20 @@ package org.cryptomator.jfuse.mac; +import org.cryptomator.jfuse.api.Errno; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.ValueSource; +import org.junit.jupiter.params.provider.MethodSource; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.stream.Stream; public class MacErrnoTest { @DisplayName("make sure method is not a stub") @ParameterizedTest(name = "{0}()") - @ValueSource(strings = {"enoent", "enosys", "enomem", "eacces", "eio", "erofs", "ebadf", "eexist", "enotdir", "eisdir", "enotempty", "einval"}) + @MethodSource("errnoNameProvider") public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationException { var errno = new MacErrno(); var method = MacErrno.class.getMethod(methodName); @@ -19,4 +24,8 @@ public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationExce Assertions.assertNotEquals(0, result); } + static Stream errnoNameProvider() { + return Arrays.stream(Errno.class.getDeclaredMethods()).map(Method::getName); + } + } \ No newline at end of file diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatImplTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatImplTest.java index 258a312a..8bf87467 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatImplTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.mac.extr.stat; +import org.cryptomator.jfuse.mac.extr.fuse.stat; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(segment, value); @@ -49,9 +49,9 @@ private interface GetInStat extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInStat setter, GetInMemorySegment getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(stat, value); diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatvfsImplTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatvfsImplTest.java index e16c62f5..4ecb1c2c 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatvfsImplTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/StatvfsImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; import org.cryptomator.jfuse.api.Statvfs; -import org.cryptomator.jfuse.mac.extr.statvfs; +import org.cryptomator.jfuse.mac.extr.fuse.statvfs; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class StatvfsImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStatvfs getter, Number value, long expected) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = statvfs.allocate(arena); - var statvfs = new StatvfsImpl(segment, arena.scope()); + var statvfs = new StatvfsImpl(segment, arena); setter.accept(segment, value); @@ -57,9 +57,9 @@ private interface GetInStatvfs extends Function { @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInStatvfs setter, GetInMemorySegment getter, Number value, long expected) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = statvfs.allocate(arena); - var statvfs = new StatvfsImpl(segment, arena.scope()); + var statvfs = new StatvfsImpl(segment, arena); setter.accept(statvfs, value.longValue()); diff --git a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/TimeSpecImplTest.java b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/TimeSpecImplTest.java index c0bb73df..42b2be25 100644 --- a/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/TimeSpecImplTest.java +++ b/jfuse-mac/src/test/java/org/cryptomator/jfuse/mac/TimeSpecImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; -import org.cryptomator.jfuse.mac.extr.stat_h; -import org.cryptomator.jfuse.mac.extr.timespec; +import org.cryptomator.jfuse.mac.extr.stat.stat_h; +import org.cryptomator.jfuse.mac.extr.fuse.timespec; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -14,7 +14,7 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,7 +29,7 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 0L); timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,7 +44,7 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), stat_h.UTIME_OMIT()); @@ -57,7 +57,7 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), stat_h.UTIME_NOW()); diff --git a/jfuse-tests/pom.xml b/jfuse-tests/pom.xml index e863069c..419c50ea 100644 --- a/jfuse-tests/pom.xml +++ b/jfuse-tests/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse-tests diff --git a/jfuse-win/pom.xml b/jfuse-win/pom.xml index fff7c213..c0786145 100644 --- a/jfuse-win/pom.xml +++ b/jfuse-win/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse-win @@ -14,7 +14,7 @@ https://github.com/cryptomator/jfuse/tree/develop/jfuse-win - C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt + C:\Program Files (x86)\Windows Kits\10\Include\10.0.22621.0\ucrt C:\Users\Arbeit\Skymatic\jextract\build\jextract\bin\jextract.bat @@ -76,7 +76,7 @@ ${jextract.executable} ${win.ucrtHeaderPath} ${project.build.sourceDirectory} - org.cryptomator.jfuse.win.extr + org.cryptomator.jfuse.win.extr.fuse3 @@ -145,6 +145,7 @@ sources + org.cryptomator.jfuse.win.extr.errno ${win.ucrtHeaderPath}/errno.h errno_h @@ -164,6 +165,7 @@ ERANGE ENOLCK ENAMETOOLONG + ENODATA @@ -173,6 +175,7 @@ sources + org.cryptomator.jfuse.win.extr.fcntl ${win.ucrtHeaderPath}/fcntl.h fcntl_h diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/DirFillerImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/DirFillerImpl.java index edc496e8..e20ee4d3 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/DirFillerImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/DirFillerImpl.java @@ -2,8 +2,8 @@ import org.cryptomator.jfuse.api.DirFiller; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.win.extr.fuse3_fill_dir_t; -import org.cryptomator.jfuse.win.extr.fuse_stat; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_fill_dir_t; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_stat; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; @@ -12,7 +12,7 @@ record DirFillerImpl(MemorySegment buf, fuse3_fill_dir_t callback, Arena arena) implements DirFiller { DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { - this(buf, fuse3_fill_dir_t.ofAddress(callback, arena.scope()), arena); + this(buf, fuse3_fill_dir_t.ofAddress(callback, arena), arena); } @Override diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FileInfoImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FileInfoImpl.java index 39ba56f9..33e9c17f 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FileInfoImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FileInfoImpl.java @@ -1,11 +1,11 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FileInfo; -import org.cryptomator.jfuse.win.extr.fcntl_h; -import org.cryptomator.jfuse.win.extr.fuse3_file_info; +import org.cryptomator.jfuse.win.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_file_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -20,7 +20,7 @@ record FileInfoImpl(MemorySegment segment) implements FileInfo { private static final int O_TRUNC = fcntl_h.O_TRUNC(); private static final int O_EXCL = fcntl_h.O_EXCL(); - public FileInfoImpl(MemorySegment address, SegmentScope scope) { + public FileInfoImpl(MemorySegment address, Arena scope) { this(fuse3_file_info.ofAddress(address, scope)); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseArgs.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseArgs.java index 5721a1b7..dd639006 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseArgs.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseArgs.java @@ -14,10 +14,10 @@ public String toString() { var argc = fuse_args.argc$get(args); var argv = fuse_args.argv$get(args); for (int i = 0; i < argc; i++) { - var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS, i).reinterpret(Long.MAX_VALUE); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } - sb.append("mountPoint = ").append(mountPoint().getUtf8String(0)); + sb.append("mountPoint = ").append(mountPoint().reinterpret(Long.MAX_VALUE).getUtf8String(0)).append(", "); sb.append("singlethreaded = ").append(!multiThreaded); return sb.toString(); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConfigImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConfigImpl.java index 69a2073e..7c4889f9 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConfigImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConfigImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FuseConfig; -import org.cryptomator.jfuse.win.extr.fuse3_config; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_config; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConfigImpl(MemorySegment segment) implements FuseConfig { - public FuseConfigImpl(MemorySegment address, SegmentScope scope) { + public FuseConfigImpl(MemorySegment address, Arena scope) { this(fuse3_config.ofAddress(address, scope)); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConnInfoImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConnInfoImpl.java index 5d4c393e..8893f719 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConnInfoImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseConnInfoImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.win.extr.fuse3_conn_info; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_conn_info; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) { + public FuseConnInfoImpl(MemorySegment address, Arena scope) { this(fuse3_conn_info.ofAddress(address, scope)); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseImpl.java index 8d1586e9..bce9878d 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseImpl.java @@ -7,9 +7,9 @@ import org.cryptomator.jfuse.api.FuseOperations; import org.cryptomator.jfuse.win.extr.fuse2.fuse2_h; import org.cryptomator.jfuse.win.extr.fuse2.fuse_args; -import org.cryptomator.jfuse.win.extr.fuse3_operations; -import org.cryptomator.jfuse.win.extr.fuse_h; -import org.cryptomator.jfuse.win.extr.fuse_timespec; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_operations; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_timespec; import org.jetbrains.annotations.VisibleForTesting; import java.lang.foreign.Arena; @@ -72,73 +72,73 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { throw new IllegalArgumentException("fuse_parse_cmdline failed to parse " + String.join(" ", cmdLineArgs)); } var isMultiThreaded = multithreaded.get(JAVA_INT, 0) == 1; - var mountPoint = mountPointPtr.get(ValueLayout.ADDRESS.asUnbounded(), 0); + var mountPoint = mountPointPtr.get(ValueLayout.ADDRESS.withoutTargetLayout().withName("mountpoint"), 0); return new FuseArgs(args, mountPoint, isMultiThreaded); } @Override protected void bind(FuseOperations.Operation operation) { switch (operation) { - case INIT -> fuse3_operations.init$set(fuseOperationsStruct, fuse3_operations.init.allocate(this::init, fuseArena.scope())); + case INIT -> fuse3_operations.init$set(fuseOperationsStruct, fuse3_operations.init.allocate(this::init, fuseArena)); case ACCESS -> fuse3_operations.access$set(fuseOperationsStruct, MemorySegment.NULL); - case CHMOD -> fuse3_operations.chmod$set(fuseOperationsStruct, fuse3_operations.chmod.allocate(this::chmod, fuseArena.scope())); - case CHOWN -> fuse3_operations.chown$set(fuseOperationsStruct, fuse3_operations.chown.allocate(this::chown, fuseArena.scope())); - case CREATE -> fuse3_operations.create$set(fuseOperationsStruct, fuse3_operations.create.allocate(this::create, fuseArena.scope())); - case DESTROY -> fuse3_operations.destroy$set(fuseOperationsStruct, fuse3_operations.destroy.allocate(this::destroy, fuseArena.scope())); - case FLUSH -> fuse3_operations.flush$set(fuseOperationsStruct, fuse3_operations.flush.allocate(this::flush, fuseArena.scope())); - case FSYNC -> fuse3_operations.fsync$set(fuseOperationsStruct, fuse3_operations.fsync.allocate(this::fsync, fuseArena.scope())); - case FSYNCDIR -> fuse3_operations.fsyncdir$set(fuseOperationsStruct, fuse3_operations.fsyncdir.allocate(this::fsyncdir, fuseArena.scope())); - case GET_ATTR -> fuse3_operations.getattr$set(fuseOperationsStruct, fuse3_operations.getattr.allocate(this::getattr, fuseArena.scope())); - case GET_XATTR -> fuse3_operations.getxattr$set(fuseOperationsStruct, fuse3_operations.getxattr.allocate(this::getxattr, fuseArena.scope())); - case LIST_XATTR -> fuse3_operations.listxattr$set(fuseOperationsStruct, fuse3_operations.listxattr.allocate(this::listxattr, fuseArena.scope())); - case MKDIR -> fuse3_operations.mkdir$set(fuseOperationsStruct, fuse3_operations.mkdir.allocate(this::mkdir, fuseArena.scope())); - case OPEN -> fuse3_operations.open$set(fuseOperationsStruct, fuse3_operations.open.allocate(this::open, fuseArena.scope())); - case OPEN_DIR -> fuse3_operations.opendir$set(fuseOperationsStruct, fuse3_operations.opendir.allocate(this::opendir, fuseArena.scope())); - case READ -> fuse3_operations.read$set(fuseOperationsStruct, fuse3_operations.read.allocate(this::read, fuseArena.scope())); - case READ_DIR -> fuse3_operations.readdir$set(fuseOperationsStruct, fuse3_operations.readdir.allocate(this::readdir, fuseArena.scope())); - case READLINK -> fuse3_operations.readlink$set(fuseOperationsStruct, fuse3_operations.readlink.allocate(this::readlink, fuseArena.scope())); - case RELEASE -> fuse3_operations.release$set(fuseOperationsStruct, fuse3_operations.release.allocate(this::release, fuseArena.scope())); - case RELEASE_DIR -> fuse3_operations.releasedir$set(fuseOperationsStruct, fuse3_operations.releasedir.allocate(this::releasedir, fuseArena.scope())); - case REMOVE_XATTR -> fuse3_operations.removexattr$set(fuseOperationsStruct, fuse3_operations.removexattr.allocate(this::removexattr, fuseArena.scope())); - case RENAME -> fuse3_operations.rename$set(fuseOperationsStruct, fuse3_operations.rename.allocate(this::rename, fuseArena.scope())); - case RMDIR -> fuse3_operations.rmdir$set(fuseOperationsStruct, fuse3_operations.rmdir.allocate(this::rmdir, fuseArena.scope())); - case SET_XATTR -> fuse3_operations.setxattr$set(fuseOperationsStruct, fuse3_operations.setxattr.allocate(this::setxattr, fuseArena.scope())); - case STATFS -> fuse3_operations.statfs$set(fuseOperationsStruct, fuse3_operations.statfs.allocate(this::statfs, fuseArena.scope())); - case SYMLINK -> fuse3_operations.symlink$set(fuseOperationsStruct, fuse3_operations.symlink.allocate(this::symlink, fuseArena.scope())); - case TRUNCATE -> fuse3_operations.truncate$set(fuseOperationsStruct, fuse3_operations.truncate.allocate(this::truncate, fuseArena.scope())); - case UNLINK -> fuse3_operations.unlink$set(fuseOperationsStruct, fuse3_operations.unlink.allocate(this::unlink, fuseArena.scope())); - case UTIMENS -> fuse3_operations.utimens$set(fuseOperationsStruct, fuse3_operations.utimens.allocate(this::utimens, fuseArena.scope())); - case WRITE -> fuse3_operations.write$set(fuseOperationsStruct, fuse3_operations.write.allocate(this::write, fuseArena.scope())); + case CHMOD -> fuse3_operations.chmod$set(fuseOperationsStruct, fuse3_operations.chmod.allocate(this::chmod, fuseArena)); + case CHOWN -> fuse3_operations.chown$set(fuseOperationsStruct, fuse3_operations.chown.allocate(this::chown, fuseArena)); + case CREATE -> fuse3_operations.create$set(fuseOperationsStruct, fuse3_operations.create.allocate(this::create, fuseArena)); + case DESTROY -> fuse3_operations.destroy$set(fuseOperationsStruct, fuse3_operations.destroy.allocate(this::destroy, fuseArena)); + case FLUSH -> fuse3_operations.flush$set(fuseOperationsStruct, fuse3_operations.flush.allocate(this::flush, fuseArena)); + case FSYNC -> fuse3_operations.fsync$set(fuseOperationsStruct, fuse3_operations.fsync.allocate(this::fsync, fuseArena)); + case FSYNCDIR -> fuse3_operations.fsyncdir$set(fuseOperationsStruct, fuse3_operations.fsyncdir.allocate(this::fsyncdir, fuseArena)); + case GET_ATTR -> fuse3_operations.getattr$set(fuseOperationsStruct, fuse3_operations.getattr.allocate(this::getattr, fuseArena)); + case GET_XATTR -> fuse3_operations.getxattr$set(fuseOperationsStruct, fuse3_operations.getxattr.allocate(this::getxattr, fuseArena)); + case LIST_XATTR -> fuse3_operations.listxattr$set(fuseOperationsStruct, fuse3_operations.listxattr.allocate(this::listxattr, fuseArena)); + case MKDIR -> fuse3_operations.mkdir$set(fuseOperationsStruct, fuse3_operations.mkdir.allocate(this::mkdir, fuseArena)); + case OPEN -> fuse3_operations.open$set(fuseOperationsStruct, fuse3_operations.open.allocate(this::open, fuseArena)); + case OPEN_DIR -> fuse3_operations.opendir$set(fuseOperationsStruct, fuse3_operations.opendir.allocate(this::opendir, fuseArena)); + case READ -> fuse3_operations.read$set(fuseOperationsStruct, fuse3_operations.read.allocate(this::read, fuseArena)); + case READ_DIR -> fuse3_operations.readdir$set(fuseOperationsStruct, fuse3_operations.readdir.allocate(this::readdir, fuseArena)); + case READLINK -> fuse3_operations.readlink$set(fuseOperationsStruct, fuse3_operations.readlink.allocate(this::readlink, fuseArena)); + case RELEASE -> fuse3_operations.release$set(fuseOperationsStruct, fuse3_operations.release.allocate(this::release, fuseArena)); + case RELEASE_DIR -> fuse3_operations.releasedir$set(fuseOperationsStruct, fuse3_operations.releasedir.allocate(this::releasedir, fuseArena)); + case REMOVE_XATTR -> fuse3_operations.removexattr$set(fuseOperationsStruct, fuse3_operations.removexattr.allocate(this::removexattr, fuseArena)); + case RENAME -> fuse3_operations.rename$set(fuseOperationsStruct, fuse3_operations.rename.allocate(this::rename, fuseArena)); + case RMDIR -> fuse3_operations.rmdir$set(fuseOperationsStruct, fuse3_operations.rmdir.allocate(this::rmdir, fuseArena)); + case SET_XATTR -> fuse3_operations.setxattr$set(fuseOperationsStruct, fuse3_operations.setxattr.allocate(this::setxattr, fuseArena)); + case STATFS -> fuse3_operations.statfs$set(fuseOperationsStruct, fuse3_operations.statfs.allocate(this::statfs, fuseArena)); + case SYMLINK -> fuse3_operations.symlink$set(fuseOperationsStruct, fuse3_operations.symlink.allocate(this::symlink, fuseArena)); + case TRUNCATE -> fuse3_operations.truncate$set(fuseOperationsStruct, fuse3_operations.truncate.allocate(this::truncate, fuseArena)); + case UNLINK -> fuse3_operations.unlink$set(fuseOperationsStruct, fuse3_operations.unlink.allocate(this::unlink, fuseArena)); + case UTIMENS -> fuse3_operations.utimens$set(fuseOperationsStruct, fuse3_operations.utimens.allocate(this::utimens, fuseArena)); + case WRITE -> fuse3_operations.write$set(fuseOperationsStruct, fuse3_operations.write.allocate(this::write, fuseArena)); } } @VisibleForTesting MemorySegment init(MemorySegment conn, MemorySegment cfg) { - try (var arena = Arena.openConfined()) { - var connInfo = new FuseConnInfoImpl(conn, arena.scope()); + try (var arena = Arena.ofConfined()) { + var connInfo = new FuseConnInfoImpl(conn, arena); connInfo.setWant(connInfo.want() | FuseConnInfo.FUSE_CAP_READDIRPLUS); - var config = new FuseConfigImpl(cfg, arena.scope()); + var config = new FuseConfigImpl(cfg, arena); fuseOperations.init(connInfo, config); } return MemorySegment.NULL; } private int chmod(MemorySegment path, int mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int chown(MemorySegment path, int uid, int gid, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, arena)); } } private int create(MemorySegment path, int mode, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, arena)); } } @@ -148,52 +148,48 @@ private void destroy(MemorySegment addr) { @VisibleForTesting int flush(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsync(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int fsyncdir(MemorySegment path, int datasync, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, arena)); } } @VisibleForTesting int getattr(MemorySegment path, MemorySegment stat, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena.scope()), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena), new FileInfoImpl(fi, arena)); } } @VisibleForTesting int getxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), value.asSlice(0, size).asByteBuffer()); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), val); } @VisibleForTesting int setxattr(MemorySegment path, MemorySegment name, MemorySegment value, long size, int flags) { - try (var arena = Arena.openConfined()) { - - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), value.asSlice(0, size).asByteBuffer(), flags); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), val, flags); } @VisibleForTesting int listxattr(MemorySegment path, MemorySegment value, long size) { - try (var arena = Arena.openConfined()) { - return fuseOperations.listxattr(path.getUtf8String(0), value.asSlice(0, size).asByteBuffer()); - } + var val = value.reinterpret(size).asByteBuffer(); + return fuseOperations.listxattr(path.getUtf8String(0), val); } @VisibleForTesting @@ -206,46 +202,44 @@ private int mkdir(MemorySegment path, int mode) { } private int open(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int opendir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int read(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } private int readdir(MemorySegment path, MemorySegment buf, MemorySegment filler, long offset, MemorySegment fi, int flags) { - try (var arena = Arena.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena.scope()), flags); + try (var arena = Arena.ofConfined()) { + return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, arena), offset, new FileInfoImpl(fi, arena), flags); } } private int readlink(MemorySegment path, MemorySegment buf, long len) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), len, arena.scope()).asByteBuffer(); - return fuseOperations.readlink(path.getUtf8String(0), buffer, len); - } + var buffer = buf.reinterpret(len).asByteBuffer(); + return fuseOperations.readlink(path.getUtf8String(0), buffer, len); } private int release(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } private int releasedir(MemorySegment path, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena)); } } @@ -258,8 +252,8 @@ private int rmdir(MemorySegment path) { } private int statfs(MemorySegment path, MemorySegment statvfs) { - try (var arena = Arena.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena)); } } @@ -269,8 +263,8 @@ private int symlink(MemorySegment linkname, MemorySegment target) { @VisibleForTesting int truncate(MemorySegment path, long size, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, arena)); } } @@ -280,21 +274,21 @@ private int unlink(MemorySegment path) { @VisibleForTesting int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { // On Windows we know for sure that WinFSP will call this function only with // valid times: https://github.com/winfsp/winfsp/discussions/445 var seq = MemoryLayout.sequenceLayout(2, fuse_timespec.$LAYOUT()); - var segment = MemorySegment.ofAddress(times.address(), seq.byteSize(), arena.scope()); + var segment = times.reinterpret(seq.byteSize()); var time0 = segment.asSlice(0, fuse_timespec.$LAYOUT().byteSize()); var time1 = segment.asSlice(fuse_timespec.$LAYOUT().byteSize(), fuse_timespec.$LAYOUT().byteSize()); - return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena.scope())); + return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena)); } } private int write(MemorySegment path, MemorySegment buf, long size, long offset, MemorySegment fi) { - try (var arena = Arena.openConfined()) { - var buffer = MemorySegment.ofAddress(buf.address(), size, arena.scope()).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena.scope())); + try (var arena = Arena.ofConfined()) { + var buffer = buf.reinterpret(size).asByteBuffer(); + return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, arena)); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java index 565c6216..b5e33c13 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/FuseMountImpl.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.win.extr.fuse3_loop_config; -import org.cryptomator.jfuse.win.extr.fuse_h; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_loop_config; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_h; import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatImpl.java index 92c2bb48..d55b2a79 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatImpl.java @@ -2,14 +2,14 @@ import org.cryptomator.jfuse.api.Stat; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.win.extr.fuse_stat; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_stat; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemorySegment address, SegmentScope scope) { + public StatImpl(MemorySegment address, Arena scope) { this(fuse_stat.ofAddress(address, scope)); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatvfsImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatvfsImpl.java index d0e54f48..40c4d129 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatvfsImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/StatvfsImpl.java @@ -1,14 +1,14 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.Statvfs; -import org.cryptomator.jfuse.win.extr.fuse_statvfs; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_statvfs; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemorySegment address, SegmentScope scope) { + public StatvfsImpl(MemorySegment address, Arena scope) { this(fuse_statvfs.ofAddress(address, scope)); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/TimeSpecImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/TimeSpecImpl.java index 99d16e57..be25a16a 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/TimeSpecImpl.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/TimeSpecImpl.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.TimeSpec; -import org.cryptomator.jfuse.win.extr.fuse_timespec; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_timespec; import java.lang.foreign.MemorySegment; import java.time.Instant; diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/WinErrno.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/WinErrno.java index f9e026d4..35e65454 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/WinErrno.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/WinErrno.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.Errno; -import org.cryptomator.jfuse.win.extr.errno_h; +import org.cryptomator.jfuse.win.extr.errno.errno_h; record WinErrno() implements Errno { @@ -84,4 +84,9 @@ public int enolck() { public int enametoolong() { return errno_h.ENAMETOOLONG(); } + + @Override + public int enodata() { + return errno_h.ENODATA(); + } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/Constants$root.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/Constants$root.java deleted file mode 100644 index 82933b6f..00000000 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/Constants$root.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.win.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class Constants$root { - - // Suppresses default constructor, ensuring non-instantiability. - private Constants$root() {} - static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; - static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; - static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; - static final OfInt C_INT$LAYOUT = JAVA_INT; - static final OfInt C_LONG$LAYOUT = JAVA_INT; - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded(); -} - - diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$0.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$0.java deleted file mode 100644 index 6d136369..00000000 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$0.java +++ /dev/null @@ -1,58 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.win.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$0 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$0() {} - static final FunctionDescriptor fuse3_fill_dir_t$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle fuse3_fill_dir_t$MH = RuntimeHelper.downcallHandle( - constants$0.fuse3_fill_dir_t$FUNC - ); - static final FunctionDescriptor fuse3_lib_help$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_lib_help$MH = RuntimeHelper.downcallHandle( - "fuse3_lib_help", - constants$0.fuse3_lib_help$FUNC - ); - static final FunctionDescriptor fuse3_new$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_new$MH = RuntimeHelper.downcallHandle( - "fuse3_new", - constants$0.fuse3_new$FUNC - ); - static final FunctionDescriptor fuse3_destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_destroy$MH = RuntimeHelper.downcallHandle( - "fuse3_destroy", - constants$0.fuse3_destroy$FUNC - ); - static final FunctionDescriptor fuse3_mount$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_mount$MH = RuntimeHelper.downcallHandle( - "fuse3_mount", - constants$0.fuse3_mount$FUNC - ); -} - - diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java deleted file mode 100644 index 04ca74e9..00000000 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/constants$1.java +++ /dev/null @@ -1,52 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.win.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class constants$1 { - - // Suppresses default constructor, ensuring non-instantiability. - private constants$1() {} - static final FunctionDescriptor fuse3_unmount$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_unmount$MH = RuntimeHelper.downcallHandle( - "fuse3_unmount", - constants$1.fuse3_unmount$FUNC - ); - static final FunctionDescriptor fuse3_loop$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_loop$MH = RuntimeHelper.downcallHandle( - "fuse3_loop", - constants$1.fuse3_loop$FUNC - ); - static final FunctionDescriptor fuse3_loop_mt_31$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle fuse3_loop_mt_31$MH = RuntimeHelper.downcallHandle( - "fuse3_loop_mt_31", - constants$1.fuse3_loop_mt_31$FUNC - ); - static final FunctionDescriptor fuse3_exit$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_exit$MH = RuntimeHelper.downcallHandle( - "fuse3_exit", - constants$1.fuse3_exit$FUNC - ); - static final FunctionDescriptor fuse3_get_session$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fuse3_get_session$MH = RuntimeHelper.downcallHandle( - "fuse3_get_session", - constants$1.fuse3_get_session$FUNC - ); -} - - diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/RuntimeHelper.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/RuntimeHelper.java new file mode 100644 index 00000000..0b673e7b --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.win.extr.errno; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/constants$0.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/constants$0.java new file mode 100644 index 00000000..9abd23a4 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.errno; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/errno_h.java similarity index 79% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno_h.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/errno_h.java index 672edb39..bed4b821 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno_h.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/errno/errno_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.errno; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static final OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfInt C_LONG = JAVA_INT; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define ENOENT 2 @@ -137,6 +137,14 @@ public static int EINVAL() { public static int ERANGE() { return (int)34L; } + /** + * {@snippet : + * #define ENODATA 120 + * } + */ + public static int ENODATA() { + return (int)120L; + } /** * {@snippet : * #define ENOTSUP 129 diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/RuntimeHelper.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/RuntimeHelper.java new file mode 100644 index 00000000..09f33097 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.win.extr.fcntl; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/constants$0.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/constants$0.java new file mode 100644 index 00000000..f3672ad9 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/constants$0.java @@ -0,0 +1,16 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fcntl; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/fcntl_h.java similarity index 65% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl_h.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/fcntl_h.java index d14ccfe7..e79fd070 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl_h.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fcntl/fcntl_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fcntl; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,14 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static final OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfInt C_LONG = JAVA_INT; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; /** * {@snippet : * #define O_RDONLY 0 diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/Constants$root.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/Constants$root.java deleted file mode 100644 index db18ff6f..00000000 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/Constants$root.java +++ /dev/null @@ -1,25 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.win.extr.fuse2; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -final class Constants$root { - - // Suppresses default constructor, ensuring non-instantiability. - private Constants$root() {} - static final OfBoolean C_BOOL$LAYOUT = JAVA_BOOLEAN; - static final OfByte C_CHAR$LAYOUT = JAVA_BYTE; - static final OfShort C_SHORT$LAYOUT = JAVA_SHORT; - static final OfInt C_INT$LAYOUT = JAVA_INT; - static final OfInt C_LONG$LAYOUT = JAVA_INT; - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG; - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT; - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE; - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64).asUnbounded(); -} - - diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/RuntimeHelper.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/RuntimeHelper.java index 6d597184..5fa763ce 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/RuntimeHelper.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/RuntimeHelper.java @@ -7,7 +7,7 @@ import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentScope; +import java.lang.foreign.Arena; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -20,6 +20,9 @@ import java.util.Optional; import java.util.stream.Stream; +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + import static java.lang.foreign.Linker.*; import static java.lang.foreign.ValueLayout.*; @@ -30,9 +33,10 @@ final class RuntimeHelper { private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); private static final SymbolLookup SYMBOL_LOOKUP; private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); + (size, align) -> Arena.ofAuto().allocate(size, align); static { @@ -51,7 +55,9 @@ static T requireNonNull(T obj, String symbolName) { } static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); } static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { @@ -70,18 +76,25 @@ static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc orElse(null); } - static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); - handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, scope); + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { - return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); } // Internals only below this point diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/constants$0.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/constants$0.java index 26ca7bdb..352eac80 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/constants$0.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/constants$0.java @@ -11,15 +11,25 @@ final class constants$0 { // Suppresses default constructor, ensuring non-instantiability. private constants$0() {} - static final FunctionDescriptor fuse_parse_cmdline$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("argc"), + MemoryLayout.paddingLayout(4), + RuntimeHelper.POINTER.withName("argv"), + JAVA_INT.withName("allocated"), + MemoryLayout.paddingLayout(4) + ).withName("fuse_args"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argc")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("argv")); + static final VarHandle const$3 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("allocated")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER ); - static final MethodHandle fuse_parse_cmdline$MH = RuntimeHelper.downcallHandle( + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( "fuse_parse_cmdline", - constants$0.fuse_parse_cmdline$FUNC + constants$0.const$4 ); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse2_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse2_h.java index fdaa120d..ab3a8e8f 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse2_h.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse2_h.java @@ -9,16 +9,16 @@ import static java.lang.foreign.ValueLayout.*; public class fuse2_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static final OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfInt C_LONG = JAVA_INT; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; public static MethodHandle fuse_parse_cmdline$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse_parse_cmdline$MH,"fuse_parse_cmdline"); + return RuntimeHelper.requireNonNull(constants$0.const$5,"fuse_parse_cmdline"); } /** * {@snippet : diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse_args.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse_args.java index d4cd621a..32e2821d 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse_args.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse_args.java @@ -18,19 +18,11 @@ */ public class fuse_args { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG$LAYOUT.withName("argc"), - MemoryLayout.paddingLayout(32), - Constants$root.C_POINTER$LAYOUT.withName("argv"), - Constants$root.C_LONG$LAYOUT.withName("allocated"), - MemoryLayout.paddingLayout(32) - ).withName("fuse_args"); public static MemoryLayout $LAYOUT() { - return fuse_args.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle argc$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argc")); public static VarHandle argc$VH() { - return fuse_args.argc$VH; + return constants$0.const$1; } /** * Getter for field: @@ -39,7 +31,7 @@ public class fuse_args { * } */ public static int argc$get(MemorySegment seg) { - return (int)fuse_args.argc$VH.get(seg); + return (int)constants$0.const$1.get(seg); } /** * Setter for field: @@ -48,17 +40,16 @@ public class fuse_args { * } */ public static void argc$set(MemorySegment seg, int x) { - fuse_args.argc$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { - return (int)fuse_args.argc$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void argc$set(MemorySegment seg, long index, int x) { - fuse_args.argc$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle argv$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("argv")); public static VarHandle argv$VH() { - return fuse_args.argv$VH; + return constants$0.const$2; } /** * Getter for field: @@ -67,7 +58,7 @@ public class fuse_args { * } */ public static MemorySegment argv$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg); } /** * Setter for field: @@ -76,17 +67,16 @@ public class fuse_args { * } */ public static void argv$set(MemorySegment seg, MemorySegment x) { - fuse_args.argv$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static MemorySegment argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void argv$set(MemorySegment seg, long index, MemorySegment x) { - fuse_args.argv$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle allocated$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("allocated")); public static VarHandle allocated$VH() { - return fuse_args.allocated$VH; + return constants$0.const$3; } /** * Getter for field: @@ -95,7 +85,7 @@ public class fuse_args { * } */ public static int allocated$get(MemorySegment seg) { - return (int)fuse_args.allocated$VH.get(seg); + return (int)constants$0.const$3.get(seg); } /** * Setter for field: @@ -104,20 +94,20 @@ public class fuse_args { * } */ public static void allocated$set(MemorySegment seg, int x) { - fuse_args.allocated$VH.set(seg, x); + constants$0.const$3.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { - return (int)fuse_args.allocated$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$3.get(seg.asSlice(index*sizeof())); } public static void allocated$set(MemorySegment seg, long index, int x) { - fuse_args.allocated$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/RuntimeHelper.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/RuntimeHelper.java new file mode 100644 index 00000000..6fce6ccb --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/RuntimeHelper.java @@ -0,0 +1,245 @@ +package org.cryptomator.jfuse.win.extr.fuse3; +// Generated by jextract + +import java.lang.foreign.Linker; +import java.lang.foreign.FunctionDescriptor; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.SymbolLookup; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.Arena; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.ValueLayout; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.io.File; +import java.nio.file.Path; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Optional; +import java.util.stream.Stream; + +import java.lang.foreign.AddressLayout; +import java.lang.foreign.MemoryLayout; + +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; + +final class RuntimeHelper { + + private static final Linker LINKER = Linker.nativeLinker(); + private static final ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); + private static final MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); + private static final SymbolLookup SYMBOL_LOOKUP; + private static final SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; + static final AddressLayout POINTER = ValueLayout.ADDRESS.withTargetLayout(MemoryLayout.sequenceLayout(JAVA_BYTE)); + + final static SegmentAllocator CONSTANT_ALLOCATOR = + (size, align) -> Arena.ofAuto().allocate(size, align); + + static { + + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); + } + + // Suppresses default constructor, ensuring non-instantiability. + private RuntimeHelper() {} + + static T requireNonNull(T obj, String symbolName) { + if (obj == null) { + throw new UnsatisfiedLinkError("unresolved symbol: " + symbolName); + } + return obj; + } + + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name) + .map(s -> s.reinterpret(layout.byteSize())) + .orElse(null); + } + + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> LINKER.downcallHandle(addr, fdesc)). + orElse(null); + } + + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { + return LINKER.downcallHandle(fdesc); + } + + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). + map(addr -> VarargsInvoker.make(addr, fdesc)). + orElse(null); + } + + static MethodHandle upcallHandle(Class fi, String name, FunctionDescriptor fdesc) { + try { + return MH_LOOKUP.findVirtual(fi, name, fdesc.toMethodType()); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment upcallStub(MethodHandle fiHandle, Z z, FunctionDescriptor fdesc, Arena scope) { + try { + fiHandle = fiHandle.bindTo(z); + return LINKER.upcallStub(fiHandle, fdesc, scope); + } catch (Throwable ex) { + throw new AssertionError(ex); + } + } + + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, Arena arena) { + return addr.reinterpret(numElements * layout.byteSize(), arena, null); + } + + // Internals only below this point + + private static final class VarargsInvoker { + private static final MethodHandle INVOKE_MH; + private final MemorySegment symbol; + private final FunctionDescriptor function; + + private VarargsInvoker(MemorySegment symbol, FunctionDescriptor function) { + this.symbol = symbol; + this.function = function; + } + + static { + try { + INVOKE_MH = MethodHandles.lookup().findVirtual(VarargsInvoker.class, "invoke", MethodType.methodType(Object.class, SegmentAllocator.class, Object[].class)); + } catch (ReflectiveOperationException e) { + throw new RuntimeException(e); + } + } + + static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { + VarargsInvoker invoker = new VarargsInvoker(symbol, function); + MethodHandle handle = INVOKE_MH.bindTo(invoker).asCollector(Object[].class, function.argumentLayouts().size() + 1); + MethodType mtype = MethodType.methodType(function.returnLayout().isPresent() ? carrier(function.returnLayout().get(), true) : void.class); + for (MemoryLayout layout : function.argumentLayouts()) { + mtype = mtype.appendParameterTypes(carrier(layout, false)); + } + mtype = mtype.appendParameterTypes(Object[].class); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); + } else { + handle = MethodHandles.insertArguments(handle, 0, THROWING_ALLOCATOR); + } + return handle.asType(mtype); + } + + static Class carrier(MemoryLayout layout, boolean ret) { + if (layout instanceof ValueLayout valueLayout) { + return valueLayout.carrier(); + } else if (layout instanceof GroupLayout) { + return MemorySegment.class; + } else { + throw new AssertionError("Cannot get here!"); + } + } + + private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwable { + // one trailing Object[] + int nNamedArgs = function.argumentLayouts().size(); + assert(args.length == nNamedArgs + 1); + // The last argument is the array of vararg collector + Object[] unnamedArgs = (Object[]) args[args.length - 1]; + + int argsCount = nNamedArgs + unnamedArgs.length; + Class[] argTypes = new Class[argsCount]; + MemoryLayout[] argLayouts = new MemoryLayout[nNamedArgs + unnamedArgs.length]; + + int pos = 0; + for (pos = 0; pos < nNamedArgs; pos++) { + argLayouts[pos] = function.argumentLayouts().get(pos); + } + + assert pos == nNamedArgs; + for (Object o: unnamedArgs) { + argLayouts[pos] = variadicLayout(normalize(o.getClass())); + pos++; + } + assert pos == argsCount; + + FunctionDescriptor f = (function.returnLayout().isEmpty()) ? + FunctionDescriptor.ofVoid(argLayouts) : + FunctionDescriptor.of(function.returnLayout().get(), argLayouts); + MethodHandle mh = LINKER.downcallHandle(symbol, f); + boolean needsAllocator = function.returnLayout().isPresent() && + function.returnLayout().get() instanceof GroupLayout; + if (needsAllocator) { + mh = mh.bindTo(allocator); + } + // flatten argument list so that it can be passed to an asSpreader MH + Object[] allArgs = new Object[nNamedArgs + unnamedArgs.length]; + System.arraycopy(args, 0, allArgs, 0, nNamedArgs); + System.arraycopy(unnamedArgs, 0, allArgs, nNamedArgs, unnamedArgs.length); + + return mh.asSpreader(Object[].class, argsCount).invoke(allArgs); + } + + private static Class unboxIfNeeded(Class clazz) { + if (clazz == Boolean.class) { + return boolean.class; + } else if (clazz == Void.class) { + return void.class; + } else if (clazz == Byte.class) { + return byte.class; + } else if (clazz == Character.class) { + return char.class; + } else if (clazz == Short.class) { + return short.class; + } else if (clazz == Integer.class) { + return int.class; + } else if (clazz == Long.class) { + return long.class; + } else if (clazz == Float.class) { + return float.class; + } else if (clazz == Double.class) { + return double.class; + } else { + return clazz; + } + } + + private Class promote(Class c) { + if (c == byte.class || c == char.class || c == short.class || c == int.class) { + return long.class; + } else if (c == float.class) { + return double.class; + } else { + return c; + } + } + + private Class normalize(Class c) { + c = unboxIfNeeded(c); + if (c.isPrimitive()) { + return promote(c); + } + if (c == MemorySegment.class) { + return MemorySegment.class; + } + throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); + } + + private MemoryLayout variadicLayout(Class c) { + if (c == long.class) { + return JAVA_LONG; + } else if (c == double.class) { + return JAVA_DOUBLE; + } else if (c == MemorySegment.class) { + return ADDRESS; + } else { + throw new IllegalArgumentException("Unhandled variadic argument class: " + c); + } + } + } +} diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$0.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$0.java new file mode 100644 index 00000000..c917deb1 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$0.java @@ -0,0 +1,56 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$0 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$0() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("fuse_timespec"); + static final VarHandle const$1 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); + static final VarHandle const$2 = constants$0.const$0.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); + static final StructLayout const$3 = MemoryLayout.structLayout( + JAVA_INT.withName("st_dev"), + MemoryLayout.paddingLayout(4), + JAVA_LONG.withName("st_ino"), + JAVA_INT.withName("st_mode"), + JAVA_SHORT.withName("st_nlink"), + MemoryLayout.paddingLayout(2), + JAVA_INT.withName("st_uid"), + JAVA_INT.withName("st_gid"), + JAVA_INT.withName("st_rdev"), + MemoryLayout.paddingLayout(4), + JAVA_LONG.withName("st_size"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_atim"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_mtim"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_ctim"), + JAVA_INT.withName("st_blksize"), + MemoryLayout.paddingLayout(4), + JAVA_LONG.withName("st_blocks"), + MemoryLayout.structLayout( + JAVA_LONG.withName("tv_sec"), + JAVA_LONG.withName("tv_nsec") + ).withName("st_birthtim") + ).withName("fuse_stat"); + static final VarHandle const$4 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); + static final VarHandle const$5 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$1.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$1.java new file mode 100644 index 00000000..59f2ac2a --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$1.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$1 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$1() {} + static final VarHandle const$0 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); + static final VarHandle const$1 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); + static final VarHandle const$2 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); + static final VarHandle const$3 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); + static final VarHandle const$4 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); + static final VarHandle const$5 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_size")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$10.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$10.java new file mode 100644 index 00000000..7012b3c4 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$10.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$10 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$10() {} + static final VarHandle const$0 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("remember")); + static final VarHandle const$1 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("hard_remove")); + static final VarHandle const$2 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("use_ino")); + static final VarHandle const$3 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("readdir_ino")); + static final VarHandle const$4 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("direct_io")); + static final VarHandle const$5 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("kernel_cache")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$11.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$11.java new file mode 100644 index 00000000..9019b7df --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$11.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$11 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$11() {} + static final VarHandle const$0 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("auto_cache")); + static final VarHandle const$1 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout_set")); + static final VarHandle const$2 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout")); + static final VarHandle const$3 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("nullpath_ok")); + static final VarHandle const$4 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("show_help")); + static final VarHandle const$5 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("modules")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$12.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$12.java new file mode 100644 index 00000000..3ccf0b5a --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$12.java @@ -0,0 +1,69 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$12 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$12() {} + static final VarHandle const$0 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("debug")); + static final StructLayout const$1 = MemoryLayout.structLayout( + RuntimeHelper.POINTER.withName("getattr"), + RuntimeHelper.POINTER.withName("readlink"), + RuntimeHelper.POINTER.withName("mknod"), + RuntimeHelper.POINTER.withName("mkdir"), + RuntimeHelper.POINTER.withName("unlink"), + RuntimeHelper.POINTER.withName("rmdir"), + RuntimeHelper.POINTER.withName("symlink"), + RuntimeHelper.POINTER.withName("rename"), + RuntimeHelper.POINTER.withName("link"), + RuntimeHelper.POINTER.withName("chmod"), + RuntimeHelper.POINTER.withName("chown"), + RuntimeHelper.POINTER.withName("truncate"), + RuntimeHelper.POINTER.withName("open"), + RuntimeHelper.POINTER.withName("read"), + RuntimeHelper.POINTER.withName("write"), + RuntimeHelper.POINTER.withName("statfs"), + RuntimeHelper.POINTER.withName("flush"), + RuntimeHelper.POINTER.withName("release"), + RuntimeHelper.POINTER.withName("fsync"), + RuntimeHelper.POINTER.withName("setxattr"), + RuntimeHelper.POINTER.withName("getxattr"), + RuntimeHelper.POINTER.withName("listxattr"), + RuntimeHelper.POINTER.withName("removexattr"), + RuntimeHelper.POINTER.withName("opendir"), + RuntimeHelper.POINTER.withName("readdir"), + RuntimeHelper.POINTER.withName("releasedir"), + RuntimeHelper.POINTER.withName("fsyncdir"), + RuntimeHelper.POINTER.withName("init"), + RuntimeHelper.POINTER.withName("destroy"), + RuntimeHelper.POINTER.withName("access"), + RuntimeHelper.POINTER.withName("create"), + RuntimeHelper.POINTER.withName("lock"), + RuntimeHelper.POINTER.withName("utimens"), + RuntimeHelper.POINTER.withName("bmap"), + RuntimeHelper.POINTER.withName("ioctl"), + RuntimeHelper.POINTER.withName("poll"), + RuntimeHelper.POINTER.withName("write_buf"), + RuntimeHelper.POINTER.withName("read_buf"), + RuntimeHelper.POINTER.withName("flock"), + RuntimeHelper.POINTER.withName("fallocate") + ).withName("fuse3_operations"); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse3_operations.getattr.class, "apply", constants$12.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$12.const$2 + ); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("getattr")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$13.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$13.java new file mode 100644 index 00000000..f4eac9b9 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$13.java @@ -0,0 +1,32 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$13 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$13() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse3_operations.readlink.class, "apply", constants$13.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$13.const$0 + ); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("readlink")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_INT + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.mknod.class, "apply", constants$13.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$14.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$14.java new file mode 100644 index 00000000..631a1716 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$14.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$14 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$14() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$13.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("mknod")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse3_operations.mkdir.class, "apply", constants$14.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$14.const$2 + ); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$15.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$15.java new file mode 100644 index 00000000..edca9f35 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$15.java @@ -0,0 +1,26 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$15 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$15() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse3_operations.unlink.class, "apply", constants$15.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$15.const$0 + ); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("unlink")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_operations.rmdir.class, "apply", constants$15.const$0); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$16.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$16.java new file mode 100644 index 00000000..ae57ed39 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$16.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$16 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$16() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse3_operations.symlink.class, "apply", constants$16.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$16.const$0 + ); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("symlink")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.rename.class, "apply", constants$16.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$17.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$17.java new file mode 100644 index 00000000..fd5a5f73 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$17.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$17 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$17() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$16.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("rename")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.link.class, "apply", constants$16.const$0); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("link")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.chmod.class, "apply", constants$17.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$18.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$18.java new file mode 100644 index 00000000..adf93c44 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$18.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$18 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$18() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$17.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("chmod")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse3_operations.chown.class, "apply", constants$18.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$18.const$2 + ); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("chown")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$19.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$19.java new file mode 100644 index 00000000..9b083c2e --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$19.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$19 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$19() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse3_operations.truncate.class, "apply", constants$19.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$19.const$0 + ); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("truncate")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_operations.open.class, "apply", constants$16.const$0); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("open")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$2.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$2.java new file mode 100644 index 00000000..6198d365 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$2.java @@ -0,0 +1,34 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$2 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$2() {} + static final VarHandle const$0 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); + static final VarHandle const$1 = constants$0.const$3.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); + static final StructLayout const$2 = MemoryLayout.structLayout( + JAVA_LONG.withName("f_bsize"), + JAVA_LONG.withName("f_frsize"), + JAVA_LONG.withName("f_blocks"), + JAVA_LONG.withName("f_bfree"), + JAVA_LONG.withName("f_bavail"), + JAVA_LONG.withName("f_files"), + JAVA_LONG.withName("f_ffree"), + JAVA_LONG.withName("f_favail"), + JAVA_LONG.withName("f_fsid"), + JAVA_LONG.withName("f_flag"), + JAVA_LONG.withName("f_namemax") + ).withName("fuse_statvfs"); + static final VarHandle const$3 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); + static final VarHandle const$4 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); + static final VarHandle const$5 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$20.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$20.java new file mode 100644 index 00000000..38cc1a2b --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$20.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$20 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$20() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse3_operations.read.class, "apply", constants$20.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$20.const$0 + ); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("read")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_operations.write.class, "apply", constants$20.const$0); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("write")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$21.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$21.java new file mode 100644 index 00000000..e68ba792 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$21.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$21 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$21() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse3_operations.statfs.class, "apply", constants$16.const$0); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("statfs")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.flush.class, "apply", constants$16.const$0); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("flush")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_operations.release.class, "apply", constants$16.const$0); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("release")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$22.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$22.java new file mode 100644 index 00000000..7908c0ee --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$22.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$22 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$22() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse3_operations.fsync.class, "apply", constants$17.const$4); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("fsync")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.setxattr.class, "apply", constants$7.const$3); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.getxattr.class, "apply", constants$22.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$23.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$23.java new file mode 100644 index 00000000..f9966217 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$23.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$23 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$23() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$22.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.listxattr.class, "apply", constants$13.const$0); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_operations.removexattr.class, "apply", constants$16.const$0); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$24.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$24.java new file mode 100644 index 00000000..b08fa797 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$24.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$24 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$24() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse3_operations.opendir.class, "apply", constants$16.const$0); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("opendir")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER, + JAVA_INT + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse3_operations.readdir.class, "apply", constants$24.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$24.const$2 + ); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("readdir")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$25.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$25.java new file mode 100644 index 00000000..0da655e0 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$25.java @@ -0,0 +1,25 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$25 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$25() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse3_operations.releasedir.class, "apply", constants$16.const$0); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.fsyncdir.class, "apply", constants$17.const$4); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.init.class, "apply", constants$25.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$26.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$26.java new file mode 100644 index 00000000..720b873c --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$26.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$26 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$26() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$25.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("init")); + static final FunctionDescriptor const$2 = FunctionDescriptor.ofVoid( + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse3_operations.destroy.class, "apply", constants$26.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$26.const$2 + ); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("destroy")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$27.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$27.java new file mode 100644 index 00000000..96e79866 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$27.java @@ -0,0 +1,27 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$27 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$27() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse3_operations.access.class, "apply", constants$14.const$2); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("access")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.create.class, "apply", constants$17.const$4); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("create")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.lock.class, "apply", constants$27.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$28.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$28.java new file mode 100644 index 00000000..da652dd3 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$28.java @@ -0,0 +1,24 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$28 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$28() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$27.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("lock")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.utimens.class, "apply", constants$12.const$2); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("utimens")); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_operations.bmap.class, "apply", constants$19.const$0); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("bmap")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$29.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$29.java new file mode 100644 index 00000000..c7b84668 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$29.java @@ -0,0 +1,36 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$29 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$29() {} + static final FunctionDescriptor const$0 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_INT, + RuntimeHelper.POINTER + ); + static final MethodHandle const$1 = RuntimeHelper.upcallHandle(fuse3_operations.ioctl.class, "apply", constants$29.const$0); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + constants$29.const$0 + ); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.poll.class, "apply", constants$29.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$3.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$3.java new file mode 100644 index 00000000..d20a40fc --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$3.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$3 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$3() {} + static final VarHandle const$0 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); + static final VarHandle const$1 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); + static final VarHandle const$2 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_files")); + static final VarHandle const$3 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); + static final VarHandle const$4 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); + static final VarHandle const$5 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$30.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$30.java new file mode 100644 index 00000000..eb44b840 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$30.java @@ -0,0 +1,31 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$30 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$30() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$29.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("poll")); + static final FunctionDescriptor const$2 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$3 = RuntimeHelper.upcallHandle(fuse3_operations.write_buf.class, "apply", constants$30.const$2); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + constants$30.const$2 + ); + static final VarHandle const$5 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$31.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$31.java new file mode 100644 index 00000000..8567f36b --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$31.java @@ -0,0 +1,28 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$31 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$31() {} + static final MethodHandle const$0 = RuntimeHelper.upcallHandle(fuse3_operations.read_buf.class, "apply", constants$20.const$0); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); + static final MethodHandle const$2 = RuntimeHelper.upcallHandle(fuse3_operations.flock.class, "apply", constants$16.const$4); + static final VarHandle const$3 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("flock")); + static final FunctionDescriptor const$4 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + JAVA_INT, + JAVA_LONG, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$5 = RuntimeHelper.upcallHandle(fuse3_operations.fallocate.class, "apply", constants$31.const$4); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$32.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$32.java new file mode 100644 index 00000000..42ad78ee --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$32.java @@ -0,0 +1,38 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$32 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$32() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + constants$31.const$4 + ); + static final VarHandle const$1 = constants$12.const$1.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + "fuse3_lib_help", + constants$26.const$2 + ); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + RuntimeHelper.POINTER + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse3_new", + constants$32.const$3 + ); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + "fuse3_destroy", + constants$26.const$2 + ); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$33.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$33.java new file mode 100644 index 00000000..a70732d8 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$33.java @@ -0,0 +1,43 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$33 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$33() {} + static final MethodHandle const$0 = RuntimeHelper.downcallHandle( + "fuse3_mount", + constants$16.const$0 + ); + static final MethodHandle const$1 = RuntimeHelper.downcallHandle( + "fuse3_unmount", + constants$26.const$2 + ); + static final MethodHandle const$2 = RuntimeHelper.downcallHandle( + "fuse3_loop", + constants$15.const$0 + ); + static final MethodHandle const$3 = RuntimeHelper.downcallHandle( + "fuse3_loop_mt_31", + constants$14.const$2 + ); + static final MethodHandle const$4 = RuntimeHelper.downcallHandle( + "fuse3_exit", + constants$26.const$2 + ); + static final FunctionDescriptor const$5 = FunctionDescriptor.of(RuntimeHelper.POINTER, + RuntimeHelper.POINTER + ); + static final MethodHandle const$6 = RuntimeHelper.downcallHandle( + "fuse3_get_session", + constants$33.const$5 + ); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$4.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$4.java new file mode 100644 index 00000000..9d07837d --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$4.java @@ -0,0 +1,29 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$4 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$4() {} + static final VarHandle const$0 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); + static final VarHandle const$1 = constants$2.const$2.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); + static final StructLayout const$2 = MemoryLayout.structLayout( + JAVA_INT.withName("flags"), + MemoryLayout.paddingLayout(12), + JAVA_LONG.withName("fh"), + JAVA_LONG.withName("lock_owner"), + JAVA_INT.withName("poll_events"), + MemoryLayout.paddingLayout(4) + ).withName("fuse3_file_info"); + static final VarHandle const$3 = constants$4.const$2.varHandle(MemoryLayout.PathElement.groupElement("flags")); + static final VarHandle const$4 = constants$4.const$2.varHandle(MemoryLayout.PathElement.groupElement("fh")); + static final VarHandle const$5 = constants$4.const$2.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$5.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$5.java new file mode 100644 index 00000000..bcd3791d --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$5.java @@ -0,0 +1,37 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$5 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$5() {} + static final VarHandle const$0 = constants$4.const$2.varHandle(MemoryLayout.PathElement.groupElement("poll_events")); + static final StructLayout const$1 = MemoryLayout.structLayout( + JAVA_INT.withName("clone_fd"), + JAVA_INT.withName("max_idle_threads") + ).withName("fuse3_loop_config"); + static final VarHandle const$2 = constants$5.const$1.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); + static final VarHandle const$3 = constants$5.const$1.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); + static final StructLayout const$4 = MemoryLayout.structLayout( + JAVA_INT.withName("proto_major"), + JAVA_INT.withName("proto_minor"), + JAVA_INT.withName("max_write"), + JAVA_INT.withName("max_read"), + JAVA_INT.withName("max_readahead"), + JAVA_INT.withName("capable"), + JAVA_INT.withName("want"), + JAVA_INT.withName("max_background"), + JAVA_INT.withName("congestion_threshold"), + JAVA_INT.withName("time_gran"), + MemoryLayout.sequenceLayout(22, JAVA_INT).withName("reserved") + ).withName("fuse3_conn_info"); + static final VarHandle const$5 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$6.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$6.java new file mode 100644 index 00000000..12634927 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$6.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$6 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$6() {} + static final VarHandle const$0 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); + static final VarHandle const$1 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_write")); + static final VarHandle const$2 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_read")); + static final VarHandle const$3 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); + static final VarHandle const$4 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("capable")); + static final VarHandle const$5 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("want")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$7.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$7.java new file mode 100644 index 00000000..493fb037 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$7.java @@ -0,0 +1,30 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$7 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$7() {} + static final VarHandle const$0 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("max_background")); + static final VarHandle const$1 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); + static final VarHandle const$2 = constants$5.const$4.varHandle(MemoryLayout.PathElement.groupElement("time_gran")); + static final FunctionDescriptor const$3 = FunctionDescriptor.of(JAVA_INT, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + RuntimeHelper.POINTER, + JAVA_LONG, + JAVA_INT + ); + static final MethodHandle const$4 = RuntimeHelper.upcallHandle(fuse3_fill_dir_t.class, "apply", constants$7.const$3); + static final MethodHandle const$5 = RuntimeHelper.downcallHandle( + constants$7.const$3 + ); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$8.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$8.java new file mode 100644 index 00000000..6f9ac431 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$8.java @@ -0,0 +1,48 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$8 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$8() {} + static final StructLayout const$0 = MemoryLayout.structLayout( + JAVA_INT.withName("set_gid"), + JAVA_INT.withName("gid"), + JAVA_INT.withName("set_uid"), + JAVA_INT.withName("uid"), + JAVA_INT.withName("set_mode"), + JAVA_INT.withName("umask"), + JAVA_DOUBLE.withName("entry_timeout"), + JAVA_DOUBLE.withName("negative_timeout"), + JAVA_DOUBLE.withName("attr_timeout"), + JAVA_INT.withName("intr"), + JAVA_INT.withName("intr_signal"), + JAVA_INT.withName("remember"), + JAVA_INT.withName("hard_remove"), + JAVA_INT.withName("use_ino"), + JAVA_INT.withName("readdir_ino"), + JAVA_INT.withName("direct_io"), + JAVA_INT.withName("kernel_cache"), + JAVA_INT.withName("auto_cache"), + JAVA_INT.withName("ac_attr_timeout_set"), + JAVA_DOUBLE.withName("ac_attr_timeout"), + JAVA_INT.withName("nullpath_ok"), + JAVA_INT.withName("show_help"), + RuntimeHelper.POINTER.withName("modules"), + JAVA_INT.withName("debug"), + MemoryLayout.paddingLayout(4) + ).withName("fuse3_config"); + static final VarHandle const$1 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("set_gid")); + static final VarHandle const$2 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("gid")); + static final VarHandle const$3 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("set_uid")); + static final VarHandle const$4 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("uid")); + static final VarHandle const$5 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("set_mode")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$9.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$9.java new file mode 100644 index 00000000..d5b4d079 --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/constants$9.java @@ -0,0 +1,22 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +final class constants$9 { + + // Suppresses default constructor, ensuring non-instantiability. + private constants$9() {} + static final VarHandle const$0 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("umask")); + static final VarHandle const$1 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("entry_timeout")); + static final VarHandle const$2 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("negative_timeout")); + static final VarHandle const$3 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("attr_timeout")); + static final VarHandle const$4 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("intr")); + static final VarHandle const$5 = constants$8.const$0.varHandle(MemoryLayout.PathElement.groupElement("intr_signal")); +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_config.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_config.java similarity index 54% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_config.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_config.java index 3a289f31..359d2187 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_config.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_config.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -39,39 +39,11 @@ */ public class fuse3_config { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG$LAYOUT.withName("set_gid"), - Constants$root.C_LONG$LAYOUT.withName("gid"), - Constants$root.C_LONG$LAYOUT.withName("set_uid"), - Constants$root.C_LONG$LAYOUT.withName("uid"), - Constants$root.C_LONG$LAYOUT.withName("set_mode"), - Constants$root.C_LONG$LAYOUT.withName("umask"), - Constants$root.C_DOUBLE$LAYOUT.withName("entry_timeout"), - Constants$root.C_DOUBLE$LAYOUT.withName("negative_timeout"), - Constants$root.C_DOUBLE$LAYOUT.withName("attr_timeout"), - Constants$root.C_LONG$LAYOUT.withName("intr"), - Constants$root.C_LONG$LAYOUT.withName("intr_signal"), - Constants$root.C_LONG$LAYOUT.withName("remember"), - Constants$root.C_LONG$LAYOUT.withName("hard_remove"), - Constants$root.C_LONG$LAYOUT.withName("use_ino"), - Constants$root.C_LONG$LAYOUT.withName("readdir_ino"), - Constants$root.C_LONG$LAYOUT.withName("direct_io"), - Constants$root.C_LONG$LAYOUT.withName("kernel_cache"), - Constants$root.C_LONG$LAYOUT.withName("auto_cache"), - Constants$root.C_LONG$LAYOUT.withName("ac_attr_timeout_set"), - Constants$root.C_DOUBLE$LAYOUT.withName("ac_attr_timeout"), - Constants$root.C_LONG$LAYOUT.withName("nullpath_ok"), - Constants$root.C_LONG$LAYOUT.withName("show_help"), - Constants$root.C_POINTER$LAYOUT.withName("modules"), - Constants$root.C_LONG$LAYOUT.withName("debug"), - MemoryLayout.paddingLayout(32) - ).withName("fuse3_config"); public static MemoryLayout $LAYOUT() { - return fuse3_config.$struct$LAYOUT; + return constants$8.const$0; } - static final VarHandle set_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_gid")); public static VarHandle set_gid$VH() { - return fuse3_config.set_gid$VH; + return constants$8.const$1; } /** * Getter for field: @@ -80,7 +52,7 @@ public class fuse3_config { * } */ public static int set_gid$get(MemorySegment seg) { - return (int)fuse3_config.set_gid$VH.get(seg); + return (int)constants$8.const$1.get(seg); } /** * Setter for field: @@ -89,17 +61,16 @@ public class fuse3_config { * } */ public static void set_gid$set(MemorySegment seg, int x) { - fuse3_config.set_gid$VH.set(seg, x); + constants$8.const$1.set(seg, x); } public static int set_gid$get(MemorySegment seg, long index) { - return (int)fuse3_config.set_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$1.get(seg.asSlice(index*sizeof())); } public static void set_gid$set(MemorySegment seg, long index, int x) { - fuse3_config.set_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("gid")); public static VarHandle gid$VH() { - return fuse3_config.gid$VH; + return constants$8.const$2; } /** * Getter for field: @@ -108,7 +79,7 @@ public class fuse3_config { * } */ public static int gid$get(MemorySegment seg) { - return (int)fuse3_config.gid$VH.get(seg); + return (int)constants$8.const$2.get(seg); } /** * Setter for field: @@ -117,17 +88,16 @@ public class fuse3_config { * } */ public static void gid$set(MemorySegment seg, int x) { - fuse3_config.gid$VH.set(seg, x); + constants$8.const$2.set(seg, x); } public static int gid$get(MemorySegment seg, long index) { - return (int)fuse3_config.gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$2.get(seg.asSlice(index*sizeof())); } public static void gid$set(MemorySegment seg, long index, int x) { - fuse3_config.gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle set_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_uid")); public static VarHandle set_uid$VH() { - return fuse3_config.set_uid$VH; + return constants$8.const$3; } /** * Getter for field: @@ -136,7 +106,7 @@ public class fuse3_config { * } */ public static int set_uid$get(MemorySegment seg) { - return (int)fuse3_config.set_uid$VH.get(seg); + return (int)constants$8.const$3.get(seg); } /** * Setter for field: @@ -145,17 +115,16 @@ public class fuse3_config { * } */ public static void set_uid$set(MemorySegment seg, int x) { - fuse3_config.set_uid$VH.set(seg, x); + constants$8.const$3.set(seg, x); } public static int set_uid$get(MemorySegment seg, long index) { - return (int)fuse3_config.set_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$3.get(seg.asSlice(index*sizeof())); } public static void set_uid$set(MemorySegment seg, long index, int x) { - fuse3_config.set_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("uid")); public static VarHandle uid$VH() { - return fuse3_config.uid$VH; + return constants$8.const$4; } /** * Getter for field: @@ -164,7 +133,7 @@ public class fuse3_config { * } */ public static int uid$get(MemorySegment seg) { - return (int)fuse3_config.uid$VH.get(seg); + return (int)constants$8.const$4.get(seg); } /** * Setter for field: @@ -173,17 +142,16 @@ public class fuse3_config { * } */ public static void uid$set(MemorySegment seg, int x) { - fuse3_config.uid$VH.set(seg, x); + constants$8.const$4.set(seg, x); } public static int uid$get(MemorySegment seg, long index) { - return (int)fuse3_config.uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$4.get(seg.asSlice(index*sizeof())); } public static void uid$set(MemorySegment seg, long index, int x) { - fuse3_config.uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle set_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("set_mode")); public static VarHandle set_mode$VH() { - return fuse3_config.set_mode$VH; + return constants$8.const$5; } /** * Getter for field: @@ -192,7 +160,7 @@ public class fuse3_config { * } */ public static int set_mode$get(MemorySegment seg) { - return (int)fuse3_config.set_mode$VH.get(seg); + return (int)constants$8.const$5.get(seg); } /** * Setter for field: @@ -201,17 +169,16 @@ public class fuse3_config { * } */ public static void set_mode$set(MemorySegment seg, int x) { - fuse3_config.set_mode$VH.set(seg, x); + constants$8.const$5.set(seg, x); } public static int set_mode$get(MemorySegment seg, long index) { - return (int)fuse3_config.set_mode$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$8.const$5.get(seg.asSlice(index*sizeof())); } public static void set_mode$set(MemorySegment seg, long index, int x) { - fuse3_config.set_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$8.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle umask$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("umask")); public static VarHandle umask$VH() { - return fuse3_config.umask$VH; + return constants$9.const$0; } /** * Getter for field: @@ -220,7 +187,7 @@ public class fuse3_config { * } */ public static int umask$get(MemorySegment seg) { - return (int)fuse3_config.umask$VH.get(seg); + return (int)constants$9.const$0.get(seg); } /** * Setter for field: @@ -229,17 +196,16 @@ public class fuse3_config { * } */ public static void umask$set(MemorySegment seg, int x) { - fuse3_config.umask$VH.set(seg, x); + constants$9.const$0.set(seg, x); } public static int umask$get(MemorySegment seg, long index) { - return (int)fuse3_config.umask$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$9.const$0.get(seg.asSlice(index*sizeof())); } public static void umask$set(MemorySegment seg, long index, int x) { - fuse3_config.umask$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle entry_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("entry_timeout")); public static VarHandle entry_timeout$VH() { - return fuse3_config.entry_timeout$VH; + return constants$9.const$1; } /** * Getter for field: @@ -248,7 +214,7 @@ public class fuse3_config { * } */ public static double entry_timeout$get(MemorySegment seg) { - return (double)fuse3_config.entry_timeout$VH.get(seg); + return (double)constants$9.const$1.get(seg); } /** * Setter for field: @@ -257,17 +223,16 @@ public class fuse3_config { * } */ public static void entry_timeout$set(MemorySegment seg, double x) { - fuse3_config.entry_timeout$VH.set(seg, x); + constants$9.const$1.set(seg, x); } public static double entry_timeout$get(MemorySegment seg, long index) { - return (double)fuse3_config.entry_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$9.const$1.get(seg.asSlice(index*sizeof())); } public static void entry_timeout$set(MemorySegment seg, long index, double x) { - fuse3_config.entry_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle negative_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("negative_timeout")); public static VarHandle negative_timeout$VH() { - return fuse3_config.negative_timeout$VH; + return constants$9.const$2; } /** * Getter for field: @@ -276,7 +241,7 @@ public class fuse3_config { * } */ public static double negative_timeout$get(MemorySegment seg) { - return (double)fuse3_config.negative_timeout$VH.get(seg); + return (double)constants$9.const$2.get(seg); } /** * Setter for field: @@ -285,17 +250,16 @@ public class fuse3_config { * } */ public static void negative_timeout$set(MemorySegment seg, double x) { - fuse3_config.negative_timeout$VH.set(seg, x); + constants$9.const$2.set(seg, x); } public static double negative_timeout$get(MemorySegment seg, long index) { - return (double)fuse3_config.negative_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$9.const$2.get(seg.asSlice(index*sizeof())); } public static void negative_timeout$set(MemorySegment seg, long index, double x) { - fuse3_config.negative_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle attr_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("attr_timeout")); public static VarHandle attr_timeout$VH() { - return fuse3_config.attr_timeout$VH; + return constants$9.const$3; } /** * Getter for field: @@ -304,7 +268,7 @@ public class fuse3_config { * } */ public static double attr_timeout$get(MemorySegment seg) { - return (double)fuse3_config.attr_timeout$VH.get(seg); + return (double)constants$9.const$3.get(seg); } /** * Setter for field: @@ -313,17 +277,16 @@ public class fuse3_config { * } */ public static void attr_timeout$set(MemorySegment seg, double x) { - fuse3_config.attr_timeout$VH.set(seg, x); + constants$9.const$3.set(seg, x); } public static double attr_timeout$get(MemorySegment seg, long index) { - return (double)fuse3_config.attr_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$9.const$3.get(seg.asSlice(index*sizeof())); } public static void attr_timeout$set(MemorySegment seg, long index, double x) { - fuse3_config.attr_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle intr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("intr")); public static VarHandle intr$VH() { - return fuse3_config.intr$VH; + return constants$9.const$4; } /** * Getter for field: @@ -332,7 +295,7 @@ public class fuse3_config { * } */ public static int intr$get(MemorySegment seg) { - return (int)fuse3_config.intr$VH.get(seg); + return (int)constants$9.const$4.get(seg); } /** * Setter for field: @@ -341,17 +304,16 @@ public class fuse3_config { * } */ public static void intr$set(MemorySegment seg, int x) { - fuse3_config.intr$VH.set(seg, x); + constants$9.const$4.set(seg, x); } public static int intr$get(MemorySegment seg, long index) { - return (int)fuse3_config.intr$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$9.const$4.get(seg.asSlice(index*sizeof())); } public static void intr$set(MemorySegment seg, long index, int x) { - fuse3_config.intr$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle intr_signal$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("intr_signal")); public static VarHandle intr_signal$VH() { - return fuse3_config.intr_signal$VH; + return constants$9.const$5; } /** * Getter for field: @@ -360,7 +322,7 @@ public class fuse3_config { * } */ public static int intr_signal$get(MemorySegment seg) { - return (int)fuse3_config.intr_signal$VH.get(seg); + return (int)constants$9.const$5.get(seg); } /** * Setter for field: @@ -369,17 +331,16 @@ public class fuse3_config { * } */ public static void intr_signal$set(MemorySegment seg, int x) { - fuse3_config.intr_signal$VH.set(seg, x); + constants$9.const$5.set(seg, x); } public static int intr_signal$get(MemorySegment seg, long index) { - return (int)fuse3_config.intr_signal$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$9.const$5.get(seg.asSlice(index*sizeof())); } public static void intr_signal$set(MemorySegment seg, long index, int x) { - fuse3_config.intr_signal$VH.set(seg.asSlice(index*sizeof()), x); + constants$9.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle remember$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("remember")); public static VarHandle remember$VH() { - return fuse3_config.remember$VH; + return constants$10.const$0; } /** * Getter for field: @@ -388,7 +349,7 @@ public class fuse3_config { * } */ public static int remember$get(MemorySegment seg) { - return (int)fuse3_config.remember$VH.get(seg); + return (int)constants$10.const$0.get(seg); } /** * Setter for field: @@ -397,17 +358,16 @@ public class fuse3_config { * } */ public static void remember$set(MemorySegment seg, int x) { - fuse3_config.remember$VH.set(seg, x); + constants$10.const$0.set(seg, x); } public static int remember$get(MemorySegment seg, long index) { - return (int)fuse3_config.remember$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$0.get(seg.asSlice(index*sizeof())); } public static void remember$set(MemorySegment seg, long index, int x) { - fuse3_config.remember$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle hard_remove$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("hard_remove")); public static VarHandle hard_remove$VH() { - return fuse3_config.hard_remove$VH; + return constants$10.const$1; } /** * Getter for field: @@ -416,7 +376,7 @@ public class fuse3_config { * } */ public static int hard_remove$get(MemorySegment seg) { - return (int)fuse3_config.hard_remove$VH.get(seg); + return (int)constants$10.const$1.get(seg); } /** * Setter for field: @@ -425,17 +385,16 @@ public class fuse3_config { * } */ public static void hard_remove$set(MemorySegment seg, int x) { - fuse3_config.hard_remove$VH.set(seg, x); + constants$10.const$1.set(seg, x); } public static int hard_remove$get(MemorySegment seg, long index) { - return (int)fuse3_config.hard_remove$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$1.get(seg.asSlice(index*sizeof())); } public static void hard_remove$set(MemorySegment seg, long index, int x) { - fuse3_config.hard_remove$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle use_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("use_ino")); public static VarHandle use_ino$VH() { - return fuse3_config.use_ino$VH; + return constants$10.const$2; } /** * Getter for field: @@ -444,7 +403,7 @@ public class fuse3_config { * } */ public static int use_ino$get(MemorySegment seg) { - return (int)fuse3_config.use_ino$VH.get(seg); + return (int)constants$10.const$2.get(seg); } /** * Setter for field: @@ -453,17 +412,16 @@ public class fuse3_config { * } */ public static void use_ino$set(MemorySegment seg, int x) { - fuse3_config.use_ino$VH.set(seg, x); + constants$10.const$2.set(seg, x); } public static int use_ino$get(MemorySegment seg, long index) { - return (int)fuse3_config.use_ino$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$2.get(seg.asSlice(index*sizeof())); } public static void use_ino$set(MemorySegment seg, long index, int x) { - fuse3_config.use_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle readdir_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir_ino")); public static VarHandle readdir_ino$VH() { - return fuse3_config.readdir_ino$VH; + return constants$10.const$3; } /** * Getter for field: @@ -472,7 +430,7 @@ public class fuse3_config { * } */ public static int readdir_ino$get(MemorySegment seg) { - return (int)fuse3_config.readdir_ino$VH.get(seg); + return (int)constants$10.const$3.get(seg); } /** * Setter for field: @@ -481,17 +439,16 @@ public class fuse3_config { * } */ public static void readdir_ino$set(MemorySegment seg, int x) { - fuse3_config.readdir_ino$VH.set(seg, x); + constants$10.const$3.set(seg, x); } public static int readdir_ino$get(MemorySegment seg, long index) { - return (int)fuse3_config.readdir_ino$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$3.get(seg.asSlice(index*sizeof())); } public static void readdir_ino$set(MemorySegment seg, long index, int x) { - fuse3_config.readdir_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle direct_io$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("direct_io")); public static VarHandle direct_io$VH() { - return fuse3_config.direct_io$VH; + return constants$10.const$4; } /** * Getter for field: @@ -500,7 +457,7 @@ public class fuse3_config { * } */ public static int direct_io$get(MemorySegment seg) { - return (int)fuse3_config.direct_io$VH.get(seg); + return (int)constants$10.const$4.get(seg); } /** * Setter for field: @@ -509,17 +466,16 @@ public class fuse3_config { * } */ public static void direct_io$set(MemorySegment seg, int x) { - fuse3_config.direct_io$VH.set(seg, x); + constants$10.const$4.set(seg, x); } public static int direct_io$get(MemorySegment seg, long index) { - return (int)fuse3_config.direct_io$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$4.get(seg.asSlice(index*sizeof())); } public static void direct_io$set(MemorySegment seg, long index, int x) { - fuse3_config.direct_io$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle kernel_cache$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("kernel_cache")); public static VarHandle kernel_cache$VH() { - return fuse3_config.kernel_cache$VH; + return constants$10.const$5; } /** * Getter for field: @@ -528,7 +484,7 @@ public class fuse3_config { * } */ public static int kernel_cache$get(MemorySegment seg) { - return (int)fuse3_config.kernel_cache$VH.get(seg); + return (int)constants$10.const$5.get(seg); } /** * Setter for field: @@ -537,17 +493,16 @@ public class fuse3_config { * } */ public static void kernel_cache$set(MemorySegment seg, int x) { - fuse3_config.kernel_cache$VH.set(seg, x); + constants$10.const$5.set(seg, x); } public static int kernel_cache$get(MemorySegment seg, long index) { - return (int)fuse3_config.kernel_cache$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$10.const$5.get(seg.asSlice(index*sizeof())); } public static void kernel_cache$set(MemorySegment seg, long index, int x) { - fuse3_config.kernel_cache$VH.set(seg.asSlice(index*sizeof()), x); + constants$10.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle auto_cache$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("auto_cache")); public static VarHandle auto_cache$VH() { - return fuse3_config.auto_cache$VH; + return constants$11.const$0; } /** * Getter for field: @@ -556,7 +511,7 @@ public class fuse3_config { * } */ public static int auto_cache$get(MemorySegment seg) { - return (int)fuse3_config.auto_cache$VH.get(seg); + return (int)constants$11.const$0.get(seg); } /** * Setter for field: @@ -565,17 +520,16 @@ public class fuse3_config { * } */ public static void auto_cache$set(MemorySegment seg, int x) { - fuse3_config.auto_cache$VH.set(seg, x); + constants$11.const$0.set(seg, x); } public static int auto_cache$get(MemorySegment seg, long index) { - return (int)fuse3_config.auto_cache$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$0.get(seg.asSlice(index*sizeof())); } public static void auto_cache$set(MemorySegment seg, long index, int x) { - fuse3_config.auto_cache$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle ac_attr_timeout_set$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout_set")); public static VarHandle ac_attr_timeout_set$VH() { - return fuse3_config.ac_attr_timeout_set$VH; + return constants$11.const$1; } /** * Getter for field: @@ -584,7 +538,7 @@ public class fuse3_config { * } */ public static int ac_attr_timeout_set$get(MemorySegment seg) { - return (int)fuse3_config.ac_attr_timeout_set$VH.get(seg); + return (int)constants$11.const$1.get(seg); } /** * Setter for field: @@ -593,17 +547,16 @@ public class fuse3_config { * } */ public static void ac_attr_timeout_set$set(MemorySegment seg, int x) { - fuse3_config.ac_attr_timeout_set$VH.set(seg, x); + constants$11.const$1.set(seg, x); } public static int ac_attr_timeout_set$get(MemorySegment seg, long index) { - return (int)fuse3_config.ac_attr_timeout_set$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$1.get(seg.asSlice(index*sizeof())); } public static void ac_attr_timeout_set$set(MemorySegment seg, long index, int x) { - fuse3_config.ac_attr_timeout_set$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle ac_attr_timeout$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ac_attr_timeout")); public static VarHandle ac_attr_timeout$VH() { - return fuse3_config.ac_attr_timeout$VH; + return constants$11.const$2; } /** * Getter for field: @@ -612,7 +565,7 @@ public class fuse3_config { * } */ public static double ac_attr_timeout$get(MemorySegment seg) { - return (double)fuse3_config.ac_attr_timeout$VH.get(seg); + return (double)constants$11.const$2.get(seg); } /** * Setter for field: @@ -621,17 +574,16 @@ public class fuse3_config { * } */ public static void ac_attr_timeout$set(MemorySegment seg, double x) { - fuse3_config.ac_attr_timeout$VH.set(seg, x); + constants$11.const$2.set(seg, x); } public static double ac_attr_timeout$get(MemorySegment seg, long index) { - return (double)fuse3_config.ac_attr_timeout$VH.get(seg.asSlice(index*sizeof())); + return (double)constants$11.const$2.get(seg.asSlice(index*sizeof())); } public static void ac_attr_timeout$set(MemorySegment seg, long index, double x) { - fuse3_config.ac_attr_timeout$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle nullpath_ok$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("nullpath_ok")); public static VarHandle nullpath_ok$VH() { - return fuse3_config.nullpath_ok$VH; + return constants$11.const$3; } /** * Getter for field: @@ -640,7 +592,7 @@ public class fuse3_config { * } */ public static int nullpath_ok$get(MemorySegment seg) { - return (int)fuse3_config.nullpath_ok$VH.get(seg); + return (int)constants$11.const$3.get(seg); } /** * Setter for field: @@ -649,17 +601,16 @@ public class fuse3_config { * } */ public static void nullpath_ok$set(MemorySegment seg, int x) { - fuse3_config.nullpath_ok$VH.set(seg, x); + constants$11.const$3.set(seg, x); } public static int nullpath_ok$get(MemorySegment seg, long index) { - return (int)fuse3_config.nullpath_ok$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$3.get(seg.asSlice(index*sizeof())); } public static void nullpath_ok$set(MemorySegment seg, long index, int x) { - fuse3_config.nullpath_ok$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle show_help$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("show_help")); public static VarHandle show_help$VH() { - return fuse3_config.show_help$VH; + return constants$11.const$4; } /** * Getter for field: @@ -668,7 +619,7 @@ public class fuse3_config { * } */ public static int show_help$get(MemorySegment seg) { - return (int)fuse3_config.show_help$VH.get(seg); + return (int)constants$11.const$4.get(seg); } /** * Setter for field: @@ -677,17 +628,16 @@ public class fuse3_config { * } */ public static void show_help$set(MemorySegment seg, int x) { - fuse3_config.show_help$VH.set(seg, x); + constants$11.const$4.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { - return (int)fuse3_config.show_help$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$11.const$4.get(seg.asSlice(index*sizeof())); } public static void show_help$set(MemorySegment seg, long index, int x) { - fuse3_config.show_help$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle modules$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("modules")); public static VarHandle modules$VH() { - return fuse3_config.modules$VH; + return constants$11.const$5; } /** * Getter for field: @@ -696,7 +646,7 @@ public class fuse3_config { * } */ public static MemorySegment modules$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_config.modules$VH.get(seg); + return (java.lang.foreign.MemorySegment)constants$11.const$5.get(seg); } /** * Setter for field: @@ -705,17 +655,16 @@ public class fuse3_config { * } */ public static void modules$set(MemorySegment seg, MemorySegment x) { - fuse3_config.modules$VH.set(seg, x); + constants$11.const$5.set(seg, x); } public static MemorySegment modules$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_config.modules$VH.get(seg.asSlice(index*sizeof())); + return (java.lang.foreign.MemorySegment)constants$11.const$5.get(seg.asSlice(index*sizeof())); } public static void modules$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_config.modules$VH.set(seg.asSlice(index*sizeof()), x); + constants$11.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle debug$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("debug")); public static VarHandle debug$VH() { - return fuse3_config.debug$VH; + return constants$12.const$0; } /** * Getter for field: @@ -724,7 +673,7 @@ public class fuse3_config { * } */ public static int debug$get(MemorySegment seg) { - return (int)fuse3_config.debug$VH.get(seg); + return (int)constants$12.const$0.get(seg); } /** * Setter for field: @@ -733,20 +682,20 @@ public class fuse3_config { * } */ public static void debug$set(MemorySegment seg, int x) { - fuse3_config.debug$VH.set(seg, x); + constants$12.const$0.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { - return (int)fuse3_config.debug$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$12.const$0.get(seg.asSlice(index*sizeof())); } public static void debug$set(MemorySegment seg, long index, int x) { - fuse3_config.debug$VH.set(seg.asSlice(index*sizeof()), x); + constants$12.const$0.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_conn_info.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_conn_info.java similarity index 55% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_conn_info.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_conn_info.java index 415a3b40..686f3ab9 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_conn_info.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_conn_info.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,25 +26,11 @@ */ public class fuse3_conn_info { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG$LAYOUT.withName("proto_major"), - Constants$root.C_LONG$LAYOUT.withName("proto_minor"), - Constants$root.C_LONG$LAYOUT.withName("max_write"), - Constants$root.C_LONG$LAYOUT.withName("max_read"), - Constants$root.C_LONG$LAYOUT.withName("max_readahead"), - Constants$root.C_LONG$LAYOUT.withName("capable"), - Constants$root.C_LONG$LAYOUT.withName("want"), - Constants$root.C_LONG$LAYOUT.withName("max_background"), - Constants$root.C_LONG$LAYOUT.withName("congestion_threshold"), - Constants$root.C_LONG$LAYOUT.withName("time_gran"), - MemoryLayout.sequenceLayout(22, Constants$root.C_LONG$LAYOUT).withName("reserved") - ).withName("fuse3_conn_info"); public static MemoryLayout $LAYOUT() { - return fuse3_conn_info.$struct$LAYOUT; + return constants$5.const$4; } - static final VarHandle proto_major$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_major")); public static VarHandle proto_major$VH() { - return fuse3_conn_info.proto_major$VH; + return constants$5.const$5; } /** * Getter for field: @@ -53,7 +39,7 @@ public class fuse3_conn_info { * } */ public static int proto_major$get(MemorySegment seg) { - return (int)fuse3_conn_info.proto_major$VH.get(seg); + return (int)constants$5.const$5.get(seg); } /** * Setter for field: @@ -62,17 +48,16 @@ public class fuse3_conn_info { * } */ public static void proto_major$set(MemorySegment seg, int x) { - fuse3_conn_info.proto_major$VH.set(seg, x); + constants$5.const$5.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.proto_major$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$5.get(seg.asSlice(index*sizeof())); } public static void proto_major$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.proto_major$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle proto_minor$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("proto_minor")); public static VarHandle proto_minor$VH() { - return fuse3_conn_info.proto_minor$VH; + return constants$6.const$0; } /** * Getter for field: @@ -81,7 +66,7 @@ public class fuse3_conn_info { * } */ public static int proto_minor$get(MemorySegment seg) { - return (int)fuse3_conn_info.proto_minor$VH.get(seg); + return (int)constants$6.const$0.get(seg); } /** * Setter for field: @@ -90,17 +75,16 @@ public class fuse3_conn_info { * } */ public static void proto_minor$set(MemorySegment seg, int x) { - fuse3_conn_info.proto_minor$VH.set(seg, x); + constants$6.const$0.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.proto_minor$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$0.get(seg.asSlice(index*sizeof())); } public static void proto_minor$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.proto_minor$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_write")); public static VarHandle max_write$VH() { - return fuse3_conn_info.max_write$VH; + return constants$6.const$1; } /** * Getter for field: @@ -109,7 +93,7 @@ public class fuse3_conn_info { * } */ public static int max_write$get(MemorySegment seg) { - return (int)fuse3_conn_info.max_write$VH.get(seg); + return (int)constants$6.const$1.get(seg); } /** * Setter for field: @@ -118,17 +102,16 @@ public class fuse3_conn_info { * } */ public static void max_write$set(MemorySegment seg, int x) { - fuse3_conn_info.max_write$VH.set(seg, x); + constants$6.const$1.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.max_write$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$1.get(seg.asSlice(index*sizeof())); } public static void max_write$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.max_write$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_read")); public static VarHandle max_read$VH() { - return fuse3_conn_info.max_read$VH; + return constants$6.const$2; } /** * Getter for field: @@ -137,7 +120,7 @@ public class fuse3_conn_info { * } */ public static int max_read$get(MemorySegment seg) { - return (int)fuse3_conn_info.max_read$VH.get(seg); + return (int)constants$6.const$2.get(seg); } /** * Setter for field: @@ -146,17 +129,16 @@ public class fuse3_conn_info { * } */ public static void max_read$set(MemorySegment seg, int x) { - fuse3_conn_info.max_read$VH.set(seg, x); + constants$6.const$2.set(seg, x); } public static int max_read$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.max_read$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$2.get(seg.asSlice(index*sizeof())); } public static void max_read$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.max_read$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_readahead$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_readahead")); public static VarHandle max_readahead$VH() { - return fuse3_conn_info.max_readahead$VH; + return constants$6.const$3; } /** * Getter for field: @@ -165,7 +147,7 @@ public class fuse3_conn_info { * } */ public static int max_readahead$get(MemorySegment seg) { - return (int)fuse3_conn_info.max_readahead$VH.get(seg); + return (int)constants$6.const$3.get(seg); } /** * Setter for field: @@ -174,17 +156,16 @@ public class fuse3_conn_info { * } */ public static void max_readahead$set(MemorySegment seg, int x) { - fuse3_conn_info.max_readahead$VH.set(seg, x); + constants$6.const$3.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.max_readahead$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$3.get(seg.asSlice(index*sizeof())); } public static void max_readahead$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.max_readahead$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle capable$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("capable")); public static VarHandle capable$VH() { - return fuse3_conn_info.capable$VH; + return constants$6.const$4; } /** * Getter for field: @@ -193,7 +174,7 @@ public class fuse3_conn_info { * } */ public static int capable$get(MemorySegment seg) { - return (int)fuse3_conn_info.capable$VH.get(seg); + return (int)constants$6.const$4.get(seg); } /** * Setter for field: @@ -202,17 +183,16 @@ public class fuse3_conn_info { * } */ public static void capable$set(MemorySegment seg, int x) { - fuse3_conn_info.capable$VH.set(seg, x); + constants$6.const$4.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.capable$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$4.get(seg.asSlice(index*sizeof())); } public static void capable$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.capable$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle want$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("want")); public static VarHandle want$VH() { - return fuse3_conn_info.want$VH; + return constants$6.const$5; } /** * Getter for field: @@ -221,7 +201,7 @@ public class fuse3_conn_info { * } */ public static int want$get(MemorySegment seg) { - return (int)fuse3_conn_info.want$VH.get(seg); + return (int)constants$6.const$5.get(seg); } /** * Setter for field: @@ -230,17 +210,16 @@ public class fuse3_conn_info { * } */ public static void want$set(MemorySegment seg, int x) { - fuse3_conn_info.want$VH.set(seg, x); + constants$6.const$5.set(seg, x); } public static int want$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.want$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$6.const$5.get(seg.asSlice(index*sizeof())); } public static void want$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.want$VH.set(seg.asSlice(index*sizeof()), x); + constants$6.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_background$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_background")); public static VarHandle max_background$VH() { - return fuse3_conn_info.max_background$VH; + return constants$7.const$0; } /** * Getter for field: @@ -249,7 +228,7 @@ public class fuse3_conn_info { * } */ public static int max_background$get(MemorySegment seg) { - return (int)fuse3_conn_info.max_background$VH.get(seg); + return (int)constants$7.const$0.get(seg); } /** * Setter for field: @@ -258,17 +237,16 @@ public class fuse3_conn_info { * } */ public static void max_background$set(MemorySegment seg, int x) { - fuse3_conn_info.max_background$VH.set(seg, x); + constants$7.const$0.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.max_background$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$0.get(seg.asSlice(index*sizeof())); } public static void max_background$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.max_background$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle congestion_threshold$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("congestion_threshold")); public static VarHandle congestion_threshold$VH() { - return fuse3_conn_info.congestion_threshold$VH; + return constants$7.const$1; } /** * Getter for field: @@ -277,7 +255,7 @@ public class fuse3_conn_info { * } */ public static int congestion_threshold$get(MemorySegment seg) { - return (int)fuse3_conn_info.congestion_threshold$VH.get(seg); + return (int)constants$7.const$1.get(seg); } /** * Setter for field: @@ -286,17 +264,16 @@ public class fuse3_conn_info { * } */ public static void congestion_threshold$set(MemorySegment seg, int x) { - fuse3_conn_info.congestion_threshold$VH.set(seg, x); + constants$7.const$1.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.congestion_threshold$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$1.get(seg.asSlice(index*sizeof())); } public static void congestion_threshold$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.congestion_threshold$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle time_gran$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("time_gran")); public static VarHandle time_gran$VH() { - return fuse3_conn_info.time_gran$VH; + return constants$7.const$2; } /** * Getter for field: @@ -305,7 +282,7 @@ public class fuse3_conn_info { * } */ public static int time_gran$get(MemorySegment seg) { - return (int)fuse3_conn_info.time_gran$VH.get(seg); + return (int)constants$7.const$2.get(seg); } /** * Setter for field: @@ -314,13 +291,13 @@ public class fuse3_conn_info { * } */ public static void time_gran$set(MemorySegment seg, int x) { - fuse3_conn_info.time_gran$VH.set(seg, x); + constants$7.const$2.set(seg, x); } public static int time_gran$get(MemorySegment seg, long index) { - return (int)fuse3_conn_info.time_gran$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$7.const$2.get(seg.asSlice(index*sizeof())); } public static void time_gran$set(MemorySegment seg, long index, int x) { - fuse3_conn_info.time_gran$VH.set(seg.asSlice(index*sizeof()), x); + constants$7.const$2.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment reserved$slice(MemorySegment seg) { return seg.asSlice(40, 88); @@ -330,7 +307,7 @@ public class fuse3_conn_info { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_file_info.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_file_info.java similarity index 52% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_file_info.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_file_info.java index 5b341929..ce028fb9 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_file_info.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_file_info.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,30 +26,11 @@ */ public class fuse3_file_info { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG$LAYOUT.withName("flags"), - MemoryLayout.structLayout( - MemoryLayout.paddingLayout(1).withName("writepage"), - MemoryLayout.paddingLayout(1).withName("direct_io"), - MemoryLayout.paddingLayout(1).withName("keep_cache"), - MemoryLayout.paddingLayout(1).withName("flush"), - MemoryLayout.paddingLayout(1).withName("nonseekable"), - MemoryLayout.paddingLayout(1).withName("flock_release"), - MemoryLayout.paddingLayout(26), - MemoryLayout.paddingLayout(27).withName("padding"), - MemoryLayout.paddingLayout(37) - ), - Constants$root.C_LONG_LONG$LAYOUT.withName("fh"), - Constants$root.C_LONG_LONG$LAYOUT.withName("lock_owner"), - Constants$root.C_LONG$LAYOUT.withName("poll_events"), - MemoryLayout.paddingLayout(32) - ).withName("fuse3_file_info"); public static MemoryLayout $LAYOUT() { - return fuse3_file_info.$struct$LAYOUT; + return constants$4.const$2; } - static final VarHandle flags$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flags")); public static VarHandle flags$VH() { - return fuse3_file_info.flags$VH; + return constants$4.const$3; } /** * Getter for field: @@ -58,7 +39,7 @@ public class fuse3_file_info { * } */ public static int flags$get(MemorySegment seg) { - return (int)fuse3_file_info.flags$VH.get(seg); + return (int)constants$4.const$3.get(seg); } /** * Setter for field: @@ -67,17 +48,16 @@ public class fuse3_file_info { * } */ public static void flags$set(MemorySegment seg, int x) { - fuse3_file_info.flags$VH.set(seg, x); + constants$4.const$3.set(seg, x); } public static int flags$get(MemorySegment seg, long index) { - return (int)fuse3_file_info.flags$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$4.const$3.get(seg.asSlice(index*sizeof())); } public static void flags$set(MemorySegment seg, long index, int x) { - fuse3_file_info.flags$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle fh$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fh")); public static VarHandle fh$VH() { - return fuse3_file_info.fh$VH; + return constants$4.const$4; } /** * Getter for field: @@ -86,7 +66,7 @@ public class fuse3_file_info { * } */ public static long fh$get(MemorySegment seg) { - return (long)fuse3_file_info.fh$VH.get(seg); + return (long)constants$4.const$4.get(seg); } /** * Setter for field: @@ -95,17 +75,16 @@ public class fuse3_file_info { * } */ public static void fh$set(MemorySegment seg, long x) { - fuse3_file_info.fh$VH.set(seg, x); + constants$4.const$4.set(seg, x); } public static long fh$get(MemorySegment seg, long index) { - return (long)fuse3_file_info.fh$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$4.const$4.get(seg.asSlice(index*sizeof())); } public static void fh$set(MemorySegment seg, long index, long x) { - fuse3_file_info.fh$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle lock_owner$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock_owner")); public static VarHandle lock_owner$VH() { - return fuse3_file_info.lock_owner$VH; + return constants$4.const$5; } /** * Getter for field: @@ -114,7 +93,7 @@ public class fuse3_file_info { * } */ public static long lock_owner$get(MemorySegment seg) { - return (long)fuse3_file_info.lock_owner$VH.get(seg); + return (long)constants$4.const$5.get(seg); } /** * Setter for field: @@ -123,17 +102,16 @@ public class fuse3_file_info { * } */ public static void lock_owner$set(MemorySegment seg, long x) { - fuse3_file_info.lock_owner$VH.set(seg, x); + constants$4.const$5.set(seg, x); } public static long lock_owner$get(MemorySegment seg, long index) { - return (long)fuse3_file_info.lock_owner$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$4.const$5.get(seg.asSlice(index*sizeof())); } public static void lock_owner$set(MemorySegment seg, long index, long x) { - fuse3_file_info.lock_owner$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle poll_events$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll_events")); public static VarHandle poll_events$VH() { - return fuse3_file_info.poll_events$VH; + return constants$5.const$0; } /** * Getter for field: @@ -142,7 +120,7 @@ public class fuse3_file_info { * } */ public static int poll_events$get(MemorySegment seg) { - return (int)fuse3_file_info.poll_events$VH.get(seg); + return (int)constants$5.const$0.get(seg); } /** * Setter for field: @@ -151,20 +129,20 @@ public class fuse3_file_info { * } */ public static void poll_events$set(MemorySegment seg, int x) { - fuse3_file_info.poll_events$VH.set(seg, x); + constants$5.const$0.set(seg, x); } public static int poll_events$get(MemorySegment seg, long index) { - return (int)fuse3_file_info.poll_events$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$0.get(seg.asSlice(index*sizeof())); } public static void poll_events$set(MemorySegment seg, long index, int x) { - fuse3_file_info.poll_events$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$0.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_fill_dir_t.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_fill_dir_t.java similarity index 63% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_fill_dir_t.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_fill_dir_t.java index 345c9526..8fde60fa 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_fill_dir_t.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_fill_dir_t.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -15,14 +15,14 @@ public interface fuse3_fill_dir_t { int apply(java.lang.foreign.MemorySegment buf, java.lang.foreign.MemorySegment name, java.lang.foreign.MemorySegment stbuf, long off, int flags); - static MemorySegment allocate(fuse3_fill_dir_t fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fuse3_fill_dir_t.class, fi, constants$0.fuse3_fill_dir_t$FUNC, scope); + static MemorySegment allocate(fuse3_fill_dir_t fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$7.const$4, fi, constants$7.const$3, scope); } - static fuse3_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + static fuse3_fill_dir_t ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); return (java.lang.foreign.MemorySegment _buf, java.lang.foreign.MemorySegment _name, java.lang.foreign.MemorySegment _stbuf, long _off, int _flags) -> { try { - return (int)constants$0.fuse3_fill_dir_t$MH.invokeExact(symbol, _buf, _name, _stbuf, _off, _flags); + return (int)constants$7.const$5.invokeExact(symbol, _buf, _name, _stbuf, _off, _flags); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_loop_config.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_loop_config.java similarity index 57% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_loop_config.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_loop_config.java index 8a48caec..f324be86 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_loop_config.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_loop_config.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -17,16 +17,11 @@ */ public class fuse3_loop_config { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG$LAYOUT.withName("clone_fd"), - Constants$root.C_LONG$LAYOUT.withName("max_idle_threads") - ).withName("fuse3_loop_config"); public static MemoryLayout $LAYOUT() { - return fuse3_loop_config.$struct$LAYOUT; + return constants$5.const$1; } - static final VarHandle clone_fd$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("clone_fd")); public static VarHandle clone_fd$VH() { - return fuse3_loop_config.clone_fd$VH; + return constants$5.const$2; } /** * Getter for field: @@ -35,7 +30,7 @@ public class fuse3_loop_config { * } */ public static int clone_fd$get(MemorySegment seg) { - return (int)fuse3_loop_config.clone_fd$VH.get(seg); + return (int)constants$5.const$2.get(seg); } /** * Setter for field: @@ -44,17 +39,16 @@ public class fuse3_loop_config { * } */ public static void clone_fd$set(MemorySegment seg, int x) { - fuse3_loop_config.clone_fd$VH.set(seg, x); + constants$5.const$2.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { - return (int)fuse3_loop_config.clone_fd$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$2.get(seg.asSlice(index*sizeof())); } public static void clone_fd$set(MemorySegment seg, long index, int x) { - fuse3_loop_config.clone_fd$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle max_idle_threads$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("max_idle_threads")); public static VarHandle max_idle_threads$VH() { - return fuse3_loop_config.max_idle_threads$VH; + return constants$5.const$3; } /** * Getter for field: @@ -63,7 +57,7 @@ public class fuse3_loop_config { * } */ public static int max_idle_threads$get(MemorySegment seg) { - return (int)fuse3_loop_config.max_idle_threads$VH.get(seg); + return (int)constants$5.const$3.get(seg); } /** * Setter for field: @@ -72,20 +66,20 @@ public class fuse3_loop_config { * } */ public static void max_idle_threads$set(MemorySegment seg, int x) { - fuse3_loop_config.max_idle_threads$VH.set(seg, x); + constants$5.const$3.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { - return (int)fuse3_loop_config.max_idle_threads$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$5.const$3.get(seg.asSlice(index*sizeof())); } public static void max_idle_threads$set(MemorySegment seg, long index, int x) { - fuse3_loop_config.max_idle_threads$VH.set(seg.asSlice(index*sizeof()), x); + constants$5.const$3.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_operations.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_operations.java new file mode 100644 index 00000000..6fab8fcd --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse3_operations.java @@ -0,0 +1,2189 @@ +// Generated by jextract + +package org.cryptomator.jfuse.win.extr.fuse3; + +import java.lang.invoke.MethodHandle; +import java.lang.invoke.VarHandle; +import java.nio.ByteOrder; +import java.lang.foreign.*; +import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse3_operations { + * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); + * int (*readlink)(char*,char*,unsigned long long); + * int (*mknod)(char*,unsigned int,unsigned int); + * int (*mkdir)(char*,unsigned int); + * int (*unlink)(char*); + * int (*rmdir)(char*); + * int (*symlink)(char*,char*); + * int (*rename)(char*,char*,unsigned int); + * int (*link)(char*,char*); + * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); + * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); + * int (*truncate)(char*,long long,struct fuse3_file_info*); + * int (*open)(char*,struct fuse3_file_info*); + * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * int (*statfs)(char*,struct fuse_statvfs*); + * int (*flush)(char*,struct fuse3_file_info*); + * int (*release)(char*,struct fuse3_file_info*); + * int (*fsync)(char*,int,struct fuse3_file_info*); + * int (*setxattr)(char*,char*,char*,unsigned long long,int); + * int (*getxattr)(char*,char*,char*,unsigned long long); + * int (*listxattr)(char*,char*,unsigned long long); + * int (*removexattr)(char*,char*); + * int (*opendir)(char*,struct fuse3_file_info*); + * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); + * int (*releasedir)(char*,struct fuse3_file_info*); + * int (*fsyncdir)(char*,int,struct fuse3_file_info*); + * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); + * void (*destroy)(void*); + * int (*access)(char*,int); + * int (*create)(char*,unsigned int,struct fuse3_file_info*); + * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); + * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); + * int (*bmap)(char*,unsigned long long,unsigned long long*); + * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); + * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); + * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); + * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); + * int (*flock)(char*,struct fuse3_file_info*,int); + * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); + * }; + * } + */ +public class fuse3_operations { + + public static MemoryLayout $LAYOUT() { + return constants$12.const$1; + } + /** + * {@snippet : + * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); + * } + */ + public interface getattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(getattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$12.const$3, fi, constants$12.const$2, scope); + } + static getattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$12.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getattr$VH() { + return constants$12.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); + * } + */ + public static MemorySegment getattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$12.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); + * } + */ + public static void getattr$set(MemorySegment seg, MemorySegment x) { + constants$12.const$5.set(seg, x); + } + public static MemorySegment getattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$12.const$5.get(seg.asSlice(index*sizeof())); + } + public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$12.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static getattr getattr(MemorySegment segment, Arena scope) { + return getattr.ofAddress(getattr$get(segment), scope); + } + /** + * {@snippet : + * int (*readlink)(char*,char*,unsigned long long); + * } + */ + public interface readlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(readlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$13.const$1, fi, constants$13.const$0, scope); + } + static readlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$13.const$2.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readlink$VH() { + return constants$13.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*readlink)(char*,char*,unsigned long long); + * } + */ + public static MemorySegment readlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$13.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readlink)(char*,char*,unsigned long long); + * } + */ + public static void readlink$set(MemorySegment seg, MemorySegment x) { + constants$13.const$3.set(seg, x); + } + public static MemorySegment readlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$13.const$3.get(seg.asSlice(index*sizeof())); + } + public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$13.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static readlink readlink(MemorySegment segment, Arena scope) { + return readlink.ofAddress(readlink$get(segment), scope); + } + /** + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned int); + * } + */ + public interface mknod { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2); + static MemorySegment allocate(mknod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$13.const$5, fi, constants$13.const$4, scope); + } + static mknod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2) -> { + try { + return (int)constants$14.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mknod$VH() { + return constants$14.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned int); + * } + */ + public static MemorySegment mknod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$14.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mknod)(char*,unsigned int,unsigned int); + * } + */ + public static void mknod$set(MemorySegment seg, MemorySegment x) { + constants$14.const$1.set(seg, x); + } + public static MemorySegment mknod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$14.const$1.get(seg.asSlice(index*sizeof())); + } + public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { + constants$14.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static mknod mknod(MemorySegment segment, Arena scope) { + return mknod.ofAddress(mknod$get(segment), scope); + } + /** + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public interface mkdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(mkdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$14.const$3, fi, constants$14.const$2, scope); + } + static mkdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$14.const$4.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle mkdir$VH() { + return constants$14.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public static MemorySegment mkdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$14.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*mkdir)(char*,unsigned int); + * } + */ + public static void mkdir$set(MemorySegment seg, MemorySegment x) { + constants$14.const$5.set(seg, x); + } + public static MemorySegment mkdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$14.const$5.get(seg.asSlice(index*sizeof())); + } + public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$14.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static mkdir mkdir(MemorySegment segment, Arena scope) { + return mkdir.ofAddress(mkdir$get(segment), scope); + } + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ + public interface unlink { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(unlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$1, fi, constants$15.const$0, scope); + } + static unlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$15.const$2.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle unlink$VH() { + return constants$15.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static MemorySegment unlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$15.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*unlink)(char*); + * } + */ + public static void unlink$set(MemorySegment seg, MemorySegment x) { + constants$15.const$3.set(seg, x); + } + public static MemorySegment unlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$15.const$3.get(seg.asSlice(index*sizeof())); + } + public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$15.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static unlink unlink(MemorySegment segment, Arena scope) { + return unlink.ofAddress(unlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public interface rmdir { + + int apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(rmdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$15.const$4, fi, constants$15.const$0, scope); + } + static rmdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + return (int)constants$15.const$2.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rmdir$VH() { + return constants$15.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static MemorySegment rmdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$15.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rmdir)(char*); + * } + */ + public static void rmdir$set(MemorySegment seg, MemorySegment x) { + constants$15.const$5.set(seg, x); + } + public static MemorySegment rmdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$15.const$5.get(seg.asSlice(index*sizeof())); + } + public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$15.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static rmdir rmdir(MemorySegment segment, Arena scope) { + return rmdir.ofAddress(rmdir$get(segment), scope); + } + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public interface symlink { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(symlink fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$16.const$1, fi, constants$16.const$0, scope); + } + static symlink ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle symlink$VH() { + return constants$16.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static MemorySegment symlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$16.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ + public static void symlink$set(MemorySegment seg, MemorySegment x) { + constants$16.const$3.set(seg, x); + } + public static MemorySegment symlink$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$16.const$3.get(seg.asSlice(index*sizeof())); + } + public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { + constants$16.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static symlink symlink(MemorySegment segment, Arena scope) { + return symlink.ofAddress(symlink$get(segment), scope); + } + /** + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public interface rename { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(rename fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$16.const$5, fi, constants$16.const$4, scope); + } + static rename ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$17.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle rename$VH() { + return constants$17.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public static MemorySegment rename$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$17.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*rename)(char*,char*,unsigned int); + * } + */ + public static void rename$set(MemorySegment seg, MemorySegment x) { + constants$17.const$1.set(seg, x); + } + public static MemorySegment rename$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$17.const$1.get(seg.asSlice(index*sizeof())); + } + public static void rename$set(MemorySegment seg, long index, MemorySegment x) { + constants$17.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static rename rename(MemorySegment segment, Arena scope) { + return rename.ofAddress(rename$get(segment), scope); + } + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public interface link { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(link fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$2, fi, constants$16.const$0, scope); + } + static link ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle link$VH() { + return constants$17.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static MemorySegment link$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$17.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*link)(char*,char*); + * } + */ + public static void link$set(MemorySegment seg, MemorySegment x) { + constants$17.const$3.set(seg, x); + } + public static MemorySegment link$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$17.const$3.get(seg.asSlice(index*sizeof())); + } + public static void link$set(MemorySegment seg, long index, MemorySegment x) { + constants$17.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static link link(MemorySegment segment, Arena scope) { + return link.ofAddress(link$get(segment), scope); + } + /** + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); + * } + */ + public interface chmod { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(chmod fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$17.const$5, fi, constants$17.const$4, scope); + } + static chmod ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$18.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chmod$VH() { + return constants$18.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); + * } + */ + public static MemorySegment chmod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); + * } + */ + public static void chmod$set(MemorySegment seg, MemorySegment x) { + constants$18.const$1.set(seg, x); + } + public static MemorySegment chmod$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$1.get(seg.asSlice(index*sizeof())); + } + public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static chmod chmod(MemorySegment segment, Arena scope) { + return chmod.ofAddress(chmod$get(segment), scope); + } + /** + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); + * } + */ + public interface chown { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(chown fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$18.const$3, fi, constants$18.const$2, scope); + } + static chown ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$18.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle chown$VH() { + return constants$18.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); + * } + */ + public static MemorySegment chown$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$18.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); + * } + */ + public static void chown$set(MemorySegment seg, MemorySegment x) { + constants$18.const$5.set(seg, x); + } + public static MemorySegment chown$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$18.const$5.get(seg.asSlice(index*sizeof())); + } + public static void chown$set(MemorySegment seg, long index, MemorySegment x) { + constants$18.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static chown chown(MemorySegment segment, Arena scope) { + return chown.ofAddress(chown$get(segment), scope); + } + /** + * {@snippet : + * int (*truncate)(char*,long long,struct fuse3_file_info*); + * } + */ + public interface truncate { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(truncate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$1, fi, constants$19.const$0, scope); + } + static truncate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$19.const$2.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle truncate$VH() { + return constants$19.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*truncate)(char*,long long,struct fuse3_file_info*); + * } + */ + public static MemorySegment truncate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*truncate)(char*,long long,struct fuse3_file_info*); + * } + */ + public static void truncate$set(MemorySegment seg, MemorySegment x) { + constants$19.const$3.set(seg, x); + } + public static MemorySegment truncate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$3.get(seg.asSlice(index*sizeof())); + } + public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static truncate truncate(MemorySegment segment, Arena scope) { + return truncate.ofAddress(truncate$get(segment), scope); + } + /** + * {@snippet : + * int (*open)(char*,struct fuse3_file_info*); + * } + */ + public interface open { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(open fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$19.const$4, fi, constants$16.const$0, scope); + } + static open ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle open$VH() { + return constants$19.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*open)(char*,struct fuse3_file_info*); + * } + */ + public static MemorySegment open$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$19.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*open)(char*,struct fuse3_file_info*); + * } + */ + public static void open$set(MemorySegment seg, MemorySegment x) { + constants$19.const$5.set(seg, x); + } + public static MemorySegment open$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$19.const$5.get(seg.asSlice(index*sizeof())); + } + public static void open$set(MemorySegment seg, long index, MemorySegment x) { + constants$19.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static open open(MemorySegment segment, Arena scope) { + return open.ofAddress(open$get(segment), scope); + } + /** + * {@snippet : + * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public interface read { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$1, fi, constants$20.const$0, scope); + } + static read ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$20.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read$VH() { + return constants$20.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public static MemorySegment read$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public static void read$set(MemorySegment seg, MemorySegment x) { + constants$20.const$3.set(seg, x); + } + public static MemorySegment read$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$3.get(seg.asSlice(index*sizeof())); + } + public static void read$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static read read(MemorySegment segment, Arena scope) { + return read.ofAddress(read$get(segment), scope); + } + /** + * {@snippet : + * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public interface write { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(write fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$20.const$4, fi, constants$20.const$0, scope); + } + static write ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$20.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write$VH() { + return constants$20.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public static MemorySegment write$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$20.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public static void write$set(MemorySegment seg, MemorySegment x) { + constants$20.const$5.set(seg, x); + } + public static MemorySegment write$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$20.const$5.get(seg.asSlice(index*sizeof())); + } + public static void write$set(MemorySegment seg, long index, MemorySegment x) { + constants$20.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static write write(MemorySegment segment, Arena scope) { + return write.ofAddress(write$get(segment), scope); + } + /** + * {@snippet : + * int (*statfs)(char*,struct fuse_statvfs*); + * } + */ + public interface statfs { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(statfs fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$0, fi, constants$16.const$0, scope); + } + static statfs ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle statfs$VH() { + return constants$21.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*statfs)(char*,struct fuse_statvfs*); + * } + */ + public static MemorySegment statfs$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*statfs)(char*,struct fuse_statvfs*); + * } + */ + public static void statfs$set(MemorySegment seg, MemorySegment x) { + constants$21.const$1.set(seg, x); + } + public static MemorySegment statfs$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$1.get(seg.asSlice(index*sizeof())); + } + public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static statfs statfs(MemorySegment segment, Arena scope) { + return statfs.ofAddress(statfs$get(segment), scope); + } + /** + * {@snippet : + * int (*flush)(char*,struct fuse3_file_info*); + * } + */ + public interface flush { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(flush fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$2, fi, constants$16.const$0, scope); + } + static flush ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flush$VH() { + return constants$21.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*flush)(char*,struct fuse3_file_info*); + * } + */ + public static MemorySegment flush$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flush)(char*,struct fuse3_file_info*); + * } + */ + public static void flush$set(MemorySegment seg, MemorySegment x) { + constants$21.const$3.set(seg, x); + } + public static MemorySegment flush$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$3.get(seg.asSlice(index*sizeof())); + } + public static void flush$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static flush flush(MemorySegment segment, Arena scope) { + return flush.ofAddress(flush$get(segment), scope); + } + /** + * {@snippet : + * int (*release)(char*,struct fuse3_file_info*); + * } + */ + public interface release { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(release fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$21.const$4, fi, constants$16.const$0, scope); + } + static release ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle release$VH() { + return constants$21.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*release)(char*,struct fuse3_file_info*); + * } + */ + public static MemorySegment release$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$21.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*release)(char*,struct fuse3_file_info*); + * } + */ + public static void release$set(MemorySegment seg, MemorySegment x) { + constants$21.const$5.set(seg, x); + } + public static MemorySegment release$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$21.const$5.get(seg.asSlice(index*sizeof())); + } + public static void release$set(MemorySegment seg, long index, MemorySegment x) { + constants$21.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static release release(MemorySegment segment, Arena scope) { + return release.ofAddress(release$get(segment), scope); + } + /** + * {@snippet : + * int (*fsync)(char*,int,struct fuse3_file_info*); + * } + */ + public interface fsync { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsync fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$0, fi, constants$17.const$4, scope); + } + static fsync ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$18.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsync$VH() { + return constants$22.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse3_file_info*); + * } + */ + public static MemorySegment fsync$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsync)(char*,int,struct fuse3_file_info*); + * } + */ + public static void fsync$set(MemorySegment seg, MemorySegment x) { + constants$22.const$1.set(seg, x); + } + public static MemorySegment fsync$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$1.get(seg.asSlice(index*sizeof())); + } + public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static fsync fsync(MemorySegment segment, Arena scope) { + return fsync.ofAddress(fsync$get(segment), scope); + } + /** + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long long,int); + * } + */ + public interface setxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); + static MemorySegment allocate(setxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$2, fi, constants$7.const$3, scope); + } + static setxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { + try { + return (int)constants$7.const$5.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle setxattr$VH() { + return constants$22.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long long,int); + * } + */ + public static MemorySegment setxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$22.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*setxattr)(char*,char*,char*,unsigned long long,int); + * } + */ + public static void setxattr$set(MemorySegment seg, MemorySegment x) { + constants$22.const$3.set(seg, x); + } + public static MemorySegment setxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$22.const$3.get(seg.asSlice(index*sizeof())); + } + public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$22.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static setxattr setxattr(MemorySegment segment, Arena scope) { + return setxattr.ofAddress(setxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long long); + * } + */ + public interface getxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); + static MemorySegment allocate(getxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$22.const$5, fi, constants$22.const$4, scope); + } + static getxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { + try { + return (int)constants$23.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle getxattr$VH() { + return constants$23.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long long); + * } + */ + public static MemorySegment getxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*getxattr)(char*,char*,char*,unsigned long long); + * } + */ + public static void getxattr$set(MemorySegment seg, MemorySegment x) { + constants$23.const$1.set(seg, x); + } + public static MemorySegment getxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$1.get(seg.asSlice(index*sizeof())); + } + public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static getxattr getxattr(MemorySegment segment, Arena scope) { + return getxattr.ofAddress(getxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long long); + * } + */ + public interface listxattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); + static MemorySegment allocate(listxattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$2, fi, constants$13.const$0, scope); + } + static listxattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { + try { + return (int)constants$13.const$2.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle listxattr$VH() { + return constants$23.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long long); + * } + */ + public static MemorySegment listxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*listxattr)(char*,char*,unsigned long long); + * } + */ + public static void listxattr$set(MemorySegment seg, MemorySegment x) { + constants$23.const$3.set(seg, x); + } + public static MemorySegment listxattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$3.get(seg.asSlice(index*sizeof())); + } + public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static listxattr listxattr(MemorySegment segment, Arena scope) { + return listxattr.ofAddress(listxattr$get(segment), scope); + } + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public interface removexattr { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(removexattr fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$23.const$4, fi, constants$16.const$0, scope); + } + static removexattr ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle removexattr$VH() { + return constants$23.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static MemorySegment removexattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$23.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ + public static void removexattr$set(MemorySegment seg, MemorySegment x) { + constants$23.const$5.set(seg, x); + } + public static MemorySegment removexattr$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$23.const$5.get(seg.asSlice(index*sizeof())); + } + public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { + constants$23.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static removexattr removexattr(MemorySegment segment, Arena scope) { + return removexattr.ofAddress(removexattr$get(segment), scope); + } + /** + * {@snippet : + * int (*opendir)(char*,struct fuse3_file_info*); + * } + */ + public interface opendir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(opendir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$0, fi, constants$16.const$0, scope); + } + static opendir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle opendir$VH() { + return constants$24.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse3_file_info*); + * } + */ + public static MemorySegment opendir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*opendir)(char*,struct fuse3_file_info*); + * } + */ + public static void opendir$set(MemorySegment seg, MemorySegment x) { + constants$24.const$1.set(seg, x); + } + public static MemorySegment opendir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$1.get(seg.asSlice(index*sizeof())); + } + public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static opendir opendir(MemorySegment segment, Arena scope) { + return opendir.ofAddress(opendir$get(segment), scope); + } + /** + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); + * } + */ + public interface readdir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4, int _x5); + static MemorySegment allocate(readdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$24.const$3, fi, constants$24.const$2, scope); + } + static readdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4, int __x5) -> { + try { + return (int)constants$24.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle readdir$VH() { + return constants$24.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); + * } + */ + public static MemorySegment readdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$24.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); + * } + */ + public static void readdir$set(MemorySegment seg, MemorySegment x) { + constants$24.const$5.set(seg, x); + } + public static MemorySegment readdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$24.const$5.get(seg.asSlice(index*sizeof())); + } + public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$24.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static readdir readdir(MemorySegment segment, Arena scope) { + return readdir.ofAddress(readdir$get(segment), scope); + } + /** + * {@snippet : + * int (*releasedir)(char*,struct fuse3_file_info*); + * } + */ + public interface releasedir { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(releasedir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$0, fi, constants$16.const$0, scope); + } + static releasedir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (int)constants$16.const$2.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle releasedir$VH() { + return constants$25.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse3_file_info*); + * } + */ + public static MemorySegment releasedir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*releasedir)(char*,struct fuse3_file_info*); + * } + */ + public static void releasedir$set(MemorySegment seg, MemorySegment x) { + constants$25.const$1.set(seg, x); + } + public static MemorySegment releasedir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$1.get(seg.asSlice(index*sizeof())); + } + public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static releasedir releasedir(MemorySegment segment, Arena scope) { + return releasedir.ofAddress(releasedir$get(segment), scope); + } + /** + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse3_file_info*); + * } + */ + public interface fsyncdir { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(fsyncdir fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$2, fi, constants$17.const$4, scope); + } + static fsyncdir ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$18.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fsyncdir$VH() { + return constants$25.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse3_file_info*); + * } + */ + public static MemorySegment fsyncdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$25.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fsyncdir)(char*,int,struct fuse3_file_info*); + * } + */ + public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { + constants$25.const$3.set(seg, x); + } + public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$25.const$3.get(seg.asSlice(index*sizeof())); + } + public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { + constants$25.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static fsyncdir fsyncdir(MemorySegment segment, Arena scope) { + return fsyncdir.ofAddress(fsyncdir$get(segment), scope); + } + /** + * {@snippet : + * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); + * } + */ + public interface init { + + java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); + static MemorySegment allocate(init fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$25.const$5, fi, constants$25.const$4, scope); + } + static init ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { + try { + return (java.lang.foreign.MemorySegment)constants$26.const$0.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle init$VH() { + return constants$26.const$1; + } + /** + * Getter for field: + * {@snippet : + * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); + * } + */ + public static MemorySegment init$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); + * } + */ + public static void init$set(MemorySegment seg, MemorySegment x) { + constants$26.const$1.set(seg, x); + } + public static MemorySegment init$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$1.get(seg.asSlice(index*sizeof())); + } + public static void init$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static init init(MemorySegment segment, Arena scope) { + return init.ofAddress(init$get(segment), scope); + } + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ + public interface destroy { + + void apply(java.lang.foreign.MemorySegment _x0); + static MemorySegment allocate(destroy fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$26.const$3, fi, constants$26.const$2, scope); + } + static destroy ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0) -> { + try { + constants$26.const$4.invokeExact(symbol, __x0); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle destroy$VH() { + return constants$26.const$5; + } + /** + * Getter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static MemorySegment destroy$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$26.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * void (*destroy)(void*); + * } + */ + public static void destroy$set(MemorySegment seg, MemorySegment x) { + constants$26.const$5.set(seg, x); + } + public static MemorySegment destroy$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$26.const$5.get(seg.asSlice(index*sizeof())); + } + public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { + constants$26.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static destroy destroy(MemorySegment segment, Arena scope) { + return destroy.ofAddress(destroy$get(segment), scope); + } + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ + public interface access { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1); + static MemorySegment allocate(access fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$0, fi, constants$14.const$2, scope); + } + static access ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1) -> { + try { + return (int)constants$14.const$4.invokeExact(symbol, __x0, __x1); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle access$VH() { + return constants$27.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static MemorySegment access$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*access)(char*,int); + * } + */ + public static void access$set(MemorySegment seg, MemorySegment x) { + constants$27.const$1.set(seg, x); + } + public static MemorySegment access$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$1.get(seg.asSlice(index*sizeof())); + } + public static void access$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static access access(MemorySegment segment, Arena scope) { + return access.ofAddress(access$get(segment), scope); + } + /** + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse3_file_info*); + * } + */ + public interface create { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(create fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$2, fi, constants$17.const$4, scope); + } + static create ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$18.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle create$VH() { + return constants$27.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse3_file_info*); + * } + */ + public static MemorySegment create$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$27.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*create)(char*,unsigned int,struct fuse3_file_info*); + * } + */ + public static void create$set(MemorySegment seg, MemorySegment x) { + constants$27.const$3.set(seg, x); + } + public static MemorySegment create$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$27.const$3.get(seg.asSlice(index*sizeof())); + } + public static void create$set(MemorySegment seg, long index, MemorySegment x) { + constants$27.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static create create(MemorySegment segment, Arena scope) { + return create.ofAddress(create$get(segment), scope); + } + /** + * {@snippet : + * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); + * } + */ + public interface lock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(lock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$27.const$5, fi, constants$27.const$4, scope); + } + static lock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$28.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle lock$VH() { + return constants$28.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); + * } + */ + public static MemorySegment lock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); + * } + */ + public static void lock$set(MemorySegment seg, MemorySegment x) { + constants$28.const$1.set(seg, x); + } + public static MemorySegment lock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$1.get(seg.asSlice(index*sizeof())); + } + public static void lock$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static lock lock(MemorySegment segment, Arena scope) { + return lock.ofAddress(lock$get(segment), scope); + } + /** + * {@snippet : + * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); + * } + */ + public interface utimens { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(utimens fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$2, fi, constants$12.const$2, scope); + } + static utimens ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$12.const$4.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle utimens$VH() { + return constants$28.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); + * } + */ + public static MemorySegment utimens$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); + * } + */ + public static void utimens$set(MemorySegment seg, MemorySegment x) { + constants$28.const$3.set(seg, x); + } + public static MemorySegment utimens$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$3.get(seg.asSlice(index*sizeof())); + } + public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static utimens utimens(MemorySegment segment, Arena scope) { + return utimens.ofAddress(utimens$get(segment), scope); + } + /** + * {@snippet : + * int (*bmap)(char*,unsigned long long,unsigned long long*); + * } + */ + public interface bmap { + + int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); + static MemorySegment allocate(bmap fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$28.const$4, fi, constants$19.const$0, scope); + } + static bmap ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { + try { + return (int)constants$19.const$2.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle bmap$VH() { + return constants$28.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*bmap)(char*,unsigned long long,unsigned long long*); + * } + */ + public static MemorySegment bmap$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$28.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*bmap)(char*,unsigned long long,unsigned long long*); + * } + */ + public static void bmap$set(MemorySegment seg, MemorySegment x) { + constants$28.const$5.set(seg, x); + } + public static MemorySegment bmap$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$28.const$5.get(seg.asSlice(index*sizeof())); + } + public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { + constants$28.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static bmap bmap(MemorySegment segment, Arena scope) { + return bmap.ofAddress(bmap$get(segment), scope); + } + /** + * {@snippet : + * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); + * } + */ + public interface ioctl { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); + static MemorySegment allocate(ioctl fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$1, fi, constants$29.const$0, scope); + } + static ioctl ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { + try { + return (int)constants$29.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle ioctl$VH() { + return constants$29.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); + * } + */ + public static MemorySegment ioctl$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$29.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); + * } + */ + public static void ioctl$set(MemorySegment seg, MemorySegment x) { + constants$29.const$3.set(seg, x); + } + public static MemorySegment ioctl$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$29.const$3.get(seg.asSlice(index*sizeof())); + } + public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { + constants$29.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static ioctl ioctl(MemorySegment segment, Arena scope) { + return ioctl.ofAddress(ioctl$get(segment), scope); + } + /** + * {@snippet : + * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); + * } + */ + public interface poll { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(poll fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$29.const$5, fi, constants$29.const$4, scope); + } + static poll ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$30.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle poll$VH() { + return constants$30.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); + * } + */ + public static MemorySegment poll$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); + * } + */ + public static void poll$set(MemorySegment seg, MemorySegment x) { + constants$30.const$1.set(seg, x); + } + public static MemorySegment poll$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$1.get(seg.asSlice(index*sizeof())); + } + public static void poll$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static poll poll(MemorySegment segment, Arena scope) { + return poll.ofAddress(poll$get(segment), scope); + } + /** + * {@snippet : + * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); + * } + */ + public interface write_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); + static MemorySegment allocate(write_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$30.const$3, fi, constants$30.const$2, scope); + } + static write_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { + try { + return (int)constants$30.const$4.invokeExact(symbol, __x0, __x1, __x2, __x3); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle write_buf$VH() { + return constants$30.const$5; + } + /** + * Getter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); + * } + */ + public static MemorySegment write_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$30.const$5.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); + * } + */ + public static void write_buf$set(MemorySegment seg, MemorySegment x) { + constants$30.const$5.set(seg, x); + } + public static MemorySegment write_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$30.const$5.get(seg.asSlice(index*sizeof())); + } + public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$30.const$5.set(seg.asSlice(index*sizeof()), x); + } + public static write_buf write_buf(MemorySegment segment, Arena scope) { + return write_buf.ofAddress(write_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public interface read_buf { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(read_buf fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$0, fi, constants$20.const$0, scope); + } + static read_buf ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$20.const$2.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle read_buf$VH() { + return constants$31.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public static MemorySegment read_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); + * } + */ + public static void read_buf$set(MemorySegment seg, MemorySegment x) { + constants$31.const$1.set(seg, x); + } + public static MemorySegment read_buf$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$1.get(seg.asSlice(index*sizeof())); + } + public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static read_buf read_buf(MemorySegment segment, Arena scope) { + return read_buf.ofAddress(read_buf$get(segment), scope); + } + /** + * {@snippet : + * int (*flock)(char*,struct fuse3_file_info*,int); + * } + */ + public interface flock { + + int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); + static MemorySegment allocate(flock fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$2, fi, constants$16.const$4, scope); + } + static flock ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { + try { + return (int)constants$17.const$0.invokeExact(symbol, __x0, __x1, __x2); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle flock$VH() { + return constants$31.const$3; + } + /** + * Getter for field: + * {@snippet : + * int (*flock)(char*,struct fuse3_file_info*,int); + * } + */ + public static MemorySegment flock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$31.const$3.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*flock)(char*,struct fuse3_file_info*,int); + * } + */ + public static void flock$set(MemorySegment seg, MemorySegment x) { + constants$31.const$3.set(seg, x); + } + public static MemorySegment flock$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$31.const$3.get(seg.asSlice(index*sizeof())); + } + public static void flock$set(MemorySegment seg, long index, MemorySegment x) { + constants$31.const$3.set(seg.asSlice(index*sizeof()), x); + } + public static flock flock(MemorySegment segment, Arena scope) { + return flock.ofAddress(flock$get(segment), scope); + } + /** + * {@snippet : + * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); + * } + */ + public interface fallocate { + + int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); + static MemorySegment allocate(fallocate fi, Arena scope) { + return RuntimeHelper.upcallStub(constants$31.const$5, fi, constants$31.const$4, scope); + } + static fallocate ofAddress(MemorySegment addr, Arena arena) { + MemorySegment symbol = addr.reinterpret(arena, null); + return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { + try { + return (int)constants$32.const$0.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); + } catch (Throwable ex$) { + throw new AssertionError("should not reach here", ex$); + } + }; + } + } + + public static VarHandle fallocate$VH() { + return constants$32.const$1; + } + /** + * Getter for field: + * {@snippet : + * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); + * } + */ + public static MemorySegment fallocate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)constants$32.const$1.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); + * } + */ + public static void fallocate$set(MemorySegment seg, MemorySegment x) { + constants$32.const$1.set(seg, x); + } + public static MemorySegment fallocate$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)constants$32.const$1.get(seg.asSlice(index*sizeof())); + } + public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { + constants$32.const$1.set(seg.asSlice(index*sizeof()), x); + } + public static fallocate fallocate(MemorySegment segment, Arena scope) { + return fallocate.ofAddress(fallocate$get(segment), scope); + } + public static long sizeof() { return $LAYOUT().byteSize(); } + public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { + return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); + } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } +} + + diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_h.java similarity index 74% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_h.java index 9c6a494f..b30494fc 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_h.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -9,16 +9,16 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - public static final OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static final OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static final OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static final OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static final OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static final OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static final OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static final OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + public static final OfByte C_CHAR = JAVA_BYTE; + public static final OfShort C_SHORT = JAVA_SHORT; + public static final OfInt C_INT = JAVA_INT; + public static final OfInt C_LONG = JAVA_INT; + public static final OfLong C_LONG_LONG = JAVA_LONG; + public static final OfFloat C_FLOAT = JAVA_FLOAT; + public static final OfDouble C_DOUBLE = JAVA_DOUBLE; + public static final AddressLayout C_POINTER = RuntimeHelper.POINTER; public static MethodHandle fuse3_lib_help$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse3_lib_help$MH,"fuse3_lib_help"); + return RuntimeHelper.requireNonNull(constants$32.const$2,"fuse3_lib_help"); } /** * {@snippet : @@ -34,7 +34,7 @@ public static void fuse3_lib_help(MemorySegment args) { } } public static MethodHandle fuse3_new$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse3_new$MH,"fuse3_new"); + return RuntimeHelper.requireNonNull(constants$32.const$4,"fuse3_new"); } /** * {@snippet : @@ -50,7 +50,7 @@ public static MemorySegment fuse3_new(MemorySegment args, MemorySegment ops, lon } } public static MethodHandle fuse3_destroy$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse3_destroy$MH,"fuse3_destroy"); + return RuntimeHelper.requireNonNull(constants$32.const$5,"fuse3_destroy"); } /** * {@snippet : @@ -66,7 +66,7 @@ public static void fuse3_destroy(MemorySegment f) { } } public static MethodHandle fuse3_mount$MH() { - return RuntimeHelper.requireNonNull(constants$0.fuse3_mount$MH,"fuse3_mount"); + return RuntimeHelper.requireNonNull(constants$33.const$0,"fuse3_mount"); } /** * {@snippet : @@ -82,7 +82,7 @@ public static int fuse3_mount(MemorySegment f, MemorySegment mountpoint) { } } public static MethodHandle fuse3_unmount$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_unmount$MH,"fuse3_unmount"); + return RuntimeHelper.requireNonNull(constants$33.const$1,"fuse3_unmount"); } /** * {@snippet : @@ -98,7 +98,7 @@ public static void fuse3_unmount(MemorySegment f) { } } public static MethodHandle fuse3_loop$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_loop$MH,"fuse3_loop"); + return RuntimeHelper.requireNonNull(constants$33.const$2,"fuse3_loop"); } /** * {@snippet : @@ -114,7 +114,7 @@ public static int fuse3_loop(MemorySegment f) { } } public static MethodHandle fuse3_loop_mt_31$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_loop_mt_31$MH,"fuse3_loop_mt_31"); + return RuntimeHelper.requireNonNull(constants$33.const$3,"fuse3_loop_mt_31"); } /** * {@snippet : @@ -130,7 +130,7 @@ public static int fuse3_loop_mt_31(MemorySegment f, int clone_fd) { } } public static MethodHandle fuse3_exit$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_exit$MH,"fuse3_exit"); + return RuntimeHelper.requireNonNull(constants$33.const$4,"fuse3_exit"); } /** * {@snippet : @@ -146,7 +146,7 @@ public static void fuse3_exit(MemorySegment f) { } } public static MethodHandle fuse3_get_session$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_get_session$MH,"fuse3_get_session"); + return RuntimeHelper.requireNonNull(constants$33.const$6,"fuse3_get_session"); } /** * {@snippet : diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_stat.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_stat.java similarity index 54% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_stat.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_stat.java index 67d2fe8d..8783e45c 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_stat.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_stat.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -29,44 +29,11 @@ */ public class fuse_stat { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG$LAYOUT.withName("st_dev"), - MemoryLayout.paddingLayout(32), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_ino"), - Constants$root.C_LONG$LAYOUT.withName("st_mode"), - Constants$root.C_SHORT$LAYOUT.withName("st_nlink"), - MemoryLayout.paddingLayout(16), - Constants$root.C_LONG$LAYOUT.withName("st_uid"), - Constants$root.C_LONG$LAYOUT.withName("st_gid"), - Constants$root.C_LONG$LAYOUT.withName("st_rdev"), - MemoryLayout.paddingLayout(32), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_size"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_atim"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_mtim"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_ctim"), - Constants$root.C_LONG$LAYOUT.withName("st_blksize"), - MemoryLayout.paddingLayout(32), - Constants$root.C_LONG_LONG$LAYOUT.withName("st_blocks"), - MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("st_birthtim") - ).withName("fuse_stat"); public static MemoryLayout $LAYOUT() { - return fuse_stat.$struct$LAYOUT; + return constants$0.const$3; } - static final VarHandle st_dev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_dev")); public static VarHandle st_dev$VH() { - return fuse_stat.st_dev$VH; + return constants$0.const$4; } /** * Getter for field: @@ -75,7 +42,7 @@ public class fuse_stat { * } */ public static int st_dev$get(MemorySegment seg) { - return (int)fuse_stat.st_dev$VH.get(seg); + return (int)constants$0.const$4.get(seg); } /** * Setter for field: @@ -84,17 +51,16 @@ public class fuse_stat { * } */ public static void st_dev$set(MemorySegment seg, int x) { - fuse_stat.st_dev$VH.set(seg, x); + constants$0.const$4.set(seg, x); } public static int st_dev$get(MemorySegment seg, long index) { - return (int)fuse_stat.st_dev$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$0.const$4.get(seg.asSlice(index*sizeof())); } public static void st_dev$set(MemorySegment seg, long index, int x) { - fuse_stat.st_dev$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_ino$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_ino")); public static VarHandle st_ino$VH() { - return fuse_stat.st_ino$VH; + return constants$0.const$5; } /** * Getter for field: @@ -103,7 +69,7 @@ public class fuse_stat { * } */ public static long st_ino$get(MemorySegment seg) { - return (long)fuse_stat.st_ino$VH.get(seg); + return (long)constants$0.const$5.get(seg); } /** * Setter for field: @@ -112,17 +78,16 @@ public class fuse_stat { * } */ public static void st_ino$set(MemorySegment seg, long x) { - fuse_stat.st_ino$VH.set(seg, x); + constants$0.const$5.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { - return (long)fuse_stat.st_ino$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$0.const$5.get(seg.asSlice(index*sizeof())); } public static void st_ino$set(MemorySegment seg, long index, long x) { - fuse_stat.st_ino$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_mode$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_mode")); public static VarHandle st_mode$VH() { - return fuse_stat.st_mode$VH; + return constants$1.const$0; } /** * Getter for field: @@ -131,7 +96,7 @@ public class fuse_stat { * } */ public static int st_mode$get(MemorySegment seg) { - return (int)fuse_stat.st_mode$VH.get(seg); + return (int)constants$1.const$0.get(seg); } /** * Setter for field: @@ -140,17 +105,16 @@ public class fuse_stat { * } */ public static void st_mode$set(MemorySegment seg, int x) { - fuse_stat.st_mode$VH.set(seg, x); + constants$1.const$0.set(seg, x); } public static int st_mode$get(MemorySegment seg, long index) { - return (int)fuse_stat.st_mode$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$0.get(seg.asSlice(index*sizeof())); } public static void st_mode$set(MemorySegment seg, long index, int x) { - fuse_stat.st_mode$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_nlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_nlink")); public static VarHandle st_nlink$VH() { - return fuse_stat.st_nlink$VH; + return constants$1.const$1; } /** * Getter for field: @@ -159,7 +123,7 @@ public class fuse_stat { * } */ public static short st_nlink$get(MemorySegment seg) { - return (short)fuse_stat.st_nlink$VH.get(seg); + return (short)constants$1.const$1.get(seg); } /** * Setter for field: @@ -168,17 +132,16 @@ public class fuse_stat { * } */ public static void st_nlink$set(MemorySegment seg, short x) { - fuse_stat.st_nlink$VH.set(seg, x); + constants$1.const$1.set(seg, x); } public static short st_nlink$get(MemorySegment seg, long index) { - return (short)fuse_stat.st_nlink$VH.get(seg.asSlice(index*sizeof())); + return (short)constants$1.const$1.get(seg.asSlice(index*sizeof())); } public static void st_nlink$set(MemorySegment seg, long index, short x) { - fuse_stat.st_nlink$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_uid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_uid")); public static VarHandle st_uid$VH() { - return fuse_stat.st_uid$VH; + return constants$1.const$2; } /** * Getter for field: @@ -187,7 +150,7 @@ public class fuse_stat { * } */ public static int st_uid$get(MemorySegment seg) { - return (int)fuse_stat.st_uid$VH.get(seg); + return (int)constants$1.const$2.get(seg); } /** * Setter for field: @@ -196,17 +159,16 @@ public class fuse_stat { * } */ public static void st_uid$set(MemorySegment seg, int x) { - fuse_stat.st_uid$VH.set(seg, x); + constants$1.const$2.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { - return (int)fuse_stat.st_uid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$2.get(seg.asSlice(index*sizeof())); } public static void st_uid$set(MemorySegment seg, long index, int x) { - fuse_stat.st_uid$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_gid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_gid")); public static VarHandle st_gid$VH() { - return fuse_stat.st_gid$VH; + return constants$1.const$3; } /** * Getter for field: @@ -215,7 +177,7 @@ public class fuse_stat { * } */ public static int st_gid$get(MemorySegment seg) { - return (int)fuse_stat.st_gid$VH.get(seg); + return (int)constants$1.const$3.get(seg); } /** * Setter for field: @@ -224,17 +186,16 @@ public class fuse_stat { * } */ public static void st_gid$set(MemorySegment seg, int x) { - fuse_stat.st_gid$VH.set(seg, x); + constants$1.const$3.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { - return (int)fuse_stat.st_gid$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$3.get(seg.asSlice(index*sizeof())); } public static void st_gid$set(MemorySegment seg, long index, int x) { - fuse_stat.st_gid$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_rdev$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_rdev")); public static VarHandle st_rdev$VH() { - return fuse_stat.st_rdev$VH; + return constants$1.const$4; } /** * Getter for field: @@ -243,7 +204,7 @@ public class fuse_stat { * } */ public static int st_rdev$get(MemorySegment seg) { - return (int)fuse_stat.st_rdev$VH.get(seg); + return (int)constants$1.const$4.get(seg); } /** * Setter for field: @@ -252,17 +213,16 @@ public class fuse_stat { * } */ public static void st_rdev$set(MemorySegment seg, int x) { - fuse_stat.st_rdev$VH.set(seg, x); + constants$1.const$4.set(seg, x); } public static int st_rdev$get(MemorySegment seg, long index) { - return (int)fuse_stat.st_rdev$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$1.const$4.get(seg.asSlice(index*sizeof())); } public static void st_rdev$set(MemorySegment seg, long index, int x) { - fuse_stat.st_rdev$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_size$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_size")); public static VarHandle st_size$VH() { - return fuse_stat.st_size$VH; + return constants$1.const$5; } /** * Getter for field: @@ -271,7 +231,7 @@ public class fuse_stat { * } */ public static long st_size$get(MemorySegment seg) { - return (long)fuse_stat.st_size$VH.get(seg); + return (long)constants$1.const$5.get(seg); } /** * Setter for field: @@ -280,13 +240,13 @@ public class fuse_stat { * } */ public static void st_size$set(MemorySegment seg, long x) { - fuse_stat.st_size$VH.set(seg, x); + constants$1.const$5.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { - return (long)fuse_stat.st_size$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$1.const$5.get(seg.asSlice(index*sizeof())); } public static void st_size$set(MemorySegment seg, long index, long x) { - fuse_stat.st_size$VH.set(seg.asSlice(index*sizeof()), x); + constants$1.const$5.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment st_atim$slice(MemorySegment seg) { return seg.asSlice(48, 16); @@ -297,9 +257,8 @@ public class fuse_stat { public static MemorySegment st_ctim$slice(MemorySegment seg) { return seg.asSlice(80, 16); } - static final VarHandle st_blksize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blksize")); public static VarHandle st_blksize$VH() { - return fuse_stat.st_blksize$VH; + return constants$2.const$0; } /** * Getter for field: @@ -308,7 +267,7 @@ public class fuse_stat { * } */ public static int st_blksize$get(MemorySegment seg) { - return (int)fuse_stat.st_blksize$VH.get(seg); + return (int)constants$2.const$0.get(seg); } /** * Setter for field: @@ -317,17 +276,16 @@ public class fuse_stat { * } */ public static void st_blksize$set(MemorySegment seg, int x) { - fuse_stat.st_blksize$VH.set(seg, x); + constants$2.const$0.set(seg, x); } public static int st_blksize$get(MemorySegment seg, long index) { - return (int)fuse_stat.st_blksize$VH.get(seg.asSlice(index*sizeof())); + return (int)constants$2.const$0.get(seg.asSlice(index*sizeof())); } public static void st_blksize$set(MemorySegment seg, long index, int x) { - fuse_stat.st_blksize$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle st_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("st_blocks")); public static VarHandle st_blocks$VH() { - return fuse_stat.st_blocks$VH; + return constants$2.const$1; } /** * Getter for field: @@ -336,7 +294,7 @@ public class fuse_stat { * } */ public static long st_blocks$get(MemorySegment seg) { - return (long)fuse_stat.st_blocks$VH.get(seg); + return (long)constants$2.const$1.get(seg); } /** * Setter for field: @@ -345,13 +303,13 @@ public class fuse_stat { * } */ public static void st_blocks$set(MemorySegment seg, long x) { - fuse_stat.st_blocks$VH.set(seg, x); + constants$2.const$1.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { - return (long)fuse_stat.st_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$2.const$1.get(seg.asSlice(index*sizeof())); } public static void st_blocks$set(MemorySegment seg, long index, long x) { - fuse_stat.st_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$1.set(seg.asSlice(index*sizeof()), x); } public static MemorySegment st_birthtim$slice(MemorySegment seg) { return seg.asSlice(112, 16); @@ -361,7 +319,7 @@ public class fuse_stat { public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_statvfs.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_statvfs.java similarity index 56% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_statvfs.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_statvfs.java index e37abd45..f000f68b 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_statvfs.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_statvfs.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -26,25 +26,11 @@ */ public class fuse_statvfs { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_frsize"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_blocks"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bfree"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_bavail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_files"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_ffree"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_favail"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_fsid"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_flag"), - Constants$root.C_LONG_LONG$LAYOUT.withName("f_namemax") - ).withName("fuse_statvfs"); public static MemoryLayout $LAYOUT() { - return fuse_statvfs.$struct$LAYOUT; + return constants$2.const$2; } - static final VarHandle f_bsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bsize")); public static VarHandle f_bsize$VH() { - return fuse_statvfs.f_bsize$VH; + return constants$2.const$3; } /** * Getter for field: @@ -53,7 +39,7 @@ public class fuse_statvfs { * } */ public static long f_bsize$get(MemorySegment seg) { - return (long)fuse_statvfs.f_bsize$VH.get(seg); + return (long)constants$2.const$3.get(seg); } /** * Setter for field: @@ -62,17 +48,16 @@ public class fuse_statvfs { * } */ public static void f_bsize$set(MemorySegment seg, long x) { - fuse_statvfs.f_bsize$VH.set(seg, x); + constants$2.const$3.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_bsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$2.const$3.get(seg.asSlice(index*sizeof())); } public static void f_bsize$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_bsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_frsize$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_frsize")); public static VarHandle f_frsize$VH() { - return fuse_statvfs.f_frsize$VH; + return constants$2.const$4; } /** * Getter for field: @@ -81,7 +66,7 @@ public class fuse_statvfs { * } */ public static long f_frsize$get(MemorySegment seg) { - return (long)fuse_statvfs.f_frsize$VH.get(seg); + return (long)constants$2.const$4.get(seg); } /** * Setter for field: @@ -90,17 +75,16 @@ public class fuse_statvfs { * } */ public static void f_frsize$set(MemorySegment seg, long x) { - fuse_statvfs.f_frsize$VH.set(seg, x); + constants$2.const$4.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_frsize$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$2.const$4.get(seg.asSlice(index*sizeof())); } public static void f_frsize$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_frsize$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_blocks$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_blocks")); public static VarHandle f_blocks$VH() { - return fuse_statvfs.f_blocks$VH; + return constants$2.const$5; } /** * Getter for field: @@ -109,7 +93,7 @@ public class fuse_statvfs { * } */ public static long f_blocks$get(MemorySegment seg) { - return (long)fuse_statvfs.f_blocks$VH.get(seg); + return (long)constants$2.const$5.get(seg); } /** * Setter for field: @@ -118,17 +102,16 @@ public class fuse_statvfs { * } */ public static void f_blocks$set(MemorySegment seg, long x) { - fuse_statvfs.f_blocks$VH.set(seg, x); + constants$2.const$5.set(seg, x); } public static long f_blocks$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_blocks$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$2.const$5.get(seg.asSlice(index*sizeof())); } public static void f_blocks$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_blocks$VH.set(seg.asSlice(index*sizeof()), x); + constants$2.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bfree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bfree")); public static VarHandle f_bfree$VH() { - return fuse_statvfs.f_bfree$VH; + return constants$3.const$0; } /** * Getter for field: @@ -137,7 +120,7 @@ public class fuse_statvfs { * } */ public static long f_bfree$get(MemorySegment seg) { - return (long)fuse_statvfs.f_bfree$VH.get(seg); + return (long)constants$3.const$0.get(seg); } /** * Setter for field: @@ -146,17 +129,16 @@ public class fuse_statvfs { * } */ public static void f_bfree$set(MemorySegment seg, long x) { - fuse_statvfs.f_bfree$VH.set(seg, x); + constants$3.const$0.set(seg, x); } public static long f_bfree$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_bfree$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$3.const$0.get(seg.asSlice(index*sizeof())); } public static void f_bfree$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_bfree$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_bavail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_bavail")); public static VarHandle f_bavail$VH() { - return fuse_statvfs.f_bavail$VH; + return constants$3.const$1; } /** * Getter for field: @@ -165,7 +147,7 @@ public class fuse_statvfs { * } */ public static long f_bavail$get(MemorySegment seg) { - return (long)fuse_statvfs.f_bavail$VH.get(seg); + return (long)constants$3.const$1.get(seg); } /** * Setter for field: @@ -174,17 +156,16 @@ public class fuse_statvfs { * } */ public static void f_bavail$set(MemorySegment seg, long x) { - fuse_statvfs.f_bavail$VH.set(seg, x); + constants$3.const$1.set(seg, x); } public static long f_bavail$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_bavail$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$3.const$1.get(seg.asSlice(index*sizeof())); } public static void f_bavail$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_bavail$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_files$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_files")); public static VarHandle f_files$VH() { - return fuse_statvfs.f_files$VH; + return constants$3.const$2; } /** * Getter for field: @@ -193,7 +174,7 @@ public class fuse_statvfs { * } */ public static long f_files$get(MemorySegment seg) { - return (long)fuse_statvfs.f_files$VH.get(seg); + return (long)constants$3.const$2.get(seg); } /** * Setter for field: @@ -202,17 +183,16 @@ public class fuse_statvfs { * } */ public static void f_files$set(MemorySegment seg, long x) { - fuse_statvfs.f_files$VH.set(seg, x); + constants$3.const$2.set(seg, x); } public static long f_files$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_files$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$3.const$2.get(seg.asSlice(index*sizeof())); } public static void f_files$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_files$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$2.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_ffree$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_ffree")); public static VarHandle f_ffree$VH() { - return fuse_statvfs.f_ffree$VH; + return constants$3.const$3; } /** * Getter for field: @@ -221,7 +201,7 @@ public class fuse_statvfs { * } */ public static long f_ffree$get(MemorySegment seg) { - return (long)fuse_statvfs.f_ffree$VH.get(seg); + return (long)constants$3.const$3.get(seg); } /** * Setter for field: @@ -230,17 +210,16 @@ public class fuse_statvfs { * } */ public static void f_ffree$set(MemorySegment seg, long x) { - fuse_statvfs.f_ffree$VH.set(seg, x); + constants$3.const$3.set(seg, x); } public static long f_ffree$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_ffree$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$3.const$3.get(seg.asSlice(index*sizeof())); } public static void f_ffree$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_ffree$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$3.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_favail$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_favail")); public static VarHandle f_favail$VH() { - return fuse_statvfs.f_favail$VH; + return constants$3.const$4; } /** * Getter for field: @@ -249,7 +228,7 @@ public class fuse_statvfs { * } */ public static long f_favail$get(MemorySegment seg) { - return (long)fuse_statvfs.f_favail$VH.get(seg); + return (long)constants$3.const$4.get(seg); } /** * Setter for field: @@ -258,17 +237,16 @@ public class fuse_statvfs { * } */ public static void f_favail$set(MemorySegment seg, long x) { - fuse_statvfs.f_favail$VH.set(seg, x); + constants$3.const$4.set(seg, x); } public static long f_favail$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_favail$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$3.const$4.get(seg.asSlice(index*sizeof())); } public static void f_favail$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_favail$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$4.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_fsid$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_fsid")); public static VarHandle f_fsid$VH() { - return fuse_statvfs.f_fsid$VH; + return constants$3.const$5; } /** * Getter for field: @@ -277,7 +255,7 @@ public class fuse_statvfs { * } */ public static long f_fsid$get(MemorySegment seg) { - return (long)fuse_statvfs.f_fsid$VH.get(seg); + return (long)constants$3.const$5.get(seg); } /** * Setter for field: @@ -286,17 +264,16 @@ public class fuse_statvfs { * } */ public static void f_fsid$set(MemorySegment seg, long x) { - fuse_statvfs.f_fsid$VH.set(seg, x); + constants$3.const$5.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_fsid$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$3.const$5.get(seg.asSlice(index*sizeof())); } public static void f_fsid$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_fsid$VH.set(seg.asSlice(index*sizeof()), x); + constants$3.const$5.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_flag$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_flag")); public static VarHandle f_flag$VH() { - return fuse_statvfs.f_flag$VH; + return constants$4.const$0; } /** * Getter for field: @@ -305,7 +282,7 @@ public class fuse_statvfs { * } */ public static long f_flag$get(MemorySegment seg) { - return (long)fuse_statvfs.f_flag$VH.get(seg); + return (long)constants$4.const$0.get(seg); } /** * Setter for field: @@ -314,17 +291,16 @@ public class fuse_statvfs { * } */ public static void f_flag$set(MemorySegment seg, long x) { - fuse_statvfs.f_flag$VH.set(seg, x); + constants$4.const$0.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_flag$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$4.const$0.get(seg.asSlice(index*sizeof())); } public static void f_flag$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_flag$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$0.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle f_namemax$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("f_namemax")); public static VarHandle f_namemax$VH() { - return fuse_statvfs.f_namemax$VH; + return constants$4.const$1; } /** * Getter for field: @@ -333,7 +309,7 @@ public class fuse_statvfs { * } */ public static long f_namemax$get(MemorySegment seg) { - return (long)fuse_statvfs.f_namemax$VH.get(seg); + return (long)constants$4.const$1.get(seg); } /** * Setter for field: @@ -342,20 +318,20 @@ public class fuse_statvfs { * } */ public static void f_namemax$set(MemorySegment seg, long x) { - fuse_statvfs.f_namemax$VH.set(seg, x); + constants$4.const$1.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { - return (long)fuse_statvfs.f_namemax$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$4.const$1.get(seg.asSlice(index*sizeof())); } public static void f_namemax$set(MemorySegment seg, long index, long x) { - fuse_statvfs.f_namemax$VH.set(seg.asSlice(index*sizeof()), x); + constants$4.const$1.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_timespec.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_timespec.java similarity index 58% rename from jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_timespec.java rename to jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_timespec.java index 2b45632a..ea210491 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_timespec.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3/fuse_timespec.java @@ -1,6 +1,6 @@ // Generated by jextract -package org.cryptomator.jfuse.win.extr; +package org.cryptomator.jfuse.win.extr.fuse3; import java.lang.invoke.MethodHandle; import java.lang.invoke.VarHandle; @@ -17,16 +17,11 @@ */ public class fuse_timespec { - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_sec"), - Constants$root.C_LONG_LONG$LAYOUT.withName("tv_nsec") - ).withName("fuse_timespec"); public static MemoryLayout $LAYOUT() { - return fuse_timespec.$struct$LAYOUT; + return constants$0.const$0; } - static final VarHandle tv_sec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_sec")); public static VarHandle tv_sec$VH() { - return fuse_timespec.tv_sec$VH; + return constants$0.const$1; } /** * Getter for field: @@ -35,7 +30,7 @@ public class fuse_timespec { * } */ public static long tv_sec$get(MemorySegment seg) { - return (long)fuse_timespec.tv_sec$VH.get(seg); + return (long)constants$0.const$1.get(seg); } /** * Setter for field: @@ -44,17 +39,16 @@ public class fuse_timespec { * } */ public static void tv_sec$set(MemorySegment seg, long x) { - fuse_timespec.tv_sec$VH.set(seg, x); + constants$0.const$1.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { - return (long)fuse_timespec.tv_sec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$0.const$1.get(seg.asSlice(index*sizeof())); } public static void tv_sec$set(MemorySegment seg, long index, long x) { - fuse_timespec.tv_sec$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$1.set(seg.asSlice(index*sizeof()), x); } - static final VarHandle tv_nsec$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("tv_nsec")); public static VarHandle tv_nsec$VH() { - return fuse_timespec.tv_nsec$VH; + return constants$0.const$2; } /** * Getter for field: @@ -63,7 +57,7 @@ public class fuse_timespec { * } */ public static long tv_nsec$get(MemorySegment seg) { - return (long)fuse_timespec.tv_nsec$VH.get(seg); + return (long)constants$0.const$2.get(seg); } /** * Setter for field: @@ -72,20 +66,20 @@ public class fuse_timespec { * } */ public static void tv_nsec$set(MemorySegment seg, long x) { - fuse_timespec.tv_nsec$VH.set(seg, x); + constants$0.const$2.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { - return (long)fuse_timespec.tv_nsec$VH.get(seg.asSlice(index*sizeof())); + return (long)constants$0.const$2.get(seg.asSlice(index*sizeof())); } public static void tv_nsec$set(MemorySegment seg, long index, long x) { - fuse_timespec.tv_nsec$VH.set(seg.asSlice(index*sizeof()), x); + constants$0.const$2.set(seg.asSlice(index*sizeof()), x); } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } + public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_operations.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_operations.java deleted file mode 100644 index 5b52d508..00000000 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_operations.java +++ /dev/null @@ -1,2594 +0,0 @@ -// Generated by jextract - -package org.cryptomator.jfuse.win.extr; - -import java.lang.invoke.MethodHandle; -import java.lang.invoke.VarHandle; -import java.nio.ByteOrder; -import java.lang.foreign.*; -import static java.lang.foreign.ValueLayout.*; -/** - * {@snippet : - * struct fuse3_operations { - * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); - * int (*readlink)(char*,char*,unsigned long long); - * int (*mknod)(char*,unsigned int,unsigned int); - * int (*mkdir)(char*,unsigned int); - * int (*unlink)(char*); - * int (*rmdir)(char*); - * int (*symlink)(char*,char*); - * int (*rename)(char*,char*,unsigned int); - * int (*link)(char*,char*); - * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); - * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); - * int (*truncate)(char*,long long,struct fuse3_file_info*); - * int (*open)(char*,struct fuse3_file_info*); - * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * int (*statfs)(char*,struct fuse_statvfs*); - * int (*flush)(char*,struct fuse3_file_info*); - * int (*release)(char*,struct fuse3_file_info*); - * int (*fsync)(char*,int,struct fuse3_file_info*); - * int (*setxattr)(char*,char*,char*,unsigned long long,int); - * int (*getxattr)(char*,char*,char*,unsigned long long); - * int (*listxattr)(char*,char*,unsigned long long); - * int (*removexattr)(char*,char*); - * int (*opendir)(char*,struct fuse3_file_info*); - * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); - * int (*releasedir)(char*,struct fuse3_file_info*); - * int (*fsyncdir)(char*,int,struct fuse3_file_info*); - * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); - * void (*destroy)(void*); - * int (*access)(char*,int); - * int (*create)(char*,unsigned int,struct fuse3_file_info*); - * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); - * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); - * int (*bmap)(char*,unsigned long long,unsigned long long*); - * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); - * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); - * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); - * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); - * int (*flock)(char*,struct fuse3_file_info*,int); - * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); - * }; - * } - */ -public class fuse3_operations { - - static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( - Constants$root.C_POINTER$LAYOUT.withName("getattr"), - Constants$root.C_POINTER$LAYOUT.withName("readlink"), - Constants$root.C_POINTER$LAYOUT.withName("mknod"), - Constants$root.C_POINTER$LAYOUT.withName("mkdir"), - Constants$root.C_POINTER$LAYOUT.withName("unlink"), - Constants$root.C_POINTER$LAYOUT.withName("rmdir"), - Constants$root.C_POINTER$LAYOUT.withName("symlink"), - Constants$root.C_POINTER$LAYOUT.withName("rename"), - Constants$root.C_POINTER$LAYOUT.withName("link"), - Constants$root.C_POINTER$LAYOUT.withName("chmod"), - Constants$root.C_POINTER$LAYOUT.withName("chown"), - Constants$root.C_POINTER$LAYOUT.withName("truncate"), - Constants$root.C_POINTER$LAYOUT.withName("open"), - Constants$root.C_POINTER$LAYOUT.withName("read"), - Constants$root.C_POINTER$LAYOUT.withName("write"), - Constants$root.C_POINTER$LAYOUT.withName("statfs"), - Constants$root.C_POINTER$LAYOUT.withName("flush"), - Constants$root.C_POINTER$LAYOUT.withName("release"), - Constants$root.C_POINTER$LAYOUT.withName("fsync"), - Constants$root.C_POINTER$LAYOUT.withName("setxattr"), - Constants$root.C_POINTER$LAYOUT.withName("getxattr"), - Constants$root.C_POINTER$LAYOUT.withName("listxattr"), - Constants$root.C_POINTER$LAYOUT.withName("removexattr"), - Constants$root.C_POINTER$LAYOUT.withName("opendir"), - Constants$root.C_POINTER$LAYOUT.withName("readdir"), - Constants$root.C_POINTER$LAYOUT.withName("releasedir"), - Constants$root.C_POINTER$LAYOUT.withName("fsyncdir"), - Constants$root.C_POINTER$LAYOUT.withName("init"), - Constants$root.C_POINTER$LAYOUT.withName("destroy"), - Constants$root.C_POINTER$LAYOUT.withName("access"), - Constants$root.C_POINTER$LAYOUT.withName("create"), - Constants$root.C_POINTER$LAYOUT.withName("lock"), - Constants$root.C_POINTER$LAYOUT.withName("utimens"), - Constants$root.C_POINTER$LAYOUT.withName("bmap"), - Constants$root.C_POINTER$LAYOUT.withName("ioctl"), - Constants$root.C_POINTER$LAYOUT.withName("poll"), - Constants$root.C_POINTER$LAYOUT.withName("write_buf"), - Constants$root.C_POINTER$LAYOUT.withName("read_buf"), - Constants$root.C_POINTER$LAYOUT.withName("flock"), - Constants$root.C_POINTER$LAYOUT.withName("fallocate") - ).withName("fuse3_operations"); - public static MemoryLayout $LAYOUT() { - return fuse3_operations.$struct$LAYOUT; - } - static final FunctionDescriptor getattr$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle getattr$MH = RuntimeHelper.downcallHandle( - fuse3_operations.getattr$FUNC - ); - /** - * {@snippet : - * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); - * } - */ - public interface getattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(getattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse3_operations.getattr$FUNC, scope); - } - static getattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.getattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getattr")); - public static VarHandle getattr$VH() { - return fuse3_operations.getattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); - * } - */ - public static MemorySegment getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.getattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getattr)(char*,struct fuse_stat*,struct fuse3_file_info*); - * } - */ - public static void getattr$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.getattr$VH.set(seg, x); - } - public static MemorySegment getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.getattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.getattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getattr getattr(MemorySegment segment, SegmentScope scope) { - return getattr.ofAddress(getattr$get(segment), scope); - } - static final FunctionDescriptor readlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle readlink$MH = RuntimeHelper.downcallHandle( - fuse3_operations.readlink$FUNC - ); - /** - * {@snippet : - * int (*readlink)(char*,char*,unsigned long long); - * } - */ - public interface readlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(readlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse3_operations.readlink$FUNC, scope); - } - static readlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse3_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readlink")); - public static VarHandle readlink$VH() { - return fuse3_operations.readlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readlink)(char*,char*,unsigned long long); - * } - */ - public static MemorySegment readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.readlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readlink)(char*,char*,unsigned long long); - * } - */ - public static void readlink$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.readlink$VH.set(seg, x); - } - public static MemorySegment readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.readlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void readlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.readlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readlink readlink(MemorySegment segment, SegmentScope scope) { - return readlink.ofAddress(readlink$get(segment), scope); - } - static final FunctionDescriptor mknod$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle mknod$MH = RuntimeHelper.downcallHandle( - fuse3_operations.mknod$FUNC - ); - /** - * {@snippet : - * int (*mknod)(char*,unsigned int,unsigned int); - * } - */ - public interface mknod { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2); - static MemorySegment allocate(mknod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse3_operations.mknod$FUNC, scope); - } - static mknod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2) -> { - try { - return (int)fuse3_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mknod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mknod")); - public static VarHandle mknod$VH() { - return fuse3_operations.mknod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mknod)(char*,unsigned int,unsigned int); - * } - */ - public static MemorySegment mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.mknod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mknod)(char*,unsigned int,unsigned int); - * } - */ - public static void mknod$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.mknod$VH.set(seg, x); - } - public static MemorySegment mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.mknod$VH.get(seg.asSlice(index*sizeof())); - } - public static void mknod$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.mknod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mknod mknod(MemorySegment segment, SegmentScope scope) { - return mknod.ofAddress(mknod$get(segment), scope); - } - static final FunctionDescriptor mkdir$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle mkdir$MH = RuntimeHelper.downcallHandle( - fuse3_operations.mkdir$FUNC - ); - /** - * {@snippet : - * int (*mkdir)(char*,unsigned int); - * } - */ - public interface mkdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(mkdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse3_operations.mkdir$FUNC, scope); - } - static mkdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse3_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle mkdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("mkdir")); - public static VarHandle mkdir$VH() { - return fuse3_operations.mkdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*mkdir)(char*,unsigned int); - * } - */ - public static MemorySegment mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.mkdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*mkdir)(char*,unsigned int); - * } - */ - public static void mkdir$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.mkdir$VH.set(seg, x); - } - public static MemorySegment mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void mkdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.mkdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static mkdir mkdir(MemorySegment segment, SegmentScope scope) { - return mkdir.ofAddress(mkdir$get(segment), scope); - } - static final FunctionDescriptor unlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( - fuse3_operations.unlink$FUNC - ); - /** - * {@snippet : - * int (*unlink)(char*); - * } - */ - public interface unlink { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(unlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse3_operations.unlink$FUNC, scope); - } - static unlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse3_operations.unlink$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle unlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("unlink")); - public static VarHandle unlink$VH() { - return fuse3_operations.unlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static MemorySegment unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.unlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*unlink)(char*); - * } - */ - public static void unlink$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.unlink$VH.set(seg, x); - } - public static MemorySegment unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.unlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void unlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.unlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static unlink unlink(MemorySegment segment, SegmentScope scope) { - return unlink.ofAddress(unlink$get(segment), scope); - } - static final FunctionDescriptor rmdir$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( - fuse3_operations.rmdir$FUNC - ); - /** - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public interface rmdir { - - int apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(rmdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse3_operations.rmdir$FUNC, scope); - } - static rmdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - return (int)fuse3_operations.rmdir$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rmdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rmdir")); - public static VarHandle rmdir$VH() { - return fuse3_operations.rmdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static MemorySegment rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.rmdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rmdir)(char*); - * } - */ - public static void rmdir$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.rmdir$VH.set(seg, x); - } - public static MemorySegment rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void rmdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.rmdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rmdir rmdir(MemorySegment segment, SegmentScope scope) { - return rmdir.ofAddress(rmdir$get(segment), scope); - } - static final FunctionDescriptor symlink$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( - fuse3_operations.symlink$FUNC - ); - /** - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public interface symlink { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(symlink fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse3_operations.symlink$FUNC, scope); - } - static symlink ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.symlink$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle symlink$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("symlink")); - public static VarHandle symlink$VH() { - return fuse3_operations.symlink$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static MemorySegment symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.symlink$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*symlink)(char*,char*); - * } - */ - public static void symlink$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.symlink$VH.set(seg, x); - } - public static MemorySegment symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.symlink$VH.get(seg.asSlice(index*sizeof())); - } - public static void symlink$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.symlink$VH.set(seg.asSlice(index*sizeof()), x); - } - public static symlink symlink(MemorySegment segment, SegmentScope scope) { - return symlink.ofAddress(symlink$get(segment), scope); - } - static final FunctionDescriptor rename$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( - fuse3_operations.rename$FUNC - ); - /** - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public interface rename { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(rename fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse3_operations.rename$FUNC, scope); - } - static rename ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse3_operations.rename$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle rename$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("rename")); - public static VarHandle rename$VH() { - return fuse3_operations.rename$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public static MemorySegment rename$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.rename$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*rename)(char*,char*,unsigned int); - * } - */ - public static void rename$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.rename$VH.set(seg, x); - } - public static MemorySegment rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.rename$VH.get(seg.asSlice(index*sizeof())); - } - public static void rename$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.rename$VH.set(seg.asSlice(index*sizeof()), x); - } - public static rename rename(MemorySegment segment, SegmentScope scope) { - return rename.ofAddress(rename$get(segment), scope); - } - static final FunctionDescriptor link$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle link$MH = RuntimeHelper.downcallHandle( - fuse3_operations.link$FUNC - ); - /** - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public interface link { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(link fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(link.class, fi, fuse3_operations.link$FUNC, scope); - } - static link ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.link$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle link$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("link")); - public static VarHandle link$VH() { - return fuse3_operations.link$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static MemorySegment link$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.link$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*link)(char*,char*); - * } - */ - public static void link$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.link$VH.set(seg, x); - } - public static MemorySegment link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.link$VH.get(seg.asSlice(index*sizeof())); - } - public static void link$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.link$VH.set(seg.asSlice(index*sizeof()), x); - } - public static link link(MemorySegment segment, SegmentScope scope) { - return link.ofAddress(link$get(segment), scope); - } - static final FunctionDescriptor chmod$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle chmod$MH = RuntimeHelper.downcallHandle( - fuse3_operations.chmod$FUNC - ); - /** - * {@snippet : - * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); - * } - */ - public interface chmod { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(chmod fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse3_operations.chmod$FUNC, scope); - } - static chmod ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.chmod$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chmod$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chmod")); - public static VarHandle chmod$VH() { - return fuse3_operations.chmod$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); - * } - */ - public static MemorySegment chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.chmod$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chmod)(char*,unsigned int,struct fuse3_file_info*); - * } - */ - public static void chmod$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.chmod$VH.set(seg, x); - } - public static MemorySegment chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.chmod$VH.get(seg.asSlice(index*sizeof())); - } - public static void chmod$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.chmod$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chmod chmod(MemorySegment segment, SegmentScope scope) { - return chmod.ofAddress(chmod$get(segment), scope); - } - static final FunctionDescriptor chown$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle chown$MH = RuntimeHelper.downcallHandle( - fuse3_operations.chown$FUNC - ); - /** - * {@snippet : - * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); - * } - */ - public interface chown { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(chown fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse3_operations.chown$FUNC, scope); - } - static chown ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse3_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle chown$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("chown")); - public static VarHandle chown$VH() { - return fuse3_operations.chown$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); - * } - */ - public static MemorySegment chown$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.chown$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*chown)(char*,unsigned int,unsigned int,struct fuse3_file_info*); - * } - */ - public static void chown$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.chown$VH.set(seg, x); - } - public static MemorySegment chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.chown$VH.get(seg.asSlice(index*sizeof())); - } - public static void chown$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.chown$VH.set(seg.asSlice(index*sizeof()), x); - } - public static chown chown(MemorySegment segment, SegmentScope scope) { - return chown.ofAddress(chown$get(segment), scope); - } - static final FunctionDescriptor truncate$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle truncate$MH = RuntimeHelper.downcallHandle( - fuse3_operations.truncate$FUNC - ); - /** - * {@snippet : - * int (*truncate)(char*,long long,struct fuse3_file_info*); - * } - */ - public interface truncate { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(truncate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse3_operations.truncate$FUNC, scope); - } - static truncate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.truncate$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle truncate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("truncate")); - public static VarHandle truncate$VH() { - return fuse3_operations.truncate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*truncate)(char*,long long,struct fuse3_file_info*); - * } - */ - public static MemorySegment truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.truncate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*truncate)(char*,long long,struct fuse3_file_info*); - * } - */ - public static void truncate$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.truncate$VH.set(seg, x); - } - public static MemorySegment truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.truncate$VH.get(seg.asSlice(index*sizeof())); - } - public static void truncate$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.truncate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static truncate truncate(MemorySegment segment, SegmentScope scope) { - return truncate.ofAddress(truncate$get(segment), scope); - } - static final FunctionDescriptor open$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle open$MH = RuntimeHelper.downcallHandle( - fuse3_operations.open$FUNC - ); - /** - * {@snippet : - * int (*open)(char*,struct fuse3_file_info*); - * } - */ - public interface open { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(open fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(open.class, fi, fuse3_operations.open$FUNC, scope); - } - static open ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.open$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle open$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("open")); - public static VarHandle open$VH() { - return fuse3_operations.open$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*open)(char*,struct fuse3_file_info*); - * } - */ - public static MemorySegment open$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.open$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*open)(char*,struct fuse3_file_info*); - * } - */ - public static void open$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.open$VH.set(seg, x); - } - public static MemorySegment open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.open$VH.get(seg.asSlice(index*sizeof())); - } - public static void open$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.open$VH.set(seg.asSlice(index*sizeof()), x); - } - public static open open(MemorySegment segment, SegmentScope scope) { - return open.ofAddress(open$get(segment), scope); - } - static final FunctionDescriptor read$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read$MH = RuntimeHelper.downcallHandle( - fuse3_operations.read$FUNC - ); - /** - * {@snippet : - * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public interface read { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read.class, fi, fuse3_operations.read$FUNC, scope); - } - static read ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse3_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read")); - public static VarHandle read$VH() { - return fuse3_operations.read$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public static MemorySegment read$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.read$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public static void read$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.read$VH.set(seg, x); - } - public static MemorySegment read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.read$VH.get(seg.asSlice(index*sizeof())); - } - public static void read$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.read$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read read(MemorySegment segment, SegmentScope scope) { - return read.ofAddress(read$get(segment), scope); - } - static final FunctionDescriptor write$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write$MH = RuntimeHelper.downcallHandle( - fuse3_operations.write$FUNC - ); - /** - * {@snippet : - * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public interface write { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(write fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write.class, fi, fuse3_operations.write$FUNC, scope); - } - static write ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse3_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write")); - public static VarHandle write$VH() { - return fuse3_operations.write$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public static MemorySegment write$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.write$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write)(char*,char*,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public static void write$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.write$VH.set(seg, x); - } - public static MemorySegment write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.write$VH.get(seg.asSlice(index*sizeof())); - } - public static void write$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.write$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write write(MemorySegment segment, SegmentScope scope) { - return write.ofAddress(write$get(segment), scope); - } - static final FunctionDescriptor statfs$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle statfs$MH = RuntimeHelper.downcallHandle( - fuse3_operations.statfs$FUNC - ); - /** - * {@snippet : - * int (*statfs)(char*,struct fuse_statvfs*); - * } - */ - public interface statfs { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(statfs fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse3_operations.statfs$FUNC, scope); - } - static statfs ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.statfs$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle statfs$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("statfs")); - public static VarHandle statfs$VH() { - return fuse3_operations.statfs$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*statfs)(char*,struct fuse_statvfs*); - * } - */ - public static MemorySegment statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.statfs$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*statfs)(char*,struct fuse_statvfs*); - * } - */ - public static void statfs$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.statfs$VH.set(seg, x); - } - public static MemorySegment statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.statfs$VH.get(seg.asSlice(index*sizeof())); - } - public static void statfs$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.statfs$VH.set(seg.asSlice(index*sizeof()), x); - } - public static statfs statfs(MemorySegment segment, SegmentScope scope) { - return statfs.ofAddress(statfs$get(segment), scope); - } - static final FunctionDescriptor flush$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle flush$MH = RuntimeHelper.downcallHandle( - fuse3_operations.flush$FUNC - ); - /** - * {@snippet : - * int (*flush)(char*,struct fuse3_file_info*); - * } - */ - public interface flush { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(flush fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse3_operations.flush$FUNC, scope); - } - static flush ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.flush$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flush$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flush")); - public static VarHandle flush$VH() { - return fuse3_operations.flush$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flush)(char*,struct fuse3_file_info*); - * } - */ - public static MemorySegment flush$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.flush$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flush)(char*,struct fuse3_file_info*); - * } - */ - public static void flush$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.flush$VH.set(seg, x); - } - public static MemorySegment flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.flush$VH.get(seg.asSlice(index*sizeof())); - } - public static void flush$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.flush$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flush flush(MemorySegment segment, SegmentScope scope) { - return flush.ofAddress(flush$get(segment), scope); - } - static final FunctionDescriptor release$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle release$MH = RuntimeHelper.downcallHandle( - fuse3_operations.release$FUNC - ); - /** - * {@snippet : - * int (*release)(char*,struct fuse3_file_info*); - * } - */ - public interface release { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(release fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(release.class, fi, fuse3_operations.release$FUNC, scope); - } - static release ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.release$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle release$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("release")); - public static VarHandle release$VH() { - return fuse3_operations.release$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*release)(char*,struct fuse3_file_info*); - * } - */ - public static MemorySegment release$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.release$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*release)(char*,struct fuse3_file_info*); - * } - */ - public static void release$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.release$VH.set(seg, x); - } - public static MemorySegment release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.release$VH.get(seg.asSlice(index*sizeof())); - } - public static void release$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.release$VH.set(seg.asSlice(index*sizeof()), x); - } - public static release release(MemorySegment segment, SegmentScope scope) { - return release.ofAddress(release$get(segment), scope); - } - static final FunctionDescriptor fsync$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsync$MH = RuntimeHelper.downcallHandle( - fuse3_operations.fsync$FUNC - ); - /** - * {@snippet : - * int (*fsync)(char*,int,struct fuse3_file_info*); - * } - */ - public interface fsync { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsync fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse3_operations.fsync$FUNC, scope); - } - static fsync ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsync$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsync")); - public static VarHandle fsync$VH() { - return fuse3_operations.fsync$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse3_file_info*); - * } - */ - public static MemorySegment fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.fsync$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsync)(char*,int,struct fuse3_file_info*); - * } - */ - public static void fsync$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.fsync$VH.set(seg, x); - } - public static MemorySegment fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.fsync$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsync$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.fsync$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsync fsync(MemorySegment segment, SegmentScope scope) { - return fsync.ofAddress(fsync$get(segment), scope); - } - static final FunctionDescriptor setxattr$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle setxattr$MH = RuntimeHelper.downcallHandle( - fuse3_operations.setxattr$FUNC - ); - /** - * {@snippet : - * int (*setxattr)(char*,char*,char*,unsigned long long,int); - * } - */ - public interface setxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse3_operations.setxattr$FUNC, scope); - } - static setxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, int __x4) -> { - try { - return (int)fuse3_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle setxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("setxattr")); - public static VarHandle setxattr$VH() { - return fuse3_operations.setxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,unsigned long long,int); - * } - */ - public static MemorySegment setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.setxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*setxattr)(char*,char*,char*,unsigned long long,int); - * } - */ - public static void setxattr$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.setxattr$VH.set(seg, x); - } - public static MemorySegment setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void setxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.setxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static setxattr setxattr(MemorySegment segment, SegmentScope scope) { - return setxattr.ofAddress(setxattr$get(segment), scope); - } - static final FunctionDescriptor getxattr$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle getxattr$MH = RuntimeHelper.downcallHandle( - fuse3_operations.getxattr$FUNC - ); - /** - * {@snippet : - * int (*getxattr)(char*,char*,char*,unsigned long long); - * } - */ - public interface getxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3); - static MemorySegment allocate(getxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse3_operations.getxattr$FUNC, scope); - } - static getxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3) -> { - try { - return (int)fuse3_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle getxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("getxattr")); - public static VarHandle getxattr$VH() { - return fuse3_operations.getxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,unsigned long long); - * } - */ - public static MemorySegment getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.getxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*getxattr)(char*,char*,char*,unsigned long long); - * } - */ - public static void getxattr$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.getxattr$VH.set(seg, x); - } - public static MemorySegment getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void getxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.getxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static getxattr getxattr(MemorySegment segment, SegmentScope scope) { - return getxattr.ofAddress(getxattr$get(segment), scope); - } - static final FunctionDescriptor listxattr$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT - ); - static final MethodHandle listxattr$MH = RuntimeHelper.downcallHandle( - fuse3_operations.listxattr$FUNC - ); - /** - * {@snippet : - * int (*listxattr)(char*,char*,unsigned long long); - * } - */ - public interface listxattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2); - static MemorySegment allocate(listxattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse3_operations.listxattr$FUNC, scope); - } - static listxattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2) -> { - try { - return (int)fuse3_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle listxattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("listxattr")); - public static VarHandle listxattr$VH() { - return fuse3_operations.listxattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*listxattr)(char*,char*,unsigned long long); - * } - */ - public static MemorySegment listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.listxattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*listxattr)(char*,char*,unsigned long long); - * } - */ - public static void listxattr$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.listxattr$VH.set(seg, x); - } - public static MemorySegment listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void listxattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.listxattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static listxattr listxattr(MemorySegment segment, SegmentScope scope) { - return listxattr.ofAddress(listxattr$get(segment), scope); - } - static final FunctionDescriptor removexattr$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( - fuse3_operations.removexattr$FUNC - ); - /** - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public interface removexattr { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(removexattr fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse3_operations.removexattr$FUNC, scope); - } - static removexattr ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle removexattr$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("removexattr")); - public static VarHandle removexattr$VH() { - return fuse3_operations.removexattr$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static MemorySegment removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.removexattr$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*removexattr)(char*,char*); - * } - */ - public static void removexattr$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.removexattr$VH.set(seg, x); - } - public static MemorySegment removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); - } - public static void removexattr$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.removexattr$VH.set(seg.asSlice(index*sizeof()), x); - } - public static removexattr removexattr(MemorySegment segment, SegmentScope scope) { - return removexattr.ofAddress(removexattr$get(segment), scope); - } - static final FunctionDescriptor opendir$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle opendir$MH = RuntimeHelper.downcallHandle( - fuse3_operations.opendir$FUNC - ); - /** - * {@snippet : - * int (*opendir)(char*,struct fuse3_file_info*); - * } - */ - public interface opendir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(opendir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse3_operations.opendir$FUNC, scope); - } - static opendir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.opendir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle opendir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("opendir")); - public static VarHandle opendir$VH() { - return fuse3_operations.opendir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse3_file_info*); - * } - */ - public static MemorySegment opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.opendir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*opendir)(char*,struct fuse3_file_info*); - * } - */ - public static void opendir$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.opendir$VH.set(seg, x); - } - public static MemorySegment opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.opendir$VH.get(seg.asSlice(index*sizeof())); - } - public static void opendir$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.opendir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static opendir opendir(MemorySegment segment, SegmentScope scope) { - return opendir.ofAddress(opendir$get(segment), scope); - } - static final FunctionDescriptor readdir$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle readdir$MH = RuntimeHelper.downcallHandle( - fuse3_operations.readdir$FUNC - ); - /** - * {@snippet : - * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); - * } - */ - public interface readdir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, long _x3, java.lang.foreign.MemorySegment _x4, int _x5); - static MemorySegment allocate(readdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse3_operations.readdir$FUNC, scope); - } - static readdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, long __x3, java.lang.foreign.MemorySegment __x4, int __x5) -> { - try { - return (int)fuse3_operations.readdir$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle readdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("readdir")); - public static VarHandle readdir$VH() { - return fuse3_operations.readdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); - * } - */ - public static MemorySegment readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.readdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*readdir)(char*,void*,int (*)(void*,char*,struct fuse_stat*,long long,enum fuse3_fill_dir_flags),long long,struct fuse3_file_info*,enum fuse3_readdir_flags); - * } - */ - public static void readdir$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.readdir$VH.set(seg, x); - } - public static MemorySegment readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.readdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void readdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.readdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static readdir readdir(MemorySegment segment, SegmentScope scope) { - return readdir.ofAddress(readdir$get(segment), scope); - } - static final FunctionDescriptor releasedir$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle releasedir$MH = RuntimeHelper.downcallHandle( - fuse3_operations.releasedir$FUNC - ); - /** - * {@snippet : - * int (*releasedir)(char*,struct fuse3_file_info*); - * } - */ - public interface releasedir { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(releasedir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse3_operations.releasedir$FUNC, scope); - } - static releasedir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (int)fuse3_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle releasedir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("releasedir")); - public static VarHandle releasedir$VH() { - return fuse3_operations.releasedir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse3_file_info*); - * } - */ - public static MemorySegment releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.releasedir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*releasedir)(char*,struct fuse3_file_info*); - * } - */ - public static void releasedir$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.releasedir$VH.set(seg, x); - } - public static MemorySegment releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); - } - public static void releasedir$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.releasedir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static releasedir releasedir(MemorySegment segment, SegmentScope scope) { - return releasedir.ofAddress(releasedir$get(segment), scope); - } - static final FunctionDescriptor fsyncdir$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fsyncdir$MH = RuntimeHelper.downcallHandle( - fuse3_operations.fsyncdir$FUNC - ); - /** - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse3_file_info*); - * } - */ - public interface fsyncdir { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(fsyncdir fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse3_operations.fsyncdir$FUNC, scope); - } - static fsyncdir ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fsyncdir$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fsyncdir")); - public static VarHandle fsyncdir$VH() { - return fuse3_operations.fsyncdir$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse3_file_info*); - * } - */ - public static MemorySegment fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.fsyncdir$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fsyncdir)(char*,int,struct fuse3_file_info*); - * } - */ - public static void fsyncdir$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.fsyncdir$VH.set(seg, x); - } - public static MemorySegment fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); - } - public static void fsyncdir$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.fsyncdir$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fsyncdir fsyncdir(MemorySegment segment, SegmentScope scope) { - return fsyncdir.ofAddress(fsyncdir$get(segment), scope); - } - static final FunctionDescriptor init$FUNC = FunctionDescriptor.of(Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle init$MH = RuntimeHelper.downcallHandle( - fuse3_operations.init$FUNC - ); - /** - * {@snippet : - * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); - * } - */ - public interface init { - - java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1); - static MemorySegment allocate(init fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(init.class, fi, fuse3_operations.init$FUNC, scope); - } - static init ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> { - try { - return (java.lang.foreign.MemorySegment)fuse3_operations.init$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle init$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("init")); - public static VarHandle init$VH() { - return fuse3_operations.init$VH; - } - /** - * Getter for field: - * {@snippet : - * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); - * } - */ - public static MemorySegment init$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.init$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void* (*init)(struct fuse3_conn_info*,struct fuse3_config*); - * } - */ - public static void init$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.init$VH.set(seg, x); - } - public static MemorySegment init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.init$VH.get(seg.asSlice(index*sizeof())); - } - public static void init$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.init$VH.set(seg.asSlice(index*sizeof()), x); - } - public static init init(MemorySegment segment, SegmentScope scope) { - return init.ofAddress(init$get(segment), scope); - } - static final FunctionDescriptor destroy$FUNC = FunctionDescriptor.ofVoid( - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( - fuse3_operations.destroy$FUNC - ); - /** - * {@snippet : - * void (*destroy)(void*); - * } - */ - public interface destroy { - - void apply(java.lang.foreign.MemorySegment _x0); - static MemorySegment allocate(destroy fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse3_operations.destroy$FUNC, scope); - } - static destroy ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0) -> { - try { - fuse3_operations.destroy$MH.invokeExact(symbol, __x0); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle destroy$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("destroy")); - public static VarHandle destroy$VH() { - return fuse3_operations.destroy$VH; - } - /** - * Getter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static MemorySegment destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.destroy$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * void (*destroy)(void*); - * } - */ - public static void destroy$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.destroy$VH.set(seg, x); - } - public static MemorySegment destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.destroy$VH.get(seg.asSlice(index*sizeof())); - } - public static void destroy$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.destroy$VH.set(seg.asSlice(index*sizeof()), x); - } - public static destroy destroy(MemorySegment segment, SegmentScope scope) { - return destroy.ofAddress(destroy$get(segment), scope); - } - static final FunctionDescriptor access$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle access$MH = RuntimeHelper.downcallHandle( - fuse3_operations.access$FUNC - ); - /** - * {@snippet : - * int (*access)(char*,int); - * } - */ - public interface access { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1); - static MemorySegment allocate(access fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(access.class, fi, fuse3_operations.access$FUNC, scope); - } - static access ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1) -> { - try { - return (int)fuse3_operations.access$MH.invokeExact(symbol, __x0, __x1); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle access$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("access")); - public static VarHandle access$VH() { - return fuse3_operations.access$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static MemorySegment access$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.access$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*access)(char*,int); - * } - */ - public static void access$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.access$VH.set(seg, x); - } - public static MemorySegment access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.access$VH.get(seg.asSlice(index*sizeof())); - } - public static void access$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.access$VH.set(seg.asSlice(index*sizeof()), x); - } - public static access access(MemorySegment segment, SegmentScope scope) { - return access.ofAddress(access$get(segment), scope); - } - static final FunctionDescriptor create$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle create$MH = RuntimeHelper.downcallHandle( - fuse3_operations.create$FUNC - ); - /** - * {@snippet : - * int (*create)(char*,unsigned int,struct fuse3_file_info*); - * } - */ - public interface create { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(create fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(create.class, fi, fuse3_operations.create$FUNC, scope); - } - static create ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle create$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("create")); - public static VarHandle create$VH() { - return fuse3_operations.create$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*create)(char*,unsigned int,struct fuse3_file_info*); - * } - */ - public static MemorySegment create$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.create$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*create)(char*,unsigned int,struct fuse3_file_info*); - * } - */ - public static void create$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.create$VH.set(seg, x); - } - public static MemorySegment create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.create$VH.get(seg.asSlice(index*sizeof())); - } - public static void create$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.create$VH.set(seg.asSlice(index*sizeof()), x); - } - public static create create(MemorySegment segment, SegmentScope scope) { - return create.ofAddress(create$get(segment), scope); - } - static final FunctionDescriptor lock$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle lock$MH = RuntimeHelper.downcallHandle( - fuse3_operations.lock$FUNC - ); - /** - * {@snippet : - * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); - * } - */ - public interface lock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(lock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse3_operations.lock$FUNC, scope); - } - static lock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse3_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle lock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("lock")); - public static VarHandle lock$VH() { - return fuse3_operations.lock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); - * } - */ - public static MemorySegment lock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.lock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*lock)(char*,struct fuse3_file_info*,int,struct fuse_flock*); - * } - */ - public static void lock$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.lock$VH.set(seg, x); - } - public static MemorySegment lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.lock$VH.get(seg.asSlice(index*sizeof())); - } - public static void lock$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.lock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static lock lock(MemorySegment segment, SegmentScope scope) { - return lock.ofAddress(lock$get(segment), scope); - } - static final FunctionDescriptor utimens$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle utimens$MH = RuntimeHelper.downcallHandle( - fuse3_operations.utimens$FUNC - ); - /** - * {@snippet : - * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); - * } - */ - public interface utimens { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(utimens fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse3_operations.utimens$FUNC, scope); - } - static utimens ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.utimens$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle utimens$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("utimens")); - public static VarHandle utimens$VH() { - return fuse3_operations.utimens$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); - * } - */ - public static MemorySegment utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.utimens$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*utimens)(char*,struct fuse_timespec*,struct fuse3_file_info*); - * } - */ - public static void utimens$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.utimens$VH.set(seg, x); - } - public static MemorySegment utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.utimens$VH.get(seg.asSlice(index*sizeof())); - } - public static void utimens$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.utimens$VH.set(seg.asSlice(index*sizeof()), x); - } - public static utimens utimens(MemorySegment segment, SegmentScope scope) { - return utimens.ofAddress(utimens$get(segment), scope); - } - static final FunctionDescriptor bmap$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle bmap$MH = RuntimeHelper.downcallHandle( - fuse3_operations.bmap$FUNC - ); - /** - * {@snippet : - * int (*bmap)(char*,unsigned long long,unsigned long long*); - * } - */ - public interface bmap { - - int apply(java.lang.foreign.MemorySegment _x0, long _x1, java.lang.foreign.MemorySegment _x2); - static MemorySegment allocate(bmap fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse3_operations.bmap$FUNC, scope); - } - static bmap ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, long __x1, java.lang.foreign.MemorySegment __x2) -> { - try { - return (int)fuse3_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle bmap$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("bmap")); - public static VarHandle bmap$VH() { - return fuse3_operations.bmap$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*bmap)(char*,unsigned long long,unsigned long long*); - * } - */ - public static MemorySegment bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.bmap$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*bmap)(char*,unsigned long long,unsigned long long*); - * } - */ - public static void bmap$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.bmap$VH.set(seg, x); - } - public static MemorySegment bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.bmap$VH.get(seg.asSlice(index*sizeof())); - } - public static void bmap$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.bmap$VH.set(seg.asSlice(index*sizeof()), x); - } - public static bmap bmap(MemorySegment segment, SegmentScope scope) { - return bmap.ofAddress(bmap$get(segment), scope); - } - static final FunctionDescriptor ioctl$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle ioctl$MH = RuntimeHelper.downcallHandle( - fuse3_operations.ioctl$FUNC - ); - /** - * {@snippet : - * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); - * } - */ - public interface ioctl { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3, int _x4, java.lang.foreign.MemorySegment _x5); - static MemorySegment allocate(ioctl fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse3_operations.ioctl$FUNC, scope); - } - static ioctl ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3, int __x4, java.lang.foreign.MemorySegment __x5) -> { - try { - return (int)fuse3_operations.ioctl$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4, __x5); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle ioctl$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("ioctl")); - public static VarHandle ioctl$VH() { - return fuse3_operations.ioctl$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); - * } - */ - public static MemorySegment ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.ioctl$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*ioctl)(char*,int,void*,struct fuse3_file_info*,unsigned int,void*); - * } - */ - public static void ioctl$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.ioctl$VH.set(seg, x); - } - public static MemorySegment ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); - } - public static void ioctl$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.ioctl$VH.set(seg.asSlice(index*sizeof()), x); - } - public static ioctl ioctl(MemorySegment segment, SegmentScope scope) { - return ioctl.ofAddress(ioctl$get(segment), scope); - } - static final FunctionDescriptor poll$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle poll$MH = RuntimeHelper.downcallHandle( - fuse3_operations.poll$FUNC - ); - /** - * {@snippet : - * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); - * } - */ - public interface poll { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, java.lang.foreign.MemorySegment _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(poll fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse3_operations.poll$FUNC, scope); - } - static poll ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, java.lang.foreign.MemorySegment __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse3_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle poll$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("poll")); - public static VarHandle poll$VH() { - return fuse3_operations.poll$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); - * } - */ - public static MemorySegment poll$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.poll$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*poll)(char*,struct fuse3_file_info*,struct fuse3_pollhandle*,unsigned int*); - * } - */ - public static void poll$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.poll$VH.set(seg, x); - } - public static MemorySegment poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.poll$VH.get(seg.asSlice(index*sizeof())); - } - public static void poll$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.poll$VH.set(seg.asSlice(index*sizeof()), x); - } - public static poll poll(MemorySegment segment, SegmentScope scope) { - return poll.ofAddress(poll$get(segment), scope); - } - static final FunctionDescriptor write_buf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle write_buf$MH = RuntimeHelper.downcallHandle( - fuse3_operations.write_buf$FUNC - ); - /** - * {@snippet : - * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); - * } - */ - public interface write_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3); - static MemorySegment allocate(write_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse3_operations.write_buf$FUNC, scope); - } - static write_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3) -> { - try { - return (int)fuse3_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle write_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("write_buf")); - public static VarHandle write_buf$VH() { - return fuse3_operations.write_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); - * } - */ - public static MemorySegment write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.write_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*write_buf)(char*,struct fuse3_bufvec*,long long,struct fuse3_file_info*); - * } - */ - public static void write_buf$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.write_buf$VH.set(seg, x); - } - public static MemorySegment write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void write_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.write_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static write_buf write_buf(MemorySegment segment, SegmentScope scope) { - return write_buf.ofAddress(write_buf$get(segment), scope); - } - static final FunctionDescriptor read_buf$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle read_buf$MH = RuntimeHelper.downcallHandle( - fuse3_operations.read_buf$FUNC - ); - /** - * {@snippet : - * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public interface read_buf { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(read_buf fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse3_operations.read_buf$FUNC, scope); - } - static read_buf ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse3_operations.read_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle read_buf$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("read_buf")); - public static VarHandle read_buf$VH() { - return fuse3_operations.read_buf$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public static MemorySegment read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.read_buf$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*read_buf)(char*,struct fuse3_bufvec**,unsigned long long,long long,struct fuse3_file_info*); - * } - */ - public static void read_buf$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.read_buf$VH.set(seg, x); - } - public static MemorySegment read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); - } - public static void read_buf$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.read_buf$VH.set(seg.asSlice(index*sizeof()), x); - } - public static read_buf read_buf(MemorySegment segment, SegmentScope scope) { - return read_buf.ofAddress(read_buf$get(segment), scope); - } - static final FunctionDescriptor flock$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT - ); - static final MethodHandle flock$MH = RuntimeHelper.downcallHandle( - fuse3_operations.flock$FUNC - ); - /** - * {@snippet : - * int (*flock)(char*,struct fuse3_file_info*,int); - * } - */ - public interface flock { - - int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, int _x2); - static MemorySegment allocate(flock fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse3_operations.flock$FUNC, scope); - } - static flock ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, int __x2) -> { - try { - return (int)fuse3_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle flock$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("flock")); - public static VarHandle flock$VH() { - return fuse3_operations.flock$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*flock)(char*,struct fuse3_file_info*,int); - * } - */ - public static MemorySegment flock$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.flock$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*flock)(char*,struct fuse3_file_info*,int); - * } - */ - public static void flock$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.flock$VH.set(seg, x); - } - public static MemorySegment flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.flock$VH.get(seg.asSlice(index*sizeof())); - } - public static void flock$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.flock$VH.set(seg.asSlice(index*sizeof()), x); - } - public static flock flock(MemorySegment segment, SegmentScope scope) { - return flock.ofAddress(flock$get(segment), scope); - } - static final FunctionDescriptor fallocate$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT, - Constants$root.C_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_LONG_LONG$LAYOUT, - Constants$root.C_POINTER$LAYOUT - ); - static final MethodHandle fallocate$MH = RuntimeHelper.downcallHandle( - fuse3_operations.fallocate$FUNC - ); - /** - * {@snippet : - * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); - * } - */ - public interface fallocate { - - int apply(java.lang.foreign.MemorySegment _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemorySegment _x4); - static MemorySegment allocate(fallocate fi, SegmentScope scope) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse3_operations.fallocate$FUNC, scope); - } - static fallocate ofAddress(MemorySegment addr, SegmentScope scope) { - MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); - return (java.lang.foreign.MemorySegment __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemorySegment __x4) -> { - try { - return (int)fuse3_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); - } catch (Throwable ex$) { - throw new AssertionError("should not reach here", ex$); - } - }; - } - } - - static final VarHandle fallocate$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("fallocate")); - public static VarHandle fallocate$VH() { - return fuse3_operations.fallocate$VH; - } - /** - * Getter for field: - * {@snippet : - * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); - * } - */ - public static MemorySegment fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemorySegment)fuse3_operations.fallocate$VH.get(seg); - } - /** - * Setter for field: - * {@snippet : - * int (*fallocate)(char*,int,long long,long long,struct fuse3_file_info*); - * } - */ - public static void fallocate$set(MemorySegment seg, MemorySegment x) { - fuse3_operations.fallocate$VH.set(seg, x); - } - public static MemorySegment fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemorySegment)fuse3_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); - } - public static void fallocate$set(MemorySegment seg, long index, MemorySegment x) { - fuse3_operations.fallocate$VH.set(seg.asSlice(index*sizeof()), x); - } - public static fallocate fallocate(MemorySegment segment, SegmentScope scope) { - return fallocate.ofAddress(fallocate$get(segment), scope); - } - public static long sizeof() { return $LAYOUT().byteSize(); } - public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { - return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); - } - public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } -} - - diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FileInfoImplTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FileInfoImplTest.java index 2f3480e2..12b5a82c 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FileInfoImplTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FileInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.win; -import org.cryptomator.jfuse.win.extr.fcntl_h; -import org.cryptomator.jfuse.win.extr.fuse3_file_info; +import org.cryptomator.jfuse.win.extr.fcntl.fcntl_h; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_file_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; @@ -20,7 +20,7 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var fi = new FileInfoImpl(fuse3_file_info.allocate(arena)); fuse3_file_info.flags$set(fi.segment(), flags); diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConfigImplTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConfigImplTest.java index a8f0ab96..3e1485f9 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConfigImplTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConfigImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FuseConfig; -import org.cryptomator.jfuse.win.extr.fuse3_config; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_config; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConfigImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInFuseConfig getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse3_config.allocate(arena); - var fuseConfig = new FuseConfigImpl(segment, arena.scope()); + var fuseConfig = new FuseConfigImpl(segment, arena); setter.accept(segment, value); diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConnInfoImplTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConnInfoImplTest.java index f846a53d..dc9ca660 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConnInfoImplTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseConnInfoImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.win.extr.fuse3_conn_info; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_conn_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse3_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(segment, 42); @@ -54,9 +54,9 @@ private interface GetInConnInfo extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInConnInfo setter, GetInMemorySegment getter) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse3_conn_info.allocate(arena); - var connInfo = new FuseConnInfoImpl(segment, arena.scope()); + var connInfo = new FuseConnInfoImpl(segment, arena); setter.accept(connInfo, 42); diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseImplTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseImplTest.java index f8db3186..dc6c1170 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseImplTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/FuseImplTest.java @@ -7,12 +7,12 @@ import org.cryptomator.jfuse.api.FuseMountFailedException; import org.cryptomator.jfuse.api.FuseOperations; import org.cryptomator.jfuse.win.extr.fuse2.fuse2_h; -import org.cryptomator.jfuse.win.extr.fuse3_config; -import org.cryptomator.jfuse.win.extr.fuse3_conn_info; -import org.cryptomator.jfuse.win.extr.fuse3_file_info; -import org.cryptomator.jfuse.win.extr.fuse_h; -import org.cryptomator.jfuse.win.extr.fuse_stat; -import org.cryptomator.jfuse.win.extr.fuse_timespec; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_config; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_conn_info; +import org.cryptomator.jfuse.win.extr.fuse3.fuse3_file_info; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_h; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_stat; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_timespec; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; @@ -113,7 +113,7 @@ public void testAdjustMountPoint() throws FuseMountFailedException, InterruptedE @DisplayName("parseArgs") public void testParseArgs() { try (var fuseH = Mockito.mockStatic(fuse2_h.class); - var arena = Arena.openConfined()) { + var arena = Arena.ofConfined()) { fuseH.when(() -> fuse2_h.fuse_parse_cmdline(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).then(invocation -> { MemorySegment mp = invocation.getArgument(1); MemorySegment mt = invocation.getArgument(2); @@ -141,7 +141,7 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse3_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); @@ -155,7 +155,7 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse3_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsync(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -169,7 +169,7 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse3_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).fsyncdir(Mockito.eq("/foo"), Mockito.eq(1), Mockito.any()); @@ -185,7 +185,7 @@ public void testFsyncdir() { @DisplayName("init() sets fuse_conn_info.wants |= FUSE_CAP_READDIRPLUS") @Test public void testInit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var result = new AtomicInteger(); Mockito.doAnswer(invocation -> { FuseConnInfo connInfo = invocation.getArgument(0); @@ -210,7 +210,7 @@ public void testInit() { public void testUtimens(long sec0, long nsec0, long sec1, long nsec1) { Instant expectedATime = Instant.ofEpochSecond(sec0, nsec0); Instant expectedMTime = Instant.ofEpochSecond(sec1, nsec1); - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var times = fuse_timespec.allocateArray(2, arena); var fi = arena.allocate(fuse3_file_info.$LAYOUT()); @@ -233,7 +233,7 @@ public class Attr { @Test @DisplayName("getattr") public void testGetattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var attr = fuse_stat.allocate(arena); var fi = arena.allocate(fuse3_file_info.$LAYOUT()); @@ -248,7 +248,7 @@ public void testGetattr() { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -264,7 +264,7 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); var value = arena.allocate(100); @@ -280,7 +280,7 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var list = arena.allocate(100); @@ -295,7 +295,7 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var name = arena.allocateUtf8String("bar"); @@ -313,7 +313,7 @@ public void testRemovexattr() { @Test @DisplayName("truncate") public void testTruncate() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = arena.allocate(fuse3_file_info.$LAYOUT()); Mockito.doReturn(42).when(fuseOps).truncate(Mockito.eq("/foo"), Mockito.eq(1337L), Mockito.argThat(usesSameMemorySegement(fi))); @@ -327,7 +327,7 @@ public void testTruncate() { @Test @DisplayName("chown") public void testChown() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var path = arena.allocateUtf8String("/foo"); var fi = fuse3_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).chown(Mockito.eq("/foo"), Mockito.eq(42), Mockito.eq(1337), Mockito.any()); diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/StatImplTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/StatImplTest.java index 88bf4959..3e775800 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/StatImplTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/StatImplTest.java @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.Stat; -import org.cryptomator.jfuse.win.extr.fuse_stat; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_stat; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(segment, value); @@ -49,9 +49,9 @@ private interface GetInStat extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInStat setter, GetInMemorySegment getter, Number value) { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var segment = fuse_stat.allocate(arena); - var stat = new StatImpl(segment, arena.scope()); + var stat = new StatImpl(segment, arena); setter.accept(stat, value); diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/TimeSpecImplTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/TimeSpecImplTest.java index df7928d4..e447ec1a 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/TimeSpecImplTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/TimeSpecImplTest.java @@ -1,6 +1,6 @@ package org.cryptomator.jfuse.win; -import org.cryptomator.jfuse.win.extr.fuse_timespec; +import org.cryptomator.jfuse.win.extr.fuse3.fuse_timespec; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; @@ -13,7 +13,7 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); fuse_timespec.tv_sec$set(timeSpec.segment(), 123L); fuse_timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -28,7 +28,7 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); fuse_timespec.tv_sec$set(timeSpec.segment(), 0L); fuse_timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -43,7 +43,7 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); Assertions.assertFalse(timeSpec.isUtimeOmit()); @@ -53,7 +53,7 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var arena = Arena.openConfined()) { + try (var arena = Arena.ofConfined()) { var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); Assertions.assertFalse(timeSpec.isUtimeNow()); diff --git a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/WinErrnoTest.java b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/WinErrnoTest.java index bf06627d..432b5c68 100644 --- a/jfuse-win/src/test/java/org/cryptomator/jfuse/win/WinErrnoTest.java +++ b/jfuse-win/src/test/java/org/cryptomator/jfuse/win/WinErrnoTest.java @@ -1,15 +1,21 @@ package org.cryptomator.jfuse.win; +import org.cryptomator.jfuse.api.Errno; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; import org.junit.jupiter.params.provider.ValueSource; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.stream.Stream; + public class WinErrnoTest { @DisplayName("make sure method is not a stub") @ParameterizedTest(name = "{0}()") - @ValueSource(strings = {"enoent", "enosys", "enomem", "eacces", "eio", "erofs", "ebadf", "eexist", "enotdir", "eisdir", "enotempty", "einval"}) + @MethodSource("errnoNameProvider") public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationException { var errno = new WinErrno(); var method = WinErrno.class.getMethod(methodName); @@ -19,4 +25,8 @@ public void testErrnoIsNotZero(String methodName) throws ReflectiveOperationExce Assertions.assertNotEquals(0, result); } + static Stream errnoNameProvider() { + return Arrays.stream(Errno.class.getDeclaredMethods()).map(Method::getName); + } + } \ No newline at end of file diff --git a/jfuse/pom.xml b/jfuse/pom.xml index c9d1eb18..4871fb02 100644 --- a/jfuse/pom.xml +++ b/jfuse/pom.xml @@ -5,7 +5,7 @@ org.cryptomator jfuse-parent - 0.5.1 + 0.6.0 4.0.0 jfuse diff --git a/pom.xml b/pom.xml index ade91e53..1c08c9dc 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.cryptomator jfuse-parent pom - 0.5.1 + 0.6.0 jFUSE Java bindings for FUSE using foreign functions & memory API https://github.com/cryptomator/jfuse @@ -65,8 +65,8 @@ org.mockito - mockito-inline - 5.2.0 + mockito-core + 5.4.0 test @@ -79,7 +79,7 @@ maven-compiler-plugin 3.10.1 - 20 + 21 UTF-8 true @@ -170,7 +170,7 @@ *.extr:*.extr.* - 20 + 21