implement sq_query_helper.c
[oweals/gnunet.git] / src / sq / sq_result_helper.c
1
2 /*
3   This file is part of GNUnet
4   Copyright (C) 2017 GNUnet e.V.
5
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.
9
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.
13
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/>
16 */
17 /**
18  * @file sq/sq_result_helper.c
19  * @brief helper functions for queries
20  * @author Christian Grothoff
21  */
22 #include "platform.h"
23 #include "gnunet_sq_lib.h"
24
25
26 /**
27  * Extract fixed-sized binary data from a Postgres database @a result at row @a row.
28  *
29  * @param cls closure
30  * @param result where to extract data from
31  * @param row row to extract data from
32  * @param column column to extract data from
33  * @param[in,out] dst_size where to store size of result, may be NULL
34  * @param[out] dst where to store the result
35  * @return
36  *   #GNUNET_YES if all results could be extracted
37  *   #GNUNET_SYSERR if a result was invalid (non-existing field or NULL)
38  */
39 static int
40 extract_fixed_blob (void *cls,
41                     sqlite3_stmt *result,
42                     int row,
43                     unsigned int column,
44                     size_t *dst_size,
45                     void *dst)
46 {
47 }
48
49
50 /**
51  * Variable-size result expected.
52  *
53  * @param[out] dst where to store the result, allocated
54  * @param[out] sptr where to store the size of @a dst
55  * @return array entry for the result specification to use
56  */
57 struct GNUNET_SQ_ResultSpec
58 GNUNET_SQ_result_spec_variable_size (void **dst,
59                                      size_t *sptr)
60 {
61 }
62
63
64 /**
65  * Fixed-size result expected.
66  *
67  * @param[out] dst where to store the result
68  * @param dst_size number of bytes in @a dst
69  * @return array entry for the result specification to use
70  */
71 struct GNUNET_SQ_ResultSpec
72 GNUNET_SQ_result_spec_fixed_size (void *dst,
73                                   size_t dst_size)
74 {
75 }
76
77
78 /**
79  * 0-terminated string expected.
80  *
81  * @param[out] dst where to store the result, allocated
82  * @return array entry for the result specification to use
83  */
84 struct GNUNET_SQ_ResultSpec
85 GNUNET_SQ_result_spec_string (char **dst)
86 {
87 }
88
89
90 /**
91  * RSA public key expected.
92  *
93  * @param[out] rsa where to store the result
94  * @return array entry for the result specification to use
95  */
96 struct GNUNET_SQ_ResultSpec
97 GNUNET_SQ_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa)
98 {
99 }
100
101
102 /**
103  * RSA signature expected.
104  *
105  * @param[out] sig where to store the result;
106  * @return array entry for the result specification to use
107  */
108 struct GNUNET_SQ_ResultSpec
109 GNUNET_SQ_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig)
110 {
111 }
112
113
114 /**
115  * Absolute time expected.
116  *
117  * @param[out] at where to store the result
118  * @return array entry for the result specification to use
119  */
120 struct GNUNET_SQ_ResultSpec
121 GNUNET_SQ_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at)
122 {
123 }
124
125
126 /**
127  * Absolute time expected.
128  *
129  * @param[out] at where to store the result
130  * @return array entry for the result specification to use
131  */
132 struct GNUNET_SQ_ResultSpec
133 GNUNET_SQ_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at)
134 {
135 }
136
137
138 /**
139  * uint16_t expected.
140  *
141  * @param[out] u16 where to store the result
142  * @return array entry for the result specification to use
143  */
144 struct GNUNET_SQ_ResultSpec
145 GNUNET_SQ_result_spec_uint16 (uint16_t *u16)
146 {
147 }
148
149
150 /**
151  * uint32_t expected.
152  *
153  * @param[out] u32 where to store the result
154  * @return array entry for the result specification to use
155  */
156 struct GNUNET_SQ_ResultSpec
157 GNUNET_SQ_result_spec_uint32 (uint32_t *u32)
158 {
159 }
160
161
162 /**
163  * uint64_t expected.
164  *
165  * @param[out] u64 where to store the result
166  * @return array entry for the result specification to use
167  */
168 struct GNUNET_SQ_ResultSpec
169 GNUNET_SQ_result_spec_uint64 (uint64_t *u64)
170 {
171 }
172
173
174 /* end of sq_result_helper.c */