-fix
[oweals/gnunet.git] / src / include / gnunet_connection_lib.h
index af10c59664fff332d9ea90bf6aef0ebdab24e5f7..3e48d32ea3b0459606584b7c8388df3e0d9c5ca0 100644 (file)
@@ -111,7 +111,8 @@ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf,
  *
  * @param sock the connection to set persistent
  */
-void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock);
+void
+GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock);
 
 /**
  * Disable the "CORK" feature for communication with the given socket,
@@ -124,7 +125,8 @@ void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock);
  * @param sock the connection to make flushing and blocking
  * @return GNUNET_OK on success
  */
-int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
+int
+GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
 
 
 /**
@@ -135,9 +137,8 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock);
  * @param osSocket existing socket to box
  * @return the boxed socket handle
  */
-struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct
-                                                                         GNUNET_NETWORK_Handle
-                                                                         *osSocket);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket);
 
 
 /**
@@ -149,10 +150,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct
  * @param lsock listen socket
  * @return the socket handle, NULL on error (for example, access refused)
  */
-struct GNUNET_CONNECTION_Handle
-    *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
-                                           void *access_cls,
-                                           struct GNUNET_NETWORK_Handle *lsock);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access,
+                                      void *access_cls,
+                                      struct GNUNET_NETWORK_Handle *lsock);
 
 
 /**
@@ -165,15 +166,10 @@ struct GNUNET_CONNECTION_Handle
  * @param port port to connect to
  * @return the socket handle
  */
-struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const
-                                                                        struct
-                                                                        GNUNET_CONFIGURATION_Handle
-                                                                        *cfg,
-                                                                        const
-                                                                        char
-                                                                        *hostname,
-                                                                        uint16_t
-                                                                        port);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle
+                                       *cfg, const char *hostname,
+                                       uint16_t port);
 
 
 /**
@@ -185,11 +181,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const
  * @param unixpath path to connect to)
  * @return the socket handle, NULL on systems without UNIX support
  */
-struct GNUNET_CONNECTION_Handle
-    *GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct
-                                                        GNUNET_CONFIGURATION_Handle
-                                                        *cfg,
-                                                        const char *unixpath);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct
+                                                   GNUNET_CONFIGURATION_Handle
+                                                   *cfg, const char *unixpath);
 
 
 
@@ -204,14 +199,10 @@ struct GNUNET_CONNECTION_Handle
  * @param addrlen length of server address
  * @return the socket handle
  */
-struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int
-                                                                         af_family,
-                                                                         const
-                                                                         struct
-                                                                         sockaddr
-                                                                         *serv_addr,
-                                                                         socklen_t
-                                                                         addrlen);
+struct GNUNET_CONNECTION_Handle *
+GNUNET_CONNECTION_create_from_sockaddr (int af_family,
+                                        const struct sockaddr *serv_addr,
+                                        socklen_t addrlen);
 
 /**
  * Check if socket is valid (no fatal errors have happened so far).
@@ -221,7 +212,8 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int
  * @param sock socket to check
  * @return GNUNET_YES if valid, GNUNET_NO otherwise
  */
-int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock);
+int
+GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock);
 
 
 /**
@@ -232,14 +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.
  *
@@ -249,8 +242,9 @@ int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock,
  *        read from the application; all other transmissions should be
  *        aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel').
  */
-void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
-                                int finish_pending_write);
+void
+GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
+                           int finish_pending_write);
 
 
 /**
@@ -266,10 +260,11 @@ void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock,
  * @param receiver function to call with received data
  * @param receiver_cls closure for receiver
  */
-void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock,
-                                size_t max, struct GNUNET_TIME_Relative timeout,
-                                GNUNET_CONNECTION_Receiver receiver,
-                                void *receiver_cls);
+void
+GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max,
+                           struct GNUNET_TIME_Relative timeout,
+                           GNUNET_CONNECTION_Receiver receiver,
+                           void *receiver_cls);
 
 
 /**
@@ -280,7 +275,8 @@ void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock,
  * @param sock socket handle
  * @return closure of the original receiver callback closure
  */
-void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock);
+void *
+GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock);
 
 
 /**
@@ -333,24 +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);
+void
+GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
+                                                GNUNET_CONNECTION_TransmitHandle
+                                                *th);
 
 
 /**
@@ -359,8 +355,9 @@ void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct
  * @param sock socket handle
  * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
  */
-void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock,
-                                        int do_ignore);
+void
+GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock,
+                                   int do_ignore);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */