+ if ( ti_lazy_index_load(t) )
+ {
+ fprintf(stderr,"[tabix] failed to load the index file.\n");
+ return 1;
+ }
+
+ ti_iter_t iter;
+ const char *s;
+ int len;
+ if ( print_header )
+ {
+ // If requested, print the header lines here
+ iter = ti_query(t, 0, 0, 0);
+ while ((s = ti_read(t, iter, &len)) != 0) {
+ if ( *s != '#' ) break;
+ fputs(s, stdout); fputc('\n', stdout);
+ }
+ ti_iter_destroy(iter);
+ }