replace redundant MQ_NotifyCallback by SCHEDULER_TaskCallback
authorChristian Grothoff <christian@grothoff.org>
Tue, 17 Jan 2017 10:22:00 +0000 (11:22 +0100)
committerChristian Grothoff <christian@grothoff.org>
Tue, 17 Jan 2017 10:22:10 +0000 (11:22 +0100)
src/include/gnunet_mq_lib.h
src/include/gnunet_peerinfo_service.h
src/multicast/multicast_api.c
src/peerinfo/peerinfo_api.c
src/psyc/psyc_api.c
src/social/social_api.c
src/util/mq.c

index 5c2f808dfbb1ad1a4cfbac8979ec9ea1b4433310..108ba5d543fc8896b2e5e401a8689edd12ff0037 100644 (file)
@@ -254,15 +254,6 @@ typedef void
                          void *impl_state);
 
 
-/**
- * Callback used for notifications
- *
- * @param cls closure
- */
-typedef void
-(*GNUNET_MQ_NotifyCallback) (void *cls);
-
-
 /**
  * Generic error handler, called with the appropriate
  * error code and the same closure specified at the creation of
@@ -634,7 +625,7 @@ GNUNET_MQ_set_handlers_closure (struct GNUNET_MQ_Handle *mq,
  */
 void
 GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *ev,
-                       GNUNET_MQ_NotifyCallback cb,
+                       GNUNET_SCHEDULER_TaskCallback cb,
                        void *cb_cls);
 
 
index 44df483a08fe431688e468bd52ec1c47f6eb67bc..b5c2153ac4982b71eab9df29b5346cf3de0ced8f 100644 (file)
@@ -101,7 +101,7 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h);
 struct GNUNET_MQ_Envelope *
 GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
                           const struct GNUNET_HELLO_Message *hello,
-                         GNUNET_MQ_NotifyCallback cont,
+                         GNUNET_SCHEDULER_TaskCallback cont,
                          void *cont_cls);
 
 
index 6e5402b280a518fbc41afd9019b749236ed31f85..a8b1dee40ecd95b82ec66374aaed34e46d4c0f41 100644 (file)
@@ -556,7 +556,7 @@ group_disconnect (struct GNUNET_MULTICAST_Group *grp,
     if (NULL != last)
     {
       GNUNET_MQ_notify_sent (last,
-                             (GNUNET_MQ_NotifyCallback) group_cleanup, grp);
+                             (GNUNET_SCHEDULER_TaskCallback) group_cleanup, grp);
     }
     else
     {
index 10729f3d090c6403fa4c3de06907e4712c909c86..b75d4e2913259fc9583f99aa9226520c0df75371 100644 (file)
@@ -557,7 +557,7 @@ GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic)
 struct GNUNET_MQ_Envelope *
 GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h,
                           const struct GNUNET_HELLO_Message *hello,
-                         GNUNET_MQ_NotifyCallback cont,
+                         GNUNET_SCHEDULER_TaskCallback cont,
                          void *cont_cls)
 {
   struct GNUNET_MQ_Envelope *env;
index d744e7d08794aea43dbe5038d182f39bb2690c53..c6544df3aeda2cf74284429fed5a6580a4d013af 100644 (file)
@@ -598,7 +598,7 @@ channel_disconnect (struct GNUNET_PSYC_Channel *chn,
     struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (chn->mq);
     if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) channel_cleanup, chn);
+      GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) channel_cleanup, chn);
     }
     else
     {
index 82928a258ac6237ff1374085d1da5ce364599655..a7fe0916f5609e743f39679279c1ffbbffdfcedb 100644 (file)
@@ -1087,7 +1087,7 @@ place_disconnect (struct GNUNET_SOCIAL_Place *plc,
     struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (plc->mq);
     if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) place_cleanup, plc);
+      GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) place_cleanup, plc);
     }
     else
     {
@@ -2701,7 +2701,7 @@ GNUNET_SOCIAL_app_disconnect (struct GNUNET_SOCIAL_App *app,
     struct GNUNET_MQ_Envelope *env = GNUNET_MQ_get_last_envelope (app->mq);
     if (NULL != env)
     {
-      GNUNET_MQ_notify_sent (env, (GNUNET_MQ_NotifyCallback) app_cleanup, app);
+      GNUNET_MQ_notify_sent (env, (GNUNET_SCHEDULER_TaskCallback) app_cleanup, app);
     }
     else
     {
index ae13ff60156c2408ef3afc5a6ba1b83c8df52b15..985e8633120d815f55c33daf830e49289106e6d0 100644 (file)
@@ -58,7 +58,7 @@ struct GNUNET_MQ_Envelope
   /**
    * Called after the message was sent irrevocably.
    */
-  GNUNET_MQ_NotifyCallback sent_cb;
+  GNUNET_SCHEDULER_TaskCallback sent_cb;
 
   /**
    * Closure for @e send_cb
@@ -128,10 +128,10 @@ struct GNUNET_MQ_Handle
   void *error_handler_cls;
 
   /**
-   * Task to asynchronously run #impl_send_continue(). 
+   * Task to asynchronously run #impl_send_continue().
    */
   struct GNUNET_SCHEDULER_Task *send_task;
-  
+
   /**
    * Linked list of messages pending to be sent
    */
@@ -414,7 +414,7 @@ static void
 impl_send_continue (void *cls)
 {
   struct GNUNET_MQ_Handle *mq = cls;
-  
+
   mq->send_task = NULL;
   /* call is only valid if we're actually currently sending
    * a message */
@@ -441,8 +441,8 @@ void
 GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
 {
   struct GNUNET_MQ_Envelope *current_envelope;
-  GNUNET_MQ_NotifyCallback cb;
-  
+  GNUNET_SCHEDULER_TaskCallback cb;
+
   GNUNET_assert (0 < mq->queue_length);
   mq->queue_length--;
   mq->in_flight = GNUNET_NO;
@@ -456,7 +456,7 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq)
   {
     current_envelope->sent_cb = NULL;
     cb (current_envelope->sent_cls);
-  }  
+  }
   GNUNET_free (current_envelope);
 }
 
@@ -475,8 +475,8 @@ void
 GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq)
 {
   struct GNUNET_MQ_Envelope *current_envelope;
-  GNUNET_MQ_NotifyCallback cb;
-  
+  GNUNET_SCHEDULER_TaskCallback cb;
+
   mq->in_flight = GNUNET_YES;
   /* call is only valid if we're actually currently sending
    * a message */
@@ -812,7 +812,7 @@ GNUNET_MQ_assoc_remove (struct GNUNET_MQ_Handle *mq,
  */
 void
 GNUNET_MQ_notify_sent (struct GNUNET_MQ_Envelope *mqm,
-                       GNUNET_MQ_NotifyCallback cb,
+                       GNUNET_SCHEDULER_TaskCallback cb,
                        void *cb_cls)
 {
   mqm->sent_cb = cb;
@@ -953,7 +953,7 @@ GNUNET_MQ_send_cancel (struct GNUNET_MQ_Envelope *ev)
 
   GNUNET_assert (NULL != mq);
   GNUNET_assert (NULL != mq->cancel_impl);
-  
+
   mq->evacuate_called = GNUNET_NO;
 
   if (mq->current_envelope == ev)