intarsys nativeC library

de.intarsys.nativec.api
Interface INativeInterface


public interface INativeInterface

The abstraction of a generic interface to c native code.


Method Summary
 void addSearchPath(String path)
          Add a directory to the search path.
 INativeHandle allocate(int size)
          Allocate c memory and return the respective INativeHandle.
 INativeCallback createCallback(ICallback callback)
           
 INativeHandle createHandle(ByteBuffer buffer)
          Allocate c memory (if necessary) from buffer.
 INativeHandle createHandle(long address)
          Create a void INativeHandle to a memory address.
 INativeLibrary createLibrary(String name)
          Load a new INativeLibrary.
 int longSize()
          The platform long size.
 int pointerSize()
          The platform pointer size.
 int wideCharSize()
          The platform wide char size.
 

Method Detail

addSearchPath

void addSearchPath(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 respective INativeHandle.

Parameters:
size - The size in bytes.
Returns:
The new allocated INativeHandle

createCallback

INativeCallback createCallback(ICallback callback)

createHandle

INativeHandle createHandle(ByteBuffer buffer)
Allocate c memory (if necessary) from buffer. The new memory will have the same content as buffer.

This method may NOT allocate c memory if buffer is a direct buffer.

Parameters:
buffer - The date for the new memory chunk.
Returns:
The new allocated memory handle.

createHandle

INativeHandle createHandle(long address)
Create a void INativeHandle to 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(String name)
Load a new INativeLibrary.

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.

intarsys nativeC library

Copyright © 2008 intarsys consulting GmbH. All Rights Reserved.