diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-18 18:49:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-18 18:49:13 +0000 |
commit | 710e8923105dfcc38d8aefed19e6da670db9c440 (patch) | |
tree | c6e46d41beedcf3ac2b13a1e040a790db8aa794a /src/include/gnunet_client_lib.h | |
parent | 5dfc382a9f8467cd15b6a0c3a6e022fca9fc4a30 (diff) | |
download | gnunet-710e8923105dfcc38d8aefed19e6da670db9c440.tar.gz gnunet-710e8923105dfcc38d8aefed19e6da670db9c440.zip |
partial refactoring, will cause FTBFS, to be completed ASAP
Diffstat (limited to 'src/include/gnunet_client_lib.h')
-rw-r--r-- | src/include/gnunet_client_lib.h | 59 |
1 files changed, 54 insertions, 5 deletions
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 93c2a3f9c..4bac4d5f3 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -43,18 +43,57 @@ extern "C" | |||
43 | #endif | 43 | #endif |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | #include "gnunet_mq_lib.h" | ||
46 | 47 | ||
47 | /** | 48 | /** |
48 | * Opaque handle for a connection to a service. | 49 | * Opaque handle for a connection to a service. |
49 | */ | 50 | */ |
50 | struct GNUNET_CLIENT_Connection; | 51 | struct GNUNET_CLIENT_Connection; |
51 | 52 | ||
53 | |||
54 | /** | ||
55 | * Create a message queue to connect to a GNUnet service. | ||
56 | * If handlers are specfied, receive messages from the connection. | ||
57 | * | ||
58 | * @param connection the client connection | ||
59 | * @param handlers handlers for receiving messages, can be NULL | ||
60 | * @param error_handler error handler | ||
61 | * @param error_handler_cls closure for the @a error_handler | ||
62 | * @return the message queue | ||
63 | */ | ||
64 | struct GNUNET_MQ_Handle * | ||
65 | GNUNET_CLIENT_connect2 (const char *service_name, | ||
66 | const struct GNUNET_CONFIGURATION_Handle *cfg, | ||
67 | const struct GNUNET_MQ_MessageHandler *handlers, | ||
68 | GNUNET_MQ_ErrorHandler error_handler, | ||
69 | void *error_handler_cls); | ||
70 | |||
71 | |||
72 | /** | ||
73 | * Create a message queue for a GNUNET_CLIENT_Connection. | ||
74 | * If handlers are specfied, receive messages from the connection. | ||
75 | * | ||
76 | * @param connection the client connection | ||
77 | * @param handlers handlers for receiving messages | ||
78 | * @param error_handler error handler | ||
79 | * @param error_handler_cls closure for the @a error_handler | ||
80 | * @return the message queue | ||
81 | * @deprecated use #GNUNET_CLIENT_connect2 | ||
82 | */ | ||
83 | struct GNUNET_MQ_Handle * | ||
84 | GNUNET_MQ_queue_for_connection_client (struct GNUNET_CLIENT_Connection *connection, | ||
85 | const struct GNUNET_MQ_MessageHandler *handlers, | ||
86 | GNUNET_MQ_ErrorHandler error_handler, | ||
87 | void *error_handler_cls); | ||
88 | |||
89 | |||
52 | /** | 90 | /** |
53 | * Get a connection with a service. | 91 | * Get a connection with a service. |
54 | * | 92 | * |
55 | * @param service_name name of the service | 93 | * @param service_name name of the service |
56 | * @param cfg configuration to use | 94 | * @param cfg configuration to use |
57 | * @return NULL on error (service unknown to configuration) | 95 | * @return NULL on error (service unknown to configuration) |
96 | * @deprecated use #GNUNET_CLIENT_connect2 | ||
58 | */ | 97 | */ |
59 | struct GNUNET_CLIENT_Connection * | 98 | struct GNUNET_CLIENT_Connection * |
60 | GNUNET_CLIENT_connect (const char *service_name, | 99 | GNUNET_CLIENT_connect (const char *service_name, |
@@ -73,6 +112,7 @@ GNUNET_CLIENT_connect (const char *service_name, | |||
73 | * which case the message may still be lost). | 112 | * which case the message may still be lost). |
74 | * | 113 | * |
75 | * @param client handle to the service connection | 114 | * @param client handle to the service connection |
115 | * @deprecated | ||
76 | */ | 116 | */ |
77 | void | 117 | void |
78 | GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *client); | 118 | GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *client); |
@@ -85,8 +125,9 @@ GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *client); | |||
85 | * @param cls closure | 125 | * @param cls closure |
86 | * @param msg message received, NULL on timeout or fatal error | 126 | * @param msg message received, NULL on timeout or fatal error |
87 | */ | 127 | */ |
88 | typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, | 128 | typedef void |
89 | const struct GNUNET_MessageHeader *msg); | 129 | (*GNUNET_CLIENT_MessageHandler) (void *cls, |
130 | const struct GNUNET_MessageHeader *msg); | ||
90 | 131 | ||
91 | 132 | ||
92 | /** | 133 | /** |
@@ -96,10 +137,12 @@ typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, | |||
96 | * @param handler function to call with the message | 137 | * @param handler function to call with the message |
97 | * @param handler_cls closure for @a handler | 138 | * @param handler_cls closure for @a handler |
98 | * @param timeout how long to wait until timing out | 139 | * @param timeout how long to wait until timing out |
140 | * @deprecated | ||
99 | */ | 141 | */ |
100 | void | 142 | void |
101 | GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *client, | 143 | GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *client, |
102 | GNUNET_CLIENT_MessageHandler handler, void *handler_cls, | 144 | GNUNET_CLIENT_MessageHandler handler, |
145 | void *handler_cls, | ||
103 | struct GNUNET_TIME_Relative timeout); | 146 | struct GNUNET_TIME_Relative timeout); |
104 | 147 | ||
105 | 148 | ||
@@ -128,6 +171,7 @@ struct GNUNET_CLIENT_TransmitHandle; | |||
128 | * @return NULL if someone else is already waiting to be notified | 171 | * @return NULL if someone else is already waiting to be notified |
129 | * non-NULL if the notify callback was queued (can be used to cancel | 172 | * non-NULL if the notify callback was queued (can be used to cancel |
130 | * using #GNUNET_CONNECTION_notify_transmit_ready_cancel) | 173 | * using #GNUNET_CONNECTION_notify_transmit_ready_cancel) |
174 | * @deprecated | ||
131 | */ | 175 | */ |
132 | struct GNUNET_CLIENT_TransmitHandle * | 176 | struct GNUNET_CLIENT_TransmitHandle * |
133 | GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client, | 177 | GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client, |
@@ -142,6 +186,7 @@ GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *client, | |||
142 | * Cancel a request for notification. | 186 | * Cancel a request for notification. |
143 | * | 187 | * |
144 | * @param th handle from the original request. | 188 | * @param th handle from the original request. |
189 | * @deprecated | ||
145 | */ | 190 | */ |
146 | void | 191 | void |
147 | GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle | 192 | GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle |
@@ -168,6 +213,7 @@ GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle | |||
168 | * @param rn_cls closure for @a rn | 213 | * @param rn_cls closure for @a rn |
169 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if a request | 214 | * @return #GNUNET_OK on success, #GNUNET_SYSERR if a request |
170 | * is already pending | 215 | * is already pending |
216 | * @deprecated | ||
171 | */ | 217 | */ |
172 | int | 218 | int |
173 | GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *client, | 219 | GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *client, |
@@ -191,8 +237,9 @@ struct GNUNET_CLIENT_TestHandle; | |||
191 | * #GNUNET_NO if the service is not running | 237 | * #GNUNET_NO if the service is not running |
192 | * #GNUNET_SYSERR if the configuration is invalid | 238 | * #GNUNET_SYSERR if the configuration is invalid |
193 | */ | 239 | */ |
194 | typedef void (*GNUNET_CLIENT_TestResultCallback)(void *cls, | 240 | typedef void |
195 | int result); | 241 | (*GNUNET_CLIENT_TestResultCallback)(void *cls, |
242 | int result); | ||
196 | 243 | ||
197 | 244 | ||
198 | /** | 245 | /** |
@@ -207,6 +254,7 @@ typedef void (*GNUNET_CLIENT_TestResultCallback)(void *cls, | |||
207 | * @param cb function to call with the result | 254 | * @param cb function to call with the result |
208 | * @param cb_cls closure for @a cb | 255 | * @param cb_cls closure for @a cb |
209 | * @return handle to cancel the test | 256 | * @return handle to cancel the test |
257 | * @deprecated | ||
210 | */ | 258 | */ |
211 | struct GNUNET_CLIENT_TestHandle * | 259 | struct GNUNET_CLIENT_TestHandle * |
212 | GNUNET_CLIENT_service_test (const char *service, | 260 | GNUNET_CLIENT_service_test (const char *service, |
@@ -219,6 +267,7 @@ GNUNET_CLIENT_service_test (const char *service, | |||
219 | * Abort testing for service. | 267 | * Abort testing for service. |
220 | * | 268 | * |
221 | * @param th test handle | 269 | * @param th test handle |
270 | * @deprecated | ||
222 | */ | 271 | */ |
223 | void | 272 | void |
224 | GNUNET_CLIENT_service_test_cancel (struct GNUNET_CLIENT_TestHandle *th); | 273 | GNUNET_CLIENT_service_test_cancel (struct GNUNET_CLIENT_TestHandle *th); |