9661f8ba9e015aef34e09240d677ac7978ec0766 braney Wed May 18 12:33:41 2011 -0700 move hub connection stuff into hg/lib so hgTracks can add hubs on its own diff --git src/hg/inc/hubConnect.h src/hg/inc/hubConnect.h index d7e01a3..5c428cf 100644 --- src/hg/inc/hubConnect.h +++ src/hg/inc/hubConnect.h @@ -1,29 +1,32 @@ /* hubConnect - stuff to manage connections to track hubs. Most of this is mediated through * the hubConnect table in the hgCentral database. Here there are routines to translate between * hub symbolic names and hub URLs, to see if a hub is up or down or sideways (up but badly * formatted) etc. Note that there is no C structure corresponding to a row in the hubConnect * table by design. We just want field-by-field access to this. */ #ifndef HUBCONNECT_H #define HUBCONNECT_H #define hubPublicTableName "hubPublic" /* Name of our table with list of public hubs. read only */ #define hubStatusTableName "hubStatus" /* Name of table that maintains status of hubs read/write. */ +#define hgHubDataText "hubUrl" +/* name of cgi variable containing new hub name */ + #define hubTrackPrefix "hub_" /* The names of all hub tracks begin with this. Use in cart. */ boolean isHubTrack(char *trackName); /* Return TRUE if it's a hub track. */ struct hubConnectStatus /* Basic status in hubStatus. Note it is *not* the same as the * hubStatus table, that has a bunch of extra fields to help * keep track of whether the hub is alive. */ { struct hubConnectStatus *next; unsigned id; /* Hub ID */ char *shortLabel; /* Hub short label. */ char *longLabel; /* Hub long label. */ @@ -75,16 +78,26 @@ /* Given something like "hub_123_myWig" return 123 */ struct trackDb *hubConnectAddHubForTrackAndFindTdb(struct cart *cart, char *database, char *trackName, struct trackDb **pTdbList, struct hash *trackHash); /* Go find hub for trackName (which will begin with hub_), and load the tracks * for it, appending to end of list and adding to trackHash. Return the * trackDb associated with trackName. */ char *hubFileVar(); /* return the name of the cart variable that holds the name of the * file in trash that has private hubs */ boolean hubWriteToFile(FILE *f, struct hubConnectStatus *el); /* write out a hubConnectStatus structure to a file */ + +unsigned hubFindOrAddUrlInStatusTable(char *database, struct cart *cart, + char *url, char **errorMessage); +/* find or add a URL to the status table */ + +void hubClearStatus(char *url); +/* delete the status for this hub from the status table */ + +void hubCheckForNew(char *database, struct cart *cart); +/* see if the user just typed in a new hub url */ #endif /* HUBCONNECT_H */