038951920f067e656d752b8325a4e3a808354cbc angie Wed Jan 7 12:13:37 2015 -0800 Fixed the behavior of jsonStringEscape for \n, \r and \t. Previously,it was inserting a \ followed by the actual \n / \r / \t character, which was not actually escaping it. A \n needs to be replaced by a \ followed by an n not \n. Also added jsonOptionalBooleanField. diff --git src/inc/jsonParse.h src/inc/jsonParse.h index e356ed9..febba09 100644 --- src/inc/jsonParse.h +++ src/inc/jsonParse.h @@ -116,16 +116,19 @@ struct jsonElement *jsonFindNamedField(struct jsonElement *object, char *objectName, char *field); /* Find named field of object or return NULL if not found. Abort if object * is not actually an object. */ struct jsonElement *jsonMustFindNamedField(struct jsonElement *object, char *objectName, char *field); /* Find named field of object or die trying. */ char *jsonOptionalStringField(struct jsonElement *object, char *field, char *defaultVal); /* Return string valued field of object, or defaultVal if it doesn't exist. */ char *jsonStringField(struct jsonElement *object, char *field); /* Return string valued field of object or abort if field doesn't exist. */ +boolean jsonOptionalBooleanField(struct jsonElement *object, char *field, boolean defaultVal); +/* Return boolean valued field of object, or defaultVal if it doesn't exist. */ + #endif /* JSONPARSE_H */