aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2019-07-22 19:03:25 +0200
committerChristian Grothoff <christian@grothoff.org>2019-07-22 19:03:25 +0200
commitf754082176ba202596cedaec98ee06c2ca2e48e4 (patch)
tree773974ed787cecb8a74e4a8b24f4bdb5a7741fc1 /src/include
parent1a90ef262d8e60630d5b79135c2eefe78b1341d4 (diff)
downloadgnunet-f754082176ba202596cedaec98ee06c2ca2e48e4.tar.gz
gnunet-f754082176ba202596cedaec98ee06c2ca2e48e4.zip
introduce GNUNET_JSON_spec_mark_optional
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_json_lib.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h
index 32de2208a..72d2c4ebe 100644
--- a/src/include/gnunet_json_lib.h
+++ b/src/include/gnunet_json_lib.h
@@ -104,6 +104,11 @@ struct GNUNET_JSON_Specification
104 * Where should we store the final size of @e ptr. 104 * Where should we store the final size of @e ptr.
105 */ 105 */
106 size_t *size_ptr; 106 size_t *size_ptr;
107
108 /**
109 * Set to #GNUNET_YES if this component is optional.
110 */
111 int is_optional;
107}; 112};
108 113
109 114
@@ -148,6 +153,16 @@ GNUNET_JSON_spec_end (void);
148 153
149 154
150/** 155/**
156 * Set the "optional" flag for a parser specification entry.
157 *
158 * @param spec specification to modify
159 * @return spec copy of @a spec with optional bit set
160 */
161struct GNUNET_JSON_Specification
162GNUNET_JSON_spec_mark_optional (struct GNUNET_JSON_Specification spec);
163
164
165/**
151 * Variable size object (in network byte order, encoded using Crockford 166 * Variable size object (in network byte order, encoded using Crockford
152 * Base32hex encoding). 167 * Base32hex encoding).
153 * 168 *