move to new client API: remove old client API
[oweals/gnunet.git] / src / include / gnunet_mq_lib.h
index b339fe0ebc78501df080653ea0634a9b59aac21a..bcf923fcc7943ed23be7439105035ddffc5b3c42 100644 (file)
@@ -415,6 +415,7 @@ struct GNUNET_MQ_MessageHandler
  */
 struct GNUNET_MQ_Envelope *
 GNUNET_MQ_msg_ (struct GNUNET_MessageHeader **mhp,
+
                 uint16_t size,
                 uint16_t type);
 
@@ -701,6 +702,9 @@ GNUNET_MQ_inject_error (struct GNUNET_MQ_Handle *mq,
 
 /**
  * Call the send implementation for the next queued message, if any.
+ * Calls the send notification for the current message unless
+ * #GNUNET_MQ_impl_send_in_flight was called for this envelope.
+ *
  * Only useful for implementing message queues, results in undefined
  * behavior if not used carefully.
  *
@@ -711,36 +715,17 @@ GNUNET_MQ_impl_send_continue (struct GNUNET_MQ_Handle *mq);
 
 
 /**
- * Get the message that should currently be sent.  The returned
- * message is only valid until #GNUNET_MQ_impl_send_continue is
- * called.  Fails if there is no current message.  Only useful for
- * implementing message queues, results in undefined behavior if not
- * used carefully.
+ * Call the send notification for the current message, but do not
+ * try to send the next message until #gnunet_mq_impl_send_continue
+ * is called.
  *
- * @param mq message queue with the current message, only valid
- *        until #GNUNET_MQ_impl_send_continue() is called
- * @return message to send, never NULL
- */
-const struct GNUNET_MessageHeader *
-GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq);
-
-
-/**
- * Get the message that is currently being sent when cancellation of that
- * message is requested.  Returns an opaque pointer which contains the memory
- * for the message, as well as some control data used by mq.
- *
- * This function may be called at most once in the cancel_impl
- * function of a message queue.
- *
- * Use this function to avoid copying a half-sent message.
+ * only useful for implementing message queues, results in undefined
+ * behavior if not used carefully.
  *
- * @param mq message queue
- * @parem msg pointer to store the message being canceled
- * @return memory block that contains the message, must be freed by the caller
+ * @param mq message queue to send the next message with
  */
-void *
-GNUNET_MQ_impl_cancel_evict (struct GNUNET_MQ_Handle *mq, struct GNUNET_MessageHeader **msg);
+void
+GNUNET_MQ_impl_send_in_flight (struct GNUNET_MQ_Handle *mq);
 
 
 /**
@@ -761,6 +746,19 @@ void *
 GNUNET_MQ_impl_state (struct GNUNET_MQ_Handle *mq);
 
 
+/**
+ * Get the message that should currently be sent.
+ * Fails if there is no current message.
+ * Only useful for implementing message queues,
+ * results in undefined behavior if not used carefully.
+ *
+ * @param mq message queue with the current message
+ * @return message to send, never NULL
+ */
+const struct GNUNET_MessageHeader *
+GNUNET_MQ_impl_current (struct GNUNET_MQ_Handle *mq);
+
+
 #endif
 
 /** @} */ /* end of group mq */