diff options
| -rw-r--r-- | src/disp.c | 9 | ||||
| -rw-r--r-- | src/disp.h | 2 | 
2 files changed, 11 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 @@ -30,6 +30,8 @@ struct disp {  	int  (*read_input)(void);  	void (*display_res)(bool, int);  	void (*destroy)(void); +	void *(*pre_reload)(void); +	void (*post_reload)(void *);  };  /* Get a display handler for the given display type. */ | 
