From 71f889186973ef26e8ae684ec47fd570138bc4e5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 5 Apr 2022 17:16:04 +0200 Subject: adapt to latest GNUnet API: GNUNET_JSON_spec_mark_optional() changed --- src/reducer/anastasis_api_redux.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) (limited to 'src/reducer/anastasis_api_redux.c') diff --git a/src/reducer/anastasis_api_redux.c b/src/reducer/anastasis_api_redux.c index bcc0e77..bc2cb5e 100644 --- a/src/reducer/anastasis_api_redux.c +++ b/src/reducer/anastasis_api_redux.c @@ -1254,19 +1254,22 @@ enter_user_attributes (json_t *state, const char *attribute_value; const char *regexp = NULL; const char *reglog = NULL; - int optional = false; + bool optional = false; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("name", &name), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("validation-regex", - ®exp)), + ®exp), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_string ("validation-logic", - ®log)), + ®log), + NULL), GNUNET_JSON_spec_mark_optional ( - GNUNET_JSON_spec_boolean ("optional", - &optional)), + GNUNET_JSON_spec_bool ("optional", + &optional), + NULL), GNUNET_JSON_spec_end () }; @@ -2024,16 +2027,20 @@ ANASTASIS_reducer_lookup_salt (const json_t *state, const json_t *cfg; uint32_t http_status = 0; bool disabled = false; + bool no_salt; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_bool ("disabled", - &disabled)), + &disabled), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_uint32 ("http_status", - &http_status)), + &http_status), + NULL), GNUNET_JSON_spec_mark_optional ( GNUNET_JSON_spec_fixed_auto ("salt", - salt)), + salt), + &no_salt), GNUNET_JSON_spec_end () }; @@ -2062,9 +2069,7 @@ ANASTASIS_reducer_lookup_salt (const json_t *state, } if (disabled) return GNUNET_NO; - if (NULL == - json_object_get (cfg, - "salt")) + if (no_salt) return GNUNET_NO; return GNUNET_OK; } -- cgit v1.2.3