Go to the source code of this file.
◆ rcutils_shared_library_t
Handle to a loaded shared library.
◆ rcutils_get_zero_initialized_shared_library()
Return an empty shared library struct.
This function returns an empty and zero initialized shared library struct.
Example:
◆ rcutils_load_shared_library()
Return shared library pointer.
- Parameters
-
[in,out] | lib | struct with the shared library pointer and shared library path name |
[in] | library_path | string with the path of the library |
[in] | allocator | to be used to allocate and deallocate memory |
- Returns
- RCUTILS_RET_OK if successful, or
-
RCUTILS_RET_BAD_ALLOC if memory allocation fails, or
-
RCUTILS_RET_ERROR if an unknown error occurs, or
-
RCUTILS_RET_INVALID_ARGUMENT for invalid arguments.
◆ rcutils_get_symbol()
Return shared library symbol pointer.
- Parameters
-
[in] | lib | struct with the shared library pointer and shared library path name |
[in] | symbol_name | name of the symbol inside the shared library |
- Returns
- shared library symbol pointer, or
-
NULL
if the symbol doesn't exist.
◆ rcutils_has_symbol()
Return true if the shared library contains a specific symbol name otherwise returns false.
- Parameters
-
[in] | lib | struct with the shared library pointer and shared library path name |
[in] | symbol_name | name of the symbol inside the shared library |
- Returns
true
if the symbol exists, or
-
false
otherwise.
◆ rcutils_unload_shared_library()
◆ rcutils_is_shared_library_loaded()
Check if the library is loaded.
This function only determines if "unload" has been called on the current shared library handle. It could very well be that a second shared library handle is still open and therefore the library being loaded.
- Parameters
-
- Returns
true
if library is loaded, or
-
false
otherwise.
◆ rcutils_get_platform_library_name()
rcutils_ret_t rcutils_get_platform_library_name |
( |
const char * |
library_name, |
|
|
char * |
library_name_platform, |
|
|
unsigned int |
buffer_size, |
|
|
bool |
debug |
|
) |
| |
Get the library name for the compiled platform.
- Parameters
-
[in] | library_name | library base name (without prefix and extension) |
[out] | library_name_platform | library name for the compiled platform |
[in] | buffer_size | size of library_name_platform buffer |
[in] | debug | if true the library will return a debug library name, otherwise it returns a normal library path |
- Returns
- RCUTILS_RET_OK if successful, or
-
RCUTILS_RET_ERROR if an unknown error occurs
bool rcutils_has_symbol(const rcutils_shared_library_t *lib, const char *symbol_name)
Return true if the shared library contains a specific symbol name otherwise returns false.
rcutils_ret_t rcutils_load_shared_library(rcutils_shared_library_t *lib, const char *library_path, rcutils_allocator_t allocator)
Return shared library pointer.