3 This file is part of GNUnet
4 Copyright (C) 2017 GNUnet e.V.
6 GNUnet is free software; you can redistribute it and/or modify it under the
7 terms of the GNU General Public License as published by the Free Software
8 Foundation; either version 3, or (at your option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY
11 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License along with
15 GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
18 * @file sq/sq_result_helper.c
19 * @brief helper functions for queries
20 * @author Christian Grothoff
23 #include "gnunet_sq_lib.h"
27 * Variable-size result expected.
29 * @param[out] dst where to store the result, allocated
30 * @param[out] sptr where to store the size of @a dst
31 * @return array entry for the result specification to use
33 struct GNUNET_SQ_ResultSpec
34 GNUNET_SQ_result_spec_variable_size (void **dst,
41 * Fixed-size result expected.
43 * @param[out] dst where to store the result
44 * @param dst_size number of bytes in @a dst
45 * @return array entry for the result specification to use
47 struct GNUNET_SQ_ResultSpec
48 GNUNET_SQ_result_spec_fixed_size (void *dst,
55 * Variable-size result expected.
57 * @param[out] dst where to store the result, allocated
58 * @param[out] sptr where to store the size of @a dst
59 * @return array entry for the result specification to use
61 struct GNUNET_SQ_ResultSpec
62 GNUNET_SQ_result_spec_variable_size (void **dst,
69 * 0-terminated string expected.
71 * @param[out] dst where to store the result, allocated
72 * @return array entry for the result specification to use
74 struct GNUNET_SQ_ResultSpec
75 GNUNET_SQ_result_spec_string (char **dst)
81 * RSA public key expected.
83 * @param[out] rsa where to store the result
84 * @return array entry for the result specification to use
86 struct GNUNET_SQ_ResultSpec
87 GNUNET_SQ_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa)
93 * RSA signature expected.
95 * @param[out] sig where to store the result;
96 * @return array entry for the result specification to use
98 struct GNUNET_SQ_ResultSpec
99 GNUNET_SQ_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig)
105 * Absolute time expected.
107 * @param[out] at where to store the result
108 * @return array entry for the result specification to use
110 struct GNUNET_SQ_ResultSpec
111 GNUNET_SQ_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at)
117 * Absolute time expected.
119 * @param[out] at where to store the result
120 * @return array entry for the result specification to use
122 struct GNUNET_SQ_ResultSpec
123 GNUNET_SQ_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at)
131 * @param[out] u16 where to store the result
132 * @return array entry for the result specification to use
134 struct GNUNET_SQ_ResultSpec
135 GNUNET_SQ_result_spec_uint16 (uint16_t *u16)
143 * @param[out] u32 where to store the result
144 * @return array entry for the result specification to use
146 struct GNUNET_SQ_ResultSpec
147 GNUNET_SQ_result_spec_uint32 (uint32_t *u32)
155 * @param[out] u64 where to store the result
156 * @return array entry for the result specification to use
158 struct GNUNET_SQ_ResultSpec
159 GNUNET_SQ_result_spec_uint64 (uint64_t *u64)
164 /* end of sq_result_helper.c */