-skeletons for transport-ng
[oweals/gnunet.git] / src / include / gnunet_mq_lib.h
index 0d201d36d9414889d6e0fbac6d6709cedc72c5c0..7da5aa7787db8d721b38f580a6aa4a2c4e1b7873 100644 (file)
@@ -117,6 +117,12 @@ GNUNET_MQ_extract_nested_mh_ (const struct GNUNET_MessageHeader *mh,
                               uint16_t base_size);
 
 
+/**
+ * Opaque handle to an envelope.
+ */
+struct GNUNET_MQ_Envelope;
+
+
 /**
  * Implementation of the #GNUNET_MQ_msg_nested_mh macro.
  *
@@ -138,11 +144,6 @@ GNUNET_MQ_msg_nested_mh_ (struct GNUNET_MessageHeader **mhp,
  */
 struct GNUNET_MQ_Handle;
 
-/**
- * Opaque handle to an envelope.
- */
-struct GNUNET_MQ_Envelope;
-
 
 /**
  * Error codes for the queue.
@@ -433,7 +434,17 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm);
 
 
 /**
- * Send a message with the give message queue.
+ * Obtain the current length of the message queue.
+ *
+ * @param mq queue to inspect
+ * @return number of queued, non-transmitted messages
+ */
+unsigned int
+GNUNET_MQ_get_length (struct GNUNET_MQ_Handle *mq);
+
+
+/**
+ * Send a message with the given message queue.
  * May only be called once per message.
  *
  * @param mq message queue
@@ -445,7 +456,7 @@ GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
 
 
 /**
- * Send a copy of a message with the give message queue.
+ * Send a copy of a message with the given message queue.
  * Can be called repeatedly on the same envelope.
  *
  * @param mq message queue