GNUnet  0.11.x
Functions
pq_query_helper.c File Reference

functions to initialize parameter arrays More...

#include "platform.h"
#include "gnunet_util_lib.h"
#include "gnunet_pq_lib.h"
Include dependency graph for pq_query_helper.c:

Go to the source code of this file.

Functions

static int qconv_fixed (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_fixed_size (const void *ptr, size_t ptr_size)
 Generate query parameter for a buffer ptr of ptr_size bytes. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_string (const char *ptr)
 Generate query parameter for a string. More...
 
static int qconv_uint16 (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint16 (const uint16_t *x)
 Generate query parameter for an uint16_t in host byte order. More...
 
static int qconv_uint32 (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint32 (const uint32_t *x)
 Generate query parameter for an uint32_t in host byte order. More...
 
static int qconv_uint64 (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint64 (const uint64_t *x)
 Generate query parameter for an uint64_t in host byte order. More...
 
static int qconv_rsa_public_key (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x)
 Generate query parameter for an RSA public key. More...
 
static int qconv_rsa_signature (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x)
 Generate query parameter for an RSA signature. More...
 
static int qconv_abs_time (void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
 Function called to convert input argument into SQL parameters. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x)
 Generate query parameter for an absolute time value. More...
 
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x)
 Generate query parameter for an absolute time value. More...
 

Detailed Description

functions to initialize parameter arrays

Author
Christian Grothoff

Definition in file pq_query_helper.c.

Function Documentation

◆ qconv_fixed()

static int qconv_fixed ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 45 of file pq_query_helper.c.

References GNUNET_break.

Referenced by GNUNET_PQ_query_param_fixed_size().

54 {
55  (void) scratch;
56  (void) scratch_length;
57  GNUNET_break (NULL == cls);
58  if (1 != param_length)
59  return -1;
60  param_values[0] = (void *) data;
61  param_lengths[0] = data_len;
62  param_formats[0] = 1;
63  return 0;
64 }
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint32_t data
The data value.
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_fixed_size()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_fixed_size ( const void *  ptr,
size_t  ptr_size 
)

Generate query parameter for a buffer ptr of ptr_size bytes.

Parameters
ptrpointer to the query parameter to pass ptr_size number of bytes in ptr

Definition at line 75 of file pq_query_helper.c.

References qconv_fixed(), and res.

Referenced by GNUNET_PQ_query_param_string(), namecache_postgres_cache_block(), namestore_postgres_store_records(), postgres_plugin_put(), and postgres_plugin_remove_key().

77 {
78  struct GNUNET_PQ_QueryParam res =
79  { &qconv_fixed, NULL, ptr, ptr_size, 1 };
80 
81  return res;
82 }
static int qconv_fixed(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_string()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_string ( const char *  ptr)

Generate query parameter for a string.

Parameters
ptrpointer to the string query parameter to pass

Definition at line 91 of file pq_query_helper.c.

References GNUNET_PQ_query_param_fixed_size().

Referenced by namestore_postgres_lookup_records(), and namestore_postgres_store_records().

92 {
93  return GNUNET_PQ_query_param_fixed_size (ptr, strlen (ptr));
94 }
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_fixed_size(const void *ptr, size_t ptr_size)
Generate query parameter for a buffer ptr of ptr_size bytes.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ qconv_uint16()

static int qconv_uint16 ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 112 of file pq_query_helper.c.

References data, GNUNET_break, and GNUNET_new.

Referenced by GNUNET_PQ_query_param_uint16().

121 {
122  const uint16_t *u_hbo = data;
123  uint16_t *u_nbo;
124 
125  (void) scratch;
126  (void) scratch_length;
127  GNUNET_break (NULL == cls);
128  if (1 != param_length)
129  return -1;
130  u_nbo = GNUNET_new (uint16_t);
131  scratch[0] = u_nbo;
132  *u_nbo = htons (*u_hbo);
133  param_values[0] = (void *) u_nbo;
134  param_lengths[0] = sizeof(uint16_t);
135  param_formats[0] = 1;
136  return 1;
137 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint32_t data
The data value.
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_uint16()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint16 ( const uint16_t *  x)

Generate query parameter for an uint16_t in host byte order.

Parameters
xpointer to the query parameter to pass

Definition at line 146 of file pq_query_helper.c.

References qconv_uint16(), and res.

Referenced by postgres_plugin_get_key().

147 {
148  struct GNUNET_PQ_QueryParam res =
149  { &qconv_uint16, NULL, x, sizeof(*x), 1 };
150 
151  return res;
152 }
static int qconv_uint16(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
Here is the call graph for this function:
Here is the caller graph for this function:

◆ qconv_uint32()

static int qconv_uint32 ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 170 of file pq_query_helper.c.

References data, GNUNET_break, and GNUNET_new.

Referenced by GNUNET_PQ_query_param_uint32().

179 {
180  const uint32_t *u_hbo = data;
181  uint32_t *u_nbo;
182 
183  (void) scratch;
184  (void) scratch_length;
185  GNUNET_break (NULL == cls);
186  if (1 != param_length)
187  return -1;
188  u_nbo = GNUNET_new (uint32_t);
189  scratch[0] = u_nbo;
190  *u_nbo = htonl (*u_hbo);
191  param_values[0] = (void *) u_nbo;
192  param_lengths[0] = sizeof(uint32_t);
193  param_formats[0] = 1;
194  return 1;
195 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint32_t data
The data value.
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_uint32()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint32 ( const uint32_t *  x)

Generate query parameter for an uint32_t in host byte order.

Parameters
xpointer to the query parameter to pass

Definition at line 204 of file pq_query_helper.c.

References qconv_uint32(), and res.

Referenced by namestore_postgres_store_records(), postgres_plugin_del(), postgres_plugin_get(), postgres_plugin_get_closest(), postgres_plugin_get_key(), postgres_plugin_get_random(), postgres_plugin_get_zero_anonymity(), postgres_plugin_put(), process_result(), and repl_proc().

205 {
206  struct GNUNET_PQ_QueryParam res =
207  { &qconv_uint32, NULL, x, sizeof(*x), 1 };
208 
209  return res;
210 }
static int qconv_uint32(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
Here is the call graph for this function:
Here is the caller graph for this function:

◆ qconv_uint64()

static int qconv_uint64 ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 228 of file pq_query_helper.c.

References data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.

Referenced by GNUNET_PQ_query_param_uint64().

237 {
238  const uint64_t *u_hbo = data;
239  uint64_t *u_nbo;
240 
241  (void) scratch;
242  (void) scratch_length;
243  GNUNET_break (NULL == cls);
244  if (1 != param_length)
245  return -1;
246  u_nbo = GNUNET_new (uint64_t);
247  scratch[0] = u_nbo;
248  *u_nbo = GNUNET_htonll (*u_hbo);
249  param_values[0] = (void *) u_nbo;
250  param_lengths[0] = sizeof(uint64_t);
251  param_formats[0] = 1;
252  return 1;
253 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Definition: common_endian.c:35
uint32_t data
The data value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_uint64()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint64 ( const uint64_t *  x)

Generate query parameter for an uint64_t in host byte order.

Generate query parameter for an uint16_t in host byte order.

Parameters
xpointer to the query parameter to pass

Definition at line 262 of file pq_query_helper.c.

References qconv_uint64(), and res.

Referenced by namestore_postgres_iterate_records(), namestore_postgres_store_records(), postgres_plugin_get_key(), postgres_plugin_get_zero_anonymity(), and postgres_plugin_put().

263 {
264  struct GNUNET_PQ_QueryParam res =
265  { &qconv_uint64, NULL, x, sizeof(*x), 1 };
266 
267  return res;
268 }
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
static int qconv_uint64(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ qconv_rsa_public_key()

static int qconv_rsa_public_key ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 286 of file pq_query_helper.c.

References buf, data, GNUNET_break, and GNUNET_CRYPTO_rsa_public_key_encode().

Referenced by GNUNET_PQ_query_param_rsa_public_key().

295 {
296  const struct GNUNET_CRYPTO_RsaPublicKey *rsa = data;
297  char *buf;
298  size_t buf_size;
299 
300  GNUNET_break (NULL == cls);
301  if (1 != param_length)
302  return -1;
303  buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa,
304  &buf);
305  scratch[0] = buf;
306  param_values[0] = (void *) buf;
307  param_lengths[0] = buf_size - 1; /* DB doesn't like the trailing \0 */
308  param_formats[0] = 1;
309  return 1;
310 }
size_t GNUNET_CRYPTO_rsa_public_key_encode(const struct GNUNET_CRYPTO_RsaPublicKey *key, char **buffer)
Encode the public key in a format suitable for storing it into a file.
Definition: crypto_rsa.c:348
The public information of an RSA key pair.
Definition: crypto_rsa.c:53
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static char buf[2048]
uint32_t data
The data value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_rsa_public_key()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_rsa_public_key ( const struct GNUNET_CRYPTO_RsaPublicKey x)

Generate query parameter for an RSA public key.

The database must contain a BLOB type in the respective position.

Parameters
xthe query parameter to pass
Returns
array entry for the query parameters to use

Definition at line 321 of file pq_query_helper.c.

References qconv_rsa_public_key(), and res.

323 {
324  struct GNUNET_PQ_QueryParam res =
325  { &qconv_rsa_public_key, NULL, (x), 0, 1 };
326 
327  return res;
328 }
static int qconv_rsa_public_key(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
Here is the call graph for this function:

◆ qconv_rsa_signature()

static int qconv_rsa_signature ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 346 of file pq_query_helper.c.

References buf, data, GNUNET_break, and GNUNET_CRYPTO_rsa_signature_encode().

Referenced by GNUNET_PQ_query_param_rsa_signature().

355 {
356  const struct GNUNET_CRYPTO_RsaSignature *sig = data;
357  char *buf;
358  size_t buf_size;
359 
360  GNUNET_break (NULL == cls);
361  if (1 != param_length)
362  return -1;
363  buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig,
364  &buf);
365  scratch[0] = buf;
366  param_values[0] = (void *) buf;
367  param_lengths[0] = buf_size - 1; /* DB doesn't like the trailing \0 */
368  param_formats[0] = 1;
369  return 1;
370 }
an RSA signature
Definition: crypto_rsa.c:65
size_t GNUNET_CRYPTO_rsa_signature_encode(const struct GNUNET_CRYPTO_RsaSignature *sig, char **buffer)
Encode the given signature in a format suitable for storing it into a file.
Definition: crypto_rsa.c:1127
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
static char buf[2048]
uint32_t data
The data value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_rsa_signature()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_rsa_signature ( const struct GNUNET_CRYPTO_RsaSignature x)

Generate query parameter for an RSA signature.

The database must contain a BLOB type in the respective position.

Parameters
xthe query parameter to pass
Returns
array entry for the query parameters to use

Definition at line 381 of file pq_query_helper.c.

References qconv_rsa_signature(), and res.

382 {
383  struct GNUNET_PQ_QueryParam res =
384  { &qconv_rsa_signature, NULL, (x), 0, 1 };
385 
386  return res;
387 }
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
static int qconv_rsa_signature(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
Here is the call graph for this function:

◆ qconv_abs_time()

static int qconv_abs_time ( void *  cls,
const void *  data,
size_t  data_len,
void *  param_values[],
int  param_lengths[],
int  param_formats[],
unsigned int  param_length,
void *  scratch[],
unsigned int  scratch_length 
)
static

Function called to convert input argument into SQL parameters.

Parameters
clsclosure
datapointer to input argument
data_lennumber of bytes in data (if applicable)
[out]param_valuesSQL data to set
[out]param_lengthsSQL length data to set
[out]param_formatsSQL format data to set
param_lengthnumber of entries available in the param_values, param_lengths and param_formats arrays
[out]scratchbuffer for dynamic allocations (to be done via GNUNET_malloc()
scratch_lengthnumber of entries left in scratch
Returns
-1 on error, number of offsets used in scratch otherwise

Definition at line 405 of file pq_query_helper.c.

References GNUNET_TIME_Absolute::abs_value_us, data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.

Referenced by GNUNET_PQ_query_param_absolute_time().

414 {
415  const struct GNUNET_TIME_Absolute *u = data;
416  struct GNUNET_TIME_Absolute abs;
417  uint64_t *u_nbo;
418 
419  GNUNET_break (NULL == cls);
420  if (1 != param_length)
421  return -1;
422  abs = *u;
423  if (abs.abs_value_us > INT64_MAX)
424  abs.abs_value_us = INT64_MAX;
425  u_nbo = GNUNET_new (uint64_t);
426  scratch[0] = u_nbo;
427  *u_nbo = GNUNET_htonll (abs.abs_value_us);
428  param_values[0] = (void *) u_nbo;
429  param_lengths[0] = sizeof(uint64_t);
430  param_formats[0] = 1;
431  return 1;
432 }
#define GNUNET_new(type)
Allocate a struct or union of the given type.
uint64_t abs_value_us
The actual value.
#define GNUNET_break(cond)
Use this for internal assertion violations that are not fatal (can be handled) but should not occur...
uint64_t GNUNET_htonll(uint64_t n)
Convert unsigned 64-bit integer to network byte order.
Definition: common_endian.c:35
Time for absolute times used by GNUnet, in microseconds.
uint32_t data
The data value.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_absolute_time()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_absolute_time ( const struct GNUNET_TIME_Absolute x)

Generate query parameter for an absolute time value.

The database must store a 64-bit integer.

Parameters
xpointer to the query parameter to pass
Returns
array entry for the query parameters to use

Definition at line 443 of file pq_query_helper.c.

References qconv_abs_time(), and res.

Referenced by namecache_postgres_expire_blocks(), postgres_plugin_del(), postgres_plugin_get(), postgres_plugin_get_closest(), postgres_plugin_get_expiration(), postgres_plugin_get_random(), and postgres_plugin_put().

444 {
445  struct GNUNET_PQ_QueryParam res =
446  { &qconv_abs_time, NULL, x, sizeof(*x), 1 };
447 
448  return res;
449 }
static int qconv_abs_time(void *cls, const void *data, size_t data_len, void *param_values[], int param_lengths[], int param_formats[], unsigned int param_length, void *scratch[], unsigned int scratch_length)
Function called to convert input argument into SQL parameters.
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:64
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GNUNET_PQ_query_param_absolute_time_nbo()

struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_absolute_time_nbo ( const struct GNUNET_TIME_AbsoluteNBO x)

Generate query parameter for an absolute time value.

The database must store a 64-bit integer.

Parameters
xpointer to the query parameter to pass

Definition at line 459 of file pq_query_helper.c.

References GNUNET_PQ_query_param_auto_from_type.

Referenced by delete_old_block(), and namecache_postgres_cache_block().

461 {
463 }
#define GNUNET_PQ_query_param_auto_from_type(x)
Generate fixed-size query parameter with size determined by variable type.
uint64_t abs_value_us__
The actual value (in network byte order).
Here is the caller graph for this function: