uncrustify as demanded.
[oweals/gnunet.git] / src / include / gnunet_service_lib.h
index fce912277a3f9d81fdc7d55e1519581aede4d06b..9cdf4d459945fcf2e4dea9e3dd51b7bc7dd7e33c 100644 (file)
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      Affero General Public License for more details.
-    
+
      You should have received a copy of the GNU Affero General Public License
      along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
      SPDX-License-Identifier: AGPL3.0-or-later
-*/
+ */
 
 /**
  * @author Christian Grothoff
@@ -50,8 +50,7 @@ extern "C"
 /**
  * Options for the service (bitmask).
  */
-enum GNUNET_SERVICE_Options
-{
+enum GNUNET_SERVICE_Options {
   /**
    * Use defaults.  Terminates all client connections and the listen
    * sockets immediately upon receiving the shutdown signal.
@@ -165,12 +164,12 @@ typedef void
  * @return NULL on error
  */
 struct GNUNET_SERVICE_Handle *
-GNUNET_SERVICE_start (const char *service_name,
-                      const struct GNUNET_CONFIGURATION_Handle *cfg,
-                      GNUNET_SERVICE_ConnectHandler connect_cb,
-                      GNUNET_SERVICE_DisconnectHandler disconnect_cb,
-                      void *cls,
-                      const struct GNUNET_MQ_MessageHandler *handlers);
+GNUNET_SERVICE_start(const char *service_name,
+                     const struct GNUNET_CONFIGURATION_Handle *cfg,
+                     GNUNET_SERVICE_ConnectHandler connect_cb,
+                     GNUNET_SERVICE_DisconnectHandler disconnect_cb,
+                     void *cls,
+                     const struct GNUNET_MQ_MessageHandler *handlers);
 
 
 /**
@@ -179,7 +178,7 @@ GNUNET_SERVICE_start (const char *service_name,
  * @param srv service to stop
  */
 void
-GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv);
+GNUNET_SERVICE_stop(struct GNUNET_SERVICE_Handle *srv);
 
 
 /**
@@ -224,15 +223,15 @@ GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv);
  * @return 0 on success, non-zero on error
  */
 int
-GNUNET_SERVICE_run_ (int argc,
-                     char *const *argv,
-                     const char *service_name,
-                     enum GNUNET_SERVICE_Options options,
-                     GNUNET_SERVICE_InitCallback service_init_cb,
-                     GNUNET_SERVICE_ConnectHandler connect_cb,
-                     GNUNET_SERVICE_DisconnectHandler disconnect_cb,
-                     void *cls,
-                     const struct GNUNET_MQ_MessageHandler *handlers);
+GNUNET_SERVICE_run_(int argc,
+                    char *const *argv,
+                    const char *service_name,
+                    enum GNUNET_SERVICE_Options options,
+                    GNUNET_SERVICE_InitCallback service_init_cb,
+                    GNUNET_SERVICE_ConnectHandler connect_cb,
+                    GNUNET_SERVICE_DisconnectHandler disconnect_cb,
+                    void *cls,
+                    const struct GNUNET_MQ_MessageHandler *handlers);
 
 
 /**
@@ -286,29 +285,29 @@ GNUNET_SERVICE_run_ (int argc,
  *  &disconnect_cb,
  *  closure_for_cb,
  *  GNUNET_MQ_hd_var_size (get,
- *                        GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST,
- *                        struct GNUNET_RESOLVER_GetMessage,
+ *                        GNUNET_MESSAGE_TYPE_RESOLVER_REQUEST,
+ *                         struct GNUNET_RESOLVER_GetMessage,
  *                        NULL),
  *  GNUNET_MQ_handler_end ());
  * </code>
  */
-#define GNUNET_SERVICE_MAIN(service_name,service_options,init_cb,connect_cb,disconnect_cb,cls,...) \
+#define GNUNET_SERVICE_MAIN(service_name, service_options, init_cb, connect_cb, disconnect_cb, cls, ...) \
   int \
-  main (int argc,\
-        char *const *argv)\
+  main(int argc, \
+       char *const *argv) \
   { \
     struct GNUNET_MQ_MessageHandler mh[] = { \
       __VA_ARGS__ \
-    };                       \
-    return GNUNET_SERVICE_run_ (argc, \
-                                argv, \
-                                service_name, \
-                                service_options, \
-                                init_cb, \
-                                connect_cb, \
-                                disconnect_cb, \
-                                cls, \
-                                mh); \
+    };                        \
+    return GNUNET_SERVICE_run_(argc, \
+                               argv, \
+                               service_name, \
+                               service_options, \
+                               init_cb, \
+                               connect_cb, \
+                               disconnect_cb, \
+                               cls, \
+                               mh); \
   }
 
 
