diff options
Diffstat (limited to 'src/disp.c')
-rw-r--r-- | src/disp.c | 23 |
1 files changed, 20 insertions, 3 deletions
@@ -25,6 +25,13 @@ #include "disp.h" +#ifdef NDEBUG +extern struct disp *cli_disp; +extern struct disp *tui_disp; +extern struct disp *ray_disp; +#endif + +#ifndef NDEBUG static void * load_generic_symbol(struct disp *disp, char *base_name) { @@ -46,8 +53,9 @@ load_generic_symbol(struct disp *disp, char *base_name) return ptr; } +#endif - +#ifndef NDEBUG static void load_symbols(struct disp *disp) { @@ -72,6 +80,7 @@ load_symbols(struct disp *disp) printf("INFO: successfully loaded symbols from \"%s\"\n", disp->so_path); } +#endif struct disp * get_disp(char *disp_name) @@ -90,9 +99,15 @@ get_disp(char *disp_name) return disp; #else -# error "not available yet" -#endif + if (strcmp(disp_name, "cli") == 0) + return cli_disp; + if (strcmp(disp_name, "tui") == 0) + return tui_disp; + if (strcmp(disp_name, "ray") == 0) + return ray_disp; + return NULL; +#endif } void @@ -101,11 +116,13 @@ destroy_disp(struct disp *disp) if (disp->destroy) disp->destroy(); +#ifndef NDEBUG if (disp->dl_handle) dlclose(disp->dl_handle); free(disp->so_path); free(disp); +#endif } #ifndef NDEBUG |