Debian Codegraph @

signature/internal/sequoia/gosequoia.h

raw
1 /*
2 * Copying and distribution of this file, with or without modification,
3 * are permitted in any medium without royalty provided the copyright
4 * notice and this notice are preserved. This file is offered as-is,
5 * without any warranty.
6 */
7
8 #ifndef GO_SEQUOIA_H_
9 #define GO_SEQUOIA_H_
10
11 #include <sequoia.h>
12
13 #if defined(GO_SEQUOIA_ENABLE_DLOPEN) && GO_SEQUOIA_ENABLE_DLOPEN
14
15 #define FUNC(ret, name, args, cargs) \
16 ret go_##name args;
17 #define VOID_FUNC FUNC
18 #include "gosequoiafuncs.h"
19 #undef VOID_FUNC
20 #undef FUNC
21
22 #define GO_SEQUOIA_FUNC(name) go_##name
23
24 #else
25
26 #define GO_SEQUOIA_FUNC(name) name
27
28 #endif /* GO_SEQUOIA_ENABLE_DLOPEN */
29
30 /* Ensure SONAME to be loaded with dlopen FLAGS, and all the necessary
31 * symbols are resolved.
32 *
33 * Returns 0 on success; negative error code otherwise.
34 *
35 * Note that this function is NOT thread-safe; when calling it from
36 * multi-threaded programs, protect it with a locking mechanism.
37 */
38 int go_sequoia_ensure_library (const char *soname, int flags);
39
40 /* Unload library and reset symbols.
41 *
42 * Note that this function is NOT thread-safe; when calling it from
43 * multi-threaded programs, protect it with a locking mechanism.
44 */
45 void go_sequoia_unload_library (void);
46
47 /* Return 1 if the library is loaded and usable.
48 *
49 * Note that this function is NOT thread-safe; when calling it from
50 * multi-threaded programs, protect it with a locking mechanism.
51 */
52 unsigned go_sequoia_is_usable (void);
53
54 #endif /* GO_SEQUOIA_H_ */