@@ -319,7 +318,7 @@ GNUNET_SERVICE_run_ (int argc,
  * @param sh service to stop accepting connections.
  */
 void
-GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh);
+GNUNET_SERVICE_suspend(struct GNUNET_SERVICE_Handle *sh);
 
 
 /**
@@ -328,7 +327,7 @@ GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh);
  * @param sh service to resume accepting connections.
  */
 void
-GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh);
+GNUNET_SERVICE_resume(struct GNUNET_SERVICE_Handle *sh);
 
 
 /**
@@ -338,7 +337,7 @@ GNUNET_SERVICE_resume (struct GNUNET_SERVICE_Handle *sh);
  * @param c the client to continue receiving from
  */
 void
-GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c);
+GNUNET_SERVICE_client_continue(struct GNUNET_SERVICE_Client *c);
 
 
 /**
@@ -348,7 +347,7 @@ GNUNET_SERVICE_client_continue (struct GNUNET_SERVICE_Client *c);
  * @return the message queue of @a c
  */
 struct GNUNET_MQ_Handle *
-GNUNET_SERVICE_client_get_mq (struct GNUNET_SERVICE_Client *c);
+GNUNET_SERVICE_client_get_mq(struct GNUNET_SERVICE_Client *c);
 
 
 /**
@@ -360,7 +359,7 @@ GNUNET_SERVICE_client_get_mq (struct GNUNET_SERVICE_Client *c);
  * @param c client for which to disable the warning
  */
 void
-GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c);
+GNUNET_SERVICE_client_disable_continue_warning(struct GNUNET_SERVICE_Client *c);
 
 
 /**
@@ -379,7 +378,7 @@ GNUNET_SERVICE_client_disable_continue_warning (struct GNUNET_SERVICE_Client *c)
  * @param c client to disconnect now
  */
 void
-GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c);
+GNUNET_SERVICE_client_drop(struct GNUNET_SERVICE_Client *c);
 
 
 /**
@@ -388,7 +387,7 @@ GNUNET_SERVICE_client_drop (struct GNUNET_SERVICE_Client *c);
  * @param sh server to shutdown
  */
 void
-GNUNET_SERVICE_shutdown (struct GNUNET_SERVICE_Handle *sh);
+GNUNET_SERVICE_shutdown(struct GNUNET_SERVICE_Handle *sh);
 
 
 /**
@@ -404,7 +403,7 @@ GNUNET_SERVICE_shutdown (struct GNUNET_SERVICE_Handle *sh);
  * @param c client to mark as a monitor
  */
 void
-GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c);
+GNUNET_SERVICE_client_mark_monitor(struct GNUNET_SERVICE_Client *c);
 
 
 /**
@@ -415,7 +414,7 @@ GNUNET_SERVICE_client_mark_monitor (struct GNUNET_SERVICE_Client *c);
  * @param c client to persist the socket (never to be closed)
  */
 void
-GNUNET_SERVICE_client_persist (struct GNUNET_SERVICE_Client *c);
+GNUNET_SERVICE_client_persist(struct GNUNET_SERVICE_Client *c);
 
 
 #if 0                           /* keep Emacsens' auto-indent happy */