diff options
| author | fschildt <florian.schildt@protonmail.com> | 2025-08-22 15:23:11 +0200 | 
|---|---|---|
| committer | fschildt <florian.schildt@protonmail.com> | 2025-10-15 11:33:23 +0200 | 
| commit | 04e4627e6c11254ee6f49edf5feb1b8d711da41a (patch) | |
| tree | e28f2e62d3e1b83f9686cdeb102e3f47379e6793 /src/os/linux/linux_library.c | |
Diffstat (limited to 'src/os/linux/linux_library.c')
| -rw-r--r-- | src/os/linux/linux_library.c | 25 | 
1 files changed, 25 insertions, 0 deletions
diff --git a/src/os/linux/linux_library.c b/src/os/linux/linux_library.c new file mode 100644 index 0000000..bd9efe1 --- /dev/null +++ b/src/os/linux/linux_library.c @@ -0,0 +1,25 @@ +#include <dlfcn.h> +#include <stdio.h> +#include <SDL2/SDL.h> + +typedef void PlatformLibrary; + +PlatformLibrary *platform_library_open(const char *path) { +    void *handle = dlopen(path, RTLD_NOW); +    if (!handle) { +        printf("could not open library %s\n", path); +        return 0; +    } + +    return handle; +} + +void platform_library_close(PlatformLibrary *handle) { +    dlclose(handle); +} + +void *platform_library_get_proc(PlatformLibrary *handle, const char *name) { +    void *addr = dlsym(handle, name); +    return addr; +} +  | 
