Package ax.antpick.k2hash
Interface CLibrary
-
- All Superinterfaces:
com.sun.jna.Library
public interface CLibrary extends com.sun.jna.LibraryThis 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 voidfree(com.sun.jna.Pointer ptr)Frees the memory space pointed to by ptrStringgetenv(String name)Gets the value of an enviroment.intsetenv(String name, String value, int overwrite)Adds an enviromentsintunsetenv(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- ifnamealready exists in the environment, then itsvalueis changed tovalueifoverwriteis nonzero. Ifoverwriteis zero, then thevalueofnameis 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.
-
-