![]() |
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... | |
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... | |
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.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_null | ( | void | ) |
Generate query parameter to create a NULL value.
Definition at line 45 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 96 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 @oaran ptr_size number of bytes in ptr |
Definition at line 96 of file pq_query_helper.c.
Referenced by 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 96 of file pq_query_helper.c.
Referenced by namestore_postgres_lookup_records(), and namestore_postgres_store_records().
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 96 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 164 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 164 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 221 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 221 of file pq_query_helper.c.
References data, GNUNET_break, and GNUNET_new.
Referenced by namestore_postgres_store_records(), postgres_plugin_del(), postgres_plugin_get(), postgres_plugin_get_closest(), 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 278 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 278 of file pq_query_helper.c.
References data, GNUNET_break, GNUNET_htonll(), and GNUNET_new.
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 335 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 335 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 391 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 391 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 446 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 446 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 505 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 505 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_cache_block(), namecache_postgres_expire_blocks(), postgres_plugin_del(), postgres_plugin_get(), 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 505 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 505 of file pq_query_helper.c.
struct GNUNET_PQ_QueryParam GNUNET_PQ_query_param_timestamp_nbo | ( | const struct GNUNET_TIME_TimestampNBO * | t | ) |
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 505 of file pq_query_helper.c.