summaryrefslogtreecommitdiff
path: root/json_util.h
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2012-04-28 13:26:09 -0500
committerEric Haszlakiewicz <erh+git@nimenees.com>2012-04-28 13:26:09 -0500
commit3fcffe1bb01de6978f4516abd49a3b3c9e2cd2f2 (patch)
tree732aac674963768bf2aa9e3abc3cf5b7f1937758 /json_util.h
parentf931f61851c949f8ab943dee8935b0d775346178 (diff)
downloadjson-c-3fcffe1bb01de6978f4516abd49a3b3c9e2cd2f2.tar.gz
Add a json_object_to_json_string_ext() function to allow the formatting of output to be selected.
There are now three options: JSON_C_TO_STRING_SPACED, JSON_C_TO_STRING_PLAIN and JSON_C_TO_STRING_PRETTY. This also add a json_object_to_file_ext() that takes the same flags. Existing output of json_object_to_json_string() is unchanged, and uses JSON_C_TO_STRING_SPACED. Thanks fo Grant Edwards for the initial patches.
Diffstat (limited to 'json_util.h')
-rw-r--r--json_util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/json_util.h b/json_util.h
index a77305e..277c3a7 100644
--- a/json_util.h
+++ b/json_util.h
@@ -23,8 +23,10 @@ extern "C" {
/* utility functions */
extern struct json_object* json_object_from_file(const char *filename);
extern int json_object_to_file(char *filename, struct json_object *obj);
+extern int json_object_to_file_ext(char *filename, struct json_object *obj, int flags);
extern int json_parse_int64(const char *buf, int64_t *retval);
+
/**
* Return a string describing the type of the object.
* e.g. "int", or "object", etc...