MCPcopy Index your code
hub / github.com/java-native-access/jna / Function

Method Function

src/com/sun/jna/Function.java:240–257  ·  view source on GitHub ↗

Create a new Function that is linked with a native function that follows the given calling convention. The allocated instance represents a pointer to the named native function from the supplied library, called with the given calling convention. @param library {@lin

(NativeLibrary library, String functionName, int callFlags, String encoding)

Source from the content-addressed store, hash-verified

238 * not found within the library.
239 */
240 Function(NativeLibrary library, String functionName, int callFlags, String encoding) {
241 checkCallingConvention(callFlags & MASK_CC);
242 if (functionName == null) {
243 throw new NullPointerException("Function name must not be null");
244 }
245 this.library = library;
246 this.functionName = functionName;
247 this.callFlags = callFlags;
248 this.options = library.getOptions();
249 this.encoding = encoding != null ? encoding : Native.getDefaultStringEncoding();
250 try {
251 this.peer = library.getSymbolAddress(functionName);
252 } catch(UnsatisfiedLinkError e) {
253 throw new UnsatisfiedLinkError("Error looking up function '"
254 + functionName + "': "
255 + e.getMessage());
256 }
257 }
258
259 /**
260 * Create a new <code>Function</code> that is linked with a native

Callers

nothing calls this directly

Calls 5

getSymbolAddressMethod · 0.65
getOptionsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected