]> git.zerfleddert.de Git - proxmark3-svn/blame - client/whereami.h
Fix typo in helps
[proxmark3-svn] / client / whereami.h
CommitLineData
4197a3f6 1// (‑●‑●)> released under the WTFPL v2 license, by Gregory Pakosz (@gpakosz)
2// https://github.com/gpakosz/whereami
3
4#ifndef WHEREAMI_H
5#define WHEREAMI_H
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11#ifndef WAI_FUNCSPEC
12 #define WAI_FUNCSPEC
13#endif
14#ifndef WAI_PREFIX
15#define WAI_PREFIX(function) wai_##function
16#endif
17
18/**
19 * Returns the path to the current executable.
20 *
21 * Usage:
22 * - first call `int length = wai_getExecutablePath(NULL, 0, NULL);` to
23 * retrieve the length of the path
24 * - allocate the destination buffer with `path = (char*)malloc(length + 1);`
25 * - call `wai_getExecutablePath(path, length, NULL)` again to retrieve the
26 * path
27 * - add a terminal NUL character with `path[length] = '\0';`
28 *
29 * @param out destination buffer, optional
30 * @param capacity destination buffer capacity
31 * @param dirname_length optional recipient for the length of the dirname part
32 * of the path.
33 *
34 * @return the length of the executable path on success (without a terminal NUL
35 * character), otherwise `-1`
36 */
37WAI_FUNCSPEC
38int WAI_PREFIX(getExecutablePath)(char* out, int capacity, int* dirname_length);
39
40/**
41 * Returns the path to the current module
42 *
43 * Usage:
44 * - first call `int length = wai_getModulePath(NULL, 0, NULL);` to retrieve
45 * the length of the path
46 * - allocate the destination buffer with `path = (char*)malloc(length + 1);`
47 * - call `wai_getModulePath(path, length, NULL)` again to retrieve the path
48 * - add a terminal NUL character with `path[length] = '\0';`
49 *
50 * @param out destination buffer, optional
51 * @param capacity destination buffer capacity
52 * @param dirname_length optional recipient for the length of the dirname part
53 * of the path.
54 *
55 * @return the length of the module path on success (without a terminal NUL
56 * character), otherwise `-1`
57 */
58WAI_FUNCSPEC
59int WAI_PREFIX(getModulePath)(char* out, int capacity, int* dirname_length);
60
61#ifdef __cplusplus
62}
63#endif
64
65#endif // #ifndef WHEREAMI_H
Impressum, Datenschutz