]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_tview_curses.c
cont
[samtools.git] / bam_tview_curses.c
index d943cdd9b82f3c8db6aa0acaec10c77118103f40..4fdd1fb66be93292dc9c952729215e0f31711b8b 100644 (file)
@@ -1,6 +1,27 @@
+#undef _HAVE_CURSES
+
+#if _CURSES_LIB == 0
+#elif _CURSES_LIB == 1
 #include <curses.h>
+#ifndef NCURSES_VERSION
+#warning "_CURSES_LIB=1 but NCURSES_VERSION not defined; tview is NOT compiled"
+#else
+#define _HAVE_CURSES
+#endif
+#elif _CURSES_LIB == 2
+#include <xcurses.h>
+#define _HAVE_CURSES
+#else
+#warning "_CURSES_LIB is not 0, 1 or 2; tview is NOT compiled"
+#endif
+
+
 #include "bam_tview.h"
 
+#ifdef _HAVE_CURSES
+
+
+
 typedef struct CursesTview {
        tview_t view;
        WINDOW *wgoto, *whelp;
@@ -261,5 +282,16 @@ tview_t* curses_tv_init(const char *fn, const char *fn_fa, const char *samples)
        }
 
 
+#else // #ifdef _HAVE_CURSES
+#include <stdio.h>
+#warning "No curses library is available; tview with curses is disabled."
+
+extern tview_t* text_tv_init(const char *fn, const char *fn_fa, const char *samples);
+
+tview_t* curses_tv_init(const char *fn, const char *fn_fa, const char *samples)
+       {
+       return text_tv_init(fn,fn_fa,samples);
+       }
+#endif // #ifdef _HAVE_CURSES