1ee99ce653ae839e4774120c3f3923dc129c8533 angie Fri Mar 16 14:41:14 2018 -0700 Moved jsonStringEscape inside jsonWriteString because it's silly to have to remember to call it first every time. tagStorm programs were doing their own limited escaping (double-quotes only); now they get the same escaping as everywhere else. refs MLQ #21113 diff --git src/inc/jsonWrite.h src/inc/jsonWrite.h index 0683923..5b92990 100644 --- src/inc/jsonWrite.h +++ src/inc/jsonWrite.h @@ -33,31 +33,32 @@ }; struct jsonWrite *jsonWriteNew(); /* Return new empty jsonWrite struct. */ void jsonWriteFree(struct jsonWrite **pJw); /* Free up a jsonWrite object. */ void jsonWriteTag(struct jsonWrite *jw, char *var); /* Print out preceding comma if necessary, and if var is non-NULL, quoted tag followed by colon. */ void jsonWriteEndLine(struct jsonWrite *jw); /* Write comma if in middle, and then newline regardless. */ void jsonWriteString(struct jsonWrite *jw, char *var, char *string); -/* Print out "var": "val". If var is NULL, print val only. If string is NULL, "var": null . */ +/* Print out "var": "val" -- or rather, jsonStringEscape(val). + * If var is NULL, print val only. If string is NULL, "var": null . */ void jsonWriteDateFromUnix(struct jsonWrite *jw, char *var, long long unixTimeVal); /* Add "var": YYYY-MM-DDT-HH:MM:SSZ given a Unix time stamp. Var may be NULL. */ void jsonWriteNumber(struct jsonWrite *jw, char *var, long long val); /* print out "var": val as number. Var may be NULL. */ void jsonWriteDouble(struct jsonWrite *jw, char *var, double val); /* print out "var": val as number. Var may be NULL. */ void jsonWriteLink(struct jsonWrite *jw, char *var, char *objRoot, char *name); /* Print out the jsony type link to another object. objRoot will start and end with a '/' * and may have additional slashes in this usage. Var may be NULL. */ void jsonWriteLinkNum(struct jsonWrite *jw, char *var, char *objRoot, long long id);