diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-07-17 19:04:09 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-07-17 19:04:09 +0200 |
commit | 91d725840e2d518bd11dbd446ac133b095f03148 (patch) | |
tree | 89563160ec8f1e402df99eb1bec31c400090e2a4 /src/library_loader.c | |
parent | 078b8dd97c201ba4df77f6bae0002639764e52a6 (diff) |
Remove code duplicated from gpu-screen-recorder (opengl, display server, drm and monitors) and get that information from gpu-screen-recorder instead
Diffstat (limited to 'src/library_loader.c')
-rw-r--r-- | src/library_loader.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/library_loader.c b/src/library_loader.c deleted file mode 100644 index fed1fe5..0000000 --- a/src/library_loader.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "library_loader.h" - -#include <dlfcn.h> -#include <stdbool.h> -#include <stdio.h> - -void* dlsym_print_fail(void *handle, const char *name, bool required) { - dlerror(); - void *sym = dlsym(handle, name); - char *err_str = dlerror(); - - if(!sym) - fprintf(stderr, "%s: dlsym(handle, \"%s\") failed, error: %s\n", required ? "error" : "warning", name, err_str ? err_str : "(null)"); - - return sym; -} - -/* |dlsyms| should be null terminated */ -bool dlsym_load_list(void *handle, const dlsym_assign *dlsyms) { - bool success = true; - for(int i = 0; dlsyms[i].func; ++i) { - *dlsyms[i].func = dlsym_print_fail(handle, dlsyms[i].name, true); - if(!*dlsyms[i].func) - success = false; - } - return success; -} - -/* |dlsyms| should be null terminated */ -void dlsym_load_list_optional(void *handle, const dlsym_assign *dlsyms) { - for(int i = 0; dlsyms[i].func; ++i) { - *dlsyms[i].func = dlsym_print_fail(handle, dlsyms[i].name, false); - } -} |