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

org.purejava.appindicator.sigevent 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 sigevent {
 *     union sigval sigev_value;
 *     int sigev_signo;
 *     int sigev_notify;
 *     union  _sigev_un;
 * };
 * }
 */
public class sigevent {

    public static MemoryLayout $LAYOUT() {
        return constants$120.const$4;
    }
    public static MemorySegment sigev_value$slice(MemorySegment seg) {
        return seg.asSlice(0, 8);
    }
    public static VarHandle sigev_signo$VH() {
        return constants$120.const$5;
    }
    /**
     * Getter for field:
     * {@snippet :
     * int sigev_signo;
     * }
     */
    public static int sigev_signo$get(MemorySegment seg) {
        return (int)constants$120.const$5.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * int sigev_signo;
     * }
     */
    public static void sigev_signo$set(MemorySegment seg, int x) {
        constants$120.const$5.set(seg, x);
    }
    public static int sigev_signo$get(MemorySegment seg, long index) {
        return (int)constants$120.const$5.get(seg.asSlice(index*sizeof()));
    }
    public static void sigev_signo$set(MemorySegment seg, long index, int x) {
        constants$120.const$5.set(seg.asSlice(index*sizeof()), x);
    }
    public static VarHandle sigev_notify$VH() {
        return constants$121.const$0;
    }
    /**
     * Getter for field:
     * {@snippet :
     * int sigev_notify;
     * }
     */
    public static int sigev_notify$get(MemorySegment seg) {
        return (int)constants$121.const$0.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * int sigev_notify;
     * }
     */
    public static void sigev_notify$set(MemorySegment seg, int x) {
        constants$121.const$0.set(seg, x);
    }
    public static int sigev_notify$get(MemorySegment seg, long index) {
        return (int)constants$121.const$0.get(seg.asSlice(index*sizeof()));
    }
    public static void sigev_notify$set(MemorySegment seg, long index, int x) {
        constants$121.const$0.set(seg.asSlice(index*sizeof()), x);
    }
    /**
     * {@snippet :
     * union {
     *     int _pad[12];
     *     int _tid;
     *     struct  _sigev_thread;
     * };
     * }
     */
    public static final class _sigev_un {

        // Suppresses default constructor, ensuring non-instantiability.
        private _sigev_un() {}
        public static MemoryLayout $LAYOUT() {
            return constants$121.const$1;
        }
        public static MemorySegment _pad$slice(MemorySegment seg) {
            return seg.asSlice(0, 48);
        }
        public static VarHandle _tid$VH() {
            return constants$121.const$2;
        }
        /**
         * Getter for field:
         * {@snippet :
         * int _tid;
         * }
         */
        public static int _tid$get(MemorySegment seg) {
            return (int)constants$121.const$2.get(seg);
        }
        /**
         * Setter for field:
         * {@snippet :
         * int _tid;
         * }
         */
        public static void _tid$set(MemorySegment seg, int x) {
            constants$121.const$2.set(seg, x);
        }
        public static int _tid$get(MemorySegment seg, long index) {
            return (int)constants$121.const$2.get(seg.asSlice(index*sizeof()));
        }
        public static void _tid$set(MemorySegment seg, long index, int x) {
            constants$121.const$2.set(seg.asSlice(index*sizeof()), x);
        }
        /**
         * {@snippet :
         * struct {
         *     void (*_function)(union sigval);
         *     union pthread_attr_t* _attribute;
         * };
         * }
         */
        public static final class _sigev_thread {

            // Suppresses default constructor, ensuring non-instantiability.
            private _sigev_thread() {}
            public static MemoryLayout $LAYOUT() {
                return constants$121.const$3;
            }
            /**
             * {@snippet :
 * void (*_function)(union sigval);
             * }
             */
            public interface _function {

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

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

        public static MemorySegment _sigev_thread$slice(MemorySegment seg) {
            return seg.asSlice(0, 16);
        }
        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); }
    }

    public static MemorySegment _sigev_un$slice(MemorySegment seg) {
        return seg.asSlice(16, 48);
    }
    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