Class OpenHow

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class OpenHow extends Struct<OpenHow> implements NativeResource

 struct open_how {
     __u64 flags;
     __u64 mode;
     __u64 resolve;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • FLAGS

      public static final int FLAGS
      The struct member offsets.
    • MODE

      public static final int MODE
      The struct member offsets.
    • RESOLVE

      public static final int RESOLVE
      The struct member offsets.
  • Constructor Details

    • OpenHow

      public OpenHow(ByteBuffer container)
      Creates a OpenHow 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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<OpenHow>
    • flags

      public long flags()
      Returns:
      the value of the flags field.
    • mode

      public long mode()
      Returns:
      the value of the mode field.
    • resolve

      public long resolve()
      Returns:
      the value of the resolve field.
    • flags

      public OpenHow flags(long value)
      Sets the specified value to the flags field.
    • mode

      public OpenHow mode(long value)
      Sets the specified value to the mode field.
    • resolve

      public OpenHow resolve(long value)
      Sets the specified value to the resolve field.
    • set

      public OpenHow set(long flags, long mode, long resolve)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static long nflags(long struct)
      Unsafe version of flags().
    • nmode

      public static long nmode(long struct)
      Unsafe version of mode().
    • nresolve

      public static long nresolve(long struct)
      Unsafe version of resolve().
    • nflags

      public static void nflags(long struct, long value)
      Unsafe version of flags.
    • nmode

      public static void nmode(long struct, long value)
      Unsafe version of mode.
    • nresolve

      public static void nresolve(long struct, long value)
      Unsafe version of resolve.