GNUnet  0.10.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  return res;
81 }
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:63
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 90 of file pq_query_helper.c.

References GNUNET_PQ_query_param_fixed_size().

Referenced by namestore_postgres_lookup_records(), and namestore_postgres_store_records().

91 {
92  return GNUNET_PQ_query_param_fixed_size (ptr, strlen (ptr));
93 }
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 111 of file pq_query_helper.c.

References data, GNUNET_break, and GNUNET_new.

Referenced by GNUNET_PQ_query_param_uint16().

120 {
121  const uint16_t *u_hbo = data;
122  uint16_t *u_nbo;
123 
124  (void) scratch;
125  (void) scratch_length;
126  GNUNET_break (NULL == cls);
127  if (1 != param_length)
128  return -1;
129  u_nbo = GNUNET_new (uint16_t);
130  scratch[0] = u_nbo;
131  *u_nbo = htons (*u_hbo);
132  param_values[0] = (void *) u_nbo;
133  param_lengths[0] = sizeof (uint16_t);
134  param_formats[0] = 1;
135  return 1;
136 }
#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 145 of file pq_query_helper.c.

References qconv_uint16(), and res.

Referenced by postgres_plugin_get_key().

146 {
147  struct GNUNET_PQ_QueryParam res =
148  { &qconv_uint16, NULL, x, sizeof (*x), 1 };
149  return res;
150 }
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:63
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 168 of file pq_query_helper.c.

References data, GNUNET_break, and GNUNET_new.

Referenced by GNUNET_PQ_query_param_uint32().

177 {
178  const uint32_t *u_hbo = data;
179  uint32_t *u_nbo;
180 
181  (void) scratch;
182  (void) scratch_length;
183  GNUNET_break (NULL == cls);
184  if (1 != param_length)
185  return -1;
186  u_nbo = GNUNET_new (uint32_t);
187  scratch[0] = u_nbo;
188  *u_nbo = htonl (*u_hbo);
189  param_values[0] = (void *) u_nbo;
190  param_lengths[0] = sizeof (uint32_t);
191  param_formats[0] = 1;
192  return 1;
193 }
#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 202 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().

203 {
204  struct GNUNET_PQ_QueryParam res =
205  { &qconv_uint32, NULL, x, sizeof (*x), 1 };
206  return res;
207 }
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:63
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 225 of file pq_query_helper.c.

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

Referenced by GNUNET_PQ_query_param_uint64().

234 {
235  const uint64_t *u_hbo = data;
236  uint64_t *u_nbo;
237 
238  (void) scratch;
239  (void) scratch_length;
240  GNUNET_break (NULL == cls);
241  if (1 != param_length)
242  return -1;
243  u_nbo = GNUNET_new (uint64_t);
244  scratch[0] = u_nbo;
245  *u_nbo = GNUNET_htonll (*u_hbo);
246  param_values[0] = (void *) u_nbo;
247  param_lengths[0] = sizeof (uint64_t);
248  param_formats[0] = 1;
249  return 1;
250 }
#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 259 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().

260 {
261  struct GNUNET_PQ_QueryParam res =
262  { &qconv_uint64, NULL, x, sizeof (*x), 1 };
263  return res;
264 }
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:63
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 282 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().

291 {
292  const struct GNUNET_CRYPTO_RsaPublicKey *rsa = data;
293  char *buf;
294  size_t buf_size;
295 
296  GNUNET_break (NULL == cls);
297  if (1 != param_length)
298  return -1;
299  buf_size = GNUNET_CRYPTO_rsa_public_key_encode (rsa,
300  &buf);
301  scratch[0] = buf;
302  param_values[0] = (void *) buf;
303  param_lengths[0] = buf_size - 1; /* DB doesn't like the trailing \0 */
304  param_formats[0] = 1;
305  return 1;
306 }
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:318
The public information of an RSA key pair.
Definition: crypto_rsa.c:51
#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 317 of file pq_query_helper.c.

References qconv_rsa_public_key(), and res.

318 {
319  struct GNUNET_PQ_QueryParam res =
320  { &qconv_rsa_public_key, NULL, (x), 0, 1 };
321  return res;
322 }
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:63
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 340 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().

349 {
350  const struct GNUNET_CRYPTO_RsaSignature *sig = data;
351  char *buf;
352  size_t buf_size;
353 
354  GNUNET_break (NULL == cls);
355  if (1 != param_length)
356  return -1;
357  buf_size = GNUNET_CRYPTO_rsa_signature_encode (sig,
358  &buf);
359  scratch[0] = buf;
360  param_values[0] = (void *) buf;
361  param_lengths[0] = buf_size - 1; /* DB doesn't like the trailing \0 */
362  param_formats[0] = 1;
363  return 1;
364 }
an RSA signature
Definition: crypto_rsa.c:63
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:966
#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 375 of file pq_query_helper.c.

References qconv_rsa_signature(), and res.

376 {
377  struct GNUNET_PQ_QueryParam res =
378  { &qconv_rsa_signature, NULL, (x), 0, 1 };
379  return res;
380 }
static int res
Description of a DB query parameter.
Definition: gnunet_pq_lib.h:63
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 398 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().

407 {
408  const struct GNUNET_TIME_Absolute *u = data;
409  struct GNUNET_TIME_Absolute abs;
410  uint64_t *u_nbo;
411 
412  GNUNET_break (NULL == cls);
413  if (1 != param_length)
414  return -1;
415  abs = *u;
416  if (abs.abs_value_us > INT64_MAX)
417  abs.abs_value_us = INT64_MAX;
418  u_nbo = GNUNET_new (uint64_t);
419  scratch[0] = u_nbo;
420  *u_nbo = GNUNET_htonll (abs.abs_value_us);
421  param_values[0] = (void *) u_nbo;
422  param_lengths[0] = sizeof (uint64_t);
423  param_formats[0] = 1;
424  return 1;
425 }
#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 436 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().

437 {
438  struct GNUNET_PQ_QueryParam res =
439  { &qconv_abs_time, NULL, x, sizeof (*x), 1 };
440 
441  return res;
442 }
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:63
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 452 of file pq_query_helper.c.

References GNUNET_PQ_query_param_auto_from_type.

Referenced by delete_old_block(), and namecache_postgres_cache_block().

453 {
455 }
#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: