Annotation Interface CFieldOffset

@Retention(RUNTIME) @Target(METHOD) public @interface CFieldOffset
Denotes a method as a field offset access of a C struct. The method must not have any parameters. The return type must be a primitive integer type or a word type.

Calls to the method are replaced with a compile time constant. If the annotation is used on a non-static method, the receiver is ignored. Java does not allow an interface method to be declared static native. So the annotated method must either be non-static (with the receiver being ignored), or static but non-native (with the method body being ignored).

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Specifies the field name inside the C struct.
  • Element Details

    • value

      String value
      Specifies the field name inside the C struct. If no name is provided, the method name is used as the field name. A possible "offsetOf" prefix of the method name is removed.