Debian Codegraph @

crt/aws-c-io/include/aws/io/shared_library.h

raw symbols SCIP
1 #ifndef AWS_COMMON_SHARED_LIBRARY_H
2 #define AWS_COMMON_SHARED_LIBRARY_H
3
4 /**
5 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6 * SPDX-License-Identifier: Apache-2.0.
7 */
8
9 #include <aws/io/io.h>
10
11 AWS_PUSH_SANE_WARNING_LEVEL
12
13 struct aws_byte_cursor;
14
15 /*
16 * A simple platform wrapper for dynamically loading and examining shared libraries
17 */
18 struct aws_shared_library {
19 void *library_handle;
20 };
21
22 typedef void (*aws_generic_function)(void);
23
24 AWS_EXTERN_C_BEGIN
25
26 /*
27 * Initializes a dynamically-loaded shared library from its file path location
28 */
29 AWS_IO_API
30 int aws_shared_library_init(struct aws_shared_library *library, const char *library_path);
31
32 /*
33 * Closes a dynamically-loaded shared library
34 */
35 AWS_IO_API
36 void aws_shared_library_clean_up(struct aws_shared_library *library);
37
38 /*
39 * Finds a function symbol within a shared library. function_address may be
40 * safely cast into any other function type as appropriate.
41 */
42 AWS_IO_API
43 int aws_shared_library_find_function(
44 struct aws_shared_library *library,
45 const char *symbol_name,
46 aws_generic_function *function_address);
47
48 AWS_EXTERN_C_END
49 AWS_POP_SANE_WARNING_LEVEL
50
51 #endif /* AWS_COMMON_SHARED_LIBRARY_H */