c34228ec6a0c5c2a82c93658be708fda331588b4 max Thu Dec 1 10:38:08 2011 -0800 variable scope changes after hiram code review diff --git src/hg/hgc/t2g.c src/hg/hgc/t2g.c index e8c4736..eec634d 100644 --- src/hg/hgc/t2g.c +++ src/hg/hgc/t2g.c @@ -1,32 +1,30 @@ /* t2g.c - display details of text2genome literature track (t2gxxx tables) */ #include "common.h" #include "jksql.h" #include "hdb.h" #include "hgc.h" #include "hgColors.h" #include "trackDb.h" #include "web.h" #include "hash.h" #include "obscure.h" //include "hgTrackUi.h" // cgi var to activate debug output int debug = 0; -// cgi var to activate fasta output -int fasta = 0; char* sequenceTable; char* articleTable; char* printArticleInfo(struct sqlConnection *conn, char* item) /* Header with information about paper, return documentId */ { char query[512]; safef(query, sizeof(query), "SELECT articleId, url, title, authors, citation, abstract FROM %s WHERE displayId='%s'", articleTable, item); struct sqlResult *sr = sqlGetResult(conn, query); char **row; char *docId=0; if ((row = sqlNextRow(sr)) != NULL) @@ -251,32 +249,33 @@ sprintLongWithCommas(startBuf, start + 1); sprintLongWithCommas(endBuf, end); printf("%s:%s-%s</A><BR>\n", seqName, startBuf, endBuf); long size = end - start; sprintLongWithCommas(startBuf, size); printf("<B>Genomic Size:</B> %s<BR>\n", startBuf); } void doT2gDetails(struct trackDb *tdb, char *item) /* text2genome.org custom display */ { int start = cgiInt("o"); int end = cgiInt("t"); char* trackTable = cgiString("g"); +int fasta = cgiOptionalInt("fasta", 0); + debug = cgiOptionalInt("debug", 0); -fasta = cgiOptionalInt("fasta", 0); struct sqlConnection *conn = hAllocConn(database); printTrackVersion(tdb, conn, item); printPositionAndSize(start, end); sequenceTable = hashMustFindVal(tdb->settingsHash, "sequenceTable"); articleTable = hashMustFindVal(tdb->settingsHash, "articleTable"); char* docId = printArticleInfo(conn, item); if (docId!=0) { bool showDesc; showDesc = (! endsWith(trackTable, "Elsevier")); printSeqInfo(conn, trackTable, docId, item, seqName, start, showDesc, fasta); }