Package org.lwjgl.system.jni
Class JNINativeMethod
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct
org.lwjgl.system.jni.JNINativeMethod
- All Implemented Interfaces:
AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class JNINativeMethod
extends org.lwjgl.system.Struct
implements org.lwjgl.system.NativeResource
Layout
struct JNINativeMethod {
char * name;
char * signature;
void * fnPtr;
}
-
Nested Class Summary
Nested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The struct alignment in bytes.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct member offsets.static final int
The struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorDescriptionJNINativeMethod
(ByteBuffer container) Creates aJNINativeMethod
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic JNINativeMethod
calloc()
Returns a newJNINativeMethod
instance allocated withmemCalloc
.static JNINativeMethod.Buffer
calloc
(int capacity) Returns a newJNINativeMethod.Buffer
instance allocated withmemCalloc
.static JNINativeMethod.Buffer
calloc
(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newJNINativeMethod.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static JNINativeMethod
calloc
(org.lwjgl.system.MemoryStack stack) Returns a newJNINativeMethod
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static JNINativeMethod
Deprecated.static JNINativeMethod.Buffer
callocStack
(int capacity) Deprecated.static JNINativeMethod.Buffer
callocStack
(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static JNINativeMethod
callocStack
(org.lwjgl.system.MemoryStack stack) Deprecated.static JNINativeMethod
create()
Returns a newJNINativeMethod
instance allocated withBufferUtils
.static JNINativeMethod.Buffer
create
(int capacity) Returns a newJNINativeMethod.Buffer
instance allocated withBufferUtils
.static JNINativeMethod
create
(long address) Returns a newJNINativeMethod
instance for the specified memory address.static JNINativeMethod.Buffer
create
(long address, int capacity) Create aJNINativeMethod.Buffer
instance at the specified memory.static JNINativeMethod
createSafe
(long address) static JNINativeMethod.Buffer
createSafe
(long address, int capacity) long
fnPtr()
fnPtr
(long value) Sets the specified value to thefnPtr
field.static JNINativeMethod
malloc()
Returns a newJNINativeMethod
instance allocated withmemAlloc
.static JNINativeMethod.Buffer
malloc
(int capacity) Returns a newJNINativeMethod.Buffer
instance allocated withmemAlloc
.static JNINativeMethod.Buffer
malloc
(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newJNINativeMethod.Buffer
instance allocated on the specifiedMemoryStack
.static JNINativeMethod
malloc
(org.lwjgl.system.MemoryStack stack) Returns a newJNINativeMethod
instance allocated on the specifiedMemoryStack
.static JNINativeMethod
Deprecated.static JNINativeMethod.Buffer
mallocStack
(int capacity) Deprecated.static JNINativeMethod.Buffer
mallocStack
(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static JNINativeMethod
mallocStack
(org.lwjgl.system.MemoryStack stack) Deprecated.name()
name
(ByteBuffer value) Sets the address of the specified encoded string to thename
field.static long
nfnPtr
(long struct) Unsafe version offnPtr()
.static void
nfnPtr
(long struct, long value) Unsafe version offnPtr
.static ByteBuffer
nname
(long struct) Unsafe version ofname()
.static void
nname
(long struct, ByteBuffer value) Unsafe version ofname
.static String
nnameString
(long struct) Unsafe version ofnameString()
.static ByteBuffer
nsignature
(long struct) Unsafe version ofsignature()
.static void
nsignature
(long struct, ByteBuffer value) Unsafe version ofsignature
.static String
nsignatureString
(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 thesignature
field.int
sizeof()
static void
validate
(long struct) Validates pointer members that should not beNULL
.Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
Methods 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 aJNINativeMethod
instance at the current position of the specifiedByteBuffer
container. 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()- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
name
- Returns:
- a
ByteBuffer
view of the null-terminated string pointed to by thename
field.
-
nameString
- Returns:
- the null-terminated string pointed to by the
name
field.
-
signature
- Returns:
- a
ByteBuffer
view of the null-terminated string pointed to by thesignature
field.
-
signatureString
- Returns:
- the null-terminated string pointed to by the
signature
field.
-
fnPtr
public long fnPtr()- Returns:
- the value of the
fnPtr
field.
-
name
Sets the address of the specified encoded string to thename
field. -
signature
Sets the address of the specified encoded string to thesignature
field. -
fnPtr
Sets the specified value to thefnPtr
field. -
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 newJNINativeMethod
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newJNINativeMethod
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newJNINativeMethod
instance allocated withBufferUtils
. -
create
Returns a newJNINativeMethod
instance for the specified memory address. -
createSafe
-
malloc
Returns a newJNINativeMethod.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newJNINativeMethod.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newJNINativeMethod.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aJNINativeMethod.Buffer
instance 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 public static JNINativeMethod.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)
instead. -
callocStack
@Deprecated public static JNINativeMethod.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)
instead. -
malloc
Returns a newJNINativeMethod
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newJNINativeMethod
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newJNINativeMethod.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newJNINativeMethod.Buffer
instance allocated on the specifiedMemoryStack
and 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
-