All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.purejava.appindicator._GVfsClass Maven / Gradle / Ivy

// Generated by jextract

package org.purejava.appindicator;

import java.lang.invoke.*;
import java.lang.foreign.*;
import java.nio.ByteOrder;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;

import static java.lang.foreign.ValueLayout.*;
import static java.lang.foreign.MemoryLayout.PathElement.*;

/**
 * {@snippet lang=c :
 * struct _GVfsClass {
 *     GObjectClass parent_class;
 *     gboolean (*is_active)(GVfs *);
 *     GFile *(*get_file_for_path)(GVfs *, const char *);
 *     GFile *(*get_file_for_uri)(GVfs *, const char *);
 *     const gchar *const *(*get_supported_uri_schemes)(GVfs *);
 *     GFile *(*parse_name)(GVfs *, const char *);
 *     void (*local_file_add_info)(GVfs *, const char *, guint64, GFileAttributeMatcher *, GFileInfo *, GCancellable *, gpointer *, GDestroyNotify *);
 *     void (*add_writable_namespaces)(GVfs *, GFileAttributeInfoList *);
 *     gboolean (*local_file_set_attributes)(GVfs *, const char *, GFileInfo *, GFileQueryInfoFlags, GCancellable *, GError **);
 *     void (*local_file_removed)(GVfs *, const char *);
 *     void (*local_file_moved)(GVfs *, const char *, const char *);
 *     GIcon *(*deserialize_icon)(GVfs *, GVariant *);
 *     void (*_g_reserved1)(void);
 *     void (*_g_reserved2)(void);
 *     void (*_g_reserved3)(void);
 *     void (*_g_reserved4)(void);
 *     void (*_g_reserved5)(void);
 *     void (*_g_reserved6)(void);
 * }
 * }
 */
public class _GVfsClass {

    _GVfsClass() {
        // Should not be called directly
    }

