aboutsummaryrefslogtreecommitdiff
path: root/src/jansson.h
diff options
context:
space:
mode:
authorNathaniel McCallum <npmccallum@redhat.com>2017-01-26 09:46:48 +0100
committerNathaniel McCallum <npmccallum@redhat.com>2017-01-26 16:16:24 +0100
commitb900967f6fbfae098ced9dfeab7b2b51e1a22c0a (patch)
treec58c08d1d918756cfb57b5fd8d20345eeb410fa6 /src/jansson.h
parent746c2c3a996a7f6e80bd19fe3de438637e6363e1 (diff)
downloadjansson-b900967f6fbfae098ced9dfeab7b2b51e1a22c0a.zip
jansson-b900967f6fbfae098ced9dfeab7b2b51e1a22c0a.tar.gz
jansson-b900967f6fbfae098ced9dfeab7b2b51e1a22c0a.tar.bz2
Implement json_dumpb()
This function encodes the json_t object to a pre-allocated buffer. It compliments the already existing json_loadb() function and is useful for parsing JSON-RPC (among other protocols) when sent over datagram sockets. Signed-off-by: Nathaniel McCallum <npmccallum@redhat.com>
Diffstat (limited to 'src/jansson.h')
-rw-r--r--src/jansson.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/jansson.h b/src/jansson.h
index 591f2a9..74f11a0 100644
--- a/src/jansson.h
+++ b/src/jansson.h
@@ -292,6 +292,7 @@ json_t *json_load_callback(json_load_callback_t callback, void *data, size_t fla
typedef int (*json_dump_callback_t)(const char *buffer, size_t size, void *data);
char *json_dumps(const json_t *json, size_t flags);
+size_t json_dumpb(const json_t *json, char *buffer, size_t size, size_t flags);
int json_dumpf(const json_t *json, FILE *output, size_t flags);
int json_dump_file(const json_t *json, const char *path, size_t flags);
int json_dump_callback(const json_t *json, json_dump_callback_t callback, void *data, size_t flags);