2 This file is part of GNUnet
3 Copyright (C) 2017 GNUnet e.V.
5 GNUnet is free software; you can redistribute it and/or modify it under the
6 terms of the GNU General Public License as published by the Free Software
7 Foundation; either version 3, or (at your option) any later version.
9 GNUnet is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License along with
14 GNUnet; see the file COPYING. If not, If not, see <http://www.gnu.org/licenses/>
17 * @file sq/sq_query_helper.c
18 * @brief helper functions for queries
19 * @author Christian Grothoff
21 #include "gnunet_sq_lib.h"
25 * Generate query parameter for a buffer @a ptr of
28 * @param ptr pointer to the query parameter to pass
29 * @oaran ptr_size number of bytes in @a ptr
31 struct GNUNET_SQ_QueryParam
32 GNUNET_SQ_query_param_fixed_size (const void *ptr,
39 * Generate query parameter for a string.
41 * @param ptr pointer to the string query parameter to pass
43 struct GNUNET_SQ_QueryParam
44 GNUNET_SQ_query_param_string (const char *ptr)
50 * Generate query parameter for an RSA public key. The
51 * database must contain a BLOB type in the respective position.
53 * @param x the query parameter to pass.
55 struct GNUNET_SQ_QueryParam
56 GNUNET_SQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x)
62 * Generate query parameter for an RSA signature. The
63 * database must contain a BLOB type in the respective position.
65 * @param x the query parameter to pass
67 struct GNUNET_SQ_QueryParam
68 GNUNET_SQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x)
74 * Generate query parameter for an absolute time value.
75 * The database must store a 64-bit integer.
77 * @param x pointer to the query parameter to pass
79 struct GNUNET_SQ_QueryParam
80 GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x)
86 * Generate query parameter for an absolute time value.
87 * The database must store a 64-bit integer.
89 * @param x pointer to the query parameter to pass
91 struct GNUNET_SQ_QueryParam
92 GNUNET_SQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x)
98 * Generate query parameter for an uint16_t in host byte order.
100 * @param x pointer to the query parameter to pass
102 struct GNUNET_SQ_QueryParam
103 GNUNET_SQ_query_param_uint16 (const uint16_t *x)
109 * Generate query parameter for an uint32_t in host byte order.
111 * @param x pointer to the query parameter to pass
113 struct GNUNET_SQ_QueryParam
114 GNUNET_SQ_query_param_uint32 (const uint32_t *x)
120 * Generate query parameter for an uint16_t in host byte order.
122 * @param x pointer to the query parameter to pass
124 struct GNUNET_SQ_QueryParam
125 GNUNET_SQ_query_param_uint64 (const uint64_t *x)
129 /* end of sq_query_helper.c */