@Retention(value=RUNTIME) @Target(value=METHOD) public @interface CFunction
native
method that calls directly from Java to C, without following the JNI
protocol. This means that there are no artificial additional parameters such as the JNI
environment passed, and no marshaling or processing of arguments (such as creating handles for
objects) is performed. If the method is non-static, the receiver will be ignored.
Parameter types and return types must not be Java reference types, only
primitive Java types, word types and
CEnum
types are allowed. The representation of passed primitive values matches exactly
how they are specified in the Java language, for example, int
as a 32-bit signed integer
or char
as a 16-bit unsigned integer. boolean
is specified as a single byte that
corresponds to true
if non-zero, and to false
if zero. If a Word value is passed
that points to a Java object, no guarantees are taken regarding its integrity as a pointer.
The class containing the annotated method must be annotated with CContext
.
Modifier and Type | Optional Element and Description |
---|---|
CFunction.Transition |
transition
The Java-to-C thread transition code used when calling the function.
|
String |
value
The symbol name to use to link this method.
|
public abstract String value
public abstract CFunction.Transition transition