first batch of license fixes (boring)
[oweals/gnunet.git] / src / include / gnunet_client_lib.h
1 /*
2      This file is part of GNUnet.
3      Copyright (C) 2001-2013, 2016 GNUnet e.V.
4
5      GNUnet is free software: you can redistribute it and/or modify it
6      under the terms of the GNU General Public License as published
7      by the Free Software Foundation, either version 3 of the License,
8      or (at your option) any later version.
9
10      GNUnet is distributed in the hope that it will be useful, but
11      WITHOUT ANY WARRANTY; without even the implied warranty of
12      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13      Affero General Public License for more details.
14 */
15
16 /**
17  * @author Christian Grothoff
18  *
19  * @file
20  * Functions related to accessing services
21
22  * @defgroup client  Client library
23  * Generic client-side communication with services
24  *
25  * @see [Documentation](https://gnunet.org/ipc)
26  *
27  * @{
28  */
29
30 #ifndef GNUNET_CLIENT_LIB_H
31 #define GNUNET_CLIENT_LIB_H
32
33 #ifdef __cplusplus
34 extern "C"
35 {
36 #if 0                           /* keep Emacsens' auto-indent happy */
37 }
38 #endif
39 #endif
40
41 #include "gnunet_mq_lib.h"
42
43
44 /**
45  * Create a message queue to connect to a GNUnet service.
46  * If handlers are specfied, receive messages from the connection.
47  *
48  * @param connection the client connection
49  * @param handlers handlers for receiving messages, can be NULL
50  * @param error_handler error handler
51  * @param error_handler_cls closure for the @a error_handler
52  * @return the message queue, NULL on error
53  */
54 struct GNUNET_MQ_Handle *
55 GNUNET_CLIENT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg,
56                        const char *service_name,
57                        const struct GNUNET_MQ_MessageHandler *handlers,
58                        GNUNET_MQ_ErrorHandler error_handler,
59                        void *error_handler_cls);
60
61
62 #if 0                           /* keep Emacsens' auto-indent happy */
63 {
64 #endif
65 #ifdef __cplusplus
66 }
67 #endif
68
69 /* ifndef GNUNET_CLIENT_LIB_H */
70 #endif
71
72 /** @} */ /* end of group client */
73
74 /* end of gnunet_client_lib.h */