[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] 02/03: fix enum
From: |
gnunet |
Subject: |
[taler-anastasis] 02/03: fix enum |
Date: |
Sun, 18 Oct 2020 20:49:49 +0200 |
This is an automated email from the git hooks/post-receive script.
dennis-neufeld pushed a commit to branch master
in repository anastasis.
commit 546bd10c21d9f65824124ecec4744eb01973bcc0
Author: Dennis Neufeld <dennis.neufeld@students.bfh.ch>
AuthorDate: Sat Oct 17 20:25:32 2020 +0200
fix enum
---
src/cli/anastasis-cli-redux.c | 28 +++++++++++++++++++++-------
src/include/anastasis_redux.h | 9 ++++-----
src/lib/anastasis_api_backup_redux.c | 10 +++++-----
src/lib/anastasis_api_redux.c | 2 +-
4 files changed, 31 insertions(+), 18 deletions(-)
diff --git a/src/cli/anastasis-cli-redux.c b/src/cli/anastasis-cli-redux.c
index a1ca33d..5fc37d3 100644
--- a/src/cli/anastasis-cli-redux.c
+++ b/src/cli/anastasis-cli-redux.c
@@ -78,6 +78,11 @@ static json_t *arguments;
*/
static char *action;
+/**
+ * Handle to an ongoing action.
+ */
+static struct ANASTASIS_ReduxAction *ra;
+
/**
* Persist a json state.
*
@@ -139,11 +144,21 @@ shutdown_task (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Shutdown initiated\n");
// FIXME shutdown routine here
+ if (NULL != ctx)
+ {
+ GNUNET_CURL_fini (ctx);
+ ctx = NULL;
+ }
if (NULL != rc)
{
GNUNET_CURL_gnunet_rc_destroy (rc);
rc = NULL;
}
+ if (NULL != ra)
+ {
+ GNUNET_free (ra);
+ ra = NULL;
+ }
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Shutdown complete\n");
@@ -381,13 +396,12 @@ run (void *cls,
&rc);
rc = GNUNET_CURL_gnunet_rc_create (ctx);
- // FIXME: return value in global, shutdown handler to clean up, yada yada
- ANASTASIS_redux_action (prev_state,
- action,
- arguments,
- ctx,
- &action_cb,
- cls);
+ ra = ANASTASIS_redux_action (prev_state,
+ action,
+ arguments,
+ ctx,
+ &action_cb,
+ cls);
}
}
diff --git a/src/include/anastasis_redux.h b/src/include/anastasis_redux.h
index b11ba9c..7c4002f 100644
--- a/src/include/anastasis_redux.h
+++ b/src/include/anastasis_redux.h
@@ -45,10 +45,9 @@ enum ANASTASIS_GenericState
#define ANASTASIS_BACKUP_STATES(REDUX_STATE) \
ANASTASIS_GENERIC_STATES (REDUX_STATE) \
- REDUX_STATE (AuthenticationsEditingState) \
- REDUX_STATE (PoliciesReviewingState) \
- REDUX_STATE (BackupPayingState) \
- REDUX_STATE (NoState) \
+ REDUX_STATE (AUTHENTICATIONS_EDITING) \
+ REDUX_STATE (POLICIES_REVIEWING) \
+ REDUX_STATE (PAYING)
#define GENERATE_BACKUP_ENUM(ENUM) ANASTASIS_BACKUP_STATE_ ## ENUM,
@@ -187,7 +186,7 @@ typedef void
/**
- * Handle to an ongoing action. Only valid until the #ANASTASIA_ActionCallback
is invoked.
+ * Handle to an ongoing action. Only valid until the #ANASTASIS_ActionCallback
is invoked.
*/
struct ANASTASIS_ReduxAction;
diff --git a/src/lib/anastasis_api_backup_redux.c
b/src/lib/anastasis_api_backup_redux.c
index b882bbc..5d0e55d 100644
--- a/src/lib/anastasis_api_backup_redux.c
+++ b/src/lib/anastasis_api_backup_redux.c
@@ -448,7 +448,7 @@ done_authentication (json_t *state,
pb.policies));
set_state (state,
ANASTASIS_backup_state_to_string (
- ANASTASIS_BACKUP_STATE_PoliciesReviewingState));
+ ANASTASIS_BACKUP_STATE_POLICIES_REVIEWING));
cb (cb_cls,
ANASTASIS_EC_NONE,
state);
@@ -543,22 +543,22 @@ ANASTASIS_backup_action_ (struct GNUNET_CURL_Context *ctx,
DispatchHandler fun;
} dispatchers[] = {
{
- ANASTASIS_BACKUP_STATE_AuthenticationsEditingState,
+ ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING,
"add_authentication",
&add_authentication
},
{
- ANASTASIS_BACKUP_STATE_AuthenticationsEditingState,
+ ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING,
"delete_authentication",
&del_authentication
},
{
- ANASTASIS_BACKUP_STATE_AuthenticationsEditingState,
+ ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING,
"next",
&done_authentication
},
{
- ANASTASIS_BACKUP_STATE_AuthenticationsEditingState,
+ ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING,
"back",
&ANASTASIS_back_generic_decrement_,
},
diff --git a/src/lib/anastasis_api_redux.c b/src/lib/anastasis_api_redux.c
index e3adffe..222a68a 100644
--- a/src/lib/anastasis_api_redux.c
+++ b/src/lib/anastasis_api_redux.c
@@ -706,7 +706,7 @@ enter_user_attributes (json_t *state,
s_mode,
json_string (
ANASTASIS_backup_state_to_string (
-
ANASTASIS_BACKUP_STATE_AuthenticationsEditingState)));
+ ANASTASIS_BACKUP_STATE_AUTHENTICATIONS_EDITING)));
/** else FIXME: do something for recovery mode*/
json_object_set_new (state,
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.