581c0a923e1c8d8e8b337c7e674c115170cdd65d tdreszer Tue Nov 16 17:03:46 2010 -0800 Added macro to tel whether cart var is really empty diff --git src/hg/inc/cart.h src/hg/inc/cart.h index fea852c..e26bdb7 100644 --- src/hg/inc/cart.h +++ src/hg/inc/cart.h @@ -2,30 +2,31 @@ * one invocation of a cgi script to another (variables * that are carted around). */ #ifndef CART_H #define CART_H #include "jksql.h" #include "errabort.h" #include "dystring.h" #include "linefile.h" #include "trackDb.h" // 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)) 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 */ struct cart /* A cart of settings that persist. */ { struct cart *next; /* Next in list. */ unsigned int userId; /* User ID in database. */ unsigned int sessionId; /* Session ID in database. */ struct hash *hash; /* String valued hash. */