From 502af2167f7c218366666ca4944bd7cc54b5b19a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 15 Aug 2011 21:46:35 +0000 Subject: indentation --- src/include/gettext.h | 22 +- src/include/gnunet_arm_service.h | 15 +- src/include/gnunet_ats_service.h | 105 +-- src/include/gnunet_bandwidth_lib.h | 43 +- src/include/gnunet_bio_lib.h | 74 +- src/include/gnunet_block_lib.h | 81 ++- src/include/gnunet_block_plugin.h | 28 +- src/include/gnunet_chat_service.h | 104 +-- src/include/gnunet_client_lib.h | 35 +- src/include/gnunet_common.h | 31 +- src/include/gnunet_configuration_lib.h | 95 +-- src/include/gnunet_connection_lib.h | 105 ++- src/include/gnunet_container_lib.h | 326 +++++---- src/include/gnunet_core_service.h | 185 ++--- src/include/gnunet_crypto_lib.h | 166 ++--- src/include/gnunet_datacache_lib.h | 38 +- src/include/gnunet_datacache_plugin.h | 34 +- src/include/gnunet_datastore_plugin.h | 63 +- src/include/gnunet_datastore_service.h | 254 ++++--- src/include/gnunet_dht_service.h | 163 +++-- src/include/gnunet_disk_lib.h | 187 ++--- src/include/gnunet_dv_service.h | 3 +- src/include/gnunet_fragmentation_lib.h | 58 +- src/include/gnunet_fs_service.h | 1161 ++++++++++++++++--------------- src/include/gnunet_getopt_lib.h | 10 +- src/include/gnunet_hello_lib.h | 39 +- src/include/gnunet_load_lib.h | 16 +- src/include/gnunet_mesh_service.h | 182 +++-- src/include/gnunet_mesh_service_new.h | 111 +-- src/include/gnunet_nat_lib.h | 90 ++- src/include/gnunet_network_lib.h | 27 +- src/include/gnunet_nse_service.h | 13 +- src/include/gnunet_os_lib.h | 57 +- src/include/gnunet_peer_lib.h | 8 +- src/include/gnunet_peerinfo_service.h | 53 +- src/include/gnunet_pseudonym_lib.h | 8 +- src/include/gnunet_resolver_service.h | 64 +- src/include/gnunet_scheduler_lib.h | 56 +- src/include/gnunet_server_lib.h | 122 ++-- src/include/gnunet_service_lib.h | 26 +- src/include/gnunet_statistics_service.h | 45 +- src/include/gnunet_strings_lib.h | 3 +- src/include/gnunet_testing_lib.h | 254 ++++--- src/include/gnunet_time_lib.h | 70 +- src/include/gnunet_transport_plugin.h | 123 ++-- src/include/gnunet_transport_service.h | 147 ++-- src/include/platform.h | 4 +- src/include/plibc.h | 1020 +++++++++++++-------------- src/include/winproc.h | 8 +- 49 files changed, 3147 insertions(+), 2785 deletions(-) (limited to 'src/include') diff --git a/src/include/gettext.h b/src/include/gettext.h index c89197cfc..0295ac2f5 100644 --- a/src/include/gettext.h +++ b/src/include/gettext.h @@ -23,7 +23,7 @@ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ -# include +#include #else @@ -34,7 +34,7 @@ and also including would fail on SunOS 4, whereas is GNUNET_OK. */ #if defined(__sun) -# include +#include #endif /* Disabled NLS. @@ -42,20 +42,20 @@ for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ -# define gettext(Msgid) ((const char *) (Msgid)) -# define dgettext(Domainname, Msgid) ((const char *) (Msgid)) -# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) -# define ngettext(Msgid1, Msgid2, N) \ +#define gettext(Msgid) ((const char *) (Msgid)) +#define dgettext(Domainname, Msgid) ((const char *) (Msgid)) +#define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) +#define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dngettext(Domainname, Msgid1, Msgid2, N) \ +#define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) -# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ +#define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) /* slight modification here to avoid warnings: generate GNUNET_NO code, not even the cast... */ -# define textdomain(Domainname) -# define bindtextdomain(Domainname, Dirname) -# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) +#define textdomain(Domainname) +#define bindtextdomain(Domainname, Dirname) +#define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index 317105520..e0a0b83ad 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h @@ -59,7 +59,7 @@ typedef void (*GNUNET_ARM_Callback) (void *cls, int success); /** * Handle for interacting with ARM. - */ + */ struct GNUNET_ARM_Handle; @@ -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,8 +83,7 @@ GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @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); /** @@ -107,7 +106,7 @@ GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); */ void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, - const char *service_name, + const char *service_name, struct GNUNET_TIME_Relative timeout, GNUNET_ARM_Callback cb, void *cb_cls); @@ -125,7 +124,7 @@ GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, */ void GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, - const char *service_name, + 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 87bd4eba0..a6149ee5a 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h @@ -58,13 +58,21 @@ struct GNUNET_ATS_Handle; * @param plugin_addr_len number of bytes in addr * @param bandwidth assigned outbound bandwidth for the connection */ -typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification)(void *cls, - const struct GNUNET_PeerIdentity *peer, - const char *plugin_name, - struct Session *session, - const void *plugin_addr, - size_t plugin_addr_len, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth); +typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification) (void *cls, + const struct + GNUNET_PeerIdentity + * peer, + const char + *plugin_name, + struct Session * + session, + const void + *plugin_addr, + size_t + plugin_addr_len, + struct + GNUNET_BANDWIDTH_Value32NBO + bandwidth); /** @@ -75,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); /** @@ -86,8 +94,7 @@ GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @param atc handle */ -void -GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); +void GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); /** @@ -102,14 +109,20 @@ GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); * @param ats performance data for the address (as far as known) * @param ats_count number of performance records in 'ats' */ -typedef void (*GNUNET_ATS_AddressSuggestionCallback)(void *cls, - const struct GNUNET_PeerIdentity *peer, - const char *plugin_name, - const void *plugin_addr, - size_t plugin_addr_len, - struct GNUNET_BANDWIDTH_Value32NBO bandwidth, - const struct GNUNET_TRANSPORT_ATS_Information *ats, - uint32_t ats_count); +typedef void (*GNUNET_ATS_AddressSuggestionCallback) (void *cls, + const struct + GNUNET_PeerIdentity * + peer, + const char *plugin_name, + const void *plugin_addr, + size_t plugin_addr_len, + struct + GNUNET_BANDWIDTH_Value32NBO + bandwidth, + const struct + GNUNET_TRANSPORT_ATS_Information + * ats, + uint32_t ats_count); /** @@ -127,11 +140,15 @@ 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); /** @@ -159,13 +176,13 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); */ 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); + 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); /** @@ -178,7 +195,7 @@ GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, */ void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, - const struct GNUNET_PeerIdentity *peer); + const struct GNUNET_PeerIdentity *peer); /** @@ -190,8 +207,8 @@ GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, */ void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, - const struct GNUNET_PeerIdentity *peer, - const struct Session *session); + const struct GNUNET_PeerIdentity *peer, + const struct Session *session); /** @@ -214,14 +231,14 @@ GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, */ 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); + 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 43e75ed0a..059a6696c 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h @@ -107,9 +107,20 @@ GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); * @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); /** @@ -122,7 +133,7 @@ GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO b */ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, - uint64_t size); + uint64_t size); @@ -135,7 +146,7 @@ GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, */ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, - struct GNUNET_BANDWIDTH_Value32NBO b2); + struct GNUNET_BANDWIDTH_Value32NBO b2); /** @@ -154,8 +165,8 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, */ void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, - struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit, - uint32_t max_carry_s); + struct GNUNET_BANDWIDTH_Value32NBO + bytes_per_second_limit, uint32_t max_carry_s); /** @@ -171,7 +182,7 @@ GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, */ int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, - ssize_t size); + ssize_t size); /** @@ -185,7 +196,7 @@ GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, */ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, - size_t size); + size_t size); /** @@ -195,8 +206,15 @@ GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, * @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); /** @@ -207,7 +225,8 @@ GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); */ void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, - struct GNUNET_BANDWIDTH_Value32NBO bytes_per_second_limit); + 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 15924f1ef..f0b486fd2 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h @@ -60,8 +60,7 @@ 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); /** @@ -73,10 +72,8 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, * @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); /** @@ -89,10 +86,8 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, * @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. @@ -105,9 +100,7 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, * @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); + const char *what, char **result, size_t maxLen); /** @@ -118,9 +111,9 @@ int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, * @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); /** @@ -128,7 +121,7 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, * * @param h hande to open file * @param f address of float to read - */ + */ #define GNUNET_BIO_read_float(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, f, sizeof(float))) @@ -138,7 +131,7 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, * * @param h hande to open file * @param f address of double to read - */ + */ #define GNUNET_BIO_read_double(h, f) (GNUNET_BIO_read_fn (h, __FILE__, __LINE__, f, sizeof(double))) @@ -150,10 +143,9 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, * @param line line number in the code * @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); /** @@ -161,7 +153,7 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, * * @param h hande to open file * @param i address of 32-bit integer to read - */ + */ #define GNUNET_BIO_read_int32(h, i) GNUNET_BIO_read_int32__ (h, __FILE__, __LINE__, (int32_t*) i) @@ -173,10 +165,9 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, * @param line line number in the code * @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); /** @@ -184,7 +175,7 @@ int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, * * @param h hande to open file * @param i address of 64-bit integer to read - */ + */ #define GNUNET_BIO_read_int64(h, i) GNUNET_BIO_read_int64__ (h, __FILE__, __LINE__, (int64_t*) i) @@ -192,6 +183,7 @@ int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, * Handle for buffered writing. */ struct GNUNET_BIO_WriteHandle; + /** * Open a file for writing. * @@ -218,9 +210,8 @@ 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); /** @@ -230,8 +221,7 @@ int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, * @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); @@ -243,8 +233,8 @@ int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, * @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); @@ -253,7 +243,7 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, * * @param h hande to open file * @param f float to write (must be a variable) - */ + */ #define GNUNET_BIO_write_float(h, f) GNUNET_BIO_write (h, &f, sizeof(float)) @@ -263,7 +253,7 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, * * @param h hande to open file * @param f double to write (must be a variable) - */ + */ #define GNUNET_BIO_write_double(h, f) GNUNET_BIO_write (h, &f, sizeof(double)) @@ -273,9 +263,8 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, * @param h hande to open file * @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); /** @@ -284,9 +273,8 @@ int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, * @param h hande to open file * @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 74ae2d322..ae6884869 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h @@ -39,113 +39,113 @@ extern "C" /** * Blocks in the datastore and the datacache must have a unique type. */ -enum GNUNET_BLOCK_Type - { +enum GNUNET_BLOCK_Type +{ /** * Any type of block, used as a wildcard when searching. Should * never be attached to a specific block. */ - GNUNET_BLOCK_TYPE_ANY = 0, + GNUNET_BLOCK_TYPE_ANY = 0, /** * Data block (leaf) in the CHK tree. */ - GNUNET_BLOCK_TYPE_FS_DBLOCK = 1, + GNUNET_BLOCK_TYPE_FS_DBLOCK = 1, /** * Inner block in the CHK tree. */ - GNUNET_BLOCK_TYPE_FS_IBLOCK = 2, + GNUNET_BLOCK_TYPE_FS_IBLOCK = 2, /** * Type of a block representing a keyword search result. Note that * the values for KBLOCK, SBLOCK and NBLOCK must be consecutive. */ - GNUNET_BLOCK_TYPE_FS_KBLOCK = 3, + GNUNET_BLOCK_TYPE_FS_KBLOCK = 3, /** * Type of a block that is used to advertise content in a namespace. */ - GNUNET_BLOCK_TYPE_FS_SBLOCK = 4, + GNUNET_BLOCK_TYPE_FS_SBLOCK = 4, /** * Type of a block that is used to advertise a namespace. */ - GNUNET_BLOCK_TYPE_FS_NBLOCK = 5, + GNUNET_BLOCK_TYPE_FS_NBLOCK = 5, /** * Type of a block representing a block to be encoded on demand from disk. * Should never appear on the network directly. */ - GNUNET_BLOCK_TYPE_FS_ONDEMAND = 6, + GNUNET_BLOCK_TYPE_FS_ONDEMAND = 6, /** * Type of a block that contains a HELLO for a peer (for * DHT find-peer operations). */ - GNUNET_BLOCK_TYPE_DHT_HELLO = 7, + GNUNET_BLOCK_TYPE_DHT_HELLO = 7, /** * Block for testing. */ - GNUNET_BLOCK_TYPE_TEST = 8, + GNUNET_BLOCK_TYPE_TEST = 8, -#if HAVE_MALICIOUS +#if HAVE_MALICIOUS /** * Block for simulating malicious peers. */ - GNUNET_BLOCK_DHT_MALICIOUS_MESSAGE_TYPE = 9, + GNUNET_BLOCK_DHT_MALICIOUS_MESSAGE_TYPE = 9, #endif /** * Block for storing .gnunet-domains */ - GNUNET_BLOCK_TYPE_DNS = 10 - }; + GNUNET_BLOCK_TYPE_DNS = 10 +}; /** * Possible ways for how a block may relate to a query. */ enum GNUNET_BLOCK_EvaluationResult - { +{ /** * Valid result, and there may be more. */ - GNUNET_BLOCK_EVALUATION_OK_MORE = 0, + GNUNET_BLOCK_EVALUATION_OK_MORE = 0, /** * Last possible valid result. */ - GNUNET_BLOCK_EVALUATION_OK_LAST = 1, + GNUNET_BLOCK_EVALUATION_OK_LAST = 1, /** * Valid result, but suppressed because it is a duplicate. */ - GNUNET_BLOCK_EVALUATION_OK_DUPLICATE = 2, + GNUNET_BLOCK_EVALUATION_OK_DUPLICATE = 2, /** * Block does not match query (invalid result) */ - GNUNET_BLOCK_EVALUATION_RESULT_INVALID = 3, + GNUNET_BLOCK_EVALUATION_RESULT_INVALID = 3, /** * Query is valid, no reply given. */ - GNUNET_BLOCK_EVALUATION_REQUEST_VALID = 4, + GNUNET_BLOCK_EVALUATION_REQUEST_VALID = 4, /** * Query format does not match block type (invalid query). For * example, xquery not given or xquery_size not appropriate for * type. */ - GNUNET_BLOCK_EVALUATION_REQUEST_INVALID = 5, + GNUNET_BLOCK_EVALUATION_REQUEST_INVALID = 5, /** * Specified block type not supported by this plugin. */ - GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED = 6 - }; + GNUNET_BLOCK_EVALUATION_TYPE_NOT_SUPPORTED = 6 +}; /** @@ -163,8 +163,7 @@ struct GNUNET_BLOCK_Context; */ void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, - uint32_t mingle_number, - GNUNET_HashCode * hc); + uint32_t mingle_number, GNUNET_HashCode * hc); /** @@ -173,8 +172,9 @@ 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); /** @@ -182,8 +182,7 @@ GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg); * * @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); /** @@ -206,14 +205,13 @@ GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); */ 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_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); /** @@ -231,10 +229,9 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, */ 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); + 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_block_plugin.h b/src/include/gnunet_block_plugin.h index 3d3fb4001..885842157 100644 --- a/src/include/gnunet_block_plugin.h +++ b/src/include/gnunet_block_plugin.h @@ -51,15 +51,14 @@ * @return characterization of result */ typedef enum GNUNET_BLOCK_EvaluationResult - (*GNUNET_BLOCK_EvaluationFunction) (void *cls, - 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); + (*GNUNET_BLOCK_EvaluationFunction) (void *cls, + 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); /** @@ -76,12 +75,11 @@ typedef enum GNUNET_BLOCK_EvaluationResult * (or if extracting a key from a block of this type does not work) */ typedef int - (*GNUNET_BLOCK_GetKeyFunction) (void *cls, - enum GNUNET_BLOCK_Type type, - const void *block, - size_t block_size, - GNUNET_HashCode *key); - + (*GNUNET_BLOCK_GetKeyFunction) (void *cls, + enum GNUNET_BLOCK_Type type, + const void *block, + size_t block_size, GNUNET_HashCode * key); + /** diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h index 0a45cf533..723c280e6 100644 --- a/src/include/gnunet_chat_service.h +++ b/src/include/gnunet_chat_service.h @@ -47,41 +47,41 @@ extern "C" * Options for messaging. Compatible options can be OR'ed together. */ enum GNUNET_CHAT_MsgOptions - { +{ /** * No special options. */ - GNUNET_CHAT_MSG_OPTION_NONE = 0, - + GNUNET_CHAT_MSG_OPTION_NONE = 0, + /** * Encrypt the message so that only the receiver can decrypt it. */ - GNUNET_CHAT_MSG_PRIVATE = 1, - + GNUNET_CHAT_MSG_PRIVATE = 1, + /** * Hide the identity of the sender. */ - GNUNET_CHAT_MSG_ANONYMOUS = 2, - + GNUNET_CHAT_MSG_ANONYMOUS = 2, + /** * Sign the content, authenticating the sender (using the provided private * key, which may represent a pseudonym). */ - GNUNET_CHAT_MSG_AUTHENTICATED = 4, - + GNUNET_CHAT_MSG_AUTHENTICATED = 4, + /** * Require signed acknowledgment before completing delivery (and of course, * only acknowledge if delivery is guaranteed). */ - GNUNET_CHAT_MSG_ACKNOWLEDGED = 8, - + GNUNET_CHAT_MSG_ACKNOWLEDGED = 8, + /** * Authenticate for the receiver, but ensure that receiver cannot prove * authenticity to third parties later. (not yet implemented) */ - GNUNET_CHAT_MSG_OFF_THE_RECORD = 16, - - }; + GNUNET_CHAT_MSG_OFF_THE_RECORD = 16, + +}; /** * Handle for a (joined) chat room. @@ -110,12 +110,15 @@ typedef int (*GNUNET_CHAT_JoinCallback) (void *cls); * accept (but user is away), GNUNET_SYSERR to signal denied delivery */ typedef int (*GNUNET_CHAT_MessageCallback) (void *cls, - struct GNUNET_CHAT_Room *room, - const GNUNET_HashCode *sender, - const struct GNUNET_CONTAINER_MetaData *member_info, - const char *message, - struct GNUNET_TIME_Absolute timestamp, - enum GNUNET_CHAT_MsgOptions options); + struct GNUNET_CHAT_Room * room, + const GNUNET_HashCode * sender, + const struct + GNUNET_CONTAINER_MetaData * + member_info, const char *message, + struct GNUNET_TIME_Absolute + timestamp, + enum GNUNET_CHAT_MsgOptions + options); /** * Callback used for notification that another room member has joined or left. @@ -128,9 +131,14 @@ typedef int (*GNUNET_CHAT_MessageCallback) (void *cls, * @return GNUNET_OK */ typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls, - const struct GNUNET_CONTAINER_MetaData *member_info, - const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded *member_id, - enum GNUNET_CHAT_MsgOptions options); + const struct + GNUNET_CONTAINER_MetaData * + member_info, + const struct + GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded + * member_id, + enum GNUNET_CHAT_MsgOptions + options); /** * Callback used for message delivery confirmations. @@ -144,10 +152,12 @@ typedef int (*GNUNET_CHAT_MemberListCallback) (void *cls, * confirmations from anyone for this message */ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, - struct GNUNET_CHAT_Room *room, + struct GNUNET_CHAT_Room * room, uint32_t orig_seq_number, - struct GNUNET_TIME_Absolute timestamp, - const GNUNET_HashCode *receiver); + struct GNUNET_TIME_Absolute + timestamp, + const GNUNET_HashCode * + receiver); /** * Join a chat room. @@ -173,21 +183,26 @@ 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. @@ -202,15 +217,14 @@ 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); + 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 diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 41dbe4efc..343960426 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h @@ -68,7 +68,7 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char */ void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, - int do_ignore); + int do_ignore); @@ -88,7 +88,7 @@ GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, * handle be completed? */ void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, - int finish_pending_write); + int finish_pending_write); /** * Type of a function to call when we receive a message @@ -111,8 +111,7 @@ typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, * GNUNET_YES on running * GNUNET_SYSERR on failure to transmit message */ -typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, - int reason); +typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, int reason); /** * Read from the service. @@ -125,7 +124,7 @@ typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, GNUNET_CLIENT_MessageHandler handler, void *handler_cls, - struct GNUNET_TIME_Relative timeout); + struct GNUNET_TIME_Relative timeout); /** @@ -155,13 +154,12 @@ struct GNUNET_CLIENT_TransmitHandle; * 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); + *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); /** @@ -170,7 +168,8 @@ struct GNUNET_CLIENT_TransmitHandle * @param th handle from the original request. */ void -GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle *th); +GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle + *th); /** @@ -196,11 +195,11 @@ GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle */ 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); + const struct GNUNET_MessageHeader *hdr, + struct GNUNET_TIME_Relative timeout, + int auto_retry, + GNUNET_CLIENT_MessageHandler rn, + void *rn_cls); /** diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 7e4f82ad4..036249e34 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -45,7 +45,7 @@ #ifdef HAVE_STDARG_H #include #endif - + /** * Version of the API (for entire gnunetutil.so library). */ @@ -193,8 +193,7 @@ GNUNET_log_from (enum GNUNET_ErrorType kind, * @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); /** @@ -206,8 +205,7 @@ GNUNET_log_skip (unsigned int n, int check_reset); * @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); +GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); /** @@ -236,7 +234,7 @@ 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); /** @@ -248,7 +246,7 @@ 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); /** @@ -273,8 +271,7 @@ 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. @@ -515,7 +512,8 @@ 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); /** @@ -569,7 +567,8 @@ 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. @@ -596,11 +595,11 @@ void GNUNET_xgrow_ (void **old, #if __STDC_VERSION__ < 199901L -# if __GNUC__ >= 2 -# define __func__ __FUNCTION__ -# else -# define __func__ "" -# endif +#if __GNUC__ >= 2 +#define __func__ __FUNCTION__ +#else +#define __func__ "" +#endif #endif #endif /*GNUNET_COMMON_H_ */ diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 642bbde53..4ecb3539f 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h @@ -58,8 +58,9 @@ 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); /** @@ -113,9 +114,10 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, * @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); +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 @@ -124,7 +126,8 @@ GNUNET_CONFIGURATION_write_diffs(const struct GNUNET_CONFIGURATION_Handle *cfgDe * @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); /** @@ -135,10 +138,10 @@ int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg * @param option name of the option * @param value value of the option */ -typedef void (*GNUNET_CONFIGURATION_Iterator)(void *cls, - const char *section, - const char *option, - const char *value); +typedef void (*GNUNET_CONFIGURATION_Iterator) (void *cls, + const char *section, + const char *option, + const char *value); /** @@ -147,8 +150,8 @@ typedef void (*GNUNET_CONFIGURATION_Iterator)(void *cls, * @param cls closure * @param section name of the section */ -typedef void (*GNUNET_CONFIGURATION_Section_Iterator)(void *cls, - const char *section); +typedef void (*GNUNET_CONFIGURATION_Section_Iterator) (void *cls, + const char *section); /** @@ -158,9 +161,9 @@ 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); /** @@ -170,9 +173,10 @@ void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg * @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); /** @@ -181,8 +185,8 @@ void GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Ha * @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. @@ -193,8 +197,9 @@ void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cf * @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, +int GNUNET_CONFIGURATION_get_value_number (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option, unsigned long long *number); @@ -208,10 +213,11 @@ int GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Han * @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); /** @@ -222,8 +228,9 @@ int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handl * @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); /** @@ -236,8 +243,9 @@ int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *c * 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, +int GNUNET_CONFIGURATION_get_value_string (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option, char **value); @@ -255,8 +263,7 @@ int GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Han int GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, const char *section, - const char *option, - char **value); + const char *option, char **value); /** * Iterate over the set of filenames stored in a configuration value. @@ -285,10 +292,11 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (const struct * @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); +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 @@ -302,8 +310,9 @@ GNUNET_CONFIGURATION_iterate_section_values (const struct GNUNET_CONFIGURATION_H * 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, +int GNUNET_CONFIGURATION_get_value_choice (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option, const char **choices, const char **value); @@ -317,8 +326,9 @@ int GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Han * @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, +int GNUNET_CONFIGURATION_get_value_yesno (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *section, const char *option); /** @@ -330,8 +340,9 @@ int GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Hand * @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); /** diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index 3184e821b..00b97d903 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h @@ -80,9 +80,11 @@ struct GNUNET_CONNECTION_Credentials * for unknown address family (will be denied). */ typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls, - const struct GNUNET_CONNECTION_Credentials *ucred, - const struct sockaddr * addr, - socklen_t addrlen); + const struct + GNUNET_CONNECTION_Credentials * + ucred, + const struct sockaddr * addr, + socklen_t addrlen); /** @@ -98,10 +100,10 @@ typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls, * @param errCode value of errno (on errors receiving) */ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, - const void *buf, - size_t available, - const struct sockaddr * addr, - socklen_t addrlen, int errCode); + const void *buf, + size_t available, + const struct sockaddr * addr, + socklen_t addrlen, int errCode); /** * Set the persist option on this connection handle. Indicates @@ -110,8 +112,7 @@ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, * * @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,8 +125,7 @@ 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); /** @@ -137,9 +137,8 @@ GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); * @return the boxed socket handle */ struct GNUNET_CONNECTION_Handle - *GNUNET_CONNECTION_create_from_existing (struct - GNUNET_NETWORK_Handle - *osSocket); + *GNUNET_CONNECTION_create_from_existing (struct + GNUNET_NETWORK_Handle *osSocket); /** @@ -152,11 +151,9 @@ struct GNUNET_CONNECTION_Handle * @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); + *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck + access, void *access_cls, + struct GNUNET_NETWORK_Handle *lsock); /** @@ -170,9 +167,10 @@ struct GNUNET_CONNECTION_Handle * @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); + *GNUNET_CONNECTION_create_from_connect (const struct + GNUNET_CONFIGURATION_Handle *cfg, + const char *hostname, + uint16_t port); /** @@ -184,10 +182,11 @@ struct GNUNET_CONNECTION_Handle * @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); @@ -203,10 +202,9 @@ GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct * @return the socket handle */ struct GNUNET_CONNECTION_Handle - *GNUNET_CONNECTION_create_from_sockaddr (int af_family, - const struct sockaddr - *serv_addr, - socklen_t addrlen); + *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). @@ -216,8 +214,7 @@ struct GNUNET_CONNECTION_Handle * @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); /** @@ -229,9 +226,8 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle * @return GNUNET_OK on success */ int GNUNET_CONNECTION_get_address (struct - GNUNET_CONNECTION_Handle - *sock, void **addr, - size_t * addrlen); + GNUNET_CONNECTION_Handle + *sock, void **addr, size_t * addrlen); /** @@ -249,7 +245,7 @@ int GNUNET_CONNECTION_get_address (struct */ void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, - int finish_pending_write); + int finish_pending_write); /** @@ -267,10 +263,10 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, */ void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle - *sock, size_t max, - struct GNUNET_TIME_Relative timeout, - GNUNET_CONNECTION_Receiver receiver, - void *receiver_cls); + *sock, size_t max, + struct GNUNET_TIME_Relative timeout, + GNUNET_CONNECTION_Receiver receiver, + void *receiver_cls); /** @@ -281,9 +277,7 @@ GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle * @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); /** @@ -298,7 +292,8 @@ void *GNUNET_CONNECTION_receive_cancel (struct * @return number of bytes written to buf */ typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, - size_t size, void *buf); + size_t size, + void *buf); /** @@ -337,14 +332,14 @@ struct GNUNET_CONNECTION_TransmitHandle; * 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); + *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); /** @@ -355,8 +350,8 @@ struct GNUNET_CONNECTION_TransmitHandle */ void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct - GNUNET_CONNECTION_TransmitHandle - *h); + GNUNET_CONNECTION_TransmitHandle + *h); /** @@ -367,7 +362,7 @@ GNUNET_CONNECTION_notify_transmit_ready_cancel (struct */ void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, - int do_ignore); + 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 3319b710b..cfc7e0842 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h @@ -62,8 +62,7 @@ struct GNUNET_CONTAINER_BloomFilter; * @return GNUNET_YES if next was updated * GNUNET_NO if there are no more entries */ -typedef int (*GNUNET_HashCodeIterator) (void *cls, - GNUNET_HashCode * next); +typedef int (*GNUNET_HashCodeIterator) (void *cls, GNUNET_HashCode * next); /** @@ -76,15 +75,13 @@ typedef int (*GNUNET_HashCodeIterator) (void *cls, * 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); /** @@ -100,15 +97,13 @@ 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); /** @@ -121,8 +116,7 @@ GNUNET_CONTAINER_bloomfilter_init (const */ int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct GNUNET_CONTAINER_BloomFilter - *bf, char *data, - size_t size); + *bf, char *data, size_t size); /** @@ -159,8 +153,10 @@ 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); @@ -180,9 +176,20 @@ 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 +size_t + + + + + + + + + + + GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter - *bf); + *bf); /** @@ -218,8 +225,8 @@ int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, */ int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, - const struct GNUNET_CONTAINER_BloomFilter *to_or, - size_t size); + const struct GNUNET_CONTAINER_BloomFilter + *to_or, size_t size); /** * Resize a bloom filter. Note that this operation @@ -250,8 +257,7 @@ 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. @@ -259,17 +265,17 @@ 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 @@ -281,11 +287,11 @@ GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); * @param md2 other value to check * @return GNUNET_YES if they are equal */ -int +int GNUNET_CONTAINER_meta_data_test_equal (const struct - GNUNET_CONTAINER_MetaData *md1, - const struct - GNUNET_CONTAINER_MetaData *md2); + GNUNET_CONTAINER_MetaData *md1, + const struct + GNUNET_CONTAINER_MetaData *md2); /** @@ -305,14 +311,13 @@ 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 +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); + const char *plugin_name, + enum EXTRACTOR_MetaType type, + enum EXTRACTOR_MetaFormat format, + const char *data_mime_type, + const char *data, size_t data_len); /** @@ -322,9 +327,9 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, * @param md metadata to extend * @param in metadata to merge */ -void +void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, - const struct GNUNET_CONTAINER_MetaData *in); + const struct GNUNET_CONTAINER_MetaData *in); /** @@ -337,11 +342,10 @@ 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 +int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, - enum EXTRACTOR_MetaType type, - const char *data, - size_t data_len); + enum EXTRACTOR_MetaType type, + const char *data, size_t data_len); /** @@ -349,8 +353,7 @@ 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); /** @@ -359,10 +362,9 @@ GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); * * @param md metadata to modify */ -void +void GNUNET_CONTAINER_meta_data_add_publication_date (struct - GNUNET_CONTAINER_MetaData - *md); + GNUNET_CONTAINER_MetaData *md); /** @@ -374,9 +376,9 @@ GNUNET_CONTAINER_meta_data_add_publication_date (struct * @return number of entries */ int GNUNET_CONTAINER_meta_data_iterate (const struct - GNUNET_CONTAINER_MetaData *md, - EXTRACTOR_MetaDataProcessor - iter, void *iter_cls); + GNUNET_CONTAINER_MetaData *md, + EXTRACTOR_MetaDataProcessor + iter, void *iter_cls); /** * Get the first MD entry of the given type. Caller @@ -388,10 +390,9 @@ int GNUNET_CONTAINER_meta_data_iterate (const struct * @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); /** @@ -405,10 +406,9 @@ 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 @@ -419,10 +419,10 @@ 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 +size_t GNUNET_CONTAINER_meta_data_get_thumbnail (const struct - GNUNET_CONTAINER_MetaData - *md, unsigned char **thumb); + GNUNET_CONTAINER_MetaData + *md, unsigned char **thumb); @@ -463,14 +463,33 @@ 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 - GNUNET_CONTAINER_MetaDataSerializationOptions - opt); + GNUNET_CONTAINER_MetaData *md, + char **target, + size_t max, + enum + GNUNET_CONTAINER_MetaDataSerializationOptions + opt); /** @@ -479,10 +498,28 @@ GNUNET_CONTAINER_meta_data_serialize (const struct * @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); + GNUNET_CONTAINER_MetaData *md); /** @@ -493,9 +530,11 @@ 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 **************************** */ @@ -561,7 +600,7 @@ typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls, * @return NULL on error */ struct GNUNET_CONTAINER_MultiHashMap - *GNUNET_CONTAINER_multihashmap_create (unsigned int len); + *GNUNET_CONTAINER_multihashmap_create (unsigned int len); /** @@ -571,8 +610,7 @@ struct GNUNET_CONTAINER_MultiHashMap * @param map the map */ void GNUNET_CONTAINER_multihashmap_destroy (struct - GNUNET_CONTAINER_MultiHashMap - *map); + GNUNET_CONTAINER_MultiHashMap *map); /** @@ -630,8 +668,7 @@ int GNUNET_CONTAINER_multihashmap_remove_all (struct */ int GNUNET_CONTAINER_multihashmap_contains (const struct GNUNET_CONTAINER_MultiHashMap - *map, - const GNUNET_HashCode * key); + *map, const GNUNET_HashCode * key); /** @@ -645,10 +682,10 @@ int GNUNET_CONTAINER_multihashmap_contains (const struct * GNUNET_NO if not */ int GNUNET_CONTAINER_multihashmap_contains_value (const struct - GNUNET_CONTAINER_MultiHashMap - *map, - const GNUNET_HashCode * key, - const void *value); + GNUNET_CONTAINER_MultiHashMap + *map, + const GNUNET_HashCode * key, + const void *value); /** @@ -667,8 +704,7 @@ int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map, const GNUNET_HashCode * key, void *value, enum - GNUNET_CONTAINER_MultiHashMapOption - opt); + GNUNET_CONTAINER_MultiHashMapOption opt); /** * Get the number of key-value pairs in the map. @@ -886,8 +922,9 @@ 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); /** @@ -905,8 +942,7 @@ 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); /** @@ -926,7 +962,8 @@ GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); * @return cost of the node */ GNUNET_CONTAINER_HeapCostType -GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode *node); +GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode + *node); /** * Iterator for heap @@ -939,9 +976,10 @@ GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode *nod * GNUNET_NO if not. */ typedef int (*GNUNET_CONTAINER_HeapIterator) (void *cls, - struct GNUNET_CONTAINER_HeapNode *node, - void *element, - GNUNET_CONTAINER_HeapCostType cost); + struct GNUNET_CONTAINER_HeapNode * + node, void *element, + GNUNET_CONTAINER_HeapCostType + cost); /** @@ -953,8 +991,8 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) (void *cls, */ void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, - GNUNET_CONTAINER_HeapIterator iterator, - void *iterator_cls); + GNUNET_CONTAINER_HeapIterator iterator, + void *iterator_cls); /** @@ -969,9 +1007,8 @@ 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); /** @@ -985,8 +1022,7 @@ 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); /** @@ -997,10 +1033,12 @@ 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); /** @@ -1009,8 +1047,7 @@ GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, * @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); /** @@ -1019,8 +1056,8 @@ 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); /** @@ -1032,8 +1069,8 @@ GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node); */ void GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, - struct GNUNET_CONTAINER_HeapNode *node, - GNUNET_CONTAINER_HeapCostType new_cost); + struct GNUNET_CONTAINER_HeapNode *node, + GNUNET_CONTAINER_HeapCostType new_cost); /* ******************** Singly linked list *************** */ @@ -1041,24 +1078,24 @@ GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, /** * Possible ways for how data stored in the linked list * might be allocated. - */ + */ enum GNUNET_CONTAINER_SListDisposition - { +{ /** * Single-linked list must copy the buffer. */ - GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT = 0, + GNUNET_CONTAINER_SLIST_DISPOSITION_TRANSIENT = 0, /** * Data is static, no need to copy or free. */ - GNUNET_CONTAINER_SLIST_DISPOSITION_STATIC = 2, + GNUNET_CONTAINER_SLIST_DISPOSITION_STATIC = 2, /** * Data is dynamic, do not copy but free when done. */ - GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC = 4 - }; + GNUNET_CONTAINER_SLIST_DISPOSITION_DYNAMIC = 4 +}; @@ -1080,9 +1117,9 @@ 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); /** @@ -1093,8 +1130,8 @@ void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, * @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); + enum GNUNET_CONTAINER_SListDisposition + disp, const void *buf, size_t len); /** @@ -1103,7 +1140,8 @@ void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, * @param src source */ void -GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, struct GNUNET_CONTAINER_SList *src); +GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, + struct GNUNET_CONTAINER_SList *src); /** @@ -1126,8 +1164,9 @@ 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); /** @@ -1144,7 +1183,8 @@ 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); /** @@ -1169,10 +1209,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); /** @@ -1199,16 +1239,16 @@ 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 447711867..1bf82030d 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h @@ -59,9 +59,11 @@ struct GNUNET_CORE_Handle; * @param atsi performance data for the connection */ typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls, - const struct - GNUNET_PeerIdentity *peer, - const struct GNUNET_TRANSPORT_ATS_Information *atsi); + const struct + GNUNET_PeerIdentity * peer, + const struct + GNUNET_TRANSPORT_ATS_Information + * atsi); /** @@ -76,12 +78,19 @@ typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls, * @param atsi performance data for the connection */ typedef void (*GNUNET_CORE_PeerStatusEventHandler) (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); + 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); /** @@ -91,8 +100,8 @@ typedef void (*GNUNET_CORE_PeerStatusEventHandler) (void *cls, * @param peer peer identity this notification is about */ typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls, - const struct - GNUNET_PeerIdentity *peer); + const struct + GNUNET_PeerIdentity * peer); /** @@ -108,10 +117,11 @@ typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls, * GNUNET_SYSERR to close it (signal serious error) */ typedef int - (*GNUNET_CORE_MessageCallback) (void *cls, - const struct GNUNET_PeerIdentity *other, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_TRANSPORT_ATS_Information *atsi); + (*GNUNET_CORE_MessageCallback) (void *cls, + const struct GNUNET_PeerIdentity * other, + const struct GNUNET_MessageHeader * message, + const struct + GNUNET_TRANSPORT_ATS_Information * atsi); /** @@ -153,13 +163,13 @@ struct GNUNET_CORE_MessageHandler * @param publicKey public key of this peer, NULL if we failed */ typedef void - (*GNUNET_CORE_StartupCallback) (void *cls, - struct GNUNET_CORE_Handle * server, - const struct GNUNET_PeerIdentity * - my_identity, - const struct - GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded * - publicKey); + (*GNUNET_CORE_StartupCallback) (void *cls, + struct GNUNET_CORE_Handle * server, + const struct GNUNET_PeerIdentity * + my_identity, + const struct + GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded * + publicKey); /** @@ -208,19 +218,27 @@ typedef void * @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); /** @@ -251,7 +269,7 @@ struct GNUNET_CORE_PeerRequestHandle; * GNUNET_NO on timeout, * GNUNET_SYSERR if core was shut down */ -typedef void (*GNUNET_CORE_ControlContinuation)(void *cls, int success); +typedef void (*GNUNET_CORE_ControlContinuation) (void *cls, int success); /** @@ -271,11 +289,17 @@ 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); /** @@ -285,7 +309,8 @@ GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, * @param req request handle that was returned for the original request */ void -GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle *req); +GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle + *req); /** @@ -301,13 +326,15 @@ GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle *r * @param preference current traffic preference for the given peer */ typedef void - (*GNUNET_CORE_PeerConfigurationInfoCallback) (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); + (*GNUNET_CORE_PeerConfigurationInfoCallback) (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); @@ -342,15 +369,15 @@ 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); /** @@ -365,7 +392,9 @@ GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, * @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); +GNUNET_CORE_peer_change_preference_cancel (struct + GNUNET_CORE_InformationRequestContext + *irc); /** @@ -435,25 +464,25 @@ 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); /** diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 883664534..ec71a791b 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h @@ -231,8 +231,7 @@ 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); /** @@ -242,8 +241,7 @@ int32_t GNUNET_CRYPTO_crc32_n (const void *buf, * @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); /** @@ -254,7 +252,7 @@ uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, * @return random 64-bit number */ uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, - uint64_t max); + uint64_t max); /** @@ -298,12 +296,12 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct * @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); + size_t len, + const struct GNUNET_CRYPTO_AesSessionKey + *sessionkey, + const struct + GNUNET_CRYPTO_AesInitializationVector *iv, + void *result); /** @@ -316,11 +314,13 @@ ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, * @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); /** @@ -333,9 +333,8 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, */ void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, - const struct GNUNET_CRYPTO_AesSessionKey *skey, - const void *salt, size_t salt_len, - ...); + const struct GNUNET_CRYPTO_AesSessionKey *skey, + const void *salt, size_t salt_len, ...); /** @@ -348,9 +347,8 @@ GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, */ 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); + const struct GNUNET_CRYPTO_AesSessionKey *skey, + const void *salt, size_t salt_len, va_list argp); /** @@ -360,8 +358,7 @@ GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv, * safely cast to char*, a '\\0' termination is set). */ void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, - struct GNUNET_CRYPTO_HashAsciiEncoded - *result); + struct GNUNET_CRYPTO_HashAsciiEncoded *result); /** @@ -370,8 +367,7 @@ 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); /** @@ -386,7 +382,7 @@ int GNUNET_CRYPTO_hash_from_string (const char *enc, * @return number between 0 and UINT32_MAX */ uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, - const GNUNET_HashCode * b); + const GNUNET_HashCode * b); /** @@ -396,9 +392,7 @@ 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); /** @@ -409,11 +403,10 @@ void GNUNET_CRYPTO_hash (const void *block, * @param plaintext_len length of plaintext * @param hmac where to store the hmac */ -void +void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, - const void *plaintext, - size_t plaintext_len, - GNUNET_HashCode *hmac); + const void *plaintext, + size_t plaintext_len, GNUNET_HashCode * hmac); /** @@ -443,12 +436,16 @@ 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); /** @@ -456,8 +453,7 @@ GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, * * @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); /** @@ -467,7 +463,7 @@ GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); * @param result hash code that is randomized */ void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, - GNUNET_HashCode * result); + GNUNET_HashCode * result); /** @@ -516,8 +512,7 @@ void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, struct GNUNET_CRYPTO_AesSessionKey *skey, struct - GNUNET_CRYPTO_AesInitializationVector - *iv); + GNUNET_CRYPTO_AesInitializationVector *iv); /** @@ -527,8 +522,7 @@ 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 @@ -542,7 +536,8 @@ int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, * * @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); /** @@ -580,11 +575,10 @@ int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, * @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); +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); /** @@ -596,11 +590,9 @@ GNUNET_CRYPTO_hmac_derive_key_v(struct GNUNET_CRYPTO_AuthKey *key, * @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, - ...); +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 @@ -615,12 +607,11 @@ GNUNET_CRYPTO_hmac_derive_key(struct GNUNET_CRYPTO_AuthKey *key, * @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, - ...); +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, ...); /** @@ -637,13 +628,12 @@ GNUNET_CRYPTO_hkdf (void *result, * @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); +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); /** @@ -658,11 +648,10 @@ GNUNET_CRYPTO_hkdf_v (void *result, * @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); +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); /** @@ -678,8 +667,8 @@ GNUNET_CRYPTO_kdf_v (void *result, */ int GNUNET_CRYPTO_kdf (void *result, size_t out_len, - const void *xts, size_t xts_len, const void *skm, - size_t skm_len, ...); + const void *xts, size_t xts_len, const void *skm, + size_t skm_len, ...); /** @@ -696,8 +685,9 @@ 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 @@ -714,7 +704,7 @@ GNUNET_CRYPTO_rsa_decode_key (const char *buf, uint16_t len); * permission denied) */ struct GNUNET_CRYPTO_RsaPrivateKey - *GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); + *GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); /** @@ -725,7 +715,7 @@ struct GNUNET_CRYPTO_RsaPrivateKey * @return some private key purely dependent on input */ struct GNUNET_CRYPTO_RsaPrivateKey - *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); + *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); /** @@ -775,11 +765,10 @@ int GNUNET_CRYPTO_rsa_encrypt (const void *block, * @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); /** @@ -792,8 +781,7 @@ ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key */ int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, const struct GNUNET_CRYPTO_RsaSignaturePurpose - *purpose, - struct GNUNET_CRYPTO_RsaSignature *sig); + *purpose, struct GNUNET_CRYPTO_RsaSignature *sig); /** diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index 5fcd99ad4..a1712b809 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h @@ -56,9 +56,10 @@ 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); /** @@ -81,11 +82,11 @@ void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); * @return GNUNET_OK to continue iterating, GNUNET_SYSERR to abort */ typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, - struct GNUNET_TIME_Absolute exp, - const GNUNET_HashCode * key, - size_t size, - const char *data, - enum GNUNET_BLOCK_Type type); + struct GNUNET_TIME_Absolute exp, + const GNUNET_HashCode * key, + size_t size, + const char *data, + enum GNUNET_BLOCK_Type type); /** @@ -99,13 +100,13 @@ 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 +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); + const GNUNET_HashCode * key, + size_t size, + const char *data, + enum GNUNET_BLOCK_Type type, + struct GNUNET_TIME_Absolute discard_time); /** @@ -119,12 +120,11 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, * @param iter_cls closure for iter * @return the number of results found */ -unsigned int +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); + 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_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h index cdacd474b..c7ce0bef1 100644 --- a/src/include/gnunet_datacache_plugin.h +++ b/src/include/gnunet_datacache_plugin.h @@ -45,9 +45,9 @@ extern "C" * @param key key of the content that was deleted * @param size number of bytes that were made available */ -typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls, - const GNUNET_HashCode *key, - size_t size); +typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback) (void *cls, + const GNUNET_HashCode * + key, size_t size); /** @@ -57,7 +57,7 @@ typedef void (*GNUNET_DATACACHE_DeleteNotifyCallback)(void *cls, */ struct GNUNET_DATACACHE_PluginEnvironment { - + /** * Configuration to use. @@ -91,11 +91,12 @@ struct GNUNET_DATACACHE_PluginEnvironment /** * @brief struct returned by the initialization function of the plugin */ -struct GNUNET_DATACACHE_PluginFunctions { +struct GNUNET_DATACACHE_PluginFunctions +{ /** * Closure to pass to all plugin functions. - */ + */ void *cls; /** @@ -108,12 +109,12 @@ struct GNUNET_DATACACHE_PluginFunctions { * @param discard_time when to discard the value in any case * @return 0 on error, number of bytes used otherwise */ - size_t (*put) (void *cls, - const GNUNET_HashCode * key, - size_t size, - const char *data, - enum GNUNET_BLOCK_Type type, - struct GNUNET_TIME_Absolute discard_time); + size_t (*put) (void *cls, + const GNUNET_HashCode * key, + size_t size, + const char *data, + enum GNUNET_BLOCK_Type type, + struct GNUNET_TIME_Absolute discard_time); /** @@ -128,10 +129,9 @@ struct GNUNET_DATACACHE_PluginFunctions { * @return the number of results found */ unsigned int (*get) (void *cls, - const GNUNET_HashCode * key, - enum GNUNET_BLOCK_Type type, - GNUNET_DATACACHE_Iterator iter, - void *iter_cls); + const GNUNET_HashCode * key, + enum GNUNET_BLOCK_Type type, + GNUNET_DATACACHE_Iterator iter, void *iter_cls); /** @@ -140,7 +140,7 @@ struct GNUNET_DATACACHE_PluginFunctions { * * @param cls closure (internal context for the plugin) * @return GNUNET_OK on success, GNUNET_SYSERR on error - */ + */ int (*del) (void *cls); diff --git a/src/include/gnunet_datastore_plugin.h b/src/include/gnunet_datastore_plugin.h index fe4cefb0a..f33588bce 100644 --- a/src/include/gnunet_datastore_plugin.h +++ b/src/include/gnunet_datastore_plugin.h @@ -48,8 +48,7 @@ * @param delta change in disk utilization, * 0 for "reset to empty" */ -typedef void (*DiskUtilizationChange)(void *cls, - int delta); +typedef void (*DiskUtilizationChange) (void *cls, int delta); /** @@ -94,15 +93,14 @@ struct GNUNET_DATASTORE_PluginEnvironment * GNUNET_NO to delete the item */ typedef int (*PluginDatumProcessor) (void *cls, - 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); + 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); /** * Get an estimate of how much space the database is @@ -133,15 +131,14 @@ typedef unsigned long long (*PluginEstimateSize) (void *cls); * GNUNET_SYSERR on failure */ typedef int (*PluginPut) (void *cls, - const GNUNET_HashCode * key, - uint32_t size, - const void *data, - enum GNUNET_BLOCK_Type type, - uint32_t priority, - uint32_t anonymity, - uint32_t replication, - struct GNUNET_TIME_Absolute expiration, - char **msg); + const GNUNET_HashCode * key, + uint32_t size, + const void *data, + enum GNUNET_BLOCK_Type type, + uint32_t priority, + uint32_t anonymity, + uint32_t replication, + struct GNUNET_TIME_Absolute expiration, char **msg); /** @@ -163,11 +160,11 @@ typedef int (*PluginPut) (void *cls, * @param proc_cls closure for proc */ typedef void (*PluginGetKey) (void *cls, - uint64_t offset, - const GNUNET_HashCode *key, - const GNUNET_HashCode *vhash, - enum GNUNET_BLOCK_Type type, - PluginDatumProcessor proc, void *proc_cls); + uint64_t offset, + const GNUNET_HashCode * key, + const GNUNET_HashCode * vhash, + enum GNUNET_BLOCK_Type type, + PluginDatumProcessor proc, void *proc_cls); @@ -182,7 +179,7 @@ typedef void (*PluginGetKey) (void *cls, * @param proc_cls closure for proc */ typedef void (*PluginGetRandom) (void *cls, - PluginDatumProcessor proc, void *proc_cls); + PluginDatumProcessor proc, void *proc_cls); /** @@ -209,10 +206,9 @@ typedef void (*PluginGetRandom) (void *cls, * @return GNUNET_OK on success */ typedef int (*PluginUpdate) (void *cls, - uint64_t uid, - int delta, - struct GNUNET_TIME_Absolute expire, - char **msg); + uint64_t uid, + int delta, + struct GNUNET_TIME_Absolute expire, char **msg); /** @@ -228,10 +224,9 @@ typedef int (*PluginUpdate) (void *cls, * @param proc_cls closure for proc */ typedef void (*PluginGetType) (void *cls, - uint64_t offset, - enum GNUNET_BLOCK_Type type, - PluginDatumProcessor proc, - void *proc_cls); + uint64_t offset, + enum GNUNET_BLOCK_Type type, + PluginDatumProcessor proc, void *proc_cls); /** diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 4671cfbda..58c730aba 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h @@ -75,8 +75,7 @@ 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); /** @@ -89,9 +88,9 @@ void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, * GNUNET_YES (or other positive value) on success * @param msg NULL on success, otherwise an error message */ -typedef void (*GNUNET_DATASTORE_ContinuationWithStatus)(void *cls, - int32_t success, - const char *msg); +typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, + int32_t success, + const char *msg); /** @@ -113,15 +112,21 @@ 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); /** @@ -150,22 +155,29 @@ GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, * 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); /** @@ -189,14 +201,24 @@ GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, * 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); /** @@ -216,16 +238,23 @@ GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, * 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); /** @@ -249,16 +278,23 @@ GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, * 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); /** @@ -276,14 +312,14 @@ GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, * maybe 0 if no unique identifier is available */ typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, - const GNUNET_HashCode * key, - size_t size, - const void *data, - enum GNUNET_BLOCK_Type type, - uint32_t priority, - uint32_t anonymity, - struct GNUNET_TIME_Absolute - expiration, uint64_t uid); + const GNUNET_HashCode * key, + size_t size, + const void *data, + enum GNUNET_BLOCK_Type type, + uint32_t priority, + uint32_t anonymity, + struct GNUNET_TIME_Absolute + expiration, uint64_t uid); /** @@ -307,16 +343,26 @@ 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); /** @@ -343,15 +389,27 @@ GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, * @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); /** @@ -373,13 +431,22 @@ GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, * @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); @@ -389,8 +456,7 @@ GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, * * @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 6660f646b..7c7f646e6 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h @@ -90,29 +90,29 @@ struct GNUNET_DHT_FindPeerHandle; * Options for routing. */ enum GNUNET_DHT_RouteOption - { +{ /** * Default. Do nothing special. */ - GNUNET_DHT_RO_NONE = 0, + GNUNET_DHT_RO_NONE = 0, /** * Each peer along the way should look at 'enc' (otherwise * only the k-peers closest to the key should look at it). */ - GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE = 1, + GNUNET_DHT_RO_DEMULTIPLEX_EVERYWHERE = 1, /** * We should keep track of the route that the message * took in the P2P network. */ - GNUNET_DHT_RO_RECORD_ROUTE = 2, + GNUNET_DHT_RO_RECORD_ROUTE = 2, /** * Possible message option for query key randomization. */ - GNUNET_DHT_RO_BART = 4 - }; + GNUNET_DHT_RO_BART = 4 +}; /** @@ -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,8 +133,7 @@ GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @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 ******************* */ @@ -165,8 +164,7 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const char *data, struct GNUNET_TIME_Absolute exp, struct GNUNET_TIME_Relative timeout, - GNUNET_SCHEDULER_Task cont, - void *cont_cls); + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -184,14 +182,15 @@ GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, * @param size number of bytes in data * @param data pointer to the result data */ -typedef void (*GNUNET_DHT_GetIterator)(void *cls, - struct GNUNET_TIME_Absolute exp, - const GNUNET_HashCode * key, - const struct GNUNET_PeerIdentity * const *get_path, - const struct GNUNET_PeerIdentity * const *put_path, - enum GNUNET_BLOCK_Type type, - size_t size, - const void *data); +typedef void (*GNUNET_DHT_GetIterator) (void *cls, + struct GNUNET_TIME_Absolute exp, + const GNUNET_HashCode * key, + const struct GNUNET_PeerIdentity * + const *get_path, + const struct GNUNET_PeerIdentity * + const *put_path, + enum GNUNET_BLOCK_Type type, + size_t size, const void *data); @@ -215,19 +214,23 @@ 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,8 +241,7 @@ GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *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 *********** */ @@ -251,8 +253,9 @@ GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); * @param cls closure * @param peer hello of a target (peer near key) */ -typedef void (*GNUNET_DHT_FindPeerProcessor)(void *cls, - const struct GNUNET_HELLO_Message *peer); +typedef void (*GNUNET_DHT_FindPeerProcessor) (void *cls, + const struct GNUNET_HELLO_Message + * peer); /** @@ -267,13 +270,21 @@ 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); /** @@ -300,10 +311,12 @@ GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle); * to the peers on the PUT path (or NULL if not recorded) * @param reply response */ -typedef void (*GNUNET_DHT_ReplyProcessor)(void *cls, - const GNUNET_HashCode *key, - const struct GNUNET_PeerIdentity * const *outgoing_path, - const struct GNUNET_MessageHeader *reply); +typedef void (*GNUNET_DHT_ReplyProcessor) (void *cls, + const GNUNET_HashCode * key, + const struct GNUNET_PeerIdentity * + const *outgoing_path, + const struct GNUNET_MessageHeader * + reply); /** @@ -327,17 +340,25 @@ 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); @@ -346,8 +367,7 @@ GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *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 ******* */ @@ -366,8 +386,7 @@ GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); */ void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, - GNUNET_SCHEDULER_Task cont, - void *cont_cls); + GNUNET_SCHEDULER_Task cont, void *cont_cls); /* ***** Special API for testing robustness with malicious peers ******* */ @@ -387,9 +406,9 @@ 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); /** @@ -401,10 +420,10 @@ GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, GNUNET_SCHED * @param cont continuation to call when done (transmitting request to service) * @param cont_cls closure for cont */ -void +void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, - struct GNUNET_TIME_Relative frequency, GNUNET_SCHEDULER_Task cont, - void *cont_cls); + struct GNUNET_TIME_Relative frequency, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -418,8 +437,8 @@ GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, */ void GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, - struct GNUNET_TIME_Relative frequency, GNUNET_SCHEDULER_Task cont, - void *cont_cls); + 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 fdccebab0..5732a27d6 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h @@ -36,7 +36,8 @@ struct GNUNET_DISK_FileHandle; struct GNUNET_DISK_PipeHandle; -enum GNUNET_FILE_Type { +enum GNUNET_FILE_Type +{ GNUNET_DISK_FILE, GNUNET_PIPE }; @@ -74,7 +75,7 @@ struct GNUNET_DISK_FileHandle int fd; #endif /* - */ + */ }; @@ -99,159 +100,159 @@ extern "C" * Specifies how a file should be opened. */ enum GNUNET_DISK_OpenFlags - { +{ /** * Open the file for reading */ - GNUNET_DISK_OPEN_READ = 1, - + GNUNET_DISK_OPEN_READ = 1, + /** * Open the file for writing */ - GNUNET_DISK_OPEN_WRITE = 2, - + GNUNET_DISK_OPEN_WRITE = 2, + /** * Open the file for both reading and writing */ - GNUNET_DISK_OPEN_READWRITE = 3, - + GNUNET_DISK_OPEN_READWRITE = 3, + /** * Fail if file already exists */ - GNUNET_DISK_OPEN_FAILIFEXISTS = 4, - + GNUNET_DISK_OPEN_FAILIFEXISTS = 4, + /** * Truncate file if it exists */ - GNUNET_DISK_OPEN_TRUNCATE = 8, - + GNUNET_DISK_OPEN_TRUNCATE = 8, + /** * Create file if it doesn't exist */ - GNUNET_DISK_OPEN_CREATE = 16, + GNUNET_DISK_OPEN_CREATE = 16, /** * Append to the file */ - GNUNET_DISK_OPEN_APPEND = 32 - }; + GNUNET_DISK_OPEN_APPEND = 32 +}; /** * Specifies what type of memory map is desired. */ enum GNUNET_DISK_MapType - { +{ /** * Read-only memory map. */ - GNUNET_DISK_MAP_TYPE_READ = 1, + GNUNET_DISK_MAP_TYPE_READ = 1, /** * Write-able memory map. */ - GNUNET_DISK_MAP_TYPE_WRITE = 2, + GNUNET_DISK_MAP_TYPE_WRITE = 2, /** * Read-write memory map. */ - GNUNET_DISK_MAP_TYPE_READWRITE = 3 - }; + GNUNET_DISK_MAP_TYPE_READWRITE = 3 +}; /** * File access permissions, UNIX-style. */ enum GNUNET_DISK_AccessPermissions - { +{ /** * Nobody is allowed to do anything to the file. */ - GNUNET_DISK_PERM_NONE = 0, + GNUNET_DISK_PERM_NONE = 0, /** * Owner can read. */ - GNUNET_DISK_PERM_USER_READ = 1, + GNUNET_DISK_PERM_USER_READ = 1, /** * Owner can write. */ - GNUNET_DISK_PERM_USER_WRITE = 2, + GNUNET_DISK_PERM_USER_WRITE = 2, /** * Owner can execute. */ - GNUNET_DISK_PERM_USER_EXEC = 4, + GNUNET_DISK_PERM_USER_EXEC = 4, /** * Group can read. */ - GNUNET_DISK_PERM_GROUP_READ = 8, + GNUNET_DISK_PERM_GROUP_READ = 8, /** * Group can write. */ - GNUNET_DISK_PERM_GROUP_WRITE = 16, + GNUNET_DISK_PERM_GROUP_WRITE = 16, /** * Group can execute. */ - GNUNET_DISK_PERM_GROUP_EXEC = 32, + GNUNET_DISK_PERM_GROUP_EXEC = 32, /** * Everybody can read. */ - GNUNET_DISK_PERM_OTHER_READ = 64, + GNUNET_DISK_PERM_OTHER_READ = 64, /** * Everybody can write. */ - GNUNET_DISK_PERM_OTHER_WRITE = 128, + GNUNET_DISK_PERM_OTHER_WRITE = 128, /** * Everybody can execute. */ - GNUNET_DISK_PERM_OTHER_EXEC = 256 - }; + GNUNET_DISK_PERM_OTHER_EXEC = 256 +}; /** * Constants for specifying how to seek. */ -enum GNUNET_DISK_Seek - { +enum GNUNET_DISK_Seek +{ /** * Seek an absolute position (from the start of the file). */ - GNUNET_DISK_SEEK_SET, + GNUNET_DISK_SEEK_SET, /** * Seek a relative position (from the current offset). */ - GNUNET_DISK_SEEK_CUR, - + GNUNET_DISK_SEEK_CUR, + /** * Seek an absolute position from the end of the file. */ - GNUNET_DISK_SEEK_END - }; + GNUNET_DISK_SEEK_END +}; /** * Enumeration identifying the two ends of a pipe. */ enum GNUNET_DISK_PipeEnd - { +{ /** * The reading-end of a pipe. */ - GNUNET_DISK_PIPE_END_READ = 0, + GNUNET_DISK_PIPE_END_READ = 0, /** * The writing-end of a pipe. */ - GNUNET_DISK_PIPE_END_WRITE = 1 - }; + GNUNET_DISK_PIPE_END_WRITE = 1 +}; /** @@ -292,9 +293,8 @@ int GNUNET_DISK_file_test (const char *fil); * @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); +GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, + off_t offset, enum GNUNET_DISK_Seek whence); /** @@ -310,8 +310,7 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, * @return GNUNET_OK on success, GNUNET_SYSERR on error */ int GNUNET_DISK_file_size (const char *filename, - uint64_t *size, - int includeSymLinks); + uint64_t * size, int includeSymLinks); /** @@ -330,9 +329,8 @@ int GNUNET_DISK_file_size (const char *filename, * @return GNUNET_OK on success */ int GNUNET_DISK_file_get_identifiers (const char *filename, - uint64_t *dev, - uint64_t *ino); - + uint64_t * dev, uint64_t * ino); + /** * Create an (empty) temporary file on disk. If the given name is not @@ -345,8 +343,7 @@ int GNUNET_DISK_file_get_identifiers (const char *filename, * @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); /** @@ -362,8 +359,11 @@ GNUNET_DISK_mktemp (const char *t); * @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); + enum GNUNET_DISK_OpenFlags + flags, + enum + GNUNET_DISK_AccessPermissions + perm); /** * Creates an interprocess channel @@ -373,8 +373,8 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, * @return handle to the new pipe, NULL on error */ struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, - int inherit_read, - int inherit_write); + int inherit_read, + int inherit_write); /** @@ -392,8 +392,8 @@ int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); * @return GNUNET_OK on success, GNUNET_SYSERR otherwise */ int -GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, - enum GNUNET_DISK_PipeEnd end); +GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, + enum GNUNET_DISK_PipeEnd end); /** * Close an open file. @@ -411,11 +411,12 @@ 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. @@ -424,8 +425,8 @@ 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); /** @@ -436,9 +437,7 @@ ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, void *res * @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); /** @@ -449,9 +448,8 @@ ssize_t GNUNET_DISK_fn_read (const char *fn, * @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); /** @@ -464,10 +462,10 @@ 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); /** @@ -489,8 +487,8 @@ int GNUNET_DISK_file_copy (const char *src, const char *dst); * @return the number of files found, -1 on error */ int GNUNET_DISK_directory_scan (const char *dirName, - GNUNET_FileNameCallback callback, - void *callback_cls); + GNUNET_FileNameCallback callback, + void *callback_cls); /** @@ -603,7 +601,7 @@ int GNUNET_DISK_directory_create (const char *dir); */ int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, - off_t lockEnd, int excl); + off_t lockEnd, int excl); /** @@ -614,9 +612,8 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, * @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); +GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, + off_t unlockStart, off_t unlockEnd); /** @@ -649,8 +646,8 @@ 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, ...); /** @@ -666,9 +663,9 @@ 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 @@ -693,7 +690,12 @@ int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); * @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); + enum + GNUNET_DISK_OpenFlags + flags, + enum + GNUNET_DISK_AccessPermissions + perm); /** * Opens already existing named pipe/FIFO @@ -704,7 +706,12 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, * @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); + enum + GNUNET_DISK_OpenFlags + flags, + enum + GNUNET_DISK_AccessPermissions + perm); /** * Closes a named pipe/FIFO diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h index 65f0ee5f6..0da76c56c 100644 --- a/src/include/gnunet_dv_service.h +++ b/src/include/gnunet_dv_service.h @@ -76,8 +76,7 @@ int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, struct GNUNET_TIME_Relative timeout, const void *addr, size_t addrlen, - GNUNET_TRANSPORT_TransmitContinuation - cont, void *cont_cls); + GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls); diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index e91e74c6f..da236478c 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h @@ -58,7 +58,8 @@ struct GNUNET_FRAGMENT_Context; * @param msg the message that was created */ typedef void (*GNUNET_FRAGMENT_MessageProcessor) (void *cls, - const struct GNUNET_MessageHeader *msg); + const struct + GNUNET_MessageHeader * msg); /** @@ -79,14 +80,22 @@ 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); /** @@ -112,7 +121,7 @@ GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); * 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); + const struct GNUNET_MessageHeader *msg); /** @@ -144,8 +153,9 @@ struct GNUNET_DEFRAGMENT_Context; * @param msg the message that was created */ typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, - uint32_t id, - const struct GNUNET_MessageHeader *msg); + uint32_t id, + const struct + GNUNET_MessageHeader * msg); /** @@ -161,13 +171,18 @@ typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, * 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); /** @@ -175,8 +190,7 @@ GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, * * @param dc defragmentation context */ -void -GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); +void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); /** @@ -188,7 +202,7 @@ GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); */ int GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, - const struct GNUNET_MessageHeader *msg); + 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 04e7b606c..b6eb83609 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h @@ -80,8 +80,8 @@ struct GNUNET_FS_Uri; * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort */ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, - const char *keyword, - int is_mandatory); + const char *keyword, + int is_mandatory); /** * Get a unique key from a URI. This is for putting URIs @@ -90,9 +90,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, * @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. @@ -100,8 +99,7 @@ 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 @@ -110,8 +108,7 @@ 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); /** @@ -124,8 +121,7 @@ GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); */ void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, - const char *keyword, - int is_mandatory); + const char *keyword, int is_mandatory); /** @@ -137,7 +133,7 @@ GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, */ void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, - const char *keyword); + const char *keyword); /** @@ -147,17 +143,14 @@ 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); /** @@ -166,7 +159,7 @@ 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 +unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); @@ -179,10 +172,10 @@ GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); * @return -1 if this is not a keyword URI, otherwise number of * keywords iterated over until iterator aborted */ -int +int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, - GNUNET_FS_KeywordIterator iterator, - void *iterator_cls); + GNUNET_FS_KeywordIterator iterator, + void *iterator_cls); /** @@ -194,7 +187,7 @@ GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, */ int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, - struct GNUNET_PeerIdentity * peer); + struct GNUNET_PeerIdentity *peer); /** @@ -203,8 +196,8 @@ 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); /** @@ -225,10 +218,13 @@ GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); * @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); /** @@ -239,8 +235,8 @@ GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, * @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); /** @@ -252,9 +248,8 @@ GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri *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); /** @@ -263,8 +258,7 @@ 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); /** @@ -284,9 +278,8 @@ 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); /** @@ -306,9 +299,8 @@ 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); /** @@ -318,9 +310,9 @@ GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, * @param u2 the other URI * @return GNUNET_YES if the URIs are equal */ -int +int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, - const struct GNUNET_FS_Uri *u2); + const struct GNUNET_FS_Uri *u2); /** @@ -329,8 +321,7 @@ 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); /** @@ -347,10 +338,8 @@ 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); /** @@ -360,9 +349,8 @@ 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); /** @@ -373,9 +361,9 @@ GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode *nsid, * @param nsid where to store the ID of the namespace * @return GNUNET_OK on success */ -int +int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, - GNUNET_HashCode * nsid); + GNUNET_HashCode * nsid); /** @@ -384,8 +372,7 @@ 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); /** @@ -396,9 +383,8 @@ 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); /** @@ -407,8 +393,7 @@ GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg, * @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); /** @@ -417,8 +402,7 @@ 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); /** @@ -428,8 +412,7 @@ 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); /** @@ -438,8 +421,7 @@ 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); /** @@ -450,8 +432,9 @@ 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 *********************** */ @@ -469,10 +452,9 @@ GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData * @return GNUNET_OK on success */ int -GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext* ctx, - void *scls, - const char *option, - const char *value); +GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); /** @@ -488,10 +470,9 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext* * @return GNUNET_OK on success */ int -GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext* ctx, - void *scls, - const char *option, - const char *value); +GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext + *ctx, void *scls, const char *option, + const char *value); @@ -636,7 +617,7 @@ enum GNUNET_FS_Status * be generated in this case. */ GNUNET_FS_STATUS_SEARCH_SUSPEND, - + /** * This search has yielded a result. */ @@ -689,7 +670,7 @@ enum GNUNET_FS_Status /** * Notification that we started to unindex a file. - */ + */ GNUNET_FS_STATUS_UNINDEX_START, /** @@ -724,7 +705,6 @@ enum GNUNET_FS_Status * was stopped (final event for this action). */ GNUNET_FS_STATUS_UNINDEX_STOPPED - }; @@ -773,17 +753,19 @@ struct GNUNET_FS_FileInformation; * information about what is going on. */ struct GNUNET_FS_ProgressInfo -{ +{ /** * Values that depend on the event type. */ - union { - + union + { + /** * Values for all "GNUNET_FS_STATUS_PUBLISH_*" events. */ - struct { + struct + { /** * Context for controlling the upload. @@ -811,7 +793,7 @@ struct GNUNET_FS_ProgressInfo * Name of the file being published; can be NULL. */ const char *filename; - + /** * How large is the file overall? For directories, * this is only the size of the directory itself, @@ -824,7 +806,7 @@ struct GNUNET_FS_ProgressInfo * At what time do we expect to finish the upload? * (will be a value in the past for completed * uploads). - */ + */ struct GNUNET_TIME_Relative eta; /** @@ -846,90 +828,96 @@ struct GNUNET_FS_ProgressInfo /** * Additional values for specific events. */ - union { + union + { - /** + /** * These values are only valid for * GNUNET_FS_STATUS_PUBLISH_PROGRESS events. */ - struct { - - /** + struct + { + + /** * Data block we just published. */ - const void *data; - - /** + const void *data; + + /** * At what offset in the file is "data"? */ - uint64_t offset; - - /** + uint64_t offset; + + /** * Length of the data block. */ - uint64_t data_len; + uint64_t data_len; - /** + /** * Depth of the given block in the tree; * 0 would be the lowest level (DBLOCKs). */ - unsigned int depth; + unsigned int depth; - } progress; + } progress; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_PUBLISH_RESUME events. */ - struct { - - /** + struct + { + + /** * Error message, NULL if no error was encountered so far. */ - const char *message; - - /** + const char *message; + + /** * URI of the file (if the download had been completed) */ - const struct GNUNET_FS_Uri *chk_uri; + const struct GNUNET_FS_Uri *chk_uri; - } resume; + } resume; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_PUBLISH_COMPLETED events. */ - struct { - - /** + struct + { + + /** * URI of the file. */ - const struct GNUNET_FS_Uri *chk_uri; + const struct GNUNET_FS_Uri *chk_uri; - } completed; + } completed; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_PUBLISH_ERROR events. */ - struct { - - /** + struct + { + + /** * Error message, never NULL. */ - const char *message; + const char *message; - } error; + } error; } specifics; } publish; - + /** * Values for all "GNUNET_FS_STATUS_DOWNLOAD_*" events. */ - struct { + struct + { /** * Context for controlling the download. @@ -956,7 +944,7 @@ struct GNUNET_FS_ProgressInfo * download was started from a search result. */ void *sctx; - + /** * URI used for this download. */ @@ -966,7 +954,7 @@ struct GNUNET_FS_ProgressInfo * Name of the file that we are downloading. */ const char *filename; - + /** * How large is the download overall? This * is NOT necessarily the size from the @@ -978,12 +966,12 @@ struct GNUNET_FS_ProgressInfo * At what time do we expect to finish the download? * (will be a value in the past for completed * uploads). - */ + */ struct GNUNET_TIME_Relative eta; /** * How long has this download been active? - */ + */ struct GNUNET_TIME_Relative duration; /** @@ -1004,83 +992,88 @@ struct GNUNET_FS_ProgressInfo /** * Additional values for specific events. */ - union { - - /** + union + { + + /** * These values are only valid for * GNUNET_FS_STATUS_DOWNLOAD_PROGRESS events. */ - struct { - - /** + struct + { + + /** * Data block we just obtained, can be NULL (even if * data_len > 0) if we found the entire block 'intact' on * disk. In this case, it is also possible for 'data_len' * to be larger than an individual (32k) block. */ - const void *data; - - /** + const void *data; + + /** * At what offset in the file is "data"? */ - uint64_t offset; - - /** + uint64_t offset; + + /** * Length of the data block. */ - uint64_t data_len; + uint64_t data_len; - /** + /** * Depth of the given block in the tree; * 0 would be the lowest level (DBLOCKS). */ - unsigned int depth; + unsigned int depth; - } progress; + } progress; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_DOWNLOAD_START events. */ - struct { + struct + { - /** + /** * Known metadata for the download. */ - const struct GNUNET_CONTAINER_MetaData *meta; - - } start; + const struct GNUNET_CONTAINER_MetaData *meta; + + } start; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_DOWNLOAD_RESUME events. */ - struct { + struct + { - /** + /** * Known metadata for the download. */ - const struct GNUNET_CONTAINER_MetaData *meta; + const struct GNUNET_CONTAINER_MetaData *meta; - /** + /** * Error message, NULL if we have not encountered any error yet. */ - const char *message; + const char *message; - } resume; + } resume; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_DOWNLOAD_ERROR events. */ - struct { + struct + { - /** + /** * Error message. */ - const char *message; + const char *message; - } error; + } error; } specifics; @@ -1089,7 +1082,8 @@ struct GNUNET_FS_ProgressInfo /** * Values for all "GNUNET_FS_STATUS_SEARCH_*" events. */ - struct { + struct + { /** * Context for controlling the search, NULL for @@ -1138,123 +1132,127 @@ struct GNUNET_FS_ProgressInfo /** * Additional values for specific events. */ - union { - - /** + union + { + + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_RESULT events. */ - struct { - - /** + struct + { + + /** * Metadata for the search result. */ - const struct GNUNET_CONTAINER_MetaData *meta; + const struct GNUNET_CONTAINER_MetaData *meta; - /** + /** * URI for the search result. */ - const struct GNUNET_FS_Uri *uri; + const struct GNUNET_FS_Uri *uri; - /** + /** * Handle to the result (for starting downloads). */ - struct GNUNET_FS_SearchResult *result; + struct GNUNET_FS_SearchResult *result; - /** + /** * Applicability rank (the larger, the better the result * fits the search criteria). */ - uint32_t applicability_rank; + uint32_t applicability_rank; + + } result; - } result; - - /** + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_RESUME_RESULT events. */ - struct { - - /** + struct + { + + /** * Metadata for the search result. */ - const struct GNUNET_CONTAINER_MetaData *meta; + const struct GNUNET_CONTAINER_MetaData *meta; - /** + /** * URI for the search result. */ - const struct GNUNET_FS_Uri *uri; + const struct GNUNET_FS_Uri *uri; - /** + /** * Handle to the result (for starting downloads). */ - struct GNUNET_FS_SearchResult *result; + struct GNUNET_FS_SearchResult *result; - /** + /** * Current availability rank (negative: * unavailable, positive: available) */ - int32_t availability_rank; - - /** + int32_t availability_rank; + + /** * On how many total queries is the given * availability_rank based? */ - uint32_t availability_certainty; + uint32_t availability_certainty; - /** + /** * Updated applicability rank (the larger, * the better the result fits the search * criteria). */ - uint32_t applicability_rank; - - } resume_result; - - /** + uint32_t applicability_rank; + + } resume_result; + + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_UPDATE events. */ - struct { + struct + { - /** + /** * Private context set for for this result * during the "RESULT" event. */ - void *cctx; - - /** + void *cctx; + + /** * Metadata for the search result. */ - const struct GNUNET_CONTAINER_MetaData *meta; + const struct GNUNET_CONTAINER_MetaData *meta; - /** + /** * URI for the search result. */ - const struct GNUNET_FS_Uri *uri; + const struct GNUNET_FS_Uri *uri; - /** + /** * Current availability rank (negative: * unavailable, positive: available) */ - int32_t availability_rank; - - /** + int32_t availability_rank; + + /** * On how many total queries is the given * availability_rank based? */ - uint32_t availability_certainty; + uint32_t availability_certainty; - /** + /** * Updated applicability rank (the larger, * the better the result fits the search * criteria). */ - uint32_t applicability_rank; + uint32_t applicability_rank; + + } update; - } update; - - /** + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_RESULT_SUSPEND events. * These events are automatically triggered for @@ -1263,27 +1261,28 @@ struct GNUNET_FS_ProgressInfo * happens primarily to give the client a chance * to clean up the "cctx" (if needed). */ - struct { + struct + { - /** + /** * Private context set for for this result * during the "RESULT" event. */ - void *cctx; - - /** + void *cctx; + + /** * Metadata for the search result. */ - const struct GNUNET_CONTAINER_MetaData *meta; + const struct GNUNET_CONTAINER_MetaData *meta; - /** + /** * URI for the search result. */ - const struct GNUNET_FS_Uri *uri; + const struct GNUNET_FS_Uri *uri; + + } result_suspend; - } result_suspend; - - /** + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_RESULT_STOPPED events. * These events are automatically triggered for @@ -1292,89 +1291,93 @@ struct GNUNET_FS_ProgressInfo * happens primarily to give the client a chance * to clean up the "cctx" (if needed). */ - struct { + struct + { - /** + /** * Private context set for for this result * during the "RESULT" event. */ - void *cctx; - - /** + void *cctx; + + /** * Metadata for the search result. */ - const struct GNUNET_CONTAINER_MetaData *meta; + const struct GNUNET_CONTAINER_MetaData *meta; - /** + /** * URI for the search result. */ - const struct GNUNET_FS_Uri *uri; + const struct GNUNET_FS_Uri *uri; - } result_stopped; + } result_stopped; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_RESUME events. */ - struct { + struct + { - /** + /** * Error message, NULL if we have not encountered any error yet. */ - const char *message; + const char *message; - /** + /** * Is this search currently paused? */ - int is_paused; + int is_paused; - } resume; + } resume; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_SEARCH_ERROR events. */ - struct { + struct + { - /** + /** * Error message. */ - const char *message; + const char *message; - } error; - - /** + } error; + + /** * Values for all "GNUNET_FS_STATUS_SEARCH_RESULT_NAMESPACE" events. */ - struct { - - /** + struct + { + + /** * Handle to the namespace (NULL if it is not a local * namespace). */ - struct GNUNET_FS_Namespace *ns; - - /** + struct GNUNET_FS_Namespace *ns; + + /** * Short, human-readable name of the namespace. */ - const char *name; - - /** + const char *name; + + /** * Root identifier for the namespace, can be NULL. */ - const char *root; - - /** + const char *root; + + /** * Metadata for the namespace. */ - const struct GNUNET_CONTAINER_MetaData *meta; - - /** + const struct GNUNET_CONTAINER_MetaData *meta; + + /** * Hash-identifier for the namespace. */ - GNUNET_HashCode id; - - } namespace; + GNUNET_HashCode id; + + } namespace; } specifics; @@ -1383,7 +1386,8 @@ struct GNUNET_FS_ProgressInfo /** * Values for all "GNUNET_FS_STATUS_UNINDEX_*" events. */ - struct { + struct + { /** * Context for controlling the unindexing. @@ -1411,7 +1415,7 @@ struct GNUNET_FS_ProgressInfo * At what time do we expect to finish unindexing? * (will be a value in the past for completed * unindexing opeations). - */ + */ struct GNUNET_TIME_Relative eta; /** @@ -1428,62 +1432,66 @@ struct GNUNET_FS_ProgressInfo /** * Additional values for specific events. */ - union { + union + { - /** + /** * These values are only valid for * GNUNET_FS_STATUS_UNINDEX_PROGRESS events. */ - struct { - - /** + struct + { + + /** * Data block we just unindexed. */ - const void *data; - - /** + const void *data; + + /** * At what offset in the file is "data"? */ - uint64_t offset; - - /** + uint64_t offset; + + /** * Length of the data block. */ - uint64_t data_len; + uint64_t data_len; - /** + /** * Depth of the given block in the tree; * 0 would be the lowest level (DBLOCKS). */ - unsigned int depth; + unsigned int depth; - } progress; + } progress; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_UNINDEX_RESUME events. */ - struct { + struct + { - /** + /** * Error message, NULL if we have not encountered any error yet. */ - const char *message; + const char *message; - } resume; + } resume; - /** + /** * These values are only valid for * GNUNET_FS_STATUS_UNINDEX_ERROR events. */ - struct { + struct + { - /** + /** * Error message. */ - const char *message; + const char *message; - } error; + } error; } specifics; @@ -1493,7 +1501,7 @@ struct GNUNET_FS_ProgressInfo /** * Specific status code (determines the event type). - */ + */ enum GNUNET_FS_Status status; }; @@ -1514,53 +1522,51 @@ struct GNUNET_FS_ProgressInfo * will be passed to future callbacks in the respective * field in the GNUNET_FS_ProgressInfo struct. */ -typedef void* (*GNUNET_FS_ProgressCallback) - (void *cls, - const struct GNUNET_FS_ProgressInfo *info); +typedef void *(*GNUNET_FS_ProgressCallback) + (void *cls, const struct GNUNET_FS_ProgressInfo * info); /** * General (global) option flags for file-sharing. */ enum GNUNET_FS_Flags - { +{ /** * No special flags set. */ - GNUNET_FS_FLAGS_NONE = 0, + GNUNET_FS_FLAGS_NONE = 0, /** * Is persistence of operations desired? * (will create SUSPEND/RESUME events). */ - GNUNET_FS_FLAGS_PERSISTENCE = 1, + GNUNET_FS_FLAGS_PERSISTENCE = 1, /** * Should we automatically trigger probes for search results * to determine availability? * (will create GNUNET_FS_STATUS_SEARCH_UPDATE events). */ - GNUNET_FS_FLAGS_DO_PROBES = 2 - - }; + GNUNET_FS_FLAGS_DO_PROBES = 2 +}; /** * Options specified in the VARARGs portion of GNUNET_FS_start. */ enum GNUNET_FS_OPTIONS - { - +{ + /** * Last option in the VARARG list. */ - GNUNET_FS_OPTIONS_END = 0, + GNUNET_FS_OPTIONS_END = 0, /** * Select the desired amount of parallelism (this option should be * followed by an "unsigned int" giving the desired maximum number * of parallel downloads). */ - GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM = 1, + GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM = 1, /** * Maximum number of requests that should be pending at a given @@ -1568,9 +1574,8 @@ enum GNUNET_FS_OPTIONS * if we are above this threshold, we should not activate any * additional downloads. */ - GNUNET_FS_OPTIONS_REQUEST_PARALLELISM = 2 - - }; + GNUNET_FS_OPTIONS_REQUEST_PARALLELISM = 2 +}; /** @@ -1621,8 +1626,7 @@ 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); /** @@ -1631,8 +1635,7 @@ 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); /** @@ -1652,13 +1655,12 @@ 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, ...); /** @@ -1667,9 +1669,8 @@ GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, * called after this function returns. * * @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); /** @@ -1681,12 +1682,11 @@ GNUNET_FS_stop (struct GNUNET_FS_Handle *h); * @return GNUNET_SYSERR on error, otherwise the number * of meta-data items obtained */ -int +int GNUNET_FS_meta_data_extract_from_file (struct - GNUNET_CONTAINER_MetaData - *md, const char *filename, - struct EXTRACTOR_PluginList * - extractors); + GNUNET_CONTAINER_MetaData + *md, const char *filename, + struct EXTRACTOR_PluginList *extractors); /** @@ -1704,14 +1704,17 @@ GNUNET_FS_meta_data_extract_from_file (struct * this entry from the directory, GNUNET_SYSERR * to abort the iteration */ -typedef int (*GNUNET_FS_FileInformationProcessor)(void *cls, - struct GNUNET_FS_FileInformation *fi, - uint64_t length, - struct GNUNET_CONTAINER_MetaData *meta, - struct GNUNET_FS_Uri **uri, - struct GNUNET_FS_BlockOptions *bo, - int *do_index, - void **client_info); +typedef int (*GNUNET_FS_FileInformationProcessor) (void *cls, + struct + GNUNET_FS_FileInformation * + fi, uint64_t length, + struct + GNUNET_CONTAINER_MetaData * + meta, + struct GNUNET_FS_Uri ** uri, + struct GNUNET_FS_BlockOptions + * bo, int *do_index, + void **client_info); /** @@ -1724,8 +1727,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); @@ -1743,14 +1746,17 @@ GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); * @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,15 +1775,17 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, * @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); /** @@ -1796,11 +1804,9 @@ GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, * @param emsg location for the reader to store an error message * @return number of bytes written, usually "max", 0 on error */ -typedef size_t (*GNUNET_FS_DataReader)(void *cls, - uint64_t offset, - size_t max, - void *buf, - char **emsg); +typedef size_t (*GNUNET_FS_DataReader) (void *cls, + uint64_t offset, + size_t max, void *buf, char **emsg); /** @@ -1819,16 +1825,19 @@ typedef size_t (*GNUNET_FS_DataReader)(void *cls, * @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); /** @@ -1841,9 +1850,9 @@ GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, * @param fi information about the file (should not be * used henceforth by the caller) */ -typedef void (*GNUNET_FS_FileProcessor)(void *cls, - const char *filename, - struct GNUNET_FS_FileInformation *fi); +typedef void (*GNUNET_FS_FileProcessor) (void *cls, + const char *filename, + struct GNUNET_FS_FileInformation * fi); /** @@ -1859,14 +1868,13 @@ typedef void (*GNUNET_FS_FileProcessor)(void *cls, * @param emsg where to store an error message (on errors) * @return GNUNET_OK on success */ -typedef int (*GNUNET_FS_DirectoryScanner)(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); +typedef int (*GNUNET_FS_DirectoryScanner) (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); @@ -1893,13 +1901,12 @@ typedef int (*GNUNET_FS_DirectoryScanner)(void *cls, */ 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); + 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); /** @@ -1922,15 +1929,17 @@ GNUNET_FS_directory_scanner_default (void *cls, * @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); /** @@ -1947,12 +1956,17 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, * @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); /** @@ -1962,7 +1976,8 @@ GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, * @return GNUNET_YES if so, GNUNET_NO if not */ int -GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation *ent); +GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation + *ent); /** @@ -1978,7 +1993,7 @@ GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation */ int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, - struct GNUNET_FS_FileInformation *ent); + struct GNUNET_FS_FileInformation *ent); /** @@ -1997,8 +2012,8 @@ GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, */ void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, - GNUNET_FS_FileInformationProcessor proc, - void *proc_cls); + GNUNET_FS_FileInformationProcessor proc, + void *proc_cls); /** @@ -2013,27 +2028,27 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, */ void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, - GNUNET_FS_FileInformationProcessor cleaner, - void *cleaner_cls); + GNUNET_FS_FileInformationProcessor cleaner, + void *cleaner_cls); /** * Options for publishing. Compatible options * can be OR'ed together. */ -enum GNUNET_FS_PublishOptions - { +enum GNUNET_FS_PublishOptions +{ /** * No options (use defaults for everything). */ - GNUNET_FS_PUBLISH_OPTION_NONE = 0, - + GNUNET_FS_PUBLISH_OPTION_NONE = 0, + /** * Simulate publishing. With this option, no data will be stored * in the datastore. Useful for computing URIs from files. */ - GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY = 1 - }; + GNUNET_FS_PUBLISH_OPTION_SIMULATE_ONLY = 1 +}; /** * Publish a file or directory. @@ -2048,13 +2063,19 @@ 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); /** @@ -2065,8 +2086,7 @@ GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, * * @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); /** @@ -2077,10 +2097,10 @@ GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); * @param uri URI under which the block is now available, NULL on error * @param emsg error message, NULL on success */ -typedef void (*GNUNET_FS_PublishContinuation)(void *cls, - const struct GNUNET_FS_Uri *uri, - const char *emsg); - +typedef void (*GNUNET_FS_PublishContinuation) (void *cls, + const struct GNUNET_FS_Uri * uri, + const char *emsg); + /** * Publish a KBlock on GNUnet. @@ -2096,13 +2116,12 @@ typedef void (*GNUNET_FS_PublishContinuation)(void *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); + 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,15 +2140,14 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, */ 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); + 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); /** @@ -2141,8 +2159,8 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort */ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, - const char *filename, - const GNUNET_HashCode *file_id); + const char *filename, + const GNUNET_HashCode * file_id); /** @@ -2156,12 +2174,11 @@ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, * error) or "PREREQ_DONE" (on success) * @param cont_cls closure for cont */ -void +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); + GNUNET_FS_IndexedFileProcessor iterator, + void *iterator_cls, + GNUNET_SCHEDULER_Task cont, void *cont_cls); /** @@ -2172,10 +2189,10 @@ 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); /** @@ -2183,8 +2200,7 @@ GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, * * @param uc handle */ -void -GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); +void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); /** @@ -2201,13 +2217,13 @@ GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); */ 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); + 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); /** @@ -2218,9 +2234,8 @@ 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); /** @@ -2234,9 +2249,8 @@ GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, * * @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); /** @@ -2249,8 +2263,8 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, * @param id hash identifier for the namespace */ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, - const char *name, - const GNUNET_HashCode *id); + const char *name, + const GNUNET_HashCode * id); /** @@ -2262,10 +2276,9 @@ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, * @param cb function to call on each known namespace * @param cb_cls closure for cb */ -void +void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, - GNUNET_FS_NamespaceInfoProcessor cb, - void *cb_cls); + GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls); /** @@ -2277,12 +2290,12 @@ GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, * @param last_meta metadata associated with last_uri * @param next_id identifier that should be used for updates */ -typedef void -(*GNUNET_FS_IdentifierProcessor)(void *cls, - const char *last_id, - const struct GNUNET_FS_Uri *last_uri, - const struct GNUNET_CONTAINER_MetaData *last_meta, - const char *next_id); +typedef void + (*GNUNET_FS_IdentifierProcessor) (void *cls, + const char *last_id, + const struct GNUNET_FS_Uri * last_uri, + const struct GNUNET_CONTAINER_MetaData * + last_meta, const char *next_id); /** @@ -2307,28 +2320,27 @@ typedef void */ void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, - const char *next_id, - GNUNET_FS_IdentifierProcessor ip, - void *ip_cls); + const char *next_id, + GNUNET_FS_IdentifierProcessor ip, + void *ip_cls); /** * Options for searching. Compatible options * can be OR'ed together. */ -enum GNUNET_FS_SearchOptions - { +enum GNUNET_FS_SearchOptions +{ /** * No options (use defaults for everything). */ - GNUNET_FS_SEARCH_OPTION_NONE = 0, + GNUNET_FS_SEARCH_OPTION_NONE = 0, /** * Only search the local host, do not search remote systems (no P2P) */ - GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1 - - }; + GNUNET_FS_SEARCH_OPTION_LOOPBACK_ONLY = 1 +}; /** @@ -2342,12 +2354,14 @@ 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); /** @@ -2355,8 +2369,7 @@ GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, * * @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); /** @@ -2364,8 +2377,7 @@ 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); /** @@ -2373,8 +2385,7 @@ 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); @@ -2383,29 +2394,29 @@ GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); * Options for downloading. Compatible options * can be OR'ed together. */ -enum GNUNET_FS_DownloadOptions - { +enum GNUNET_FS_DownloadOptions +{ /** * No options (use defaults for everything). */ - GNUNET_FS_DOWNLOAD_OPTION_NONE = 0, + GNUNET_FS_DOWNLOAD_OPTION_NONE = 0, /** * Only download from the local host, do not access remote systems (no P2P) */ - GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY = 1, - + GNUNET_FS_DOWNLOAD_OPTION_LOOPBACK_ONLY = 1, + /** * Do a recursive download (that is, automatically trigger the * download of files in directories). */ - GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE = 2, + GNUNET_FS_DOWNLOAD_OPTION_RECURSIVE = 2, /** * Do not append temporary data to * the target file (for the IBlocks). */ - GNUNET_FS_DOWNLOAD_NO_TEMPORARIES = 4, + GNUNET_FS_DOWNLOAD_NO_TEMPORARIES = 4, /** * Internal option used to flag this download as a 'probe' for a @@ -2414,9 +2425,8 @@ enum GNUNET_FS_DownloadOptions * Also, probe downloads are not serialized on suspension. Normal * clients should not use this! */ - GNUNET_FS_DOWNLOAD_IS_PROBE = (1<<31) - - }; + GNUNET_FS_DOWNLOAD_IS_PROBE = (1 << 31) +}; @@ -2450,18 +2460,26 @@ 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); /** @@ -2498,16 +2516,29 @@ GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, * @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); /** @@ -2517,8 +2548,7 @@ GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, * @param do_delete delete files of incomplete downloads */ void -GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, - int do_delete); +GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); @@ -2536,8 +2566,9 @@ 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); /** @@ -2546,8 +2577,7 @@ GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData * * * @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); /** @@ -2556,8 +2586,8 @@ 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); /** @@ -2575,12 +2605,14 @@ GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData *md * embedded with the directory itself). * @param data data available for the file (length bytes) */ -typedef void (*GNUNET_FS_DirectoryEntryProcessor)(void *cls, - const char *filename, - const struct GNUNET_FS_Uri *uri, - const struct GNUNET_CONTAINER_MetaData *meta, - size_t length, - const void *data); +typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, + const char *filename, + const struct GNUNET_FS_Uri * + uri, + const struct + GNUNET_CONTAINER_MetaData * + meta, size_t length, + const void *data); /** @@ -2602,12 +2634,12 @@ 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 +int GNUNET_FS_directory_list_contents (size_t size, - const void *data, - uint64_t offset, - GNUNET_FS_DirectoryEntryProcessor dep, - void *dep_cls); + const void *data, + uint64_t offset, + GNUNET_FS_DirectoryEntryProcessor dep, + void *dep_cls); /** @@ -2620,8 +2652,10 @@ 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); /** @@ -2636,10 +2670,10 @@ GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData *mdir */ 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); - + const struct GNUNET_FS_Uri *uri, + const struct GNUNET_CONTAINER_MetaData *md, + const void *data); + /** * Finish building the directory. Frees the @@ -2653,8 +2687,7 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, */ int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, - size_t *rsize, - void **rdata); + 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 8691fba2f..9c34810b2 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h @@ -86,11 +86,11 @@ struct GNUNET_GETOPT_CommandLineProcessorContext * @return GNUNET_OK to continue processing other options, GNUNET_SYSERR to abort */ typedef - int (*GNUNET_GETOPT_CommandLineOptionProcessor) (struct - GNUNET_GETOPT_CommandLineProcessorContext - * ctx, void *scls, - const char *option, - const char *value); + int (*GNUNET_GETOPT_CommandLineOptionProcessor) (struct + GNUNET_GETOPT_CommandLineProcessorContext + * ctx, void *scls, + const char *option, + const char *value); /** * @brief Definition of a command line option. diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index f1b67121e..a3e4ba0f0 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h @@ -61,6 +61,13 @@ struct GNUNET_HELLO_Message; * the target buffer was not big enough. */ size_t + + + + + + + GNUNET_HELLO_add_address (const char *tname, struct GNUNET_TIME_Absolute expiration, const void *addr, @@ -79,8 +86,8 @@ GNUNET_HELLO_add_address (const char *tname, * end of the iteration. */ typedef size_t - (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, - size_t max, void *buf); + (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, + size_t max, void *buf); /** @@ -136,12 +143,11 @@ 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 +struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct - GNUNET_HELLO_Message *h1, - const struct - GNUNET_HELLO_Message *h2, - struct GNUNET_TIME_Absolute now); + GNUNET_HELLO_Message *h1, + const struct + GNUNET_HELLO_Message *h2, struct GNUNET_TIME_Absolute now); /** @@ -157,11 +163,10 @@ GNUNET_HELLO_equals (const struct * GNUNET_SYSERR to stop iterating (but keep current address) */ typedef int - (*GNUNET_HELLO_AddressIterator) (void *cls, - const char *tname, - struct GNUNET_TIME_Absolute expiration, - const void *addr, - uint16_t addrlen); + (*GNUNET_HELLO_AddressIterator) (void *cls, + const char *tname, + struct GNUNET_TIME_Absolute expiration, + const void *addr, uint16_t addrlen); /** @@ -182,8 +187,7 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct int return_modified, GNUNET_HELLO_AddressIterator - it, - void *it_cls); + it, void *it_cls); /** @@ -230,7 +234,7 @@ GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, */ int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, - struct GNUNET_PeerIdentity *peer); + struct GNUNET_PeerIdentity *peer); /** @@ -241,8 +245,9 @@ 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 ea2ad588e..40323e709 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); /** @@ -63,7 +63,7 @@ GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); */ void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, - struct GNUNET_TIME_Relative autodecline); + struct GNUNET_TIME_Relative autodecline); /** @@ -83,8 +83,7 @@ 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); /** @@ -93,8 +92,7 @@ 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); /** @@ -103,9 +101,7 @@ 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 25744248b..7e332c749 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h @@ -68,12 +68,13 @@ struct GNUNET_MESH_Tunnel; * GNUNET_SYSERR to close it (signal serious error) */ typedef int - (*GNUNET_MESH_MessageCallback) (void *cls, - struct GNUNET_MESH_Tunnel *tunnel, - void **tunnel_ctx, - const struct GNUNET_PeerIdentity *sender, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_TRANSPORT_ATS_Information *atsi); + (*GNUNET_MESH_MessageCallback) (void *cls, + struct GNUNET_MESH_Tunnel * tunnel, + void **tunnel_ctx, + const struct GNUNET_PeerIdentity * sender, + const struct GNUNET_MessageHeader * message, + const struct + GNUNET_TRANSPORT_ATS_Information * atsi); /** @@ -110,9 +111,9 @@ struct GNUNET_MESH_MessageHandler * @param tunnel connection to the other end (henceforth invalid) * @param tunnel_ctx place where local state associated with the tunnel is stored */ -typedef void (GNUNET_MESH_TunnelEndHandler)(void *cls, - const struct GNUNET_MESH_Tunnel *tunnel, - void **tunnel_ctx); +typedef void (GNUNET_MESH_TunnelEndHandler) (void *cls, + const struct GNUNET_MESH_Tunnel * + tunnel, void **tunnel_ctx); /** @@ -135,12 +136,17 @@ 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 @@ -148,8 +154,9 @@ GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, * @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); /** @@ -170,7 +177,9 @@ void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); * @param peer peer identity the tunnel stopped working with */ typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls, - const struct GNUNET_PeerIdentity *peer); + const struct + GNUNET_PeerIdentity * + peer); /** @@ -181,8 +190,11 @@ typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls, * @param atsi performance data for the connection */ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, - const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_TRANSPORT_ATS_Information *atsi); + const struct + GNUNET_PeerIdentity * peer, + const struct + GNUNET_TRANSPORT_ATS_Information + * atsi); @@ -206,14 +218,23 @@ 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); /** @@ -233,14 +254,23 @@ GNUNET_MESH_peer_request_connect_any (struct GNUNET_MESH_Handle *h, * @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); /** @@ -253,8 +283,8 @@ GNUNET_MESH_peer_request_connect_all (struct GNUNET_MESH_Handle *h, */ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, - struct GNUNET_TIME_Relative timeout, - const struct GNUNET_PeerIdentity *peer); + struct GNUNET_TIME_Relative timeout, + const struct GNUNET_PeerIdentity *peer); /** @@ -266,7 +296,7 @@ GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, */ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, - const struct GNUNET_PeerIdentity *peer); + const struct GNUNET_PeerIdentity *peer); /** @@ -286,13 +316,20 @@ 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); /** @@ -301,8 +338,7 @@ GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h, * * @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); /** @@ -332,22 +368,25 @@ 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); /** @@ -359,13 +398,16 @@ 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_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_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 7d1570550..7146faa75 100644 --- a/src/include/gnunet_mesh_service_new.h +++ b/src/include/gnunet_mesh_service_new.h @@ -68,13 +68,13 @@ struct GNUNET_MESH_Tunnel; * GNUNET_SYSERR to close it (signal serious error) */ typedef int - (*GNUNET_MESH_MessageCallback) (void *cls, - struct GNUNET_MESH_Tunnel *tunnel, - void **tunnel_ctx, - const struct GNUNET_PeerIdentity *sender, - const struct GNUNET_MessageHeader *message, - const struct GNUNET_TRANSPORT_ATS_Information - *atsi); + (*GNUNET_MESH_MessageCallback) (void *cls, + struct GNUNET_MESH_Tunnel * tunnel, + void **tunnel_ctx, + const struct GNUNET_PeerIdentity * sender, + const struct GNUNET_MessageHeader * message, + const struct + GNUNET_TRANSPORT_ATS_Information * atsi); /** @@ -112,10 +112,9 @@ struct GNUNET_MESH_MessageHandler * @param tunnel_ctx place where local state associated * with the tunnel is stored */ -typedef void (GNUNET_MESH_TunnelEndHandler)(void *cls, - const struct GNUNET_MESH_Tunnel - *tunnel, - void **tunnel_ctx); +typedef void (GNUNET_MESH_TunnelEndHandler) (void *cls, + const struct GNUNET_MESH_Tunnel + * tunnel, void **tunnel_ctx); /** @@ -139,12 +138,17 @@ 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); /** @@ -162,7 +166,9 @@ void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); * @param peer peer identity the tunnel stopped working with */ typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls, - const struct GNUNET_PeerIdentity *peer); + const struct + GNUNET_PeerIdentity * + peer); /** @@ -173,8 +179,11 @@ typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls, * @param atsi performance data for the connection */ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, - const struct GNUNET_PeerIdentity *peer, - const struct GNUNET_TRANSPORT_ATS_Information *atsi); + const struct + GNUNET_PeerIdentity * peer, + const struct + GNUNET_TRANSPORT_ATS_Information + * atsi); @@ -187,21 +196,20 @@ 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); /** @@ -214,8 +222,8 @@ GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); */ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, - struct GNUNET_TIME_Relative timeout, - const struct GNUNET_PeerIdentity *peer); + struct GNUNET_TIME_Relative timeout, + const struct GNUNET_PeerIdentity *peer); /** @@ -227,7 +235,7 @@ GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, */ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, - const struct GNUNET_PeerIdentity *peer); + const struct GNUNET_PeerIdentity *peer); /** @@ -241,8 +249,8 @@ GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, */ void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, - struct GNUNET_TIME_Relative timeout, - GNUNET_MESH_ApplicationType app_type); + struct GNUNET_TIME_Relative timeout, + GNUNET_MESH_ApplicationType app_type); /** @@ -271,22 +279,25 @@ 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); /** diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 2ab3eccb6..a84f684a7 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h @@ -41,9 +41,9 @@ * @param addr either the previous or the new public IP address * @param addrlen actual lenght of the address */ -typedef void (*GNUNET_NAT_AddressCallback) (void *cls, - int add_remove, - const struct sockaddr *addr, +typedef void (*GNUNET_NAT_AddressCallback) (void *cls, + int add_remove, + const struct sockaddr * addr, socklen_t addrlen); @@ -56,9 +56,9 @@ typedef void (*GNUNET_NAT_AddressCallback) (void *cls, * @param addr public IP address of the other peer * @param addrlen actual lenght of the address */ -typedef void (*GNUNET_NAT_ReversalCallback) (void *cls, - const struct sockaddr *addr, - socklen_t addrlen); +typedef void (*GNUNET_NAT_ReversalCallback) (void *cls, + const struct sockaddr * addr, + socklen_t addrlen); /** @@ -87,16 +87,17 @@ 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); /** @@ -111,8 +112,7 @@ GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, */ int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, - const void *addr, - socklen_t addrlen); + const void *addr, socklen_t addrlen); /** @@ -125,7 +125,7 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, */ void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, - const struct sockaddr_in *sa); + const struct sockaddr_in *sa); @@ -135,8 +135,7 @@ 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); /** @@ -153,8 +152,7 @@ struct GNUNET_NAT_Test; * GNUNET_SYSERR if the test could not be * properly started (internal failure) */ -typedef void (*GNUNET_NAT_TestCallback)(void *cls, - int success); +typedef void (*GNUNET_NAT_TestCallback) (void *cls, int success); /** * Start testing if NAT traversal works using the @@ -168,13 +166,12 @@ typedef void (*GNUNET_NAT_TestCallback)(void *cls, * @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); /** @@ -182,8 +179,7 @@ GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @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); /** @@ -192,8 +188,7 @@ GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); * @param cls closure * @param addr the address, NULL on errors */ -typedef void (*GNUNET_NAT_IPCallback)(void *cls, - const struct in_addr *addr); +typedef void (*GNUNET_NAT_IPCallback) (void *cls, const struct in_addr * addr); @@ -211,10 +206,13 @@ 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); /** @@ -228,7 +226,7 @@ GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); /** * Handle to a mapping created with upnpc. - */ + */ struct GNUNET_NAT_MiniHandle; @@ -245,11 +243,10 @@ 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); /** @@ -260,10 +257,9 @@ 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 +#endif /* end of gnunet_nat_lib.h */ diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 1405efa2a..ecc4adf41 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h @@ -98,8 +98,7 @@ 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); /** @@ -181,10 +180,16 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle * @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); + struct sockaddr *src_addr, socklen_t * addrlen); /** @@ -322,8 +327,8 @@ void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, * @param h the file handle to add */ void -GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet *fds, - HANDLE h); +GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet + *fds, HANDLE h); #endif @@ -380,8 +385,7 @@ 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); /** @@ -391,9 +395,9 @@ void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, * @param nfd native FD to test, -1 for none * @return GNUNET_YES if to contains nfd */ -int +int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, - int nfd); + int nfd); /** @@ -412,8 +416,7 @@ void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, * @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); + const struct GNUNET_DISK_FileHandle *h); /** diff --git a/src/include/gnunet_nse_service.h b/src/include/gnunet_nse_service.h index dca2e105f..91711ef5b 100644 --- a/src/include/gnunet_nse_service.h +++ b/src/include/gnunet_nse_service.h @@ -63,8 +63,7 @@ struct GNUNET_NSE_Handle; */ typedef void (*GNUNET_NSE_Callback) (void *cls, struct GNUNET_TIME_Absolute timestamp, - double logestimate, - double std_dev); + double logestimate, double std_dev); /** @@ -85,9 +84,10 @@ 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,8 +96,7 @@ GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, * @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 48027e922..b285e3b60 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h @@ -211,8 +211,7 @@ 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 @@ -234,10 +233,11 @@ 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, ...); /** @@ -249,11 +249,14 @@ GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, * @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. @@ -265,9 +268,9 @@ GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin, * 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[]); /** @@ -281,16 +284,14 @@ struct GNUNET_OS_CommandHandle; * @param cls closure * @param line line of output from a command, NULL for the end */ -typedef void (*GNUNET_OS_LineProcessor)(void *cls, - const char *line); +typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); /** * Stop/kill a command. * * @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 +305,12 @@ 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, ...); /** @@ -321,7 +322,8 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, * @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); + enum GNUNET_OS_ProcessStatusType *type, + unsigned long *code); /** @@ -343,7 +345,7 @@ int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); void GNUNET_OS_install_parent_control_handler (void *cls, const struct - GNUNET_SCHEDULER_TaskContext * tc); + GNUNET_SCHEDULER_TaskContext *tc); /** @@ -357,8 +359,7 @@ 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 b6cba7d32..da364dd44 100644 --- a/src/include/gnunet_peer_lib.h +++ b/src/include/gnunet_peer_lib.h @@ -63,7 +63,7 @@ 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); /** @@ -81,8 +81,7 @@ 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); /** @@ -91,8 +90,7 @@ void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id * ids, * @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 1411168c0..04c63cbb1 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h @@ -54,9 +54,10 @@ 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); + /** @@ -68,8 +69,7 @@ GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); * * @param h handle to disconnect */ -void -GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); +void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); /** @@ -85,7 +85,7 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); */ void GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, - const struct GNUNET_HELLO_Message *hello); + const struct GNUNET_HELLO_Message *hello); /** @@ -98,10 +98,10 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, * @param error message */ typedef void - (*GNUNET_PEERINFO_Processor) (void *cls, - const struct GNUNET_PeerIdentity * peer, - const struct GNUNET_HELLO_Message * hello, - const char * err_msg); + (*GNUNET_PEERINFO_Processor) (void *cls, + const struct GNUNET_PeerIdentity * peer, + const struct GNUNET_HELLO_Message * hello, + const char *err_msg); /** @@ -127,12 +127,19 @@ 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); @@ -164,10 +171,13 @@ 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); /** @@ -175,8 +185,7 @@ GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @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_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index db06d33ee..a0f202a3c 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h @@ -64,7 +64,7 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, * @return new rating of the namespace */ int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, - const GNUNET_HashCode *nsid, int delta); + const GNUNET_HashCode * nsid, int delta); /** * Add a pseudonym to the set of known pseudonyms. @@ -76,7 +76,7 @@ int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param meta metadata for the pseudonym */ void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, - const GNUNET_HashCode *id, + const GNUNET_HashCode * id, const struct GNUNET_CONTAINER_MetaData *meta); @@ -114,8 +114,8 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator * * @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. diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h index 86269d9dd..f24bf5c5e 100644 --- a/src/include/gnunet_resolver_service.h +++ b/src/include/gnunet_resolver_service.h @@ -48,7 +48,7 @@ extern "C" * @param addrlen length of the address */ typedef void (*GNUNET_RESOLVER_AddressCallback) (void *cls, - const struct sockaddr *addr, + const struct sockaddr * addr, socklen_t addrlen); @@ -63,15 +63,13 @@ 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); /** @@ -84,12 +82,16 @@ 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); /** @@ -102,11 +104,15 @@ GNUNET_RESOLVER_ip_get (const char *hostname, * @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); /** @@ -124,8 +130,7 @@ 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); /** @@ -140,13 +145,19 @@ 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); /** @@ -157,8 +168,7 @@ GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, * * @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 723f8ca91..c09153e31 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h @@ -206,10 +206,10 @@ typedef void (*GNUNET_SCHEDULER_Task) (void *cls, * @return number of selected sockets, GNUNET_SYSERR on error */ typedef int (*GNUNET_SCHEDULER_select) (void *cls, - struct GNUNET_NETWORK_FDSet *rfds, - struct GNUNET_NETWORK_FDSet *wfds, - struct GNUNET_NETWORK_FDSet *efds, - struct GNUNET_TIME_Relative timeout); + struct GNUNET_NETWORK_FDSet * rfds, + struct GNUNET_NETWORK_FDSet * wfds, + struct GNUNET_NETWORK_FDSet * efds, + struct GNUNET_TIME_Relative timeout); /** * Initialize and run scheduler. This function will return when all * tasks have completed. On systems with signals, receiving a SIGTERM @@ -258,8 +258,7 @@ 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 (); /** @@ -305,8 +304,7 @@ GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, */ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, - GNUNET_SCHEDULER_Task task, - void *task_cls); + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -320,8 +318,7 @@ GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, */ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, - GNUNET_SCHEDULER_Task task, - void *task_cls); + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -334,8 +331,7 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, * only valid until "task" is started! */ GNUNET_SCHEDULER_TaskIdentifier -GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, - void *task_cls); +GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -354,8 +350,8 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, */ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, - GNUNET_SCHEDULER_Task task, - void *task_cls); + GNUNET_SCHEDULER_Task task, + void *task_cls); /** @@ -372,8 +368,7 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, */ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, - GNUNET_SCHEDULER_Task task, - void *task_cls); + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -394,9 +389,8 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, */ 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); + struct GNUNET_NETWORK_Handle *rfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -417,9 +411,8 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, */ 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); + struct GNUNET_NETWORK_Handle *wfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -440,9 +433,8 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, */ 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); + const struct GNUNET_DISK_FileHandle *rfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -463,9 +455,8 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, */ 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); + const struct GNUNET_DISK_FileHandle *wfd, + GNUNET_SCHEDULER_Task task, void *task_cls); /** @@ -505,10 +496,9 @@ 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); + 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). @@ -518,7 +508,7 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, */ void GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, - void *new_select_cls); + 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 3ada838b6..e4b856db0 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h @@ -74,8 +74,7 @@ typedef void (*GNUNET_SERVER_MessageCallback) (void *cls, struct GNUNET_SERVER_Client * client, const struct - GNUNET_MessageHeader * - message); + GNUNET_MessageHeader * message); @@ -123,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. @@ -145,8 +144,9 @@ GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, void *a */ struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, - struct sockaddr *const*serverAddr, - const socklen_t *socklen, + struct sockaddr *const + *serverAddr, + const socklen_t * socklen, struct GNUNET_TIME_Relative idle_timeout, int require_found); @@ -195,11 +195,11 @@ GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, * 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); + *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); /** @@ -208,8 +208,7 @@ 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 @@ -237,7 +236,7 @@ GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success); */ void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, - struct GNUNET_TIME_Relative timeout); + struct GNUNET_TIME_Relative timeout); /** @@ -248,7 +247,8 @@ 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); +GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client + *client); /** @@ -364,9 +364,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); /** @@ -392,8 +393,7 @@ void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); * @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); +GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore); @@ -405,8 +405,7 @@ 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); /** @@ -425,8 +424,8 @@ struct GNUNET_SERVER_TransmitContext; * @return NULL on error */ struct GNUNET_SERVER_TransmitContext - *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client - *client); + *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client + *client); /** @@ -441,8 +440,8 @@ struct GNUNET_SERVER_TransmitContext */ void GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext - *tc, const void *data, size_t length, - uint16_t type); + *tc, const void *data, + size_t length, uint16_t type); /** @@ -454,8 +453,11 @@ GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext * @param msg message to append */ void -GNUNET_SERVER_transmit_context_append_message (struct GNUNET_SERVER_TransmitContext - *tc, const struct GNUNET_MessageHeader *msg); +GNUNET_SERVER_transmit_context_append_message (struct + GNUNET_SERVER_TransmitContext + *tc, + const struct GNUNET_MessageHeader + *msg); /** @@ -493,9 +495,10 @@ 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); /** @@ -504,7 +507,9 @@ GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server, * @param nc context to destroy. */ void -GNUNET_SERVER_notification_context_destroy (struct GNUNET_SERVER_NotificationContext *nc); +GNUNET_SERVER_notification_context_destroy (struct + GNUNET_SERVER_NotificationContext + *nc); /** @@ -514,8 +519,9 @@ GNUNET_SERVER_notification_context_destroy (struct GNUNET_SERVER_NotificationCon * @param client client to add */ void -GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext *nc, - struct GNUNET_SERVER_Client *client); +GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext + *nc, + struct GNUNET_SERVER_Client *client); /** @@ -528,10 +534,12 @@ GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext * @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); +GNUNET_SERVER_notification_context_unicast (struct + GNUNET_SERVER_NotificationContext + *nc, + struct GNUNET_SERVER_Client *client, + const struct GNUNET_MessageHeader + *msg, int can_drop); /** @@ -542,9 +550,11 @@ GNUNET_SERVER_notification_context_unicast (struct GNUNET_SERVER_NotificationCon * @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); +GNUNET_SERVER_notification_context_broadcast (struct + GNUNET_SERVER_NotificationContext + *nc, + const struct GNUNET_MessageHeader + *msg, int can_drop); @@ -562,10 +572,10 @@ struct GNUNET_SERVER_MessageStreamTokenizer; * @param message the actual message */ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, - void *client, - const struct - GNUNET_MessageHeader * - message); + void *client, + const struct + GNUNET_MessageHeader * + message); /** @@ -575,9 +585,9 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, * @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); /** @@ -598,11 +608,9 @@ GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, */ int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, - void *client_identity, - const char *buf, - size_t size, - int purge, - int one_shot); + void *client_identity, + const char *buf, + size_t size, int purge, int one_shot); /** diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index 883ad462f..fca2ff329 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h @@ -61,9 +61,9 @@ extern "C" */ int GNUNET_SERVICE_get_server_addresses (const char *serviceName, - const struct GNUNET_CONFIGURATION_Handle *cfg, - struct sockaddr ***addrs, - socklen_t **addr_lens); + const struct GNUNET_CONFIGURATION_Handle + *cfg, struct sockaddr ***addrs, + socklen_t ** addr_lens); /** @@ -84,18 +84,18 @@ typedef void (*GNUNET_SERVICE_Main) (void *cls, * Options for the service (bitmask). */ enum GNUNET_SERVICE_Options - { +{ /** * Use defaults. */ - GNUNET_SERVICE_OPTION_NONE = 0, + GNUNET_SERVICE_OPTION_NONE = 0, /** * Do not trigger server shutdown on signals, allow for the user * to terminate the server explicitly when needed. */ - GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN = 1 - }; + GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN = 1 +}; /** @@ -111,12 +111,12 @@ 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; diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index e22fe16d4..1807d3de0 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h @@ -64,8 +64,7 @@ struct GNUNET_STATISTICS_Handle; typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, const char *name, - uint64_t value, - int is_persistent); + uint64_t value, int is_persistent); /** * Get handle for the statistics service. @@ -75,8 +74,8 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, * @return handle to use */ struct GNUNET_STATISTICS_Handle - *GNUNET_STATISTICS_create (const char *subsystem, - const struct GNUNET_CONFIGURATION_Handle *cfg); + *GNUNET_STATISTICS_create (const char *subsystem, + const struct GNUNET_CONFIGURATION_Handle *cfg); /** @@ -88,7 +87,7 @@ struct GNUNET_STATISTICS_Handle * be completed */ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, - int sync_first); + int sync_first); /** @@ -105,10 +104,9 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, */ int GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, - const char *subsystem, - const char *name, - GNUNET_STATISTICS_Iterator proc, - void *proc_cls); + const char *subsystem, + const char *name, + GNUNET_STATISTICS_Iterator proc, void *proc_cls); /** @@ -138,13 +136,19 @@ 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); /** @@ -153,8 +157,7 @@ GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, * * @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,8 +171,7 @@ GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); */ void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, - const char *name, - uint64_t value, int make_persistent); + const char *name, uint64_t value, int make_persistent); /** * Set statistic value for the peer. Will always use our @@ -182,8 +184,7 @@ GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, */ void GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, - const char *name, - int64_t delta, int make_persistent); + 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 a466074a3..3e15a24c8 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h @@ -105,8 +105,7 @@ char *GNUNET_STRINGS_filename_expand (const char *fil); * (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 size, unsigned int count, ...); /** diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 9d85f3af9..1111f576c 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h @@ -88,10 +88,12 @@ struct GNUNET_TESTING_Host * @param d handle for the daemon * @param emsg error message (NULL on success) */ -typedef void (*GNUNET_TESTING_NotifyHostkeyCreated)(void *cls, - const struct GNUNET_PeerIdentity *id, - struct GNUNET_TESTING_Daemon *d, - const char *emsg); +typedef void (*GNUNET_TESTING_NotifyHostkeyCreated) (void *cls, + const struct + GNUNET_PeerIdentity * id, + struct + GNUNET_TESTING_Daemon * d, + const char *emsg); /** * Prototype of a function that will be called whenever @@ -103,11 +105,14 @@ typedef void (*GNUNET_TESTING_NotifyHostkeyCreated)(void *cls, * @param d handle for the daemon * @param emsg error message (NULL on success) */ -typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, - const struct GNUNET_PeerIdentity *id, - const struct GNUNET_CONFIGURATION_Handle *cfg, - struct GNUNET_TESTING_Daemon *d, - const char *emsg); +typedef void (*GNUNET_TESTING_NotifyDaemonRunning) (void *cls, + const struct + GNUNET_PeerIdentity * id, + const struct + GNUNET_CONFIGURATION_Handle + * cfg, + struct GNUNET_TESTING_Daemon + * d, const char *emsg); /** @@ -203,8 +208,7 @@ enum GNUNET_TESTING_StartPhase * @param cls closure * @param emsg NULL on success */ -typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, - const char *emsg); +typedef void (*GNUNET_TESTING_NotifyCompletion) (void *cls, const char *emsg); /** * Prototype of a function that will be called with the @@ -213,8 +217,8 @@ typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, * @param cls closure * @param num_connections the number of connections created */ -typedef void (*GNUNET_TESTING_NotifyConnections)(void *cls, - unsigned int num_connections); +typedef void (*GNUNET_TESTING_NotifyConnections) (void *cls, + unsigned int num_connections); /** * Handle for a GNUnet daemon (technically a set of @@ -405,15 +409,23 @@ struct GNUNET_TESTING_PeerGroup; * @param second_daemon handle for the second daemon * @param emsg error message (NULL on success) */ -typedef void (*GNUNET_TESTING_NotifyConnection)(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); +typedef void (*GNUNET_TESTING_NotifyConnection) (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); /** * Prototype of a callback function indicating that two peers @@ -425,10 +437,11 @@ typedef void (*GNUNET_TESTING_NotifyConnection)(void *cls, * @param distance distance between the connected peers * @param emsg error message (NULL on success) */ -typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls, - const struct GNUNET_PeerIdentity *first, - const struct GNUNET_PeerIdentity *second, - const char *emsg); +typedef void (*GNUNET_TESTING_NotifyTopology) (void *cls, + const struct GNUNET_PeerIdentity + * first, + const struct GNUNET_PeerIdentity + * second, const char *emsg); /** * Starts a GNUnet daemon. GNUnet must be installed on the target @@ -453,18 +466,22 @@ 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 @@ -474,7 +491,7 @@ GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param daemon the daemon to finish starting */ void -GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *daemon); +GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); /** * Check whether the given daemon is running. @@ -484,8 +501,7 @@ GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *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. @@ -496,7 +512,8 @@ GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); */ void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, - GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls); + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls); /** * Start a peer that has previously been stopped using the daemon_stop @@ -526,7 +543,8 @@ 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); + GNUNET_TESTING_NotifyDaemonRunning cb, + void *cb_cls); /** * Starts a GNUnet daemon's service which has been previously turned off. @@ -540,8 +558,10 @@ GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, 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); + struct GNUNET_TIME_Relative + timeout, + GNUNET_TESTING_NotifyDaemonRunning + cb, void *cb_cls); /** * Get a certain testing daemon handle. @@ -549,9 +569,10 @@ GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, * @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 @@ -562,9 +583,12 @@ GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, * * @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. @@ -595,9 +619,9 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, * @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); + struct GNUNET_CONFIGURATION_Handle *cfg, + GNUNET_TESTING_NotifyCompletion cb, + void *cb_cls); /** * Stops a single service of a GNUnet daemon. Used like daemon_stop, @@ -615,7 +639,8 @@ 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); + GNUNET_TESTING_NotifyCompletion cb, + void *cb_cls); /** * Read a testing hosts file based on a configuration. @@ -626,8 +651,9 @@ 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); /** @@ -657,19 +683,31 @@ GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg); * * @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 @@ -678,7 +716,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param pg the peer group to continue starting */ void -GNUNET_TESTING_daemons_continue_startup(struct GNUNET_TESTING_PeerGroup *pg); +GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); /** @@ -727,10 +765,9 @@ GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, * @param cb_cls closure for cb */ void -GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, +GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); + GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); /** @@ -772,8 +809,7 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, unsigned int voff, unsigned int von, struct GNUNET_TIME_Relative timeout, - GNUNET_TESTING_NotifyCompletion cb, - void *cb_cls); + GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); /* * Start a given service for each of the peers in the peer group. * @@ -804,7 +840,8 @@ GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration */ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, - const struct GNUNET_PeerIdentity *peer, + const struct + GNUNET_PeerIdentity * peer, const char *subsystem, const char *name, uint64_t value, @@ -822,7 +859,8 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, void GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_STATISTICS_Callback cont, - GNUNET_TESTING_STATISTICS_Iterator proc, void *cls); + GNUNET_TESTING_STATISTICS_Iterator proc, + void *cls); /** * Topologies supported for testbeds. @@ -938,8 +976,8 @@ enum GNUNET_TESTING_TopologyOption * known topology, GNUNET_NO if not */ int -GNUNET_TESTING_topology_get(enum GNUNET_TESTING_Topology *topology, - const char * topology_string); +GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, + const char *topology_string); /** * Get connect topology option from string input. @@ -951,8 +989,9 @@ GNUNET_TESTING_topology_get(enum GNUNET_TESTING_Topology *topology, * known topology, GNUNET_NO if not */ int -GNUNET_TESTING_topology_option_get(enum GNUNET_TESTING_TopologyOption *topology_option, - const char * topology_string); +GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption + *topology_option, + const char *topology_string); /** @@ -1007,21 +1046,21 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, */ void GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, - GNUNET_TESTING_NotifyTopology cb, void *cls); + 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. @@ -1066,12 +1105,11 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, * @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); +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 @@ -1090,15 +1128,23 @@ 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. @@ -1110,10 +1156,10 @@ GNUNET_TESTING_peergroup_start( * */ 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); +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 386f6d609..be35ff131 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h @@ -199,10 +199,10 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct * @return timestamp that is smaller */ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct - GNUNET_TIME_Relative - t1, - struct - GNUNET_TIME_Relative t2); + GNUNET_TIME_Relative + t1, + struct + GNUNET_TIME_Relative t2); /** @@ -213,10 +213,10 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct * @return timestamp that is larger */ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct - GNUNET_TIME_Relative - t1, - struct - GNUNET_TIME_Relative t2); + GNUNET_TIME_Relative + t1, + struct + GNUNET_TIME_Relative t2); /** * Return the minimum of two absolute time values. @@ -226,10 +226,10 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct * @return timestamp that is smaller */ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct - GNUNET_TIME_Absolute - t1, - struct - GNUNET_TIME_Absolute t2); + GNUNET_TIME_Absolute + t1, + struct + GNUNET_TIME_Absolute t2); /** * Return the maximum of two absolute time values. @@ -239,10 +239,10 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct * @return timestamp that is smaller */ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct - GNUNET_TIME_Absolute - t1, - struct - GNUNET_TIME_Absolute t2); + GNUNET_TIME_Absolute + t1, + struct + GNUNET_TIME_Absolute t2); /** * Given a timestamp in the future, how much time @@ -266,9 +266,10 @@ 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); /** @@ -324,11 +325,11 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct * @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); + GNUNET_TIME_Absolute + start, + struct + GNUNET_TIME_Relative + duration); /** * Multiply relative time by a given factor. @@ -340,8 +341,7 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, - unsigned int - factor); + unsigned int factor); /** * Divide relative time by a given factor. @@ -351,10 +351,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct * @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); + GNUNET_TIME_Relative + rel, + unsigned int factor); /** * Add relative times together. @@ -366,8 +365,7 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, struct - GNUNET_TIME_Relative - a2); + GNUNET_TIME_Relative a2); /** * Subtract relative timestamp from the other. @@ -378,7 +376,7 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct */ struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, - struct GNUNET_TIME_Relative a2); + struct GNUNET_TIME_Relative a2); /** @@ -429,16 +427,14 @@ 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_plugin.h b/src/include/gnunet_transport_plugin.h index 37eef9427..b90f3f1cf 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h @@ -63,7 +63,7 @@ struct SessionHeader * Expiration time for signature. Do not use in the plugin! */ struct GNUNET_TIME_Absolute pong_sig_expires; - + }; /** @@ -80,8 +80,8 @@ struct SessionHeader * @param session which session is being destoyed */ typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls, - const struct GNUNET_PeerIdentity *peer, - struct Session *session); + const struct GNUNET_PeerIdentity * + peer, struct Session * session); /** @@ -105,18 +105,26 @@ typedef void (*GNUNET_TRANSPORT_SessionEnd) (void *cls, * @return how long the plugin should wait until receiving more data * (plugins that do not support this, can ignore the return value) */ -typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls, - const struct - GNUNET_PeerIdentity * - peer, - const struct - GNUNET_MessageHeader * - message, - const struct GNUNET_TRANSPORT_ATS_Information *ats, - uint32_t ats_count, - struct Session *session, - const char *sender_address, - uint16_t sender_address_len); +typedef struct + GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (void *cls, + const struct + GNUNET_PeerIdentity + * peer, + const struct + GNUNET_MessageHeader + * message, + const struct + GNUNET_TRANSPORT_ATS_Information + * ats, + uint32_t + ats_count, + struct + Session * + session, + const char + *sender_address, + uint16_t + sender_address_len); /** @@ -131,7 +139,7 @@ typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_PluginReceiveCallback) (v * @param addrlen length of the address */ typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls, - int add_remove, + int add_remove, const void *addr, size_t addrlen); @@ -151,16 +159,21 @@ typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls, * @return how long to wait until reading more from this peer * (to enforce inbound quotas) */ -typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void *cls, - const struct - GNUNET_PeerIdentity *peer, - size_t amount_recved); +typedef struct GNUNET_TIME_Relative (*GNUNET_TRANSPORT_TrafficReport) (void + *cls, + const + struct + GNUNET_PeerIdentity + * peer, + size_t + amount_recved); /** * Function that returns a HELLO message. - */ -typedef const struct GNUNET_MessageHeader * (*GNUNET_TRANSPORT_GetHelloCallback)(void); + */ +typedef const struct GNUNET_MessageHeader + *(*GNUNET_TRANSPORT_GetHelloCallback) (void); /** @@ -242,9 +255,9 @@ struct GNUNET_TRANSPORT_PluginEnvironment * the ReceiveCallback. */ typedef void - (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, - const struct GNUNET_PeerIdentity * - target, int result); + (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, + const struct GNUNET_PeerIdentity * + target, int result); /** @@ -284,19 +297,19 @@ typedef void * and does NOT mean that the message was not transmitted (DV) */ typedef ssize_t - (*GNUNET_TRANSPORT_TransmitFunction) (void *cls, - const struct GNUNET_PeerIdentity * - target, - const char *msgbuf, - size_t msgbuf_size, - uint32_t priority, - struct GNUNET_TIME_Relative timeout, - struct Session *session, - const void *addr, - size_t addrlen, - int force_address, - GNUNET_TRANSPORT_TransmitContinuation - cont, void *cont_cls); + (*GNUNET_TRANSPORT_TransmitFunction) (void *cls, + const struct GNUNET_PeerIdentity * + target, + const char *msgbuf, + size_t msgbuf_size, + uint32_t priority, + struct GNUNET_TIME_Relative timeout, + struct Session * session, + const void *addr, + size_t addrlen, + int force_address, + GNUNET_TRANSPORT_TransmitContinuation + cont, void *cont_cls); /** @@ -316,9 +329,9 @@ typedef ssize_t * to be cancelled */ typedef void - (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls, - const struct GNUNET_PeerIdentity * - target); + (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls, + const struct GNUNET_PeerIdentity * + target); /** @@ -348,15 +361,15 @@ typedef void (*GNUNET_TRANSPORT_AddressStringCallback) (void *cls, * @param asc_cls closure for asc */ typedef void - (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls, - const char *type, - const void *addr, - size_t addrlen, - int numeric, - struct GNUNET_TIME_Relative - timeout, - GNUNET_TRANSPORT_AddressStringCallback - asc, void *asc_cls); + (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls, + const char *type, + const void *addr, + size_t addrlen, + int numeric, + struct GNUNET_TIME_Relative + timeout, + GNUNET_TRANSPORT_AddressStringCallback + asc, void *asc_cls); /** @@ -374,8 +387,8 @@ typedef void * and transport, GNUNET_SYSERR if not */ typedef int -(*GNUNET_TRANSPORT_CheckAddress) (void *cls, - const void *addr, size_t addrlen); + (*GNUNET_TRANSPORT_CheckAddress) (void *cls, + const void *addr, size_t addrlen); /** @@ -389,9 +402,9 @@ typedef int * @param addr_len length of the address * @return string representing the same address */ -typedef const char* (*GNUNET_TRANSPORT_AddressToString) (void *cls, - const void *addr, - size_t addrlen); +typedef const char *(*GNUNET_TRANSPORT_AddressToString) (void *cls, + const void *addr, + size_t addrlen); /** diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 0e17a0135..f4cc88e55 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h @@ -90,7 +90,7 @@ enum GNUNET_TRANSPORT_ATS_Property * 2G : 10 [cent/MB] */ GNUNET_TRANSPORT_ATS_COST_FINANCIAL_PER_VOLUME = 1, - + /** * Time based cost in financial units to transmit data * @@ -108,7 +108,7 @@ enum GNUNET_TRANSPORT_ATS_Property * Dialup: 10 [cent/h] */ GNUNET_TRANSPORT_ATS_COST_FINANCIAL_PER_TIME = 2, - + /** * Computational costs * @@ -128,7 +128,7 @@ enum GNUNET_TRANSPORT_ATS_Property * HTTPS with RC4-1024: 2,652 */ GNUNET_TRANSPORT_ATS_COST_COMPUTATIONAL = 3, - + /** * Energy consumption * @@ -157,7 +157,7 @@ enum GNUNET_TRANSPORT_ATS_Property * Bluetooth: 267 (100 mW @ BT2.0 EDR /w 3 MBit/s) */ GNUNET_TRANSPORT_ATS_COST_ENERGY_CONSUMPTION = 4, - + /** * Connect cost * How many bytes are transmitted to initiate a new connection using @@ -180,7 +180,7 @@ enum GNUNET_TRANSPORT_ATS_Property * * */ GNUNET_TRANSPORT_ATS_COST_CONNECT = 5, - + /** * Bandwidth cost * @@ -198,7 +198,7 @@ enum GNUNET_TRANSPORT_ATS_Property * */ GNUNET_TRANSPORT_ATS_COST_BANDWITH_AVAILABLE = 6, - + /** * Network overhead * @@ -219,36 +219,36 @@ enum GNUNET_TRANSPORT_ATS_Property * UDP/IPv6 over Ethernet: 1024 + 38 + 40 + 8 = 1110 [bytes/kb] */ GNUNET_TRANSPORT_ATS_COST_NETWORK_OVERHEAD = 7, - - + + /* Quality related values */ /* ====================== */ - + /* Physical layer quality properties */ - + /** * Signal strength on physical layer * * Unit: [dBm] */ GNUNET_TRANSPORT_ATS_QUALITY_PHY_SIGNAL_STRENGTH = 1025, - + /** * Collision rate on physical layer * * Unit: [B/s] */ GNUNET_TRANSPORT_ATS_QUALITY_PHY_COLLISION_RATE = 1026, - + /** * Error rate on physical layer * * Unit: [B/s] */ GNUNET_TRANSPORT_ATS_QUALITY_PHY_ERROR_RATE = 1027, - + /* Network layer quality properties */ - + /** * Delay * Time between when the time packet is sent and the packet arrives @@ -262,7 +262,7 @@ enum GNUNET_TRANSPORT_ATS_Property * Dialup: 500 */ GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY = 1028, - + /** * Jitter * Time variations of the delay @@ -271,7 +271,7 @@ enum GNUNET_TRANSPORT_ATS_Property * Unit: [ms] */ GNUNET_TRANSPORT_ATS_QUALITY_NET_JITTER = 1029, - + /** * Error rate on network layer * @@ -286,7 +286,7 @@ enum GNUNET_TRANSPORT_ATS_Property * measured or somehow determined */ GNUNET_TRANSPORT_ATS_QUALITY_NET_ERRORRATE = 1030, - + /** * Drop rate on network layer * Bytes actively dismissed by a network component during transmission @@ -303,7 +303,7 @@ enum GNUNET_TRANSPORT_ATS_Property * measured or somehow determined */ GNUNET_TRANSPORT_ATS_QUALITY_NET_DROPRATE = 1031, - + /** * Loss rate on network layer * Bytes lost during transmission @@ -320,7 +320,7 @@ enum GNUNET_TRANSPORT_ATS_Property * or somehow determined */ GNUNET_TRANSPORT_ATS_QUALITY_NET_LOSSRATE = 1032, - + /** * Throughput on network layer * @@ -334,7 +334,7 @@ enum GNUNET_TRANSPORT_ATS_Property * */ GNUNET_TRANSPORT_ATS_QUALITY_NET_THROUGHPUT = 1033, - + /** * Distance on network layer * @@ -345,17 +345,16 @@ enum GNUNET_TRANSPORT_ATS_Property /* Availability related values */ /* =========================== */ - + /** * Is a peer reachable? */ GNUNET_TRANSPORT_ATS_AVAILABILITY_REACHABLE = 2048, - + /** * Is there a connection established to a peer using this transport */ GNUNET_TRANSPORT_ATS_AVAILABILITY_CONNECTED = 2049 - }; @@ -383,7 +382,7 @@ struct GNUNET_TRANSPORT_ATS_Information * ATS property type, in network byte order. */ uint32_t type; - + /** * ATS property value, in network byte order. */ @@ -407,8 +406,9 @@ typedef void (*GNUNET_TRANSPORT_ReceiveCallback) (void *cls, const struct GNUNET_MessageHeader * message, - const struct GNUNET_TRANSPORT_ATS_Information *ats, - uint32_t ats_count); + const struct + GNUNET_TRANSPORT_ATS_Information + * ats, uint32_t ats_count); /** @@ -427,10 +427,11 @@ struct GNUNET_TRANSPORT_Handle; * @param ats_count number of entries in ats (excluding 0-termination) */ typedef void - (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, - const struct GNUNET_PeerIdentity * peer, - const struct GNUNET_TRANSPORT_ATS_Information *ats, - uint32_t ats_count); + (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, + const struct GNUNET_PeerIdentity * peer, + const struct + GNUNET_TRANSPORT_ATS_Information * ats, + uint32_t ats_count); /** * Function called to notify transport users that another @@ -440,9 +441,9 @@ typedef void * @param peer the peer that disconnected */ typedef void - (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, - const struct GNUNET_PeerIdentity * - peer); + (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, + const struct GNUNET_PeerIdentity * + peer); /** @@ -452,8 +453,7 @@ typedef void * @param address NULL on error, otherwise 0-terminated printable UTF-8 string */ typedef void -(*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, - const char *address); + (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, const char *address); /** @@ -471,9 +471,10 @@ typedef void */ struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle - *cfg, - const struct GNUNET_PeerIdentity *self, - void *cls, + *cfg, + const struct + GNUNET_PeerIdentity + *self, void *cls, GNUNET_TRANSPORT_ReceiveCallback rec, GNUNET_TRANSPORT_NotifyConnect @@ -499,7 +500,7 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); */ void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, - const struct GNUNET_PeerIdentity *target); + const struct GNUNET_PeerIdentity *target); /** @@ -544,15 +545,15 @@ struct GNUNET_TRANSPORT_TransmitHandle; * 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); + *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); /** @@ -574,8 +575,10 @@ GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct * @param cls closure * @param hello our updated HELLO */ -typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback)(void *cls, - const struct GNUNET_MessageHeader *hello); +typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, + const struct + GNUNET_MessageHeader * + hello); /** @@ -600,8 +603,8 @@ GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, */ void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, - GNUNET_TRANSPORT_HelloUpdateCallback rec, - void *rec_cls); + GNUNET_TRANSPORT_HelloUpdateCallback rec, + void *rec_cls); /** @@ -618,8 +621,7 @@ GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, const struct GNUNET_MessageHeader *hello, - GNUNET_SCHEDULER_Task cont, - void *cls); + GNUNET_SCHEDULER_Task cont, void *cls); /** @@ -637,13 +639,13 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, */ void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, - const char * address, + const char *address, size_t addressLen, - int numeric, + int numeric, const char *nameTrans, - struct GNUNET_TIME_Relative timeout, - GNUNET_TRANSPORT_AddressLookUpCallback aluc, - void *aluc_cls); + struct GNUNET_TIME_Relative timeout, + GNUNET_TRANSPORT_AddressLookUpCallback aluc, + void *aluc_cls); /** @@ -657,10 +659,12 @@ GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, * @param peer_address_callback_cls closure for peer_address_callback */ void -GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, +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, + GNUNET_TRANSPORT_AddressLookUpCallback + peer_address_callback, void *peer_address_callback_cls); @@ -676,7 +680,8 @@ GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle * void GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, struct GNUNET_TIME_Relative timeout, - GNUNET_TRANSPORT_AddressLookUpCallback peer_address_callback, + GNUNET_TRANSPORT_AddressLookUpCallback + peer_address_callback, void *peer_address_callback_cls); @@ -693,8 +698,9 @@ struct GNUNET_TRANSPORT_Blacklist; * @param pid peer to approve or disapproave * @return GNUNET_OK if the connection is allowed */ -typedef int (*GNUNET_TRANSPORT_BlacklistCallback)(void *cls, - const struct GNUNET_PeerIdentity *pid); +typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, + const struct + GNUNET_PeerIdentity * pid); /** @@ -711,10 +717,12 @@ 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); /** @@ -723,8 +731,7 @@ GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, * * @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/platform.h b/src/include/platform.h index 4bdebf90f..4f9eb5eda 100644 --- a/src/include/platform.h +++ b/src/include/platform.h @@ -90,7 +90,7 @@ #if HAVE_NETINET_IN_SYSTM_H #include #endif -#include /* superset of previous */ +#include /* superset of previous */ #include #include #include @@ -110,7 +110,7 @@ #include #include #ifdef WINDOWS -#include /* for alloca(), on other OSes it's in stdlib.h */ +#include /* for alloca(), on other OSes it's in stdlib.h */ #endif #ifndef _MSC_VER #include /* KLB_FIX */ diff --git a/src/include/plibc.h b/src/include/plibc.h index a59e53de9..82079faf1 100644 --- a/src/include/plibc.h +++ b/src/include/plibc.h @@ -29,17 +29,18 @@ #define _PLIBC_H_ #ifndef SIGALRM - #define SIGALRM 14 +#define SIGALRM 14 #endif #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif #include #ifdef Q_OS_WIN32 - #define WINDOWS 1 +#define WINDOWS 1 #endif #define HAVE_PLIBC_FD 0 @@ -47,7 +48,7 @@ extern "C" { #ifdef WINDOWS #if ENABLE_NLS - #include "langinfo.h" +#include "langinfo.h" #endif #include @@ -72,8 +73,8 @@ extern "C" { #define Li2Double(x) ((double)((x).HighPart) * 4.294967296E9 + \ (double)((x).LowPart)) -struct stat64 -{ + struct stat64 + { _dev_t st_dev; _ino_t st_ino; _mode_t st_mode; @@ -85,133 +86,134 @@ struct stat64 __time64_t st_atime; __time64_t st_mtime; __time64_t st_ctime; -}; + }; -typedef unsigned int sa_family_t; + typedef unsigned int sa_family_t; -struct sockaddr_un { - short sun_family; /*AF_UNIX*/ - char sun_path[108]; /*path name */ -}; + struct sockaddr_un + { + short sun_family; /*AF_UNIX */ + char sun_path[108]; /*path name */ + }; #ifndef pid_t - #define pid_t DWORD +#define pid_t DWORD #endif #ifndef error_t - #define error_t int +#define error_t int #endif #ifndef WEXITSTATUS - #define WEXITSTATUS(status) (((status) & 0xff00) >> 8) +#define WEXITSTATUS(status) (((status) & 0xff00) >> 8) #endif #ifndef MSG_DONTWAIT - #define MSG_DONTWAIT 0 +#define MSG_DONTWAIT 0 #endif -enum -{ - _SC_PAGESIZE = 30, - _SC_PAGE_SIZE = 30 -}; + enum + { + _SC_PAGESIZE = 30, + _SC_PAGE_SIZE = 30 + }; /* Thanks to the Cygwin project */ -#define ENOCSI 43 /* No CSI structure available */ -#define EL2HLT 44 /* Level 2 halted */ +#define ENOCSI 43 /* No CSI structure available */ +#define EL2HLT 44 /* Level 2 halted */ #ifndef EDEADLK - #define EDEADLK 45 /* Deadlock condition */ +#define EDEADLK 45 /* Deadlock condition */ #endif #ifndef ENOLCK - #define ENOLCK 46 /* No record locks available */ +#define ENOLCK 46 /* No record locks available */ #endif -#define EBADE 50 /* Invalid exchange */ -#define EBADR 51 /* Invalid request descriptor */ -#define EXFULL 52 /* Exchange full */ -#define ENOANO 53 /* No anode */ -#define EBADRQC 54 /* Invalid request code */ -#define EBADSLT 55 /* Invalid slot */ +#define EBADE 50 /* Invalid exchange */ +#define EBADR 51 /* Invalid request descriptor */ +#define EXFULL 52 /* Exchange full */ +#define ENOANO 53 /* No anode */ +#define EBADRQC 54 /* Invalid request code */ +#define EBADSLT 55 /* Invalid slot */ #ifndef EDEADLOCK - #define EDEADLOCK EDEADLK /* File locking deadlock error */ +#define EDEADLOCK EDEADLK /* File locking deadlock error */ #endif -#define EBFONT 57 /* Bad font file fmt */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data (for no delay io) */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* The object is remote */ -#define ENOLINK 67 /* The link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 74 /* Multihop attempted */ -#define ELBIN 75 /* Inode is remote (not really error) */ -#define EDOTDOT 76 /* Cross mount point (not really error) */ -#define EBADMSG 77 /* Trying to read unreadable message */ -#define ENOTUNIQ 80 /* Given log. name not unique */ -#define EBADFD 81 /* f.d. invalid for this operation */ -#define EREMCHG 82 /* Remote address changed */ -#define ELIBACC 83 /* Can't access a needed shared lib */ -#define ELIBBAD 84 /* Accessing a corrupted shared lib */ -#define ELIBSCN 85 /* .lib section in a.out corrupted */ -#define ELIBMAX 86 /* Attempting to link in too many libs */ -#define ELIBEXEC 87 /* Attempting to exec a shared library */ +#define EBFONT 57 /* Bad font file fmt */ +#define ENOSTR 60 /* Device not a stream */ +#define ENODATA 61 /* No data (for no delay io) */ +#define ETIME 62 /* Timer expired */ +#define ENOSR 63 /* Out of streams resources */ +#define ENONET 64 /* Machine is not on the network */ +#define ENOPKG 65 /* Package not installed */ +#define EREMOTE 66 /* The object is remote */ +#define ENOLINK 67 /* The link has been severed */ +#define EADV 68 /* Advertise error */ +#define ESRMNT 69 /* Srmount error */ +#define ECOMM 70 /* Communication error on send */ +#define EPROTO 71 /* Protocol error */ +#define EMULTIHOP 74 /* Multihop attempted */ +#define ELBIN 75 /* Inode is remote (not really error) */ +#define EDOTDOT 76 /* Cross mount point (not really error) */ +#define EBADMSG 77 /* Trying to read unreadable message */ +#define ENOTUNIQ 80 /* Given log. name not unique */ +#define EBADFD 81 /* f.d. invalid for this operation */ +#define EREMCHG 82 /* Remote address changed */ +#define ELIBACC 83 /* Can't access a needed shared lib */ +#define ELIBBAD 84 /* Accessing a corrupted shared lib */ +#define ELIBSCN 85 /* .lib section in a.out corrupted */ +#define ELIBMAX 86 /* Attempting to link in too many libs */ +#define ELIBEXEC 87 /* Attempting to exec a shared library */ #ifndef ENOSYS - #define ENOSYS 88 /* Function not implemented */ +#define ENOSYS 88 /* Function not implemented */ #endif -#define ENMFILE 89 /* No more files */ +#define ENMFILE 89 /* No more files */ #ifndef ENOTEMPTY - #define ENOTEMPTY 90 /* Directory not empty */ +#define ENOTEMPTY 90 /* Directory not empty */ #endif #ifndef ENAMETOOLONG - #define ENAMETOOLONG 91 /* File or path name too long */ +#define ENAMETOOLONG 91 /* File or path name too long */ #endif -#define ELOOP 92 /* Too many symbolic links */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ -#define EPROTOTYPE 107 /* Protocol wrong type for socket */ -#define ENOTSOCK 108 /* Socket operation on non-socket */ -#define ENOPROTOOPT 109 /* Protocol not available */ -#define ESHUTDOWN 110 /* Can't send after socket shutdown */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EADDRINUSE 112 /* Address already in use */ -#define ECONNABORTED 113 /* Connection aborted */ -#define ENETUNREACH 114 /* Network is unreachable */ -#define ENETDOWN 115 /* Network interface is not configured */ +#define ELOOP 92 /* Too many symbolic links */ +#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ +#define EPFNOSUPPORT 96 /* Protocol family not supported */ +#define ECONNRESET 104 /* Connection reset by peer */ +#define ENOBUFS 105 /* No buffer space available */ +#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ +#define EPROTOTYPE 107 /* Protocol wrong type for socket */ +#define ENOTSOCK 108 /* Socket operation on non-socket */ +#define ENOPROTOOPT 109 /* Protocol not available */ +#define ESHUTDOWN 110 /* Can't send after socket shutdown */ +#define ECONNREFUSED 111 /* Connection refused */ +#define EADDRINUSE 112 /* Address already in use */ +#define ECONNABORTED 113 /* Connection aborted */ +#define ENETUNREACH 114 /* Network is unreachable */ +#define ENETDOWN 115 /* Network interface is not configured */ #ifndef ETIMEDOUT - #define ETIMEDOUT 116 /* Connection timed out */ +#define ETIMEDOUT 116 /* Connection timed out */ #endif -#define EHOSTDOWN 117 /* Host is down */ -#define EHOSTUNREACH 118 /* Host is unreachable */ -#define EINPROGRESS 119 /* Connection already in progress */ -#define EALREADY 120 /* Socket already connected */ -#define EDESTADDRREQ 121 /* Destination address required */ -#define EMSGSIZE 122 /* Message too long */ -#define EPROTONOSUPPORT 123 /* Unknown protocol */ -#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ -#define EADDRNOTAVAIL 125 /* Address not available */ -#define ENETRESET 126 /* Connection aborted by network */ -#define EISCONN 127 /* Socket is already connected */ -#define ENOTCONN 128 /* Socket is not connected */ -#define ETOOMANYREFS 129 /* Too many references: cannot splice */ -#define EPROCLIM 130 /* Too many processes */ -#define EUSERS 131 /* Too many users */ -#define EDQUOT 132 /* Disk quota exceeded */ -#define ESTALE 133 /* Unknown error */ +#define EHOSTDOWN 117 /* Host is down */ +#define EHOSTUNREACH 118 /* Host is unreachable */ +#define EINPROGRESS 119 /* Connection already in progress */ +#define EALREADY 120 /* Socket already connected */ +#define EDESTADDRREQ 121 /* Destination address required */ +#define EMSGSIZE 122 /* Message too long */ +#define EPROTONOSUPPORT 123 /* Unknown protocol */ +#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ +#define EADDRNOTAVAIL 125 /* Address not available */ +#define ENETRESET 126 /* Connection aborted by network */ +#define EISCONN 127 /* Socket is already connected */ +#define ENOTCONN 128 /* Socket is not connected */ +#define ETOOMANYREFS 129 /* Too many references: cannot splice */ +#define EPROCLIM 130 /* Too many processes */ +#define EUSERS 131 /* Too many users */ +#define EDQUOT 132 /* Disk quota exceeded */ +#define ESTALE 133 /* Unknown error */ #ifndef ENOTSUP - #define ENOTSUP 134 /* Not supported */ +#define ENOTSUP 134 /* Not supported */ #endif -#define ENOMEDIUM 135 /* No medium (in tape drive) */ -#define ENOSHARE 136 /* No such host or network path */ -#define ECASECLASH 137 /* Filename exists with different case */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define EOVERFLOW 139 /* Value too large for defined data type */ +#define ENOMEDIUM 135 /* No medium (in tape drive) */ +#define ENOSHARE 136 /* No such host or network path */ +#define ECASECLASH 137 /* Filename exists with different case */ +#define EWOULDBLOCK EAGAIN /* Operation would block */ +#define EOVERFLOW 139 /* Value too large for defined data type */ #undef HOST_NOT_FOUND #define HOST_NOT_FOUND 1 @@ -225,68 +227,68 @@ enum #define PROT_READ 0x1 #define PROT_WRITE 0x2 #define MAP_SHARED 0x1 -#define MAP_PRIVATE 0x2 /* unsupported */ +#define MAP_PRIVATE 0x2 /* unsupported */ #define MAP_FIXED 0x10 #define MAP_FAILED ((void *)-1) -struct statfs -{ - long f_type; /* type of filesystem (see below) */ - long f_bsize; /* optimal transfer block size */ - long f_blocks; /* total data blocks in file system */ - long f_bfree; /* free blocks in fs */ - long f_bavail; /* free blocks avail to non-superuser */ - long f_files; /* total file nodes in file system */ - long f_ffree; /* free file nodes in fs */ - long f_fsid; /* file system id */ - long f_namelen; /* maximum length of filenames */ - long f_spare[6]; /* spare for later */ -}; - -extern const struct in6_addr in6addr_any; /* :: */ -extern const struct in6_addr in6addr_loopback; /* ::1 */ + struct statfs + { + long f_type; /* type of filesystem (see below) */ + long f_bsize; /* optimal transfer block size */ + long f_blocks; /* total data blocks in file system */ + long f_bfree; /* free blocks in fs */ + long f_bavail; /* free blocks avail to non-superuser */ + long f_files; /* total file nodes in file system */ + long f_ffree; /* free file nodes in fs */ + long f_fsid; /* file system id */ + long f_namelen; /* maximum length of filenames */ + long f_spare[6]; /* spare for later */ + }; + + extern const struct in6_addr in6addr_any; /* :: */ + extern const struct in6_addr in6addr_loopback; /* ::1 */ /* Taken from the Wine project /wine/include/winternl.h */ -enum SYSTEM_INFORMATION_CLASS -{ - SystemBasicInformation = 0, - Unknown1, - SystemPerformanceInformation = 2, - SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */ - Unknown4, - SystemProcessInformation = 5, - Unknown6, - Unknown7, - SystemProcessorPerformanceInformation = 8, - Unknown9, - Unknown10, - SystemDriverInformation, - Unknown12, - Unknown13, - Unknown14, - Unknown15, - SystemHandleList, - Unknown17, - Unknown18, - Unknown19, - Unknown20, - SystemCacheInformation, - Unknown22, - SystemInterruptInformation = 23, - SystemExceptionInformation = 33, - SystemRegistryQuotaInformation = 37, - SystemLookasideInformation = 45 -}; - -typedef struct -{ + enum SYSTEM_INFORMATION_CLASS + { + SystemBasicInformation = 0, + Unknown1, + SystemPerformanceInformation = 2, + SystemTimeOfDayInformation = 3, /* was SystemTimeInformation */ + Unknown4, + SystemProcessInformation = 5, + Unknown6, + Unknown7, + SystemProcessorPerformanceInformation = 8, + Unknown9, + Unknown10, + SystemDriverInformation, + Unknown12, + Unknown13, + Unknown14, + Unknown15, + SystemHandleList, + Unknown17, + Unknown18, + Unknown19, + Unknown20, + SystemCacheInformation, + Unknown22, + SystemInterruptInformation = 23, + SystemExceptionInformation = 33, + SystemRegistryQuotaInformation = 37, + SystemLookasideInformation = 45 + }; + + typedef struct + { LARGE_INTEGER IdleTime; LARGE_INTEGER KernelTime; LARGE_INTEGER UserTime; LARGE_INTEGER Reserved1[2]; ULONG Reserved2; -} SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; + } SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION; #define sleep(secs) (Sleep(secs * 1000)) @@ -303,11 +305,11 @@ typedef struct #define SHUT_RDWR SD_BOTH /* Operations for flock() */ -#define LOCK_SH 1 /* shared lock */ -#define LOCK_EX 2 /* exclusive lock */ -#define LOCK_NB 4 /* or'd with one of the above to prevent - blocking */ -#define LOCK_UN 8 /* remove lock */ +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* or'd with one of the above to prevent + * blocking */ +#define LOCK_UN 8 /* remove lock */ /* Not supported under MinGW */ #define S_IRGRP 0 @@ -331,330 +333,331 @@ typedef struct #define SetErrnoFromWinError(e) _SetErrnoFromWinError(e, __FILE__, __LINE__) -BOOL _plibc_CreateShortcut(const char *pszSrc, const char *pszDest); -BOOL _plibc_DereferenceShortcut(char *pszShortcut); -char *plibc_ChooseDir(char *pszTitle, unsigned long ulFlags); -char *plibc_ChooseFile(char *pszTitle, unsigned long ulFlags); -long QueryRegistry(HKEY hMainKey, const char *pszKey, const char *pszSubKey, - char *pszBuffer, long *pdLength); - -BOOL __win_IsHandleMarkedAsBlocking(int hHandle); -void __win_SetHandleBlockingMode(int s, BOOL bBlocking); -void __win_DiscardHandleBlockingMode(int s); -int _win_isSocketValid(int s); -int plibc_conv_to_win_path(const char *pszUnix, char *pszWindows); -unsigned plibc_get_handle_count(); - -typedef void (*TPanicProc) (int, char *); -void plibc_set_panic_proc(TPanicProc proc); - -int flock(int fd, int operation); -int fsync(int fildes); -int inet_pton(int af, const char *src, void *dst); -int inet_pton4(const char *src, u_char *dst, int pton); + BOOL _plibc_CreateShortcut (const char *pszSrc, const char *pszDest); + BOOL _plibc_DereferenceShortcut (char *pszShortcut); + char *plibc_ChooseDir (char *pszTitle, unsigned long ulFlags); + char *plibc_ChooseFile (char *pszTitle, unsigned long ulFlags); + long QueryRegistry (HKEY hMainKey, const char *pszKey, const char *pszSubKey, + char *pszBuffer, long *pdLength); + + BOOL __win_IsHandleMarkedAsBlocking (int hHandle); + void __win_SetHandleBlockingMode (int s, BOOL bBlocking); + void __win_DiscardHandleBlockingMode (int s); + int _win_isSocketValid (int s); + int plibc_conv_to_win_path (const char *pszUnix, char *pszWindows); + unsigned plibc_get_handle_count (); + + typedef void (*TPanicProc) (int, char *); + void plibc_set_panic_proc (TPanicProc proc); + + int flock (int fd, int operation); + int fsync (int fildes); + int inet_pton (int af, const char *src, void *dst); + int inet_pton4 (const char *src, u_char * dst, int pton); #if USE_IPV6 -int inet_pton6(const char *src, u_char *dst); + int inet_pton6 (const char *src, u_char * dst); #endif -int truncate(const char *fname, int distance); -int statfs(const char *path, struct statfs *buf); -const char *hstrerror(int err); -int mkstemp(char *tmplate); -char *strptime (const char *buf, const char *format, struct tm *tm); -const char *inet_ntop(int af, const void *src, char *dst, size_t size); - -int plibc_init(char *pszOrg, char *pszApp); -void plibc_shutdown(); -int plibc_initialized(); -int plibc_conv_to_win_path_ex(const char *pszUnix, char *pszWindows, int derefLinks); -void _SetErrnoFromWinError(long lWinError, char *pszCaller, int iLine); -void SetErrnoFromWinsockError(long lWinError); -void SetHErrnoFromWinError(long lWinError); -void SetErrnoFromHRESULT(HRESULT hRes); -int GetErrnoFromWinsockError(long lWinError); -FILE *_win_fopen(const char *filename, const char *mode); -DIR *_win_opendir(const char *dirname); -int _win_open(const char *filename, int oflag, ...); + int truncate (const char *fname, int distance); + int statfs (const char *path, struct statfs *buf); + const char *hstrerror (int err); + int mkstemp (char *tmplate); + char *strptime (const char *buf, const char *format, struct tm *tm); + const char *inet_ntop (int af, const void *src, char *dst, size_t size); + + int plibc_init (char *pszOrg, char *pszApp); + void plibc_shutdown (); + int plibc_initialized (); + int plibc_conv_to_win_path_ex (const char *pszUnix, char *pszWindows, + int derefLinks); + void _SetErrnoFromWinError (long lWinError, char *pszCaller, int iLine); + void SetErrnoFromWinsockError (long lWinError); + void SetHErrnoFromWinError (long lWinError); + void SetErrnoFromHRESULT (HRESULT hRes); + int GetErrnoFromWinsockError (long lWinError); + FILE *_win_fopen (const char *filename, const char *mode); + DIR *_win_opendir (const char *dirname); + int _win_open (const char *filename, int oflag, ...); #ifdef ENABLE_NLS -char *_win_bindtextdomain(const char *domainname, const char *dirname); + char *_win_bindtextdomain (const char *domainname, const char *dirname); #endif -int _win_chdir(const char *path); -int _win_close(int fd); -int _win_creat(const char *path, mode_t mode); -char *_win_ctime(const time_t *clock); -char *_win_ctime_r(const time_t *clock, char *buf); -int _win_fstat(int handle, struct stat *buffer); -int _win_ftruncate(int fildes, off_t length); -void _win_gettimeofday(struct timeval *tp, void *tzp); -int _win_kill(pid_t pid, int sig); -int _win_pipe(int *phandles); -int _win_rmdir(const char *path); -int _win_access( const char *path, int mode ); -int _win_chmod(const char *filename, int pmode); -char *realpath(const char *file_name, char *resolved_name); -long _win_random(void); -void _win_srandom(unsigned int seed); -int _win_remove(const char *path); -int _win_rename(const char *oldname, const char *newname); -int _win_stat(const char *path, struct stat *buffer); -int _win_stat64(const char *path, struct stat64 *buffer); -long _win_sysconf(int name); -int _win_unlink(const char *filename); -int _win_write(int fildes, const void *buf, size_t nbyte); -int _win_read(int fildes, void *buf, size_t nbyte); -size_t _win_fwrite(const void *buffer, size_t size, size_t count, FILE *stream); -size_t _win_fread( void *buffer, size_t size, size_t count, FILE *stream ); -int _win_symlink(const char *path1, const char *path2); -void *_win_mmap(void *start, size_t len, int access, int flags, int fd, - unsigned long long offset); -int _win_munmap(void *start, size_t length); -int _win_lstat(const char *path, struct stat *buf); -int _win_lstat64(const char *path, struct stat64 *buf); -int _win_readlink(const char *path, char *buf, size_t bufsize); -int _win_accept(int s, struct sockaddr *addr, int *addrlen); -int _win_printf(const char *format,...); -int _win_fprintf(FILE *f,const char *format,...); -int _win_vprintf(const char *format, va_list ap); -int _win_vfprintf(FILE *stream, const char *format, va_list arg_ptr); -int _win_vsprintf(char *dest,const char *format, va_list arg_ptr); -int _win_vsnprintf(char* str, size_t size, const char *format, va_list arg_ptr); -int _win_snprintf(char *str,size_t size,const char *format,...); -int _win_sprintf(char *dest,const char *format,...); -int _win_vsscanf(const char* str, const char* format, va_list arg_ptr); -int _win_sscanf(const char *str, const char *format, ...); -int _win_vfscanf(FILE *stream, const char *format, va_list arg_ptr); -int _win_vscanf(const char *format, va_list arg_ptr); -int _win_scanf(const char *format, ...); -int _win_fscanf(FILE *stream, const char *format, ...); -pid_t _win_waitpid(pid_t pid, int *stat_loc, int options); -int _win_bind(int s, const struct sockaddr *name, int namelen); -int _win_connect(int s,const struct sockaddr *name, int namelen); -int _win_getpeername(int s, struct sockaddr *name, - int *namelen); -int _win_getsockname(int s, struct sockaddr *name, - int *namelen); -int _win_getsockopt(int s, int level, int optname, char *optval, - int *optlen); -int _win_listen(int s, int backlog); -int _win_recv(int s, char *buf, int len, int flags); -int _win_recvfrom(int s, void *buf, int len, int flags, - struct sockaddr *from, int *fromlen); -int _win_select(int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds, - const struct timeval *tv); -int _win_send(int s, const char *buf, int len, int flags); -int _win_sendto(int s, const char *buf, int len, int flags, - const struct sockaddr *to, int tolen); -int _win_setsockopt(int s, int level, int optname, const void *optval, - int optlen); -int _win_shutdown(int s, int how); -int _win_socket(int af, int type, int protocol); -struct hostent *_win_gethostbyaddr(const char *addr, int len, int type); -struct hostent *_win_gethostbyname(const char *name); -struct hostent *gethostbyname2(const char *name, int af); -char *_win_strerror(int errnum); -int IsWinNT(); -char *index(const char *s, int c); + int _win_chdir (const char *path); + int _win_close (int fd); + int _win_creat (const char *path, mode_t mode); + char *_win_ctime (const time_t * clock); + char *_win_ctime_r (const time_t * clock, char *buf); + int _win_fstat (int handle, struct stat *buffer); + int _win_ftruncate (int fildes, off_t length); + void _win_gettimeofday (struct timeval *tp, void *tzp); + int _win_kill (pid_t pid, int sig); + int _win_pipe (int *phandles); + int _win_rmdir (const char *path); + int _win_access (const char *path, int mode); + int _win_chmod (const char *filename, int pmode); + char *realpath (const char *file_name, char *resolved_name); + long _win_random (void); + void _win_srandom (unsigned int seed); + int _win_remove (const char *path); + int _win_rename (const char *oldname, const char *newname); + int _win_stat (const char *path, struct stat *buffer); + int _win_stat64 (const char *path, struct stat64 *buffer); + long _win_sysconf (int name); + int _win_unlink (const char *filename); + int _win_write (int fildes, const void *buf, size_t nbyte); + int _win_read (int fildes, void *buf, size_t nbyte); + size_t _win_fwrite (const void *buffer, size_t size, size_t count, + FILE * stream); + size_t _win_fread (void *buffer, size_t size, size_t count, FILE * stream); + int _win_symlink (const char *path1, const char *path2); + void *_win_mmap (void *start, size_t len, int access, int flags, int fd, + unsigned long long offset); + int _win_munmap (void *start, size_t length); + int _win_lstat (const char *path, struct stat *buf); + int _win_lstat64 (const char *path, struct stat64 *buf); + int _win_readlink (const char *path, char *buf, size_t bufsize); + int _win_accept (int s, struct sockaddr *addr, int *addrlen); + int _win_printf (const char *format, ...); + int _win_fprintf (FILE * f, const char *format, ...); + int _win_vprintf (const char *format, va_list ap); + int _win_vfprintf (FILE * stream, const char *format, va_list arg_ptr); + int _win_vsprintf (char *dest, const char *format, va_list arg_ptr); + int _win_vsnprintf (char *str, size_t size, const char *format, + va_list arg_ptr); + int _win_snprintf (char *str, size_t size, const char *format, ...); + int _win_sprintf (char *dest, const char *format, ...); + int _win_vsscanf (const char *str, const char *format, va_list arg_ptr); + int _win_sscanf (const char *str, const char *format, ...); + int _win_vfscanf (FILE * stream, const char *format, va_list arg_ptr); + int _win_vscanf (const char *format, va_list arg_ptr); + int _win_scanf (const char *format, ...); + int _win_fscanf (FILE * stream, const char *format, ...); + pid_t _win_waitpid (pid_t pid, int *stat_loc, int options); + int _win_bind (int s, const struct sockaddr *name, int namelen); + int _win_connect (int s, const struct sockaddr *name, int namelen); + int _win_getpeername (int s, struct sockaddr *name, int *namelen); + int _win_getsockname (int s, struct sockaddr *name, int *namelen); + int _win_getsockopt (int s, int level, int optname, char *optval, + int *optlen); + int _win_listen (int s, int backlog); + int _win_recv (int s, char *buf, int len, int flags); + int _win_recvfrom (int s, void *buf, int len, int flags, + struct sockaddr *from, int *fromlen); + int _win_select (int max_fd, fd_set * rfds, fd_set * wfds, fd_set * efds, + const struct timeval *tv); + int _win_send (int s, const char *buf, int len, int flags); + int _win_sendto (int s, const char *buf, int len, int flags, + const struct sockaddr *to, int tolen); + int _win_setsockopt (int s, int level, int optname, const void *optval, + int optlen); + int _win_shutdown (int s, int how); + int _win_socket (int af, int type, int protocol); + struct hostent *_win_gethostbyaddr (const char *addr, int len, int type); + struct hostent *_win_gethostbyname (const char *name); + struct hostent *gethostbyname2 (const char *name, int af); + char *_win_strerror (int errnum); + int IsWinNT (); + char *index (const char *s, int c); #if !HAVE_STRNDUP -char *strndup (const char *s, size_t n); + char *strndup (const char *s, size_t n); #endif #if !HAVE_STRNLEN -size_t strnlen (const char *str, size_t maxlen); + size_t strnlen (const char *str, size_t maxlen); #endif -char *stpcpy(char *dest, const char *src); -char *strcasestr(const char *haystack_start, const char *needle_start); + char *stpcpy (char *dest, const char *src); + char *strcasestr (const char *haystack_start, const char *needle_start); #define strcasecmp(a, b) stricmp(a, b) #define strncasecmp(a, b, c) strnicmp(a, b, c) -#endif /* WINDOWS */ +#endif /* WINDOWS */ #ifndef WINDOWS - #define DIR_SEPARATOR '/' - #define DIR_SEPARATOR_STR "/" - #define PATH_SEPARATOR ':' - #define PATH_SEPARATOR_STR ":" - #define NEWLINE "\n" +#define DIR_SEPARATOR '/' +#define DIR_SEPARATOR_STR "/" +#define PATH_SEPARATOR ':' +#define PATH_SEPARATOR_STR ":" +#define NEWLINE "\n" #ifdef ENABLE_NLS - #define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n) +#define BINDTEXTDOMAIN(d, n) bindtextdomain(d, n) #endif - #define CREAT(p, m) creat(p, m) - #define PLIBC_CTIME(c) ctime(c) - #define CTIME_R(c, b) ctime_r(c, b) - #undef FOPEN - #define FOPEN(f, m) fopen(f, m) - #define FTRUNCATE(f, l) ftruncate(f, l) - #define OPENDIR(d) opendir(d) - #define OPEN open - #define CHDIR(d) chdir(d) - #define CLOSE(f) close(f) - #define LSEEK(f, o, w) lseek(f, o, w) - #define RMDIR(f) rmdir(f) - #define ACCESS(p, m) access(p, m) - #define CHMOD(f, p) chmod(f, p) - #define FSTAT(h, b) fstat(h, b) - #define PLIBC_KILL(p, s) kill(p, s) - #define PIPE(h) pipe(h) - #define REMOVE(p) remove(p) - #define RENAME(o, n) rename(o, n) - #define STAT(p, b) stat(p, b) - #define STAT64(p, b) stat64(p, b) - #define SYSCONF(n) sysconf(n) - #define UNLINK(f) unlink(f) - #define WRITE(f, b, n) write(f, b, n) - #define READ(f, b, n) read(f, b, n) - #define GN_FREAD(b, s, c, f) fread(b, s, c, f) - #define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f) - #define SYMLINK(a, b) symlink(a, b) - #define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o) - #define MUNMAP(s, l) munmap(s, l) - #define STRERROR(i) strerror(i) - #define RANDOM() random() - #define SRANDOM(s) srandom(s) - #define READLINK(p, b, s) readlink(p, b, s) - #define LSTAT(p, b) lstat(p, b) - #define LSTAT64(p, b) lstat64(p, b) - #define PRINTF printf - #define FPRINTF fprintf - #define VPRINTF(f, a) vprintf(f, a) - #define VFPRINTF(s, f, a) vfprintf(s, f, a) - #define VSPRINTF(d, f, a) vsprintf(d, f, a) - #define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a) - #define _REAL_SNPRINTF snprintf - #define SPRINTF sprintf - #define VSSCANF(s, f, a) vsscanf(s, f, a) - #define SSCANF sscanf - #define VFSCANF(s, f, a) vfscanf(s, f, a) - #define VSCANF(f, a) vscanf(f, a) - #define SCANF scanf - #define FSCANF fscanf - #define WAITPID(p, s, o) waitpid(p, s, o) - #define ACCEPT(s, a, l) accept(s, a, l) - #define BIND(s, n, l) bind(s, n, l) - #define CONNECT(s, n, l) connect(s, n, l) - #define GETPEERNAME(s, n, l) getpeername(s, n, l) - #define GETSOCKNAME(s, n, l) getsockname(s, n, l) - #define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p) - #define LISTEN(s, b) listen(s, b) - #define RECV(s, b, l, f) recv(s, b, l, f) - #define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o) - #define SELECT(n, r, w, e, t) select(n, r, w, e, t) - #define SEND(s, b, l, f) send(s, b, l, f) - #define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n) - #define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n) - #define SHUTDOWN(s, h) shutdown(s, h) - #define SOCKET(a, t, p) socket(a, t, p) - #define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t) - #define GETHOSTBYNAME(n) gethostbyname(n) - #define GETTIMEOFDAY(t, n) gettimeofday(t, n) - #define INSQUE(e, p) insque(e, p) - #define REMQUE(e) remque(e) - #define HSEARCH(i, a) hsearch(i, a) - #define HCREATE(n) hcreate(n) - #define HDESTROY() hdestroy() - #define HSEARCH_R(i, a, r, h) hsearch_r(i, a, r, h) - #define HCREATE_R(n, h) hcreate_r(n, h) - #define HDESTROY_R(h) hdestroy_r(h) - #define TSEARCH(k, r, c) tsearch(k, r, c) - #define TFIND(k, r, c) tfind(k, r, c) - #define TDELETE(k, r, c) tdelete(k, r, c) - #define TWALK(r, a) twalk(r, a) - #define TDESTROY(r, f) tdestroy(r, f) - #define LFIND(k, b, n, s, c) lfind(k, b, n, s, c) - #define LSEARCH(k, b, n, s, c) lsearch(k, b, n, s, c) +#define CREAT(p, m) creat(p, m) +#define PLIBC_CTIME(c) ctime(c) +#define CTIME_R(c, b) ctime_r(c, b) +#undef FOPEN +#define FOPEN(f, m) fopen(f, m) +#define FTRUNCATE(f, l) ftruncate(f, l) +#define OPENDIR(d) opendir(d) +#define OPEN open +#define CHDIR(d) chdir(d) +#define CLOSE(f) close(f) +#define LSEEK(f, o, w) lseek(f, o, w) +#define RMDIR(f) rmdir(f) +#define ACCESS(p, m) access(p, m) +#define CHMOD(f, p) chmod(f, p) +#define FSTAT(h, b) fstat(h, b) +#define PLIBC_KILL(p, s) kill(p, s) +#define PIPE(h) pipe(h) +#define REMOVE(p) remove(p) +#define RENAME(o, n) rename(o, n) +#define STAT(p, b) stat(p, b) +#define STAT64(p, b) stat64(p, b) +#define SYSCONF(n) sysconf(n) +#define UNLINK(f) unlink(f) +#define WRITE(f, b, n) write(f, b, n) +#define READ(f, b, n) read(f, b, n) +#define GN_FREAD(b, s, c, f) fread(b, s, c, f) +#define GN_FWRITE(b, s, c, f) fwrite(b, s, c, f) +#define SYMLINK(a, b) symlink(a, b) +#define MMAP(s, l, p, f, d, o) mmap(s, l, p, f, d, o) +#define MUNMAP(s, l) munmap(s, l) +#define STRERROR(i) strerror(i) +#define RANDOM() random() +#define SRANDOM(s) srandom(s) +#define READLINK(p, b, s) readlink(p, b, s) +#define LSTAT(p, b) lstat(p, b) +#define LSTAT64(p, b) lstat64(p, b) +#define PRINTF printf +#define FPRINTF fprintf +#define VPRINTF(f, a) vprintf(f, a) +#define VFPRINTF(s, f, a) vfprintf(s, f, a) +#define VSPRINTF(d, f, a) vsprintf(d, f, a) +#define VSNPRINTF(str, size, fmt, a) vsnprintf(str, size, fmt, a) +#define _REAL_SNPRINTF snprintf +#define SPRINTF sprintf +#define VSSCANF(s, f, a) vsscanf(s, f, a) +#define SSCANF sscanf +#define VFSCANF(s, f, a) vfscanf(s, f, a) +#define VSCANF(f, a) vscanf(f, a) +#define SCANF scanf +#define FSCANF fscanf +#define WAITPID(p, s, o) waitpid(p, s, o) +#define ACCEPT(s, a, l) accept(s, a, l) +#define BIND(s, n, l) bind(s, n, l) +#define CONNECT(s, n, l) connect(s, n, l) +#define GETPEERNAME(s, n, l) getpeername(s, n, l) +#define GETSOCKNAME(s, n, l) getsockname(s, n, l) +#define GETSOCKOPT(s, l, o, v, p) getsockopt(s, l, o, v, p) +#define LISTEN(s, b) listen(s, b) +#define RECV(s, b, l, f) recv(s, b, l, f) +#define RECVFROM(s, b, l, f, r, o) recvfrom(s, b, l, f, r, o) +#define SELECT(n, r, w, e, t) select(n, r, w, e, t) +#define SEND(s, b, l, f) send(s, b, l, f) +#define SENDTO(s, b, l, f, o, n) sendto(s, b, l, f, o, n) +#define SETSOCKOPT(s, l, o, v, n) setsockopt(s, l, o, v, n) +#define SHUTDOWN(s, h) shutdown(s, h) +#define SOCKET(a, t, p) socket(a, t, p) +#define GETHOSTBYADDR(a, l, t) gethostbyname(a, l, t) +#define GETHOSTBYNAME(n) gethostbyname(n) +#define GETTIMEOFDAY(t, n) gettimeofday(t, n) +#define INSQUE(e, p) insque(e, p) +#define REMQUE(e) remque(e) +#define HSEARCH(i, a) hsearch(i, a) +#define HCREATE(n) hcreate(n) +#define HDESTROY() hdestroy() +#define HSEARCH_R(i, a, r, h) hsearch_r(i, a, r, h) +#define HCREATE_R(n, h) hcreate_r(n, h) +#define HDESTROY_R(h) hdestroy_r(h) +#define TSEARCH(k, r, c) tsearch(k, r, c) +#define TFIND(k, r, c) tfind(k, r, c) +#define TDELETE(k, r, c) tdelete(k, r, c) +#define TWALK(r, a) twalk(r, a) +#define TDESTROY(r, f) tdestroy(r, f) +#define LFIND(k, b, n, s, c) lfind(k, b, n, s, c) +#define LSEARCH(k, b, n, s, c) lsearch(k, b, n, s, c) #else - #define DIR_SEPARATOR '\\' - #define DIR_SEPARATOR_STR "\\" - #define PATH_SEPARATOR ';' - #define PATH_SEPARATOR_STR ";" - #define NEWLINE "\r\n" +#define DIR_SEPARATOR '\\' +#define DIR_SEPARATOR_STR "\\" +#define PATH_SEPARATOR ';' +#define PATH_SEPARATOR_STR ";" +#define NEWLINE "\r\n" #ifdef ENABLE_NLS - #define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n) +#define BINDTEXTDOMAIN(d, n) _win_bindtextdomain(d, n) #endif - #define CREAT(p, m) _win_creat(p, m) - #define PLIBC_CTIME(c) _win_ctime(c) - #define CTIME_R(c, b) _win_ctime_r(c, b) - #define FOPEN(f, m) _win_fopen(f, m) - #define FTRUNCATE(f, l) _win_ftruncate(f, l) - #define OPENDIR(d) _win_opendir(d) - #define OPEN _win_open - #define CHDIR(d) _win_chdir(d) - #define CLOSE(f) _win_close(f) - #define PLIBC_KILL(p, s) _win_kill(p, s) - #define LSEEK(f, o, w) _win_lseek(f, o, w) - #define FSTAT(h, b) _win_fstat(h, b) - #define RMDIR(f) _win_rmdir(f) - #define ACCESS(p, m) _win_access(p, m) - #define CHMOD(f, p) _win_chmod(f, p) - #define PIPE(h) _win_pipe(h) - #define RANDOM() _win_random() - #define SRANDOM(s) _win_srandom(s) - #define REMOVE(p) _win_remove(p) - #define RENAME(o, n) _win_rename(o, n) - #define STAT(p, b) _win_stat(p, b) - #define STAT64(p, b) _win_stat64(p, b) - #define SYSCONF(n) _win_sysconf(n) - #define UNLINK(f) _win_unlink(f) - #define WRITE(f, b, n) _win_write(f, b, n) - #define READ(f, b, n) _win_read(f, b, n) - #define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f) - #define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f) - #define SYMLINK(a, b) _win_symlink(a, b) - #define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o) - #define MUNMAP(s, l) _win_munmap(s, l) - #define STRERROR(i) _win_strerror(i) - #define READLINK(p, b, s) _win_readlink(p, b, s) - #define LSTAT(p, b) _win_lstat(p, b) - #define LSTAT64(p, b) _win_lstat64(p, b) - #define PRINTF(f, ...) _win_printf(f , __VA_ARGS__) - #define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__) - #define VPRINTF(f, a) _win_vprintf(f, a) - #define VFPRINTF(s, f, a) _win_vfprintf(s, f, a) - #define VSPRINTF(d, f, a) _win_vsprintf(d, f, a) - #define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a) - #define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, __VA_ARGS__) - #define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__) - #define VSSCANF(s, f, a) _win_vsscanf(s, f, a) - #define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__) - #define VFSCANF(s, f, a) _win_vfscanf(s, f, a) - #define VSCANF(f, a) _win_vscanf(f, a) - #define SCANF(f, ...) _win_scanf(f, __VA_ARGS__) - #define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__) - #define WAITPID(p, s, o) _win_waitpid(p, s, o) - #define ACCEPT(s, a, l) _win_accept(s, a, l) - #define BIND(s, n, l) _win_bind(s, n, l) - #define CONNECT(s, n, l) _win_connect(s, n, l) - #define GETPEERNAME(s, n, l) _win_getpeername(s, n, l) - #define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l) - #define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p) - #define LISTEN(s, b) _win_listen(s, b) - #define RECV(s, b, l, f) _win_recv(s, b, l, f) - #define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o) - #define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t) - #define SEND(s, b, l, f) _win_send(s, b, l, f) - #define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n) - #define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n) - #define SHUTDOWN(s, h) _win_shutdown(s, h) - #define SOCKET(a, t, p) _win_socket(a, t, p) - #define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t) - #define GETHOSTBYNAME(n) _win_gethostbyname(n) - #define GETTIMEOFDAY(t, n) _win_gettimeofday(t, n) - #define INSQUE(e, p) _win_insque(e, p) - #define REMQUE(e) _win_remque(e) - #define HSEARCH(i, a) _win_hsearch(i, a) - #define HCREATE(n) _win_hcreate(n) - #define HDESTROY() _win_hdestroy() - #define HSEARCH_R(i, a, r, h) _win_hsearch_r(i, a, r, h) - #define HCREATE_R(n, h) _win_hcreate_r(n, h) - #define HDESTROY_R(h) _win_hdestroy_r(h) - #define TSEARCH(k, r, c) _win_tsearch(k, r, c) - #define TFIND(k, r, c) _win_tfind(k, r, c) - #define TDELETE(k, r, c) _win_tdelete(k, r, c) - #define TWALK(r, a) _win_twalk(r, a) - #define TDESTROY(r, f) _win_tdestroy(r, f) - #define LFIND(k, b, n, s, c) _win_lfind(k, b, n, s, c) - #define LSEARCH(k, b, n, s, c) _win_lsearch(k, b, n, s, c) +#define CREAT(p, m) _win_creat(p, m) +#define PLIBC_CTIME(c) _win_ctime(c) +#define CTIME_R(c, b) _win_ctime_r(c, b) +#define FOPEN(f, m) _win_fopen(f, m) +#define FTRUNCATE(f, l) _win_ftruncate(f, l) +#define OPENDIR(d) _win_opendir(d) +#define OPEN _win_open +#define CHDIR(d) _win_chdir(d) +#define CLOSE(f) _win_close(f) +#define PLIBC_KILL(p, s) _win_kill(p, s) +#define LSEEK(f, o, w) _win_lseek(f, o, w) +#define FSTAT(h, b) _win_fstat(h, b) +#define RMDIR(f) _win_rmdir(f) +#define ACCESS(p, m) _win_access(p, m) +#define CHMOD(f, p) _win_chmod(f, p) +#define PIPE(h) _win_pipe(h) +#define RANDOM() _win_random() +#define SRANDOM(s) _win_srandom(s) +#define REMOVE(p) _win_remove(p) +#define RENAME(o, n) _win_rename(o, n) +#define STAT(p, b) _win_stat(p, b) +#define STAT64(p, b) _win_stat64(p, b) +#define SYSCONF(n) _win_sysconf(n) +#define UNLINK(f) _win_unlink(f) +#define WRITE(f, b, n) _win_write(f, b, n) +#define READ(f, b, n) _win_read(f, b, n) +#define GN_FREAD(b, s, c, f) _win_fread(b, s, c, f) +#define GN_FWRITE(b, s, c, f) _win_fwrite(b, s, c, f) +#define SYMLINK(a, b) _win_symlink(a, b) +#define MMAP(s, l, p, f, d, o) _win_mmap(s, l, p, f, d, o) +#define MUNMAP(s, l) _win_munmap(s, l) +#define STRERROR(i) _win_strerror(i) +#define READLINK(p, b, s) _win_readlink(p, b, s) +#define LSTAT(p, b) _win_lstat(p, b) +#define LSTAT64(p, b) _win_lstat64(p, b) +#define PRINTF(f, ...) _win_printf(f , __VA_ARGS__) +#define FPRINTF(fil, fmt, ...) _win_fprintf(fil, fmt, __VA_ARGS__) +#define VPRINTF(f, a) _win_vprintf(f, a) +#define VFPRINTF(s, f, a) _win_vfprintf(s, f, a) +#define VSPRINTF(d, f, a) _win_vsprintf(d, f, a) +#define VSNPRINTF(str, size, fmt, a) _win_vsnprintf(str, size, fmt, a) +#define _REAL_SNPRINTF(str, size, fmt, ...) _win_snprintf(str, size, fmt, __VA_ARGS__) +#define SPRINTF(d, f, ...) _win_sprintf(d, f, __VA_ARGS__) +#define VSSCANF(s, f, a) _win_vsscanf(s, f, a) +#define SSCANF(s, f, ...) _win_sscanf(s, f, __VA_ARGS__) +#define VFSCANF(s, f, a) _win_vfscanf(s, f, a) +#define VSCANF(f, a) _win_vscanf(f, a) +#define SCANF(f, ...) _win_scanf(f, __VA_ARGS__) +#define FSCANF(s, f, ...) _win_fscanf(s, f, __VA_ARGS__) +#define WAITPID(p, s, o) _win_waitpid(p, s, o) +#define ACCEPT(s, a, l) _win_accept(s, a, l) +#define BIND(s, n, l) _win_bind(s, n, l) +#define CONNECT(s, n, l) _win_connect(s, n, l) +#define GETPEERNAME(s, n, l) _win_getpeername(s, n, l) +#define GETSOCKNAME(s, n, l) _win_getsockname(s, n, l) +#define GETSOCKOPT(s, l, o, v, p) _win_getsockopt(s, l, o, v, p) +#define LISTEN(s, b) _win_listen(s, b) +#define RECV(s, b, l, f) _win_recv(s, b, l, f) +#define RECVFROM(s, b, l, f, r, o) _win_recvfrom(s, b, l, f, r, o) +#define SELECT(n, r, w, e, t) _win_select(n, r, w, e, t) +#define SEND(s, b, l, f) _win_send(s, b, l, f) +#define SENDTO(s, b, l, f, o, n) _win_sendto(s, b, l, f, o, n) +#define SETSOCKOPT(s, l, o, v, n) _win_setsockopt(s, l, o, v, n) +#define SHUTDOWN(s, h) _win_shutdown(s, h) +#define SOCKET(a, t, p) _win_socket(a, t, p) +#define GETHOSTBYADDR(a, l, t) _win_gethostbyname(a, l, t) +#define GETHOSTBYNAME(n) _win_gethostbyname(n) +#define GETTIMEOFDAY(t, n) _win_gettimeofday(t, n) +#define INSQUE(e, p) _win_insque(e, p) +#define REMQUE(e) _win_remque(e) +#define HSEARCH(i, a) _win_hsearch(i, a) +#define HCREATE(n) _win_hcreate(n) +#define HDESTROY() _win_hdestroy() +#define HSEARCH_R(i, a, r, h) _win_hsearch_r(i, a, r, h) +#define HCREATE_R(n, h) _win_hcreate_r(n, h) +#define HDESTROY_R(h) _win_hdestroy_r(h) +#define TSEARCH(k, r, c) _win_tsearch(k, r, c) +#define TFIND(k, r, c) _win_tfind(k, r, c) +#define TDELETE(k, r, c) _win_tdelete(k, r, c) +#define TWALK(r, a) _win_twalk(r, a) +#define TDESTROY(r, f) _win_tdestroy(r, f) +#define LFIND(k, b, n, s, c) _win_lfind(k, b, n, s, c) +#define LSEARCH(k, b, n, s, c) _win_lsearch(k, b, n, s, c) #endif /* search.h */ @@ -662,7 +665,7 @@ char *strcasestr(const char *haystack_start, const char *needle_start); /* Prototype structure for a linked-list data structure. This is the type used by the `insque' and `remque' functions. */ -struct PLIBC_SEARCH_QELEM + struct PLIBC_SEARCH_QELEM { struct qelem *q_forw; struct qelem *q_back; @@ -671,41 +674,41 @@ struct PLIBC_SEARCH_QELEM /* Insert ELEM into a doubly-linked list, after PREV. */ -void _win_insque (void *__elem, void *__prev); + void _win_insque (void *__elem, void *__prev); /* Unlink ELEM from the doubly-linked list that it is in. */ -void _win_remque (void *__elem); + void _win_remque (void *__elem); /* For use with hsearch(3). */ -typedef int (*PLIBC_SEARCH__compar_fn_t) (__const void *, __const void *); + typedef int (*PLIBC_SEARCH__compar_fn_t) (__const void *, __const void *); -typedef PLIBC_SEARCH__compar_fn_t _win_comparison_fn_t; + typedef PLIBC_SEARCH__compar_fn_t _win_comparison_fn_t; /* Action which shall be performed in the call the hsearch. */ -typedef enum + typedef enum { PLIBC_SEARCH_FIND, PLIBC_SEARCH_ENTER } -PLIBC_SEARCH_ACTION; + PLIBC_SEARCH_ACTION; -typedef struct PLIBC_SEARCH_entry + typedef struct PLIBC_SEARCH_entry { char *key; void *data; } -PLIBC_SEARCH_ENTRY; + PLIBC_SEARCH_ENTRY; /* The reentrant version has no static variables to maintain the state. Instead the interface of all functions is extended to take an argument which describes the current status. */ -typedef struct _PLIBC_SEARCH_ENTRY -{ - unsigned int used; - PLIBC_SEARCH_ENTRY entry; -} -_PLIBC_SEARCH_ENTRY; + typedef struct _PLIBC_SEARCH_ENTRY + { + unsigned int used; + PLIBC_SEARCH_ENTRY entry; + } + _PLIBC_SEARCH_ENTRY; /* Family of hash table handling functions. The functions also @@ -716,16 +719,17 @@ _PLIBC_SEARCH_ENTRY; ACTION is `FIND' return found entry or signal error by returning NULL. If ACTION is `ENTER' replace existing data (if any) with ITEM.data. */ -PLIBC_SEARCH_ENTRY *_win_hsearch (PLIBC_SEARCH_ENTRY __item, PLIBC_SEARCH_ACTION __action); + PLIBC_SEARCH_ENTRY *_win_hsearch (PLIBC_SEARCH_ENTRY __item, + PLIBC_SEARCH_ACTION __action); /* Create a new hashing table which will at most contain NEL elements. */ -int _win_hcreate (size_t __nel); + int _win_hcreate (size_t __nel); /* Destroy current internal hashing table. */ -void _win_hdestroy (void); + void _win_hdestroy (void); /* Data type for reentrant functions. */ -struct PLIBC_SEARCH_hsearch_data + struct PLIBC_SEARCH_hsearch_data { struct _PLIBC_SEARCH_ENTRY *table; unsigned int size; @@ -734,10 +738,11 @@ struct PLIBC_SEARCH_hsearch_data /* Reentrant versions which can handle multiple hashing tables at the same time. */ -int _win_hsearch_r (PLIBC_SEARCH_ENTRY __item, PLIBC_SEARCH_ACTION __action, PLIBC_SEARCH_ENTRY **__retval, - struct PLIBC_SEARCH_hsearch_data *__htab); -int _win_hcreate_r (size_t __nel, struct PLIBC_SEARCH_hsearch_data *__htab); -void _win_hdestroy_r (struct PLIBC_SEARCH_hsearch_data *__htab); + int _win_hsearch_r (PLIBC_SEARCH_ENTRY __item, PLIBC_SEARCH_ACTION __action, + PLIBC_SEARCH_ENTRY ** __retval, + struct PLIBC_SEARCH_hsearch_data *__htab); + int _win_hcreate_r (size_t __nel, struct PLIBC_SEARCH_hsearch_data *__htab); + void _win_hdestroy_r (struct PLIBC_SEARCH_hsearch_data *__htab); /* The tsearch routines are very interesting. They make many @@ -745,54 +750,57 @@ void _win_hdestroy_r (struct PLIBC_SEARCH_hsearch_data *__htab); in node must be the "key" field, which points to the datum. Everything depends on that. */ /* For tsearch */ -typedef enum -{ - PLIBC_SEARCH_preorder, - PLIBC_SEARCH_postorder, - PLIBC_SEARCH_endorder, - PLIBC_SEARCH_leaf -} -PLIBC_SEARCH_VISIT; + typedef enum + { + PLIBC_SEARCH_preorder, + PLIBC_SEARCH_postorder, + PLIBC_SEARCH_endorder, + PLIBC_SEARCH_leaf + } + PLIBC_SEARCH_VISIT; /* Search for an entry matching the given KEY in the tree pointed to by *ROOTP and insert a new element if not found. */ -void *_win_tsearch (__const void *__key, void **__rootp, - PLIBC_SEARCH__compar_fn_t __compar); + void *_win_tsearch (__const void *__key, void **__rootp, + PLIBC_SEARCH__compar_fn_t __compar); /* Search for an entry matching the given KEY in the tree pointed to by *ROOTP. If no matching entry is available return NULL. */ -void *_win_tfind (__const void *__key, void *__const *__rootp, - PLIBC_SEARCH__compar_fn_t __compar); + void *_win_tfind (__const void *__key, void *__const * __rootp, + PLIBC_SEARCH__compar_fn_t __compar); /* Remove the element matching KEY from the tree pointed to by *ROOTP. */ -void *_win_tdelete (__const void *__restrict __key, - void **__restrict __rootp, - PLIBC_SEARCH__compar_fn_t __compar); + void *_win_tdelete (__const void *__restrict __key, + void **__restrict __rootp, + PLIBC_SEARCH__compar_fn_t __compar); -typedef void (*PLIBC_SEARCH__action_fn_t) (__const void *__nodep, PLIBC_SEARCH_VISIT __value, - int __level); + typedef void (*PLIBC_SEARCH__action_fn_t) (__const void *__nodep, + PLIBC_SEARCH_VISIT __value, + int __level); /* Walk through the whole tree and call the ACTION callback for every node or leaf. */ -void _win_twalk (__const void *__root, PLIBC_SEARCH__action_fn_t __action); + void _win_twalk (__const void *__root, PLIBC_SEARCH__action_fn_t __action); /* Callback type for function to free a tree node. If the keys are atomic data this function should do nothing. */ -typedef void (*PLIBC_SEARCH__free_fn_t) (void *__nodep); + typedef void (*PLIBC_SEARCH__free_fn_t) (void *__nodep); /* Destroy the whole tree, call FREEFCT for each node or leaf. */ -void _win_tdestroy (void *__root, PLIBC_SEARCH__free_fn_t __freefct); + void _win_tdestroy (void *__root, PLIBC_SEARCH__free_fn_t __freefct); /* Perform linear search for KEY by comparing by COMPAR in an array [BASE,BASE+NMEMB*SIZE). */ -void *_win_lfind (__const void *__key, __const void *__base, - size_t *__nmemb, size_t __size, PLIBC_SEARCH__compar_fn_t __compar); + void *_win_lfind (__const void *__key, __const void *__base, + size_t * __nmemb, size_t __size, + PLIBC_SEARCH__compar_fn_t __compar); /* Perform linear search for KEY by comparing by COMPAR function in array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */ -void *_win_lsearch (__const void *__key, void *__base, - size_t *__nmemb, size_t __size, PLIBC_SEARCH__compar_fn_t __compar); + void *_win_lsearch (__const void *__key, void *__base, + size_t * __nmemb, size_t __size, + PLIBC_SEARCH__compar_fn_t __compar); #ifdef __cplusplus @@ -800,6 +808,6 @@ void *_win_lsearch (__const void *__key, void *__base, #endif -#endif //_PLIBC_H_ +#endif //_PLIBC_H_ /* end of plibc.h */ diff --git a/src/include/winproc.h b/src/include/winproc.h index a29130e66..1c7703799 100644 --- a/src/include/winproc.h +++ b/src/include/winproc.h @@ -56,8 +56,7 @@ extern "C" #define MAX_NAME_LENGTH 25 #endif - typedef DWORD WINAPI (*TNtQuerySystemInformation) (int, PVOID, ULONG, - PULONG); + typedef DWORD WINAPI (*TNtQuerySystemInformation) (int, PVOID, ULONG, PULONG); typedef DWORD WINAPI (*TGetIfEntry) (PMIB_IFROW pIfRow); typedef DWORD WINAPI (*TGetIpAddrTable) (PMIB_IPADDRTABLE pIpAddrTable, PULONG pdwSize, BOOL bOrder); @@ -104,8 +103,7 @@ extern "C" PDWORD pdwBestIfIndex); typedef DWORD WINAPI (*TGetAdaptersInfo) (PIP_ADAPTER_INFO pAdapterInfo, PULONG pOutBufLen); - typedef NET_API_STATUS WINAPI (*TNetUserAdd) (LPCWSTR, DWORD, PBYTE, - PDWORD); + typedef NET_API_STATUS WINAPI (*TNetUserAdd) (LPCWSTR, DWORD, PBYTE, PDWORD); typedef NET_API_STATUS WINAPI (*TNetUserSetInfo) (LPCWSTR servername, LPCWSTR username, DWORD level, LPBYTE buf, @@ -205,7 +203,7 @@ extern "C" BOOL AddPathAccessRights (char *lpszFileName, char *lpszAccountName, DWORD dwAccessMask); char *winErrorStr (const char *prefix, int dwErr); - void EnumNICs(PMIB_IFTABLE *pIfTable, PMIB_IPADDRTABLE *pAddrTable); + void EnumNICs (PMIB_IFTABLE * pIfTable, PMIB_IPADDRTABLE * pAddrTable); int GNInitWinEnv (); void GNShutdownWinEnv (); -- cgit v1.2.3