060ada2535fca719656219c1214a3e1c16490693
tdreszer
  Wed Nov 9 16:06:41 2011 -0800
Moved as code in hgTables down to lib and access it from hgc and hgTrackUi.  This is to remove 'extraFields' support as per Jim's request in redmine 5883 and 5582
diff --git src/hg/hgTables/hgTables.h src/hg/hgTables/hgTables.h
index b693f54..ca86ffd 100644
--- src/hg/hgTables/hgTables.h
+++ src/hg/hgTables/hgTables.h
@@ -1,38 +1,31 @@
 /* hgTables - shared data between hgTables modules. */
 
 #ifndef HGTABLES_H
 #define HGTABLES_H
 
 
 #include "jksql.h"
-
 #include "localmem.h"
-
 #include "dystring.h"
-
 #include "hdb.h"
-
 #include "hCommon.h"
-
 #include "customTrack.h"
-
 #include "grp.h"
-
 #include "joiner.h"
-
 #include "hPrint.h"
+#include "hui.h"
 
 struct region
 /* A part (or all) of a chromosome. */
     {
     struct region *next;
     char *chrom;		/* Chromosome. */
     int start;			/* Zero-based. */
     int end;			/* Non-inclusive. */
     boolean fullChrom;		/* If TRUE it's full chromosome. */
     char *name;			/* possibly the encode region name */
     };
 
 /* Global variables - generally set during initialization and then read-only. */
 extern struct cart *cart;	/* This holds cgi and other variables between clicks. */
 extern struct hash *oldVars;	/* The cart before new cgi stuff added. */
@@ -151,36 +144,30 @@
 
 struct trackDb *findSelectedTrack(struct trackDb *trackList,
 	struct grp *group, char *varName);
 /* Find selected track - from CGI variable if possible, else
  * via various defaults. */
 
 struct trackDb *findTrack(char *name, struct trackDb *trackList);
 /* Find track, or return NULL if can't find it. */
 
 struct trackDb *mustFindTrack(char *name, struct trackDb *trackList);
 /* Find track or squawk and die. */
 
 struct asObject *asForTable(struct sqlConnection *conn, char *table);
 /* Get autoSQL description if any associated with table. */
 
-struct asColumn *asColumnFind(struct asObject *asObj, char *name);
-/* Return named column. */
-
-struct slName *asColNames(struct asObject *as);
-/* Get list of column names. */
-
 struct sqlFieldType *sqlFieldTypesFromAs(struct asObject *as);
 /* Convert asObject to list of sqlFieldTypes */
 
 char *connectingTableForTrack(char *rawTable);
 /* Return table name to use with all.joiner for track.
  * You can freeMem this when done. */
 
 char *chromTable(struct sqlConnection *conn, char *table);
 /* Get chr1_table if it exists, otherwise table.
  * You can freeMem this when done. */
 
 char *chrnTable(struct sqlConnection *conn, char *table);
 /* Return chrN_table if table is split, otherwise table.
  * You can freeMem this when done. */
 
@@ -734,123 +721,112 @@
 void wigShowFilter(struct sqlConnection *conn);
 /* print out wiggle data value filter */
 
 /* ----------- BigWig business in bigWig.c -------------------- */
 
 boolean isBigWigTable(char *table);
 /* Return TRUE if table is bedGraph in current database's trackDb. */
 
 char *bigFileNameFromCtOrHub(char *table, struct sqlConnection *conn);
 /* If table is a custom track or hub track, return the bigDataUrl setting;
  * otherwise return NULL.  Do a freeMem on returned string when done. */
 
 char *bigWigFileName(char *table, struct sqlConnection *conn);
 /* Return file name associated with bigWig.  This handles differences whether it's
  * a custom or built-in track.  Do a freeMem on returned string when done. */
