diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-10-13 23:51:45 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-10-13 23:52:20 +0200 |
commit | e1a3225cda96b8fd99d437ba3c53a9badd341693 (patch) | |
tree | 4e5882811caf4c05da9e74ba46ad96d1d049497e /src/include | |
parent | 5db905d02e078e7b85992bd5ddbdadfae9ca5c08 (diff) | |
download | gnunet-e1a3225cda96b8fd99d437ba3c53a9badd341693.tar.gz gnunet-e1a3225cda96b8fd99d437ba3c53a9badd341693.zip |
NEWS: add support for encoding/decoding double values as part of JSON to libgnunetjson
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_json_lib.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h index 26c68fed3..c3204026b 100644 --- a/src/include/gnunet_json_lib.h +++ b/src/include/gnunet_json_lib.h | |||
@@ -291,6 +291,17 @@ GNUNET_JSON_spec_bool (const char *name, | |||
291 | 291 | ||
292 | 292 | ||
293 | /** | 293 | /** |
294 | * double. | ||
295 | * | ||
296 | * @param name name of the JSON field | ||
297 | * @param[out] f where to store the double found under @a name | ||
298 | */ | ||
299 | struct GNUNET_JSON_Specification | ||
300 | GNUNET_JSON_spec_double (const char *name, | ||
301 | double *f); | ||
302 | |||
303 | |||
304 | /** | ||
294 | * 8-bit integer. | 305 | * 8-bit integer. |
295 | * | 306 | * |
296 | * @param name name of the JSON field | 307 | * @param name name of the JSON field |
@@ -704,6 +715,19 @@ GNUNET_JSON_pack_bool (const char *name, | |||
704 | 715 | ||
705 | /** | 716 | /** |
706 | * Generate packer instruction for a JSON field of type | 717 | * Generate packer instruction for a JSON field of type |
718 | * double. | ||
719 | * | ||
720 | * @param name name of the field to add to the object | ||
721 | * @param f double value | ||
722 | * @return json pack specification | ||
723 | */ | ||
724 | struct GNUNET_JSON_PackSpec | ||
725 | GNUNET_JSON_pack_double (const char *name, | ||
726 | double f); | ||
727 | |||
728 | |||
729 | /** | ||
730 | * Generate packer instruction for a JSON field of type | ||
707 | * string. | 731 | * string. |
708 | * | 732 | * |
709 | * @param name name of the field to add to the object | 733 | * @param name name of the field to add to the object |