4d2eb49f84199890ac7e679ba67f094cb49bd124
braney
  Thu Apr 6 14:29:02 2023 -0700
Change recommended track sets to merge with the current session.  refs #28525

diff --git src/hg/inc/cart.h src/hg/inc/cart.h
index 94be03b..d784bf5 100644
--- src/hg/inc/cart.h
+++ src/hg/inc/cart.h
@@ -4,30 +4,33 @@
 
 /* Copyright (C) 2014 The Regents of the University of California 
  * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */
 
 #ifndef CART_H
 #define CART_H
 
 struct cart;         // forward definition for use in trackDb.h
 
 #include "jksql.h"
 #include "errAbort.h"
 #include "dystring.h"
 #include "linefile.h"
 #include "trackDb.h"
 
+#define namedSessionDbTableConfVariable    "namedSessionDbName"
+#define defaultNamedSessionDb              "namedSessionDb"
+
 // If cgi set as CART_VAR_EMPTY, then removed from cart
 // If If cgi created new and oldVars are stored, then will be CART_VAR_EMPTY in old vars
 #define CART_VAR_EMPTY "[]"
 #define IS_CART_VAR_EMPTY(var) ((var) == NULL || sameString(var,CART_VAR_EMPTY))
 
 // A list of headers each CGI can use to control their own HTTP headers
 extern struct slPair *httpHeaders;
 
 typedef struct sqlConnection *(*DbConnector)();
 /* funtion type used to get a connection to database */
 
 typedef void (*DbDisconnect)(struct sqlConnection **pConn);
 /* function type used to cleanup a connection from database */
 
 
@@ -468,31 +471,31 @@
 #define hgSessionPrefix "hgS_"
 #define hgPublicSessionsPrefix "hgPS_"
 #define dataTableStateName "DataTableState"
 #define hgSessionTableState hgSessionPrefix dataTableStateName
 #define hgPublicSessionsTableState hgPublicSessionsPrefix dataTableStateName
 
 #define hgsOtherUserName hgSessionPrefix "otherUserName"
 #define hgsOtherUserSessionName hgSessionPrefix "otherUserSessionName"
 #define hgsMergeCart hgSessionPrefix "merge"
 #define hgsOtherUserSessionLabel hgSessionPrefix "otherUserSessionLabel"
 #define hgsDoOtherUser hgSessionPrefix "doOtherUser"
 
 #define hgsLoadUrlName hgSessionPrefix "loadUrlName"
 #define hgsDoLoadUrl hgSessionPrefix "doLoadUrl"
 
-#define namedSessionTable "namedSessionDb"
+#define namedSessionTable cartNamedSessionDbTable()
 
 void sessionTouchLastUse(struct sqlConnection *conn, char *encUserName,
 			 char *encSessionName);
 /* Increment namedSessionDb.useCount and update lastUse for this session. */
 
 void cartLoadUserSession(struct sqlConnection *conn, char *sessionOwner,
 			 char *sessionName, struct cart *cart,
 			 struct hash *oldVars, char *actionVar);
 /* If permitted, load the contents of the given user's session, and then
  * reload the CGI settings (to support override of session settings).
  * If non-NULL, oldVars will contain values overloaded when reloading CGI.
  * If non-NULL, actionVar is a cartRemove wildcard string specifying the
  * CGI action variable that sent us here. */
 
 boolean cartLoadSettingsFromUserInput(struct lineFile *lf, struct cart *cart, struct hash *oldVars,
@@ -666,17 +669,20 @@
  *      Or user requested limits are defined in the cart. */
 
 unsigned cartGetVersion(struct cart *cart);
 /* Get the current version of the cart, which is stored in the variable "cartVersion" */
 
 void cartSetVersion(struct cart *cart, unsigned version);
 /* Set the current version of the cart, which is stored in the variable "cartVersion" */
 
 void cartRewrite(struct cart *cart, unsigned trackDbCartVersion, unsigned cartVersion);
 /* Rewrite the cart to update it to expectations of trackDb. */
 
 void cartTurnOnSuper(struct cart *cart, char **trackNames, unsigned numTracks, char *superTrackName);
 /* Turn on a supertrack if any of the subtracks are not hidden.  ASSUMES ALL TRACKS ARE HIDDEN
  * by default.
  */
+
+char *cartNamedSessionDbTable();
+/* Get the name of the table that lists named sessions.  Don't free the result. */
 #endif /* CART_H */