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) | |
download | gnunet-6c4af0398d260316dd2dd2358a02000cbf84ceba.tar.gz gnunet-6c4af0398d260316dd2dd2358a02000cbf84ceba.zip |
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 d12f69e5f..bd7ad7c47 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 | |||
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | 1142 | ||
1143 | /** | ||
1144 | * Insert @a env into the envelope DLL starting at @a env_head | ||
1145 | * Note that @a env must not be in any MQ while this function | ||
1146 | * is used with DLLs defined outside of the MQ module. This | ||
1147 | * is just in case some application needs to also manage a | ||
1148 | * FIFO of envelopes independent of MQ itself and wants to | ||
1149 | * re-use the pointers internal to @a env. Use with caution. | ||
1150 | * | ||
1151 | * @param[in|out] env_head of envelope DLL | ||
1152 | * @param[in|out] env_tail tail of envelope DLL | ||
1153 | * @param[in|out] env element to insert at the tail | ||
1154 | */ | ||
1155 | void | ||
1156 | GNUNET_MQ_dll_insert_tail (struct GNUNET_MQ_Envelope **env_head, | ||
1157 | struct GNUNET_MQ_Envelope **env_tail, | ||
1158 | struct GNUNET_MQ_Envelope *env) | ||
1159 | { | ||
1160 | GNUNET_CONTAINER_DLL_insert_tail (*env_head, | ||
1161 | *env_tail, | ||
1162 | env); | ||
1163 | } | ||
1164 | |||
1165 | |||
1166 | /** | ||
1167 | * Remove @a env from the envelope DLL starting at @a env_head. | ||
1168 | * Note that @a env must not be in any MQ while this function | ||
1169 | * is used with DLLs defined outside of the MQ module. This | ||
1170 | * is just in case some application needs to also manage a | ||
1171 | * FIFO of envelopes independent of MQ itself and wants to | ||
1172 | * re-use the pointers internal to @a env. Use with caution. | ||
1173 | * | ||
1174 | * @param[in|out] env_head of envelope DLL | ||
1175 | * @param[in|out] env_tail tail of envelope DLL | ||
1176 | * @param[in|out] env element to remove from the DLL | ||
1177 | */ | ||
1178 | void | ||
1179 | GNUNET_MQ_dll_remove (struct GNUNET_MQ_Envelope **env_head, | ||
1180 | struct GNUNET_MQ_Envelope **env_tail, | ||
1181 | struct GNUNET_MQ_Envelope *env) | ||
1182 | { | ||
1183 | GNUNET_CONTAINER_DLL_remove (*env_head, | ||
1184 | *env_tail, | ||
1185 | env); | ||
1186 | } | ||
1187 | |||
1188 | |||
1143 | /* end of mq.c */ | 1189 | /* end of mq.c */ |