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

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

There is a newer version: 1.4.1
Show newest version
// Generated by jextract

package org.purejava.appindicator;

import java.lang.foreign.Arena;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentAllocator;
import java.lang.invoke.VarHandle;
/**
 * {@snippet :
 * struct _GIOFuncs {
 *     enum GIOStatus (*io_read)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
 *     enum GIOStatus (*io_write)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
 *     enum GIOStatus (*io_seek)(struct _GIOChannel*,long,enum GSeekType,struct _GError**);
 *     enum GIOStatus (*io_close)(struct _GIOChannel*,struct _GError**);
 *     struct _GSource* (*io_create_watch)(struct _GIOChannel*,enum GIOCondition);
 *     void (*io_free)(struct _GIOChannel*);
 *     enum GIOStatus (*io_set_flags)(struct _GIOChannel*,enum GIOFlags,struct _GError**);
 *     enum GIOFlags (*io_get_flags)(struct _GIOChannel*);
 * };
 * }
 */
public class _GIOFuncs {

    public static MemoryLayout $LAYOUT() {
        return constants$315.const$4;
    }
    /**
     * {@snippet :
 * enum GIOStatus (*io_read)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
     * }
     */
    public interface io_read {

        int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4);
        static MemorySegment allocate(io_read fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$316.const$0, fi, constants$315.const$5, scope);
        }
        static io_read ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4) -> {
                try {
                    return (int)constants$316.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_read$VH() {
        return constants$316.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * enum GIOStatus (*io_read)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
     * }
     */
    public static MemorySegment io_read$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$316.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * enum GIOStatus (*io_read)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
     * }
     */
    public static void io_read$set(MemorySegment seg, MemorySegment x) {
        constants$316.const$2.set(seg, x);
    }
    public static MemorySegment io_read$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$316.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void io_read$set(MemorySegment seg, long index, MemorySegment x) {
        constants$316.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_read io_read(MemorySegment segment, Arena scope) {
        return io_read.ofAddress(io_read$get(segment), scope);
    }
    /**
     * {@snippet :
 * enum GIOStatus (*io_write)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
     * }
     */
    public interface io_write {

        int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1, long _x2, java.lang.foreign.MemorySegment _x3, java.lang.foreign.MemorySegment _x4);
        static MemorySegment allocate(io_write fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$316.const$3, fi, constants$315.const$5, scope);
        }
        static io_write ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1, long __x2, java.lang.foreign.MemorySegment __x3, java.lang.foreign.MemorySegment __x4) -> {
                try {
                    return (int)constants$316.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3, __x4);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_write$VH() {
        return constants$316.const$4;
    }
    /**
     * Getter for field:
     * {@snippet :
     * enum GIOStatus (*io_write)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
     * }
     */
    public static MemorySegment io_write$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$316.const$4.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * enum GIOStatus (*io_write)(struct _GIOChannel*,char*,unsigned long,unsigned long*,struct _GError**);
     * }
     */
    public static void io_write$set(MemorySegment seg, MemorySegment x) {
        constants$316.const$4.set(seg, x);
    }
    public static MemorySegment io_write$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$316.const$4.get(seg.asSlice(index*sizeof()));
    }
    public static void io_write$set(MemorySegment seg, long index, MemorySegment x) {
        constants$316.const$4.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_write io_write(MemorySegment segment, Arena scope) {
        return io_write.ofAddress(io_write$get(segment), scope);
    }
    /**
     * {@snippet :
 * enum GIOStatus (*io_seek)(struct _GIOChannel*,long,enum GSeekType,struct _GError**);
     * }
     */
    public interface io_seek {

        int apply(java.lang.foreign.MemorySegment _x0, long _x1, int _x2, java.lang.foreign.MemorySegment _x3);
        static MemorySegment allocate(io_seek fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$317.const$0, fi, constants$316.const$5, scope);
        }
        static io_seek ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, long __x1, int __x2, java.lang.foreign.MemorySegment __x3) -> {
                try {
                    return (int)constants$317.const$1.invokeExact(symbol, __x0, __x1, __x2, __x3);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_seek$VH() {
        return constants$317.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * enum GIOStatus (*io_seek)(struct _GIOChannel*,long,enum GSeekType,struct _GError**);
     * }
     */
    public static MemorySegment io_seek$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$317.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * enum GIOStatus (*io_seek)(struct _GIOChannel*,long,enum GSeekType,struct _GError**);
     * }
     */
    public static void io_seek$set(MemorySegment seg, MemorySegment x) {
        constants$317.const$2.set(seg, x);
    }
    public static MemorySegment io_seek$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$317.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void io_seek$set(MemorySegment seg, long index, MemorySegment x) {
        constants$317.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_seek io_seek(MemorySegment segment, Arena scope) {
        return io_seek.ofAddress(io_seek$get(segment), scope);
    }
    /**
     * {@snippet :
 * enum GIOStatus (*io_close)(struct _GIOChannel*,struct _GError**);
     * }
     */
    public interface io_close {

        int apply(java.lang.foreign.MemorySegment _x0, java.lang.foreign.MemorySegment _x1);
        static MemorySegment allocate(io_close fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$317.const$3, fi, constants$9.const$0, scope);
        }
        static io_close ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, java.lang.foreign.MemorySegment __x1) -> {
                try {
                    return (int)constants$12.const$1.invokeExact(symbol, __x0, __x1);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_close$VH() {
        return constants$317.const$4;
    }
    /**
     * Getter for field:
     * {@snippet :
     * enum GIOStatus (*io_close)(struct _GIOChannel*,struct _GError**);
     * }
     */
    public static MemorySegment io_close$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$317.const$4.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * enum GIOStatus (*io_close)(struct _GIOChannel*,struct _GError**);
     * }
     */
    public static void io_close$set(MemorySegment seg, MemorySegment x) {
        constants$317.const$4.set(seg, x);
    }
    public static MemorySegment io_close$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$317.const$4.get(seg.asSlice(index*sizeof()));
    }
    public static void io_close$set(MemorySegment seg, long index, MemorySegment x) {
        constants$317.const$4.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_close io_close(MemorySegment segment, Arena scope) {
        return io_close.ofAddress(io_close$get(segment), scope);
    }
    /**
     * {@snippet :
 * struct _GSource* (*io_create_watch)(struct _GIOChannel*,enum GIOCondition);
     * }
     */
    public interface io_create_watch {

        java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment _x0, int _x1);
        static MemorySegment allocate(io_create_watch fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$317.const$5, fi, constants$21.const$3, scope);
        }
        static io_create_watch ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, int __x1) -> {
                try {
                    return (java.lang.foreign.MemorySegment)constants$318.const$0.invokeExact(symbol, __x0, __x1);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_create_watch$VH() {
        return constants$318.const$1;
    }
    /**
     * Getter for field:
     * {@snippet :
     * struct _GSource* (*io_create_watch)(struct _GIOChannel*,enum GIOCondition);
     * }
     */
    public static MemorySegment io_create_watch$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$318.const$1.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * struct _GSource* (*io_create_watch)(struct _GIOChannel*,enum GIOCondition);
     * }
     */
    public static void io_create_watch$set(MemorySegment seg, MemorySegment x) {
        constants$318.const$1.set(seg, x);
    }
    public static MemorySegment io_create_watch$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$318.const$1.get(seg.asSlice(index*sizeof()));
    }
    public static void io_create_watch$set(MemorySegment seg, long index, MemorySegment x) {
        constants$318.const$1.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_create_watch io_create_watch(MemorySegment segment, Arena scope) {
        return io_create_watch.ofAddress(io_create_watch$get(segment), scope);
    }
    /**
     * {@snippet :
 * void (*io_free)(struct _GIOChannel*);
     * }
     */
    public interface io_free {

        void apply(java.lang.foreign.MemorySegment display);
        static MemorySegment allocate(io_free fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$318.const$2, fi, constants$13.const$1, scope);
        }
        static io_free ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment _display) -> {
                try {
                    constants$13.const$3.invokeExact(symbol, _display);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_free$VH() {
        return constants$318.const$3;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void (*io_free)(struct _GIOChannel*);
     * }
     */
    public static MemorySegment io_free$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$318.const$3.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void (*io_free)(struct _GIOChannel*);
     * }
     */
    public static void io_free$set(MemorySegment seg, MemorySegment x) {
        constants$318.const$3.set(seg, x);
    }
    public static MemorySegment io_free$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$318.const$3.get(seg.asSlice(index*sizeof()));
    }
    public static void io_free$set(MemorySegment seg, long index, MemorySegment x) {
        constants$318.const$3.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_free io_free(MemorySegment segment, Arena scope) {
        return io_free.ofAddress(io_free$get(segment), scope);
    }
    /**
     * {@snippet :
 * enum GIOStatus (*io_set_flags)(struct _GIOChannel*,enum GIOFlags,struct _GError**);
     * }
     */
    public interface io_set_flags {

        int apply(java.lang.foreign.MemorySegment _x0, int _x1, java.lang.foreign.MemorySegment _x2);
        static MemorySegment allocate(io_set_flags fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$318.const$4, fi, constants$150.const$0, scope);
        }
        static io_set_flags ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0, int __x1, java.lang.foreign.MemorySegment __x2) -> {
                try {
                    return (int)constants$315.const$3.invokeExact(symbol, __x0, __x1, __x2);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_set_flags$VH() {
        return constants$318.const$5;
    }
    /**
     * Getter for field:
     * {@snippet :
     * enum GIOStatus (*io_set_flags)(struct _GIOChannel*,enum GIOFlags,struct _GError**);
     * }
     */
    public static MemorySegment io_set_flags$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$318.const$5.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * enum GIOStatus (*io_set_flags)(struct _GIOChannel*,enum GIOFlags,struct _GError**);
     * }
     */
    public static void io_set_flags$set(MemorySegment seg, MemorySegment x) {
        constants$318.const$5.set(seg, x);
    }
    public static MemorySegment io_set_flags$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$318.const$5.get(seg.asSlice(index*sizeof()));
    }
    public static void io_set_flags$set(MemorySegment seg, long index, MemorySegment x) {
        constants$318.const$5.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_set_flags io_set_flags(MemorySegment segment, Arena scope) {
        return io_set_flags.ofAddress(io_set_flags$get(segment), scope);
    }
    /**
     * {@snippet :
 * enum GIOFlags (*io_get_flags)(struct _GIOChannel*);
     * }
     */
    public interface io_get_flags {

        int apply(java.lang.foreign.MemorySegment _x0);
        static MemorySegment allocate(io_get_flags fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$319.const$0, fi, constants$10.const$5, scope);
        }
        static io_get_flags ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment __x0) -> {
                try {
                    return (int)constants$14.const$2.invokeExact(symbol, __x0);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle io_get_flags$VH() {
        return constants$319.const$1;
    }
    /**
     * Getter for field:
     * {@snippet :
     * enum GIOFlags (*io_get_flags)(struct _GIOChannel*);
     * }
     */
    public static MemorySegment io_get_flags$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$319.const$1.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * enum GIOFlags (*io_get_flags)(struct _GIOChannel*);
     * }
     */
    public static void io_get_flags$set(MemorySegment seg, MemorySegment x) {
        constants$319.const$1.set(seg, x);
    }
    public static MemorySegment io_get_flags$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$319.const$1.get(seg.asSlice(index*sizeof()));
    }
    public static void io_get_flags$set(MemorySegment seg, long index, MemorySegment x) {
        constants$319.const$1.set(seg.asSlice(index*sizeof()), x);
    }
    public static io_get_flags io_get_flags(MemorySegment segment, Arena scope) {
        return io_get_flags.ofAddress(io_get_flags$get(segment), scope);
    }
    public static long sizeof() { return $LAYOUT().byteSize(); }
    public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
    public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
        return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
    }
    public static MemorySegment ofAddress(MemorySegment addr, Arena scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
}






© 2015 - 2024 Weber Informatics LLC | Privacy Policy