diff options
197 files changed, 4159 insertions, 4237 deletions
diff --git a/.indent.pro b/.indent.pro index 7009a9140..89b4984ad 100644 --- a/.indent.pro +++ b/.indent.pro @@ -1,3 +1,5 @@ +//LRN extension for return values for prototypes +-nddd //GNU (default) style: // //-nbad -bap -nbc -bbo -bl -bli2 -bls -ncdb -nce -cp1 -cs -di2 diff --git a/pre-commit b/pre-commit index 2fc554236..da86ca59c 100755 --- a/pre-commit +++ b/pre-commit @@ -1,8 +1,8 @@ #!/bin/sh find src/ -name "*.c" -exec indent {} \; -find src/ -name "*.c" -exec indent {} \; +find src/ -name "*.h" -exec indent {} \; if test -x "`which 'dos2unix'`" then find src/ -name "*.c" -exec dos2unix {} \; - find src/ -name "*.c" -exec dos2unix {} \; + find src/ -name "*.h" -exec dos2unix {} \; fi diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index cf5e1592a..7e108cb41 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c @@ -138,7 +138,8 @@ static struct GNUNET_TIME_Relative timeout; * @param cls closure, unused * @param tc context, unused */ -static void cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -305,9 +306,8 @@ cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_ARM_stop_service (h, "arm", (0 == - timeout. - rel_value) ? STOP_TIMEOUT_ARM : timeout, - &confirm_cb, "arm"); + timeout.rel_value) ? STOP_TIMEOUT_ARM : + timeout, &confirm_cb, "arm"); return; } break; @@ -336,9 +336,8 @@ cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { GNUNET_CLIENT_service_test (test, cfg, (0 == - timeout. - rel_value) ? TEST_TIMEOUT : timeout, - &confirm_task, test); + timeout.rel_value) ? TEST_TIMEOUT : + timeout, &confirm_task, test); return; } break; diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index ddccb7fa0..e85b2eb12 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c @@ -722,8 +722,8 @@ delayed_restart_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { lowestRestartDelay = GNUNET_TIME_relative_min (lowestRestartDelay, - GNUNET_TIME_absolute_get_remaining (pos-> - restartAt)); + GNUNET_TIME_absolute_get_remaining + (pos->restartAt)); } } pos = pos->next; diff --git a/src/arm/gnunet-service-arm.h b/src/arm/gnunet-service-arm.h index bdb5d2c93..e8d125b92 100644 --- a/src/arm/gnunet-service-arm.h +++ b/src/arm/gnunet-service-arm.h @@ -35,8 +35,9 @@ * @param lsocks -1 terminated list of listen sockets to pass (systemd style), or NULL * @return GNUNET_OK on success */ -int start_service (struct GNUNET_SERVER_Client *client, const char *servicename, - const int *lsocks); +int +start_service (struct GNUNET_SERVER_Client *client, const char *servicename, + const int *lsocks); /** * Stop listening for connections to a service. @@ -45,9 +46,10 @@ int start_service (struct GNUNET_SERVER_Client *client, const char *servicename, * @return GNUNET_OK if we stopped to listen, GNUNET_NO if we were * not listening */ -int stop_listening (const char *serviceName); +int +stop_listening (const char *serviceName); -void prepareServices (const struct GNUNET_CONFIGURATION_Handle - *configurationHandle); +void +prepareServices (const struct GNUNET_CONFIGURATION_Handle *configurationHandle); #endif diff --git a/src/arm/gnunet-service-arm_interceptor.c b/src/arm/gnunet-service-arm_interceptor.c index 6d417ba37..59f8ac30b 100644 --- a/src/arm/gnunet-service-arm_interceptor.c +++ b/src/arm/gnunet-service-arm_interceptor.c @@ -356,8 +356,8 @@ closeClientAndServiceSockets (struct ForwardedConnection *fc, int reason) * @param cls callback data, struct ForwardedConnection for the communication between client and service * @param tc context */ -static void receiveFromClient (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -366,15 +366,15 @@ static void receiveFromClient (void *cls, * @param cls callback data, struct ForwardedConnection for the communication between client and service * @param tc scheduler context */ -static void receiveFromService (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * */ -static void start_forwarding (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +start_forwarding (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); @@ -497,8 +497,7 @@ receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_a2s (fc->listen_info->service_addr, fc->listen_info->service_addr_len), (unsigned long long) GNUNET_TIME_relative_min (fc->back_off, - rem). - rel_value); + rem).rel_value); #endif rem = GNUNET_TIME_absolute_get_remaining (fc->timeout); GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task); @@ -584,8 +583,7 @@ forwardToService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_a2s (fc->listen_info->service_addr, fc->listen_info->service_addr_len), (unsigned long long) GNUNET_TIME_relative_min (fc->back_off, - rem). - rel_value); + rem).rel_value); #endif rem = GNUNET_TIME_absolute_get_remaining (fc->timeout); GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task); @@ -913,8 +911,8 @@ stop_listening (const char *serviceName) * @param cls callback data, struct ServiceListeningInfo describing a listen socket * @param tc context */ -static void acceptConnection (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); static void @@ -948,8 +946,8 @@ accept_and_forward (struct ServiceListeningInfo *serviceListeningInfo) return; } GNUNET_break (GNUNET_OK == - GNUNET_NETWORK_socket_close (serviceListeningInfo-> - listeningSocket)); + GNUNET_NETWORK_socket_close + (serviceListeningInfo->listeningSocket)); start_service (NULL, serviceListeningInfo->serviceName, NULL); GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' started\n"), fc->listen_info->serviceName); diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 04c52d0eb..3b68039b1 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c @@ -251,8 +251,8 @@ arm_notify_stop (void *cls, int success) } -static void kill_task (void *cbData, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc); static void @@ -273,8 +273,8 @@ arm_notify (void *cls, int success) } -static void kill_task (void *cbData, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc); static void diff --git a/src/chat/chat.c b/src/chat/chat.c index 74dde678c..fb47b6c15 100644 --- a/src/chat/chat.c +++ b/src/chat/chat.c @@ -148,7 +148,8 @@ struct GNUNET_CHAT_SendReceiptContext /** * Ask client to send a join request. */ -static int rejoin_room (struct GNUNET_CHAT_Room *chat_room); +static int +rejoin_room (struct GNUNET_CHAT_Room *chat_room); /** @@ -404,9 +405,8 @@ process_result (struct GNUNET_CHAT_Room *room, if (NULL != room->confirmation_callback) room->confirmation_callback (room->confirmation_cls, room, ntohl (receipt->sequence_number), - GNUNET_TIME_absolute_ntoh (receipt-> - timestamp), - &receipt->target); + GNUNET_TIME_absolute_ntoh + (receipt->timestamp), &receipt->target); break; default: GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Unknown message type: '%u'\n"), diff --git a/src/chat/gnunet-chat.c b/src/chat/gnunet-chat.c index c656d1cad..53884a299 100644 --- a/src/chat/gnunet-chat.c +++ b/src/chat/gnunet-chat.c @@ -76,7 +76,8 @@ free_user_list () } } -static int do_help (const char *args, const void *xtra); +static int +do_help (const char *args, const void *xtra); /** diff --git a/src/core/core_api.c b/src/core/core_api.c index 5ec48d68c..27754010a 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c @@ -371,7 +371,8 @@ struct GNUNET_CORE_TransmitHandle * * @param h our handle to the core service */ -static void reconnect (struct GNUNET_CORE_Handle *h); +static void +reconnect (struct GNUNET_CORE_Handle *h); /** @@ -515,8 +516,8 @@ reconnect_later (struct GNUNET_CORE_Handle *h) * @param h core handle * @param ignore_currently_down transmit message even if not initialized? */ -static void trigger_next_request (struct GNUNET_CORE_Handle *h, - int ignore_currently_down); +static void +trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down); /** @@ -526,9 +527,8 @@ static void trigger_next_request (struct GNUNET_CORE_Handle *h, * @param cls the transmit handle of the request that timed out * @param tc context, can be NULL (!) */ -static void transmission_timeout (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -776,8 +776,8 @@ trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down) } if (h->control_pending_head != NULL) msize = - ntohs (((struct GNUNET_MessageHeader *) &h->control_pending_head[1])-> - size); + ntohs (((struct GNUNET_MessageHeader *) &h-> + control_pending_head[1])->size); else if (h->ready_peer_head != NULL) msize = h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage); diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index e97e9fe46..7385991a2 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c @@ -1807,7 +1807,8 @@ free_neighbour (struct Neighbour *n) * * @param n neighbour to check. */ -static void process_encrypted_neighbour_queue (struct Neighbour *n); +static void +process_encrypted_neighbour_queue (struct Neighbour *n); /** @@ -1854,7 +1855,8 @@ do_encrypt (struct Neighbour *n, * * @param n neighbour to consider discarding */ -static void consider_free_neighbour (struct Neighbour *n); +static void +consider_free_neighbour (struct Neighbour *n); /** @@ -2006,9 +2008,9 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) #if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Copied message of type %u and size %u into transport buffer for `%4s'\n", - (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])-> - type), (unsigned int) ret, - GNUNET_i2s (&n->peer)); + (unsigned int) + ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), + (unsigned int) ret, GNUNET_i2s (&n->peer)); #endif process_encrypted_neighbour_queue (n); } @@ -2017,8 +2019,9 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) #if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Transmission of message of type %u and size %u failed\n", - (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])-> - type), (unsigned int) m->size); + (unsigned int) + ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), + (unsigned int) m->size); #endif } GNUNET_free (m); @@ -2038,7 +2041,8 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) * * @param n neighbour to check. */ -static void process_plaintext_neighbour_queue (struct Neighbour *n); +static void +process_plaintext_neighbour_queue (struct Neighbour *n); /** @@ -2071,9 +2075,8 @@ process_encrypted_neighbour_queue (struct Neighbour *n) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", (unsigned int) m->size, GNUNET_i2s (&n->peer), - (unsigned long long) GNUNET_TIME_absolute_get_remaining (m-> - deadline). - rel_value); + (unsigned long long) + GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value); #endif n->th = GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, @@ -2436,8 +2439,8 @@ batch_message (struct Neighbour *n, char *buf, size_t size, (unsigned int) ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->type), (unsigned int) - ntohs (((const struct GNUNET_MessageHeader *) &pos[1])-> - size)); + ntohs (((const struct GNUNET_MessageHeader *) + &pos[1])->size)); #endif /* copy for encrypted transmission */ memcpy (&buf[ret], &pos[1], pos->size); @@ -2448,9 +2451,8 @@ batch_message (struct Neighbour *n, char *buf, size_t size, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Adding plaintext message of size %u with deadline %llu ms to batch\n", (unsigned int) pos->size, - (unsigned long long) GNUNET_TIME_absolute_get_remaining (pos-> - deadline). - rel_value); + (unsigned long long) + GNUNET_TIME_absolute_get_remaining (pos->deadline).rel_value); #endif deadline->abs_value = GNUNET_MIN (deadline->abs_value, pos->deadline.abs_value); @@ -2548,7 +2550,8 @@ retry_plaintext_processing (void *cls, * * @param n the other peer */ -static void send_key (struct Neighbour *n); +static void +send_key (struct Neighbour *n); /** * Task that will retry "send_key" if our previous attempt failed @@ -2734,9 +2737,9 @@ process_plaintext_neighbour_queue (struct Neighbour *n) * @param cls neighbour for the quota update * @param tc context */ -static void neighbour_quota_update (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +neighbour_quota_update (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -3269,9 +3272,9 @@ send_key (struct Neighbour *n) #if DEBUG_CORE GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Have %llu ms left for `%s' transmission.\n", - (unsigned long long) GNUNET_TIME_absolute_get_remaining (me-> - deadline). - rel_value, "SET_KEY"); + (unsigned long long) + GNUNET_TIME_absolute_get_remaining (me->deadline).rel_value, + "SET_KEY"); #endif trigger_processing: /* trigger queue processing */ @@ -3293,9 +3296,10 @@ trigger_processing: * @param ats performance data * @param ats_count number of entries in ats (excluding 0-termination) */ -static void handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m, - const struct GNUNET_TRANSPORT_ATS_Information *ats, - uint32_t ats_count); +static void +handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m, + const struct GNUNET_TRANSPORT_ATS_Information *ats, + uint32_t ats_count); @@ -3843,8 +3847,8 @@ send_p2p_message_to_client (struct Neighbour *sender, struct Client *client, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Core service passes message from `%4s' of type %u to client.\n", GNUNET_i2s (&sender->peer), - (unsigned int) ntohs (((const struct GNUNET_MessageHeader *) m)-> - type)); + (unsigned int) + ntohs (((const struct GNUNET_MessageHeader *) m)->type)); #endif ntm = (struct NotifyTrafficMessage *) buf; ntm->header.size = htons (size); diff --git a/src/core/test_core_api_preferences.c b/src/core/test_core_api_preferences.c index e5d5deb1b..8bc977df2 100644 --- a/src/core/test_core_api_preferences.c +++ b/src/core/test_core_api_preferences.c @@ -75,8 +75,8 @@ static GNUNET_SCHEDULER_TaskIdentifier ask_task; static unsigned int total_reserve = 5; -static void process_hello (void *cls, - const struct GNUNET_MessageHeader *message); +static void +process_hello (void *cls, const struct GNUNET_MessageHeader *message); static void terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) @@ -151,11 +151,10 @@ transmit_ready (void *cls, size_t size, void *buf) return sizeof (struct GNUNET_MessageHeader); } -static void preference_cb (void *cls, const struct GNUNET_PeerIdentity *peer, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, - int32_t amount, - struct GNUNET_TIME_Relative res_delay, - uint64_t preference); +static void +preference_cb (void *cls, const struct GNUNET_PeerIdentity *peer, + struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, int32_t amount, + struct GNUNET_TIME_Relative res_delay, uint64_t preference); static void do_reserve (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index afe6ad269..47d1ae8ac 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c @@ -113,8 +113,8 @@ get_size (unsigned int iter) return sizeof (struct TestMessage) + (ret % 60000); } -static void process_hello (void *cls, - const struct GNUNET_MessageHeader *message); +static void +process_hello (void *cls, const struct GNUNET_MessageHeader *message); static void terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) @@ -296,7 +296,8 @@ outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, } -static size_t transmit_ready (void *cls, size_t size, void *buf); +static size_t +transmit_ready (void *cls, size_t size, void *buf); static int process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 88ba2c0f2..41d156c6b 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c @@ -114,8 +114,8 @@ struct TestMessage uint32_t num; }; -static void process_hello (void *cls, - const struct GNUNET_MessageHeader *message); +static void +process_hello (void *cls, const struct GNUNET_MessageHeader *message); static void terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) @@ -424,7 +424,8 @@ outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, } -static size_t transmit_ready (void *cls, size_t size, void *buf); +static size_t +transmit_ready (void *cls, size_t size, void *buf); static int process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index a5dc02362..131ca4b82 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c @@ -91,8 +91,8 @@ run (void *cls, char *const *args, const char *cfgfile, } fprintf (stderr, "\n"); fprintf (stdout, "Stored %u items in %llums\n", ITERATIONS, - (unsigned long long) GNUNET_TIME_absolute_get_duration (start). - rel_value); + (unsigned long long) + GNUNET_TIME_absolute_get_duration (start).rel_value); GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name); GAUGER (gstr, "Time to PUT item in datacache", GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, @@ -111,8 +111,9 @@ run (void *cls, char *const *args, const char *cfgfile, fprintf (stdout, "Found %u/%u items in %llums (%u were deleted during storage processing)\n", found, ITERATIONS, - (unsigned long long) GNUNET_TIME_absolute_get_duration (start). - rel_value, ITERATIONS - found); + (unsigned long long) + GNUNET_TIME_absolute_get_duration (start).rel_value, + ITERATIONS - found); if (found > 0) GAUGER (gstr, "Time to GET item from datacache", GNUNET_TIME_absolute_get_duration (start).rel_value / found, diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index ff49c106e..8a8f64eb3 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c @@ -480,7 +480,8 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h, size_t msize, * * @param h handle to the datastore */ -static void process_queue (struct GNUNET_DATASTORE_Handle *h); +static void +process_queue (struct GNUNET_DATASTORE_Handle *h); /** diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 8efb706c1..d6a0b3c81 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c @@ -276,8 +276,8 @@ static struct GNUNET_STATISTICS_GetHandle *stat_get; * @param cls not used * @param tc task context */ -static void delete_expired (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index cf9911329..07df6a691 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c @@ -104,8 +104,8 @@ struct CpsRunContext -static void run_continuation (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 1e2a29f14..36dc84656 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c @@ -145,7 +145,8 @@ putValue (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) stored_entries++; } -static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); static int diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c index 63b065b0c..d6b6d6c62 100644 --- a/src/datastore/plugin_datastore_mysql.c +++ b/src/datastore/plugin_datastore_mysql.c @@ -1068,12 +1068,12 @@ mysql_plugin_get_key (void *cls, uint64_t offset, const GNUNET_HashCode * key, { ret = prepared_statement_run_select (plugin, - plugin->count_entry_by_hash_vhash_and_type, - 1, cbind, MYSQL_TYPE_BLOB, key, - hashSize, &hashSize, MYSQL_TYPE_BLOB, - vhash, hashSize2, &hashSize2, - MYSQL_TYPE_LONG, &type, GNUNET_YES, - -1); + plugin-> + count_entry_by_hash_vhash_and_type, 1, + cbind, MYSQL_TYPE_BLOB, key, hashSize, + &hashSize, MYSQL_TYPE_BLOB, vhash, + hashSize2, &hashSize2, MYSQL_TYPE_LONG, + &type, GNUNET_YES, -1); } else { diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index 3dff4a588..91350f203 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c @@ -134,8 +134,8 @@ struct CpsRunContext }; -static void run_continuation (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); static void diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 230b7eb67..72348e28c 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c @@ -117,8 +117,8 @@ struct CpsRunContext }; -static void run_continuation (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); static void diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index a34c4e38a..3a924c7b6 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c @@ -141,7 +141,8 @@ put_value (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) } -static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); static uint64_t guid; diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index eded50efc..9c378dca1 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c @@ -203,7 +203,8 @@ struct GNUNET_DHT_Handle /** * Transmit the next pending message, called by notify_transmit_ready */ -static size_t transmit_pending (void *cls, size_t size, void *buf); +static size_t +transmit_pending (void *cls, size_t size, void *buf); /** @@ -211,8 +212,8 @@ static size_t transmit_pending (void *cls, size_t size, void *buf); * a demultiplexer which handles numerous message types * */ -static void service_message_handler (void *cls, - const struct GNUNET_MessageHeader *msg); +static void +service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg); @@ -273,7 +274,8 @@ add_request_to_pending (void *cls, const GNUNET_HashCode * key, void *value) * Try to send messages from list of messages to send * @param handle DHT_Handle */ -static void process_pending_messages (struct GNUNET_DHT_Handle *handle); +static void +process_pending_messages (struct GNUNET_DHT_Handle *handle); /** @@ -760,11 +762,9 @@ GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle) route_handle->message); } GNUNET_assert (GNUNET_YES == - GNUNET_CONTAINER_multihashmap_remove (route_handle-> - dht_handle-> - active_requests, - &route_handle->key, - route_handle)); + GNUNET_CONTAINER_multihashmap_remove + (route_handle->dht_handle->active_requests, &route_handle->key, + route_handle)); GNUNET_free (route_handle->message); GNUNET_free (route_handle); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DHT route stop request processed\n"); diff --git a/src/dht/dhtlog.h b/src/dht/dhtlog.h index 476a4039e..cdab36305 100644 --- a/src/dht/dhtlog.h +++ b/src/dht/dhtlog.h @@ -373,14 +373,14 @@ struct GNUNET_DHTLOG_Plugin * * @param c a configuration to use */ -struct GNUNET_DHTLOG_Handle *GNUNET_DHTLOG_connect (const struct - GNUNET_CONFIGURATION_Handle - *c); +struct GNUNET_DHTLOG_Handle * +GNUNET_DHTLOG_connect (const struct GNUNET_CONFIGURATION_Handle *c); /** * Shutdown the module. */ -void GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); +void +GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index d58e49e3b..4f411f4a9 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c @@ -1244,12 +1244,14 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) /** * Forward declaration. */ -static void do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Forward declaration. */ -static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Iterator over hash map entries. @@ -1465,8 +1467,8 @@ iterate_min_heap_peers (void *cls, struct GNUNET_CONTAINER_HeapNode *node, GNUNET_TESTING_daemons_connect (d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, GNUNET_YES, NULL, NULL); } - if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). - rel_value > 0) + if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).rel_value + > 0) return GNUNET_YES; else return GNUNET_NO; @@ -1475,10 +1477,10 @@ iterate_min_heap_peers (void *cls, struct GNUNET_CONTAINER_HeapNode *node, /** * Forward declaration. */ -static void schedule_churn_find_peer_requests (void *cls, - const struct - GNUNET_SCHEDULER_TaskContext - *tc); +static void +schedule_churn_find_peer_requests (void *cls, + const struct GNUNET_SCHEDULER_TaskContext + *tc); /** * Callback for iterating over all the peer connections of a peer group. @@ -1555,12 +1557,11 @@ count_peers_churn_cb (void *cls, const struct GNUNET_PeerIdentity *first, */ GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Out of %u peers, fewest connections is %d\n", - GNUNET_CONTAINER_heap_get_size (find_peer_context-> - peer_min_heap), - peer_count->count); + GNUNET_CONTAINER_heap_get_size + (find_peer_context->peer_min_heap), peer_count->count); if ((peer_count->count == 0) && - (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). - rel_value > 0)) + (GNUNET_TIME_absolute_get_remaining + (find_peer_context->endtime).rel_value > 0)) { GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); @@ -1570,8 +1571,9 @@ count_peers_churn_cb (void *cls, const struct GNUNET_PeerIdentity *first, GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, find_peer_context); } - else if ((GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). - rel_value > 0) && (find_peer_context->last_sent != 0)) + else if ((GNUNET_TIME_absolute_get_remaining + (find_peer_context->endtime).rel_value > 0) && + (find_peer_context->last_sent != 0)) { GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, find_peer_context); @@ -1772,8 +1774,8 @@ churn_complete (void *cls, const char *emsg) } GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Added %d peers to heap, total size %d\n", count_added, - GNUNET_CONTAINER_heap_get_size (find_peer_context-> - peer_min_heap)); + GNUNET_CONTAINER_heap_get_size + (find_peer_context->peer_min_heap)); GNUNET_SCHEDULER_add_delayed (DEFAULT_PEER_DISCONNECT_TIMEOUT, &schedule_churn_get_topology, find_peer_context); @@ -2262,14 +2264,14 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) test_put->next); } -static void schedule_find_peer_requests (void *cls, - const struct - GNUNET_SCHEDULER_TaskContext *tc); +static void +schedule_find_peer_requests (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); #if HAVE_MALICIOUS -static void setup_malicious_peers (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +setup_malicious_peers (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); #endif /** @@ -2322,8 +2324,8 @@ count_peers_cb (void *cls, const struct GNUNET_PeerIdentity *first, if ((find_peer_context->last_sent < 8) || ((find_peer_context->current_peers < 2 * connection_estimate (num_peers, DEFAULT_BUCKET_SIZE)) && - (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). - rel_value > 0) && + (GNUNET_TIME_absolute_get_remaining + (find_peer_context->endtime).rel_value > 0) && (find_peer_context->current_peers < target_total_connections))) { GNUNET_SCHEDULER_add_now (&schedule_find_peer_requests, @@ -2424,11 +2426,9 @@ schedule_find_peer_requests (void *cls, peer_count = GNUNET_CONTAINER_heap_remove_root (find_peer_ctx->peer_min_heap); GNUNET_assert (GNUNET_YES == - GNUNET_CONTAINER_multihashmap_remove (find_peer_ctx-> - peer_hash, - &peer_count->peer_id. - hashPubKey, - peer_count)); + GNUNET_CONTAINER_multihashmap_remove + (find_peer_ctx->peer_hash, &peer_count->peer_id.hashPubKey, + peer_count)); test_find_peer->daemon = GNUNET_TESTING_daemon_get_by_id (pg, &peer_count->peer_id); GNUNET_assert (test_find_peer->daemon != NULL); @@ -2879,17 +2879,14 @@ setup_malicious_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) #if ONLY_TESTING /* Forward declaration */ -static void topology_callback (void *cls, - const struct GNUNET_PeerIdentity *first, - const struct GNUNET_PeerIdentity *second, - uint32_t distance, - const struct GNUNET_CONFIGURATION_Handle - *first_cfg, - const struct GNUNET_CONFIGURATION_Handle - *second_cfg, - struct GNUNET_TESTING_Daemon *first_daemon, - struct GNUNET_TESTING_Daemon *second_daemon, - const char *emsg); +static void +topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, + const struct GNUNET_PeerIdentity *second, uint32_t distance, + const struct GNUNET_CONFIGURATION_Handle *first_cfg, + const struct GNUNET_CONFIGURATION_Handle *second_cfg, + struct GNUNET_TESTING_Daemon *first_daemon, + struct GNUNET_TESTING_Daemon *second_daemon, + const char *emsg); /** * Retry connecting two specific peers until they connect, @@ -2993,12 +2990,12 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, /* Get duration in seconds */ duration = GNUNET_TIME_absolute_get_difference (connect_last_time, - GNUNET_TIME_absolute_get ()). - rel_value / 1000; + GNUNET_TIME_absolute_get + ()).rel_value / 1000; total_duration = GNUNET_TIME_absolute_get_difference (connect_start_time, - GNUNET_TIME_absolute_get ()). - rel_value / 1000; + GNUNET_TIME_absolute_get + ()).rel_value / 1000; failed_conns_per_sec_recent = (double) new_failed_connections / (double) duration; @@ -3086,8 +3083,8 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, total_duration = GNUNET_TIME_absolute_get_difference (connect_start_time, - GNUNET_TIME_absolute_get ()). - rel_value / 1000; + GNUNET_TIME_absolute_get + ()).rel_value / 1000; failed_conns_per_sec_total = (long double) failed_connections / total_duration; conns_per_sec_total = (long double) total_connections / total_duration; @@ -3299,14 +3296,16 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, GNUNET_CONFIGURATION_have_value (config, "TESTING", "HOSTKEYSFILE")) { GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION", - GNUNET_TIME_absolute_get_duration (hostkey_start_time). - rel_value / (double) num_peers, "ms/hostkey", revision_str); + GNUNET_TIME_absolute_get_duration + (hostkey_start_time).rel_value / (double) num_peers, + "ms/hostkey", revision_str); } else { GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION_REAL", - GNUNET_TIME_absolute_get_duration (hostkey_start_time). - rel_value / (double) num_peers, "ms/hostkey", revision_str); + GNUNET_TIME_absolute_get_duration + (hostkey_start_time).rel_value / (double) num_peers, + "ms/hostkey", revision_str); } } diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 1721e73af..43a6c9bea 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c @@ -934,11 +934,13 @@ static struct GNUNET_BLOCK_Context *block_context; /** * Forward declaration. */ -static size_t send_generic_reply (void *cls, size_t size, void *buf); +static size_t +send_generic_reply (void *cls, size_t size, void *buf); /** Declare here so retry_core_send is aware of it */ -static size_t core_transmit_notify (void *cls, size_t size, void *buf); +static size_t +core_transmit_notify (void *cls, size_t size, void *buf); /** * Convert unique ID to hash code. @@ -1160,7 +1162,8 @@ forward_result_message (const struct GNUNET_MessageHeader *msg, result_message->hop_count = htonl (msg_ctx->hop_count + 1); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, - result_message->bloomfilter, + result_message-> + bloomfilter, DHT_BLOOM_SIZE)); result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id); memcpy (&result_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); @@ -1474,9 +1477,9 @@ find_peer_by_id (const struct GNUNET_PeerIdentity *peer) } /* Forward declaration */ -static void update_core_preference (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +update_core_preference (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Function called with statistics about the given peer. * @@ -1776,7 +1779,8 @@ forward_message (const struct GNUNET_MessageHeader *msg, struct PeerInfo *peer, if (msg_ctx->bloom != NULL) GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, - route_message->bloomfilter, + route_message-> + bloomfilter, DHT_BLOOM_SIZE)); memcpy (&route_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); memcpy (&route_message[1], msg, ntohs (msg->size)); @@ -1885,8 +1889,8 @@ process_pending_messages (struct ClientList *client) client->transmit_handle = GNUNET_SERVER_notify_transmit_ready (client->client_handle, - ntohs (client->pending_head->msg-> - size), + ntohs (client->pending_head-> + msg->size), GNUNET_TIME_UNIT_FOREVER_REL, &send_generic_reply, client); } @@ -2457,8 +2461,9 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, * @param msg the message to be routed * @param msg_ctx the context containing all pertinent information about the message */ -static void route_message (const struct GNUNET_MessageHeader *msg, - struct DHT_MessageContext *msg_ctx); +static void +route_message (const struct GNUNET_MessageHeader *msg, + struct DHT_MessageContext *msg_ctx); /** @@ -2815,8 +2820,8 @@ handle_dht_find_peer (const struct GNUNET_MessageHeader *find_msg, * @param cls closure (a struct RepublishContext) * @param tc runtime context for this task */ -static void republish_content (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +republish_content (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Server handler for initiating local dht put requests @@ -3509,10 +3514,10 @@ select_peer (const GNUNET_HashCode * target, break; /* overflow case */ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Choose %d matching bits (%d bits match me) (%.2f percent) converge ret %llu\n", - GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]-> - id.hashPubKey, target), - GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]-> - id.hashPubKey, + GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id. + hashPubKey, target), + GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id. + hashPubKey, &my_identity.hashPubKey), (temp_converge_distance / (double) total_distance) * 100, temp_converge_distance); @@ -4473,7 +4478,8 @@ send_find_peer_message (void *cls, temp_bloom); GNUNET_assert (GNUNET_OK == GNUNET_CONTAINER_bloomfilter_get_raw_data (temp_bloom, - find_peer_msg->bloomfilter, + find_peer_msg-> + bloomfilter, DHT_BLOOM_SIZE)); GNUNET_CONTAINER_bloomfilter_free (temp_bloom); memset (&msg_ctx, 0, sizeof (struct DHT_MessageContext)); diff --git a/src/dht/plugin_dhtlog_dummy.c b/src/dht/plugin_dhtlog_dummy.c index a411c5934..563d97e46 100644 --- a/src/dht/plugin_dhtlog_dummy.c +++ b/src/dht/plugin_dhtlog_dummy.c @@ -281,18 +281,18 @@ set_malicious (struct GNUNET_PeerIdentity *peer) * * @return GNUNET_OK on success, GNUNET_SYSERR on failure */ -int insert_stat (const struct GNUNET_PeerIdentity *peer, - unsigned int route_requests, unsigned int route_forwards, - unsigned int result_requests, unsigned int client_requests, - unsigned int result_forwards, unsigned int gets, - unsigned int puts, unsigned int data_inserts, - unsigned int find_peer_requests, - unsigned int find_peers_started, unsigned int gets_started, - unsigned int puts_started, - unsigned int find_peer_responses_received, - unsigned int get_responses_received, - unsigned int find_peer_responses_sent, - unsigned int get_responses_sent) +int +insert_stat (const struct GNUNET_PeerIdentity *peer, + unsigned int route_requests, unsigned int route_forwards, + unsigned int result_requests, unsigned int client_requests, + unsigned int result_forwards, unsigned int gets, unsigned int puts, + unsigned int data_inserts, unsigned int find_peer_requests, + unsigned int find_peers_started, unsigned int gets_started, + unsigned int puts_started, + unsigned int find_peer_responses_received, + unsigned int get_responses_received, + unsigned int find_peer_responses_sent, + unsigned int get_responses_sent) { return GNUNET_OK; } diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 9fc5c2d7a..f5bb05d8b 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c @@ -237,8 +237,8 @@ test_find_peer_processor (void *cls, const struct GNUNET_HELLO_Message *hello) * @param cls closure * @param tc context information (why was this task triggered now?) */ -void retry_find_peer_stop (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +void +retry_find_peer_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Retry the find_peer task on timeout. diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index 50a27a093..63f200e7d 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c @@ -141,7 +141,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } /* Forward declaration */ -static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Iterator called on each result obtained for a DHT @@ -199,8 +200,8 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, } -static void stop_retry_get (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +stop_retry_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); static void get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) diff --git a/src/dv/dv.h b/src/dv/dv.h index 3c62a22bc..1d4912f84 100644 --- a/src/dv/dv.h +++ b/src/dv/dv.h @@ -257,17 +257,17 @@ typedef struct } p2p_dv_MESSAGE_Disconnect; -struct GNUNET_DV_Handle *GNUNET_DV_connect (const struct - GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_DV_MessageReceivedHandler - receive_handler, - void *receive_handler_cls); +struct GNUNET_DV_Handle * +GNUNET_DV_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_DV_MessageReceivedHandler receive_handler, + void *receive_handler_cls); /** * Disconnect from the DV service * * @param handle the current handle to the service to disconnect */ -void GNUNET_DV_disconnect (struct GNUNET_DV_Handle *handle); +void +GNUNET_DV_disconnect (struct GNUNET_DV_Handle *handle); #endif diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c index 3450e5844..d4c07ecdc 100644 --- a/src/dv/dv_api.c +++ b/src/dv/dv_api.c @@ -180,7 +180,8 @@ try_connect (struct GNUNET_DV_Handle *ret) return GNUNET_NO; } -static void process_pending_message (struct GNUNET_DV_Handle *handle); +static void +process_pending_message (struct GNUNET_DV_Handle *handle); /** * Send complete, schedule next @@ -284,8 +285,8 @@ process_pending_message (struct GNUNET_DV_Handle *handle) if (NULL == (handle->th = GNUNET_CLIENT_notify_transmit_ready (handle->client, - ntohs (handle->current->msg->header. - size), + ntohs (handle->current->msg-> + header.size), handle->current->msg->timeout, GNUNET_YES, &transmit_pending, handle))) diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 876d056ac..6699fef11 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c @@ -761,8 +761,8 @@ transmit_to_plugin (void *cls, size_t size, void *buf) if (plugin_pending_head != NULL) plugin_transmit_handle = GNUNET_SERVER_notify_transmit_ready (client_handle, - ntohs (plugin_pending_head-> - msg->size), + ntohs (plugin_pending_head->msg-> + size), GNUNET_TIME_UNIT_FOREVER_REL, &transmit_to_plugin, NULL); @@ -858,7 +858,8 @@ send_to_plugin (const struct GNUNET_PeerIdentity *sender, } /* Declare here so retry_core_send is aware of it */ -size_t core_transmit_notify (void *cls, size_t size, void *buf); +size_t +core_transmit_notify (void *cls, size_t size, void *buf); /** * Try to send another message from our core sending list @@ -999,9 +1000,9 @@ send_message_via (const struct GNUNET_PeerIdentity *sender, find_context.via = recipient; find_context.tid = 0; GNUNET_CONTAINER_multihashmap_get_multiple (extended_neighbors, - &send_context->distant_peer-> - hashPubKey, &find_specific_id, - &find_context); + &send_context-> + distant_peer->hashPubKey, + &find_specific_id, &find_context); if (find_context.tid == 0) { @@ -2071,19 +2072,16 @@ handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client, } /** Forward declarations **/ -static int handle_dv_gossip_message (void *cls, - const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_MessageHeader *message, - const struct - GNUNET_TRANSPORT_ATS_Information *atsi); - -static int handle_dv_disconnect_message (void *cls, - const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_MessageHeader - *message, - const struct - GNUNET_TRANSPORT_ATS_Information - *atsi); +static int +handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer, + const struct GNUNET_MessageHeader *message, + const struct GNUNET_TRANSPORT_ATS_Information *atsi); + +static int +handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer, + const struct GNUNET_MessageHeader *message, + const struct GNUNET_TRANSPORT_ATS_Information + *atsi); /** End forward declarations **/ @@ -2658,8 +2656,8 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity *peer, atsi[0].value = htonl (referrer->pending_messages[i].distance); atsi[1].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); atsi[1].value = - htonl ((uint32_t) referrer->pending_messages[i].latency. - rel_value); + htonl ((uint32_t) referrer->pending_messages[i]. + latency.rel_value); atsi[2].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); atsi[2].value = htonl (0); handle_dv_data_message (NULL, &referrer->pending_messages[i].sender, diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index fee8eea81..e66caa4f6 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c @@ -382,8 +382,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } } -static void send_other_messages (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Get distance information from 'atsi'. diff --git a/src/fs/fs.c b/src/fs/fs.c index e26a01996..fc1388a04 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c @@ -72,8 +72,8 @@ stop_job (struct GNUNET_FS_QueueEntry *qe) qe->h->active_blocks -= qe->blocks; qe->run_time = GNUNET_TIME_relative_add (qe->run_time, - GNUNET_TIME_absolute_get_duration (qe-> - start_time)); + GNUNET_TIME_absolute_get_duration + (qe->start_time)); GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, qe->h->pending_tail, qe); @@ -638,12 +638,8 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, * the infromation * @return NULL on error */ -static struct GNUNET_FS_FileInformation *deserialize_file_information (struct - GNUNET_FS_Handle - *h, - const - char - *filename); +static struct GNUNET_FS_FileInformation * +deserialize_file_information (struct GNUNET_FS_Handle *h, const char *filename); /** @@ -1152,8 +1148,8 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi) (GNUNET_OK != GNUNET_BIO_write_string (wh, (fi->data.dir.entries == - NULL) ? NULL : fi->data.dir.entries-> - serialization))) + NULL) ? NULL : fi->data.dir. + entries->serialization))) { GNUNET_break (0); goto cleanup; @@ -1566,9 +1562,9 @@ read_download_request (struct GNUNET_BIO_ReadHandle *rh) (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || (dr->num_children > CHK_PER_INODE) || (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->depth)) || ((dr->depth == 0) - && (dr-> - num_children - > 0)) || + && + (dr->num_children + > 0)) || ((dr->depth > 0) && (dr->num_children == 0))) { GNUNET_break (0); @@ -2017,11 +2013,12 @@ cleanup: * @param search associated search * @param serialization name under which the search was serialized */ -static void deserialize_download (struct GNUNET_FS_Handle *h, - struct GNUNET_BIO_ReadHandle *rh, - struct GNUNET_FS_DownloadContext *parent, - struct GNUNET_FS_SearchResult *search, - const char *serialization); +static void +deserialize_download (struct GNUNET_FS_Handle *h, + struct GNUNET_BIO_ReadHandle *rh, + struct GNUNET_FS_DownloadContext *parent, + struct GNUNET_FS_SearchResult *search, + const char *serialization); /** @@ -2032,16 +2029,11 @@ static void deserialize_download (struct GNUNET_FS_Handle *h, * @param psearch_result parent search result * @param serialization name under which the search was serialized */ -static struct GNUNET_FS_SearchContext *deserialize_search (struct - GNUNET_FS_Handle *h, - struct - GNUNET_BIO_ReadHandle - *rh, - struct - GNUNET_FS_SearchResult - *psearch_result, - const char - *serialization); +static struct GNUNET_FS_SearchContext * +deserialize_search (struct GNUNET_FS_Handle *h, + struct GNUNET_BIO_ReadHandle *rh, + struct GNUNET_FS_SearchResult *psearch_result, + const char *serialization); /** @@ -2203,7 +2195,8 @@ signal_download_resume (struct GNUNET_FS_DownloadContext *dc) * * @param sc search being resumed */ -static void signal_search_resume (struct GNUNET_FS_SearchContext *sc); +static void +signal_search_resume (struct GNUNET_FS_SearchContext *sc); /** @@ -2255,7 +2248,8 @@ signal_result_resume (void *cls, const GNUNET_HashCode * key, void *value) * * @param sc search context to free */ -static void free_search_context (struct GNUNET_FS_SearchContext *sc); +static void +free_search_context (struct GNUNET_FS_SearchContext *sc); /** diff --git a/src/fs/fs.h b/src/fs/fs.h index 68bab5916..11cfc755e 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h @@ -759,17 +759,17 @@ struct GNUNET_FS_SearchResult * @param blocks number of blocks this download has * @return queue handle */ -struct GNUNET_FS_QueueEntry *GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, - GNUNET_FS_QueueStart start, - GNUNET_FS_QueueStop stop, - void *cls, unsigned int blocks); +struct GNUNET_FS_QueueEntry * +GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, + GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks); /** * Dequeue a job from the queue. * @param qh handle for the job */ -void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); +void +GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); /** @@ -788,9 +788,9 @@ void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); * @param emsg location for the reader to store an error message * @return number of bytes written, usually "max", 0 on error */ -size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, - size_t max, void *buf, - char **emsg); +size_t +GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf, + char **emsg); /** @@ -799,7 +799,8 @@ size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, * @param filename file to read * @return closure to use */ -void *GNUNET_FS_make_file_reader_context_ (const char *filename); +void * +GNUNET_FS_make_file_reader_context_ (const char *filename); @@ -819,8 +820,9 @@ void *GNUNET_FS_make_file_reader_context_ (const char *filename); * @param emsg location for the reader to store an error message * @return number of bytes written, usually "max", 0 on error */ -size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, - void *buf, char **emsg); +size_t +GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, void *buf, + char **emsg); /** * Notification of FS that a search probe has made progress. @@ -837,9 +839,9 @@ size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, * will be passed to future callbacks in the respective * field in the GNUNET_FS_ProgressInfo struct. */ -void *GNUNET_FS_search_probe_progress_ (void *cls, - const struct GNUNET_FS_ProgressInfo - *info); +void * +GNUNET_FS_search_probe_progress_ (void *cls, + const struct GNUNET_FS_ProgressInfo *info); /** @@ -848,8 +850,9 @@ void *GNUNET_FS_search_probe_progress_ (void *cls, * @param cls "struct GNUNET_FS_PublishContext" identifies the upload * @param tc task context */ -void GNUNET_FS_publish_main_ (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +void +GNUNET_FS_publish_main_ (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -859,8 +862,8 @@ void GNUNET_FS_publish_main_ (void *cls, * @param cls closure, unindex context * @param file_id computed hash, NULL on error */ -void GNUNET_FS_unindex_process_hash_ (void *cls, - const GNUNET_HashCode * file_id); +void +GNUNET_FS_unindex_process_hash_ (void *cls, const GNUNET_HashCode * file_id); /** @@ -873,10 +876,11 @@ void GNUNET_FS_unindex_process_hash_ (void *cls, * @param offset where in the file are we so far * @return value returned from callback */ -void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, - struct GNUNET_FS_PublishContext *sc, - const struct GNUNET_FS_FileInformation *p, - uint64_t offset); +void * +GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, + struct GNUNET_FS_PublishContext *sc, + const struct GNUNET_FS_FileInformation *p, + uint64_t offset); /** @@ -886,8 +890,9 @@ void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, * @param pi structure to fill in * @param dc overall download context */ -void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, - struct GNUNET_FS_DownloadContext *dc); +void +GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, + struct GNUNET_FS_DownloadContext *dc); /** @@ -897,9 +902,9 @@ void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, * @param cls the 'struct GNUNET_FS_DownloadContext' * @param tc scheduler context */ -void GNUNET_FS_download_start_task_ (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +void +GNUNET_FS_download_start_task_ (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); @@ -911,9 +916,10 @@ void GNUNET_FS_download_start_task_ (void *cls, * @param uc overall unindex context * @param offset where we are in the file (for progress) */ -void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, - struct GNUNET_FS_UnindexContext *uc, - uint64_t offset); +void +GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, + struct GNUNET_FS_UnindexContext *uc, + uint64_t offset); /** * Fill in all of the generic fields for a search event and @@ -923,8 +929,9 @@ void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, * @param sc overall search context * @return value returned by the callback */ -void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, - struct GNUNET_FS_SearchContext *sc); +void * +GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, + struct GNUNET_FS_SearchContext *sc); /** @@ -932,7 +939,8 @@ void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, * * @param uc context for the unindex operation. */ -void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); +void +GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); /** * Build the request and actually initiate the search using the @@ -941,15 +949,16 @@ void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); * @param sc search context * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); +int +GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); /** * Start the downloading process (by entering the queue). * * @param dc our download context */ -void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext - *dc); +void +GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc); /** @@ -957,7 +966,8 @@ void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext * * @param sr the search result */ -void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); +void +GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); /** * Remove serialization/deserialization file from disk. @@ -966,8 +976,9 @@ void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); * @param ext component of the path * @param ent entity identifier */ -void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, - const char *ent); +void +GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, + const char *ent); /** @@ -977,8 +988,9 @@ void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, * @param ext component of the path * @param uni unique name of parent */ -void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, - const char *uni); +void +GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, + const char *uni); /** @@ -989,7 +1001,8 @@ void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, * * @param fi the struct to sync */ -void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); +void +GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); /** * Synchronize this publishing struct with its mirror @@ -999,7 +1012,8 @@ void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); * * @param pc the struct to sync */ -void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); +void +GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); /** * Synchronize this unindex struct with its mirror @@ -1009,7 +1023,8 @@ void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); * * @param uc the struct to sync */ -void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); +void +GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); /** * Synchronize this search struct with its mirror @@ -1019,7 +1034,8 @@ void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); * * @param sc the struct to sync */ -void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); +void +GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); /** * Synchronize this search result with its mirror @@ -1029,7 +1045,8 @@ void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); * * @param sr the struct to sync */ -void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); +void +GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); /** * Synchronize this download struct with its mirror @@ -1039,7 +1056,8 @@ void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); * * @param dc the struct to sync */ -void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); +void +GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); /** * Create SUSPEND event for the given publish operation @@ -1047,7 +1065,8 @@ void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); * * @param cls the 'struct GNUNET_FS_PublishContext' to signal for */ -void GNUNET_FS_publish_signal_suspend_ (void *cls); +void +GNUNET_FS_publish_signal_suspend_ (void *cls); /** * Create SUSPEND event for the given search operation @@ -1055,7 +1074,8 @@ void GNUNET_FS_publish_signal_suspend_ (void *cls); * * @param cls the 'struct GNUNET_FS_SearchContext' to signal for */ -void GNUNET_FS_search_signal_suspend_ (void *cls); +void +GNUNET_FS_search_signal_suspend_ (void *cls); /** * Create SUSPEND event for the given download operation @@ -1063,7 +1083,8 @@ void GNUNET_FS_search_signal_suspend_ (void *cls); * * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for */ -void GNUNET_FS_download_signal_suspend_ (void *cls); +void +GNUNET_FS_download_signal_suspend_ (void *cls); /** * Create SUSPEND event for the given unindex operation @@ -1071,7 +1092,8 @@ void GNUNET_FS_download_signal_suspend_ (void *cls); * * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for */ -void GNUNET_FS_unindex_signal_suspend_ (void *cls); +void +GNUNET_FS_unindex_signal_suspend_ (void *cls); /** * Function signature of the functions that can be called @@ -1118,9 +1140,9 @@ struct TopLevelActivity * @param ssf_cls closure for ssf * @return fresh top-level activity handle */ -struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, - SuspendSignalFunction ssf, - void *ssf_cls); +struct TopLevelActivity * +GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, + void *ssf_cls); /** @@ -1129,8 +1151,8 @@ struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, * @param h global fs handle * @param top top level activity entry */ -void GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, - struct TopLevelActivity *top); +void +GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, struct TopLevelActivity *top); @@ -1736,7 +1758,8 @@ struct DownloadRequest * * @param dr request to free */ -void GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); +void +GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); /** diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index a3c5b9b62..89de277da 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -143,7 +143,8 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, * @param buf where the callee should write the message * @return number of bytes written to buf */ -static size_t transmit_download_request (void *cls, size_t size, void *buf); +static size_t +transmit_download_request (void *cls, size_t size, void *buf); /** @@ -194,8 +195,9 @@ struct ProcessResultClosure * @param value value in the hash map (a 'struct DownloadRequest') * @return GNUNET_YES (we should continue to iterate); unless serious error */ -static int process_result_with_request (void *cls, const GNUNET_HashCode * key, - void *value); +static int +process_result_with_request (void *cls, const GNUNET_HashCode * key, + void *value); /** @@ -261,7 +263,8 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc, * * @param dc download context that is having trouble */ -static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); +static void +try_reconnect (struct GNUNET_FS_DownloadContext *dc); /** @@ -275,10 +278,11 @@ static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); * @param length number of bytes in data * @param data contents of the file (or NULL if they were not inlined) */ -static void trigger_recursive_download (void *cls, const char *filename, - const struct GNUNET_FS_Uri *uri, - const struct GNUNET_CONTAINER_MetaData - *meta, size_t length, const void *data); +static void +trigger_recursive_download (void *cls, const char *filename, + const struct GNUNET_FS_Uri *uri, + const struct GNUNET_CONTAINER_MetaData *meta, + size_t length, const void *data); /** @@ -940,8 +944,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, - (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. - file_length)); + (unsigned long long) GNUNET_ntohll (dc->uri->data. + chk.file_length)); #endif bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll @@ -953,8 +957,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, _ ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), bs, dr->depth, (unsigned long long) dr->offset, - (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. - file_length), + (unsigned long long) GNUNET_ntohll (dc->uri->data. + chk.file_length), prc->size); GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); while (dr->parent != NULL) @@ -1077,8 +1081,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, #if DEBUG_DOWNLOAD GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Download completed, truncating file to desired length %llu\n", - (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. - file_length)); + (unsigned long long) GNUNET_ntohll (dc->uri->data. + chk.file_length)); #endif /* truncate file to size (since we store IBlocks at the end) */ if (dc->filename != NULL) @@ -1757,8 +1761,7 @@ GNUNET_FS_download_start_task_ (void *cls, GNUNET_DISK_OPEN_READWRITE | GNUNET_DISK_OPEN_CREATE | ((0 == - GNUNET_FS_uri_chk_get_file_size (dc-> - uri)) ? + GNUNET_FS_uri_chk_get_file_size (dc->uri)) ? GNUNET_DISK_OPEN_TRUNCATE : 0), GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE | diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 6809e3055..a67b22036 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -638,8 +638,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, no = GNUNET_NO; if (GNUNET_OK != proc (proc_cls, dir, - (dir->is_directory) ? dir->data.dir.dir_size : dir->data.file. - file_size, dir->meta, &dir->keywords, &dir->bo, + (dir->is_directory) ? dir->data.dir.dir_size : dir->data. + file.file_size, dir->meta, &dir->keywords, &dir->bo, (dir->is_directory) ? &no : &dir->data.file.do_index, &dir->client_info)) return; @@ -651,8 +651,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, no = GNUNET_NO; if (GNUNET_OK != proc (proc_cls, pos, - (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file. - file_size, pos->meta, &pos->keywords, &pos->bo, + (pos->is_directory) ? pos->data.dir.dir_size : pos->data. + file.file_size, pos->meta, &pos->keywords, &pos->bo, (dir->is_directory) ? &no : &dir->data.file.do_index, &pos->client_info)) break; diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 746f4f099..94641e934 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -179,8 +179,8 @@ signal_publish_completion (struct GNUNET_FS_FileInformation *p, pi.value.publish.specifics.completed.chk_uri = p->chk_uri; p->client_info = GNUNET_FS_publish_make_status_ (&pi, pc, p, - GNUNET_ntohll (p->chk_uri->data.chk. - file_length)); + GNUNET_ntohll (p->chk_uri->data. + chk.file_length)); } @@ -1333,8 +1333,8 @@ struct PublishKskContext * @param cls closure of type "struct PublishKskContext*" * @param tc unused */ -static void publish_ksk_cont (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 89a8c5582..0c47eb173 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c @@ -440,15 +440,10 @@ process_ksk_result (struct GNUNET_FS_SearchContext *sc, * @param psearch parent search result (for namespace update searches) * @return context that can be used to control the search */ -static struct GNUNET_FS_SearchContext *search_start (struct GNUNET_FS_Handle *h, - const struct GNUNET_FS_Uri - *uri, uint32_t anonymity, - enum - GNUNET_FS_SearchOptions - options, void *cctx, - struct - GNUNET_FS_SearchResult - *psearch); +static struct GNUNET_FS_SearchContext * +search_start (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, + uint32_t anonymity, enum GNUNET_FS_SearchOptions options, + void *cctx, struct GNUNET_FS_SearchResult *psearch); /** @@ -813,7 +808,8 @@ process_result (struct GNUNET_FS_SearchContext *sc, enum GNUNET_BLOCK_Type type, * * @param sc the search to reconnec */ -static void try_reconnect (struct GNUNET_FS_SearchContext *sc); +static void +try_reconnect (struct GNUNET_FS_SearchContext *sc); /** @@ -855,8 +851,8 @@ receive_results (void *cls, const struct GNUNET_MessageHeader *msg) * * @param sc context for the search */ -static void schedule_transmit_search_request (struct GNUNET_FS_SearchContext - *sc); +static void +schedule_transmit_search_request (struct GNUNET_FS_SearchContext *sc); /** diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h index fa822e265..ad1d96bf0 100644 --- a/src/fs/fs_test_lib.h +++ b/src/fs/fs_test_lib.h @@ -53,11 +53,12 @@ struct GNUNET_FS_TestDaemon; * 'GNUNET_FS_TEST_daemons_stop'! * @param cont_cls closure for cont */ -void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, - struct GNUNET_TIME_Relative timeout, - unsigned int total, - struct GNUNET_FS_TestDaemon **daemons, - GNUNET_SCHEDULER_Task cont, void *cont_cls); +void +GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, + struct GNUNET_TIME_Relative timeout, + unsigned int total, + struct GNUNET_FS_TestDaemon **daemons, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -70,11 +71,11 @@ void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, * @param cont function to call when done * @param cont_cls closure for cont */ -void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, - struct GNUNET_FS_TestDaemon *daemon2, - struct GNUNET_TIME_Relative timeout, - GNUNET_SCHEDULER_Task cont, - void *cont_cls); +void +GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, + struct GNUNET_FS_TestDaemon *daemon2, + struct GNUNET_TIME_Relative timeout, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -83,9 +84,8 @@ void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, * @param daemons array with the daemons (must contain at least one) * @return peer group */ -struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct - GNUNET_FS_TestDaemon - **daemons); +struct GNUNET_TESTING_PeerGroup * +GNUNET_FS_TEST_get_group (struct GNUNET_FS_TestDaemon **daemons); @@ -96,9 +96,9 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct * @param off which configuration to get * @return peer configuration */ -const struct GNUNET_CONFIGURATION_Handle - *GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, - unsigned int off); +const struct GNUNET_CONFIGURATION_Handle * +GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, + unsigned int off); /** * Stop daemons used for testing. @@ -106,8 +106,9 @@ const struct GNUNET_CONFIGURATION_Handle * @param total number of daemons to stop * @param daemons array with the daemons (values will be clobbered) */ -void GNUNET_FS_TEST_daemons_stop (unsigned int total, - struct GNUNET_FS_TestDaemon **daemons); +void +GNUNET_FS_TEST_daemons_stop (unsigned int total, + struct GNUNET_FS_TestDaemon **daemons); /** @@ -136,12 +137,12 @@ typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, * @param cont function to call when done * @param cont_cls closure for cont */ -void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, - struct GNUNET_TIME_Relative timeout, - uint32_t anonymity, int do_index, uint64_t size, - uint32_t seed, unsigned int verbose, - GNUNET_FS_TEST_UriContinuation cont, - void *cont_cls); +void +GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, + struct GNUNET_TIME_Relative timeout, uint32_t anonymity, + int do_index, uint64_t size, uint32_t seed, + unsigned int verbose, + GNUNET_FS_TEST_UriContinuation cont, void *cont_cls); /** @@ -157,12 +158,12 @@ void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, * @param cont function to call when done * @param cont_cls closure for cont */ -void GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, - struct GNUNET_TIME_Relative timeout, - uint32_t anonymity, uint32_t seed, - const struct GNUNET_FS_Uri *uri, - unsigned int verbose, GNUNET_SCHEDULER_Task cont, - void *cont_cls); +void +GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, + struct GNUNET_TIME_Relative timeout, + uint32_t anonymity, uint32_t seed, + const struct GNUNET_FS_Uri *uri, unsigned int verbose, + GNUNET_SCHEDULER_Task cont, void *cont_cls); diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 0a0db7a10..58d0f0127 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c @@ -395,8 +395,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te) if (NULL != te->proc) te->proc (te->cls, mychk, te->publish_offset, te->current_depth, (0 == - te-> - current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK : + te->current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK : GNUNET_BLOCK_TYPE_FS_IBLOCK, enc, pt_size); if (NULL != te->progress) te->progress (te->cls, te->publish_offset, pt_block, pt_size, diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h index 532c9e9aa..b39a47cd3 100644 --- a/src/fs/fs_tree.h +++ b/src/fs/fs_tree.h @@ -40,7 +40,8 @@ * @param flen file length for which to compute the depth * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. */ -unsigned int GNUNET_FS_compute_depth (uint64_t flen); +unsigned int +GNUNET_FS_compute_depth (uint64_t flen); /** @@ -52,7 +53,8 @@ unsigned int GNUNET_FS_compute_depth (uint64_t flen); * @param depth depth of the block. depth==0 is a DBLOCK. * @return number of bytes of payload a subtree of this depth may correspond to */ -uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); +uint64_t +GNUNET_FS_tree_compute_tree_size (unsigned int depth); /** @@ -66,8 +68,9 @@ uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); * @param depth depth of the node in the tree, 0 for DBLOCK * @return number of bytes stored in this node */ -size_t GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, - unsigned int depth); +size_t +GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, + unsigned int depth); /** @@ -134,18 +137,12 @@ typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, uint64_t offset, * @param cont function to call when done * @return tree encoder context */ -struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct - GNUNET_FS_Handle - *h, uint64_t size, - void *cls, - GNUNET_FS_DataReader - reader, - GNUNET_FS_TreeBlockProcessor - proc, - GNUNET_FS_TreeProgressCallback - progress, - GNUNET_SCHEDULER_Task - cont); +struct GNUNET_FS_TreeEncoder * +GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size, + void *cls, GNUNET_FS_DataReader reader, + GNUNET_FS_TreeBlockProcessor proc, + GNUNET_FS_TreeProgressCallback progress, + GNUNET_SCHEDULER_Task cont); /** @@ -156,7 +153,8 @@ struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct * * @param te tree encoder to use */ -void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); +void +GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); /** @@ -170,8 +168,9 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); * prior to completion and prior to an internal error, * both "*uri" and "*emsg" will be set to NULL). */ -void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, - struct GNUNET_FS_Uri **uri, char **emsg); +void +GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, + struct GNUNET_FS_Uri **uri, char **emsg); #if 0 @@ -185,8 +184,9 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, * @param data set to the resume data * @param size set to the size of the resume data */ -void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder - *te, void **data, size_t * size); +void +GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te, + void **data, size_t * size); /** @@ -197,8 +197,9 @@ void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder * @param data the resume data * @param size the size of the resume data */ -void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, - const void *data, size_t size); +void +GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, + const void *data, size_t size); #endif #endif diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 22dab4955..206a8adca 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c @@ -1834,8 +1834,8 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, (const char *) &queryhash, - (unsigned long long) GNUNET_ntohll (uri->data.loc.fi. - file_length), peerId, + (unsigned long long) GNUNET_ntohll (uri->data.loc. + fi.file_length), peerId, peerSig, (unsigned long long) uri->data.loc.expirationTime.abs_value); GNUNET_free (peerSig); diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 9f18cb99c..748a8f09c 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c @@ -106,8 +106,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000LL / - (info->value.download.duration. - rel_value + 1)); + (info->value.download. + duration.rel_value + 1)); fprintf (stdout, _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), info->value.download.filename, @@ -124,8 +124,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / - (info->value.download.duration. - rel_value + 1)); + (info->value.download. + duration.rel_value + 1)); fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), info->value.download.filename, s); GNUNET_free (s); diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index a67886f7d..7edad6979 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c @@ -133,8 +133,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) case GNUNET_FS_STATUS_PUBLISH_COMPLETED: fprintf (stdout, _("Publishing `%s' done.\n"), info->value.publish.filename); - s = GNUNET_FS_uri_to_string (info->value.publish.specifics.completed. - chk_uri); + s = GNUNET_FS_uri_to_string (info->value.publish.specifics. + completed.chk_uri); fprintf (stdout, _("URI is `%s'.\n"), s); GNUNET_free (s); if (info->value.publish.pctx == NULL) diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index c82a0794c..eb5345833 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c @@ -150,8 +150,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri); printf ("#%u:\n", cnt++); filename = - GNUNET_CONTAINER_meta_data_get_by_type (info->value.search.specifics. - result.meta, + GNUNET_CONTAINER_meta_data_get_by_type (info->value.search. + specifics.result.meta, EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); if (filename != NULL) { @@ -162,8 +162,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) else printf ("gnunet-download %s\n", uri); if (verbose) - GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics.result. - meta, &item_printer, NULL); + GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics. + result.meta, &item_printer, NULL); printf ("\n"); fflush (stdout); GNUNET_free_non_null (filename); diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index 56604185f..bee814318 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h @@ -167,7 +167,8 @@ extern int GSF_enable_randomized_delays; * GNUNET_NO to process normally (load normal) * GNUNET_SYSERR to process for free (load low) */ -int GSF_test_get_load_too_high_ (uint32_t priority); +int +GSF_test_get_load_too_high_ (uint32_t priority); /** @@ -176,7 +177,8 @@ int GSF_test_get_load_too_high_ (uint32_t priority); * * @param start time when the datastore request was issued */ -void GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start); +void +GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start); diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 1e93a475e..96d906c5b 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c @@ -383,7 +383,8 @@ GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp) * @param buf where to copy the message * @return number of bytes copied to buf */ -static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf); +static size_t +peer_transmit_ready_cb (void *cls, size_t size, void *buf); @@ -400,12 +401,11 @@ static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf); * long should the client wait until re-trying? * @param preference current traffic preference for the given peer */ -static void core_reserve_callback (void *cls, - const struct GNUNET_PeerIdentity *peer, - struct GNUNET_BANDWIDTH_Value32NBO - bandwidth_out, int32_t amount, - struct GNUNET_TIME_Relative res_delay, - uint64_t preference); +static void +core_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer, + struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, + int32_t amount, struct GNUNET_TIME_Relative res_delay, + uint64_t preference); /** @@ -491,9 +491,8 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf) GNUNET_assert (0 < cp->ppd.pending_replies--); } GNUNET_LOAD_update (cp->ppd.transmission_delay, - GNUNET_TIME_absolute_get_duration (pth-> - transmission_request_start_time). - rel_value); + GNUNET_TIME_absolute_get_duration + (pth->transmission_request_start_time).rel_value); ret = pth->gmc (pth->gmc_cls, size, buf); GNUNET_assert (NULL == pth->cth); for (pos = cp->pth_head; pos != NULL; pos = pos->next) @@ -1732,9 +1731,9 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, #if DEBUG_FS && 0 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Migration already blocked for another %llu ms\n", - (unsigned long long) GNUNET_TIME_absolute_get_remaining (cp-> - last_migration_block). - rel_value); + (unsigned long long) + GNUNET_TIME_absolute_get_remaining + (cp->last_migration_block).rel_value); #endif return; /* already blocked */ } diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h index 84165d8b7..3f25363f1 100644 --- a/src/fs/gnunet-service-fs_cp.h +++ b/src/fs/gnunet-service-fs_cp.h @@ -170,11 +170,9 @@ struct GSF_PeerTransmitHandle; * @param atsi performance data for the connection * @return handle to connected peer entry */ -struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct - GNUNET_PeerIdentity *peer, - const struct - GNUNET_TRANSPORT_ATS_Information - *atsi); +struct GSF_ConnectedPeer * +GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, + const struct GNUNET_TRANSPORT_ATS_Information *atsi); /** @@ -183,8 +181,8 @@ struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct * @param peer peer's identity * @return NULL if this peer is not currently connected */ -struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity - *peer); +struct GSF_ConnectedPeer * +GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); /** @@ -201,13 +199,10 @@ struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity * @param gmc_cls closure for gmc * @return handle to cancel request */ -struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, - int is_query, - uint32_t priority, - struct GNUNET_TIME_Relative - timeout, size_t size, - GSF_GetMessageCallback gmc, - void *gmc_cls); +struct GSF_PeerTransmitHandle * +GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, int is_query, + uint32_t priority, struct GNUNET_TIME_Relative timeout, + size_t size, GSF_GetMessageCallback gmc, void *gmc_cls); /** @@ -215,7 +210,8 @@ struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, * * @param pth request to cancel */ -void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); +void +GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); /** @@ -225,9 +221,10 @@ void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); * @param request_time time at which the original query was transmitted * @param request_priority priority of the original request */ -void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, - struct GNUNET_TIME_Absolute request_time, - uint32_t request_priority); +void +GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, + struct GNUNET_TIME_Absolute request_time, + uint32_t request_priority); /** @@ -237,9 +234,9 @@ void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, * @param cp responding peer (will be updated) * @param initiator_client local client on responsible for query */ -void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, - struct GSF_LocalClient - *initiator_client); +void +GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, + struct GSF_LocalClient *initiator_client); /** @@ -249,9 +246,10 @@ void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, * @param cp responding peer (will be updated) * @param initiator_peer other peer responsible for query */ -void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, - const struct GSF_ConnectedPeer - *initiator_peer); +void +GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, + const struct GSF_ConnectedPeer + *initiator_peer); /** @@ -265,13 +263,12 @@ void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, * unless we see some further activity from it * @param atsi status information */ -void GSF_peer_status_handler_ (void *cls, - const struct GNUNET_PeerIdentity *peer, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, - struct GNUNET_TIME_Absolute timeout, - const struct GNUNET_TRANSPORT_ATS_Information - *atsi); +void +GSF_peer_status_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer, + struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, + struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, + struct GNUNET_TIME_Absolute timeout, + const struct GNUNET_TRANSPORT_ATS_Information *atsi); /** @@ -285,11 +282,12 @@ void GSF_peer_status_handler_ (void *cls, * @return GNUNET_OK to keep the connection open, * GNUNET_SYSERR to close it (signal serious error) */ -int GSF_handle_p2p_migration_stop_ (void *cls, - const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct - GNUNET_TRANSPORT_ATS_Information *atsi); +int +GSF_handle_p2p_migration_stop_ (void *cls, + const struct GNUNET_PeerIdentity *other, + const struct GNUNET_MessageHeader *message, + const struct GNUNET_TRANSPORT_ATS_Information + *atsi); /** @@ -303,11 +301,9 @@ int GSF_handle_p2p_migration_stop_ (void *cls, * @param message the actual message * @return pending request handle, NULL on error */ -struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct - GNUNET_PeerIdentity *other, - const struct - GNUNET_MessageHeader - *message); +struct GSF_PendingRequest * +GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, + const struct GNUNET_MessageHeader *message); /** @@ -316,9 +312,8 @@ struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct * @param cp peer to query * @return performance data record for the peer */ -struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct - GSF_ConnectedPeer - *cp); +struct GSF_PeerPerformanceData * +GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); /** @@ -328,8 +323,9 @@ struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct * @param cp peer to ask * @param block_time until when to block */ -void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, - struct GNUNET_TIME_Relative block_time); +void +GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, + struct GNUNET_TIME_Relative block_time); /** @@ -339,8 +335,9 @@ void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, * @param cls unused * @param peer identity of peer that connected */ -void GSF_peer_disconnect_handler_ (void *cls, - const struct GNUNET_PeerIdentity *peer); +void +GSF_peer_disconnect_handler_ (void *cls, + const struct GNUNET_PeerIdentity *peer); /** @@ -349,7 +346,8 @@ void GSF_peer_disconnect_handler_ (void *cls, * * @param lc handle to the local client (henceforth invalid) */ -void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); +void +GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); /** @@ -361,8 +359,9 @@ void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); * @param cp peer to reserve bandwidth from * @param pref preference change */ -void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, - uint64_t pref); +void +GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, + uint64_t pref); /** @@ -371,8 +370,9 @@ void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, * @param cp peer to reserve bandwidth from * @param id identity to set (written to) */ -void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, - struct GNUNET_PeerIdentity *id); +void +GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, + struct GNUNET_PeerIdentity *id); /** @@ -381,19 +381,22 @@ void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, * @param it function to call for each peer * @param it_cls closure for it */ -void GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); +void +GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); /** * Initialize peer management subsystem. */ -void GSF_connected_peer_init_ (void); +void +GSF_connected_peer_init_ (void); /** * Shutdown peer management subsystem. */ -void GSF_connected_peer_done_ (void); +void +GSF_connected_peer_done_ (void); #endif diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index c7bff3a9d..ab3f77abe 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c @@ -228,8 +228,7 @@ signal_index_ok (struct IndexInfo *ii) ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), ii->filename, (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, - &ii-> - file_id)); + &ii->file_id)); GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); @@ -447,8 +446,8 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, prev->next = next; GNUNET_break (GNUNET_OK == GNUNET_CONTAINER_multihashmap_remove (ifm, &pos->file_id, - (void *) pos-> - filename)); + (void *) + pos->filename)); GNUNET_free (pos); found = GNUNET_YES; } diff --git a/src/fs/gnunet-service-fs_indexing.h b/src/fs/gnunet-service-fs_indexing.h index a5c8f6593..4295b2011 100644 --- a/src/fs/gnunet-service-fs_indexing.h +++ b/src/fs/gnunet-service-fs_indexing.h @@ -54,14 +54,14 @@ * @param cont_cls closure for cont * @return GNUNET_OK on success */ -int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, - uint32_t size, const void *data, - enum GNUNET_BLOCK_Type type, - uint32_t priority, uint32_t anonymity, - struct GNUNET_TIME_Absolute expiration, - uint64_t uid, - GNUNET_DATASTORE_DatumProcessor cont, - void *cont_cls); +int +GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size, + const void *data, enum GNUNET_BLOCK_Type type, + uint32_t priority, uint32_t anonymity, + struct GNUNET_TIME_Absolute expiration, + uint64_t uid, + GNUNET_DATASTORE_DatumProcessor cont, + void *cont_cls); /** * Handle INDEX_START-message. @@ -70,9 +70,9 @@ int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, * @param client identification of the client * @param message the actual message */ -void GNUNET_FS_handle_index_start (void *cls, - struct GNUNET_SERVER_Client *client, - const struct GNUNET_MessageHeader *message); +void +GNUNET_FS_handle_index_start (void *cls, struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader *message); /** @@ -82,10 +82,9 @@ void GNUNET_FS_handle_index_start (void *cls, * @param client identification of the client * @param message the actual message */ -void GNUNET_FS_handle_index_list_get (void *cls, - struct GNUNET_SERVER_Client *client, - const struct GNUNET_MessageHeader - *message); +void +GNUNET_FS_handle_index_list_get (void *cls, struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader *message); /** @@ -95,8 +94,9 @@ void GNUNET_FS_handle_index_list_get (void *cls, * @param client identification of the client * @param message the actual message */ -void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, - const struct GNUNET_MessageHeader *message); +void +GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader *message); /** @@ -106,14 +106,16 @@ void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, * @param d datastore to use * @return GNUNET_OK on success */ -int GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, - struct GNUNET_DATASTORE_Handle *d); +int +GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, + struct GNUNET_DATASTORE_Handle *d); /** * Shutdown the module. */ -void GNUNET_FS_indexing_done (void); +void +GNUNET_FS_indexing_done (void); #endif diff --git a/src/fs/gnunet-service-fs_lc.h b/src/fs/gnunet-service-fs_lc.h index 6b79690f1..c625edf0b 100644 --- a/src/fs/gnunet-service-fs_lc.h +++ b/src/fs/gnunet-service-fs_lc.h @@ -36,8 +36,8 @@ * @param client handle of the client * @return handle to local client entry */ -struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client - *client); +struct GSF_LocalClient * +GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client); /** @@ -50,12 +50,10 @@ struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client * @param message the actual message * @return pending request handle for the request, NULL on error */ -struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct - GNUNET_SERVER_Client - *client, - const struct - GNUNET_MessageHeader - *message); +struct GSF_PendingRequest * +GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader + *message); /** @@ -66,8 +64,9 @@ struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct * @param lc recipient * @param msg message to transmit to client */ -void GSF_local_client_transmit_ (struct GSF_LocalClient *lc, - const struct GNUNET_MessageHeader *msg); +void +GSF_local_client_transmit_ (struct GSF_LocalClient *lc, + const struct GNUNET_MessageHeader *msg); /** @@ -76,8 +75,8 @@ void GSF_local_client_transmit_ (struct GSF_LocalClient *lc, * @param cls unused * @param client handle of the client */ -void GSF_client_disconnect_handler_ (void *cls, - struct GNUNET_SERVER_Client *client); +void +GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client); #endif diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 58fb11cee..d1a8a1163 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c @@ -207,9 +207,9 @@ static unsigned long long plan_count; * @param cls the 'struct GSF_ConnectedPeer' for transmission * @param tc scheduler context */ -static void schedule_peer_transmission (void *cls, - const struct - GNUNET_SCHEDULER_TaskContext *tc); +static void +schedule_peer_transmission (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -243,8 +243,8 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) #endif GNUNET_assert (rp->hn == NULL); - if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission). - rel_value == 0) + if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value + == 0) rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); else rp->hn = @@ -359,8 +359,8 @@ schedule_peer_transmission (void *cls, } /* move ready requests to priority queue */ while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && - (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission). - rel_value == 0)) + (GNUNET_TIME_absolute_get_remaining + (rp->earliest_transmission).rel_value == 0)) { GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); @@ -380,9 +380,9 @@ schedule_peer_transmission (void *cls, #if DEBUG_FS GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Sleeping for %llu ms before retrying requests on plan %p.\n", - (unsigned long long) GNUNET_TIME_absolute_get_remaining (rp-> - earliest_transmission). - rel_value, pp); + (unsigned long long) + GNUNET_TIME_absolute_get_remaining + (rp->earliest_transmission).rel_value, pp); #endif pp->task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining diff --git a/src/fs/gnunet-service-fs_pe.h b/src/fs/gnunet-service-fs_pe.h index cfaeabe22..23787908e 100644 --- a/src/fs/gnunet-service-fs_pe.h +++ b/src/fs/gnunet-service-fs_pe.h @@ -35,8 +35,8 @@ * @param cp peer with the entry * @param pr request with the entry */ -void GSF_plan_add_ (struct GSF_ConnectedPeer *cp, - struct GSF_PendingRequest *pr); +void +GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr); /** @@ -45,7 +45,8 @@ void GSF_plan_add_ (struct GSF_ConnectedPeer *cp, * * @param cp connected peer */ -void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); +void +GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); /** @@ -54,19 +55,22 @@ void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); * * @param pr request that is done */ -void GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); +void +GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); /** * Initialize plan subsystem. */ -void GSF_plan_init (void); +void +GSF_plan_init (void); /** * Shutdown plan subsystem. */ -void GSF_plan_done (void); +void +GSF_plan_done (void); #endif diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 7b6290bbb..e5cb1f03c 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c @@ -817,9 +817,8 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value) /* short cut: stop processing early, no BF-update, etc. */ update_request_performance_data (prq, pr); GNUNET_LOAD_update (GSF_rt_entry_lifetime, - GNUNET_TIME_absolute_get_duration (pr->public_data. - start_time). - rel_value); + GNUNET_TIME_absolute_get_duration (pr-> + public_data.start_time).rel_value); /* pass on to other peers / local clients */ pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, prq->type, prq->data, prq->size); @@ -1101,9 +1100,8 @@ warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Datastore lookup already took %llu ms!\n"), - (unsigned long long) GNUNET_TIME_absolute_get_duration (pr-> - qe_start). - rel_value); + (unsigned long long) + GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value); pr->warn_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, pr); @@ -1123,9 +1121,8 @@ odc_warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("On-demand lookup already took %llu ms!\n"), - (unsigned long long) GNUNET_TIME_absolute_get_duration (pr-> - qe_start). - rel_value); + (unsigned long long) + GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value); pr->warn_task = GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &odc_warn_delay_task, pr); @@ -1257,12 +1254,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, GNUNET_BLOCK_TYPE_FS_DBLOCK ? GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr-> - public_data.options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & + pr->public_data.options)) ? UINT_MAX : 1 /* queue priority */ , (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr-> - public_data.options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & + pr->public_data.options)) ? UINT_MAX : 1 /* max queue size */ , GNUNET_TIME_UNIT_FOREVER_REL, &process_local_reply, pr); @@ -1298,12 +1295,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, GNUNET_BLOCK_TYPE_FS_DBLOCK ? GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr-> - public_data.options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & + pr->public_data.options)) ? UINT_MAX : 1 /* queue priority */ , (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr-> - public_data.options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & + pr->public_data.options)) ? UINT_MAX : 1 /* max queue size */ , GNUNET_TIME_UNIT_FOREVER_REL, &process_local_reply, pr); @@ -1357,12 +1354,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, GNUNET_BLOCK_TYPE_FS_DBLOCK ? GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. - options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & pr-> + public_data.options)) ? UINT_MAX : 1 /* queue priority */ , (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. - options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & pr-> + public_data.options)) ? UINT_MAX : 1 /* max queue size */ , GNUNET_TIME_UNIT_FOREVER_REL, &process_local_reply, pr); @@ -1413,12 +1410,12 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, GNUNET_BLOCK_TYPE_FS_DBLOCK ? GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. - options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & pr-> + public_data.options)) ? UINT_MAX : 1 /* queue priority */ , (0 != - (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. - options)) ? UINT_MAX : 1 + (GSF_PRO_PRIORITY_UNLIMITED & pr-> + public_data.options)) ? UINT_MAX : 1 /* max queue size */ , GNUNET_TIME_UNIT_FOREVER_REL, &process_local_reply, pr); diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index f2e7bcf62..b68989be7 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h @@ -201,33 +201,19 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls, * @param rh_cls closure for rh * @return handle for the new pending request */ -struct GSF_PendingRequest *GSF_pending_request_create_ (enum - GSF_PendingRequestOptions - options, - enum GNUNET_BLOCK_Type - type, - const GNUNET_HashCode * - query, - const GNUNET_HashCode * - namespace, - const struct - GNUNET_PeerIdentity - *target, - const char *bf_data, - size_t bf_size, - uint32_t mingle, - uint32_t - anonymity_level, - uint32_t priority, - int32_t ttl, - GNUNET_PEER_Id - sender_pid, - const GNUNET_HashCode * - replies_seen, - unsigned int - replies_seen_count, - GSF_PendingRequestReplyHandler - rh, void *rh_cls); +struct GSF_PendingRequest * +GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, + enum GNUNET_BLOCK_Type type, + const GNUNET_HashCode * query, + const GNUNET_HashCode * namespace, + const struct GNUNET_PeerIdentity *target, + const char *bf_data, size_t bf_size, + uint32_t mingle, uint32_t anonymity_level, + uint32_t priority, int32_t ttl, + GNUNET_PEER_Id sender_pid, + const GNUNET_HashCode * replies_seen, + unsigned int replies_seen_count, + GSF_PendingRequestReplyHandler rh, void *rh_cls); /** @@ -238,9 +224,10 @@ struct GSF_PendingRequest *GSF_pending_request_create_ (enum * @param replies_seen hash codes of replies that we've seen * @param replies_seen_count size of the replies_seen array */ -void GSF_pending_request_update_ (struct GSF_PendingRequest *pr, - const GNUNET_HashCode * replies_seen, - unsigned int replies_seen_count); +void +GSF_pending_request_update_ (struct GSF_PendingRequest *pr, + const GNUNET_HashCode * replies_seen, + unsigned int replies_seen_count); /** @@ -249,9 +236,8 @@ void GSF_pending_request_update_ (struct GSF_PendingRequest *pr, * @param pr pending request * @return associated public data */ -struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct - GSF_PendingRequest - *pr); +struct GSF_PendingRequestData * +GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr); /** @@ -263,8 +249,9 @@ struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct * @param pra another pending request * @return GNUNET_OK if the requests are compatible */ -int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, - struct GSF_PendingRequest *prb); +int +GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, + struct GSF_PendingRequest *prb); /** @@ -276,9 +263,9 @@ int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, * @param buf where to copy the message (can be NULL) * @return number of bytes needed (if buf_size too small) or used */ -size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest - *pr, size_t buf_size, - void *buf); +size_t +GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, + size_t buf_size, void *buf); /** @@ -287,8 +274,8 @@ size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest * @param pr request to cancel * @param full_cleanup fully purge the request */ -void GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, - int full_cleanup); +void +GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup); /** @@ -311,7 +298,8 @@ typedef int (*GSF_PendingRequestIterator) (void *cls, * @param it function to call for each request * @param cls closure for it */ -void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); +void +GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); /** @@ -327,8 +315,9 @@ void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); * GNUNET_SYSERR if the message was malformed (close connection, * do not cache under any circumstances) */ -int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, - const struct GNUNET_MessageHeader *message); +int +GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, + const struct GNUNET_MessageHeader *message); /** @@ -336,7 +325,8 @@ int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, * * @param pr the pending request to process */ -void GSF_dht_lookup_ (struct GSF_PendingRequest *pr); +void +GSF_dht_lookup_ (struct GSF_PendingRequest *pr); /** @@ -360,20 +350,23 @@ typedef void (*GSF_LocalLookupContinuation) (void *cls, * @param cont function to call at the end * @param cont_cls closure for cont */ -void GSF_local_lookup_ (struct GSF_PendingRequest *pr, - GSF_LocalLookupContinuation cont, void *cont_cls); +void +GSF_local_lookup_ (struct GSF_PendingRequest *pr, + GSF_LocalLookupContinuation cont, void *cont_cls); /** * Setup the subsystem. */ -void GSF_pending_request_init_ (void); +void +GSF_pending_request_init_ (void); /** * Shutdown the subsystem. */ -void GSF_pending_request_done_ (void); +void +GSF_pending_request_done_ (void); #endif diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 6d8c05999..fb05366af 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c @@ -191,7 +191,8 @@ delete_migration_block (struct MigrationReadyBlock *mb) /** * Find content for migration to this peer. */ -static void find_content (struct MigrationReadyPeer *mrp); +static void +find_content (struct MigrationReadyPeer *mrp); /** @@ -343,7 +344,8 @@ score_content (struct MigrationReadyPeer *peer, * If the migration task is not currently running, consider * (re)scheduling it with the appropriate delay. */ -static void consider_gathering (void); +static void +consider_gathering (void); /** @@ -421,9 +423,9 @@ find_content (struct MigrationReadyPeer *mrp) * @param cls unused * @param tc scheduler context (also unused) */ -static void gather_migration_blocks (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +gather_migration_blocks (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/fs/gnunet-service-fs_push.h b/src/fs/gnunet-service-fs_push.h index 40e1252be..7967b04cd 100644 --- a/src/fs/gnunet-service-fs_push.h +++ b/src/fs/gnunet-service-fs_push.h @@ -32,13 +32,15 @@ /** * Setup the module. */ -void GSF_push_init_ (void); +void +GSF_push_init_ (void); /** * Shutdown the module. */ -void GSF_push_done_ (void); +void +GSF_push_done_ (void); /** @@ -47,7 +49,8 @@ void GSF_push_done_ (void); * * @param peer handle for the peer that connected */ -void GSF_push_start_ (struct GSF_ConnectedPeer *peer); +void +GSF_push_start_ (struct GSF_ConnectedPeer *peer); /** @@ -56,7 +59,8 @@ void GSF_push_start_ (struct GSF_ConnectedPeer *peer); * * @param peer handle for the peer that disconnected */ -void GSF_push_stop_ (struct GSF_ConnectedPeer *peer); +void +GSF_push_stop_ (struct GSF_ConnectedPeer *peer); #endif diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c index ec2344b37..4b4925d22 100644 --- a/src/fs/gnunet-service-fs_put.c +++ b/src/fs/gnunet-service-fs_put.c @@ -86,9 +86,9 @@ static struct PutOperator operators[] = { * @param cls type of blocks to gather * @param tc scheduler context (unused) */ -static void gather_dht_put_blocks (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +gather_dht_put_blocks (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/fs/gnunet-service-fs_put.h b/src/fs/gnunet-service-fs_put.h index 21c3c3baf..59b1f83e3 100644 --- a/src/fs/gnunet-service-fs_put.h +++ b/src/fs/gnunet-service-fs_put.h @@ -32,13 +32,15 @@ /** * Setup the module. */ -void GSF_put_init_ (void); +void +GSF_put_init_ (void); /** * Shutdown the module. */ -void GSF_put_done_ (void); +void +GSF_put_done_ (void); #endif diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 0737ea949..0bf05d0ce 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c @@ -129,7 +129,8 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, /** * Function that gathers stats from all daemons. */ -static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -206,8 +207,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) sm->stat = GNUNET_STATISTICS_create ("<driver>", GNUNET_FS_TEST_get_configuration (daemons, - sm-> - daemon)); + sm->daemon)); GNUNET_SCHEDULER_add_now (&stat_run, sm); } else diff --git a/src/fs/perf_gnunet_service_fs_p2p_trust.c b/src/fs/perf_gnunet_service_fs_p2p_trust.c index 5a8d4242a..3432714b3 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_trust.c +++ b/src/fs/perf_gnunet_service_fs_p2p_trust.c @@ -162,7 +162,8 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, /** * Function that gathers stats from all daemons. */ -static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -244,8 +245,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) sm->stat = GNUNET_STATISTICS_create ("<driver>", GNUNET_FS_TEST_get_configuration (daemons, - sm-> - daemon)); + sm->daemon)); GNUNET_SCHEDULER_add_now (&stat_run, sm); } else diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 34625ff2e..10f4c0ce4 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c @@ -140,42 +140,42 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kb/s.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL)); GAUGER ("FS", "Publishing speed (insertion)", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL), "kb/s"); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL), "kb/s"); fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); start = GNUNET_TIME_absolute_get (); download = GNUNET_FS_download_start (fs, - event->value.publish.specifics.completed. - chk_uri, NULL, fn, NULL, 0, FILESIZE, 1, - GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", - NULL); + event->value.publish.specifics. + completed.chk_uri, NULL, fn, NULL, 0, + FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE, + "download", NULL); GNUNET_assert (download != NULL); break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: printf ("Download complete, %llu kb/s.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL)); GAUGER ("FS", "Local download speed (inserted)", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL), "kb/s"); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL), "kb/s"); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: @@ -185,8 +185,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.download.completed, (unsigned long long) event->value.download.size, event->value.download.specifics.progress.depth, - (unsigned long long) event->value.download.specifics.progress. - offset); + (unsigned long long) event->value.download.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 5b1752e63..1811b325d 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c @@ -141,42 +141,42 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL)); GAUGER ("FS", "Publishing speed (indexing)", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL), "kb/s"); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL), "kb/s"); fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); start = GNUNET_TIME_absolute_get (); download = GNUNET_FS_download_start (fs, - event->value.publish.specifics.completed. - chk_uri, NULL, fn, NULL, 0, FILESIZE, 1, - GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", - NULL); + event->value.publish.specifics. + completed.chk_uri, NULL, fn, NULL, 0, + FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE, + "download", NULL); GNUNET_assert (download != NULL); break; case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: printf ("Download complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL)); GAUGER ("FS", "Local download speed (indexed)", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL), "kb/s"); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL), "kb/s"); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: @@ -186,8 +186,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.download.completed, (unsigned long long) event->value.download.size, event->value.download.specifics.progress.depth, - (unsigned long long) event->value.download.specifics.progress. - offset); + (unsigned long long) event->value.download.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index 5b2a53f80..c7a0a8b7c 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c @@ -123,8 +123,8 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -static void *progress_cb (void *cls, - const struct GNUNET_FS_ProgressInfo *event); +static void * +progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); static void @@ -171,16 +171,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL)); fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); start = GNUNET_TIME_absolute_get (); GNUNET_assert (download == NULL); @@ -194,8 +194,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) printf ("Download complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024LL)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024LL)); GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); break; case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: @@ -206,8 +206,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.download.completed, (unsigned long long) event->value.download.size, event->value.download.specifics.progress.depth, - (unsigned long long) event->value.download.specifics.progress. - offset); + (unsigned long long) event->value.download.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index 87afa12e1..b86506f8d 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c @@ -110,8 +110,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) printf ("Publish complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000 / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); @@ -125,8 +125,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index 797c4c9a8..3db0a7c62 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c @@ -98,8 +98,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) printf ("Publish complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000 / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); @@ -112,8 +112,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index f69ac5d9a..704c2a4c0 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c @@ -97,8 +97,8 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -static void *progress_cb (void *cls, - const struct GNUNET_FS_ProgressInfo *event); +static void * +progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); static void @@ -149,8 +149,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) printf ("Publish complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000LL / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); break; @@ -163,8 +163,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_SUSPEND: @@ -175,8 +175,9 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) if (NULL == publish) { GNUNET_assert (GNUNET_YES == - GNUNET_FS_file_information_is_directory (event->value. - publish.fi)); + GNUNET_FS_file_information_is_directory (event-> + value.publish. + fi)); publish = event->value.publish.pc; return "publish-context-dir"; } diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index 3961017cf..d8e592b6f 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c @@ -101,8 +101,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 5c5a6f140..6eb18dafb 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c @@ -86,8 +86,8 @@ abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -static void *progress_cb (void *cls, - const struct GNUNET_FS_ProgressInfo *event); +static void * +progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); static void @@ -140,8 +140,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 177b687ca..99913fbcf 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c @@ -100,16 +100,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000 / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); start = GNUNET_TIME_absolute_get (); unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); GNUNET_assert (unindex != NULL); @@ -118,8 +118,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) printf ("Unindex complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000 / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; @@ -130,8 +130,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.unindex.completed, (unsigned long long) event->value.unindex.size, event->value.unindex.specifics.progress.depth, - (unsigned long long) event->value.unindex.specifics.progress. - offset); + (unsigned long long) event->value.unindex.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_ERROR: diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 4fcd1445f..e81400817 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c @@ -94,8 +94,8 @@ abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -static void *progress_cb (void *cls, - const struct GNUNET_FS_ProgressInfo *event); +static void * +progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); static void @@ -141,16 +141,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.publish.completed, (unsigned long long) event->value.publish.size, event->value.publish.specifics.progress.depth, - (unsigned long long) event->value.publish.specifics.progress. - offset); + (unsigned long long) event->value.publish.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_COMPLETED: printf ("Publishing complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000 / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); start = GNUNET_TIME_absolute_get (); unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); GNUNET_assert (unindex != NULL); @@ -159,8 +159,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) printf ("Unindex complete, %llu kbps.\n", (unsigned long long) (FILESIZE * 1000 / (1 + - GNUNET_TIME_absolute_get_duration (start). - rel_value) / 1024)); + GNUNET_TIME_absolute_get_duration + (start).rel_value) / 1024)); GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, GNUNET_SCHEDULER_REASON_PREREQ_DONE); break; @@ -172,8 +172,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) (unsigned long long) event->value.unindex.completed, (unsigned long long) event->value.unindex.size, event->value.unindex.specifics.progress.depth, - (unsigned long long) event->value.unindex.specifics.progress. - offset); + (unsigned long long) event->value.unindex.specifics. + progress.offset); #endif break; case GNUNET_FS_STATUS_PUBLISH_SUSPEND: diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index c049dceea..f6a47f4d9 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c @@ -476,7 +476,8 @@ download_get_url () * Method to save hostlist to a file during hostlist client shutdown * @param shutdown set if called because of shutdown, entries in linked list will be destroyed */ -static void save_hostlist_file (int shutdown); +static void +save_hostlist_file (int shutdown); /** @@ -708,8 +709,8 @@ clean_up () * @param cls closure, unused * @param tc task context, unused */ -static void task_download (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/hostlist/hostlist-client.h b/src/hostlist/hostlist-client.h index c6561c820..3def865e4 100644 --- a/src/hostlist/hostlist-client.h +++ b/src/hostlist/hostlist-client.h @@ -89,17 +89,19 @@ * @param learn set if client is learning new hostlists * @return GNUNET_OK on success */ -int GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, - struct GNUNET_STATISTICS_Handle *st, - GNUNET_CORE_ConnectEventHandler *ch, - GNUNET_CORE_DisconnectEventHandler *dh, - GNUNET_CORE_MessageCallback *msgh, int learn); +int +GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, + struct GNUNET_STATISTICS_Handle *st, + GNUNET_CORE_ConnectEventHandler *ch, + GNUNET_CORE_DisconnectEventHandler *dh, + GNUNET_CORE_MessageCallback *msgh, int learn); /** * Stop downloading hostlists from hostlist servers as necessary. */ -void GNUNET_HOSTLIST_client_stop (void); +void +GNUNET_HOSTLIST_client_stop (void); #endif diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index e48b6a4ac..bfe0b4b0e 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c @@ -448,8 +448,8 @@ process_notify (void *cls, const struct GNUNET_PeerIdentity *peer, * Function that queries MHD's select sets and * starts the task waiting for them. */ -static GNUNET_SCHEDULER_TaskIdentifier prepare_daemon (struct MHD_Daemon - *daemon_handle); +static GNUNET_SCHEDULER_TaskIdentifier +prepare_daemon (struct MHD_Daemon *daemon_handle); /** diff --git a/src/hostlist/hostlist-server.h b/src/hostlist/hostlist-server.h index b5960b39c..e0f8eb4a6 100644 --- a/src/hostlist/hostlist-server.h +++ b/src/hostlist/hostlist-server.h @@ -38,18 +38,20 @@ * * @return GNUNET_OK on success */ -int GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, - struct GNUNET_STATISTICS_Handle *st, - struct GNUNET_CORE_Handle *core, - GNUNET_CORE_ConnectEventHandler *server_ch, - GNUNET_CORE_DisconnectEventHandler *server_dh, - int advertise); +int +GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, + struct GNUNET_STATISTICS_Handle *st, + struct GNUNET_CORE_Handle *core, + GNUNET_CORE_ConnectEventHandler *server_ch, + GNUNET_CORE_DisconnectEventHandler *server_dh, + int advertise); /** * Stop server offering our hostlist. */ -void GNUNET_HOSTLIST_server_stop (void); +void +GNUNET_HOSTLIST_server_stop (void); #endif diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index 76529ede4..6d52773de 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h @@ -73,9 +73,9 @@ struct GNUNET_ARM_Handle; * @param service service that *this* process is implementing/providing, can be NULL * @return context to use for further ARM operations, NULL on error */ -struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *service); +struct GNUNET_ARM_Handle * +GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *service); /** @@ -83,7 +83,8 @@ struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct * * @param h the handle that was being used */ -void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); +void +GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); /** @@ -104,10 +105,10 @@ void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); * @param cb callback to invoke when service is ready * @param cb_cls closure for callback */ -void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, - const char *service_name, - struct GNUNET_TIME_Relative timeout, - GNUNET_ARM_Callback cb, void *cb_cls); +void +GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, const char *service_name, + struct GNUNET_TIME_Relative timeout, + GNUNET_ARM_Callback cb, void *cb_cls); /** @@ -121,10 +122,10 @@ void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, * @param cb callback to invoke when service is ready * @param cb_cls closure for callback */ -void GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, - const char *service_name, - struct GNUNET_TIME_Relative timeout, - GNUNET_ARM_Callback cb, void *cb_cls); +void +GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, const char *service_name, + struct GNUNET_TIME_Relative timeout, + GNUNET_ARM_Callback cb, void *cb_cls); diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index dd648dd75..1de3d1041 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h @@ -83,10 +83,10 @@ typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification) (void *cls, * @param alloc_cb_cls closure for 'alloc_cb' * @return ats context */ -struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct - GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_TRANSPORT_ATS_AllocationNotification - alloc_cb, void *alloc_cb_cls); +struct GNUNET_ATS_Handle * +GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb, + void *alloc_cb_cls); /** @@ -94,7 +94,8 @@ struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct * * @param atc handle */ -void GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); +void +GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); /** @@ -140,15 +141,11 @@ struct GNUNET_ATS_SuggestionContext; * @param cb function to call with the address * @param cb_cls closure for cb */ -struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct - GNUNET_ATS_Handle - *atc, - const struct - GNUNET_PeerIdentity - *peer, - GNUNET_ATS_AddressSuggestionCallback - cb, - void *cb_cls); +struct GNUNET_ATS_SuggestionContext * +GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc, + const struct GNUNET_PeerIdentity *peer, + GNUNET_ATS_AddressSuggestionCallback cb, + void *cb_cls); /** @@ -156,8 +153,8 @@ struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct * * @param asc handle of the request to cancel */ -void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext - *asc); +void +GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); /** @@ -174,12 +171,13 @@ void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext * @param ats performance data for the connection * @param ats_count number of performance records in 'ats' */ -void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, - const struct GNUNET_PeerIdentity *peer, - const char *plugin_name, struct Session *session, - const void *plugin_addr, size_t plugin_addr_len, - const struct GNUNET_TRANSPORT_ATS_Information - *ats, uint32_t ats_count); +void +GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, + const struct GNUNET_PeerIdentity *peer, + const char *plugin_name, struct Session *session, + const void *plugin_addr, size_t plugin_addr_len, + const struct GNUNET_TRANSPORT_ATS_Information *ats, + uint32_t ats_count); /** @@ -190,8 +188,9 @@ void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, * @param atc handle * @param peer identity of the peer */ -void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, - const struct GNUNET_PeerIdentity *peer); +void +GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, + const struct GNUNET_PeerIdentity *peer); /** @@ -201,9 +200,10 @@ void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, * @param peer identity of the peer * @param session session handle that is no longer valid */ -void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, - const struct GNUNET_PeerIdentity *peer, - const struct Session *session); +void +GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, + const struct GNUNET_PeerIdentity *peer, + const struct Session *session); /** @@ -224,14 +224,14 @@ void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, * @param ats performance data for the address * @param ats_count number of performance records in 'ats' */ -void GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, - const struct GNUNET_PeerIdentity *peer, - struct GNUNET_TIME_Absolute valid_until, - const char *plugin_name, - struct Session *session, - const void *plugin_addr, size_t plugin_addr_len, - const struct GNUNET_TRANSPORT_ATS_Information - *ats, uint32_t ats_count); +void +GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, + const struct GNUNET_PeerIdentity *peer, + struct GNUNET_TIME_Absolute valid_until, + const char *plugin_name, struct Session *session, + const void *plugin_addr, size_t plugin_addr_len, + const struct GNUNET_TRANSPORT_ATS_Information *ats, + uint32_t ats_count); #endif diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index e78d16552..75f71b32c 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h @@ -89,8 +89,8 @@ struct GNUNET_BANDWIDTH_Tracker * @param bytes_per_second value to create * @return the new bandwidth value */ -struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t - bytes_per_second); +struct GNUNET_BANDWIDTH_Value32NBO +GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); /** @@ -107,12 +107,11 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t * @param deadline when is the deadline * @return number of bytes available at bps until deadline */ -uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct - GNUNET_BANDWIDTH_Value32NBO - bps, - struct - GNUNET_TIME_Relative - deadline); +uint64_t +GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO + bps, + struct GNUNET_TIME_Relative + deadline); /** @@ -123,11 +122,9 @@ uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct * @param size number of bytes we want to have available * @return how long it would take */ -struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct - GNUNET_BANDWIDTH_Value32NBO - bps, - uint64_t - size); +struct GNUNET_TIME_Relative +GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, + uint64_t size); @@ -138,12 +135,9 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct * @param b2 second value * @return the min of b1 and b2 */ -struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct - GNUNET_BANDWIDTH_Value32NBO - b1, - struct - GNUNET_BANDWIDTH_Value32NBO - b2); +struct GNUNET_BANDWIDTH_Value32NBO +GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, + struct GNUNET_BANDWIDTH_Value32NBO b2); /** @@ -160,10 +154,10 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct * @param max_carry_s maximum number of seconds unused bandwidth * may accumulate before it expires */ -void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, - struct GNUNET_BANDWIDTH_Value32NBO - bytes_per_second_limit, - uint32_t max_carry_s); +void +GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, + struct GNUNET_BANDWIDTH_Value32NBO + bytes_per_second_limit, uint32_t max_carry_s); /** @@ -177,8 +171,9 @@ void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, * @param size number of bytes consumed * @return GNUNET_YES if this consumption is above the limit */ -int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, - ssize_t size); +int +GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, + ssize_t size); /** @@ -190,10 +185,9 @@ int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, * @param size number of bytes we would like to consume * @return time to wait for consumption to be OK */ -struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct - GNUNET_BANDWIDTH_Tracker - *av, - size_t size); +struct GNUNET_TIME_Relative +GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, + size_t size); /** @@ -203,9 +197,8 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct * @param av tracker to query * @return number of bytes available for consumption right now */ -int64_t GNUNET_BANDWIDTH_tracker_get_available (struct - GNUNET_BANDWIDTH_Tracker - *av); +int64_t +GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); /** @@ -214,9 +207,10 @@ int64_t GNUNET_BANDWIDTH_tracker_get_available (struct * @param av tracker to initialize * @param bytes_per_second_limit new limit to assume */ -void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, - struct GNUNET_BANDWIDTH_Value32NBO - bytes_per_second_limit); +void +GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, + struct GNUNET_BANDWIDTH_Value32NBO + bytes_per_second_limit); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 74512ec40..de356d1e5 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h @@ -49,7 +49,8 @@ struct GNUNET_BIO_ReadHandle; * @param fn file name to be opened * @return IO handle on success, NULL on error */ -struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); +struct GNUNET_BIO_ReadHandle * +GNUNET_BIO_read_open (const char *fn); /** @@ -60,7 +61,8 @@ struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); * @param emsg set to the error message * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); +int +GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); /** @@ -72,8 +74,9 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); * @param len the number of bytes to read * @return GNUNET_OK on success, GNUNET_SYSERR on failure */ -int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, - void *result, size_t len); +int +GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, + void *result, size_t len); /** @@ -86,8 +89,9 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, * @param len the number of bytes to read * @return GNUNET_OK on success, GNUNET_SYSERR on failure */ -int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, - int line, void *result, size_t len); +int +GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int line, + void *result, size_t len); /** * Read 0-terminated string from a file. @@ -99,8 +103,9 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, * @param maxLen maximum allowed length for the string * @return GNUNET_OK on success, GNUNET_SYSERR on failure */ -int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, - char **result, size_t maxLen); +int +GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, + char **result, size_t maxLen); /** @@ -111,9 +116,9 @@ int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, * @param result the buffer to store a pointer to the (allocated) metadata * @return GNUNET_OK on success, GNUNET_SYSERR on failure */ -int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, - const char *what, - struct GNUNET_CONTAINER_MetaData **result); +int +GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, + struct GNUNET_CONTAINER_MetaData **result); /** @@ -144,8 +149,9 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, * @param i address of 32-bit integer to read * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, - int line, int32_t * i); +int +GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, + int line, int32_t * i); /** @@ -166,8 +172,9 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, * @param i address of 64-bit integer to read * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, - int line, int64_t * i); +int +GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, + int line, int64_t * i); /** @@ -190,7 +197,8 @@ struct GNUNET_BIO_WriteHandle; * @param fn file name to be opened * @return IO handle on success, NULL on error */ -struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); +struct GNUNET_BIO_WriteHandle * +GNUNET_BIO_write_open (const char *fn); /** @@ -199,7 +207,8 @@ struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); * @param h file handle * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); +int +GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); /** @@ -210,8 +219,9 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); * @param n number of bytes to write * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, - size_t n); +int +GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, + size_t n); /** @@ -221,7 +231,8 @@ int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, * @param s string to write (can be NULL) * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); +int +GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); @@ -233,8 +244,9 @@ int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); * @param m metadata to write * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, - const struct GNUNET_CONTAINER_MetaData *m); +int +GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, + const struct GNUNET_CONTAINER_MetaData *m); @@ -264,7 +276,8 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, * @param i address of 32-bit integer to write * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); +int +GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); /** @@ -274,7 +287,8 @@ int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); * @param i address of 64-bit integer to write * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); +int +GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index 51b8254d0..66b2490c0 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h @@ -161,8 +161,9 @@ struct GNUNET_BLOCK_Context; * @param mingle_number number for hash permutation * @param hc where to store the result. */ -void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, - uint32_t mingle_number, GNUNET_HashCode * hc); +void +GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, uint32_t mingle_number, + GNUNET_HashCode * hc); /** @@ -171,9 +172,8 @@ void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, * @param cfg configuration to use * @return NULL on error */ -struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_BLOCK_Context * +GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -181,7 +181,8 @@ struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct * * @param ctx context to destroy */ -void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); +void +GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); /** @@ -202,23 +203,14 @@ void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); * @param reply_block_size number of bytes in reply block * @return characterization of result */ -enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct - GNUNET_BLOCK_Context - *ctx, - enum GNUNET_BLOCK_Type - type, - const GNUNET_HashCode - * query, - struct - GNUNET_CONTAINER_BloomFilter - **bf, - int32_t bf_mutator, - const void *xquery, - size_t xquery_size, - const void - *reply_block, - size_t - reply_block_size); +enum GNUNET_BLOCK_EvaluationResult +GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, + enum GNUNET_BLOCK_Type type, + const GNUNET_HashCode * query, + struct GNUNET_CONTAINER_BloomFilter **bf, + int32_t bf_mutator, const void *xquery, + size_t xquery_size, const void *reply_block, + size_t reply_block_size); /** @@ -234,9 +226,10 @@ enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct * GNUNET_SYSERR if type not supported * (or if extracting a key from a block of this type does not work) */ -int GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, - enum GNUNET_BLOCK_Type type, const void *block, - size_t block_size, GNUNET_HashCode * key); +int +GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, + enum GNUNET_BLOCK_Type type, const void *block, + size_t block_size, GNUNET_HashCode * key); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h index d9c3ec76f..5eb0daf3f 100644 --- a/src/include/gnunet_chat_service.h +++ b/src/include/gnunet_chat_service.h @@ -183,26 +183,19 @@ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, * @param me member ID (pseudonym) * @return NULL on error */ -struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct - GNUNET_CONFIGURATION_Handle - *cfg, const char *nick_name, - struct GNUNET_CONTAINER_MetaData - *member_info, - const char *room_name, - enum GNUNET_CHAT_MsgOptions - msg_options, - GNUNET_CHAT_JoinCallback - joinCallback, void *join_cls, - GNUNET_CHAT_MessageCallback - messageCallback, - void *message_cls, - GNUNET_CHAT_MemberListCallback - memberCallback, - void *member_cls, - GNUNET_CHAT_MessageConfirmation - confirmationCallback, - void *confirmation_cls, - GNUNET_HashCode * me); +struct GNUNET_CHAT_Room * +GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *nick_name, + struct GNUNET_CONTAINER_MetaData *member_info, + const char *room_name, + enum GNUNET_CHAT_MsgOptions msg_options, + GNUNET_CHAT_JoinCallback joinCallback, void *join_cls, + GNUNET_CHAT_MessageCallback messageCallback, + void *message_cls, + GNUNET_CHAT_MemberListCallback memberCallback, + void *member_cls, + GNUNET_CHAT_MessageConfirmation confirmationCallback, + void *confirmation_cls, GNUNET_HashCode * me); /** * Send a message. @@ -213,18 +206,18 @@ struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct * @param receiver use NULL to send to everyone in the room * @param sequence_number where to write the sequence id of the message */ -void GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, - const char *message, - enum GNUNET_CHAT_MsgOptions options, - const struct - GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded - *receiver, uint32_t * sequence_number); +void +GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, const char *message, + enum GNUNET_CHAT_MsgOptions options, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + *receiver, uint32_t * sequence_number); /** * Leave a chat room. */ -void GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); +void +GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); #if 0 @@ -241,9 +234,10 @@ typedef int (*GNUNET_CHAT_RoomIterator) (const char *room, const char *topic, * List all of the (publically visible) chat rooms. * @return number of rooms on success, GNUNET_SYSERR if iterator aborted */ -int GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx, - struct GNUNET_GC_Configuration *cfg, - GNUNET_CHAT_RoomIterator it, void *cls); +int +GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx, + struct GNUNET_GC_Configuration *cfg, + GNUNET_CHAT_RoomIterator it, void *cls); #endif diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 3fad01222..ed033d031 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h @@ -53,11 +53,9 @@ struct GNUNET_CLIENT_Connection; * @param cfg configuration to use * @return NULL on error (service unknown to configuration) */ -struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char - *service_name, - const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_CLIENT_Connection * +GNUNET_CLIENT_connect (const char *service_name, + const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -66,8 +64,9 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char * @param h client handle * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default */ -void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, - int do_ignore); +void +GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, + int do_ignore); @@ -86,8 +85,9 @@ void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, * @param finish_pending_write should a transmission already passed to the * handle be completed? */ -void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, - int finish_pending_write); +void +GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, + int finish_pending_write); /** * Type of a function to call when we receive a message @@ -120,10 +120,10 @@ typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, int reason); * @param handler_cls closure for handler * @param timeout how long to wait until timing out */ -void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, - GNUNET_CLIENT_MessageHandler handler, - void *handler_cls, - struct GNUNET_TIME_Relative timeout); +void +GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, + GNUNET_CLIENT_MessageHandler handler, void *handler_cls, + struct GNUNET_TIME_Relative timeout); /** @@ -152,20 +152,13 @@ struct GNUNET_CLIENT_TransmitHandle; * non-NULL if the notify callback was queued (can be used to cancel * using GNUNET_CONNECTION_notify_transmit_ready_cancel) */ -struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct - GNUNET_CLIENT_Connection - *sock, - size_t - size, - struct - GNUNET_TIME_Relative - timeout, - int - auto_retry, - GNUNET_CONNECTION_TransmitReadyNotify - notify, - void - *notify_cls); +struct GNUNET_CLIENT_TransmitHandle * +GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, + size_t size, + struct GNUNET_TIME_Relative timeout, + int auto_retry, + GNUNET_CONNECTION_TransmitReadyNotify + notify, void *notify_cls); /** @@ -173,9 +166,9 @@ struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct * * @param th handle from the original request. */ -void GNUNET_CLIENT_notify_transmit_ready_cancel (struct - GNUNET_CLIENT_TransmitHandle - *th); +void +GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle + *th); /** @@ -199,14 +192,13 @@ void GNUNET_CLIENT_notify_transmit_ready_cancel (struct * @return GNUNET_OK on success, GNUNET_SYSERR if a request * is already pending */ -int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection - *sock, - const struct GNUNET_MessageHeader - *hdr, - struct GNUNET_TIME_Relative - timeout, int auto_retry, - GNUNET_CLIENT_MessageHandler rn, - void *rn_cls); +int +GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock, + const struct GNUNET_MessageHeader *hdr, + struct GNUNET_TIME_Relative timeout, + int auto_retry, + GNUNET_CLIENT_MessageHandler rn, + void *rn_cls); /** @@ -220,10 +212,11 @@ int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection * or "TIMEOUT" (service not known to be running)) * @param task_cls closure for task */ -void GNUNET_CLIENT_service_test (const char *service, - const struct GNUNET_CONFIGURATION_Handle *cfg, - struct GNUNET_TIME_Relative timeout, - GNUNET_SCHEDULER_Task task, void *task_cls); +void +GNUNET_CLIENT_service_test (const char *service, + const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TIME_Relative timeout, + GNUNET_SCHEDULER_Task task, void *task_cls); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index f884d9a24..2636824d3 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -168,7 +168,8 @@ typedef void (*GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, * @param message what is the message (format string) * @param ... arguments for format string */ -void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); +void +GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); @@ -181,8 +182,9 @@ void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); * @param message what is the message (format string) * @param ... arguments for format string */ -void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, - const char *message, ...); +void +GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, + const char *message, ...); /** @@ -191,7 +193,8 @@ void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, * @param n number of log calls to ignore * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero */ -void GNUNET_log_skip (unsigned int n, int check_reset); +void +GNUNET_log_skip (unsigned int n, int check_reset); /** @@ -202,8 +205,8 @@ void GNUNET_log_skip (unsigned int n, int check_reset); * @param logfile change logging to logfile (use NULL to keep stderr) * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened */ -int GNUNET_log_setup (const char *comp, const char *loglevel, - const char *logfile); +int +GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); /** @@ -212,7 +215,8 @@ int GNUNET_log_setup (const char *comp, const char *loglevel, * @param logger log function * @param logger_cls closure for logger */ -void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); +void +GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); /** @@ -221,7 +225,8 @@ void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); * @param logger log function * @param logger_cls closure for logger */ -void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); +void +GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); /** @@ -232,7 +237,8 @@ void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); * @param hc the hash code * @return string */ -const char *GNUNET_h2s (const GNUNET_HashCode * hc); +const char * +GNUNET_h2s (const GNUNET_HashCode * hc); /** @@ -244,7 +250,8 @@ const char *GNUNET_h2s (const GNUNET_HashCode * hc); * @param hc the hash code * @return string */ -const char *GNUNET_h2s_full (const GNUNET_HashCode * hc); +const char * +GNUNET_h2s_full (const GNUNET_HashCode * hc); /** @@ -256,7 +263,8 @@ const char *GNUNET_h2s_full (const GNUNET_HashCode * hc); * @return string form of the pid; will be overwritten by next * call to GNUNET_i2s. */ -const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); +const char * +GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); /** @@ -269,7 +277,8 @@ const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); * @return nicely formatted string for the address * will be overwritten by next call to GNUNET_a2s. */ -const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); +const char * +GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); /** * Convert error type to string. @@ -277,7 +286,8 @@ const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); * @param kind type to convert * @return string corresponding to the type */ -const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); +const char * +GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); /** @@ -327,14 +337,16 @@ const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); * @param n the value in network byte order * @return the same value in host byte order */ -unsigned long long GNUNET_ntohll (unsigned long long n); +unsigned long long +GNUNET_ntohll (unsigned long long n); /** * Convert a long long to network-byte-order. * @param n the value in host byte order * @return the same value in network byte order */ -unsigned long long GNUNET_htonll (unsigned long long n); +unsigned long long +GNUNET_htonll (unsigned long long n); /* ************************* allocation functions ****************** */ @@ -468,7 +480,8 @@ unsigned long long GNUNET_htonll (unsigned long long n); * @param ... data for format string * @return number of bytes written to buf or negative value on error */ -int GNUNET_snprintf (char *buf, size_t size, const char *format, ...); +int +GNUNET_snprintf (char *buf, size_t size, const char *format, ...); /** @@ -479,7 +492,8 @@ int GNUNET_snprintf (char *buf, size_t size, const char *format, ...); * @param ... data for format string * @return number of bytes in "*buf" excluding 0-termination */ -int GNUNET_asprintf (char **buf, const char *format, ...); +int +GNUNET_asprintf (char **buf, const char *format, ...); /* ************** internal implementations, use macros above! ************** */ @@ -495,7 +509,8 @@ int GNUNET_asprintf (char **buf, const char *format, ...); * @param linenumber line where this call is being made (for debugging) * @return allocated memory, never NULL */ -void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); +void * +GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); @@ -510,8 +525,9 @@ void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); * @param linenumber line where this call is being made (for debugging) * @return allocated memory, never NULL */ -void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, - int linenumber); +void * +GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, + int linenumber); /** @@ -526,15 +542,15 @@ void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, * @param linenumber line where this call is being made (for debugging) * @return pointer to size bytes of memory, NULL if we do not have enough memory */ -void *GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, - int linenumber); +void * +GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber); /** * Reallocate memory. Checks the return value, aborts if no more * memory is available. */ -void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, - int linenumber); +void * +GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber); /** * Free memory. Merely a wrapper for the case that we @@ -545,7 +561,8 @@ void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, * @param filename where is this call being made (for debugging) * @param linenumber line where this call is being made (for debugging) */ -void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); +void +GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); /** @@ -555,7 +572,8 @@ void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); * @param linenumber line where this call is being made (for debugging) * @return the duplicated string */ -char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); +char * +GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); /** * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro. @@ -565,8 +583,9 @@ char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); * @param linenumber line where this call is being made (for debugging) * @return the duplicated string */ -char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, - int linenumber); +char * +GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, + int linenumber); /** * Grow an array, the new elements are zeroed out. @@ -583,9 +602,9 @@ char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, * @param filename where is this call being made (for debugging) * @param linenumber line where this call is being made (for debugging) */ -void GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, - unsigned int newCount, const char *filename, - int linenumber); +void +GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, + unsigned int newCount, const char *filename, int linenumber); diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 24705f0fb..7167d8bd6 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h @@ -49,7 +49,8 @@ struct GNUNET_CONFIGURATION_Handle; * Create a new configuration object. * @return fresh configuration object */ -struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void); +struct GNUNET_CONFIGURATION_Handle * +GNUNET_CONFIGURATION_create (void); /** @@ -58,9 +59,8 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void); * @param cfg configuration to duplicate * @return duplicate configuration */ -struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_CONFIGURATION_Handle * +GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -68,7 +68,8 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct * * @param cfg configuration to destroy */ -void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); +void +GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -80,8 +81,9 @@ void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); * @param filename name of the configuration file, NULL to load defaults * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, - const char *filename); +int +GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, + const char *filename); /** @@ -92,8 +94,9 @@ int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, * @param filename name of the configuration file * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, - const char *filename); +int +GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, + const char *filename); /** @@ -103,8 +106,9 @@ int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, * @param filename where to write the configuration * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, - const char *filename); +int +GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, + const char *filename); /** * Write only configuration entries that have been changed to configuration file @@ -113,10 +117,11 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, * @param filename where to write the configuration diff between default and new * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle - *cfgDefault, - const struct GNUNET_CONFIGURATION_Handle - *cfgNew, const char *filename); +int +GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle + *cfgDefault, + const struct GNUNET_CONFIGURATION_Handle + *cfgNew, const char *filename); /** * Test if there are configuration options that were @@ -125,8 +130,8 @@ int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle * @param cfg configuration to inspect * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) */ -int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle - *cfg); +int +GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -159,9 +164,10 @@ typedef void (*GNUNET_CONFIGURATION_Section_Iterator) (void *cls, * @param iter function to call on each option * @param iter_cls closure for iter */ -void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle - *cfg, GNUNET_CONFIGURATION_Iterator iter, - void *iter_cls); +void +GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_CONFIGURATION_Iterator iter, + void *iter_cls); /** @@ -171,10 +177,11 @@ void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle * @param iter function to call on each section * @param iter_cls closure for iter */ -void GNUNET_CONFIGURATION_iterate_sections (const struct - GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_CONFIGURATION_Section_Iterator - iter, void *iter_cls); +void +GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle + *cfg, + GNUNET_CONFIGURATION_Section_Iterator + iter, void *iter_cls); /** @@ -183,8 +190,9 @@ void GNUNET_CONFIGURATION_iterate_sections (const struct * @param cfg configuration to inspect * @param section name of the section to remove */ -void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle - *cfg, const char *section); +void +GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section); /** * Get a configuration value that should be a number. @@ -195,11 +203,11 @@ void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle * @param number where to store the numeric value of the option * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_get_value_number (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - const char *option, - unsigned long long *number); +int +GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option, + unsigned long long *number); /** @@ -211,11 +219,11 @@ int GNUNET_CONFIGURATION_get_value_number (const struct * @param time set to the time value stored in the configuration * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_get_value_time (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - const char *option, - struct GNUNET_TIME_Relative *time); +int +GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option, + struct GNUNET_TIME_Relative *time); /** @@ -226,9 +234,9 @@ int GNUNET_CONFIGURATION_get_value_time (const struct * @param option option of interest * @return GNUNET_YES if so, GNUNET_NO if not. */ -int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - const char *option); +int +GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option); /** @@ -241,10 +249,10 @@ int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle * value, or NULL if option is not specified * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_get_value_string (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - const char *option, char **value); +int +GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option, char **value); /** @@ -258,10 +266,11 @@ int GNUNET_CONFIGURATION_get_value_string (const struct * value, or NULL if option is not specified * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_get_value_filename (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - const char *option, char **value); +int +GNUNET_CONFIGURATION_get_value_filename (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, + const char *option, char **value); /** * Iterate over the set of filenames stored in a configuration value. @@ -273,12 +282,13 @@ int GNUNET_CONFIGURATION_get_value_filename (const struct * @param cb_cls closure for cb * @return number of filenames iterated over, -1 on error */ -int GNUNET_CONFIGURATION_iterate_value_filenames (const struct - GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - const char *option, - GNUNET_FileNameCallback cb, - void *cb_cls); +int +GNUNET_CONFIGURATION_iterate_value_filenames (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, + const char *option, + GNUNET_FileNameCallback cb, + void *cb_cls); /** * Iterate over values of a section in the configuration. @@ -288,11 +298,12 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (const struct * @param iter function to call on each option * @param iter_cls closure for iter */ -void GNUNET_CONFIGURATION_iterate_section_values (const struct - GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - GNUNET_CONFIGURATION_Iterator - iter, void *iter_cls); +void +GNUNET_CONFIGURATION_iterate_section_values (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, + GNUNET_CONFIGURATION_Iterator iter, + void *iter_cls); /** * Get a configuration value that should be in a set of @@ -306,12 +317,11 @@ void GNUNET_CONFIGURATION_iterate_section_values (const struct * or NULL if option is not specified and no default given * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_CONFIGURATION_get_value_choice (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - const char *option, - const char **choices, - const char **value); +int +GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option, const char **choices, + const char **value); /** * Get a configuration value that should be in a set of @@ -322,10 +332,10 @@ int GNUNET_CONFIGURATION_get_value_choice (const struct * @param option option of interest * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR */ -int GNUNET_CONFIGURATION_get_value_yesno (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *section, - const char *option); +int +GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option); /** * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" @@ -336,9 +346,9 @@ int GNUNET_CONFIGURATION_get_value_yesno (const struct * @param orig string to $-expand (will be freed!) * @return $-expanded string */ -char *GNUNET_CONFIGURATION_expand_dollar (const struct - GNUNET_CONFIGURATION_Handle *cfg, - char *orig); +char * +GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle + *cfg, char *orig); /** @@ -349,10 +359,10 @@ char *GNUNET_CONFIGURATION_expand_dollar (const struct * @param option option of interest * @param number value to set */ -void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - const char *option, - unsigned long long number); +void +GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option, + unsigned long long number); /** @@ -363,10 +373,10 @@ void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle * @param option option of interest * @param value value to set */ -void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - const char *option, - const char *value); +void +GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option, + const char *value); /** * Remove a filename from a configuration value that @@ -379,11 +389,11 @@ void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle * @return GNUNET_OK on success, * GNUNET_SYSERR if the filename is not in the list */ -int GNUNET_CONFIGURATION_remove_value_filename (struct - GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - const char *option, - const char *value); +int +GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option, + const char *value); /** * Append a filename to a configuration value that @@ -396,11 +406,11 @@ int GNUNET_CONFIGURATION_remove_value_filename (struct * @return GNUNET_OK on success, * GNUNET_SYSERR if the filename already in the list */ -int GNUNET_CONFIGURATION_append_value_filename (struct - GNUNET_CONFIGURATION_Handle - *cfg, const char *section, - const char *option, - const char *value); +int +GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle + *cfg, const char *section, + const char *option, + const char *value); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index af10c5966..f7a6e5078 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h @@ -111,7 +111,8 @@ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf, * * @param sock the connection to set persistent */ -void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); +void +GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); /** * Disable the "CORK" feature for communication with the given socket, @@ -124,7 +125,8 @@ void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); * @param sock the connection to make flushing and blocking * @return GNUNET_OK on success */ -int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); +int +GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); /** @@ -135,9 +137,8 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); * @param osSocket existing socket to box * @return the boxed socket handle */ -struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct - GNUNET_NETWORK_Handle - *osSocket); +struct GNUNET_CONNECTION_Handle * +GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket); /** @@ -149,10 +150,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct * @param lsock listen socket * @return the socket handle, NULL on error (for example, access refused) */ -struct GNUNET_CONNECTION_Handle - *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, - void *access_cls, - struct GNUNET_NETWORK_Handle *lsock); +struct GNUNET_CONNECTION_Handle * +GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, + void *access_cls, + struct GNUNET_NETWORK_Handle *lsock); /** @@ -165,15 +166,10 @@ struct GNUNET_CONNECTION_Handle * @param port port to connect to * @return the socket handle */ -struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const - struct - GNUNET_CONFIGURATION_Handle - *cfg, - const - char - *hostname, - uint16_t - port); +struct GNUNET_CONNECTION_Handle * +GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle + *cfg, const char *hostname, + uint16_t port); /** @@ -185,11 +181,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const * @param unixpath path to connect to) * @return the socket handle, NULL on systems without UNIX support */ -struct GNUNET_CONNECTION_Handle - *GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - const char *unixpath); +struct GNUNET_CONNECTION_Handle * +GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct + GNUNET_CONFIGURATION_Handle + *cfg, const char *unixpath); @@ -204,14 +199,10 @@ struct GNUNET_CONNECTION_Handle * @param addrlen length of server address * @return the socket handle */ -struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int - af_family, - const - struct - sockaddr - *serv_addr, - socklen_t - addrlen); +struct GNUNET_CONNECTION_Handle * +GNUNET_CONNECTION_create_from_sockaddr (int af_family, + const struct sockaddr *serv_addr, + socklen_t addrlen); /** * Check if socket is valid (no fatal errors have happened so far). @@ -221,7 +212,8 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int * @param sock socket to check * @return GNUNET_YES if valid, GNUNET_NO otherwise */ -int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); +int +GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); /** @@ -232,8 +224,9 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); * @param addrlen where to store the length of the address * @return GNUNET_OK on success */ -int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, - void **addr, size_t * addrlen); +int +GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, + void **addr, size_t * addrlen); /** @@ -249,8 +242,9 @@ int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, * read from the application; all other transmissions should be * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). */ -void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, - int finish_pending_write); +void +GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, + int finish_pending_write); /** @@ -266,10 +260,11 @@ void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, * @param receiver function to call with received data * @param receiver_cls closure for receiver */ -void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, - size_t max, struct GNUNET_TIME_Relative timeout, - GNUNET_CONNECTION_Receiver receiver, - void *receiver_cls); +void +GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max, + struct GNUNET_TIME_Relative timeout, + GNUNET_CONNECTION_Receiver receiver, + void *receiver_cls); /** @@ -280,7 +275,8 @@ void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, * @param sock socket handle * @return closure of the original receiver callback closure */ -void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); +void * +GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); /** @@ -333,13 +329,12 @@ struct GNUNET_CONNECTION_TransmitHandle; * @return non-NULL if the notify callback was queued, * NULL if we are already going to notify someone else (busy) */ -struct GNUNET_CONNECTION_TransmitHandle - *GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle - *sock, size_t size, - struct GNUNET_TIME_Relative - timeout, - GNUNET_CONNECTION_TransmitReadyNotify - notify, void *notify_cls); +struct GNUNET_CONNECTION_TransmitHandle * +GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock, + size_t size, + struct GNUNET_TIME_Relative timeout, + GNUNET_CONNECTION_TransmitReadyNotify + notify, void *notify_cls); /** @@ -348,9 +343,10 @@ struct GNUNET_CONNECTION_TransmitHandle * * @param h handle for notification to cancel */ -void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct - GNUNET_CONNECTION_TransmitHandle - *h); +void +GNUNET_CONNECTION_notify_transmit_ready_cancel (struct + GNUNET_CONNECTION_TransmitHandle + *h); /** @@ -359,8 +355,9 @@ void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct * @param sock socket handle * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default */ -void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, - int do_ignore); +void +GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, + int do_ignore); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index fde31ed34..cad85d016 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h @@ -75,13 +75,9 @@ typedef int (*GNUNET_HashCodeIterator) (void *cls, GNUNET_HashCode * next); * element (number of bits set per element in the set) * @return the bloomfilter */ -struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const - char - *filename, - size_t - size, - unsigned - int k); +struct GNUNET_CONTAINER_BloomFilter * +GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, + unsigned int k); /** @@ -97,13 +93,9 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const * element (number of bits set per element in the set) * @return the bloomfilter */ -struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const - char - *data, - size_t - size, - unsigned - int k); +struct GNUNET_CONTAINER_BloomFilter * +GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size, + unsigned int k); /** @@ -114,9 +106,10 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const * @param size the size of the given data array * @return GNUNET_SYSERR if the data array of the wrong size */ -int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct - GNUNET_CONTAINER_BloomFilter *bf, - char *data, size_t size); +int +GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct + GNUNET_CONTAINER_BloomFilter *bf, + char *data, size_t size); /** @@ -125,8 +118,9 @@ int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct * @param bf the filter * @return GNUNET_YES if the element is in the filter, GNUNET_NO if not */ -int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter - *bf, const GNUNET_HashCode * e); +int +GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter + *bf, const GNUNET_HashCode * e); /** @@ -134,8 +128,9 @@ int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter * @param bf the filter * @param e the element */ -void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, - const GNUNET_HashCode * e); +void +GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, + const GNUNET_HashCode * e); /** @@ -143,8 +138,9 @@ void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, * @param bf the filter * @param e the element to remove */ -void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter - *bf, const GNUNET_HashCode * e); +void +GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, + const GNUNET_HashCode * e); /** @@ -153,10 +149,9 @@ void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter * @param bf the filter * @return copy of bf */ -struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const - struct - GNUNET_CONTAINER_BloomFilter - *bf); +struct GNUNET_CONTAINER_BloomFilter * +GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter + *bf); @@ -166,8 +161,8 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const * free the space on the drive) * @param bf the filter */ -void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter - *bf); +void +GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf); /** @@ -176,17 +171,17 @@ void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter * @param bf the filter * @return number of bytes used for the data of the bloom filter */ -size_t GNUNET_CONTAINER_bloomfilter_get_size (const struct - GNUNET_CONTAINER_BloomFilter - *bf); +size_t +GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter + *bf); /** * Reset a bloom filter to empty. * @param bf the filter */ -void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter - *bf); +void +GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf); /** * Or the entries of the given raw data array with the @@ -199,8 +194,9 @@ void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter * @param size size of data * @return GNUNET_OK on success */ -int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, - const char *data, size_t size); +int +GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, + const char *data, size_t size); /** * Or the entries of the given raw data array with the @@ -212,9 +208,10 @@ int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, * @param to_or the bloomfilter to or-in * @param size number of bytes in data */ -int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, - const struct GNUNET_CONTAINER_BloomFilter - *to_or, size_t size); +int +GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, + const struct GNUNET_CONTAINER_BloomFilter + *to_or, size_t size); /** * Resize a bloom filter. Note that this operation @@ -227,10 +224,11 @@ int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, * @param size the new size for the filter * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element */ -void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter - *bf, GNUNET_HashCodeIterator iterator, - void *iterator_cls, size_t size, - unsigned int k); +void +GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, + GNUNET_HashCodeIterator iterator, + void *iterator_cls, size_t size, + unsigned int k); /* ****************** metadata ******************* */ @@ -244,7 +242,8 @@ struct GNUNET_CONTAINER_MetaData; * * @return empty meta-data container */ -struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void); +struct GNUNET_CONTAINER_MetaData * +GNUNET_CONTAINER_meta_data_create (void); /** * Duplicate a MetaData token. @@ -252,17 +251,17 @@ struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void); * @param md what to duplicate * @return duplicate meta-data container */ -struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const - struct - GNUNET_CONTAINER_MetaData - *md); +struct GNUNET_CONTAINER_MetaData * +GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData + *md); /** * Free meta data. * * @param md what to free */ -void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); +void +GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); /** * Test if two MDs are equal. We consider them equal if @@ -274,10 +273,11 @@ void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); * @param md2 other value to check * @return GNUNET_YES if they are equal */ -int GNUNET_CONTAINER_meta_data_test_equal (const struct - GNUNET_CONTAINER_MetaData *md1, - const struct - GNUNET_CONTAINER_MetaData *md2); +int +GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData + *md1, + const struct GNUNET_CONTAINER_MetaData + *md2); /** @@ -297,12 +297,13 @@ int GNUNET_CONTAINER_meta_data_test_equal (const struct * @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists * data_mime_type and plugin_name are not considered for "exists" checks */ -int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, - const char *plugin_name, - enum EXTRACTOR_MetaType type, - enum EXTRACTOR_MetaFormat format, - const char *data_mime_type, - const char *data, size_t data_len); +int +GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, + const char *plugin_name, + enum EXTRACTOR_MetaType type, + enum EXTRACTOR_MetaFormat format, + const char *data_mime_type, const char *data, + size_t data_len); /** @@ -312,9 +313,9 @@ int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, * @param md metadata to extend * @param in metadata to merge */ -void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, - const struct GNUNET_CONTAINER_MetaData - *in); +void +GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, + const struct GNUNET_CONTAINER_MetaData *in); /** @@ -327,9 +328,10 @@ void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, * @param data_len number of bytes in data * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md */ -int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, - enum EXTRACTOR_MetaType type, - const char *data, size_t data_len); +int +GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, + enum EXTRACTOR_MetaType type, + const char *data, size_t data_len); /** @@ -337,7 +339,8 @@ int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, * * @param md metadata to manipulate */ -void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); +void +GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); /** @@ -346,9 +349,9 @@ void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); * * @param md metadata to modify */ -void GNUNET_CONTAINER_meta_data_add_publication_date (struct - GNUNET_CONTAINER_MetaData - *md); +void +GNUNET_CONTAINER_meta_data_add_publication_date (struct + GNUNET_CONTAINER_MetaData *md); /** @@ -359,9 +362,10 @@ void GNUNET_CONTAINER_meta_data_add_publication_date (struct * @param iter_cls closure for iterator * @return number of entries */ -int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData - *md, EXTRACTOR_MetaDataProcessor iter, - void *iter_cls); +int +GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, + EXTRACTOR_MetaDataProcessor iter, + void *iter_cls); /** * Get the first MD entry of the given type. Caller @@ -373,9 +377,9 @@ int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData * @param type type to look for * @return NULL if no entry was found */ -char *GNUNET_CONTAINER_meta_data_get_by_type (const struct - GNUNET_CONTAINER_MetaData *md, - enum EXTRACTOR_MetaType type); +char * +GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData + *md, enum EXTRACTOR_MetaType type); /** @@ -389,9 +393,10 @@ char *GNUNET_CONTAINER_meta_data_get_by_type (const struct * @return NULL if we do not have any such entry, * otherwise client is responsible for freeing the value! */ -char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct - GNUNET_CONTAINER_MetaData - *md, ...); +char * +GNUNET_CONTAINER_meta_data_get_first_by_types (const struct + GNUNET_CONTAINER_MetaData *md, + ...); /** * Get a thumbnail from the meta-data (if present). Only matches meta @@ -402,9 +407,9 @@ char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct * freed by the caller! * @return number of bytes in thumbnail, 0 if not available */ -size_t GNUNET_CONTAINER_meta_data_get_thumbnail (const struct - GNUNET_CONTAINER_MetaData *md, - unsigned char **thumb); +size_t +GNUNET_CONTAINER_meta_data_get_thumbnail (const struct GNUNET_CONTAINER_MetaData + *md, unsigned char **thumb); @@ -445,7 +450,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions * -1 on error (typically: not enough * space) */ -ssize_t +ssize_t GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData *md, char **target, size_t max, enum @@ -459,7 +464,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData * @param md metadata to inspect * @return number of bytes needed for serialization, -1 on error */ -ssize_t +ssize_t GNUNET_CONTAINER_meta_data_get_serialized_size (const struct GNUNET_CONTAINER_MetaData *md); @@ -472,11 +477,8 @@ GNUNET_CONTAINER_meta_data_get_serialized_size (const struct * @return MD on success, NULL on error (i.e. * bad format) */ -struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_deserialize (const - char - *input, - size_t - size); +struct GNUNET_CONTAINER_MetaData * +GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size); /* ******************************* HashMap **************************** */ @@ -541,8 +543,8 @@ typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls, * @param len initial size (map will grow as needed) * @return NULL on error */ -struct GNUNET_CONTAINER_MultiHashMap - *GNUNET_CONTAINER_multihashmap_create (unsigned int len); +struct GNUNET_CONTAINER_MultiHashMap * +GNUNET_CONTAINER_multihashmap_create (unsigned int len); /** @@ -551,8 +553,9 @@ struct GNUNET_CONTAINER_MultiHashMap * * @param map the map */ -void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap - *map); +void +GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap + *map); /** @@ -565,9 +568,9 @@ void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap * happen to be NULL; use "contains" to test for * key-value pairs with value NULL */ -void *GNUNET_CONTAINER_multihashmap_get (const struct - GNUNET_CONTAINER_MultiHashMap *map, - const GNUNET_HashCode * key); +void * +GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap + *map, const GNUNET_HashCode * key); /** @@ -581,9 +584,9 @@ void *GNUNET_CONTAINER_multihashmap_get (const struct * @return GNUNET_YES on success, GNUNET_NO if the key-value pair * is not in the map */ -int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap - *map, const GNUNET_HashCode * key, - void *value); +int +GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, + const GNUNET_HashCode * key, void *value); /** * Remove all entries for the given key from the map. @@ -593,10 +596,9 @@ int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap * @param key identifies values to be removed * @return number of values removed */ -int GNUNET_CONTAINER_multihashmap_remove_all (struct - GNUNET_CONTAINER_MultiHashMap - *map, - const GNUNET_HashCode * key); +int +GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap + *map, const GNUNET_HashCode * key); /** @@ -608,9 +610,10 @@ int GNUNET_CONTAINER_multihashmap_remove_all (struct * @return GNUNET_YES if such a value exists, * GNUNET_NO if not */ -int GNUNET_CONTAINER_multihashmap_contains (const struct - GNUNET_CONTAINER_MultiHashMap *map, - const GNUNET_HashCode * key); +int +GNUNET_CONTAINER_multihashmap_contains (const struct + GNUNET_CONTAINER_MultiHashMap *map, + const GNUNET_HashCode * key); /** @@ -623,11 +626,11 @@ int GNUNET_CONTAINER_multihashmap_contains (const struct * @return GNUNET_YES if such a value exists, * GNUNET_NO if not */ -int GNUNET_CONTAINER_multihashmap_contains_value (const struct - GNUNET_CONTAINER_MultiHashMap - *map, - const GNUNET_HashCode * key, - const void *value); +int +GNUNET_CONTAINER_multihashmap_contains_value (const struct + GNUNET_CONTAINER_MultiHashMap + *map, const GNUNET_HashCode * key, + const void *value); /** @@ -642,11 +645,11 @@ int GNUNET_CONTAINER_multihashmap_contains_value (const struct * GNUNET_SYSERR if UNIQUE_ONLY was the option and the * value already exists */ -int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap - *map, const GNUNET_HashCode * key, - void *value, - enum GNUNET_CONTAINER_MultiHashMapOption - opt); +int +GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map, + const GNUNET_HashCode * key, void *value, + enum GNUNET_CONTAINER_MultiHashMapOption + opt); /** * Get the number of key-value pairs in the map. @@ -654,9 +657,9 @@ int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap * @param map the map * @return the number of key value pairs */ -unsigned int GNUNET_CONTAINER_multihashmap_size (const struct - GNUNET_CONTAINER_MultiHashMap - *map); +unsigned int +GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap + *map); /** @@ -668,10 +671,11 @@ unsigned int GNUNET_CONTAINER_multihashmap_size (const struct * @return the number of key value pairs processed, * GNUNET_SYSERR if it aborted iteration */ -int GNUNET_CONTAINER_multihashmap_iterate (const struct - GNUNET_CONTAINER_MultiHashMap *map, - GNUNET_CONTAINER_HashMapIterator it, - void *it_cls); +int +GNUNET_CONTAINER_multihashmap_iterate (const struct + GNUNET_CONTAINER_MultiHashMap *map, + GNUNET_CONTAINER_HashMapIterator it, + void *it_cls); /** @@ -684,12 +688,12 @@ int GNUNET_CONTAINER_multihashmap_iterate (const struct * @return the number of key value pairs processed, * GNUNET_SYSERR if it aborted iteration */ -int GNUNET_CONTAINER_multihashmap_get_multiple (const struct - GNUNET_CONTAINER_MultiHashMap - *map, - const GNUNET_HashCode * key, - GNUNET_CONTAINER_HashMapIterator - it, void *it_cls); +int +GNUNET_CONTAINER_multihashmap_get_multiple (const struct + GNUNET_CONTAINER_MultiHashMap *map, + const GNUNET_HashCode * key, + GNUNET_CONTAINER_HashMapIterator it, + void *it_cls); /* ******************** doubly-linked list *************** */ @@ -864,9 +868,8 @@ struct GNUNET_CONTAINER_HeapNode; * @param order how should the heap be sorted? * @return handle to the heap */ -struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum - GNUNET_CONTAINER_HeapOrder - order); +struct GNUNET_CONTAINER_Heap * +GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order); /** @@ -875,7 +878,8 @@ struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum * * @param heap heap to destroy */ -void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); +void +GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); /** @@ -884,7 +888,8 @@ void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); * @param heap heap to inspect * @return NULL if heap is empty */ -void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); +void * +GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); /** @@ -893,8 +898,8 @@ void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); * @param heap the heap to get the size of * @return number of elements stored */ -unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap - *heap); +unsigned int +GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); /** @@ -903,9 +908,9 @@ unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap * @param node the node to get the cost of * @return cost of the node */ -GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost (const struct - GNUNET_CONTAINER_HeapNode - *node); +GNUNET_CONTAINER_HeapCostType +GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode + *node); /** * Iterator for heap @@ -931,9 +936,10 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) (void *cls, * @param iterator function to call on each entry * @param iterator_cls closure for iterator */ -void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, - GNUNET_CONTAINER_HeapIterator iterator, - void *iterator_cls); +void +GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, + GNUNET_CONTAINER_HeapIterator iterator, + void *iterator_cls); /** @@ -948,8 +954,9 @@ void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, * NULL if the heap is empty. * */ -void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, - uint32_t max); +void * +GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, + uint32_t max); /** @@ -963,7 +970,8 @@ void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, * @return data stored at the next random node in the walk; * NULL if the tree is empty. */ -void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); +void * +GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); /** @@ -974,12 +982,9 @@ void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); * @param cost cost for the element * @return node for the new element */ -struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct - GNUNET_CONTAINER_Heap - *heap, - void *element, - GNUNET_CONTAINER_HeapCostType - cost); +struct GNUNET_CONTAINER_HeapNode * +GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void *element, + GNUNET_CONTAINER_HeapCostType cost); /** @@ -988,7 +993,8 @@ struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct * @param heap heap to modify * @return element data stored at the root node */ -void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); +void * +GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); /** @@ -997,8 +1003,8 @@ void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); * @param node node to remove * @return element data stored at the node, NULL if heap is empty */ -void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode - *node); +void * +GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node); /** @@ -1008,9 +1014,10 @@ void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode * @param node node for which the cost is to be changed * @param new_cost new cost for the node */ -void GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, - struct GNUNET_CONTAINER_HeapNode *node, - GNUNET_CONTAINER_HeapCostType new_cost); +void +GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, + struct GNUNET_CONTAINER_HeapNode *node, + GNUNET_CONTAINER_HeapCostType new_cost); /* ******************** Singly linked list *************** */ @@ -1057,9 +1064,10 @@ struct GNUNET_CONTAINER_SList_Iterator; * @param buf payload buffer * @param len length of the buffer */ -void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, - enum GNUNET_CONTAINER_SListDisposition disp, - const void *buf, size_t len); +void +GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, + enum GNUNET_CONTAINER_SListDisposition disp, + const void *buf, size_t len); /** @@ -1069,9 +1077,10 @@ void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, * @param buf payload buffer * @param len length of the buffer */ -void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, - enum GNUNET_CONTAINER_SListDisposition - disp, const void *buf, size_t len); +void +GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, + enum GNUNET_CONTAINER_SListDisposition disp, + const void *buf, size_t len); /** @@ -1079,22 +1088,25 @@ void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, * @param dst list to append to * @param src source */ -void GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, - struct GNUNET_CONTAINER_SList *src); +void +GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, + struct GNUNET_CONTAINER_SList *src); /** * Create a new singly linked list * @return the new list */ -struct GNUNET_CONTAINER_SList *GNUNET_CONTAINER_slist_create (void); +struct GNUNET_CONTAINER_SList * +GNUNET_CONTAINER_slist_create (void); /** * Destroy a singly linked list * @param l the list to be destroyed */ -void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); +void +GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); /** @@ -1103,9 +1115,8 @@ void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); * @param l list * @return iterator pointing to the beginning, free using "GNUNET_free" */ -struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct - GNUNET_CONTAINER_SList - *l); +struct GNUNET_CONTAINER_SList_Iterator * +GNUNET_CONTAINER_slist_begin (struct GNUNET_CONTAINER_SList *l); /** @@ -1113,7 +1124,8 @@ struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct * * @param l list */ -void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); +void +GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); /** @@ -1122,8 +1134,9 @@ void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); * @param buf payload buffer to find * @param len length of the payload (number of bytes in buf) */ -int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, - const void *buf, size_t len); +int +GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, + const void *buf, size_t len); /** @@ -1131,14 +1144,16 @@ int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, * @param l list * @return number of elements in the list */ -int GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l); +int +GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l); /** * Remove an element from the list * @param i iterator that points to the element to be removed */ -void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); +void +GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); /** @@ -1148,10 +1163,10 @@ void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); * @param buf payload buffer * @param len length of the payload */ -void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator - *before, - enum GNUNET_CONTAINER_SListDisposition disp, - const void *buf, size_t len); +void +GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator *before, + enum GNUNET_CONTAINER_SListDisposition disp, + const void *buf, size_t len); /** @@ -1159,7 +1174,8 @@ void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator * @param i iterator * @return GNUNET_YES on success, GNUNET_NO if the end has been reached */ -int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); +int +GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); /** @@ -1168,7 +1184,8 @@ int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); * @return GNUNET_YES if the end has been reached, GNUNET_NO if the iterator * points to a valid element */ -int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); +int +GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); /** @@ -1178,16 +1195,17 @@ int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); * @param len set to the payload length * @return payload */ -void *GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator - *i, size_t * len); +void * +GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, + size_t * len); /** * Release an iterator * @param i iterator */ -void GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator - *i); +void +GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator *i); #if 0 /* keep Emacsens' auto-indent happy */ 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, * @return handle to the core service (only useful for disconnect until 'init' is called), * NULL on error (in this case, init is never called) */ -struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct - GNUNET_CONFIGURATION_Handle - *cfg, unsigned int queue_size, - void *cls, - GNUNET_CORE_StartupCallback - init, - GNUNET_CORE_ConnectEventHandler - connects, - GNUNET_CORE_DisconnectEventHandler - disconnects, - GNUNET_CORE_PeerStatusEventHandler - status_events, - GNUNET_CORE_MessageCallback - inbound_notify, - int inbound_hdr_only, - GNUNET_CORE_MessageCallback - outbound_notify, - int outbound_hdr_only, - const struct - GNUNET_CORE_MessageHandler - *handlers); +struct GNUNET_CORE_Handle * +GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, + unsigned int queue_size, void *cls, + GNUNET_CORE_StartupCallback init, + GNUNET_CORE_ConnectEventHandler connects, + GNUNET_CORE_DisconnectEventHandler disconnects, + GNUNET_CORE_PeerStatusEventHandler status_events, + GNUNET_CORE_MessageCallback inbound_notify, + int inbound_hdr_only, + GNUNET_CORE_MessageCallback outbound_notify, + int outbound_hdr_only, + const struct GNUNET_CORE_MessageHandler *handlers); /** @@ -249,7 +240,8 @@ struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct * * @param handle connection to core to disconnect */ -void GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); +void +GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); /** @@ -290,17 +282,11 @@ typedef void (*GNUNET_CORE_ControlContinuation) (void *cls, int success); * @param cont_cls closure for cont * @return NULL on error (cont will not be called), otherwise handle for cancellation */ -struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct - GNUNET_CORE_Handle - *h, - const - struct - GNUNET_PeerIdentity - *peer, - GNUNET_CORE_ControlContinuation - cont, - void - *cont_cls); +struct GNUNET_CORE_PeerRequestHandle * +GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, + const struct GNUNET_PeerIdentity *peer, + GNUNET_CORE_ControlContinuation cont, + void *cont_cls); /** @@ -309,9 +295,9 @@ struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct * * @param req request handle that was returned for the original request */ -void GNUNET_CORE_peer_request_connect_cancel (struct - GNUNET_CORE_PeerRequestHandle - *req); +void +GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle + *req); /** @@ -372,15 +358,14 @@ struct GNUNET_CORE_InformationRequestContext; * @param info_cls closure for info * @return NULL on error */ -struct GNUNET_CORE_InformationRequestContext - *GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, - const struct GNUNET_PeerIdentity *peer, - struct GNUNET_TIME_Relative timeout, - struct GNUNET_BANDWIDTH_Value32NBO - bw_out, int32_t amount, - uint64_t preference, - GNUNET_CORE_PeerConfigurationInfoCallback - info, void *info_cls); +struct GNUNET_CORE_InformationRequestContext * +GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, + const struct GNUNET_PeerIdentity *peer, + struct GNUNET_TIME_Relative timeout, + struct GNUNET_BANDWIDTH_Value32NBO bw_out, + int32_t amount, uint64_t preference, + GNUNET_CORE_PeerConfigurationInfoCallback + info, void *info_cls); /** @@ -394,9 +379,10 @@ struct GNUNET_CORE_InformationRequestContext * * @param irc context returned by the original GNUNET_CORE_peer_get_info call */ -void GNUNET_CORE_peer_change_preference_cancel (struct - GNUNET_CORE_InformationRequestContext - *irc); +void +GNUNET_CORE_peer_change_preference_cancel (struct + GNUNET_CORE_InformationRequestContext + *irc); /** @@ -407,9 +393,10 @@ void GNUNET_CORE_peer_change_preference_cancel (struct * @param cb_cls closure for peer_cb * @return GNUNET_OK on success, GNUNET_SYSERR on errors */ -int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_CORE_ConnectEventHandler peer_cb, - void *cb_cls); +int +GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_CORE_ConnectEventHandler peer_cb, + void *cb_cls); /** * Iterate over all currently connected peers. @@ -424,10 +411,11 @@ int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @return GNUNET_OK if iterating, GNUNET_SYSERR on error */ -int GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle - *cfg, struct GNUNET_PeerIdentity *peer, - GNUNET_CORE_ConnectEventHandler peer_cb, - void *cb_cls); +int +GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_PeerIdentity *peer, + GNUNET_CORE_ConnectEventHandler peer_cb, + void *cb_cls); /** @@ -464,25 +452,14 @@ struct GNUNET_CORE_TransmitHandle; * NULL if we can not even queue the request (insufficient * memory); if NULL is returned, "notify" will NOT be called. */ -struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct - GNUNET_CORE_Handle - *handle, - int cork, - uint32_t - priority, - struct - GNUNET_TIME_Relative - maxdelay, - const - struct - GNUNET_PeerIdentity - *target, - size_t - notify_size, - GNUNET_CONNECTION_TransmitReadyNotify - notify, - void - *notify_cls); +struct GNUNET_CORE_TransmitHandle * +GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, + uint32_t priority, + struct GNUNET_TIME_Relative maxdelay, + const struct GNUNET_PeerIdentity *target, + size_t notify_size, + GNUNET_CONNECTION_TransmitReadyNotify notify, + void *notify_cls); /** @@ -490,8 +467,9 @@ struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct * * @param th handle that was returned by "notify_transmit_ready". */ -void GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle - *th); +void +GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle + *th); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 30a7d9ee0..d5a1685d1 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -231,7 +231,8 @@ struct GNUNET_CRYPTO_AuthKey * @param len the length of the buffer in bytes * @return the resulting CRC32 checksum */ -int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); +int32_t +GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); /** @@ -241,7 +242,8 @@ int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); * @param i the upper limit (exclusive) for the random number * @return a random value in the interval [0,i) (exclusive). */ -uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); +uint32_t +GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); /** @@ -251,8 +253,8 @@ uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); * @param max value returned will be in range [0,max) (exclusive) * @return random 64-bit number */ -uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, - uint64_t max); +uint64_t +GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max); /** @@ -262,8 +264,8 @@ uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, * @param n the size of the array * @return the permutation array (allocated from heap) */ -unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, - unsigned int n); +unsigned int * +GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n); /** @@ -271,8 +273,8 @@ unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, * * @param key key to initialize */ -void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey - *key); +void +GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key); /** * Check that a new session key is well-formed. @@ -280,8 +282,9 @@ void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey * @param key key to check * @return GNUNET_OK if the key is valid */ -int GNUNET_CRYPTO_aes_check_session_key (const struct - GNUNET_CRYPTO_AesSessionKey *key); +int +GNUNET_CRYPTO_aes_check_session_key (const struct GNUNET_CRYPTO_AesSessionKey + *key); /** @@ -295,12 +298,11 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct * for streams. * @return the size of the encrypted block, -1 for errors */ -ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, - const struct GNUNET_CRYPTO_AesSessionKey - *sessionkey, - const struct - GNUNET_CRYPTO_AesInitializationVector *iv, - void *result); +ssize_t +GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, + const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, + const struct GNUNET_CRYPTO_AesInitializationVector + *iv, void *result); /** @@ -313,12 +315,11 @@ ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, * @param result address to store the result at * @return -1 on failure, size of decrypted block on success */ -ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, - const struct GNUNET_CRYPTO_AesSessionKey - *sessionkey, - const struct - GNUNET_CRYPTO_AesInitializationVector *iv, - void *result); +ssize_t +GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, + const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, + const struct GNUNET_CRYPTO_AesInitializationVector + *iv, void *result); /** @@ -329,11 +330,10 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, * @param salt_len size of the salt * @param ... pairs of void * & size_t for context chunks, terminated by NULL */ -void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector - *iv, - const struct GNUNET_CRYPTO_AesSessionKey - *skey, const void *salt, size_t salt_len, - ...); +void +GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, + const struct GNUNET_CRYPTO_AesSessionKey *skey, + const void *salt, size_t salt_len, ...); /** @@ -344,11 +344,10 @@ void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector * @param salt_len size of the salt * @param argp pairs of void * & size_t for context chunks, terminated by NULL */ -void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector - *iv, - const struct GNUNET_CRYPTO_AesSessionKey - *skey, const void *salt, size_t salt_len, - va_list argp); +void +GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv, + const struct GNUNET_CRYPTO_AesSessionKey *skey, + const void *salt, size_t salt_len, va_list argp); /** @@ -357,8 +356,9 @@ void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be * safely cast to char*, a '\\0' termination is set). */ -void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, - struct GNUNET_CRYPTO_HashAsciiEncoded *result); +void +GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, + struct GNUNET_CRYPTO_HashAsciiEncoded *result); /** @@ -367,7 +367,8 @@ void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, * @param result where to store the GNUNET_CRYPTO_hash code * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding */ -int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); +int +GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); /** @@ -381,8 +382,9 @@ int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); * @param b some hash code * @return number between 0 and UINT32_MAX */ -uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, - const GNUNET_HashCode * b); +uint32_t +GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, + const GNUNET_HashCode * b); /** @@ -392,7 +394,8 @@ uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, * @param size size of the block * @param ret pointer to where to write the hashcode */ -void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); +void +GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); /** @@ -403,9 +406,10 @@ void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); * @param plaintext_len length of plaintext * @param hmac where to store the hmac */ -void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, - const void *plaintext, size_t plaintext_len, - GNUNET_HashCode * hmac); +void +GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, + const void *plaintext, size_t plaintext_len, + GNUNET_HashCode * hmac); /** @@ -435,16 +439,11 @@ struct GNUNET_CRYPTO_FileHashContext; * @param callback_cls closure for callback * @return NULL on (immediate) errror */ -struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum - GNUNET_SCHEDULER_Priority - priority, - const char - *filename, - size_t blocksize, - GNUNET_CRYPTO_HashCompletedCallback - callback, - void - *callback_cls); +struct GNUNET_CRYPTO_FileHashContext * +GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, + const char *filename, size_t blocksize, + GNUNET_CRYPTO_HashCompletedCallback callback, + void *callback_cls); /** @@ -452,7 +451,8 @@ struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum * * @param fhc operation to cancel (callback must not yet have been invoked) */ -void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); +void +GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); /** @@ -461,8 +461,9 @@ void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); * @param mode desired quality level * @param result hash code that is randomized */ -void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, - GNUNET_HashCode * result); +void +GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, + GNUNET_HashCode * result); /** @@ -472,9 +473,10 @@ void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, * @param b some hash code * @param result set to b - a */ -void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, - const GNUNET_HashCode * b, - GNUNET_HashCode * result); +void +GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, + const GNUNET_HashCode * b, + GNUNET_HashCode * result); /** @@ -484,9 +486,10 @@ void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, * @param delta some hash code * @param result set to a + delta */ -void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, - const GNUNET_HashCode * delta, - GNUNET_HashCode * result); +void +GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, + const GNUNET_HashCode * delta, + GNUNET_HashCode * result); /** @@ -496,9 +499,9 @@ void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, * @param b some hash code * @param result set to a ^ b */ -void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, - const GNUNET_HashCode * b, - GNUNET_HashCode * result); +void +GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b, + GNUNET_HashCode * result); /** @@ -508,10 +511,11 @@ void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, * @param skey set to a valid session key * @param iv set to a valid initialization vector */ -void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, - struct GNUNET_CRYPTO_AesSessionKey *skey, - struct GNUNET_CRYPTO_AesInitializationVector - *iv); +void +GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, + struct GNUNET_CRYPTO_AesSessionKey *skey, + struct GNUNET_CRYPTO_AesInitializationVector + *iv); /** @@ -521,7 +525,8 @@ void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, * @param bit index into the hashcode, [0...159] * @return Bit \a bit from hashcode \a code, -1 for invalid index */ -int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); +int +GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); /** * Determine how many low order bits match in two @@ -535,8 +540,9 @@ int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); * * @return the number of bits that match */ -unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, - const GNUNET_HashCode * second); +unsigned int +GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, + const GNUNET_HashCode * second); /** @@ -547,8 +553,8 @@ unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, * @param h2 some hash code * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. */ -int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, - const GNUNET_HashCode * h2); +int +GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2); /** @@ -560,9 +566,10 @@ int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, * @param target some hash code * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. */ -int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, - const GNUNET_HashCode * h2, - const GNUNET_HashCode * target); +int +GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, + const GNUNET_HashCode * h2, + const GNUNET_HashCode * target); /** @@ -573,10 +580,11 @@ int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, * @param salt_len size of the salt * @param argp pair of void * & size_t for context chunks, terminated by NULL */ -void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, - const struct GNUNET_CRYPTO_AesSessionKey - *rkey, const void *salt, size_t salt_len, - va_list argp); +void +GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, + const struct GNUNET_CRYPTO_AesSessionKey *rkey, + const void *salt, size_t salt_len, + va_list argp); /** @@ -587,10 +595,10 @@ void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, * @param salt_len size of the salt * @param ... pair of void * & size_t for context chunks, terminated by NULL */ -void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, - const struct GNUNET_CRYPTO_AesSessionKey - *rkey, const void *salt, size_t salt_len, - ...); +void +GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, + const struct GNUNET_CRYPTO_AesSessionKey *rkey, + const void *salt, size_t salt_len, ...); /** * @brief Derive key @@ -604,9 +612,10 @@ void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, * @param skm_len length of skm * @return GNUNET_YES on success */ -int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, - int prf_algo, const void *xts, size_t xts_len, - const void *skm, size_t skm_len, ...); +int +GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo, + const void *xts, size_t xts_len, const void *skm, + size_t skm_len, ...); /** @@ -622,9 +631,10 @@ int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, * @param argp va_list of void * & size_t pairs for context chunks * @return GNUNET_YES on success */ -int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, - int prf_algo, const void *xts, size_t xts_len, - const void *skm, size_t skm_len, va_list argp); +int +GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, + const void *xts, size_t xts_len, const void *skm, + size_t skm_len, va_list argp); /** @@ -638,9 +648,10 @@ int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, * @param argp va_list of void * & size_t pairs for context chunks * @return GNUNET_YES on success */ -int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, - size_t xts_len, const void *skm, size_t skm_len, - va_list argp); +int +GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, + size_t xts_len, const void *skm, size_t skm_len, + va_list argp); /** @@ -654,8 +665,9 @@ int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, * @param ... void * & size_t pairs for context chunks * @return GNUNET_YES on success */ -int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, - size_t xts_len, const void *skm, size_t skm_len, ...); +int +GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, + size_t xts_len, const void *skm, size_t skm_len, ...); /** @@ -663,7 +675,8 @@ int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, * * @return fresh private key */ -struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void); +struct GNUNET_CRYPTO_RsaPrivateKey * +GNUNET_CRYPTO_rsa_key_create (void); /** * Decode the private key from the data-format back @@ -672,9 +685,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void); * @param buf the buffer where the private key data is stored * @param len the length of the data in 'buffer' */ -struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char - *buf, - uint16_t len); +struct GNUNET_CRYPTO_RsaPrivateKey * +GNUNET_CRYPTO_rsa_decode_key (const char *buf, uint16_t len); /** * Create a new private key by reading it from a file. If the @@ -690,8 +702,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char * @return new private key, NULL on error (for example, * permission denied) */ -struct GNUNET_CRYPTO_RsaPrivateKey - *GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); +struct GNUNET_CRYPTO_RsaPrivateKey * +GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); /** @@ -701,15 +713,16 @@ struct GNUNET_CRYPTO_RsaPrivateKey * @param hc "random" input to PRNG * @return some private key purely dependent on input */ -struct GNUNET_CRYPTO_RsaPrivateKey - *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); +struct GNUNET_CRYPTO_RsaPrivateKey * +GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); /** * Free memory occupied by the private key. * @param hostkey pointer to the memory to free */ -void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); +void +GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); /** @@ -718,11 +731,11 @@ void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); * @param priv the private key * @param pub where to write the public key */ -void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey - *priv, - struct - GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded - *pub); +void +GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey + *priv, + struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + *pub); /** @@ -735,11 +748,11 @@ void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey * @param target where to store the encrypted block * @return GNUNET_SYSERR on error, GNUNET_OK if ok */ -int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, - const struct - GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded - *publicKey, - struct GNUNET_CRYPTO_RsaEncryptedData *target); +int +GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + *publicKey, + struct GNUNET_CRYPTO_RsaEncryptedData *target); /** @@ -751,10 +764,10 @@ int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, * @param max how many bytes of a result are expected? Must be exact. * @return the size of the decrypted block (that is, size) or -1 on error */ -ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey - *key, - const struct GNUNET_CRYPTO_RsaEncryptedData - *block, void *result, size_t max); +ssize_t +GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key, + const struct GNUNET_CRYPTO_RsaEncryptedData *block, + void *result, size_t max); /** @@ -765,9 +778,10 @@ ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey * @param sig where to write the signature * @return GNUNET_SYSERR on error, GNUNET_OK on success */ -int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, - const struct GNUNET_CRYPTO_RsaSignaturePurpose - *purpose, struct GNUNET_CRYPTO_RsaSignature *sig); +int +GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, + const struct GNUNET_CRYPTO_RsaSignaturePurpose *purpose, + struct GNUNET_CRYPTO_RsaSignature *sig); /** @@ -780,13 +794,13 @@ int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, * @param publicKey public key of the signer * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid */ -int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, - const struct GNUNET_CRYPTO_RsaSignaturePurpose - *validate, - const struct GNUNET_CRYPTO_RsaSignature *sig, - const struct - GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded - *publicKey); +int +GNUNET_CRYPTO_rsa_verify (uint32_t purpose, + const struct GNUNET_CRYPTO_RsaSignaturePurpose + *validate, + const struct GNUNET_CRYPTO_RsaSignature *sig, + const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + *publicKey); @@ -795,7 +809,8 @@ int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, * where strong entropy gathering is not desired * (for example, for hostkey generation). */ -void GNUNET_CRYPTO_random_disable_entropy_gathering (void); +void +GNUNET_CRYPTO_random_disable_entropy_gathering (void); #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index 46d22d5ec..84cb4d600 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h @@ -56,10 +56,9 @@ struct GNUNET_DATACACHE_Handle; * @param section section in the configuration that contains our options * @return handle to use to access the service */ -struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - const char *section); +struct GNUNET_DATACACHE_Handle * +GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *section); /** @@ -67,7 +66,8 @@ struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct * * @param h handle to the datastore */ -void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); +void +GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); /** @@ -99,10 +99,11 @@ typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, * @param discard_time when to discard the value in any case * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) */ -int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, - const GNUNET_HashCode * key, size_t size, - const char *data, enum GNUNET_BLOCK_Type type, - struct GNUNET_TIME_Absolute discard_time); +int +GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, + const GNUNET_HashCode * key, size_t size, + const char *data, enum GNUNET_BLOCK_Type type, + struct GNUNET_TIME_Absolute discard_time); /** @@ -116,11 +117,10 @@ int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, * @param iter_cls closure for iter * @return the number of results found */ -unsigned int GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, - const GNUNET_HashCode * key, - enum GNUNET_BLOCK_Type type, - GNUNET_DATACACHE_Iterator iter, - void *iter_cls); +unsigned int +GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, + const GNUNET_HashCode * key, enum GNUNET_BLOCK_Type type, + GNUNET_DATACACHE_Iterator iter, void *iter_cls); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 584537f39..3d2cc35c9 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h @@ -63,9 +63,8 @@ struct GNUNET_DATASTORE_Handle; * @param cfg configuration to use * @return handle to use to access the service */ -struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_DATASTORE_Handle * +GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -75,7 +74,8 @@ struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct * @param h handle to the datastore * @param drop set to GNUNET_YES to delete all data in datastore (!) */ -void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); +void +GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); /** @@ -112,21 +112,13 @@ typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, * cancel; note that even if NULL is returned, the callback will be invoked * (or rather, will already have been invoked) */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct - GNUNET_DATASTORE_Handle - *h, - uint64_t amount, - uint32_t entries, - unsigned int - queue_priority, - unsigned int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_ContinuationWithStatus - cont, - void *cont_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount, + uint32_t entries, unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_ContinuationWithStatus cont, + void *cont_cls); /** @@ -155,29 +147,17 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct * cancel; note that even if NULL is returned, the callback will be invoked * (or rather, will already have been invoked) */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct - GNUNET_DATASTORE_Handle - *h, uint32_t rid, - const GNUNET_HashCode - * key, size_t size, - const void *data, - enum GNUNET_BLOCK_Type - type, - uint32_t priority, - uint32_t anonymity, - uint32_t replication, - struct - GNUNET_TIME_Absolute - expiration, - unsigned int - queue_priority, - unsigned int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_ContinuationWithStatus - cont, void *cont_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, + const GNUNET_HashCode * key, size_t size, + const void *data, enum GNUNET_BLOCK_Type type, + uint32_t priority, uint32_t anonymity, + uint32_t replication, + struct GNUNET_TIME_Absolute expiration, + unsigned int queue_priority, unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_ContinuationWithStatus cont, + void *cont_cls); /** @@ -201,24 +181,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct * cancel; note that even if NULL is returned, the callback will be invoked * (or rather, will already have been invoked) */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct - GNUNET_DATASTORE_Handle - *h, - uint32_t - rid, - unsigned - int - queue_priority, - unsigned - int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_ContinuationWithStatus - cont, - void - *cont_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, + uint32_t rid, unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_ContinuationWithStatus cont, + void *cont_cls); /** @@ -238,23 +207,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct * cancel; note that even if NULL is returned, the callback will be invoked * (or rather, will already have been invoked) */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct - GNUNET_DATASTORE_Handle - *h, uint64_t uid, - uint32_t priority, - struct - GNUNET_TIME_Absolute - expiration, - unsigned int - queue_priority, - unsigned int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_ContinuationWithStatus - cont, - void *cont_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid, + uint32_t priority, + struct GNUNET_TIME_Absolute expiration, + unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_ContinuationWithStatus cont, + void *cont_cls); /** @@ -278,23 +239,14 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct * cancel; note that even if NULL is returned, the callback will be invoked * (or rather, will already have been invoked) */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_remove (struct - GNUNET_DATASTORE_Handle - *h, - const - GNUNET_HashCode * - key, size_t size, - const void *data, - unsigned int - queue_priority, - unsigned int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_ContinuationWithStatus - cont, - void *cont_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, + const GNUNET_HashCode * key, size_t size, + const void *data, unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_ContinuationWithStatus cont, + void *cont_cls); /** @@ -342,26 +294,14 @@ typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, * @return NULL if the entry was not queued, otherwise a handle that can be used to * cancel */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct - GNUNET_DATASTORE_Handle - *h, - uint64_t offset, - const - GNUNET_HashCode * - key, - enum - GNUNET_BLOCK_Type - type, - unsigned int - queue_priority, - unsigned int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_DatumProcessor - proc, - void *proc_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset, + const GNUNET_HashCode * key, + enum GNUNET_BLOCK_Type type, + unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls); /** @@ -388,27 +328,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct * @return NULL if the entry was not queued, otherwise a handle that can be used to * cancel */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct - GNUNET_DATASTORE_Handle - *h, - uint64_t - offset, - unsigned - int - queue_priority, - unsigned - int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - enum - GNUNET_BLOCK_Type - type, - GNUNET_DATASTORE_DatumProcessor - proc, - void - *proc_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, + uint64_t offset, + unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + enum GNUNET_BLOCK_Type type, + GNUNET_DATASTORE_DatumProcessor proc, + void *proc_cls); /** @@ -430,22 +358,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct * @return NULL if the entry was not queued, otherwise a handle that can be used to * cancel */ -struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct - GNUNET_DATASTORE_Handle - *h, - unsigned - int - queue_priority, - unsigned - int - max_queue_size, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DATASTORE_DatumProcessor - proc, - void - *proc_cls); +struct GNUNET_DATASTORE_QueueEntry * +GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, + unsigned int queue_priority, + unsigned int max_queue_size, + struct GNUNET_TIME_Relative timeout, + GNUNET_DATASTORE_DatumProcessor proc, + void *proc_cls); @@ -455,7 +374,8 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct * * @param qe operation to cancel */ -void GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); +void +GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 46929c366..55038d99a 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h @@ -123,9 +123,9 @@ enum GNUNET_DHT_RouteOption * processing multiple GET/FIND requests in parallel * @return NULL on error */ -struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct - GNUNET_CONFIGURATION_Handle *cfg, - unsigned int ht_len); +struct GNUNET_DHT_Handle * +GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, + unsigned int ht_len); /** @@ -133,7 +133,8 @@ struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct * * @param handle connection to shut down */ -void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); +void +GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); /* *************** Standard API: get and put ******************* */ @@ -154,14 +155,14 @@ void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); * @param cont continuation to call when done (transmitting request to service) * @param cont_cls closure for cont */ -void GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, - const GNUNET_HashCode * key, - uint32_t desired_replication_level, - enum GNUNET_DHT_RouteOption options, - enum GNUNET_BLOCK_Type type, size_t size, const char *data, - struct GNUNET_TIME_Absolute exp, - struct GNUNET_TIME_Relative timeout, - GNUNET_SCHEDULER_Task cont, void *cont_cls); +void +GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const GNUNET_HashCode * key, + uint32_t desired_replication_level, + enum GNUNET_DHT_RouteOption options, + enum GNUNET_BLOCK_Type type, size_t size, const char *data, + struct GNUNET_TIME_Absolute exp, + struct GNUNET_TIME_Relative timeout, GNUNET_SCHEDULER_Task cont, + void *cont_cls); /** @@ -211,23 +212,16 @@ typedef void (*GNUNET_DHT_GetIterator) (void *cls, * * @return handle to stop the async get */ -struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle - *handle, - struct GNUNET_TIME_Relative - timeout, - enum GNUNET_BLOCK_Type type, - const GNUNET_HashCode * key, - uint32_t - desired_replication_level, - enum GNUNET_DHT_RouteOption - options, - const struct - GNUNET_CONTAINER_BloomFilter - *bf, int32_t bf_mutator, - const void *xquery, - size_t xquery_size, - GNUNET_DHT_GetIterator iter, - void *iter_cls); +struct GNUNET_DHT_GetHandle * +GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, + struct GNUNET_TIME_Relative timeout, + enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key, + uint32_t desired_replication_level, + enum GNUNET_DHT_RouteOption options, + const struct GNUNET_CONTAINER_BloomFilter *bf, + int32_t bf_mutator, const void *xquery, + size_t xquery_size, GNUNET_DHT_GetIterator iter, + void *iter_cls); /** @@ -238,7 +232,8 @@ struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle * On return get_handle will no longer be valid, caller * must not use again!!! */ -void GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); +void +GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); /* ******** Special high-level API for finding peers *********** */ @@ -267,21 +262,12 @@ typedef void (*GNUNET_DHT_FindPeerProcessor) (void *cls, * @param proc_cls closure for proc * @return handle to stop the async get, NULL on error */ -struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct - GNUNET_DHT_Handle - *handle, - struct - GNUNET_TIME_Relative - timeout, - const - GNUNET_HashCode * - key, - enum - GNUNET_DHT_RouteOption - options, - GNUNET_DHT_FindPeerProcessor - proc, - void *proc_cls); +struct GNUNET_DHT_FindPeerHandle * +GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *handle, + struct GNUNET_TIME_Relative timeout, + const GNUNET_HashCode * key, + enum GNUNET_DHT_RouteOption options, + GNUNET_DHT_FindPeerProcessor proc, void *proc_cls); /** @@ -289,8 +275,8 @@ struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct * * @param find_peer_handle GET operation to stop. */ -void GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle - *find_peer_handle); +void +GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle); @@ -337,25 +323,15 @@ typedef void (*GNUNET_DHT_ReplyProcessor) (void *cls, * @param cont_cls closure for cont * @return handle to stop the request, NULL if the request is "fire and forget" */ -struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle - *handle, - const GNUNET_HashCode * - key, - uint32_t - desired_replication_level, - enum - GNUNET_DHT_RouteOption - options, - const struct - GNUNET_MessageHeader - *enc, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_DHT_ReplyProcessor - iter, void *iter_cls, - GNUNET_SCHEDULER_Task - cont, void *cont_cls); +struct GNUNET_DHT_RouteHandle * +GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle, + const GNUNET_HashCode * key, + uint32_t desired_replication_level, + enum GNUNET_DHT_RouteOption options, + const struct GNUNET_MessageHeader *enc, + struct GNUNET_TIME_Relative timeout, + GNUNET_DHT_ReplyProcessor iter, void *iter_cls, + GNUNET_SCHEDULER_Task cont, void *cont_cls); @@ -364,7 +340,8 @@ struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle * * @param route_handle operation to stop. */ -void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); +void +GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); /* ***** Special API for controlling DHT routing maintenance ******* */ @@ -381,8 +358,9 @@ void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); * @param cont_cls closure for cont * @param handle handle to the DHT service */ -void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, - GNUNET_SCHEDULER_Task cont, void *cont_cls); +void +GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /* ***** Special API for testing robustness with malicious peers ******* */ @@ -402,9 +380,9 @@ void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, * @param cont_cls closure for cont * */ -void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, - GNUNET_SCHEDULER_Task cont, - void *cont_cls); +void +GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -416,10 +394,10 @@ void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, * @param cont continuation to call when done (transmitting request to service) * @param cont_cls closure for cont */ -void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, - struct GNUNET_TIME_Relative frequency, - GNUNET_SCHEDULER_Task cont, - void *cont_cls); +void +GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, + struct GNUNET_TIME_Relative frequency, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -431,10 +409,10 @@ void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, * @param cont continuation to call when done (transmitting request to service) * @param cont_cls closure for cont */ -void GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, - struct GNUNET_TIME_Relative frequency, - GNUNET_SCHEDULER_Task cont, - void *cont_cls); +void +GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, + struct GNUNET_TIME_Relative frequency, + GNUNET_SCHEDULER_Task cont, void *cont_cls); #endif diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index f5fae80c9..abca17370 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h @@ -262,7 +262,8 @@ enum GNUNET_DISK_PipeEnd * @param part a file on the partition to check * @return -1 on errors, otherwise the number of free blocks */ -long GNUNET_DISK_get_blocks_available (const char *part); +long +GNUNET_DISK_get_blocks_available (const char *part); /** @@ -271,7 +272,8 @@ long GNUNET_DISK_get_blocks_available (const char *part); * @param h handle to check * @return GNUNET_YES if invalid, GNUNET_NO if valid */ -int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); +int +GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); /** @@ -282,7 +284,8 @@ int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something * else (will print an error message in that case, too). */ -int GNUNET_DISK_file_test (const char *fil); +int +GNUNET_DISK_file_test (const char *fil); /** @@ -292,8 +295,9 @@ int GNUNET_DISK_file_test (const char *fil); * @param whence specification to which position the offset parameter relates to * @return the new position on success, GNUNET_SYSERR otherwise */ -off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, - off_t offset, enum GNUNET_DISK_Seek whence); +off_t +GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, + enum GNUNET_DISK_Seek whence); /** @@ -308,8 +312,9 @@ off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, * included? * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_DISK_file_size (const char *filename, uint64_t * size, - int includeSymLinks); +int +GNUNET_DISK_file_size (const char *filename, uint64_t * size, + int includeSymLinks); /** @@ -327,8 +332,9 @@ int GNUNET_DISK_file_size (const char *filename, uint64_t * size, * @param ino set to the inode ID * @return GNUNET_OK on success */ -int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, - uint64_t * ino); +int +GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, + uint64_t * ino); /** @@ -342,7 +348,8 @@ int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, * @return NULL on error, otherwise name of fresh * file on disk in directory for temporary files */ -char *GNUNET_DISK_mktemp (const char *t); +char * +GNUNET_DISK_mktemp (const char *t); /** @@ -357,12 +364,9 @@ char *GNUNET_DISK_mktemp (const char *t); * call (because of flags) * @return IO handle on success, NULL on error */ -struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, - enum GNUNET_DISK_OpenFlags - flags, - enum - GNUNET_DISK_AccessPermissions - perm); +struct GNUNET_DISK_FileHandle * +GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, + enum GNUNET_DISK_AccessPermissions perm); /** * Creates an interprocess channel @@ -371,8 +375,8 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) * @return handle to the new pipe, NULL on error */ -struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, - int inherit_write); +struct GNUNET_DISK_PipeHandle * +GNUNET_DISK_pipe (int blocking, int inherit_read, int inherit_write); /** @@ -380,7 +384,8 @@ struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, * @param p pipe * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); +int +GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); /** * Closes one half of an interprocess channel @@ -389,8 +394,9 @@ int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); * @param end which end of the pipe to close * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, - enum GNUNET_DISK_PipeEnd end); +int +GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, + enum GNUNET_DISK_PipeEnd end); /** * Close an open file. @@ -398,7 +404,8 @@ int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, * @param h file handle * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); +int +GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); /** @@ -408,12 +415,9 @@ int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); * @param n end to access * @return handle for the respective end */ -const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct - GNUNET_DISK_PipeHandle - *p, - enum - GNUNET_DISK_PipeEnd - n); +const struct GNUNET_DISK_FileHandle * +GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, + enum GNUNET_DISK_PipeEnd n); /** * Read the contents of a binary file into a buffer. @@ -422,8 +426,9 @@ const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct * @param len the maximum number of bytes to read * @return the number of bytes read on success, GNUNET_SYSERR on failure */ -ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, - void *result, size_t len); +ssize_t +GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, void *result, + size_t len); /** @@ -434,7 +439,8 @@ ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, * @param len the maximum number of bytes to read * @return number of bytes read, GNUNET_SYSERR on failure */ -ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); +ssize_t +GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); /** @@ -445,8 +451,9 @@ ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); * @param n number of bytes to write * @return number of bytes written on success, GNUNET_SYSERR on error */ -ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, - const void *buffer, size_t n); +ssize_t +GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, + const void *buffer, size_t n); /** @@ -459,8 +466,9 @@ ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, * @param mode file permissions * @return number of bytes written on success, GNUNET_SYSERR on error */ -ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, - enum GNUNET_DISK_AccessPermissions mode); +ssize_t +GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, + enum GNUNET_DISK_AccessPermissions mode); /** @@ -470,7 +478,8 @@ ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, * @param dst destination file name * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_DISK_file_copy (const char *src, const char *dst); +int +GNUNET_DISK_file_copy (const char *src, const char *dst); /** @@ -481,9 +490,10 @@ int GNUNET_DISK_file_copy (const char *src, const char *dst); * @param callback_cls closure for callback * @return the number of files found, -1 on error */ -int GNUNET_DISK_directory_scan (const char *dirName, - GNUNET_FileNameCallback callback, - void *callback_cls); +int +GNUNET_DISK_directory_scan (const char *dirName, + GNUNET_FileNameCallback callback, + void *callback_cls); /** @@ -521,8 +531,9 @@ typedef void (*GNUNET_DISK_DirectoryIteratorCallback) (void *cls, * GNUNET_NO if this was the last entry (and iteration is complete), * GNUNET_SYSERR if "can" was YES */ -int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator - *iter, int can); +int +GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator *iter, + int can); /** @@ -536,10 +547,11 @@ int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator * @param callback the method to call for each file * @param callback_cls closure for callback */ -void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, - const char *dirName, - GNUNET_DISK_DirectoryIteratorCallback - callback, void *callback_cls); +void +GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, + const char *dirName, + GNUNET_DISK_DirectoryIteratorCallback + callback, void *callback_cls); /** @@ -550,7 +562,8 @@ void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, * @returns GNUNET_OK on success, GNUNET_SYSERR on failure, * GNUNET_NO if directory exists but is not writeable */ -int GNUNET_DISK_directory_create_for_file (const char *filename); +int +GNUNET_DISK_directory_create_for_file (const char *filename); /** @@ -563,7 +576,8 @@ int GNUNET_DISK_directory_create_for_file (const char *filename); * @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR * on any error and if exists but not directory */ -int GNUNET_DISK_directory_test (const char *fil); +int +GNUNET_DISK_directory_test (const char *fil); /** @@ -573,7 +587,8 @@ int GNUNET_DISK_directory_test (const char *fil); * @param fileName the file to remove * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_DISK_directory_remove (const char *fileName); +int +GNUNET_DISK_directory_remove (const char *fileName); /** @@ -582,7 +597,8 @@ int GNUNET_DISK_directory_remove (const char *fileName); * @param dir the directory to create * @returns GNUNET_SYSERR on failure, GNUNET_OK otherwise */ -int GNUNET_DISK_directory_create (const char *dir); +int +GNUNET_DISK_directory_create (const char *dir); /** @@ -594,8 +610,9 @@ int GNUNET_DISK_directory_create (const char *dir); * @param excl GNUNET_YES for an exclusive lock * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, - off_t lockEnd, int excl); +int +GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, + off_t lockEnd, int excl); /** @@ -605,15 +622,17 @@ int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, * @param unlockEnd absolute position until where to unlock * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, - off_t unlockStart, off_t unlockEnd); +int +GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlockStart, + off_t unlockEnd); /** * @brief Removes special characters as ':' from a filename. * @param fn the filename to canonicalize */ -void GNUNET_DISK_filename_canonicalize (char *fn); +void +GNUNET_DISK_filename_canonicalize (char *fn); /** @@ -622,7 +641,8 @@ void GNUNET_DISK_filename_canonicalize (char *fn); * @param user new owner of the file * @return GNUNET_OK on success, GNUNET_SYSERR on failure */ -int GNUNET_DISK_file_change_owner (const char *filename, const char *user); +int +GNUNET_DISK_file_change_owner (const char *filename, const char *user); /** @@ -639,8 +659,9 @@ int GNUNET_DISK_file_change_owner (const char *filename, const char *user); * private directory name. * @return the constructed filename */ -char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle - *cfg, const char *serviceName, ...); +char * +GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *serviceName, ...); /** @@ -656,9 +677,10 @@ struct GNUNET_DISK_MapHandle; * @param len size of the mapping * @return pointer to the mapped memory region, NULL on failure */ -void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, - struct GNUNET_DISK_MapHandle **m, - enum GNUNET_DISK_MapType access, size_t len); +void * +GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, + struct GNUNET_DISK_MapHandle **m, + enum GNUNET_DISK_MapType access, size_t len); /** * Unmap a file @@ -666,14 +688,16 @@ void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, * @param h mapping handle * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); +int +GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); /** * Write file changes to disk * @param h handle to an open file * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); +int +GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); /** * Creates a named pipe/FIFO and opens it @@ -682,13 +706,9 @@ int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); * @param perm access permissions * @return pipe handle on success, NULL on error */ -struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, - enum - GNUNET_DISK_OpenFlags - flags, - enum - GNUNET_DISK_AccessPermissions - perm); +struct GNUNET_DISK_FileHandle * +GNUNET_DISK_npipe_create (char **fn, enum GNUNET_DISK_OpenFlags flags, + enum GNUNET_DISK_AccessPermissions perm); /** * Opens already existing named pipe/FIFO @@ -698,20 +718,17 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, * @param perm access permissions * @return pipe handle on success, NULL on error */ -struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_open (const char *fn, - enum - GNUNET_DISK_OpenFlags - flags, - enum - GNUNET_DISK_AccessPermissions - perm); +struct GNUNET_DISK_FileHandle * +GNUNET_DISK_npipe_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, + enum GNUNET_DISK_AccessPermissions perm); /** * Closes a named pipe/FIFO * @param pipe named pipe * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe); +int +GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe); #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h index 2bb2319b9..3454ebc24 100644 --- a/src/include/gnunet_dv_service.h +++ b/src/include/gnunet_dv_service.h @@ -68,12 +68,13 @@ struct GNUNET_DV_Handle; * @param cont_cls closure for continuation * */ -int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, - const struct GNUNET_PeerIdentity *target, - const char *msgbuf, size_t msgbuf_size, - unsigned int priority, struct GNUNET_TIME_Relative timeout, - const void *addr, size_t addrlen, - GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls); +int +GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, + const struct GNUNET_PeerIdentity *target, const char *msgbuf, + size_t msgbuf_size, unsigned int priority, + struct GNUNET_TIME_Relative timeout, const void *addr, + size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont, + void *cont_cls); diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index 1f1f85321..06022e093 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h @@ -80,22 +80,14 @@ typedef void (*GNUNET_FRAGMENT_MessageProcessor) (void *cls, * @param proc_cls closure for proc * @return the fragmentation context */ -struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct - GNUNET_STATISTICS_Handle - *stats, - uint16_t mtu, - struct - GNUNET_BANDWIDTH_Tracker - *tracker, - struct - GNUNET_TIME_Relative - delay, - const struct - GNUNET_MessageHeader - *msg, - GNUNET_FRAGMENT_MessageProcessor - proc, - void *proc_cls); +struct GNUNET_FRAGMENT_Context * +GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, + uint16_t mtu, + struct GNUNET_BANDWIDTH_Tracker *tracker, + struct GNUNET_TIME_Relative delay, + const struct GNUNET_MessageHeader *msg, + GNUNET_FRAGMENT_MessageProcessor proc, + void *proc_cls); /** @@ -105,8 +97,8 @@ struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct * * @param fc fragmentation context */ -void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context - *fc); +void +GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); /** @@ -120,8 +112,9 @@ void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context * GNUNET_NO if more messages are pending * GNUNET_SYSERR if this ack is not valid for this fc */ -int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, - const struct GNUNET_MessageHeader *msg); +int +GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, + const struct GNUNET_MessageHeader *msg); /** @@ -132,9 +125,8 @@ int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, * @return average delay between transmission and ACK for the * last message, FOREVER if the message was not fully transmitted */ -struct GNUNET_TIME_Relative GNUNET_FRAGMENT_context_destroy (struct - GNUNET_FRAGMENT_Context - *fc); +struct GNUNET_TIME_Relative +GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc); /** @@ -171,18 +163,12 @@ typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, uint32_t id, * back to the other side) * @return the defragmentation context */ -struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct - GNUNET_STATISTICS_Handle - *stats, - uint16_t - mtu, - unsigned int - num_msgs, - void *cls, - GNUNET_FRAGMENT_MessageProcessor - proc, - GNUNET_DEFRAGMENT_AckProcessor - ackp); +struct GNUNET_DEFRAGMENT_Context * +GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, + uint16_t mtu, unsigned int num_msgs, + void *cls, + GNUNET_FRAGMENT_MessageProcessor proc, + GNUNET_DEFRAGMENT_AckProcessor ackp); /** @@ -190,7 +176,8 @@ struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct * * @param dc defragmentation context */ -void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); +void +GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); /** @@ -200,8 +187,9 @@ void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); * @param msg the message that was received * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error */ -int GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, - const struct GNUNET_MessageHeader *msg); +int +GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, + const struct GNUNET_MessageHeader *msg); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 2962a9cf2..e8026a66f 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -89,8 +89,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, * @param uri uri to convert to a unique key * @param key wherer to store the unique key */ -void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, - GNUNET_HashCode * key); +void +GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key); /** * Convert a URI to a UTF-8 String. @@ -98,7 +98,8 @@ void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, * @param uri uri to convert to a string * @return the UTF-8 string */ -char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); +char * +GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); /** * Convert keyword URI to a human readable format @@ -107,7 +108,8 @@ char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); * @param uri ksk uri to convert to a string * @return string with the keywords */ -char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); +char * +GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); /** @@ -118,8 +120,9 @@ char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); * @param keyword keyword to add * @param is_mandatory is this keyword mandatory? */ -void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, - const char *keyword, int is_mandatory); +void +GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, const char *keyword, + int is_mandatory); /** @@ -129,8 +132,9 @@ void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, * @param uri ksk uri to modify * @param keyword keyword to add */ -void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, - const char *keyword); +void +GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, + const char *keyword); /** @@ -140,14 +144,16 @@ void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, * @param emsg where to store the parser error message (if any) * @return NULL on error */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_parse (const char *uri, char **emsg); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_parse (const char *uri, char **emsg); /** * Free URI. * * @param uri uri to free */ -void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); +void +GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); /** @@ -156,8 +162,8 @@ void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); * @param uri ksk uri to get the number of keywords from * @return 0 if this is not a keyword URI */ -unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri - *uri); +unsigned int +GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); /** @@ -169,9 +175,10 @@ unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri * @return -1 if this is not a keyword URI, otherwise number of * keywords iterated over until iterator aborted */ -int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, - GNUNET_FS_KeywordIterator iterator, - void *iterator_cls); +int +GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, + GNUNET_FS_KeywordIterator iterator, + void *iterator_cls); /** @@ -181,8 +188,9 @@ int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, * @param peer where to store the identify of the peer (presumably) offering the content * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK */ -int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, - struct GNUNET_PeerIdentity *peer); +int +GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, + struct GNUNET_PeerIdentity *peer); /** @@ -191,8 +199,8 @@ int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, * @param uri location URI to get the content URI from * @return NULL if argument is not a location URI */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri - *uri); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri); /** @@ -201,9 +209,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri * @param uri location URI to get the expiration from * @return expiration time of the URI */ -struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct - GNUNET_FS_Uri - *uri); +struct GNUNET_TIME_Absolute +GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); /** @@ -214,13 +221,10 @@ struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct * @param expiration_time how long will the content be offered? * @return the location URI, NULL on error */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri - *baseUri, - const struct - GNUNET_CONFIGURATION_Handle - *cfg, - struct GNUNET_TIME_Absolute - expiration_time); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, + const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TIME_Absolute expiration_time); /** @@ -231,8 +235,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri * @param uri the URI to canonicalize * @return canonicalized version of the URI, NULL on error */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri - *uri); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri *uri); /** @@ -244,8 +248,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri * @param u2 second uri * @return merged URI, NULL on error */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, - const struct GNUNET_FS_Uri *u2); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, + const struct GNUNET_FS_Uri *u2); /** @@ -254,7 +259,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, * @param uri the URI to duplicate * @return copy of the URI */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); /** @@ -274,8 +280,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); * @return an FS URI for the given keywords, NULL * if keywords is not legal (i.e. empty). */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords, - char **emsg); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_ksk_create (const char *keywords, char **emsg); /** @@ -295,8 +301,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords, * @return an FS URI for the given keywords, NULL * if keywords is not legal (i.e. empty). */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, - const char **argv); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv); /** @@ -306,8 +312,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, * @param u2 the other URI * @return GNUNET_YES if the URIs are equal */ -int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, - const struct GNUNET_FS_Uri *u2); +int +GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, + const struct GNUNET_FS_Uri *u2); /** @@ -316,7 +323,8 @@ int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, * @param uri the uri to check * @return GNUNET_YES if this is an SKS uri */ -int GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); +int +GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); /** @@ -333,8 +341,9 @@ struct GNUNET_FS_Namespace; * @param emsg where to store an error message * @return an FS URI for the given namespace and identifier */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, - const char *id, char **emsg); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id, + char **emsg); /** @@ -344,8 +353,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, * @param id identifier * @return an FS URI for the given namespace and identifier */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * - nsid, const char *id); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * nsid, const char *id); /** @@ -356,8 +365,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * * @param nsid where to store the ID of the namespace * @return GNUNET_OK on success */ -int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, - GNUNET_HashCode * nsid); +int +GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, + GNUNET_HashCode * nsid); /** @@ -366,7 +376,8 @@ int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, * @param uri the sks uri * @return NULL on error (not a valid SKS URI) */ -char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); +char * +GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); /** @@ -377,8 +388,9 @@ char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); * @param uri SKS uri to convert * @return NULL on error (not an SKS URI) */ -char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle - *cfg, const struct GNUNET_FS_Uri *uri); +char * +GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_FS_Uri *uri); /** @@ -387,7 +399,8 @@ char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle * @param uri the uri * @return GNUNET_YES if this is a KSK uri */ -int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); +int +GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); /** @@ -396,7 +409,8 @@ int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); * @param uri the uri to check * @return GNUNET_YES if this is a CHK uri */ -int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); +int +GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); /** @@ -406,7 +420,8 @@ int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); * @param uri the CHK (or LOC) URI to inspect * @return size of the file as specified in the CHK URI */ -uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); +uint64_t +GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); /** @@ -415,7 +430,8 @@ uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); * @param uri the uri to check * @return GNUNET_YES if this is a LOC uri */ -int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); +int +GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); /** @@ -426,9 +442,9 @@ int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); * @param md metadata to use * @return NULL on error, otherwise a KSK URI */ -struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct - GNUNET_CONTAINER_MetaData - *md); +struct GNUNET_FS_Uri * +GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData + *md); /* ******************** command-line option parsing API *********************** */ @@ -445,10 +461,10 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct * @param value command line argument given * @return GNUNET_OK on success */ -int GNUNET_FS_getopt_set_keywords (struct - GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); /** @@ -463,10 +479,10 @@ int GNUNET_FS_getopt_set_keywords (struct * @param value command line argument given * @return GNUNET_OK on success */ -int GNUNET_FS_getopt_set_metadata (struct - GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); @@ -1621,7 +1637,8 @@ struct GNUNET_FS_BlockOptions /** * Return the current year (i.e. '2011'). */ -unsigned int GNUNET_FS_get_current_year (void); +unsigned int +GNUNET_FS_get_current_year (void); /** @@ -1630,7 +1647,8 @@ unsigned int GNUNET_FS_get_current_year (void); * @param year a year (after 1970, please ;-)). * @return absolute time for January 1st of that year. */ -struct GNUNET_TIME_Absolute GNUNET_FS_year_to_time (unsigned int year); +struct GNUNET_TIME_Absolute +GNUNET_FS_year_to_time (unsigned int year); /** @@ -1650,12 +1668,10 @@ struct GNUNET_FS_Handle; * @param ... list of optional options, terminated with GNUNET_FS_OPTIONS_END * @return NULL on error */ -struct GNUNET_FS_Handle *GNUNET_FS_start (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const char *client_name, - GNUNET_FS_ProgressCallback upcb, - void *upcb_cls, - enum GNUNET_FS_Flags flags, ...); +struct GNUNET_FS_Handle * +GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *client_name, GNUNET_FS_ProgressCallback upcb, + void *upcb_cls, enum GNUNET_FS_Flags flags, ...); /** @@ -1665,7 +1681,8 @@ struct GNUNET_FS_Handle *GNUNET_FS_start (const struct * * @param h handle that was returned from GNUNET_FS_start */ -void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); +void +GNUNET_FS_stop (struct GNUNET_FS_Handle *h); /** @@ -1677,10 +1694,10 @@ void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); * @return GNUNET_SYSERR on error, otherwise the number * of meta-data items obtained */ -int GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, - const char *filename, - struct EXTRACTOR_PluginList - *extractors); +int +GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, + const char *filename, + struct EXTRACTOR_PluginList *extractors); /** @@ -1721,8 +1738,8 @@ typedef int (*GNUNET_FS_FileInformationProcessor) (void *cls, * can be passed to "GNUNET_FS_file_information_recover" * to read this fi-struct from disk. */ -const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation - *s); +const char * +GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); @@ -1740,17 +1757,17 @@ const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation * @param bo block options * @return publish structure entry for the file */ -struct GNUNET_FS_FileInformation - *GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, - void *client_info, - const char *filename, - const struct GNUNET_FS_Uri - *keywords, - const struct - GNUNET_CONTAINER_MetaData - *meta, int do_index, - const struct - GNUNET_FS_BlockOptions *bo); +struct GNUNET_FS_FileInformation * +GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, + void *client_info, + const char *filename, + const struct GNUNET_FS_Uri + *keywords, + const struct + GNUNET_CONTAINER_MetaData *meta, + int do_index, + const struct GNUNET_FS_BlockOptions + *bo); /** @@ -1769,17 +1786,17 @@ struct GNUNET_FS_FileInformation * @param bo block options * @return publish structure entry for the file */ -struct GNUNET_FS_FileInformation - *GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, - void *client_info, - uint64_t length, void *data, - const struct GNUNET_FS_Uri - *keywords, - const struct - GNUNET_CONTAINER_MetaData - *meta, int do_index, - const struct - GNUNET_FS_BlockOptions *bo); +struct GNUNET_FS_FileInformation * +GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, + void *client_info, uint64_t length, + void *data, + const struct GNUNET_FS_Uri + *keywords, + const struct + GNUNET_CONTAINER_MetaData *meta, + int do_index, + const struct GNUNET_FS_BlockOptions + *bo); /** @@ -1818,19 +1835,19 @@ typedef size_t (*GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, * @param bo block options * @return publish structure entry for the file */ -struct GNUNET_FS_FileInformation - *GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, - void *client_info, - uint64_t length, - GNUNET_FS_DataReader reader, - void *reader_cls, - const struct GNUNET_FS_Uri - *keywords, - const struct - GNUNET_CONTAINER_MetaData - *meta, int do_index, - const struct - GNUNET_FS_BlockOptions *bo); +struct GNUNET_FS_FileInformation * +GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, + void *client_info, + uint64_t length, + GNUNET_FS_DataReader reader, + void *reader_cls, + const struct GNUNET_FS_Uri + *keywords, + const struct + GNUNET_CONTAINER_MetaData *meta, + int do_index, + const struct + GNUNET_FS_BlockOptions *bo); /** @@ -1890,11 +1907,12 @@ typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, * @param emsg where to store an error message (on errors) * @return GNUNET_OK on success */ -int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, - const char *dirname, int do_index, - const struct GNUNET_FS_BlockOptions - *bo, GNUNET_FS_FileProcessor proc, - void *proc_cls, char **emsg); +int +GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, + const char *dirname, int do_index, + const struct GNUNET_FS_BlockOptions *bo, + GNUNET_FS_FileProcessor proc, + void *proc_cls, char **emsg); /** @@ -1917,17 +1935,16 @@ int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, * @param emsg where to store an error message * @return publish structure entry for the directory, NULL on error */ -struct GNUNET_FS_FileInformation - *GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle - *h, void *client_info, - const char *filename, - GNUNET_FS_DirectoryScanner - scanner, - void *scanner_cls, - int do_index, - const struct - GNUNET_FS_BlockOptions - *bo, char **emsg); +struct GNUNET_FS_FileInformation * +GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, + void *client_info, + const char *filename, + GNUNET_FS_DirectoryScanner + scanner, void *scanner_cls, + int do_index, + const struct + GNUNET_FS_BlockOptions *bo, + char **emsg); /** @@ -1944,17 +1961,16 @@ struct GNUNET_FS_FileInformation * @param bo block options * @return publish structure entry for the directory , NULL on error */ -struct GNUNET_FS_FileInformation - *GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle - *h, void *client_info, - const struct - GNUNET_FS_Uri *keywords, - const struct - GNUNET_CONTAINER_MetaData - *meta, - const struct - GNUNET_FS_BlockOptions - *bo); +struct GNUNET_FS_FileInformation * +GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, + void *client_info, + const struct GNUNET_FS_Uri + *keywords, + const struct + GNUNET_CONTAINER_MetaData + *meta, + const struct + GNUNET_FS_BlockOptions *bo); /** @@ -1963,8 +1979,9 @@ struct GNUNET_FS_FileInformation * @param ent check if this FI represents a directory * @return GNUNET_YES if so, GNUNET_NO if not */ -int GNUNET_FS_file_information_is_directory (const struct - GNUNET_FS_FileInformation *ent); +int +GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation + *ent); /** @@ -1978,8 +1995,9 @@ int GNUNET_FS_file_information_is_directory (const struct * must not include "dir" in its structure * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, - struct GNUNET_FS_FileInformation *ent); +int +GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, + struct GNUNET_FS_FileInformation *ent); /** @@ -1996,9 +2014,10 @@ int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, * @param proc function to call on each entry * @param proc_cls closure for proc */ -void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, - GNUNET_FS_FileInformationProcessor - proc, void *proc_cls); +void +GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, + GNUNET_FS_FileInformationProcessor proc, + void *proc_cls); /** @@ -2011,9 +2030,10 @@ void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, * values are ignored * @param cleaner_cls closure for cleaner */ -void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, - GNUNET_FS_FileInformationProcessor - cleaner, void *cleaner_cls); +void +GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, + GNUNET_FS_FileInformationProcessor cleaner, + void *cleaner_cls); /** @@ -2047,19 +2067,12 @@ enum GNUNET_FS_PublishOptions * @param options options for the publication * @return context that can be used to control the publish operation */ -struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct - GNUNET_FS_Handle *h, - struct - GNUNET_FS_FileInformation - *fi, - struct - GNUNET_FS_Namespace - *namespace, - const char *nid, - const char *nuid, - enum - GNUNET_FS_PublishOptions - options); +struct GNUNET_FS_PublishContext * +GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, + struct GNUNET_FS_FileInformation *fi, + struct GNUNET_FS_Namespace *namespace, const char *nid, + const char *nuid, + enum GNUNET_FS_PublishOptions options); /** @@ -2070,7 +2083,8 @@ struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct * * @param pc context for the publication to stop */ -void GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); +void +GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); /** @@ -2098,13 +2112,14 @@ typedef void (*GNUNET_FS_PublishContinuation) (void *cls, * @param cont continuation * @param cont_cls closure for cont */ -void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, - const struct GNUNET_FS_Uri *ksk_uri, - const struct GNUNET_CONTAINER_MetaData *meta, - const struct GNUNET_FS_Uri *uri, - const struct GNUNET_FS_BlockOptions *bo, - enum GNUNET_FS_PublishOptions options, - GNUNET_FS_PublishContinuation cont, void *cont_cls); +void +GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, + const struct GNUNET_FS_Uri *ksk_uri, + const struct GNUNET_CONTAINER_MetaData *meta, + const struct GNUNET_FS_Uri *uri, + const struct GNUNET_FS_BlockOptions *bo, + enum GNUNET_FS_PublishOptions options, + GNUNET_FS_PublishContinuation cont, void *cont_cls); /** @@ -2121,14 +2136,15 @@ void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, * @param cont continuation * @param cont_cls closure for cont */ -void GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, - struct GNUNET_FS_Namespace *namespace, - const char *identifier, const char *update, - const struct GNUNET_CONTAINER_MetaData *meta, - const struct GNUNET_FS_Uri *uri, - const struct GNUNET_FS_BlockOptions *bo, - enum GNUNET_FS_PublishOptions options, - GNUNET_FS_PublishContinuation cont, void *cont_cls); +void +GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, + struct GNUNET_FS_Namespace *namespace, + const char *identifier, const char *update, + const struct GNUNET_CONTAINER_MetaData *meta, + const struct GNUNET_FS_Uri *uri, + const struct GNUNET_FS_BlockOptions *bo, + enum GNUNET_FS_PublishOptions options, + GNUNET_FS_PublishContinuation cont, void *cont_cls); /** @@ -2154,10 +2170,11 @@ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, * error) or "PREREQ_DONE" (on success) * @param cont_cls closure for cont */ -void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, - GNUNET_FS_IndexedFileProcessor iterator, - void *iterator_cls, - GNUNET_SCHEDULER_Task cont, void *cont_cls); +void +GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, + GNUNET_FS_IndexedFileProcessor iterator, + void *iterator_cls, GNUNET_SCHEDULER_Task cont, + void *cont_cls); /** @@ -2168,10 +2185,9 @@ void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, * @param cctx initial value for the client context * @return NULL on error, otherwise handle */ -struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct - GNUNET_FS_Handle *h, - const char *filename, - void *cctx); +struct GNUNET_FS_UnindexContext * +GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, + void *cctx); /** @@ -2179,7 +2195,8 @@ struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct * * @param uc handle */ -void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); +void +GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); /** @@ -2194,15 +2211,15 @@ void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); * @param cont continuation * @param cont_cls closure for cont */ -void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, - struct GNUNET_FS_Uri *ksk_uri, - struct GNUNET_FS_Namespace *namespace, - const struct GNUNET_CONTAINER_MetaData - *meta, - const struct GNUNET_FS_BlockOptions *bo, - const char *rootEntry, - GNUNET_FS_PublishContinuation cont, - void *cont_cls); +void +GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, + struct GNUNET_FS_Uri *ksk_uri, + struct GNUNET_FS_Namespace *namespace, + const struct GNUNET_CONTAINER_MetaData *meta, + const struct GNUNET_FS_BlockOptions *bo, + const char *rootEntry, + GNUNET_FS_PublishContinuation cont, + void *cont_cls); /** @@ -2213,8 +2230,8 @@ void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, * @param name name to use for the namespace * @return handle to the namespace, NULL on error */ -struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle - *h, const char *name); +struct GNUNET_FS_Namespace * +GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name); /** @@ -2228,8 +2245,8 @@ struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle * * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, - int freeze); +int +GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); /** @@ -2254,9 +2271,9 @@ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, * @param cb function to call on each known namespace * @param cb_cls closure for cb */ -void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, - GNUNET_FS_NamespaceInfoProcessor cb, - void *cb_cls); +void +GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, + GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls); /** @@ -2296,10 +2313,11 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, * @param ip function to call on each updateable identifier * @param ip_cls closure for ip */ -void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, - const char *next_id, - GNUNET_FS_IdentifierProcessor ip, - void *ip_cls); +void +GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, + const char *next_id, + GNUNET_FS_IdentifierProcessor ip, + void *ip_cls); /** @@ -2331,14 +2349,10 @@ enum GNUNET_FS_SearchOptions * @param cctx initial value for the client context * @return context that can be used to control the search */ -struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle - *h, - const struct - GNUNET_FS_Uri *uri, - uint32_t anonymity, - enum - GNUNET_FS_SearchOptions - options, void *cctx); +struct GNUNET_FS_SearchContext * +GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, + const struct GNUNET_FS_Uri *uri, uint32_t anonymity, + enum GNUNET_FS_SearchOptions options, void *cctx); /** @@ -2346,7 +2360,8 @@ struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle * * @param sc context for the search that should be paused */ -void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); +void +GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); /** @@ -2354,7 +2369,8 @@ void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); * * @param sc context for the search that should be resumed */ -void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); +void +GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); /** @@ -2362,7 +2378,8 @@ void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); * * @param sc context for the search that should be stopped */ -void GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); +void +GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); @@ -2437,26 +2454,14 @@ enum GNUNET_FS_DownloadOptions * for top-level downloads; useful for manually-triggered recursive downloads) * @return context that can be used to control this download */ -struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct - GNUNET_FS_Handle *h, - const struct - GNUNET_FS_Uri *uri, - const struct - GNUNET_CONTAINER_MetaData - *meta, - const char - *filename, - const char - *tempname, - uint64_t offset, - uint64_t length, - uint32_t anonymity, - enum - GNUNET_FS_DownloadOptions - options, void *cctx, - struct - GNUNET_FS_DownloadContext - *parent); +struct GNUNET_FS_DownloadContext * +GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, + const struct GNUNET_FS_Uri *uri, + const struct GNUNET_CONTAINER_MetaData *meta, + const char *filename, const char *tempname, + uint64_t offset, uint64_t length, uint32_t anonymity, + enum GNUNET_FS_DownloadOptions options, void *cctx, + struct GNUNET_FS_DownloadContext *parent); /** @@ -2493,29 +2498,14 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct * @param cctx initial value for the client context for this download * @return context that can be used to control this download */ -struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct - GNUNET_FS_Handle - *h, - struct - GNUNET_FS_SearchResult - *sr, - const - char - *filename, - const - char - *tempname, - uint64_t - offset, - uint64_t - length, - uint32_t - anonymity, - enum - GNUNET_FS_DownloadOptions - options, - void - *cctx); +struct GNUNET_FS_DownloadContext * +GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, + struct GNUNET_FS_SearchResult *sr, + const char *filename, + const char *tempname, uint64_t offset, + uint64_t length, uint32_t anonymity, + enum GNUNET_FS_DownloadOptions options, + void *cctx); /** @@ -2524,8 +2514,8 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct * @param dc handle for the download * @param do_delete delete files of incomplete downloads */ -void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, - int do_delete); +void +GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); @@ -2543,8 +2533,9 @@ void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if * we have no mime-type information (treat as 'GNUNET_NO') */ -int GNUNET_FS_meta_data_test_for_directory (const struct - GNUNET_CONTAINER_MetaData *md); +int +GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData + *md); /** @@ -2553,7 +2544,8 @@ int GNUNET_FS_meta_data_test_for_directory (const struct * * @param md metadata to add mimetype to */ -void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); +void +GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); /** @@ -2562,8 +2554,9 @@ void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); * @param md given meta data * @return NULL if meta data is useless for suggesting a filename */ -char *GNUNET_FS_meta_data_suggest_filename (const struct - GNUNET_CONTAINER_MetaData *md); +char * +GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData + *md); /** @@ -2610,10 +2603,11 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, * GNUNET_NO if this could be part of a directory (but not 100% OK) * GNUNET_SYSERR if 'data' does not represent a directory */ -int GNUNET_FS_directory_list_contents (size_t size, const void *data, - uint64_t offset, - GNUNET_FS_DirectoryEntryProcessor dep, - void *dep_cls); +int +GNUNET_FS_directory_list_contents (size_t size, const void *data, + uint64_t offset, + GNUNET_FS_DirectoryEntryProcessor dep, + void *dep_cls); /** @@ -2626,10 +2620,9 @@ struct GNUNET_FS_DirectoryBuilder; * * @param mdir metadata for the directory */ -struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const - struct - GNUNET_CONTAINER_MetaData - *mdir); +struct GNUNET_FS_DirectoryBuilder * +GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData + *mdir); /** @@ -2642,10 +2635,11 @@ struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const * data must point to exactly the number of bytes specified * by the uri */ -void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, - const struct GNUNET_FS_Uri *uri, - const struct GNUNET_CONTAINER_MetaData - *md, const void *data); +void +GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, + const struct GNUNET_FS_Uri *uri, + const struct GNUNET_CONTAINER_MetaData *md, + const void *data); /** @@ -2658,8 +2652,9 @@ void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, * @param rdata set to the encoded directory * @return GNUNET_OK on success */ -int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, - size_t * rsize, void **rdata); +int +GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, + size_t * rsize, void **rdata); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index 0fb7ec84e..e6afa2b3c 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h @@ -207,9 +207,10 @@ struct GNUNET_GETOPT_CommandLineOption * @return index into argv with first non-option * argument, or GNUNET_SYSERR on error */ -int GNUNET_GETOPT_run (const char *binaryOptions, - const struct GNUNET_GETOPT_CommandLineOption *allOptions, - unsigned int argc, char *const *argv); +int +GNUNET_GETOPT_run (const char *binaryOptions, + const struct GNUNET_GETOPT_CommandLineOption *allOptions, + unsigned int argc, char *const *argv); /** @@ -225,9 +226,9 @@ int GNUNET_GETOPT_run (const char *binaryOptions, * @param value actual value of the option as a string. * @return GNUNET_OK if parsing the value worked */ -int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, + void *scls, const char *option, const char *value); /** @@ -243,9 +244,9 @@ int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext * @param value actual value of the option as a string. * @return GNUNET_OK if parsing the value worked */ -int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, + void *scls, const char *option, const char *value); /** @@ -262,9 +263,9 @@ int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext * @param value not used (NULL) * @return GNUNET_OK */ -int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, + void *scls, const char *option, const char *value); /** @@ -281,9 +282,9 @@ int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext * @param value actual value of the option (a string) * @return GNUNET_OK */ -int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, + void *scls, const char *option, const char *value); /** * Set an option of type 'unsigned int' from the command line. Each @@ -299,10 +300,10 @@ int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext * @param value not used (NULL) * @return GNUNET_OK */ -int GNUNET_GETOPT_increment_value (struct - GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); /* *************** internal prototypes - use macros above! ************* */ @@ -316,9 +317,10 @@ int GNUNET_GETOPT_increment_value (struct * @param value not used (NULL) * @return GNUNET_SYSERR (do not continue) */ -int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); /** * Print out program version (implements --version). @@ -329,10 +331,10 @@ int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext * @param value not used (NULL) * @return GNUNET_SYSERR (do not continue) */ -int GNUNET_GETOPT_print_version_ (struct - GNUNET_GETOPT_CommandLineProcessorContext - *ctx, void *scls, const char *option, - const char *value); +int +GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 3c44b5048..556b41d3c 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h @@ -60,11 +60,11 @@ struct GNUNET_HELLO_Message; * @return number of bytes copied, 0 if * the target buffer was not big enough. */ -size_t GNUNET_HELLO_add_address (const char *tname, - struct GNUNET_TIME_Absolute - expiration, const void *addr, - uint16_t addr_len, char *target, - size_t max); +size_t +GNUNET_HELLO_add_address (const char *tname, + struct GNUNET_TIME_Absolute expiration, + const void *addr, uint16_t addr_len, char *target, + size_t max); /** @@ -90,11 +90,11 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, * * @return the hello message */ -struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct - GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded - *publicKey, - GNUNET_HELLO_GenerateAddressListCallback - addrgen, void *addrgen_cls); +struct GNUNET_HELLO_Message * +GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + *publicKey, + GNUNET_HELLO_GenerateAddressListCallback addrgen, + void *addrgen_cls); /** @@ -102,7 +102,8 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct * @param hello to inspect * @return the size, 0 if HELLO is invalid */ -uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); +uint16_t +GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); /** @@ -114,10 +115,9 @@ uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); * @param h2 the second HELLO message * @return the combined hello message */ -struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct - GNUNET_HELLO_Message *h1, - const struct - GNUNET_HELLO_Message *h2); +struct GNUNET_HELLO_Message * +GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1, + const struct GNUNET_HELLO_Message *h2); /** @@ -136,12 +136,10 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct * zero if the some addresses with expirations >= now * do not match at all */ -struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct - GNUNET_HELLO_Message *h1, - const struct - GNUNET_HELLO_Message *h2, - struct GNUNET_TIME_Absolute - now); +struct GNUNET_TIME_Absolute +GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, + const struct GNUNET_HELLO_Message *h2, + struct GNUNET_TIME_Absolute now); /** @@ -174,13 +172,10 @@ typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, const char *tname, * @param it_cls closure for it * @return the modified HELLO or NULL */ -struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct - GNUNET_HELLO_Message - *msg, - int - return_modified, - GNUNET_HELLO_AddressIterator - it, void *it_cls); +struct GNUNET_HELLO_Message * +GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, + int return_modified, + GNUNET_HELLO_AddressIterator it, void *it_cls); /** @@ -194,14 +189,15 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct * @param it iterator to call on each address * @param it_cls closure for it */ -void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message - *new_hello, - const struct GNUNET_HELLO_Message - *old_hello, - struct GNUNET_TIME_Absolute - expiration_limit, - GNUNET_HELLO_AddressIterator it, - void *it_cls); +void +GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message + *new_hello, + const struct GNUNET_HELLO_Message + *old_hello, + struct GNUNET_TIME_Absolute + expiration_limit, + GNUNET_HELLO_AddressIterator it, + void *it_cls); /** @@ -211,9 +207,10 @@ void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message * @param publicKey where to copy the public key information, can be NULL * @return GNUNET_SYSERR if the HELLO was malformed */ -int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, - struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded - *publicKey); +int +GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, + struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + *publicKey); /** @@ -223,8 +220,9 @@ int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, * @param peer where to store the peer's identity * @return GNUNET_SYSERR if the HELLO was malformed */ -int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, - struct GNUNET_PeerIdentity *peer); +int +GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, + struct GNUNET_PeerIdentity *peer); /** @@ -235,9 +233,8 @@ int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, * * @return header or NULL if the HELLO was malformed */ -struct GNUNET_MessageHeader *GNUNET_HELLO_get_header (struct - GNUNET_HELLO_Message - *hello); +struct GNUNET_MessageHeader * +GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); /* ifndef GNUNET_HELLO_LIB_H */ #endif diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index d56522d40..6dfe80cb2 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h @@ -51,8 +51,8 @@ struct GNUNET_LOAD_Value; * frequency, 0-load values will be added to the load * @return the new load value */ -struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative - autodecline); +struct GNUNET_LOAD_Value * +GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); /** @@ -61,8 +61,9 @@ struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative * @param load load to update * @param autodecline frequency of load decline */ -void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, - struct GNUNET_TIME_Relative autodecline); +void +GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, + struct GNUNET_TIME_Relative autodecline); /** @@ -82,7 +83,8 @@ void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, * 100 if the latest updates were so large * that we could not do proper calculations */ -double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); +double +GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); /** @@ -91,7 +93,8 @@ double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); * @param load load handle * @return zero if update was never called */ -double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); +double +GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); /** @@ -100,7 +103,8 @@ double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); * @param load to update * @param data latest measurement value (for example, delay) */ -void GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); +void +GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 507b766d1..bea706478 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h @@ -138,17 +138,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; * @return handle to the mesh service * NULL on error (in this case, init is never called) */ -struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct - GNUNET_CONFIGURATION_Handle - *cfg, void *cls, - GNUNET_MESH_TunnelEndHandler - cleaner, - const struct - GNUNET_MESH_MessageHandler - *handlers, - const - GNUNET_MESH_ApplicationType - *stypes); +struct GNUNET_MESH_Handle * +GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, + GNUNET_MESH_TunnelEndHandler cleaner, + const struct GNUNET_MESH_MessageHandler *handlers, + const GNUNET_MESH_ApplicationType *stypes); /** * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise @@ -156,9 +150,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct * @param tunnel the tunnel * @return the peer or NULL */ -const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct - GNUNET_MESH_Tunnel - *tunnel); +const struct GNUNET_PeerIdentity * +GNUNET_MESH_get_peer (const struct GNUNET_MESH_Tunnel *tunnel); /** @@ -166,7 +159,8 @@ const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct * * @param handle connection to mesh to disconnect */ -void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); +void +GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); @@ -220,23 +214,15 @@ struct GNUNET_MESH_PeerRequestHandle; * @param handler_cls closure for handler * @return NULL on error (handler will not be called), otherwise handle for cancellation */ -struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct - GNUNET_MESH_Handle - *h, - struct - GNUNET_TIME_Relative - timeout, - unsigned int - num_peers, - const struct - GNUNET_PeerIdentity - *peers, - GNUNET_MESH_TunnelConnectHandler - connect_handler, - GNUNET_MESH_TunnelDisconnectHandler - disconnect_handler, - void - *handler_cls); +struct GNUNET_MESH_Tunnel * +GNUNET_MESH_peer_request_connect_any (struct GNUNET_MESH_Handle *h, + struct GNUNET_TIME_Relative timeout, + unsigned int num_peers, + const struct GNUNET_PeerIdentity *peers, + GNUNET_MESH_TunnelConnectHandler + connect_handler, + GNUNET_MESH_TunnelDisconnectHandler + disconnect_handler, void *handler_cls); /** @@ -256,23 +242,15 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct * @param handler_cls closure for handler * @return NULL on error (handler will not be called), otherwise handle for cancellation */ -struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct - GNUNET_MESH_Handle - *h, - struct - GNUNET_TIME_Relative - timeout, - unsigned int - num_peers, - const struct - GNUNET_PeerIdentity - *peers, - GNUNET_MESH_TunnelConnectHandler - connect_handler, - GNUNET_MESH_TunnelDisconnectHandler - disconnect_handler, - void - *handler_cls); +struct GNUNET_MESH_Tunnel * +GNUNET_MESH_peer_request_connect_all (struct GNUNET_MESH_Handle *h, + struct GNUNET_TIME_Relative timeout, + unsigned int num_peers, + const struct GNUNET_PeerIdentity *peers, + GNUNET_MESH_TunnelConnectHandler + connect_handler, + GNUNET_MESH_TunnelDisconnectHandler + disconnect_handler, void *handler_cls); /** @@ -283,10 +261,10 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct * @param timeout how long to try to establish a connection * @param peer peer to add */ -void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, - struct GNUNET_TIME_Relative timeout, - const struct GNUNET_PeerIdentity - *peer); +void +GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, + struct GNUNET_TIME_Relative timeout, + const struct GNUNET_PeerIdentity *peer); /** @@ -296,9 +274,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, * @param tunnel handle to existing tunnel * @param peer peer to remove */ -void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, - const struct GNUNET_PeerIdentity - *peer); +void +GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, + const struct GNUNET_PeerIdentity *peer); /** @@ -318,20 +296,15 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, * @param handler_cls closure for handler * @return NULL on error (handler will not be called), otherwise handle for cancellation */ -struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct - GNUNET_MESH_Handle - *h, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_MESH_ApplicationType - app_type, - GNUNET_MESH_TunnelConnectHandler - connect_handler, - GNUNET_MESH_TunnelDisconnectHandler - disconnect_handler, - void - *handler_cls); +struct GNUNET_MESH_Tunnel * +GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h, + struct GNUNET_TIME_Relative timeout, + GNUNET_MESH_ApplicationType app_type, + GNUNET_MESH_TunnelConnectHandler + connect_handler, + GNUNET_MESH_TunnelDisconnectHandler + disconnect_handler, + void *handler_cls); /** @@ -340,7 +313,8 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct * * @param req request handle that was returned for the original request */ -void GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req); +void +GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req); /** @@ -370,25 +344,14 @@ struct GNUNET_MESH_TransmitHandle; * NULL if we can not even queue the request (insufficient * memory); if NULL is returned, "notify" will NOT be called. */ -struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct - GNUNET_MESH_Tunnel - *tunnel, - int cork, - uint32_t - priority, - struct - GNUNET_TIME_Relative - maxdelay, - const - struct - GNUNET_PeerIdentity - *target, - size_t - notify_size, - GNUNET_CONNECTION_TransmitReadyNotify - notify, - void - *notify_cls); +struct GNUNET_MESH_TransmitHandle * +GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, + uint32_t priority, + struct GNUNET_TIME_Relative maxdelay, + const struct GNUNET_PeerIdentity *target, + size_t notify_size, + GNUNET_CONNECTION_TransmitReadyNotify notify, + void *notify_cls); /** @@ -396,19 +359,23 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct * * @param th handle that was returned by "notify_transmit_ready". */ -void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle - *th); - -void GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, - void *head); -void GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, - void *tail); -void *GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel); -void *GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel); - -void GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, - void *data); -void *GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel); +void +GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle + *th); + +void +GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, void *head); +void +GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, void *tail); +void * +GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel); +void * +GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel); + +void +GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data); +void * +GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel); #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_mesh_service_new.h b/src/include/gnunet_mesh_service_new.h index 89b1c881e..83addfce5 100644 --- a/src/include/gnunet_mesh_service_new.h +++ b/src/include/gnunet_mesh_service_new.h @@ -140,17 +140,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; * @return handle to the mesh service NULL on error * (in this case, init is never called) */ -struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct - GNUNET_CONFIGURATION_Handle - *cfg, void *cls, - GNUNET_MESH_TunnelEndHandler - cleaner, - const struct - GNUNET_MESH_MessageHandler - *handlers, - const - GNUNET_MESH_ApplicationType - *stypes); +struct GNUNET_MESH_Handle * +GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, + GNUNET_MESH_TunnelEndHandler cleaner, + const struct GNUNET_MESH_MessageHandler *handlers, + const GNUNET_MESH_ApplicationType *stypes); /** @@ -158,7 +152,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct * * @param handle connection to mesh to disconnect */ -void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); +void +GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); /** @@ -198,20 +193,19 @@ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, * @param disconnect_handler function to call when peers are disconnected * @param handler_cls closure for connect/disconnect handlers */ -struct GNUNET_MESH_Tunnel *GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle - *h, - GNUNET_MESH_TunnelConnectHandler - connect_handler, - GNUNET_MESH_TunnelDisconnectHandler - disconnect_handler, - void *handler_cls); +struct GNUNET_MESH_Tunnel * +GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, + GNUNET_MESH_TunnelConnectHandler connect_handler, + GNUNET_MESH_TunnelDisconnectHandler + disconnect_handler, void *handler_cls); /** * Destroy an existing tunnel. * * @param tun tunnel handle */ -void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); +void +GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); /** @@ -222,10 +216,10 @@ void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); * @param timeout how long to try to establish a connection * @param peer peer to add */ -void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, - struct GNUNET_TIME_Relative timeout, - const struct GNUNET_PeerIdentity - *peer); +void +GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, + struct GNUNET_TIME_Relative timeout, + const struct GNUNET_PeerIdentity *peer); /** @@ -235,9 +229,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, * @param tunnel handle to existing tunnel * @param peer peer to remove */ -void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, - const struct GNUNET_PeerIdentity - *peer); +void +GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, + const struct GNUNET_PeerIdentity *peer); /** @@ -249,12 +243,10 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, * @param app_type application type that must be supported by the peer * (MESH should discover peer in proximity handling this type) */ -void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel - *tunnel, - struct GNUNET_TIME_Relative - timeout, - GNUNET_MESH_ApplicationType - app_type); +void +GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, + struct GNUNET_TIME_Relative timeout, + GNUNET_MESH_ApplicationType app_type); /** @@ -283,25 +275,14 @@ struct GNUNET_MESH_TransmitHandle; * NULL if we can not even queue the request (insufficient * memory); if NULL is returned, "notify" will NOT be called. */ -struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct - GNUNET_MESH_Tunnel - *tunnel, - int cork, - uint32_t - priority, - struct - GNUNET_TIME_Relative - maxdelay, - const - struct - GNUNET_PeerIdentity - *target, - size_t - notify_size, - GNUNET_CONNECTION_TransmitReadyNotify - notify, - void - *notify_cls); +struct GNUNET_MESH_TransmitHandle * +GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, + uint32_t priority, + struct GNUNET_TIME_Relative maxdelay, + const struct GNUNET_PeerIdentity *target, + size_t notify_size, + GNUNET_CONNECTION_TransmitReadyNotify notify, + void *notify_cls); /** @@ -309,8 +290,9 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct * * @param th handle that was returned by "notify_transmit_ready". */ -void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle - *th); +void +GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle + *th); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 30eb50dd8..c521a560c 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h @@ -86,17 +86,13 @@ struct GNUNET_NAT_Handle; * @param callback_cls closure for callback * @return NULL on error, otherwise handle that can be used to unregister */ -struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct - GNUNET_CONFIGURATION_Handle *cfg, - int is_tcp, uint16_t adv_port, - unsigned int num_addrs, - const struct sockaddr **addrs, - const socklen_t * addrlens, - GNUNET_NAT_AddressCallback - address_callback, - GNUNET_NAT_ReversalCallback - reversal_callback, - void *callback_cls); +struct GNUNET_NAT_Handle * +GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp, + uint16_t adv_port, unsigned int num_addrs, + const struct sockaddr **addrs, const socklen_t * addrlens, + GNUNET_NAT_AddressCallback address_callback, + GNUNET_NAT_ReversalCallback reversal_callback, + void *callback_cls); /** @@ -109,8 +105,9 @@ struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct * GNUNET_NO if the address is not plausible, * GNUNET_SYSERR if the address is malformed */ -int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, - socklen_t addrlen); +int +GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, + socklen_t addrlen); /** @@ -121,8 +118,9 @@ int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, * @param h handle (used for configuration) * @param sa the address of the peer (IPv4-only) */ -void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, - const struct sockaddr_in *sa); +void +GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, + const struct sockaddr_in *sa); @@ -132,7 +130,8 @@ void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, * * @param h the handle to stop */ -void GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); +void +GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); /** @@ -163,12 +162,10 @@ typedef void (*GNUNET_NAT_TestCallback) (void *cls, int success); * @param report_cls closure for report * @return handle to cancel NAT test */ -struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct - GNUNET_CONFIGURATION_Handle *cfg, - int is_tcp, uint16_t bnd_port, - uint16_t adv_port, - GNUNET_NAT_TestCallback report, - void *report_cls); +struct GNUNET_NAT_Test * +GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + int is_tcp, uint16_t bnd_port, uint16_t adv_port, + GNUNET_NAT_TestCallback report, void *report_cls); /** @@ -176,7 +173,8 @@ struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct * * @param tst test to stop. */ -void GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); +void +GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); /** @@ -203,13 +201,9 @@ struct GNUNET_NAT_ExternalHandle; * @param cb_cls closure for 'cb' * @return handle for cancellation (can only be used until 'cb' is called), NULL on error */ -struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct - GNUNET_TIME_Relative - timeout, - GNUNET_NAT_IPCallback - cb, - void - *cb_cls); +struct GNUNET_NAT_ExternalHandle * +GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, + GNUNET_NAT_IPCallback cb, void *cb_cls); /** @@ -217,8 +211,8 @@ struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct * * @param eh operation to cancel */ -void GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle - *eh); +void +GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); /** @@ -240,10 +234,9 @@ struct GNUNET_NAT_MiniHandle; * @param ac_cls closure for 'ac' * @return NULL on error */ -struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, - int is_tcp, - GNUNET_NAT_AddressCallback - ac, void *ac_cls); +struct GNUNET_NAT_MiniHandle * +GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp, + GNUNET_NAT_AddressCallback ac, void *ac_cls); /** @@ -254,7 +247,8 @@ struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, * * @param mini the handle */ -void GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); +void +GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); #endif diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 0f38b855f..65b2042d5 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -83,13 +83,10 @@ struct GNUNET_NETWORK_FDSet * @param address_len length of address * @return client socket */ -struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct - GNUNET_NETWORK_Handle - *desc, - struct sockaddr - *address, - socklen_t * - address_len); +struct GNUNET_NETWORK_Handle * +GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, + struct sockaddr *address, + socklen_t * address_len); /** @@ -98,7 +95,8 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct * @param fd socket to box * @return NULL on error (including not supported on target platform) */ -struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd); +struct GNUNET_NETWORK_Handle * +GNUNET_NETWORK_socket_box_native (int fd); /** @@ -109,9 +107,10 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd); * @param address_len length of address * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, - const struct sockaddr *address, - socklen_t address_len); +int +GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, + const struct sockaddr *address, + socklen_t address_len); /** * Close a socket. @@ -119,7 +118,8 @@ int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, * @param desc socket to close * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); +int +GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); /** @@ -130,9 +130,10 @@ int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); * @param address_len of address * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, - const struct sockaddr *address, - socklen_t address_len); +int +GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, + const struct sockaddr *address, + socklen_t address_len); /** @@ -145,9 +146,10 @@ int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, * @param optlen length of optval * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, - int level, int optname, void *optval, - socklen_t * optlen); +int +GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, + int level, int optname, void *optval, + socklen_t * optlen); /** @@ -157,16 +159,18 @@ int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, * @param backlog length of the listen queue * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, - int backlog); +int +GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, + int backlog); /** * How much data is available to be read on this descriptor? * @param desc socket */ -ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct - GNUNET_NETWORK_Handle *desc); +ssize_t +GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle + *desc); /** @@ -178,12 +182,10 @@ ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct * to be filled in by recvfrom * @param addrlen length of the addr */ -ssize_t GNUNET_NETWORK_socket_recvfrom (const struct - GNUNET_NETWORK_Handle - *desc, void *buffer, - size_t length, - struct sockaddr *src_addr, - socklen_t * addrlen); +ssize_t +GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, + void *buffer, size_t length, + struct sockaddr *src_addr, socklen_t * addrlen); /** @@ -194,8 +196,9 @@ ssize_t GNUNET_NETWORK_socket_recvfrom (const struct * @param length length of buffer * @return number of bytes read */ -ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, - void *buffer, size_t length); +ssize_t +GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, + void *buffer, size_t length); /** @@ -206,10 +209,11 @@ ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, * @param timeout relative value when to return * @return number of selected sockets, GNUNET_SYSERR on error */ -int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, - struct GNUNET_NETWORK_FDSet *wfds, - struct GNUNET_NETWORK_FDSet *efds, - struct GNUNET_TIME_Relative timeout); +int +GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, + struct GNUNET_NETWORK_FDSet *wfds, + struct GNUNET_NETWORK_FDSet *efds, + struct GNUNET_TIME_Relative timeout); /** @@ -220,8 +224,9 @@ int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, * @param length size of the buffer * @return number of bytes sent, GNUNET_SYSERR on error */ -ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, - const void *buffer, size_t length); +ssize_t +GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, + const void *buffer, size_t length); /** @@ -235,10 +240,11 @@ ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, * @param dest_len length of address * @return number of bytes sent, GNUNET_SYSERR on error */ -ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, - const void *message, size_t length, - const struct sockaddr *dest_addr, - socklen_t dest_len); +ssize_t +GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, + const void *message, size_t length, + const struct sockaddr *dest_addr, + socklen_t dest_len); /** @@ -251,10 +257,10 @@ ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, * @param option_len size of option_value * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, - int level, int option_name, - const void *option_value, - socklen_t option_len); +int +GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level, + int option_name, const void *option_value, + socklen_t option_len); /** @@ -264,8 +270,8 @@ int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, * @param how type of shutdown * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, - int how); +int +GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how); /** @@ -277,7 +283,8 @@ int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, * @param desc socket * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); +int +GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); /** @@ -290,9 +297,8 @@ int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); * @param protocol network protocol * @return new socket, NULL on error */ -struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, - int type, - int protocol); +struct GNUNET_NETWORK_Handle * +GNUNET_NETWORK_socket_create (int domain, int type, int protocol); /** @@ -300,7 +306,8 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, * * @param fds fd set to clear */ -void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); +void +GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); /** @@ -308,8 +315,9 @@ void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); * @param fds fd set * @param desc socket to add */ -void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, - const struct GNUNET_NETWORK_Handle *desc); +void +GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, + const struct GNUNET_NETWORK_Handle *desc); #ifdef __MINGW32__ @@ -319,9 +327,9 @@ void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, * @param fds fd set * @param h the file handle to add */ -void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct - GNUNET_NETWORK_FDSet - *fds, HANDLE h); +void +GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet + *fds, HANDLE h); #endif @@ -331,8 +339,9 @@ void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct * @param desc socket * @return GNUNET_YES if the socket is in the set */ -int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, - const struct GNUNET_NETWORK_Handle *desc); +int +GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, + const struct GNUNET_NETWORK_Handle *desc); /** @@ -340,8 +349,9 @@ int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, * @param dst the fd set to add to * @param src the fd set to add from */ -void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, - const struct GNUNET_NETWORK_FDSet *src); +void +GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, + const struct GNUNET_NETWORK_FDSet *src); /** @@ -349,8 +359,9 @@ void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, * @param to destination * @param from source */ -void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, - const struct GNUNET_NETWORK_FDSet *from); +void +GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, + const struct GNUNET_NETWORK_FDSet *from); /** @@ -359,7 +370,8 @@ void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, * @param desc wrapper to process * @return POSIX file descriptor */ -int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); +int +GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); /** @@ -368,8 +380,9 @@ int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); * @param from native source set * @param nfds the biggest socket number in from + 1 */ -void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, - const fd_set * from, int nfds); +void +GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, + const fd_set * from, int nfds); /** @@ -378,7 +391,8 @@ void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, * @param to destination * @param nfd native FD to set */ -void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); +void +GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); /** @@ -388,8 +402,9 @@ void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); * @param nfd native FD to test, -1 for none * @return GNUNET_YES if to contains nfd */ -int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, - int nfd); +int +GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, + int nfd); /** @@ -397,8 +412,9 @@ int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, * @param fds fd set * @param h the file handle to add */ -void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, - const struct GNUNET_DISK_FileHandle *h); +void +GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, + const struct GNUNET_DISK_FileHandle *h); /** @@ -407,8 +423,9 @@ void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, * @param h file handle * @return GNUNET_YES if the file handle is part of the set */ -int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, - const struct GNUNET_DISK_FileHandle *h); +int +GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, + const struct GNUNET_DISK_FileHandle *h); /** @@ -417,22 +434,25 @@ int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, * @param fds2 second fd set * @return GNUNET_YES if they do overlap, GNUNET_NO otherwise */ -int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, - const struct GNUNET_NETWORK_FDSet *fds2); +int +GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, + const struct GNUNET_NETWORK_FDSet *fds2); /** * Creates an fd set * @return a new fd set */ -struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void); +struct GNUNET_NETWORK_FDSet * +GNUNET_NETWORK_fdset_create (void); /** * Releases the associated memory of an fd set * @param fds fd set */ -void GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); +void +GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_nse_service.h b/src/include/gnunet_nse_service.h index 91711ef5b..451f2a2dc 100644 --- a/src/include/gnunet_nse_service.h +++ b/src/include/gnunet_nse_service.h @@ -84,10 +84,9 @@ typedef void (*GNUNET_NSE_Callback) (void *cls, * * @return handle to use */ -struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct - GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_NSE_Callback func, - void *func_cls); +struct GNUNET_NSE_Handle * +GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_NSE_Callback func, void *func_cls); /** @@ -96,7 +95,8 @@ struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct * @param h handle to destroy * */ -void GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); +void +GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index d2474d2d8..9d611af9b 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -135,8 +135,8 @@ enum GNUNET_OS_ProcessStatusType * @param dirkind what kind of directory is desired? * @return a pointer to the dir path (to be freed by the caller) */ -char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind - dirkind); +char * +GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind); /** @@ -160,8 +160,9 @@ typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls, const char *name, * @param proc the callback function * @param proc_cls closure for proc */ -void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor - proc, void *proc_cls); +void +GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, + void *proc_cls); /** * @brief Get maximum string length returned by gethostname() @@ -183,7 +184,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor * * @return pointer to the process sturcutre for this process */ -struct GNUNET_OS_Process *GNUNET_OS_process_current (void); +struct GNUNET_OS_Process * +GNUNET_OS_process_current (void); /** @@ -193,7 +195,8 @@ struct GNUNET_OS_Process *GNUNET_OS_process_current (void); * @param sig signal * @return 0 on success, -1 on error */ -int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); +int +GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); /** @@ -201,7 +204,8 @@ int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); * * @param proc pointer to process structure */ -void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); +void +GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); /** * Get the pid of the process in question @@ -210,7 +214,8 @@ void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); * * @return the current process id */ -pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); +pid_t +GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); /** * Set process priority @@ -219,8 +224,9 @@ pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); * @param prio priority value * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, - enum GNUNET_SCHEDULER_Priority prio); +int +GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, + enum GNUNET_SCHEDULER_Priority prio); /** @@ -232,11 +238,10 @@ int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, * @param ... NULL-terminated list of arguments to the process * @return pointer to process structure of the new process, NULL on error */ -struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle - *pipe_stdin, - struct GNUNET_DISK_PipeHandle - *pipe_stdout, - const char *filename, ...); +struct GNUNET_OS_Process * +GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, + struct GNUNET_DISK_PipeHandle *pipe_stdout, + const char *filename, ...); /** @@ -248,14 +253,10 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle * @param va NULL-terminated list of arguments to the process * @return pointer to process structure of the new process, NULL on error */ -struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct - GNUNET_DISK_PipeHandle - *pipe_stdin, - struct - GNUNET_DISK_PipeHandle - *pipe_stdout, - const char *filename, - va_list va); +struct GNUNET_OS_Process * +GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin, + struct GNUNET_DISK_PipeHandle *pipe_stdout, + const char *filename, va_list va); /** * Start a process. @@ -267,9 +268,9 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct * including the process name as the first argument * @return pointer to process structure of the new process, NULL on error */ -struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks, - const char *filename, - char *const argv[]); +struct GNUNET_OS_Process * +GNUNET_OS_start_process_v (const int *lsocks, const char *filename, + char *const argv[]); /** @@ -290,7 +291,8 @@ typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); * * @param cmd handle to the process */ -void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); +void +GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); /** @@ -304,12 +306,10 @@ void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); * @param ... arguments to command * @return NULL on error */ -struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor - proc, void *proc_cls, - struct - GNUNET_TIME_Relative - timeout, - const char *binary, ...); +struct GNUNET_OS_CommandHandle * +GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, + struct GNUNET_TIME_Relative timeout, const char *binary, + ...); /** @@ -320,9 +320,10 @@ struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor * @param code return code/signal number * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise */ -int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, - enum GNUNET_OS_ProcessStatusType *type, - unsigned long *code); +int +GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, + enum GNUNET_OS_ProcessStatusType *type, + unsigned long *code); /** @@ -335,16 +336,17 @@ int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, * @param proc pointer to process structure of the process to wait for * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ -int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); +int +GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); /** * Connects this process to its parent via pipe */ -void GNUNET_OS_install_parent_control_handler (void *cls, - const struct - GNUNET_SCHEDULER_TaskContext - *tc); +void +GNUNET_OS_install_parent_control_handler (void *cls, + const struct + GNUNET_SCHEDULER_TaskContext *tc); /** @@ -358,7 +360,8 @@ void GNUNET_OS_install_parent_control_handler (void *cls, * GNUNET_NO if not SUID (but binary exists) * GNUNET_SYSERR on error (no such binary or not executable) */ -int GNUNET_OS_check_helper_binary (const char *binary); +int +GNUNET_OS_check_helper_binary (const char *binary); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_peer_lib.h b/src/include/gnunet_peer_lib.h index da364dd44..89413aa59 100644 --- a/src/include/gnunet_peer_lib.h +++ b/src/include/gnunet_peer_lib.h @@ -53,7 +53,8 @@ typedef unsigned int GNUNET_PEER_Id; * @param pid identity to find * @return the interned identity or 0. */ -GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); +GNUNET_PEER_Id +GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); /** @@ -63,7 +64,8 @@ GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); * @param pid identity to intern * @return the interned identity. */ -GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); +GNUNET_PEER_Id +GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); /** @@ -72,7 +74,8 @@ GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); * @param id identity to change the RC of * @param delta how much to change the RC */ -void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); +void +GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); /** @@ -81,7 +84,8 @@ void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); * @param ids array of PIDs to decrement the RCs of * @param count size of the ids array */ -void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); +void +GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); /** @@ -90,7 +94,8 @@ void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); * @param id interned PID to convert * @param pid where to write the normal peer identity */ -void GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid); +void +GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid); /* ifndef GNUNET_PEER_LIB_H */ diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 2013eb60f..50bbc458a 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h @@ -54,9 +54,8 @@ struct GNUNET_PEERINFO_Handle; * @return NULL on error (configuration related, actual connection * etablishment may happen asynchronously). */ -struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_PEERINFO_Handle * +GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); @@ -69,7 +68,8 @@ struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct * * @param h handle to disconnect */ -void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); +void +GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); /** @@ -83,8 +83,9 @@ void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); * @param h handle to the peerinfo service * @param hello the verified (!) HELLO message */ -void GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, - const struct GNUNET_HELLO_Message *hello); +void +GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, + const struct GNUNET_HELLO_Message *hello); /** @@ -126,19 +127,12 @@ struct GNUNET_PEERINFO_IteratorContext; * @return NULL on error (in this case, 'callback' is never called!), * otherwise an iterator context */ -struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct - GNUNET_PEERINFO_Handle - *h, - const struct - GNUNET_PeerIdentity - *peer, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_PEERINFO_Processor - callback, - void - *callback_cls); +struct GNUNET_PEERINFO_IteratorContext * +GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, + const struct GNUNET_PeerIdentity *peer, + struct GNUNET_TIME_Relative timeout, + GNUNET_PEERINFO_Processor callback, + void *callback_cls); @@ -147,8 +141,8 @@ struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct * * @param ic context of the iterator to cancel */ -void GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext - *ic); +void +GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic); @@ -170,13 +164,9 @@ struct GNUNET_PEERINFO_NotifyContext; * @param callback_cls closure for callback * @return NULL on error */ -struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - GNUNET_PEERINFO_Processor - callback, - void - *callback_cls); +struct GNUNET_PEERINFO_NotifyContext * +GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_PEERINFO_Processor callback, void *callback_cls); /** @@ -184,7 +174,8 @@ struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct * * @param nc context to stop notifying */ -void GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); +void +GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h index 9608abd4c..fbc7e2617 100644 --- a/src/include/gnunet_plugin_lib.h +++ b/src/include/gnunet_plugin_lib.h @@ -59,7 +59,8 @@ typedef void *(*GNUNET_PLUGIN_Callback) (void *arg); * @param library_name name of the plugin to test if it is installed * @return GNUNET_YES if the plugin exists, GNUNET_NO if not */ -int GNUNET_PLUGIN_test (const char *library_name); +int +GNUNET_PLUGIN_test (const char *library_name); /** * Setup plugin (runs the "init" callback and returns whatever "init" @@ -73,7 +74,8 @@ int GNUNET_PLUGIN_test (const char *library_name); * @param arg argument to the plugin initialization function * @return whatever the initialization function returned, NULL on error */ -void *GNUNET_PLUGIN_load (const char *library_name, void *arg); +void * +GNUNET_PLUGIN_load (const char *library_name, void *arg); /** @@ -85,7 +87,8 @@ void *GNUNET_PLUGIN_load (const char *library_name, void *arg); * @return whatever the shutdown function returned, typically NULL * or a "char *" representing the error message */ -void *GNUNET_PLUGIN_unload (const char *library_name, void *arg); +void * +GNUNET_PLUGIN_unload (const char *library_name, void *arg); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index 8881bfa9d..48d5280ee 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h @@ -66,10 +66,11 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls, char *const *args, * @param task_cls closure for task * @return GNUNET_SYSERR on error, GNUNET_OK on success */ -int GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, - const char *binaryHelp, - const struct GNUNET_GETOPT_CommandLineOption *options, - GNUNET_PROGRAM_Main task, void *task_cls); +int +GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, + const char *binaryHelp, + const struct GNUNET_GETOPT_CommandLineOption *options, + GNUNET_PROGRAM_Main task, void *task_cls); diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index 7a9373cc4..138375fe1 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h @@ -61,8 +61,9 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, * @param delta by how much should the rating be changed? * @return new rating of the namespace */ -int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, - const GNUNET_HashCode * nsid, int delta); +int +GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, + const GNUNET_HashCode * nsid, int delta); /** * Add a pseudonym to the set of known pseudonyms. @@ -73,9 +74,10 @@ int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param id the pseudonym identifier * @param meta metadata for the pseudonym */ -void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, - const GNUNET_HashCode * id, - const struct GNUNET_CONTAINER_MetaData *meta); +void +GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, + const GNUNET_HashCode * id, + const struct GNUNET_CONTAINER_MetaData *meta); /** @@ -86,41 +88,44 @@ void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param closure closure for iterator * @return number of pseudonyms found */ -int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_PSEUDONYM_Iterator iterator, - void *closure); +int +GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_PSEUDONYM_Iterator iterator, void *closure); /** * Register callback to be invoked whenever we discover * a new pseudonym. */ -int GNUNET_PSEUDONYM_discovery_callback_register (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - GNUNET_PSEUDONYM_Iterator - iterator, void *closure); +int +GNUNET_PSEUDONYM_discovery_callback_register (const struct + GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_PSEUDONYM_Iterator + iterator, void *closure); /** * Unregister namespace discovery callback. */ -int GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator - iterator, void *closure); +int +GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator + iterator, void *closure); /** * Return the unique, human readable name for the given pseudonym. * * @return NULL on failure (should never happen) */ -char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle - *cfg, const GNUNET_HashCode * pseudo); +char * +GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg, + const GNUNET_HashCode * pseudo); /** * Get the pseudonym ID belonging to the given human readable name. * * @return GNUNET_OK on success */ -int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, - const char *hname, GNUNET_HashCode * psid); +int +GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *hname, GNUNET_HashCode * psid); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h index f24bf5c5e..e55a014e6 100644 --- a/src/include/gnunet_resolver_service.h +++ b/src/include/gnunet_resolver_service.h @@ -63,13 +63,15 @@ struct GNUNET_RESOLVER_RequestHandle; * * @param cfg configuration to use */ -void GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); +void +GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); /** * Destroy the connection to the resolver service. */ -void GNUNET_RESOLVER_disconnect (void); +void +GNUNET_RESOLVER_disconnect (void); /** @@ -82,16 +84,11 @@ void GNUNET_RESOLVER_disconnect (void); * @param timeout how long to try resolving * @return handle that can be used to cancel the request, NULL on error */ -struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char - *hostname, - int domain, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_RESOLVER_AddressCallback - callback, - void - *callback_cls); +struct GNUNET_RESOLVER_RequestHandle * +GNUNET_RESOLVER_ip_get (const char *hostname, int domain, + struct GNUNET_TIME_Relative timeout, + GNUNET_RESOLVER_AddressCallback callback, + void *callback_cls); /** @@ -104,15 +101,11 @@ struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char * @param timeout how long to try resolving * @return handle that can be used to cancel the request, NULL on error */ -struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_resolve (int - domain, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_RESOLVER_AddressCallback - callback, - void - *cls); +struct GNUNET_RESOLVER_RequestHandle * +GNUNET_RESOLVER_hostname_resolve (int domain, + struct GNUNET_TIME_Relative timeout, + GNUNET_RESOLVER_AddressCallback callback, + void *cls); /** @@ -130,7 +123,8 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls, * * @return local hostname, caller must free */ -char *GNUNET_RESOLVER_local_fqdn_get (void); +char * +GNUNET_RESOLVER_local_fqdn_get (void); /** @@ -145,19 +139,12 @@ char *GNUNET_RESOLVER_local_fqdn_get (void); * @param cls closure for callback * @return handle that can be used to cancel the request, NULL on error */ -struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct - sockaddr - *sa, - socklen_t - salen, - int - do_resolve, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_RESOLVER_HostnameCallback - callback, - void *cls); +struct GNUNET_RESOLVER_RequestHandle * +GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen, + int do_resolve, + struct GNUNET_TIME_Relative timeout, + GNUNET_RESOLVER_HostnameCallback callback, + void *cls); /** @@ -168,7 +155,8 @@ struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct * * @param rh handle of request to cancel */ -void GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); +void +GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 9ab3a3a84..0f80b9cee 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h @@ -224,7 +224,8 @@ typedef int (*GNUNET_SCHEDULER_select) (void *cls, * @param task task to run first (and immediately) * @param task_cls closure of task */ -void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); +void +GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -234,7 +235,8 @@ void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); * priorities and prerequisite tasks). Note that tasks * scheduled AFTER this call may still be delayed arbitrarily. */ -void GNUNET_SCHEDULER_shutdown (); +void +GNUNET_SCHEDULER_shutdown (); /** @@ -248,7 +250,8 @@ void GNUNET_SCHEDULER_shutdown (); * all priority levels * @return number of tasks pending right now */ -unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); +unsigned int +GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); /** @@ -258,7 +261,8 @@ unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); * * * @return reason(s) why the current task is run */ -enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason (); +enum GNUNET_SCHEDULER_Reason +GNUNET_SCHEDULER_get_reason (); /** @@ -268,7 +272,8 @@ enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason (); * * @param task id of the task to cancel * @return the closure of the callback of the cancelled task */ -void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); +void * +GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); /** @@ -280,9 +285,9 @@ void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); * @param task_cls closure of task * @param reason reason for task invocation */ -void GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, - void *task_cls, - enum GNUNET_SCHEDULER_Reason reason); +void +GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls, + enum GNUNET_SCHEDULER_Reason reason); /** @@ -315,13 +320,9 @@ GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum - GNUNET_SCHEDULER_Priority - prio, - GNUNET_SCHEDULER_Task - task, - void - *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -333,8 +334,8 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task - task, void *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -351,12 +352,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int - lifeness, - GNUNET_SCHEDULER_Task - task, - void - *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, + GNUNET_SCHEDULER_Task task, + void *task_cls); /** @@ -371,12 +370,9 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct - GNUNET_TIME_Relative - delay, - GNUNET_SCHEDULER_Task - task, - void *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -395,15 +391,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct - GNUNET_TIME_Relative - delay, - struct - GNUNET_NETWORK_Handle - *rfd, - GNUNET_SCHEDULER_Task - task, - void *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, + struct GNUNET_NETWORK_Handle *rfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -422,15 +413,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct - GNUNET_TIME_Relative - delay, - struct - GNUNET_NETWORK_Handle - *wfd, - GNUNET_SCHEDULER_Task - task, - void *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, + struct GNUNET_NETWORK_Handle *wfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -449,15 +435,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct - GNUNET_TIME_Relative - delay, - const struct - GNUNET_DISK_FileHandle - *rfd, - GNUNET_SCHEDULER_Task - task, - void *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, + const struct GNUNET_DISK_FileHandle *rfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -476,16 +457,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct - GNUNET_TIME_Relative - delay, - const struct - GNUNET_DISK_FileHandle - *wfd, - GNUNET_SCHEDULER_Task - task, - void - *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, + const struct GNUNET_DISK_FileHandle *wfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -520,23 +495,13 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct * @return unique task identifier for the job * only valid until "task" is started! */ -GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum - GNUNET_SCHEDULER_Priority - prio, - GNUNET_SCHEDULER_TaskIdentifier - prerequisite_task, - struct - GNUNET_TIME_Relative - delay, - const struct - GNUNET_NETWORK_FDSet - *rs, - const struct - GNUNET_NETWORK_FDSet - *ws, - GNUNET_SCHEDULER_Task - task, - void *task_cls); +GNUNET_SCHEDULER_TaskIdentifier +GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, + GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, + struct GNUNET_TIME_Relative delay, + const struct GNUNET_NETWORK_FDSet *rs, + const struct GNUNET_NETWORK_FDSet *ws, + GNUNET_SCHEDULER_Task task, void *task_cls); /** * Sets the select function to use in the scheduler (scheduler_select). @@ -544,8 +509,9 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum * @param new_select new select function to use (NULL to reset to default) * @param new_select_cls closure for 'new_select' */ -void GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, - void *new_select_cls); +void +GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, + void *new_select_cls); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index d9663ac82..3d8130c60 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h @@ -122,12 +122,12 @@ struct GNUNET_SERVER_MessageHandler * @return handle for the new server, NULL on error * (typically, "port" already in use) */ -struct GNUNET_SERVER_Handle - *GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, - void *access_cls, - struct GNUNET_NETWORK_Handle **lsocks, - struct GNUNET_TIME_Relative - idle_timeout, int require_found); +struct GNUNET_SERVER_Handle * +GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, + void *access_cls, + struct GNUNET_NETWORK_Handle **lsocks, + struct GNUNET_TIME_Relative idle_timeout, + int require_found); /** * Create a new server. @@ -142,14 +142,12 @@ struct GNUNET_SERVER_Handle * @return handle for the new server, NULL on error * (typically, "port" already in use) */ -struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck - access, void *access_cls, - struct sockaddr *const - *serverAddr, - const socklen_t * socklen, - struct GNUNET_TIME_Relative - idle_timeout, - int require_found); +struct GNUNET_SERVER_Handle * +GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, + struct sockaddr *const *serverAddr, + const socklen_t * socklen, + struct GNUNET_TIME_Relative idle_timeout, + int require_found); /** @@ -157,7 +155,8 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck * * @param s server to destroy */ -void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); +void +GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); /** @@ -173,9 +172,10 @@ void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); * the handlers array must exist until removed * (or server is destroyed). */ -void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, - const struct GNUNET_SERVER_MessageHandler - *handlers); +void +GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, + const struct GNUNET_SERVER_MessageHandler + *handlers); /** @@ -193,12 +193,12 @@ void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, * GNUNET_CONNECTION_notify_transmit_ready_cancel. * NULL if we are already going to notify someone else (busy) */ -struct GNUNET_CONNECTION_TransmitHandle - *GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, - size_t size, - struct GNUNET_TIME_Relative timeout, - GNUNET_CONNECTION_TransmitReadyNotify - callback, void *callback_cls); +struct GNUNET_CONNECTION_TransmitHandle * +GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, + size_t size, + struct GNUNET_TIME_Relative timeout, + GNUNET_CONNECTION_TransmitReadyNotify + callback, void *callback_cls); /** @@ -207,7 +207,8 @@ struct GNUNET_CONNECTION_TransmitHandle * * @param client the client to set the persistent flag on */ -void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); +void +GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); /** * Resume receiving from this client, we are done processing the @@ -221,8 +222,8 @@ void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); * GNUNET_SYSERR to close the connection (signal * serious error) */ -void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, - int success); +void +GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success); /** @@ -233,8 +234,9 @@ void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, * @param client the client to update * @param timeout new timeout for activities on the socket */ -void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, - struct GNUNET_TIME_Relative timeout); +void +GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, + struct GNUNET_TIME_Relative timeout); /** @@ -244,8 +246,9 @@ void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, * * @param client client for which to disable the warning */ -void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client - *client); +void +GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client + *client); /** @@ -263,9 +266,10 @@ void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client * GNUNET_SYSERR if the connection to the * client should be shut down */ -int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, - struct GNUNET_SERVER_Client *sender, - const struct GNUNET_MessageHeader *message); +int +GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, + struct GNUNET_SERVER_Client *sender, + const struct GNUNET_MessageHeader *message); /** @@ -280,12 +284,9 @@ int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, * @return the client handle (client should call * "client_drop" on the return value eventually) */ -struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct - GNUNET_SERVER_Handle - *server, - struct - GNUNET_CONNECTION_Handle - *connection); +struct GNUNET_SERVER_Client * +GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, + struct GNUNET_CONNECTION_Handle *connection); /** @@ -295,7 +296,8 @@ struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct * * @param client the client to keep */ -void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); +void +GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); /** @@ -306,7 +308,8 @@ void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); * * @param client the client to drop */ -void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); +void +GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); /** @@ -317,8 +320,9 @@ void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); * @param addrlen where to store the length of the address * @return GNUNET_OK on success */ -int GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, - void **addr, size_t * addrlen); +int +GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, + void **addr, size_t * addrlen); /** @@ -348,9 +352,10 @@ typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, * @param callback function to call on disconnect * @param callback_cls closure for callback */ -void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, - GNUNET_SERVER_DisconnectCallback callback, - void *callback_cls); +void +GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, + GNUNET_SERVER_DisconnectCallback callback, + void *callback_cls); /** @@ -360,10 +365,10 @@ void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, * @param callback function to call on disconnect * @param callback_cls closure for callback */ -void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle - *server, - GNUNET_SERVER_DisconnectCallback - callback, void *callback_cls); +void +GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server, + GNUNET_SERVER_DisconnectCallback + callback, void *callback_cls); /** @@ -374,7 +379,8 @@ void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle * * @param client the client to disconnect from */ -void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); +void +GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); /** @@ -388,8 +394,8 @@ void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); * @param h server handle * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default */ -void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, - int do_ignore); +void +GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore); @@ -401,7 +407,8 @@ void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, * @param client handle to the client * @return GNUNET_OK on success */ -int GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client); +int +GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client); /** @@ -419,9 +426,8 @@ struct GNUNET_SERVER_TransmitContext; * @param client client to create the context for. * @return NULL on error */ -struct GNUNET_SERVER_TransmitContext - *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client - *client); +struct GNUNET_SERVER_TransmitContext * +GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client *client); /** @@ -434,10 +440,10 @@ struct GNUNET_SERVER_TransmitContext * @param length length of data * @param type type of the message */ -void GNUNET_SERVER_transmit_context_append_data (struct - GNUNET_SERVER_TransmitContext - *tc, const void *data, - size_t length, uint16_t type); +void +GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext + *tc, const void *data, + size_t length, uint16_t type); /** @@ -448,11 +454,12 @@ void GNUNET_SERVER_transmit_context_append_data (struct * @param tc context to use * @param msg message to append */ -void GNUNET_SERVER_transmit_context_append_message (struct - GNUNET_SERVER_TransmitContext - *tc, - const struct - GNUNET_MessageHeader *msg); +void +GNUNET_SERVER_transmit_context_append_message (struct + GNUNET_SERVER_TransmitContext + *tc, + const struct GNUNET_MessageHeader + *msg); /** @@ -464,9 +471,9 @@ void GNUNET_SERVER_transmit_context_append_message (struct * @param tc transmission context to use * @param timeout when to time out and abort the transmission */ -void GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext - *tc, - struct GNUNET_TIME_Relative timeout); +void +GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext *tc, + struct GNUNET_TIME_Relative timeout); @@ -490,10 +497,9 @@ struct GNUNET_SERVER_NotificationContext; * if the queue gets longer than this number of messages * @return handle to the notification context */ -struct GNUNET_SERVER_NotificationContext - *GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle - *server, - unsigned int queue_length); +struct GNUNET_SERVER_NotificationContext * +GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server, + unsigned int queue_length); /** @@ -501,9 +507,10 @@ struct GNUNET_SERVER_NotificationContext * * @param nc context to destroy. */ -void GNUNET_SERVER_notification_context_destroy (struct - GNUNET_SERVER_NotificationContext - *nc); +void +GNUNET_SERVER_notification_context_destroy (struct + GNUNET_SERVER_NotificationContext + *nc); /** @@ -512,11 +519,10 @@ void GNUNET_SERVER_notification_context_destroy (struct * @param nc context to modify * @param client client to add */ -void GNUNET_SERVER_notification_context_add (struct - GNUNET_SERVER_NotificationContext - *nc, - struct GNUNET_SERVER_Client - *client); +void +GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext + *nc, + struct GNUNET_SERVER_Client *client); /** @@ -528,14 +534,13 @@ void GNUNET_SERVER_notification_context_add (struct * @param msg message to send * @param can_drop can this message be dropped due to queue length limitations */ -void GNUNET_SERVER_notification_context_unicast (struct - GNUNET_SERVER_NotificationContext - *nc, - struct GNUNET_SERVER_Client - *client, - const struct - GNUNET_MessageHeader *msg, - int can_drop); +void +GNUNET_SERVER_notification_context_unicast (struct + GNUNET_SERVER_NotificationContext + *nc, + struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader + *msg, int can_drop); /** @@ -545,12 +550,12 @@ void GNUNET_SERVER_notification_context_unicast (struct * @param msg message to send * @param can_drop can this message be dropped due to queue length limitations */ -void GNUNET_SERVER_notification_context_broadcast (struct - GNUNET_SERVER_NotificationContext - *nc, - const struct - GNUNET_MessageHeader *msg, - int can_drop); +void +GNUNET_SERVER_notification_context_broadcast (struct + GNUNET_SERVER_NotificationContext + *nc, + const struct GNUNET_MessageHeader + *msg, int can_drop); @@ -580,9 +585,9 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, void *client, * @param cb_cls closure for cb * @return handle to tokenizer */ -struct GNUNET_SERVER_MessageStreamTokenizer - *GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, - void *cb_cls); +struct GNUNET_SERVER_MessageStreamTokenizer * +GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, + void *cb_cls); /** @@ -601,9 +606,10 @@ struct GNUNET_SERVER_MessageStreamTokenizer * GNUNET_NO if one_shot was set and we have another message ready * GNUNET_SYSERR if the data stream is corrupt */ -int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, - void *client_identity, const char *buf, - size_t size, int purge, int one_shot); +int +GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, + void *client_identity, const char *buf, size_t size, + int purge, int one_shot); /** @@ -611,8 +617,8 @@ int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, * * @param mst tokenizer to destroy */ -void GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer - *mst); +void +GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index 79453cbf6..1641e0f93 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h @@ -59,11 +59,11 @@ extern "C" * zero (in this case, '*addrs' and '*addr_lens' will be * set to NULL). */ -int GNUNET_SERVICE_get_server_addresses (const char *serviceName, - const struct - GNUNET_CONFIGURATION_Handle *cfg, - struct sockaddr ***addrs, - socklen_t ** addr_lens); +int +GNUNET_SERVICE_get_server_addresses (const char *serviceName, + const struct GNUNET_CONFIGURATION_Handle + *cfg, struct sockaddr ***addrs, + socklen_t ** addr_lens); /** @@ -111,9 +111,10 @@ enum GNUNET_SERVICE_Options * @return GNUNET_SYSERR on error, GNUNET_OK * if we shutdown nicely */ -int GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, - enum GNUNET_SERVICE_Options opt, - GNUNET_SERVICE_Main task, void *task_cls); +int +GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, + enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task, + void *task_cls); struct GNUNET_SERVICE_Context; @@ -126,10 +127,9 @@ struct GNUNET_SERVICE_Context; * @param cfg configuration to use * @return NULL on error, service handle */ -struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, - const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_SERVICE_Context * +GNUNET_SERVICE_start (const char *serviceName, + const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -139,9 +139,8 @@ struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, * @param ctx the service context returned from the start function * @return handle to the server for this service, NULL if there is none */ -struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct - GNUNET_SERVICE_Context - *ctx); +struct GNUNET_SERVER_Handle * +GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx); /** @@ -149,7 +148,8 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct * * @param sctx the service context returned from the start function */ -void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx); +void +GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_signal_lib.h b/src/include/gnunet_signal_lib.h index e386ccc0e..1597c76d0 100644 --- a/src/include/gnunet_signal_lib.h +++ b/src/include/gnunet_signal_lib.h @@ -59,9 +59,8 @@ typedef void (*GNUNET_SIGNAL_Handler) (void); * @param handler the function to call * @return context that can be used to restore, NULL on error */ -struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, - GNUNET_SIGNAL_Handler - handler); +struct GNUNET_SIGNAL_Context * +GNUNET_SIGNAL_handler_install (int signal, GNUNET_SIGNAL_Handler handler); /** * Uninstall a previously installed signal hander. @@ -69,7 +68,8 @@ struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, * @param ctx context that was returned when the * signal handler was installed */ -void GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); +void +GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index 90cc612df..c246e7cda 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h @@ -72,11 +72,9 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, * @param cfg services configuration in use * @return handle to use */ -struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char - *subsystem, - const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_STATISTICS_Handle * +GNUNET_STATISTICS_create (const char *subsystem, + const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -87,8 +85,8 @@ struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char * @param sync_first set to GNUNET_YES if pending SET requests should * be completed */ -void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, - int sync_first); +void +GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first); /** @@ -103,9 +101,10 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, * @param proc_cls closure for proc * @return GNUNET_OK on success, GNUNET_SYSERR on error */ -int GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, - const char *subsystem, const char *name, - GNUNET_STATISTICS_Iterator proc, void *proc_cls); +int +GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, + const char *subsystem, const char *name, + GNUNET_STATISTICS_Iterator proc, void *proc_cls); /** @@ -135,19 +134,12 @@ struct GNUNET_STATISTICS_GetHandle; * @param cls closure for proc and cont * @return NULL on error */ -struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct - GNUNET_STATISTICS_Handle - *handle, - const char - *subsystem, - const char *name, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_STATISTICS_Callback - cont, - GNUNET_STATISTICS_Iterator - proc, void *cls); +struct GNUNET_STATISTICS_GetHandle * +GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, + const char *subsystem, const char *name, + struct GNUNET_TIME_Relative timeout, + GNUNET_STATISTICS_Callback cont, + GNUNET_STATISTICS_Iterator proc, void *cls); /** @@ -156,7 +148,8 @@ struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct * * @param gh handle of the request to cancel */ -void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); +void +GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); /** @@ -168,9 +161,9 @@ void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); * @param value new value to set * @param make_persistent should the value be kept across restarts? */ -void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, - const char *name, uint64_t value, - int make_persistent); +void +GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, + const char *name, uint64_t value, int make_persistent); /** * Set statistic value for the peer. Will always use our @@ -181,9 +174,9 @@ void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, * @param delta change in value (added to existing value) * @param make_persistent should the value be kept across restarts? */ -void GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, - const char *name, int64_t delta, - int make_persistent); +void +GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, + const char *name, int64_t delta, int make_persistent); diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index dd78aee35..6413fb102 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h @@ -56,7 +56,8 @@ extern "C" * @param size number of bytes * @return fancy representation of the size (possibly rounded) for humans */ -char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); +char * +GNUNET_STRINGS_byte_size_fancy (unsigned long long size); /** @@ -69,8 +70,8 @@ char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); * @param charset character set to convert from * @return the converted string (0-terminated) */ -char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, - const char *charset); +char * +GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset); /** @@ -81,7 +82,8 @@ char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, * @return the full file name, * NULL is returned on error */ -char *GNUNET_STRINGS_filename_expand (const char *fil); +char * +GNUNET_STRINGS_filename_expand (const char *fil); /** * Fill a buffer of the given size with @@ -104,8 +106,8 @@ char *GNUNET_STRINGS_filename_expand (const char *fil); * @return number of bytes written to the buffer * (or number of bytes that would have been written) */ -size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, - unsigned int count, ...); +size_t +GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, unsigned int count, ...); /** @@ -122,8 +124,9 @@ size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, * @return offset of the character after the last 0-termination * in the buffer, or 0 on error. */ -unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, - unsigned int count, ...); +unsigned int +GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, + unsigned int count, ...); @@ -134,7 +137,8 @@ unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, * @param t the absolute time to convert * @return timestamp in human-readable form */ -char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); +char * +GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); /** @@ -143,8 +147,8 @@ char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); * @param delta time in milli seconds * @return string in human-readable form */ -char *GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative - delta); +char * +GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta); #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index cd673a082..5bedc406c 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h @@ -466,22 +466,15 @@ typedef void (*GNUNET_TESTING_NotifyTopology) (void *cls, * @param cb_cls closure for cb * @return handle to the daemon (actual start will be completed asynchronously) */ -struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - struct - GNUNET_TIME_Relative - timeout, int pretend, - const char *hostname, - const char - *ssh_username, - uint16_t sshport, - const char *hostkey, - GNUNET_TESTING_NotifyHostkeyCreated - hostkey_callback, - void *hostkey_cls, - GNUNET_TESTING_NotifyDaemonRunning - cb, void *cb_cls); +struct GNUNET_TESTING_Daemon * +GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TIME_Relative timeout, int pretend, + const char *hostname, const char *ssh_username, + uint16_t sshport, const char *hostkey, + GNUNET_TESTING_NotifyHostkeyCreated + hostkey_callback, void *hostkey_cls, + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls); /** * Continues GNUnet daemon startup when user wanted to be notified @@ -490,8 +483,8 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct * * @param daemon the daemon to finish starting */ -void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon - *daemon); +void +GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); /** * Check whether the given daemon is running. @@ -501,7 +494,8 @@ void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon * @return GNUNET_YES if the daemon is up, GNUNET_NO if the * daemon is down, GNUNET_SYSERR on error. */ -int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); +int +GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); /** * Restart (stop and start) a GNUnet daemon. @@ -510,9 +504,10 @@ int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); * @param cb function called once the daemon is (re)started * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, - GNUNET_TESTING_NotifyDaemonRunning cb, - void *cb_cls); +void +GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls); /** * Start a peer that has previously been stopped using the daemon_stop @@ -523,10 +518,11 @@ void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, * @param cb the callback for notification when the peer is running * @param cb_cls closure for the callback */ -void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyDaemonRunning cb, - void *cb_cls); +void +GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls); /** * Starts a GNUnet daemon's service. @@ -537,11 +533,12 @@ void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, * @param cb function called once gnunet-arm returns * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, - char *service, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyDaemonRunning cb, - void *cb_cls); +void +GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, + char *service, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls); /** * Starts a GNUnet daemon's service which has been previously turned off. @@ -552,12 +549,13 @@ void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, * @param cb function called once gnunet-arm returns * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon - *d, char *service, - struct GNUNET_TIME_Relative - timeout, - GNUNET_TESTING_NotifyDaemonRunning - cb, void *cb_cls); +void +GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, + char *service, + struct GNUNET_TIME_Relative + timeout, + GNUNET_TESTING_NotifyDaemonRunning + cb, void *cb_cls); /** * Get a certain testing daemon handle. @@ -565,10 +563,9 @@ void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon * @param pg handle to the set of running peers * @param position the number of the peer to return */ -struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct - GNUNET_TESTING_PeerGroup - *pg, - unsigned int position); +struct GNUNET_TESTING_Daemon * +GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, + unsigned int position); /* * Get a daemon by peer identity, so callers can @@ -579,12 +576,9 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct * * @return the daemon on success, or NULL if no such peer identity is found */ -struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct - GNUNET_TESTING_PeerGroup - *pg, - struct - GNUNET_PeerIdentity - *peer_id); +struct GNUNET_TESTING_Daemon * +GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, + struct GNUNET_PeerIdentity *peer_id); /** * Stops a GNUnet daemon. @@ -599,11 +593,11 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct * @param allow_restart GNUNET_YES to restart peer later (using this API) * GNUNET_NO to kill off and clean up for good */ -void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls, int delete_files, - int allow_restart); +void +GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyCompletion cb, void *cb_cls, + int delete_files, int allow_restart); /** @@ -614,10 +608,11 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, * @param cb function called once the configuration was changed * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, - struct GNUNET_CONFIGURATION_Handle *cfg, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); +void +GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, + struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_TESTING_NotifyCompletion cb, + void *cb_cls); /** * Stops a single service of a GNUnet daemon. Used like daemon_stop, @@ -631,11 +626,12 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, * @param cb function called once the service was stopped * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, - char *service, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); +void +GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, + char *service, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyCompletion cb, + void *cb_cls); /** * Read a testing hosts file based on a configuration. @@ -646,9 +642,8 @@ void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, * * @return DLL of hosts on success, NULL on failure */ -struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct - GNUNET_CONFIGURATION_Handle - *cfg); +struct GNUNET_TESTING_Host * +GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -678,31 +673,19 @@ struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct * * @return NULL on error, otherwise handle to control peer group */ -struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - unsigned int - total, - unsigned int - max_concurrent_connections, - unsigned int - max_concurrent_ssh, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_TESTING_NotifyHostkeyCreated - hostkey_callback, - void - *hostkey_cls, - GNUNET_TESTING_NotifyDaemonRunning - cb, void *cb_cls, - GNUNET_TESTING_NotifyConnection - connect_callback, - void - *connect_callback_cls, - const struct - GNUNET_TESTING_Host - *hostnames); +struct GNUNET_TESTING_PeerGroup * +GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + unsigned int total, + unsigned int max_concurrent_connections, + unsigned int max_concurrent_ssh, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyHostkeyCreated + hostkey_callback, void *hostkey_cls, + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls, + GNUNET_TESTING_NotifyConnection connect_callback, + void *connect_callback_cls, + const struct GNUNET_TESTING_Host *hostnames); /** * Function which continues a peer group starting up @@ -710,8 +693,8 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct * * @param pg the peer group to continue starting */ -void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup - *pg); +void +GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); /** @@ -728,13 +711,14 @@ void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup * @param cb function to call at the end * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, - struct GNUNET_TESTING_Daemon *d2, - struct GNUNET_TIME_Relative timeout, - unsigned int max_connect_attempts, - int send_hello, - GNUNET_TESTING_NotifyConnection cb, - void *cb_cls); +void +GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, + struct GNUNET_TESTING_Daemon *d2, + struct GNUNET_TIME_Relative timeout, + unsigned int max_connect_attempts, + int send_hello, + GNUNET_TESTING_NotifyConnection cb, + void *cb_cls); /** @@ -744,9 +728,10 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, * @param callback function to call on completion (or failure) * @param callback_cls closure for the callback function */ -void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, - GNUNET_TESTING_NotifyCompletion callback, - void *callback_cls); +void +GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, + GNUNET_TESTING_NotifyCompletion callback, + void *callback_cls); /** @@ -757,10 +742,10 @@ void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, * @param cb callback to notify upon success or failure * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); +void +GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); /** @@ -770,8 +755,8 @@ void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, * * @return the number of currently running peers in the peer group */ -unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup - *pg); +unsigned int +GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); /** * Simulate churn by stopping some peers (and possibly @@ -796,12 +781,12 @@ unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup * @param cb function to call at the end * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, - char *service, unsigned int voff, - unsigned int von, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); +void +GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, + char *service, unsigned int voff, + unsigned int von, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); /* * Start a given service for each of the peers in the peer group. * @@ -813,11 +798,12 @@ void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, * @param cb_cls closure for cb * */ -void GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, - char *service, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); +void +GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, + char *service, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyCompletion cb, + void *cb_cls); /** * Callback function to process statistic values. @@ -847,10 +833,11 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, * @param proc processing function for each statistic retrieved * @param cls closure to pass to proc */ -void GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, - GNUNET_STATISTICS_Callback cont, - GNUNET_TESTING_STATISTICS_Iterator proc, - void *cls); +void +GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, + GNUNET_STATISTICS_Callback cont, + GNUNET_TESTING_STATISTICS_Iterator proc, + void *cls); /** * Topologies supported for testbeds. @@ -965,8 +952,9 @@ enum GNUNET_TESTING_TopologyOption * @return GNUNET_YES if topology string matched a * known topology, GNUNET_NO if not */ -int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, - const char *topology_string); +int +GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, + const char *topology_string); /** * Get connect topology option from string input. @@ -977,9 +965,10 @@ int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, * @return GNUNET_YES if topology string matched a * known topology, GNUNET_NO if not */ -int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption - *topology_option, - const char *topology_string); +int +GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption + *topology_option, + const char *topology_string); /** @@ -1018,13 +1007,11 @@ int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption * @return the maximum number of connections were all allowed peers * connected to each other */ -unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup - *pg, - enum GNUNET_TESTING_Topology - topology, - enum GNUNET_TESTING_Topology - restrict_topology, - const char *restrict_transports); +unsigned int +GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, + enum GNUNET_TESTING_Topology topology, + enum GNUNET_TESTING_Topology restrict_topology, + const char *restrict_transports); /** * Iterate over all (running) peers in the peer group, retrieve @@ -1034,22 +1021,25 @@ unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup * @param cb callback for topology information * @param cls closure for callback */ -void GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, - GNUNET_TESTING_NotifyTopology cb, void *cls); +void +GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, + GNUNET_TESTING_NotifyTopology cb, void *cls); /** * Stop the connection process temporarily. * * @param pg the peer group to stop connecting */ -void GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); +void +GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); /** * Resume the connection process. * * @param pg the peer group to resume connecting */ -void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); +void +GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); /** * There are many ways to connect peers that are supported by this function. @@ -1073,15 +1063,15 @@ void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); * * @return the number of connections that will be attempted, GNUNET_SYSERR on error */ -int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, - enum GNUNET_TESTING_Topology topology, - enum GNUNET_TESTING_TopologyOption options, - double option_modifier, - struct GNUNET_TIME_Relative - connect_timeout, - unsigned int connect_attempts, - GNUNET_TESTING_NotifyCompletion - notify_callback, void *notify_cls); +int +GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, + enum GNUNET_TESTING_Topology topology, + enum GNUNET_TESTING_TopologyOption options, + double option_modifier, + struct GNUNET_TIME_Relative connect_timeout, + unsigned int connect_attempts, + GNUNET_TESTING_NotifyCompletion + notify_callback, void *notify_cls); /** * Start or stop an individual peer from the given group. @@ -1093,11 +1083,11 @@ int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, * @param cb function to call at the end * @param cb_cls closure for cb */ -void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, - unsigned int offset, int desired_status, - struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); +void +GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, + unsigned int offset, int desired_status, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); /** * Start a peer group with a given number of peers. Notify @@ -1116,23 +1106,14 @@ void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, * * @return NULL on error, otherwise handle to control peer group */ -struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - unsigned int - total, - struct - GNUNET_TIME_Relative - timeout, - GNUNET_TESTING_NotifyConnection - connect_cb, - GNUNET_TESTING_NotifyCompletion - peergroup_cb, - void - *peergroup_cls, - const struct - GNUNET_TESTING_Host - *hostnames); +struct GNUNET_TESTING_PeerGroup * +GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, + unsigned int total, + struct GNUNET_TIME_Relative timeout, + GNUNET_TESTING_NotifyConnection connect_cb, + GNUNET_TESTING_NotifyCompletion peergroup_cb, + void *peergroup_cls, + const struct GNUNET_TESTING_Host *hostnames); /** * Print current topology to a graphviz readable file. @@ -1143,11 +1124,11 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct * @param notify_cb_cls closure for notify_cb * */ -void GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup - *pg, - const char *output_filename, - GNUNET_TESTING_NotifyCompletion - notify_cb, void *notify_cb_cls); +void +GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup *pg, + const char *output_filename, + GNUNET_TESTING_NotifyCompletion + notify_cb, void *notify_cb_cls); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index ffae1ce51..1f157631f 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h @@ -151,34 +151,40 @@ struct GNUNET_TIME_AbsoluteNBO /** * Return relative time of 0ms. */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero (void); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_get_zero (void); /** * Return absolute time of 0ms. */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero (void); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_get_zero (void); /** * Return relative time of 1ms. */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_unit (void); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_get_unit (void); /** * Return "forever". */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever (void); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_get_forever (void); /** * Return "forever". */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_forever (void); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_get_forever (void); /** * Get the current time. * * @return the current time */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_get (void); /** * Convert relative time to an absolute time in the @@ -187,9 +193,8 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void); * @param rel relative time to convert * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) */ -struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct - GNUNET_TIME_Relative - rel); +struct GNUNET_TIME_Absolute +GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); /** * Return the minimum of two relative time values. @@ -198,10 +203,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct * @param t2 other timestamp * @return timestamp that is smaller */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct - GNUNET_TIME_Relative t1, - struct - GNUNET_TIME_Relative t2); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, + struct GNUNET_TIME_Relative t2); /** @@ -211,10 +215,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct * @param t2 other timestamp * @return timestamp that is larger */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct - GNUNET_TIME_Relative t1, - struct - GNUNET_TIME_Relative t2); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, + struct GNUNET_TIME_Relative t2); /** * Return the minimum of two absolute time values. @@ -223,10 +226,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct * @param t2 other timestamp * @return timestamp that is smaller */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct - GNUNET_TIME_Absolute t1, - struct - GNUNET_TIME_Absolute t2); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, + struct GNUNET_TIME_Absolute t2); /** * Return the maximum of two absolute time values. @@ -235,10 +237,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct * @param t2 other timestamp * @return timestamp that is smaller */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct - GNUNET_TIME_Absolute t1, - struct - GNUNET_TIME_Absolute t2); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, + struct GNUNET_TIME_Absolute t2); /** * Given a timestamp in the future, how much time @@ -247,9 +248,8 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct * @param future some absolute time, typically in the future * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. */ -struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct - GNUNET_TIME_Absolute - future); +struct GNUNET_TIME_Relative +GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); /** @@ -262,10 +262,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct * @return remaining duration for the operation, * assuming it continues at the same speed */ -struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct - GNUNET_TIME_Absolute - start, uint64_t finished, - uint64_t total); +struct GNUNET_TIME_Relative +GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, uint64_t finished, + uint64_t total); /** @@ -277,12 +276,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct * @param end some absolute time (typically larger or equal to start) * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start */ -struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct - GNUNET_TIME_Absolute - start, - struct - GNUNET_TIME_Absolute - end); +struct GNUNET_TIME_Relative +GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, + struct GNUNET_TIME_Absolute end); /** * Get the duration of an operation as the @@ -291,9 +287,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct * @param whence some absolute time, typically in the past * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence. */ -struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct - GNUNET_TIME_Absolute - whence); +struct GNUNET_TIME_Relative +GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); /** @@ -304,12 +299,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct * @param duration some relative time to add * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct - GNUNET_TIME_Absolute - start, - struct - GNUNET_TIME_Relative - duration); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, + struct GNUNET_TIME_Relative duration); /** @@ -320,12 +312,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct * @param duration some relative time to subtract * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct - GNUNET_TIME_Absolute - start, - struct - GNUNET_TIME_Relative - duration); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, + struct GNUNET_TIME_Relative duration); /** * Multiply relative time by a given factor. @@ -334,10 +323,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct * @param factor integer to multiply with * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct - GNUNET_TIME_Relative - rel, - unsigned int factor); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, + unsigned int factor); /** * Divide relative time by a given factor. @@ -346,10 +334,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct * @param factor integer to divide by * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct - GNUNET_TIME_Relative - rel, - unsigned int factor); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, + unsigned int factor); /** * Add relative times together. @@ -358,10 +345,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct * @param a2 some other relative time * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct - GNUNET_TIME_Relative a1, - struct - GNUNET_TIME_Relative a2); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, + struct GNUNET_TIME_Relative a2); /** * Subtract relative timestamp from the other. @@ -370,12 +356,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct * @param a2 second timestamp * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct - GNUNET_TIME_Relative - a1, - struct - GNUNET_TIME_Relative - a2); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, + struct GNUNET_TIME_Relative a2); /** @@ -384,9 +367,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct * @param a time to convert * @return converted time value */ -struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct - GNUNET_TIME_Relative - a); +struct GNUNET_TIME_RelativeNBO +GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); /** * Convert relative time from network byte order. @@ -394,9 +376,8 @@ struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct * @param a time to convert * @return converted time value */ -struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct - GNUNET_TIME_RelativeNBO - a); +struct GNUNET_TIME_Relative +GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); /** * Convert relative time to network byte order. @@ -404,9 +385,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct * @param a time to convert * @return converted time value */ -struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct - GNUNET_TIME_Absolute - a); +struct GNUNET_TIME_AbsoluteNBO +GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); /** * Convert relative time from network byte order. @@ -414,9 +394,8 @@ struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct * @param a time to convert * @return converted time value */ -struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct - GNUNET_TIME_AbsoluteNBO - a); +struct GNUNET_TIME_Absolute +GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); /** * Convert a relative time to a string. @@ -426,14 +405,16 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct * * @return string form of the time (as milliseconds) */ -const char *GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); +const char * +GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); /** * Set the timestamp offset for this instance. * * @param offset the offset to skew the locale time by */ -void GNUNET_TIME_set_offset (long long offset); +void +GNUNET_TIME_set_offset (long long offset); #if 0 /* keep Emacsens' auto-indent happy */ { diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 7e0656956..988d55784 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h @@ -468,18 +468,12 @@ typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, * @param nd function to call on disconnect events * @return NULL on error */ -struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - const struct - GNUNET_PeerIdentity - *self, void *cls, - GNUNET_TRANSPORT_ReceiveCallback - rec, - GNUNET_TRANSPORT_NotifyConnect - nc, - GNUNET_TRANSPORT_NotifyDisconnect - nd); +struct GNUNET_TRANSPORT_Handle * +GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, + const struct GNUNET_PeerIdentity *self, void *cls, + GNUNET_TRANSPORT_ReceiveCallback rec, + GNUNET_TRANSPORT_NotifyConnect nc, + GNUNET_TRANSPORT_NotifyDisconnect nd); /** @@ -487,7 +481,8 @@ struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct * * @param handle handle returned from connect */ -void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); +void +GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); /** @@ -497,8 +492,9 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); * @param handle connection to transport service * @param target who we should try to connect to */ -void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, - const struct GNUNET_PeerIdentity *target); +void +GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, + const struct GNUNET_PeerIdentity *target); /** @@ -510,10 +506,11 @@ void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, * @param quota_in incoming bandwidth quota * @param quota_out outgoing bandwidth quota */ -void GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, - const struct GNUNET_PeerIdentity *target, - struct GNUNET_BANDWIDTH_Value32NBO quota_in, - struct GNUNET_BANDWIDTH_Value32NBO quota_out); +void +GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, + const struct GNUNET_PeerIdentity *target, + struct GNUNET_BANDWIDTH_Value32NBO quota_in, + struct GNUNET_BANDWIDTH_Value32NBO quota_out); /** @@ -541,16 +538,13 @@ struct GNUNET_TRANSPORT_TransmitHandle; * non-NULL if the notify callback was queued (can be used to cancel * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) */ -struct GNUNET_TRANSPORT_TransmitHandle - *GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle - *handle, - const struct GNUNET_PeerIdentity - *target, size_t size, - uint32_t priority, - struct GNUNET_TIME_Relative - timeout, - GNUNET_CONNECTION_TransmitReadyNotify - notify, void *notify_cls); +struct GNUNET_TRANSPORT_TransmitHandle * +GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, + const struct GNUNET_PeerIdentity + *target, size_t size, uint32_t priority, + struct GNUNET_TIME_Relative timeout, + GNUNET_CONNECTION_TransmitReadyNotify + notify, void *notify_cls); /** @@ -558,9 +552,10 @@ struct GNUNET_TRANSPORT_TransmitHandle * * @param th handle of the transmission notification request to cancel */ -void GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct - GNUNET_TRANSPORT_TransmitHandle - *th); +void +GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct + GNUNET_TRANSPORT_TransmitHandle + *th); @@ -584,9 +579,10 @@ typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, * @param rec function to call with the HELLO * @param rec_cls closure for rec */ -void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, - GNUNET_TRANSPORT_HelloUpdateCallback rec, - void *rec_cls); +void +GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, + GNUNET_TRANSPORT_HelloUpdateCallback rec, + void *rec_cls); /** @@ -596,9 +592,10 @@ void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, * @param rec function previously registered to be called with the HELLOs * @param rec_cls closure for rec */ -void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, - GNUNET_TRANSPORT_HelloUpdateCallback - rec, void *rec_cls); +void +GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, + GNUNET_TRANSPORT_HelloUpdateCallback rec, + void *rec_cls); /** @@ -612,9 +609,10 @@ void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, * @param cls closure for continuation * */ -void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, - const struct GNUNET_MessageHeader *hello, - GNUNET_SCHEDULER_Task cont, void *cls); +void +GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, + const struct GNUNET_MessageHeader *hello, + GNUNET_SCHEDULER_Task cont, void *cls); /** @@ -630,13 +628,13 @@ void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, * @param aluc function to call with the results * @param aluc_cls closure for aluc */ -void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle - *cfg, const char *address, - size_t addressLen, int numeric, - const char *nameTrans, - struct GNUNET_TIME_Relative timeout, - GNUNET_TRANSPORT_AddressLookUpCallback - aluc, void *aluc_cls); +void +GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, + const char *address, size_t addressLen, + int numeric, const char *nameTrans, + struct GNUNET_TIME_Relative timeout, + GNUNET_TRANSPORT_AddressLookUpCallback aluc, + void *aluc_cls); /** @@ -649,14 +647,14 @@ void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle * @param peer_address_callback function to call with the results * @param peer_address_callback_cls closure for peer_address_callback */ -void GNUNET_TRANSPORT_peer_address_lookup (const struct - GNUNET_CONFIGURATION_Handle *cfg, - const struct GNUNET_PeerIdentity - *peer, - struct GNUNET_TIME_Relative timeout, - GNUNET_TRANSPORT_AddressLookUpCallback - peer_address_callback, - void *peer_address_callback_cls); +void +GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle + *cfg, + const struct GNUNET_PeerIdentity *peer, + struct GNUNET_TIME_Relative timeout, + GNUNET_TRANSPORT_AddressLookUpCallback + peer_address_callback, + void *peer_address_callback_cls); /** @@ -668,12 +666,12 @@ void GNUNET_TRANSPORT_peer_address_lookup (const struct * @param peer_address_callback function to call with the results * @param peer_address_callback_cls closure for peer_address_callback */ -void GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle - *cfg, - struct GNUNET_TIME_Relative timeout, - GNUNET_TRANSPORT_AddressLookUpCallback - peer_address_callback, - void *peer_address_callback_cls); +void +GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_TIME_Relative timeout, + GNUNET_TRANSPORT_AddressLookUpCallback + peer_address_callback, + void *peer_address_callback_cls); /** @@ -708,12 +706,10 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, * @param cb_cls closure for cb * @return NULL on error, otherwise handle for cancellation */ -struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct - GNUNET_CONFIGURATION_Handle - *cfg, - GNUNET_TRANSPORT_BlacklistCallback - cb, - void *cb_cls); +struct GNUNET_TRANSPORT_Blacklist * +GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_TRANSPORT_BlacklistCallback cb, + void *cb_cls); /** @@ -722,7 +718,8 @@ struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct * * @param br handle of the request that is to be cancelled */ -void GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); +void +GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); diff --git a/src/include/gnunet_upnp_service.h b/src/include/gnunet_upnp_service.h index 70e50b354..1ac2ca58e 100644 --- a/src/include/gnunet_upnp_service.h +++ b/src/include/gnunet_upnp_service.h @@ -54,10 +54,11 @@ extern "C" * function will be called with NULL on error * @param cls closure for callback */ -int GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain, - int type, int protocol, uint16_t port, - struct GNUNET_TIME_Relative timeout, - GNUNET_RESOLVER_AddressCallback callback, void *cls); +int +GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain, + int type, int protocol, uint16_t port, + struct GNUNET_TIME_Relative timeout, + GNUNET_RESOLVER_AddressCallback callback, void *cls); #if 0 /* keep Emacsens' auto-indent happy */ diff --git a/src/include/platform.h b/src/include/platform.h index 4f9eb5eda..aa2434731 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -226,7 +226,8 @@ #if !HAVE_ATOLL -long long atoll (const char *nptr); +long long +atoll (const char *nptr); #endif #if ENABLE_NLS diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index fe0ca631d..0fd6b0813 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c @@ -213,8 +213,8 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -static void churn_peers (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/nat/nat.c b/src/nat/nat.c index 6069d40ad..a037e3b20 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c @@ -361,7 +361,8 @@ struct GNUNET_NAT_Handle * * @param h handle to NAT */ -static void start_gnunet_nat_server (struct GNUNET_NAT_Handle *h); +static void +start_gnunet_nat_server (struct GNUNET_NAT_Handle *h); /** @@ -548,8 +549,8 @@ add_ip_to_address_list (struct GNUNET_NAT_Handle *h, * @param cls the NAT handle * @param tc scheduler context */ -static void resolve_dns (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +resolve_dns (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -585,8 +586,8 @@ process_external_ip (void *cls, const struct sockaddr *addr, socklen_t addrlen) * @param cls the NAT handle * @param tc scheduler context */ -static void resolve_hostname (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +resolve_hostname (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c index e88c9ca55..1f5a83d2d 100644 --- a/src/nat/nat_mini.c +++ b/src/nat/nat_mini.c @@ -279,8 +279,8 @@ struct GNUNET_NAT_MiniHandle * @param cls the 'struct GNUNET_NAT_MiniHandle' * @param tc scheduler context */ -static void do_refresh (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +do_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -289,7 +289,8 @@ static void do_refresh (void *cls, * @param cls the 'struct GNUNET_NAT_MiniHandle' * @param line line of output, NULL at the end */ -static void process_map_output (void *cls, const char *line); +static void +process_map_output (void *cls, const char *line); /** @@ -376,8 +377,7 @@ process_refresh_output (void *cls, const char *line) return; /* skip */ if (1 != sscanf (line, - (mini-> - is_tcp) ? "%*u TCP %u->%*s:%*u %*s" : + (mini->is_tcp) ? "%*u TCP %u->%*s:%*u %*s" : "%*u UDP %u->%*s:%*u %*s", &nport)) return; /* skip */ mini->found = GNUNET_YES; diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index df26280c4..4879c5916 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c @@ -263,8 +263,8 @@ connect_nse_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) } -static void churn_peers (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 5f880088f..c82180dfd 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c @@ -498,8 +498,8 @@ get_transmit_delay (int round_offset) * @param cls the 'struct NSEPeerEntry' * @param tc scheduler context */ -static void transmit_task (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +transmit_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** @@ -545,8 +545,9 @@ transmit_ready (void *cls, size_t size, void *buf) GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "In round %llu, sending to `%s' estimate with %u bits\n", (unsigned long long) - GNUNET_TIME_absolute_ntoh (size_estimate_messages[idx].timestamp). - abs_value, GNUNET_i2s (&peer_entry->id), + GNUNET_TIME_absolute_ntoh (size_estimate_messages[idx]. + timestamp).abs_value, + GNUNET_i2s (&peer_entry->id), (unsigned int) ntohl (size_estimate_messages[idx].matching_bits)); #endif if (ntohl (size_estimate_messages[idx].hop_count) == 0) @@ -861,8 +862,8 @@ verify_message_crypto (const struct GNUNET_NSE_FloodMessage *incoming_flood) incoming_flood->proof_of_work)) { GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Proof of work invalid: %llu!\n"), - (unsigned long long) GNUNET_ntohll (incoming_flood-> - proof_of_work)); + (unsigned long long) + GNUNET_ntohll (incoming_flood->proof_of_work)); GNUNET_break_op (0); return GNUNET_NO; } @@ -959,9 +960,9 @@ handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer, GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer)); GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Flood at %llu from `%s' via `%s' at `%s' with bits %u\n", - (unsigned long long) GNUNET_TIME_absolute_ntoh (incoming_flood-> - timestamp). - abs_value, origin, pred, GNUNET_i2s (&my_identity), + (unsigned long long) + GNUNET_TIME_absolute_ntoh (incoming_flood->timestamp).abs_value, + origin, pred, GNUNET_i2s (&my_identity), (unsigned int) matching_bits); } #endif diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c index 8ff0256b9..0eb165fe5 100644 --- a/src/nse/nse_api.c +++ b/src/nse/nse_api.c @@ -85,8 +85,8 @@ struct GNUNET_NSE_Handle * @param cls the handle to the transport service * @param tc scheduler context */ -static void reconnect (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index 4febf2eeb..d1af01405 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c @@ -188,7 +188,8 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h) * * @param h handle to the service */ -static void trigger_transmit (struct GNUNET_PEERINFO_Handle *h); +static void +trigger_transmit (struct GNUNET_PEERINFO_Handle *h); /** @@ -196,7 +197,8 @@ static void trigger_transmit (struct GNUNET_PEERINFO_Handle *h); * * @param h handle to the service */ -static void reconnect (struct GNUNET_PEERINFO_Handle *h); +static void +reconnect (struct GNUNET_PEERINFO_Handle *h); /** * Task scheduled to re-try connecting to the peerinfo service. diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c index 4ec7b2192..9c75b1828 100644 --- a/src/peerinfo/peerinfo_api_notify.c +++ b/src/peerinfo/peerinfo_api_notify.c @@ -76,7 +76,8 @@ struct GNUNET_PEERINFO_NotifyContext * * @param nc our context */ -static void request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); +static void +request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); /** @@ -85,7 +86,8 @@ static void request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); * * @param nc our context */ -static void receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); +static void +receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); /** diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index f4a71cc21..e117e971c 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c @@ -242,14 +242,16 @@ struct GNUNET_STATISTICS_Handle /** * Schedule the next action to be performed. */ -static void schedule_action (struct GNUNET_STATISTICS_Handle *h); +static void +schedule_action (struct GNUNET_STATISTICS_Handle *h); /** * Try to (re)connect to the statistics service. * * @return GNUNET_YES on success, GNUNET_NO on failure. */ -static int try_connect (struct GNUNET_STATISTICS_Handle *ret); +static int +try_connect (struct GNUNET_STATISTICS_Handle *ret); static void @@ -500,8 +502,8 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg) "Processing VALUE done, now reading more\n"); #endif GNUNET_CLIENT_receive (h->client, &receive_stats, h, - GNUNET_TIME_absolute_get_remaining (h->current-> - timeout)); + GNUNET_TIME_absolute_get_remaining (h-> + current->timeout)); h->backoff = GNUNET_TIME_UNIT_MILLISECONDS; return; } @@ -572,8 +574,8 @@ transmit_get (struct GNUNET_STATISTICS_Handle *handle, size_t size, void *buf) #endif handle->receiving = GNUNET_YES; GNUNET_CLIENT_receive (handle->client, &receive_stats, handle, - GNUNET_TIME_absolute_get_remaining (handle->current-> - timeout)); + GNUNET_TIME_absolute_get_remaining (handle-> + current->timeout)); } return msize; } diff --git a/src/testing/test_testing_reconnect.c b/src/testing/test_testing_reconnect.c index 480bafdc6..69b871303 100644 --- a/src/testing/test_testing_reconnect.c +++ b/src/testing/test_testing_reconnect.c @@ -54,7 +54,8 @@ static int phase; * Run the next phase of starting daemons, connecting them and * stopping them again. */ -static void run_phase (); +static void +run_phase (); static void end2_cb (void *cls, const char *emsg) diff --git a/src/testing/testing.c b/src/testing/testing.c index c107ec593..3a712f071 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c @@ -164,8 +164,8 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message) #endif } -static void start_fsm (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); #if WAIT_FOR_HELLO /** @@ -195,10 +195,9 @@ testing_init (void *cls, struct GNUNET_CORE_Handle *server, d->server = NULL; if (GNUNET_YES == d->dead) GNUNET_TESTING_daemon_stop (d, - GNUNET_TIME_absolute_get_remaining (d-> - max_timeout), - d->dead_cb, d->dead_cb_cls, GNUNET_YES, - GNUNET_NO); + GNUNET_TIME_absolute_get_remaining + (d->max_timeout), d->dead_cb, d->dead_cb_cls, + GNUNET_YES, GNUNET_NO); else if (NULL != d->cb) d->cb (d->cb_cls, NULL, d->cfg, d, _("Failed to connect to core service\n")); @@ -233,10 +232,9 @@ testing_init (void *cls, struct GNUNET_CORE_Handle *server, { if (GNUNET_YES == d->dead) GNUNET_TESTING_daemon_stop (d, - GNUNET_TIME_absolute_get_remaining (d-> - max_timeout), - d->dead_cb, d->dead_cb_cls, GNUNET_YES, - GNUNET_NO); + GNUNET_TIME_absolute_get_remaining + (d->max_timeout), d->dead_cb, d->dead_cb_cls, + GNUNET_YES, GNUNET_NO); else if (NULL != d->cb) d->cb (d->cb_cls, &d->id, d->cfg, d, _("Failed to connect to transport service!\n")); @@ -349,8 +347,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != cb) cb (d->cb_cls, NULL, d->cfg, d, (NULL == - d-> - hostname) ? + d->hostname) ? _("Failed to create pipe for `gnunet-peerinfo' process.\n") : _("Failed to create pipe for `ssh' process.\n")); return; @@ -415,9 +412,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != cb) cb (d->cb_cls, NULL, d->cfg, d, (NULL == - d-> - hostname) ? _("Failed to start `gnunet-peerinfo' process.\n") : - _("Failed to start `ssh' process.\n")); + d->hostname) ? _("Failed to start `gnunet-peerinfo' process.\n") + : _("Failed to start `ssh' process.\n")); GNUNET_DISK_pipe_close (d->pipe_stdout); return; } @@ -429,9 +425,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) d->task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining (d->max_timeout), - GNUNET_DISK_pipe_handle (d-> - pipe_stdout, - GNUNET_DISK_PIPE_END_READ), + GNUNET_DISK_pipe_handle + (d->pipe_stdout, + GNUNET_DISK_PIPE_END_READ), &start_fsm, d); } else /* Already have a hostkey! */ @@ -464,9 +460,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) d->task = GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining (d->max_timeout), - GNUNET_DISK_pipe_handle (d-> - pipe_stdout, - GNUNET_DISK_PIPE_END_READ), + GNUNET_DISK_pipe_handle + (d->pipe_stdout, + GNUNET_DISK_PIPE_END_READ), &start_fsm, d); return; } @@ -614,8 +610,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != cb) cb (d->cb_cls, NULL, d->cfg, d, (NULL == - d-> - hostname) ? _("Failed to start `gnunet-arm' process.\n") : + d->hostname) ? _("Failed to start `gnunet-arm' process.\n") : _("Failed to start `ssh' process.\n")); return; } @@ -639,8 +634,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != cb) cb (d->cb_cls, NULL, d->cfg, d, (NULL == - d-> - hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : + d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : _("`ssh' does not seem to terminate.\n")); GNUNET_CONFIGURATION_destroy (d->cfg); GNUNET_free (d->cfgfile); @@ -698,10 +692,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) { if (GNUNET_YES == d->dead) GNUNET_TESTING_daemon_stop (d, - GNUNET_TIME_absolute_get_remaining (d-> - max_timeout), - d->dead_cb, d->dead_cb_cls, GNUNET_YES, - GNUNET_NO); + GNUNET_TIME_absolute_get_remaining + (d->max_timeout), d->dead_cb, + d->dead_cb_cls, GNUNET_YES, GNUNET_NO); else if (NULL != d->cb) d->cb (d->cb_cls, &d->id, d->cfg, d, _("Failed to connect to transport service!\n")); @@ -763,8 +756,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != cb) cb (d->cb_cls, NULL, d->cfg, d, (NULL == - d-> - hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : + d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : _("`ssh' does not seem to terminate.\n")); return; } @@ -782,8 +774,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) if (NULL != cb) cb (d->cb_cls, NULL, d->cfg, d, (NULL == - d-> - hostname) ? + d->hostname) ? _ ("`gnunet-arm' terminated with non-zero exit status (or timed out)!\n") : _("`ssh' does not seem to terminate.\n")); @@ -1946,9 +1937,9 @@ struct ConnectContext /** Forward declaration **/ -static void reattempt_daemons_connect (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +reattempt_daemons_connect (void *cls, + const struct GNUNET_SCHEDULER_TaskContext *tc); /** diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index d03cb307b..88c51abe0 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c @@ -1630,19 +1630,23 @@ remove_connections (struct GNUNET_TESTING_PeerGroup *pg, unsigned int first, } #else if (GNUNET_YES == - GNUNET_CONTAINER_multihashmap_contains (pg->peers[first]. - blacklisted_peers, &hash_second)) + GNUNET_CONTAINER_multihashmap_contains (pg-> + peers[first].blacklisted_peers, + &hash_second)) { - GNUNET_CONTAINER_multihashmap_remove_all (pg->peers[first]. - blacklisted_peers, &hash_second); + GNUNET_CONTAINER_multihashmap_remove_all (pg-> + peers[first].blacklisted_peers, + &hash_second); } if (GNUNET_YES == - GNUNET_CONTAINER_multihashmap_contains (pg->peers[second]. - blacklisted_peers, &hash_first)) + GNUNET_CONTAINER_multihashmap_contains (pg-> + peers[second].blacklisted_peers, + &hash_first)) { - GNUNET_CONTAINER_multihashmap_remove_all (pg->peers[second]. - blacklisted_peers, &hash_first); + GNUNET_CONTAINER_multihashmap_remove_all (pg-> + peers[second].blacklisted_peers, + &hash_first); } #endif @@ -2864,8 +2868,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg) conn_iter = pg->peers[pg_iter].allowed_peers_head; while (conn_iter != NULL) { - GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->id. - hashPubKey, &peer_enc); + GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon-> + id.hashPubKey, &peer_enc); fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc); conn_iter = conn_iter->next; } @@ -3051,15 +3055,16 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, conn_iter = pg->peers[pg_iter].blacklisted_peers_head; while (conn_iter != NULL) { - GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->id. - hashPubKey, &peer_enc); + GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon-> + id.hashPubKey, &peer_enc); fprintf (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc); conn_iter = conn_iter->next; } #else blacklist_ctx.transport = pos; - (void) GNUNET_CONTAINER_multihashmap_iterate (pg->peers[pg_iter]. - blacklisted_peers, + (void) GNUNET_CONTAINER_multihashmap_iterate (pg-> + peers + [pg_iter].blacklisted_peers, &blacklist_file_iterator, &blacklist_ctx); #endif @@ -3176,8 +3181,8 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, } /* Forward Declaration */ -static void schedule_connect (void *cls, - const struct GNUNET_SCHEDULER_TaskContext *tc); +static void +schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Choose a random peer's next connection to create, and @@ -3216,9 +3221,8 @@ preschedule_connect (struct GNUNET_TESTING_PeerGroup *pg) #if USE_SEND_HELLOS /* Forward declaration */ -static void schedule_send_hellos (void *cls, - const struct GNUNET_SCHEDULER_TaskContext - *tc); +static void +schedule_send_hellos (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); /** * Close connections and free the hello context. @@ -3319,19 +3323,19 @@ send_core_connect_requests (void *cls, conn = send_hello_context->peer->connect_peers_head; while (conn != NULL) { - GNUNET_CORE_peer_request_connect (send_hello_context->peer->daemon-> - server, - &send_hello_context->pg->peers[conn-> - index]. - daemon->id, NULL, NULL); + GNUNET_CORE_peer_request_connect (send_hello_context->peer-> + d |