1a89c8e587e4cdbdb94430448caaa19247871cb8 tdreszer Thu Sep 22 13:01:11 2011 -0700 Big load of changes for subCfg. diff --git src/hg/inc/jsHelper.h src/hg/inc/jsHelper.h index a121759..d2a9fe7 100644 --- src/hg/inc/jsHelper.h +++ src/hg/inc/jsHelper.h @@ -172,45 +172,52 @@ { jsonElementType type; struct hash *hash; }; struct jsonStringElement { jsonElementType type; char *str; }; struct jsonStringElement *newJsonString(char *str); struct jsonHashElement *newJsonHash(struct hash *h); struct jsonListElement *newJsonList(struct slRef *list); +// NOTE: Adding to a NULL hash will add to the global "common" hash printed with jsonPrintGlobals() void jsonHashAdd(struct jsonHashElement *h, char *name, struct jsonElement *ele); void jsonHashAddString(struct jsonHashElement *h, char *name, char *val); // Add a string to a hash which will be used to print a javascript object; // existing values are replaced. void jsonHashAddNumber(struct jsonHashElement *h, char *name, long val); // Add a number to a hash which will be used to print a javascript object; // existing values are replaced. void jsonHashAddDouble(struct jsonHashElement *h, char *name, double val); void jsonHashAddBoolean(struct jsonHashElement *h, char *name, boolean val); // Add a boolean to a hash which will be used to print a javascript object; // existing values are replaced. void jsonListAdd(struct slRef **list, struct jsonElement *ele); void jsonListAddString(struct slRef **list, char *val); void jsonListAddNumber(struct slRef **list, long val); void jsonListAddDouble(struct slRef **list, double val); void jsonListAddBoolean(struct slRef **list, boolean val); void jsonPrint(struct jsonElement *json, char *name, int indentLevel); // print out a jsonElement +extern struct jsonHashElement *jsonGlobalsHash; // The "all" globals json hash + +void jsonPrintGlobals(boolean wrapWithScriptTags); +// prints out the "common" globals json hash +// This hash is the one utils.js and therefore all CGIs know about + void jsonErrPrintf(struct dyString *ds, char *format, ...); // Printf a json error to a dyString for communicating with ajax code; format is: // {"error": error message here} #endif /* JSHELPER_H */