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:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class JNINativeMethod extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct JNINativeMethod { char * name; char * signature; void * fnPtr; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classJNINativeMethod.BufferAn array ofJNINativeMethodstructs.
-
Constructor Summary
Constructors Constructor Description JNINativeMethod(java.nio.ByteBuffer container)Creates aJNINativeMethodinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static JNINativeMethodcalloc()Returns a newJNINativeMethodinstance allocated withmemCalloc.static JNINativeMethod.Buffercalloc(int capacity)Returns a newJNINativeMethod.Bufferinstance allocated withmemCalloc.static JNINativeMethod.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static JNINativeMethodcalloc(org.lwjgl.system.MemoryStack stack)Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static JNINativeMethodcallocStack()Deprecated.static JNINativeMethod.BuffercallocStack(int capacity)Deprecated.static JNINativeMethod.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static JNINativeMethodcallocStack(org.lwjgl.system.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 JNINativeMethodcreateSafe(long address)static JNINativeMethod.BuffercreateSafe(long address, int capacity)longfnPtr()JNINativeMethodfnPtr(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, org.lwjgl.system.MemoryStack stack)Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStack.static JNINativeMethodmalloc(org.lwjgl.system.MemoryStack stack)Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStack.static JNINativeMethodmallocStack()Deprecated.static JNINativeMethod.BuffermallocStack(int capacity)Deprecated.static JNINativeMethod.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack)Deprecated.static JNINativeMethodmallocStack(org.lwjgl.system.MemoryStack stack)Deprecated.java.nio.ByteBuffername()JNINativeMethodname(java.nio.ByteBuffer value)Sets the address of the specified encoded string to thenamefield.java.lang.StringnameString()static longnfnPtr(long struct)Unsafe version offnPtr().static voidnfnPtr(long struct, long value)Unsafe version offnPtr.static java.nio.ByteBuffernname(long struct)Unsafe version ofname().static voidnname(long struct, java.nio.ByteBuffer value)Unsafe version ofname.static java.lang.StringnnameString(long struct)Unsafe version ofnameString().static java.nio.ByteBuffernsignature(long struct)Unsafe version ofsignature().static voidnsignature(long struct, java.nio.ByteBuffer value)Unsafe version ofsignature.static java.lang.StringnsignatureString(long struct)Unsafe version ofsignatureString().JNINativeMethodset(java.nio.ByteBuffer name, java.nio.ByteBuffer signature, long fnPtr)Initializes this struct with the specified values.JNINativeMethodset(JNINativeMethod src)Copies the specified struct data to this struct.java.nio.ByteBuffersignature()JNINativeMethodsignature(java.nio.ByteBuffer value)Sets the address of the specified encoded string to thesignaturefield.java.lang.StringsignatureString()intsizeof()static voidvalidate(long struct)Validates pointer members that should not beNULL.
-
-
-
Constructor Detail
-
JNINativeMethod
public JNINativeMethod(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
name
public java.nio.ByteBuffer name()
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thenamefield.
-
nameString
public java.lang.String nameString()
- Returns:
- the null-terminated string pointed to by the
namefield.
-
signature
public java.nio.ByteBuffer signature()
- Returns:
- a
ByteBufferview of the null-terminated string pointed to by thesignaturefield.
-
signatureString
public java.lang.String signatureString()
- Returns:
- the null-terminated string pointed to by the
signaturefield.
-
fnPtr
public long fnPtr()
- Returns:
- the value of the
fnPtrfield.
-
name
public JNINativeMethod name(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thenamefield.
-
signature
public JNINativeMethod signature(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thesignaturefield.
-
fnPtr
public JNINativeMethod fnPtr(long value)
Sets the specified value to thefnPtrfield.
-
set
public JNINativeMethod set(java.nio.ByteBuffer name, java.nio.ByteBuffer signature, long fnPtr)
Initializes this struct with the specified values.
-
set
public JNINativeMethod set(JNINativeMethod src)
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
public static JNINativeMethod malloc()
Returns a newJNINativeMethodinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static JNINativeMethod calloc()
Returns a newJNINativeMethodinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static JNINativeMethod create()
Returns a newJNINativeMethodinstance allocated withBufferUtils.
-
create
public static JNINativeMethod create(long address)
Returns a newJNINativeMethodinstance for the specified memory address.
-
createSafe
@Nullable public static JNINativeMethod createSafe(long address)
-
malloc
public static JNINativeMethod.Buffer malloc(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static JNINativeMethod.Buffer calloc(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static JNINativeMethod.Buffer create(int capacity)
Returns a newJNINativeMethod.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static JNINativeMethod.Buffer create(long address, int capacity)
Create aJNINativeMethod.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static JNINativeMethod.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static JNINativeMethod mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static JNINativeMethod callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static JNINativeMethod mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static JNINativeMethod callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static JNINativeMethod.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static JNINativeMethod.Buffer callocStack(int capacity)
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
public static JNINativeMethod malloc(org.lwjgl.system.MemoryStack stack)
Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static JNINativeMethod calloc(org.lwjgl.system.MemoryStack stack)
Returns a newJNINativeMethodinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static JNINativeMethod.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static JNINativeMethod.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newJNINativeMethod.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
nname
public static java.nio.ByteBuffer nname(long struct)
Unsafe version ofname().
-
nnameString
public static java.lang.String nnameString(long struct)
Unsafe version ofnameString().
-
nsignature
public static java.nio.ByteBuffer nsignature(long struct)
Unsafe version ofsignature().
-
nsignatureString
public static java.lang.String nsignatureString(long struct)
Unsafe version ofsignatureString().
-
nfnPtr
public static long nfnPtr(long struct)
Unsafe version offnPtr().
-
nname
public static void nname(long struct, java.nio.ByteBuffer value)Unsafe version ofname.
-
nsignature
public static void nsignature(long struct, java.nio.ByteBuffer value)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
-
-