e70152e44cc66cc599ff6b699eb8adc07f3e656a
kent
Sat May 24 21:09:34 2014 -0700
Adding Copyright NNNN Regents of the University of California to all files I believe with reasonable certainty were developed under UCSC employ or as part of Genome Browser copyright assignment.
diff --git src/hg/cartDump/cartDump.c src/hg/cartDump/cartDump.c
index 6e57241..006979d 100644
--- src/hg/cartDump/cartDump.c
+++ src/hg/cartDump/cartDump.c
@@ -1,124 +1,127 @@
/* cartDump - Dump contents of cart. */
+
+/* Copyright (C) 2014 The Regents of the University of California
+ * See README in this or parent directory for licensing information. */
#include "common.h"
#include "linefile.h"
#include "hash.h"
#include "cheapcgi.h"
#include "cart.h"
#include "hdb.h"
#include "jsHelper.h"
#include "hui.h"
#include "botDelay.h"
#define CART_DUMP_REMOVE_VAR "n/a"
struct hash *oldVars = NULL;
void doMiddle(struct cart *cart)
/* cartDump - Dump contents of cart. */
{
#define MATCH_VAR "match"
char *vName = "cartDump.varName";
char *vVal = "cartDump.newValue";
char *wildcard;
boolean asTable = cartVarExists(cart,CART_DUMP_AS_TABLE);
// To discourage hacking, call bottleneck
hgBotDelay();
if (cgiVarExists("submit"))
{
char *varName = cgiOptionalString(vName);
char *newValue = cgiOptionalString(vVal);
if (isNotEmpty(varName) && isNotEmpty(newValue))
{
varName = skipLeadingSpaces(varName);
eraseTrailingSpaces(varName);
if (sameString(newValue, CART_DUMP_REMOVE_VAR) || sameString(newValue, CART_VAR_EMPTY))
cartRemove(cart, varName);
else
cartSetString(cart, varName, newValue);
}
cartRemove(cart, vVal);
cartRemove(cart, "submit");
}
if (cgiVarExists("noDisplay"))
{
char *trackName = cgiOptionalString("g");
if (trackName != NULL && hashNumEntries(oldVars) > 0)
{
char *db = cartString(cart, "db");
struct trackDb *tdb = hTrackDbForTrack(db, trackName);
if (tdb != NULL && tdbIsComposite(tdb))
{
struct lm *lm = lmInit(0);
cartTdbTreeCleanupOverrides(tdb,cart,oldVars,lm);
lmCleanup(&lm);
}
}
return;
}
if (asTable)
{
jsIncludeFile("utils.js",NULL);
jsIncludeFile("ajax.js",NULL);
printf("Show as plain text.
",CART_DUMP_AS_TABLE);
printf("
"); wildcard = cgiOptionalString(MATCH_VAR); if (wildcard) cartDumpLike(cart, wildcard); else cartDump(cart); printf(""); if (!asTable) { printf("\n"); } printf("
Cookies passed to %s:
\n%s\n