diff options
author | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-22 16:19:05 +0900 |
---|---|---|
committer | Tristan Riehs <tristan.riehs@bordeaux-inp.fr> | 2024-06-22 16:19:05 +0900 |
commit | 7119092665e1b771b04b305813be81e9892dfc1b (patch) | |
tree | 3856526163d627c16e83d86873337aea03199b16 /src/disp.h | |
parent | 14e0d1887808a3d8233dd14877bce7da2fe8ca12 (diff) |
Improve disp API and implement dynamic reload
Diffstat (limited to 'src/disp.h')
-rw-r--r-- | src/disp.h | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -18,11 +18,19 @@ #define DISP_H #include <stdbool.h> +#include <limits.h> /* Available display types. */ #define DISP_CLI "cli" #define DISP_RAY "ray" +/* Reserved return values for the read_input function. */ +#ifndef NDEBUG +# define DISP_RELOAD INT_MAX +#endif +#define DISP_QUIT (INT_MAX - 1) +#define DISP_ERR (INT_MAX - 2) + struct disp { void *dl_handle; void (*init)(void); @@ -30,13 +38,19 @@ struct disp { int (*read_input)(void); void (*display_res)(bool, int); void (*destroy)(void); +#ifndef NDEBUG + char *so_path; void *(*pre_reload)(void); void (*post_reload)(void *); +#endif }; /* Get a display handler for the given display type. */ -struct disp *get_disp(char *disp_name); +struct disp *get_disp(char *); +void destroy_disp(struct disp *); -void destroy_disp(void); +#ifndef NDEBUG +void disp_reload(struct disp *); +#endif /* NDEBUG */ -#endif +#endif /* DISP_H */ |