Package org.lwjgl.system.jni
Class JNINativeMethod
- All Implemented Interfaces:
AutoCloseable,NativeResource,Pointer
struct JNINativeMethod {
char * name;
char * signature;
void * fnPtr;
}-
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 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 size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionJNINativeMethod(ByteBuffer container) Creates aJNINativeMethodinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic JNINativeMethodcalloc()Returns a newJNINativeMethodinstance allocated withmemCalloc.static JNINativeMethod.Buffercalloc(int capacity) Returns a newJNINativeMethod.Bufferinstance allocated withmemCalloc.static JNINativeMethod.Buffercalloc(int capacity, MemoryStack stack) Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static JNINativeMethodcalloc(MemoryStack stack) Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static JNINativeMethodDeprecated.static JNINativeMethod.BuffercallocStack(int capacity) Deprecated.static JNINativeMethod.BuffercallocStack(int capacity, MemoryStack stack) Deprecated.static JNINativeMethodcallocStack(MemoryStack stack) Deprecated.static JNINativeMethodcreate()Returns a newJNINativeMethodinstance allocated withBufferUtils.static JNINativeMethod.Buffercreate(int capacity) Returns a newJNINativeMethod.Bufferinstance allocated withBufferUtils.static JNINativeMethodcreate(long address) Returns a newJNINativeMethodinstance for the specified memory address.static JNINativeMethod.Buffercreate(long address, int capacity) Create aJNINativeMethod.Bufferinstance at the specified memory.static @Nullable JNINativeMethodcreateSafe(long address) static @Nullable JNINativeMethod.BuffercreateSafe(long address, int capacity) longfnPtr()fnPtr(long value) Sets the specified value to thefnPtrfield.static JNINativeMethodmalloc()Returns a newJNINativeMethodinstance allocated withmemAlloc.static JNINativeMethod.Buffermalloc(int capacity) Returns a newJNINativeMethod.Bufferinstance allocated withmemAlloc.static JNINativeMethod.Buffermalloc(int capacity, MemoryStack stack) Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStack.static JNINativeMethodmalloc(MemoryStack stack) Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStack.static JNINativeMethodDeprecated.static JNINativeMethod.BuffermallocStack(int capacity) Deprecated.static JNINativeMethod.BuffermallocStack(int capacity, MemoryStack stack) Deprecated.static JNINativeMethodmallocStack(MemoryStack stack) Deprecated.name()name(ByteBuffer value) Sets the address of the specified encoded string to thenamefield.static longnfnPtr(long struct) Unsafe version offnPtr().static voidnfnPtr(long struct, long value) Unsafe version offnPtr.static ByteBuffernname(long struct) Unsafe version ofname().static voidnname(long struct, ByteBuffer value) Unsafe version ofname.static StringnnameString(long struct) Unsafe version ofnameString().static ByteBuffernsignature(long struct) Unsafe version ofsignature().static voidnsignature(long struct, ByteBuffer value) Unsafe version ofsignature.static StringnsignatureString(long struct) Unsafe version ofsignatureString().set(ByteBuffer name, ByteBuffer signature, long fnPtr) Initializes this struct with the specified values.set(JNINativeMethod src) Copies the specified struct data to this struct.signature(ByteBuffer value) Sets the address of the specified encoded string to thesignaturefield.intsizeof()Returnssizeof(struct).static voidvalidate(long struct) Validates pointer members that should not beNULL.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. -
NAME
public static final int NAMEThe struct member offsets. -
SIGNATURE
public static final int SIGNATUREThe struct member offsets. -
FNPTR
public static final int FNPTRThe struct member offsets.
-
-
Constructor Details
-
JNINativeMethod
Creates aJNINativeMethodinstance 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).- Specified by:
sizeofin classStruct<JNINativeMethod>
-
name
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thenamefield.
-
nameString
- Returns:
- the null-terminated string pointed to by the
namefield.
-
signature
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thesignaturefield.
-
signatureString
- Returns:
- the null-terminated string pointed to by the
signaturefield.
-
fnPtr
public long fnPtr()- Returns:
- the value of the
fnPtrfield.
-
name
Sets the address of the specified encoded string to thenamefield. -
signature
Sets the address of the specified encoded string to thesignaturefield. -
fnPtr
Sets the specified value to thefnPtrfield. -
set
Initializes this struct with the specified values. -
set
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newJNINativeMethodinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newJNINativeMethodinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newJNINativeMethodinstance allocated withBufferUtils. -
create
Returns a newJNINativeMethodinstance for the specified memory address. -
createSafe
-
malloc
Returns a newJNINativeMethod.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newJNINativeMethod.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newJNINativeMethod.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aJNINativeMethod.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nname
Unsafe version ofname(). -
nnameString
Unsafe version ofnameString(). -
nsignature
Unsafe version ofsignature(). -
nsignatureString
Unsafe version ofsignatureString(). -
nfnPtr
public static long nfnPtr(long struct) Unsafe version offnPtr(). -
nname
Unsafe version ofname. -
nsignature
Unsafe version ofsignature. -
nfnPtr
public static void nfnPtr(long struct, long value) Unsafe version offnPtr. -
validate
public static void validate(long struct) Validates pointer members that should not beNULL.- Parameters:
struct- the struct to validate
-