]> git.donarmstrong.com Git - samtools.git/blobdiff - bam_tview.c
* samtools-0.1.4-10 (r341)
[samtools.git] / bam_tview.c
index c6780c302c285bf6dbcad4bd378d9514fa5deefb..60b7350b92db8fbf08d45156c638b6d891f426f2 100644 (file)
@@ -1,5 +1,6 @@
 #ifndef _NO_CURSES
 #include <curses.h>
+#ifdef NCURSES_VERSION
 #include <ctype.h>
 #include <assert.h>
 #include <string.h>
@@ -7,6 +8,10 @@
 #include "faidx.h"
 #include "bam_maqcns.h"
 
+char bam_aux_getCEi(bam1_t *b, int i);
+char bam_aux_getCSi(bam1_t *b, int i);
+char bam_aux_getCQi(bam1_t *b, int i);
+
 #define TV_MIN_ALNROW 2
 #define TV_MAX_GOTO  40
 #define TV_LOW_MAPQ  10
@@ -154,6 +159,7 @@ int tv_pl_func(uint32_t tid, uint32_t pos, int n, const bam_pileup1_t *pl, void
 tview_t *tv_init(const char *fn, const char *fn_fa)
 {
        tview_t *tv = (tview_t*)calloc(1, sizeof(tview_t));
+       tv->is_dot = 1;
        tv->idx = bam_index_load(fn);
        tv->fp = bam_open(fn, "r");
        assert(tv->fp);
@@ -302,7 +308,7 @@ void tv_loop(tview_t *tv)
        tid = tv->curr_tid; pos = tv->left_pos;
        while (1) {
                int c = getch();
-               if(256 < c) {c = 1 + (c%256);} // Terminal was displaying ctrl-H as 263 via ssh from Mac OS X 10.5 computer 
+               //if(256 < c) {c = 1 + (c%256);} // Terminal was displaying ctrl-H as 263 via ssh from Mac OS X 10.5 computer 
                switch (c) {
                        case '?': tv_win_help(tv); break;
                        case '\033':
@@ -360,4 +366,12 @@ int bam_tview_main(int argc, char *argv[])
        tv_destroy(tv);
        return 0;
 }
+#else // #ifdef NCURSES_VERSION
+#warning "The ncurses library is unavailable; tview is disabled."
+int bam_tview_main(int argc, char *argv[])
+{
+       fprintf(stderr, "[bam_tview_main] The ncurses library is unavailable; tview is not compiled.\n");
+       return 1;
+}
 #endif
+#endif // #ifndef _NO_CURSES