From e321090a6ab5ac7228bf71983db0ae86af91ea99 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 21 May 2016 16:16:02 +0000 Subject: [PATCH] define GNUNET_JSON_from_data_auto --- src/include/gnunet_json_lib.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h index 8b21c01dd..9e5f9e284 100644 --- a/src/include/gnunet_json_lib.h +++ b/src/include/gnunet_json_lib.h @@ -311,6 +311,16 @@ GNUNET_JSON_from_data (const void *data, size_t size); +/** + * Convert binary data to a JSON string with the base32crockford + * encoding. + * + * @param ptr binary data, sizeof (*ptr) must yield correct size + * @return json string that encodes @a data + */ +#define GNUNET_JSON_from_data_auto(ptr) GNUNET_JSON_from_data(ptr, sizeof (*ptr)) + + /** * Convert absolute timestamp to a json string. * -- 2.25.1