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

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

There is a newer version: 1.4.2
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 _GMemVTable {
 *     void* (*malloc)(unsigned long);
 *     void* (*realloc)(void*,unsigned long);
 *     void (*free)(void*);
 *     void* (*calloc)(unsigned long,unsigned long);
 *     void* (*try_malloc)(unsigned long);
 *     void* (*try_realloc)(void*,unsigned long);
 * };
 * }
 */
public class _GMemVTable {

    public static MemoryLayout $LAYOUT() {
        return constants$208.const$0;
    }
    /**
     * {@snippet :
 * void* (*malloc)(unsigned long);
     * }
     */
    public interface malloc {

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

    public static VarHandle malloc$VH() {
        return constants$208.const$3;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void* (*malloc)(unsigned long);
     * }
     */
    public static MemorySegment malloc$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$208.const$3.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void* (*malloc)(unsigned long);
     * }
     */
    public static void malloc$set(MemorySegment seg, MemorySegment x) {
        constants$208.const$3.set(seg, x);
    }
    public static MemorySegment malloc$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$208.const$3.get(seg.asSlice(index*sizeof()));
    }
    public static void malloc$set(MemorySegment seg, long index, MemorySegment x) {
        constants$208.const$3.set(seg.asSlice(index*sizeof()), x);
    }
    public static malloc malloc(MemorySegment segment, Arena scope) {
        return malloc.ofAddress(malloc$get(segment), scope);
    }
    /**
     * {@snippet :
 * void* (*realloc)(void*,unsigned long);
     * }
     */
    public interface realloc {

        java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment data, long size);
        static MemorySegment allocate(realloc fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$208.const$4, fi, constants$21.const$1, scope);
        }
        static realloc ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment _data, long _size) -> {
                try {
                    return (java.lang.foreign.MemorySegment)constants$208.const$5.invokeExact(symbol, _data, _size);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle realloc$VH() {
        return constants$209.const$0;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void* (*realloc)(void*,unsigned long);
     * }
     */
    public static MemorySegment realloc$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$209.const$0.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void* (*realloc)(void*,unsigned long);
     * }
     */
    public static void realloc$set(MemorySegment seg, MemorySegment x) {
        constants$209.const$0.set(seg, x);
    }
    public static MemorySegment realloc$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$209.const$0.get(seg.asSlice(index*sizeof()));
    }
    public static void realloc$set(MemorySegment seg, long index, MemorySegment x) {
        constants$209.const$0.set(seg.asSlice(index*sizeof()), x);
    }
    public static realloc realloc(MemorySegment segment, Arena scope) {
        return realloc.ofAddress(realloc$get(segment), scope);
    }
    /**
     * {@snippet :
 * void (*free)(void*);
     * }
     */
    public interface free {

        void apply(java.lang.foreign.MemorySegment display);
        static MemorySegment allocate(free fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$209.const$1, fi, constants$13.const$1, scope);
        }
        static 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 free$VH() {
        return constants$209.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void (*free)(void*);
     * }
     */
    public static MemorySegment free$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$209.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void (*free)(void*);
     * }
     */
    public static void free$set(MemorySegment seg, MemorySegment x) {
        constants$209.const$2.set(seg, x);
    }
    public static MemorySegment free$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$209.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void free$set(MemorySegment seg, long index, MemorySegment x) {
        constants$209.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    public static free free(MemorySegment segment, Arena scope) {
        return free.ofAddress(free$get(segment), scope);
    }
    /**
     * {@snippet :
 * void* (*calloc)(unsigned long,unsigned long);
     * }
     */
    public interface calloc {

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

    public static VarHandle calloc$VH() {
        return constants$209.const$5;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void* (*calloc)(unsigned long,unsigned long);
     * }
     */
    public static MemorySegment calloc$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$209.const$5.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void* (*calloc)(unsigned long,unsigned long);
     * }
     */
    public static void calloc$set(MemorySegment seg, MemorySegment x) {
        constants$209.const$5.set(seg, x);
    }
    public static MemorySegment calloc$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$209.const$5.get(seg.asSlice(index*sizeof()));
    }
    public static void calloc$set(MemorySegment seg, long index, MemorySegment x) {
        constants$209.const$5.set(seg.asSlice(index*sizeof()), x);
    }
    public static calloc calloc(MemorySegment segment, Arena scope) {
        return calloc.ofAddress(calloc$get(segment), scope);
    }
    /**
     * {@snippet :
 * void* (*try_malloc)(unsigned long);
     * }
     */
    public interface try_malloc {

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

    public static VarHandle try_malloc$VH() {
        return constants$210.const$1;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void* (*try_malloc)(unsigned long);
     * }
     */
    public static MemorySegment try_malloc$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$210.const$1.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void* (*try_malloc)(unsigned long);
     * }
     */
    public static void try_malloc$set(MemorySegment seg, MemorySegment x) {
        constants$210.const$1.set(seg, x);
    }
    public static MemorySegment try_malloc$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$210.const$1.get(seg.asSlice(index*sizeof()));
    }
    public static void try_malloc$set(MemorySegment seg, long index, MemorySegment x) {
        constants$210.const$1.set(seg.asSlice(index*sizeof()), x);
    }
    public static try_malloc try_malloc(MemorySegment segment, Arena scope) {
        return try_malloc.ofAddress(try_malloc$get(segment), scope);
    }
    /**
     * {@snippet :
 * void* (*try_realloc)(void*,unsigned long);
     * }
     */
    public interface try_realloc {

        java.lang.foreign.MemorySegment apply(java.lang.foreign.MemorySegment data, long size);
        static MemorySegment allocate(try_realloc fi, Arena scope) {
            return RuntimeHelper.upcallStub(constants$210.const$2, fi, constants$21.const$1, scope);
        }
        static try_realloc ofAddress(MemorySegment addr, Arena arena) {
            MemorySegment symbol = addr.reinterpret(arena, null);
            return (java.lang.foreign.MemorySegment _data, long _size) -> {
                try {
                    return (java.lang.foreign.MemorySegment)constants$208.const$5.invokeExact(symbol, _data, _size);
                } catch (Throwable ex$) {
                    throw new AssertionError("should not reach here", ex$);
                }
            };
        }
    }

    public static VarHandle try_realloc$VH() {
        return constants$210.const$3;
    }
    /**
     * Getter for field:
     * {@snippet :
     * void* (*try_realloc)(void*,unsigned long);
     * }
     */
    public static MemorySegment try_realloc$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$210.const$3.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * void* (*try_realloc)(void*,unsigned long);
     * }
     */
    public static void try_realloc$set(MemorySegment seg, MemorySegment x) {
        constants$210.const$3.set(seg, x);
    }
    public static MemorySegment try_realloc$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$210.const$3.get(seg.asSlice(index*sizeof()));
    }
    public static void try_realloc$set(MemorySegment seg, long index, MemorySegment x) {
        constants$210.const$3.set(seg.asSlice(index*sizeof()), x);
    }
    public static try_realloc try_realloc(MemorySegment segment, Arena scope) {
        return try_realloc.ofAddress(try_realloc$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 - 2025 Weber Informatics LLC | Privacy Policy