fd532108ac0d9e35b8fe6087e86e84a0e073eae3 hiram Wed May 8 12:08:40 2019 -0700 for list/ucscGenomes function only show active=1 genomes by default with hidden option showActive0=on to allow show of active=0 genomes refs #18869 diff --git src/hg/hubApi/hubApi.c src/hg/hubApi/hubApi.c index 288fce3..e193e23 100644 --- src/hg/hubApi/hubApi.c +++ src/hg/hubApi/hubApi.c @@ -905,58 +905,30 @@ * and then get the shortLabel */ { char hubUrl[1024]; char query[1024]; struct sqlConnection *conn = hConnectCentral(); // Build a query to select the hubUrl for the given shortLabel sqlSafef(query, sizeof(query), "select hubUrl from %s where shortLabel='%s'", hubPublicTableName(), shortLabel); if (! sqlQuickQuery(conn, query, hubUrl, sizeof(hubUrl))) hubUrl[0] = 0; hDisconnectCentral(&conn); return cloneString(hubUrl); } -static int dbDbCmpName(const void *va, const void *vb) -/* Compare two dbDb elements: name, ignore case. */ -{ -const struct dbDb *a = *((struct dbDb **)va); -const struct dbDb *b = *((struct dbDb **)vb); -return strcasecmp(a->name, b->name); -} - -struct dbDb *ucscDbDb() -/* return the dbDb table as an slList */ -{ -char query[1024]; -struct sqlConnection *conn = hConnectCentral(); -sqlSafef(query, sizeof(query), "select * from dbDb"); -struct dbDb *dbList = NULL, *el = NULL; -struct sqlResult *sr = sqlGetResult(conn, query); -char **row; -while ((row = sqlNextRow(sr)) != NULL) - { - el = dbDbLoad(row); - slAddHead(&dbList, el); - } -sqlFreeResult(&sr); -hDisconnectCentral(&conn); -slSort(&dbList, dbDbCmpName); -return dbList; -} - static struct hash *apiFunctionHash = NULL; static void setupFunctionHash() /* initialize the apiFunctionHash */ { if (apiFunctionHash) return; /* already done */ apiFunctionHash = hashNew(0); hashAdd(apiFunctionHash, "list", &apiList); hashAdd(apiFunctionHash, "getData", &apiGetData); } static struct hashEl *parsePathInfo(char *pathInfo, char *words[MAX_PATH_INFO]) /* given a pathInfo string: /command/subCommand/etc...