diff options
-rw-r--r-- | src/include/gnunet_my_lib.h | 2 | ||||
-rw-r--r-- | src/my/my_query_helper.c | 133 | ||||
-rw-r--r-- | src/my/my_result_helper.c | 2 |
3 files changed, 68 insertions, 69 deletions
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h index 6ecff67a0..88b527e20 100644 --- a/src/include/gnunet_my_lib.h +++ b/src/include/gnunet_my_lib.h | |||
@@ -259,7 +259,7 @@ struct GNUNET_MY_ResultSpec | |||
259 | * | 259 | * |
260 | * @return array last entry for the result specification to use | 260 | * @return array last entry for the result specification to use |
261 | */ | 261 | */ |
262 | #define GNUNET_MY_result_spec_end { NULL, NULL, NULL, 0, NULL, 0 } | 262 | #define GNUNET_MY_result_spec_end { NULL, NULL, NULL, 0, NULL, 0, 0 } |
263 | 263 | ||
264 | 264 | ||
265 | 265 | ||
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c index c806a73fb..436860691 100644 --- a/src/my/my_query_helper.c +++ b/src/my/my_query_helper.c | |||
@@ -57,7 +57,6 @@ my_conv_fixed_size (void *cls, | |||
57 | MYSQL_BIND *qbind) | 57 | MYSQL_BIND *qbind) |
58 | { | 58 | { |
59 | GNUNET_assert (1 == qp->num_params); | 59 | GNUNET_assert (1 == qp->num_params); |
60 | |||
61 | qbind->buffer = (void *) qp->data; | 60 | qbind->buffer = (void *) qp->data; |
62 | qbind->buffer_length = qp->data_len; | 61 | qbind->buffer_length = qp->data_len; |
63 | qbind->buffer_type = MYSQL_TYPE_BLOB; | 62 | qbind->buffer_type = MYSQL_TYPE_BLOB; |
@@ -90,29 +89,29 @@ GNUNET_MY_query_param_fixed_size (const void *ptr, | |||
90 | 89 | ||
91 | 90 | ||
92 | /** | 91 | /** |
93 | * Generate query parameter for a string | 92 | * Generate query parameter for a string |
94 | * | 93 | * |
95 | *@param ptr pointer to the string query parameter to pass | 94 | * @param ptr pointer to the string query parameter to pass |
96 | */ | 95 | */ |
97 | struct GNUNET_MY_QueryParam | 96 | struct GNUNET_MY_QueryParam |
98 | GNUNET_MY_query_param_string (const char *ptr) | 97 | GNUNET_MY_query_param_string (const char *ptr) |
99 | { | 98 | { |
100 | return GNUNET_MY_query_param_fixed_size(ptr, | 99 | return GNUNET_MY_query_param_fixed_size (ptr, |
101 | strlen(ptr)); | 100 | strlen(ptr)); |
102 | } | 101 | } |
103 | 102 | ||
104 | 103 | ||
105 | /** | 104 | /** |
106 | * Function called to convert input argument into SQL parameters | 105 | * Function called to convert input argument into SQL parameters |
107 | * | 106 | * |
108 | *@param cls closure | 107 | * @param cls closure |
109 | *@param pq data about the query | 108 | * @param pq data about the query |
110 | * @param qbind array of parameters to initialize | 109 | * @param qbind array of parameters to initialize |
111 | *@return -1 on error | 110 | * @return -1 on error |
112 | */ | 111 | */ |
113 | static int | 112 | static int |
114 | my_conv_uint16 (void *cls, | 113 | my_conv_uint16 (void *cls, |
115 | const struct GNUNET_MY_QueryParam * qp, | 114 | const struct GNUNET_MY_QueryParam *qp, |
116 | MYSQL_BIND *qbind) | 115 | MYSQL_BIND *qbind) |
117 | { | 116 | { |
118 | GNUNET_assert (1 == qp->num_params); | 117 | GNUNET_assert (1 == qp->num_params); |
@@ -124,10 +123,10 @@ my_conv_uint16 (void *cls, | |||
124 | 123 | ||
125 | 124 | ||
126 | /** | 125 | /** |
127 | * Generate query parameter for an uint16_t in host byte order. | 126 | * Generate query parameter for an uint16_t in host byte order. |
128 | * | 127 | * |
129 | * @param x pointer to the query parameter to pass | 128 | * @param x pointer to the query parameter to pass |
130 | */ | 129 | */ |
131 | struct GNUNET_MY_QueryParam | 130 | struct GNUNET_MY_QueryParam |
132 | GNUNET_MY_query_param_uint16 (const uint16_t *x) | 131 | GNUNET_MY_query_param_uint16 (const uint16_t *x) |
133 | { | 132 | { |
@@ -145,13 +144,13 @@ GNUNET_MY_query_param_uint16 (const uint16_t *x) | |||
145 | 144 | ||
146 | 145 | ||
147 | /** | 146 | /** |
148 | * Function called to convert input argument into SQL parameters | 147 | * Function called to convert input argument into SQL parameters |
149 | * | 148 | * |
150 | *@param cls closure | 149 | * @param cls closure |
151 | *@param pq data about the query | 150 | * @param pq data about the query |
152 | * @param qbind array of parameters to initialize | 151 | * @param qbind array of parameters to initialize |
153 | *@return -1 on error | 152 | * @return -1 on error |
154 | */ | 153 | */ |
155 | static int | 154 | static int |
156 | my_conv_uint32 (void *cls, | 155 | my_conv_uint32 (void *cls, |
157 | const struct GNUNET_MY_QueryParam *qp, | 156 | const struct GNUNET_MY_QueryParam *qp, |
@@ -167,10 +166,10 @@ my_conv_uint32 (void *cls, | |||
167 | 166 | ||
168 | 167 | ||
169 | /** | 168 | /** |
170 | * Generate query parameter for an uint32_t in host byte order | 169 | * Generate query parameter for an uint32_t in host byte order |
171 | * | 170 | * |
172 | *@param x pointer to the query parameter to pass | 171 | * @param x pointer to the query parameter to pass |
173 | */ | 172 | */ |
174 | struct GNUNET_MY_QueryParam | 173 | struct GNUNET_MY_QueryParam |
175 | GNUNET_MY_query_param_uint32 (const uint32_t *x) | 174 | GNUNET_MY_query_param_uint32 (const uint32_t *x) |
176 | { | 175 | { |
@@ -188,13 +187,13 @@ GNUNET_MY_query_param_uint32 (const uint32_t *x) | |||
188 | 187 | ||
189 | 188 | ||
190 | /** | 189 | /** |
191 | * Function called to convert input argument into SQL parameters | 190 | * Function called to convert input argument into SQL parameters |
192 | * | 191 | * |
193 | *@param cls closure | 192 | * @param cls closure |
194 | *@param pq data about the query | 193 | * @param pq data about the query |
195 | * @param qbind array of parameters to initialize | 194 | * @param qbind array of parameters to initialize |
196 | *@return -1 on error | 195 | * @return -1 on error |
197 | */ | 196 | */ |
198 | static int | 197 | static int |
199 | my_conv_uint64 (void *cls, | 198 | my_conv_uint64 (void *cls, |
200 | const struct GNUNET_MY_QueryParam *qp, | 199 | const struct GNUNET_MY_QueryParam *qp, |
@@ -209,10 +208,10 @@ my_conv_uint64 (void *cls, | |||
209 | 208 | ||
210 | 209 | ||
211 | /** | 210 | /** |
212 | * Generate query parameter for an uint64_t in host byte order | 211 | * Generate query parameter for an uint64_t in host byte order |
213 | * | 212 | * |
214 | *@param x pointer to the query parameter to pass | 213 | * @param x pointer to the query parameter to pass |
215 | */ | 214 | */ |
216 | struct GNUNET_MY_QueryParam | 215 | struct GNUNET_MY_QueryParam |
217 | GNUNET_MY_query_param_uint64 (const uint64_t *x) | 216 | GNUNET_MY_query_param_uint64 (const uint64_t *x) |
218 | { | 217 | { |
@@ -230,13 +229,13 @@ GNUNET_MY_query_param_uint64 (const uint64_t *x) | |||
230 | 229 | ||
231 | 230 | ||
232 | /** | 231 | /** |
233 | * Function called to convert input argument into SQL parameters | 232 | * Function called to convert input argument into SQL parameters |
234 | * | 233 | * |
235 | *@param cls closure | 234 | * @param cls closure |
236 | *@param pq data about the query | 235 | * @param pq data about the query |
237 | * @param qbind array of parameters to initialize | 236 | * @param qbind array of parameters to initialize |
238 | *@return -1 on error | 237 | * @return -1 on error |
239 | */ | 238 | */ |
240 | static int | 239 | static int |
241 | my_conv_rsa_public_key (void *cls, | 240 | my_conv_rsa_public_key (void *cls, |
242 | const struct GNUNET_MY_QueryParam *qp, | 241 | const struct GNUNET_MY_QueryParam *qp, |
@@ -259,12 +258,12 @@ my_conv_rsa_public_key (void *cls, | |||
259 | 258 | ||
260 | 259 | ||
261 | /** | 260 | /** |
262 | * Generate query parameter for an RSA public key. The | 261 | * Generate query parameter for an RSA public key. The |
263 | * database must contain a BLOB type in the respective position. | 262 | * database must contain a BLOB type in the respective position. |
264 | * | 263 | * |
265 | * @param x the query parameter to pass | 264 | * @param x the query parameter to pass |
266 | * @return array entry for the query parameters to use | 265 | * @return array entry for the query parameters to use |
267 | */ | 266 | */ |
268 | struct GNUNET_MY_QueryParam | 267 | struct GNUNET_MY_QueryParam |
269 | GNUNET_MY_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x) | 268 | GNUNET_MY_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x) |
270 | { | 269 | { |
@@ -311,12 +310,12 @@ my_conv_rsa_signature (void *cls, | |||
311 | 310 | ||
312 | 311 | ||
313 | /** | 312 | /** |
314 | * Generate query parameter for an RSA signature. The | 313 | * Generate query parameter for an RSA signature. The |
315 | * database must contain a BLOB type in the respective position | 314 | * database must contain a BLOB type in the respective position |
316 | * | 315 | * |
317 | *@param x the query parameter to pass | 316 | * @param x the query parameter to pass |
318 | *@return array entry for the query parameters to use | 317 | * @return array entry for the query parameters to use |
319 | */ | 318 | */ |
320 | struct GNUNET_MY_QueryParam | 319 | struct GNUNET_MY_QueryParam |
321 | GNUNET_MY_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) | 320 | GNUNET_MY_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) |
322 | { | 321 | { |
@@ -333,12 +332,12 @@ GNUNET_MY_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) | |||
333 | 332 | ||
334 | 333 | ||
335 | /** | 334 | /** |
336 | * Generate query parameter for an absolute time value. | 335 | * Generate query parameter for an absolute time value. |
337 | * The database must store a 64-bit integer. | 336 | * The database must store a 64-bit integer. |
338 | * | 337 | * |
339 | *@param x pointer to the query parameter to pass | 338 | * @param x pointer to the query parameter to pass |
340 | *@return array entry for the query parameters to use | 339 | * @return array entry for the query parameters to use |
341 | */ | 340 | */ |
342 | struct GNUNET_MY_QueryParam | 341 | struct GNUNET_MY_QueryParam |
343 | GNUNET_MY_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x) | 342 | GNUNET_MY_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x) |
344 | { | 343 | { |
@@ -347,11 +346,11 @@ GNUNET_MY_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x) | |||
347 | 346 | ||
348 | 347 | ||
349 | /** | 348 | /** |
350 | * Generate query parameter for an absolute time value. | 349 | * Generate query parameter for an absolute time value. |
351 | * The database must store a 64-bit integer. | 350 | * The database must store a 64-bit integer. |
352 | * | 351 | * |
353 | *@param x pointer to the query parameter to pass | 352 | * @param x pointer to the query parameter to pass |
354 | */ | 353 | */ |
355 | struct GNUNET_MY_QueryParam | 354 | struct GNUNET_MY_QueryParam |
356 | GNUNET_MY_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x) | 355 | GNUNET_MY_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x) |
357 | { | 356 | { |
diff --git a/src/my/my_result_helper.c b/src/my/my_result_helper.c index bee6e3304..6c6a4e3b1 100644 --- a/src/my/my_result_helper.c +++ b/src/my/my_result_helper.c | |||
@@ -865,4 +865,4 @@ GNUNET_MY_result_spec_uint64 (uint64_t *u64) | |||
865 | } | 865 | } |
866 | 866 | ||
867 | 867 | ||
868 | /* end of pq_result_helper.c */ | 868 | /* end of my_result_helper.c */ |