![]() |
GNUnet
0.11.x
|
functions to initialize parameter arrays More...
Go to the source code of this file.
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... | |
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... | |
functions to initialize parameter arrays
Definition in file pq_query_helper.c.
|
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 45 of file pq_query_helper.c.
References GNUNET_break.
Referenced by GNUNET_PQ_query_param_null().
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_null | ( | void | ) |
Generate query parameter to create a NULL value.
Definition at line 70 of file pq_query_helper.c.
References qconv_null(), and res.
|
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 95 of file pq_query_helper.c.
References GNUNET_break.
Referenced by 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.
ptr | pointer to the query parameter to pass ptr_size number of bytes in ptr |
Definition at line 118 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().
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 130 of file pq_query_helper.c.
References GNUNET_PQ_query_param_fixed_size().
Referenced by GNUNET_PQ_run_sql(), namestore_postgres_lookup_records(), and namestore_postgres_store_records().
|
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 152 of file pq_query_helper.c.
References GNUNET_PQ_QueryParam::data, GNUNET_break, and GNUNET_new.
Referenced by 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.
x | pointer to the query parameter to pass |
Definition at line 181 of file pq_query_helper.c.
References qconv_uint16(), and res.
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 205 of file pq_query_helper.c.
References GNUNET_PQ_QueryParam::data, GNUNET_break, and GNUNET_new.
Referenced by 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.
x | pointer to the query parameter to pass |
Definition at line 234 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().
|
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 258 of file pq_query_helper.c.
References GNUNET_PQ_QueryParam::data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.
Referenced by GNUNET_PQ_query_param_uint64().
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 287 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().
|
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 311 of file pq_query_helper.c.
References buf, GNUNET_PQ_QueryParam::data, GNUNET_break, and GNUNET_CRYPTO_rsa_public_key_encode().
Referenced by 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.
x | the query parameter to pass. |
Definition at line 339 of file pq_query_helper.c.
References qconv_rsa_public_key(), and res.
|
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 364 of file pq_query_helper.c.
References buf, GNUNET_PQ_QueryParam::data, GNUNET_break, and GNUNET_CRYPTO_rsa_signature_encode().
Referenced by 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.
x | the query parameter to pass |
Definition at line 392 of file pq_query_helper.c.
References qconv_rsa_signature(), and res.
|
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 416 of file pq_query_helper.c.
References GNUNET_PQ_QueryParam::data, GNUNET_break, GNUNET_htonll(), GNUNET_new, and GNUNET_TIME_Relative::rel_value_us.
Referenced by GNUNET_PQ_query_param_relative_time().
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 447 of file pq_query_helper.c.
References qconv_rel_time(), and res.
|
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 471 of file pq_query_helper.c.
References GNUNET_TIME_Absolute::abs_value_us, GNUNET_PQ_QueryParam::data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.
Referenced by 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.
x | pointer to the query parameter to pass |
Definition at line 502 of file pq_query_helper.c.
References qconv_abs_time(), and res.
Referenced by delete_old_block(), namecache_postgres_cache_block(), 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().
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 513 of file pq_query_helper.c.
References GNUNET_PQ_query_param_auto_from_type.