diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
commit | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (patch) | |
tree | edbc42f37889069033e57da201fef242939a6e0f /src/include/gnunet_connection_lib.h | |
parent | 502af2167f7c218366666ca4944bd7cc54b5b19a (diff) | |
download | gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.tar.gz gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.zip |
indentation
Diffstat (limited to 'src/include/gnunet_connection_lib.h')
-rw-r--r-- | src/include/gnunet_connection_lib.h | 80 |
1 files changed, 39 insertions, 41 deletions
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index 00b97d903..af10c5966 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h | |||
@@ -99,8 +99,7 @@ typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls, | |||
99 | * @param addrlen size of addr | 99 | * @param addrlen size of addr |
100 | * @param errCode value of errno (on errors receiving) | 100 | * @param errCode value of errno (on errors receiving) |
101 | */ | 101 | */ |
102 | typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, | 102 | typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf, |
103 | const void *buf, | ||
104 | size_t available, | 103 | size_t available, |
105 | const struct sockaddr * addr, | 104 | const struct sockaddr * addr, |
106 | socklen_t addrlen, int errCode); | 105 | socklen_t addrlen, int errCode); |
@@ -136,9 +135,9 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | |||
136 | * @param osSocket existing socket to box | 135 | * @param osSocket existing socket to box |
137 | * @return the boxed socket handle | 136 | * @return the boxed socket handle |
138 | */ | 137 | */ |
139 | struct GNUNET_CONNECTION_Handle | 138 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct |
140 | *GNUNET_CONNECTION_create_from_existing (struct | 139 | GNUNET_NETWORK_Handle |
141 | GNUNET_NETWORK_Handle *osSocket); | 140 | *osSocket); |
142 | 141 | ||
143 | 142 | ||
144 | /** | 143 | /** |
@@ -151,8 +150,8 @@ struct GNUNET_CONNECTION_Handle | |||
151 | * @return the socket handle, NULL on error (for example, access refused) | 150 | * @return the socket handle, NULL on error (for example, access refused) |
152 | */ | 151 | */ |
153 | struct GNUNET_CONNECTION_Handle | 152 | struct GNUNET_CONNECTION_Handle |
154 | *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck | 153 | *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, |
155 | access, void *access_cls, | 154 | void *access_cls, |
156 | struct GNUNET_NETWORK_Handle *lsock); | 155 | struct GNUNET_NETWORK_Handle *lsock); |
157 | 156 | ||
158 | 157 | ||
@@ -166,11 +165,15 @@ struct GNUNET_CONNECTION_Handle | |||
166 | * @param port port to connect to | 165 | * @param port port to connect to |
167 | * @return the socket handle | 166 | * @return the socket handle |
168 | */ | 167 | */ |
169 | struct GNUNET_CONNECTION_Handle | 168 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const |
170 | *GNUNET_CONNECTION_create_from_connect (const struct | 169 | struct |
171 | GNUNET_CONFIGURATION_Handle *cfg, | 170 | GNUNET_CONFIGURATION_Handle |
172 | const char *hostname, | 171 | *cfg, |
173 | uint16_t port); | 172 | const |
173 | char | ||
174 | *hostname, | ||
175 | uint16_t | ||
176 | port); | ||
174 | 177 | ||
175 | 178 | ||
176 | /** | 179 | /** |
@@ -201,10 +204,14 @@ struct GNUNET_CONNECTION_Handle | |||
201 | * @param addrlen length of server address | 204 | * @param addrlen length of server address |
202 | * @return the socket handle | 205 | * @return the socket handle |
203 | */ | 206 | */ |
204 | struct GNUNET_CONNECTION_Handle | 207 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int |
205 | *GNUNET_CONNECTION_create_from_sockaddr (int af_family, | 208 | af_family, |
206 | const struct sockaddr | 209 | const |
207 | *serv_addr, socklen_t addrlen); | 210 | struct |
211 | sockaddr | ||
212 | *serv_addr, | ||
213 | socklen_t | ||
214 | addrlen); | ||
208 | 215 | ||
209 | /** | 216 | /** |
210 | * Check if socket is valid (no fatal errors have happened so far). | 217 | * Check if socket is valid (no fatal errors have happened so far). |
@@ -225,9 +232,8 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | |||
225 | * @param addrlen where to store the length of the address | 232 | * @param addrlen where to store the length of the address |
226 | * @return GNUNET_OK on success | 233 | * @return GNUNET_OK on success |
227 | */ | 234 | */ |
228 | int GNUNET_CONNECTION_get_address (struct | 235 | int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, |
229 | GNUNET_CONNECTION_Handle | 236 | void **addr, size_t * addrlen); |
230 | *sock, void **addr, size_t * addrlen); | ||
231 | 237 | ||
232 | 238 | ||
233 | /** | 239 | /** |
@@ -243,9 +249,8 @@ int GNUNET_CONNECTION_get_address (struct | |||
243 | * read from the application; all other transmissions should be | 249 | * read from the application; all other transmissions should be |
244 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). | 250 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). |
245 | */ | 251 | */ |
246 | void | 252 | void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, |
247 | GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | 253 | int finish_pending_write); |
248 | int finish_pending_write); | ||
249 | 254 | ||
250 | 255 | ||
251 | /** | 256 | /** |
@@ -261,12 +266,10 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | |||
261 | * @param receiver function to call with received data | 266 | * @param receiver function to call with received data |
262 | * @param receiver_cls closure for receiver | 267 | * @param receiver_cls closure for receiver |
263 | */ | 268 | */ |
264 | void | 269 | void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, |
265 | GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle | 270 | size_t max, struct GNUNET_TIME_Relative timeout, |
266 | *sock, size_t max, | 271 | GNUNET_CONNECTION_Receiver receiver, |
267 | struct GNUNET_TIME_Relative timeout, | 272 | void *receiver_cls); |
268 | GNUNET_CONNECTION_Receiver receiver, | ||
269 | void *receiver_cls); | ||
270 | 273 | ||
271 | 274 | ||
272 | /** | 275 | /** |
@@ -291,8 +294,7 @@ void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); | |||
291 | * @param buf where the callee should write the message | 294 | * @param buf where the callee should write the message |
292 | * @return number of bytes written to buf | 295 | * @return number of bytes written to buf |
293 | */ | 296 | */ |
294 | typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, | 297 | typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, size_t size, |
295 | size_t size, | ||
296 | void *buf); | 298 | void *buf); |
297 | 299 | ||
298 | 300 | ||
@@ -332,11 +334,9 @@ struct GNUNET_CONNECTION_TransmitHandle; | |||
332 | * NULL if we are already going to notify someone else (busy) | 334 | * NULL if we are already going to notify someone else (busy) |
333 | */ | 335 | */ |
334 | struct GNUNET_CONNECTION_TransmitHandle | 336 | struct GNUNET_CONNECTION_TransmitHandle |
335 | *GNUNET_CONNECTION_notify_transmit_ready (struct | 337 | *GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle |
336 | GNUNET_CONNECTION_Handle | ||
337 | *sock, size_t size, | 338 | *sock, size_t size, |
338 | struct | 339 | struct GNUNET_TIME_Relative |
339 | GNUNET_TIME_Relative | ||
340 | timeout, | 340 | timeout, |
341 | GNUNET_CONNECTION_TransmitReadyNotify | 341 | GNUNET_CONNECTION_TransmitReadyNotify |
342 | notify, void *notify_cls); | 342 | notify, void *notify_cls); |
@@ -348,10 +348,9 @@ struct GNUNET_CONNECTION_TransmitHandle | |||
348 | * | 348 | * |
349 | * @param h handle for notification to cancel | 349 | * @param h handle for notification to cancel |
350 | */ | 350 | */ |
351 | void | 351 | void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
352 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | 352 | GNUNET_CONNECTION_TransmitHandle |
353 | GNUNET_CONNECTION_TransmitHandle | 353 | *h); |
354 | *h); | ||
355 | 354 | ||
356 | 355 | ||
357 | /** | 356 | /** |
@@ -360,9 +359,8 @@ GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | |||
360 | * @param sock socket handle | 359 | * @param sock socket handle |
361 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 360 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
362 | */ | 361 | */ |
363 | void | 362 | void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, |
364 | GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, | 363 | int do_ignore); |
365 | int do_ignore); | ||
366 | 364 | ||
367 | 365 | ||
368 | #if 0 /* keep Emacsens' auto-indent happy */ | 366 | #if 0 /* keep Emacsens' auto-indent happy */ |