summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-04-03 19:35:52 +0000
committerChristian Grothoff <christian@grothoff.org>2016-04-03 19:35:52 +0000
commite0f650cbf41490b3f58476f0696783058798c63d (patch)
treeb50992e3256e921a2333cc9f864290890760efb1 /src
parentaaad91acd22b6204c97690a032e5c623f57376cc (diff)
downloadgnunet-e0f650cbf41490b3f58476f0696783058798c63d.tar.gz
gnunet-e0f650cbf41490b3f58476f0696783058798c63d.zip
add function for string parameters
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_pq_lib.h10
-rw-r--r--src/pq/pq_query_helper.c14
2 files changed, 23 insertions, 1 deletions
diff --git a/src/include/gnunet_pq_lib.h b/src/include/gnunet_pq_lib.h
index 39c288f5a..8483b72cf 100644
--- a/src/include/gnunet_pq_lib.h
+++ b/src/include/gnunet_pq_lib.h
@@ -102,6 +102,16 @@ GNUNET_PQ_query_param_fixed_size (const void *ptr,
102 size_t ptr_size); 102 size_t ptr_size);
103 103
104 104
105
106/**
107 * Generate query parameter for a string.
108 *
109 * @param ptr pointer to the string query parameter to pass
110 */
111struct GNUNET_PQ_QueryParam
112GNUNET_PQ_query_param_string (const char *ptr);
113
114
105/** 115/**
106 * Generate fixed-size query parameter with size determined 116 * Generate fixed-size query parameter with size determined
107 * by variable type. 117 * by variable type.
diff --git a/src/pq/pq_query_helper.c b/src/pq/pq_query_helper.c
index d284822c2..d80a3d99a 100644
--- a/src/pq/pq_query_helper.c
+++ b/src/pq/pq_query_helper.c
@@ -76,6 +76,18 @@ GNUNET_PQ_query_param_fixed_size (const void *ptr,
76 76
77 77
78/** 78/**
79 * Generate query parameter for a string.
80 *
81 * @param ptr pointer to the string query parameter to pass
82 */
83struct GNUNET_PQ_QueryParam
84GNUNET_PQ_query_param_string (const char *ptr)
85{
86 return GNUNET_PQ_query_param_fixed_size (ptr, strlen (ptr));
87}
88
89
90/**
79 * Function called to convert input argument into SQL parameters. 91 * Function called to convert input argument into SQL parameters.
80 * 92 *
81 * @param cls closure 93 * @param cls closure
@@ -254,7 +266,7 @@ GNUNET_PQ_query_param_uint64 (const uint64_t *x)
254 * @param scratch_length number of entries left in @a scratch 266 * @param scratch_length number of entries left in @a scratch
255 * @return -1 on error, number of offsets used in @a scratch otherwise 267 * @return -1 on error, number of offsets used in @a scratch otherwise
256 */ 268 */
257static int 269static int
258qconv_rsa_public_key (void *cls, 270qconv_rsa_public_key (void *cls,
259 const void *data, 271 const void *data,
260 size_t data_len, 272 size_t data_len,