// Generated by jextract

package c.lib.math;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.VarHandle;
import java.nio.ByteOrder;
import java.lang.foreign.*;
import static java.lang.foreign.ValueLayout.*;
/**
 * {@snippet :
 * struct localeinfo_struct {
 *     pthreadlocinfo locinfo;
 *     pthreadmbcinfo mbcinfo;
 * };
 * }
 */
public class localeinfo_struct {

    public static MemoryLayout $LAYOUT() {
        return constants$0.const$2;
    }
    public static VarHandle locinfo$VH() {
        return constants$0.const$3;
    }
    /**
     * Getter for field:
     * {@snippet :
     * pthreadlocinfo locinfo;
     * }
     */
    public static MemorySegment locinfo$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$0.const$3.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * pthreadlocinfo locinfo;
     * }
     */
    public static void locinfo$set(MemorySegment seg, MemorySegment x) {
        constants$0.const$3.set(seg, x);
    }
    public static MemorySegment locinfo$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$0.const$3.get(seg.asSlice(index*sizeof()));
    }
    public static void locinfo$set(MemorySegment seg, long index, MemorySegment x) {
        constants$0.const$3.set(seg.asSlice(index*sizeof()), x);
    }
    public static VarHandle mbcinfo$VH() {
        return constants$0.const$4;
    }
    /**
     * Getter for field:
     * {@snippet :
     * pthreadmbcinfo mbcinfo;
     * }
     */
    public static MemorySegment mbcinfo$get(MemorySegment seg) {
        return (java.lang.foreign.MemorySegment)constants$0.const$4.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * pthreadmbcinfo mbcinfo;
     * }
     */
    public static void mbcinfo$set(MemorySegment seg, MemorySegment x) {
        constants$0.const$4.set(seg, x);
    }
    public static MemorySegment mbcinfo$get(MemorySegment seg, long index) {
        return (java.lang.foreign.MemorySegment)constants$0.const$4.get(seg.asSlice(index*sizeof()));
    }
    public static void mbcinfo$set(MemorySegment seg, long index, MemorySegment x) {
        constants$0.const$4.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 arena) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, arena); }
}