+#define bigBedFileName(table, conn) bigWigFileName(table, conn)
 
 
 int bigWigOutRegion(char *table, struct sqlConnection *conn,
 			     struct region *region, int maxOut,
 			     enum wigOutputType wigOutType);
 /* Write out bigWig for region, doing intersecting and filtering as need be. */
 
 void doSummaryStatsBigWig(struct sqlConnection *conn);
 /* Put up page showing summary stats for bigWig track. */
 
 struct bed *bigWigIntervalsToBed(struct sqlConnection *conn, char *table, struct region *region,
 				 struct lm *lm);
 /* Return a list of unfiltered, unintersected intervals in region as bed (for
  * secondary table in intersection). */
 
 /* ----------- BigBed business in bigBed.c -------------------- */
 boolean isBigBed(char *database, char *table, struct trackDb *parent, 
 	struct customTrack *(*ctLookupName)(char *table));
 /* Local test to see if something is big bed.  Handles hub tracks unlike hIsBigBed. */
 
 char *bigBedFileName(char *table, struct sqlConnection *conn);
 /* Return file name associated with bigBed.  This handles differences whether it's
  * a custom or built-in track or hub.  Do a freeMem on returned string when done. */
 
 struct hTableInfo *bigBedToHti(char *table, struct sqlConnection *conn);
 /* Get fields of bigBed into hti structure. */
 
-struct asObject *bigBedAsForTable(char *table, struct sqlConnection *conn);
-/* Get asObject associated with bigBed table. */
-
 struct slName *bigBedGetFields(char *table, struct sqlConnection *conn);
 /* Get fields of bigBed as simple name list. */
 
 struct sqlFieldType *bigBedListFieldsAndTypes(char *table, struct sqlConnection *conn);
 /* Get fields of bigBed as list of sqlFieldType. */
 
 struct bed *bigBedGetFilteredBedsOnRegions(struct sqlConnection *conn,
 	char *db, char *table, struct region *regionList, struct lm *lm,
 	int *retFieldCount);
 /* Get list of beds from bigBed, in all regions, that pass filtering. */
 
 void bigBedTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f);
 /* Print out selected fields from Big Bed.  If fields is NULL, then print out all fields. */
 
 void showSchemaBigBed(char *table);
 /* Show schema on bigBed. */
 
 /* More stuff in bigBed.c that makes use of autoSql files. */
 
-struct slName *asColNames(struct asObject *as);
-/* Get list of column names. */
-
 struct sqlFieldType *sqlFieldTypesFromAs(struct asObject *as);
 /* Convert asObject to list of sqlFieldTypes */
 
 /* BAM stuff from bam.c */
 
-struct asObject *bamAsObj();
-/* Return asObject describing fields of BAM */
-
 boolean isBamTable(char *table);
 /* Return TRUE if table corresponds to a BAM file. */
 
 struct slName *bamGetFields(char *table);
 /* Get fields of bam as simple name list. */
 
 struct sqlFieldType *bamListFieldsAndTypes();
 /* Get fields of BAM as list of sqlFieldType. */
 
 struct hTableInfo *bamToHti(char *table);
 /* Get standard fields of BAM into hti structure. */
 
 void showSchemaBam(char *table);
 /* Show schema on bam. */
 
 void bamTabOut(char *db, char *table, struct sqlConnection *conn, char *fields, FILE *f);
 /* Print out selected fields from BAM.  If fields is NULL, then print out all fields. */
 
 struct bed *bamGetFilteredBedsOnRegions(struct sqlConnection *conn, 
 	char *db, char *table, struct region *regionList, struct lm *lm, 
 	int *retFieldCount);
 /* Get list of beds from BAM, in all regions, that pass filtering. */
 
 struct slName *randomBamIds(char *table, struct sqlConnection *conn, int count);
 /* Return some semi-random qName based IDs from a BAM file. */
 
 /* VCF (Variant Call Format) stuff from vcf.c */
 
 extern char *vcfDataLineAutoSqlString;
 
-struct asObject *vcfAsObj();
-/* Return asObject describing fields of VCF */
-
 boolean isVcfTable(char *table);
 /* Return TRUE if table corresponds to a VCF file. */
 
 struct slName *vcfGetFields(char *table);
 /* Get fields of VCF as simple name list. */
 
 struct sqlFieldType *vcfListFieldsAndTypes();
 /* Get fields of VCF as list of sqlFieldType. */
 
 struct hTableInfo *vcfToHti(char *table);
 /* Get standard fields of VCF into hti structure. */
 
 void showSchemaVcf(char *table);
 /* Show schema on VCF. */