aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_scalarproduct_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-23 13:43:02 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-23 13:43:02 +0000
commit5a0e57891c7f33f03bb25a3ab6b83d0f0b26a05e (patch)
treefe9e0c8c1ffbe9867b0c03839df6c1fab288e292 /src/include/gnunet_scalarproduct_service.h
parent33b89b07e0ea833955f64d07b7e54e64aab500e9 (diff)
downloadgnunet-5a0e57891c7f33f03bb25a3ab6b83d0f0b26a05e.tar.gz
gnunet-5a0e57891c7f33f03bb25a3ab6b83d0f0b26a05e.zip
-more vector -> scalar renaming
Diffstat (limited to 'src/include/gnunet_scalarproduct_service.h')
-rw-r--r--src/include/gnunet_scalarproduct_service.h76
1 files changed, 38 insertions, 38 deletions
diff --git a/src/include/gnunet_scalarproduct_service.h b/src/include/gnunet_scalarproduct_service.h
index 743a7365d..9fc8dbd2a 100644
--- a/src/include/gnunet_scalarproduct_service.h
+++ b/src/include/gnunet_scalarproduct_service.h
@@ -19,13 +19,13 @@
19 */ 19 */
20 20
21/** 21/**
22 * @file include/gnunet_vectorproduct_service.h 22 * @file include/gnunet_scalarproduct_service.h
23 * @brief API to the vectorproduct service 23 * @brief API to the scalarproduct service
24 * @author Christian M. Fuchs 24 * @author Christian M. Fuchs
25 * @author Gaurav Kukreja 25 * @author Gaurav Kukreja
26 */ 26 */
27#ifndef GNUNET_VECTORPRODUCT_SERVICE_H 27#ifndef GNUNET_SCALARPRODUCT_SERVICE_H
28#define GNUNET_VECTORPRODUCT_SERVICE_H 28#define GNUNET_SCALARPRODUCT_SERVICE_H
29#define GCRYPT_NO_DEPRECATED 29#define GCRYPT_NO_DEPRECATED
30// including gcrypt crashes netbeans after the next restart... 30// including gcrypt crashes netbeans after the next restart...
31#include <gcrypt.h> 31#include <gcrypt.h>
@@ -38,15 +38,15 @@ extern "C" {
38#endif 38#endif
39 39
40/** 40/**
41 * Version of the vectorproduct API. 41 * Version of the scalarproduct API.
42 */ 42 */
43#define GNUNET_VECTORPRODUCT_VERSION 0x00000042 43#define GNUNET_SCALARPRODUCT_VERSION 0x00000042
44 44
45/** 45/**
46 * Message type passed from client to service 46 * Message type passed from client to service
47 * to initiate a request or responder role 47 * to initiate a request or responder role
48 */ 48 */
49struct GNUNET_VECTORPRODUCT_client_request { 49struct GNUNET_SCALARPRODUCT_client_request {
50 /** 50 /**
51 * GNUNET message header 51 * GNUNET message header
52 */ 52 */
@@ -81,7 +81,7 @@ struct GNUNET_VECTORPRODUCT_client_request {
81 * Message type passed from service client 81 * Message type passed from service client
82 * to finalize a session as requester or responder 82 * to finalize a session as requester or responder
83 */ 83 */
84struct GNUNET_VECTORPRODUCT_client_response { 84struct GNUNET_SCALARPRODUCT_client_response {
85 /** 85 /**
86 * GNUNET message header 86 * GNUNET message header
87 */ 87 */
@@ -107,22 +107,22 @@ struct GNUNET_VECTORPRODUCT_client_response {
107 */ 107 */
108}; 108};
109 109
110enum GNUNET_VECTORPRODUCT_ResponseStatus { 110enum GNUNET_SCALARPRODUCT_ResponseStatus {
111 GNUNET_VECTORPRODUCT_Status_Success = 0, 111 GNUNET_SCALARPRODUCT_Status_Success = 0,
112 GNUNET_VECTORPRODUCT_Status_Failure, 112 GNUNET_SCALARPRODUCT_Status_Failure,
113 GNUNET_VECTORPRODUCT_Status_Timeout, 113 GNUNET_SCALARPRODUCT_Status_Timeout,
114 GNUNET_VECTORPRODUCT_Status_InvalidResponse, 114 GNUNET_SCALARPRODUCT_Status_InvalidResponse,
115 GNUNET_VECTORPRODUCT_Status_ServiceDisconnected 115 GNUNET_SCALARPRODUCT_Status_ServiceDisconnected
116}; 116};
117 117
118struct GNUNET_VECTORPRODUCT_Handle { 118struct GNUNET_SCALARPRODUCT_Handle {
119 /** 119 /**
120 * Our configuration. 120 * Our configuration.
121 */ 121 */
122 const struct GNUNET_CONFIGURATION_Handle *cfg; 122 const struct GNUNET_CONFIGURATION_Handle *cfg;
123 123
124 /** 124 /**
125 * Current connection to the vectorproduct service. 125 * Current connection to the scalarproduct service.
126 */ 126 */
127 struct GNUNET_CLIENT_Connection *client; 127 struct GNUNET_CLIENT_Connection *client;
128 128
@@ -134,12 +134,12 @@ struct GNUNET_VECTORPRODUCT_Handle {
134 /** 134 /**
135 * Current head of priority queue. 135 * Current head of priority queue.
136 */ 136 */
137 struct GNUNET_VECTORPRODUCT_QueueEntry *queue_head; 137 struct GNUNET_SCALARPRODUCT_QueueEntry *queue_head;
138 138
139 /** 139 /**
140 * Current tail of priority queue. 140 * Current tail of priority queue.
141 */ 141 */
142 struct GNUNET_VECTORPRODUCT_QueueEntry *queue_tail; 142 struct GNUNET_SCALARPRODUCT_QueueEntry *queue_tail;
143 143
144 /** 144 /**
145 * Are we currently trying to receive from the service? 145 * Are we currently trying to receive from the service?
@@ -156,9 +156,9 @@ struct GNUNET_VECTORPRODUCT_Handle {
156 */ 156 */
157}; 157};
158 158
159typedef void (*GNUNET_VECTORPRODUCT_ResponseMessageHandler) (void *cls, 159typedef void (*GNUNET_SCALARPRODUCT_ResponseMessageHandler) (void *cls,
160 const struct GNUNET_MessageHeader *msg, 160 const struct GNUNET_MessageHeader *msg,
161 enum GNUNET_VECTORPRODUCT_ResponseStatus status); 161 enum GNUNET_SCALARPRODUCT_ResponseStatus status);
162 162
163/** 163/**
164 * Continuation called to notify client about result of the 164 * Continuation called to notify client about result of the
@@ -170,11 +170,11 @@ typedef void (*GNUNET_VECTORPRODUCT_ResponseMessageHandler) (void *cls,
170 * GNUNET_YES (or other positive value) on success 170 * GNUNET_YES (or other positive value) on success
171 * @param msg NULL on success, otherwise an error message 171 * @param msg NULL on success, otherwise an error message
172 */ 172 */
173typedef void (*GNUNET_VECTORPRODUCT_ContinuationWithStatus) (void *cls, 173typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls,
174 const struct GNUNET_HashCode * key, 174 const struct GNUNET_HashCode * key,
175 enum GNUNET_VECTORPRODUCT_ResponseStatus status); 175 enum GNUNET_SCALARPRODUCT_ResponseStatus status);
176/** 176/**
177 * Process a datum that was stored in the vectorproduct. 177 * Process a datum that was stored in the scalarproduct.
178 * 178 *
179 * @param cls closure 179 * @param cls closure
180 * @param key Sessioon key 180 * @param key Sessioon key
@@ -184,11 +184,11 @@ typedef void (*GNUNET_VECTORPRODUCT_ContinuationWithStatus) (void *cls,
184 * @param data Pointer to the data 184 * @param data Pointer to the data
185 * @param type Type of data 185 * @param type Type of data
186 */ 186 */
187typedef void (*GNUNET_VECTORPRODUCT_DatumProcessor) (void *cls, 187typedef void (*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls,
188 const struct GNUNET_HashCode * key, 188 const struct GNUNET_HashCode * key,
189 const struct GNUNET_PeerIdentity * peer, 189 const struct GNUNET_PeerIdentity * peer,
190 enum GNUNET_VECTORPRODUCT_ResponseStatus status, 190 enum GNUNET_SCALARPRODUCT_ResponseStatus status,
191 const struct GNUNET_VECTORPRODUCT_client_response *msg); 191 const struct GNUNET_SCALARPRODUCT_client_response *msg);
192 192
193/** 193/**
194 * Request the Scalar Product Evaluation 194 * Request the Scalar Product Evaluation
@@ -204,15 +204,15 @@ typedef void (*GNUNET_VECTORPRODUCT_DatumProcessor) (void *cls,
204 * @param cont Callback function 204 * @param cont Callback function
205 * @param cont_cls Closure for the callback function 205 * @param cont_cls Closure for the callback function
206 */ 206 */
207struct GNUNET_VECTORPRODUCT_QueueEntry * 207struct GNUNET_SCALARPRODUCT_QueueEntry *
208GNUNET_VECTORPRODUCT_request(struct GNUNET_VECTORPRODUCT_Handle *h, 208GNUNET_SCALARPRODUCT_request(struct GNUNET_SCALARPRODUCT_Handle *h,
209 const struct GNUNET_HashCode * key, 209 const struct GNUNET_HashCode * key,
210 const struct GNUNET_PeerIdentity *peer, 210 const struct GNUNET_PeerIdentity *peer,
211 uint16_t element_count, 211 uint16_t element_count,
212 uint16_t mask_bytes, 212 uint16_t mask_bytes,
213 int32_t * elements, const unsigned char * mask, 213 int32_t * elements, const unsigned char * mask,
214 struct GNUNET_TIME_Relative timeout, 214 struct GNUNET_TIME_Relative timeout,
215 GNUNET_VECTORPRODUCT_DatumProcessor cont, 215 GNUNET_SCALARPRODUCT_DatumProcessor cont,
216 void *cont_cls); 216 void *cont_cls);
217 217
218/** 218/**
@@ -228,31 +228,31 @@ GNUNET_VECTORPRODUCT_request(struct GNUNET_VECTORPRODUCT_Handle *h,
228 * @param cont Callback function 228 * @param cont Callback function
229 * @param cont_cls Closure for the callback function 229 * @param cont_cls Closure for the callback function
230 */ 230 */
231struct GNUNET_VECTORPRODUCT_QueueEntry * 231struct GNUNET_SCALARPRODUCT_QueueEntry *
232GNUNET_VECTORPRODUCT_prepare_response(struct GNUNET_VECTORPRODUCT_Handle *h, 232GNUNET_SCALARPRODUCT_prepare_response(struct GNUNET_SCALARPRODUCT_Handle *h,
233 const struct GNUNET_HashCode * key, 233 const struct GNUNET_HashCode * key,
234 uint16_t element_count, 234 uint16_t element_count,
235 int32_t* elements, 235 int32_t* elements,
236 struct GNUNET_TIME_Relative timeout, 236 struct GNUNET_TIME_Relative timeout,
237 GNUNET_VECTORPRODUCT_ContinuationWithStatus cont, 237 GNUNET_SCALARPRODUCT_ContinuationWithStatus cont,
238 void *cont_cls); 238 void *cont_cls);
239 239
240/** 240/**
241 * Connect to the vectorproduct service. 241 * Connect to the scalarproduct service.
242 * 242 *
243 * @param cfg configuration to use 243 * @param cfg configuration to use
244 * @return handle to use to access the service 244 * @return handle to use to access the service
245 */ 245 */
246struct GNUNET_VECTORPRODUCT_Handle * 246struct GNUNET_SCALARPRODUCT_Handle *
247GNUNET_VECTORPRODUCT_connect(const struct GNUNET_CONFIGURATION_Handle * cfg); 247GNUNET_SCALARPRODUCT_connect(const struct GNUNET_CONFIGURATION_Handle * cfg);
248 248
249/** 249/**
250 * Disconnect from the vectorproduct service. 250 * Disconnect from the scalarproduct service.
251 * 251 *
252 * @param h handle to the vectorproduct 252 * @param h handle to the scalarproduct
253 */ 253 */
254void 254void
255GNUNET_VECTORPRODUCT_disconnect(struct GNUNET_VECTORPRODUCT_Handle * h); 255GNUNET_SCALARPRODUCT_disconnect(struct GNUNET_SCALARPRODUCT_Handle * h);
256 256
257 257
258#if 0 /* keep Emacsens' auto-indent happy */ 258#if 0 /* keep Emacsens' auto-indent happy */