From: Christian Grothoff Date: Sat, 21 May 2016 16:16:02 +0000 (+0000) Subject: define GNUNET_JSON_from_data_auto X-Git-Tag: initial-import-from-subversion-38251~859 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e321090a6ab5ac7228bf71983db0ae86af91ea99;p=oweals%2Fgnunet.git define GNUNET_JSON_from_data_auto --- 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. *