Class HookList

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class HookList extends ProxyInstance
The GHookList struct represents a list of hook functions.
  • Constructor Details

    • HookList

      public HookList(MemorySegment address)
      Create a HookList proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • HookList

      public HookList(Arena arena)
      Allocate a new HookList.
      Parameters:
      arena - to control the memory allocation scope
    • HookList

      public HookList()
      Allocate a new HookList. The memory is allocated with Arena.ofAuto().
    • HookList

      public HookList(int seqId, Hook hooks, MemorySegment dummy3, HookFinalizeFunc finalizeHook, MemorySegment[] dummy, Arena arena)
      Allocate a new HookList with the fields set to the provided values.
      Parameters:
      seqId - value for the field seqId
      hooks - value for the field hooks
      dummy3 - value for the field dummy3
      finalizeHook - value for the field finalizeHook
      dummy - value for the field dummy
      arena - to control the memory allocation scope
    • HookList

      public HookList(int seqId, Hook hooks, MemorySegment dummy3, HookFinalizeFunc finalizeHook, MemorySegment[] dummy)
      Allocate a new HookList with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      seqId - value for the field seqId
      hooks - value for the field hooks
      dummy3 - value for the field dummy3
      finalizeHook - value for the field finalizeHook
      dummy - value for the field dummy
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readSeqId

      public int readSeqId()
      Read the value of the field seq_id.
      Returns:
      The value of the field seq_id
    • writeSeqId

      public void writeSeqId(int seqId)
      Write a value in the field seq_id.
      Parameters:
      seqId - The new value for the field seq_id
    • readHooks

      public Hook readHooks()
      Read the value of the field hooks.
      Returns:
      The value of the field hooks
    • writeHooks

      public void writeHooks(Hook hooks)
      Write a value in the field hooks.
      Parameters:
      hooks - The new value for the field hooks
    • readDummy3

      public MemorySegment readDummy3()
      Read the value of the field dummy3.
      Returns:
      The value of the field dummy3
    • writeDummy3

      public void writeDummy3(MemorySegment dummy3)
      Write a value in the field dummy3.
      Parameters:
      dummy3 - The new value for the field dummy3
    • readFinalizeHook

      public @Nullable HookFinalizeFunc readFinalizeHook()
      Read the value of the field finalize_hook.
      Returns:
      The value of the field finalize_hook
    • writeFinalizeHook

      public void writeFinalizeHook(@Nullable HookFinalizeFunc finalizeHook, Arena _arena)
      Write a value in the field finalize_hook.
      Parameters:
      finalizeHook - The new value for the field finalize_hook
      _arena - to control the memory allocation scope
    • readDummy

      public @Nullable MemorySegment @Nullable [] readDummy()
      Read the value of the field dummy.
      Returns:
      The value of the field dummy
    • writeDummy

      public void writeDummy(@Nullable MemorySegment @Nullable [] dummy, Arena _arena)
      Write a value in the field dummy.
      Parameters:
      dummy - The new value for the field dummy
    • clear

      public void clear()
      Removes all the GHook elements from a GHookList.
    • init

      public void init(int hookSize)
      Initializes a GHookList. This must be called before the GHookList is used.
      Parameters:
      hookSize - the size of each element in the GHookList, typically sizeof (GHook).
    • invoke

      public void invoke(boolean mayRecurse)
      Calls all of the GHook functions in a GHookList.
      Parameters:
      mayRecurse - true if functions which are already running (e.g. in another thread) can be called. If set to false, these are skipped
    • invokeCheck

      public void invokeCheck(boolean mayRecurse)
      Calls all of the GHook functions in a GHookList. Any function which returns false is removed from the GHookList.
      Parameters:
      mayRecurse - true if functions which are already running (e.g. in another thread) can be called. If set to false, these are skipped
    • marshal

      public void marshal(boolean mayRecurse, @Nullable HookMarshaller marshaller)
      Calls a function on each valid GHook.
      Parameters:
      mayRecurse - true if hooks which are currently running (e.g. in another thread) are considered valid. If set to false, these are skipped
      marshaller - the function to call for each GHook
    • marshalCheck

      public void marshalCheck(boolean mayRecurse, @Nullable HookCheckMarshaller marshaller)
      Calls a function on each valid GHook and destroys it if the function returns false.
      Parameters:
      mayRecurse - true if hooks which are currently running (e.g. in another thread) are considered valid. If set to false, these are skipped
      marshaller - the function to call for each GHook