aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_scalarproduct_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-12-05 21:03:00 +0000
committerChristian Grothoff <christian@grothoff.org>2013-12-05 21:03:00 +0000
commitce3358e934f60fd2637e98b08d58ced6e7f76ec7 (patch)
tree6fafa275f28d69e3433c44de75eb859efe9e3e9b /src/include/gnunet_scalarproduct_service.h
parent83d2ed0a8630e0295c3bd9db54e15074c68ff783 (diff)
downloadgnunet-ce3358e934f60fd2637e98b08d58ced6e7f76ec7.tar.gz
gnunet-ce3358e934f60fd2637e98b08d58ced6e7f76ec7.zip
-indentations, comments on API
Diffstat (limited to 'src/include/gnunet_scalarproduct_service.h')
-rw-r--r--src/include/gnunet_scalarproduct_service.h38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/include/gnunet_scalarproduct_service.h b/src/include/gnunet_scalarproduct_service.h
index 1146db1e4..b61a4d6f6 100644
--- a/src/include/gnunet_scalarproduct_service.h
+++ b/src/include/gnunet_scalarproduct_service.h
@@ -49,11 +49,13 @@ enum GNUNET_SCALARPRODUCT_ResponseStatus
49 GNUNET_SCALARPRODUCT_Status_ServiceDisconnected 49 GNUNET_SCALARPRODUCT_Status_ServiceDisconnected
50}; 50};
51 51
52
52/** 53/**
53 * Opaque declaration of the SP-Handle 54 * Opaque declaration of the SP-Handle
54 */ 55 */
55struct GNUNET_SCALARPRODUCT_Handle; 56struct GNUNET_SCALARPRODUCT_Handle;
56 57
58
57/** 59/**
58 * Continuation called to notify client about result of the 60 * Continuation called to notify client about result of the
59 * operation. 61 * operation.
@@ -63,6 +65,8 @@ struct GNUNET_SCALARPRODUCT_Handle;
63 */ 65 */
64typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls, 66typedef void (*GNUNET_SCALARPRODUCT_ContinuationWithStatus) (void *cls,
65 enum GNUNET_SCALARPRODUCT_ResponseStatus status); 67 enum GNUNET_SCALARPRODUCT_ResponseStatus status);
68
69
66/** 70/**
67 * Process a datum that was stored in the scalarproduct. 71 * Process a datum that was stored in the scalarproduct.
68 * 72 *
@@ -74,6 +78,7 @@ typedef void (*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls,
74 enum GNUNET_SCALARPRODUCT_ResponseStatus status, 78 enum GNUNET_SCALARPRODUCT_ResponseStatus status,
75 gcry_mpi_t result); 79 gcry_mpi_t result);
76 80
81
77/** 82/**
78 * Request by Alice's client for computing a scalar product 83 * Request by Alice's client for computing a scalar product
79 * 84 *
@@ -85,17 +90,16 @@ typedef void (*GNUNET_SCALARPRODUCT_DatumProcessor) (void *cls,
85 * @param mask Array of the mask 90 * @param mask Array of the mask
86 * @param mask_bytes number of bytes in the mask 91 * @param mask_bytes number of bytes in the mask
87 * @param cont Callback function 92 * @param cont Callback function
88 * @param cont_cls Closure for the callback function 93 * @param cont_cls Closure for @a cont
89 *
90 * @return a new handle for this computation 94 * @return a new handle for this computation
91 */ 95 */
92struct GNUNET_SCALARPRODUCT_ComputationHandle * 96struct GNUNET_SCALARPRODUCT_ComputationHandle *
93GNUNET_SCALARPRODUCT_request (const struct GNUNET_CONFIGURATION_Handle * cfg, 97GNUNET_SCALARPRODUCT_request (const struct GNUNET_CONFIGURATION_Handle *cfg,
94 const struct GNUNET_HashCode * key, 98 const struct GNUNET_HashCode *key,
95 const struct GNUNET_PeerIdentity *peer, 99 const struct GNUNET_PeerIdentity *peer,
96 const int32_t * elements, 100 const int32_t *elements,
97 uint32_t element_count, 101 uint32_t element_count,
98 const unsigned char * mask, 102 const unsigned char *mask,
99 uint32_t mask_bytes, 103 uint32_t mask_bytes,
100 GNUNET_SCALARPRODUCT_DatumProcessor cont, 104 GNUNET_SCALARPRODUCT_DatumProcessor cont,
101 void * cont_cls); 105 void * cont_cls);
@@ -108,17 +112,18 @@ GNUNET_SCALARPRODUCT_request (const struct GNUNET_CONFIGURATION_Handle * cfg,
108 * @param elements Array of elements of the vector 112 * @param elements Array of elements of the vector
109 * @param element_count Number of elements in the vector 113 * @param element_count Number of elements in the vector
110 * @param cont Callback function 114 * @param cont Callback function
111 * @param cont_cls Closure for the callback function 115 * @param cont_cls Closure for @a cont
112 *
113 * @return a new handle for this computation 116 * @return a new handle for this computation
114 */ 117 */
115struct GNUNET_SCALARPRODUCT_ComputationHandle * 118struct GNUNET_SCALARPRODUCT_ComputationHandle *
116GNUNET_SCALARPRODUCT_response (const struct GNUNET_CONFIGURATION_Handle * cfg, 119GNUNET_SCALARPRODUCT_response (const struct GNUNET_CONFIGURATION_Handle *cfg,
117 const struct GNUNET_HashCode * key, 120 const struct GNUNET_HashCode *key,
118 const int32_t * elements, 121 const int32_t *elements,
119 uint32_t element_count, 122 uint32_t element_count,
120 GNUNET_SCALARPRODUCT_ContinuationWithStatus cont, 123 GNUNET_SCALARPRODUCT_ContinuationWithStatus cont,
121 void * cont_cls); 124 void *cont_cls);
125
126
122/** 127/**
123 * Cancel an ongoing computation or revoke our collaboration offer. 128 * Cancel an ongoing computation or revoke our collaboration offer.
124 * Closes the connection to the service 129 * Closes the connection to the service
@@ -126,15 +131,22 @@ GNUNET_SCALARPRODUCT_response (const struct GNUNET_CONFIGURATION_Handle * cfg,
126 * @param h computation handle to terminate 131 * @param h computation handle to terminate
127 */ 132 */
128void 133void
129GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle * h); 134GNUNET_SCALARPRODUCT_cancel (struct GNUNET_SCALARPRODUCT_ComputationHandle *h);
135
130 136
131/** 137/**
132 * Cancel ALL ongoing computation or revoke our collaboration offer. 138 * Cancel ALL ongoing computation or revoke our collaboration offer.
133 * Closes ALL connections to the service 139 * Closes ALL connections to the service
140 *
141 * FIXME: this should take an argument, and we should
142 * have an explicit 'connect' API which returns an opaque
143 * connection handle. Avoid (globals) in the library!
144 * @deprecated in this form
134 */ 145 */
135void 146void
136GNUNET_SCALARPRODUCT_disconnect (); 147GNUNET_SCALARPRODUCT_disconnect ();
137 148
149
138#if 0 /* keep Emacsens' auto-indent happy */ 150#if 0 /* keep Emacsens' auto-indent happy */
139{ 151{
140#endif 152#endif