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.NativeResource
Layout
struct JNINativeMethod { char * name; char * signature; void * fnPtr; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JNINativeMethod.Buffer
An array ofJNINativeMethod
structs.
-
Constructor Summary
Constructors Constructor Description JNINativeMethod(java.nio.ByteBuffer container)
Creates aJNINativeMethod
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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
callocStack()
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()
JNINativeMethod
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
mallocStack()
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.java.nio.ByteBuffer
name()
JNINativeMethod
name(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thename
field.java.lang.String
nameString()
static long
nfnPtr(long struct)
Unsafe version offnPtr()
.static void
nfnPtr(long struct, long value)
Unsafe version offnPtr
.static java.nio.ByteBuffer
nname(long struct)
Unsafe version ofname()
.static void
nname(long struct, java.nio.ByteBuffer value)
Unsafe version ofname
.static java.lang.String
nnameString(long struct)
Unsafe version ofnameString()
.static java.nio.ByteBuffer
nsignature(long struct)
Unsafe version ofsignature()
.static void
nsignature(long struct, java.nio.ByteBuffer value)
Unsafe version ofsignature
.static java.lang.String
nsignatureString(long struct)
Unsafe version ofsignatureString()
.JNINativeMethod
set(java.nio.ByteBuffer name, java.nio.ByteBuffer signature, long fnPtr)
Initializes this struct with the specified values.JNINativeMethod
set(JNINativeMethod src)
Copies the specified struct data to this struct.java.nio.ByteBuffer
signature()
JNINativeMethod
signature(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thesignature
field.java.lang.String
signatureString()
int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.
-
-
-
Constructor Detail
-
JNINativeMethod
public JNINativeMethod(java.nio.ByteBuffer container)
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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
name
public java.nio.ByteBuffer name()
- Returns:
- a
ByteBuffer
view of the null-terminated string pointed to by thename
field.
-
nameString
public java.lang.String nameString()
- Returns:
- the null-terminated string pointed to by the
name
field.
-
signature
public java.nio.ByteBuffer signature()
- Returns:
- a
ByteBuffer
view of the null-terminated string pointed to by thesignature
field.
-
signatureString
public java.lang.String signatureString()
- Returns:
- the null-terminated string pointed to by the
signature
field.
-
fnPtr
public long fnPtr()
- Returns:
- the value of the
fnPtr
field.
-
name
public JNINativeMethod name(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thename
field.
-
signature
public JNINativeMethod signature(java.nio.ByteBuffer value)
Sets the address of the specified encoded string to thesignature
field.
-
fnPtr
public JNINativeMethod fnPtr(long value)
Sets the specified value to thefnPtr
field.
-
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 newJNINativeMethod
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static JNINativeMethod calloc()
Returns a newJNINativeMethod
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static JNINativeMethod create()
Returns a newJNINativeMethod
instance allocated withBufferUtils
.
-
create
public static JNINativeMethod create(long address)
Returns a newJNINativeMethod
instance for the specified memory address.
-
createSafe
@Nullable public static JNINativeMethod createSafe(long address)
-
malloc
public static JNINativeMethod.Buffer malloc(int capacity)
Returns a newJNINativeMethod.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static JNINativeMethod.Buffer calloc(int capacity)
Returns a newJNINativeMethod.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static JNINativeMethod.Buffer create(int capacity)
Returns a newJNINativeMethod.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static JNINativeMethod.Buffer create(long address, int capacity)
Create aJNINativeMethod.Buffer
instance 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 newJNINativeMethod
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
public static JNINativeMethod calloc(org.lwjgl.system.MemoryStack stack)
Returns a newJNINativeMethod
instance allocated on the specifiedMemoryStack
and 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.Buffer
instance 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.Buffer
instance allocated on the specifiedMemoryStack
and 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
-
-