From c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sat, 5 Oct 2019 15:09:28 +0200 Subject: global reindent, now with uncrustify hook enabled --- src/cadet/cadet_api_get_channel.c | 121 +++++++++++++++++++------------------- 1 file changed, 61 insertions(+), 60 deletions(-) (limited to 'src/cadet/cadet_api_get_channel.c') diff --git a/src/cadet/cadet_api_get_channel.c b/src/cadet/cadet_api_get_channel.c index 5479f4238..6d86e8e81 100644 --- a/src/cadet/cadet_api_get_channel.c +++ b/src/cadet/cadet_api_get_channel.c @@ -34,7 +34,8 @@ /** * Operation handle. */ -struct GNUNET_CADET_ChannelMonitor { +struct GNUNET_CADET_ChannelMonitor +{ /** * Channel callback. */ @@ -81,10 +82,10 @@ struct GNUNET_CADET_ChannelMonitor { * #GNUNET_SYSERR otherwise */ static int -check_channel_info(void *cls, - const struct GNUNET_CADET_ChannelInfoMessage *message) +check_channel_info (void *cls, + const struct GNUNET_CADET_ChannelInfoMessage *message) { - (void)cls; + (void) cls; return GNUNET_OK; } @@ -97,17 +98,17 @@ check_channel_info(void *cls, * @param message Message itself. */ static void -handle_channel_info(void *cls, - const struct GNUNET_CADET_ChannelInfoMessage *message) +handle_channel_info (void *cls, + const struct GNUNET_CADET_ChannelInfoMessage *message) { struct GNUNET_CADET_ChannelMonitor *cm = cls; struct GNUNET_CADET_ChannelInternals ci; ci.root = message->root; ci.dest = message->dest; - cm->channel_cb(cm->channel_cb_cls, - &ci); - GNUNET_CADET_get_channel_cancel(cm); + cm->channel_cb (cm->channel_cb_cls, + &ci); + GNUNET_CADET_get_channel_cancel (cm); } @@ -118,14 +119,14 @@ handle_channel_info(void *cls, * @param message Message itself. */ static void -handle_channel_info_end(void *cls, - const struct GNUNET_MessageHeader *message) +handle_channel_info_end (void *cls, + const struct GNUNET_MessageHeader *message) { struct GNUNET_CADET_ChannelMonitor *cm = cls; - cm->channel_cb(cm->channel_cb_cls, - NULL); - GNUNET_CADET_get_channel_cancel(cm); + cm->channel_cb (cm->channel_cb_cls, + NULL); + GNUNET_CADET_get_channel_cancel (cm); } @@ -135,7 +136,7 @@ handle_channel_info_end(void *cls, * @param cls a `struct GNUNET_CADET_ChannelMonitor` operation */ static void -reconnect(void *cls); +reconnect (void *cls); /** @@ -145,18 +146,18 @@ reconnect(void *cls); * @param error error code from MQ */ static void -error_handler(void *cls, - enum GNUNET_MQ_Error error) +error_handler (void *cls, + enum GNUNET_MQ_Error error) { struct GNUNET_CADET_ChannelMonitor *cm = cls; - GNUNET_MQ_destroy(cm->mq); + GNUNET_MQ_destroy (cm->mq); cm->mq = NULL; - cm->backoff = GNUNET_TIME_randomized_backoff(cm->backoff, - GNUNET_TIME_UNIT_MINUTES); - cm->reconnect_task = GNUNET_SCHEDULER_add_delayed(cm->backoff, - &reconnect, - cm); + cm->backoff = GNUNET_TIME_randomized_backoff (cm->backoff, + GNUNET_TIME_UNIT_MINUTES); + cm->reconnect_task = GNUNET_SCHEDULER_add_delayed (cm->backoff, + &reconnect, + cm); } @@ -166,36 +167,36 @@ error_handler(void *cls, * @param cls a `struct GNUNET_CADET_ChannelMonitor` operation */ static void -reconnect(void *cls) +reconnect (void *cls) { struct GNUNET_CADET_ChannelMonitor *cm = cls; struct GNUNET_MQ_MessageHandler handlers[] = { - GNUNET_MQ_hd_fixed_size(channel_info_end, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL_END, - struct GNUNET_MessageHeader, - cm), - GNUNET_MQ_hd_var_size(channel_info, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL, - struct GNUNET_CADET_ChannelInfoMessage, - cm), - GNUNET_MQ_handler_end() + GNUNET_MQ_hd_fixed_size (channel_info_end, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL_END, + struct GNUNET_MessageHeader, + cm), + GNUNET_MQ_hd_var_size (channel_info, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_INFO_CHANNEL, + struct GNUNET_CADET_ChannelInfoMessage, + cm), + GNUNET_MQ_handler_end () }; struct GNUNET_CADET_RequestChannelInfoMessage *msg; struct GNUNET_MQ_Envelope *env; cm->reconnect_task = NULL; - cm->mq = GNUNET_CLIENT_connect(cm->cfg, - "cadet", - handlers, - &error_handler, - cm); + cm->mq = GNUNET_CLIENT_connect (cm->cfg, + "cadet", + handlers, + &error_handler, + cm); if (NULL == cm->mq) return; - env = GNUNET_MQ_msg(msg, - GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_CHANNEL); + env = GNUNET_MQ_msg (msg, + GNUNET_MESSAGE_TYPE_CADET_LOCAL_REQUEST_INFO_CHANNEL); msg->target = cm->peer; - GNUNET_MQ_send(cm->mq, - env); + GNUNET_MQ_send (cm->mq, + env); } @@ -209,29 +210,29 @@ reconnect(void *cls) * @return NULL on error */ struct GNUNET_CADET_ChannelMonitor * -GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, - struct GNUNET_PeerIdentity *peer, - GNUNET_CADET_ChannelCB callback, - void *callback_cls) +GNUNET_CADET_get_channel (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_PeerIdentity *peer, + GNUNET_CADET_ChannelCB callback, + void *callback_cls) { struct GNUNET_CADET_ChannelMonitor *cm; if (NULL == callback) - { - GNUNET_break(0); - return NULL; - } - cm = GNUNET_new(struct GNUNET_CADET_ChannelMonitor); + { + GNUNET_break (0); + return NULL; + } + cm = GNUNET_new (struct GNUNET_CADET_ChannelMonitor); cm->channel_cb = callback; cm->channel_cb_cls = callback_cls; cm->cfg = cfg; cm->peer = *peer; - reconnect(cm); + reconnect (cm); if (NULL == cm->mq) - { - GNUNET_free(cm); - return NULL; - } + { + GNUNET_free (cm); + return NULL; + } return cm; } @@ -243,15 +244,15 @@ GNUNET_CADET_get_channel(const struct GNUNET_CONFIGURATION_Handle *cfg, * @return Closure that was given to #GNUNET_CADET_get_channel(). */ void * -GNUNET_CADET_get_channel_cancel(struct GNUNET_CADET_ChannelMonitor *cm) +GNUNET_CADET_get_channel_cancel (struct GNUNET_CADET_ChannelMonitor *cm) { void *ret = cm->channel_cb_cls; if (NULL != cm->mq) - GNUNET_MQ_destroy(cm->mq); + GNUNET_MQ_destroy (cm->mq); if (NULL != cm->reconnect_task) - GNUNET_SCHEDULER_cancel(cm->reconnect_task); - GNUNET_free(cm); + GNUNET_SCHEDULER_cancel (cm->reconnect_task); + GNUNET_free (cm); return ret; } -- cgit v1.2.3