diff options
author | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-05-24 16:16:01 +0000 |
---|---|---|
committer | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-05-24 16:16:01 +0000 |
commit | 52aa7299f2c3a9f9e80b366ca9068a6edf3b9bab (patch) | |
tree | e086c7db41ce02182a17e07e1c3d0899c398620c /src/include/gnunet_my_lib.h | |
parent | a0f69c5d40c22904549bb3246c523681d00d72cd (diff) | |
download | gnunet-52aa7299f2c3a9f9e80b366ca9068a6edf3b9bab.tar.gz gnunet-52aa7299f2c3a9f9e80b366ca9068a6edf3b9bab.zip |
fix result and query helper
Diffstat (limited to 'src/include/gnunet_my_lib.h')
-rw-r--r-- | src/include/gnunet_my_lib.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h index 2a7df1ed6..6931ddcbd 100644 --- a/src/include/gnunet_my_lib.h +++ b/src/include/gnunet_my_lib.h | |||
@@ -299,10 +299,96 @@ GNUNET_MY_query_param_uint64 (const uint64_t *x); | |||
299 | */ | 299 | */ |
300 | #define GNUNET_MY_result_spec_auto_from_type(dst) GNUNET_MY_result_spec_fixed_size ((dst), sizeof (*(dst))) | 300 | #define GNUNET_MY_result_spec_auto_from_type(dst) GNUNET_MY_result_spec_fixed_size ((dst), sizeof (*(dst))) |
301 | 301 | ||
302 | |||
302 | /** | 303 | /** |
303 | * FIXME. | 304 | * FIXME. |
304 | * | 305 | * |
305 | */ | 306 | */ |
307 | |||
308 | /** | ||
309 | * Variable-size result expected | ||
310 | * | ||
311 | * @param[out] dst where to store the result, allocated | ||
312 | * @param[out] sptr where to store the size of @a dst | ||
313 | * @return array entru for the result specification to use | ||
314 | */ | ||
315 | struct GNUNET_MY_ResultSpec | ||
316 | GNUNET_MY_result_spec_variable_size (void **dst, | ||
317 | size_t *ptr_size); | ||
318 | /** | ||
319 | * RSA public key expected | ||
320 | * | ||
321 | * @param name name of the field in the table | ||
322 | * @param[out] rsa where to store the result | ||
323 | * @return array entry for the result specification to use | ||
324 | */ | ||
325 | struct GNUNET_MY_ResultSpec | ||
326 | GNUNET_MY_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa); | ||
327 | |||
328 | /** | ||
329 | * RSA signature expected. | ||
330 | * | ||
331 | * @param[out] sig where to store the result; | ||
332 | * @return array entry for the result specification to use | ||
333 | */ | ||
334 | struct GNUNET_MY_ResultSpec | ||
335 | GNUNET_MY_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig); | ||
336 | |||
337 | /** | ||
338 | * 0- terminated string exprected. | ||
339 | * | ||
340 | * @param[out] dst where to store the result, allocated | ||
341 | * @return array entry for the result specification to use | ||
342 | */ | ||
343 | struct GNUNET_MY_ResultSpec | ||
344 | GNUNET_MY_result_spec_string (char **dst); | ||
345 | |||
346 | /** | ||
347 | * Absolute time expected | ||
348 | * | ||
349 | * @param name name of the field in the table | ||
350 | * @param[out] at where to store the result | ||
351 | * @return array entry for the result specification to use | ||
352 | */ | ||
353 | struct GNUNET_MY_ResultSpec | ||
354 | GNUNET_MY_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at); | ||
355 | |||
356 | /** | ||
357 | * Absolute time in network byte order expected | ||
358 | * | ||
359 | * @param[out] at where to store the result | ||
360 | * @return array entry for the result specification to use | ||
361 | */ | ||
362 | struct GNUNET_MY_ResultSpec | ||
363 | GNUNET_MY_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at); | ||
364 | |||
365 | /** | ||
366 | * uint16_t expected | ||
367 | * | ||
368 | * @param[out] u16 where to store the result | ||
369 | * @return array entry for the result specification to use | ||
370 | */ | ||
371 | struct GNUNET_MY_ResultSpec | ||
372 | GNUNET_MY_result_spec_uint16 (uint16_t *u16); | ||
373 | |||
374 | /** | ||
375 | * uint32_t expected | ||
376 | * | ||
377 | * @param[out] u32 where to store the result | ||
378 | * @return array entry for the result specification to use | ||
379 | */ | ||
380 | struct GNUNET_MY_ResultSpec | ||
381 | GNUNET_MY_result_spec_uint32 (uint32_t *u32); | ||
382 | |||
383 | /** | ||
384 | * uint64_t expected. | ||
385 | * | ||
386 | * @param[out] u64 where to store the result | ||
387 | * @return array entry for the result specification to use | ||
388 | */ | ||
389 | struct GNUNET_MY_ResultSpec | ||
390 | GNUNET_MY_result_spec_uint64 (uint64_t *u64); | ||
391 | |||
306 | int | 392 | int |
307 | GNUNET_MY_extract_result (MYSQL_BIND * result, | 393 | GNUNET_MY_extract_result (MYSQL_BIND * result, |
308 | struct GNUNET_MY_QueryParam *qp, | 394 | struct GNUNET_MY_QueryParam *qp, |