summaryrefslogtreecommitdiff
path: root/json_object_private.h
diff options
context:
space:
mode:
authorEric Haszlakiewicz <erh+git@nimenees.com>2012-09-02 15:21:56 -0500
committerEric Haszlakiewicz <erh+git@nimenees.com>2012-09-02 15:21:56 -0500
commit38f421a2e7f4453bdc7f206681dbcbfb1b00de4c (patch)
tree0b1772e2dc05f8efb749d8f8fcb83dca7d8169d6 /json_object_private.h
parentf74e8f8f9b1314293623c293e10fc838b89c7ddb (diff)
downloadjson-c-38f421a2e7f4453bdc7f206681dbcbfb1b00de4c.tar.gz
Add a json_set_serializer() function to allow the string output of a json_object to be customized.
Diffstat (limited to 'json_object_private.h')
-rw-r--r--json_object_private.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/json_object_private.h b/json_object_private.h
index 597332b..5ed791b 100644
--- a/json_object_private.h
+++ b/json_object_private.h
@@ -16,16 +16,12 @@
extern "C" {
#endif
-typedef void (json_object_delete_fn)(struct json_object *o);
-typedef int (json_object_to_json_string_fn)(struct json_object *o,
- struct printbuf *pb,
- int level,
- int flags);
+typedef void (json_object_private_delete_fn)(struct json_object *o);
struct json_object
{
enum json_type o_type;
- json_object_delete_fn *_delete;
+ json_object_private_delete_fn *_delete;
json_object_to_json_string_fn *_to_json_string;
int _ref_count;
struct printbuf *_pb;
@@ -40,6 +36,8 @@ struct json_object
int len;
} c_string;
} o;
+ json_object_delete_fn *_user_delete;
+ void *_userdata;
};
#ifdef __cplusplus