#include "messenger_api_queue_messages.h"
#include "gnunet_messenger_service.h"
#include "messenger_api_message.h"
Go to the source code of this file.
Functions | |
void | init_queue_messages (struct GNUNET_MESSENGER_QueueMessages *messages) |
Initializes queue of messages as empty queue. More... | |
void | clear_queue_messages (struct GNUNET_MESSENGER_QueueMessages *messages) |
Clears the queue of messages. More... | |
void | enqueue_to_messages (struct GNUNET_MESSENGER_QueueMessages *messages, const struct GNUNET_CRYPTO_PrivateKey *sender, struct GNUNET_MESSENGER_Message *message, struct GNUNET_MESSENGER_Message *transcript) |
Adds a specific message to the end or the beginning of the queue depending on its priority. More... | |
struct GNUNET_MESSENGER_Message * | dequeue_from_messages (struct GNUNET_MESSENGER_QueueMessages *messages, struct GNUNET_CRYPTO_PrivateKey *sender, struct GNUNET_MESSENGER_Message **transcript) |
Remove the message from the front of the queue and returns it. More... | |
void init_queue_messages | ( | struct GNUNET_MESSENGER_QueueMessages * | messages | ) |
Initializes queue of messages as empty queue.
[out] | messages | Queue of messages |
Definition at line 32 of file messenger_api_queue_messages.c.
References GNUNET_assert, GNUNET_MESSENGER_QueueMessages::head, and GNUNET_MESSENGER_QueueMessages::tail.
Referenced by create_room().
void clear_queue_messages | ( | struct GNUNET_MESSENGER_QueueMessages * | messages | ) |
Clears the queue of messages.
[in,out] | messages | Queue of messages |
Definition at line 42 of file messenger_api_queue_messages.c.
References destroy_message(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MESSENGER_QueueMessages::head, GNUNET_MESSENGER_QueueMessage::message, GNUNET_MESSENGER_QueueMessages::tail, and GNUNET_MESSENGER_QueueMessage::transcript.
Referenced by destroy_room().
void enqueue_to_messages | ( | struct GNUNET_MESSENGER_QueueMessages * | messages, |
const struct GNUNET_CRYPTO_PrivateKey * | sender, | ||
struct GNUNET_MESSENGER_Message * | message, | ||
struct GNUNET_MESSENGER_Message * | transcript | ||
) |
Adds a specific message to the end or the beginning of the queue depending on its priority.
[in,out] | messages | Queue of messages |
[in] | sender | Private sender key |
[in] | message | Message |
[in] | transcript | Message transcript |
Definition at line 68 of file messenger_api_queue_messages.c.
References destroy_message(), GNUNET_assert, GNUNET_CONTAINER_DLL_insert, GNUNET_CONTAINER_DLL_insert_before, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_free, GNUNET_memcpy, GNUNET_MESSENGER_KIND_JOIN, GNUNET_MESSENGER_KIND_SUBSCRIBE, GNUNET_MESSENGER_KIND_TALK, GNUNET_new, GNUNET_MESSENGER_QueueMessages::head, GNUNET_MESSENGER_Message::header, GNUNET_MESSENGER_MessageHeader::kind, GNUNET_MESSENGER_QueueMessage::message, GNUNET_MESSENGER_QueueMessage::next, GNUNET_MESSENGER_QueueMessage::sender, GNUNET_MESSENGER_QueueMessages::tail, and GNUNET_MESSENGER_QueueMessage::transcript.
Referenced by enqueue_message_to_room().
struct GNUNET_MESSENGER_Message * dequeue_from_messages | ( | struct GNUNET_MESSENGER_QueueMessages * | messages, |
struct GNUNET_CRYPTO_PrivateKey * | sender, | ||
struct GNUNET_MESSENGER_Message ** | transcript | ||
) |
Remove the message from the front of the queue and returns it.
[in,out] | messages | Queue of messages |
[out] | sender | Private sender key |
[out] | transcript | Message transcript |
Definition at line 121 of file messenger_api_queue_messages.c.
References destroy_message(), GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_memcpy, GNUNET_MESSENGER_QueueMessages::head, GNUNET_MESSENGER_QueueMessage::message, GNUNET_MESSENGER_QueueMessage::sender, GNUNET_MESSENGER_QueueMessages::tail, and GNUNET_MESSENGER_QueueMessage::transcript.
Referenced by dequeue_message_from_room().