diff options
author | Gabor X Toth <*@tg-x.net> | 2014-07-30 21:18:05 +0000 |
---|---|---|
committer | Gabor X Toth <*@tg-x.net> | 2014-07-30 21:18:05 +0000 |
commit | 831718fa44b2c56577aa4e36a479fef6debb8cea (patch) | |
tree | 448006c73980613dac5f877d75d52e614d2df920 /src/include | |
parent | b084e26e380fa2a4fe5b970668bdd83a2ad8acc7 (diff) | |
download | gnunet-831718fa44b2c56577aa4e36a479fef6debb8cea.tar.gz gnunet-831718fa44b2c56577aa4e36a479fef6debb8cea.zip |
client manager: documentation
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_client_manager_lib.h | 77 |
1 files changed, 49 insertions, 28 deletions
diff --git a/src/include/gnunet_client_manager_lib.h b/src/include/gnunet_client_manager_lib.h index 07d9d2807..63a745514 100644 --- a/src/include/gnunet_client_manager_lib.h +++ b/src/include/gnunet_client_manager_lib.h | |||
@@ -99,11 +99,12 @@ struct GNUNET_CLIENT_MANAGER_MessageHandler | |||
99 | /** | 99 | /** |
100 | * Connect to a service. | 100 | * Connect to a service. |
101 | * | 101 | * |
102 | * @param cfg Configuration to use. | 102 | * @param cfg |
103 | * @param service_name Service name to connect to. | 103 | * Configuration to use. |
104 | * @param connect_msg FIXME | 104 | * @param service_name |
105 | * @param connection_lost_cb x | 105 | * Service name to connect to. |
106 | * @param cls | 106 | * @param handlers |
107 | * Message handlers. | ||
107 | * | 108 | * |
108 | * @return Client manager connection handle. | 109 | * @return Client manager connection handle. |
109 | */ | 110 | */ |
@@ -117,22 +118,27 @@ GNUNET_CLIENT_MANAGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
117 | /** | 118 | /** |
118 | * Disconnect from the service. | 119 | * Disconnect from the service. |
119 | * | 120 | * |
120 | * @param mgr Client manager connection. | 121 | * @param mgr |
121 | * @param transmit_queue Transmit pending messages in queue before disconnecting. | 122 | * Client manager connection. |
122 | * @param disconnect_cb Function called after disconnected from the service. | 123 | * @param transmit_queue |
123 | * @param disconnect_cls Closure for @a disconnect_cb. | 124 | * Transmit pending messages in queue before disconnecting. |
125 | * @param disconnect_cb | ||
126 | * Function called after disconnected from the service. | ||
127 | * @param cls | ||
128 | * Closure for @a disconnect_cb. | ||
124 | */ | 129 | */ |
125 | void | 130 | void |
126 | GNUNET_CLIENT_MANAGER_disconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr, | 131 | GNUNET_CLIENT_MANAGER_disconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr, |
127 | int transmit_queue, | 132 | int transmit_queue, |
128 | GNUNET_ContinuationCallback disconnect_cb, | 133 | GNUNET_ContinuationCallback disconnect_cb, |
129 | void *disconnect_cls); | 134 | void *cls); |
130 | 135 | ||
131 | 136 | ||
132 | /** | 137 | /** |
133 | * Reschedule connect to the service using exponential back-off. | 138 | * Reschedule connect to the service using exponential back-off. |
134 | * | 139 | * |
135 | * @param mgr Client manager connection. | 140 | * @param mgr |
141 | * Client manager connection. | ||
136 | */ | 142 | */ |
137 | void | 143 | void |
138 | GNUNET_CLIENT_MANAGER_reconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr); | 144 | GNUNET_CLIENT_MANAGER_reconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr); |
@@ -141,8 +147,11 @@ GNUNET_CLIENT_MANAGER_reconnect (struct GNUNET_CLIENT_MANAGER_Connection *mgr); | |||
141 | /** | 147 | /** |
142 | * Add a message to the end of the transmission queue. | 148 | * Add a message to the end of the transmission queue. |
143 | * | 149 | * |
144 | * @param mgr Client manager connection. | 150 | * @param mgr |
145 | * @param msg Message to transmit. It is free()'d after transmission. | 151 | * Client manager connection. |
152 | * @param msg | ||
153 | * Message to transmit, should be allocated with GNUNET_malloc() or | ||
154 | * GNUNET_new(), as it is freed with GNUNET_free() after transmission. | ||
146 | */ | 155 | */ |
147 | void | 156 | void |
148 | GNUNET_CLIENT_MANAGER_transmit (struct GNUNET_CLIENT_MANAGER_Connection *mgr, | 157 | GNUNET_CLIENT_MANAGER_transmit (struct GNUNET_CLIENT_MANAGER_Connection *mgr, |
@@ -152,8 +161,11 @@ GNUNET_CLIENT_MANAGER_transmit (struct GNUNET_CLIENT_MANAGER_Connection *mgr, | |||
152 | /** | 161 | /** |
153 | * Add a message to the beginning of the transmission queue. | 162 | * Add a message to the beginning of the transmission queue. |
154 | * | 163 | * |
155 | * @param mgr Client manager connection. | 164 | * @param mgr |
156 | * @param msg Message to transmit. It is free()'d after transmission. | 165 | * Client manager connection. |
166 | * @param msg | ||
167 | * Message to transmit, should be allocated with GNUNET_malloc() or | ||
168 | * GNUNET_new(), as it is freed with GNUNET_free() after transmission. | ||
157 | */ | 169 | */ |
158 | void | 170 | void |
159 | GNUNET_CLIENT_MANAGER_transmit_now (struct GNUNET_CLIENT_MANAGER_Connection *mgr, | 171 | GNUNET_CLIENT_MANAGER_transmit_now (struct GNUNET_CLIENT_MANAGER_Connection *mgr, |
@@ -163,7 +175,8 @@ GNUNET_CLIENT_MANAGER_transmit_now (struct GNUNET_CLIENT_MANAGER_Connection *mgr | |||
163 | /** | 175 | /** |
164 | * Drop all queued messages. | 176 | * Drop all queued messages. |
165 | * | 177 | * |
166 | * @param mgr Client manager connection. | 178 | * @param mgr |
179 | * Client manager connection. | ||
167 | */ | 180 | */ |
168 | void | 181 | void |
169 | GNUNET_CLIENT_MANAGER_drop_queue (struct GNUNET_CLIENT_MANAGER_Connection *mgr); | 182 | GNUNET_CLIENT_MANAGER_drop_queue (struct GNUNET_CLIENT_MANAGER_Connection *mgr); |
@@ -172,7 +185,8 @@ GNUNET_CLIENT_MANAGER_drop_queue (struct GNUNET_CLIENT_MANAGER_Connection *mgr); | |||
172 | /** | 185 | /** |
173 | * Obtain client connection handle. | 186 | * Obtain client connection handle. |
174 | * | 187 | * |
175 | * @param mgr Client manager connection handle. | 188 | * @param mgr |
189 | * Client manager connection. | ||
176 | * | 190 | * |
177 | * @return Client connection handle. | 191 | * @return Client connection handle. |
178 | */ | 192 | */ |
@@ -184,9 +198,10 @@ GNUNET_CLIENT_MANAGER_get_client (struct GNUNET_CLIENT_MANAGER_Connection *mgr); | |||
184 | * Return user context associated with the given client manager. | 198 | * Return user context associated with the given client manager. |
185 | * Note: you should probably use the macro (call without the underscore). | 199 | * Note: you should probably use the macro (call without the underscore). |
186 | * | 200 | * |
187 | * @param mgr Client manager connection. | 201 | * @param mgr |
188 | * @param size Number of bytes in user context struct (for verification only). | 202 | * Client manager connection. |
189 | * @return User context. | 203 | * @param size |
204 | * Number of bytes in user context struct (for verification only). | ||
190 | */ | 205 | */ |
191 | void * | 206 | void * |
192 | GNUNET_CLIENT_MANAGER_get_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection *mgr, | 207 | GNUNET_CLIENT_MANAGER_get_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection *mgr, |
@@ -197,9 +212,10 @@ GNUNET_CLIENT_MANAGER_get_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection | |||
197 | * Set user context to be associated with the given client manager. | 212 | * Set user context to be associated with the given client manager. |
198 | * Note: you should probably use the macro (call without the underscore). | 213 | * Note: you should probably use the macro (call without the underscore). |
199 | * | 214 | * |
200 | * @param mgr Client manager connection. | 215 | * @param mgr |
201 | * @param ctx User context. | 216 | * Client manager connection. |
202 | * @param size Number of bytes in user context struct (for verification only). | 217 | * @param size |
218 | * Number of bytes in user context struct (for verification only). | ||
203 | */ | 219 | */ |
204 | void | 220 | void |
205 | GNUNET_CLIENT_MANAGER_set_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection *mgr, | 221 | GNUNET_CLIENT_MANAGER_set_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection *mgr, |
@@ -210,9 +226,12 @@ GNUNET_CLIENT_MANAGER_set_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection | |||
210 | /** | 226 | /** |
211 | * Return user context associated with the given client manager. | 227 | * Return user context associated with the given client manager. |
212 | * | 228 | * |
213 | * @param mgr Client manager connection. | 229 | * @param mgr |
214 | * @param type Expected return type (i.e. 'struct Foo') | 230 | * Client manager connection. |
215 | * @return Pointer to user context of type 'type *'. | 231 | * @param ctx |
232 | * User context. | ||
233 | * @param size | ||
234 | * Number of bytes in user context struct (for verification only). | ||
216 | */ | 235 | */ |
217 | #define GNUNET_CLIENT_MANAGER_get_user_context(mgr, type) \ | 236 | #define GNUNET_CLIENT_MANAGER_get_user_context(mgr, type) \ |
218 | (type *) GNUNET_CLIENT_MANAGER_get_user_context_ (mgr, sizeof (type)) | 237 | (type *) GNUNET_CLIENT_MANAGER_get_user_context_ (mgr, sizeof (type)) |
@@ -221,8 +240,10 @@ GNUNET_CLIENT_MANAGER_set_user_context_ (struct GNUNET_CLIENT_MANAGER_Connection | |||
221 | /** | 240 | /** |
222 | * Set user context to be associated with the given client manager. | 241 | * Set user context to be associated with the given client manager. |
223 | * | 242 | * |
224 | * @param mgr Client manager connection. | 243 | * @param mgr |
225 | * @param ctx Pointer to user context. | 244 | * Client manager connection. |
245 | * @param ctx | ||
246 | * Pointer to user context. | ||
226 | */ | 247 | */ |
227 | #define GNUNET_CLIENT_MANAGER_set_user_context(mgr, ctx) \ | 248 | #define GNUNET_CLIENT_MANAGER_set_user_context(mgr, ctx) \ |
228 | GNUNET_CLIENT_MANAGER_set_user_context_ (mgr, ctx, sizeof (*ctx)) | 249 | GNUNET_CLIENT_MANAGER_set_user_context_ (mgr, ctx, sizeof (*ctx)) |