64 void Init(
const std::string& path);
103 std::string mTempFile;
106 [[maybe_unused]]
void* mTccState =
nullptr;
Loads and manages a single shared library (DLL / .so / .dylib) at runtime.
Definition LibraryLoader.h:30
void Unload()
Unloads the library from memory and cleans up platform resources.
void * GetFunction(const std::string &name)
Resolves an exported symbol from the loaded library.
void Init(const std::string &path)
Loads the shared library already written at path via the platform dynamic linker.
void WriteToTempFile(const std::vector< uint8_t > &data)
Writes raw library bytes to the temp file created by GenerateTempFile().
std::string GenerateTempFile()
Creates a temporary file path suitable for holding a library copy.
LibraryLoader()
Constructs an unloaded LibraryLoader with no associated library.
Definition LibraryLoader.h:35
void InitInMemory(void *tccState)
Relocates an in-memory TCC compilation unit and takes ownership of it.
Definition LibraryLoader.h:7
void(* LibraryFunc_t)(void)
Function pointer type for library entry points with no parameters and no return value.
Definition LibraryLoader.h:10
void * LibraryHandle_t
Opaque handle to a dynamically loaded shared library.
Definition LibraryLoader.h:13