15c2acbbf16454d91d9079216f21427fdd33a609 hiram Tue Apr 16 13:45:20 2019 -0700 beginning to allow the array output time to function refs #18869 diff --git src/hg/hubApi/apiUtils.c src/hg/hubApi/apiUtils.c index 13381eb..558d13a 100644 --- src/hg/hubApi/apiUtils.c +++ src/hg/hubApi/apiUtils.c @@ -282,62 +282,15 @@ apiErrAbort(err404, err404Msg, "error opening bigFile URL: '%s', '%s'", bigDataUrl, errCatch->message->string); } errCatchFree(&errCatch); return bbi; } int chromInfoCmp(const void *va, const void *vb) /* Compare to sort based on size */ { const struct chromInfo *a = *((struct chromInfo **)va); const struct chromInfo *b = *((struct chromInfo **)vb); int dif; dif = (long) a->size - (long) b->size; return dif; } - -#ifdef NOT -unsigned largestChrom(char *db, char **nameReturn, int *chromCount) -/* return the length and get the chrom name for the largest chrom - * from chromInfo table. For use is sample getData URLs - */ -{ -char query[1024]; -struct sqlConnection *conn = hAllocConn(db); -sqlSafef(query, sizeof(query), "select chrom,size from chromInfo order by size desc limit 1"); -struct sqlResult *sr = sqlGetResult(conn, query); -char **row = sqlNextRow(sr); -unsigned length = 0; -if (row) - { - *nameReturn = cloneString(row[0]); - length = sqlLongLong(row[1]); - } -sqlFreeResult(&sr); -if (chromCount) - { - sqlSafef(query, sizeof(query), "select count(*) from chromInfo"); - *chromCount = sqlQuickNum(conn, query); - } -hFreeConn(&conn); -return length; -}/*static unsigned largestChrom(char *db, char **nameReturn, int *chromCount)*/ - -unsigned largestChromInfo(struct chromInfo *ci, char **chromName) -/* find largest chrom in this chromInfo, return name and size */ -{ -unsigned size = 0; -char *name = NULL; -struct chromInfo *el; -for (el = ci; el; el = el->next) - { - if (el->size > size) - { - size = el->size; - name = el->chrom; - } - } -if (chromName) - *chromName = name; -return size; -} /* unsigned largestChromInfo(struct chromInfo *ci, char **chromName) */ -#endif