Package org.lwjgl.system.linux
Class Sockaddr
- All Implemented Interfaces:
AutoCloseable
,NativeResource
,Pointer
struct sockaddr {
sa_family_t sa_family;
char sa_data[14];
}
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
Struct.StructValidation
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
Field Summary
FieldsModifier 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 size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionSockaddr
(ByteBuffer container) Creates aSockaddr
instance at the current position of the specifiedByteBuffer
container. -
Method Summary
Modifier and TypeMethodDescriptionstatic Sockaddr
calloc()
Returns a newSockaddr
instance allocated withmemCalloc
.static Sockaddr.Buffer
calloc
(int capacity) Returns a newSockaddr.Buffer
instance allocated withmemCalloc
.static Sockaddr.Buffer
calloc
(int capacity, MemoryStack stack) Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static Sockaddr
calloc
(MemoryStack stack) Returns a newSockaddr
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static Sockaddr
create()
Returns a newSockaddr
instance allocated withBufferUtils
.static Sockaddr.Buffer
create
(int capacity) Returns a newSockaddr.Buffer
instance allocated withBufferUtils
.static Sockaddr
create
(long address) Returns a newSockaddr
instance for the specified memory address.static Sockaddr.Buffer
create
(long address, int capacity) Create aSockaddr.Buffer
instance at the specified memory.static @Nullable Sockaddr
createSafe
(long address) static @Nullable Sockaddr.Buffer
createSafe
(long address, int capacity) static Sockaddr
malloc()
Returns a newSockaddr
instance allocated withmemAlloc
.static Sockaddr.Buffer
malloc
(int capacity) Returns a newSockaddr.Buffer
instance allocated withmemAlloc
.static Sockaddr.Buffer
malloc
(int capacity, MemoryStack stack) Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
.static Sockaddr
malloc
(MemoryStack stack) Returns a newSockaddr
instance allocated on the specifiedMemoryStack
.static ByteBuffer
nsa_data
(long struct) Unsafe version ofsa_data()
.static byte
nsa_data
(long struct, int index) Unsafe version ofsa_data
.static void
nsa_data
(long struct, int index, byte value) Unsafe version ofsa_data
.static void
nsa_data
(long struct, ByteBuffer value) Unsafe version ofsa_data
.static short
nsa_family
(long struct) Unsafe version ofsa_family()
.static void
nsa_family
(long struct, short value) Unsafe version ofsa_family
.sa_data()
byte
sa_data
(int index) sa_data
(int index, byte value) Sets the specified value at the specified index of thesa_data
field.sa_data
(ByteBuffer value) Copies the specifiedByteBuffer
to thesa_data
field.short
sa_family
(short value) Sets the specified value to thesa_family
field.set
(short sa_family, ByteBuffer sa_data) Initializes this struct with the specified values.Copies the specified struct data to this struct.int
sizeof()
Returnssizeof(struct)
.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. -
SA_FAMILY
public static final int SA_FAMILYThe struct member offsets. -
SA_DATA
public static final int SA_DATAThe struct member offsets.
-
-
Constructor Details
-
Sockaddr
Creates aSockaddr
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()Description copied from class:Struct
Returnssizeof(struct)
. -
sa_family
public short sa_family()- Returns:
- the value of the
sa_family
field.
-
sa_data
- Returns:
- a
ByteBuffer
view of thesa_data
field.
-
sa_data
public byte sa_data(int index) - Returns:
- the value at the specified index of the
sa_data
field.
-
sa_family
Sets the specified value to thesa_family
field. -
sa_data
Copies the specifiedByteBuffer
to thesa_data
field. -
sa_data
Sets the specified value at the specified index of thesa_data
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 newSockaddr
instance allocated withmemAlloc
. The instance must be explicitly freed. -
calloc
Returns a newSockaddr
instance allocated withmemCalloc
. The instance must be explicitly freed. -
create
Returns a newSockaddr
instance allocated withBufferUtils
. -
create
Returns a newSockaddr
instance for the specified memory address. -
createSafe
-
malloc
Returns a newSockaddr.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
Returns a newSockaddr.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
Returns a newSockaddr.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
Create aSockaddr.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
-
malloc
Returns a newSockaddr
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
calloc
Returns a newSockaddr
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
malloc
Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
calloc
Returns a newSockaddr.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacitystack
- the stack from which to allocate
-
nsa_family
public static short nsa_family(long struct) Unsafe version ofsa_family()
. -
nsa_data
Unsafe version ofsa_data()
. -
nsa_data
public static byte nsa_data(long struct, int index) Unsafe version ofsa_data
. -
nsa_family
public static void nsa_family(long struct, short value) Unsafe version ofsa_family
. -
nsa_data
Unsafe version ofsa_data
. -
nsa_data
public static void nsa_data(long struct, int index, byte value) Unsafe version ofsa_data
.
-