f4ab269ea813af98072a989a40558e5d7425512a
angie
  Mon Aug 22 10:48:02 2011 -0700
Fix for compiling without USE_BAM: bamFile.h needs to define bam_index_t.
diff --git src/inc/bamFile.h src/inc/bamFile.h
index 911d72c..2c876c7 100644
--- src/inc/bamFile.h
+++ src/inc/bamFile.h
@@ -1,50 +1,47 @@
 /* bamFile -- interface to binary alignment format files using Heng Li's samtools lib. */
 
 #ifndef BAMFILE_H
 #define BAMFILE_H
 
+#include "dnaseq.h"
+#include "dystring.h"
+
 #ifdef USE_BAM
 
 // bam.h is incomplete without _IOLIB set to 1, 2 or 3.  2 is used by Makefile.generic:
 #ifndef _IOLIB
 #define _IOLIB 2
 #endif
 #include "bam.h"
 #include "sam.h"
 
 #else // no USE_BAM
 typedef struct { } bam1_t;
+typedef struct { } bam_index_t;
 typedef struct { } samfile_t;
 typedef int (*bam_fetch_f)(const bam1_t *b, void *data);
 
 #define COMPILE_WITH_SAMTOOLS "%s: in order to use this functionality you must " \
     "install the samtools library (<A HREF=\"http://samtools.sourceforge.net\" " \
     "TARGET=_BLANK>http://samtools.sourceforge.net</A>) and recompile kent/src with " \
     "USE_BAM=1 in your environment " \
     "(see <A HREF=\"http://genomewiki.ucsc.edu/index.php/Build_Environment_Variables\" " \
     "TARGET=_BLANK>http://genomewiki.ucsc.edu/index.php/Build_Environment_Variables</A>)."
 
 #endif // USE_BAM
 
-#ifndef DNASEQ_H
-#include "dnaseq.h"
-#endif
-
-#ifndef DYSTRING_H
-#include "dystring.h"
-#endif
 
 boolean bamFileExists(char *bamFileName);
 /* Return TRUE if we can successfully open the bam file and its index file. */
 
 samfile_t *bamOpen(char *fileOrUrl, char **retBamFileName);
 /* Return an open bam file as well as the filename of the bam. */
 
 void bamFetchAlreadyOpen(samfile_t *samfile, bam_index_t *idx, char *bamFileName, 
 			 char *position, bam_fetch_f callbackFunc, void *callbackData);
 /* With the open bam file, return items the same way with the callbacks as with bamFetch() */
 /* except in this case use an already-open bam file and index (use bam_index_load and free() for */
 /* the index). It seems a little strange to pass the filename in with the open bam, but */
 /* it's just used to report errors. */
 
 void bamFetch(char *fileOrUrl, char *position, bam_fetch_f callbackFunc, void *callbackData,