json: Add utility to add a null-member

Signed-off-by: Christian Decker <decker.christian@gmail.com>
This commit is contained in:
Christian Decker
2019-02-07 16:14:01 +01:00
parent b5085a9c17
commit ff0ddee56e
4 changed files with 15 additions and 0 deletions

View File

@@ -299,6 +299,11 @@ void json_add_bool(struct json_stream *result, const char *fieldname, bool value
json_add_member(result, fieldname, value ? "true" : "false");
}
void json_add_null(struct json_stream *stream, const char *fieldname)
{
json_add_member(stream, fieldname, "null");
}
void json_add_hex(struct json_stream *result, const char *fieldname,
const void *data, size_t len)
{