-fix
[oweals/gnunet.git] / src / include / gnunet_client_lib.h
index 3fad012226c2c19db5934fc790e6cf9e0b56d118..60fa938c80b6cbc6bcbeff7dd606148317bc200f 100644 (file)
@@ -53,22 +53,9 @@ struct GNUNET_CLIENT_Connection;
  * @param cfg configuration to use
  * @return NULL on error (service unknown to configuration)
  */
-struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char
-                                                        *service_name,
-                                                        const struct
-                                                        GNUNET_CONFIGURATION_Handle
-                                                        *cfg);
-
-
-/**
- * Configure this connection to ignore shutdown signals.
- *
- * @param h client handle
- * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default
- */
-void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h,
-                                    int do_ignore);
-
+struct GNUNET_CLIENT_Connection *
+GNUNET_CLIENT_connect (const char *service_name,
+                       const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
 /**
@@ -86,8 +73,10 @@ void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h,
  * @param finish_pending_write should a transmission already passed to the
  *          handle be completed?
  */
-void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
-                               int finish_pending_write);
+void
+GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
+                          int finish_pending_write);
+
 
 /**
  * Type of a function to call when we receive a message
@@ -100,6 +89,7 @@ typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls,
                                               const struct GNUNET_MessageHeader
                                               * msg);
 
+
 /**
  * Type of a function to call when we have finished shutting
  * down a service, or failed.
@@ -112,6 +102,7 @@ typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls,
  */
 typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, int reason);
 
+
 /**
  * Read from the service.
  *
@@ -120,10 +111,10 @@ typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, int reason);
  * @param handler_cls closure for handler
  * @param timeout how long to wait until timing out
  */
-void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
-                            GNUNET_CLIENT_MessageHandler handler,
-                            void *handler_cls,
-                            struct GNUNET_TIME_Relative timeout);
+void
+GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock,
+                       GNUNET_CLIENT_MessageHandler handler, void *handler_cls,
+                       struct GNUNET_TIME_Relative timeout);
 
 
 /**
@@ -152,30 +143,23 @@ struct GNUNET_CLIENT_TransmitHandle;
  *         non-NULL if the notify callback was queued (can be used to cancel
  *         using GNUNET_CONNECTION_notify_transmit_ready_cancel)
  */
-struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct
-                                                                          GNUNET_CLIENT_Connection
-                                                                          *sock,
-                                                                          size_t
-                                                                          size,
-                                                                          struct
-                                                                          GNUNET_TIME_Relative
-                                                                          timeout,
-                                                                          int
-                                                                          auto_retry,
-                                                                          GNUNET_CONNECTION_TransmitReadyNotify
-                                                                          notify,
-                                                                          void
-                                                                          *notify_cls);
+struct GNUNET_CLIENT_TransmitHandle *
+GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock,
+                                     size_t size,
+                                     struct GNUNET_TIME_Relative timeout,
+                                     int auto_retry,
+                                     GNUNET_CONNECTION_TransmitReadyNotify
+                                     notify, void *notify_cls);
 
 
 /**
  * Cancel a request for notification.
- * 
+ *
  * @param th handle from the original request.
  */
-void GNUNET_CLIENT_notify_transmit_ready_cancel (struct
-                                                 GNUNET_CLIENT_TransmitHandle
-                                                 *th);
+void
+GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle
+                                            *th);
 
 
 /**
@@ -195,18 +179,17 @@ void GNUNET_CLIENT_notify_transmit_ready_cancel (struct
  *        if the caller does not care about temporary connection errors,
  *        for example because the protocol is stateless
  * @param rn function to call with the response
- * @param rn_cls closure for rn 
+ * @param rn_cls closure for rn
  * @return GNUNET_OK on success, GNUNET_SYSERR if a request
  *         is already pending
  */
-int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection
-                                             *sock,
-                                             const struct GNUNET_MessageHeader
-                                             *hdr,
-                                             struct GNUNET_TIME_Relative
-                                             timeout, int auto_retry,
-                                             GNUNET_CLIENT_MessageHandler rn,
-                                             void *rn_cls);
+int
+GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock,
+                                         const struct GNUNET_MessageHeader *hdr,
+                                         struct GNUNET_TIME_Relative timeout,
+                                         int auto_retry,
+                                         GNUNET_CLIENT_MessageHandler rn,
+                                         void *rn_cls);
 
 
 /**
@@ -220,10 +203,11 @@ int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection
  *         or "TIMEOUT" (service not known to be running))
  * @param task_cls closure for task
  */
-void GNUNET_CLIENT_service_test (const char *service,
-                                 const struct GNUNET_CONFIGURATION_Handle *cfg,
-                                 struct GNUNET_TIME_Relative timeout,
-                                 GNUNET_SCHEDULER_Task task, void *task_cls);
+void
+GNUNET_CLIENT_service_test (const char *service,
+                            const struct GNUNET_CONFIGURATION_Handle *cfg,
+                            struct GNUNET_TIME_Relative timeout,
+                            GNUNET_SCHEDULER_Task task, void *task_cls);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */