Package org.lwjgl.system.libffi
Class FFICIF
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct ffi_cif {
ffi_abi abi;
unsigned nargs;
{@link FFIType ffi_type} ** arg_types;
{@link FFIType ffi_type} * rtype;
unsigned bytes;
unsigned flags;
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct member offsets.static final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionFFICIF(ByteBuffer container) Creates aFFICIFinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionintabi()arg_types(int capacity) intbytes()static FFICIFcalloc()Returns a newFFICIFinstance allocated withmemCalloc.static FFICIF.Buffercalloc(int capacity) Returns a newFFICIF.Bufferinstance allocated withmemCalloc.static FFICIF.Buffercalloc(int capacity, MemoryStack stack) Returns a newFFICIF.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static FFICIFcalloc(MemoryStack stack) Returns a newFFICIFinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static FFICIFcreate()Returns a newFFICIFinstance allocated withBufferUtils.static FFICIF.Buffercreate(int capacity) Returns a newFFICIF.Bufferinstance allocated withBufferUtils.static FFICIFcreate(long address) Returns a newFFICIFinstance for the specified memory address.static FFICIF.Buffercreate(long address, int capacity) Create aFFICIF.Bufferinstance at the specified memory.static @Nullable FFICIFcreateSafe(long address) static @Nullable FFICIF.BuffercreateSafe(long address, int capacity) intflags()static FFICIFmalloc()Returns a newFFICIFinstance allocated withmemAlloc.static FFICIF.Buffermalloc(int capacity) Returns a newFFICIF.Bufferinstance allocated withmemAlloc.static FFICIF.Buffermalloc(int capacity, MemoryStack stack) Returns a newFFICIF.Bufferinstance allocated on the specifiedMemoryStack.static FFICIFmalloc(MemoryStack stack) Returns a newFFICIFinstance allocated on the specifiedMemoryStack.static intnabi(long struct) Unsafe version ofabi().static PointerBuffernarg_types(long struct, int capacity) Unsafe version ofarg_types.intnargs()static intnbytes(long struct) Unsafe version ofbytes().static intnflags(long struct) Unsafe version offlags().static intnnargs(long struct) Unsafe version ofnargs().static FFITypenrtype(long struct) Unsafe version ofrtype().rtype()intsizeof()Returnssizeof(struct).Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
ABI
public static final int ABIThe struct member offsets. -
NARGS
public static final int NARGSThe struct member offsets. -
ARG_TYPES
public static final int ARG_TYPESThe struct member offsets. -
RTYPE
public static final int RTYPEThe struct member offsets. -
BYTES
public static final int BYTESThe struct member offsets. -
FLAGS
public static final int FLAGSThe struct member offsets.
-
-
Constructor Details
-
FFICIF
Creates aFFICIFinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()Description copied from class:StructReturnssizeof(struct). -
abi
public int abi()- Returns:
- the value of the
abifield.
-
nargs
public int nargs()- Returns:
- the value of the
nargsfield.
-
arg_types
- Returns:
- a
PointerBufferview of the data pointed to by thearg_typesfield.
-
rtype
- Returns:
- a
FFITypeview of the struct pointed to by thertypefield.
-
bytes
public int bytes()- Returns:
- the value of the
bytesfield.
-
flags
public int flags()- Returns:
- the value of the
flagsfield.
-
malloc
Returns a newFFICIFinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newFFICIFinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newFFICIFinstance allocated withBufferUtils. -
create
Returns a newFFICIFinstance for the specified memory address. -
createSafe
-
malloc
Returns a newFFICIF.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newFFICIF.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newFFICIF.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aFFICIF.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newFFICIFinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newFFICIFinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newFFICIF.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newFFICIF.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nabi
public static int nabi(long struct) Unsafe version ofabi(). -
nnargs
public static int nnargs(long struct) Unsafe version ofnargs(). -
narg_types
Unsafe version ofarg_types. -
nrtype
Unsafe version ofrtype(). -
nbytes
public static int nbytes(long struct) Unsafe version ofbytes(). -
nflags
public static int nflags(long struct) Unsafe version offlags().
-