Skip to main content

JNA API 3.2.7

com.sun.jna
Interface FunctionMapper

All Known Implementing Classes:
StdCallFunctionMapper, W32APIFunctionMapper

public interface FunctionMapper

Provides mapping of Java method names to native function names. An instance of this interface may be provided to Native.loadLibrary(String, Class, java.util.Map) as an entry in the options map with key Library.OPTION_FUNCTION_MAPPER.

There are several circumstances where this option might prove useful.

  • C preprocessor macros are used to allow C code to refer to a library function by a different name
  • Generated linker symbols are different than those used in C code. Windows stdcall functions, for instance, are exported with a special suffix that describes the stack size of the function arguments (see StdCallFunctionMapper).
  • The naming of the C library methods conflicts horribly with your Java coding standards, or are otherwise hard to follow. It's generally better to keep the original function names in this case, to avoid confusion about what's actually being called, but the option is available.

See Also:
Library.OPTION_FUNCTION_MAPPER

Method Summary
 String getFunctionName(NativeLibrary library, Method method)
           
 

Method Detail

getFunctionName

String getFunctionName(NativeLibrary library,
                       Method method)

JNA API 3.2.7

Copyright © 2007-2010 Timothy Wall. All Rights Reserved.
 
 
Close
loading
Please Confirm
Close