Go to the source code of this file.
◆ WAI_FUNCSPEC
◆ WAI_PREFIX
#define WAI_PREFIX |
( |
|
function | ) |
wai_##function |
◆ getExecutablePath()
Returns the path to the current executable.
Usage:
- first call
int length = wai_getExecutablePath(NULL, 0, NULL);
to retrieve the length of the path
- allocate the destination buffer with
path = (char*)malloc(length + 1);
- call
wai_getExecutablePath(path, length, NULL)
again to retrieve the path
- add a terminal NUL character with ‘path[length] = ’\0';`
- Parameters
-
out | destination buffer, optional |
capacity | destination buffer capacity |
dirname_length | optional recipient for the length of the dirname part of the path. |
- Returns
- the length of the executable path on success (without a terminal NUL character), otherwise
-1
◆ getModulePath()
Returns the path to the current module.
Usage:
- first call
int length = wai_getModulePath(NULL, 0, NULL);
to retrieve the length of the path
- allocate the destination buffer with
path = (char*)malloc(length + 1);
- call
wai_getModulePath(path, length, NULL)
again to retrieve the path
- add a terminal NUL character with ‘path[length] = ’\0';`
- Parameters
-
out | destination buffer, optional |
capacity | destination buffer capacity |
dirname_length | optional recipient for the length of the dirname part of the path. |
- Returns
- the length of the module path on success (without a terminal NUL character), otherwise
-1