Class Flock

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class Flock
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct flock64 {
         short l_type();
         short l_whence();
         off_t l_start();
         off_t l_len();
         pid_t l_pid();
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Flock.Buffer
      An array of Flock structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int L_LEN
      L_PID
      L_START
      L_TYPE
      L_WHENCE
      The struct member offsets.
      static int SIZEOF
      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

      Constructors 
      Constructor Description
      Flock​(java.nio.ByteBuffer container)
      Creates a Flock instance at the current position of the specified ByteBuffer container.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static Flock calloc()
      Returns a new Flock instance allocated with memCalloc.
      static Flock.Buffer calloc​(int capacity)
      Returns a new Flock.Buffer instance allocated with memCalloc.
      static Flock.Buffer calloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new Flock.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static Flock calloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new Flock instance allocated on the specified MemoryStack and initializes all its bits to zero.
      static Flock create()
      Returns a new Flock instance allocated with BufferUtils.
      static Flock.Buffer create​(int capacity)
      Returns a new Flock.Buffer instance allocated with BufferUtils.
      static Flock create​(long address)
      Returns a new Flock instance for the specified memory address.
      static Flock.Buffer create​(long address, int capacity)
      Create a Flock.Buffer instance at the specified memory.
      static Flock createSafe​(long address)
      Like create, but returns null if address is NULL.
      static Flock.Buffer createSafe​(long address, int capacity)
      Like create, but returns null if address is NULL.
      long l_len()
      size of the locked area; zero means until EOF
      Flock l_len​(long value)
      Sets the specified value to the l_len() field.
      int l_pid()
      process holding the lock
      Flock l_pid​(int value)
      Sets the specified value to the l_pid() field.
      long l_start()
      offset where the lock begins
      Flock l_start​(long value)
      Sets the specified value to the l_start() field.
      short l_type()
      type of lock.
      Flock l_type​(short value)
      Sets the specified value to the l_type() field.
      short l_whence()
      where l_start is relative to (like lseek)
      Flock l_whence​(short value)
      Sets the specified value to the l_whence() field.
      static Flock malloc()
      Returns a new Flock instance allocated with memAlloc.
      static Flock.Buffer malloc​(int capacity)
      Returns a new Flock.Buffer instance allocated with memAlloc.
      static Flock.Buffer malloc​(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new Flock.Buffer instance allocated on the specified MemoryStack.
      static Flock malloc​(org.lwjgl.system.MemoryStack stack)
      Returns a new Flock instance allocated on the specified MemoryStack.
      static long nl_len​(long struct)
      Unsafe version of l_len().
      static void nl_len​(long struct, long value)
      Unsafe version of l_len.
      static int nl_pid​(long struct)
      Unsafe version of l_pid().
      static void nl_pid​(long struct, int value)
      Unsafe version of l_pid.
      static long nl_start​(long struct)
      Unsafe version of l_start().
      static void nl_start​(long struct, long value)
      Unsafe version of l_start.
      static short nl_type​(long struct)
      Unsafe version of l_type().
      static void nl_type​(long struct, short value)
      Unsafe version of l_type.
      static short nl_whence​(long struct)
      Unsafe version of l_whence().
      static void nl_whence​(long struct, short value)
      Unsafe version of l_whence.
      Flock set​(short l_type, short l_whence, long l_start, long l_len, int l_pid)
      Initializes this struct with the specified values.
      Flock set​(Flock src)
      Copies the specified struct data to this struct.
      int sizeof()  
      • Methods inherited from interface org.lwjgl.system.NativeResource

        close, free
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from class org.lwjgl.system.Pointer.Default

        address, equals, hashCode, toString
      • Methods inherited from class org.lwjgl.system.Struct

        clear, free, isNull, validate
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • L_TYPE, L_WHENCE, L_START, L_LEN, L_PID

        The struct member offsets.
    • Constructor Detail

      • Flock

        public Flock​(java.nio.ByteBuffer container)
        Creates a Flock instance at the current position of the specified ByteBuffer 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 class org.lwjgl.system.Struct
      • l_whence

        public short l_whence()
        where l_start is relative to (like lseek)
      • l_start

        public long l_start()
        offset where the lock begins
      • l_len

        public long l_len()
        size of the locked area; zero means until EOF
      • l_pid

        public int l_pid()
        process holding the lock
      • l_type

        public Flock l_type​(short value)
        Sets the specified value to the l_type() field.
      • l_whence

        public Flock l_whence​(short value)
        Sets the specified value to the l_whence() field.
      • l_start

        public Flock l_start​(long value)
        Sets the specified value to the l_start() field.
      • l_len

        public Flock l_len​(long value)
        Sets the specified value to the l_len() field.
      • l_pid

        public Flock l_pid​(int value)
        Sets the specified value to the l_pid() field.
      • set

        public Flock set​(short l_type,
                         short l_whence,
                         long l_start,
                         long l_len,
                         int l_pid)
        Initializes this struct with the specified values.
      • set

        public Flock set​(Flock src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static Flock malloc()
        Returns a new Flock instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static Flock calloc()
        Returns a new Flock instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static Flock create()
        Returns a new Flock instance allocated with BufferUtils.
      • create

        public static Flock create​(long address)
        Returns a new Flock instance for the specified memory address.
      • createSafe

        @Nullable
        public static Flock createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static Flock.Buffer malloc​(int capacity)
        Returns a new Flock.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static Flock.Buffer calloc​(int capacity)
        Returns a new Flock.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static Flock.Buffer create​(int capacity)
        Returns a new Flock.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static Flock.Buffer create​(long address,
                                          int capacity)
        Create a Flock.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static Flock.Buffer createSafe​(long address,
                                              int capacity)
        Like create, but returns null if address is NULL.
      • malloc

        public static Flock malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new Flock instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static Flock calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new Flock instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static Flock.Buffer malloc​(int capacity,
                                          org.lwjgl.system.MemoryStack stack)
        Returns a new Flock.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static Flock.Buffer calloc​(int capacity,
                                          org.lwjgl.system.MemoryStack stack)
        Returns a new Flock.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nl_type

        public static short nl_type​(long struct)
        Unsafe version of l_type().
      • nl_whence

        public static short nl_whence​(long struct)
        Unsafe version of l_whence().
      • nl_start

        public static long nl_start​(long struct)
        Unsafe version of l_start().
      • nl_len

        public static long nl_len​(long struct)
        Unsafe version of l_len().
      • nl_pid

        public static int nl_pid​(long struct)
        Unsafe version of l_pid().
      • nl_type

        public static void nl_type​(long struct,
                                   short value)
        Unsafe version of l_type.
      • nl_whence

        public static void nl_whence​(long struct,
                                     short value)
        Unsafe version of l_whence.
      • nl_start

        public static void nl_start​(long struct,
                                    long value)
        Unsafe version of l_start.
      • nl_len

        public static void nl_len​(long struct,
                                  long value)
        Unsafe version of l_len.
      • nl_pid

        public static void nl_pid​(long struct,
                                  int value)
        Unsafe version of l_pid.