aboutsummaryrefslogtreecommitdiff
path: root/src/my/my_query_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/my/my_query_helper.c')
-rw-r--r--src/my/my_query_helper.c40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/my/my_query_helper.c b/src/my/my_query_helper.c
index 17ade5a927..b2a893a44c 100644
--- a/src/my/my_query_helper.c
+++ b/src/my/my_query_helper.c
@@ -2,20 +2,18 @@
This file is part of GNUnet
Copyright (C) 2016 GNUnet e.V.
- GNUnet is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
+ GNUnet is free software: you can redistribute it and/or modify it
+ under the terms of the GNU Affero General Public License as published
+ by the Free Software Foundation, either version 3 of the License,
+ or (at your option) any later version.
GNUnet is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* @file my/my_query_helper.c
@@ -39,6 +37,7 @@ static void
my_clean_query (void *cls,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_free (qbind[0].buffer);
}
@@ -56,6 +55,7 @@ my_conv_fixed_size (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = qp->data_len;
@@ -101,12 +101,11 @@ my_conv_string (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
-
qbind->buffer = (void *) qp->data;
qbind->buffer_length = qp->data_len;
qbind->buffer_type = MYSQL_TYPE_STRING;
-
return 1;
}
@@ -144,10 +143,12 @@ my_conv_uint16 (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = sizeof (uint16_t);
qbind->buffer_type = MYSQL_TYPE_SHORT;
+ qbind->is_unsigned = 1;
return 1;
}
@@ -186,11 +187,12 @@ my_conv_uint32 (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND *qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = sizeof(uint32_t);
qbind->buffer_type = MYSQL_TYPE_LONG;
-
+ qbind->is_unsigned = 1;
return 1;
}
@@ -229,10 +231,12 @@ my_conv_uint64 (void *cls,
const struct GNUNET_MY_QueryParam *qp,
MYSQL_BIND * qbind)
{
+ (void) cls;
GNUNET_assert (1 == qp->num_params);
qbind->buffer = (void *) qp->data;
qbind->buffer_length = sizeof (uint64_t);
qbind->buffer_type = MYSQL_TYPE_LONGLONG;
+ qbind->is_unsigned = 1;
return 1;
}
@@ -275,14 +279,13 @@ my_conv_rsa_public_key (void *cls,
char *buf;
size_t buf_size;
+ (void) cls;
GNUNET_assert(1 == qp->num_params);
-
- buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa, &buf);
-
+ buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa,
+ &buf);
qbind->buffer = (void *) buf;
qbind->buffer_length = buf_size;
qbind->buffer_type = MYSQL_TYPE_BLOB;
-
return 1;
}
@@ -327,14 +330,13 @@ my_conv_rsa_signature (void *cls,
char *buf;
size_t buf_size;
+ (void) cls;
GNUNET_assert(1 == qp->num_params);
-
buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig,
&buf);
qbind->buffer = (void *) buf;
qbind->buffer_length = buf_size;
qbind->buffer_type = MYSQL_TYPE_BLOB;
-
return 1;
}