5db18ae05a21e122258f156fb5e62c15cfdf98f9
kent
  Mon Dec 9 11:28:37 2013 -0800
Removing jsonGlabalsHash from library routines.  Now it is restricted to hgTrackUi.
diff --git src/lib/jsonParse.c src/lib/jsonParse.c
index ef205df..9681889 100644
--- src/lib/jsonParse.c
+++ src/lib/jsonParse.c
@@ -1,27 +1,24 @@
 /* jsonParse - routines to parse JSON strings and traverse and pick things out of the
  * resulting object tree. */
 
 #include "common.h"
 #include "hash.h"
 #include "dystring.h"
 #include "sqlNum.h"
 #include "jsonParse.h"
 
-// Global json hash - I'm wanting to move this to jsHelper, but one step at a time....
-struct jsonElement *jsonGlobalsHash = NULL; 
-
 static struct jsonElement *newJsonElement(jsonElementType type)
 // generic constructor for a jsonElement; callers fill in the appropriate value
 {
 struct jsonElement *ele;
 AllocVar(ele);
 ele->type = type;
 return ele;
 }
 
 struct jsonElement *newJsonString(char *str)
 {
 struct jsonElement *ele = newJsonElement(jsonString);
 ele->val.jeString = cloneString(str);
 return ele;
 }
@@ -51,38 +48,31 @@
 {
 struct jsonElement *ele = newJsonElement(jsonObject);
 ele->val.jeHash = h;
 return ele;
 }
 
 struct jsonElement *newJsonList(struct slRef *list)
 {
 struct jsonElement *ele = newJsonElement(jsonList);
 ele->val.jeList = list;
 return ele;
 }
 
 void jsonObjectAdd(struct jsonElement *h, char *name, struct jsonElement *ele)
 // Add a new element to a jsonObject; existing values are replaced.
-// NOTE: Adding to a NULL hash will add to the global "common" hash printed with jsonPrintGlobals();
-{
-if (h == NULL)  // If hash isn't provided, assume global
 {
-    if (jsonGlobalsHash == NULL)
-        jsonGlobalsHash = newJsonObject(newHash(5));
-    h = jsonGlobalsHash;
-    }
 if(h->type != jsonObject)
     errAbort("jsonObjectAdd called on element with incorrect type (%d)", h->type);
 hashReplace(h->val.jeHash, name, ele);
 }
 
 void jsonListAdd(struct jsonElement *list, struct jsonElement *ele)
 {
 if(list->type != jsonList)
     errAbort("jsonListAdd called on element with incorrect type (%d)", list->type);
 slAddHead(&list->val.jeList, ele);
 }
 
 static void skipLeadingSpacesWithPos(char *s, int *posPtr)
 /* skip leading white space. */
 {