diff options
Diffstat (limited to 'src/disp.c')
-rw-r--r-- | src/disp.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -17,6 +17,7 @@ #include "config.h" #include <dlfcn.h> +#include <limits.h> #include <string.h> #include <stdio.h> #include <stdlib.h> @@ -24,6 +25,10 @@ #include "disp.h" +/* Reserved return values for the read_input function. */ +#define DISP_ERR INT_MAX +#define DISP_RELOAD (INT_MAX - 1) + #define dlsym_and_check(dest, name) \ dest->name = dlsym(dest->dl_handle, #name); \ if ((!dest->name) || (dest->name == dest->dl_handle)) { \ @@ -52,6 +57,8 @@ get_disp(char *disp_name) exit(1); } + printf("INFO: successfully loaded symbols from \"%s\"\n", so_path); + struct disp *disp = malloc(sizeof(*disp)); disp->dl_handle = handle; dlsym_and_check(disp, init); @@ -59,6 +66,8 @@ get_disp(char *disp_name) dlsym_and_check(disp, read_input); dlsym_and_check(disp, display_res); dlsym_and_check(disp, destroy); + dlsym_and_check(disp, pre_reload); + dlsym_and_check(disp, post_reload); return disp; #else |