aboutsummaryrefslogtreecommitdiff
path: root/src/disp.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/disp.c')
-rw-r--r--src/disp.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/disp.c b/src/disp.c
index 8a1a174..26bb2f2 100644
--- a/src/disp.c
+++ b/src/disp.c
@@ -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