Package ax.antpick.k2hash
Interface CLibrary
-
- All Superinterfaces:
com.sun.jna.Library
public interface CLibrary extends com.sun.jna.Library
This JNA interface provides functions in the C library.Usage Examples. Suppose you want to set the K2HDBGMODE enviroment "INFO" and print it, You could write this as:
package ax.antpick; import com.sun.jna.*; import com.sun.jna.ptr.*; public class App { public static void main(String[] args) { CLibrary INSTANCE = (CLibrary) Native.synchronizedLibrary(Native.loadLibrary("c", CLibrary.class)); INSTANCE.setenv("K2HDBGMODE", "INFO", 1); System.out.println(INSTANCE.getenv("K2HDBGMODE")); } }
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
free(com.sun.jna.Pointer ptr)
Frees the memory space pointed to by ptrString
getenv(String name)
Gets the value of an enviroment.int
setenv(String name, String value, int overwrite)
Adds an enviromentsint
unsetenv(String name)
Deletes an variable name from the environment.
-
-
-
Method Detail
-
free
void free(com.sun.jna.Pointer ptr)
Frees the memory space pointed to by ptr- Parameters:
ptr
- a pointer to be free
-
setenv
int setenv(String name, String value, int overwrite)
Adds an enviroments- Parameters:
name
- an environment stringvalue
- the valueoverwrite
- ifname
already exists in the environment, then itsvalue
is changed tovalue
ifoverwrite
is nonzero. Ifoverwrite
is zero, then thevalue
ofname
is not changed.- Returns:
- returns zero on success, or -1 on error, with errno set to indicate the cause of the error.
-
unsetenv
int unsetenv(String name)
Deletes an variable name from the environment.- Parameters:
name
- an environment string- Returns:
- returns zero on success, or -1 on error, with errno set to indicate the cause of the error.
-
-