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
/**
* 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.
* @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);
/**
* @param srv service to stop
*/
void
-GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Handle *srv);
+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);
/**
* &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); \
}
* @param sh service to stop accepting connections.
*/
void
-GNUNET_SERVICE_suspend (struct GNUNET_SERVICE_Handle *sh);
+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);
/**
* @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);
/**
* @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);
/**
* @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);
/**
* @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);
/**
* @param sh server to shutdown
*/
void
-GNUNET_SERVICE_shutdown (struct GNUNET_SERVICE_Handle *sh);
+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);
/**
* @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 */