Package uk.co.caprica.vlcj.binding
Interface LibC
-
- All Superinterfaces:
com.sun.jna.Library
public interface LibC extends com.sun.jna.LibraryMinimal interface to the standard "C" library.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int_putenv(String envstring)Closest Windows equivalent tosetenv(String, String, int).intgetpid()Get the current process id.intmlock(com.sun.jna.Pointer addr, com.sun.jna.NativeLong length)Locks (pins) parts of virtual address space into RAM so it can not be swapped out.intmunlock(com.sun.jna.Pointer addr, com.sun.jna.NativeLong length)Unlock previously locked memory.intsetenv(String name, String value, int overwrite)Change or add an evironment variable.intunsetenv(String name)Unset an environment variable.intvsnprintf(ByteBuffer str, int size, String format, com.sun.jna.Pointer args)Format a string with a variable arguments list into a fixed size buffer.
-
-
-
Field Detail
-
INSTANCE
static final LibC INSTANCE
Native library instance.
-
-
Method Detail
-
vsnprintf
int vsnprintf(ByteBuffer str, int size, String format, com.sun.jna.Pointer args)
Format a string with a variable arguments list into a fixed size buffer.The resultant string will be truncated to the size of the buffer if it would otherwise exceed it.
For example, if the buffer has a capacity of 10 this is a maximum of 9 characters plus a null terminator for a total capacity of 10. This means if 10 characters are required, the buffer capacity must be 11 to accommodate the null terminator.
- Parameters:
str- buffersize- capacity of the buffer, including space for a null terminatorformat- format stringargs- format arguments- Returns:
- length of the formatted string, which may exceed the capacity of the buffer, or less than zero on error
-
mlock
int mlock(com.sun.jna.Pointer addr, com.sun.jna.NativeLong length)Locks (pins) parts of virtual address space into RAM so it can not be swapped out.- Parameters:
addr- address pointerlength- length- Returns:
- 0 if successful; -1 if not, setting
errnoto an error code
-
munlock
int munlock(com.sun.jna.Pointer addr, com.sun.jna.NativeLong length)Unlock previously locked memory.- Parameters:
addr- address pointerlength- length- Returns:
- 0 if successful; -1 if not, setting
errnoto an error code
-
setenv
int setenv(String name, String value, int overwrite)
Change or add an evironment variable.The value strings are copied (natively).
Not available on Windows.
- Parameters:
name- name of environment variablevalue- value of the environment variableoverwrite- non-zero to replace any existing value- Returns:
- 0 if successful; -1 if not, setting
errnoto an error code
-
unsetenv
int unsetenv(String name)
Unset an environment variable.Not available on Windows.
- Parameters:
name- name of environment variable- Returns:
- 0 if successful; -1 if not, setting
errnoto an error code
-
getpid
int getpid()
Get the current process id.Not available on Windows.
- Returns:
- process id
-
_putenv
int _putenv(String envstring)
Closest Windows equivalent tosetenv(String, String, int).Note that after setting an environment variable, it will not show up via System#getenv even if it was successfully set.
Use with case, it is not guaranteed to be thread-safe.
Only available on Windows.
- Parameters:
envstring- variable and value to set, in the format "variable=value", without quotes.- Returns:
- zero on success, non-zero on error
-
-