aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-05 17:15:10 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-05 17:15:16 +0200
commit2ea635b60d3fcc4a242089084441ea8e2747c3d4 (patch)
tree5cb5af404b2cf6fea4bc6245f8100e483bd0f852 /src/include
parent89332e84db275272b9ecdf8a18c28e001d772358 (diff)
downloadgnunet-2ea635b60d3fcc4a242089084441ea8e2747c3d4.tar.gz
gnunet-2ea635b60d3fcc4a242089084441ea8e2747c3d4.zip
add flag to return 'not present' status from GNUNET_JSON_spec_mark_optional
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_json_lib.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h
index 6e73a3365..2002a0130 100644
--- a/src/include/gnunet_json_lib.h
+++ b/src/include/gnunet_json_lib.h
@@ -97,9 +97,10 @@ struct GNUNET_JSON_Specification
97 void *ptr; 97 void *ptr;
98 98
99 /** 99 /**
100 * Number of bytes available in @e ptr. 100 * Pointer to set to true if this argument is
101 * indeed missing. Can be NULL.
101 */ 102 */
102 size_t ptr_size; 103 bool *missing;
103 104
104 /** 105 /**
105 * Where should we store the final size of @e ptr. 106 * Where should we store the final size of @e ptr.
@@ -107,6 +108,11 @@ struct GNUNET_JSON_Specification
107 size_t *size_ptr; 108 size_t *size_ptr;
108 109
109 /** 110 /**
111 * Number of bytes available in @e ptr.
112 */
113 size_t ptr_size;
114
115 /**
110 * Set to true if this component is optional. 116 * Set to true if this component is optional.
111 */ 117 */
112 bool is_optional; 118 bool is_optional;
@@ -157,10 +163,12 @@ GNUNET_JSON_spec_end (void);
157 * Set the "optional" flag for a parser specification entry. 163 * Set the "optional" flag for a parser specification entry.
158 * 164 *
159 * @param spec specification to modify 165 * @param spec specification to modify
166 * @param[out] missing set to true if the argument is missing, NULL is allowed.
160 * @return spec copy of @a spec with optional bit set 167 * @return spec copy of @a spec with optional bit set
161 */ 168 */
162struct GNUNET_JSON_Specification 169struct GNUNET_JSON_Specification
163GNUNET_JSON_spec_mark_optional (struct GNUNET_JSON_Specification spec); 170GNUNET_JSON_spec_mark_optional (struct GNUNET_JSON_Specification spec,
171 bool *missing);
164 172
165 173
166/** 174/**