From 4cb29fbc2d20f20e9d605796b137b4b70363113a Mon Sep 17 00:00:00 2001 From: 0scar Date: Fri, 28 Jul 2023 16:32:58 +0200 Subject: Implement hotloading * This commit implements dltools.{c,h}: _A simple wrapper around libdl / dlfcn.h_ * Reload states when done initializing engine, if hotloading is enabled. * Adds general function types for state functions. --- include/engine/dltools.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 include/engine/dltools.h (limited to 'include/engine/dltools.h') diff --git a/include/engine/dltools.h b/include/engine/dltools.h new file mode 100644 index 0000000..9306ae7 --- /dev/null +++ b/include/engine/dltools.h @@ -0,0 +1,14 @@ +#ifndef DLTOOLS_H +#define DLTOOLS_H + +/* Utility functions for handling runtime linked shared libraries */ +bool dynamic_library_close(void* shared_library); +void* dynamic_library_open(const char *library_path); +void* dynamic_library_reload(void* shared_library, const char *library_path); + +/* Returns the address of symbol in the provided shared_library handle. + * NULL on error*/ +void* dynamic_library_get_symbol(void* shared_library, const char *symbol); +char* dynamic_library_get_error(void); + +#endif -- cgit v1.3