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.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 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 aSockaddrinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic Sockaddrcalloc()Returns a newSockaddrinstance allocated withmemCalloc.static Sockaddr.Buffercalloc(int capacity) Returns a newSockaddr.Bufferinstance allocated withmemCalloc.static Sockaddr.Buffercalloc(int capacity, MemoryStack stack) Returns a newSockaddr.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static Sockaddrcalloc(MemoryStack stack) Returns a newSockaddrinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static Sockaddrcreate()Returns a newSockaddrinstance allocated withBufferUtils.static Sockaddr.Buffercreate(int capacity) Returns a newSockaddr.Bufferinstance allocated withBufferUtils.static Sockaddrcreate(long address) Returns a newSockaddrinstance for the specified memory address.static Sockaddr.Buffercreate(long address, int capacity) Create aSockaddr.Bufferinstance at the specified memory.static @Nullable SockaddrcreateSafe(long address) static @Nullable Sockaddr.BuffercreateSafe(long address, int capacity) static Sockaddrmalloc()Returns a newSockaddrinstance allocated withmemAlloc.static Sockaddr.Buffermalloc(int capacity) Returns a newSockaddr.Bufferinstance allocated withmemAlloc.static Sockaddr.Buffermalloc(int capacity, MemoryStack stack) Returns a newSockaddr.Bufferinstance allocated on the specifiedMemoryStack.static Sockaddrmalloc(MemoryStack stack) Returns a newSockaddrinstance allocated on the specifiedMemoryStack.static ByteBuffernsa_data(long struct) Unsafe version ofsa_data().static bytensa_data(long struct, int index) Unsafe version ofsa_data.static voidnsa_data(long struct, int index, byte value) Unsafe version ofsa_data.static voidnsa_data(long struct, ByteBuffer value) Unsafe version ofsa_data.static shortnsa_family(long struct) Unsafe version ofsa_family().static voidnsa_family(long struct, short value) Unsafe version ofsa_family.sa_data()bytesa_data(int index) sa_data(int index, byte value) Sets the specified value at the specified index of thesa_datafield.sa_data(ByteBuffer value) Copies the specifiedByteBufferto thesa_datafield.shortsa_family(short value) Sets the specified value to thesa_familyfield.set(short sa_family, ByteBuffer sa_data) Initializes this struct with the specified values.Copies the specified struct data to this struct.intsizeof()Returnssizeof(struct).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. -
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 aSockaddrinstance 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). -
sa_family
public short sa_family()- Returns:
- the value of the
sa_familyfield.
-
sa_data
- Returns:
- a
ByteBufferview of thesa_datafield.
-
sa_data
public byte sa_data(int index) - Returns:
- the value at the specified index of the
sa_datafield.
-
sa_family
Sets the specified value to thesa_familyfield. -
sa_data
Copies the specifiedByteBufferto thesa_datafield. -
sa_data
Sets the specified value at the specified index of thesa_datafield. -
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 newSockaddrinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newSockaddrinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newSockaddrinstance allocated withBufferUtils. -
create
Returns a newSockaddrinstance for the specified memory address. -
createSafe
-
malloc
Returns a newSockaddr.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newSockaddr.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newSockaddr.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aSockaddr.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newSockaddrinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newSockaddrinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newSockaddr.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newSockaddr.Bufferinstance allocated on the specifiedMemoryStackand 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.
-