diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
commit | 16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch) | |
tree | e09d4fe5191dc329b3e1b667f2914f8313bcba59 /src/include/gnunet_core_service.h | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/include/gnunet_core_service.h')
-rw-r--r-- | src/include/gnunet_core_service.h | 130 |
1 files changed, 54 insertions, 76 deletions
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 94272a30a..083276804 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -219,27 +219,18 @@ typedef void (*GNUNET_CORE_StartupCallback) (void *cls, | |||
219 | * @return handle to the core service (only useful for disconnect until 'init' is called), | 219 | * @return handle to the core service (only useful for disconnect until 'init' is called), |
220 | * NULL on error (in this case, init is never called) | 220 | * NULL on error (in this case, init is never called) |
221 | */ | 221 | */ |
222 | struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct | 222 | struct GNUNET_CORE_Handle * |
223 | GNUNET_CONFIGURATION_Handle | 223 | GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
224 | *cfg, unsigned int queue_size, | 224 | unsigned int queue_size, void *cls, |
225 | void *cls, | 225 | GNUNET_CORE_StartupCallback init, |
226 | GNUNET_CORE_StartupCallback | 226 | GNUNET_CORE_ConnectEventHandler connects, |
227 | init, | 227 | GNUNET_CORE_DisconnectEventHandler disconnects, |
228 | GNUNET_CORE_ConnectEventHandler | 228 | GNUNET_CORE_PeerStatusEventHandler status_events, |
229 | connects, | 229 | GNUNET_CORE_MessageCallback inbound_notify, |
230 | GNUNET_CORE_DisconnectEventHandler | 230 | int inbound_hdr_only, |
231 | disconnects, | 231 | GNUNET_CORE_MessageCallback outbound_notify, |
232 | GNUNET_CORE_PeerStatusEventHandler | 232 | int outbound_hdr_only, |
233 | status_events, | 233 | const struct GNUNET_CORE_MessageHandler *handlers); |
234 | GNUNET_CORE_MessageCallback | ||
235 | inbound_notify, | ||
236 | int inbound_hdr_only, | ||
237 | GNUNET_CORE_MessageCallback | ||
238 | outbound_notify, | ||
239 | int outbound_hdr_only, | ||
240 | const struct | ||
241 | GNUNET_CORE_MessageHandler | ||
242 | *handlers); | ||
243 | 234 | ||
244 | 235 | ||
245 | /** | 236 | /** |
@@ -249,7 +240,8 @@ struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct | |||
249 | * | 240 | * |
250 | * @param handle connection to core to disconnect | 241 | * @param handle connection to core to disconnect |
251 | */ | 242 | */ |
252 | void GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | 243 | void |
244 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | ||
253 | 245 | ||
254 | 246 | ||
255 | /** | 247 | /** |
@@ -290,17 +282,11 @@ typedef void (*GNUNET_CORE_ControlContinuation) (void *cls, int success); | |||
290 | * @param cont_cls closure for cont | 282 | * @param cont_cls closure for cont |
291 | * @return NULL on error (cont will not be called), otherwise handle for cancellation | 283 | * @return NULL on error (cont will not be called), otherwise handle for cancellation |
292 | */ | 284 | */ |
293 | struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | 285 | struct GNUNET_CORE_PeerRequestHandle * |
294 | GNUNET_CORE_Handle | 286 | GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, |
295 | *h, | 287 | const struct GNUNET_PeerIdentity *peer, |
296 | const | 288 | GNUNET_CORE_ControlContinuation cont, |
297 | struct | 289 | void *cont_cls); |
298 | GNUNET_PeerIdentity | ||
299 | *peer, | ||
300 | GNUNET_CORE_ControlContinuation | ||
301 | cont, | ||
302 | void | ||
303 | *cont_cls); | ||
304 | 290 | ||
305 | 291 | ||
306 | /** | 292 | /** |
@@ -309,9 +295,9 @@ struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | |||
309 | * | 295 | * |
310 | * @param req request handle that was returned for the original request | 296 | * @param req request handle that was returned for the original request |
311 | */ | 297 | */ |
312 | void GNUNET_CORE_peer_request_connect_cancel (struct | 298 | void |
313 | GNUNET_CORE_PeerRequestHandle | 299 | GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle |
314 | *req); | 300 | *req); |
315 | 301 | ||
316 | 302 | ||
317 | /** | 303 | /** |
@@ -372,15 +358,14 @@ struct GNUNET_CORE_InformationRequestContext; | |||
372 | * @param info_cls closure for info | 358 | * @param info_cls closure for info |
373 | * @return NULL on error | 359 | * @return NULL on error |
374 | */ | 360 | */ |
375 | struct GNUNET_CORE_InformationRequestContext | 361 | struct GNUNET_CORE_InformationRequestContext * |
376 | *GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, | 362 | GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, |
377 | const struct GNUNET_PeerIdentity *peer, | 363 | const struct GNUNET_PeerIdentity *peer, |
378 | struct GNUNET_TIME_Relative timeout, | 364 | struct GNUNET_TIME_Relative timeout, |
379 | struct GNUNET_BANDWIDTH_Value32NBO | 365 | struct GNUNET_BANDWIDTH_Value32NBO bw_out, |
380 | bw_out, int32_t amount, | 366 | int32_t amount, uint64_t preference, |
381 | uint64_t preference, | 367 | GNUNET_CORE_PeerConfigurationInfoCallback |
382 | GNUNET_CORE_PeerConfigurationInfoCallback | 368 | info, void *info_cls); |
383 | info, void *info_cls); | ||
384 | 369 | ||
385 | 370 | ||
386 | /** | 371 | /** |
@@ -394,9 +379,10 @@ struct GNUNET_CORE_InformationRequestContext | |||
394 | * | 379 | * |
395 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call | 380 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call |
396 | */ | 381 | */ |
397 | void GNUNET_CORE_peer_change_preference_cancel (struct | 382 | void |
398 | GNUNET_CORE_InformationRequestContext | 383 | GNUNET_CORE_peer_change_preference_cancel (struct |
399 | *irc); | 384 | GNUNET_CORE_InformationRequestContext |
385 | *irc); | ||
400 | 386 | ||
401 | 387 | ||
402 | /** | 388 | /** |
@@ -407,9 +393,10 @@ void GNUNET_CORE_peer_change_preference_cancel (struct | |||
407 | * @param cb_cls closure for peer_cb | 393 | * @param cb_cls closure for peer_cb |
408 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors | 394 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors |
409 | */ | 395 | */ |
410 | int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | 396 | int |
411 | GNUNET_CORE_ConnectEventHandler peer_cb, | 397 | GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, |
412 | void *cb_cls); | 398 | GNUNET_CORE_ConnectEventHandler peer_cb, |
399 | void *cb_cls); | ||
413 | 400 | ||
414 | /** | 401 | /** |
415 | * Iterate over all currently connected peers. | 402 | * Iterate over all currently connected peers. |
@@ -424,10 +411,11 @@ int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
424 | * | 411 | * |
425 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error | 412 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error |
426 | */ | 413 | */ |
427 | int GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle | 414 | int |
428 | *cfg, struct GNUNET_PeerIdentity *peer, | 415 | GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, |
429 | GNUNET_CORE_ConnectEventHandler peer_cb, | 416 | struct GNUNET_PeerIdentity *peer, |
430 | void *cb_cls); | 417 | GNUNET_CORE_ConnectEventHandler peer_cb, |
418 | void *cb_cls); | ||
431 | 419 | ||
432 | 420 | ||
433 | /** | 421 | /** |
@@ -464,25 +452,14 @@ struct GNUNET_CORE_TransmitHandle; | |||
464 | * NULL if we can not even queue the request (insufficient | 452 | * NULL if we can not even queue the request (insufficient |
465 | * memory); if NULL is returned, "notify" will NOT be called. | 453 | * memory); if NULL is returned, "notify" will NOT be called. |
466 | */ | 454 | */ |
467 | struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | 455 | struct GNUNET_CORE_TransmitHandle * |
468 | GNUNET_CORE_Handle | 456 | GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, |
469 | *handle, | 457 | uint32_t priority, |
470 | int cork, | 458 | struct GNUNET_TIME_Relative maxdelay, |
471 | uint32_t | 459 | const struct GNUNET_PeerIdentity *target, |
472 | priority, | 460 | size_t notify_size, |
473 | struct | 461 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
474 | GNUNET_TIME_Relative | 462 | void *notify_cls); |
475 | maxdelay, | ||
476 | const | ||
477 | struct | ||
478 | GNUNET_PeerIdentity | ||
479 | *target, | ||
480 | size_t | ||
481 | notify_size, | ||
482 | GNUNET_CONNECTION_TransmitReadyNotify | ||
483 | notify, | ||
484 | void | ||
485 | *notify_cls); | ||
486 | 463 | ||
487 | 464 | ||
488 | /** | 465 | /** |
@@ -490,8 +467,9 @@ struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | |||
490 | * | 467 | * |
491 | * @param th handle that was returned by "notify_transmit_ready". | 468 | * @param th handle that was returned by "notify_transmit_ready". |
492 | */ | 469 | */ |
493 | void GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | 470 | void |
494 | *th); | 471 | GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle |
472 | *th); | ||
495 | 473 | ||
496 | 474 | ||
497 | #if 0 /* keep Emacsens' auto-indent happy */ | 475 | #if 0 /* keep Emacsens' auto-indent happy */ |