6411d5f0ae8b75f54dc71f28a6c0690a9d567895 braney Mon May 16 11:29:37 2011 -0700 make private (now unlisted) hubs use the same status table as the public hubs, no trash use diff --git src/hg/inc/hubConnect.h src/hg/inc/hubConnect.h index e85cfc7..d7e01a3 100644 --- src/hg/inc/hubConnect.h +++ src/hg/inc/hubConnect.h @@ -1,48 +1,57 @@ /* 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 hubConnectTableName "hubConnect" -/* Name of our table. */ +#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 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 on hubConnect. Note it is *not* the same as the - * hubConnect table, that has a bunch of extra fields to help +/* 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; - int id; /* Hub ID */ + unsigned id; /* Hub ID */ char *shortLabel; /* Hub short label. */ char *longLabel; /* Hub long label. */ char *hubUrl; /* URL to hub.ra file. */ char *errorMessage; /* If non-empty hub has an error and this describes it. */ unsigned dbCount; /* Number of databases hub has data for. */ char **dbArray; /* Array of databases hub has data for. */ + unsigned status; /* 1 if private */ }; +/* status bits */ +#define HUB_UNLISTED (1 << 0) + +boolean isHubUnlisted(struct hubConnectStatus *hub) ; +/* Return TRUE if it's an unlisted hub */ + void hubConnectStatusFree(struct hubConnectStatus **pHub); /* Free hubConnectStatus */ void hubConnectStatusFreeList(struct hubConnectStatus **pList); /* Free a list of dynamically allocated hubConnectStatus's */ struct hubConnectStatus *hubConnectStatusForId(struct cart *cart, struct sqlConnection *conn, int id); /* Given a hub ID return associated status. */ struct hubConnectStatus *hubConnectStatusListFromCart(struct cart *cart); /* Return list of track hubs that are turned on by user in cart. */ #define hubConnectTrackHubsVarName "trackHubs" /* Name of cart variable with list of track hubs. */