Go to the source code of this file.
if (!handle) {
return -1;
}
int(*)(int),
);
if (my_func) {
int result = my_func(42);
}
l61_rosetta_SharedLibrary_symbol_t l61_rosetta_getSharedLibrarySymbol(l61_rosetta_SharedLibrary_handle_t handle, const char *symbol)
Definition loadSharedLibrary.c:42
#define L61_ROSETTA_CAST_SYMBOL(type, symbol)
Definition loadSharedLibrary.h:71
int l61_rosetta_unloadSharedLibrary(l61_rosetta_SharedLibrary_handle_t handle)
Definition loadSharedLibrary.c:52
l61_rosetta_SharedLibrary_handle_t l61_rosetta_loadSharedLibrary(const char *file)
Definition loadSharedLibrary.c:31
const char * l61_rosetta_getSharedLibraryLoaderError()
Definition loadSharedLibrary.c:62
◆ L61_ROSETTA_CAST_SYMBOL
#define L61_ROSETTA_CAST_SYMBOL |
( |
| type, |
|
|
| symbol ) |
◆ l61_rosetta_getSharedLibraryLoaderError()
const char * l61_rosetta_getSharedLibraryLoaderError |
( |
| ) |
|
Retrieves a description of the last shared library loading error. On POSIX systems, this wraps dlerror(). On Windows, it provides a formatted system error message.
- Warning
- The returned string is stored in thread-local storage on POSIX systems but uses a static buffer on Windows (not thread-safe on Windows).
- Returns
- A pointer to a string describing the last error. !!DO NOT FREE!!
◆ l61_rosetta_getSharedLibrarySymbol()
Gets a symbol from a shared library.
- Parameters
-
handle | Handle to the loaded library. |
symbol | Name of the symbol to retrieve. |
- Warning
- Do mind C++ symbol mangling
- Returns
- Pointer to the requested symbol, or NULL if the symbol is not found.
◆ l61_rosetta_loadSharedLibrary()
Loads a shared library.
- Parameters
-
- Returns
- Handle to the loaded library, or NULL on failure.
◆ l61_rosetta_unloadSharedLibrary()
Unloads a shared library.
- Parameters
-
handle | Handle to the loaded library. |
- Returns
- 0 on success, -1 on failure.