Class LibDivideU32

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

    public class LibDivideU32
    extends Struct
    implements NativeResource

    Layout

    
     struct libdivide_u32_t {
         uint32_t magic;
         uint8_t more;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MAGIC, MORE

        The struct member offsets.
    • Constructor Detail

      • LibDivideU32

        public LibDivideU32​(java.nio.ByteBuffer container)
        Creates a LibDivideU32 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • magic

        public int magic()
        Returns the value of the magic field.
      • more

        public byte more()
        Returns the value of the more field.
      • magic

        public LibDivideU32 magic​(int value)
        Sets the specified value to the magic field.
      • more

        public LibDivideU32 more​(byte value)
        Sets the specified value to the more field.
      • set

        public LibDivideU32 set​(int magic,
                                byte more)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

        public static LibDivideU32 mallocStack()
        Returns a new LibDivideU32 instance allocated on the thread-local MemoryStack.
      • callocStack

        public static LibDivideU32 callocStack()
        Returns a new LibDivideU32 instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static LibDivideU32 mallocStack​(MemoryStack stack)
        Returns a new LibDivideU32 instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

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

        public static LibDivideU32.Buffer callocStack​(int capacity)
        Returns a new LibDivideU32.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static LibDivideU32.Buffer callocStack​(int capacity,
                                                      MemoryStack stack)
        Returns a new LibDivideU32.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
      • nmagic

        public static int nmagic​(long struct)
        Unsafe version of magic().
      • nmore

        public static byte nmore​(long struct)
        Unsafe version of more().
      • nmagic

        public static void nmagic​(long struct,
                                  int value)
        Unsafe version of magic.
      • nmore

        public static void nmore​(long struct,
                                 byte value)
        Unsafe version of more.