gnunet-svn
[Top][All Lists]
Advanced

[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:33:42 +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 121d236  async state management
121d236 is described below

commit 121d236cb8f58d72a18162469807a407ddcdbcce
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Wed Oct 14 15:33:40 2020 +0200

    async state management
---
 src/lib/anastasis_api_backup_redux.c | 30 +++++++++++++++++-------------
 src/lib/anastasis_api_redux.c        |  2 +-
 2 files changed, 18 insertions(+), 14 deletions(-)

diff --git a/src/lib/anastasis_api_backup_redux.c 
b/src/lib/anastasis_api_backup_redux.c
index 30ed18d..726b9fb 100644
--- a/src/lib/anastasis_api_backup_redux.c
+++ b/src/lib/anastasis_api_backup_redux.c
@@ -71,7 +71,7 @@ ANASTASIS_backup_state_to_string (enum ANASTASIS_BackupState 
bs)
  *  @param cb FIXME: Description
  *  @param cb_cls FIXME: Description
  */
-typedef void
+typedef struct ANASTASIS_ReduxAction *
 (*DispatchHandler)(json_t *state,
                    const json_t *arguments,
                    ANASTASIS_ActionCallback cb,
@@ -150,7 +150,7 @@ ANASTASIS_backup_start (const struct 
GNUNET_CONFIGURATION_Handle *cfg)
 }
 
 
-static void
+static struct ANASTASIS_ReduxAction *
 add_authentication (json_t *state,
                     const json_t *arguments,
                     ANASTASIS_ActionCallback cb,
@@ -171,6 +171,7 @@ add_authentication (json_t *state,
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
+  return NULL;
 }
 
 
@@ -395,7 +396,7 @@ method_candidate (struct PolicyBuilder *pb,
 }
 
 
-static void
+static struct ANASTASIS_ReduxAction *
 done_authentication (json_t *state,
                      const json_t *arguments,
                      ANASTASIS_ActionCallback cb,
@@ -447,10 +448,11 @@ done_authentication (json_t *state,
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
+  return NULL;
 }
 
 
-static void
+static struct ANASTASIS_ReduxAction *
 del_authentication (json_t *state,
                     const json_t *arguments,
                     ANASTASIS_ActionCallback cb,
@@ -493,16 +495,17 @@ del_authentication (json_t *state,
   cb (cb_cls,
       ANASTASIS_EC_NONE,
       state);
+  return NULL;
 }
 
 
-static void
+static struct ANASTASIS_ReduxAction *
 add_policy (json_t *state,
             const json_t *arguments,
             ANASTASIS_ActionCallback cb,
             void *cb_cls)
 {
-
+  return NULL;
 }
 
 
@@ -519,7 +522,7 @@ add_policy (json_t *state,
  * @param cb function to call with the result
  * @param cb_cls closure for @a cb
  */
-void
+struct ANASTASIS_ReduxAction *
 ANASTASIS_backup_action (struct GNUNET_CURL_Context *ctx,
                          json_t *state,
                          const char *action,
@@ -565,6 +568,7 @@ ANASTASIS_backup_action (struct GNUNET_CURL_Context *ctx,
     cb (cb_cls,
         ANASTASIS_EC_INVALID, // FIXME: Define correct error code
         NULL);
+    return NULL;
   }
   bs = ANASTASIS_backup_state_from_string (s);
   if (ANASTASIS_BACKUP_STATE_ERROR == bs)
@@ -572,7 +576,7 @@ ANASTASIS_backup_action (struct GNUNET_CURL_Context *ctx,
     cb (cb_cls,
         ANASTASIS_EC_INVALID, // FIXME: Define correct error code
         NULL);
-    return;
+    return NULL;
   }
   for (unsigned int i = 0; NULL != dispatchers[i].fun; i++)
   {
@@ -580,15 +584,15 @@ ANASTASIS_backup_action (struct GNUNET_CURL_Context *ctx,
          (0 == strcmp (action,
                        dispatchers[i].backup_action)) )
     {
-      dispatchers[i].fun (state,
-                          arguments,
-                          cb,
-                          cb_cls);
-      return;
+      return dispatchers[i].fun (state,
+                                 arguments,
+                                 cb,
+                                 cb_cls);
     }
   }
   GNUNET_break (0);
   cb (cb_cls,
       ANASTASIS_EC_INVALID, // FIXME: Define correct error code
       NULL);
+  return NULL;
 }
diff --git a/src/lib/anastasis_api_redux.c b/src/lib/anastasis_api_redux.c
index fef945d..5ed32ed 100644
--- a/src/lib/anastasis_api_redux.c
+++ b/src/lib/anastasis_api_redux.c
@@ -173,7 +173,7 @@ const json_t *redux_id_attr;
  * @param cb FIXME: Description
  * @param cb_cls FIXME: Description
  */
-typedef void
+typedef struct ANASTASIS_ReduxAction *
 (*DispatchHandler)(json_t *state,
                    const json_t *arguments,
                    ANASTASIS_ActionCallback cb,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]