[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: async state management
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: async state management |
Date: |
Wed, 14 Oct 2020 15:32:07 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 10e525a async state management
10e525a is described below
commit 10e525af529bdfb55218fdfd47d7cbea69343f3d
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Oct 14 15:32:05 2020 +0200
async state management
---
src/lib/anastasis_api_redux.c | 51 ++++++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 22 deletions(-)
diff --git a/src/lib/anastasis_api_redux.c b/src/lib/anastasis_api_redux.c
index 1ac792b..fef945d 100644
--- a/src/lib/anastasis_api_redux.c
+++ b/src/lib/anastasis_api_redux.c
@@ -450,7 +450,7 @@ redux_id_attr_init (const char *country_code)
}
-static void
+static struct ANASTASIS_ReduxAction *
select_continent (json_t *state,
const json_t *arguments,
ANASTASIS_ActionCallback cb,
@@ -500,6 +500,7 @@ select_continent (json_t *state,
cb (cb_cls,
ANASTASIS_EC_NONE,
state);
+ return NULL;
}
@@ -637,7 +638,7 @@ select_country (json_t *state,
}
-static void
+static struct ANASTASIS_ReduxAction *
unselect_country (json_t *state,
const json_t *arguments,
ANASTASIS_ActionCallback cb,
@@ -655,10 +656,11 @@ unselect_country (json_t *state,
cb (cb_cls,
ANASTASIS_EC_NONE,
state);
+ return NULL;
}
-static void
+static struct ANASTASIS_ReduxAction *
unselect_continent (json_t *state,
const json_t *arguments,
ANASTASIS_ActionCallback cb,
@@ -677,10 +679,11 @@ unselect_continent (json_t *state,
cb (cb_cls,
ANASTASIS_EC_NONE,
state);
+ return NULL;
}
-static void
+static struct ANASTASIS_ReduxAction *
enter_user_attributes (json_t *state,
const json_t *arguments,
ANASTASIS_ActionCallback cb,
@@ -713,10 +716,11 @@ enter_user_attributes (json_t *state,
cb (cb_cls,
ANASTASIS_EC_NONE,
state);
+ return NULL;
}
-void
+struct ANASTASIS_ReduxAction *
ANASTASIS_back_generic_decrement_ (json_t *state,
const json_t *arguments,
ANASTASIS_ActionCallback cb,
@@ -740,6 +744,7 @@ ANASTASIS_back_generic_decrement_ (json_t *state,
cb (cb_cls,
ANASTASIS_EC_NONE,
state);
+ return NULL;
}
@@ -859,6 +864,7 @@ ANASTASIS_redux_action (const json_t *state,
}
{
json_t *new_state;
+ struct ANASTASIS_ReduxAction *ret;
new_state = json_deep_copy (state);
GNUNET_assert (NULL != new_state);
@@ -868,33 +874,34 @@ ANASTASIS_redux_action (const json_t *state,
(0 == strcmp (action,
dispatchers[i].redux_action)) )
{
- dispatchers[i].fun (new_state,
- arguments,
- cb,
- cb_cls);
+ ret = dispatchers[i].fun (new_state,
+ arguments,
+ cb,
+ cb_cls);
json_decref (new_state);
- return;
+ return ret;
}
}
if (recovery_mode)
{
- ANASTASIS_recovery_action (ctx,
- new_state,
- action,
- arguments,
- cb,
- NULL);
+ ret = ANASTASIS_recovery_action (ctx,
+ new_state,
+ action,
+ arguments,
+ cb,
+ NULL);
}
else
{
- ANASTASIS_backup_action (ctx,
- new_state,
- action,
- arguments,
- cb,
- NULL);
+ ret = ANASTASIS_backup_action (ctx,
+ new_state,
+ action,
+ arguments,
+ cb,
+ NULL);
}
json_decref (new_state);
+ return ret;
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.