-fix
[oweals/gnunet.git] / src / include / gnunet_connection_lib.h
index 00b97d903dafc812b6666f3b23c55513f1381bcb..3e48d32ea3b0459606584b7c8388df3e0d9c5ca0 100644 (file)
@@ -99,8 +99,7 @@ typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls,
  * @param addrlen size of addr
  * @param errCode value of errno (on errors receiving)
  */
-typedef void (*GNUNET_CONNECTION_Receiver) (void *cls,
-                                            const void *buf,
+typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf,
                                             size_t available,
                                             const struct sockaddr * addr,
                                             socklen_t addrlen, int errCode);
@@ -112,7 +111,8 @@ 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,
@@ -125,7 +125,8 @@ void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock);
  * @param sock the connection to make flushing and blocking
  * @return GNUNET_OK on success
  */
-int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
+int
+GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
 
 
 /**
@@ -136,9 +137,8 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
  * @param osSocket existing socket to box
  * @return the boxed socket handle
  */
-struct GNUNET_CONNECTION_Handle
-    *GNUNET_CONNECTION_create_from_existing (struct
-                                             GNUNET_NETWORK_Handle *osSocket);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket);
 
 
 /**
@@ -150,10 +150,10 @@ struct GNUNET_CONNECTION_Handle
  * @param lsock listen socket
  * @return the socket handle, NULL on error (for example, access refused)
  */
-struct GNUNET_CONNECTION_Handle
-    *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck
-                                           access, void *access_cls,
-                                           struct GNUNET_NETWORK_Handle *lsock);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
+                                      void *access_cls,
+                                      struct GNUNET_NETWORK_Handle *lsock);
 
 
 /**
@@ -166,11 +166,10 @@ struct GNUNET_CONNECTION_Handle
  * @param port port to connect to
  * @return the socket handle
  */
-struct GNUNET_CONNECTION_Handle
-    *GNUNET_CONNECTION_create_from_connect (const struct
-                                            GNUNET_CONFIGURATION_Handle *cfg,
-                                            const char *hostname,
-                                            uint16_t port);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle
+                                       *cfg, const char *hostname,
+                                       uint16_t port);
 
 
 /**
@@ -182,11 +181,10 @@ 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);
 
 
 
@@ -201,10 +199,10 @@ struct GNUNET_CONNECTION_Handle
  * @param addrlen length of server address
  * @return the socket handle
  */
-struct GNUNET_CONNECTION_Handle
-    *GNUNET_CONNECTION_create_from_sockaddr (int af_family,
-                                             const struct sockaddr
-                                             *serv_addr, socklen_t addrlen);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_sockaddr (int af_family,
+                                        const struct sockaddr *serv_addr,
+                                        socklen_t addrlen);
 
 /**
  * Check if socket is valid (no fatal errors have happened so far).
@@ -214,7 +212,8 @@ 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);
 
 
 /**
@@ -225,15 +224,15 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock);
  * @param addrlen where to store the length of the address
  * @return GNUNET_OK on success
  */
-int GNUNET_CONNECTION_get_address (struct
-                                   GNUNET_CONNECTION_Handle
-                                   *sock, void **addr, size_t * addrlen);
+int
+GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock,
+                               void **addr, size_t * addrlen);
 
 
 /**
  * Close the socket and free associated resources. Pending
  * transmissions may be completed or dropped depending on the
- * arguments.   If a receive call is pending and should 
+ * arguments.   If a receive call is pending and should
  * NOT be completed, 'GNUNET_CONNECTION_receive_cancel'
  * should be called explicitly first.
  *
@@ -262,8 +261,7 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
  * @param receiver_cls closure for receiver
  */
 void
-GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle
-                           *sock, size_t max,
+GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max,
                            struct GNUNET_TIME_Relative timeout,
                            GNUNET_CONNECTION_Receiver receiver,
                            void *receiver_cls);
@@ -277,7 +275,8 @@ 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);
 
 
 /**
@@ -291,8 +290,7 @@ void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock);
  * @param buf where the callee should write the message
  * @return number of bytes written to buf
  */
-typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls,
-                                                         size_t size,
+typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, size_t size,
                                                          void *buf);
 
 
@@ -331,27 +329,24 @@ struct GNUNET_CONNECTION_TransmitHandle;
  * @return non-NULL if the notify callback was queued,
  *         NULL if we are already going to notify someone else (busy)
  */
-struct GNUNET_CONNECTION_TransmitHandle
-    *GNUNET_CONNECTION_notify_transmit_ready (struct
-                                              GNUNET_CONNECTION_Handle
-                                              *sock, size_t size,
-                                              struct
-                                              GNUNET_TIME_Relative
-                                              timeout,
-                                              GNUNET_CONNECTION_TransmitReadyNotify
-                                              notify, void *notify_cls);
+struct GNUNET_CONNECTION_TransmitHandle *
+GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock,
+                                         size_t size,
+                                         struct GNUNET_TIME_Relative timeout,
+                                         GNUNET_CONNECTION_TransmitReadyNotify
+                                         notify, void *notify_cls);
 
 
 /**
  * Cancel the specified transmission-ready
  * notification.
  *
- * @param h handle for notification to cancel
+ * @param th handle for notification to cancel
  */
 void
 GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
                                                 GNUNET_CONNECTION_TransmitHandle
-                                                *h);
+                                                *th);
 
 
 /**