Package de.intarsys.nativec.api
Interface INativeInterface
-
- All Known Implementing Classes:
JnaNativeInterface
public interface INativeInterfaceThe abstraction of a generic interface to c native code.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddSearchPath(java.lang.String path)Add a directory to the search path.INativeHandleallocate(int size)Allocate c memory and return the respectiveINativeHandle.INativeCallbackcreateCallback(ICallback callback)INativeFunctioncreateFunction(long address)Create anINativeFunctionfrom a function pointer.INativeHandlecreateHandle(long address)Create a voidINativeHandleto a memory address.INativeLibrarycreateLibrary(java.lang.String name)Load a newINativeLibrary.intlongSize()The platform long size.intpointerSize()The platform pointer size.intwideCharSize()The platform wide char size.
-
-
-
Method Detail
-
addSearchPath
void addSearchPath(java.lang.String path)
Add a directory to the search path.- Parameters:
path- The path to be added;
-
allocate
INativeHandle allocate(int size)
Allocate c memory and return the respectiveINativeHandle.- Parameters:
size- The size in bytes.- Returns:
- The new allocated
INativeHandle
-
createCallback
INativeCallback createCallback(ICallback callback)
-
createFunction
INativeFunction createFunction(long address)
Create anINativeFunctionfrom a function pointer.There is no special handling for the 0 address!
- Parameters:
address- The function pointer.- Returns:
- The function object.
-
createHandle
INativeHandle createHandle(long address)
Create a voidINativeHandleto a memory address.There is no special handling for the 0 address!
- Parameters:
address- The memory address.- Returns:
- The handle to the memory address.
-
createLibrary
INativeLibrary createLibrary(java.lang.String name)
Load a newINativeLibrary.- Parameters:
name- The name of the library to load.- Returns:
- The new
INativeLibrary
-
longSize
int longSize()
The platform long size.- Returns:
- The platform long size.
-
pointerSize
int pointerSize()
The platform pointer size.- Returns:
- The platform pointer size.
-
wideCharSize
int wideCharSize()
The platform wide char size.- Returns:
- The platform wide char size.
-
-