diff options
author | Bart Polot <bart.polot+gnunet@gmail.com> | 2017-02-20 19:13:59 +0100 |
---|---|---|
committer | Bart Polot <bart.polot+gnunet@gmail.com> | 2017-02-20 19:17:40 +0100 |
commit | ba5817a7dbaef67b871606431d9a9a7f82d5bdf8 (patch) | |
tree | 747bdbac51436264cbf64c59c594dbd356393f9e /src/include/gnunet_mq_lib.h | |
parent | 6b6a966864221ffa0d52d311da3b68f6c42549be (diff) | |
download | gnunet-ba5817a7dbaef67b871606431d9a9a7f82d5bdf8.tar.gz gnunet-ba5817a7dbaef67b871606431d9a9a7f82d5bdf8.zip |
Refactor copying of handler arrays
Diffstat (limited to 'src/include/gnunet_mq_lib.h')
-rw-r--r-- | src/include/gnunet_mq_lib.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h index b527b58e8..a50a59c49 100644 --- a/src/include/gnunet_mq_lib.h +++ b/src/include/gnunet_mq_lib.h | |||
@@ -305,6 +305,30 @@ GNUNET_MQ_dll_remove (struct GNUNET_MQ_Envelope **env_head, | |||
305 | 305 | ||
306 | 306 | ||
307 | /** | 307 | /** |
308 | * Copy an array of handlers. | ||
309 | * | ||
310 | * Useful if the array has been delared in local memory and needs to be | ||
311 | * persisted for future use. | ||
312 | * | ||
313 | * @param handlers Array of handlers to be copied. | ||
314 | * @return A newly allocated array of handlers. | ||
315 | * Needs to be freed with #GNUNET_free. | ||
316 | */ | ||
317 | struct GNUNET_MQ_MessageHandler * | ||
318 | GNUNET_MQ_copy_handlers (const struct GNUNET_MQ_MessageHandler *handlers); | ||
319 | |||
320 | |||
321 | /** | ||
322 | * Count the handlers in a handler array. | ||
323 | * | ||
324 | * @param handlers Array of handlers to be counted. | ||
325 | * @return The number of handlers in the array. | ||
326 | */ | ||
327 | unsigned int | ||
328 | GNUNET_MQ_count_handlers (const struct GNUNET_MQ_MessageHandler *handlers); | ||
329 | |||
330 | |||
331 | /** | ||
308 | * Message handler for a specific message type. | 332 | * Message handler for a specific message type. |
309 | */ | 333 | */ |
310 | struct GNUNET_MQ_MessageHandler | 334 | struct GNUNET_MQ_MessageHandler |