From a1d8705394fa1e240befc1abf414370c4da17e6d Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 10 Mar 2023 12:09:42 +0100 Subject: [PATCH 1/9] migrated to new API --- .github/workflows/build.yml | 8 +- .github/workflows/publish-central.yml | 2 +- .github/workflows/publish-github.yml | 2 +- .idea/misc.xml | 2 +- .../java/org/cryptomator/jfuse/api/Fuse.java | 8 +- jfuse-linux-aarch64/pom.xml | 80 +- .../jfuse/linux/aarch64/DirFillerImpl.java | 15 +- .../jfuse/linux/aarch64/FileInfoImpl.java | 5 +- .../jfuse/linux/aarch64/FuseArgs.java | 5 +- .../jfuse/linux/aarch64/FuseConfigImpl.java | 5 +- .../jfuse/linux/aarch64/FuseConnInfoImpl.java | 5 +- .../jfuse/linux/aarch64/FuseFunctions.java | 6 +- .../jfuse/linux/aarch64/FuseImpl.java | 246 +- .../jfuse/linux/aarch64/FuseMountImpl.java | 10 +- .../jfuse/linux/aarch64/StatImpl.java | 5 +- .../jfuse/linux/aarch64/StatvfsImpl.java | 5 +- .../linux/aarch64/extr/Constants$root.java | 22 +- .../linux/aarch64/extr/RuntimeHelper.java | 67 +- .../jfuse/linux/aarch64/extr/constants$0.java | 4 +- .../jfuse/linux/aarch64/extr/constants$1.java | 4 +- .../jfuse/linux/aarch64/extr/constants$2.java | 4 +- .../jfuse/linux/aarch64/extr/errno_h.java | 97 +- .../jfuse/linux/aarch64/extr/fcntl_h.java | 62 +- .../jfuse/linux/aarch64/extr/fuse_args.java | 69 +- .../linux/aarch64/extr/fuse_cmdline_opts.java | 174 +- .../jfuse/linux/aarch64/extr/fuse_config.java | 399 ++- .../linux/aarch64/extr/fuse_conn_info.java | 163 +- .../linux/aarch64/extr/fuse_file_info.java | 82 +- .../linux/aarch64/extr/fuse_fill_dir_t.java | 19 +- .../jfuse/linux/aarch64/extr/fuse_h.java | 121 +- .../aarch64/extr/fuse_loop_config_v1.java | 42 +- .../linux/aarch64/extr/fuse_lowlevel_h.java | 17 +- .../linux/aarch64/extr/fuse_operations.java | 2112 +++++++++++----- .../jfuse/linux/aarch64/extr/stat.java | 196 +- .../jfuse/linux/aarch64/extr/stat_h.java | 27 +- .../jfuse/linux/aarch64/extr/statvfs.java | 178 +- .../jfuse/linux/aarch64/extr/stdio_h.java | 32 +- .../jfuse/linux/aarch64/extr/timespec.java | 42 +- .../jfuse/linux/aarch64/FileInfoImplTest.java | 6 +- .../linux/aarch64/FuseConfigImplTest.java | 8 +- .../linux/aarch64/FuseConnInfoImplTest.java | 14 +- .../jfuse/linux/aarch64/FuseImplTest.java | 109 +- .../linux/aarch64/FuseMountImplTest.java | 6 +- .../jfuse/linux/aarch64/StatImplTest.java | 14 +- .../jfuse/linux/aarch64/TimeSpecImplTest.java | 18 +- jfuse-linux-amd64/pom.xml | 20 +- .../jfuse/linux/amd64/DirFillerImpl.java | 14 +- .../jfuse/linux/amd64/FileInfoImpl.java | 5 +- .../jfuse/linux/amd64/FuseArgs.java | 5 +- .../jfuse/linux/amd64/FuseConfigImpl.java | 5 +- .../jfuse/linux/amd64/FuseConnInfoImpl.java | 5 +- .../jfuse/linux/amd64/FuseFunctions.java | 6 +- .../jfuse/linux/amd64/FuseImpl.java | 246 +- .../jfuse/linux/amd64/FuseMountImpl.java | 10 +- .../jfuse/linux/amd64/StatImpl.java | 5 +- .../jfuse/linux/amd64/StatvfsImpl.java | 5 +- .../linux/amd64/extr/Constants$root.java | 22 +- .../jfuse/linux/amd64/extr/RuntimeHelper.java | 67 +- .../jfuse/linux/amd64/extr/constants$0.java | 4 +- .../jfuse/linux/amd64/extr/constants$1.java | 4 +- .../jfuse/linux/amd64/extr/constants$2.java | 4 +- .../jfuse/linux/amd64/extr/errno_h.java | 97 +- .../jfuse/linux/amd64/extr/fcntl_h.java | 62 +- .../jfuse/linux/amd64/extr/fuse_args.java | 69 +- .../linux/amd64/extr/fuse_cmdline_opts.java | 174 +- .../jfuse/linux/amd64/extr/fuse_config.java | 399 ++- .../linux/amd64/extr/fuse_conn_info.java | 163 +- .../linux/amd64/extr/fuse_file_info.java | 82 +- .../linux/amd64/extr/fuse_fill_dir_t.java | 19 +- .../jfuse/linux/amd64/extr/fuse_h.java | 121 +- .../linux/amd64/extr/fuse_loop_config_v1.java | 42 +- .../linux/amd64/extr/fuse_lowlevel_h.java | 17 +- .../linux/amd64/extr/fuse_operations.java | 2112 +++++++++++----- .../jfuse/linux/amd64/extr/stat.java | 181 +- .../jfuse/linux/amd64/extr/stat_h.java | 27 +- .../jfuse/linux/amd64/extr/statvfs.java | 178 +- .../jfuse/linux/amd64/extr/stdio_h.java | 32 +- .../jfuse/linux/amd64/extr/timespec.java | 42 +- .../jfuse/linux/amd64/FileInfoImplTest.java | 6 +- .../jfuse/linux/amd64/FuseConfigImplTest.java | 9 +- .../linux/amd64/FuseConnInfoImplTest.java | 14 +- .../jfuse/linux/amd64/FuseImplTest.java | 109 +- .../jfuse/linux/amd64/FuseMountImplTest.java | 6 +- .../jfuse/linux/amd64/StatImplTest.java | 14 +- .../jfuse/linux/amd64/TimeSpecImplTest.java | 18 +- jfuse-mac/pom.xml | 70 +- .../cryptomator/jfuse/mac/DirFillerImpl.java | 15 +- .../cryptomator/jfuse/mac/FileInfoImpl.java | 5 +- .../org/cryptomator/jfuse/mac/FuseArgs.java | 5 +- .../jfuse/mac/FuseConnInfoImpl.java | 5 +- .../org/cryptomator/jfuse/mac/FuseImpl.java | 249 +- .../cryptomator/jfuse/mac/FuseMountImpl.java | 4 +- .../org/cryptomator/jfuse/mac/StatImpl.java | 5 +- .../cryptomator/jfuse/mac/StatvfsImpl.java | 5 +- .../jfuse/mac/extr/Constants$root.java | 22 +- .../jfuse/mac/extr/RuntimeHelper.java | 67 +- .../jfuse/mac/extr/constants$0.java | 4 +- .../jfuse/mac/extr/constants$1.java | 4 +- .../cryptomator/jfuse/mac/extr/errno_h.java | 97 +- .../cryptomator/jfuse/mac/extr/fcntl_h.java | 62 +- .../cryptomator/jfuse/mac/extr/fuse_args.java | 69 +- .../jfuse/mac/extr/fuse_conn_info.java | 148 +- .../jfuse/mac/extr/fuse_file_info.java | 93 +- .../jfuse/mac/extr/fuse_fill_dir_t.java | 19 +- .../cryptomator/jfuse/mac/extr/fuse_h.java | 77 +- .../jfuse/mac/extr/fuse_operations.java | 2216 +++++++++++------ .../org/cryptomator/jfuse/mac/extr/stat.java | 212 +- .../cryptomator/jfuse/mac/extr/stat_h.java | 27 +- .../cryptomator/jfuse/mac/extr/statvfs.java | 177 +- .../cryptomator/jfuse/mac/extr/timespec.java | 42 +- .../jfuse/mac/FileInfoImplTest.java | 6 +- .../jfuse/mac/FuseConnInfoImplTest.java | 14 +- .../cryptomator/jfuse/mac/FuseImplTest.java | 129 +- .../cryptomator/jfuse/mac/StatImplTest.java | 14 +- .../jfuse/mac/TimeSpecImplTest.java | 18 +- .../cryptomator/jfuse/win/DirFillerImpl.java | 14 +- .../cryptomator/jfuse/win/FileInfoImpl.java | 5 +- .../org/cryptomator/jfuse/win/FuseArgs.java | 6 +- .../cryptomator/jfuse/win/FuseConfigImpl.java | 5 +- .../jfuse/win/FuseConnInfoImpl.java | 5 +- .../org/cryptomator/jfuse/win/FuseImpl.java | 233 +- .../cryptomator/jfuse/win/FuseMountImpl.java | 4 +- .../org/cryptomator/jfuse/win/StatImpl.java | 5 +- .../cryptomator/jfuse/win/StatvfsImpl.java | 5 +- .../jfuse/win/extr/Constants$root.java | 22 +- .../jfuse/win/extr/RuntimeHelper.java | 52 +- .../jfuse/win/extr/fuse2/Constants$root.java | 22 +- .../jfuse/win/extr/fuse2/RuntimeHelper.java | 54 +- .../jfuse/win/extr/fuse2/fuse2_h.java | 2 +- .../jfuse/win/extr/fuse2/fuse_args.java | 23 +- .../jfuse/win/extr/fuse3_config.java | 14 +- .../jfuse/win/extr/fuse3_conn_info.java | 2 +- .../jfuse/win/extr/fuse3_file_info.java | 2 +- .../jfuse/win/extr/fuse3_fill_dir_t.java | 14 +- .../jfuse/win/extr/fuse3_operations.java | 1202 ++++----- .../cryptomator/jfuse/win/extr/fuse_h.java | 22 +- .../cryptomator/jfuse/win/extr/fuse_stat.java | 2 +- .../jfuse/win/extr/fuse_statvfs.java | 2 +- .../jfuse/win/extr/fuse_timespec.java | 2 +- .../jfuse/win/FileInfoImplTest.java | 7 +- .../jfuse/win/FuseConfigImplTest.java | 8 +- .../jfuse/win/FuseConnInfoImplTest.java | 15 +- .../cryptomator/jfuse/win/FuseImplTest.java | 123 +- .../cryptomator/jfuse/win/StatImplTest.java | 14 +- .../jfuse/win/TimeSpecImplTest.java | 19 +- .../cryptomator/jfuse/win/WinErrnoTest.java | 1 - pom.xml | 15 +- 147 files changed, 10233 insertions(+), 4505 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed2a0ec2..d168b8f0 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: 19 + java-version: 20-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: 19 + java-version: 20-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: 19 + java-version: 20-ea distribution: 'zulu' cache: 'maven' - name: Setup fuse @@ -83,7 +83,7 @@ jobs: fetch-depth: 0 - uses: actions/setup-java@v3 with: - java-version: 19 + java-version: 20-ea distribution: 'zulu' cache: 'maven' - name: Cache SonarCloud packages diff --git a/.github/workflows/publish-central.yml b/.github/workflows/publish-central.yml index c3f28206..e580b1f0 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: 19 + java-version: 20-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 b233f6ce..2c1d6b44 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: 19 + java-version: 20-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 301d9c4f..3ff4034e 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -8,7 +8,7 @@ - + \ No newline at end of file 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 975af65f..fdaeacf1 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 @@ -7,8 +7,8 @@ import org.jetbrains.annotations.VisibleForTesting; import java.io.IOException; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.SegmentAllocator; import java.nio.file.Files; import java.nio.file.Path; @@ -41,7 +41,7 @@ public abstract class Fuse implements AutoCloseable { /** * The memory session associated with the lifecycle of this Fuse instance. */ - protected final MemorySession fuseScope = MemorySession.openShared(); + protected final Arena fuseScope = Arena.openShared(); // TODO rename to fuseArena? /** * The file system operations invoked by this FUSE file system. @@ -145,7 +145,7 @@ void waitForMountingToComplete(Path mountPoint) throws InterruptedException { @Blocking private int fuseLoop(FuseMount mount) { AtomicInteger result = new AtomicInteger(); - fuseScope.whileAlive(() -> { + fuseScope.scope().whileAlive(() -> { result.set(mount.loop()); }); return result.get(); @@ -173,7 +173,7 @@ private int fuseLoop(FuseMount mount) { @Blocking @MustBeInvokedByOverriders public synchronized void close() throws TimeoutException { - if (!fuseScope.isAlive()) { + if (!fuseScope.scope().isAlive()) { return; // already closed } try { diff --git a/jfuse-linux-aarch64/pom.xml b/jfuse-linux-aarch64/pom.xml index 2c2133a3..9bbda07c 100644 --- a/jfuse-linux-aarch64/pom.xml +++ b/jfuse-linux-aarch64/pom.xml @@ -69,9 +69,9 @@ io.github.coffeelibs jextract-maven-plugin - 0.2.0 + 0.3.0 - ${user.home}/.sdkman/candidates/java/19.ea.jextract/bin/jextract + /Users/sebastian/Documents/Cryptomator/jextract/build/jextract/bin/jextract ${linux.headerSearchPath} ${project.build.sourceDirectory} org.cryptomator.jfuse.linux.aarch64.extr @@ -147,24 +147,24 @@ ${linux.headerSearchPath}/errno.h errno_h - - ENOENT - ENOSYS - ENOMEM - EACCES - EIO - EROFS - EBADF - EEXIST - ENOTDIR - EISDIR - ENOTEMPTY - ENOTSUP - EINVAL - ERANGE - ENOLCK - ENAMETOOLONG - + + ENOENT + ENOSYS + ENOMEM + EACCES + EIO + EROFS + EBADF + EEXIST + ENOTDIR + EISDIR + ENOTEMPTY + ENOTSUP + EINVAL + ERANGE + ENOLCK + ENAMETOOLONG + @@ -175,10 +175,10 @@ ${linux.headerSearchPath}/sys/stat.h stat_h - - UTIME_NOW - UTIME_OMIT - + + UTIME_NOW + UTIME_OMIT + @@ -189,17 +189,17 @@ ${linux.headerSearchPath}/fcntl.h fcntl_h - - O_RDONLY - O_WRONLY - O_RDWR - O_APPEND - O_CREAT - O_TRUNC - O_EXCL - O_DSYNC - O_SYNC - + + O_RDONLY + O_WRONLY + O_RDWR + O_APPEND + O_CREAT + O_TRUNC + O_EXCL + O_DSYNC + O_SYNC + @@ -213,12 +213,12 @@ _GNU_SOURCE=1 - + - RENAME_NOREPLACE - RENAME_EXCHANGE - RENAME_WHITEOUT - + RENAME_NOREPLACE + RENAME_EXCHANGE + RENAME_WHITEOUT + 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 a4d329d1..29d67f3a 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 @@ -5,21 +5,22 @@ import org.cryptomator.jfuse.linux.aarch64.extr.fuse_fill_dir_t; import org.cryptomator.jfuse.linux.aarch64.extr.stat; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; import java.util.function.Consumer; -record DirFillerImpl(MemoryAddress buf, fuse_fill_dir_t callback, MemorySession scope) implements DirFiller { +record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller { - DirFillerImpl(MemoryAddress buf, MemoryAddress callback, MemorySession scope) { - this(buf, fuse_fill_dir_t.ofAddress(callback, scope), scope); + DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { + this(buf, fuse_fill_dir_t.ofAddress(callback, arena.scope()), arena); } @Override public int fill(String name, Consumer statFiller, long offset, int flags) { - var statSegment = stat.allocate(scope); + var statSegment = stat.allocate(arena); statFiller.accept(new StatImpl(statSegment)); - return callback.apply(buf, scope.allocateUtf8String(name).address(), statSegment.address(), offset, flags); + return callback.apply(buf, arena.allocateUtf8String(name), statSegment, offset, flags); } } \ No newline at end of file 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 e782b36b..5b8dc84c 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 @@ -4,9 +4,8 @@ import org.cryptomator.jfuse.linux.aarch64.extr.fcntl_h; import org.cryptomator.jfuse.linux.aarch64.extr.fuse_file_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -23,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(MemoryAddress address, MemorySession scope) { + public FileInfoImpl(MemorySegment address, SegmentScope 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 f3257dda..b4876e90 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 @@ -3,7 +3,6 @@ import org.cryptomator.jfuse.linux.aarch64.extr.fuse_args; import org.cryptomator.jfuse.linux.aarch64.extr.fuse_cmdline_opts; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -15,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, i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } sb.append("mountPoint = ").append(mountPoint().getUtf8String(0)); @@ -24,7 +23,7 @@ public String toString() { return sb.toString(); } - public MemoryAddress mountPoint() { + public MemorySegment mountPoint() { return fuse_cmdline_opts.mountpoint$get(cmdLineOpts); } 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 14641764..4d7e3d57 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConfig; import org.cryptomator.jfuse.linux.aarch64.extr.fuse_config; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConfigImpl(MemorySegment segment) implements FuseConfig { - public FuseConfigImpl(MemoryAddress address, MemorySession scope) { + public FuseConfigImpl(MemorySegment address, SegmentScope 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 91be8363..68784682 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.linux.aarch64.extr.fuse_conn_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemoryAddress address, MemorySession scope) { + public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) { this(fuse_conn_info.ofAddress(address, scope)); } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseFunctions.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseFunctions.java index bafc8238..52cada82 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseFunctions.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/FuseFunctions.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.aarch64; -import java.lang.foreign.Addressable; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.Linker; +import java.lang.foreign.MemorySegment; import java.lang.foreign.SymbolLookup; import java.lang.invoke.MethodHandle; @@ -24,7 +24,7 @@ class FuseFunctions { private FuseFunctions() { var lookup = SymbolLookup.loaderLookup(); var linker = Linker.nativeLinker(); - this.fuse_parse_cmdline = lookup.lookup("fuse_parse_cmdline") + this.fuse_parse_cmdline = lookup.find("fuse_parse_cmdline") .map(symbol -> linker.downcallHandle(symbol, FUSE_PARSE_CMDLINE)) .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol fuse_parse_cmdline")); } @@ -33,7 +33,7 @@ private static class Holder { private static final FuseFunctions INSTANCE = new FuseFunctions(); } - public static int fuse_parse_cmdline(Addressable args, Addressable opts) { + public static int fuse_parse_cmdline(MemorySegment args, MemorySegment opts) { try { return (int) Holder.INSTANCE.fuse_parse_cmdline.invokeExact(args, opts); } catch (Throwable e) { 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 6a359585..cb1aca45 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 @@ -3,8 +3,8 @@ import org.cryptomator.jfuse.api.Fuse; import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -13,11 +13,8 @@ import org.cryptomator.jfuse.linux.aarch64.extr.timespec; import org.jetbrains.annotations.VisibleForTesting; -import java.lang.foreign.Addressable; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemoryLayout; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.util.List; @@ -30,8 +27,8 @@ public FuseImpl(FuseOperations fuseOperations) { @Override protected FuseMount mount(List args) throws FuseMountFailedException { var fuseArgs = parseArgs(args); - var fuse = fuse_h.fuse_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL); - if (MemoryAddress.NULL.equals(fuse)) { + var fuse = fuse_h.fuse_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemorySegment.NULL); + if (MemorySegment.NULL.equals(fuse)) { throw new FuseMountFailedException("fuse_new failed"); } if (fuse_h.fuse_mount(fuse, fuseArgs.mountPoint()) != 0) { @@ -49,9 +46,9 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { var cString = fuseScope.allocateUtf8String(cmdLineArgs.get(i)); argv.setAtIndex(ValueLayout.ADDRESS, i, cString); } - argv.setAtIndex(ValueLayout.ADDRESS, argc, MemoryAddress.NULL); + argv.setAtIndex(ValueLayout.ADDRESS, argc, MemorySegment.NULL); fuse_args.argc$set(args, argc); - fuse_args.argv$set(args, argv.address()); + fuse_args.argv$set(args, argv); fuse_args.allocated$set(args, 0); var opts = fuse_cmdline_opts.allocate(fuseScope); @@ -69,231 +66,232 @@ 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, fuseScope).address()); - case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseScope).address()); - case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseScope).address()); - case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseScope).address()); - case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseScope).address()); - case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseScope).address()); - case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseScope).address()); - case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseScope).address()); - case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseScope).address()); - case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope).address()); - case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseScope).address()); - case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseScope).address()); - case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseScope).address()); - case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseScope).address()); - case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseScope).address()); - case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseScope).address()); - case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseScope).address()); - case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseScope).address()); - case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseScope).address()); - case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseScope).address()); - case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseScope).address()); - case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseScope).address()); - case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseScope).address()); - case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseScope).address()); - case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseScope).address()); - case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseScope).address()); - case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope).address()); - case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseScope).address()); - case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseScope).address()); - case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseScope).address()); + case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseScope.scope())); + case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseScope.scope())); + case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseScope.scope())); + case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseScope.scope())); + case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseScope.scope())); + case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseScope.scope())); + case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseScope.scope())); + case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseScope.scope())); + case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseScope.scope())); + case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope.scope())); + case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseScope.scope())); + case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseScope.scope())); + case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseScope.scope())); + case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseScope.scope())); + case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseScope.scope())); + case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseScope.scope())); + case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseScope.scope())); + case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseScope.scope())); + case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseScope.scope())); + case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseScope.scope())); + case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseScope.scope())); + case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseScope.scope())); + case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseScope.scope())); + case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseScope.scope())); + case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseScope.scope())); + case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseScope.scope())); + case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope.scope())); + case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseScope.scope())); + case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseScope.scope())); + case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseScope.scope())); } } @VisibleForTesting - Addressable init(MemoryAddress conn, MemoryAddress cfg) { - try (var scope = MemorySession.openConfined()) { - var connInfo = new FuseConnInfoImpl(conn, scope); + MemorySegment init(MemorySegment conn, MemorySegment cfg) { + try (var arena = Arena.openConfined()) { + var connInfo = new FuseConnInfoImpl(conn, arena.scope()); connInfo.setWant(connInfo.want() | FuseConnInfo.FUSE_CAP_READDIRPLUS); - var config = new FuseConfigImpl(cfg, scope); + var config = new FuseConfigImpl(cfg, arena.scope()); fuseOperations.init(connInfo, config); } - return MemoryAddress.NULL; + return MemorySegment.NULL; } - private int access(MemoryAddress path, int mask) { + private int access(MemorySegment path, int mask) { return fuseOperations.access(path.getUtf8String(0), mask); } - private int chmod(MemoryAddress path, int mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int chown(MemoryAddress path, int uid, int gid, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, scope)); + 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())); } } - private int create(MemoryAddress path, int mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } - private void destroy(MemoryAddress addr) { + private void destroy(MemorySegment addr) { fuseOperations.destroy(); } @VisibleForTesting - int flush(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + int flush(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } @VisibleForTesting - int fsync(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int fsyncdir(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } - private int getattr(MemoryAddress path, MemoryAddress stat, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, scope), new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int getxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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); } } @VisibleForTesting - int setxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer(), flags); + 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); } } @VisibleForTesting - int listxattr(MemoryAddress path, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.listxattr(path.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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); } } @VisibleForTesting - int removexattr(MemoryAddress path, MemoryAddress name) { + int removexattr(MemorySegment path, MemorySegment name) { return fuseOperations.removexattr(path.getUtf8String(0), name.getUtf8String(0)); } - private int mkdir(MemoryAddress path, int mode) { + private int mkdir(MemorySegment path, int mode) { return fuseOperations.mkdir(path.getUtf8String(0), mode); } - private int open(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int open(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int opendir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int opendir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int read(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } - private int readdir(MemoryAddress path, MemoryAddress buf, MemoryAddress filler, long offset, MemoryAddress fi, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, scope), offset, new FileInfoImpl(fi, scope), flags); + 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); } } - private int readlink(MemoryAddress path, MemoryAddress buf, long len) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, len, scope).asByteBuffer(); + 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); } } - private int release(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int release(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int releasedir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int releasedir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int rename(MemoryAddress oldpath, MemoryAddress newpath, int flags) { + private int rename(MemorySegment oldpath, MemorySegment newpath, int flags) { return fuseOperations.rename(oldpath.getUtf8String(0), newpath.getUtf8String(0), flags); } - private int rmdir(MemoryAddress path) { + private int rmdir(MemorySegment path) { return fuseOperations.rmdir(path.getUtf8String(0)); } - private int statfs(MemoryAddress path, MemoryAddress statvfs) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, scope)); + private int statfs(MemorySegment path, MemorySegment statvfs) { + try (var arena = Arena.openConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); } } - private int symlink(MemoryAddress linkname, MemoryAddress target) { + private int symlink(MemorySegment linkname, MemorySegment target) { return fuseOperations.symlink(linkname.getUtf8String(0), target.getUtf8String(0)); } - private int truncate(MemoryAddress path, long size, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, scope)); + 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())); } } - private int unlink(MemoryAddress path) { + private int unlink(MemorySegment path) { return fuseOperations.unlink(path.getUtf8String(0)); } @VisibleForTesting - int utimens(MemoryAddress path, MemoryAddress times, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - if (MemoryAddress.NULL.equals(times)) { + int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + if (MemorySegment.NULL.equals(times)) { // set both times to current time (using on-heap memory segments) - var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), scope); + var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), arena.scope()); 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, scope)); + return fuseOperations.utimens(path.getUtf8String(0), time, time, new FileInfoImpl(fi, arena.scope())); } else { - var seq = MemoryLayout.sequenceLayout(2, timespec.$LAYOUT()); - var segment = MemorySegment.ofAddress(times, seq.byteSize(), scope); - var time0 = segment.asSlice(0, timespec.$LAYOUT().byteSize()); - var time1 = segment.asSlice(timespec.$LAYOUT().byteSize(), timespec.$LAYOUT().byteSize()); - return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, scope)); + 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())); } } } - private int write(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } 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 6caeeda0..6d464cd2 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 @@ -4,10 +4,10 @@ import org.cryptomator.jfuse.linux.aarch64.extr.fuse_h; import org.cryptomator.jfuse.linux.aarch64.extr.fuse_loop_config_v1; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; -record FuseMountImpl(MemoryAddress fuse, FuseArgs fuseArgs) implements FuseMount { +record FuseMountImpl(MemorySegment fuse, FuseArgs fuseArgs) implements FuseMount { private static final int FUSE_3_2 = 32; private static final int FUSE_3_12 = 312; @@ -20,8 +20,8 @@ public int loop() { return fuse_h.fuse_loop(fuse); } else if (fuse_h.fuse_version() < FUSE_3_12) { // FUSE 3.2 - try (var scope = MemorySession.openConfined()) { - var loopCfg = fuse_loop_config_v1.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); return fuse_h.fuse_loop_mt(fuse, loopCfg); 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 4ff547ce..80a201a8 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 @@ -5,13 +5,12 @@ import org.cryptomator.jfuse.api.TimeSpec; import org.cryptomator.jfuse.linux.aarch64.extr.stat; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemoryAddress address, MemorySession scope) { + public StatImpl(MemorySegment address, SegmentScope 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 088422fd..6f0c9bd5 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.Statvfs; import org.cryptomator.jfuse.linux.aarch64.extr.statvfs; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemoryAddress address, MemorySession scope) { + public StatvfsImpl(MemorySegment address, SegmentScope scope) { this(statvfs.ofAddress(address, scope)); } 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 index b88d269d..16f3a77f 100644 --- 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 @@ -7,17 +7,19 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -public class Constants$root { +final class 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.withBitAlignment(16); - static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfLong C_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); + // 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/RuntimeHelper.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/RuntimeHelper.java index a3dca24c..49c02a4f 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/RuntimeHelper.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/RuntimeHelper.java @@ -1,15 +1,13 @@ package org.cryptomator.jfuse.linux.aarch64.extr; // Generated by jextract -import java.lang.foreign.Addressable; import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; import java.lang.foreign.SymbolLookup; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -27,21 +25,24 @@ final class RuntimeHelper { - private RuntimeHelper() {} - private final static Linker LINKER = Linker.nativeLinker(); - private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); - private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); - private final static SymbolLookup SYMBOL_LOOKUP; + 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"); }; final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); + (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); static { SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); + 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); @@ -49,45 +50,43 @@ static T requireNonNull(T obj, String symbolName) { return obj; } - private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; - - static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } - static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } - static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { return LINKER.downcallHandle(fdesc); } - static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { + static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, session); + return LINKER.upcallStub(handle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { - return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); } // Internals only below this point - private static class VarargsInvoker { + private static final class VarargsInvoker { private static final MethodHandle INVOKE_MH; private final MemorySegment symbol; private final FunctionDescriptor function; @@ -113,7 +112,9 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { mtype = mtype.appendParameterTypes(carrier(layout, false)); } mtype = mtype.appendParameterTypes(Object[].class); - if (mtype.returnType().equals(MemorySegment.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); @@ -123,8 +124,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { static Class carrier(MemoryLayout layout, boolean ret) { if (layout instanceof ValueLayout valueLayout) { - return (ret || valueLayout.carrier() != MemoryAddress.class) ? - valueLayout.carrier() : Addressable.class; + return valueLayout.carrier(); } else if (layout instanceof GroupLayout) { return MemorySegment.class; } else { @@ -159,7 +159,9 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.ofVoid(argLayouts) : FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); - if (mh.type().returnType() == MemorySegment.class) { + 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 @@ -209,10 +211,7 @@ private Class normalize(Class c) { if (c.isPrimitive()) { return promote(c); } - if (MemoryAddress.class.isAssignableFrom(c)) { - return MemoryAddress.class; - } - if (MemorySegment.class.isAssignableFrom(c)) { + if (c == MemorySegment.class) { return MemorySegment.class; } throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); @@ -223,7 +222,7 @@ private MemoryLayout variadicLayout(Class c) { return JAVA_LONG; } else if (c == double.class) { return JAVA_DOUBLE; - } else if (MemoryAddress.class.isAssignableFrom(c)) { + } 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/constants$0.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/constants$0.java index 0a84d9c3..937be913 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$0 { +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", 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 index 056d3622..e98767b7 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$1 { +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, 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 index 5020cf17..ecf675c6 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$2 { +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 ); diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java index 844b540b..2276b805 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/errno_h.java @@ -9,60 +9,139 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - /* package-private */ errno_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 ENOENT 2 + * } + */ public static int ENOENT() { return (int)2L; } + /** + * {@snippet : + * #define EIO 5 + * } + */ public static int EIO() { return (int)5L; } + /** + * {@snippet : + * #define EBADF 9 + * } + */ public static int EBADF() { return (int)9L; } + /** + * {@snippet : + * #define ENOMEM 12 + * } + */ public static int ENOMEM() { return (int)12L; } + /** + * {@snippet : + * #define EACCES 13 + * } + */ public static int EACCES() { return (int)13L; } + /** + * {@snippet : + * #define EEXIST 17 + * } + */ public static int EEXIST() { return (int)17L; } + /** + * {@snippet : + * #define ENOTDIR 20 + * } + */ public static int ENOTDIR() { return (int)20L; } + /** + * {@snippet : + * #define EISDIR 21 + * } + */ public static int EISDIR() { return (int)21L; } + /** + * {@snippet : + * #define EINVAL 22 + * } + */ public static int EINVAL() { return (int)22L; } + /** + * {@snippet : + * #define EROFS 30 + * } + */ public static int EROFS() { return (int)30L; } + /** + * {@snippet : + * #define ERANGE 34 + * } + */ public static int ERANGE() { return (int)34L; } + /** + * {@snippet : + * #define ENAMETOOLONG 36 + * } + */ public static int ENAMETOOLONG() { return (int)36L; } + /** + * {@snippet : + * #define ENOLCK 37 + * } + */ public static int ENOLCK() { return (int)37L; } + /** + * {@snippet : + * #define ENOSYS 38 + * } + */ public static int ENOSYS() { return (int)38L; } + /** + * {@snippet : + * #define ENOTEMPTY 39 + * } + */ public static int ENOTEMPTY() { return (int)39L; } + /** + * {@snippet : + * #define ENOTSUP 95 + * } + */ public static int ENOTSUP() { return (int)95L; } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java index fb3a269b..4f896dd5 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fcntl_h.java @@ -9,39 +9,83 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - /* package-private */ fcntl_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 O_RDONLY 0 + * } + */ public static int O_RDONLY() { return (int)0L; } + /** + * {@snippet : + * #define O_WRONLY 1 + * } + */ public static int O_WRONLY() { return (int)1L; } + /** + * {@snippet : + * #define O_RDWR 2 + * } + */ public static int O_RDWR() { return (int)2L; } + /** + * {@snippet : + * #define O_CREAT 64 + * } + */ public static int O_CREAT() { return (int)64L; } + /** + * {@snippet : + * #define O_EXCL 128 + * } + */ public static int O_EXCL() { return (int)128L; } + /** + * {@snippet : + * #define O_TRUNC 512 + * } + */ public static int O_TRUNC() { return (int)512L; } + /** + * {@snippet : + * #define O_APPEND 1024 + * } + */ public static int O_APPEND() { return (int)1024L; } + /** + * {@snippet : + * #define O_SYNC 1052672 + * } + */ public static int O_SYNC() { return (int)1052672L; } + /** + * {@snippet : + * #define O_DSYNC 4096 + * } + */ public static int O_DSYNC() { return (int)4096L; } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java index 6cc3f68c..97103c5b 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_args.java @@ -7,9 +7,18 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_args { + * int argc; + * char** argv; + * int allocated; + * }; + * } + */ public class fuse_args { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_INT$LAYOUT.withName("argc"), MemoryLayout.paddingLayout(32), Constants$root.C_POINTER$LAYOUT.withName("argv"), @@ -23,10 +32,22 @@ public class fuse_args { public static VarHandle argc$VH() { return fuse_args.argc$VH; } + /** + * Getter for field: + * {@snippet : + * int argc; + * } + */ public static int argc$get(MemorySegment seg) { return (int)fuse_args.argc$VH.get(seg); } - public static void argc$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int argc; + * } + */ + public static void argc$set(MemorySegment seg, int x) { fuse_args.argc$VH.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { @@ -39,26 +60,50 @@ public class fuse_args { public static VarHandle argv$VH() { return fuse_args.argv$VH; } - public static MemoryAddress argv$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg); - } - public static void argv$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char** argv; + * } + */ + public static MemorySegment argv$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char** argv; + * } + */ + public static void argv$set(MemorySegment seg, MemorySegment x) { fuse_args.argv$VH.set(seg, x); } - public static MemoryAddress argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment argv$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); } - public static void argv$set(MemorySegment seg, long index, MemoryAddress x) { + public static void argv$set(MemorySegment seg, long index, MemorySegment x) { fuse_args.argv$VH.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; } + /** + * Getter for field: + * {@snippet : + * int allocated; + * } + */ public static int allocated$get(MemorySegment seg) { return (int)fuse_args.allocated$VH.get(seg); } - public static void allocated$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int allocated; + * } + */ + public static void allocated$set(MemorySegment seg, int x) { fuse_args.allocated$VH.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { @@ -69,10 +114,10 @@ public class fuse_args { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_cmdline_opts.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_cmdline_opts.java index 9199946b..08c4f18e 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_cmdline_opts.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_cmdline_opts.java @@ -7,9 +7,25 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_cmdline_opts { + * int singlethread; + * int foreground; + * int debug; + * int nodefault_subtype; + * char* mountpoint; + * int show_version; + * int show_help; + * int clone_fd; + * unsigned int max_idle_threads; + * unsigned int max_threads; + * }; + * } + */ public class fuse_cmdline_opts { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -29,10 +45,22 @@ public class fuse_cmdline_opts { public static VarHandle singlethread$VH() { return fuse_cmdline_opts.singlethread$VH; } + /** + * Getter for field: + * {@snippet : + * int singlethread; + * } + */ public static int singlethread$get(MemorySegment seg) { return (int)fuse_cmdline_opts.singlethread$VH.get(seg); } - public static void singlethread$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int singlethread; + * } + */ + public static void singlethread$set(MemorySegment seg, int x) { fuse_cmdline_opts.singlethread$VH.set(seg, x); } public static int singlethread$get(MemorySegment seg, long index) { @@ -45,10 +73,22 @@ public class fuse_cmdline_opts { public static VarHandle foreground$VH() { return fuse_cmdline_opts.foreground$VH; } + /** + * Getter for field: + * {@snippet : + * int foreground; + * } + */ public static int foreground$get(MemorySegment seg) { return (int)fuse_cmdline_opts.foreground$VH.get(seg); } - public static void foreground$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int foreground; + * } + */ + public static void foreground$set(MemorySegment seg, int x) { fuse_cmdline_opts.foreground$VH.set(seg, x); } public static int foreground$get(MemorySegment seg, long index) { @@ -61,10 +101,22 @@ public class fuse_cmdline_opts { public static VarHandle debug$VH() { return fuse_cmdline_opts.debug$VH; } + /** + * Getter for field: + * {@snippet : + * int debug; + * } + */ public static int debug$get(MemorySegment seg) { return (int)fuse_cmdline_opts.debug$VH.get(seg); } - public static void debug$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int debug; + * } + */ + public static void debug$set(MemorySegment seg, int x) { fuse_cmdline_opts.debug$VH.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { @@ -77,10 +129,22 @@ public class fuse_cmdline_opts { public static VarHandle nodefault_subtype$VH() { return fuse_cmdline_opts.nodefault_subtype$VH; } + /** + * Getter for field: + * {@snippet : + * int nodefault_subtype; + * } + */ public static int nodefault_subtype$get(MemorySegment seg) { return (int)fuse_cmdline_opts.nodefault_subtype$VH.get(seg); } - public static void nodefault_subtype$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int nodefault_subtype; + * } + */ + public static void nodefault_subtype$set(MemorySegment seg, int x) { fuse_cmdline_opts.nodefault_subtype$VH.set(seg, x); } public static int nodefault_subtype$get(MemorySegment seg, long index) { @@ -93,26 +157,50 @@ public class fuse_cmdline_opts { public static VarHandle mountpoint$VH() { return fuse_cmdline_opts.mountpoint$VH; } - public static MemoryAddress mountpoint$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_cmdline_opts.mountpoint$VH.get(seg); - } - public static void mountpoint$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char* mountpoint; + * } + */ + public static MemorySegment mountpoint$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char* mountpoint; + * } + */ + public static void mountpoint$set(MemorySegment seg, MemorySegment x) { fuse_cmdline_opts.mountpoint$VH.set(seg, x); } - public static MemoryAddress mountpoint$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_cmdline_opts.mountpoint$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment mountpoint$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg.asSlice(index*sizeof())); } - public static void mountpoint$set(MemorySegment seg, long index, MemoryAddress x) { + public static void mountpoint$set(MemorySegment seg, long index, MemorySegment x) { fuse_cmdline_opts.mountpoint$VH.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; } + /** + * Getter for field: + * {@snippet : + * int show_version; + * } + */ public static int show_version$get(MemorySegment seg) { return (int)fuse_cmdline_opts.show_version$VH.get(seg); } - public static void show_version$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_version; + * } + */ + public static void show_version$set(MemorySegment seg, int x) { fuse_cmdline_opts.show_version$VH.set(seg, x); } public static int show_version$get(MemorySegment seg, long index) { @@ -125,10 +213,22 @@ public class fuse_cmdline_opts { public static VarHandle show_help$VH() { return fuse_cmdline_opts.show_help$VH; } + /** + * Getter for field: + * {@snippet : + * int show_help; + * } + */ public static int show_help$get(MemorySegment seg) { return (int)fuse_cmdline_opts.show_help$VH.get(seg); } - public static void show_help$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_help; + * } + */ + public static void show_help$set(MemorySegment seg, int x) { fuse_cmdline_opts.show_help$VH.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { @@ -141,10 +241,22 @@ public class fuse_cmdline_opts { public static VarHandle clone_fd$VH() { return fuse_cmdline_opts.clone_fd$VH; } + /** + * Getter for field: + * {@snippet : + * int clone_fd; + * } + */ public static int clone_fd$get(MemorySegment seg) { return (int)fuse_cmdline_opts.clone_fd$VH.get(seg); } - public static void clone_fd$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int clone_fd; + * } + */ + public static void clone_fd$set(MemorySegment seg, int x) { fuse_cmdline_opts.clone_fd$VH.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { @@ -157,10 +269,22 @@ public class fuse_cmdline_opts { public static VarHandle max_idle_threads$VH() { return fuse_cmdline_opts.max_idle_threads$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ public static int max_idle_threads$get(MemorySegment seg) { return (int)fuse_cmdline_opts.max_idle_threads$VH.get(seg); } - public static void max_idle_threads$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ + public static void max_idle_threads$set(MemorySegment seg, int x) { fuse_cmdline_opts.max_idle_threads$VH.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { @@ -173,10 +297,22 @@ public class fuse_cmdline_opts { public static VarHandle max_threads$VH() { return fuse_cmdline_opts.max_threads$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_threads; + * } + */ public static int max_threads$get(MemorySegment seg) { return (int)fuse_cmdline_opts.max_threads$VH.get(seg); } - public static void max_threads$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_threads; + * } + */ + public static void max_threads$set(MemorySegment seg, int x) { fuse_cmdline_opts.max_threads$VH.set(seg, x); } public static int max_threads$get(MemorySegment seg, long index) { @@ -187,10 +323,10 @@ public class fuse_cmdline_opts { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_config.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_config.java index 0711943c..34efb8e9 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_config.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_config.java @@ -7,9 +7,40 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_config { + * int set_gid; + * unsigned int gid; + * int set_uid; + * unsigned int uid; + * int set_mode; + * unsigned int umask; + * double entry_timeout; + * double negative_timeout; + * double attr_timeout; + * int intr; + * int intr_signal; + * int remember; + * int hard_remove; + * int use_ino; + * int readdir_ino; + * int direct_io; + * int kernel_cache; + * int auto_cache; + * int no_rofd_flush; + * int ac_attr_timeout_set; + * double ac_attr_timeout; + * int nullpath_ok; + * int show_help; + * char* modules; + * int debug; + * }; + * } + */ public class fuse_config { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -45,10 +76,22 @@ public class fuse_config { public static VarHandle set_gid$VH() { return fuse_config.set_gid$VH; } + /** + * Getter for field: + * {@snippet : + * int set_gid; + * } + */ public static int set_gid$get(MemorySegment seg) { return (int)fuse_config.set_gid$VH.get(seg); } - public static void set_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_gid; + * } + */ + public static void set_gid$set(MemorySegment seg, int x) { fuse_config.set_gid$VH.set(seg, x); } public static int set_gid$get(MemorySegment seg, long index) { @@ -61,10 +104,22 @@ public class fuse_config { public static VarHandle gid$VH() { return fuse_config.gid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int gid; + * } + */ public static int gid$get(MemorySegment seg) { return (int)fuse_config.gid$VH.get(seg); } - public static void gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int gid; + * } + */ + public static void gid$set(MemorySegment seg, int x) { fuse_config.gid$VH.set(seg, x); } public static int gid$get(MemorySegment seg, long index) { @@ -77,10 +132,22 @@ public class fuse_config { public static VarHandle set_uid$VH() { return fuse_config.set_uid$VH; } + /** + * Getter for field: + * {@snippet : + * int set_uid; + * } + */ public static int set_uid$get(MemorySegment seg) { return (int)fuse_config.set_uid$VH.get(seg); } - public static void set_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_uid; + * } + */ + public static void set_uid$set(MemorySegment seg, int x) { fuse_config.set_uid$VH.set(seg, x); } public static int set_uid$get(MemorySegment seg, long index) { @@ -93,10 +160,22 @@ public class fuse_config { public static VarHandle uid$VH() { return fuse_config.uid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int uid; + * } + */ public static int uid$get(MemorySegment seg) { return (int)fuse_config.uid$VH.get(seg); } - public static void uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int uid; + * } + */ + public static void uid$set(MemorySegment seg, int x) { fuse_config.uid$VH.set(seg, x); } public static int uid$get(MemorySegment seg, long index) { @@ -109,10 +188,22 @@ public class fuse_config { public static VarHandle set_mode$VH() { return fuse_config.set_mode$VH; } + /** + * Getter for field: + * {@snippet : + * int set_mode; + * } + */ public static int set_mode$get(MemorySegment seg) { return (int)fuse_config.set_mode$VH.get(seg); } - public static void set_mode$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_mode; + * } + */ + public static void set_mode$set(MemorySegment seg, int x) { fuse_config.set_mode$VH.set(seg, x); } public static int set_mode$get(MemorySegment seg, long index) { @@ -125,10 +216,22 @@ public class fuse_config { public static VarHandle umask$VH() { return fuse_config.umask$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int umask; + * } + */ public static int umask$get(MemorySegment seg) { return (int)fuse_config.umask$VH.get(seg); } - public static void umask$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int umask; + * } + */ + public static void umask$set(MemorySegment seg, int x) { fuse_config.umask$VH.set(seg, x); } public static int umask$get(MemorySegment seg, long index) { @@ -141,10 +244,22 @@ public class fuse_config { public static VarHandle entry_timeout$VH() { return fuse_config.entry_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double entry_timeout; + * } + */ public static double entry_timeout$get(MemorySegment seg) { return (double)fuse_config.entry_timeout$VH.get(seg); } - public static void entry_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double entry_timeout; + * } + */ + public static void entry_timeout$set(MemorySegment seg, double x) { fuse_config.entry_timeout$VH.set(seg, x); } public static double entry_timeout$get(MemorySegment seg, long index) { @@ -157,10 +272,22 @@ public class fuse_config { public static VarHandle negative_timeout$VH() { return fuse_config.negative_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double negative_timeout; + * } + */ public static double negative_timeout$get(MemorySegment seg) { return (double)fuse_config.negative_timeout$VH.get(seg); } - public static void negative_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double negative_timeout; + * } + */ + public static void negative_timeout$set(MemorySegment seg, double x) { fuse_config.negative_timeout$VH.set(seg, x); } public static double negative_timeout$get(MemorySegment seg, long index) { @@ -173,10 +300,22 @@ public class fuse_config { public static VarHandle attr_timeout$VH() { return fuse_config.attr_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double attr_timeout; + * } + */ public static double attr_timeout$get(MemorySegment seg) { return (double)fuse_config.attr_timeout$VH.get(seg); } - public static void attr_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double attr_timeout; + * } + */ + public static void attr_timeout$set(MemorySegment seg, double x) { fuse_config.attr_timeout$VH.set(seg, x); } public static double attr_timeout$get(MemorySegment seg, long index) { @@ -189,10 +328,22 @@ public class fuse_config { public static VarHandle intr$VH() { return fuse_config.intr$VH; } + /** + * Getter for field: + * {@snippet : + * int intr; + * } + */ public static int intr$get(MemorySegment seg) { return (int)fuse_config.intr$VH.get(seg); } - public static void intr$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int intr; + * } + */ + public static void intr$set(MemorySegment seg, int x) { fuse_config.intr$VH.set(seg, x); } public static int intr$get(MemorySegment seg, long index) { @@ -205,10 +356,22 @@ public class fuse_config { public static VarHandle intr_signal$VH() { return fuse_config.intr_signal$VH; } + /** + * Getter for field: + * {@snippet : + * int intr_signal; + * } + */ public static int intr_signal$get(MemorySegment seg) { return (int)fuse_config.intr_signal$VH.get(seg); } - public static void intr_signal$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int intr_signal; + * } + */ + public static void intr_signal$set(MemorySegment seg, int x) { fuse_config.intr_signal$VH.set(seg, x); } public static int intr_signal$get(MemorySegment seg, long index) { @@ -221,10 +384,22 @@ public class fuse_config { public static VarHandle remember$VH() { return fuse_config.remember$VH; } + /** + * Getter for field: + * {@snippet : + * int remember; + * } + */ public static int remember$get(MemorySegment seg) { return (int)fuse_config.remember$VH.get(seg); } - public static void remember$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int remember; + * } + */ + public static void remember$set(MemorySegment seg, int x) { fuse_config.remember$VH.set(seg, x); } public static int remember$get(MemorySegment seg, long index) { @@ -237,10 +412,22 @@ public class fuse_config { public static VarHandle hard_remove$VH() { return fuse_config.hard_remove$VH; } + /** + * Getter for field: + * {@snippet : + * int hard_remove; + * } + */ public static int hard_remove$get(MemorySegment seg) { return (int)fuse_config.hard_remove$VH.get(seg); } - public static void hard_remove$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int hard_remove; + * } + */ + public static void hard_remove$set(MemorySegment seg, int x) { fuse_config.hard_remove$VH.set(seg, x); } public static int hard_remove$get(MemorySegment seg, long index) { @@ -253,10 +440,22 @@ public class fuse_config { public static VarHandle use_ino$VH() { return fuse_config.use_ino$VH; } + /** + * Getter for field: + * {@snippet : + * int use_ino; + * } + */ public static int use_ino$get(MemorySegment seg) { return (int)fuse_config.use_ino$VH.get(seg); } - public static void use_ino$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int use_ino; + * } + */ + public static void use_ino$set(MemorySegment seg, int x) { fuse_config.use_ino$VH.set(seg, x); } public static int use_ino$get(MemorySegment seg, long index) { @@ -269,10 +468,22 @@ public class fuse_config { public static VarHandle readdir_ino$VH() { return fuse_config.readdir_ino$VH; } + /** + * Getter for field: + * {@snippet : + * int readdir_ino; + * } + */ public static int readdir_ino$get(MemorySegment seg) { return (int)fuse_config.readdir_ino$VH.get(seg); } - public static void readdir_ino$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int readdir_ino; + * } + */ + public static void readdir_ino$set(MemorySegment seg, int x) { fuse_config.readdir_ino$VH.set(seg, x); } public static int readdir_ino$get(MemorySegment seg, long index) { @@ -285,10 +496,22 @@ public class fuse_config { public static VarHandle direct_io$VH() { return fuse_config.direct_io$VH; } + /** + * Getter for field: + * {@snippet : + * int direct_io; + * } + */ public static int direct_io$get(MemorySegment seg) { return (int)fuse_config.direct_io$VH.get(seg); } - public static void direct_io$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int direct_io; + * } + */ + public static void direct_io$set(MemorySegment seg, int x) { fuse_config.direct_io$VH.set(seg, x); } public static int direct_io$get(MemorySegment seg, long index) { @@ -301,10 +524,22 @@ public class fuse_config { public static VarHandle kernel_cache$VH() { return fuse_config.kernel_cache$VH; } + /** + * Getter for field: + * {@snippet : + * int kernel_cache; + * } + */ public static int kernel_cache$get(MemorySegment seg) { return (int)fuse_config.kernel_cache$VH.get(seg); } - public static void kernel_cache$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int kernel_cache; + * } + */ + public static void kernel_cache$set(MemorySegment seg, int x) { fuse_config.kernel_cache$VH.set(seg, x); } public static int kernel_cache$get(MemorySegment seg, long index) { @@ -317,10 +552,22 @@ public class fuse_config { public static VarHandle auto_cache$VH() { return fuse_config.auto_cache$VH; } + /** + * Getter for field: + * {@snippet : + * int auto_cache; + * } + */ public static int auto_cache$get(MemorySegment seg) { return (int)fuse_config.auto_cache$VH.get(seg); } - public static void auto_cache$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int auto_cache; + * } + */ + public static void auto_cache$set(MemorySegment seg, int x) { fuse_config.auto_cache$VH.set(seg, x); } public static int auto_cache$get(MemorySegment seg, long index) { @@ -333,10 +580,22 @@ public class fuse_config { public static VarHandle no_rofd_flush$VH() { return fuse_config.no_rofd_flush$VH; } + /** + * Getter for field: + * {@snippet : + * int no_rofd_flush; + * } + */ public static int no_rofd_flush$get(MemorySegment seg) { return (int)fuse_config.no_rofd_flush$VH.get(seg); } - public static void no_rofd_flush$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int no_rofd_flush; + * } + */ + public static void no_rofd_flush$set(MemorySegment seg, int x) { fuse_config.no_rofd_flush$VH.set(seg, x); } public static int no_rofd_flush$get(MemorySegment seg, long index) { @@ -349,10 +608,22 @@ public class fuse_config { public static VarHandle ac_attr_timeout_set$VH() { return fuse_config.ac_attr_timeout_set$VH; } + /** + * Getter for field: + * {@snippet : + * int ac_attr_timeout_set; + * } + */ public static int ac_attr_timeout_set$get(MemorySegment seg) { return (int)fuse_config.ac_attr_timeout_set$VH.get(seg); } - public static void ac_attr_timeout_set$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int ac_attr_timeout_set; + * } + */ + public static void ac_attr_timeout_set$set(MemorySegment seg, int x) { fuse_config.ac_attr_timeout_set$VH.set(seg, x); } public static int ac_attr_timeout_set$get(MemorySegment seg, long index) { @@ -365,10 +636,22 @@ public class fuse_config { public static VarHandle ac_attr_timeout$VH() { return fuse_config.ac_attr_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double ac_attr_timeout; + * } + */ public static double ac_attr_timeout$get(MemorySegment seg) { return (double)fuse_config.ac_attr_timeout$VH.get(seg); } - public static void ac_attr_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double ac_attr_timeout; + * } + */ + public static void ac_attr_timeout$set(MemorySegment seg, double x) { fuse_config.ac_attr_timeout$VH.set(seg, x); } public static double ac_attr_timeout$get(MemorySegment seg, long index) { @@ -381,10 +664,22 @@ public class fuse_config { public static VarHandle nullpath_ok$VH() { return fuse_config.nullpath_ok$VH; } + /** + * Getter for field: + * {@snippet : + * int nullpath_ok; + * } + */ public static int nullpath_ok$get(MemorySegment seg) { return (int)fuse_config.nullpath_ok$VH.get(seg); } - public static void nullpath_ok$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int nullpath_ok; + * } + */ + public static void nullpath_ok$set(MemorySegment seg, int x) { fuse_config.nullpath_ok$VH.set(seg, x); } public static int nullpath_ok$get(MemorySegment seg, long index) { @@ -397,10 +692,22 @@ public class fuse_config { public static VarHandle show_help$VH() { return fuse_config.show_help$VH; } + /** + * Getter for field: + * {@snippet : + * int show_help; + * } + */ public static int show_help$get(MemorySegment seg) { return (int)fuse_config.show_help$VH.get(seg); } - public static void show_help$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_help; + * } + */ + public static void show_help$set(MemorySegment seg, int x) { fuse_config.show_help$VH.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { @@ -413,26 +720,50 @@ public class fuse_config { public static VarHandle modules$VH() { return fuse_config.modules$VH; } - public static MemoryAddress modules$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_config.modules$VH.get(seg); - } - public static void modules$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char* modules; + * } + */ + public static MemorySegment modules$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char* modules; + * } + */ + public static void modules$set(MemorySegment seg, MemorySegment x) { fuse_config.modules$VH.set(seg, x); } - public static MemoryAddress modules$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_config.modules$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment modules$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg.asSlice(index*sizeof())); } - public static void modules$set(MemorySegment seg, long index, MemoryAddress x) { + public static void modules$set(MemorySegment seg, long index, MemorySegment x) { fuse_config.modules$VH.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; } + /** + * Getter for field: + * {@snippet : + * int debug; + * } + */ public static int debug$get(MemorySegment seg) { return (int)fuse_config.debug$VH.get(seg); } - public static void debug$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int debug; + * } + */ + public static void debug$set(MemorySegment seg, int x) { fuse_config.debug$VH.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { @@ -443,10 +774,10 @@ public class fuse_config { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_conn_info.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_conn_info.java index d03be0f1..9b193291 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_conn_info.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_conn_info.java @@ -7,9 +7,26 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_conn_info { + * unsigned int proto_major; + * unsigned int proto_minor; + * unsigned int max_write; + * unsigned int max_read; + * unsigned int max_readahead; + * unsigned int capable; + * unsigned int want; + * unsigned int max_background; + * unsigned int congestion_threshold; + * unsigned int time_gran; + * unsigned int reserved[22]; + * }; + * } + */ public class fuse_conn_info { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -29,10 +46,22 @@ public class fuse_conn_info { public static VarHandle proto_major$VH() { return fuse_conn_info.proto_major$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ public static int proto_major$get(MemorySegment seg) { return (int)fuse_conn_info.proto_major$VH.get(seg); } - public static void proto_major$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ + public static void proto_major$set(MemorySegment seg, int x) { fuse_conn_info.proto_major$VH.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { @@ -45,10 +74,22 @@ public class fuse_conn_info { public static VarHandle proto_minor$VH() { return fuse_conn_info.proto_minor$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ public static int proto_minor$get(MemorySegment seg) { return (int)fuse_conn_info.proto_minor$VH.get(seg); } - public static void proto_minor$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ + public static void proto_minor$set(MemorySegment seg, int x) { fuse_conn_info.proto_minor$VH.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { @@ -61,10 +102,22 @@ public class fuse_conn_info { public static VarHandle max_write$VH() { return fuse_conn_info.max_write$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_write; + * } + */ public static int max_write$get(MemorySegment seg) { return (int)fuse_conn_info.max_write$VH.get(seg); } - public static void max_write$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_write; + * } + */ + public static void max_write$set(MemorySegment seg, int x) { fuse_conn_info.max_write$VH.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { @@ -77,10 +130,22 @@ public class fuse_conn_info { public static VarHandle max_read$VH() { return fuse_conn_info.max_read$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_read; + * } + */ public static int max_read$get(MemorySegment seg) { return (int)fuse_conn_info.max_read$VH.get(seg); } - public static void max_read$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_read; + * } + */ + public static void max_read$set(MemorySegment seg, int x) { fuse_conn_info.max_read$VH.set(seg, x); } public static int max_read$get(MemorySegment seg, long index) { @@ -93,10 +158,22 @@ public class fuse_conn_info { public static VarHandle max_readahead$VH() { return fuse_conn_info.max_readahead$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ public static int max_readahead$get(MemorySegment seg) { return (int)fuse_conn_info.max_readahead$VH.get(seg); } - public static void max_readahead$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ + public static void max_readahead$set(MemorySegment seg, int x) { fuse_conn_info.max_readahead$VH.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { @@ -109,10 +186,22 @@ public class fuse_conn_info { public static VarHandle capable$VH() { return fuse_conn_info.capable$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int capable; + * } + */ public static int capable$get(MemorySegment seg) { return (int)fuse_conn_info.capable$VH.get(seg); } - public static void capable$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int capable; + * } + */ + public static void capable$set(MemorySegment seg, int x) { fuse_conn_info.capable$VH.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { @@ -125,10 +214,22 @@ public class fuse_conn_info { public static VarHandle want$VH() { return fuse_conn_info.want$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int want; + * } + */ public static int want$get(MemorySegment seg) { return (int)fuse_conn_info.want$VH.get(seg); } - public static void want$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int want; + * } + */ + public static void want$set(MemorySegment seg, int x) { fuse_conn_info.want$VH.set(seg, x); } public static int want$get(MemorySegment seg, long index) { @@ -141,10 +242,22 @@ public class fuse_conn_info { public static VarHandle max_background$VH() { return fuse_conn_info.max_background$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_background; + * } + */ public static int max_background$get(MemorySegment seg) { return (int)fuse_conn_info.max_background$VH.get(seg); } - public static void max_background$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_background; + * } + */ + public static void max_background$set(MemorySegment seg, int x) { fuse_conn_info.max_background$VH.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { @@ -157,10 +270,22 @@ public class fuse_conn_info { public static VarHandle congestion_threshold$VH() { return fuse_conn_info.congestion_threshold$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ public static int congestion_threshold$get(MemorySegment seg) { return (int)fuse_conn_info.congestion_threshold$VH.get(seg); } - public static void congestion_threshold$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ + public static void congestion_threshold$set(MemorySegment seg, int x) { fuse_conn_info.congestion_threshold$VH.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { @@ -173,10 +298,22 @@ public class fuse_conn_info { public static VarHandle time_gran$VH() { return fuse_conn_info.time_gran$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int time_gran; + * } + */ public static int time_gran$get(MemorySegment seg) { return (int)fuse_conn_info.time_gran$VH.get(seg); } - public static void time_gran$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int time_gran; + * } + */ + public static void time_gran$set(MemorySegment seg, int x) { fuse_conn_info.time_gran$VH.set(seg, x); } public static int time_gran$get(MemorySegment seg, long index) { @@ -190,10 +327,10 @@ public class fuse_conn_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_file_info.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_file_info.java index 02ff4c6f..6fc89b7c 100644 --- 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 @@ -7,9 +7,29 @@ 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 GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_INT$LAYOUT.withName("flags"), MemoryLayout.structLayout( MemoryLayout.paddingLayout(1).withName("writepage"), @@ -36,10 +56,22 @@ public class fuse_file_info { 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); } - public static void flags$set( MemorySegment seg, int x) { + /** + * 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) { @@ -52,10 +84,22 @@ public class fuse_file_info { 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); } - public static void fh$set( MemorySegment seg, long x) { + /** + * 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) { @@ -68,10 +112,22 @@ public class fuse_file_info { 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); } - public static void lock_owner$set( MemorySegment seg, long x) { + /** + * 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) { @@ -84,10 +140,22 @@ public class fuse_file_info { 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); } - public static void poll_events$set( MemorySegment seg, int x) { + /** + * 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) { @@ -98,10 +166,10 @@ public class fuse_file_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_fill_dir_t.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_fill_dir_t.java index 9b199066..601ff15c 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_fill_dir_t.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_fill_dir_t.java @@ -7,17 +7,22 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * int (*fuse_fill_dir_t)(void* buf,char* name,struct stat* stbuf,long off,enum fuse_fill_dir_flags flags); + * } + */ public interface fuse_fill_dir_t { - int apply(java.lang.foreign.MemoryAddress buf, java.lang.foreign.MemoryAddress name, java.lang.foreign.MemoryAddress stbuf, long off, int flags); - static MemorySegment allocate(fuse_fill_dir_t fi, MemorySession session) { - return RuntimeHelper.upcallStub(fuse_fill_dir_t.class, fi, constants$0.fuse_fill_dir_t$FUNC, session); + 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 fuse_fill_dir_t ofAddress(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress _buf, java.lang.foreign.MemoryAddress _name, java.lang.foreign.MemoryAddress _stbuf, long _off, int _flags) -> { + static fuse_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + 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((Addressable)symbol, (java.lang.foreign.Addressable)_buf, (java.lang.foreign.Addressable)_name, (java.lang.foreign.Addressable)_stbuf, _off, _flags); + return (int)constants$1.fuse_fill_dir_t$MH.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-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_h.java index abc89ff7..fc570944 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_h.java @@ -9,19 +9,23 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - /* package-private */ fuse_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 MethodHandle fuse_version$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_version$MH,"fuse_version"); } - public static int fuse_version () { + /** + * {@snippet : + * int fuse_version(); + * } + */ + public static int fuse_version() { var mh$ = fuse_version$MH(); try { return (int)mh$.invokeExact(); @@ -32,10 +36,15 @@ 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"); } - public static MemoryAddress fuse_loop_cfg_create () { + /** + * {@snippet : + * struct fuse_loop_config* fuse_loop_cfg_create(); + * } + */ + public static MemorySegment fuse_loop_cfg_create() { var mh$ = fuse_loop_cfg_create$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -43,7 +52,12 @@ public static MemoryAddress 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"); } - public static void fuse_loop_cfg_destroy ( Addressable config) { + /** + * {@snippet : + * void fuse_loop_cfg_destroy(struct fuse_loop_config* config); + * } + */ + public static void fuse_loop_cfg_destroy(MemorySegment config) { var mh$ = fuse_loop_cfg_destroy$MH(); try { mh$.invokeExact(config); @@ -54,7 +68,12 @@ public static void fuse_loop_cfg_destroy ( Addressable 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"); } - public static void fuse_loop_cfg_set_max_threads ( Addressable config, int value) { + /** + * {@snippet : + * void fuse_loop_cfg_set_max_threads(struct fuse_loop_config* config, unsigned int value); + * } + */ + public static void fuse_loop_cfg_set_max_threads(MemorySegment config, int value) { var mh$ = fuse_loop_cfg_set_max_threads$MH(); try { mh$.invokeExact(config, value); @@ -65,7 +84,12 @@ public static void fuse_loop_cfg_set_max_threads ( Addressable config, int valu 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"); } - public static void fuse_loop_cfg_set_clone_fd ( Addressable config, int value) { + /** + * {@snippet : + * void fuse_loop_cfg_set_clone_fd(struct fuse_loop_config* config, unsigned int value); + * } + */ + public static void fuse_loop_cfg_set_clone_fd(MemorySegment config, int value) { var mh$ = fuse_loop_cfg_set_clone_fd$MH(); try { mh$.invokeExact(config, value); @@ -76,7 +100,12 @@ public static void fuse_loop_cfg_set_clone_fd ( Addressable config, int value) public static MethodHandle fuse_lib_help$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_lib_help$MH,"fuse_lib_help"); } - public static void fuse_lib_help ( Addressable args) { + /** + * {@snippet : + * void fuse_lib_help(struct fuse_args* args); + * } + */ + public static void fuse_lib_help(MemorySegment args) { var mh$ = fuse_lib_help$MH(); try { mh$.invokeExact(args); @@ -87,10 +116,15 @@ public static void fuse_lib_help ( Addressable args) { public static MethodHandle fuse_new$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_new$MH,"fuse_new"); } - public static MemoryAddress fuse_new ( Addressable args, Addressable op, long op_size, Addressable private_data) { + /** + * {@snippet : + * struct fuse* fuse_new(struct fuse_args* args, struct fuse_operations* op, size_t op_size, void* private_data); + * } + */ + public static MemorySegment fuse_new(MemorySegment args, MemorySegment op, long op_size, MemorySegment private_data) { var mh$ = fuse_new$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(args, op, op_size, private_data); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(args, op, op_size, private_data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -98,7 +132,12 @@ public static MemoryAddress fuse_new ( Addressable args, Addressable op, long public static MethodHandle fuse_mount$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_mount$MH,"fuse_mount"); } - public static int fuse_mount ( Addressable f, Addressable mountpoint) { + /** + * {@snippet : + * int fuse_mount(struct fuse* f, char* mountpoint); + * } + */ + public static int fuse_mount(MemorySegment f, MemorySegment mountpoint) { var mh$ = fuse_mount$MH(); try { return (int)mh$.invokeExact(f, mountpoint); @@ -109,7 +148,12 @@ public static int fuse_mount ( Addressable f, Addressable mountpoint) { public static MethodHandle fuse_unmount$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_unmount$MH,"fuse_unmount"); } - public static void fuse_unmount ( Addressable f) { + /** + * {@snippet : + * void fuse_unmount(struct fuse* f); + * } + */ + public static void fuse_unmount(MemorySegment f) { var mh$ = fuse_unmount$MH(); try { mh$.invokeExact(f); @@ -120,7 +164,12 @@ public static void fuse_unmount ( Addressable f) { public static MethodHandle fuse_destroy$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_destroy$MH,"fuse_destroy"); } - public static void fuse_destroy ( Addressable f) { + /** + * {@snippet : + * void fuse_destroy(struct fuse* f); + * } + */ + public static void fuse_destroy(MemorySegment f) { var mh$ = fuse_destroy$MH(); try { mh$.invokeExact(f); @@ -131,7 +180,12 @@ public static void fuse_destroy ( Addressable f) { public static MethodHandle fuse_loop$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_loop$MH,"fuse_loop"); } - public static int fuse_loop ( Addressable f) { + /** + * {@snippet : + * int fuse_loop(struct fuse* f); + * } + */ + public static int fuse_loop(MemorySegment f) { var mh$ = fuse_loop$MH(); try { return (int)mh$.invokeExact(f); @@ -142,7 +196,12 @@ public static int fuse_loop ( Addressable f) { public static MethodHandle fuse_exit$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_exit$MH,"fuse_exit"); } - public static void fuse_exit ( Addressable f) { + /** + * {@snippet : + * void fuse_exit(struct fuse* f); + * } + */ + public static void fuse_exit(MemorySegment f) { var mh$ = fuse_exit$MH(); try { mh$.invokeExact(f); @@ -153,7 +212,12 @@ public static void fuse_exit ( Addressable f) { public static MethodHandle fuse_loop_mt$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_loop_mt$MH,"fuse_loop_mt"); } - public static int fuse_loop_mt ( Addressable f, Addressable config) { + /** + * {@snippet : + * int fuse_loop_mt(struct fuse* f, struct fuse_loop_config* config); + * } + */ + public static int fuse_loop_mt(MemorySegment f, MemorySegment config) { var mh$ = fuse_loop_mt$MH(); try { return (int)mh$.invokeExact(f, config); @@ -164,10 +228,15 @@ public static int fuse_loop_mt ( Addressable f, Addressable config) { public static MethodHandle fuse_get_session$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_get_session$MH,"fuse_get_session"); } - public static MemoryAddress fuse_get_session ( Addressable f) { + /** + * {@snippet : + * struct fuse_session* fuse_get_session(struct fuse* f); + * } + */ + public static MemorySegment fuse_get_session(MemorySegment f) { var mh$ = fuse_get_session$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(f); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(f); } 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_loop_config_v1.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_loop_config_v1.java index 469a8435..f6c7114b 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_loop_config_v1.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/fuse_loop_config_v1.java @@ -7,9 +7,17 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_loop_config_v1 { + * int clone_fd; + * unsigned int max_idle_threads; + * }; + * } + */ public class fuse_loop_config_v1 { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"); @@ -20,10 +28,22 @@ public class fuse_loop_config_v1 { public static VarHandle clone_fd$VH() { return fuse_loop_config_v1.clone_fd$VH; } + /** + * Getter for field: + * {@snippet : + * int clone_fd; + * } + */ public static int clone_fd$get(MemorySegment seg) { return (int)fuse_loop_config_v1.clone_fd$VH.get(seg); } - public static void clone_fd$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int clone_fd; + * } + */ + public static void clone_fd$set(MemorySegment seg, int x) { fuse_loop_config_v1.clone_fd$VH.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { @@ -36,10 +56,22 @@ public class fuse_loop_config_v1 { public static VarHandle max_idle_threads$VH() { return fuse_loop_config_v1.max_idle_threads$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ public static int max_idle_threads$get(MemorySegment seg) { return (int)fuse_loop_config_v1.max_idle_threads$VH.get(seg); } - public static void max_idle_threads$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ + public static void max_idle_threads$set(MemorySegment seg, int x) { fuse_loop_config_v1.max_idle_threads$VH.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { @@ -50,10 +82,10 @@ public class fuse_loop_config_v1 { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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 index a60515de..de75bf11 100644 --- 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 @@ -9,15 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_lowlevel_h { - /* package-private */ fuse_lowlevel_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 index d0f09f89..df3e2cfd 100644 --- 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 @@ -7,9 +7,57 @@ 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 GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -64,17 +112,22 @@ public class fuse_operations { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(getattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse_operations.getattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.getattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -86,20 +139,32 @@ static getattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getattr$VH() { return fuse_operations.getattr$VH; } - public static MemoryAddress getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getattr$VH.get(seg); - } - public static void getattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getattr.ofAddress(getattr$get(segment), session); + 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, @@ -109,17 +174,22 @@ public static getattr getattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(readlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse_operations.readlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -131,20 +201,32 @@ static readlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readlink$VH() { return fuse_operations.readlink$VH; } - public static MemoryAddress readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readlink$VH.get(seg); - } - public static void readlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readlink.ofAddress(readlink$get(segment), session); + 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, @@ -154,17 +236,22 @@ public static readlink readlink (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, long _x2); - static MemorySegment allocate(mknod fi, MemorySession session) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse_operations.mknod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2); + return (int)fuse_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -176,20 +263,32 @@ static mknod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mknod$VH() { return fuse_operations.mknod$VH; } - public static MemoryAddress mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mknod$VH.get(seg); - } - public static void mknod$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mknod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mknod.ofAddress(mknod$get(segment), session); + 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, @@ -198,17 +297,22 @@ public static mknod mknod (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1); - static MemorySegment allocate(mkdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse_operations.mkdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -220,20 +324,32 @@ static mkdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mkdir$VH() { return fuse_operations.mkdir$VH; } - public static MemoryAddress mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mkdir$VH.get(seg); - } - public static void mkdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mkdir.ofAddress(mkdir$get(segment), session); + 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 @@ -241,17 +357,22 @@ public static mkdir mkdir (MemorySegment segment, MemorySession session) { static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( fuse_operations.unlink$FUNC ); + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ public interface unlink { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(unlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse_operations.unlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse_operations.unlink$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -263,20 +384,32 @@ static unlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle unlink$VH() { return fuse_operations.unlink$VH; } - public static MemoryAddress unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.unlink$VH.get(seg); - } - public static void unlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.unlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return unlink.ofAddress(unlink$get(segment), session); + 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 @@ -284,17 +417,22 @@ public static unlink unlink (MemorySegment segment, MemorySession session) { static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( fuse_operations.rmdir$FUNC ); + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ public interface rmdir { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(rmdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse_operations.rmdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse_operations.rmdir$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -306,20 +444,32 @@ static rmdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rmdir$VH() { return fuse_operations.rmdir$VH; } - public static MemoryAddress rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rmdir$VH.get(seg); - } - public static void rmdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rmdir.ofAddress(rmdir$get(segment), session); + 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, @@ -328,17 +478,22 @@ public static rmdir rmdir (MemorySegment segment, MemorySession session) { static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( fuse_operations.symlink$FUNC ); + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ public interface symlink { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(symlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse_operations.symlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.symlink$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -350,20 +505,32 @@ static symlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle symlink$VH() { return fuse_operations.symlink$VH; } - public static MemoryAddress symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.symlink$VH.get(seg); - } - public static void symlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.symlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return symlink.ofAddress(symlink$get(segment), session); + 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, @@ -373,17 +540,22 @@ public static symlink symlink (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(rename fi, MemorySession session) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse_operations.rename$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.rename$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -395,20 +567,32 @@ static rename ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rename$VH() { return fuse_operations.rename$VH; } - public static MemoryAddress rename$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rename$VH.get(seg); - } - public static void rename$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rename$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rename.ofAddress(rename$get(segment), session); + 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, @@ -417,17 +601,22 @@ public static rename rename (MemorySegment segment, MemorySession session) { static final MethodHandle link$MH = RuntimeHelper.downcallHandle( fuse_operations.link$FUNC ); + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ public interface link { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(link fi, MemorySession session) { - return RuntimeHelper.upcallStub(link.class, fi, fuse_operations.link$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.link$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -439,20 +628,32 @@ static link ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle link$VH() { return fuse_operations.link$VH; } - public static MemoryAddress link$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.link$VH.get(seg); - } - public static void link$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.link$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return link.ofAddress(link$get(segment), session); + 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, @@ -462,17 +663,22 @@ public static link link (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(chmod fi, MemorySession session) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse_operations.chmod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.chmod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -484,20 +690,32 @@ static chmod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chmod$VH() { return fuse_operations.chmod$VH; } - public static MemoryAddress chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chmod$VH.get(seg); - } - public static void chmod$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chmod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chmod.ofAddress(chmod$get(segment), session); + 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, @@ -508,17 +726,22 @@ public static chmod chmod (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(chown fi, MemorySession session) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse_operations.chown$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -530,20 +753,32 @@ static chown ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chown$VH() { return fuse_operations.chown$VH; } - public static MemoryAddress chown$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chown$VH.get(seg); - } - public static void chown$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chown$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chown.ofAddress(chown$get(segment), session); + 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, @@ -553,17 +788,22 @@ public static chown chown (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(truncate fi, MemorySession session) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse_operations.truncate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.truncate$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -575,20 +815,32 @@ static truncate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle truncate$VH() { return fuse_operations.truncate$VH; } - public static MemoryAddress truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.truncate$VH.get(seg); - } - public static void truncate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.truncate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return truncate.ofAddress(truncate$get(segment), session); + 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, @@ -597,17 +849,22 @@ public static truncate truncate (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(open fi, MemorySession session) { - return RuntimeHelper.upcallStub(open.class, fi, fuse_operations.open$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.open$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -619,20 +876,32 @@ static open ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle open$VH() { return fuse_operations.open$VH; } - public static MemoryAddress open$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.open$VH.get(seg); - } - public static void open$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.open$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return open.ofAddress(open$get(segment), session); + 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, @@ -644,17 +913,22 @@ public static open open (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read fi, MemorySession session) { - return RuntimeHelper.upcallStub(read.class, fi, fuse_operations.read$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -666,20 +940,32 @@ static read ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read$VH() { return fuse_operations.read$VH; } - public static MemoryAddress read$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read$VH.get(seg); - } - public static void read$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read.ofAddress(read$get(segment), session); + 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, @@ -691,17 +977,22 @@ public static read read (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(write fi, MemorySession session) { - return RuntimeHelper.upcallStub(write.class, fi, fuse_operations.write$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -713,20 +1004,32 @@ static write ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write$VH() { return fuse_operations.write$VH; } - public static MemoryAddress write$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write$VH.get(seg); - } - public static void write$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write.ofAddress(write$get(segment), session); + 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, @@ -735,17 +1038,22 @@ public static write write (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(statfs fi, MemorySession session) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse_operations.statfs$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.statfs$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -757,20 +1065,32 @@ static statfs ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle statfs$VH() { return fuse_operations.statfs$VH; } - public static MemoryAddress statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.statfs$VH.get(seg); - } - public static void statfs$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.statfs$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return statfs.ofAddress(statfs$get(segment), session); + 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, @@ -779,17 +1099,22 @@ public static statfs statfs (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(flush fi, MemorySession session) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse_operations.flush$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.flush$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -801,20 +1126,32 @@ static flush ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flush$VH() { return fuse_operations.flush$VH; } - public static MemoryAddress flush$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flush$VH.get(seg); - } - public static void flush$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flush$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flush.ofAddress(flush$get(segment), session); + 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, @@ -823,17 +1160,22 @@ public static flush flush (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(release fi, MemorySession session) { - return RuntimeHelper.upcallStub(release.class, fi, fuse_operations.release$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.release$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -845,20 +1187,32 @@ static release ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle release$VH() { return fuse_operations.release$VH; } - public static MemoryAddress release$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.release$VH.get(seg); - } - public static void release$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.release$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return release.ofAddress(release$get(segment), session); + 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, @@ -868,17 +1222,22 @@ public static release release (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsync fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse_operations.fsync$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -890,20 +1249,32 @@ static fsync ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsync$VH() { return fuse_operations.fsync$VH; } - public static MemoryAddress fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsync$VH.get(seg); - } - public static void fsync$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsync$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsync.ofAddress(fsync$get(segment), session); + 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, @@ -915,17 +1286,22 @@ public static fsync fsync (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse_operations.setxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, int __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, __x4); + return (int)fuse_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -937,20 +1313,32 @@ static setxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle setxattr$VH() { return fuse_operations.setxattr$VH; } - public static MemoryAddress setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.setxattr$VH.get(seg); - } - public static void setxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return setxattr.ofAddress(setxattr$get(segment), session); + 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, @@ -961,17 +1349,22 @@ public static setxattr setxattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3); - static MemorySegment allocate(getxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse_operations.getxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3); + return (int)fuse_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -983,20 +1376,32 @@ static getxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getxattr$VH() { return fuse_operations.getxattr$VH; } - public static MemoryAddress getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getxattr$VH.get(seg); - } - public static void getxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getxattr.ofAddress(getxattr$get(segment), session); + 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, @@ -1006,17 +1411,22 @@ public static getxattr getxattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(listxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse_operations.listxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1028,20 +1438,32 @@ static listxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle listxattr$VH() { return fuse_operations.listxattr$VH; } - public static MemoryAddress listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.listxattr$VH.get(seg); - } - public static void listxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return listxattr.ofAddress(listxattr$get(segment), session); + 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, @@ -1050,17 +1472,22 @@ public static listxattr listxattr (MemorySegment segment, MemorySession session) static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( fuse_operations.removexattr$FUNC ); + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ public interface removexattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(removexattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse_operations.removexattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1072,20 +1499,32 @@ static removexattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle removexattr$VH() { return fuse_operations.removexattr$VH; } - public static MemoryAddress removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.removexattr$VH.get(seg); - } - public static void removexattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return removexattr.ofAddress(removexattr$get(segment), session); + 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, @@ -1094,17 +1533,22 @@ public static removexattr removexattr (MemorySegment segment, MemorySession sess 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(opendir fi, MemorySession session) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse_operations.opendir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.opendir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1116,20 +1560,32 @@ static opendir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle opendir$VH() { return fuse_operations.opendir$VH; } - public static MemoryAddress opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.opendir$VH.get(seg); - } - public static void opendir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.opendir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return opendir.ofAddress(opendir$get(segment), session); + 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, @@ -1142,17 +1598,22 @@ public static opendir opendir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, java.lang.foreign.MemoryAddress _x4, int _x5); - static MemorySegment allocate(readdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse_operations.readdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, java.lang.foreign.MemoryAddress __x4, int __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, (java.lang.foreign.Addressable)__x4, __x5); + 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$); } @@ -1164,20 +1625,32 @@ static readdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readdir$VH() { return fuse_operations.readdir$VH; } - public static MemoryAddress readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readdir$VH.get(seg); - } - public static void readdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readdir.ofAddress(readdir$get(segment), session); + 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, @@ -1186,17 +1659,22 @@ public static readdir readdir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(releasedir fi, MemorySession session) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse_operations.releasedir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1208,20 +1686,32 @@ static releasedir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle releasedir$VH() { return fuse_operations.releasedir$VH; } - public static MemoryAddress releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.releasedir$VH.get(seg); - } - public static void releasedir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return releasedir.ofAddress(releasedir$get(segment), session); + 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, @@ -1231,17 +1721,22 @@ public static releasedir releasedir (MemorySegment segment, MemorySession sessio 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsyncdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse_operations.fsyncdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1253,20 +1748,32 @@ static fsyncdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsyncdir$VH() { return fuse_operations.fsyncdir$VH; } - public static MemoryAddress fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsyncdir$VH.get(seg); - } - public static void fsyncdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsyncdir.ofAddress(fsyncdir$get(segment), session); + 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, @@ -1275,17 +1782,22 @@ public static fsyncdir fsyncdir (MemorySegment segment, MemorySession session) { 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.Addressable apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(init fi, MemorySession session) { - return RuntimeHelper.upcallStub(init.class, fi, fuse_operations.init$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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.Addressable)(java.lang.foreign.MemoryAddress)fuse_operations.init$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (java.lang.foreign.MemorySegment)fuse_operations.init$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1297,20 +1809,32 @@ static init ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle init$VH() { return fuse_operations.init$VH; } - public static MemoryAddress init$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.init$VH.get(seg); - } - public static void init$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.init$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return init.ofAddress(init$get(segment), session); + 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 @@ -1318,17 +1842,22 @@ public static init init (MemorySegment segment, MemorySession session) { static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( fuse_operations.destroy$FUNC ); + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ public interface destroy { - void apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(destroy fi, MemorySession session) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse_operations.destroy$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + fuse_operations.destroy$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1340,20 +1869,32 @@ static destroy ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle destroy$VH() { return fuse_operations.destroy$VH; } - public static MemoryAddress destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.destroy$VH.get(seg); - } - public static void destroy$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.destroy$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return destroy.ofAddress(destroy$get(segment), session); + 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, @@ -1362,17 +1903,22 @@ public static destroy destroy (MemorySegment segment, MemorySession session) { static final MethodHandle access$MH = RuntimeHelper.downcallHandle( fuse_operations.access$FUNC ); + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ public interface access { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1); - static MemorySegment allocate(access fi, MemorySession session) { - return RuntimeHelper.upcallStub(access.class, fi, fuse_operations.access$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.access$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1384,20 +1930,32 @@ static access ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle access$VH() { return fuse_operations.access$VH; } - public static MemoryAddress access$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.access$VH.get(seg); - } - public static void access$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.access$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return access.ofAddress(access$get(segment), session); + 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, @@ -1407,17 +1965,22 @@ public static access access (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(create fi, MemorySession session) { - return RuntimeHelper.upcallStub(create.class, fi, fuse_operations.create$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1429,20 +1992,32 @@ static create ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle create$VH() { return fuse_operations.create$VH; } - public static MemoryAddress create$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.create$VH.get(seg); - } - public static void create$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.create$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return create.ofAddress(create$get(segment), session); + 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, @@ -1453,17 +2028,22 @@ public static create create (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(lock fi, MemorySession session) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse_operations.lock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1475,20 +2055,32 @@ static lock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle lock$VH() { return fuse_operations.lock$VH; } - public static MemoryAddress lock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lock$VH.get(seg); - } - public static void lock$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return lock.ofAddress(lock$get(segment), session); + 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, @@ -1498,17 +2090,22 @@ public static lock lock (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(utimens fi, MemorySession session) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse_operations.utimens$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.utimens$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1520,20 +2117,32 @@ static utimens ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle utimens$VH() { return fuse_operations.utimens$VH; } - public static MemoryAddress utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utimens$VH.get(seg); - } - public static void utimens$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utimens$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return utimens.ofAddress(utimens$get(segment), session); + 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, @@ -1543,17 +2152,22 @@ public static utimens utimens (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(bmap fi, MemorySession session) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse_operations.bmap$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1565,20 +2179,32 @@ static bmap ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle bmap$VH() { return fuse_operations.bmap$VH; } - public static MemoryAddress bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.bmap$VH.get(seg); - } - public static void bmap$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.bmap$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return bmap.ofAddress(bmap$get(segment), session); + 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, @@ -1591,17 +2217,22 @@ public static bmap bmap (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3, int _x4, java.lang.foreign.MemoryAddress _x5); - static MemorySegment allocate(ioctl fi, MemorySession session) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse_operations.ioctl$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3, int __x4, java.lang.foreign.MemoryAddress __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3, __x4, (java.lang.foreign.Addressable)__x5); + 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$); } @@ -1613,20 +2244,32 @@ static ioctl ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle ioctl$VH() { return fuse_operations.ioctl$VH; } - public static MemoryAddress ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ioctl$VH.get(seg); - } - public static void ioctl$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return ioctl.ofAddress(ioctl$get(segment), session); + 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, @@ -1637,17 +2280,22 @@ public static ioctl ioctl (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(poll fi, MemorySession session) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse_operations.poll$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1659,20 +2307,32 @@ static poll ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle poll$VH() { return fuse_operations.poll$VH; } - public static MemoryAddress poll$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.poll$VH.get(seg); - } - public static void poll$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.poll$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return poll.ofAddress(poll$get(segment), session); + 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, @@ -1683,17 +2343,22 @@ public static poll poll (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(write_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse_operations.write_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1705,20 +2370,32 @@ static write_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write_buf$VH() { return fuse_operations.write_buf$VH; } - public static MemoryAddress write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write_buf$VH.get(seg); - } - public static void write_buf$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write_buf.ofAddress(write_buf$get(segment), session); + 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, @@ -1730,17 +2407,22 @@ public static write_buf write_buf (MemorySegment segment, MemorySession session) 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse_operations.read_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + 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$); } @@ -1752,20 +2434,32 @@ static read_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read_buf$VH() { return fuse_operations.read_buf$VH; } - public static MemoryAddress read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read_buf$VH.get(seg); - } - public static void read_buf$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read_buf.ofAddress(read_buf$get(segment), session); + 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, @@ -1775,17 +2469,22 @@ public static read_buf read_buf (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(flock fi, MemorySession session) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse_operations.flock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1797,20 +2496,32 @@ static flock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flock$VH() { return fuse_operations.flock$VH; } - public static MemoryAddress flock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flock$VH.get(seg); - } - public static void flock$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flock.ofAddress(flock$get(segment), session); + 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, @@ -1822,17 +2533,22 @@ public static flock flock (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(fallocate fi, MemorySession session) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse_operations.fallocate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1844,20 +2560,32 @@ static fallocate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fallocate$VH() { return fuse_operations.fallocate$VH; } - public static MemoryAddress fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fallocate$VH.get(seg); - } - public static void fallocate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fallocate.ofAddress(fallocate$get(segment), session); + 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, @@ -1872,17 +2600,22 @@ public static fallocate fallocate (MemorySegment segment, MemorySession session) 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, java.lang.foreign.MemoryAddress _x3, java.lang.foreign.MemoryAddress _x4, long _x5, long _x6, int _x7); - static MemorySegment allocate(copy_file_range fi, MemorySession session) { - return RuntimeHelper.upcallStub(copy_file_range.class, fi, fuse_operations.copy_file_range$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, java.lang.foreign.MemoryAddress __x3, java.lang.foreign.MemoryAddress __x4, long __x5, long __x6, int __x7) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3, (java.lang.foreign.Addressable)__x4, __x5, __x6, __x7); + 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$); } @@ -1894,20 +2627,32 @@ static copy_file_range ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle copy_file_range$VH() { return fuse_operations.copy_file_range$VH; } - public static MemoryAddress copy_file_range$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.copy_file_range$VH.get(seg); - } - public static void copy_file_range$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress copy_file_range$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.copy_file_range$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return copy_file_range.ofAddress(copy_file_range$get(segment), session); + 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, @@ -1918,17 +2663,22 @@ public static copy_file_range copy_file_range (MemorySegment segment, MemorySess 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.MemoryAddress _x0, long _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(lseek fi, MemorySession session) { - return RuntimeHelper.upcallStub(lseek.class, fi, fuse_operations.lseek$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, (java.lang.foreign.Addressable)__x3); + return (long)fuse_operations.lseek$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1940,27 +2690,39 @@ static lseek ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle lseek$VH() { return fuse_operations.lseek$VH; } - public static MemoryAddress lseek$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lseek$VH.get(seg); - } - public static void lseek$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress lseek$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lseek$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return lseek.ofAddress(lseek$get(segment), session); + 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(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat.java index 38997d0e..b3df1ad7 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/stat.java @@ -7,9 +7,31 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@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; + * int __pad2; + * __blkcnt64_t st_blocks; + * struct timespec st_atim; + * struct timespec st_mtim; + * struct timespec st_ctim; + * int __glibc_reserved[2]; + * }; + * } + */ public class stat { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -43,10 +65,22 @@ public class stat { public static VarHandle st_dev$VH() { return stat.st_dev$VH; } + /** + * Getter for field: + * {@snippet : + * __dev_t st_dev; + * } + */ public static long st_dev$get(MemorySegment seg) { return (long)stat.st_dev$VH.get(seg); } - public static void st_dev$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __dev_t st_dev; + * } + */ + public static void st_dev$set(MemorySegment seg, long x) { stat.st_dev$VH.set(seg, x); } public static long st_dev$get(MemorySegment seg, long index) { @@ -59,10 +93,22 @@ public class stat { public static VarHandle st_ino$VH() { return stat.st_ino$VH; } + /** + * Getter for field: + * {@snippet : + * __ino64_t st_ino; + * } + */ public static long st_ino$get(MemorySegment seg) { return (long)stat.st_ino$VH.get(seg); } - public static void st_ino$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __ino64_t st_ino; + * } + */ + public static void st_ino$set(MemorySegment seg, long x) { stat.st_ino$VH.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { @@ -75,10 +121,22 @@ public class stat { public static VarHandle st_mode$VH() { return stat.st_mode$VH; } + /** + * Getter for field: + * {@snippet : + * __mode_t st_mode; + * } + */ public static int st_mode$get(MemorySegment seg) { return (int)stat.st_mode$VH.get(seg); } - public static void st_mode$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __mode_t st_mode; + * } + */ + public static void st_mode$set(MemorySegment seg, int x) { stat.st_mode$VH.set(seg, x); } public static int st_mode$get(MemorySegment seg, long index) { @@ -91,10 +149,22 @@ public class stat { public static VarHandle st_nlink$VH() { return stat.st_nlink$VH; } + /** + * Getter for field: + * {@snippet : + * __nlink_t st_nlink; + * } + */ public static int st_nlink$get(MemorySegment seg) { return (int)stat.st_nlink$VH.get(seg); } - public static void st_nlink$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __nlink_t st_nlink; + * } + */ + public static void st_nlink$set(MemorySegment seg, int x) { stat.st_nlink$VH.set(seg, x); } public static int st_nlink$get(MemorySegment seg, long index) { @@ -107,10 +177,22 @@ public class stat { public static VarHandle st_uid$VH() { return stat.st_uid$VH; } + /** + * Getter for field: + * {@snippet : + * __uid_t st_uid; + * } + */ public static int st_uid$get(MemorySegment seg) { return (int)stat.st_uid$VH.get(seg); } - public static void st_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __uid_t st_uid; + * } + */ + public static void st_uid$set(MemorySegment seg, int x) { stat.st_uid$VH.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { @@ -123,10 +205,22 @@ public class stat { public static VarHandle st_gid$VH() { return stat.st_gid$VH; } + /** + * Getter for field: + * {@snippet : + * __gid_t st_gid; + * } + */ public static int st_gid$get(MemorySegment seg) { return (int)stat.st_gid$VH.get(seg); } - public static void st_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __gid_t st_gid; + * } + */ + public static void st_gid$set(MemorySegment seg, int x) { stat.st_gid$VH.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { @@ -139,10 +233,22 @@ public class stat { public static VarHandle st_rdev$VH() { return stat.st_rdev$VH; } + /** + * Getter for field: + * {@snippet : + * __dev_t st_rdev; + * } + */ public static long st_rdev$get(MemorySegment seg) { return (long)stat.st_rdev$VH.get(seg); } - public static void st_rdev$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __dev_t st_rdev; + * } + */ + public static void st_rdev$set(MemorySegment seg, long x) { stat.st_rdev$VH.set(seg, x); } public static long st_rdev$get(MemorySegment seg, long index) { @@ -155,10 +261,22 @@ public class stat { public static VarHandle __pad1$VH() { return stat.__pad1$VH; } + /** + * Getter for field: + * {@snippet : + * __dev_t __pad1; + * } + */ public static long __pad1$get(MemorySegment seg) { return (long)stat.__pad1$VH.get(seg); } - public static void __pad1$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __dev_t __pad1; + * } + */ + public static void __pad1$set(MemorySegment seg, long x) { stat.__pad1$VH.set(seg, x); } public static long __pad1$get(MemorySegment seg, long index) { @@ -171,10 +289,22 @@ public class stat { public static VarHandle st_size$VH() { return stat.st_size$VH; } + /** + * Getter for field: + * {@snippet : + * __off64_t st_size; + * } + */ public static long st_size$get(MemorySegment seg) { return (long)stat.st_size$VH.get(seg); } - public static void st_size$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __off64_t st_size; + * } + */ + public static void st_size$set(MemorySegment seg, long x) { stat.st_size$VH.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { @@ -187,10 +317,22 @@ public class stat { public static VarHandle st_blksize$VH() { return stat.st_blksize$VH; } + /** + * Getter for field: + * {@snippet : + * __blksize_t st_blksize; + * } + */ public static int st_blksize$get(MemorySegment seg) { return (int)stat.st_blksize$VH.get(seg); } - public static void st_blksize$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __blksize_t st_blksize; + * } + */ + public static void st_blksize$set(MemorySegment seg, int x) { stat.st_blksize$VH.set(seg, x); } public static int st_blksize$get(MemorySegment seg, long index) { @@ -203,10 +345,22 @@ public class stat { public static VarHandle __pad2$VH() { return stat.__pad2$VH; } + /** + * Getter for field: + * {@snippet : + * int __pad2; + * } + */ public static int __pad2$get(MemorySegment seg) { return (int)stat.__pad2$VH.get(seg); } - public static void __pad2$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int __pad2; + * } + */ + public static void __pad2$set(MemorySegment seg, int x) { stat.__pad2$VH.set(seg, x); } public static int __pad2$get(MemorySegment seg, long index) { @@ -219,10 +373,22 @@ public class stat { public static VarHandle st_blocks$VH() { return stat.st_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * __blkcnt64_t st_blocks; + * } + */ public static long st_blocks$get(MemorySegment seg) { return (long)stat.st_blocks$VH.get(seg); } - public static void st_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __blkcnt64_t st_blocks; + * } + */ + public static void st_blocks$set(MemorySegment seg, long x) { stat.st_blocks$VH.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { @@ -245,10 +411,10 @@ public class stat { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stat_h.java index 45cb993c..61aa8be5 100644 --- 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 @@ -9,18 +9,27 @@ import static java.lang.foreign.ValueLayout.*; public class stat_h { - /* package-private */ stat_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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/statvfs.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/statvfs.java index 4e118783..288a7d68 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/statvfs.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/statvfs.java @@ -7,9 +7,27 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * 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_fsid; + * unsigned long f_flag; + * unsigned long f_namemax; + * int __f_spare[6]; + * }; + * } + */ public class statvfs { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -30,10 +48,22 @@ public class statvfs { public static VarHandle f_bsize$VH() { return statvfs.f_bsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_bsize; + * } + */ public static long f_bsize$get(MemorySegment seg) { return (long)statvfs.f_bsize$VH.get(seg); } - public static void f_bsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_bsize; + * } + */ + public static void f_bsize$set(MemorySegment seg, long x) { statvfs.f_bsize$VH.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { @@ -46,10 +76,22 @@ public class statvfs { public static VarHandle f_frsize$VH() { return statvfs.f_frsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_frsize; + * } + */ public static long f_frsize$get(MemorySegment seg) { return (long)statvfs.f_frsize$VH.get(seg); } - public static void f_frsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_frsize; + * } + */ + public static void f_frsize$set(MemorySegment seg, long x) { statvfs.f_frsize$VH.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { @@ -62,10 +104,22 @@ public class statvfs { public static VarHandle f_blocks$VH() { return statvfs.f_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * __fsblkcnt64_t f_blocks; + * } + */ public static long f_blocks$get(MemorySegment seg) { return (long)statvfs.f_blocks$VH.get(seg); } - public static void f_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsblkcnt64_t f_blocks; + * } + */ + public static void f_blocks$set(MemorySegment seg, long x) { statvfs.f_blocks$VH.set(seg, x); } public static long f_blocks$get(MemorySegment seg, long index) { @@ -78,10 +132,22 @@ public class statvfs { public static VarHandle f_bfree$VH() { return statvfs.f_bfree$VH; } + /** + * Getter for field: + * {@snippet : + * __fsblkcnt64_t f_bfree; + * } + */ public static long f_bfree$get(MemorySegment seg) { return (long)statvfs.f_bfree$VH.get(seg); } - public static void f_bfree$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsblkcnt64_t f_bfree; + * } + */ + public static void f_bfree$set(MemorySegment seg, long x) { statvfs.f_bfree$VH.set(seg, x); } public static long f_bfree$get(MemorySegment seg, long index) { @@ -94,10 +160,22 @@ public class statvfs { public static VarHandle f_bavail$VH() { return statvfs.f_bavail$VH; } + /** + * Getter for field: + * {@snippet : + * __fsblkcnt64_t f_bavail; + * } + */ public static long f_bavail$get(MemorySegment seg) { return (long)statvfs.f_bavail$VH.get(seg); } - public static void f_bavail$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsblkcnt64_t f_bavail; + * } + */ + public static void f_bavail$set(MemorySegment seg, long x) { statvfs.f_bavail$VH.set(seg, x); } public static long f_bavail$get(MemorySegment seg, long index) { @@ -110,10 +188,22 @@ public class statvfs { public static VarHandle f_files$VH() { return statvfs.f_files$VH; } + /** + * Getter for field: + * {@snippet : + * __fsfilcnt64_t f_files; + * } + */ public static long f_files$get(MemorySegment seg) { return (long)statvfs.f_files$VH.get(seg); } - public static void f_files$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsfilcnt64_t f_files; + * } + */ + public static void f_files$set(MemorySegment seg, long x) { statvfs.f_files$VH.set(seg, x); } public static long f_files$get(MemorySegment seg, long index) { @@ -126,10 +216,22 @@ public class statvfs { public static VarHandle f_ffree$VH() { return statvfs.f_ffree$VH; } + /** + * Getter for field: + * {@snippet : + * __fsfilcnt64_t f_ffree; + * } + */ public static long f_ffree$get(MemorySegment seg) { return (long)statvfs.f_ffree$VH.get(seg); } - public static void f_ffree$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsfilcnt64_t f_ffree; + * } + */ + public static void f_ffree$set(MemorySegment seg, long x) { statvfs.f_ffree$VH.set(seg, x); } public static long f_ffree$get(MemorySegment seg, long index) { @@ -142,10 +244,22 @@ public class statvfs { public static VarHandle f_favail$VH() { return statvfs.f_favail$VH; } + /** + * Getter for field: + * {@snippet : + * __fsfilcnt64_t f_favail; + * } + */ public static long f_favail$get(MemorySegment seg) { return (long)statvfs.f_favail$VH.get(seg); } - public static void f_favail$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsfilcnt64_t f_favail; + * } + */ + public static void f_favail$set(MemorySegment seg, long x) { statvfs.f_favail$VH.set(seg, x); } public static long f_favail$get(MemorySegment seg, long index) { @@ -158,10 +272,22 @@ public class statvfs { public static VarHandle f_fsid$VH() { return statvfs.f_fsid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_fsid; + * } + */ public static long f_fsid$get(MemorySegment seg) { return (long)statvfs.f_fsid$VH.get(seg); } - public static void f_fsid$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_fsid; + * } + */ + public static void f_fsid$set(MemorySegment seg, long x) { statvfs.f_fsid$VH.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { @@ -174,10 +300,22 @@ public class statvfs { public static VarHandle f_flag$VH() { return statvfs.f_flag$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_flag; + * } + */ public static long f_flag$get(MemorySegment seg) { return (long)statvfs.f_flag$VH.get(seg); } - public static void f_flag$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_flag; + * } + */ + public static void f_flag$set(MemorySegment seg, long x) { statvfs.f_flag$VH.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { @@ -190,10 +328,22 @@ public class statvfs { public static VarHandle f_namemax$VH() { return statvfs.f_namemax$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_namemax; + * } + */ public static long f_namemax$get(MemorySegment seg) { return (long)statvfs.f_namemax$VH.get(seg); } - public static void f_namemax$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_namemax; + * } + */ + public static void f_namemax$set(MemorySegment seg, long x) { statvfs.f_namemax$VH.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { @@ -207,10 +357,10 @@ public class statvfs { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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/stdio_h.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio_h.java index df67ea8d..010a704c 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio_h.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/stdio_h.java @@ -9,21 +9,35 @@ import static java.lang.foreign.ValueLayout.*; public class stdio_h { - /* package-private */ stdio_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 RENAME_NOREPLACE 1 + * } + */ public static int RENAME_NOREPLACE() { return (int)1L; } + /** + * {@snippet : + * #define RENAME_EXCHANGE 2 + * } + */ public static int RENAME_EXCHANGE() { return (int)2L; } + /** + * {@snippet : + * #define RENAME_WHITEOUT 4 + * } + */ public static int RENAME_WHITEOUT() { return (int)4L; } diff --git a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java index 7b5ceb93..98490e19 100644 --- a/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java +++ b/jfuse-linux-aarch64/src/main/java/org/cryptomator/jfuse/linux/aarch64/extr/timespec.java @@ -7,9 +7,17 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct timespec { + * __time_t tv_sec; + * __syscall_slong_t tv_nsec; + * }; + * } + */ public class timespec { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"); @@ -20,10 +28,22 @@ public class timespec { public static VarHandle tv_sec$VH() { return timespec.tv_sec$VH; } + /** + * Getter for field: + * {@snippet : + * __time_t tv_sec; + * } + */ public static long tv_sec$get(MemorySegment seg) { return (long)timespec.tv_sec$VH.get(seg); } - public static void tv_sec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __time_t tv_sec; + * } + */ + public static void tv_sec$set(MemorySegment seg, long x) { timespec.tv_sec$VH.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { @@ -36,10 +56,22 @@ public class timespec { public static VarHandle tv_nsec$VH() { return timespec.tv_nsec$VH; } + /** + * Getter for field: + * {@snippet : + * __syscall_slong_t tv_nsec; + * } + */ public static long tv_nsec$get(MemorySegment seg) { return (long)timespec.tv_nsec$VH.get(seg); } - public static void tv_nsec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __syscall_slong_t tv_nsec; + * } + */ + public static void tv_nsec$set(MemorySegment seg, long x) { timespec.tv_nsec$VH.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { @@ -50,10 +82,10 @@ public class timespec { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } 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 ed92c2e1..bb758895 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.nio.file.OpenOption; import java.nio.file.StandardOpenOption; import java.util.Set; @@ -20,8 +20,8 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var scope = MemorySession.openConfined()) { - var fi = new FileInfoImpl(fuse_file_info.allocate(scope)); + try (var arena = Arena.openConfined()) { + var fi = new FileInfoImpl(fuse_file_info.allocate(arena)); fuse_file_info.flags$set(fi.segment(), flags); var result = fi.getOpenFlags(); 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 f1ea1ea5..86667494 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class FuseConfigImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInFuseConfig getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse_config.allocate(scope); - var fuseConfig = new FuseConfigImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_config.allocate(arena); + var fuseConfig = new FuseConfigImpl(segment, arena.scope()); 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 0789d974..c0712567 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = fuse_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 5494ea6d..16443c63 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 @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.aarch64; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -23,9 +23,8 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.time.Instant; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -57,7 +56,7 @@ public void teardown() { @Test @DisplayName("MountFailedException when fuse_new fails") public void testFuseNewFails() { - fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL); + fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.NULL); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -68,7 +67,7 @@ public void testFuseNewFails() { @Test @DisplayName("MountFailedException when fuse_mount fails") public void testFuseMountFails() { - fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L)); + fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.ofAddress(42L)); fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(1); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -101,12 +100,12 @@ public void testParseArgsHelp(String arg) { @DisplayName("parseArgs") public void testParseArgs() { try (var fuseFunctionsClass = Mockito.mockStatic(FuseFunctions.class); - var scope = MemorySession.openConfined()) { + var arena = Arena.openConfined()) { fuseFunctionsClass.when(() -> FuseFunctions.fuse_parse_cmdline(Mockito.any(), Mockito.any())).then(invocation -> { MemorySegment opts = invocation.getArgument(1); fuse_cmdline_opts.singlethread$set(opts, 0); fuse_cmdline_opts.debug$set(opts, 1); - fuse_cmdline_opts.mountpoint$set(opts, scope.allocateUtf8String("/mount/point").address()); + fuse_cmdline_opts.mountpoint$set(opts, arena.allocateUtf8String("/mount/point")); return 0; }); @@ -129,12 +128,12 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.flush(path.address(), fi.address()); + var result = fuseImpl.flush(path, fi); Assertions.assertEquals(42, result); } @@ -143,12 +142,12 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsync(path.address(), 1, fi.address()); + var result = fuseImpl.fsync(path, 1, fi); Assertions.assertEquals(42, result); } @@ -157,12 +156,12 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsyncdir(path.address(), 1, fi.address()); + var result = fuseImpl.fsyncdir(path, 1, fi); Assertions.assertEquals(42, result); } @@ -173,17 +172,17 @@ public void testFsyncdir() { @DisplayName("init() sets fuse_conn_info.wants |= FUSE_CAP_READDIRPLUS") @Test public void testInit() { - try (var scope = MemorySession.openConfined()) { + try (var arena = Arena.openConfined()) { var result = new AtomicInteger(); Mockito.doAnswer(invocation -> { FuseConnInfo connInfo = invocation.getArgument(0); result.set(connInfo.want()); return null; }).when(fuseOps).init(Mockito.any(), Mockito.any()); - var connInfo = fuse_conn_info.allocate(scope); - var fuseConfig = fuse_config.allocate(scope); + var connInfo = fuse_conn_info.allocate(arena); + var fuseConfig = fuse_config.allocate(arena); - fuseImpl.init(connInfo.address(), fuseConfig.address()); + fuseImpl.init(connInfo, fuseConfig); Assertions.assertEquals(FuseConnInfo.FUSE_CAP_READDIRPLUS, result.get() & FuseConnInfo.FUSE_CAP_READDIRPLUS); } @@ -196,13 +195,13 @@ public class Utimens { @DisplayName("utimens(\"/foo\", UTIME_NOW, UTIME_NOW)") @Test public void testUtimensNow() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = scope.allocate(fuse_file_info.$LAYOUT()); - var times = MemoryAddress.NULL; + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = arena.allocate(fuse_file_info.$LAYOUT()); + var times = MemorySegment.NULL; Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(TimeSpec::isUtimeNow), Mockito.argThat(TimeSpec::isUtimeNow), Mockito.any()); - var result = fuseImpl.utimens(path.address(), times, fi.address()); + var result = fuseImpl.utimens(path, times, fi); Assertions.assertEquals(42, result); } @@ -217,17 +216,17 @@ 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 scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = scope.allocate(fuse_file_info.$LAYOUT()); - var times = timespec.allocateArray(2, scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = arena.allocate(fuse_file_info.$LAYOUT()); + var times = timespec.allocateArray(2, arena); timespec.tv_sec$set(times, 0, sec0); timespec.tv_nsec$set(times, 0, nsec0); timespec.tv_sec$set(times, 1, sec1); timespec.tv_nsec$set(times, 1, nsec1); Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(t -> expectedATime.equals(t.get())), Mockito.argThat(t -> expectedMTime.equals(t.get())), Mockito.any()); - var result = fuseImpl.utimens(path.address(), times.address(), fi.address()); + var result = fuseImpl.utimens(path, times, fi); Assertions.assertEquals(42, result); } @@ -241,14 +240,14 @@ public class Attr { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).getxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any()); - var result = fuseImpl.getxattr(path.address(), name.address(), value.address(), 100); + var result = fuseImpl.getxattr(path, name, value, 100); Assertions.assertEquals(42, result); } @@ -257,14 +256,14 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).setxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any(), Mockito.anyInt()); - var result = fuseImpl.setxattr(path.address(), name.address(), value.address(), 100, 0xDEADBEEF); + var result = fuseImpl.setxattr(path, name, value, 100, 0xDEADBEEF); Assertions.assertEquals(42, result); } @@ -273,13 +272,13 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var list = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var list = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).listxattr(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.listxattr(path.address(), list.address(), 100); + var result = fuseImpl.listxattr(path, list, 100); Assertions.assertEquals(42, result); } @@ -288,13 +287,13 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); Mockito.doReturn(42).when(fuseOps).removexattr(Mockito.eq("/foo"), Mockito.eq("bar")); - var result = fuseImpl.removexattr(path.address(), name.address()); + var result = fuseImpl.removexattr(path, name); Assertions.assertEquals(42, result); } @@ -305,12 +304,12 @@ public void testRemovexattr() { @Test @DisplayName("chown") public void testChown() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.chown(path.address(), 42, 1337, fi.address()); + var result = fuseImpl.chown(path, 42, 1337, fi); Assertions.assertEquals(42, result); } 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 f507e2ba..f87d2324 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 @@ -10,13 +10,13 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemorySegment; public class FuseMountImplTest { private MockedStatic fuseH; private FuseArgs fuseArgs = Mockito.mock(FuseArgs.class); - private MemoryAddress fuse = MemoryAddress.ofLong(42L); + private MemorySegment fuse = MemorySegment.ofAddress(42L); private FuseMountImpl fuseMount = new FuseMountImpl(fuse, fuseArgs); @BeforeEach @@ -71,7 +71,7 @@ public void testLoopMultiThreaded32(int fuseVersion) { @Test @DisplayName("FUSE 3.12 calls fuse_loop_mt") public void testLoopMultiThreaded312() { - var loopCfg = MemoryAddress.ofLong(1337L); + var loopCfg = MemorySegment.ofAddress(1337L); Mockito.doReturn(true).when(fuseArgs).multithreaded(); fuseH.when(fuse_h::fuse_version).thenReturn(312); fuseH.when(fuse_h::fuse_loop_cfg_create).thenReturn(loopCfg); 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 b13b839f..e252fdc4 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 73b1c85e..fa2b8031 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 @@ -6,7 +6,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.time.Instant; public class TimeSpecImplTest { @@ -14,8 +14,8 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,8 +29,8 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 0L); timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,8 +44,8 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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,8 +57,8 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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 0e7ba6a1..c93f922e 100644 --- a/jfuse-linux-amd64/pom.xml +++ b/jfuse-linux-amd64/pom.xml @@ -69,9 +69,9 @@ io.github.coffeelibs jextract-maven-plugin - 0.2.0 + 0.3.0 - ${user.home}/.sdkman/candidates/java/19.ea.jextract/bin/jextract + /Users/sebastian/Documents/Cryptomator/jextract/build/jextract/bin/jextract ${linux.headerSearchPath} ${project.build.sourceDirectory} org.cryptomator.jfuse.linux.amd64.extr @@ -147,7 +147,7 @@ ${linux.headerSearchPath}/errno.h errno_h - + ENOENT ENOSYS ENOMEM @@ -164,7 +164,7 @@ ERANGE ENOLCK ENAMETOOLONG - + @@ -175,10 +175,10 @@ ${linux.headerSearchPath}/sys/stat.h stat_h - + UTIME_NOW UTIME_OMIT - + @@ -189,7 +189,7 @@ ${linux.headerSearchPath}/fcntl.h fcntl_h - + O_RDONLY O_WRONLY O_RDWR @@ -199,7 +199,7 @@ O_EXCL O_DSYNC O_SYNC - + @@ -213,12 +213,12 @@ _GNU_SOURCE=1 - + RENAME_NOREPLACE RENAME_EXCHANGE RENAME_WHITEOUT - + 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 428398ba..4f427eb4 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 @@ -5,21 +5,21 @@ import org.cryptomator.jfuse.linux.amd64.extr.fuse_fill_dir_t; import org.cryptomator.jfuse.linux.amd64.extr.stat; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; import java.util.function.Consumer; -record DirFillerImpl(MemoryAddress buf, fuse_fill_dir_t callback, MemorySession scope) implements DirFiller { +record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller { - DirFillerImpl(MemoryAddress buf, MemoryAddress callback, MemorySession scope) { - this(buf, fuse_fill_dir_t.ofAddress(callback, scope), scope); + DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { + this(buf, fuse_fill_dir_t.ofAddress(callback, arena.scope()), arena); } @Override public int fill(String name, Consumer statFiller, long offset, int flags) { - var statSegment = stat.allocate(scope); + var statSegment = stat.allocate(arena); statFiller.accept(new StatImpl(statSegment)); - return callback.apply(buf, scope.allocateUtf8String(name).address(), statSegment.address(), offset, flags); + return callback.apply(buf, arena.allocateUtf8String(name), statSegment, offset, flags); } } \ No newline at end of file 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 c739c783..4e8575ac 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 @@ -4,9 +4,8 @@ import org.cryptomator.jfuse.linux.amd64.extr.fcntl_h; import org.cryptomator.jfuse.linux.amd64.extr.fuse_file_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -23,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(MemoryAddress address, MemorySession scope) { + public FileInfoImpl(MemorySegment address, SegmentScope 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 cb1f6ea9..30fe77cf 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 @@ -3,7 +3,6 @@ import org.cryptomator.jfuse.linux.amd64.extr.fuse_args; import org.cryptomator.jfuse.linux.amd64.extr.fuse_cmdline_opts; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; @@ -15,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, i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } sb.append("mountPoint = ").append(mountPoint().getUtf8String(0)); @@ -24,7 +23,7 @@ public String toString() { return sb.toString(); } - public MemoryAddress mountPoint() { + public MemorySegment mountPoint() { return fuse_cmdline_opts.mountpoint$get(cmdLineOpts); } 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 2c1c8080..15005dd3 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConfig; import org.cryptomator.jfuse.linux.amd64.extr.fuse_config; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConfigImpl(MemorySegment segment) implements FuseConfig { - public FuseConfigImpl(MemoryAddress address, MemorySession scope) { + public FuseConfigImpl(MemorySegment address, SegmentScope 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 8bc88436..2ca4078e 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.linux.amd64.extr.fuse_conn_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemoryAddress address, MemorySession scope) { + public FuseConnInfoImpl(MemorySegment address, SegmentScope scope) { this(fuse_conn_info.ofAddress(address, scope)); } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseFunctions.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseFunctions.java index b9ea2dd0..4a182345 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseFunctions.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/FuseFunctions.java @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.amd64; -import java.lang.foreign.Addressable; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.Linker; +import java.lang.foreign.MemorySegment; import java.lang.foreign.SymbolLookup; import java.lang.invoke.MethodHandle; @@ -24,7 +24,7 @@ class FuseFunctions { private FuseFunctions() { var lookup = SymbolLookup.loaderLookup(); var linker = Linker.nativeLinker(); - this.fuse_parse_cmdline = lookup.lookup("fuse_parse_cmdline") + this.fuse_parse_cmdline = lookup.find("fuse_parse_cmdline") .map(symbol -> linker.downcallHandle(symbol, FUSE_PARSE_CMDLINE)) .orElseThrow(() -> new UnsatisfiedLinkError("unresolved symbol fuse_parse_cmdline")); } @@ -33,7 +33,7 @@ private static class Holder { private static final FuseFunctions INSTANCE = new FuseFunctions(); } - public static int fuse_parse_cmdline(Addressable args, Addressable opts) { + public static int fuse_parse_cmdline(MemorySegment args, MemorySegment opts) { try { return (int) Holder.INSTANCE.fuse_parse_cmdline.invokeExact(args, opts); } catch (Throwable e) { 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 59977bad..5e0f6244 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 @@ -3,8 +3,8 @@ import org.cryptomator.jfuse.api.Fuse; import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -13,11 +13,8 @@ import org.cryptomator.jfuse.linux.amd64.extr.timespec; import org.jetbrains.annotations.VisibleForTesting; -import java.lang.foreign.Addressable; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemoryLayout; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.util.List; @@ -30,8 +27,8 @@ public FuseImpl(FuseOperations fuseOperations) { @Override protected FuseMount mount(List args) throws FuseMountFailedException { var fuseArgs = parseArgs(args); - var fuse = fuse_h.fuse_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL); - if (MemoryAddress.NULL.equals(fuse)) { + var fuse = fuse_h.fuse_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemorySegment.NULL); + if (MemorySegment.NULL.equals(fuse)) { throw new FuseMountFailedException("fuse_new failed"); } if (fuse_h.fuse_mount(fuse, fuseArgs.mountPoint()) != 0) { @@ -49,9 +46,9 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { var cString = fuseScope.allocateUtf8String(cmdLineArgs.get(i)); argv.setAtIndex(ValueLayout.ADDRESS, i, cString); } - argv.setAtIndex(ValueLayout.ADDRESS, argc, MemoryAddress.NULL); + argv.setAtIndex(ValueLayout.ADDRESS, argc, MemorySegment.NULL); fuse_args.argc$set(args, argc); - fuse_args.argv$set(args, argv.address()); + fuse_args.argv$set(args, argv); fuse_args.allocated$set(args, 0); var opts = fuse_cmdline_opts.allocate(fuseScope); @@ -69,230 +66,231 @@ 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, fuseScope).address()); - case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseScope).address()); - case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseScope).address()); - case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseScope).address()); - case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseScope).address()); - case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseScope).address()); - case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseScope).address()); - case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseScope).address()); - case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseScope).address()); - case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope).address()); - case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseScope).address()); - case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseScope).address()); - case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseScope).address()); - case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseScope).address()); - case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseScope).address()); - case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseScope).address()); - case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseScope).address()); - case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseScope).address()); - case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseScope).address()); - case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseScope).address()); - case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseScope).address()); - case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseScope).address()); - case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseScope).address()); - case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseScope).address()); - case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseScope).address()); - case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseScope).address()); - case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope).address()); - case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseScope).address()); - case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseScope).address()); - case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseScope).address()); + case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseScope.scope())); + case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseScope.scope())); + case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseScope.scope())); + case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseScope.scope())); + case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseScope.scope())); + case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseScope.scope())); + case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseScope.scope())); + case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseScope.scope())); + case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseScope.scope())); + case GET_ATTR -> fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope.scope())); + case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseScope.scope())); + case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseScope.scope())); + case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseScope.scope())); + case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseScope.scope())); + case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseScope.scope())); + case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseScope.scope())); + case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseScope.scope())); + case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseScope.scope())); + case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseScope.scope())); + case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseScope.scope())); + case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseScope.scope())); + case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseScope.scope())); + case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseScope.scope())); + case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseScope.scope())); + case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseScope.scope())); + case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseScope.scope())); + case TRUNCATE -> fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope.scope())); + case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseScope.scope())); + case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseScope.scope())); + case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseScope.scope())); } } @VisibleForTesting - Addressable init(MemoryAddress conn, MemoryAddress cfg) { - try (var scope = MemorySession.openConfined()) { - var connInfo = new FuseConnInfoImpl(conn, scope); + MemorySegment init(MemorySegment conn, MemorySegment cfg) { + try (var arena = Arena.openConfined()) { + var connInfo = new FuseConnInfoImpl(conn, arena.scope()); connInfo.setWant(connInfo.want() | FuseConnInfo.FUSE_CAP_READDIRPLUS); - var config = new FuseConfigImpl(cfg, scope); + var config = new FuseConfigImpl(cfg, arena.scope()); fuseOperations.init(connInfo, config); } - return MemoryAddress.NULL; + return MemorySegment.NULL; } - private int access(MemoryAddress path, int mask) { + private int access(MemorySegment path, int mask) { return fuseOperations.access(path.getUtf8String(0), mask); } - private int chmod(MemoryAddress path, int mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int chown(MemoryAddress path, int uid, int gid, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, scope)); + 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())); } } - private int create(MemoryAddress path, int mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } - private void destroy(MemoryAddress addr) { + private void destroy(MemorySegment addr) { fuseOperations.destroy(); } @VisibleForTesting - int flush(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + int flush(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } @VisibleForTesting - int fsync(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int fsyncdir(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } - private int getattr(MemoryAddress path, MemoryAddress stat, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, scope), new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int getxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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); } } @VisibleForTesting - int setxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer(), flags); + 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); } } @VisibleForTesting - int listxattr(MemoryAddress path, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.listxattr(path.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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); } } @VisibleForTesting - int removexattr(MemoryAddress path, MemoryAddress name) { + int removexattr(MemorySegment path, MemorySegment name) { return fuseOperations.removexattr(path.getUtf8String(0), name.getUtf8String(0)); } - private int mkdir(MemoryAddress path, int mode) { + private int mkdir(MemorySegment path, int mode) { return fuseOperations.mkdir(path.getUtf8String(0), mode); } - private int open(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int open(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int opendir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int opendir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int read(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } - private int readdir(MemoryAddress path, MemoryAddress buf, MemoryAddress filler, long offset, MemoryAddress fi, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, scope), offset, new FileInfoImpl(fi, scope), flags); + 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); } } - private int readlink(MemoryAddress path, MemoryAddress buf, long len) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, len, scope).asByteBuffer(); + 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); } } - private int release(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int release(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int releasedir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int releasedir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int rename(MemoryAddress oldpath, MemoryAddress newpath, int flags) { + private int rename(MemorySegment oldpath, MemorySegment newpath, int flags) { return fuseOperations.rename(oldpath.getUtf8String(0), newpath.getUtf8String(0), flags); } - private int rmdir(MemoryAddress path) { + private int rmdir(MemorySegment path) { return fuseOperations.rmdir(path.getUtf8String(0)); } - private int statfs(MemoryAddress path, MemoryAddress statvfs) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, scope)); + private int statfs(MemorySegment path, MemorySegment statvfs) { + try (var arena = Arena.openConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); } } - private int symlink(MemoryAddress linkname, MemoryAddress target) { + private int symlink(MemorySegment linkname, MemorySegment target) { return fuseOperations.symlink(linkname.getUtf8String(0), target.getUtf8String(0)); } - private int truncate(MemoryAddress path, long size, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, scope)); + 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())); } } - private int unlink(MemoryAddress path) { + private int unlink(MemorySegment path) { return fuseOperations.unlink(path.getUtf8String(0)); } @VisibleForTesting - int utimens(MemoryAddress path, MemoryAddress times, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - if (MemoryAddress.NULL.equals(times)) { + int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + if (MemorySegment.NULL.equals(times)) { // set both times to current time (using on-heap memory segments) - var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), scope); + var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), arena.scope()); 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, scope)); + return fuseOperations.utimens(path.getUtf8String(0), time, time, new FileInfoImpl(fi, arena.scope())); } else { - var seq = MemoryLayout.sequenceLayout(2, timespec.$LAYOUT()); - var segment = MemorySegment.ofAddress(times, seq.byteSize(), scope); - var time0 = segment.asSlice(0, timespec.$LAYOUT().byteSize()); - var time1 = segment.asSlice(timespec.$LAYOUT().byteSize(), timespec.$LAYOUT().byteSize()); - return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, scope)); + 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())); } } } - private int write(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } 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 dd2de259..13d79896 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 @@ -4,10 +4,10 @@ import org.cryptomator.jfuse.linux.amd64.extr.fuse_h; import org.cryptomator.jfuse.linux.amd64.extr.fuse_loop_config_v1; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; -record FuseMountImpl(MemoryAddress fuse, FuseArgs fuseArgs) implements FuseMount { +record FuseMountImpl(MemorySegment fuse, FuseArgs fuseArgs) implements FuseMount { private static final int FUSE_3_2 = 32; private static final int FUSE_3_12 = 312; @@ -20,8 +20,8 @@ public int loop() { return fuse_h.fuse_loop(fuse); } else if (fuse_h.fuse_version() < FUSE_3_12) { // FUSE 3.2 - try (var scope = MemorySession.openConfined()) { - var loopCfg = fuse_loop_config_v1.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); return fuse_h.fuse_loop_mt(fuse, loopCfg); 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 a9c2d636..a9dcee21 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 @@ -4,13 +4,12 @@ import org.cryptomator.jfuse.api.TimeSpec; import org.cryptomator.jfuse.linux.amd64.extr.stat; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemoryAddress address, MemorySession scope) { + public StatImpl(MemorySegment address, SegmentScope 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 d0838081..aa7cabd5 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.Statvfs; import org.cryptomator.jfuse.linux.amd64.extr.statvfs; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemoryAddress address, MemorySession scope) { + public StatvfsImpl(MemorySegment address, SegmentScope scope) { this(statvfs.ofAddress(address, scope)); } 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 index 35bb385d..839fe764 100644 --- 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 @@ -7,17 +7,19 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -public class Constants$root { +final class 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.withBitAlignment(16); - static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfLong C_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); + // 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/RuntimeHelper.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/RuntimeHelper.java index 55cd717c..70bb6da0 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/RuntimeHelper.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/RuntimeHelper.java @@ -1,15 +1,13 @@ package org.cryptomator.jfuse.linux.amd64.extr; // Generated by jextract -import java.lang.foreign.Addressable; import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; import java.lang.foreign.SymbolLookup; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -27,21 +25,24 @@ final class RuntimeHelper { - private RuntimeHelper() {} - private final static Linker LINKER = Linker.nativeLinker(); - private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); - private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); - private final static SymbolLookup SYMBOL_LOOKUP; + 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"); }; final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); + (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); static { SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); + 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); @@ -49,45 +50,43 @@ static T requireNonNull(T obj, String symbolName) { return obj; } - private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; - - static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } - static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } - static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { return LINKER.downcallHandle(fdesc); } - static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { + static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, session); + return LINKER.upcallStub(handle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { - return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); } // Internals only below this point - private static class VarargsInvoker { + private static final class VarargsInvoker { private static final MethodHandle INVOKE_MH; private final MemorySegment symbol; private final FunctionDescriptor function; @@ -113,7 +112,9 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { mtype = mtype.appendParameterTypes(carrier(layout, false)); } mtype = mtype.appendParameterTypes(Object[].class); - if (mtype.returnType().equals(MemorySegment.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); @@ -123,8 +124,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { static Class carrier(MemoryLayout layout, boolean ret) { if (layout instanceof ValueLayout valueLayout) { - return (ret || valueLayout.carrier() != MemoryAddress.class) ? - valueLayout.carrier() : Addressable.class; + return valueLayout.carrier(); } else if (layout instanceof GroupLayout) { return MemorySegment.class; } else { @@ -159,7 +159,9 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.ofVoid(argLayouts) : FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); - if (mh.type().returnType() == MemorySegment.class) { + 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 @@ -209,10 +211,7 @@ private Class normalize(Class c) { if (c.isPrimitive()) { return promote(c); } - if (MemoryAddress.class.isAssignableFrom(c)) { - return MemoryAddress.class; - } - if (MemorySegment.class.isAssignableFrom(c)) { + if (c == MemorySegment.class) { return MemorySegment.class; } throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); @@ -223,7 +222,7 @@ private MemoryLayout variadicLayout(Class c) { return JAVA_LONG; } else if (c == double.class) { return JAVA_DOUBLE; - } else if (MemoryAddress.class.isAssignableFrom(c)) { + } 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/constants$0.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/constants$0.java index a3ea0512..cdcb2206 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$0 { +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", 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 index b5e94157..1c12d74d 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$1 { +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, 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 index 5eb1f25a..5d054754 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$2 { +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 ); diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java index 5e1ad38c..76e19057 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/errno_h.java @@ -9,60 +9,139 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - /* package-private */ errno_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 ENOENT 2 + * } + */ public static int ENOENT() { return (int)2L; } + /** + * {@snippet : + * #define EIO 5 + * } + */ public static int EIO() { return (int)5L; } + /** + * {@snippet : + * #define EBADF 9 + * } + */ public static int EBADF() { return (int)9L; } + /** + * {@snippet : + * #define ENOMEM 12 + * } + */ public static int ENOMEM() { return (int)12L; } + /** + * {@snippet : + * #define EACCES 13 + * } + */ public static int EACCES() { return (int)13L; } + /** + * {@snippet : + * #define EEXIST 17 + * } + */ public static int EEXIST() { return (int)17L; } + /** + * {@snippet : + * #define ENOTDIR 20 + * } + */ public static int ENOTDIR() { return (int)20L; } + /** + * {@snippet : + * #define EISDIR 21 + * } + */ public static int EISDIR() { return (int)21L; } + /** + * {@snippet : + * #define EINVAL 22 + * } + */ public static int EINVAL() { return (int)22L; } + /** + * {@snippet : + * #define EROFS 30 + * } + */ public static int EROFS() { return (int)30L; } + /** + * {@snippet : + * #define ERANGE 34 + * } + */ public static int ERANGE() { return (int)34L; } + /** + * {@snippet : + * #define ENAMETOOLONG 36 + * } + */ public static int ENAMETOOLONG() { return (int)36L; } + /** + * {@snippet : + * #define ENOLCK 37 + * } + */ public static int ENOLCK() { return (int)37L; } + /** + * {@snippet : + * #define ENOSYS 38 + * } + */ public static int ENOSYS() { return (int)38L; } + /** + * {@snippet : + * #define ENOTEMPTY 39 + * } + */ public static int ENOTEMPTY() { return (int)39L; } + /** + * {@snippet : + * #define ENOTSUP 95 + * } + */ public static int ENOTSUP() { return (int)95L; } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java index fad6be99..6c0c3898 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fcntl_h.java @@ -9,39 +9,83 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - /* package-private */ fcntl_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 O_RDONLY 0 + * } + */ public static int O_RDONLY() { return (int)0L; } + /** + * {@snippet : + * #define O_WRONLY 1 + * } + */ public static int O_WRONLY() { return (int)1L; } + /** + * {@snippet : + * #define O_RDWR 2 + * } + */ public static int O_RDWR() { return (int)2L; } + /** + * {@snippet : + * #define O_CREAT 64 + * } + */ public static int O_CREAT() { return (int)64L; } + /** + * {@snippet : + * #define O_EXCL 128 + * } + */ public static int O_EXCL() { return (int)128L; } + /** + * {@snippet : + * #define O_TRUNC 512 + * } + */ public static int O_TRUNC() { return (int)512L; } + /** + * {@snippet : + * #define O_APPEND 1024 + * } + */ public static int O_APPEND() { return (int)1024L; } + /** + * {@snippet : + * #define O_SYNC 1052672 + * } + */ public static int O_SYNC() { return (int)1052672L; } + /** + * {@snippet : + * #define O_DSYNC 4096 + * } + */ public static int O_DSYNC() { return (int)4096L; } 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/fuse_args.java index ad44b601..6628429d 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/fuse_args.java @@ -7,9 +7,18 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_args { + * int argc; + * char** argv; + * int allocated; + * }; + * } + */ public class fuse_args { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_INT$LAYOUT.withName("argc"), MemoryLayout.paddingLayout(32), Constants$root.C_POINTER$LAYOUT.withName("argv"), @@ -23,10 +32,22 @@ public class fuse_args { public static VarHandle argc$VH() { return fuse_args.argc$VH; } + /** + * Getter for field: + * {@snippet : + * int argc; + * } + */ public static int argc$get(MemorySegment seg) { return (int)fuse_args.argc$VH.get(seg); } - public static void argc$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int argc; + * } + */ + public static void argc$set(MemorySegment seg, int x) { fuse_args.argc$VH.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { @@ -39,26 +60,50 @@ public class fuse_args { public static VarHandle argv$VH() { return fuse_args.argv$VH; } - public static MemoryAddress argv$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg); - } - public static void argv$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char** argv; + * } + */ + public static MemorySegment argv$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char** argv; + * } + */ + public static void argv$set(MemorySegment seg, MemorySegment x) { fuse_args.argv$VH.set(seg, x); } - public static MemoryAddress argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment argv$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); } - public static void argv$set(MemorySegment seg, long index, MemoryAddress x) { + public static void argv$set(MemorySegment seg, long index, MemorySegment x) { fuse_args.argv$VH.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; } + /** + * Getter for field: + * {@snippet : + * int allocated; + * } + */ public static int allocated$get(MemorySegment seg) { return (int)fuse_args.allocated$VH.get(seg); } - public static void allocated$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int allocated; + * } + */ + public static void allocated$set(MemorySegment seg, int x) { fuse_args.allocated$VH.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { @@ -69,10 +114,10 @@ public class fuse_args { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_cmdline_opts.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_cmdline_opts.java index 7e8155a8..c88d9cee 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_cmdline_opts.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_cmdline_opts.java @@ -7,9 +7,25 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_cmdline_opts { + * int singlethread; + * int foreground; + * int debug; + * int nodefault_subtype; + * char* mountpoint; + * int show_version; + * int show_help; + * int clone_fd; + * unsigned int max_idle_threads; + * unsigned int max_threads; + * }; + * } + */ public class fuse_cmdline_opts { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -29,10 +45,22 @@ public class fuse_cmdline_opts { public static VarHandle singlethread$VH() { return fuse_cmdline_opts.singlethread$VH; } + /** + * Getter for field: + * {@snippet : + * int singlethread; + * } + */ public static int singlethread$get(MemorySegment seg) { return (int)fuse_cmdline_opts.singlethread$VH.get(seg); } - public static void singlethread$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int singlethread; + * } + */ + public static void singlethread$set(MemorySegment seg, int x) { fuse_cmdline_opts.singlethread$VH.set(seg, x); } public static int singlethread$get(MemorySegment seg, long index) { @@ -45,10 +73,22 @@ public class fuse_cmdline_opts { public static VarHandle foreground$VH() { return fuse_cmdline_opts.foreground$VH; } + /** + * Getter for field: + * {@snippet : + * int foreground; + * } + */ public static int foreground$get(MemorySegment seg) { return (int)fuse_cmdline_opts.foreground$VH.get(seg); } - public static void foreground$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int foreground; + * } + */ + public static void foreground$set(MemorySegment seg, int x) { fuse_cmdline_opts.foreground$VH.set(seg, x); } public static int foreground$get(MemorySegment seg, long index) { @@ -61,10 +101,22 @@ public class fuse_cmdline_opts { public static VarHandle debug$VH() { return fuse_cmdline_opts.debug$VH; } + /** + * Getter for field: + * {@snippet : + * int debug; + * } + */ public static int debug$get(MemorySegment seg) { return (int)fuse_cmdline_opts.debug$VH.get(seg); } - public static void debug$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int debug; + * } + */ + public static void debug$set(MemorySegment seg, int x) { fuse_cmdline_opts.debug$VH.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { @@ -77,10 +129,22 @@ public class fuse_cmdline_opts { public static VarHandle nodefault_subtype$VH() { return fuse_cmdline_opts.nodefault_subtype$VH; } + /** + * Getter for field: + * {@snippet : + * int nodefault_subtype; + * } + */ public static int nodefault_subtype$get(MemorySegment seg) { return (int)fuse_cmdline_opts.nodefault_subtype$VH.get(seg); } - public static void nodefault_subtype$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int nodefault_subtype; + * } + */ + public static void nodefault_subtype$set(MemorySegment seg, int x) { fuse_cmdline_opts.nodefault_subtype$VH.set(seg, x); } public static int nodefault_subtype$get(MemorySegment seg, long index) { @@ -93,26 +157,50 @@ public class fuse_cmdline_opts { public static VarHandle mountpoint$VH() { return fuse_cmdline_opts.mountpoint$VH; } - public static MemoryAddress mountpoint$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_cmdline_opts.mountpoint$VH.get(seg); - } - public static void mountpoint$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char* mountpoint; + * } + */ + public static MemorySegment mountpoint$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char* mountpoint; + * } + */ + public static void mountpoint$set(MemorySegment seg, MemorySegment x) { fuse_cmdline_opts.mountpoint$VH.set(seg, x); } - public static MemoryAddress mountpoint$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_cmdline_opts.mountpoint$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment mountpoint$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_cmdline_opts.mountpoint$VH.get(seg.asSlice(index*sizeof())); } - public static void mountpoint$set(MemorySegment seg, long index, MemoryAddress x) { + public static void mountpoint$set(MemorySegment seg, long index, MemorySegment x) { fuse_cmdline_opts.mountpoint$VH.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; } + /** + * Getter for field: + * {@snippet : + * int show_version; + * } + */ public static int show_version$get(MemorySegment seg) { return (int)fuse_cmdline_opts.show_version$VH.get(seg); } - public static void show_version$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_version; + * } + */ + public static void show_version$set(MemorySegment seg, int x) { fuse_cmdline_opts.show_version$VH.set(seg, x); } public static int show_version$get(MemorySegment seg, long index) { @@ -125,10 +213,22 @@ public class fuse_cmdline_opts { public static VarHandle show_help$VH() { return fuse_cmdline_opts.show_help$VH; } + /** + * Getter for field: + * {@snippet : + * int show_help; + * } + */ public static int show_help$get(MemorySegment seg) { return (int)fuse_cmdline_opts.show_help$VH.get(seg); } - public static void show_help$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_help; + * } + */ + public static void show_help$set(MemorySegment seg, int x) { fuse_cmdline_opts.show_help$VH.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { @@ -141,10 +241,22 @@ public class fuse_cmdline_opts { public static VarHandle clone_fd$VH() { return fuse_cmdline_opts.clone_fd$VH; } + /** + * Getter for field: + * {@snippet : + * int clone_fd; + * } + */ public static int clone_fd$get(MemorySegment seg) { return (int)fuse_cmdline_opts.clone_fd$VH.get(seg); } - public static void clone_fd$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int clone_fd; + * } + */ + public static void clone_fd$set(MemorySegment seg, int x) { fuse_cmdline_opts.clone_fd$VH.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { @@ -157,10 +269,22 @@ public class fuse_cmdline_opts { public static VarHandle max_idle_threads$VH() { return fuse_cmdline_opts.max_idle_threads$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ public static int max_idle_threads$get(MemorySegment seg) { return (int)fuse_cmdline_opts.max_idle_threads$VH.get(seg); } - public static void max_idle_threads$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ + public static void max_idle_threads$set(MemorySegment seg, int x) { fuse_cmdline_opts.max_idle_threads$VH.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { @@ -173,10 +297,22 @@ public class fuse_cmdline_opts { public static VarHandle max_threads$VH() { return fuse_cmdline_opts.max_threads$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_threads; + * } + */ public static int max_threads$get(MemorySegment seg) { return (int)fuse_cmdline_opts.max_threads$VH.get(seg); } - public static void max_threads$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_threads; + * } + */ + public static void max_threads$set(MemorySegment seg, int x) { fuse_cmdline_opts.max_threads$VH.set(seg, x); } public static int max_threads$get(MemorySegment seg, long index) { @@ -187,10 +323,10 @@ public class fuse_cmdline_opts { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_config.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_config.java index e73e46a8..cd68db51 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_config.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_config.java @@ -7,9 +7,40 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_config { + * int set_gid; + * unsigned int gid; + * int set_uid; + * unsigned int uid; + * int set_mode; + * unsigned int umask; + * double entry_timeout; + * double negative_timeout; + * double attr_timeout; + * int intr; + * int intr_signal; + * int remember; + * int hard_remove; + * int use_ino; + * int readdir_ino; + * int direct_io; + * int kernel_cache; + * int auto_cache; + * int no_rofd_flush; + * int ac_attr_timeout_set; + * double ac_attr_timeout; + * int nullpath_ok; + * int show_help; + * char* modules; + * int debug; + * }; + * } + */ public class fuse_config { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -45,10 +76,22 @@ public class fuse_config { public static VarHandle set_gid$VH() { return fuse_config.set_gid$VH; } + /** + * Getter for field: + * {@snippet : + * int set_gid; + * } + */ public static int set_gid$get(MemorySegment seg) { return (int)fuse_config.set_gid$VH.get(seg); } - public static void set_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_gid; + * } + */ + public static void set_gid$set(MemorySegment seg, int x) { fuse_config.set_gid$VH.set(seg, x); } public static int set_gid$get(MemorySegment seg, long index) { @@ -61,10 +104,22 @@ public class fuse_config { public static VarHandle gid$VH() { return fuse_config.gid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int gid; + * } + */ public static int gid$get(MemorySegment seg) { return (int)fuse_config.gid$VH.get(seg); } - public static void gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int gid; + * } + */ + public static void gid$set(MemorySegment seg, int x) { fuse_config.gid$VH.set(seg, x); } public static int gid$get(MemorySegment seg, long index) { @@ -77,10 +132,22 @@ public class fuse_config { public static VarHandle set_uid$VH() { return fuse_config.set_uid$VH; } + /** + * Getter for field: + * {@snippet : + * int set_uid; + * } + */ public static int set_uid$get(MemorySegment seg) { return (int)fuse_config.set_uid$VH.get(seg); } - public static void set_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_uid; + * } + */ + public static void set_uid$set(MemorySegment seg, int x) { fuse_config.set_uid$VH.set(seg, x); } public static int set_uid$get(MemorySegment seg, long index) { @@ -93,10 +160,22 @@ public class fuse_config { public static VarHandle uid$VH() { return fuse_config.uid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int uid; + * } + */ public static int uid$get(MemorySegment seg) { return (int)fuse_config.uid$VH.get(seg); } - public static void uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int uid; + * } + */ + public static void uid$set(MemorySegment seg, int x) { fuse_config.uid$VH.set(seg, x); } public static int uid$get(MemorySegment seg, long index) { @@ -109,10 +188,22 @@ public class fuse_config { public static VarHandle set_mode$VH() { return fuse_config.set_mode$VH; } + /** + * Getter for field: + * {@snippet : + * int set_mode; + * } + */ public static int set_mode$get(MemorySegment seg) { return (int)fuse_config.set_mode$VH.get(seg); } - public static void set_mode$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_mode; + * } + */ + public static void set_mode$set(MemorySegment seg, int x) { fuse_config.set_mode$VH.set(seg, x); } public static int set_mode$get(MemorySegment seg, long index) { @@ -125,10 +216,22 @@ public class fuse_config { public static VarHandle umask$VH() { return fuse_config.umask$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int umask; + * } + */ public static int umask$get(MemorySegment seg) { return (int)fuse_config.umask$VH.get(seg); } - public static void umask$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int umask; + * } + */ + public static void umask$set(MemorySegment seg, int x) { fuse_config.umask$VH.set(seg, x); } public static int umask$get(MemorySegment seg, long index) { @@ -141,10 +244,22 @@ public class fuse_config { public static VarHandle entry_timeout$VH() { return fuse_config.entry_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double entry_timeout; + * } + */ public static double entry_timeout$get(MemorySegment seg) { return (double)fuse_config.entry_timeout$VH.get(seg); } - public static void entry_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double entry_timeout; + * } + */ + public static void entry_timeout$set(MemorySegment seg, double x) { fuse_config.entry_timeout$VH.set(seg, x); } public static double entry_timeout$get(MemorySegment seg, long index) { @@ -157,10 +272,22 @@ public class fuse_config { public static VarHandle negative_timeout$VH() { return fuse_config.negative_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double negative_timeout; + * } + */ public static double negative_timeout$get(MemorySegment seg) { return (double)fuse_config.negative_timeout$VH.get(seg); } - public static void negative_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double negative_timeout; + * } + */ + public static void negative_timeout$set(MemorySegment seg, double x) { fuse_config.negative_timeout$VH.set(seg, x); } public static double negative_timeout$get(MemorySegment seg, long index) { @@ -173,10 +300,22 @@ public class fuse_config { public static VarHandle attr_timeout$VH() { return fuse_config.attr_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double attr_timeout; + * } + */ public static double attr_timeout$get(MemorySegment seg) { return (double)fuse_config.attr_timeout$VH.get(seg); } - public static void attr_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double attr_timeout; + * } + */ + public static void attr_timeout$set(MemorySegment seg, double x) { fuse_config.attr_timeout$VH.set(seg, x); } public static double attr_timeout$get(MemorySegment seg, long index) { @@ -189,10 +328,22 @@ public class fuse_config { public static VarHandle intr$VH() { return fuse_config.intr$VH; } + /** + * Getter for field: + * {@snippet : + * int intr; + * } + */ public static int intr$get(MemorySegment seg) { return (int)fuse_config.intr$VH.get(seg); } - public static void intr$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int intr; + * } + */ + public static void intr$set(MemorySegment seg, int x) { fuse_config.intr$VH.set(seg, x); } public static int intr$get(MemorySegment seg, long index) { @@ -205,10 +356,22 @@ public class fuse_config { public static VarHandle intr_signal$VH() { return fuse_config.intr_signal$VH; } + /** + * Getter for field: + * {@snippet : + * int intr_signal; + * } + */ public static int intr_signal$get(MemorySegment seg) { return (int)fuse_config.intr_signal$VH.get(seg); } - public static void intr_signal$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int intr_signal; + * } + */ + public static void intr_signal$set(MemorySegment seg, int x) { fuse_config.intr_signal$VH.set(seg, x); } public static int intr_signal$get(MemorySegment seg, long index) { @@ -221,10 +384,22 @@ public class fuse_config { public static VarHandle remember$VH() { return fuse_config.remember$VH; } + /** + * Getter for field: + * {@snippet : + * int remember; + * } + */ public static int remember$get(MemorySegment seg) { return (int)fuse_config.remember$VH.get(seg); } - public static void remember$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int remember; + * } + */ + public static void remember$set(MemorySegment seg, int x) { fuse_config.remember$VH.set(seg, x); } public static int remember$get(MemorySegment seg, long index) { @@ -237,10 +412,22 @@ public class fuse_config { public static VarHandle hard_remove$VH() { return fuse_config.hard_remove$VH; } + /** + * Getter for field: + * {@snippet : + * int hard_remove; + * } + */ public static int hard_remove$get(MemorySegment seg) { return (int)fuse_config.hard_remove$VH.get(seg); } - public static void hard_remove$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int hard_remove; + * } + */ + public static void hard_remove$set(MemorySegment seg, int x) { fuse_config.hard_remove$VH.set(seg, x); } public static int hard_remove$get(MemorySegment seg, long index) { @@ -253,10 +440,22 @@ public class fuse_config { public static VarHandle use_ino$VH() { return fuse_config.use_ino$VH; } + /** + * Getter for field: + * {@snippet : + * int use_ino; + * } + */ public static int use_ino$get(MemorySegment seg) { return (int)fuse_config.use_ino$VH.get(seg); } - public static void use_ino$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int use_ino; + * } + */ + public static void use_ino$set(MemorySegment seg, int x) { fuse_config.use_ino$VH.set(seg, x); } public static int use_ino$get(MemorySegment seg, long index) { @@ -269,10 +468,22 @@ public class fuse_config { public static VarHandle readdir_ino$VH() { return fuse_config.readdir_ino$VH; } + /** + * Getter for field: + * {@snippet : + * int readdir_ino; + * } + */ public static int readdir_ino$get(MemorySegment seg) { return (int)fuse_config.readdir_ino$VH.get(seg); } - public static void readdir_ino$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int readdir_ino; + * } + */ + public static void readdir_ino$set(MemorySegment seg, int x) { fuse_config.readdir_ino$VH.set(seg, x); } public static int readdir_ino$get(MemorySegment seg, long index) { @@ -285,10 +496,22 @@ public class fuse_config { public static VarHandle direct_io$VH() { return fuse_config.direct_io$VH; } + /** + * Getter for field: + * {@snippet : + * int direct_io; + * } + */ public static int direct_io$get(MemorySegment seg) { return (int)fuse_config.direct_io$VH.get(seg); } - public static void direct_io$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int direct_io; + * } + */ + public static void direct_io$set(MemorySegment seg, int x) { fuse_config.direct_io$VH.set(seg, x); } public static int direct_io$get(MemorySegment seg, long index) { @@ -301,10 +524,22 @@ public class fuse_config { public static VarHandle kernel_cache$VH() { return fuse_config.kernel_cache$VH; } + /** + * Getter for field: + * {@snippet : + * int kernel_cache; + * } + */ public static int kernel_cache$get(MemorySegment seg) { return (int)fuse_config.kernel_cache$VH.get(seg); } - public static void kernel_cache$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int kernel_cache; + * } + */ + public static void kernel_cache$set(MemorySegment seg, int x) { fuse_config.kernel_cache$VH.set(seg, x); } public static int kernel_cache$get(MemorySegment seg, long index) { @@ -317,10 +552,22 @@ public class fuse_config { public static VarHandle auto_cache$VH() { return fuse_config.auto_cache$VH; } + /** + * Getter for field: + * {@snippet : + * int auto_cache; + * } + */ public static int auto_cache$get(MemorySegment seg) { return (int)fuse_config.auto_cache$VH.get(seg); } - public static void auto_cache$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int auto_cache; + * } + */ + public static void auto_cache$set(MemorySegment seg, int x) { fuse_config.auto_cache$VH.set(seg, x); } public static int auto_cache$get(MemorySegment seg, long index) { @@ -333,10 +580,22 @@ public class fuse_config { public static VarHandle no_rofd_flush$VH() { return fuse_config.no_rofd_flush$VH; } + /** + * Getter for field: + * {@snippet : + * int no_rofd_flush; + * } + */ public static int no_rofd_flush$get(MemorySegment seg) { return (int)fuse_config.no_rofd_flush$VH.get(seg); } - public static void no_rofd_flush$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int no_rofd_flush; + * } + */ + public static void no_rofd_flush$set(MemorySegment seg, int x) { fuse_config.no_rofd_flush$VH.set(seg, x); } public static int no_rofd_flush$get(MemorySegment seg, long index) { @@ -349,10 +608,22 @@ public class fuse_config { public static VarHandle ac_attr_timeout_set$VH() { return fuse_config.ac_attr_timeout_set$VH; } + /** + * Getter for field: + * {@snippet : + * int ac_attr_timeout_set; + * } + */ public static int ac_attr_timeout_set$get(MemorySegment seg) { return (int)fuse_config.ac_attr_timeout_set$VH.get(seg); } - public static void ac_attr_timeout_set$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int ac_attr_timeout_set; + * } + */ + public static void ac_attr_timeout_set$set(MemorySegment seg, int x) { fuse_config.ac_attr_timeout_set$VH.set(seg, x); } public static int ac_attr_timeout_set$get(MemorySegment seg, long index) { @@ -365,10 +636,22 @@ public class fuse_config { public static VarHandle ac_attr_timeout$VH() { return fuse_config.ac_attr_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double ac_attr_timeout; + * } + */ public static double ac_attr_timeout$get(MemorySegment seg) { return (double)fuse_config.ac_attr_timeout$VH.get(seg); } - public static void ac_attr_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double ac_attr_timeout; + * } + */ + public static void ac_attr_timeout$set(MemorySegment seg, double x) { fuse_config.ac_attr_timeout$VH.set(seg, x); } public static double ac_attr_timeout$get(MemorySegment seg, long index) { @@ -381,10 +664,22 @@ public class fuse_config { public static VarHandle nullpath_ok$VH() { return fuse_config.nullpath_ok$VH; } + /** + * Getter for field: + * {@snippet : + * int nullpath_ok; + * } + */ public static int nullpath_ok$get(MemorySegment seg) { return (int)fuse_config.nullpath_ok$VH.get(seg); } - public static void nullpath_ok$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int nullpath_ok; + * } + */ + public static void nullpath_ok$set(MemorySegment seg, int x) { fuse_config.nullpath_ok$VH.set(seg, x); } public static int nullpath_ok$get(MemorySegment seg, long index) { @@ -397,10 +692,22 @@ public class fuse_config { public static VarHandle show_help$VH() { return fuse_config.show_help$VH; } + /** + * Getter for field: + * {@snippet : + * int show_help; + * } + */ public static int show_help$get(MemorySegment seg) { return (int)fuse_config.show_help$VH.get(seg); } - public static void show_help$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_help; + * } + */ + public static void show_help$set(MemorySegment seg, int x) { fuse_config.show_help$VH.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { @@ -413,26 +720,50 @@ public class fuse_config { public static VarHandle modules$VH() { return fuse_config.modules$VH; } - public static MemoryAddress modules$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_config.modules$VH.get(seg); - } - public static void modules$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char* modules; + * } + */ + public static MemorySegment modules$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char* modules; + * } + */ + public static void modules$set(MemorySegment seg, MemorySegment x) { fuse_config.modules$VH.set(seg, x); } - public static MemoryAddress modules$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_config.modules$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment modules$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_config.modules$VH.get(seg.asSlice(index*sizeof())); } - public static void modules$set(MemorySegment seg, long index, MemoryAddress x) { + public static void modules$set(MemorySegment seg, long index, MemorySegment x) { fuse_config.modules$VH.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; } + /** + * Getter for field: + * {@snippet : + * int debug; + * } + */ public static int debug$get(MemorySegment seg) { return (int)fuse_config.debug$VH.get(seg); } - public static void debug$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int debug; + * } + */ + public static void debug$set(MemorySegment seg, int x) { fuse_config.debug$VH.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { @@ -443,10 +774,10 @@ public class fuse_config { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_conn_info.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_conn_info.java index 1dda6cea..7cbbeb6f 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_conn_info.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_conn_info.java @@ -7,9 +7,26 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_conn_info { + * unsigned int proto_major; + * unsigned int proto_minor; + * unsigned int max_write; + * unsigned int max_read; + * unsigned int max_readahead; + * unsigned int capable; + * unsigned int want; + * unsigned int max_background; + * unsigned int congestion_threshold; + * unsigned int time_gran; + * unsigned int reserved[22]; + * }; + * } + */ public class fuse_conn_info { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -29,10 +46,22 @@ public class fuse_conn_info { public static VarHandle proto_major$VH() { return fuse_conn_info.proto_major$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ public static int proto_major$get(MemorySegment seg) { return (int)fuse_conn_info.proto_major$VH.get(seg); } - public static void proto_major$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ + public static void proto_major$set(MemorySegment seg, int x) { fuse_conn_info.proto_major$VH.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { @@ -45,10 +74,22 @@ public class fuse_conn_info { public static VarHandle proto_minor$VH() { return fuse_conn_info.proto_minor$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ public static int proto_minor$get(MemorySegment seg) { return (int)fuse_conn_info.proto_minor$VH.get(seg); } - public static void proto_minor$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ + public static void proto_minor$set(MemorySegment seg, int x) { fuse_conn_info.proto_minor$VH.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { @@ -61,10 +102,22 @@ public class fuse_conn_info { public static VarHandle max_write$VH() { return fuse_conn_info.max_write$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_write; + * } + */ public static int max_write$get(MemorySegment seg) { return (int)fuse_conn_info.max_write$VH.get(seg); } - public static void max_write$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_write; + * } + */ + public static void max_write$set(MemorySegment seg, int x) { fuse_conn_info.max_write$VH.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { @@ -77,10 +130,22 @@ public class fuse_conn_info { public static VarHandle max_read$VH() { return fuse_conn_info.max_read$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_read; + * } + */ public static int max_read$get(MemorySegment seg) { return (int)fuse_conn_info.max_read$VH.get(seg); } - public static void max_read$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_read; + * } + */ + public static void max_read$set(MemorySegment seg, int x) { fuse_conn_info.max_read$VH.set(seg, x); } public static int max_read$get(MemorySegment seg, long index) { @@ -93,10 +158,22 @@ public class fuse_conn_info { public static VarHandle max_readahead$VH() { return fuse_conn_info.max_readahead$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ public static int max_readahead$get(MemorySegment seg) { return (int)fuse_conn_info.max_readahead$VH.get(seg); } - public static void max_readahead$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ + public static void max_readahead$set(MemorySegment seg, int x) { fuse_conn_info.max_readahead$VH.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { @@ -109,10 +186,22 @@ public class fuse_conn_info { public static VarHandle capable$VH() { return fuse_conn_info.capable$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int capable; + * } + */ public static int capable$get(MemorySegment seg) { return (int)fuse_conn_info.capable$VH.get(seg); } - public static void capable$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int capable; + * } + */ + public static void capable$set(MemorySegment seg, int x) { fuse_conn_info.capable$VH.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { @@ -125,10 +214,22 @@ public class fuse_conn_info { public static VarHandle want$VH() { return fuse_conn_info.want$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int want; + * } + */ public static int want$get(MemorySegment seg) { return (int)fuse_conn_info.want$VH.get(seg); } - public static void want$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int want; + * } + */ + public static void want$set(MemorySegment seg, int x) { fuse_conn_info.want$VH.set(seg, x); } public static int want$get(MemorySegment seg, long index) { @@ -141,10 +242,22 @@ public class fuse_conn_info { public static VarHandle max_background$VH() { return fuse_conn_info.max_background$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_background; + * } + */ public static int max_background$get(MemorySegment seg) { return (int)fuse_conn_info.max_background$VH.get(seg); } - public static void max_background$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_background; + * } + */ + public static void max_background$set(MemorySegment seg, int x) { fuse_conn_info.max_background$VH.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { @@ -157,10 +270,22 @@ public class fuse_conn_info { public static VarHandle congestion_threshold$VH() { return fuse_conn_info.congestion_threshold$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ public static int congestion_threshold$get(MemorySegment seg) { return (int)fuse_conn_info.congestion_threshold$VH.get(seg); } - public static void congestion_threshold$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ + public static void congestion_threshold$set(MemorySegment seg, int x) { fuse_conn_info.congestion_threshold$VH.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { @@ -173,10 +298,22 @@ public class fuse_conn_info { public static VarHandle time_gran$VH() { return fuse_conn_info.time_gran$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int time_gran; + * } + */ public static int time_gran$get(MemorySegment seg) { return (int)fuse_conn_info.time_gran$VH.get(seg); } - public static void time_gran$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int time_gran; + * } + */ + public static void time_gran$set(MemorySegment seg, int x) { fuse_conn_info.time_gran$VH.set(seg, x); } public static int time_gran$get(MemorySegment seg, long index) { @@ -190,10 +327,10 @@ public class fuse_conn_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_file_info.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_file_info.java index 60c07e93..221e4db7 100644 --- 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 @@ -7,9 +7,29 @@ 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 GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_INT$LAYOUT.withName("flags"), MemoryLayout.structLayout( MemoryLayout.paddingLayout(1).withName("writepage"), @@ -36,10 +56,22 @@ public class fuse_file_info { 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); } - public static void flags$set( MemorySegment seg, int x) { + /** + * 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) { @@ -52,10 +84,22 @@ public class fuse_file_info { 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); } - public static void fh$set( MemorySegment seg, long x) { + /** + * 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) { @@ -68,10 +112,22 @@ public class fuse_file_info { 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); } - public static void lock_owner$set( MemorySegment seg, long x) { + /** + * 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) { @@ -84,10 +140,22 @@ public class fuse_file_info { 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); } - public static void poll_events$set( MemorySegment seg, int x) { + /** + * 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) { @@ -98,10 +166,10 @@ public class fuse_file_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_fill_dir_t.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_fill_dir_t.java index fac20ad9..1468d8e5 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_fill_dir_t.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_fill_dir_t.java @@ -7,17 +7,22 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * int (*fuse_fill_dir_t)(void* buf,char* name,struct stat* stbuf,long off,enum fuse_fill_dir_flags flags); + * } + */ public interface fuse_fill_dir_t { - int apply(java.lang.foreign.MemoryAddress buf, java.lang.foreign.MemoryAddress name, java.lang.foreign.MemoryAddress stbuf, long off, int flags); - static MemorySegment allocate(fuse_fill_dir_t fi, MemorySession session) { - return RuntimeHelper.upcallStub(fuse_fill_dir_t.class, fi, constants$0.fuse_fill_dir_t$FUNC, session); + 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 fuse_fill_dir_t ofAddress(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress _buf, java.lang.foreign.MemoryAddress _name, java.lang.foreign.MemoryAddress _stbuf, long _off, int _flags) -> { + static fuse_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + 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((Addressable)symbol, (java.lang.foreign.Addressable)_buf, (java.lang.foreign.Addressable)_name, (java.lang.foreign.Addressable)_stbuf, _off, _flags); + return (int)constants$1.fuse_fill_dir_t$MH.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-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_h.java index d573932e..59babf88 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_h.java @@ -9,19 +9,23 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - /* package-private */ fuse_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 MethodHandle fuse_version$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_version$MH,"fuse_version"); } - public static int fuse_version () { + /** + * {@snippet : + * int fuse_version(); + * } + */ + public static int fuse_version() { var mh$ = fuse_version$MH(); try { return (int)mh$.invokeExact(); @@ -32,10 +36,15 @@ 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"); } - public static MemoryAddress fuse_loop_cfg_create () { + /** + * {@snippet : + * struct fuse_loop_config* fuse_loop_cfg_create(); + * } + */ + public static MemorySegment fuse_loop_cfg_create() { var mh$ = fuse_loop_cfg_create$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -43,7 +52,12 @@ public static MemoryAddress 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"); } - public static void fuse_loop_cfg_destroy ( Addressable config) { + /** + * {@snippet : + * void fuse_loop_cfg_destroy(struct fuse_loop_config* config); + * } + */ + public static void fuse_loop_cfg_destroy(MemorySegment config) { var mh$ = fuse_loop_cfg_destroy$MH(); try { mh$.invokeExact(config); @@ -54,7 +68,12 @@ public static void fuse_loop_cfg_destroy ( Addressable 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"); } - public static void fuse_loop_cfg_set_max_threads ( Addressable config, int value) { + /** + * {@snippet : + * void fuse_loop_cfg_set_max_threads(struct fuse_loop_config* config, unsigned int value); + * } + */ + public static void fuse_loop_cfg_set_max_threads(MemorySegment config, int value) { var mh$ = fuse_loop_cfg_set_max_threads$MH(); try { mh$.invokeExact(config, value); @@ -65,7 +84,12 @@ public static void fuse_loop_cfg_set_max_threads ( Addressable config, int valu 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"); } - public static void fuse_loop_cfg_set_clone_fd ( Addressable config, int value) { + /** + * {@snippet : + * void fuse_loop_cfg_set_clone_fd(struct fuse_loop_config* config, unsigned int value); + * } + */ + public static void fuse_loop_cfg_set_clone_fd(MemorySegment config, int value) { var mh$ = fuse_loop_cfg_set_clone_fd$MH(); try { mh$.invokeExact(config, value); @@ -76,7 +100,12 @@ public static void fuse_loop_cfg_set_clone_fd ( Addressable config, int value) public static MethodHandle fuse_lib_help$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_lib_help$MH,"fuse_lib_help"); } - public static void fuse_lib_help ( Addressable args) { + /** + * {@snippet : + * void fuse_lib_help(struct fuse_args* args); + * } + */ + public static void fuse_lib_help(MemorySegment args) { var mh$ = fuse_lib_help$MH(); try { mh$.invokeExact(args); @@ -87,10 +116,15 @@ public static void fuse_lib_help ( Addressable args) { public static MethodHandle fuse_new$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_new$MH,"fuse_new"); } - public static MemoryAddress fuse_new ( Addressable args, Addressable op, long op_size, Addressable private_data) { + /** + * {@snippet : + * struct fuse* fuse_new(struct fuse_args* args, struct fuse_operations* op, size_t op_size, void* private_data); + * } + */ + public static MemorySegment fuse_new(MemorySegment args, MemorySegment op, long op_size, MemorySegment private_data) { var mh$ = fuse_new$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(args, op, op_size, private_data); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(args, op, op_size, private_data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -98,7 +132,12 @@ public static MemoryAddress fuse_new ( Addressable args, Addressable op, long public static MethodHandle fuse_mount$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_mount$MH,"fuse_mount"); } - public static int fuse_mount ( Addressable f, Addressable mountpoint) { + /** + * {@snippet : + * int fuse_mount(struct fuse* f, char* mountpoint); + * } + */ + public static int fuse_mount(MemorySegment f, MemorySegment mountpoint) { var mh$ = fuse_mount$MH(); try { return (int)mh$.invokeExact(f, mountpoint); @@ -109,7 +148,12 @@ public static int fuse_mount ( Addressable f, Addressable mountpoint) { public static MethodHandle fuse_unmount$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_unmount$MH,"fuse_unmount"); } - public static void fuse_unmount ( Addressable f) { + /** + * {@snippet : + * void fuse_unmount(struct fuse* f); + * } + */ + public static void fuse_unmount(MemorySegment f) { var mh$ = fuse_unmount$MH(); try { mh$.invokeExact(f); @@ -120,7 +164,12 @@ public static void fuse_unmount ( Addressable f) { public static MethodHandle fuse_destroy$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_destroy$MH,"fuse_destroy"); } - public static void fuse_destroy ( Addressable f) { + /** + * {@snippet : + * void fuse_destroy(struct fuse* f); + * } + */ + public static void fuse_destroy(MemorySegment f) { var mh$ = fuse_destroy$MH(); try { mh$.invokeExact(f); @@ -131,7 +180,12 @@ public static void fuse_destroy ( Addressable f) { public static MethodHandle fuse_loop$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_loop$MH,"fuse_loop"); } - public static int fuse_loop ( Addressable f) { + /** + * {@snippet : + * int fuse_loop(struct fuse* f); + * } + */ + public static int fuse_loop(MemorySegment f) { var mh$ = fuse_loop$MH(); try { return (int)mh$.invokeExact(f); @@ -142,7 +196,12 @@ public static int fuse_loop ( Addressable f) { public static MethodHandle fuse_exit$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_exit$MH,"fuse_exit"); } - public static void fuse_exit ( Addressable f) { + /** + * {@snippet : + * void fuse_exit(struct fuse* f); + * } + */ + public static void fuse_exit(MemorySegment f) { var mh$ = fuse_exit$MH(); try { mh$.invokeExact(f); @@ -153,7 +212,12 @@ public static void fuse_exit ( Addressable f) { public static MethodHandle fuse_loop_mt$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_loop_mt$MH,"fuse_loop_mt"); } - public static int fuse_loop_mt ( Addressable f, Addressable config) { + /** + * {@snippet : + * int fuse_loop_mt(struct fuse* f, struct fuse_loop_config* config); + * } + */ + public static int fuse_loop_mt(MemorySegment f, MemorySegment config) { var mh$ = fuse_loop_mt$MH(); try { return (int)mh$.invokeExact(f, config); @@ -164,10 +228,15 @@ public static int fuse_loop_mt ( Addressable f, Addressable config) { public static MethodHandle fuse_get_session$MH() { return RuntimeHelper.requireNonNull(constants$2.fuse_get_session$MH,"fuse_get_session"); } - public static MemoryAddress fuse_get_session ( Addressable f) { + /** + * {@snippet : + * struct fuse_session* fuse_get_session(struct fuse* f); + * } + */ + public static MemorySegment fuse_get_session(MemorySegment f) { var mh$ = fuse_get_session$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(f); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(f); } 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_loop_config_v1.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_loop_config_v1.java index 02f3b7ed..4414356b 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_loop_config_v1.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/fuse_loop_config_v1.java @@ -7,9 +7,17 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_loop_config_v1 { + * int clone_fd; + * unsigned int max_idle_threads; + * }; + * } + */ public class fuse_loop_config_v1 { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"); @@ -20,10 +28,22 @@ public class fuse_loop_config_v1 { public static VarHandle clone_fd$VH() { return fuse_loop_config_v1.clone_fd$VH; } + /** + * Getter for field: + * {@snippet : + * int clone_fd; + * } + */ public static int clone_fd$get(MemorySegment seg) { return (int)fuse_loop_config_v1.clone_fd$VH.get(seg); } - public static void clone_fd$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int clone_fd; + * } + */ + public static void clone_fd$set(MemorySegment seg, int x) { fuse_loop_config_v1.clone_fd$VH.set(seg, x); } public static int clone_fd$get(MemorySegment seg, long index) { @@ -36,10 +56,22 @@ public class fuse_loop_config_v1 { public static VarHandle max_idle_threads$VH() { return fuse_loop_config_v1.max_idle_threads$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ public static int max_idle_threads$get(MemorySegment seg) { return (int)fuse_loop_config_v1.max_idle_threads$VH.get(seg); } - public static void max_idle_threads$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ + public static void max_idle_threads$set(MemorySegment seg, int x) { fuse_loop_config_v1.max_idle_threads$VH.set(seg, x); } public static int max_idle_threads$get(MemorySegment seg, long index) { @@ -50,10 +82,10 @@ public class fuse_loop_config_v1 { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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 index 5eb7c15a..12b15489 100644 --- 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 @@ -9,15 +9,14 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_lowlevel_h { - /* package-private */ fuse_lowlevel_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 index 37795014..84819230 100644 --- 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 @@ -7,9 +7,57 @@ 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 GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -64,17 +112,22 @@ public class fuse_operations { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(getattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse_operations.getattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.getattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -86,20 +139,32 @@ static getattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getattr$VH() { return fuse_operations.getattr$VH; } - public static MemoryAddress getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getattr$VH.get(seg); - } - public static void getattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getattr.ofAddress(getattr$get(segment), session); + 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, @@ -109,17 +174,22 @@ public static getattr getattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(readlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse_operations.readlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -131,20 +201,32 @@ static readlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readlink$VH() { return fuse_operations.readlink$VH; } - public static MemoryAddress readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readlink$VH.get(seg); - } - public static void readlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readlink.ofAddress(readlink$get(segment), session); + 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, @@ -154,17 +236,22 @@ public static readlink readlink (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, long _x2); - static MemorySegment allocate(mknod fi, MemorySession session) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse_operations.mknod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2); + return (int)fuse_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -176,20 +263,32 @@ static mknod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mknod$VH() { return fuse_operations.mknod$VH; } - public static MemoryAddress mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mknod$VH.get(seg); - } - public static void mknod$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mknod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mknod.ofAddress(mknod$get(segment), session); + 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, @@ -198,17 +297,22 @@ public static mknod mknod (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1); - static MemorySegment allocate(mkdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse_operations.mkdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -220,20 +324,32 @@ static mkdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mkdir$VH() { return fuse_operations.mkdir$VH; } - public static MemoryAddress mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mkdir$VH.get(seg); - } - public static void mkdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mkdir.ofAddress(mkdir$get(segment), session); + 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 @@ -241,17 +357,22 @@ public static mkdir mkdir (MemorySegment segment, MemorySession session) { static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( fuse_operations.unlink$FUNC ); + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ public interface unlink { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(unlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse_operations.unlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse_operations.unlink$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -263,20 +384,32 @@ static unlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle unlink$VH() { return fuse_operations.unlink$VH; } - public static MemoryAddress unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.unlink$VH.get(seg); - } - public static void unlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.unlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return unlink.ofAddress(unlink$get(segment), session); + 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 @@ -284,17 +417,22 @@ public static unlink unlink (MemorySegment segment, MemorySession session) { static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( fuse_operations.rmdir$FUNC ); + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ public interface rmdir { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(rmdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse_operations.rmdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse_operations.rmdir$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -306,20 +444,32 @@ static rmdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rmdir$VH() { return fuse_operations.rmdir$VH; } - public static MemoryAddress rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rmdir$VH.get(seg); - } - public static void rmdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rmdir.ofAddress(rmdir$get(segment), session); + 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, @@ -328,17 +478,22 @@ public static rmdir rmdir (MemorySegment segment, MemorySession session) { static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( fuse_operations.symlink$FUNC ); + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ public interface symlink { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(symlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse_operations.symlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.symlink$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -350,20 +505,32 @@ static symlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle symlink$VH() { return fuse_operations.symlink$VH; } - public static MemoryAddress symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.symlink$VH.get(seg); - } - public static void symlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.symlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return symlink.ofAddress(symlink$get(segment), session); + 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, @@ -373,17 +540,22 @@ public static symlink symlink (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(rename fi, MemorySession session) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse_operations.rename$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.rename$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -395,20 +567,32 @@ static rename ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rename$VH() { return fuse_operations.rename$VH; } - public static MemoryAddress rename$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rename$VH.get(seg); - } - public static void rename$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rename$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rename.ofAddress(rename$get(segment), session); + 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, @@ -417,17 +601,22 @@ public static rename rename (MemorySegment segment, MemorySession session) { static final MethodHandle link$MH = RuntimeHelper.downcallHandle( fuse_operations.link$FUNC ); + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ public interface link { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(link fi, MemorySession session) { - return RuntimeHelper.upcallStub(link.class, fi, fuse_operations.link$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.link$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -439,20 +628,32 @@ static link ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle link$VH() { return fuse_operations.link$VH; } - public static MemoryAddress link$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.link$VH.get(seg); - } - public static void link$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.link$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return link.ofAddress(link$get(segment), session); + 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, @@ -462,17 +663,22 @@ public static link link (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(chmod fi, MemorySession session) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse_operations.chmod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.chmod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -484,20 +690,32 @@ static chmod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chmod$VH() { return fuse_operations.chmod$VH; } - public static MemoryAddress chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chmod$VH.get(seg); - } - public static void chmod$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chmod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chmod.ofAddress(chmod$get(segment), session); + 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, @@ -508,17 +726,22 @@ public static chmod chmod (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(chown fi, MemorySession session) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse_operations.chown$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -530,20 +753,32 @@ static chown ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chown$VH() { return fuse_operations.chown$VH; } - public static MemoryAddress chown$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chown$VH.get(seg); - } - public static void chown$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chown$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chown.ofAddress(chown$get(segment), session); + 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, @@ -553,17 +788,22 @@ public static chown chown (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(truncate fi, MemorySession session) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse_operations.truncate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.truncate$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -575,20 +815,32 @@ static truncate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle truncate$VH() { return fuse_operations.truncate$VH; } - public static MemoryAddress truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.truncate$VH.get(seg); - } - public static void truncate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.truncate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return truncate.ofAddress(truncate$get(segment), session); + 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, @@ -597,17 +849,22 @@ public static truncate truncate (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(open fi, MemorySession session) { - return RuntimeHelper.upcallStub(open.class, fi, fuse_operations.open$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.open$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -619,20 +876,32 @@ static open ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle open$VH() { return fuse_operations.open$VH; } - public static MemoryAddress open$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.open$VH.get(seg); - } - public static void open$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.open$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return open.ofAddress(open$get(segment), session); + 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, @@ -644,17 +913,22 @@ public static open open (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read fi, MemorySession session) { - return RuntimeHelper.upcallStub(read.class, fi, fuse_operations.read$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -666,20 +940,32 @@ static read ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read$VH() { return fuse_operations.read$VH; } - public static MemoryAddress read$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read$VH.get(seg); - } - public static void read$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read.ofAddress(read$get(segment), session); + 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, @@ -691,17 +977,22 @@ public static read read (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(write fi, MemorySession session) { - return RuntimeHelper.upcallStub(write.class, fi, fuse_operations.write$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -713,20 +1004,32 @@ static write ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write$VH() { return fuse_operations.write$VH; } - public static MemoryAddress write$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write$VH.get(seg); - } - public static void write$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write.ofAddress(write$get(segment), session); + 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, @@ -735,17 +1038,22 @@ public static write write (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(statfs fi, MemorySession session) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse_operations.statfs$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.statfs$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -757,20 +1065,32 @@ static statfs ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle statfs$VH() { return fuse_operations.statfs$VH; } - public static MemoryAddress statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.statfs$VH.get(seg); - } - public static void statfs$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.statfs$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return statfs.ofAddress(statfs$get(segment), session); + 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, @@ -779,17 +1099,22 @@ public static statfs statfs (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(flush fi, MemorySession session) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse_operations.flush$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.flush$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -801,20 +1126,32 @@ static flush ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flush$VH() { return fuse_operations.flush$VH; } - public static MemoryAddress flush$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flush$VH.get(seg); - } - public static void flush$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flush$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flush.ofAddress(flush$get(segment), session); + 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, @@ -823,17 +1160,22 @@ public static flush flush (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(release fi, MemorySession session) { - return RuntimeHelper.upcallStub(release.class, fi, fuse_operations.release$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.release$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -845,20 +1187,32 @@ static release ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle release$VH() { return fuse_operations.release$VH; } - public static MemoryAddress release$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.release$VH.get(seg); - } - public static void release$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.release$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return release.ofAddress(release$get(segment), session); + 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, @@ -868,17 +1222,22 @@ public static release release (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsync fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse_operations.fsync$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -890,20 +1249,32 @@ static fsync ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsync$VH() { return fuse_operations.fsync$VH; } - public static MemoryAddress fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsync$VH.get(seg); - } - public static void fsync$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsync$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsync.ofAddress(fsync$get(segment), session); + 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, @@ -915,17 +1286,22 @@ public static fsync fsync (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse_operations.setxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, int __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, __x4); + return (int)fuse_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -937,20 +1313,32 @@ static setxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle setxattr$VH() { return fuse_operations.setxattr$VH; } - public static MemoryAddress setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.setxattr$VH.get(seg); - } - public static void setxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return setxattr.ofAddress(setxattr$get(segment), session); + 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, @@ -961,17 +1349,22 @@ public static setxattr setxattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3); - static MemorySegment allocate(getxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse_operations.getxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3); + return (int)fuse_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -983,20 +1376,32 @@ static getxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getxattr$VH() { return fuse_operations.getxattr$VH; } - public static MemoryAddress getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getxattr$VH.get(seg); - } - public static void getxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getxattr.ofAddress(getxattr$get(segment), session); + 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, @@ -1006,17 +1411,22 @@ public static getxattr getxattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(listxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse_operations.listxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1028,20 +1438,32 @@ static listxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle listxattr$VH() { return fuse_operations.listxattr$VH; } - public static MemoryAddress listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.listxattr$VH.get(seg); - } - public static void listxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return listxattr.ofAddress(listxattr$get(segment), session); + 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, @@ -1050,17 +1472,22 @@ public static listxattr listxattr (MemorySegment segment, MemorySession session) static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( fuse_operations.removexattr$FUNC ); + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ public interface removexattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(removexattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse_operations.removexattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1072,20 +1499,32 @@ static removexattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle removexattr$VH() { return fuse_operations.removexattr$VH; } - public static MemoryAddress removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.removexattr$VH.get(seg); - } - public static void removexattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return removexattr.ofAddress(removexattr$get(segment), session); + 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, @@ -1094,17 +1533,22 @@ public static removexattr removexattr (MemorySegment segment, MemorySession sess 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(opendir fi, MemorySession session) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse_operations.opendir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.opendir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1116,20 +1560,32 @@ static opendir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle opendir$VH() { return fuse_operations.opendir$VH; } - public static MemoryAddress opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.opendir$VH.get(seg); - } - public static void opendir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.opendir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return opendir.ofAddress(opendir$get(segment), session); + 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, @@ -1142,17 +1598,22 @@ public static opendir opendir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, java.lang.foreign.MemoryAddress _x4, int _x5); - static MemorySegment allocate(readdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse_operations.readdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, java.lang.foreign.MemoryAddress __x4, int __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, (java.lang.foreign.Addressable)__x4, __x5); + 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$); } @@ -1164,20 +1625,32 @@ static readdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readdir$VH() { return fuse_operations.readdir$VH; } - public static MemoryAddress readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readdir$VH.get(seg); - } - public static void readdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readdir.ofAddress(readdir$get(segment), session); + 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, @@ -1186,17 +1659,22 @@ public static readdir readdir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(releasedir fi, MemorySession session) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse_operations.releasedir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1208,20 +1686,32 @@ static releasedir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle releasedir$VH() { return fuse_operations.releasedir$VH; } - public static MemoryAddress releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.releasedir$VH.get(seg); - } - public static void releasedir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return releasedir.ofAddress(releasedir$get(segment), session); + 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, @@ -1231,17 +1721,22 @@ public static releasedir releasedir (MemorySegment segment, MemorySession sessio 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsyncdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse_operations.fsyncdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1253,20 +1748,32 @@ static fsyncdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsyncdir$VH() { return fuse_operations.fsyncdir$VH; } - public static MemoryAddress fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsyncdir$VH.get(seg); - } - public static void fsyncdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsyncdir.ofAddress(fsyncdir$get(segment), session); + 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, @@ -1275,17 +1782,22 @@ public static fsyncdir fsyncdir (MemorySegment segment, MemorySession session) { 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.Addressable apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(init fi, MemorySession session) { - return RuntimeHelper.upcallStub(init.class, fi, fuse_operations.init$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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.Addressable)(java.lang.foreign.MemoryAddress)fuse_operations.init$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (java.lang.foreign.MemorySegment)fuse_operations.init$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1297,20 +1809,32 @@ static init ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle init$VH() { return fuse_operations.init$VH; } - public static MemoryAddress init$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.init$VH.get(seg); - } - public static void init$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.init$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return init.ofAddress(init$get(segment), session); + 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 @@ -1318,17 +1842,22 @@ public static init init (MemorySegment segment, MemorySession session) { static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( fuse_operations.destroy$FUNC ); + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ public interface destroy { - void apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(destroy fi, MemorySession session) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse_operations.destroy$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + fuse_operations.destroy$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1340,20 +1869,32 @@ static destroy ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle destroy$VH() { return fuse_operations.destroy$VH; } - public static MemoryAddress destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.destroy$VH.get(seg); - } - public static void destroy$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.destroy$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return destroy.ofAddress(destroy$get(segment), session); + 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, @@ -1362,17 +1903,22 @@ public static destroy destroy (MemorySegment segment, MemorySession session) { static final MethodHandle access$MH = RuntimeHelper.downcallHandle( fuse_operations.access$FUNC ); + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ public interface access { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1); - static MemorySegment allocate(access fi, MemorySession session) { - return RuntimeHelper.upcallStub(access.class, fi, fuse_operations.access$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.access$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1384,20 +1930,32 @@ static access ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle access$VH() { return fuse_operations.access$VH; } - public static MemoryAddress access$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.access$VH.get(seg); - } - public static void access$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.access$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return access.ofAddress(access$get(segment), session); + 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, @@ -1407,17 +1965,22 @@ public static access access (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(create fi, MemorySession session) { - return RuntimeHelper.upcallStub(create.class, fi, fuse_operations.create$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1429,20 +1992,32 @@ static create ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle create$VH() { return fuse_operations.create$VH; } - public static MemoryAddress create$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.create$VH.get(seg); - } - public static void create$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.create$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return create.ofAddress(create$get(segment), session); + 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, @@ -1453,17 +2028,22 @@ public static create create (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(lock fi, MemorySession session) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse_operations.lock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1475,20 +2055,32 @@ static lock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle lock$VH() { return fuse_operations.lock$VH; } - public static MemoryAddress lock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lock$VH.get(seg); - } - public static void lock$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return lock.ofAddress(lock$get(segment), session); + 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, @@ -1498,17 +2090,22 @@ public static lock lock (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(utimens fi, MemorySession session) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse_operations.utimens$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.utimens$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1520,20 +2117,32 @@ static utimens ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle utimens$VH() { return fuse_operations.utimens$VH; } - public static MemoryAddress utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utimens$VH.get(seg); - } - public static void utimens$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utimens$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return utimens.ofAddress(utimens$get(segment), session); + 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, @@ -1543,17 +2152,22 @@ public static utimens utimens (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(bmap fi, MemorySession session) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse_operations.bmap$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1565,20 +2179,32 @@ static bmap ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle bmap$VH() { return fuse_operations.bmap$VH; } - public static MemoryAddress bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.bmap$VH.get(seg); - } - public static void bmap$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.bmap$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return bmap.ofAddress(bmap$get(segment), session); + 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, @@ -1591,17 +2217,22 @@ public static bmap bmap (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3, int _x4, java.lang.foreign.MemoryAddress _x5); - static MemorySegment allocate(ioctl fi, MemorySession session) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse_operations.ioctl$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3, int __x4, java.lang.foreign.MemoryAddress __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3, __x4, (java.lang.foreign.Addressable)__x5); + 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$); } @@ -1613,20 +2244,32 @@ static ioctl ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle ioctl$VH() { return fuse_operations.ioctl$VH; } - public static MemoryAddress ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ioctl$VH.get(seg); - } - public static void ioctl$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return ioctl.ofAddress(ioctl$get(segment), session); + 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, @@ -1637,17 +2280,22 @@ public static ioctl ioctl (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(poll fi, MemorySession session) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse_operations.poll$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1659,20 +2307,32 @@ static poll ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle poll$VH() { return fuse_operations.poll$VH; } - public static MemoryAddress poll$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.poll$VH.get(seg); - } - public static void poll$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.poll$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return poll.ofAddress(poll$get(segment), session); + 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, @@ -1683,17 +2343,22 @@ public static poll poll (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(write_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse_operations.write_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1705,20 +2370,32 @@ static write_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write_buf$VH() { return fuse_operations.write_buf$VH; } - public static MemoryAddress write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write_buf$VH.get(seg); - } - public static void write_buf$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write_buf.ofAddress(write_buf$get(segment), session); + 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, @@ -1730,17 +2407,22 @@ public static write_buf write_buf (MemorySegment segment, MemorySession session) 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse_operations.read_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + 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$); } @@ -1752,20 +2434,32 @@ static read_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read_buf$VH() { return fuse_operations.read_buf$VH; } - public static MemoryAddress read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read_buf$VH.get(seg); - } - public static void read_buf$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read_buf.ofAddress(read_buf$get(segment), session); + 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, @@ -1775,17 +2469,22 @@ public static read_buf read_buf (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(flock fi, MemorySession session) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse_operations.flock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1797,20 +2496,32 @@ static flock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flock$VH() { return fuse_operations.flock$VH; } - public static MemoryAddress flock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flock$VH.get(seg); - } - public static void flock$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flock.ofAddress(flock$get(segment), session); + 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, @@ -1822,17 +2533,22 @@ public static flock flock (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(fallocate fi, MemorySession session) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse_operations.fallocate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1844,20 +2560,32 @@ static fallocate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fallocate$VH() { return fuse_operations.fallocate$VH; } - public static MemoryAddress fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fallocate$VH.get(seg); - } - public static void fallocate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fallocate.ofAddress(fallocate$get(segment), session); + 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, @@ -1872,17 +2600,22 @@ public static fallocate fallocate (MemorySegment segment, MemorySession session) 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, java.lang.foreign.MemoryAddress _x3, java.lang.foreign.MemoryAddress _x4, long _x5, long _x6, int _x7); - static MemorySegment allocate(copy_file_range fi, MemorySession session) { - return RuntimeHelper.upcallStub(copy_file_range.class, fi, fuse_operations.copy_file_range$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, java.lang.foreign.MemoryAddress __x3, java.lang.foreign.MemoryAddress __x4, long __x5, long __x6, int __x7) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3, (java.lang.foreign.Addressable)__x4, __x5, __x6, __x7); + 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$); } @@ -1894,20 +2627,32 @@ static copy_file_range ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle copy_file_range$VH() { return fuse_operations.copy_file_range$VH; } - public static MemoryAddress copy_file_range$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.copy_file_range$VH.get(seg); - } - public static void copy_file_range$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress copy_file_range$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.copy_file_range$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return copy_file_range.ofAddress(copy_file_range$get(segment), session); + 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, @@ -1918,17 +2663,22 @@ public static copy_file_range copy_file_range (MemorySegment segment, MemorySess 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.MemoryAddress _x0, long _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(lseek fi, MemorySession session) { - return RuntimeHelper.upcallStub(lseek.class, fi, fuse_operations.lseek$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, (java.lang.foreign.Addressable)__x3); + return (long)fuse_operations.lseek$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1940,27 +2690,39 @@ static lseek ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle lseek$VH() { return fuse_operations.lseek$VH; } - public static MemoryAddress lseek$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lseek$VH.get(seg); - } - public static void lseek$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress lseek$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lseek$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return lseek.ofAddress(lseek$get(segment), session); + 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(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat.java index 7d6bebff..ac7bee4e 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/stat.java @@ -7,9 +7,30 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@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; + * int __pad0; + * __dev_t st_rdev; + * __off_t st_size; + * __blksize_t st_blksize; + * __blkcnt_t st_blocks; + * struct timespec st_atim; + * struct timespec st_mtim; + * struct timespec st_ctim; + * __syscall_slong_t __glibc_reserved[3]; + * }; + * } + */ public class stat { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -42,10 +63,22 @@ public class stat { public static VarHandle st_dev$VH() { return stat.st_dev$VH; } + /** + * Getter for field: + * {@snippet : + * __dev_t st_dev; + * } + */ public static long st_dev$get(MemorySegment seg) { return (long)stat.st_dev$VH.get(seg); } - public static void st_dev$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __dev_t st_dev; + * } + */ + public static void st_dev$set(MemorySegment seg, long x) { stat.st_dev$VH.set(seg, x); } public static long st_dev$get(MemorySegment seg, long index) { @@ -58,10 +91,22 @@ public class stat { public static VarHandle st_ino$VH() { return stat.st_ino$VH; } + /** + * Getter for field: + * {@snippet : + * __ino_t st_ino; + * } + */ public static long st_ino$get(MemorySegment seg) { return (long)stat.st_ino$VH.get(seg); } - public static void st_ino$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __ino_t st_ino; + * } + */ + public static void st_ino$set(MemorySegment seg, long x) { stat.st_ino$VH.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { @@ -74,10 +119,22 @@ public class stat { public static VarHandle st_nlink$VH() { return stat.st_nlink$VH; } + /** + * Getter for field: + * {@snippet : + * __nlink_t st_nlink; + * } + */ public static long st_nlink$get(MemorySegment seg) { return (long)stat.st_nlink$VH.get(seg); } - public static void st_nlink$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __nlink_t st_nlink; + * } + */ + public static void st_nlink$set(MemorySegment seg, long x) { stat.st_nlink$VH.set(seg, x); } public static long st_nlink$get(MemorySegment seg, long index) { @@ -90,10 +147,22 @@ public class stat { public static VarHandle st_mode$VH() { return stat.st_mode$VH; } + /** + * Getter for field: + * {@snippet : + * __mode_t st_mode; + * } + */ public static int st_mode$get(MemorySegment seg) { return (int)stat.st_mode$VH.get(seg); } - public static void st_mode$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __mode_t st_mode; + * } + */ + public static void st_mode$set(MemorySegment seg, int x) { stat.st_mode$VH.set(seg, x); } public static int st_mode$get(MemorySegment seg, long index) { @@ -106,10 +175,22 @@ public class stat { public static VarHandle st_uid$VH() { return stat.st_uid$VH; } + /** + * Getter for field: + * {@snippet : + * __uid_t st_uid; + * } + */ public static int st_uid$get(MemorySegment seg) { return (int)stat.st_uid$VH.get(seg); } - public static void st_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __uid_t st_uid; + * } + */ + public static void st_uid$set(MemorySegment seg, int x) { stat.st_uid$VH.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { @@ -122,10 +203,22 @@ public class stat { public static VarHandle st_gid$VH() { return stat.st_gid$VH; } + /** + * Getter for field: + * {@snippet : + * __gid_t st_gid; + * } + */ public static int st_gid$get(MemorySegment seg) { return (int)stat.st_gid$VH.get(seg); } - public static void st_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __gid_t st_gid; + * } + */ + public static void st_gid$set(MemorySegment seg, int x) { stat.st_gid$VH.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { @@ -138,10 +231,22 @@ public class stat { public static VarHandle __pad0$VH() { return stat.__pad0$VH; } + /** + * Getter for field: + * {@snippet : + * int __pad0; + * } + */ public static int __pad0$get(MemorySegment seg) { return (int)stat.__pad0$VH.get(seg); } - public static void __pad0$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int __pad0; + * } + */ + public static void __pad0$set(MemorySegment seg, int x) { stat.__pad0$VH.set(seg, x); } public static int __pad0$get(MemorySegment seg, long index) { @@ -154,10 +259,22 @@ public class stat { public static VarHandle st_rdev$VH() { return stat.st_rdev$VH; } + /** + * Getter for field: + * {@snippet : + * __dev_t st_rdev; + * } + */ public static long st_rdev$get(MemorySegment seg) { return (long)stat.st_rdev$VH.get(seg); } - public static void st_rdev$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __dev_t st_rdev; + * } + */ + public static void st_rdev$set(MemorySegment seg, long x) { stat.st_rdev$VH.set(seg, x); } public static long st_rdev$get(MemorySegment seg, long index) { @@ -170,10 +287,22 @@ public class stat { public static VarHandle st_size$VH() { return stat.st_size$VH; } + /** + * Getter for field: + * {@snippet : + * __off_t st_size; + * } + */ public static long st_size$get(MemorySegment seg) { return (long)stat.st_size$VH.get(seg); } - public static void st_size$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __off_t st_size; + * } + */ + public static void st_size$set(MemorySegment seg, long x) { stat.st_size$VH.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { @@ -186,10 +315,22 @@ public class stat { public static VarHandle st_blksize$VH() { return stat.st_blksize$VH; } + /** + * Getter for field: + * {@snippet : + * __blksize_t st_blksize; + * } + */ public static long st_blksize$get(MemorySegment seg) { return (long)stat.st_blksize$VH.get(seg); } - public static void st_blksize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __blksize_t st_blksize; + * } + */ + public static void st_blksize$set(MemorySegment seg, long x) { stat.st_blksize$VH.set(seg, x); } public static long st_blksize$get(MemorySegment seg, long index) { @@ -202,10 +343,22 @@ public class stat { public static VarHandle st_blocks$VH() { return stat.st_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * __blkcnt_t st_blocks; + * } + */ public static long st_blocks$get(MemorySegment seg) { return (long)stat.st_blocks$VH.get(seg); } - public static void st_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __blkcnt_t st_blocks; + * } + */ + public static void st_blocks$set(MemorySegment seg, long x) { stat.st_blocks$VH.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { @@ -228,10 +381,10 @@ public class stat { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stat_h.java index f627067c..16ec9d10 100644 --- 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 @@ -9,18 +9,27 @@ import static java.lang.foreign.ValueLayout.*; public class stat_h { - /* package-private */ stat_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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/statvfs.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/statvfs.java index 11194b1c..ecfdea65 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/statvfs.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/statvfs.java @@ -7,9 +7,27 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * 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_fsid; + * unsigned long f_flag; + * unsigned long f_namemax; + * int __f_spare[6]; + * }; + * } + */ public class statvfs { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -30,10 +48,22 @@ public class statvfs { public static VarHandle f_bsize$VH() { return statvfs.f_bsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_bsize; + * } + */ public static long f_bsize$get(MemorySegment seg) { return (long)statvfs.f_bsize$VH.get(seg); } - public static void f_bsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_bsize; + * } + */ + public static void f_bsize$set(MemorySegment seg, long x) { statvfs.f_bsize$VH.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { @@ -46,10 +76,22 @@ public class statvfs { public static VarHandle f_frsize$VH() { return statvfs.f_frsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_frsize; + * } + */ public static long f_frsize$get(MemorySegment seg) { return (long)statvfs.f_frsize$VH.get(seg); } - public static void f_frsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_frsize; + * } + */ + public static void f_frsize$set(MemorySegment seg, long x) { statvfs.f_frsize$VH.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { @@ -62,10 +104,22 @@ public class statvfs { public static VarHandle f_blocks$VH() { return statvfs.f_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * __fsblkcnt64_t f_blocks; + * } + */ public static long f_blocks$get(MemorySegment seg) { return (long)statvfs.f_blocks$VH.get(seg); } - public static void f_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsblkcnt64_t f_blocks; + * } + */ + public static void f_blocks$set(MemorySegment seg, long x) { statvfs.f_blocks$VH.set(seg, x); } public static long f_blocks$get(MemorySegment seg, long index) { @@ -78,10 +132,22 @@ public class statvfs { public static VarHandle f_bfree$VH() { return statvfs.f_bfree$VH; } + /** + * Getter for field: + * {@snippet : + * __fsblkcnt64_t f_bfree; + * } + */ public static long f_bfree$get(MemorySegment seg) { return (long)statvfs.f_bfree$VH.get(seg); } - public static void f_bfree$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsblkcnt64_t f_bfree; + * } + */ + public static void f_bfree$set(MemorySegment seg, long x) { statvfs.f_bfree$VH.set(seg, x); } public static long f_bfree$get(MemorySegment seg, long index) { @@ -94,10 +160,22 @@ public class statvfs { public static VarHandle f_bavail$VH() { return statvfs.f_bavail$VH; } + /** + * Getter for field: + * {@snippet : + * __fsblkcnt64_t f_bavail; + * } + */ public static long f_bavail$get(MemorySegment seg) { return (long)statvfs.f_bavail$VH.get(seg); } - public static void f_bavail$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsblkcnt64_t f_bavail; + * } + */ + public static void f_bavail$set(MemorySegment seg, long x) { statvfs.f_bavail$VH.set(seg, x); } public static long f_bavail$get(MemorySegment seg, long index) { @@ -110,10 +188,22 @@ public class statvfs { public static VarHandle f_files$VH() { return statvfs.f_files$VH; } + /** + * Getter for field: + * {@snippet : + * __fsfilcnt64_t f_files; + * } + */ public static long f_files$get(MemorySegment seg) { return (long)statvfs.f_files$VH.get(seg); } - public static void f_files$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsfilcnt64_t f_files; + * } + */ + public static void f_files$set(MemorySegment seg, long x) { statvfs.f_files$VH.set(seg, x); } public static long f_files$get(MemorySegment seg, long index) { @@ -126,10 +216,22 @@ public class statvfs { public static VarHandle f_ffree$VH() { return statvfs.f_ffree$VH; } + /** + * Getter for field: + * {@snippet : + * __fsfilcnt64_t f_ffree; + * } + */ public static long f_ffree$get(MemorySegment seg) { return (long)statvfs.f_ffree$VH.get(seg); } - public static void f_ffree$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsfilcnt64_t f_ffree; + * } + */ + public static void f_ffree$set(MemorySegment seg, long x) { statvfs.f_ffree$VH.set(seg, x); } public static long f_ffree$get(MemorySegment seg, long index) { @@ -142,10 +244,22 @@ public class statvfs { public static VarHandle f_favail$VH() { return statvfs.f_favail$VH; } + /** + * Getter for field: + * {@snippet : + * __fsfilcnt64_t f_favail; + * } + */ public static long f_favail$get(MemorySegment seg) { return (long)statvfs.f_favail$VH.get(seg); } - public static void f_favail$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __fsfilcnt64_t f_favail; + * } + */ + public static void f_favail$set(MemorySegment seg, long x) { statvfs.f_favail$VH.set(seg, x); } public static long f_favail$get(MemorySegment seg, long index) { @@ -158,10 +272,22 @@ public class statvfs { public static VarHandle f_fsid$VH() { return statvfs.f_fsid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_fsid; + * } + */ public static long f_fsid$get(MemorySegment seg) { return (long)statvfs.f_fsid$VH.get(seg); } - public static void f_fsid$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_fsid; + * } + */ + public static void f_fsid$set(MemorySegment seg, long x) { statvfs.f_fsid$VH.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { @@ -174,10 +300,22 @@ public class statvfs { public static VarHandle f_flag$VH() { return statvfs.f_flag$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_flag; + * } + */ public static long f_flag$get(MemorySegment seg) { return (long)statvfs.f_flag$VH.get(seg); } - public static void f_flag$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_flag; + * } + */ + public static void f_flag$set(MemorySegment seg, long x) { statvfs.f_flag$VH.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { @@ -190,10 +328,22 @@ public class statvfs { public static VarHandle f_namemax$VH() { return statvfs.f_namemax$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_namemax; + * } + */ public static long f_namemax$get(MemorySegment seg) { return (long)statvfs.f_namemax$VH.get(seg); } - public static void f_namemax$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_namemax; + * } + */ + public static void f_namemax$set(MemorySegment seg, long x) { statvfs.f_namemax$VH.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { @@ -207,10 +357,10 @@ public class statvfs { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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/stdio_h.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio_h.java index 5e7c828c..ed219643 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio_h.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/stdio_h.java @@ -9,21 +9,35 @@ import static java.lang.foreign.ValueLayout.*; public class stdio_h { - /* package-private */ stdio_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 RENAME_NOREPLACE 1 + * } + */ public static int RENAME_NOREPLACE() { return (int)1L; } + /** + * {@snippet : + * #define RENAME_EXCHANGE 2 + * } + */ public static int RENAME_EXCHANGE() { return (int)2L; } + /** + * {@snippet : + * #define RENAME_WHITEOUT 4 + * } + */ public static int RENAME_WHITEOUT() { return (int)4L; } diff --git a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java index e6eef255..1e316e27 100644 --- a/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java +++ b/jfuse-linux-amd64/src/main/java/org/cryptomator/jfuse/linux/amd64/extr/timespec.java @@ -7,9 +7,17 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct timespec { + * __time_t tv_sec; + * __syscall_slong_t tv_nsec; + * }; + * } + */ public class timespec { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"); @@ -20,10 +28,22 @@ public class timespec { public static VarHandle tv_sec$VH() { return timespec.tv_sec$VH; } + /** + * Getter for field: + * {@snippet : + * __time_t tv_sec; + * } + */ public static long tv_sec$get(MemorySegment seg) { return (long)timespec.tv_sec$VH.get(seg); } - public static void tv_sec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __time_t tv_sec; + * } + */ + public static void tv_sec$set(MemorySegment seg, long x) { timespec.tv_sec$VH.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { @@ -36,10 +56,22 @@ public class timespec { public static VarHandle tv_nsec$VH() { return timespec.tv_nsec$VH; } + /** + * Getter for field: + * {@snippet : + * __syscall_slong_t tv_nsec; + * } + */ public static long tv_nsec$get(MemorySegment seg) { return (long)timespec.tv_nsec$VH.get(seg); } - public static void tv_nsec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __syscall_slong_t tv_nsec; + * } + */ + public static void tv_nsec$set(MemorySegment seg, long x) { timespec.tv_nsec$VH.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { @@ -50,10 +82,10 @@ public class timespec { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } 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 04fc7ce6..7a653b27 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.nio.file.OpenOption; import java.nio.file.StandardOpenOption; import java.util.Set; @@ -20,8 +20,8 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var scope = MemorySession.openConfined()) { - var fi = new FileInfoImpl(fuse_file_info.allocate(scope)); + try (var arena = Arena.openConfined()) { + var fi = new FileInfoImpl(fuse_file_info.allocate(arena)); fuse_file_info.flags$set(fi.segment(), flags); var result = fi.getOpenFlags(); 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 04bc631f..f8b8b9eb 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 @@ -2,7 +2,6 @@ import org.cryptomator.jfuse.api.FuseConfig; import org.cryptomator.jfuse.linux.amd64.extr.fuse_config; -import org.cryptomator.jfuse.linux.amd64.extr.stat; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Named; @@ -10,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -22,9 +21,9 @@ public class FuseConfigImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInFuseConfig getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse_config.allocate(scope); - var fuseConfig = new FuseConfigImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_config.allocate(arena); + var fuseConfig = new FuseConfigImpl(segment, arena.scope()); 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 7ae3917c..36739a01 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = fuse_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 7d377ab0..1aabbe75 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 @@ -1,8 +1,8 @@ package org.cryptomator.jfuse.linux.amd64; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -23,9 +23,8 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.time.Instant; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; @@ -57,7 +56,7 @@ public void teardown() { @Test @DisplayName("MountFailedException when fuse_new fails") public void testFuseNewFails() { - fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL); + fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.NULL); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -68,7 +67,7 @@ public void testFuseNewFails() { @Test @DisplayName("MountFailedException when fuse_mount fails") public void testFuseMountFails() { - fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L)); + fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.ofAddress(42L)); fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(1); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -101,12 +100,12 @@ public void testParseArgsHelp(String arg) { @DisplayName("parseArgs") public void testParseArgs() { try (var fuseFunctionsClass = Mockito.mockStatic(FuseFunctions.class); - var scope = MemorySession.openConfined()) { + var arena = Arena.openConfined()) { fuseFunctionsClass.when(() -> FuseFunctions.fuse_parse_cmdline(Mockito.any(), Mockito.any())).then(invocation -> { MemorySegment opts = invocation.getArgument(1); fuse_cmdline_opts.singlethread$set(opts, 0); fuse_cmdline_opts.debug$set(opts, 1); - fuse_cmdline_opts.mountpoint$set(opts, scope.allocateUtf8String("/mount/point").address()); + fuse_cmdline_opts.mountpoint$set(opts, arena.allocateUtf8String("/mount/point")); return 0; }); @@ -129,12 +128,12 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.flush(path.address(), fi.address()); + var result = fuseImpl.flush(path, fi); Assertions.assertEquals(42, result); } @@ -143,12 +142,12 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsync(path.address(), 1, fi.address()); + var result = fuseImpl.fsync(path, 1, fi); Assertions.assertEquals(42, result); } @@ -157,12 +156,12 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsyncdir(path.address(), 1, fi.address()); + var result = fuseImpl.fsyncdir(path, 1, fi); Assertions.assertEquals(42, result); } @@ -173,17 +172,17 @@ public void testFsyncdir() { @DisplayName("init() sets fuse_conn_info.wants |= FUSE_CAP_READDIRPLUS") @Test public void testInit() { - try (var scope = MemorySession.openConfined()) { + try (var arena = Arena.openConfined()) { var result = new AtomicInteger(); Mockito.doAnswer(invocation -> { FuseConnInfo connInfo = invocation.getArgument(0); result.set(connInfo.want()); return null; }).when(fuseOps).init(Mockito.any(), Mockito.any()); - var connInfo = fuse_conn_info.allocate(scope); - var fuseConfig = fuse_config.allocate(scope); + var connInfo = fuse_conn_info.allocate(arena); + var fuseConfig = fuse_config.allocate(arena); - fuseImpl.init(connInfo.address(), fuseConfig.address()); + fuseImpl.init(connInfo, fuseConfig); Assertions.assertEquals(FuseConnInfo.FUSE_CAP_READDIRPLUS, result.get() & FuseConnInfo.FUSE_CAP_READDIRPLUS); } @@ -196,13 +195,13 @@ public class Utimens { @DisplayName("utimens(\"/foo\", UTIME_NOW, UTIME_NOW)") @Test public void testUtimensNow() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = scope.allocate(fuse_file_info.$LAYOUT()); - var times = MemoryAddress.NULL; + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = arena.allocate(fuse_file_info.$LAYOUT()); + var times = MemorySegment.NULL; Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(TimeSpec::isUtimeNow), Mockito.argThat(TimeSpec::isUtimeNow), Mockito.any()); - var result = fuseImpl.utimens(path.address(), times, fi.address()); + var result = fuseImpl.utimens(path, times, fi); Assertions.assertEquals(42, result); } @@ -217,17 +216,17 @@ 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 scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = scope.allocate(fuse_file_info.$LAYOUT()); - var times = timespec.allocateArray(2, scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = arena.allocate(fuse_file_info.$LAYOUT()); + var times = timespec.allocateArray(2, arena); timespec.tv_sec$set(times, 0, sec0); timespec.tv_nsec$set(times, 0, nsec0); timespec.tv_sec$set(times, 1, sec1); timespec.tv_nsec$set(times, 1, nsec1); Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(t -> expectedATime.equals(t.get())), Mockito.argThat(t -> expectedMTime.equals(t.get())), Mockito.any()); - var result = fuseImpl.utimens(path.address(), times.address(), fi.address()); + var result = fuseImpl.utimens(path, times, fi); Assertions.assertEquals(42, result); } @@ -241,14 +240,14 @@ public class Attr { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).getxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any()); - var result = fuseImpl.getxattr(path.address(), name.address(), value.address(), 100); + var result = fuseImpl.getxattr(path, name, value, 100); Assertions.assertEquals(42, result); } @@ -257,14 +256,14 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).setxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any(), Mockito.anyInt()); - var result = fuseImpl.setxattr(path.address(), name.address(), value.address(), 100, 0xDEADBEEF); + var result = fuseImpl.setxattr(path, name, value, 100, 0xDEADBEEF); Assertions.assertEquals(42, result); } @@ -273,13 +272,13 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var list = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var list = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).listxattr(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.listxattr(path.address(), list.address(), 100); + var result = fuseImpl.listxattr(path, list, 100); Assertions.assertEquals(42, result); } @@ -288,13 +287,13 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); Mockito.doReturn(42).when(fuseOps).removexattr(Mockito.eq("/foo"), Mockito.eq("bar")); - var result = fuseImpl.removexattr(path.address(), name.address()); + var result = fuseImpl.removexattr(path, name); Assertions.assertEquals(42, result); } @@ -305,12 +304,12 @@ public void testRemovexattr() { @Test @DisplayName("chown") public void testChown() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.chown(path.address(), 42, 1337, fi.address()); + var result = fuseImpl.chown(path, 42, 1337, fi); Assertions.assertEquals(42, result); } 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 7d836a51..1322534a 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 @@ -10,13 +10,13 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemorySegment; public class FuseMountImplTest { private MockedStatic fuseH; private FuseArgs fuseArgs = Mockito.mock(FuseArgs.class); - private MemoryAddress fuse = MemoryAddress.ofLong(42L); + private MemorySegment fuse = MemorySegment.ofAddress(42L); private FuseMountImpl fuseMount = new FuseMountImpl(fuse, fuseArgs); @BeforeEach @@ -71,7 +71,7 @@ public void testLoopMultiThreaded32(int fuseVersion) { @Test @DisplayName("FUSE 3.12 calls fuse_loop_mt") public void testLoopMultiThreaded312() { - var loopCfg = MemoryAddress.ofLong(1337L); + var loopCfg = MemorySegment.ofAddress(1337L); Mockito.doReturn(true).when(fuseArgs).multithreaded(); fuseH.when(fuse_h::fuse_version).thenReturn(312); fuseH.when(fuse_h::fuse_loop_cfg_create).thenReturn(loopCfg); 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 d898189a..720c4a0a 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 ee390b98..ee293331 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 @@ -6,7 +6,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.time.Instant; public class TimeSpecImplTest { @@ -14,8 +14,8 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,8 +29,8 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 0L); timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,8 +44,8 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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,8 +57,8 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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 2fdc893a..220a30db 100644 --- a/jfuse-mac/pom.xml +++ b/jfuse-mac/pom.xml @@ -69,9 +69,9 @@ io.github.coffeelibs jextract-maven-plugin - 0.2.0 + 0.3.0 - ${user.home}/.sdkman/candidates/java/19.ea.jextract/bin/jextract + /Users/sebastian/Documents/Cryptomator/jextract/build/jextract/bin/jextract ${mac.headerSearchPath} ${project.build.sourceDirectory} org.cryptomator.jfuse.mac.extr @@ -121,24 +121,24 @@ ${mac.headerSearchPath}/errno.h errno_h - - ENOENT - ENOSYS - ENOMEM - EACCES - EIO - EROFS - EBADF - EEXIST - ENOTDIR - EISDIR - ENOTEMPTY - ENOTSUP - EINVAL - ERANGE - ENOLCK - ENAMETOOLONG - + + ENOENT + ENOSYS + ENOMEM + EACCES + EIO + EROFS + EBADF + EEXIST + ENOTDIR + EISDIR + ENOTEMPTY + ENOTSUP + EINVAL + ERANGE + ENOLCK + ENAMETOOLONG + @@ -149,10 +149,10 @@ ${mac.headerSearchPath}/sys/stat.h stat_h - - UTIME_NOW - UTIME_OMIT - + + UTIME_NOW + UTIME_OMIT + @@ -163,17 +163,17 @@ ${mac.headerSearchPath}/fcntl.h fcntl_h - - O_RDONLY - O_WRONLY - O_RDWR - O_APPEND - O_CREAT - O_TRUNC - O_EXCL - O_DSYNC - O_SYNC - + + O_RDONLY + O_WRONLY + O_RDWR + O_APPEND + O_CREAT + O_TRUNC + O_EXCL + O_DSYNC + O_SYNC + 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 62e115d4..69ae1a74 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 @@ -5,21 +5,22 @@ import org.cryptomator.jfuse.mac.extr.fuse_fill_dir_t; import org.cryptomator.jfuse.mac.extr.stat; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentScope; import java.util.function.Consumer; -record DirFillerImpl(MemoryAddress buf, fuse_fill_dir_t callback, MemorySession scope) implements DirFiller { +record DirFillerImpl(MemorySegment buf, fuse_fill_dir_t callback, Arena arena) implements DirFiller { - DirFillerImpl(MemoryAddress buf, MemoryAddress callback, MemorySession scope) { - this(buf, fuse_fill_dir_t.ofAddress(callback, scope), scope); + DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { + this(buf, fuse_fill_dir_t.ofAddress(callback, arena.scope()), arena); } @Override public int fill(String name, Consumer statFiller, long offset, int flags) { - var statSegment = stat.allocate(scope); + var statSegment = stat.allocate(arena); statFiller.accept(new StatImpl(statSegment)); - return callback.apply(buf, scope.allocateUtf8String(name).address(), statSegment.address(), offset); + return callback.apply(buf, arena.allocateUtf8String(name), statSegment, offset); } } \ No newline at end of file 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 b7819f25..97d5f1d7 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 @@ -4,9 +4,8 @@ import org.cryptomator.jfuse.mac.extr.fcntl_h; import org.cryptomator.jfuse.mac.extr.fuse_file_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -23,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(MemoryAddress address, MemorySession scope) { + public FileInfoImpl(MemorySegment address, SegmentScope 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 42c92539..f264fcd0 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 @@ -2,11 +2,10 @@ import org.cryptomator.jfuse.mac.extr.fuse_args; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; -record FuseArgs(MemorySegment args, MemoryAddress mountPoint, boolean multiThreaded) { +record FuseArgs(MemorySegment args, MemorySegment mountPoint, boolean multiThreaded) { @Override public String toString() { @@ -14,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, i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); 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 fc68702a..07c69b1f 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.mac.extr.fuse_conn_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemoryAddress address, MemorySession scope) { + public FuseConnInfoImpl(MemorySegment address, SegmentScope 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 f88362f0..69d05a88 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 @@ -2,8 +2,8 @@ import org.cryptomator.jfuse.api.Fuse; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -11,11 +11,8 @@ import org.cryptomator.jfuse.mac.extr.timespec; import org.jetbrains.annotations.VisibleForTesting; -import java.lang.foreign.Addressable; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemoryLayout; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.util.List; @@ -31,11 +28,11 @@ public FuseImpl(FuseOperations fuseOperations) { protected FuseMount mount(List args) throws FuseMountFailedException { var fuseArgs = parseArgs(args); var ch = fuse_h.fuse_mount(fuseArgs.mountPoint(), fuseArgs.args()); - if (MemoryAddress.NULL.equals(ch)) { + if (MemorySegment.NULL.equals(ch)) { throw new FuseMountFailedException("fuse_mount failed"); } - var fuse = fuse_h.fuse_new(ch, fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL); - if (MemoryAddress.NULL.equals(fuse)) { + var fuse = fuse_h.fuse_new(ch, fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemorySegment.NULL); + if (MemorySegment.NULL.equals(fuse)) { fuse_h.fuse_unmount(fuseArgs.mountPoint(), ch); throw new FuseMountFailedException("fuse_new failed"); } @@ -51,9 +48,9 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { var cString = fuseScope.allocateUtf8String(cmdLineArgs.get(i)); argv.setAtIndex(ValueLayout.ADDRESS, i, cString); } - argv.setAtIndex(ValueLayout.ADDRESS, argc, MemoryAddress.NULL); + argv.setAtIndex(ValueLayout.ADDRESS, argc, MemorySegment.NULL); fuse_args.argc$set(args, argc); - fuse_args.argv$set(args, argv.address()); + fuse_args.argv$set(args, argv); fuse_args.allocated$set(args, 0); var multithreaded = fuseScope.allocate(JAVA_INT, 1); @@ -64,249 +61,251 @@ 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, 0); + var mountPoint = mountPointPtr.get(ValueLayout.ADDRESS.asUnbounded(), 0); return new FuseArgs(args, mountPoint, isMultiThreaded); } @Override protected void bind(FuseOperations.Operation operation) { + var fuseScope = this.fuseScope.scope(); switch (operation) { - case INIT -> fuse_operations.init$set(fuseOperationsStruct, fuse_operations.init.allocate(this::init, fuseScope).address()); - case ACCESS -> fuse_operations.access$set(fuseOperationsStruct, fuse_operations.access.allocate(this::access, fuseScope).address()); - case CHMOD -> fuse_operations.chmod$set(fuseOperationsStruct, fuse_operations.chmod.allocate(this::chmod, fuseScope).address()); - case CHOWN -> fuse_operations.chown$set(fuseOperationsStruct, fuse_operations.chown.allocate(this::chown, fuseScope).address()); - case CREATE -> fuse_operations.create$set(fuseOperationsStruct, fuse_operations.create.allocate(this::create, fuseScope).address()); - case DESTROY -> fuse_operations.destroy$set(fuseOperationsStruct, fuse_operations.destroy.allocate(this::destroy, fuseScope).address()); - case FLUSH -> fuse_operations.flush$set(fuseOperationsStruct, fuse_operations.flush.allocate(this::flush, fuseScope).address()); - case FSYNC -> fuse_operations.fsync$set(fuseOperationsStruct, fuse_operations.fsync.allocate(this::fsync, fuseScope).address()); - case FSYNCDIR -> fuse_operations.fsyncdir$set(fuseOperationsStruct, fuse_operations.fsyncdir.allocate(this::fsyncdir, fuseScope).address()); + 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 GET_ATTR -> { - fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope).address()); - fuse_operations.fgetattr$set(fuseOperationsStruct, fuse_operations.fgetattr.allocate(this::fgetattr, fuseScope).address()); + fuse_operations.getattr$set(fuseOperationsStruct, fuse_operations.getattr.allocate(this::getattr, fuseScope)); + fuse_operations.fgetattr$set(fuseOperationsStruct, fuse_operations.fgetattr.allocate(this::fgetattr, fuseScope)); } - case GET_XATTR -> fuse_operations.getxattr$set(fuseOperationsStruct, fuse_operations.getxattr.allocate(this::getxattr, fuseScope).address()); - case LIST_XATTR -> fuse_operations.listxattr$set(fuseOperationsStruct, fuse_operations.listxattr.allocate(this::listxattr, fuseScope).address()); - case MKDIR -> fuse_operations.mkdir$set(fuseOperationsStruct, fuse_operations.mkdir.allocate(this::mkdir, fuseScope).address()); - case OPEN -> fuse_operations.open$set(fuseOperationsStruct, fuse_operations.open.allocate(this::open, fuseScope).address()); - case OPEN_DIR -> fuse_operations.opendir$set(fuseOperationsStruct, fuse_operations.opendir.allocate(this::opendir, fuseScope).address()); - case READ -> fuse_operations.read$set(fuseOperationsStruct, fuse_operations.read.allocate(this::read, fuseScope).address()); - case READ_DIR -> fuse_operations.readdir$set(fuseOperationsStruct, fuse_operations.readdir.allocate(this::readdir, fuseScope).address()); - case READLINK -> fuse_operations.readlink$set(fuseOperationsStruct, fuse_operations.readlink.allocate(this::readlink, fuseScope).address()); - case RELEASE -> fuse_operations.release$set(fuseOperationsStruct, fuse_operations.release.allocate(this::release, fuseScope).address()); - case RELEASE_DIR -> fuse_operations.releasedir$set(fuseOperationsStruct, fuse_operations.releasedir.allocate(this::releasedir, fuseScope).address()); - case REMOVE_XATTR -> fuse_operations.removexattr$set(fuseOperationsStruct, fuse_operations.removexattr.allocate(this::removexattr, fuseScope).address()); - case RENAME -> fuse_operations.rename$set(fuseOperationsStruct, fuse_operations.rename.allocate(this::rename, fuseScope).address()); - case RMDIR -> fuse_operations.rmdir$set(fuseOperationsStruct, fuse_operations.rmdir.allocate(this::rmdir, fuseScope).address()); - case SET_XATTR -> fuse_operations.setxattr$set(fuseOperationsStruct, fuse_operations.setxattr.allocate(this::setxattr, fuseScope).address()); - case STATFS -> fuse_operations.statfs$set(fuseOperationsStruct, fuse_operations.statfs.allocate(this::statfs, fuseScope).address()); - case SYMLINK -> fuse_operations.symlink$set(fuseOperationsStruct, fuse_operations.symlink.allocate(this::symlink, fuseScope).address()); + 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 TRUNCATE -> { - fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope).address()); - fuse_operations.ftruncate$set(fuseOperationsStruct, fuse_operations.ftruncate.allocate(this::ftruncate, fuseScope).address()); + fuse_operations.truncate$set(fuseOperationsStruct, fuse_operations.truncate.allocate(this::truncate, fuseScope)); + fuse_operations.ftruncate$set(fuseOperationsStruct, fuse_operations.ftruncate.allocate(this::ftruncate, fuseScope)); } - case UNLINK -> fuse_operations.unlink$set(fuseOperationsStruct, fuse_operations.unlink.allocate(this::unlink, fuseScope).address()); - case UTIMENS -> fuse_operations.utimens$set(fuseOperationsStruct, fuse_operations.utimens.allocate(this::utimens, fuseScope).address()); - case WRITE -> fuse_operations.write$set(fuseOperationsStruct, fuse_operations.write.allocate(this::write, fuseScope).address()); + 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)); } } - private Addressable init(MemoryAddress conn) { - try (var scope = MemorySession.openConfined()) { - fuseOperations.init(new FuseConnInfoImpl(conn, scope), null); + private MemorySegment init(MemorySegment conn) { + try (var arena = Arena.openConfined()) { + fuseOperations.init(new FuseConnInfoImpl(conn, arena.scope()), null); } - return MemoryAddress.NULL; + return MemorySegment.NULL; } - private int access(MemoryAddress path, int mask) { + private int access(MemorySegment path, int mask) { return fuseOperations.access(path.getUtf8String(0), mask); } - private int chmod(MemoryAddress path, short mode) { + private int chmod(MemorySegment path, short mode) { return fuseOperations.chmod(path.getUtf8String(0), mode, null); } @VisibleForTesting - int chown(MemoryAddress path, int uid, int gid) { + int chown(MemorySegment path, int uid, int gid) { return fuseOperations.chown(path.getUtf8String(0), uid, gid, null); } - private int create(MemoryAddress path, short mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } - private void destroy(MemoryAddress addr) { + private void destroy(MemorySegment addr) { fuseOperations.destroy(); } @VisibleForTesting - int flush(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + int flush(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } @VisibleForTesting - int fsync(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int fsyncdir(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int getattr(MemoryAddress path, MemoryAddress stat) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, scope), null); + int getattr(MemorySegment path, MemorySegment stat) { + try (var arena = Arena.openConfined()) { + return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, arena.scope()), null); } } @VisibleForTesting - int fgetattr(MemoryAddress path, MemoryAddress stat, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, scope), new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int getxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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); } } @VisibleForTesting - int setxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer(), flags); + 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); } } @VisibleForTesting - int listxattr(MemoryAddress path, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.listxattr(path.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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); } } @VisibleForTesting - int removexattr(MemoryAddress path, MemoryAddress name) { + int removexattr(MemorySegment path, MemorySegment name) { return fuseOperations.removexattr(path.getUtf8String(0), name.getUtf8String(0)); } - private int mkdir(MemoryAddress path, short mode) { + private int mkdir(MemorySegment path, short mode) { return fuseOperations.mkdir(path.getUtf8String(0), mode); } - private int open(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int open(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int opendir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int opendir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int read(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } - private int readdir(MemoryAddress path, MemoryAddress buf, MemoryAddress filler, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, scope), offset, new FileInfoImpl(fi, scope), 0); + 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); } } - private int readlink(MemoryAddress path, MemoryAddress buf, long len) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, len, scope).asByteBuffer(); + 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); } } - private int release(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int release(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int releasedir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int releasedir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int rename(MemoryAddress oldpath, MemoryAddress newpath) { + private int rename(MemorySegment oldpath, MemorySegment newpath) { return fuseOperations.rename(oldpath.getUtf8String(0), newpath.getUtf8String(0), 0); } - private int rmdir(MemoryAddress path) { + private int rmdir(MemorySegment path) { return fuseOperations.rmdir(path.getUtf8String(0)); } - private int statfs(MemoryAddress path, MemoryAddress statvfs) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, scope)); + private int statfs(MemorySegment path, MemorySegment statvfs) { + try (var arena = Arena.openConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); } } - private int symlink(MemoryAddress linkname, MemoryAddress target) { + private int symlink(MemorySegment linkname, MemorySegment target) { return fuseOperations.symlink(linkname.getUtf8String(0), target.getUtf8String(0)); } @VisibleForTesting - int truncate(MemoryAddress path, long size) { + int truncate(MemorySegment path, long size) { return fuseOperations.truncate(path.getUtf8String(0), size, null); } @VisibleForTesting - int ftruncate(MemoryAddress path, long size, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, scope)); + 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())); } } - private int unlink(MemoryAddress path) { + private int unlink(MemorySegment path) { return fuseOperations.unlink(path.getUtf8String(0)); } @VisibleForTesting - int utimens(MemoryAddress path, MemoryAddress times) { - try (var scope = MemorySession.openConfined()) { - if (MemoryAddress.NULL.equals(times)) { + int utimens(MemorySegment path, MemorySegment times) { + try (var arena = Arena.openConfined()) { + if (MemorySegment.NULL.equals(times)) { // set both times to current time (using on-heap memory segments) - var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), scope); + var segment = MemorySegment.allocateNative(timespec.$LAYOUT().byteSize(), arena.scope()); 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, null); } else { - var seq = MemoryLayout.sequenceLayout(2, timespec.$LAYOUT()); - var segment = MemorySegment.ofAddress(times, seq.byteSize(), scope); - var time0 = segment.asSlice(0, timespec.$LAYOUT().byteSize()); - var time1 = segment.asSlice(timespec.$LAYOUT().byteSize(), timespec.$LAYOUT().byteSize()); + 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), null); } } } - private int write(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } 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 135dec06..73eb1063 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 @@ -3,9 +3,9 @@ import org.cryptomator.jfuse.api.FuseMount; import org.cryptomator.jfuse.mac.extr.fuse_h; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemorySegment; -record FuseMountImpl(MemoryAddress fuse, MemoryAddress ch, FuseArgs args) implements FuseMount { +record FuseMountImpl(MemorySegment fuse, MemorySegment ch, FuseArgs args) implements FuseMount { @Override public int loop() { 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 81a69845..7d23368f 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 @@ -4,13 +4,12 @@ import org.cryptomator.jfuse.api.TimeSpec; import org.cryptomator.jfuse.mac.extr.stat; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemoryAddress address, MemorySession scope) { + public StatImpl(MemorySegment address, SegmentScope 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 c1a047f7..f2a0e9f4 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.Statvfs; import org.cryptomator.jfuse.mac.extr.statvfs; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemoryAddress address, MemorySession scope) { + public StatvfsImpl(MemorySegment address, SegmentScope scope) { this(statvfs.ofAddress(address, scope)); } 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 index 0ec69a89..f5765118 100644 --- 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 @@ -7,17 +7,19 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -public class Constants$root { +final class 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.withBitAlignment(16); - static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfLong C_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); + // 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/RuntimeHelper.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/RuntimeHelper.java index 6d118c8d..dd2e6580 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/RuntimeHelper.java @@ -1,15 +1,13 @@ package org.cryptomator.jfuse.mac.extr; // Generated by jextract -import java.lang.foreign.Addressable; import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; import java.lang.foreign.SymbolLookup; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.lang.foreign.SegmentAllocator; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; @@ -27,21 +25,24 @@ final class RuntimeHelper { - private RuntimeHelper() {} - private final static Linker LINKER = Linker.nativeLinker(); - private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); - private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); - private final static SymbolLookup SYMBOL_LOOKUP; + 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"); }; final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); + (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); static { SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); + 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); @@ -49,45 +50,43 @@ static T requireNonNull(T obj, String symbolName) { return obj; } - private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; - - static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } - static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } - static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { return LINKER.downcallHandle(fdesc); } - static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { + static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, session); + return LINKER.upcallStub(handle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { - return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); } // Internals only below this point - private static class VarargsInvoker { + private static final class VarargsInvoker { private static final MethodHandle INVOKE_MH; private final MemorySegment symbol; private final FunctionDescriptor function; @@ -113,7 +112,9 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { mtype = mtype.appendParameterTypes(carrier(layout, false)); } mtype = mtype.appendParameterTypes(Object[].class); - if (mtype.returnType().equals(MemorySegment.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); @@ -123,8 +124,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { static Class carrier(MemoryLayout layout, boolean ret) { if (layout instanceof ValueLayout valueLayout) { - return (ret || valueLayout.carrier() != MemoryAddress.class) ? - valueLayout.carrier() : Addressable.class; + return valueLayout.carrier(); } else if (layout instanceof GroupLayout) { return MemorySegment.class; } else { @@ -159,7 +159,9 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.ofVoid(argLayouts) : FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); - if (mh.type().returnType() == MemorySegment.class) { + 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 @@ -209,10 +211,7 @@ private Class normalize(Class c) { if (c.isPrimitive()) { return promote(c); } - if (MemoryAddress.class.isAssignableFrom(c)) { - return MemoryAddress.class; - } - if (MemorySegment.class.isAssignableFrom(c)) { + if (c == MemorySegment.class) { return MemorySegment.class; } throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); @@ -223,7 +222,7 @@ private MemoryLayout variadicLayout(Class c) { return JAVA_LONG; } else if (c == double.class) { return JAVA_DOUBLE; - } else if (MemoryAddress.class.isAssignableFrom(c)) { + } else if (c == MemorySegment.class) { return ADDRESS; } else { throw new IllegalArgumentException("Unhandled variadic argument class: " + c); 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 index 2c5fa6eb..80110212 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$0 { +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 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 index f1a3b6fe..ed018bc7 100644 --- 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 @@ -7,8 +7,10 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -class constants$1 { +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 ); 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_h.java index b3b007e1..dfddf79e 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_h.java @@ -9,60 +9,139 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - /* package-private */ errno_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 ENOENT 2 + * } + */ public static int ENOENT() { return (int)2L; } + /** + * {@snippet : + * #define EIO 5 + * } + */ public static int EIO() { return (int)5L; } + /** + * {@snippet : + * #define EBADF 9 + * } + */ public static int EBADF() { return (int)9L; } + /** + * {@snippet : + * #define ENOMEM 12 + * } + */ public static int ENOMEM() { return (int)12L; } + /** + * {@snippet : + * #define EACCES 13 + * } + */ public static int EACCES() { return (int)13L; } + /** + * {@snippet : + * #define EEXIST 17 + * } + */ public static int EEXIST() { return (int)17L; } + /** + * {@snippet : + * #define ENOTDIR 20 + * } + */ public static int ENOTDIR() { return (int)20L; } + /** + * {@snippet : + * #define EISDIR 21 + * } + */ public static int EISDIR() { return (int)21L; } + /** + * {@snippet : + * #define EINVAL 22 + * } + */ public static int EINVAL() { return (int)22L; } + /** + * {@snippet : + * #define EROFS 30 + * } + */ public static int EROFS() { return (int)30L; } + /** + * {@snippet : + * #define ERANGE 34 + * } + */ public static int ERANGE() { return (int)34L; } + /** + * {@snippet : + * #define ENOTSUP 45 + * } + */ public static int ENOTSUP() { return (int)45L; } + /** + * {@snippet : + * #define ENAMETOOLONG 63 + * } + */ public static int ENAMETOOLONG() { return (int)63L; } + /** + * {@snippet : + * #define ENOTEMPTY 66 + * } + */ public static int ENOTEMPTY() { return (int)66L; } + /** + * {@snippet : + * #define ENOLCK 77 + * } + */ public static int ENOLCK() { return (int)77L; } + /** + * {@snippet : + * #define ENOSYS 78 + * } + */ public static int ENOSYS() { return (int)78L; } 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_h.java index 178eb52d..85723847 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_h.java @@ -9,39 +9,83 @@ import static java.lang.foreign.ValueLayout.*; public class fcntl_h { - /* package-private */ fcntl_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 O_RDONLY 0 + * } + */ public static int O_RDONLY() { return (int)0L; } + /** + * {@snippet : + * #define O_WRONLY 1 + * } + */ public static int O_WRONLY() { return (int)1L; } + /** + * {@snippet : + * #define O_RDWR 2 + * } + */ public static int O_RDWR() { return (int)2L; } + /** + * {@snippet : + * #define O_APPEND 8 + * } + */ public static int O_APPEND() { return (int)8L; } + /** + * {@snippet : + * #define O_SYNC 128 + * } + */ public static int O_SYNC() { return (int)128L; } + /** + * {@snippet : + * #define O_CREAT 512 + * } + */ public static int O_CREAT() { return (int)512L; } + /** + * {@snippet : + * #define O_TRUNC 1024 + * } + */ public static int O_TRUNC() { return (int)1024L; } + /** + * {@snippet : + * #define O_EXCL 2048 + * } + */ public static int O_EXCL() { return (int)2048L; } + /** + * {@snippet : + * #define O_DSYNC 4194304 + * } + */ public static int O_DSYNC() { return (int)4194304L; } diff --git a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java index 54c885d3..92d59647 100644 --- a/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java +++ b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/fuse_args.java @@ -7,9 +7,18 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_args { + * int argc; + * char** argv; + * int allocated; + * }; + * } + */ public class fuse_args { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_INT$LAYOUT.withName("argc"), MemoryLayout.paddingLayout(32), Constants$root.C_POINTER$LAYOUT.withName("argv"), @@ -23,10 +32,22 @@ public class fuse_args { public static VarHandle argc$VH() { return fuse_args.argc$VH; } + /** + * Getter for field: + * {@snippet : + * int argc; + * } + */ public static int argc$get(MemorySegment seg) { return (int)fuse_args.argc$VH.get(seg); } - public static void argc$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int argc; + * } + */ + public static void argc$set(MemorySegment seg, int x) { fuse_args.argc$VH.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { @@ -39,26 +60,50 @@ public class fuse_args { public static VarHandle argv$VH() { return fuse_args.argv$VH; } - public static MemoryAddress argv$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg); - } - public static void argv$set( MemorySegment seg, MemoryAddress x) { + /** + * Getter for field: + * {@snippet : + * char** argv; + * } + */ + public static MemorySegment argv$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * char** argv; + * } + */ + public static void argv$set(MemorySegment seg, MemorySegment x) { fuse_args.argv$VH.set(seg, x); } - public static MemoryAddress argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment argv$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); } - public static void argv$set(MemorySegment seg, long index, MemoryAddress x) { + public static void argv$set(MemorySegment seg, long index, MemorySegment x) { fuse_args.argv$VH.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; } + /** + * Getter for field: + * {@snippet : + * int allocated; + * } + */ public static int allocated$get(MemorySegment seg) { return (int)fuse_args.allocated$VH.get(seg); } - public static void allocated$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int allocated; + * } + */ + public static void allocated$set(MemorySegment seg, int x) { fuse_args.allocated$VH.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { @@ -69,10 +114,10 @@ public class fuse_args { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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_conn_info.java index 09fbe740..2c5e30d6 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_conn_info.java @@ -7,9 +7,25 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_conn_info { + * unsigned int proto_major; + * unsigned int proto_minor; + * unsigned int async_read; + * unsigned int max_write; + * unsigned int max_readahead; + * unsigned int capable; + * unsigned int want; + * unsigned int max_background; + * unsigned int congestion_threshold; + * unsigned int reserved[23]; + * }; + * } + */ public class fuse_conn_info { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -28,10 +44,22 @@ public class fuse_conn_info { public static VarHandle proto_major$VH() { return fuse_conn_info.proto_major$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ public static int proto_major$get(MemorySegment seg) { return (int)fuse_conn_info.proto_major$VH.get(seg); } - public static void proto_major$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ + public static void proto_major$set(MemorySegment seg, int x) { fuse_conn_info.proto_major$VH.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { @@ -44,10 +72,22 @@ public class fuse_conn_info { public static VarHandle proto_minor$VH() { return fuse_conn_info.proto_minor$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ public static int proto_minor$get(MemorySegment seg) { return (int)fuse_conn_info.proto_minor$VH.get(seg); } - public static void proto_minor$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ + public static void proto_minor$set(MemorySegment seg, int x) { fuse_conn_info.proto_minor$VH.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { @@ -60,10 +100,22 @@ public class fuse_conn_info { public static VarHandle async_read$VH() { return fuse_conn_info.async_read$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int async_read; + * } + */ public static int async_read$get(MemorySegment seg) { return (int)fuse_conn_info.async_read$VH.get(seg); } - public static void async_read$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int async_read; + * } + */ + public static void async_read$set(MemorySegment seg, int x) { fuse_conn_info.async_read$VH.set(seg, x); } public static int async_read$get(MemorySegment seg, long index) { @@ -76,10 +128,22 @@ public class fuse_conn_info { public static VarHandle max_write$VH() { return fuse_conn_info.max_write$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_write; + * } + */ public static int max_write$get(MemorySegment seg) { return (int)fuse_conn_info.max_write$VH.get(seg); } - public static void max_write$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_write; + * } + */ + public static void max_write$set(MemorySegment seg, int x) { fuse_conn_info.max_write$VH.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { @@ -92,10 +156,22 @@ public class fuse_conn_info { public static VarHandle max_readahead$VH() { return fuse_conn_info.max_readahead$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ public static int max_readahead$get(MemorySegment seg) { return (int)fuse_conn_info.max_readahead$VH.get(seg); } - public static void max_readahead$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ + public static void max_readahead$set(MemorySegment seg, int x) { fuse_conn_info.max_readahead$VH.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { @@ -108,10 +184,22 @@ public class fuse_conn_info { public static VarHandle capable$VH() { return fuse_conn_info.capable$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int capable; + * } + */ public static int capable$get(MemorySegment seg) { return (int)fuse_conn_info.capable$VH.get(seg); } - public static void capable$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int capable; + * } + */ + public static void capable$set(MemorySegment seg, int x) { fuse_conn_info.capable$VH.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { @@ -124,10 +212,22 @@ public class fuse_conn_info { public static VarHandle want$VH() { return fuse_conn_info.want$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int want; + * } + */ public static int want$get(MemorySegment seg) { return (int)fuse_conn_info.want$VH.get(seg); } - public static void want$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int want; + * } + */ + public static void want$set(MemorySegment seg, int x) { fuse_conn_info.want$VH.set(seg, x); } public static int want$get(MemorySegment seg, long index) { @@ -140,10 +240,22 @@ public class fuse_conn_info { public static VarHandle max_background$VH() { return fuse_conn_info.max_background$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_background; + * } + */ public static int max_background$get(MemorySegment seg) { return (int)fuse_conn_info.max_background$VH.get(seg); } - public static void max_background$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_background; + * } + */ + public static void max_background$set(MemorySegment seg, int x) { fuse_conn_info.max_background$VH.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { @@ -156,10 +268,22 @@ public class fuse_conn_info { public static VarHandle congestion_threshold$VH() { return fuse_conn_info.congestion_threshold$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ public static int congestion_threshold$get(MemorySegment seg) { return (int)fuse_conn_info.congestion_threshold$VH.get(seg); } - public static void congestion_threshold$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ + public static void congestion_threshold$set(MemorySegment seg, int x) { fuse_conn_info.congestion_threshold$VH.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { @@ -173,10 +297,10 @@ public class fuse_conn_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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_file_info.java index 051bf4f2..bdea7ac3 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_file_info.java @@ -7,9 +7,26 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse_file_info { + * int flags; + * unsigned long fh_old; + * int writepage; + * * unsigned int direct_io; + * unsigned int keep_cache; + * unsigned int flush; + * unsigned int nonseekable; + * unsigned int flock_release; + * unsigned int padding; + * uint64_t fh; + * uint64_t lock_owner; + * }; + * } + */ public class fuse_file_info { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -32,10 +49,22 @@ public class fuse_file_info { 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); } - public static void flags$set( MemorySegment seg, int x) { + /** + * 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) { @@ -48,10 +77,22 @@ public class fuse_file_info { public static VarHandle fh_old$VH() { return fuse_file_info.fh_old$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long fh_old; + * } + */ public static long fh_old$get(MemorySegment seg) { return (long)fuse_file_info.fh_old$VH.get(seg); } - public static void fh_old$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long fh_old; + * } + */ + public static void fh_old$set(MemorySegment seg, long x) { fuse_file_info.fh_old$VH.set(seg, x); } public static long fh_old$get(MemorySegment seg, long index) { @@ -64,10 +105,22 @@ public class fuse_file_info { public static VarHandle writepage$VH() { return fuse_file_info.writepage$VH; } + /** + * Getter for field: + * {@snippet : + * int writepage; + * } + */ public static int writepage$get(MemorySegment seg) { return (int)fuse_file_info.writepage$VH.get(seg); } - public static void writepage$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int writepage; + * } + */ + public static void writepage$set(MemorySegment seg, int x) { fuse_file_info.writepage$VH.set(seg, x); } public static int writepage$get(MemorySegment seg, long index) { @@ -80,10 +133,22 @@ public class fuse_file_info { 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); } - public static void fh$set( MemorySegment seg, long x) { + /** + * 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) { @@ -96,10 +161,22 @@ public class fuse_file_info { 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); } - public static void lock_owner$set( MemorySegment seg, long x) { + /** + * 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) { @@ -110,10 +187,10 @@ public class fuse_file_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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_fill_dir_t.java index 6d1cfbf6..ddcc1b05 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_fill_dir_t.java @@ -7,17 +7,22 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * int (*fuse_fill_dir_t)(void* buf,char* name,struct stat* stbuf,long long off); + * } + */ public interface fuse_fill_dir_t { - int apply(java.lang.foreign.MemoryAddress buf, java.lang.foreign.MemoryAddress name, java.lang.foreign.MemoryAddress stbuf, long off); - static MemorySegment allocate(fuse_fill_dir_t fi, MemorySession session) { - return RuntimeHelper.upcallStub(fuse_fill_dir_t.class, fi, constants$0.fuse_fill_dir_t$FUNC, session); + 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 fuse_fill_dir_t ofAddress(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress _buf, java.lang.foreign.MemoryAddress _name, java.lang.foreign.MemoryAddress _stbuf, long _off) -> { + static fuse_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + 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((Addressable)symbol, (java.lang.foreign.Addressable)_buf, (java.lang.foreign.Addressable)_name, (java.lang.foreign.Addressable)_stbuf, _off); + return (int)constants$0.fuse_fill_dir_t$MH.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_h.java index 22cce062..45a04638 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_h.java @@ -9,22 +9,26 @@ import static java.lang.foreign.ValueLayout.*; public class fuse_h { - /* package-private */ fuse_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 MethodHandle fuse_mount$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_mount$MH,"fuse_mount"); } - public static MemoryAddress fuse_mount ( Addressable mountpoint, Addressable args) { + /** + * {@snippet : + * struct fuse_chan* fuse_mount(char* mountpoint, struct fuse_args* args); + * } + */ + public static MemorySegment fuse_mount(MemorySegment mountpoint, MemorySegment args) { var mh$ = fuse_mount$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(mountpoint, args); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(mountpoint, args); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -32,7 +36,12 @@ public static MemoryAddress fuse_mount ( Addressable mountpoint, Addressable ar public static MethodHandle fuse_unmount$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_unmount$MH,"fuse_unmount"); } - public static void fuse_unmount ( Addressable mountpoint, Addressable ch) { + /** + * {@snippet : + * void fuse_unmount(char* mountpoint, struct fuse_chan* ch); + * } + */ + public static void fuse_unmount(MemorySegment mountpoint, MemorySegment ch) { var mh$ = fuse_unmount$MH(); try { mh$.invokeExact(mountpoint, ch); @@ -43,7 +52,12 @@ public static void fuse_unmount ( Addressable mountpoint, Addressable ch) { public static MethodHandle fuse_parse_cmdline$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_parse_cmdline$MH,"fuse_parse_cmdline"); } - public static int fuse_parse_cmdline ( Addressable args, Addressable mountpoint, Addressable multithreaded, Addressable foreground) { + /** + * {@snippet : + * int fuse_parse_cmdline(struct fuse_args* args, char** mountpoint, int* multithreaded, int* foreground); + * } + */ + public static int fuse_parse_cmdline(MemorySegment args, MemorySegment mountpoint, MemorySegment multithreaded, MemorySegment foreground) { var mh$ = fuse_parse_cmdline$MH(); try { return (int)mh$.invokeExact(args, mountpoint, multithreaded, foreground); @@ -54,10 +68,15 @@ public static int fuse_parse_cmdline ( Addressable args, Addressable mountpoint public static MethodHandle fuse_new$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_new$MH,"fuse_new"); } - public static MemoryAddress fuse_new ( Addressable ch, Addressable args, Addressable op, long op_size, Addressable user_data) { + /** + * {@snippet : + * struct fuse* fuse_new(struct fuse_chan* ch, struct fuse_args* args, struct fuse_operations* op, size_t op_size, void* user_data); + * } + */ + public static MemorySegment fuse_new(MemorySegment ch, MemorySegment args, MemorySegment op, long op_size, MemorySegment user_data) { var mh$ = fuse_new$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(ch, args, op, op_size, user_data); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(ch, args, op, op_size, user_data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -65,7 +84,12 @@ public static MemoryAddress fuse_new ( Addressable ch, Addressable args, Addre public static MethodHandle fuse_destroy$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_destroy$MH,"fuse_destroy"); } - public static void fuse_destroy ( Addressable f) { + /** + * {@snippet : + * void fuse_destroy(struct fuse* f); + * } + */ + public static void fuse_destroy(MemorySegment f) { var mh$ = fuse_destroy$MH(); try { mh$.invokeExact(f); @@ -76,7 +100,12 @@ public static void fuse_destroy ( Addressable f) { public static MethodHandle fuse_loop$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_loop$MH,"fuse_loop"); } - public static int fuse_loop ( Addressable f) { + /** + * {@snippet : + * int fuse_loop(struct fuse* f); + * } + */ + public static int fuse_loop(MemorySegment f) { var mh$ = fuse_loop$MH(); try { return (int)mh$.invokeExact(f); @@ -87,7 +116,12 @@ public static int fuse_loop ( Addressable f) { public static MethodHandle fuse_exit$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_exit$MH,"fuse_exit"); } - public static void fuse_exit ( Addressable f) { + /** + * {@snippet : + * void fuse_exit(struct fuse* f); + * } + */ + public static void fuse_exit(MemorySegment f) { var mh$ = fuse_exit$MH(); try { mh$.invokeExact(f); @@ -98,7 +132,12 @@ public static void fuse_exit ( Addressable f) { public static MethodHandle fuse_loop_mt$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse_loop_mt$MH,"fuse_loop_mt"); } - public static int fuse_loop_mt ( Addressable f) { + /** + * {@snippet : + * int fuse_loop_mt(struct fuse* f); + * } + */ + public static int fuse_loop_mt(MemorySegment f) { var mh$ = fuse_loop_mt$MH(); try { return (int)mh$.invokeExact(f); 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 index d3a0698a..15889d82 100644 --- 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 @@ -7,9 +7,63 @@ 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 GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -72,17 +126,22 @@ public class fuse_operations { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(getattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse_operations.getattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.getattr$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -94,20 +153,32 @@ static getattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getattr$VH() { return fuse_operations.getattr$VH; } - public static MemoryAddress getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getattr$VH.get(seg); - } - public static void getattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getattr.ofAddress(getattr$get(segment), session); + 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, @@ -117,17 +188,22 @@ public static getattr getattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(readlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse_operations.readlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -139,20 +215,32 @@ static readlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readlink$VH() { return fuse_operations.readlink$VH; } - public static MemoryAddress readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readlink$VH.get(seg); - } - public static void readlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readlink.ofAddress(readlink$get(segment), session); + 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, @@ -162,17 +250,22 @@ public static readlink readlink (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(getdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(getdir.class, fi, fuse_operations.getdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.getdir$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -184,20 +277,32 @@ static getdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getdir$VH() { return fuse_operations.getdir$VH; } - public static MemoryAddress getdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getdir$VH.get(seg); - } - public static void getdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getdir.ofAddress(getdir$get(segment), session); + 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, @@ -207,17 +312,22 @@ public static getdir getdir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, short _x1, int _x2); - static MemorySegment allocate(mknod fi, MemorySession session) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse_operations.mknod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, short __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2); + return (int)fuse_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -229,20 +339,32 @@ static mknod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mknod$VH() { return fuse_operations.mknod$VH; } - public static MemoryAddress mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mknod$VH.get(seg); - } - public static void mknod$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mknod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mknod.ofAddress(mknod$get(segment), session); + 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, @@ -251,17 +373,22 @@ public static mknod mknod (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, short _x1); - static MemorySegment allocate(mkdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse_operations.mkdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, short __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -273,20 +400,32 @@ static mkdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mkdir$VH() { return fuse_operations.mkdir$VH; } - public static MemoryAddress mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mkdir$VH.get(seg); - } - public static void mkdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mkdir.ofAddress(mkdir$get(segment), session); + 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 @@ -294,17 +433,22 @@ public static mkdir mkdir (MemorySegment segment, MemorySession session) { static final MethodHandle unlink$MH = RuntimeHelper.downcallHandle( fuse_operations.unlink$FUNC ); + /** + * {@snippet : + * int (*unlink)(char*); + * } + */ public interface unlink { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(unlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse_operations.unlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse_operations.unlink$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -316,20 +460,32 @@ static unlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle unlink$VH() { return fuse_operations.unlink$VH; } - public static MemoryAddress unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.unlink$VH.get(seg); - } - public static void unlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.unlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return unlink.ofAddress(unlink$get(segment), session); + 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 @@ -337,17 +493,22 @@ public static unlink unlink (MemorySegment segment, MemorySession session) { static final MethodHandle rmdir$MH = RuntimeHelper.downcallHandle( fuse_operations.rmdir$FUNC ); + /** + * {@snippet : + * int (*rmdir)(char*); + * } + */ public interface rmdir { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(rmdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse_operations.rmdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse_operations.rmdir$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -359,20 +520,32 @@ static rmdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rmdir$VH() { return fuse_operations.rmdir$VH; } - public static MemoryAddress rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rmdir$VH.get(seg); - } - public static void rmdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rmdir.ofAddress(rmdir$get(segment), session); + 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, @@ -381,17 +554,22 @@ public static rmdir rmdir (MemorySegment segment, MemorySession session) { static final MethodHandle symlink$MH = RuntimeHelper.downcallHandle( fuse_operations.symlink$FUNC ); + /** + * {@snippet : + * int (*symlink)(char*,char*); + * } + */ public interface symlink { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(symlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse_operations.symlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.symlink$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -403,20 +581,32 @@ static symlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle symlink$VH() { return fuse_operations.symlink$VH; } - public static MemoryAddress symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.symlink$VH.get(seg); - } - public static void symlink$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.symlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return symlink.ofAddress(symlink$get(segment), session); + 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, @@ -425,17 +615,22 @@ public static symlink symlink (MemorySegment segment, MemorySession session) { static final MethodHandle rename$MH = RuntimeHelper.downcallHandle( fuse_operations.rename$FUNC ); + /** + * {@snippet : + * int (*rename)(char*,char*); + * } + */ public interface rename { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(rename fi, MemorySession session) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse_operations.rename$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.rename$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -447,20 +642,32 @@ static rename ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rename$VH() { return fuse_operations.rename$VH; } - public static MemoryAddress rename$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rename$VH.get(seg); - } - public static void rename$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.rename$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rename.ofAddress(rename$get(segment), session); + 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, @@ -469,17 +676,22 @@ public static rename rename (MemorySegment segment, MemorySession session) { static final MethodHandle link$MH = RuntimeHelper.downcallHandle( fuse_operations.link$FUNC ); + /** + * {@snippet : + * int (*link)(char*,char*); + * } + */ public interface link { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(link fi, MemorySession session) { - return RuntimeHelper.upcallStub(link.class, fi, fuse_operations.link$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.link$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -491,20 +703,32 @@ static link ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle link$VH() { return fuse_operations.link$VH; } - public static MemoryAddress link$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.link$VH.get(seg); - } - public static void link$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.link$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return link.ofAddress(link$get(segment), session); + 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, @@ -513,17 +737,22 @@ public static link link (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, short _x1); - static MemorySegment allocate(chmod fi, MemorySession session) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse_operations.chmod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, short __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.chmod$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -535,20 +764,32 @@ static chmod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chmod$VH() { return fuse_operations.chmod$VH; } - public static MemoryAddress chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chmod$VH.get(seg); - } - public static void chmod$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chmod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chmod.ofAddress(chmod$get(segment), session); + 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, @@ -558,17 +799,22 @@ public static chmod chmod (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, int _x2); - static MemorySegment allocate(chown fi, MemorySession session) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse_operations.chown$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2); + return (int)fuse_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -580,20 +826,32 @@ static chown ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chown$VH() { return fuse_operations.chown$VH; } - public static MemoryAddress chown$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chown$VH.get(seg); - } - public static void chown$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.chown$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chown.ofAddress(chown$get(segment), session); + 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, @@ -602,17 +860,22 @@ public static chown chown (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1); - static MemorySegment allocate(truncate fi, MemorySession session) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse_operations.truncate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.truncate$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -624,20 +887,32 @@ static truncate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle truncate$VH() { return fuse_operations.truncate$VH; } - public static MemoryAddress truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.truncate$VH.get(seg); - } - public static void truncate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.truncate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return truncate.ofAddress(truncate$get(segment), session); + 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, @@ -646,17 +921,22 @@ public static truncate truncate (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(utime fi, MemorySession session) { - return RuntimeHelper.upcallStub(utime.class, fi, fuse_operations.utime$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.utime$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -668,20 +948,32 @@ static utime ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle utime$VH() { return fuse_operations.utime$VH; } - public static MemoryAddress utime$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utime$VH.get(seg); - } - public static void utime$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress utime$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utime$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return utime.ofAddress(utime$get(segment), session); + 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, @@ -690,17 +982,22 @@ public static utime utime (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(open fi, MemorySession session) { - return RuntimeHelper.upcallStub(open.class, fi, fuse_operations.open$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.open$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -712,20 +1009,32 @@ static open ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle open$VH() { return fuse_operations.open$VH; } - public static MemoryAddress open$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.open$VH.get(seg); - } - public static void open$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.open$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return open.ofAddress(open$get(segment), session); + 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, @@ -737,17 +1046,22 @@ public static open open (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read fi, MemorySession session) { - return RuntimeHelper.upcallStub(read.class, fi, fuse_operations.read$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -759,20 +1073,32 @@ static read ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read$VH() { return fuse_operations.read$VH; } - public static MemoryAddress read$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read$VH.get(seg); - } - public static void read$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read.ofAddress(read$get(segment), session); + 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, @@ -784,17 +1110,22 @@ public static read read (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(write fi, MemorySession session) { - return RuntimeHelper.upcallStub(write.class, fi, fuse_operations.write$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -806,20 +1137,32 @@ static write ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write$VH() { return fuse_operations.write$VH; } - public static MemoryAddress write$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write$VH.get(seg); - } - public static void write$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write.ofAddress(write$get(segment), session); + 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, @@ -828,17 +1171,22 @@ public static write write (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(statfs fi, MemorySession session) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse_operations.statfs$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.statfs$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -850,20 +1198,32 @@ static statfs ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle statfs$VH() { return fuse_operations.statfs$VH; } - public static MemoryAddress statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.statfs$VH.get(seg); - } - public static void statfs$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.statfs$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return statfs.ofAddress(statfs$get(segment), session); + 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, @@ -872,17 +1232,22 @@ public static statfs statfs (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(flush fi, MemorySession session) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse_operations.flush$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.flush$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -894,20 +1259,32 @@ static flush ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flush$VH() { return fuse_operations.flush$VH; } - public static MemoryAddress flush$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flush$VH.get(seg); - } - public static void flush$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flush$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flush.ofAddress(flush$get(segment), session); + 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, @@ -916,17 +1293,22 @@ public static flush flush (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(release fi, MemorySession session) { - return RuntimeHelper.upcallStub(release.class, fi, fuse_operations.release$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.release$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -938,20 +1320,32 @@ static release ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle release$VH() { return fuse_operations.release$VH; } - public static MemoryAddress release$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.release$VH.get(seg); - } - public static void release$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.release$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return release.ofAddress(release$get(segment), session); + 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, @@ -961,17 +1355,22 @@ public static release release (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsync fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse_operations.fsync$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -983,20 +1382,32 @@ static fsync ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsync$VH() { return fuse_operations.fsync$VH; } - public static MemoryAddress fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsync$VH.get(seg); - } - public static void fsync$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsync$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsync.ofAddress(fsync$get(segment), session); + 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, @@ -1008,17 +1419,22 @@ public static fsync fsync (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse_operations.setxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, int __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, __x4); + return (int)fuse_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1030,20 +1446,32 @@ static setxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle setxattr$VH() { return fuse_operations.setxattr$VH; } - public static MemoryAddress setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.setxattr$VH.get(seg); - } - public static void setxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return setxattr.ofAddress(setxattr$get(segment), session); + 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, @@ -1054,17 +1482,22 @@ public static setxattr setxattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3); - static MemorySegment allocate(getxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse_operations.getxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3); + return (int)fuse_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1076,20 +1509,32 @@ static getxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getxattr$VH() { return fuse_operations.getxattr$VH; } - public static MemoryAddress getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getxattr$VH.get(seg); - } - public static void getxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getxattr.ofAddress(getxattr$get(segment), session); + 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, @@ -1099,17 +1544,22 @@ public static getxattr getxattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(listxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse_operations.listxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1121,20 +1571,32 @@ static listxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle listxattr$VH() { return fuse_operations.listxattr$VH; } - public static MemoryAddress listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.listxattr$VH.get(seg); - } - public static void listxattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return listxattr.ofAddress(listxattr$get(segment), session); + 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, @@ -1143,17 +1605,22 @@ public static listxattr listxattr (MemorySegment segment, MemorySession session) static final MethodHandle removexattr$MH = RuntimeHelper.downcallHandle( fuse_operations.removexattr$FUNC ); + /** + * {@snippet : + * int (*removexattr)(char*,char*); + * } + */ public interface removexattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(removexattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse_operations.removexattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1165,20 +1632,32 @@ static removexattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle removexattr$VH() { return fuse_operations.removexattr$VH; } - public static MemoryAddress removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.removexattr$VH.get(seg); - } - public static void removexattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return removexattr.ofAddress(removexattr$get(segment), session); + 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, @@ -1187,17 +1666,22 @@ public static removexattr removexattr (MemorySegment segment, MemorySession sess 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(opendir fi, MemorySession session) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse_operations.opendir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.opendir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1209,20 +1693,32 @@ static opendir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle opendir$VH() { return fuse_operations.opendir$VH; } - public static MemoryAddress opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.opendir$VH.get(seg); - } - public static void opendir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.opendir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return opendir.ofAddress(opendir$get(segment), session); + 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, @@ -1234,17 +1730,22 @@ public static opendir opendir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(readdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse_operations.readdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.readdir$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1256,20 +1757,32 @@ static readdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readdir$VH() { return fuse_operations.readdir$VH; } - public static MemoryAddress readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readdir$VH.get(seg); - } - public static void readdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.readdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readdir.ofAddress(readdir$get(segment), session); + 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, @@ -1278,17 +1791,22 @@ public static readdir readdir (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(releasedir fi, MemorySession session) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse_operations.releasedir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1300,20 +1818,32 @@ static releasedir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle releasedir$VH() { return fuse_operations.releasedir$VH; } - public static MemoryAddress releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.releasedir$VH.get(seg); - } - public static void releasedir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return releasedir.ofAddress(releasedir$get(segment), session); + 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, @@ -1323,17 +1853,22 @@ public static releasedir releasedir (MemorySegment segment, MemorySession sessio 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsyncdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse_operations.fsyncdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1345,20 +1880,32 @@ static fsyncdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsyncdir$VH() { return fuse_operations.fsyncdir$VH; } - public static MemoryAddress fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsyncdir$VH.get(seg); - } - public static void fsyncdir$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsyncdir.ofAddress(fsyncdir$get(segment), session); + 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 @@ -1366,17 +1913,22 @@ public static fsyncdir fsyncdir (MemorySegment segment, MemorySession session) { static final MethodHandle init$MH = RuntimeHelper.downcallHandle( fuse_operations.init$FUNC ); + /** + * {@snippet : + * void* (*init)(struct fuse_conn_info*); + * } + */ public interface init { - java.lang.foreign.Addressable apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(init fi, MemorySession session) { - return RuntimeHelper.upcallStub(init.class, fi, fuse_operations.init$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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.Addressable)(java.lang.foreign.MemoryAddress)fuse_operations.init$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (java.lang.foreign.MemorySegment)fuse_operations.init$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1388,20 +1940,32 @@ static init ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle init$VH() { return fuse_operations.init$VH; } - public static MemoryAddress init$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.init$VH.get(seg); - } - public static void init$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.init$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return init.ofAddress(init$get(segment), session); + 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 @@ -1409,17 +1973,22 @@ public static init init (MemorySegment segment, MemorySession session) { static final MethodHandle destroy$MH = RuntimeHelper.downcallHandle( fuse_operations.destroy$FUNC ); + /** + * {@snippet : + * void (*destroy)(void*); + * } + */ public interface destroy { - void apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(destroy fi, MemorySession session) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse_operations.destroy$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + fuse_operations.destroy$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1431,20 +2000,32 @@ static destroy ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle destroy$VH() { return fuse_operations.destroy$VH; } - public static MemoryAddress destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.destroy$VH.get(seg); - } - public static void destroy$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.destroy$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return destroy.ofAddress(destroy$get(segment), session); + 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, @@ -1453,17 +2034,22 @@ public static destroy destroy (MemorySegment segment, MemorySession session) { static final MethodHandle access$MH = RuntimeHelper.downcallHandle( fuse_operations.access$FUNC ); + /** + * {@snippet : + * int (*access)(char*,int); + * } + */ public interface access { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1); - static MemorySegment allocate(access fi, MemorySession session) { - return RuntimeHelper.upcallStub(access.class, fi, fuse_operations.access$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse_operations.access$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1475,20 +2061,32 @@ static access ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle access$VH() { return fuse_operations.access$VH; } - public static MemoryAddress access$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.access$VH.get(seg); - } - public static void access$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.access$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return access.ofAddress(access$get(segment), session); + 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, @@ -1498,17 +2096,22 @@ public static access access (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, short _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(create fi, MemorySession session) { - return RuntimeHelper.upcallStub(create.class, fi, fuse_operations.create$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, short __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1520,20 +2123,32 @@ static create ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle create$VH() { return fuse_operations.create$VH; } - public static MemoryAddress create$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.create$VH.get(seg); - } - public static void create$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.create$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return create.ofAddress(create$get(segment), session); + 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, @@ -1543,17 +2158,22 @@ public static create create (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(ftruncate fi, MemorySession session) { - return RuntimeHelper.upcallStub(ftruncate.class, fi, fuse_operations.ftruncate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.ftruncate$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1565,20 +2185,32 @@ static ftruncate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle ftruncate$VH() { return fuse_operations.ftruncate$VH; } - public static MemoryAddress ftruncate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ftruncate$VH.get(seg); - } - public static void ftruncate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress ftruncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ftruncate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return ftruncate.ofAddress(ftruncate$get(segment), session); + 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, @@ -1588,17 +2220,22 @@ public static ftruncate ftruncate (MemorySegment segment, MemorySession session) 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fgetattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(fgetattr.class, fi, fuse_operations.fgetattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.fgetattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1610,20 +2247,32 @@ static fgetattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fgetattr$VH() { return fuse_operations.fgetattr$VH; } - public static MemoryAddress fgetattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fgetattr$VH.get(seg); - } - public static void fgetattr$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fgetattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fgetattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fgetattr.ofAddress(fgetattr$get(segment), session); + 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, @@ -1634,17 +2283,22 @@ public static fgetattr fgetattr (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(lock fi, MemorySession session) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse_operations.lock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1656,20 +2310,32 @@ static lock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle lock$VH() { return fuse_operations.lock$VH; } - public static MemoryAddress lock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lock$VH.get(seg); - } - public static void lock$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.lock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return lock.ofAddress(lock$get(segment), session); + 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, @@ -1678,17 +2344,22 @@ public static lock lock (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(utimens fi, MemorySession session) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse_operations.utimens$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse_operations.utimens$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1700,20 +2371,32 @@ static utimens ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle utimens$VH() { return fuse_operations.utimens$VH; } - public static MemoryAddress utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utimens$VH.get(seg); - } - public static void utimens$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.utimens$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return utimens.ofAddress(utimens$get(segment), session); + 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, @@ -1723,17 +2406,22 @@ public static utimens utimens (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(bmap fi, MemorySession session) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse_operations.bmap$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1745,20 +2433,32 @@ static bmap ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle bmap$VH() { return fuse_operations.bmap$VH; } - public static MemoryAddress bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.bmap$VH.get(seg); - } - public static void bmap$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.bmap$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return bmap.ofAddress(bmap$get(segment), session); + 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, @@ -1771,17 +2471,22 @@ public static bmap bmap (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3, int _x4, java.lang.foreign.MemoryAddress _x5); - static MemorySegment allocate(ioctl fi, MemorySession session) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse_operations.ioctl$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3, int __x4, java.lang.foreign.MemoryAddress __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3, __x4, (java.lang.foreign.Addressable)__x5); + 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$); } @@ -1793,20 +2498,32 @@ static ioctl ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle ioctl$VH() { return fuse_operations.ioctl$VH; } - public static MemoryAddress ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ioctl$VH.get(seg); - } - public static void ioctl$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return ioctl.ofAddress(ioctl$get(segment), session); + 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, @@ -1817,17 +2534,22 @@ public static ioctl ioctl (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(poll fi, MemorySession session) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse_operations.poll$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1839,20 +2561,32 @@ static poll ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle poll$VH() { return fuse_operations.poll$VH; } - public static MemoryAddress poll$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.poll$VH.get(seg); - } - public static void poll$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.poll$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return poll.ofAddress(poll$get(segment), session); + 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, @@ -1863,17 +2597,22 @@ public static poll poll (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(write_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse_operations.write_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1885,20 +2624,32 @@ static write_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write_buf$VH() { return fuse_operations.write_buf$VH; } - public static MemoryAddress write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write_buf$VH.get(seg); - } - public static void write_buf$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write_buf.ofAddress(write_buf$get(segment), session); + 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, @@ -1910,17 +2661,22 @@ public static write_buf write_buf (MemorySegment segment, MemorySession session) 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse_operations.read_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + 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$); } @@ -1932,20 +2688,32 @@ static read_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read_buf$VH() { return fuse_operations.read_buf$VH; } - public static MemoryAddress read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read_buf$VH.get(seg); - } - public static void read_buf$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read_buf.ofAddress(read_buf$get(segment), session); + 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, @@ -1955,17 +2723,22 @@ public static read_buf read_buf (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(flock fi, MemorySession session) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse_operations.flock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1977,20 +2750,32 @@ static flock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flock$VH() { return fuse_operations.flock$VH; } - public static MemoryAddress flock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flock$VH.get(seg); - } - public static void flock$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.flock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flock.ofAddress(flock$get(segment), session); + 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, @@ -2002,17 +2787,22 @@ public static flock flock (MemorySegment segment, MemorySession session) { 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.MemoryAddress _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(fallocate fi, MemorySession session) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse_operations.fallocate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -2024,27 +2814,39 @@ static fallocate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fallocate$VH() { return fuse_operations.fallocate$VH; } - public static MemoryAddress fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fallocate$VH.get(seg); - } - public static void fallocate$set( MemorySegment seg, MemoryAddress x) { + /** + * 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 MemoryAddress fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fallocate.ofAddress(fallocate$get(segment), session); + 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(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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/stat.java index 1893a514..822fa12b 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/stat.java @@ -7,9 +7,33 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct stat { + * dev_t st_dev; + * mode_t st_mode; + * nlink_t st_nlink; + * __darwin_ino64_t st_ino; + * uid_t st_uid; + * gid_t st_gid; + * dev_t st_rdev; + * struct timespec st_atimespec; + * struct timespec st_mtimespec; + * struct timespec st_ctimespec; + * struct timespec st_birthtimespec; + * off_t st_size; + * blkcnt_t st_blocks; + * blksize_t st_blksize; + * __uint32_t st_flags; + * __uint32_t st_gen; + * __int32_t st_lspare; + * __int64_t st_qspare[2]; + * }; + * } + */ public class stat { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -49,10 +73,22 @@ public class stat { public static VarHandle st_dev$VH() { return stat.st_dev$VH; } + /** + * Getter for field: + * {@snippet : + * dev_t st_dev; + * } + */ public static int st_dev$get(MemorySegment seg) { return (int)stat.st_dev$VH.get(seg); } - public static void st_dev$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * dev_t st_dev; + * } + */ + public static void st_dev$set(MemorySegment seg, int x) { stat.st_dev$VH.set(seg, x); } public static int st_dev$get(MemorySegment seg, long index) { @@ -65,10 +101,22 @@ public class stat { public static VarHandle st_mode$VH() { return stat.st_mode$VH; } + /** + * Getter for field: + * {@snippet : + * mode_t st_mode; + * } + */ public static short st_mode$get(MemorySegment seg) { return (short)stat.st_mode$VH.get(seg); } - public static void st_mode$set( MemorySegment seg, short x) { + /** + * Setter for field: + * {@snippet : + * mode_t st_mode; + * } + */ + public static void st_mode$set(MemorySegment seg, short x) { stat.st_mode$VH.set(seg, x); } public static short st_mode$get(MemorySegment seg, long index) { @@ -81,10 +129,22 @@ public class stat { public static VarHandle st_nlink$VH() { return stat.st_nlink$VH; } + /** + * Getter for field: + * {@snippet : + * nlink_t st_nlink; + * } + */ public static short st_nlink$get(MemorySegment seg) { return (short)stat.st_nlink$VH.get(seg); } - public static void st_nlink$set( MemorySegment seg, short x) { + /** + * Setter for field: + * {@snippet : + * nlink_t st_nlink; + * } + */ + public static void st_nlink$set(MemorySegment seg, short x) { stat.st_nlink$VH.set(seg, x); } public static short st_nlink$get(MemorySegment seg, long index) { @@ -97,10 +157,22 @@ public class stat { public static VarHandle st_ino$VH() { return stat.st_ino$VH; } + /** + * Getter for field: + * {@snippet : + * __darwin_ino64_t st_ino; + * } + */ public static long st_ino$get(MemorySegment seg) { return (long)stat.st_ino$VH.get(seg); } - public static void st_ino$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __darwin_ino64_t st_ino; + * } + */ + public static void st_ino$set(MemorySegment seg, long x) { stat.st_ino$VH.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { @@ -113,10 +185,22 @@ public class stat { public static VarHandle st_uid$VH() { return stat.st_uid$VH; } + /** + * Getter for field: + * {@snippet : + * uid_t st_uid; + * } + */ public static int st_uid$get(MemorySegment seg) { return (int)stat.st_uid$VH.get(seg); } - public static void st_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * uid_t st_uid; + * } + */ + public static void st_uid$set(MemorySegment seg, int x) { stat.st_uid$VH.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { @@ -129,10 +213,22 @@ public class stat { public static VarHandle st_gid$VH() { return stat.st_gid$VH; } + /** + * Getter for field: + * {@snippet : + * gid_t st_gid; + * } + */ public static int st_gid$get(MemorySegment seg) { return (int)stat.st_gid$VH.get(seg); } - public static void st_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * gid_t st_gid; + * } + */ + public static void st_gid$set(MemorySegment seg, int x) { stat.st_gid$VH.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { @@ -145,10 +241,22 @@ public class stat { public static VarHandle st_rdev$VH() { return stat.st_rdev$VH; } + /** + * Getter for field: + * {@snippet : + * dev_t st_rdev; + * } + */ public static int st_rdev$get(MemorySegment seg) { return (int)stat.st_rdev$VH.get(seg); } - public static void st_rdev$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * dev_t st_rdev; + * } + */ + public static void st_rdev$set(MemorySegment seg, int x) { stat.st_rdev$VH.set(seg, x); } public static int st_rdev$get(MemorySegment seg, long index) { @@ -173,10 +281,22 @@ public class stat { public static VarHandle st_size$VH() { return stat.st_size$VH; } + /** + * Getter for field: + * {@snippet : + * off_t st_size; + * } + */ public static long st_size$get(MemorySegment seg) { return (long)stat.st_size$VH.get(seg); } - public static void st_size$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * off_t st_size; + * } + */ + public static void st_size$set(MemorySegment seg, long x) { stat.st_size$VH.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { @@ -189,10 +309,22 @@ public class stat { public static VarHandle st_blocks$VH() { return stat.st_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * blkcnt_t st_blocks; + * } + */ public static long st_blocks$get(MemorySegment seg) { return (long)stat.st_blocks$VH.get(seg); } - public static void st_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * blkcnt_t st_blocks; + * } + */ + public static void st_blocks$set(MemorySegment seg, long x) { stat.st_blocks$VH.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { @@ -205,10 +337,22 @@ public class stat { public static VarHandle st_blksize$VH() { return stat.st_blksize$VH; } + /** + * Getter for field: + * {@snippet : + * blksize_t st_blksize; + * } + */ public static int st_blksize$get(MemorySegment seg) { return (int)stat.st_blksize$VH.get(seg); } - public static void st_blksize$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * blksize_t st_blksize; + * } + */ + public static void st_blksize$set(MemorySegment seg, int x) { stat.st_blksize$VH.set(seg, x); } public static int st_blksize$get(MemorySegment seg, long index) { @@ -221,10 +365,22 @@ public class stat { public static VarHandle st_flags$VH() { return stat.st_flags$VH; } + /** + * Getter for field: + * {@snippet : + * __uint32_t st_flags; + * } + */ public static int st_flags$get(MemorySegment seg) { return (int)stat.st_flags$VH.get(seg); } - public static void st_flags$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __uint32_t st_flags; + * } + */ + public static void st_flags$set(MemorySegment seg, int x) { stat.st_flags$VH.set(seg, x); } public static int st_flags$get(MemorySegment seg, long index) { @@ -237,10 +393,22 @@ public class stat { public static VarHandle st_gen$VH() { return stat.st_gen$VH; } + /** + * Getter for field: + * {@snippet : + * __uint32_t st_gen; + * } + */ public static int st_gen$get(MemorySegment seg) { return (int)stat.st_gen$VH.get(seg); } - public static void st_gen$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __uint32_t st_gen; + * } + */ + public static void st_gen$set(MemorySegment seg, int x) { stat.st_gen$VH.set(seg, x); } public static int st_gen$get(MemorySegment seg, long index) { @@ -253,10 +421,22 @@ public class stat { public static VarHandle st_lspare$VH() { return stat.st_lspare$VH; } + /** + * Getter for field: + * {@snippet : + * __int32_t st_lspare; + * } + */ public static int st_lspare$get(MemorySegment seg) { return (int)stat.st_lspare$VH.get(seg); } - public static void st_lspare$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * __int32_t st_lspare; + * } + */ + public static void st_lspare$set(MemorySegment seg, int x) { stat.st_lspare$VH.set(seg, x); } public static int st_lspare$get(MemorySegment seg, long index) { @@ -270,10 +450,10 @@ public class stat { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } 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 index 16d83ef8..5b7a498d 100644 --- 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 @@ -9,18 +9,27 @@ import static java.lang.foreign.ValueLayout.*; public class stat_h { - /* package-private */ stat_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_INT$LAYOUT; - public static OfLong C_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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/main/java/org/cryptomator/jfuse/mac/extr/statvfs.java b/jfuse-mac/src/main/java/org/cryptomator/jfuse/mac/extr/statvfs.java index 661d8cf7..ae5a11e2 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/statvfs.java @@ -7,9 +7,26 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct statvfs { + * unsigned long f_bsize; + * unsigned long f_frsize; + * fsblkcnt_t f_blocks; + * fsblkcnt_t f_bfree; + * fsblkcnt_t f_bavail; + * fsfilcnt_t f_files; + * fsfilcnt_t f_ffree; + * fsfilcnt_t f_favail; + * unsigned long f_fsid; + * unsigned long f_flag; + * unsigned long f_namemax; + * }; + * } + */ public class statvfs { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -29,10 +46,22 @@ public class statvfs { public static VarHandle f_bsize$VH() { return statvfs.f_bsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_bsize; + * } + */ public static long f_bsize$get(MemorySegment seg) { return (long)statvfs.f_bsize$VH.get(seg); } - public static void f_bsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_bsize; + * } + */ + public static void f_bsize$set(MemorySegment seg, long x) { statvfs.f_bsize$VH.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { @@ -45,10 +74,22 @@ public class statvfs { public static VarHandle f_frsize$VH() { return statvfs.f_frsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_frsize; + * } + */ public static long f_frsize$get(MemorySegment seg) { return (long)statvfs.f_frsize$VH.get(seg); } - public static void f_frsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_frsize; + * } + */ + public static void f_frsize$set(MemorySegment seg, long x) { statvfs.f_frsize$VH.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { @@ -61,10 +102,22 @@ public class statvfs { public static VarHandle f_blocks$VH() { return statvfs.f_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * fsblkcnt_t f_blocks; + * } + */ public static int f_blocks$get(MemorySegment seg) { return (int)statvfs.f_blocks$VH.get(seg); } - public static void f_blocks$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * fsblkcnt_t f_blocks; + * } + */ + public static void f_blocks$set(MemorySegment seg, int x) { statvfs.f_blocks$VH.set(seg, x); } public static int f_blocks$get(MemorySegment seg, long index) { @@ -77,10 +130,22 @@ public class statvfs { public static VarHandle f_bfree$VH() { return statvfs.f_bfree$VH; } + /** + * Getter for field: + * {@snippet : + * fsblkcnt_t f_bfree; + * } + */ public static int f_bfree$get(MemorySegment seg) { return (int)statvfs.f_bfree$VH.get(seg); } - public static void f_bfree$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * fsblkcnt_t f_bfree; + * } + */ + public static void f_bfree$set(MemorySegment seg, int x) { statvfs.f_bfree$VH.set(seg, x); } public static int f_bfree$get(MemorySegment seg, long index) { @@ -93,10 +158,22 @@ public class statvfs { public static VarHandle f_bavail$VH() { return statvfs.f_bavail$VH; } + /** + * Getter for field: + * {@snippet : + * fsblkcnt_t f_bavail; + * } + */ public static int f_bavail$get(MemorySegment seg) { return (int)statvfs.f_bavail$VH.get(seg); } - public static void f_bavail$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * fsblkcnt_t f_bavail; + * } + */ + public static void f_bavail$set(MemorySegment seg, int x) { statvfs.f_bavail$VH.set(seg, x); } public static int f_bavail$get(MemorySegment seg, long index) { @@ -109,10 +186,22 @@ public class statvfs { public static VarHandle f_files$VH() { return statvfs.f_files$VH; } + /** + * Getter for field: + * {@snippet : + * fsfilcnt_t f_files; + * } + */ public static int f_files$get(MemorySegment seg) { return (int)statvfs.f_files$VH.get(seg); } - public static void f_files$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * fsfilcnt_t f_files; + * } + */ + public static void f_files$set(MemorySegment seg, int x) { statvfs.f_files$VH.set(seg, x); } public static int f_files$get(MemorySegment seg, long index) { @@ -125,10 +214,22 @@ public class statvfs { public static VarHandle f_ffree$VH() { return statvfs.f_ffree$VH; } + /** + * Getter for field: + * {@snippet : + * fsfilcnt_t f_ffree; + * } + */ public static int f_ffree$get(MemorySegment seg) { return (int)statvfs.f_ffree$VH.get(seg); } - public static void f_ffree$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * fsfilcnt_t f_ffree; + * } + */ + public static void f_ffree$set(MemorySegment seg, int x) { statvfs.f_ffree$VH.set(seg, x); } public static int f_ffree$get(MemorySegment seg, long index) { @@ -141,10 +242,22 @@ public class statvfs { public static VarHandle f_favail$VH() { return statvfs.f_favail$VH; } + /** + * Getter for field: + * {@snippet : + * fsfilcnt_t f_favail; + * } + */ public static int f_favail$get(MemorySegment seg) { return (int)statvfs.f_favail$VH.get(seg); } - public static void f_favail$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * fsfilcnt_t f_favail; + * } + */ + public static void f_favail$set(MemorySegment seg, int x) { statvfs.f_favail$VH.set(seg, x); } public static int f_favail$get(MemorySegment seg, long index) { @@ -157,10 +270,22 @@ public class statvfs { public static VarHandle f_fsid$VH() { return statvfs.f_fsid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_fsid; + * } + */ public static long f_fsid$get(MemorySegment seg) { return (long)statvfs.f_fsid$VH.get(seg); } - public static void f_fsid$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_fsid; + * } + */ + public static void f_fsid$set(MemorySegment seg, long x) { statvfs.f_fsid$VH.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { @@ -173,10 +298,22 @@ public class statvfs { public static VarHandle f_flag$VH() { return statvfs.f_flag$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_flag; + * } + */ public static long f_flag$get(MemorySegment seg) { return (long)statvfs.f_flag$VH.get(seg); } - public static void f_flag$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_flag; + * } + */ + public static void f_flag$set(MemorySegment seg, long x) { statvfs.f_flag$VH.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { @@ -189,10 +326,22 @@ public class statvfs { public static VarHandle f_namemax$VH() { return statvfs.f_namemax$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long f_namemax; + * } + */ public static long f_namemax$get(MemorySegment seg) { return (long)statvfs.f_namemax$VH.get(seg); } - public static void f_namemax$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long f_namemax; + * } + */ + public static void f_namemax$set(MemorySegment seg, long x) { statvfs.f_namemax$VH.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { @@ -203,10 +352,10 @@ public class statvfs { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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/timespec.java index 9ac47bc1..be70f479 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/timespec.java @@ -7,9 +7,17 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct timespec { + * __darwin_time_t tv_sec; + * long tv_nsec; + * }; + * } + */ public class timespec { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"); @@ -20,10 +28,22 @@ public class timespec { public static VarHandle tv_sec$VH() { return timespec.tv_sec$VH; } + /** + * Getter for field: + * {@snippet : + * __darwin_time_t tv_sec; + * } + */ public static long tv_sec$get(MemorySegment seg) { return (long)timespec.tv_sec$VH.get(seg); } - public static void tv_sec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * __darwin_time_t tv_sec; + * } + */ + public static void tv_sec$set(MemorySegment seg, long x) { timespec.tv_sec$VH.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { @@ -36,10 +56,22 @@ public class timespec { public static VarHandle tv_nsec$VH() { return timespec.tv_nsec$VH; } + /** + * Getter for field: + * {@snippet : + * long tv_nsec; + * } + */ public static long tv_nsec$get(MemorySegment seg) { return (long)timespec.tv_nsec$VH.get(seg); } - public static void tv_nsec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * long tv_nsec; + * } + */ + public static void tv_nsec$set(MemorySegment seg, long x) { timespec.tv_nsec$VH.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { @@ -50,10 +82,10 @@ public class timespec { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + public static MemorySegment allocateArray(long len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } 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 0132095c..043e7690 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 @@ -8,7 +8,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.nio.file.OpenOption; import java.nio.file.StandardOpenOption; import java.util.Set; @@ -20,8 +20,8 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var scope = MemorySession.openConfined()) { - var fi = new FileInfoImpl(fuse_file_info.allocate(scope)); + try (var arena = Arena.openConfined()) { + var fi = new FileInfoImpl(fuse_file_info.allocate(arena)); fuse_file_info.flags$set(fi.segment(), flags); var result = fi.getOpenFlags(); 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 82defd21..5cbbd332 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = fuse_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 dd7b1daf..66817242 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 @@ -1,7 +1,7 @@ package org.cryptomator.jfuse.mac; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -18,9 +18,8 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.time.Instant; import java.util.List; @@ -54,8 +53,8 @@ public void teardown() { @Test @DisplayName("MountFailedException when fuse_new fails") public void testFuseNewFails() { - fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L)); - fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL); + fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(MemorySegment.ofAddress(42L)); + fuseH.when(() -> fuse_h.fuse_new(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.NULL); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -66,7 +65,7 @@ public void testFuseNewFails() { @Test @DisplayName("MountFailedException when fuse_mount fails") public void testFuseMountFails() { - fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(MemoryAddress.NULL); + fuseH.when(() -> fuse_h.fuse_mount(Mockito.any(), Mockito.any())).thenReturn(MemorySegment.NULL); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -80,12 +79,12 @@ public void testFuseMountFails() { @DisplayName("parseArgs") public void testParseArgs() { try (var fuseH = Mockito.mockStatic(fuse_h.class); - var scope = MemorySession.openConfined()) { + var arena = Arena.openConfined()) { 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); MemorySegment fg = invocation.getArgument(3); - mp.set(ValueLayout.ADDRESS, 0L, scope.allocateUtf8String("/mount/point")); + mp.set(ValueLayout.ADDRESS, 0L, arena.allocateUtf8String("/mount/point")); mt.set(JAVA_INT, 0L, 1); fg.set(JAVA_INT, 0L, 1); return 0; @@ -108,12 +107,12 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.flush(path.address(), fi.address()); + var result = fuseImpl.flush(path, fi); Assertions.assertEquals(42, result); } @@ -122,12 +121,12 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsync(path.address(), 1, fi.address()); + var result = fuseImpl.fsync(path, 1, fi); Assertions.assertEquals(42, result); } @@ -136,12 +135,12 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsyncdir(path.address(), 1, fi.address()); + var result = fuseImpl.fsyncdir(path, 1, fi); Assertions.assertEquals(42, result); } @@ -156,12 +155,12 @@ public class Utimens { @DisplayName("utimens(\"/foo\", UTIME_NOW, UTIME_NOW)") @Test public void testUtimensNow() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var times = MemoryAddress.NULL; + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.utimens(path.address(), times); + var result = fuseImpl.utimens(path, times); Assertions.assertEquals(42, result); } @@ -176,16 +175,16 @@ 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 scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var times = timespec.allocateArray(2, scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var times = timespec.allocateArray(2, arena); timespec.tv_sec$set(times, 0, sec0); timespec.tv_nsec$set(times, 0, nsec0); timespec.tv_sec$set(times, 1, sec1); timespec.tv_nsec$set(times, 1, nsec1); Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(t -> expectedATime.equals(t.get())), Mockito.argThat(t -> expectedMTime.equals(t.get())), Mockito.isNull()); - var result = fuseImpl.utimens(path.address(), times.address()); + var result = fuseImpl.utimens(path, times); Assertions.assertEquals(42, result); } @@ -199,12 +198,12 @@ public class Attr { @Test @DisplayName("getattr") public void testGetattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var attr = stat.allocate(scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var attr = stat.allocate(arena); Mockito.doReturn(42).when(fuseOps).getattr(Mockito.eq("/foo"), Mockito.any(), Mockito.isNull()); - var result = fuseImpl.getattr(path.address(), attr.address()); + var result = fuseImpl.getattr(path, attr); Assertions.assertEquals(42, result); } @@ -213,13 +212,13 @@ public void testGetattr() { @Test @DisplayName("fgetattr") public void testFgetattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var attr = stat.allocate(scope); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var attr = stat.allocate(arena); + var fi = fuse_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).getattr(Mockito.eq("/foo"), Mockito.any(), Mockito.notNull()); - var result = fuseImpl.fgetattr(path.address(), attr.address(), fi.address()); + var result = fuseImpl.fgetattr(path, attr, fi); Assertions.assertEquals(42, result); } @@ -228,14 +227,14 @@ public void testFgetattr() { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).getxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any()); - var result = fuseImpl.getxattr(path.address(), name.address(), value.address(), 100); + var result = fuseImpl.getxattr(path, name, value, 100); Assertions.assertEquals(42, result); } @@ -244,14 +243,14 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).setxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any(), Mockito.anyInt()); - var result = fuseImpl.setxattr(path.address(), name.address(), value.address(), 100, 0xDEADBEEF); + var result = fuseImpl.setxattr(path, name, value, 100, 0xDEADBEEF); Assertions.assertEquals(42, result); } @@ -260,13 +259,13 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var list = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var list = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).listxattr(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.listxattr(path.address(), list.address(), 100); + var result = fuseImpl.listxattr(path, list, 100); Assertions.assertEquals(42, result); } @@ -275,13 +274,13 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); Mockito.doReturn(42).when(fuseOps).removexattr(Mockito.eq("/foo"), Mockito.eq("bar")); - var result = fuseImpl.removexattr(path.address(), name.address()); + var result = fuseImpl.removexattr(path, name); Assertions.assertEquals(42, result); } @@ -296,11 +295,11 @@ public class Truncate { @Test @DisplayName("truncate") public void testTruncate() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); Mockito.doReturn(42).when(fuseOps).truncate(Mockito.eq("/foo"), Mockito.eq(1337L), Mockito.isNull()); - var result = fuseImpl.truncate(path.address(), 1337L); + var result = fuseImpl.truncate(path, 1337L); Assertions.assertEquals(42, result); } @@ -309,12 +308,12 @@ public void testTruncate() { @Test @DisplayName("ftruncate") public void testFtruncate() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.ftruncate(path.address(), 1337L, fi.address()); + var result = fuseImpl.ftruncate(path, 1337L, fi); Assertions.assertEquals(42, result); } @@ -325,11 +324,11 @@ public void testFtruncate() { @Test @DisplayName("chown") public void testChown() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); Mockito.doReturn(42).when(fuseOps).chown("/foo", 42, 1337, null); - var result = fuseImpl.chown(path.address(), 42, 1337); + var result = fuseImpl.chown(path, 42, 1337); Assertions.assertEquals(42, result); } 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 fb31d70f..258a312a 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); setter.accept(stat, value); 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 89394fc7..c0bb73df 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 @@ -6,7 +6,7 @@ import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.time.Instant; public class TimeSpecImplTest { @@ -14,8 +14,8 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 123L); timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,8 +29,8 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(timespec.allocate(arena)); timespec.tv_sec$set(timeSpec.segment(), 0L); timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,8 +44,8 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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,8 +57,8 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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-win/src/main/java/org/cryptomator/jfuse/win/DirFillerImpl.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/DirFillerImpl.java index 6ef37a44..edc496e8 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 @@ -5,21 +5,21 @@ import org.cryptomator.jfuse.win.extr.fuse3_fill_dir_t; import org.cryptomator.jfuse.win.extr.fuse_stat; -import java.lang.foreign.MemoryAddress; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; +import java.lang.foreign.MemorySegment; import java.util.function.Consumer; -record DirFillerImpl(MemoryAddress buf, fuse3_fill_dir_t callback, MemorySession scope) implements DirFiller { +record DirFillerImpl(MemorySegment buf, fuse3_fill_dir_t callback, Arena arena) implements DirFiller { - DirFillerImpl(MemoryAddress buf, MemoryAddress callback, MemorySession scope) { - this(buf, fuse3_fill_dir_t.ofAddress(callback, scope), scope); + DirFillerImpl(MemorySegment buf, MemorySegment callback, Arena arena) { + this(buf, fuse3_fill_dir_t.ofAddress(callback, arena.scope()), arena); } @Override public int fill(String name, Consumer statFiller, long offset, int flags) { - var statSegment = fuse_stat.allocate(scope); + var statSegment = fuse_stat.allocate(arena); statFiller.accept(new StatImpl(statSegment)); - return callback.apply(buf, scope.allocateUtf8String(name).address(), statSegment.address(), offset, flags); + return callback.apply(buf, arena.allocateUtf8String(name), statSegment, offset, flags); } } \ No newline at end of file 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 a7c2832d..39ba56f9 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 @@ -4,9 +4,8 @@ import org.cryptomator.jfuse.win.extr.fcntl_h; import org.cryptomator.jfuse.win.extr.fuse3_file_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; import java.nio.file.StandardOpenOption; import java.util.EnumSet; import java.util.Set; @@ -21,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(MemoryAddress address, MemorySession scope) { + public FileInfoImpl(MemorySegment address, SegmentScope 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 915d7f12..5721a1b7 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 @@ -2,11 +2,11 @@ import org.cryptomator.jfuse.win.extr.fuse2.fuse_args; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemorySegment; import java.lang.foreign.MemorySegment; import java.lang.foreign.ValueLayout; -record FuseArgs(MemorySegment args, MemoryAddress mountPoint, boolean multiThreaded) { +record FuseArgs(MemorySegment args, MemorySegment mountPoint, boolean multiThreaded) { @Override public String toString() { @@ -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, i); + var cString = argv.getAtIndex(ValueLayout.ADDRESS.asUnbounded(), i); sb.append("arg[").append(i).append("] = ").append(cString.getUtf8String(0)).append(", "); } sb.append("mountPoint = ").append(mountPoint().getUtf8String(0)); 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 b30cbe2c..69a2073e 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConfig; import org.cryptomator.jfuse.win.extr.fuse3_config; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConfigImpl(MemorySegment segment) implements FuseConfig { - public FuseConfigImpl(MemoryAddress address, MemorySession scope) { + public FuseConfigImpl(MemorySegment address, SegmentScope 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 0eb1b8e2..5d4c393e 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.win.extr.fuse3_conn_info; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record FuseConnInfoImpl(MemorySegment segment) implements FuseConnInfo { - public FuseConnInfoImpl(MemoryAddress address, MemorySession scope) { + public FuseConnInfoImpl(MemorySegment address, SegmentScope 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 166860c9..f3466bb7 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 @@ -3,8 +3,8 @@ import org.cryptomator.jfuse.api.Fuse; import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.api.FuseOperations; 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.fuse2.fuse_args; import org.cryptomator.jfuse.win.extr.fuse3_operations; @@ -12,11 +12,9 @@ import org.cryptomator.jfuse.win.extr.fuse_timespec; import org.jetbrains.annotations.VisibleForTesting; -import java.lang.foreign.Addressable; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Arena; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.nio.file.Path; import java.util.List; @@ -42,8 +40,8 @@ public void mount(String progName, Path mountPoint, String... flags) throws Fuse @Override protected FuseMount mount(List args) throws FuseMountFailedException { var fuseArgs = parseArgs(args); - var fuse = fuse_h.fuse3_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemoryAddress.NULL); - if (MemoryAddress.NULL.equals(fuse)) { + var fuse = fuse_h.fuse3_new(fuseArgs.args(), fuseOperationsStruct, fuseOperationsStruct.byteSize(), MemorySegment.NULL); + if (MemorySegment.NULL.equals(fuse)) { throw new FuseMountFailedException("fuse_new failed"); } if (fuse_h.fuse3_mount(fuse, fuseArgs.mountPoint()) != 0) { @@ -61,9 +59,9 @@ FuseArgs parseArgs(List cmdLineArgs) throws IllegalArgumentException { var cString = fuseScope.allocateUtf8String(cmdLineArgs.get(i)); argv.setAtIndex(ValueLayout.ADDRESS, i, cString); } - argv.setAtIndex(ValueLayout.ADDRESS, argc, MemoryAddress.NULL); + argv.setAtIndex(ValueLayout.ADDRESS, argc, MemorySegment.NULL); fuse_args.argc$set(args, argc); - fuse_args.argv$set(args, argv.address()); + fuse_args.argv$set(args, argv); fuse_args.allocated$set(args, 0); var multithreaded = fuseScope.allocate(JAVA_INT, 1); @@ -74,228 +72,229 @@ 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, 0); + var mountPoint = mountPointPtr.get(ValueLayout.ADDRESS.asUnbounded(), 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, fuseScope).address()); - case ACCESS -> fuse3_operations.access$set(fuseOperationsStruct, MemoryAddress.NULL); - case CHMOD -> fuse3_operations.chmod$set(fuseOperationsStruct, fuse3_operations.chmod.allocate(this::chmod, fuseScope).address()); - case CHOWN -> fuse3_operations.chown$set(fuseOperationsStruct, fuse3_operations.chown.allocate(this::chown, fuseScope).address()); - case CREATE -> fuse3_operations.create$set(fuseOperationsStruct, fuse3_operations.create.allocate(this::create, fuseScope).address()); - case DESTROY -> fuse3_operations.destroy$set(fuseOperationsStruct, fuse3_operations.destroy.allocate(this::destroy, fuseScope).address()); - case FLUSH -> fuse3_operations.flush$set(fuseOperationsStruct, fuse3_operations.flush.allocate(this::flush, fuseScope).address()); - case FSYNC -> fuse3_operations.fsync$set(fuseOperationsStruct, fuse3_operations.fsync.allocate(this::fsync, fuseScope).address()); - case FSYNCDIR -> fuse3_operations.fsyncdir$set(fuseOperationsStruct, fuse3_operations.fsyncdir.allocate(this::fsyncdir, fuseScope).address()); - case GET_ATTR -> fuse3_operations.getattr$set(fuseOperationsStruct, fuse3_operations.getattr.allocate(this::getattr, fuseScope).address()); - case GET_XATTR -> fuse3_operations.getxattr$set(fuseOperationsStruct, fuse3_operations.getxattr.allocate(this::getxattr, fuseScope).address()); - case LIST_XATTR -> fuse3_operations.listxattr$set(fuseOperationsStruct, fuse3_operations.listxattr.allocate(this::listxattr, fuseScope).address()); - case MKDIR -> fuse3_operations.mkdir$set(fuseOperationsStruct, fuse3_operations.mkdir.allocate(this::mkdir, fuseScope).address()); - case OPEN -> fuse3_operations.open$set(fuseOperationsStruct, fuse3_operations.open.allocate(this::open, fuseScope).address()); - case OPEN_DIR -> fuse3_operations.opendir$set(fuseOperationsStruct, fuse3_operations.opendir.allocate(this::opendir, fuseScope).address()); - case READ -> fuse3_operations.read$set(fuseOperationsStruct, fuse3_operations.read.allocate(this::read, fuseScope).address()); - case READ_DIR -> fuse3_operations.readdir$set(fuseOperationsStruct, fuse3_operations.readdir.allocate(this::readdir, fuseScope).address()); - case READLINK -> fuse3_operations.readlink$set(fuseOperationsStruct, fuse3_operations.readlink.allocate(this::readlink, fuseScope).address()); - case RELEASE -> fuse3_operations.release$set(fuseOperationsStruct, fuse3_operations.release.allocate(this::release, fuseScope).address()); - case RELEASE_DIR -> fuse3_operations.releasedir$set(fuseOperationsStruct, fuse3_operations.releasedir.allocate(this::releasedir, fuseScope).address()); - case REMOVE_XATTR -> fuse3_operations.removexattr$set(fuseOperationsStruct, fuse3_operations.removexattr.allocate(this::removexattr, fuseScope).address()); - case RENAME -> fuse3_operations.rename$set(fuseOperationsStruct, fuse3_operations.rename.allocate(this::rename, fuseScope).address()); - case RMDIR -> fuse3_operations.rmdir$set(fuseOperationsStruct, fuse3_operations.rmdir.allocate(this::rmdir, fuseScope).address()); - case SET_XATTR -> fuse3_operations.setxattr$set(fuseOperationsStruct, fuse3_operations.setxattr.allocate(this::setxattr, fuseScope).address()); - case STATFS -> fuse3_operations.statfs$set(fuseOperationsStruct, fuse3_operations.statfs.allocate(this::statfs, fuseScope).address()); - case SYMLINK -> fuse3_operations.symlink$set(fuseOperationsStruct, fuse3_operations.symlink.allocate(this::symlink, fuseScope).address()); - case TRUNCATE -> fuse3_operations.truncate$set(fuseOperationsStruct, fuse3_operations.truncate.allocate(this::truncate, fuseScope).address()); - case UNLINK -> fuse3_operations.unlink$set(fuseOperationsStruct, fuse3_operations.unlink.allocate(this::unlink, fuseScope).address()); - case UTIMENS -> fuse3_operations.utimens$set(fuseOperationsStruct, fuse3_operations.utimens.allocate(this::utimens, fuseScope).address()); - case WRITE -> fuse3_operations.write$set(fuseOperationsStruct, fuse3_operations.write.allocate(this::write, fuseScope).address()); + case INIT -> fuse3_operations.init$set(fuseOperationsStruct, fuse3_operations.init.allocate(this::init, fuseScope.scope())); + case ACCESS -> fuse3_operations.access$set(fuseOperationsStruct, MemorySegment.NULL); + case CHMOD -> fuse3_operations.chmod$set(fuseOperationsStruct, fuse3_operations.chmod.allocate(this::chmod, fuseScope.scope())); + case CHOWN -> fuse3_operations.chown$set(fuseOperationsStruct, fuse3_operations.chown.allocate(this::chown, fuseScope.scope())); + case CREATE -> fuse3_operations.create$set(fuseOperationsStruct, fuse3_operations.create.allocate(this::create, fuseScope.scope())); + case DESTROY -> fuse3_operations.destroy$set(fuseOperationsStruct, fuse3_operations.destroy.allocate(this::destroy, fuseScope.scope())); + case FLUSH -> fuse3_operations.flush$set(fuseOperationsStruct, fuse3_operations.flush.allocate(this::flush, fuseScope.scope())); + case FSYNC -> fuse3_operations.fsync$set(fuseOperationsStruct, fuse3_operations.fsync.allocate(this::fsync, fuseScope.scope())); + case FSYNCDIR -> fuse3_operations.fsyncdir$set(fuseOperationsStruct, fuse3_operations.fsyncdir.allocate(this::fsyncdir, fuseScope.scope())); + case GET_ATTR -> fuse3_operations.getattr$set(fuseOperationsStruct, fuse3_operations.getattr.allocate(this::getattr, fuseScope.scope())); + case GET_XATTR -> fuse3_operations.getxattr$set(fuseOperationsStruct, fuse3_operations.getxattr.allocate(this::getxattr, fuseScope.scope())); + case LIST_XATTR -> fuse3_operations.listxattr$set(fuseOperationsStruct, fuse3_operations.listxattr.allocate(this::listxattr, fuseScope.scope())); + case MKDIR -> fuse3_operations.mkdir$set(fuseOperationsStruct, fuse3_operations.mkdir.allocate(this::mkdir, fuseScope.scope())); + case OPEN -> fuse3_operations.open$set(fuseOperationsStruct, fuse3_operations.open.allocate(this::open, fuseScope.scope())); + case OPEN_DIR -> fuse3_operations.opendir$set(fuseOperationsStruct, fuse3_operations.opendir.allocate(this::opendir, fuseScope.scope())); + case READ -> fuse3_operations.read$set(fuseOperationsStruct, fuse3_operations.read.allocate(this::read, fuseScope.scope())); + case READ_DIR -> fuse3_operations.readdir$set(fuseOperationsStruct, fuse3_operations.readdir.allocate(this::readdir, fuseScope.scope())); + case READLINK -> fuse3_operations.readlink$set(fuseOperationsStruct, fuse3_operations.readlink.allocate(this::readlink, fuseScope.scope())); + case RELEASE -> fuse3_operations.release$set(fuseOperationsStruct, fuse3_operations.release.allocate(this::release, fuseScope.scope())); + case RELEASE_DIR -> fuse3_operations.releasedir$set(fuseOperationsStruct, fuse3_operations.releasedir.allocate(this::releasedir, fuseScope.scope())); + case REMOVE_XATTR -> fuse3_operations.removexattr$set(fuseOperationsStruct, fuse3_operations.removexattr.allocate(this::removexattr, fuseScope.scope())); + case RENAME -> fuse3_operations.rename$set(fuseOperationsStruct, fuse3_operations.rename.allocate(this::rename, fuseScope.scope())); + case RMDIR -> fuse3_operations.rmdir$set(fuseOperationsStruct, fuse3_operations.rmdir.allocate(this::rmdir, fuseScope.scope())); + case SET_XATTR -> fuse3_operations.setxattr$set(fuseOperationsStruct, fuse3_operations.setxattr.allocate(this::setxattr, fuseScope.scope())); + case STATFS -> fuse3_operations.statfs$set(fuseOperationsStruct, fuse3_operations.statfs.allocate(this::statfs, fuseScope.scope())); + case SYMLINK -> fuse3_operations.symlink$set(fuseOperationsStruct, fuse3_operations.symlink.allocate(this::symlink, fuseScope.scope())); + case TRUNCATE -> fuse3_operations.truncate$set(fuseOperationsStruct, fuse3_operations.truncate.allocate(this::truncate, fuseScope.scope())); + case UNLINK -> fuse3_operations.unlink$set(fuseOperationsStruct, fuse3_operations.unlink.allocate(this::unlink, fuseScope.scope())); + case UTIMENS -> fuse3_operations.utimens$set(fuseOperationsStruct, fuse3_operations.utimens.allocate(this::utimens, fuseScope.scope())); + case WRITE -> fuse3_operations.write$set(fuseOperationsStruct, fuse3_operations.write.allocate(this::write, fuseScope.scope())); } } @VisibleForTesting - Addressable init(MemoryAddress conn, MemoryAddress cfg) { - try (var scope = MemorySession.openConfined()) { - var connInfo = new FuseConnInfoImpl(conn, scope); + MemorySegment init(MemorySegment conn, MemorySegment cfg) { + try (var arena = Arena.openConfined()) { + var connInfo = new FuseConnInfoImpl(conn, arena.scope()); connInfo.setWant(connInfo.want() | FuseConnInfo.FUSE_CAP_READDIRPLUS); - var config = new org.cryptomator.jfuse.win.FuseConfigImpl(cfg, scope); + var config = new FuseConfigImpl(cfg, arena.scope()); fuseOperations.init(connInfo, config); } - return MemoryAddress.NULL; + return MemorySegment.NULL; } - private int chmod(MemoryAddress path, int mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.chmod(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int chown(MemoryAddress path, int uid, int gid, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.chown(path.getUtf8String(0), uid, gid, new FileInfoImpl(fi, scope)); + 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())); } } - private int create(MemoryAddress path, int mode, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.create(path.getUtf8String(0), mode, new FileInfoImpl(fi, scope)); + 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())); } } - private void destroy(MemoryAddress addr) { + private void destroy(MemorySegment addr) { fuseOperations.destroy(); } @VisibleForTesting - int flush(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + int flush(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.flush(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } @VisibleForTesting - int fsync(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsync(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int fsyncdir(MemoryAddress path, int datasync, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.fsyncdir(path.getUtf8String(0), datasync, new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int getattr(MemoryAddress path, MemoryAddress stat, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getattr(path.getUtf8String(0), new StatImpl(stat, scope), new FileInfoImpl(fi, scope)); + 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())); } } @VisibleForTesting - int getxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.getxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + 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()); } } @VisibleForTesting - int setxattr(MemoryAddress path, MemoryAddress name, MemoryAddress value, long size, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.setxattr(path.getUtf8String(0), name.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer(), flags); + 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); } } @VisibleForTesting - int listxattr(MemoryAddress path, MemoryAddress value, long size) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.listxattr(path.getUtf8String(0), MemorySegment.ofAddress(value.address(), size, scope).asByteBuffer()); + int listxattr(MemorySegment path, MemorySegment value, long size) { + try (var arena = Arena.openConfined()) { + return fuseOperations.listxattr(path.getUtf8String(0), value.asSlice(0, size).asByteBuffer()); } } @VisibleForTesting - int removexattr(MemoryAddress path, MemoryAddress name) { + int removexattr(MemorySegment path, MemorySegment name) { return fuseOperations.removexattr(path.getUtf8String(0), name.getUtf8String(0)); } - private int mkdir(MemoryAddress path, int mode) { + private int mkdir(MemorySegment path, int mode) { return fuseOperations.mkdir(path.getUtf8String(0), mode); } - private int open(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int open(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.open(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int opendir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int opendir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.opendir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int read(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.read(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } - private int readdir(MemoryAddress path, MemoryAddress buf, MemoryAddress filler, long offset, MemoryAddress fi, int flags) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.readdir(path.getUtf8String(0), new DirFillerImpl(buf, filler, scope), offset, new FileInfoImpl(fi, scope), flags); + 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); } } - private int readlink(MemoryAddress path, MemoryAddress buf, long len) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, len, scope).asByteBuffer(); + 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); } } - private int release(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int release(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.release(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int releasedir(MemoryAddress path, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, scope)); + private int releasedir(MemorySegment path, MemorySegment fi) { + try (var arena = Arena.openConfined()) { + return fuseOperations.releasedir(path.getUtf8String(0), new FileInfoImpl(fi, arena.scope())); } } - private int rename(MemoryAddress oldpath, MemoryAddress newpath, int flags) { + private int rename(MemorySegment oldpath, MemorySegment newpath, int flags) { return fuseOperations.rename(oldpath.getUtf8String(0), newpath.getUtf8String(0), flags); } - private int rmdir(MemoryAddress path) { + private int rmdir(MemorySegment path) { return fuseOperations.rmdir(path.getUtf8String(0)); } - private int statfs(MemoryAddress path, MemoryAddress statvfs) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, scope)); + private int statfs(MemorySegment path, MemorySegment statvfs) { + try (var arena = Arena.openConfined()) { + return fuseOperations.statfs(path.getUtf8String(0), new StatvfsImpl(statvfs, arena.scope())); } } - private int symlink(MemoryAddress linkname, MemoryAddress target) { + private int symlink(MemorySegment linkname, MemorySegment target) { return fuseOperations.symlink(linkname.getUtf8String(0), target.getUtf8String(0)); } @VisibleForTesting - int truncate(MemoryAddress path, long size, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - return fuseOperations.truncate(path.getUtf8String(0), size, new FileInfoImpl(fi, scope)); + 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())); } } - private int unlink(MemoryAddress path) { + private int unlink(MemorySegment path) { return fuseOperations.unlink(path.getUtf8String(0)); } @VisibleForTesting - int utimens(MemoryAddress path, MemoryAddress times, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { + int utimens(MemorySegment path, MemorySegment times, MemorySegment fi) { + try (var arena = Arena.openConfined()) { // 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, seq.byteSize(), scope); + var segment = MemorySegment.ofAddress(times.address(), seq.byteSize(), arena.scope()); 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, scope)); + return fuseOperations.utimens(path.getUtf8String(0), new TimeSpecImpl(time0), new TimeSpecImpl(time1), new FileInfoImpl(fi, arena.scope())); } } - private int write(MemoryAddress path, MemoryAddress buf, long size, long offset, MemoryAddress fi) { - try (var scope = MemorySession.openConfined()) { - var buffer = MemorySegment.ofAddress(buf, size, scope).asByteBuffer(); - return fuseOperations.write(path.getUtf8String(0), buffer, size, offset, new FileInfoImpl(fi, scope)); + 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())); } } 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 e65e3377..23ae0264 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 @@ -3,9 +3,9 @@ import org.cryptomator.jfuse.api.FuseMount; import org.cryptomator.jfuse.win.extr.fuse_h; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.MemorySegment; -record FuseMountImpl(MemoryAddress fuse, FuseArgs fuseArgs) implements FuseMount { +record FuseMountImpl(MemorySegment fuse, FuseArgs fuseArgs) implements FuseMount { @Override public int loop() { 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 49e6b92a..92c2bb48 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 @@ -4,13 +4,12 @@ import org.cryptomator.jfuse.api.TimeSpec; import org.cryptomator.jfuse.win.extr.fuse_stat; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatImpl(MemorySegment segment) implements Stat { - public StatImpl(MemoryAddress address, MemorySession scope) { + public StatImpl(MemorySegment address, SegmentScope 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 c7c09928..d0e54f48 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 @@ -3,13 +3,12 @@ import org.cryptomator.jfuse.api.Statvfs; import org.cryptomator.jfuse.win.extr.fuse_statvfs; -import java.lang.foreign.MemoryAddress; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; +import java.lang.foreign.SegmentScope; record StatvfsImpl(MemorySegment segment) implements Statvfs { - public StatvfsImpl(MemoryAddress address, MemorySession scope) { + public StatvfsImpl(MemorySegment address, SegmentScope scope) { this(fuse_statvfs.ofAddress(address, scope)); } 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 index dcd55543..82933b6f 100644 --- 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 @@ -7,17 +7,19 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -public class Constants$root { +final class 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.withBitAlignment(16); - static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfInt C_LONG$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); + // 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/RuntimeHelper.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java index 767bd78a..c83dee88 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java @@ -1,22 +1,22 @@ package org.cryptomator.jfuse.win.extr; // Generated by jextract -import java.lang.foreign.Addressable; -import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Linker; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.SymbolLookup; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.ValueLayout.ADDRESS; +import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; +import static java.lang.foreign.ValueLayout.JAVA_LONG; final class RuntimeHelper { @@ -27,12 +27,12 @@ private RuntimeHelper() {} private final static SymbolLookup SYMBOL_LOOKUP; final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); + (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); static { SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); } static T requireNonNull(T obj, String symbolName) { @@ -45,11 +45,11 @@ static T requireNonNull(T obj, String symbolName) { private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); + return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } @@ -59,28 +59,28 @@ static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { } static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { + static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, session); + return LINKER.upcallStub(handle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { - return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); } // Internals only below this point - private static class VarargsInvoker { + private static final class VarargsInvoker { private static final MethodHandle INVOKE_MH; private final MemorySegment symbol; private final FunctionDescriptor function; @@ -106,7 +106,9 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { mtype = mtype.appendParameterTypes(carrier(layout, false)); } mtype = mtype.appendParameterTypes(Object[].class); - if (mtype.returnType().equals(MemorySegment.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); @@ -116,8 +118,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { static Class carrier(MemoryLayout layout, boolean ret) { if (layout instanceof ValueLayout valueLayout) { - return (ret || valueLayout.carrier() != MemoryAddress.class) ? - valueLayout.carrier() : Addressable.class; + return valueLayout.carrier(); } else if (layout instanceof GroupLayout) { return MemorySegment.class; } else { @@ -152,7 +153,9 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.ofVoid(argLayouts) : FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); - if (mh.type().returnType() == MemorySegment.class) { + 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 @@ -202,10 +205,7 @@ private Class normalize(Class c) { if (c.isPrimitive()) { return promote(c); } - if (MemoryAddress.class.isAssignableFrom(c)) { - return MemoryAddress.class; - } - if (MemorySegment.class.isAssignableFrom(c)) { + if (c == MemorySegment.class) { return MemorySegment.class; } throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); @@ -216,7 +216,7 @@ private MemoryLayout variadicLayout(Class c) { return JAVA_LONG; } else if (c == double.class) { return JAVA_DOUBLE; - } else if (MemoryAddress.class.isAssignableFrom(c)) { + } 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/fuse2/Constants$root.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/Constants$root.java index ea519756..db18ff6f 100644 --- 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 @@ -7,17 +7,19 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; -public class Constants$root { +final class 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.withBitAlignment(16); - static final OfInt C_INT$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfInt C_LONG$LAYOUT = JAVA_INT.withBitAlignment(32); - static final OfLong C_LONG_LONG$LAYOUT = JAVA_LONG.withBitAlignment(64); - static final OfFloat C_FLOAT$LAYOUT = JAVA_FLOAT.withBitAlignment(32); - static final OfDouble C_DOUBLE$LAYOUT = JAVA_DOUBLE.withBitAlignment(64); - static final OfAddress C_POINTER$LAYOUT = ADDRESS.withBitAlignment(64); + // 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 6802595a..764ab17d 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 @@ -1,22 +1,22 @@ package org.cryptomator.jfuse.win.extr.fuse2; // Generated by jextract -import java.lang.foreign.Addressable; -import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; -import java.lang.foreign.SymbolLookup; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Linker; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.SymbolLookup; import java.lang.foreign.ValueLayout; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; -import static java.lang.foreign.ValueLayout.*; +import static java.lang.foreign.ValueLayout.ADDRESS; +import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; +import static java.lang.foreign.ValueLayout.JAVA_LONG; final class RuntimeHelper { @@ -27,12 +27,12 @@ private RuntimeHelper() {} private final static SymbolLookup SYMBOL_LOOKUP; final static SegmentAllocator CONSTANT_ALLOCATOR = - (size, align) -> MemorySegment.allocateNative(size, align, MemorySession.openImplicit()); + (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); static { - + SymbolLookup loaderLookup = SymbolLookup.loaderLookup(); - SYMBOL_LOOKUP = name -> loaderLookup.lookup(name).or(() -> LINKER.defaultLookup().lookup(name)); + SYMBOL_LOOKUP = name -> loaderLookup.find(name).or(() -> LINKER.defaultLookup().find(name)); } static T requireNonNull(T obj, String symbolName) { @@ -45,11 +45,11 @@ static T requireNonNull(T obj, String symbolName) { private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { - return SYMBOL_LOOKUP.lookup(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), MemorySession.openShared())).orElse(null); + return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } @@ -59,28 +59,28 @@ static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { } static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { - return SYMBOL_LOOKUP.lookup(name). + return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, MemorySession session) { + static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { - MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", Linker.upcallType(fdesc)); + MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); - return LINKER.upcallStub(handle, fdesc, session); + return LINKER.upcallStub(handle, fdesc, scope); } catch (Throwable ex) { throw new AssertionError(ex); } } - static MemorySegment asArray(MemoryAddress addr, MemoryLayout layout, int numElements, MemorySession session) { - return MemorySegment.ofAddress(addr, numElements * layout.byteSize(), session); + static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); } // Internals only below this point - private static class VarargsInvoker { + private static final class VarargsInvoker { private static final MethodHandle INVOKE_MH; private final MemorySegment symbol; private final FunctionDescriptor function; @@ -106,7 +106,9 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { mtype = mtype.appendParameterTypes(carrier(layout, false)); } mtype = mtype.appendParameterTypes(Object[].class); - if (mtype.returnType().equals(MemorySegment.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); @@ -116,8 +118,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { static Class carrier(MemoryLayout layout, boolean ret) { if (layout instanceof ValueLayout valueLayout) { - return (ret || valueLayout.carrier() != MemoryAddress.class) ? - valueLayout.carrier() : Addressable.class; + return valueLayout.carrier(); } else if (layout instanceof GroupLayout) { return MemorySegment.class; } else { @@ -152,7 +153,9 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.ofVoid(argLayouts) : FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); - if (mh.type().returnType() == MemorySegment.class) { + 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 @@ -202,10 +205,7 @@ private Class normalize(Class c) { if (c.isPrimitive()) { return promote(c); } - if (MemoryAddress.class.isAssignableFrom(c)) { - return MemoryAddress.class; - } - if (MemorySegment.class.isAssignableFrom(c)) { + if (c == MemorySegment.class) { return MemorySegment.class; } throw new IllegalArgumentException("Invalid type for ABI: " + c.getTypeName()); @@ -216,7 +216,7 @@ private MemoryLayout variadicLayout(Class c) { return JAVA_LONG; } else if (c == double.class) { return JAVA_DOUBLE; - } else if (MemoryAddress.class.isAssignableFrom(c)) { + } 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/fuse2/fuse2_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse2/fuse2_h.java index 16fa84fc..0d7841b2 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 @@ -19,7 +19,7 @@ public class fuse2_h { public static MethodHandle fuse_parse_cmdline$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_parse_cmdline$MH,"fuse_parse_cmdline"); } - public static int fuse_parse_cmdline ( Addressable args, Addressable mountpoint, Addressable multithreaded, Addressable foreground) { + public static int fuse_parse_cmdline ( MemorySegment args, MemorySegment mountpoint, MemorySegment multithreaded, MemorySegment foreground) { var mh$ = fuse_parse_cmdline$MH(); try { return (int)mh$.invokeExact(args, mountpoint, multithreaded, foreground); 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 c115580c..36a9fdd9 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 @@ -2,12 +2,17 @@ package org.cryptomator.jfuse.win.extr.fuse2; +import java.lang.foreign.GroupLayout; +import java.lang.foreign.MemoryLayout; +import java.lang.foreign.MemorySegment; +import java.lang.foreign.SegmentAllocator; +import java.lang.foreign.SegmentScope; +import java.lang.foreign.StructLayout; import java.lang.invoke.VarHandle; -import java.lang.foreign.*; public class fuse_args { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_LONG$LAYOUT.withName("argc"), MemoryLayout.paddingLayout(32), Constants$root.C_POINTER$LAYOUT.withName("argv"), @@ -37,16 +42,16 @@ public class fuse_args { public static VarHandle argv$VH() { return fuse_args.argv$VH; } - public static MemoryAddress argv$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg); + public static MemorySegment argv$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); } - public static void argv$set( MemorySegment seg, MemoryAddress x) { + public static void argv$set( MemorySegment seg, MemorySegment x) { fuse_args.argv$VH.set(seg, x); } - public static MemoryAddress argv$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment argv$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg.asSlice(index*sizeof())); } - public static void argv$set(MemorySegment seg, long index, MemoryAddress x) { + public static void argv$set(MemorySegment seg, long index, MemorySegment x) { fuse_args.argv$VH.set(seg.asSlice(index*sizeof()), x); } static final VarHandle allocated$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("allocated")); @@ -70,7 +75,7 @@ public class fuse_args { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); } } 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_config.java index 8785ed81..28981390 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_config.java @@ -395,16 +395,16 @@ public class fuse3_config { public static VarHandle modules$VH() { return fuse3_config.modules$VH; } - public static MemoryAddress modules$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_config.modules$VH.get(seg); + public static MemorySegment modules$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_config.modules$VH.get(seg); } - public static void modules$set( MemorySegment seg, MemoryAddress x) { + public static void modules$set( MemorySegment seg, MemorySegment x) { fuse3_config.modules$VH.set(seg, x); } - public static MemoryAddress modules$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_config.modules$VH.get(seg.asSlice(index*sizeof())); + public static MemorySegment modules$get(MemorySegment seg, long index) { + return (java.lang.foreign.MemorySegment)fuse3_config.modules$VH.get(seg.asSlice(index*sizeof())); } - public static void modules$set(MemorySegment seg, long index, MemoryAddress x) { + public static void modules$set(MemorySegment seg, long index, MemorySegment x) { fuse3_config.modules$VH.set(seg.asSlice(index*sizeof()), x); } static final VarHandle debug$VH = $struct$LAYOUT.varHandle(MemoryLayout.PathElement.groupElement("debug")); @@ -428,7 +428,7 @@ public class fuse3_config { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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_conn_info.java index 6e605dee..7d0e7260 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_conn_info.java @@ -191,7 +191,7 @@ public class fuse3_conn_info { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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_file_info.java index 520e0112..adcdca35 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_file_info.java @@ -97,7 +97,7 @@ public class fuse3_file_info { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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_fill_dir_t.java index a645b3a4..3de9c131 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_fill_dir_t.java @@ -6,15 +6,15 @@ public interface fuse3_fill_dir_t { - int apply(java.lang.foreign.MemoryAddress buf, java.lang.foreign.MemoryAddress name, java.lang.foreign.MemoryAddress stbuf, long off, int flags); - static MemorySegment allocate(fuse3_fill_dir_t fi, MemorySession session) { - return RuntimeHelper.upcallStub(fuse3_fill_dir_t.class, fi, constants$0.fuse3_fill_dir_t$FUNC, session); + 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 fuse3_fill_dir_t ofAddress(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress _buf, java.lang.foreign.MemoryAddress _name, java.lang.foreign.MemoryAddress _stbuf, long _off, int _flags) -> { + static fuse3_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { + MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); + 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((Addressable)symbol, (java.lang.foreign.Addressable)_buf, (java.lang.foreign.Addressable)_name, (java.lang.foreign.Addressable)_stbuf, _off, _flags); + return (int)constants$0.fuse3_fill_dir_t$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)_buf, (java.lang.foreign.MemorySegment)_name, (java.lang.foreign.MemorySegment)_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_operations.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_operations.java index 43330c74..0a5853c2 100644 --- 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 @@ -63,15 +63,15 @@ public class fuse3_operations { ); public interface getattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(getattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getattr.class, fi, fuse3_operations.getattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.getattr$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -83,20 +83,20 @@ static getattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getattr$VH() { return fuse3_operations.getattr$VH; } - public static MemoryAddress getattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.getattr$VH.get(seg); + public static MemorySegment getattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.getattr$VH.get(seg); } - public static void getattr$set( MemorySegment seg, MemoryAddress x) { + public static void getattr$set( MemorySegment seg, MemorySegment x) { fuse3_operations.getattr$VH.set(seg, x); } - public static MemoryAddress getattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.getattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getattr.ofAddress(getattr$get(segment), session); + 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, @@ -108,15 +108,15 @@ public static getattr getattr (MemorySegment segment, MemorySession session) { ); public interface readlink { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(readlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(readlink.class, fi, fuse3_operations.readlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse3_operations.readlink$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -128,20 +128,20 @@ static readlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readlink$VH() { return fuse3_operations.readlink$VH; } - public static MemoryAddress readlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.readlink$VH.get(seg); + public static MemorySegment readlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.readlink$VH.get(seg); } - public static void readlink$set( MemorySegment seg, MemoryAddress x) { + public static void readlink$set( MemorySegment seg, MemorySegment x) { fuse3_operations.readlink$VH.set(seg, x); } - public static MemoryAddress readlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.readlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readlink.ofAddress(readlink$get(segment), session); + 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, @@ -153,15 +153,15 @@ public static readlink readlink (MemorySegment segment, MemorySession session) { ); public interface mknod { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, int _x2); - static MemorySegment allocate(mknod fi, MemorySession session) { - return RuntimeHelper.upcallStub(mknod.class, fi, fuse3_operations.mknod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2); + return (int)fuse3_operations.mknod$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -173,20 +173,20 @@ static mknod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mknod$VH() { return fuse3_operations.mknod$VH; } - public static MemoryAddress mknod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.mknod$VH.get(seg); + public static MemorySegment mknod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.mknod$VH.get(seg); } - public static void mknod$set( MemorySegment seg, MemoryAddress x) { + public static void mknod$set( MemorySegment seg, MemorySegment x) { fuse3_operations.mknod$VH.set(seg, x); } - public static MemoryAddress mknod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.mknod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mknod.ofAddress(mknod$get(segment), session); + 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, @@ -197,15 +197,15 @@ public static mknod mknod (MemorySegment segment, MemorySession session) { ); public interface mkdir { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1); - static MemorySegment allocate(mkdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(mkdir.class, fi, fuse3_operations.mkdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse3_operations.mkdir$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -217,20 +217,20 @@ static mkdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle mkdir$VH() { return fuse3_operations.mkdir$VH; } - public static MemoryAddress mkdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.mkdir$VH.get(seg); + public static MemorySegment mkdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.mkdir$VH.get(seg); } - public static void mkdir$set( MemorySegment seg, MemoryAddress x) { + public static void mkdir$set( MemorySegment seg, MemorySegment x) { fuse3_operations.mkdir$VH.set(seg, x); } - public static MemoryAddress mkdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.mkdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return mkdir.ofAddress(mkdir$get(segment), session); + 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 @@ -240,15 +240,15 @@ public static mkdir mkdir (MemorySegment segment, MemorySession session) { ); public interface unlink { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(unlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(unlink.class, fi, fuse3_operations.unlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse3_operations.unlink$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -260,20 +260,20 @@ static unlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle unlink$VH() { return fuse3_operations.unlink$VH; } - public static MemoryAddress unlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.unlink$VH.get(seg); + public static MemorySegment unlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.unlink$VH.get(seg); } - public static void unlink$set( MemorySegment seg, MemoryAddress x) { + public static void unlink$set( MemorySegment seg, MemorySegment x) { fuse3_operations.unlink$VH.set(seg, x); } - public static MemoryAddress unlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.unlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return unlink.ofAddress(unlink$get(segment), session); + 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 @@ -283,15 +283,15 @@ public static unlink unlink (MemorySegment segment, MemorySession session) { ); public interface rmdir { - int apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(rmdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(rmdir.class, fi, fuse3_operations.rmdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + return (int)fuse3_operations.rmdir$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -303,20 +303,20 @@ static rmdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rmdir$VH() { return fuse3_operations.rmdir$VH; } - public static MemoryAddress rmdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.rmdir$VH.get(seg); + public static MemorySegment rmdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.rmdir$VH.get(seg); } - public static void rmdir$set( MemorySegment seg, MemoryAddress x) { + public static void rmdir$set( MemorySegment seg, MemorySegment x) { fuse3_operations.rmdir$VH.set(seg, x); } - public static MemoryAddress rmdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.rmdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rmdir.ofAddress(rmdir$get(segment), session); + 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, @@ -327,15 +327,15 @@ public static rmdir rmdir (MemorySegment segment, MemorySession session) { ); public interface symlink { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(symlink fi, MemorySession session) { - return RuntimeHelper.upcallStub(symlink.class, fi, fuse3_operations.symlink$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.symlink$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -347,20 +347,20 @@ static symlink ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle symlink$VH() { return fuse3_operations.symlink$VH; } - public static MemoryAddress symlink$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.symlink$VH.get(seg); + public static MemorySegment symlink$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.symlink$VH.get(seg); } - public static void symlink$set( MemorySegment seg, MemoryAddress x) { + public static void symlink$set( MemorySegment seg, MemorySegment x) { fuse3_operations.symlink$VH.set(seg, x); } - public static MemoryAddress symlink$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.symlink$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return symlink.ofAddress(symlink$get(segment), session); + 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, @@ -372,15 +372,15 @@ public static symlink symlink (MemorySegment segment, MemorySession session) { ); public interface rename { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(rename fi, MemorySession session) { - return RuntimeHelper.upcallStub(rename.class, fi, fuse3_operations.rename$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse3_operations.rename$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -392,20 +392,20 @@ static rename ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle rename$VH() { return fuse3_operations.rename$VH; } - public static MemoryAddress rename$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.rename$VH.get(seg); + public static MemorySegment rename$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.rename$VH.get(seg); } - public static void rename$set( MemorySegment seg, MemoryAddress x) { + public static void rename$set( MemorySegment seg, MemorySegment x) { fuse3_operations.rename$VH.set(seg, x); } - public static MemoryAddress rename$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.rename$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return rename.ofAddress(rename$get(segment), session); + 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, @@ -416,15 +416,15 @@ public static rename rename (MemorySegment segment, MemorySession session) { ); public interface link { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(link fi, MemorySession session) { - return RuntimeHelper.upcallStub(link.class, fi, fuse3_operations.link$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.link$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -436,20 +436,20 @@ static link ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle link$VH() { return fuse3_operations.link$VH; } - public static MemoryAddress link$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.link$VH.get(seg); + public static MemorySegment link$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.link$VH.get(seg); } - public static void link$set( MemorySegment seg, MemoryAddress x) { + public static void link$set( MemorySegment seg, MemorySegment x) { fuse3_operations.link$VH.set(seg, x); } - public static MemoryAddress link$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.link$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return link.ofAddress(link$get(segment), session); + 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, @@ -461,15 +461,15 @@ public static link link (MemorySegment segment, MemorySession session) { ); public interface chmod { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(chmod fi, MemorySession session) { - return RuntimeHelper.upcallStub(chmod.class, fi, fuse3_operations.chmod$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.chmod$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -481,20 +481,20 @@ static chmod ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chmod$VH() { return fuse3_operations.chmod$VH; } - public static MemoryAddress chmod$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.chmod$VH.get(seg); + public static MemorySegment chmod$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.chmod$VH.get(seg); } - public static void chmod$set( MemorySegment seg, MemoryAddress x) { + public static void chmod$set( MemorySegment seg, MemorySegment x) { fuse3_operations.chmod$VH.set(seg, x); } - public static MemoryAddress chmod$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.chmod$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chmod.ofAddress(chmod$get(segment), session); + 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, @@ -507,15 +507,15 @@ public static chmod chmod (MemorySegment segment, MemorySession session) { ); public interface chown { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(chown fi, MemorySession session) { - return RuntimeHelper.upcallStub(chown.class, fi, fuse3_operations.chown$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse3_operations.chown$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, __x2, (java.lang.foreign.MemorySegment)__x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -527,20 +527,20 @@ static chown ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle chown$VH() { return fuse3_operations.chown$VH; } - public static MemoryAddress chown$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.chown$VH.get(seg); + public static MemorySegment chown$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.chown$VH.get(seg); } - public static void chown$set( MemorySegment seg, MemoryAddress x) { + public static void chown$set( MemorySegment seg, MemorySegment x) { fuse3_operations.chown$VH.set(seg, x); } - public static MemoryAddress chown$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.chown$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return chown.ofAddress(chown$get(segment), session); + 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, @@ -552,15 +552,15 @@ public static chown chown (MemorySegment segment, MemorySession session) { ); public interface truncate { - int apply(java.lang.foreign.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(truncate fi, MemorySession session) { - return RuntimeHelper.upcallStub(truncate.class, fi, fuse3_operations.truncate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.truncate$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -572,20 +572,20 @@ static truncate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle truncate$VH() { return fuse3_operations.truncate$VH; } - public static MemoryAddress truncate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.truncate$VH.get(seg); + public static MemorySegment truncate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.truncate$VH.get(seg); } - public static void truncate$set( MemorySegment seg, MemoryAddress x) { + public static void truncate$set( MemorySegment seg, MemorySegment x) { fuse3_operations.truncate$VH.set(seg, x); } - public static MemoryAddress truncate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.truncate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return truncate.ofAddress(truncate$get(segment), session); + 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, @@ -596,15 +596,15 @@ public static truncate truncate (MemorySegment segment, MemorySession session) { ); public interface open { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(open fi, MemorySession session) { - return RuntimeHelper.upcallStub(open.class, fi, fuse3_operations.open$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.open$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -616,20 +616,20 @@ static open ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle open$VH() { return fuse3_operations.open$VH; } - public static MemoryAddress open$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.open$VH.get(seg); + public static MemorySegment open$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.open$VH.get(seg); } - public static void open$set( MemorySegment seg, MemoryAddress x) { + public static void open$set( MemorySegment seg, MemorySegment x) { fuse3_operations.open$VH.set(seg, x); } - public static MemoryAddress open$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.open$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return open.ofAddress(open$get(segment), session); + 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, @@ -643,15 +643,15 @@ public static open open (MemorySegment segment, MemorySession session) { ); public interface read { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read fi, MemorySession session) { - return RuntimeHelper.upcallStub(read.class, fi, fuse3_operations.read$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse3_operations.read$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -663,20 +663,20 @@ static read ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read$VH() { return fuse3_operations.read$VH; } - public static MemoryAddress read$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.read$VH.get(seg); + public static MemorySegment read$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.read$VH.get(seg); } - public static void read$set( MemorySegment seg, MemoryAddress x) { + public static void read$set( MemorySegment seg, MemorySegment x) { fuse3_operations.read$VH.set(seg, x); } - public static MemoryAddress read$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.read$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read.ofAddress(read$get(segment), session); + 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, @@ -690,15 +690,15 @@ public static read read (MemorySegment segment, MemorySession session) { ); public interface write { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(write fi, MemorySession session) { - return RuntimeHelper.upcallStub(write.class, fi, fuse3_operations.write$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse3_operations.write$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -710,20 +710,20 @@ static write ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write$VH() { return fuse3_operations.write$VH; } - public static MemoryAddress write$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.write$VH.get(seg); + public static MemorySegment write$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.write$VH.get(seg); } - public static void write$set( MemorySegment seg, MemoryAddress x) { + public static void write$set( MemorySegment seg, MemorySegment x) { fuse3_operations.write$VH.set(seg, x); } - public static MemoryAddress write$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.write$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write.ofAddress(write$get(segment), session); + 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, @@ -734,15 +734,15 @@ public static write write (MemorySegment segment, MemorySession session) { ); public interface statfs { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(statfs fi, MemorySession session) { - return RuntimeHelper.upcallStub(statfs.class, fi, fuse3_operations.statfs$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.statfs$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -754,20 +754,20 @@ static statfs ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle statfs$VH() { return fuse3_operations.statfs$VH; } - public static MemoryAddress statfs$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.statfs$VH.get(seg); + public static MemorySegment statfs$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.statfs$VH.get(seg); } - public static void statfs$set( MemorySegment seg, MemoryAddress x) { + public static void statfs$set( MemorySegment seg, MemorySegment x) { fuse3_operations.statfs$VH.set(seg, x); } - public static MemoryAddress statfs$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.statfs$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return statfs.ofAddress(statfs$get(segment), session); + 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, @@ -778,15 +778,15 @@ public static statfs statfs (MemorySegment segment, MemorySession session) { ); public interface flush { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(flush fi, MemorySession session) { - return RuntimeHelper.upcallStub(flush.class, fi, fuse3_operations.flush$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.flush$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -798,20 +798,20 @@ static flush ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flush$VH() { return fuse3_operations.flush$VH; } - public static MemoryAddress flush$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.flush$VH.get(seg); + public static MemorySegment flush$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.flush$VH.get(seg); } - public static void flush$set( MemorySegment seg, MemoryAddress x) { + public static void flush$set( MemorySegment seg, MemorySegment x) { fuse3_operations.flush$VH.set(seg, x); } - public static MemoryAddress flush$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.flush$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flush.ofAddress(flush$get(segment), session); + 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, @@ -822,15 +822,15 @@ public static flush flush (MemorySegment segment, MemorySession session) { ); public interface release { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(release fi, MemorySession session) { - return RuntimeHelper.upcallStub(release.class, fi, fuse3_operations.release$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.release$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -842,20 +842,20 @@ static release ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle release$VH() { return fuse3_operations.release$VH; } - public static MemoryAddress release$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.release$VH.get(seg); + public static MemorySegment release$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.release$VH.get(seg); } - public static void release$set( MemorySegment seg, MemoryAddress x) { + public static void release$set( MemorySegment seg, MemorySegment x) { fuse3_operations.release$VH.set(seg, x); } - public static MemoryAddress release$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.release$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return release.ofAddress(release$get(segment), session); + 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, @@ -867,15 +867,15 @@ public static release release (MemorySegment segment, MemorySession session) { ); public interface fsync { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsync fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsync.class, fi, fuse3_operations.fsync$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.fsync$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -887,20 +887,20 @@ static fsync ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsync$VH() { return fuse3_operations.fsync$VH; } - public static MemoryAddress fsync$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.fsync$VH.get(seg); + public static MemorySegment fsync$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.fsync$VH.get(seg); } - public static void fsync$set( MemorySegment seg, MemoryAddress x) { + public static void fsync$set( MemorySegment seg, MemorySegment x) { fuse3_operations.fsync$VH.set(seg, x); } - public static MemoryAddress fsync$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.fsync$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsync.ofAddress(fsync$get(segment), session); + 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, @@ -914,15 +914,15 @@ public static fsync fsync (MemorySegment segment, MemorySession session) { ); public interface setxattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, int _x4); - static MemorySegment allocate(setxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(setxattr.class, fi, fuse3_operations.setxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, int __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, __x4); + return (int)fuse3_operations.setxattr$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -934,20 +934,20 @@ static setxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle setxattr$VH() { return fuse3_operations.setxattr$VH; } - public static MemoryAddress setxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.setxattr$VH.get(seg); + public static MemorySegment setxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.setxattr$VH.get(seg); } - public static void setxattr$set( MemorySegment seg, MemoryAddress x) { + public static void setxattr$set( MemorySegment seg, MemorySegment x) { fuse3_operations.setxattr$VH.set(seg, x); } - public static MemoryAddress setxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.setxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return setxattr.ofAddress(setxattr$get(segment), session); + 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, @@ -960,15 +960,15 @@ public static setxattr setxattr (MemorySegment segment, MemorySession session) { ); public interface getxattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3); - static MemorySegment allocate(getxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(getxattr.class, fi, fuse3_operations.getxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3); + return (int)fuse3_operations.getxattr$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -980,20 +980,20 @@ static getxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle getxattr$VH() { return fuse3_operations.getxattr$VH; } - public static MemoryAddress getxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.getxattr$VH.get(seg); + public static MemorySegment getxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.getxattr$VH.get(seg); } - public static void getxattr$set( MemorySegment seg, MemoryAddress x) { + public static void getxattr$set( MemorySegment seg, MemorySegment x) { fuse3_operations.getxattr$VH.set(seg, x); } - public static MemoryAddress getxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.getxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return getxattr.ofAddress(getxattr$get(segment), session); + 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, @@ -1005,15 +1005,15 @@ public static getxattr getxattr (MemorySegment segment, MemorySession session) { ); public interface listxattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2); - static MemorySegment allocate(listxattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(listxattr.class, fi, fuse3_operations.listxattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse3_operations.listxattr$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1025,20 +1025,20 @@ static listxattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle listxattr$VH() { return fuse3_operations.listxattr$VH; } - public static MemoryAddress listxattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.listxattr$VH.get(seg); + public static MemorySegment listxattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.listxattr$VH.get(seg); } - public static void listxattr$set( MemorySegment seg, MemoryAddress x) { + public static void listxattr$set( MemorySegment seg, MemorySegment x) { fuse3_operations.listxattr$VH.set(seg, x); } - public static MemoryAddress listxattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.listxattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return listxattr.ofAddress(listxattr$get(segment), session); + 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, @@ -1049,15 +1049,15 @@ public static listxattr listxattr (MemorySegment segment, MemorySession session) ); public interface removexattr { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(removexattr fi, MemorySession session) { - return RuntimeHelper.upcallStub(removexattr.class, fi, fuse3_operations.removexattr$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.removexattr$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1069,20 +1069,20 @@ static removexattr ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle removexattr$VH() { return fuse3_operations.removexattr$VH; } - public static MemoryAddress removexattr$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.removexattr$VH.get(seg); + public static MemorySegment removexattr$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.removexattr$VH.get(seg); } - public static void removexattr$set( MemorySegment seg, MemoryAddress x) { + public static void removexattr$set( MemorySegment seg, MemorySegment x) { fuse3_operations.removexattr$VH.set(seg, x); } - public static MemoryAddress removexattr$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.removexattr$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return removexattr.ofAddress(removexattr$get(segment), session); + 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, @@ -1093,15 +1093,15 @@ public static removexattr removexattr (MemorySegment segment, MemorySession sess ); public interface opendir { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(opendir fi, MemorySession session) { - return RuntimeHelper.upcallStub(opendir.class, fi, fuse3_operations.opendir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.opendir$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1113,20 +1113,20 @@ static opendir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle opendir$VH() { return fuse3_operations.opendir$VH; } - public static MemoryAddress opendir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.opendir$VH.get(seg); + public static MemorySegment opendir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.opendir$VH.get(seg); } - public static void opendir$set( MemorySegment seg, MemoryAddress x) { + public static void opendir$set( MemorySegment seg, MemorySegment x) { fuse3_operations.opendir$VH.set(seg, x); } - public static MemoryAddress opendir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.opendir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return opendir.ofAddress(opendir$get(segment), session); + 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, @@ -1141,15 +1141,15 @@ public static opendir opendir (MemorySegment segment, MemorySession session) { ); public interface readdir { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, long _x3, java.lang.foreign.MemoryAddress _x4, int _x5); - static MemorySegment allocate(readdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(readdir.class, fi, fuse3_operations.readdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, long __x3, java.lang.foreign.MemoryAddress __x4, int __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, __x3, (java.lang.foreign.Addressable)__x4, __x5); + return (int)fuse3_operations.readdir$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, __x3, (java.lang.foreign.MemorySegment)__x4, __x5); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1161,20 +1161,20 @@ static readdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle readdir$VH() { return fuse3_operations.readdir$VH; } - public static MemoryAddress readdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.readdir$VH.get(seg); + public static MemorySegment readdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.readdir$VH.get(seg); } - public static void readdir$set( MemorySegment seg, MemoryAddress x) { + public static void readdir$set( MemorySegment seg, MemorySegment x) { fuse3_operations.readdir$VH.set(seg, x); } - public static MemoryAddress readdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.readdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return readdir.ofAddress(readdir$get(segment), session); + 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, @@ -1185,15 +1185,15 @@ public static readdir readdir (MemorySegment segment, MemorySession session) { ); public interface releasedir { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(releasedir fi, MemorySession session) { - return RuntimeHelper.upcallStub(releasedir.class, fi, fuse3_operations.releasedir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (int)fuse3_operations.releasedir$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1205,20 +1205,20 @@ static releasedir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle releasedir$VH() { return fuse3_operations.releasedir$VH; } - public static MemoryAddress releasedir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.releasedir$VH.get(seg); + public static MemorySegment releasedir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.releasedir$VH.get(seg); } - public static void releasedir$set( MemorySegment seg, MemoryAddress x) { + public static void releasedir$set( MemorySegment seg, MemorySegment x) { fuse3_operations.releasedir$VH.set(seg, x); } - public static MemoryAddress releasedir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.releasedir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return releasedir.ofAddress(releasedir$get(segment), session); + 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, @@ -1230,15 +1230,15 @@ public static releasedir releasedir (MemorySegment segment, MemorySession sessio ); public interface fsyncdir { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(fsyncdir fi, MemorySession session) { - return RuntimeHelper.upcallStub(fsyncdir.class, fi, fuse3_operations.fsyncdir$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.fsyncdir$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1250,20 +1250,20 @@ static fsyncdir ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fsyncdir$VH() { return fuse3_operations.fsyncdir$VH; } - public static MemoryAddress fsyncdir$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.fsyncdir$VH.get(seg); + public static MemorySegment fsyncdir$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.fsyncdir$VH.get(seg); } - public static void fsyncdir$set( MemorySegment seg, MemoryAddress x) { + public static void fsyncdir$set( MemorySegment seg, MemorySegment x) { fuse3_operations.fsyncdir$VH.set(seg, x); } - public static MemoryAddress fsyncdir$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.fsyncdir$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fsyncdir.ofAddress(fsyncdir$get(segment), session); + 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, @@ -1274,15 +1274,15 @@ public static fsyncdir fsyncdir (MemorySegment segment, MemorySession session) { ); public interface init { - java.lang.foreign.Addressable apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1); - static MemorySegment allocate(init fi, MemorySession session) { - return RuntimeHelper.upcallStub(init.class, fi, fuse3_operations.init$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1) -> { + 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.Addressable)(java.lang.foreign.MemoryAddress)fuse3_operations.init$MH.invokeExact((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1); + return (java.lang.foreign.MemorySegment)(java.lang.foreign.MemorySegment)fuse3_operations.init$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1294,20 +1294,20 @@ static init ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle init$VH() { return fuse3_operations.init$VH; } - public static MemoryAddress init$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.init$VH.get(seg); + public static MemorySegment init$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.init$VH.get(seg); } - public static void init$set( MemorySegment seg, MemoryAddress x) { + public static void init$set( MemorySegment seg, MemorySegment x) { fuse3_operations.init$VH.set(seg, x); } - public static MemoryAddress init$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.init$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return init.ofAddress(init$get(segment), session); + 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 @@ -1317,15 +1317,15 @@ public static init init (MemorySegment segment, MemorySession session) { ); public interface destroy { - void apply(java.lang.foreign.MemoryAddress _x0); - static MemorySegment allocate(destroy fi, MemorySession session) { - return RuntimeHelper.upcallStub(destroy.class, fi, fuse3_operations.destroy$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0); + fuse3_operations.destroy$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1337,20 +1337,20 @@ static destroy ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle destroy$VH() { return fuse3_operations.destroy$VH; } - public static MemoryAddress destroy$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.destroy$VH.get(seg); + public static MemorySegment destroy$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.destroy$VH.get(seg); } - public static void destroy$set( MemorySegment seg, MemoryAddress x) { + public static void destroy$set( MemorySegment seg, MemorySegment x) { fuse3_operations.destroy$VH.set(seg, x); } - public static MemoryAddress destroy$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.destroy$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return destroy.ofAddress(destroy$get(segment), session); + 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, @@ -1361,15 +1361,15 @@ public static destroy destroy (MemorySegment segment, MemorySession session) { ); public interface access { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1); - static MemorySegment allocate(access fi, MemorySession session) { - return RuntimeHelper.upcallStub(access.class, fi, fuse3_operations.access$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1); + return (int)fuse3_operations.access$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1381,20 +1381,20 @@ static access ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle access$VH() { return fuse3_operations.access$VH; } - public static MemoryAddress access$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.access$VH.get(seg); + public static MemorySegment access$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.access$VH.get(seg); } - public static void access$set( MemorySegment seg, MemoryAddress x) { + public static void access$set( MemorySegment seg, MemorySegment x) { fuse3_operations.access$VH.set(seg, x); } - public static MemoryAddress access$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.access$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return access.ofAddress(access$get(segment), session); + 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, @@ -1406,15 +1406,15 @@ public static access access (MemorySegment segment, MemorySession session) { ); public interface create { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(create fi, MemorySession session) { - return RuntimeHelper.upcallStub(create.class, fi, fuse3_operations.create$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.create$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1426,20 +1426,20 @@ static create ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle create$VH() { return fuse3_operations.create$VH; } - public static MemoryAddress create$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.create$VH.get(seg); + public static MemorySegment create$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.create$VH.get(seg); } - public static void create$set( MemorySegment seg, MemoryAddress x) { + public static void create$set( MemorySegment seg, MemorySegment x) { fuse3_operations.create$VH.set(seg, x); } - public static MemoryAddress create$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.create$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return create.ofAddress(create$get(segment), session); + 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, @@ -1452,15 +1452,15 @@ public static create create (MemorySegment segment, MemorySession session) { ); public interface lock { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(lock fi, MemorySession session) { - return RuntimeHelper.upcallStub(lock.class, fi, fuse3_operations.lock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse3_operations.lock$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, (java.lang.foreign.MemorySegment)__x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1472,20 +1472,20 @@ static lock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle lock$VH() { return fuse3_operations.lock$VH; } - public static MemoryAddress lock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.lock$VH.get(seg); + public static MemorySegment lock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.lock$VH.get(seg); } - public static void lock$set( MemorySegment seg, MemoryAddress x) { + public static void lock$set( MemorySegment seg, MemorySegment x) { fuse3_operations.lock$VH.set(seg, x); } - public static MemoryAddress lock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.lock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return lock.ofAddress(lock$get(segment), session); + 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, @@ -1497,15 +1497,15 @@ public static lock lock (MemorySegment segment, MemorySession session) { ); public interface utimens { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(utimens fi, MemorySession session) { - return RuntimeHelper.upcallStub(utimens.class, fi, fuse3_operations.utimens$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.utimens$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1517,20 +1517,20 @@ static utimens ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle utimens$VH() { return fuse3_operations.utimens$VH; } - public static MemoryAddress utimens$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.utimens$VH.get(seg); + public static MemorySegment utimens$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.utimens$VH.get(seg); } - public static void utimens$set( MemorySegment seg, MemoryAddress x) { + public static void utimens$set( MemorySegment seg, MemorySegment x) { fuse3_operations.utimens$VH.set(seg, x); } - public static MemoryAddress utimens$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.utimens$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return utimens.ofAddress(utimens$get(segment), session); + 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, @@ -1542,15 +1542,15 @@ public static utimens utimens (MemorySegment segment, MemorySession session) { ); public interface bmap { - int apply(java.lang.foreign.MemoryAddress _x0, long _x1, java.lang.foreign.MemoryAddress _x2); - static MemorySegment allocate(bmap fi, MemorySession session) { - return RuntimeHelper.upcallStub(bmap.class, fi, fuse3_operations.bmap$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, long __x1, java.lang.foreign.MemoryAddress __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2); + return (int)fuse3_operations.bmap$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1562,20 +1562,20 @@ static bmap ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle bmap$VH() { return fuse3_operations.bmap$VH; } - public static MemoryAddress bmap$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.bmap$VH.get(seg); + public static MemorySegment bmap$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.bmap$VH.get(seg); } - public static void bmap$set( MemorySegment seg, MemoryAddress x) { + public static void bmap$set( MemorySegment seg, MemorySegment x) { fuse3_operations.bmap$VH.set(seg, x); } - public static MemoryAddress bmap$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.bmap$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return bmap.ofAddress(bmap$get(segment), session); + 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, @@ -1590,15 +1590,15 @@ public static bmap bmap (MemorySegment segment, MemorySession session) { ); public interface ioctl { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3, int _x4, java.lang.foreign.MemoryAddress _x5); - static MemorySegment allocate(ioctl fi, MemorySession session) { - return RuntimeHelper.upcallStub(ioctl.class, fi, fuse3_operations.ioctl$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3, int __x4, java.lang.foreign.MemoryAddress __x5) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3, __x4, (java.lang.foreign.Addressable)__x5); + return (int)fuse3_operations.ioctl$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2, (java.lang.foreign.MemorySegment)__x3, __x4, (java.lang.foreign.MemorySegment)__x5); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1610,20 +1610,20 @@ static ioctl ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle ioctl$VH() { return fuse3_operations.ioctl$VH; } - public static MemoryAddress ioctl$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.ioctl$VH.get(seg); + public static MemorySegment ioctl$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.ioctl$VH.get(seg); } - public static void ioctl$set( MemorySegment seg, MemoryAddress x) { + public static void ioctl$set( MemorySegment seg, MemorySegment x) { fuse3_operations.ioctl$VH.set(seg, x); } - public static MemoryAddress ioctl$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.ioctl$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return ioctl.ofAddress(ioctl$get(segment), session); + 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, @@ -1636,15 +1636,15 @@ public static ioctl ioctl (MemorySegment segment, MemorySession session) { ); public interface poll { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, java.lang.foreign.MemoryAddress _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(poll fi, MemorySession session) { - return RuntimeHelper.upcallStub(poll.class, fi, fuse3_operations.poll$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, java.lang.foreign.MemoryAddress __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, (java.lang.foreign.Addressable)__x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse3_operations.poll$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, (java.lang.foreign.MemorySegment)__x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1656,20 +1656,20 @@ static poll ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle poll$VH() { return fuse3_operations.poll$VH; } - public static MemoryAddress poll$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.poll$VH.get(seg); + public static MemorySegment poll$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.poll$VH.get(seg); } - public static void poll$set( MemorySegment seg, MemoryAddress x) { + public static void poll$set( MemorySegment seg, MemorySegment x) { fuse3_operations.poll$VH.set(seg, x); } - public static MemoryAddress poll$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.poll$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return poll.ofAddress(poll$get(segment), session); + 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, @@ -1682,15 +1682,15 @@ public static poll poll (MemorySegment segment, MemorySession session) { ); public interface write_buf { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, java.lang.foreign.MemoryAddress _x3); - static MemorySegment allocate(write_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(write_buf.class, fi, fuse3_operations.write_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, java.lang.foreign.MemoryAddress __x3) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, (java.lang.foreign.Addressable)__x3); + return (int)fuse3_operations.write_buf$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, (java.lang.foreign.MemorySegment)__x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1702,20 +1702,20 @@ static write_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle write_buf$VH() { return fuse3_operations.write_buf$VH; } - public static MemoryAddress write_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.write_buf$VH.get(seg); + public static MemorySegment write_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.write_buf$VH.get(seg); } - public static void write_buf$set( MemorySegment seg, MemoryAddress x) { + public static void write_buf$set( MemorySegment seg, MemorySegment x) { fuse3_operations.write_buf$VH.set(seg, x); } - public static MemoryAddress write_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.write_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return write_buf.ofAddress(write_buf$get(segment), session); + 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, @@ -1729,15 +1729,15 @@ public static write_buf write_buf (MemorySegment segment, MemorySession session) ); public interface read_buf { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(read_buf fi, MemorySession session) { - return RuntimeHelper.upcallStub(read_buf.class, fi, fuse3_operations.read_buf$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse3_operations.read_buf$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1749,20 +1749,20 @@ static read_buf ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle read_buf$VH() { return fuse3_operations.read_buf$VH; } - public static MemoryAddress read_buf$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.read_buf$VH.get(seg); + public static MemorySegment read_buf$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.read_buf$VH.get(seg); } - public static void read_buf$set( MemorySegment seg, MemoryAddress x) { + public static void read_buf$set( MemorySegment seg, MemorySegment x) { fuse3_operations.read_buf$VH.set(seg, x); } - public static MemoryAddress read_buf$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.read_buf$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return read_buf.ofAddress(read_buf$get(segment), session); + 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, @@ -1774,15 +1774,15 @@ public static read_buf read_buf (MemorySegment segment, MemorySession session) { ); public interface flock { - int apply(java.lang.foreign.MemoryAddress _x0, java.lang.foreign.MemoryAddress _x1, int _x2); - static MemorySegment allocate(flock fi, MemorySession session) { - return RuntimeHelper.upcallStub(flock.class, fi, fuse3_operations.flock$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, java.lang.foreign.MemoryAddress __x1, int __x2) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, (java.lang.foreign.Addressable)__x1, __x2); + return (int)fuse3_operations.flock$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1794,20 +1794,20 @@ static flock ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle flock$VH() { return fuse3_operations.flock$VH; } - public static MemoryAddress flock$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.flock$VH.get(seg); + public static MemorySegment flock$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.flock$VH.get(seg); } - public static void flock$set( MemorySegment seg, MemoryAddress x) { + public static void flock$set( MemorySegment seg, MemorySegment x) { fuse3_operations.flock$VH.set(seg, x); } - public static MemoryAddress flock$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.flock$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return flock.ofAddress(flock$get(segment), session); + 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, @@ -1821,15 +1821,15 @@ public static flock flock (MemorySegment segment, MemorySession session) { ); public interface fallocate { - int apply(java.lang.foreign.MemoryAddress _x0, int _x1, long _x2, long _x3, java.lang.foreign.MemoryAddress _x4); - static MemorySegment allocate(fallocate fi, MemorySession session) { - return RuntimeHelper.upcallStub(fallocate.class, fi, fuse3_operations.fallocate$FUNC, session); + 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(MemoryAddress addr, MemorySession session) { - MemorySegment symbol = MemorySegment.ofAddress(addr, 0, session); - return (java.lang.foreign.MemoryAddress __x0, int __x1, long __x2, long __x3, java.lang.foreign.MemoryAddress __x4) -> { + 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((Addressable)symbol, (java.lang.foreign.Addressable)__x0, __x1, __x2, __x3, (java.lang.foreign.Addressable)__x4); + return (int)fuse3_operations.fallocate$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1841,27 +1841,27 @@ static fallocate ofAddress(MemoryAddress addr, MemorySession session) { public static VarHandle fallocate$VH() { return fuse3_operations.fallocate$VH; } - public static MemoryAddress fallocate$get(MemorySegment seg) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.fallocate$VH.get(seg); + public static MemorySegment fallocate$get(MemorySegment seg) { + return (java.lang.foreign.MemorySegment)fuse3_operations.fallocate$VH.get(seg); } - public static void fallocate$set( MemorySegment seg, MemoryAddress x) { + public static void fallocate$set( MemorySegment seg, MemorySegment x) { fuse3_operations.fallocate$VH.set(seg, x); } - public static MemoryAddress fallocate$get(MemorySegment seg, long index) { - return (java.lang.foreign.MemoryAddress)fuse3_operations.fallocate$VH.get(seg.asSlice(index*sizeof())); + 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, MemoryAddress x) { + 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, MemorySession session) { - return fallocate.ofAddress(fallocate$get(segment), session); + 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(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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/fuse_h.java index e56948a4..95126eb9 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/fuse_h.java @@ -19,7 +19,7 @@ public class fuse_h { public static MethodHandle fuse3_lib_help$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_lib_help$MH,"fuse3_lib_help"); } - public static void fuse3_lib_help ( Addressable args) { + public static void fuse3_lib_help ( MemorySegment args) { var mh$ = fuse3_lib_help$MH(); try { mh$.invokeExact(args); @@ -30,10 +30,10 @@ public static void fuse3_lib_help ( Addressable args) { public static MethodHandle fuse3_new$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_new$MH,"fuse3_new"); } - public static MemoryAddress fuse3_new ( Addressable args, Addressable ops, long opsize, Addressable data) { + public static MemorySegment fuse3_new ( MemorySegment args, MemorySegment ops, long opsize, MemorySegment data) { var mh$ = fuse3_new$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(args, ops, opsize, data); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(args, ops, opsize, data); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -41,7 +41,7 @@ public static MemoryAddress fuse3_new ( Addressable args, Addressable ops, lon public static MethodHandle fuse3_destroy$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_destroy$MH,"fuse3_destroy"); } - public static void fuse3_destroy ( Addressable f) { + public static void fuse3_destroy ( MemorySegment f) { var mh$ = fuse3_destroy$MH(); try { mh$.invokeExact(f); @@ -52,7 +52,7 @@ public static void fuse3_destroy ( Addressable f) { public static MethodHandle fuse3_mount$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_mount$MH,"fuse3_mount"); } - public static int fuse3_mount ( Addressable f, Addressable mountpoint) { + public static int fuse3_mount ( MemorySegment f, MemorySegment mountpoint) { var mh$ = fuse3_mount$MH(); try { return (int)mh$.invokeExact(f, mountpoint); @@ -63,7 +63,7 @@ public static int fuse3_mount ( Addressable f, Addressable mountpoint) { public static MethodHandle fuse3_unmount$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse3_unmount$MH,"fuse3_unmount"); } - public static void fuse3_unmount ( Addressable f) { + public static void fuse3_unmount ( MemorySegment f) { var mh$ = fuse3_unmount$MH(); try { mh$.invokeExact(f); @@ -74,7 +74,7 @@ public static void fuse3_unmount ( Addressable f) { public static MethodHandle fuse3_loop$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse3_loop$MH,"fuse3_loop"); } - public static int fuse3_loop ( Addressable f) { + public static int fuse3_loop ( MemorySegment f) { var mh$ = fuse3_loop$MH(); try { return (int)mh$.invokeExact(f); @@ -85,7 +85,7 @@ public static int fuse3_loop ( Addressable f) { public static MethodHandle fuse3_loop_mt_31$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse3_loop_mt_31$MH,"fuse3_loop_mt_31"); } - public static int fuse3_loop_mt_31 ( Addressable f, int clone_fd) { + public static int fuse3_loop_mt_31 ( MemorySegment f, int clone_fd) { var mh$ = fuse3_loop_mt_31$MH(); try { return (int)mh$.invokeExact(f, clone_fd); @@ -96,7 +96,7 @@ public static int fuse3_loop_mt_31 ( Addressable f, int clone_fd) { public static MethodHandle fuse3_exit$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse3_exit$MH,"fuse3_exit"); } - public static void fuse3_exit ( Addressable f) { + public static void fuse3_exit ( MemorySegment f) { var mh$ = fuse3_exit$MH(); try { mh$.invokeExact(f); @@ -107,10 +107,10 @@ public static void fuse3_exit ( Addressable f) { public static MethodHandle fuse3_get_session$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse3_get_session$MH,"fuse3_get_session"); } - public static MemoryAddress fuse3_get_session ( Addressable f) { + public static MemorySegment fuse3_get_session ( MemorySegment f) { var mh$ = fuse3_get_session$MH(); try { - return (java.lang.foreign.MemoryAddress)mh$.invokeExact(f); + return (java.lang.foreign.MemorySegment)mh$.invokeExact(f); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } 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/fuse_stat.java index a9b84b90..cf26b2ed 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/fuse_stat.java @@ -219,7 +219,7 @@ public class fuse_stat { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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/fuse_statvfs.java index 4e8463c3..6dd2dea1 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/fuse_statvfs.java @@ -204,7 +204,7 @@ public class fuse_statvfs { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + public static MemorySegment ofAddress(MemorySegment addr, SegmentScope 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/fuse_timespec.java index 041d1be1..f5d33801 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/fuse_timespec.java @@ -51,7 +51,7 @@ public class fuse_timespec { public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT())); } - public static MemorySegment ofAddress(MemoryAddress addr, MemorySession session) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, session); } + 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 2701c120..2f3480e2 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,6 +1,5 @@ package org.cryptomator.jfuse.win; -import org.cryptomator.jfuse.win.FileInfoImpl; import org.cryptomator.jfuse.win.extr.fcntl_h; import org.cryptomator.jfuse.win.extr.fuse3_file_info; import org.junit.jupiter.api.Assertions; @@ -9,7 +8,7 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.nio.file.OpenOption; import java.nio.file.StandardOpenOption; import java.util.Set; @@ -21,8 +20,8 @@ public class FileInfoImplTest { @MethodSource("testGetOpenFlagParams") @DisplayName("test getOpenFlags()") public void testGetOpenFlags(int flags, Set expectedResult) { - try (var scope = MemorySession.openConfined()) { - var fi = new FileInfoImpl(fuse3_file_info.allocate(scope)); + try (var arena = Arena.openConfined()) { + var fi = new FileInfoImpl(fuse3_file_info.allocate(arena)); fuse3_file_info.flags$set(fi.segment(), flags); var result = fi.getOpenFlags(); 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 ded22db8..a8f0ab96 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class FuseConfigImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInFuseConfig getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse3_config.allocate(scope); - var fuseConfig = new FuseConfigImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse3_config.allocate(arena); + var fuseConfig = new FuseConfigImpl(segment, arena.scope()); 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 b87efacd..f846a53d 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,6 @@ package org.cryptomator.jfuse.win; import org.cryptomator.jfuse.api.FuseConnInfo; -import org.cryptomator.jfuse.win.FuseConnInfoImpl; import org.cryptomator.jfuse.win.extr.fuse3_conn_info; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; @@ -10,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -22,9 +21,9 @@ public class FuseConnInfoImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInConnInfo getter) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse3_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse3_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); setter.accept(segment, 42); @@ -55,9 +54,9 @@ private interface GetInConnInfo extends Function {} @ParameterizedTest(name = "{0}") @MethodSource public void testSetters(SetInConnInfo setter, GetInMemorySegment getter) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse3_conn_info.allocate(scope); - var connInfo = new FuseConnInfoImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse3_conn_info.allocate(arena); + var connInfo = new FuseConnInfoImpl(segment, arena.scope()); 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 6a2523ae..f8db3186 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 @@ -4,8 +4,8 @@ import org.cryptomator.jfuse.api.Fuse; import org.cryptomator.jfuse.api.FuseConnInfo; import org.cryptomator.jfuse.api.FuseMount; -import org.cryptomator.jfuse.api.FuseOperations; 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; @@ -25,9 +25,8 @@ import org.mockito.MockedStatic; import org.mockito.Mockito; -import java.lang.foreign.MemoryAddress; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.lang.foreign.ValueLayout; import java.nio.file.Path; import java.time.Instant; @@ -76,7 +75,7 @@ public void teardown() { @Test @DisplayName("MountFailedException when fuse_new fails") public void testFuseNewFails() { - fuseH.when(() -> fuse_h.fuse3_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.NULL); + fuseH.when(() -> fuse_h.fuse3_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.NULL); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -87,7 +86,7 @@ public void testFuseNewFails() { @Test @DisplayName("MountFailedException when fuse_mount fails") public void testFuseMountFails() { - fuseH.when(() -> fuse_h.fuse3_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemoryAddress.ofLong(42L)); + fuseH.when(() -> fuse_h.fuse3_new(Mockito.any(), Mockito.any(), Mockito.anyLong(), Mockito.any())).thenReturn(MemorySegment.ofAddress(42L)); fuseH.when(() -> fuse_h.fuse3_mount(Mockito.any(), Mockito.any())).thenReturn(1); var thrown = Assertions.assertThrows(FuseMountFailedException.class, () -> fuseImplSpy.mount(args)); @@ -102,11 +101,11 @@ public void testAdjustMountPoint() throws FuseMountFailedException, InterruptedE FuseMount fuseMount = Mockito.mock(FuseMount.class); Mockito.doReturn(mountPoint).when(mountPoint).getRoot(); Mockito.doReturn(true).when(mountPoint).isAbsolute(); - Mockito.doNothing().when((Fuse) fuseImplSpy).mount(Mockito.any(), Mockito.any(), Mockito.any()); + Mockito.doNothing().when((Fuse) fuseImplSpy).mount(Mockito.any(), Mockito.any()); fuseImplSpy.mount("test", mountPoint); - Mockito.verify((Fuse) fuseImplSpy).mount(Mockito.any(), Mockito.eq(mountPoint), Mockito.any()); + Mockito.verify((Fuse) fuseImplSpy).mount(Mockito.any(), Mockito.eq(mountPoint)); } } @@ -114,12 +113,12 @@ public void testAdjustMountPoint() throws FuseMountFailedException, InterruptedE @DisplayName("parseArgs") public void testParseArgs() { try (var fuseH = Mockito.mockStatic(fuse2_h.class); - var scope = MemorySession.openConfined()) { + var arena = Arena.openConfined()) { 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); MemorySegment fg = invocation.getArgument(3); - mp.set(ValueLayout.ADDRESS, 0L, scope.allocateUtf8String("/mount/point")); + mp.set(ValueLayout.ADDRESS, 0L, arena.allocateUtf8String("/mount/point")); mt.set(JAVA_INT, 0L, 1); fg.set(JAVA_INT, 0L, 1); return 0; @@ -142,12 +141,12 @@ public class FlushFsyncFsyncdir { @Test @DisplayName("flush(\"/foo\", fi)") public void testFlush() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse3_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var fi = fuse3_file_info.allocate(arena); Mockito.doReturn(42).when(fuseOps).flush(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.flush(path.address(), fi.address()); + var result = fuseImpl.flush(path, fi); Assertions.assertEquals(42, result); } @@ -156,12 +155,12 @@ public void testFlush() { @Test @DisplayName("fsync(\"/foo\", 1, fi)") public void testFsync() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse3_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsync(path.address(), 1, fi.address()); + var result = fuseImpl.fsync(path, 1, fi); Assertions.assertEquals(42, result); } @@ -170,12 +169,12 @@ public void testFsync() { @Test @DisplayName("fsyncdir(\"/foo\", 1, fi)") public void testFsyncdir() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse3_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.fsyncdir(path.address(), 1, fi.address()); + var result = fuseImpl.fsyncdir(path, 1, fi); Assertions.assertEquals(42, result); } @@ -186,17 +185,17 @@ public void testFsyncdir() { @DisplayName("init() sets fuse_conn_info.wants |= FUSE_CAP_READDIRPLUS") @Test public void testInit() { - try (var scope = MemorySession.openConfined()) { + try (var arena = Arena.openConfined()) { var result = new AtomicInteger(); Mockito.doAnswer(invocation -> { FuseConnInfo connInfo = invocation.getArgument(0); result.set(connInfo.want()); return null; }).when(fuseOps).init(Mockito.any(), Mockito.any()); - var connInfo = fuse3_conn_info.allocate(scope); - var fuseConfig = fuse3_config.allocate(scope); + var connInfo = fuse3_conn_info.allocate(arena); + var fuseConfig = fuse3_config.allocate(arena); - fuseImpl.init(connInfo.address(), fuseConfig.address()); + fuseImpl.init(connInfo, fuseConfig); Assertions.assertEquals(FuseConnInfo.FUSE_CAP_READDIRPLUS, result.get() & FuseConnInfo.FUSE_CAP_READDIRPLUS); } @@ -211,17 +210,17 @@ 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 scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var times = fuse_timespec.allocateArray(2, scope); - var fi = scope.allocate(fuse3_file_info.$LAYOUT()); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var times = fuse_timespec.allocateArray(2, arena); + var fi = arena.allocate(fuse3_file_info.$LAYOUT()); fuse_timespec.tv_sec$set(times, 0, sec0); fuse_timespec.tv_nsec$set(times, 0, nsec0); fuse_timespec.tv_sec$set(times, 1, sec1); fuse_timespec.tv_nsec$set(times, 1, nsec1); Mockito.doReturn(42).when(fuseOps).utimens(Mockito.eq("/foo"), Mockito.argThat(t -> expectedATime.equals(t.get())), Mockito.argThat(t -> expectedMTime.equals(t.get())), Mockito.argThat(usesSameMemorySegement(fi))); - var result = fuseImpl.utimens(path.address(), times.address(), fi.address()); + var result = fuseImpl.utimens(path, times, fi); Assertions.assertEquals(42, result); } @@ -234,13 +233,13 @@ public class Attr { @Test @DisplayName("getattr") public void testGetattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var attr = fuse_stat.allocate(scope); - var fi = scope.allocate(fuse3_file_info.$LAYOUT()); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var attr = fuse_stat.allocate(arena); + var fi = arena.allocate(fuse3_file_info.$LAYOUT()); Mockito.doReturn(42).when(fuseOps).getattr(Mockito.eq("/foo"), Mockito.any(), Mockito.argThat(usesSameMemorySegement(fi))); - var result = fuseImpl.getattr(path.address(), attr.address(), fi.address()); + var result = fuseImpl.getattr(path, attr, fi); Assertions.assertEquals(42, result); } @@ -249,14 +248,14 @@ public void testGetattr() { @Test @DisplayName("getxattr") public void testGetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).getxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any()); - var result = fuseImpl.getxattr(path.address(), name.address(), value.address(), 100); + var result = fuseImpl.getxattr(path, name, value, 100); Assertions.assertEquals(42, result); } @@ -265,14 +264,14 @@ public void testGetxattr() { @Test @DisplayName("setxattr") public void testSetxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); - var value = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); + var value = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).setxattr(Mockito.eq("/foo"), Mockito.eq("bar"), Mockito.any(), Mockito.anyInt()); - var result = fuseImpl.setxattr(path.address(), name.address(), value.address(), 100, 0xDEADBEEF); + var result = fuseImpl.setxattr(path, name, value, 100, 0xDEADBEEF); Assertions.assertEquals(42, result); } @@ -281,13 +280,13 @@ public void testSetxattr() { @Test @DisplayName("listxattr") public void testListxattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var list = scope.allocate(100); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var list = arena.allocate(100); Mockito.doReturn(42).when(fuseOps).listxattr(Mockito.eq("/foo"), Mockito.any()); - var result = fuseImpl.listxattr(path.address(), list.address(), 100); + var result = fuseImpl.listxattr(path, list, 100); Assertions.assertEquals(42, result); } @@ -296,13 +295,13 @@ public void testListxattr() { @Test @DisplayName("removexattr") public void testRemovexattr() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var name = scope.allocateUtf8String("bar"); + try (var arena = Arena.openConfined()) { + var path = arena.allocateUtf8String("/foo"); + var name = arena.allocateUtf8String("bar"); Mockito.doReturn(42).when(fuseOps).removexattr(Mockito.eq("/foo"), Mockito.eq("bar")); - var result = fuseImpl.removexattr(path.address(), name.address()); + var result = fuseImpl.removexattr(path, name); Assertions.assertEquals(42, result); } @@ -314,12 +313,12 @@ public void testRemovexattr() { @Test @DisplayName("truncate") public void testTruncate() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = scope.allocate(fuse3_file_info.$LAYOUT()); + try (var arena = Arena.openConfined()) { + 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))); - var result = fuseImpl.truncate(path.address(), 1337L, fi.address()); + var result = fuseImpl.truncate(path, 1337L, fi); Assertions.assertEquals(42, result); } @@ -328,12 +327,12 @@ public void testTruncate() { @Test @DisplayName("chown") public void testChown() { - try (var scope = MemorySession.openConfined()) { - var path = scope.allocateUtf8String("/foo"); - var fi = fuse3_file_info.allocate(scope); + try (var arena = Arena.openConfined()) { + 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()); - var result = fuseImpl.chown(path.address(), 42, 1337, fi.address()); + var result = fuseImpl.chown(path, 42, 1337, fi); Assertions.assertEquals(42, result); } @@ -342,7 +341,7 @@ public void testChown() { private static ArgumentMatcher usesSameMemorySegement(MemorySegment expected) { return obj -> { if (obj instanceof FileInfoImpl fiImpl) { - return fiImpl.segment().address().equals(expected.address()) && fiImpl.segment().byteSize() == expected.byteSize(); + return fiImpl.segment().equals(expected) && fiImpl.segment().byteSize() == expected.byteSize(); } return false; }; 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 13ecddd0..88bf4959 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 @@ -9,8 +9,8 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; -import java.lang.foreign.MemorySession; import java.util.function.BiConsumer; import java.util.function.Function; import java.util.stream.Stream; @@ -21,9 +21,9 @@ public class StatImplTest { @ParameterizedTest(name = "{1}") @MethodSource public void testGetters(SetInMemorySegment setter, GetInStat getter, Number value) { - try (var scope = MemorySession.openConfined()) { - var segment = fuse_stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 scope = MemorySession.openConfined()) { - var segment = fuse_stat.allocate(scope); - var stat = new StatImpl(segment.address(), scope); + try (var arena = Arena.openConfined()) { + var segment = fuse_stat.allocate(arena); + var stat = new StatImpl(segment, arena.scope()); 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 51c686f1..df7928d4 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,12 +1,11 @@ package org.cryptomator.jfuse.win; -import org.cryptomator.jfuse.win.TimeSpecImpl; import org.cryptomator.jfuse.win.extr.fuse_timespec; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; -import java.lang.foreign.MemorySession; +import java.lang.foreign.Arena; import java.time.Instant; public class TimeSpecImplTest { @@ -14,8 +13,8 @@ public class TimeSpecImplTest { @Test @DisplayName("test get()") public void testGet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); fuse_timespec.tv_sec$set(timeSpec.segment(), 123L); fuse_timespec.tv_nsec$set(timeSpec.segment(), 456L); @@ -29,8 +28,8 @@ public void testGet() { @Test @DisplayName("test set()") public void testSet() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); fuse_timespec.tv_sec$set(timeSpec.segment(), 0L); fuse_timespec.tv_nsec$set(timeSpec.segment(), 0L); @@ -44,8 +43,8 @@ public void testSet() { @Test @DisplayName("test isUtimeOmit()") public void testIsUtimeOmit() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(arena)); Assertions.assertFalse(timeSpec.isUtimeOmit()); } @@ -54,8 +53,8 @@ public void testIsUtimeOmit() { @Test @DisplayName("test isUtimeNow()") public void testIsUtimeNow() { - try (var scope = MemorySession.openConfined()) { - var timeSpec = new TimeSpecImpl(fuse_timespec.allocate(scope)); + try (var arena = Arena.openConfined()) { + 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 24dfa1b9..bf06627d 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,6 +1,5 @@ package org.cryptomator.jfuse.win; -import org.cryptomator.jfuse.win.WinErrno; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.params.ParameterizedTest; diff --git a/pom.xml b/pom.xml index 60439f66..9d77b37c 100644 --- a/pom.xml +++ b/pom.xml @@ -50,6 +50,13 @@ jfuse + + + ossrh.snapshots + https://oss.sonatype.org/content/repositories/snapshots + + + org.jetbrains @@ -66,7 +73,7 @@ org.mockito mockito-inline - 4.7.0 + 5.2.0 test @@ -79,7 +86,7 @@ maven-compiler-plugin 3.10.1 - 19 + 20 UTF-8 true @@ -140,7 +147,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.9-SNAPSHOT @@ -170,7 +177,7 @@ *.extr:*.extr.* - 19 + 20 From 6b98dc55582b0b347525ff98d18d4976ff449241 Mon Sep 17 00:00:00 2001 From: Sebastian Stenzel Date: Fri, 10 Mar 2023 12:32:41 +0100 Subject: [PATCH 2/9] updated README.md [ci skip] --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8a2878c1..2358d28d 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,12 @@ # jFUSE -Zero-Dependency Java bindings for FUSE using [JEP 424](https://openjdk.org/jeps/424). +Zero-Dependency Java bindings for FUSE using [JEP 434](https://openjdk.org/jeps/434). ## Status -This is currently an experimental library requiring JDK 19. As long as the [Foreign Function & Memory API](https://openjdk.org/jeps/424) is incubating, the required JDK will increase. +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. +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. From 41c2a111b53a25e60b3a663b424cd1b44b2c877a Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 23 Mar 2023 17:17:56 +0100 Subject: [PATCH 3/9] migrate jfuse-win to JDK20 --- jfuse-win/pom.xml | 68 +- .../cryptomator/jfuse/win/FuseMountImpl.java | 9 +- .../jfuse/win/extr/RuntimeHelper.java | 46 +- .../jfuse/win/extr/constants$0.java | 8 +- .../jfuse/win/extr/constants$1.java | 18 +- .../cryptomator/jfuse/win/extr/errno_h.java | 97 +- .../cryptomator/jfuse/win/extr/fcntl_h.java | 56 +- .../jfuse/win/extr/fuse2/RuntimeHelper.java | 50 +- .../jfuse/win/extr/fuse2/constants$0.java | 8 +- .../jfuse/win/extr/fuse2/fuse2_h.java | 26 +- .../jfuse/win/extr/fuse2/fuse_args.java | 64 +- .../jfuse/win/extr/fuse3_config.java | 370 ++++++- .../jfuse/win/extr/fuse3_conn_info.java | 165 ++- .../jfuse/win/extr/fuse3_file_info.java | 81 +- .../jfuse/win/extr/fuse3_fill_dir_t.java | 12 +- .../jfuse/win/extr/fuse3_loop_config.java | 91 ++ .../jfuse/win/extr/fuse3_operations.java | 973 +++++++++++++++--- .../cryptomator/jfuse/win/extr/fuse_h.java | 90 +- .../cryptomator/jfuse/win/extr/fuse_stat.java | 168 ++- .../jfuse/win/extr/fuse_statvfs.java | 179 +++- .../jfuse/win/extr/fuse_timespec.java | 44 +- 21 files changed, 2274 insertions(+), 349 deletions(-) create mode 100644 jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_loop_config.java diff --git a/jfuse-win/pom.xml b/jfuse-win/pom.xml index 8f836716..ab21c387 100644 --- a/jfuse-win/pom.xml +++ b/jfuse-win/pom.xml @@ -15,6 +15,7 @@ C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt + C:\Users\Arbeit\Skymatic\jextract\build\jextract\bin\jextract.bat @@ -70,9 +71,9 @@ io.github.coffeelibs jextract-maven-plugin - 0.2.0 + 0.3.0 - C:\Users\Arbeit\Programs\jextract-19\bin\jextract.bat + ${jextract.executable} ${win.ucrtHeaderPath} ${project.build.sourceDirectory} org.cryptomator.jfuse.win.extr @@ -88,7 +89,8 @@ fuse_h WINFSP_DLL_INTERNAL - FUSE_USE_VERSION=31 + FUSE_USE_VERSION=33 + CYGFUSE fuse3_lib_help @@ -96,7 +98,7 @@ fuse3_mount fuse3_get_session fuse3_loop - fuse3_loop_mt_31 + fuse3_loop_mt fuse3_exit fuse3_unmount fuse3_destroy @@ -112,6 +114,7 @@ fuse_timespec fuse3_config fuse3_conn_info + fuse3_loop_config @@ -125,6 +128,9 @@ org.cryptomator.jfuse.win.extr.fuse2 ${project.parent.basedir}/winfsp/inc/fuse/fuse_common.h fuse2_h + + CYGFUSE + fuse_parse_cmdline @@ -141,24 +147,24 @@ ${win.ucrtHeaderPath}/errno.h errno_h - - ENOENT - ENOSYS - ENOMEM - EACCES - EIO - EROFS - EBADF - EEXIST - ENOTDIR - EISDIR - ENOTEMPTY - ENOTSUP - EINVAL - ERANGE - ENOLCK - ENAMETOOLONG - + + ENOENT + ENOSYS + ENOMEM + EACCES + EIO + EROFS + EBADF + EEXIST + ENOTDIR + EISDIR + ENOTEMPTY + ENOTSUP + EINVAL + ERANGE + ENOLCK + ENAMETOOLONG + @@ -169,15 +175,15 @@ ${win.ucrtHeaderPath}/fcntl.h fcntl_h - - O_RDONLY - O_WRONLY - O_RDWR - O_APPEND - O_CREAT - O_TRUNC - O_EXCL - + + O_RDONLY + O_WRONLY + O_RDWR + O_APPEND + O_CREAT + O_TRUNC + O_EXCL + 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 23ae0264..ee31d3be 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,10 @@ 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 java.lang.foreign.Arena; import java.lang.foreign.MemorySegment; record FuseMountImpl(MemorySegment fuse, FuseArgs fuseArgs) implements FuseMount { @@ -10,7 +12,12 @@ record FuseMountImpl(MemorySegment fuse, FuseArgs fuseArgs) implements FuseMount @Override public int loop() { if (fuseArgs.multiThreaded()) { - return fuse_h.fuse3_loop_mt_31(fuse, 0); + try (var arena = Arena.openConfined()) { + var loopCfg = fuse3_loop_config.allocate(arena); + fuse3_loop_config.clone_fd$set(loopCfg,0); + fuse3_loop_config.max_idle_threads$set(loopCfg, 5); + return fuse_h.fuse3_loop_mt(fuse, loopCfg); + } } else { return fuse_h.fuse3_loop(fuse); } diff --git a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java index c83dee88..4519d7b5 100644 --- a/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/RuntimeHelper.java @@ -1,30 +1,35 @@ package org.cryptomator.jfuse.win.extr; // Generated by jextract +import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; +import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; import java.lang.foreign.SegmentScope; -import java.lang.foreign.SymbolLookup; +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 static java.lang.foreign.ValueLayout.ADDRESS; -import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; -import static java.lang.foreign.ValueLayout.JAVA_LONG; +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; final class RuntimeHelper { - private RuntimeHelper() {} - private final static Linker LINKER = Linker.nativeLinker(); - private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); - private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); - private final static SymbolLookup SYMBOL_LOOKUP; + 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"); }; final static SegmentAllocator CONSTANT_ALLOCATOR = (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); @@ -35,6 +40,9 @@ private RuntimeHelper() {} 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); @@ -42,29 +50,27 @@ static T requireNonNull(T obj, String symbolName) { return obj; } - private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; - - static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } - static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } - static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { return LINKER.downcallHandle(fdesc); } - static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); @@ -107,7 +113,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { } mtype = mtype.appendParameterTypes(Object[].class); boolean needsAllocator = function.returnLayout().isPresent() && - function.returnLayout().get() instanceof GroupLayout; + function.returnLayout().get() instanceof GroupLayout; if (needsAllocator) { mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); } else { @@ -154,7 +160,7 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); boolean needsAllocator = function.returnLayout().isPresent() && - function.returnLayout().get() instanceof GroupLayout; + function.returnLayout().get() instanceof GroupLayout; if (needsAllocator) { mh = mh.bindTo(allocator); } 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 index 545ec48e..6d136369 100644 --- 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 @@ -3,10 +3,14 @@ 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 { -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, 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 index c69826d9..e82479dd 100644 --- 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 @@ -3,10 +3,14 @@ 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 { -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 ); @@ -21,13 +25,13 @@ class constants$1 { "fuse3_loop", constants$1.fuse3_loop$FUNC ); - static final FunctionDescriptor fuse3_loop_mt_31$FUNC = FunctionDescriptor.of(Constants$root.C_LONG$LAYOUT, + static final FunctionDescriptor fuse3_loop_mt$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 fuse3_loop_mt_31$MH = RuntimeHelper.downcallHandle( - "fuse3_loop_mt_31", - constants$1.fuse3_loop_mt_31$FUNC + static final MethodHandle fuse3_loop_mt$MH = RuntimeHelper.downcallHandle( + "fuse3_loop_mt", + constants$1.fuse3_loop_mt$FUNC ); static final FunctionDescriptor fuse3_exit$FUNC = FunctionDescriptor.ofVoid( Constants$root.C_POINTER$LAYOUT 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_h.java index d78bdc4e..672edb39 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_h.java @@ -9,60 +9,139 @@ import static java.lang.foreign.ValueLayout.*; public class errno_h { - /* package-private */ errno_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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; + /** + * {@snippet : + * #define ENOENT 2 + * } + */ public static int ENOENT() { return (int)2L; } + /** + * {@snippet : + * #define EIO 5 + * } + */ public static int EIO() { return (int)5L; } + /** + * {@snippet : + * #define EBADF 9 + * } + */ public static int EBADF() { return (int)9L; } + /** + * {@snippet : + * #define ENOMEM 12 + * } + */ public static int ENOMEM() { return (int)12L; } + /** + * {@snippet : + * #define EACCES 13 + * } + */ public static int EACCES() { return (int)13L; } + /** + * {@snippet : + * #define EEXIST 17 + * } + */ public static int EEXIST() { return (int)17L; } + /** + * {@snippet : + * #define ENOTDIR 20 + * } + */ public static int ENOTDIR() { return (int)20L; } + /** + * {@snippet : + * #define EISDIR 21 + * } + */ public static int EISDIR() { return (int)21L; } + /** + * {@snippet : + * #define EROFS 30 + * } + */ public static int EROFS() { return (int)30L; } + /** + * {@snippet : + * #define ENAMETOOLONG 38 + * } + */ public static int ENAMETOOLONG() { return (int)38L; } + /** + * {@snippet : + * #define ENOLCK 39 + * } + */ public static int ENOLCK() { return (int)39L; } + /** + * {@snippet : + * #define ENOSYS 40 + * } + */ public static int ENOSYS() { return (int)40L; } + /** + * {@snippet : + * #define ENOTEMPTY 41 + * } + */ public static int ENOTEMPTY() { return (int)41L; } + /** + * {@snippet : + * #define EINVAL 22 + * } + */ public static int EINVAL() { return (int)22L; } + /** + * {@snippet : + * #define ERANGE 34 + * } + */ public static int ERANGE() { return (int)34L; } + /** + * {@snippet : + * #define ENOTSUP 129 + * } + */ public static int ENOTSUP() { return (int)129L; } 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_h.java index e8134901..d14ccfe7 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_h.java @@ -2,36 +2,74 @@ 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.*; public class fcntl_h { - /* package-private */ fcntl_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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; + /** + * {@snippet : + * #define O_RDONLY 0 + * } + */ public static int O_RDONLY() { return (int)0L; } + /** + * {@snippet : + * #define O_WRONLY 1 + * } + */ public static int O_WRONLY() { return (int)1L; } + /** + * {@snippet : + * #define O_RDWR 2 + * } + */ public static int O_RDWR() { return (int)2L; } + /** + * {@snippet : + * #define O_APPEND 8 + * } + */ public static int O_APPEND() { return (int)8L; } + /** + * {@snippet : + * #define O_CREAT 256 + * } + */ public static int O_CREAT() { return (int)256L; } + /** + * {@snippet : + * #define O_TRUNC 512 + * } + */ public static int O_TRUNC() { return (int)512L; } + /** + * {@snippet : + * #define O_EXCL 1024 + * } + */ public static int O_EXCL() { return (int)1024L; } 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 764ab17d..6d597184 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 @@ -1,40 +1,48 @@ package org.cryptomator.jfuse.win.extr.fuse2; // Generated by jextract +import java.lang.foreign.Linker; import java.lang.foreign.FunctionDescriptor; import java.lang.foreign.GroupLayout; -import java.lang.foreign.Linker; +import java.lang.foreign.SymbolLookup; import java.lang.foreign.MemoryLayout; import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; import java.lang.foreign.SegmentScope; -import java.lang.foreign.SymbolLookup; +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 static java.lang.foreign.ValueLayout.ADDRESS; -import static java.lang.foreign.ValueLayout.JAVA_DOUBLE; -import static java.lang.foreign.ValueLayout.JAVA_LONG; +import static java.lang.foreign.Linker.*; +import static java.lang.foreign.ValueLayout.*; final class RuntimeHelper { - private RuntimeHelper() {} - private final static Linker LINKER = Linker.nativeLinker(); - private final static ClassLoader LOADER = RuntimeHelper.class.getClassLoader(); - private final static MethodHandles.Lookup MH_LOOKUP = MethodHandles.lookup(); - private final static SymbolLookup SYMBOL_LOOKUP; + 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"); }; final static SegmentAllocator CONSTANT_ALLOCATOR = (size, align) -> MemorySegment.allocateNative(size, align, SegmentScope.auto()); 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); @@ -42,29 +50,27 @@ static T requireNonNull(T obj, String symbolName) { return obj; } - private final static SegmentAllocator THROWING_ALLOCATOR = (x, y) -> { throw new AssertionError("should not reach here"); }; - - static final MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { + static MemorySegment lookupGlobalVariable(String name, MemoryLayout layout) { return SYMBOL_LOOKUP.find(name).map(symbol -> MemorySegment.ofAddress(symbol.address(), layout.byteSize(), symbol.scope())).orElse(null); } - static final MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(String name, FunctionDescriptor fdesc) { return SYMBOL_LOOKUP.find(name). map(addr -> LINKER.downcallHandle(addr, fdesc)). orElse(null); } - static final MethodHandle downcallHandle(FunctionDescriptor fdesc) { + static MethodHandle downcallHandle(FunctionDescriptor fdesc) { return LINKER.downcallHandle(fdesc); } - static final MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { + static MethodHandle downcallHandleVariadic(String name, FunctionDescriptor fdesc) { return SYMBOL_LOOKUP.find(name). map(addr -> VarargsInvoker.make(addr, fdesc)). orElse(null); } - static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { + static MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor fdesc, SegmentScope scope) { try { MethodHandle handle = MH_LOOKUP.findVirtual(fi, "apply", fdesc.toMethodType()); handle = handle.bindTo(z); @@ -75,7 +81,7 @@ static final MemorySegment upcallStub(Class fi, Z z, FunctionDescriptor f } static MemorySegment asArray(MemorySegment addr, MemoryLayout layout, int numElements, SegmentScope scope) { - return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); + return MemorySegment.ofAddress(addr.address(), numElements * layout.byteSize(), scope); } // Internals only below this point @@ -107,7 +113,7 @@ static MethodHandle make(MemorySegment symbol, FunctionDescriptor function) { } mtype = mtype.appendParameterTypes(Object[].class); boolean needsAllocator = function.returnLayout().isPresent() && - function.returnLayout().get() instanceof GroupLayout; + function.returnLayout().get() instanceof GroupLayout; if (needsAllocator) { mtype = mtype.insertParameterTypes(0, SegmentAllocator.class); } else { @@ -154,7 +160,7 @@ private Object invoke(SegmentAllocator allocator, Object[] args) throws Throwabl FunctionDescriptor.of(function.returnLayout().get(), argLayouts); MethodHandle mh = LINKER.downcallHandle(symbol, f); boolean needsAllocator = function.returnLayout().isPresent() && - function.returnLayout().get() instanceof GroupLayout; + function.returnLayout().get() instanceof GroupLayout; if (needsAllocator) { mh = mh.bindTo(allocator); } 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 7761303c..26ca7bdb 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 @@ -3,10 +3,14 @@ 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$0 { -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, 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 0d7841b2..fdaa120d 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 @@ -3,23 +3,29 @@ 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.*; public class fuse2_h { - /* package-private */ fuse2_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 MethodHandle fuse_parse_cmdline$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse_parse_cmdline$MH,"fuse_parse_cmdline"); } - public static int fuse_parse_cmdline ( MemorySegment args, MemorySegment mountpoint, MemorySegment multithreaded, MemorySegment foreground) { + /** + * {@snippet : + * int fuse_parse_cmdline(struct fuse_args* args, char** mountpoint, int* multithreaded, int* foreground); + * } + */ + public static int fuse_parse_cmdline(MemorySegment args, MemorySegment mountpoint, MemorySegment multithreaded, MemorySegment foreground) { var mh$ = fuse_parse_cmdline$MH(); try { return (int)mh$.invokeExact(args, mountpoint, multithreaded, foreground); 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 36a9fdd9..d4cd621a 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 @@ -2,14 +2,20 @@ package org.cryptomator.jfuse.win.extr.fuse2; -import java.lang.foreign.GroupLayout; -import java.lang.foreign.MemoryLayout; -import java.lang.foreign.MemorySegment; -import java.lang.foreign.SegmentAllocator; -import java.lang.foreign.SegmentScope; -import java.lang.foreign.StructLayout; +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_args { + * int argc; + * char** argv; + * int allocated; + * }; + * } + */ public class fuse_args { static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( @@ -26,10 +32,22 @@ public class fuse_args { public static VarHandle argc$VH() { return fuse_args.argc$VH; } + /** + * Getter for field: + * {@snippet : + * int argc; + * } + */ public static int argc$get(MemorySegment seg) { return (int)fuse_args.argc$VH.get(seg); } - public static void argc$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int argc; + * } + */ + public static void argc$set(MemorySegment seg, int x) { fuse_args.argc$VH.set(seg, x); } public static int argc$get(MemorySegment seg, long index) { @@ -42,10 +60,22 @@ public class fuse_args { public static VarHandle argv$VH() { return fuse_args.argv$VH; } + /** + * Getter for field: + * {@snippet : + * char** argv; + * } + */ public static MemorySegment argv$get(MemorySegment seg) { return (java.lang.foreign.MemorySegment)fuse_args.argv$VH.get(seg); } - public static void argv$set( MemorySegment seg, MemorySegment x) { + /** + * Setter for field: + * {@snippet : + * char** argv; + * } + */ + public static void argv$set(MemorySegment seg, MemorySegment x) { fuse_args.argv$VH.set(seg, x); } public static MemorySegment argv$get(MemorySegment seg, long index) { @@ -58,10 +88,22 @@ public class fuse_args { public static VarHandle allocated$VH() { return fuse_args.allocated$VH; } + /** + * Getter for field: + * {@snippet : + * int allocated; + * } + */ public static int allocated$get(MemorySegment seg) { return (int)fuse_args.allocated$VH.get(seg); } - public static void allocated$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int allocated; + * } + */ + public static void allocated$set(MemorySegment seg, int x) { fuse_args.allocated$VH.set(seg, x); } public static int allocated$get(MemorySegment seg, long index) { @@ -72,7 +114,7 @@ public class fuse_args { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse3_config.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_config.java index 28981390..3a289f31 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_config.java @@ -7,9 +7,39 @@ import java.nio.ByteOrder; import java.lang.foreign.*; import static java.lang.foreign.ValueLayout.*; +/** + * {@snippet : + * struct fuse3_config { + * int set_gid; + * unsigned int gid; + * int set_uid; + * unsigned int uid; + * int set_mode; + * unsigned int umask; + * double entry_timeout; + * double negative_timeout; + * double attr_timeout; + * int intr; + * int intr_signal; + * int remember; + * int hard_remove; + * int use_ino; + * int readdir_ino; + * int direct_io; + * int kernel_cache; + * int auto_cache; + * int ac_attr_timeout_set; + * double ac_attr_timeout; + * int nullpath_ok; + * int show_help; + * char* modules; + * int debug; + * }; + * } + */ public class fuse3_config { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -43,10 +73,22 @@ public class fuse3_config { public static VarHandle set_gid$VH() { return fuse3_config.set_gid$VH; } + /** + * Getter for field: + * {@snippet : + * int set_gid; + * } + */ public static int set_gid$get(MemorySegment seg) { return (int)fuse3_config.set_gid$VH.get(seg); } - public static void set_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_gid; + * } + */ + public static void set_gid$set(MemorySegment seg, int x) { fuse3_config.set_gid$VH.set(seg, x); } public static int set_gid$get(MemorySegment seg, long index) { @@ -59,10 +101,22 @@ public class fuse3_config { public static VarHandle gid$VH() { return fuse3_config.gid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int gid; + * } + */ public static int gid$get(MemorySegment seg) { return (int)fuse3_config.gid$VH.get(seg); } - public static void gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int gid; + * } + */ + public static void gid$set(MemorySegment seg, int x) { fuse3_config.gid$VH.set(seg, x); } public static int gid$get(MemorySegment seg, long index) { @@ -75,10 +129,22 @@ public class fuse3_config { public static VarHandle set_uid$VH() { return fuse3_config.set_uid$VH; } + /** + * Getter for field: + * {@snippet : + * int set_uid; + * } + */ public static int set_uid$get(MemorySegment seg) { return (int)fuse3_config.set_uid$VH.get(seg); } - public static void set_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_uid; + * } + */ + public static void set_uid$set(MemorySegment seg, int x) { fuse3_config.set_uid$VH.set(seg, x); } public static int set_uid$get(MemorySegment seg, long index) { @@ -91,10 +157,22 @@ public class fuse3_config { public static VarHandle uid$VH() { return fuse3_config.uid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int uid; + * } + */ public static int uid$get(MemorySegment seg) { return (int)fuse3_config.uid$VH.get(seg); } - public static void uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int uid; + * } + */ + public static void uid$set(MemorySegment seg, int x) { fuse3_config.uid$VH.set(seg, x); } public static int uid$get(MemorySegment seg, long index) { @@ -107,10 +185,22 @@ public class fuse3_config { public static VarHandle set_mode$VH() { return fuse3_config.set_mode$VH; } + /** + * Getter for field: + * {@snippet : + * int set_mode; + * } + */ public static int set_mode$get(MemorySegment seg) { return (int)fuse3_config.set_mode$VH.get(seg); } - public static void set_mode$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int set_mode; + * } + */ + public static void set_mode$set(MemorySegment seg, int x) { fuse3_config.set_mode$VH.set(seg, x); } public static int set_mode$get(MemorySegment seg, long index) { @@ -123,10 +213,22 @@ public class fuse3_config { public static VarHandle umask$VH() { return fuse3_config.umask$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int umask; + * } + */ public static int umask$get(MemorySegment seg) { return (int)fuse3_config.umask$VH.get(seg); } - public static void umask$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int umask; + * } + */ + public static void umask$set(MemorySegment seg, int x) { fuse3_config.umask$VH.set(seg, x); } public static int umask$get(MemorySegment seg, long index) { @@ -139,10 +241,22 @@ public class fuse3_config { public static VarHandle entry_timeout$VH() { return fuse3_config.entry_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double entry_timeout; + * } + */ public static double entry_timeout$get(MemorySegment seg) { return (double)fuse3_config.entry_timeout$VH.get(seg); } - public static void entry_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double entry_timeout; + * } + */ + public static void entry_timeout$set(MemorySegment seg, double x) { fuse3_config.entry_timeout$VH.set(seg, x); } public static double entry_timeout$get(MemorySegment seg, long index) { @@ -155,10 +269,22 @@ public class fuse3_config { public static VarHandle negative_timeout$VH() { return fuse3_config.negative_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double negative_timeout; + * } + */ public static double negative_timeout$get(MemorySegment seg) { return (double)fuse3_config.negative_timeout$VH.get(seg); } - public static void negative_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double negative_timeout; + * } + */ + public static void negative_timeout$set(MemorySegment seg, double x) { fuse3_config.negative_timeout$VH.set(seg, x); } public static double negative_timeout$get(MemorySegment seg, long index) { @@ -171,10 +297,22 @@ public class fuse3_config { public static VarHandle attr_timeout$VH() { return fuse3_config.attr_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double attr_timeout; + * } + */ public static double attr_timeout$get(MemorySegment seg) { return (double)fuse3_config.attr_timeout$VH.get(seg); } - public static void attr_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double attr_timeout; + * } + */ + public static void attr_timeout$set(MemorySegment seg, double x) { fuse3_config.attr_timeout$VH.set(seg, x); } public static double attr_timeout$get(MemorySegment seg, long index) { @@ -187,10 +325,22 @@ public class fuse3_config { public static VarHandle intr$VH() { return fuse3_config.intr$VH; } + /** + * Getter for field: + * {@snippet : + * int intr; + * } + */ public static int intr$get(MemorySegment seg) { return (int)fuse3_config.intr$VH.get(seg); } - public static void intr$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int intr; + * } + */ + public static void intr$set(MemorySegment seg, int x) { fuse3_config.intr$VH.set(seg, x); } public static int intr$get(MemorySegment seg, long index) { @@ -203,10 +353,22 @@ public class fuse3_config { public static VarHandle intr_signal$VH() { return fuse3_config.intr_signal$VH; } + /** + * Getter for field: + * {@snippet : + * int intr_signal; + * } + */ public static int intr_signal$get(MemorySegment seg) { return (int)fuse3_config.intr_signal$VH.get(seg); } - public static void intr_signal$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int intr_signal; + * } + */ + public static void intr_signal$set(MemorySegment seg, int x) { fuse3_config.intr_signal$VH.set(seg, x); } public static int intr_signal$get(MemorySegment seg, long index) { @@ -219,10 +381,22 @@ public class fuse3_config { public static VarHandle remember$VH() { return fuse3_config.remember$VH; } + /** + * Getter for field: + * {@snippet : + * int remember; + * } + */ public static int remember$get(MemorySegment seg) { return (int)fuse3_config.remember$VH.get(seg); } - public static void remember$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int remember; + * } + */ + public static void remember$set(MemorySegment seg, int x) { fuse3_config.remember$VH.set(seg, x); } public static int remember$get(MemorySegment seg, long index) { @@ -235,10 +409,22 @@ public class fuse3_config { public static VarHandle hard_remove$VH() { return fuse3_config.hard_remove$VH; } + /** + * Getter for field: + * {@snippet : + * int hard_remove; + * } + */ public static int hard_remove$get(MemorySegment seg) { return (int)fuse3_config.hard_remove$VH.get(seg); } - public static void hard_remove$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int hard_remove; + * } + */ + public static void hard_remove$set(MemorySegment seg, int x) { fuse3_config.hard_remove$VH.set(seg, x); } public static int hard_remove$get(MemorySegment seg, long index) { @@ -251,10 +437,22 @@ public class fuse3_config { public static VarHandle use_ino$VH() { return fuse3_config.use_ino$VH; } + /** + * Getter for field: + * {@snippet : + * int use_ino; + * } + */ public static int use_ino$get(MemorySegment seg) { return (int)fuse3_config.use_ino$VH.get(seg); } - public static void use_ino$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int use_ino; + * } + */ + public static void use_ino$set(MemorySegment seg, int x) { fuse3_config.use_ino$VH.set(seg, x); } public static int use_ino$get(MemorySegment seg, long index) { @@ -267,10 +465,22 @@ public class fuse3_config { public static VarHandle readdir_ino$VH() { return fuse3_config.readdir_ino$VH; } + /** + * Getter for field: + * {@snippet : + * int readdir_ino; + * } + */ public static int readdir_ino$get(MemorySegment seg) { return (int)fuse3_config.readdir_ino$VH.get(seg); } - public static void readdir_ino$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int readdir_ino; + * } + */ + public static void readdir_ino$set(MemorySegment seg, int x) { fuse3_config.readdir_ino$VH.set(seg, x); } public static int readdir_ino$get(MemorySegment seg, long index) { @@ -283,10 +493,22 @@ public class fuse3_config { public static VarHandle direct_io$VH() { return fuse3_config.direct_io$VH; } + /** + * Getter for field: + * {@snippet : + * int direct_io; + * } + */ public static int direct_io$get(MemorySegment seg) { return (int)fuse3_config.direct_io$VH.get(seg); } - public static void direct_io$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int direct_io; + * } + */ + public static void direct_io$set(MemorySegment seg, int x) { fuse3_config.direct_io$VH.set(seg, x); } public static int direct_io$get(MemorySegment seg, long index) { @@ -299,10 +521,22 @@ public class fuse3_config { public static VarHandle kernel_cache$VH() { return fuse3_config.kernel_cache$VH; } + /** + * Getter for field: + * {@snippet : + * int kernel_cache; + * } + */ public static int kernel_cache$get(MemorySegment seg) { return (int)fuse3_config.kernel_cache$VH.get(seg); } - public static void kernel_cache$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int kernel_cache; + * } + */ + public static void kernel_cache$set(MemorySegment seg, int x) { fuse3_config.kernel_cache$VH.set(seg, x); } public static int kernel_cache$get(MemorySegment seg, long index) { @@ -315,10 +549,22 @@ public class fuse3_config { public static VarHandle auto_cache$VH() { return fuse3_config.auto_cache$VH; } + /** + * Getter for field: + * {@snippet : + * int auto_cache; + * } + */ public static int auto_cache$get(MemorySegment seg) { return (int)fuse3_config.auto_cache$VH.get(seg); } - public static void auto_cache$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int auto_cache; + * } + */ + public static void auto_cache$set(MemorySegment seg, int x) { fuse3_config.auto_cache$VH.set(seg, x); } public static int auto_cache$get(MemorySegment seg, long index) { @@ -331,10 +577,22 @@ public class fuse3_config { public static VarHandle ac_attr_timeout_set$VH() { return fuse3_config.ac_attr_timeout_set$VH; } + /** + * Getter for field: + * {@snippet : + * int ac_attr_timeout_set; + * } + */ public static int ac_attr_timeout_set$get(MemorySegment seg) { return (int)fuse3_config.ac_attr_timeout_set$VH.get(seg); } - public static void ac_attr_timeout_set$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int ac_attr_timeout_set; + * } + */ + public static void ac_attr_timeout_set$set(MemorySegment seg, int x) { fuse3_config.ac_attr_timeout_set$VH.set(seg, x); } public static int ac_attr_timeout_set$get(MemorySegment seg, long index) { @@ -347,10 +605,22 @@ public class fuse3_config { public static VarHandle ac_attr_timeout$VH() { return fuse3_config.ac_attr_timeout$VH; } + /** + * Getter for field: + * {@snippet : + * double ac_attr_timeout; + * } + */ public static double ac_attr_timeout$get(MemorySegment seg) { return (double)fuse3_config.ac_attr_timeout$VH.get(seg); } - public static void ac_attr_timeout$set( MemorySegment seg, double x) { + /** + * Setter for field: + * {@snippet : + * double ac_attr_timeout; + * } + */ + public static void ac_attr_timeout$set(MemorySegment seg, double x) { fuse3_config.ac_attr_timeout$VH.set(seg, x); } public static double ac_attr_timeout$get(MemorySegment seg, long index) { @@ -363,10 +633,22 @@ public class fuse3_config { public static VarHandle nullpath_ok$VH() { return fuse3_config.nullpath_ok$VH; } + /** + * Getter for field: + * {@snippet : + * int nullpath_ok; + * } + */ public static int nullpath_ok$get(MemorySegment seg) { return (int)fuse3_config.nullpath_ok$VH.get(seg); } - public static void nullpath_ok$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int nullpath_ok; + * } + */ + public static void nullpath_ok$set(MemorySegment seg, int x) { fuse3_config.nullpath_ok$VH.set(seg, x); } public static int nullpath_ok$get(MemorySegment seg, long index) { @@ -379,10 +661,22 @@ public class fuse3_config { public static VarHandle show_help$VH() { return fuse3_config.show_help$VH; } + /** + * Getter for field: + * {@snippet : + * int show_help; + * } + */ public static int show_help$get(MemorySegment seg) { return (int)fuse3_config.show_help$VH.get(seg); } - public static void show_help$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int show_help; + * } + */ + public static void show_help$set(MemorySegment seg, int x) { fuse3_config.show_help$VH.set(seg, x); } public static int show_help$get(MemorySegment seg, long index) { @@ -395,10 +689,22 @@ public class fuse3_config { public static VarHandle modules$VH() { return fuse3_config.modules$VH; } + /** + * Getter for field: + * {@snippet : + * char* modules; + * } + */ public static MemorySegment modules$get(MemorySegment seg) { return (java.lang.foreign.MemorySegment)fuse3_config.modules$VH.get(seg); } - public static void modules$set( MemorySegment seg, MemorySegment x) { + /** + * Setter for field: + * {@snippet : + * char* modules; + * } + */ + public static void modules$set(MemorySegment seg, MemorySegment x) { fuse3_config.modules$VH.set(seg, x); } public static MemorySegment modules$get(MemorySegment seg, long index) { @@ -411,10 +717,22 @@ public class fuse3_config { public static VarHandle debug$VH() { return fuse3_config.debug$VH; } + /** + * Getter for field: + * {@snippet : + * int debug; + * } + */ public static int debug$get(MemorySegment seg) { return (int)fuse3_config.debug$VH.get(seg); } - public static void debug$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int debug; + * } + */ + public static void debug$set(MemorySegment seg, int x) { fuse3_config.debug$VH.set(seg, x); } public static int debug$get(MemorySegment seg, long index) { @@ -425,7 +743,7 @@ public class fuse3_config { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse3_conn_info.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_conn_info.java index 7d0e7260..415a3b40 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_conn_info.java @@ -2,12 +2,31 @@ 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_conn_info { + * unsigned int proto_major; + * unsigned int proto_minor; + * unsigned int max_write; + * unsigned int max_read; + * unsigned int max_readahead; + * unsigned int capable; + * unsigned int want; + * unsigned int max_background; + * unsigned int congestion_threshold; + * unsigned int time_gran; + * unsigned int reserved[22]; + * }; + * } + */ public class fuse3_conn_info { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -27,10 +46,22 @@ public class fuse3_conn_info { public static VarHandle proto_major$VH() { return fuse3_conn_info.proto_major$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ public static int proto_major$get(MemorySegment seg) { return (int)fuse3_conn_info.proto_major$VH.get(seg); } - public static void proto_major$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_major; + * } + */ + public static void proto_major$set(MemorySegment seg, int x) { fuse3_conn_info.proto_major$VH.set(seg, x); } public static int proto_major$get(MemorySegment seg, long index) { @@ -43,10 +74,22 @@ public class fuse3_conn_info { public static VarHandle proto_minor$VH() { return fuse3_conn_info.proto_minor$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ public static int proto_minor$get(MemorySegment seg) { return (int)fuse3_conn_info.proto_minor$VH.get(seg); } - public static void proto_minor$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int proto_minor; + * } + */ + public static void proto_minor$set(MemorySegment seg, int x) { fuse3_conn_info.proto_minor$VH.set(seg, x); } public static int proto_minor$get(MemorySegment seg, long index) { @@ -59,10 +102,22 @@ public class fuse3_conn_info { public static VarHandle max_write$VH() { return fuse3_conn_info.max_write$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_write; + * } + */ public static int max_write$get(MemorySegment seg) { return (int)fuse3_conn_info.max_write$VH.get(seg); } - public static void max_write$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_write; + * } + */ + public static void max_write$set(MemorySegment seg, int x) { fuse3_conn_info.max_write$VH.set(seg, x); } public static int max_write$get(MemorySegment seg, long index) { @@ -75,10 +130,22 @@ public class fuse3_conn_info { public static VarHandle max_read$VH() { return fuse3_conn_info.max_read$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_read; + * } + */ public static int max_read$get(MemorySegment seg) { return (int)fuse3_conn_info.max_read$VH.get(seg); } - public static void max_read$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_read; + * } + */ + public static void max_read$set(MemorySegment seg, int x) { fuse3_conn_info.max_read$VH.set(seg, x); } public static int max_read$get(MemorySegment seg, long index) { @@ -91,10 +158,22 @@ public class fuse3_conn_info { public static VarHandle max_readahead$VH() { return fuse3_conn_info.max_readahead$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ public static int max_readahead$get(MemorySegment seg) { return (int)fuse3_conn_info.max_readahead$VH.get(seg); } - public static void max_readahead$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_readahead; + * } + */ + public static void max_readahead$set(MemorySegment seg, int x) { fuse3_conn_info.max_readahead$VH.set(seg, x); } public static int max_readahead$get(MemorySegment seg, long index) { @@ -107,10 +186,22 @@ public class fuse3_conn_info { public static VarHandle capable$VH() { return fuse3_conn_info.capable$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int capable; + * } + */ public static int capable$get(MemorySegment seg) { return (int)fuse3_conn_info.capable$VH.get(seg); } - public static void capable$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int capable; + * } + */ + public static void capable$set(MemorySegment seg, int x) { fuse3_conn_info.capable$VH.set(seg, x); } public static int capable$get(MemorySegment seg, long index) { @@ -123,10 +214,22 @@ public class fuse3_conn_info { public static VarHandle want$VH() { return fuse3_conn_info.want$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int want; + * } + */ public static int want$get(MemorySegment seg) { return (int)fuse3_conn_info.want$VH.get(seg); } - public static void want$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int want; + * } + */ + public static void want$set(MemorySegment seg, int x) { fuse3_conn_info.want$VH.set(seg, x); } public static int want$get(MemorySegment seg, long index) { @@ -139,10 +242,22 @@ public class fuse3_conn_info { public static VarHandle max_background$VH() { return fuse3_conn_info.max_background$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int max_background; + * } + */ public static int max_background$get(MemorySegment seg) { return (int)fuse3_conn_info.max_background$VH.get(seg); } - public static void max_background$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int max_background; + * } + */ + public static void max_background$set(MemorySegment seg, int x) { fuse3_conn_info.max_background$VH.set(seg, x); } public static int max_background$get(MemorySegment seg, long index) { @@ -155,10 +270,22 @@ public class fuse3_conn_info { public static VarHandle congestion_threshold$VH() { return fuse3_conn_info.congestion_threshold$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ public static int congestion_threshold$get(MemorySegment seg) { return (int)fuse3_conn_info.congestion_threshold$VH.get(seg); } - public static void congestion_threshold$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int congestion_threshold; + * } + */ + public static void congestion_threshold$set(MemorySegment seg, int x) { fuse3_conn_info.congestion_threshold$VH.set(seg, x); } public static int congestion_threshold$get(MemorySegment seg, long index) { @@ -171,10 +298,22 @@ public class fuse3_conn_info { public static VarHandle time_gran$VH() { return fuse3_conn_info.time_gran$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int time_gran; + * } + */ public static int time_gran$get(MemorySegment seg) { return (int)fuse3_conn_info.time_gran$VH.get(seg); } - public static void time_gran$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int time_gran; + * } + */ + public static void time_gran$set(MemorySegment seg, int x) { fuse3_conn_info.time_gran$VH.set(seg, x); } public static int time_gran$get(MemorySegment seg, long index) { @@ -188,7 +327,7 @@ public class fuse3_conn_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse3_file_info.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_file_info.java index adcdca35..5b341929 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_file_info.java @@ -2,12 +2,31 @@ 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_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 padding; + * unsigned long long fh; + * unsigned long long lock_owner; + * unsigned int poll_events; + * }; + * } + */ public class fuse3_file_info { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + static final StructLayout $struct$LAYOUT = MemoryLayout.structLayout( Constants$root.C_LONG$LAYOUT.withName("flags"), MemoryLayout.structLayout( MemoryLayout.paddingLayout(1).withName("writepage"), @@ -32,10 +51,22 @@ public class fuse3_file_info { public static VarHandle flags$VH() { return fuse3_file_info.flags$VH; } + /** + * Getter for field: + * {@snippet : + * int flags; + * } + */ public static int flags$get(MemorySegment seg) { return (int)fuse3_file_info.flags$VH.get(seg); } - public static void flags$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int flags; + * } + */ + public static void flags$set(MemorySegment seg, int x) { fuse3_file_info.flags$VH.set(seg, x); } public static int flags$get(MemorySegment seg, long index) { @@ -48,10 +79,22 @@ public class fuse3_file_info { public static VarHandle fh$VH() { return fuse3_file_info.fh$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long fh; + * } + */ public static long fh$get(MemorySegment seg) { return (long)fuse3_file_info.fh$VH.get(seg); } - public static void fh$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long fh; + * } + */ + public static void fh$set(MemorySegment seg, long x) { fuse3_file_info.fh$VH.set(seg, x); } public static long fh$get(MemorySegment seg, long index) { @@ -64,10 +107,22 @@ public class fuse3_file_info { public static VarHandle lock_owner$VH() { return fuse3_file_info.lock_owner$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long lock_owner; + * } + */ public static long lock_owner$get(MemorySegment seg) { return (long)fuse3_file_info.lock_owner$VH.get(seg); } - public static void lock_owner$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long lock_owner; + * } + */ + public static void lock_owner$set(MemorySegment seg, long x) { fuse3_file_info.lock_owner$VH.set(seg, x); } public static long lock_owner$get(MemorySegment seg, long index) { @@ -80,10 +135,22 @@ public class fuse3_file_info { public static VarHandle poll_events$VH() { return fuse3_file_info.poll_events$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int poll_events; + * } + */ public static int poll_events$get(MemorySegment seg) { return (int)fuse3_file_info.poll_events$VH.get(seg); } - public static void poll_events$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int poll_events; + * } + */ + public static void poll_events$set(MemorySegment seg, int x) { fuse3_file_info.poll_events$VH.set(seg, x); } public static int poll_events$get(MemorySegment seg, long index) { @@ -94,7 +161,7 @@ public class fuse3_file_info { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse3_fill_dir_t.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_fill_dir_t.java index 3de9c131..345c9526 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_fill_dir_t.java @@ -2,8 +2,16 @@ 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 : + * int (*fuse3_fill_dir_t)(void* buf,char* name,struct fuse_stat* stbuf,long long off,enum fuse3_fill_dir_flags flags); + * } + */ 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); @@ -14,7 +22,7 @@ static fuse3_fill_dir_t ofAddress(MemorySegment addr, SegmentScope scope) { MemorySegment symbol = MemorySegment.ofAddress(addr.address(), 0, scope); 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)_buf, (java.lang.foreign.MemorySegment)_name, (java.lang.foreign.MemorySegment)_stbuf, _off, _flags); + return (int)constants$0.fuse3_fill_dir_t$MH.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_loop_config.java new file mode 100644 index 00000000..8a48caec --- /dev/null +++ b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_loop_config.java @@ -0,0 +1,91 @@ +// 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_loop_config { + * int clone_fd; + * unsigned int max_idle_threads; + * }; + * } + */ +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; + } + 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; + } + /** + * Getter for field: + * {@snippet : + * int clone_fd; + * } + */ + public static int clone_fd$get(MemorySegment seg) { + return (int)fuse3_loop_config.clone_fd$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * int clone_fd; + * } + */ + public static void clone_fd$set(MemorySegment seg, int x) { + fuse3_loop_config.clone_fd$VH.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())); + } + public static void clone_fd$set(MemorySegment seg, long index, int x) { + fuse3_loop_config.clone_fd$VH.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; + } + /** + * Getter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ + public static int max_idle_threads$get(MemorySegment seg) { + return (int)fuse3_loop_config.max_idle_threads$VH.get(seg); + } + /** + * Setter for field: + * {@snippet : + * unsigned int max_idle_threads; + * } + */ + public static void max_idle_threads$set(MemorySegment seg, int x) { + fuse3_loop_config.max_idle_threads$VH.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())); + } + 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); + } + 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/main/java/org/cryptomator/jfuse/win/extr/fuse3_operations.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse3_operations.java index 0a5853c2..5b52d508 100644 --- 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 @@ -4,11 +4,58 @@ 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 GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -61,6 +108,11 @@ public class fuse3_operations { 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); @@ -71,7 +123,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.getattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -83,10 +135,22 @@ static getattr ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void getattr$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -95,7 +159,7 @@ static getattr ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -106,6 +170,11 @@ public static getattr getattr (MemorySegment segment, SegmentScope scope) { 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); @@ -116,7 +185,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); + return (int)fuse3_operations.readlink$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -128,10 +197,22 @@ static readlink ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void readlink$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -140,7 +221,7 @@ static readlink ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -151,6 +232,11 @@ public static readlink readlink (MemorySegment segment, SegmentScope scope) { 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); @@ -161,7 +247,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, __x2); + return (int)fuse3_operations.mknod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -173,10 +259,22 @@ static mknod ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void mknod$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -185,7 +283,7 @@ static mknod ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -195,6 +293,11 @@ public static mknod mknod (MemorySegment segment, SegmentScope scope) { 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); @@ -205,7 +308,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1); + return (int)fuse3_operations.mkdir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -217,10 +320,22 @@ static mkdir ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void mkdir$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -229,7 +344,7 @@ static mkdir ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -238,6 +353,11 @@ public static mkdir mkdir (MemorySegment segment, SegmentScope scope) { 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); @@ -248,7 +368,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0); + return (int)fuse3_operations.unlink$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -260,10 +380,22 @@ static unlink ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void unlink$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -272,7 +404,7 @@ static unlink ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -281,6 +413,11 @@ public static unlink unlink (MemorySegment segment, SegmentScope scope) { 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); @@ -291,7 +428,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0); + return (int)fuse3_operations.rmdir$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -303,10 +440,22 @@ static rmdir ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void rmdir$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -315,7 +464,7 @@ static rmdir ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -325,6 +474,11 @@ public static rmdir rmdir (MemorySegment segment, SegmentScope scope) { 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); @@ -335,7 +489,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.symlink$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -347,10 +501,22 @@ static symlink ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void symlink$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -359,7 +525,7 @@ static symlink ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -370,6 +536,11 @@ public static symlink symlink (MemorySegment segment, SegmentScope scope) { 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); @@ -380,7 +551,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); + return (int)fuse3_operations.rename$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -392,10 +563,22 @@ static rename ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void rename$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -404,7 +587,7 @@ static rename ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -414,6 +597,11 @@ public static rename rename (MemorySegment segment, SegmentScope scope) { 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); @@ -424,7 +612,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.link$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -436,10 +624,22 @@ static link ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void link$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -448,7 +648,7 @@ static link ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -459,6 +659,11 @@ public static link link (MemorySegment segment, SegmentScope scope) { 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); @@ -469,7 +674,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.chmod$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -481,10 +686,22 @@ static chmod ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void chmod$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -493,7 +710,7 @@ static chmod ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -505,6 +722,11 @@ public static chmod chmod (MemorySegment segment, SegmentScope scope) { 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); @@ -515,7 +737,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, __x2, (java.lang.foreign.MemorySegment)__x3); + return (int)fuse3_operations.chown$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -527,10 +749,22 @@ static chown ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void chown$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -539,7 +773,7 @@ static chown ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -550,6 +784,11 @@ public static chown chown (MemorySegment segment, SegmentScope scope) { 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); @@ -560,7 +799,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.truncate$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -572,10 +811,22 @@ static truncate ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void truncate$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -584,7 +835,7 @@ static truncate ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -594,6 +845,11 @@ public static truncate truncate (MemorySegment segment, SegmentScope scope) { 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); @@ -604,7 +860,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.open$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -616,10 +872,22 @@ static open ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void open$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -628,7 +896,7 @@ static open ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -641,6 +909,11 @@ public static open open (MemorySegment segment, SegmentScope scope) { 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); @@ -651,7 +924,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); + return (int)fuse3_operations.read$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -663,10 +936,22 @@ static read ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void read$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -675,7 +960,7 @@ static read ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -688,6 +973,11 @@ public static read read (MemorySegment segment, SegmentScope scope) { 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); @@ -698,7 +988,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); + return (int)fuse3_operations.write$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -710,10 +1000,22 @@ static write ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void write$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -722,7 +1024,7 @@ static write ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -732,6 +1034,11 @@ public static write write (MemorySegment segment, SegmentScope scope) { 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); @@ -742,7 +1049,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.statfs$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -754,10 +1061,22 @@ static statfs ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void statfs$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -766,7 +1085,7 @@ static statfs ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -776,6 +1095,11 @@ public static statfs statfs (MemorySegment segment, SegmentScope scope) { 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); @@ -786,7 +1110,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.flush$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -798,10 +1122,22 @@ static flush ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void flush$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -810,7 +1146,7 @@ static flush ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -820,6 +1156,11 @@ public static flush flush (MemorySegment segment, SegmentScope scope) { 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); @@ -830,7 +1171,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.release$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -842,10 +1183,22 @@ static release ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void release$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -854,7 +1207,7 @@ static release ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -865,6 +1218,11 @@ public static release release (MemorySegment segment, SegmentScope scope) { 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); @@ -875,7 +1233,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.fsync$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -887,10 +1245,22 @@ static fsync ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void fsync$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -899,7 +1269,7 @@ static fsync ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -912,6 +1282,11 @@ public static fsync fsync (MemorySegment segment, SegmentScope scope) { 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); @@ -922,7 +1297,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, __x3, __x4); + return (int)fuse3_operations.setxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -934,10 +1309,22 @@ static setxattr ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void setxattr$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -946,7 +1333,7 @@ static setxattr ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -958,6 +1345,11 @@ public static setxattr setxattr (MemorySegment segment, SegmentScope scope) { 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); @@ -968,7 +1360,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, __x3); + return (int)fuse3_operations.getxattr$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -980,10 +1372,22 @@ static getxattr ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void getxattr$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -992,7 +1396,7 @@ static getxattr ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1003,6 +1407,11 @@ public static getxattr getxattr (MemorySegment segment, SegmentScope scope) { 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); @@ -1013,7 +1422,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); + return (int)fuse3_operations.listxattr$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1025,10 +1434,22 @@ static listxattr ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void listxattr$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1037,7 +1458,7 @@ static listxattr ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1047,6 +1468,11 @@ public static listxattr listxattr (MemorySegment segment, SegmentScope scope) { 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); @@ -1057,7 +1483,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.removexattr$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1069,10 +1495,22 @@ static removexattr ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void removexattr$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1081,7 +1519,7 @@ static removexattr ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1091,6 +1529,11 @@ public static removexattr removexattr (MemorySegment segment, SegmentScope scope 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); @@ -1101,7 +1544,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.opendir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1113,10 +1556,22 @@ static opendir ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void opendir$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1125,7 +1580,7 @@ static opendir ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1139,6 +1594,11 @@ public static opendir opendir (MemorySegment segment, SegmentScope scope) { 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); @@ -1149,7 +1609,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, __x3, (java.lang.foreign.MemorySegment)__x4, __x5); + 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$); } @@ -1161,10 +1621,22 @@ static readdir ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void readdir$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1173,7 +1645,7 @@ static readdir ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1183,6 +1655,11 @@ public static readdir readdir (MemorySegment segment, SegmentScope scope) { 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); @@ -1193,7 +1670,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (int)fuse3_operations.releasedir$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1205,10 +1682,22 @@ static releasedir ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void releasedir$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1217,7 +1706,7 @@ static releasedir ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1228,6 +1717,11 @@ public static releasedir releasedir (MemorySegment segment, SegmentScope scope) 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); @@ -1238,7 +1732,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.fsyncdir$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1250,10 +1744,22 @@ static fsyncdir ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void fsyncdir$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1262,7 +1768,7 @@ static fsyncdir ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1272,6 +1778,11 @@ public static fsyncdir fsyncdir (MemorySegment segment, SegmentScope scope) { 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); @@ -1282,7 +1793,7 @@ 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)(java.lang.foreign.MemorySegment)fuse3_operations.init$MH.invokeExact((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1); + return (java.lang.foreign.MemorySegment)fuse3_operations.init$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1294,10 +1805,22 @@ static init ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void init$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1306,7 +1829,7 @@ static init ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + public static init init(MemorySegment segment, SegmentScope scope) { return init.ofAddress(init$get(segment), scope); } static final FunctionDescriptor destroy$FUNC = FunctionDescriptor.ofVoid( @@ -1315,6 +1838,11 @@ public static init init (MemorySegment segment, SegmentScope scope) { 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); @@ -1325,7 +1853,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0); + fuse3_operations.destroy$MH.invokeExact(symbol, __x0); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1337,10 +1865,22 @@ static destroy ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void destroy$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1349,7 +1889,7 @@ static destroy ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1359,6 +1899,11 @@ public static destroy destroy (MemorySegment segment, SegmentScope scope) { 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); @@ -1369,7 +1914,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1); + return (int)fuse3_operations.access$MH.invokeExact(symbol, __x0, __x1); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1381,10 +1926,22 @@ static access ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void access$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1393,7 +1950,7 @@ static access ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1404,6 +1961,11 @@ public static access access (MemorySegment segment, SegmentScope scope) { 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); @@ -1414,7 +1976,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.create$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1426,10 +1988,22 @@ static create ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void create$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1438,7 +2012,7 @@ static create ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1450,6 +2024,11 @@ public static create create (MemorySegment segment, SegmentScope scope) { 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); @@ -1460,7 +2039,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, (java.lang.foreign.MemorySegment)__x3); + return (int)fuse3_operations.lock$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1472,10 +2051,22 @@ static lock ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void lock$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1484,7 +2075,7 @@ static lock ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1495,6 +2086,11 @@ public static lock lock (MemorySegment segment, SegmentScope scope) { 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); @@ -1505,7 +2101,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.utimens$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1517,10 +2113,22 @@ static utimens ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void utimens$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1529,7 +2137,7 @@ static utimens ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1540,6 +2148,11 @@ public static utimens utimens (MemorySegment segment, SegmentScope scope) { 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); @@ -1550,7 +2163,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2); + return (int)fuse3_operations.bmap$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1562,10 +2175,22 @@ static bmap ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void bmap$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1574,7 +2199,7 @@ static bmap ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1588,6 +2213,11 @@ public static bmap bmap (MemorySegment segment, SegmentScope scope) { 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); @@ -1598,7 +2228,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, (java.lang.foreign.MemorySegment)__x2, (java.lang.foreign.MemorySegment)__x3, __x4, (java.lang.foreign.MemorySegment)__x5); + 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$); } @@ -1610,10 +2240,22 @@ static ioctl ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void ioctl$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1622,7 +2264,7 @@ static ioctl ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1634,6 +2276,11 @@ public static ioctl ioctl (MemorySegment segment, SegmentScope scope) { 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); @@ -1644,7 +2291,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, (java.lang.foreign.MemorySegment)__x2, (java.lang.foreign.MemorySegment)__x3); + return (int)fuse3_operations.poll$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1656,10 +2303,22 @@ static poll ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void poll$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1668,7 +2327,7 @@ static poll ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1680,6 +2339,11 @@ public static poll poll (MemorySegment segment, SegmentScope scope) { 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); @@ -1690,7 +2354,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, (java.lang.foreign.MemorySegment)__x3); + return (int)fuse3_operations.write_buf$MH.invokeExact(symbol, __x0, __x1, __x2, __x3); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1702,10 +2366,22 @@ static write_buf ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void write_buf$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1714,7 +2390,7 @@ static write_buf ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1727,6 +2403,11 @@ public static write_buf write_buf (MemorySegment segment, SegmentScope scope) { 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); @@ -1737,7 +2418,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); + 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$); } @@ -1749,10 +2430,22 @@ static read_buf ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void read_buf$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1761,7 +2454,7 @@ static read_buf ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1772,6 +2465,11 @@ public static read_buf read_buf (MemorySegment segment, SegmentScope scope) { 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); @@ -1782,7 +2480,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, (java.lang.foreign.MemorySegment)__x1, __x2); + return (int)fuse3_operations.flock$MH.invokeExact(symbol, __x0, __x1, __x2); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1794,10 +2492,22 @@ static flock ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void flock$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1806,7 +2516,7 @@ static flock ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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, @@ -1819,6 +2529,11 @@ public static flock flock (MemorySegment segment, SegmentScope scope) { 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); @@ -1829,7 +2544,7 @@ 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((MemorySegment)symbol, (java.lang.foreign.MemorySegment)__x0, __x1, __x2, __x3, (java.lang.foreign.MemorySegment)__x4); + return (int)fuse3_operations.fallocate$MH.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -1841,10 +2556,22 @@ static fallocate ofAddress(MemorySegment addr, SegmentScope scope) { 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); } - public static void fallocate$set( MemorySegment seg, MemorySegment x) { + /** + * 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) { @@ -1853,12 +2580,12 @@ static fallocate ofAddress(MemorySegment addr, SegmentScope scope) { 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) { + 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(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_h.java index 95126eb9..f6118b92 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/fuse_h.java @@ -3,23 +3,29 @@ 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.*; public class fuse_h { - /* package-private */ fuse_h() {} - public static OfByte C_CHAR = Constants$root.C_CHAR$LAYOUT; - public static OfShort C_SHORT = Constants$root.C_SHORT$LAYOUT; - public static OfInt C_INT = Constants$root.C_LONG$LAYOUT; - public static OfInt C_LONG = Constants$root.C_LONG$LAYOUT; - public static OfLong C_LONG_LONG = Constants$root.C_LONG_LONG$LAYOUT; - public static OfFloat C_FLOAT = Constants$root.C_FLOAT$LAYOUT; - public static OfDouble C_DOUBLE = Constants$root.C_DOUBLE$LAYOUT; - public static OfAddress C_POINTER = Constants$root.C_POINTER$LAYOUT; + 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 MethodHandle fuse3_lib_help$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_lib_help$MH,"fuse3_lib_help"); } - public static void fuse3_lib_help ( MemorySegment args) { + /** + * {@snippet : + * void fuse3_lib_help(struct fuse_args* args); + * } + */ + public static void fuse3_lib_help(MemorySegment args) { var mh$ = fuse3_lib_help$MH(); try { mh$.invokeExact(args); @@ -30,7 +36,12 @@ public static void fuse3_lib_help ( MemorySegment args) { public static MethodHandle fuse3_new$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_new$MH,"fuse3_new"); } - public static MemorySegment fuse3_new ( MemorySegment args, MemorySegment ops, long opsize, MemorySegment data) { + /** + * {@snippet : + * struct fuse3* fuse3_new(struct fuse_args* args, struct fuse3_operations* ops, unsigned long long opsize, void* data); + * } + */ + public static MemorySegment fuse3_new(MemorySegment args, MemorySegment ops, long opsize, MemorySegment data) { var mh$ = fuse3_new$MH(); try { return (java.lang.foreign.MemorySegment)mh$.invokeExact(args, ops, opsize, data); @@ -41,7 +52,12 @@ public static MemorySegment fuse3_new ( MemorySegment args, MemorySegment ops, public static MethodHandle fuse3_destroy$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_destroy$MH,"fuse3_destroy"); } - public static void fuse3_destroy ( MemorySegment f) { + /** + * {@snippet : + * void fuse3_destroy(struct fuse3* f); + * } + */ + public static void fuse3_destroy(MemorySegment f) { var mh$ = fuse3_destroy$MH(); try { mh$.invokeExact(f); @@ -52,7 +68,12 @@ public static void fuse3_destroy ( MemorySegment f) { public static MethodHandle fuse3_mount$MH() { return RuntimeHelper.requireNonNull(constants$0.fuse3_mount$MH,"fuse3_mount"); } - public static int fuse3_mount ( MemorySegment f, MemorySegment mountpoint) { + /** + * {@snippet : + * int fuse3_mount(struct fuse3* f, char* mountpoint); + * } + */ + public static int fuse3_mount(MemorySegment f, MemorySegment mountpoint) { var mh$ = fuse3_mount$MH(); try { return (int)mh$.invokeExact(f, mountpoint); @@ -63,7 +84,12 @@ 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"); } - public static void fuse3_unmount ( MemorySegment f) { + /** + * {@snippet : + * void fuse3_unmount(struct fuse3* f); + * } + */ + public static void fuse3_unmount(MemorySegment f) { var mh$ = fuse3_unmount$MH(); try { mh$.invokeExact(f); @@ -74,7 +100,12 @@ public static void fuse3_unmount ( MemorySegment f) { public static MethodHandle fuse3_loop$MH() { return RuntimeHelper.requireNonNull(constants$1.fuse3_loop$MH,"fuse3_loop"); } - public static int fuse3_loop ( MemorySegment f) { + /** + * {@snippet : + * int fuse3_loop(struct fuse3* f); + * } + */ + public static int fuse3_loop(MemorySegment f) { var mh$ = fuse3_loop$MH(); try { return (int)mh$.invokeExact(f); @@ -82,13 +113,18 @@ public static int fuse3_loop ( MemorySegment f) { throw new AssertionError("should not reach here", ex$); } } - public static MethodHandle fuse3_loop_mt_31$MH() { - return RuntimeHelper.requireNonNull(constants$1.fuse3_loop_mt_31$MH,"fuse3_loop_mt_31"); + public static MethodHandle fuse3_loop_mt$MH() { + return RuntimeHelper.requireNonNull(constants$1.fuse3_loop_mt$MH,"fuse3_loop_mt"); } - public static int fuse3_loop_mt_31 ( MemorySegment f, int clone_fd) { - var mh$ = fuse3_loop_mt_31$MH(); + /** + * {@snippet : + * int fuse3_loop_mt(struct fuse3* f, struct fuse3_loop_config* config); + * } + */ + public static int fuse3_loop_mt(MemorySegment f, MemorySegment config) { + var mh$ = fuse3_loop_mt$MH(); try { - return (int)mh$.invokeExact(f, clone_fd); + return (int)mh$.invokeExact(f, config); } catch (Throwable ex$) { throw new AssertionError("should not reach here", ex$); } @@ -96,7 +132,12 @@ 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"); } - public static void fuse3_exit ( MemorySegment f) { + /** + * {@snippet : + * void fuse3_exit(struct fuse3* f); + * } + */ + public static void fuse3_exit(MemorySegment f) { var mh$ = fuse3_exit$MH(); try { mh$.invokeExact(f); @@ -107,7 +148,12 @@ 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"); } - public static MemorySegment fuse3_get_session ( MemorySegment f) { + /** + * {@snippet : + * struct fuse3_session* fuse3_get_session(struct fuse3* f); + * } + */ + public static MemorySegment fuse3_get_session(MemorySegment f) { var mh$ = fuse3_get_session$MH(); try { return (java.lang.foreign.MemorySegment)mh$.invokeExact(f); 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/fuse_stat.java index cf26b2ed..67d2fe8d 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/fuse_stat.java @@ -2,12 +2,34 @@ 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 fuse_stat { + * unsigned int st_dev; + * unsigned long long st_ino; + * unsigned int st_mode; + * unsigned short st_nlink; + * unsigned int st_uid; + * unsigned int st_gid; + * unsigned int st_rdev; + * long long st_size; + * struct fuse_timespec st_atim; + * struct fuse_timespec st_mtim; + * struct fuse_timespec st_ctim; + * int st_blksize; + * long long st_blocks; + * struct fuse_timespec st_birthtim; + * }; + * } + */ public class fuse_stat { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -46,10 +68,22 @@ public class fuse_stat { public static VarHandle st_dev$VH() { return fuse_stat.st_dev$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int st_dev; + * } + */ public static int st_dev$get(MemorySegment seg) { return (int)fuse_stat.st_dev$VH.get(seg); } - public static void st_dev$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int st_dev; + * } + */ + public static void st_dev$set(MemorySegment seg, int x) { fuse_stat.st_dev$VH.set(seg, x); } public static int st_dev$get(MemorySegment seg, long index) { @@ -62,10 +96,22 @@ public class fuse_stat { public static VarHandle st_ino$VH() { return fuse_stat.st_ino$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long st_ino; + * } + */ public static long st_ino$get(MemorySegment seg) { return (long)fuse_stat.st_ino$VH.get(seg); } - public static void st_ino$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long st_ino; + * } + */ + public static void st_ino$set(MemorySegment seg, long x) { fuse_stat.st_ino$VH.set(seg, x); } public static long st_ino$get(MemorySegment seg, long index) { @@ -78,10 +124,22 @@ public class fuse_stat { public static VarHandle st_mode$VH() { return fuse_stat.st_mode$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int st_mode; + * } + */ public static int st_mode$get(MemorySegment seg) { return (int)fuse_stat.st_mode$VH.get(seg); } - public static void st_mode$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int st_mode; + * } + */ + public static void st_mode$set(MemorySegment seg, int x) { fuse_stat.st_mode$VH.set(seg, x); } public static int st_mode$get(MemorySegment seg, long index) { @@ -94,10 +152,22 @@ public class fuse_stat { public static VarHandle st_nlink$VH() { return fuse_stat.st_nlink$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned short st_nlink; + * } + */ public static short st_nlink$get(MemorySegment seg) { return (short)fuse_stat.st_nlink$VH.get(seg); } - public static void st_nlink$set( MemorySegment seg, short x) { + /** + * Setter for field: + * {@snippet : + * unsigned short st_nlink; + * } + */ + public static void st_nlink$set(MemorySegment seg, short x) { fuse_stat.st_nlink$VH.set(seg, x); } public static short st_nlink$get(MemorySegment seg, long index) { @@ -110,10 +180,22 @@ public class fuse_stat { public static VarHandle st_uid$VH() { return fuse_stat.st_uid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int st_uid; + * } + */ public static int st_uid$get(MemorySegment seg) { return (int)fuse_stat.st_uid$VH.get(seg); } - public static void st_uid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int st_uid; + * } + */ + public static void st_uid$set(MemorySegment seg, int x) { fuse_stat.st_uid$VH.set(seg, x); } public static int st_uid$get(MemorySegment seg, long index) { @@ -126,10 +208,22 @@ public class fuse_stat { public static VarHandle st_gid$VH() { return fuse_stat.st_gid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int st_gid; + * } + */ public static int st_gid$get(MemorySegment seg) { return (int)fuse_stat.st_gid$VH.get(seg); } - public static void st_gid$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int st_gid; + * } + */ + public static void st_gid$set(MemorySegment seg, int x) { fuse_stat.st_gid$VH.set(seg, x); } public static int st_gid$get(MemorySegment seg, long index) { @@ -142,10 +236,22 @@ public class fuse_stat { public static VarHandle st_rdev$VH() { return fuse_stat.st_rdev$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned int st_rdev; + * } + */ public static int st_rdev$get(MemorySegment seg) { return (int)fuse_stat.st_rdev$VH.get(seg); } - public static void st_rdev$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * unsigned int st_rdev; + * } + */ + public static void st_rdev$set(MemorySegment seg, int x) { fuse_stat.st_rdev$VH.set(seg, x); } public static int st_rdev$get(MemorySegment seg, long index) { @@ -158,10 +264,22 @@ public class fuse_stat { public static VarHandle st_size$VH() { return fuse_stat.st_size$VH; } + /** + * Getter for field: + * {@snippet : + * long long st_size; + * } + */ public static long st_size$get(MemorySegment seg) { return (long)fuse_stat.st_size$VH.get(seg); } - public static void st_size$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * long long st_size; + * } + */ + public static void st_size$set(MemorySegment seg, long x) { fuse_stat.st_size$VH.set(seg, x); } public static long st_size$get(MemorySegment seg, long index) { @@ -183,10 +301,22 @@ public class fuse_stat { public static VarHandle st_blksize$VH() { return fuse_stat.st_blksize$VH; } + /** + * Getter for field: + * {@snippet : + * int st_blksize; + * } + */ public static int st_blksize$get(MemorySegment seg) { return (int)fuse_stat.st_blksize$VH.get(seg); } - public static void st_blksize$set( MemorySegment seg, int x) { + /** + * Setter for field: + * {@snippet : + * int st_blksize; + * } + */ + public static void st_blksize$set(MemorySegment seg, int x) { fuse_stat.st_blksize$VH.set(seg, x); } public static int st_blksize$get(MemorySegment seg, long index) { @@ -199,10 +329,22 @@ public class fuse_stat { public static VarHandle st_blocks$VH() { return fuse_stat.st_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * long long st_blocks; + * } + */ public static long st_blocks$get(MemorySegment seg) { return (long)fuse_stat.st_blocks$VH.get(seg); } - public static void st_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * long long st_blocks; + * } + */ + public static void st_blocks$set(MemorySegment seg, long x) { fuse_stat.st_blocks$VH.set(seg, x); } public static long st_blocks$get(MemorySegment seg, long index) { @@ -216,7 +358,7 @@ public class fuse_stat { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse_statvfs.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_statvfs.java index 6dd2dea1..e37abd45 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/fuse_statvfs.java @@ -2,12 +2,31 @@ 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 fuse_statvfs { + * unsigned long long f_bsize; + * unsigned long long f_frsize; + * unsigned long long f_blocks; + * unsigned long long f_bfree; + * unsigned long long f_bavail; + * unsigned long long f_files; + * unsigned long long f_ffree; + * unsigned long long f_favail; + * unsigned long long f_fsid; + * unsigned long long f_flag; + * unsigned long long f_namemax; + * }; + * } + */ public class fuse_statvfs { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"), @@ -27,10 +46,22 @@ public class fuse_statvfs { public static VarHandle f_bsize$VH() { return fuse_statvfs.f_bsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_bsize; + * } + */ public static long f_bsize$get(MemorySegment seg) { return (long)fuse_statvfs.f_bsize$VH.get(seg); } - public static void f_bsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_bsize; + * } + */ + public static void f_bsize$set(MemorySegment seg, long x) { fuse_statvfs.f_bsize$VH.set(seg, x); } public static long f_bsize$get(MemorySegment seg, long index) { @@ -43,10 +74,22 @@ public class fuse_statvfs { public static VarHandle f_frsize$VH() { return fuse_statvfs.f_frsize$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_frsize; + * } + */ public static long f_frsize$get(MemorySegment seg) { return (long)fuse_statvfs.f_frsize$VH.get(seg); } - public static void f_frsize$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_frsize; + * } + */ + public static void f_frsize$set(MemorySegment seg, long x) { fuse_statvfs.f_frsize$VH.set(seg, x); } public static long f_frsize$get(MemorySegment seg, long index) { @@ -59,10 +102,22 @@ public class fuse_statvfs { public static VarHandle f_blocks$VH() { return fuse_statvfs.f_blocks$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_blocks; + * } + */ public static long f_blocks$get(MemorySegment seg) { return (long)fuse_statvfs.f_blocks$VH.get(seg); } - public static void f_blocks$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_blocks; + * } + */ + public static void f_blocks$set(MemorySegment seg, long x) { fuse_statvfs.f_blocks$VH.set(seg, x); } public static long f_blocks$get(MemorySegment seg, long index) { @@ -75,10 +130,22 @@ public class fuse_statvfs { public static VarHandle f_bfree$VH() { return fuse_statvfs.f_bfree$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_bfree; + * } + */ public static long f_bfree$get(MemorySegment seg) { return (long)fuse_statvfs.f_bfree$VH.get(seg); } - public static void f_bfree$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_bfree; + * } + */ + public static void f_bfree$set(MemorySegment seg, long x) { fuse_statvfs.f_bfree$VH.set(seg, x); } public static long f_bfree$get(MemorySegment seg, long index) { @@ -91,10 +158,22 @@ public class fuse_statvfs { public static VarHandle f_bavail$VH() { return fuse_statvfs.f_bavail$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_bavail; + * } + */ public static long f_bavail$get(MemorySegment seg) { return (long)fuse_statvfs.f_bavail$VH.get(seg); } - public static void f_bavail$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_bavail; + * } + */ + public static void f_bavail$set(MemorySegment seg, long x) { fuse_statvfs.f_bavail$VH.set(seg, x); } public static long f_bavail$get(MemorySegment seg, long index) { @@ -107,10 +186,22 @@ public class fuse_statvfs { public static VarHandle f_files$VH() { return fuse_statvfs.f_files$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_files; + * } + */ public static long f_files$get(MemorySegment seg) { return (long)fuse_statvfs.f_files$VH.get(seg); } - public static void f_files$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_files; + * } + */ + public static void f_files$set(MemorySegment seg, long x) { fuse_statvfs.f_files$VH.set(seg, x); } public static long f_files$get(MemorySegment seg, long index) { @@ -123,10 +214,22 @@ public class fuse_statvfs { public static VarHandle f_ffree$VH() { return fuse_statvfs.f_ffree$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_ffree; + * } + */ public static long f_ffree$get(MemorySegment seg) { return (long)fuse_statvfs.f_ffree$VH.get(seg); } - public static void f_ffree$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_ffree; + * } + */ + public static void f_ffree$set(MemorySegment seg, long x) { fuse_statvfs.f_ffree$VH.set(seg, x); } public static long f_ffree$get(MemorySegment seg, long index) { @@ -139,10 +242,22 @@ public class fuse_statvfs { public static VarHandle f_favail$VH() { return fuse_statvfs.f_favail$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_favail; + * } + */ public static long f_favail$get(MemorySegment seg) { return (long)fuse_statvfs.f_favail$VH.get(seg); } - public static void f_favail$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_favail; + * } + */ + public static void f_favail$set(MemorySegment seg, long x) { fuse_statvfs.f_favail$VH.set(seg, x); } public static long f_favail$get(MemorySegment seg, long index) { @@ -155,10 +270,22 @@ public class fuse_statvfs { public static VarHandle f_fsid$VH() { return fuse_statvfs.f_fsid$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_fsid; + * } + */ public static long f_fsid$get(MemorySegment seg) { return (long)fuse_statvfs.f_fsid$VH.get(seg); } - public static void f_fsid$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_fsid; + * } + */ + public static void f_fsid$set(MemorySegment seg, long x) { fuse_statvfs.f_fsid$VH.set(seg, x); } public static long f_fsid$get(MemorySegment seg, long index) { @@ -171,10 +298,22 @@ public class fuse_statvfs { public static VarHandle f_flag$VH() { return fuse_statvfs.f_flag$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_flag; + * } + */ public static long f_flag$get(MemorySegment seg) { return (long)fuse_statvfs.f_flag$VH.get(seg); } - public static void f_flag$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_flag; + * } + */ + public static void f_flag$set(MemorySegment seg, long x) { fuse_statvfs.f_flag$VH.set(seg, x); } public static long f_flag$get(MemorySegment seg, long index) { @@ -187,10 +326,22 @@ public class fuse_statvfs { public static VarHandle f_namemax$VH() { return fuse_statvfs.f_namemax$VH; } + /** + * Getter for field: + * {@snippet : + * unsigned long long f_namemax; + * } + */ public static long f_namemax$get(MemorySegment seg) { return (long)fuse_statvfs.f_namemax$VH.get(seg); } - public static void f_namemax$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * unsigned long long f_namemax; + * } + */ + public static void f_namemax$set(MemorySegment seg, long x) { fuse_statvfs.f_namemax$VH.set(seg, x); } public static long f_namemax$get(MemorySegment seg, long index) { @@ -201,7 +352,7 @@ public class fuse_statvfs { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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/main/java/org/cryptomator/jfuse/win/extr/fuse_timespec.java b/jfuse-win/src/main/java/org/cryptomator/jfuse/win/extr/fuse_timespec.java index f5d33801..2b45632a 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/fuse_timespec.java @@ -2,12 +2,22 @@ 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 fuse_timespec { + * long long tv_sec; + * long long tv_nsec; + * }; + * } + */ public class fuse_timespec { - static final GroupLayout $struct$LAYOUT = MemoryLayout.structLayout( + 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"); @@ -18,10 +28,22 @@ public class fuse_timespec { public static VarHandle tv_sec$VH() { return fuse_timespec.tv_sec$VH; } + /** + * Getter for field: + * {@snippet : + * long long tv_sec; + * } + */ public static long tv_sec$get(MemorySegment seg) { return (long)fuse_timespec.tv_sec$VH.get(seg); } - public static void tv_sec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * long long tv_sec; + * } + */ + public static void tv_sec$set(MemorySegment seg, long x) { fuse_timespec.tv_sec$VH.set(seg, x); } public static long tv_sec$get(MemorySegment seg, long index) { @@ -34,10 +56,22 @@ public class fuse_timespec { public static VarHandle tv_nsec$VH() { return fuse_timespec.tv_nsec$VH; } + /** + * Getter for field: + * {@snippet : + * long long tv_nsec; + * } + */ public static long tv_nsec$get(MemorySegment seg) { return (long)fuse_timespec.tv_nsec$VH.get(seg); } - public static void tv_nsec$set( MemorySegment seg, long x) { + /** + * Setter for field: + * {@snippet : + * long long tv_nsec; + * } + */ + public static void tv_nsec$set(MemorySegment seg, long x) { fuse_timespec.tv_nsec$VH.set(seg, x); } public static long tv_nsec$get(MemorySegment seg, long index) { @@ -48,7 +82,7 @@ public class fuse_timespec { } public static long sizeof() { return $LAYOUT().byteSize(); } public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); } - public static MemorySegment allocateArray(int len, SegmentAllocator allocator) { + 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); } From d36fd20cee6c286baf6822b95119791210174cd8 Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Thu, 23 Mar 2023 17:19:01 +0100 Subject: [PATCH 4/9] adjust IDE files --- .idea/runConfigurations/HelloWorldFileSystem.xml | 1 - .idea/runConfigurations/HelloWorldFileSystem__Windows_.xml | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.idea/runConfigurations/HelloWorldFileSystem.xml b/.idea/runConfigurations/HelloWorldFileSystem.xml index 97229a05..0f644ec8 100644 --- a/.idea/runConfigurations/HelloWorldFileSystem.xml +++ b/.idea/runConfigurations/HelloWorldFileSystem.xml @@ -1,6 +1,5 @@ -