From ff26b9b60c2e9084fbf86c93b5974407061df2a5 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 29 Nov 2023 01:53:30 +0100 Subject: Add av1 option, add option to install polkit rule in flatpak to remove password prompts --- src/library_loader.h | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'src/library_loader.h') diff --git a/src/library_loader.h b/src/library_loader.h index fbd9cdf..47bc9f0 100644 --- a/src/library_loader.h +++ b/src/library_loader.h @@ -1,35 +1,17 @@ #ifndef GSR_LIBRARY_LOADER_H #define GSR_LIBRARY_LOADER_H -#include #include -#include typedef struct { void **func; const char *name; } dlsym_assign; -static 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; -} - +void* dlsym_print_fail(void *handle, const char *name, bool required); +/* |dlsyms| should be null terminated */ +bool dlsym_load_list(void *handle, const dlsym_assign *dlsyms); /* |dlsyms| should be null terminated */ -static 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; -} +void dlsym_load_list_optional(void *handle, const dlsym_assign *dlsyms); #endif /* GSR_LIBRARY_LOADER_H */ -- cgit v1.2.3