diff options
author | Christian Grothoff <christian@grothoff.org> | 2017-01-30 17:42:00 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2017-01-30 17:42:00 +0100 |
commit | 6c4af0398d260316dd2dd2358a02000cbf84ceba (patch) | |
tree | fec82f367e1bb6ea91865aa6fcaa1027ee3614b4 /src/util/mq.c | |
parent | 9600ac83094c6738831a79e5cb82b02f8d560064 (diff) |
allow external code to use DLL pointers of envelopes, under very particular circumstances
Diffstat (limited to 'src/util/mq.c')
-rw-r--r-- | src/util/mq.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/util/mq.c b/src/util/mq.c index d12f69e5f4..bd7ad7c472 100644 --- a/src/util/mq.c +++ b/src/util/mq.c @@ -1140,4 +1140,50 @@ GNUNET_MQ_destroy_notify_cancel (struct GNUNET_MQ_DestroyNotificationHandle *dnh } +/** + * Insert @a env into the envelope DLL starting at @a env_head + * Note that @a env must not be in any MQ while this function + * is used with DLLs defined outside of the MQ module. This + * is just in case some application needs to also manage a + * FIFO of envelopes independent of MQ itself and wants to + * re-use the pointers internal to @a env. Use with caution. + * + * @param[in|out] env_head of envelope DLL + * @param[in|out] env_tail tail of envelope DLL + * @param[in|out] env element to insert at the tail + */ +void +GNUNET_MQ_dll_insert_tail (struct GNUNET_MQ_Envelope **env_head, + struct GNUNET_MQ_Envelope **env_tail, + struct GNUNET_MQ_Envelope *env) +{ + GNUNET_CONTAINER_DLL_insert_tail (*env_head, + *env_tail, + env); +} + + +/** + * Remove @a env from the envelope DLL starting at @a env_head. + * Note that @a env must not be in any MQ while this function + * is used with DLLs defined outside of the MQ module. This + * is just in case some application needs to also manage a + * FIFO of envelopes independent of MQ itself and wants to + * re-use the pointers internal to @a env. Use with caution. + * + * @param[in|out] env_head of envelope DLL + * @param[in|out] env_tail tail of envelope DLL + * @param[in|out] env element to remove from the DLL + */ +void +GNUNET_MQ_dll_remove (struct GNUNET_MQ_Envelope **env_head, + struct GNUNET_MQ_Envelope **env_tail, + struct GNUNET_MQ_Envelope *env) +{ + GNUNET_CONTAINER_DLL_remove (*env_head, + *env_tail, + env); +} + + /* end of mq.c */ |