functions to initialize parameter arrays More...
#include "platform.h"
#include "gnunet_common.h"
#include "gnunet_pq_lib.h"
#include "gnunet_time_lib.h"
#include "pq.h"
Go to the source code of this file.
Data Structures | |
struct | qconv_array_cls |
Closure for the array type handlers. More... | |
Macros | |
#define | RETURN_UNLESS(cond) |
Functions | |
static int | qconv_null (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_null (void) |
Generate query parameter to create a NULL value. More... | |
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... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_bool (bool b) |
Pass a boolean into a query. 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 uint16_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_rel_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_relative_time (const struct GNUNET_TIME_Relative *x) |
Generate query parameter for a relative time value. 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... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_timestamp (const struct GNUNET_TIME_Timestamp *x) |
Generate query parameter for a timestamp. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_timestamp_nbo (const struct GNUNET_TIME_TimestampNBO *x) |
Generate query parameter for a timestamp in NBO. More... | |
static void | qconv_array_cls_cleanup (void *cls) |
Callback to cleanup a qconv_array_cls to be used during GNUNET_PQ_cleanup_query_params_closures. More... | |
static int | qconv_array (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 for arrays. More... | |
static struct GNUNET_PQ_QueryParam | query_param_array_generic (unsigned int num, bool continuous, const void *elements, const size_t *sizes, size_t same_size, enum array_types typ, Oid oid) |
Function to genreate a typ specific query parameter and corresponding closure. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_bool (unsigned int num, const bool *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of bool in host byte order. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_uint16 (unsigned int num, const uint16_t *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of uint16_t in host byte order. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_uint32 (unsigned int num, const uint32_t *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of uint32_t in host byte order. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_uint64 (unsigned int num, const uint64_t *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of uint64 in host byte order. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_bytes (unsigned int num, const void *elements, const size_t *sizes, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of buffers elements, each of corresponding size given in sizes. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_ptrs_bytes (unsigned int num, const void *elements[static num], const size_t *sizes, struct GNUNET_PQ_Context *db) |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_bytes_same_size (unsigned int num, const void *elements, size_t same_size, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of buffers elements, each of the same size size. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_ptrs_bytes_same_size (unsigned int num, const void *elements[static num], size_t same_size, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of pointers to buffers elements, each of the same size size. More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_string (unsigned int num, const char *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of strings (continuous) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_ptrs_string (unsigned int num, const char *elements[static num], struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of strings (pointers) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_abs_time (unsigned int num, const struct GNUNET_TIME_Absolute *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of absolute time stamps (continuous) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_ptrs_abs_time (unsigned int num, const struct GNUNET_TIME_Absolute *elements[], struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of absolute time stamps (pointers) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_rel_time (unsigned int num, const struct GNUNET_TIME_Relative *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of relative time stamps (continuous) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_ptrs_rel_time (unsigned int num, const struct GNUNET_TIME_Relative *elements[], struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of relative time stamps (pointers) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_timestamp (unsigned int num, const struct GNUNET_TIME_Timestamp *elements, struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of time stamps (continuous) More... | |
struct GNUNET_PQ_QueryParam | GNUNET_PQ_query_param_array_ptrs_timestamp (unsigned int num, const struct GNUNET_TIME_Timestamp *elements[], struct GNUNET_PQ_Context *db) |
Generate query parameter for an array of time stamps (pointers) More... | |
functions to initialize parameter arrays
Definition in file pq_query_helper.c.
#define RETURN_UNLESS | ( | cond | ) |
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 47 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_null | ( | void | ) |
Generate query parameter to create a NULL value.
Definition at line 47 of file pq_query_helper.c.
References data, and GNUNET_break.
Referenced by postgres_plugin_put().
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 98 of file pq_query_helper.c.
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.
ptr | pointer to the query parameter to pass |
ptr_size | number of bytes in ptr |
Definition at line 98 of file pq_query_helper.c.
Referenced by postgres_plugin_put(), and postgres_plugin_remove_key().
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_string | ( | const char * | ptr | ) |
Generate query parameter for a string.
ptr | pointer to the string query parameter to pass |
Definition at line 98 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_bool | ( | bool | b | ) |
Pass a boolean into a query.
b | boolean bit to pass |
Definition at line 98 of file pq_query_helper.c.
References data, and GNUNET_break.
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 170 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint16 | ( | const uint16_t * | x | ) |
Generate query parameter for an uint16_t in host byte order.
x | pointer to the query parameter to pass |
Definition at line 170 of file pq_query_helper.c.
References data, GNUNET_break, and GNUNET_new.
Referenced by postgres_plugin_get_key().
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 227 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint32 | ( | const uint32_t * | x | ) |
Generate query parameter for an uint32_t in host byte order.
x | pointer to the query parameter to pass |
Definition at line 227 of file pq_query_helper.c.
References data, GNUNET_break, and GNUNET_new.
Referenced by postgres_plugin_del(), postgres_plugin_get_closest(), postgres_plugin_get_key(), postgres_plugin_get_zero_anonymity(), and postgres_plugin_put().
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 284 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_uint64 | ( | const uint64_t * | x | ) |
Generate query parameter for an uint16_t in host byte order.
x | pointer to the query parameter to pass |
Definition at line 284 of file pq_query_helper.c.
References data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.
Referenced by postgres_plugin_get_key(), postgres_plugin_get_zero_anonymity(), postgres_plugin_put(), process_result(), and repl_proc().
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 341 of file pq_query_helper.c.
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.
x | the query parameter to pass. |
Definition at line 341 of file pq_query_helper.c.
References buf, data, GNUNET_break, and GNUNET_CRYPTO_rsa_public_key_encode().
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 397 of file pq_query_helper.c.
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.
x | the query parameter to pass |
Definition at line 397 of file pq_query_helper.c.
References buf, data, GNUNET_break, and GNUNET_CRYPTO_rsa_signature_encode().
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 452 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_relative_time | ( | const struct GNUNET_TIME_Relative * | x | ) |
Generate query parameter for a relative time value.
The database must store a 64-bit integer.
x | pointer to the query parameter to pass |
Definition at line 452 of file pq_query_helper.c.
References data, GNUNET_break, GNUNET_htonll(), GNUNET_new, and GNUNET_TIME_Relative::rel_value_us.
|
static |
Function called to convert input argument into SQL parameters.
cls | closure | |
data | pointer to input argument | |
data_len | number of bytes in data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 511 of file pq_query_helper.c.
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.
x | pointer to the query parameter to pass |
Definition at line 511 of file pq_query_helper.c.
References GNUNET_TIME_Absolute::abs_value_us, data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.
Referenced by delete_old_block(), namecache_postgres_expire_blocks(), postgres_plugin_del(), postgres_plugin_get_closest(), postgres_plugin_get_expiration(), and postgres_plugin_put().
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.
x | pointer to the query parameter to pass |
Definition at line 511 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_timestamp | ( | const struct GNUNET_TIME_Timestamp * | x | ) |
Generate query parameter for a timestamp.
The database must store a 64-bit integer.
x | pointer to the query parameter to pass |
Definition at line 511 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_timestamp_nbo | ( | const struct GNUNET_TIME_TimestampNBO * | x | ) |
Generate query parameter for a timestamp in NBO.
The database must store a 64-bit integer.
x | pointer to the query parameter to pass |
Definition at line 511 of file pq_query_helper.c.
|
static |
Callback to cleanup a qconv_array_cls to be used during GNUNET_PQ_cleanup_query_params_closures.
Definition at line 623 of file pq_query_helper.c.
References GNUNET_free.
|
static |
Function called to convert input argument into SQL parameters for arrays.
Note: the format for the encoding of arrays for libpq is not very well documented. We peeked into various sources (postgresql and libpqtypes) for guidance.
cls | Closure of type struct qconv_array_cls* | |
data | Pointer to first element in the array | |
data_len | Number of elements in array data (if applicable) | |
[out] | param_values | SQL data to set |
[out] | param_lengths | SQL length data to set |
[out] | param_formats | SQL format data to set |
param_length | number of entries available in the param_values, param_lengths and param_formats arrays | |
[out] | scratch | buffer for dynamic allocations (to be done via GNUNET_malloc() |
scratch_length | number of entries left in scratch |
Definition at line 648 of file pq_query_helper.c.
|
static |
Function to genreate a typ specific query parameter and corresponding closure.
num | Number of elements in elements |
continuous | If true, elements is an continuous array of data |
elements | Array of num elements, either continuous or pointers |
sizes | Array of num sizes, one per element, may be NULL |
same_size | If not 0, all elements in elements have this size |
typ | Supported internal type of each element in elements |
oid | Oid of the type to be used in Postgres |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_bool | ( | unsigned int | num, |
const bool * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of bool in host byte order.
num | Number of elements in elements |
elements | Continuous array of num boolean elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_uint16 | ( | unsigned int | num, |
const uint16_t * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of uint16_t in host byte order.
Note that the (unsigend) elements are not checked to wrap over INT2_MAX
num | Number of elements in elements |
elements | Continuous array of num uint16 elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_uint32 | ( | unsigned int | num, |
const uint32_t * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of uint32_t in host byte order.
Note that the (unsigend) elements are not checked to wrap over INT4_MAX
num | Number of elements in elements |
elements | Continuous Array of num uint32_t elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_uint64 | ( | unsigned int | num, |
const uint64_t * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of uint64 in host byte order.
Note that the (unsigend) elements are not checked to wrap over INT8_MAX
num | Number of elements in elements |
elements | Continuous array of num uint64_t elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_bytes | ( | unsigned int | num, |
const void * | elements, | ||
const size_t * | sizes, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of buffers elements, each of corresponding size given in sizes.
num | Number of elements in elements |
elements | Continous array of num buffers, each of corresponding size given in sizes. |
sizes | Pointer to sizes in bytes of each element in elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_ptrs_bytes | ( | unsigned int | num, |
const void * | elements[static num], | ||
const size_t * | sizes, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_bytes_same_size | ( | unsigned int | num, |
const void * | elements, | ||
size_t | same_size, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of buffers elements, each of the same size size.
num | Number of elements in elements |
elements | Continous array of num buffers, each with the same size same_size |
same_size | Size in bytes of each element in elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_ptrs_bytes_same_size | ( | unsigned int | num, |
const void * | elements[static num], | ||
size_t | same_size, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of pointers to buffers elements, each of the same size size.
num | Number of elements in elements |
elements | Array of num pointers to buffers, each with the same size same_size |
same_size | Size in bytes of each element in elements |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_string | ( | unsigned int | num, |
const char * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of strings (continuous)
num | Number of elements in elements |
elements | Array of num continuous strings (zero-terminated each) |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_ptrs_string | ( | unsigned int | num, |
const char * | elements[static num], | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of strings (pointers)
num | Number of elements in elements |
elements | Array of num pointer to strings |
db | Database context, needed for database-depending encoding of elements |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_abs_time | ( | unsigned int | num, |
const struct GNUNET_TIME_Absolute * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of absolute time stamps (continuous)
num | Number of elements in elements |
elements | Array of num absolute timestamps |
Definition at line 648 of file pq_query_helper.c.
References GNUNET_TIME_Timestamp::abs_time, GNUNET_TIME_Absolute::abs_value_us, array_of_abs_time, array_of_bool, array_of_byte, array_of_rel_time, array_of_string, array_of_timestamp, array_of_uint16, array_of_uint32, array_of_uint64, data, GNUNET_assert, GNUNET_free, GNUNET_htonll(), GNUNET_malloc, GNUNET_memcpy, GNUNET_new_array, h, INT_MAX, len, meta, GNUNET_TIME_Relative::rel_value_us, RETURN_UNLESS, and qconv_array_cls::sizes.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_ptrs_abs_time | ( | unsigned int | num, |
const struct GNUNET_TIME_Absolute * | elements[], | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of absolute time stamps (pointers)
num | Number of elements in elements |
elements | Array of num pointers to absolute timestamps |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_rel_time | ( | unsigned int | num, |
const struct GNUNET_TIME_Relative * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of relative time stamps (continuous)
num | Number of elements in elements |
elements | Array of num relative timestamps |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_ptrs_rel_time | ( | unsigned int | num, |
const struct GNUNET_TIME_Relative * | elements[], | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of relative time stamps (pointers)
num | Number of elements in elements |
elements | Array of num pointers to relative timestamps |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_timestamp | ( | unsigned int | num, |
const struct GNUNET_TIME_Timestamp * | elements, | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of time stamps (continuous)
num | Number of elements in elements |
elements | Array of num timestamps |
Definition at line 648 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_array_ptrs_timestamp | ( | unsigned int | num, |
const struct GNUNET_TIME_Timestamp * | elements[], | ||
struct GNUNET_PQ_Context * | db | ||
) |
Generate query parameter for an array of time stamps (pointers)
num | Number of elements in elements |
elements | Array of num pointers to relative timestamps |
Definition at line 648 of file pq_query_helper.c.