Class NativeLayout

java.lang.Object
club.doki7.ffm.NativeLayout

public final class NativeLayout extends Object
  • Field Details

  • Method Details

    • readCLong

      public static long readCLong(@NotNull @NotNull MemorySegment segment, long offset)
    • writeCLong

      public static void writeCLong(@NotNull @NotNull MemorySegment segment, long offset, long value)
    • readCSizeT

      @Unsigned public static long readCSizeT(@NotNull @NotNull MemorySegment segment, long offset)
    • writeCSizeT

      public static void writeCSizeT(@NotNull @NotNull MemorySegment segment, long offset, @Unsigned long value)
    • readWCharT

      @Unsigned public static int readWCharT(@NotNull @NotNull MemorySegment segment, long offset)
    • writeWCharT

      public static void writeWCharT(@NotNull @NotNull MemorySegment segment, long offset, int value)
    • structLayout

      @NotNull public static @NotNull StructLayout structLayout(@NotNull @NotNull MemoryLayout... elements)
      Unlike MemoryLayout.structLayout, this function will automatically compute and add padding to the layout to ensure that each element is properly aligned. The resulting layout should be the same with a C struct layout.
      Parameters:
      elements - the elements of the struct
      Returns:
      the struct layout
    • unionLayout

      @NotNull public static @NotNull UnionLayout unionLayout(@NotNull @NotNull MemoryLayout... elements)