org.purejava.appindicator._GStaticRWLock Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of libappindicator-gtk3-java-full Show documentation
Show all versions of libappindicator-gtk3-java-full Show documentation
Java bindings for libappindicator-gtk3 in 100% pure Java
// 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 _GStaticRWLock {
* struct GStaticMutex mutex;
* struct _GCond* read_cond;
* struct _GCond* write_cond;
* unsigned int read_counter;
* int have_writer;
* unsigned int want_to_read;
* unsigned int want_to_write;
* };
* }
*/
public class _GStaticRWLock {
public static MemoryLayout $LAYOUT() {
return constants$539.const$4;
}
public static MemorySegment mutex$slice(MemorySegment seg) {
return seg.asSlice(0, 56);
}
public static VarHandle read_cond$VH() {
return constants$539.const$5;
}
/**
* Getter for field:
* {@snippet :
* struct _GCond* read_cond;
* }
*/
public static MemorySegment read_cond$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$539.const$5.get(seg);
}
/**
* Setter for field:
* {@snippet :
* struct _GCond* read_cond;
* }
*/
public static void read_cond$set(MemorySegment seg, MemorySegment x) {
constants$539.const$5.set(seg, x);
}
public static MemorySegment read_cond$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$539.const$5.get(seg.asSlice(index*sizeof()));
}
public static void read_cond$set(MemorySegment seg, long index, MemorySegment x) {
constants$539.const$5.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle write_cond$VH() {
return constants$540.const$0;
}
/**
* Getter for field:
* {@snippet :
* struct _GCond* write_cond;
* }
*/
public static MemorySegment write_cond$get(MemorySegment seg) {
return (java.lang.foreign.MemorySegment)constants$540.const$0.get(seg);
}
/**
* Setter for field:
* {@snippet :
* struct _GCond* write_cond;
* }
*/
public static void write_cond$set(MemorySegment seg, MemorySegment x) {
constants$540.const$0.set(seg, x);
}
public static MemorySegment write_cond$get(MemorySegment seg, long index) {
return (java.lang.foreign.MemorySegment)constants$540.const$0.get(seg.asSlice(index*sizeof()));
}
public static void write_cond$set(MemorySegment seg, long index, MemorySegment x) {
constants$540.const$0.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle read_counter$VH() {
return constants$540.const$1;
}
/**
* Getter for field:
* {@snippet :
* unsigned int read_counter;
* }
*/
public static int read_counter$get(MemorySegment seg) {
return (int)constants$540.const$1.get(seg);
}
/**
* Setter for field:
* {@snippet :
* unsigned int read_counter;
* }
*/
public static void read_counter$set(MemorySegment seg, int x) {
constants$540.const$1.set(seg, x);
}
public static int read_counter$get(MemorySegment seg, long index) {
return (int)constants$540.const$1.get(seg.asSlice(index*sizeof()));
}
public static void read_counter$set(MemorySegment seg, long index, int x) {
constants$540.const$1.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle have_writer$VH() {
return constants$540.const$2;
}
/**
* Getter for field:
* {@snippet :
* int have_writer;
* }
*/
public static int have_writer$get(MemorySegment seg) {
return (int)constants$540.const$2.get(seg);
}
/**
* Setter for field:
* {@snippet :
* int have_writer;
* }
*/
public static void have_writer$set(MemorySegment seg, int x) {
constants$540.const$2.set(seg, x);
}
public static int have_writer$get(MemorySegment seg, long index) {
return (int)constants$540.const$2.get(seg.asSlice(index*sizeof()));
}
public static void have_writer$set(MemorySegment seg, long index, int x) {
constants$540.const$2.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle want_to_read$VH() {
return constants$540.const$3;
}
/**
* Getter for field:
* {@snippet :
* unsigned int want_to_read;
* }
*/
public static int want_to_read$get(MemorySegment seg) {
return (int)constants$540.const$3.get(seg);
}
/**
* Setter for field:
* {@snippet :
* unsigned int want_to_read;
* }
*/
public static void want_to_read$set(MemorySegment seg, int x) {
constants$540.const$3.set(seg, x);
}
public static int want_to_read$get(MemorySegment seg, long index) {
return (int)constants$540.const$3.get(seg.asSlice(index*sizeof()));
}
public static void want_to_read$set(MemorySegment seg, long index, int x) {
constants$540.const$3.set(seg.asSlice(index*sizeof()), x);
}
public static VarHandle want_to_write$VH() {
return constants$540.const$4;
}
/**
* Getter for field:
* {@snippet :
* unsigned int want_to_write;
* }
*/
public static int want_to_write$get(MemorySegment seg) {
return (int)constants$540.const$4.get(seg);
}
/**
* Setter for field:
* {@snippet :
* unsigned int want_to_write;
* }
*/
public static void want_to_write$set(MemorySegment seg, int x) {
constants$540.const$4.set(seg, x);
}
public static int want_to_write$get(MemorySegment seg, long index) {
return (int)constants$540.const$4.get(seg.asSlice(index*sizeof()));
}
public static void want_to_write$set(MemorySegment seg, long index, int x) {
constants$540.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 scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
}