-fix
[oweals/gnunet.git] / src / include / gnunet_client_lib.h
index 41dbe4efc1809b9ee8744918cd1c6cd2bd40a09d..60fa938c80b6cbc6bcbeff7dd606148317bc200f 100644 (file)
@@ -53,23 +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);
 
 
 /**
@@ -87,8 +73,10 @@ 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
@@ -98,8 +86,9 @@ void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock,
  * @param msg message received, NULL on timeout or fatal error
  */
 typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls,
-                                              const struct
-                                              GNUNET_MessageHeader * msg);
+                                              const struct GNUNET_MessageHeader
+                                              * msg);
+
 
 /**
  * Type of a function to call when we have finished shutting
@@ -111,8 +100,8 @@ 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.
@@ -122,10 +111,10 @@ typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls,
  * @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);
 
 
 /**
@@ -154,23 +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);
+GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle
+                                            *th);
 
 
 /**
@@ -190,17 +179,17 @@ GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle
  *        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);
+                                         const struct GNUNET_MessageHeader *hdr,
+                                         struct GNUNET_TIME_Relative timeout,
+                                         int auto_retry,
+                                         GNUNET_CLIENT_MessageHandler rn,
+                                         void *rn_cls);
 
 
 /**
@@ -214,10 +203,11 @@ GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock,
  *         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 */