    private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
        _GObjectClass.layout().withName("parent_class"),
        app_indicator_h.C_POINTER.withName("is_active"),
        app_indicator_h.C_POINTER.withName("get_file_for_path"),
        app_indicator_h.C_POINTER.withName("get_file_for_uri"),
        app_indicator_h.C_POINTER.withName("get_supported_uri_schemes"),
        app_indicator_h.C_POINTER.withName("parse_name"),
        app_indicator_h.C_POINTER.withName("local_file_add_info"),
        app_indicator_h.C_POINTER.withName("add_writable_namespaces"),
        app_indicator_h.C_POINTER.withName("local_file_set_attributes"),
        app_indicator_h.C_POINTER.withName("local_file_removed"),
        app_indicator_h.C_POINTER.withName("local_file_moved"),
        app_indicator_h.C_POINTER.withName("deserialize_icon"),
        app_indicator_h.C_POINTER.withName("_g_reserved1"),
        app_indicator_h.C_POINTER.withName("_g_reserved2"),
        app_indicator_h.C_POINTER.withName("_g_reserved3"),
        app_indicator_h.C_POINTER.withName("_g_reserved4"),
        app_indicator_h.C_POINTER.withName("_g_reserved5"),
        app_indicator_h.C_POINTER.withName("_g_reserved6")
    ).withName("_GVfsClass");

    /**
     * The layout of this struct
     */
    public static final GroupLayout layout() {
        return $LAYOUT;
    }

    private static final GroupLayout parent_class$LAYOUT = (GroupLayout)$LAYOUT.select(groupElement("parent_class"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GObjectClass parent_class
     * }
     */
    public static final GroupLayout parent_class$layout() {
        return parent_class$LAYOUT;
    }

    private static final long parent_class$OFFSET = 0;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GObjectClass parent_class
     * }
     */
    public static final long parent_class$offset() {
        return parent_class$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GObjectClass parent_class
     * }
     */
    public static MemorySegment parent_class(MemorySegment struct) {
        return struct.asSlice(parent_class$OFFSET, parent_class$LAYOUT.byteSize());
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GObjectClass parent_class
     * }
     */
    public static void parent_class(MemorySegment struct, MemorySegment fieldValue) {
        MemorySegment.copy(fieldValue, 0L, struct, parent_class$OFFSET, parent_class$LAYOUT.byteSize());
    }

    /**
     * {@snippet lang=c :
     * gboolean (*is_active)(GVfs *)
     * }
     */
    public class is_active {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            int apply(MemorySegment _x0);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_INT,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(is_active.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(is_active.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static int invoke(MemorySegment funcPtr,MemorySegment _x0) {
            try {
                return (int) DOWN$MH.invokeExact(funcPtr, _x0);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout is_active$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("is_active"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * gboolean (*is_active)(GVfs *)
     * }
     */
    public static final AddressLayout is_active$layout() {
        return is_active$LAYOUT;
    }

    private static final long is_active$OFFSET = 136;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * gboolean (*is_active)(GVfs *)
     * }
     */
    public static final long is_active$offset() {
        return is_active$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * gboolean (*is_active)(GVfs *)
     * }
     */
    public static MemorySegment is_active(MemorySegment struct) {
        return struct.get(is_active$LAYOUT, is_active$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * gboolean (*is_active)(GVfs *)
     * }
     */
    public static void is_active(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(is_active$LAYOUT, is_active$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * GFile *(*get_file_for_path)(GVfs *, const char *)
     * }
     */
    public class get_file_for_path {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_file_for_path.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_file_for_path.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_file_for_path$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_file_for_path"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_path)(GVfs *, const char *)
     * }
     */
    public static final AddressLayout get_file_for_path$layout() {
        return get_file_for_path$LAYOUT;
    }

    private static final long get_file_for_path$OFFSET = 144;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_path)(GVfs *, const char *)
     * }
     */
    public static final long get_file_for_path$offset() {
        return get_file_for_path$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_path)(GVfs *, const char *)
     * }
     */
    public static MemorySegment get_file_for_path(MemorySegment struct) {
        return struct.get(get_file_for_path$LAYOUT, get_file_for_path$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_path)(GVfs *, const char *)
     * }
     */
    public static void get_file_for_path(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_file_for_path$LAYOUT, get_file_for_path$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * GFile *(*get_file_for_uri)(GVfs *, const char *)
     * }
     */
    public class get_file_for_uri {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_file_for_uri.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_file_for_uri.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_file_for_uri$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_file_for_uri"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_uri)(GVfs *, const char *)
     * }
     */
    public static final AddressLayout get_file_for_uri$layout() {
        return get_file_for_uri$LAYOUT;
    }

    private static final long get_file_for_uri$OFFSET = 152;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_uri)(GVfs *, const char *)
     * }
     */
    public static final long get_file_for_uri$offset() {
        return get_file_for_uri$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_uri)(GVfs *, const char *)
     * }
     */
    public static MemorySegment get_file_for_uri(MemorySegment struct) {
        return struct.get(get_file_for_uri$LAYOUT, get_file_for_uri$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GFile *(*get_file_for_uri)(GVfs *, const char *)
     * }
     */
    public static void get_file_for_uri(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_file_for_uri$LAYOUT, get_file_for_uri$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * const gchar *const *(*get_supported_uri_schemes)(GVfs *)
     * }
     */
    public class get_supported_uri_schemes {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(get_supported_uri_schemes.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(get_supported_uri_schemes.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout get_supported_uri_schemes$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("get_supported_uri_schemes"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * const gchar *const *(*get_supported_uri_schemes)(GVfs *)
     * }
     */
    public static final AddressLayout get_supported_uri_schemes$layout() {
        return get_supported_uri_schemes$LAYOUT;
    }

    private static final long get_supported_uri_schemes$OFFSET = 160;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * const gchar *const *(*get_supported_uri_schemes)(GVfs *)
     * }
     */
    public static final long get_supported_uri_schemes$offset() {
        return get_supported_uri_schemes$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * const gchar *const *(*get_supported_uri_schemes)(GVfs *)
     * }
     */
    public static MemorySegment get_supported_uri_schemes(MemorySegment struct) {
        return struct.get(get_supported_uri_schemes$LAYOUT, get_supported_uri_schemes$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * const gchar *const *(*get_supported_uri_schemes)(GVfs *)
     * }
     */
    public static void get_supported_uri_schemes(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(get_supported_uri_schemes$LAYOUT, get_supported_uri_schemes$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * GFile *(*parse_name)(GVfs *, const char *)
     * }
     */
    public class parse_name {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(parse_name.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(parse_name.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout parse_name$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("parse_name"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GFile *(*parse_name)(GVfs *, const char *)
     * }
     */
    public static final AddressLayout parse_name$layout() {
        return parse_name$LAYOUT;
    }

    private static final long parse_name$OFFSET = 168;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GFile *(*parse_name)(GVfs *, const char *)
     * }
     */
    public static final long parse_name$offset() {
        return parse_name$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GFile *(*parse_name)(GVfs *, const char *)
     * }
     */
    public static MemorySegment parse_name(MemorySegment struct) {
        return struct.get(parse_name$LAYOUT, parse_name$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GFile *(*parse_name)(GVfs *, const char *)
     * }
     */
    public static void parse_name(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(parse_name$LAYOUT, parse_name$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*local_file_add_info)(GVfs *, const char *, guint64, GFileAttributeMatcher *, GFileInfo *, GCancellable *, gpointer *, GDestroyNotify *)
     * }
     */
    public class local_file_add_info {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1, long _x2, MemorySegment _x3, MemorySegment _x4, MemorySegment _x5, MemorySegment _x6, MemorySegment _x7);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_LONG,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(local_file_add_info.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(local_file_add_info.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, long _x2, MemorySegment _x3, MemorySegment _x4, MemorySegment _x5, MemorySegment _x6, MemorySegment _x7) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2, _x3, _x4, _x5, _x6, _x7);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout local_file_add_info$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("local_file_add_info"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*local_file_add_info)(GVfs *, const char *, guint64, GFileAttributeMatcher *, GFileInfo *, GCancellable *, gpointer *, GDestroyNotify *)
     * }
     */
    public static final AddressLayout local_file_add_info$layout() {
        return local_file_add_info$LAYOUT;
    }

    private static final long local_file_add_info$OFFSET = 176;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*local_file_add_info)(GVfs *, const char *, guint64, GFileAttributeMatcher *, GFileInfo *, GCancellable *, gpointer *, GDestroyNotify *)
     * }
     */
    public static final long local_file_add_info$offset() {
        return local_file_add_info$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*local_file_add_info)(GVfs *, const char *, guint64, GFileAttributeMatcher *, GFileInfo *, GCancellable *, gpointer *, GDestroyNotify *)
     * }
     */
    public static MemorySegment local_file_add_info(MemorySegment struct) {
        return struct.get(local_file_add_info$LAYOUT, local_file_add_info$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*local_file_add_info)(GVfs *, const char *, guint64, GFileAttributeMatcher *, GFileInfo *, GCancellable *, gpointer *, GDestroyNotify *)
     * }
     */
    public static void local_file_add_info(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(local_file_add_info$LAYOUT, local_file_add_info$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*add_writable_namespaces)(GVfs *, GFileAttributeInfoList *)
     * }
     */
    public class add_writable_namespaces {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(add_writable_namespaces.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(add_writable_namespaces.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout add_writable_namespaces$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("add_writable_namespaces"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*add_writable_namespaces)(GVfs *, GFileAttributeInfoList *)
     * }
     */
    public static final AddressLayout add_writable_namespaces$layout() {
        return add_writable_namespaces$LAYOUT;
    }

    private static final long add_writable_namespaces$OFFSET = 184;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*add_writable_namespaces)(GVfs *, GFileAttributeInfoList *)
     * }
     */
    public static final long add_writable_namespaces$offset() {
        return add_writable_namespaces$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*add_writable_namespaces)(GVfs *, GFileAttributeInfoList *)
     * }
     */
    public static MemorySegment add_writable_namespaces(MemorySegment struct) {
        return struct.get(add_writable_namespaces$LAYOUT, add_writable_namespaces$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*add_writable_namespaces)(GVfs *, GFileAttributeInfoList *)
     * }
     */
    public static void add_writable_namespaces(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(add_writable_namespaces$LAYOUT, add_writable_namespaces$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * gboolean (*local_file_set_attributes)(GVfs *, const char *, GFileInfo *, GFileQueryInfoFlags, GCancellable *, GError **)
     * }
     */
    public class local_file_set_attributes {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            int apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2, int _x3, MemorySegment _x4, MemorySegment _x5);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_INT,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_INT,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(local_file_set_attributes.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(local_file_set_attributes.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static int invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, MemorySegment _x2, int _x3, MemorySegment _x4, MemorySegment _x5) {
            try {
                return (int) DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2, _x3, _x4, _x5);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout local_file_set_attributes$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("local_file_set_attributes"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * gboolean (*local_file_set_attributes)(GVfs *, const char *, GFileInfo *, GFileQueryInfoFlags, GCancellable *, GError **)
     * }
     */
    public static final AddressLayout local_file_set_attributes$layout() {
        return local_file_set_attributes$LAYOUT;
    }

    private static final long local_file_set_attributes$OFFSET = 192;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * gboolean (*local_file_set_attributes)(GVfs *, const char *, GFileInfo *, GFileQueryInfoFlags, GCancellable *, GError **)
     * }
     */
    public static final long local_file_set_attributes$offset() {
        return local_file_set_attributes$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * gboolean (*local_file_set_attributes)(GVfs *, const char *, GFileInfo *, GFileQueryInfoFlags, GCancellable *, GError **)
     * }
     */
    public static MemorySegment local_file_set_attributes(MemorySegment struct) {
        return struct.get(local_file_set_attributes$LAYOUT, local_file_set_attributes$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * gboolean (*local_file_set_attributes)(GVfs *, const char *, GFileInfo *, GFileQueryInfoFlags, GCancellable *, GError **)
     * }
     */
    public static void local_file_set_attributes(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(local_file_set_attributes$LAYOUT, local_file_set_attributes$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*local_file_removed)(GVfs *, const char *)
     * }
     */
    public class local_file_removed {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(local_file_removed.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(local_file_removed.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout local_file_removed$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("local_file_removed"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*local_file_removed)(GVfs *, const char *)
     * }
     */
    public static final AddressLayout local_file_removed$layout() {
        return local_file_removed$LAYOUT;
    }

    private static final long local_file_removed$OFFSET = 200;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*local_file_removed)(GVfs *, const char *)
     * }
     */
    public static final long local_file_removed$offset() {
        return local_file_removed$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*local_file_removed)(GVfs *, const char *)
     * }
     */
    public static MemorySegment local_file_removed(MemorySegment struct) {
        return struct.get(local_file_removed$LAYOUT, local_file_removed$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*local_file_removed)(GVfs *, const char *)
     * }
     */
    public static void local_file_removed(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(local_file_removed$LAYOUT, local_file_removed$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*local_file_moved)(GVfs *, const char *, const char *)
     * }
     */
    public class local_file_moved {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply(MemorySegment _x0, MemorySegment _x1, MemorySegment _x2);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(local_file_moved.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(local_file_moved.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1, MemorySegment _x2) {
            try {
                 DOWN$MH.invokeExact(funcPtr, _x0, _x1, _x2);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout local_file_moved$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("local_file_moved"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*local_file_moved)(GVfs *, const char *, const char *)
     * }
     */
    public static final AddressLayout local_file_moved$layout() {
        return local_file_moved$LAYOUT;
    }

    private static final long local_file_moved$OFFSET = 208;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*local_file_moved)(GVfs *, const char *, const char *)
     * }
     */
    public static final long local_file_moved$offset() {
        return local_file_moved$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*local_file_moved)(GVfs *, const char *, const char *)
     * }
     */
    public static MemorySegment local_file_moved(MemorySegment struct) {
        return struct.get(local_file_moved$LAYOUT, local_file_moved$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*local_file_moved)(GVfs *, const char *, const char *)
     * }
     */
    public static void local_file_moved(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(local_file_moved$LAYOUT, local_file_moved$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * GIcon *(*deserialize_icon)(GVfs *, GVariant *)
     * }
     */
    public class deserialize_icon {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            MemorySegment apply(MemorySegment _x0, MemorySegment _x1);
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.of(
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER,
            app_indicator_h.C_POINTER
        );

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(deserialize_icon.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(deserialize_icon.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static MemorySegment invoke(MemorySegment funcPtr,MemorySegment _x0, MemorySegment _x1) {
            try {
                return (MemorySegment) DOWN$MH.invokeExact(funcPtr, _x0, _x1);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout deserialize_icon$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("deserialize_icon"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * GIcon *(*deserialize_icon)(GVfs *, GVariant *)
     * }
     */
    public static final AddressLayout deserialize_icon$layout() {
        return deserialize_icon$LAYOUT;
    }

    private static final long deserialize_icon$OFFSET = 216;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * GIcon *(*deserialize_icon)(GVfs *, GVariant *)
     * }
     */
    public static final long deserialize_icon$offset() {
        return deserialize_icon$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * GIcon *(*deserialize_icon)(GVfs *, GVariant *)
     * }
     */
    public static MemorySegment deserialize_icon(MemorySegment struct) {
        return struct.get(deserialize_icon$LAYOUT, deserialize_icon$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * GIcon *(*deserialize_icon)(GVfs *, GVariant *)
     * }
     */
    public static void deserialize_icon(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(deserialize_icon$LAYOUT, deserialize_icon$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*_g_reserved1)(void)
     * }
     */
    public class _g_reserved1 {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply();
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_g_reserved1.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(_g_reserved1.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr) {
            try {
                 DOWN$MH.invokeExact(funcPtr);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout _g_reserved1$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_g_reserved1"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*_g_reserved1)(void)
     * }
     */
    public static final AddressLayout _g_reserved1$layout() {
        return _g_reserved1$LAYOUT;
    }

    private static final long _g_reserved1$OFFSET = 224;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*_g_reserved1)(void)
     * }
     */
    public static final long _g_reserved1$offset() {
        return _g_reserved1$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*_g_reserved1)(void)
     * }
     */
    public static MemorySegment _g_reserved1(MemorySegment struct) {
        return struct.get(_g_reserved1$LAYOUT, _g_reserved1$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*_g_reserved1)(void)
     * }
     */
    public static void _g_reserved1(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(_g_reserved1$LAYOUT, _g_reserved1$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*_g_reserved2)(void)
     * }
     */
    public class _g_reserved2 {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply();
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_g_reserved2.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(_g_reserved2.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr) {
            try {
                 DOWN$MH.invokeExact(funcPtr);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout _g_reserved2$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_g_reserved2"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*_g_reserved2)(void)
     * }
     */
    public static final AddressLayout _g_reserved2$layout() {
        return _g_reserved2$LAYOUT;
    }

    private static final long _g_reserved2$OFFSET = 232;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*_g_reserved2)(void)
     * }
     */
    public static final long _g_reserved2$offset() {
        return _g_reserved2$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*_g_reserved2)(void)
     * }
     */
    public static MemorySegment _g_reserved2(MemorySegment struct) {
        return struct.get(_g_reserved2$LAYOUT, _g_reserved2$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*_g_reserved2)(void)
     * }
     */
    public static void _g_reserved2(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(_g_reserved2$LAYOUT, _g_reserved2$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*_g_reserved3)(void)
     * }
     */
    public class _g_reserved3 {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply();
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_g_reserved3.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(_g_reserved3.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr) {
            try {
                 DOWN$MH.invokeExact(funcPtr);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout _g_reserved3$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_g_reserved3"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*_g_reserved3)(void)
     * }
     */
    public static final AddressLayout _g_reserved3$layout() {
        return _g_reserved3$LAYOUT;
    }

    private static final long _g_reserved3$OFFSET = 240;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*_g_reserved3)(void)
     * }
     */
    public static final long _g_reserved3$offset() {
        return _g_reserved3$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*_g_reserved3)(void)
     * }
     */
    public static MemorySegment _g_reserved3(MemorySegment struct) {
        return struct.get(_g_reserved3$LAYOUT, _g_reserved3$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*_g_reserved3)(void)
     * }
     */
    public static void _g_reserved3(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(_g_reserved3$LAYOUT, _g_reserved3$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*_g_reserved4)(void)
     * }
     */
    public class _g_reserved4 {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply();
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_g_reserved4.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(_g_reserved4.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr) {
            try {
                 DOWN$MH.invokeExact(funcPtr);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout _g_reserved4$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_g_reserved4"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*_g_reserved4)(void)
     * }
     */
    public static final AddressLayout _g_reserved4$layout() {
        return _g_reserved4$LAYOUT;
    }

    private static final long _g_reserved4$OFFSET = 248;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*_g_reserved4)(void)
     * }
     */
    public static final long _g_reserved4$offset() {
        return _g_reserved4$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*_g_reserved4)(void)
     * }
     */
    public static MemorySegment _g_reserved4(MemorySegment struct) {
        return struct.get(_g_reserved4$LAYOUT, _g_reserved4$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*_g_reserved4)(void)
     * }
     */
    public static void _g_reserved4(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(_g_reserved4$LAYOUT, _g_reserved4$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*_g_reserved5)(void)
     * }
     */
    public class _g_reserved5 {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply();
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_g_reserved5.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(_g_reserved5.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr) {
            try {
                 DOWN$MH.invokeExact(funcPtr);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout _g_reserved5$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_g_reserved5"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*_g_reserved5)(void)
     * }
     */
    public static final AddressLayout _g_reserved5$layout() {
        return _g_reserved5$LAYOUT;
    }

    private static final long _g_reserved5$OFFSET = 256;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*_g_reserved5)(void)
     * }
     */
    public static final long _g_reserved5$offset() {
        return _g_reserved5$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*_g_reserved5)(void)
     * }
     */
    public static MemorySegment _g_reserved5(MemorySegment struct) {
        return struct.get(_g_reserved5$LAYOUT, _g_reserved5$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*_g_reserved5)(void)
     * }
     */
    public static void _g_reserved5(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(_g_reserved5$LAYOUT, _g_reserved5$OFFSET, fieldValue);
    }

    /**
     * {@snippet lang=c :
     * void (*_g_reserved6)(void)
     * }
     */
    public class _g_reserved6 {

        /**
         * The function pointer signature, expressed as a functional interface
         */
        public interface Function {
            void apply();
        }

        private static final FunctionDescriptor $DESC = FunctionDescriptor.ofVoid();

        /**
         * The descriptor of this function pointer
         */
        public static FunctionDescriptor descriptor() {
            return $DESC;
        }

        private static final MethodHandle UP$MH = app_indicator_h.upcallHandle(_g_reserved6.Function.class, "apply", $DESC);

        /**
         * Allocates a new upcall stub, whose implementation is defined by {@code fi}.
         * The lifetime of the returned segment is managed by {@code arena}
         */
        public static MemorySegment allocate(_g_reserved6.Function fi, Arena arena) {
            return Linker.nativeLinker().upcallStub(UP$MH.bindTo(fi), $DESC, arena);
        }

        private static final MethodHandle DOWN$MH = Linker.nativeLinker().downcallHandle($DESC);

        /**
         * Invoke the upcall stub {@code funcPtr}, with given parameters
         */
        public static void invoke(MemorySegment funcPtr) {
            try {
                 DOWN$MH.invokeExact(funcPtr);
            } catch (Throwable ex$) {
                throw new AssertionError("should not reach here", ex$);
            }
        }
    }

    private static final AddressLayout _g_reserved6$LAYOUT = (AddressLayout)$LAYOUT.select(groupElement("_g_reserved6"));

    /**
     * Layout for field:
     * {@snippet lang=c :
     * void (*_g_reserved6)(void)
     * }
     */
    public static final AddressLayout _g_reserved6$layout() {
        return _g_reserved6$LAYOUT;
    }

    private static final long _g_reserved6$OFFSET = 264;

    /**
     * Offset for field:
     * {@snippet lang=c :
     * void (*_g_reserved6)(void)
     * }
     */
    public static final long _g_reserved6$offset() {
        return _g_reserved6$OFFSET;
    }

    /**
     * Getter for field:
     * {@snippet lang=c :
     * void (*_g_reserved6)(void)
     * }
     */
    public static MemorySegment _g_reserved6(MemorySegment struct) {
        return struct.get(_g_reserved6$LAYOUT, _g_reserved6$OFFSET);
    }

    /**
     * Setter for field:
     * {@snippet lang=c :
     * void (*_g_reserved6)(void)
     * }
     */
    public static void _g_reserved6(MemorySegment struct, MemorySegment fieldValue) {
        struct.set(_g_reserved6$LAYOUT, _g_reserved6$OFFSET, fieldValue);
    }

    /**
     * Obtains a slice of {@code arrayParam} which selects the array element at {@code index}.
     * The returned segment has address {@code arrayParam.address() + index * layout().byteSize()}
     */
    public static MemorySegment asSlice(MemorySegment array, long index) {
        return array.asSlice(layout().byteSize() * index);
    }

    /**
     * The size (in bytes) of this struct
     */
    public static long sizeof() { return layout().byteSize(); }

    /**
     * Allocate a segment of size {@code layout().byteSize()} using {@code allocator}
     */
    public static MemorySegment allocate(SegmentAllocator allocator) {
        return allocator.allocate(layout());
    }

    /**
     * Allocate an array of size {@code elementCount} using {@code allocator}.
     * The returned segment has size {@code elementCount * layout().byteSize()}.
     */
    public static MemorySegment allocateArray(long elementCount, SegmentAllocator allocator) {
        return allocator.allocate(MemoryLayout.sequenceLayout(elementCount, layout()));
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction) (if any).
     * The returned segment has size {@code layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer cleanup) {
        return reinterpret(addr, 1, arena, cleanup);
    }

    /**
     * Reinterprets {@code addr} using target {@code arena} and {@code cleanupAction) (if any).
     * The returned segment has size {@code elementCount * layout().byteSize()}
     */
    public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer cleanup) {
        return addr.reinterpret(layout().byteSize() * elementCount, arena, cleanup);
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy