aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_mq_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-21 15:16:58 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-21 15:16:58 +0000
commit5a38c8f0d1826ea964e3e3452e1a3a2a24d7d35b (patch)
tree7ba261fc1882bcfa6dc0da916272a0ed0d17468e /src/include/gnunet_mq_lib.h
parent1fca0c918c8468ba16666e8a1c41526cacdc6df2 (diff)
downloadgnunet-5a38c8f0d1826ea964e3e3452e1a3a2a24d7d35b.tar.gz
gnunet-5a38c8f0d1826ea964e3e3452e1a3a2a24d7d35b.zip
-misc doxygen fixes
Diffstat (limited to 'src/include/gnunet_mq_lib.h')
-rw-r--r--src/include/gnunet_mq_lib.h41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/include/gnunet_mq_lib.h b/src/include/gnunet_mq_lib.h
index a20588b4d..f88017fbe 100644
--- a/src/include/gnunet_mq_lib.h
+++ b/src/include/gnunet_mq_lib.h
@@ -1,10 +1,10 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2012 Christian Grothoff (and other contributing authors) 3 (C) 2012-2013 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
@@ -22,6 +22,8 @@
22 * @author Florian Dold 22 * @author Florian Dold
23 * @file include/gnunet_mq_lib.h 23 * @file include/gnunet_mq_lib.h
24 * @brief general purpose message queue 24 * @brief general purpose message queue
25 * @defgroup mq general purpose message queue
26 * @{
25 */ 27 */
26#ifndef GNUNET_MQ_H 28#ifndef GNUNET_MQ_H
27#define GNUNET_MQ_H 29#define GNUNET_MQ_H
@@ -93,7 +95,7 @@
93 * @param var pointer to a message struct, the type of the expression determines the base size, 95 * @param var pointer to a message struct, the type of the expression determines the base size,
94 * the space after the base size is the nested message 96 * the space after the base size is the nested message
95 * @return a 'struct GNUNET_MessageHeader *' that points at the nested message of the given message, 97 * @return a 'struct GNUNET_MessageHeader *' that points at the nested message of the given message,
96 * or NULL if the given message in 'var' does not have any space after the message struct 98 * or NULL if the given message in @a var does not have any space after the message struct
97 */ 99 */
98#define GNUNET_MQ_extract_nested_mh(var) GNUNET_MQ_extract_nested_mh_ ((struct GNUNET_MessageHeader *) (var), sizeof (*(var))) 100#define GNUNET_MQ_extract_nested_mh(var) GNUNET_MQ_extract_nested_mh_ ((struct GNUNET_MessageHeader *) (var), sizeof (*(var)))
99 101
@@ -140,10 +142,25 @@ struct GNUNET_MQ_Handle;
140 */ 142 */
141struct GNUNET_MQ_Envelope; 143struct GNUNET_MQ_Envelope;
142 144
145
146/**
147 * Error codes for the queue.
148 */
143enum GNUNET_MQ_Error 149enum GNUNET_MQ_Error
144{ 150{
151 /**
152 * FIXME: document!
153 */
145 GNUNET_MQ_ERROR_READ = 1, 154 GNUNET_MQ_ERROR_READ = 1,
155
156 /**
157 * FIXME: document!
158 */
146 GNUNET_MQ_ERROR_WRITE = 2, 159 GNUNET_MQ_ERROR_WRITE = 2,
160
161 /**
162 * FIXME: document!
163 */
147 GNUNET_MQ_ERROR_TIMEOUT = 4 164 GNUNET_MQ_ERROR_TIMEOUT = 4
148}; 165};
149 166
@@ -176,8 +193,8 @@ typedef void
176/** 193/**
177 * Signature of functions implementing the 194 * Signature of functions implementing the
178 * destruction of a message queue. 195 * destruction of a message queue.
179 * Implementations must not free 'mq', but should 196 * Implementations must not free @a mq, but should
180 * take care of 'impl_state'. 197 * take care of @a impl_state.
181 * 198 *
182 * @param mq the message queue to destroy 199 * @param mq the message queue to destroy
183 * @param impl_state state of the implementation 200 * @param impl_state state of the implementation
@@ -277,12 +294,14 @@ GNUNET_MQ_discard (struct GNUNET_MQ_Envelope *mqm);
277 * @param ev the envelope with the message to send. 294 * @param ev the envelope with the message to send.
278 */ 295 */
279void 296void
280GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq, struct GNUNET_MQ_Envelope *ev); 297GNUNET_MQ_send (struct GNUNET_MQ_Handle *mq,
298 struct GNUNET_MQ_Envelope *ev);
281 299
282 300
283/** 301/**
284 * Cancel sending the message. Message must have been sent with GNUNET_MQ_send before. 302 * Cancel sending the message. Message must have been sent with
285 * May not be called after the notify sent callback has been called 303 * #GNUNET_MQ_send before. May not be called after the notify sent
304 * callback has been called
286 * 305 *
287 * @param ev queued envelope to cancel 306 * @param ev queued envelope to cancel
288 */ 307 */
@@ -340,7 +359,7 @@ GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection *connecti
340 359
341 360
342/** 361/**
343 * Create a message queue for a GNUNET_STREAM_Socket. 362 * Create a message queue for a GNUNET_SERVER_Client.
344 * 363 *
345 * @param client the client 364 * @param client the client
346 * @return the message queue 365 * @return the message queue
@@ -355,7 +374,7 @@ GNUNET_MQ_queue_for_server_client (struct GNUNET_SERVER_Client *client);
355 * @param send function the implements sending messages 374 * @param send function the implements sending messages
356 * @param destroy function that implements destroying the queue 375 * @param destroy function that implements destroying the queue
357 * @param cancel function that implements canceling a message 376 * @param cancel function that implements canceling a message
358 * @param impl_state for the queue, passed to 'send' and 'destroy' 377 * @param impl_state for the queue, passed to @a send, @a destroy and @a cancel
359 * @param handlers array of message handlers 378 * @param handlers array of message handlers
360 * @param error_handler handler for read and write errors 379 * @param error_handler handler for read and write errors
361 * @param cls closure for message handlers and error handler 380 * @param cls closure for message handlers and error handler
@@ -497,4 +516,6 @@ GNUNET_MQ_impl_state (struct GNUNET_MQ_Handle *mq);
497void 516void
498GNUNET_MQ_impl_send_commit (struct GNUNET_MQ_Handle *mq); 517GNUNET_MQ_impl_send_commit (struct GNUNET_MQ_Handle *mq);
499 518
519/** @} */ /* end of group mq */
520
500#endif 521#endif