indentation, moving API towards MQ-style
authorChristian Grothoff <christian@grothoff.org>
Tue, 5 Jul 2016 12:41:49 +0000 (12:41 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 5 Jul 2016 12:41:49 +0000 (12:41 +0000)
src/dv/dv_api.c
src/dv/gnunet-service-dv.c
src/dv/plugin_transport_dv.c
src/include/gnunet_dv_service.h

index e3ba995c3bfce277420bd54f9fb519bbe46490eb..d74453376ab7330154f0ff892674ee70bb05f535 100644 (file)
@@ -308,7 +308,7 @@ cleanup_send_cb (void *cls,
   while (NULL != (th = peer->head))
   {
     GNUNET_CONTAINER_DLL_remove (peer->head, peer->tail, th);
-    th->cb (th->cb_cls, GNUNET_SYSERR);
+    th->cb (th->cb_cls);
     GNUNET_free (th);
   }
   GNUNET_free (peer);
@@ -416,7 +416,7 @@ handle_message_receipt (void *cls,
         GNUNET_CONTAINER_DLL_remove (sh->th_head,
                                      sh->th_tail,
                                      th);
-        th->cb (th->cb_cls, GNUNET_SYSERR);
+        th->cb (th->cb_cls);
         GNUNET_free (th);
       }
     }
@@ -473,10 +473,7 @@ handle_message_receipt (void *cls,
       GNUNET_CONTAINER_DLL_remove (peer->head,
                                    peer->tail,
                                    th);
-      th->cb (th->cb_cls,
-              (ntohs (ack->header.type) == GNUNET_MESSAGE_TYPE_DV_SEND_ACK)
-              ? GNUNET_OK
-              : GNUNET_SYSERR);
+      th->cb (th->cb_cls);
       GNUNET_free (th);
       break;
     }
index fd51a856223bc5a3dbef0b2e4195848a0d555d86..af6ddb3d92d70e04d5f4b44b473a53d1daa999cd 100644 (file)
@@ -230,7 +230,7 @@ struct DirectNeighbor
    * ID of the task we use to (periodically) update our consensus
    * with this peer.  Used if we are the initiating peer.
    */
-  struct GNUNET_SCHEDULER_Task * initiate_task;
+  struct GNUNET_SCHEDULER_Task *initiate_task;
 
   /**
    * At what offset are we, with respect to inserting our own routes
@@ -1905,7 +1905,8 @@ handle_dv_route_message (void *cls,
  * @param message the actual message
  */
 static void
-handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client,
+handle_dv_send_message (void *cls,
+                        struct GNUNET_SERVER_Client *client,
                         const struct GNUNET_MessageHeader *message)
 {
   struct Route *route;
index aa94bed315c0d1d3270d78ca60b7050b2cb71367..7293d9fb841d34ee94232fb58773490786d2b5e9 100644 (file)
@@ -519,11 +519,9 @@ handle_dv_disconnect (void *cls,
  * Clean up the pending request, and call continuations.
  *
  * @param cls closure
- * @param ok #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static void
-send_finished (void *cls,
-              int ok)
+send_finished (void *cls)
 {
   struct PendingRequest *pr = cls;
   struct GNUNET_ATS_Session *session = pr->session;
@@ -535,7 +533,7 @@ send_finished (void *cls,
   if (NULL != pr->transmit_cont)
     pr->transmit_cont (pr->transmit_cont_cls,
                       &session->sender,
-                      ok,
+                      GNUNET_OK,
                        pr->size, 0);
   GNUNET_free (pr);
 }
index 248e373dc3b6dda573f88de4931928e1ee50b682..f58311f74fdef3947b92a34d44465b9ce4132dee 100644 (file)
  * @param distance distance to the peer
  * @param network the peer is located in
  */
-typedef void (*GNUNET_DV_ConnectCallback)(void *cls,
-                                         const struct GNUNET_PeerIdentity *peer,
-                                         uint32_t distance,
-                                          enum GNUNET_ATS_Network_Type network);
+typedef void
+(*GNUNET_DV_ConnectCallback)(void *cls,
+                             const struct GNUNET_PeerIdentity *peer,
+                             uint32_t distance,
+                             enum GNUNET_ATS_Network_Type network);
 
 
 /**
@@ -60,10 +61,11 @@ typedef void (*GNUNET_DV_ConnectCallback)(void *cls,
  * @param distance new distance to the peer
  * @param network this network will be used to reach the next hop
  */
-typedef void (*GNUNET_DV_DistanceChangedCallback)(void *cls,
-                                                 const struct GNUNET_PeerIdentity *peer,
-                                                 uint32_t distance,
-                                                  enum GNUNET_ATS_Network_Type network);
+typedef void
+(*GNUNET_DV_DistanceChangedCallback)(void *cls,
+                                     const struct GNUNET_PeerIdentity *peer,
+                                     uint32_t distance,
+                                     enum GNUNET_ATS_Network_Type network);
 
 
 /**
@@ -73,8 +75,9 @@ typedef void (*GNUNET_DV_DistanceChangedCallback)(void *cls,
  * @param cls closure
  * @param peer peer that disconnected
  */
-typedef void (*GNUNET_DV_DisconnectCallback)(void *cls,
-                                            const struct GNUNET_PeerIdentity *peer);
+typedef void
+(*GNUNET_DV_DisconnectCallback)(void *cls,
+                                const struct GNUNET_PeerIdentity *peer);
 
 
 /**
@@ -86,10 +89,11 @@ typedef void (*GNUNET_DV_DisconnectCallback)(void *cls,
  * @param distance how far did the message travel
  * @param msg actual message payload
  */
-typedef void (*GNUNET_DV_MessageReceivedCallback)(void *cls,
-                                                 const struct GNUNET_PeerIdentity *sender,
-                                                 uint32_t distance,
-                                                 const struct GNUNET_MessageHeader *msg);
+typedef void
+(*GNUNET_DV_MessageReceivedCallback)(void *cls,
+                                     const struct GNUNET_PeerIdentity *sender,
+                                     uint32_t distance,
+                                     const struct GNUNET_MessageHeader *msg);
 
 
 /**
@@ -97,10 +101,9 @@ typedef void (*GNUNET_DV_MessageReceivedCallback)(void *cls,
  * message has been successful.
  *
  * @param cls closure
- * @param ok GNUNET_OK on success, GNUNET_SYSERR on error
  */
-typedef void (*GNUNET_DV_MessageSentCallback)(void *cls,
-                                             int ok);
+typedef void
+(*GNUNET_DV_MessageSentCallback)(void *cls);
 
 
 /**