helper functions for queries More...
Go to the source code of this file.
Functions | |
static int | bind_fixed_blob (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_fixed_size (const void *ptr, size_t ptr_size) |
Generate query parameter for a buffer ptr of ptr_size bytes. More... | |
static int | bind_string (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_string (const char *ptr) |
Generate query parameter for a string. More... | |
static int | bind_rsa_pub (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_rsa_public_key (const struct GNUNET_CRYPTO_RsaPublicKey *x) |
Generate query parameter for an RSA public key. More... | |
static int | bind_rsa_sig (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_rsa_signature (const struct GNUNET_CRYPTO_RsaSignature *x) |
Generate query parameter for an RSA signature. More... | |
static int | bind_abstime (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x) |
Generate query parameter for an absolute time value. More... | |
static int | bind_nbotime (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_absolute_time_nbo (const struct GNUNET_TIME_AbsoluteNBO *x) |
Generate query parameter for an absolute time value. More... | |
static int | bind_u16 (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_uint16 (const uint16_t *x) |
Generate query parameter for an uint16_t in host byte order. More... | |
static int | bind_u32 (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_uint32 (const uint32_t *x) |
Generate query parameter for an uint32_t in host byte order. More... | |
static int | bind_u64 (void *cls, const void *data, size_t data_len, sqlite3_stmt *stmt, unsigned int off) |
Function called to convert input argument into SQL parameters. More... | |
struct GNUNET_SQ_QueryParam | GNUNET_SQ_query_param_uint64 (const uint64_t *x) |
Generate query parameter for an uint16_t in host byte order. More... | |
helper functions for queries
Definition in file sq_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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 41 of file sq_query_helper.c.
References data, GNUNET_OK, and GNUNET_SYSERR.
Referenced by GNUNET_SQ_query_param_fixed_size().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 66 of file sq_query_helper.c.
References bind_fixed_blob(), GNUNET_SQ_QueryParam::conv, and GNUNET_SQ_QueryParam::size.
Referenced by namecache_sqlite_cache_block(), namestore_sqlite_store_records(), peerstore_sqlite_store_record(), sqlite_plugin_put(), and sqlite_plugin_remove_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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 92 of file sq_query_helper.c.
References data, GNUNET_OK, and GNUNET_SYSERR.
Referenced by GNUNET_SQ_query_param_string().
struct GNUNET_SQ_QueryParam GNUNET_SQ_query_param_string | ( | const char * | ptr | ) |
Generate query parameter for a string.
ptr | pointer to the string query parameter to pass |
Definition at line 123 of file sq_query_helper.c.
References bind_string(), GNUNET_SQ_QueryParam::conv, and GNUNET_SQ_QueryParam::num_params.
Referenced by lookup_records(), namestore_sqlite_editor_hint_clear(), namestore_sqlite_store_records(), peerstore_sqlite_delete_records(), peerstore_sqlite_iterate_records(), and peerstore_sqlite_store_record().
|
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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 147 of file sq_query_helper.c.
References data, GNUNET_break, GNUNET_CRYPTO_rsa_public_key_encode(), GNUNET_free, GNUNET_OK, and GNUNET_SYSERR.
Referenced by GNUNET_SQ_query_param_rsa_public_key().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 182 of file sq_query_helper.c.
References bind_rsa_pub(), and GNUNET_SQ_QueryParam::conv.
|
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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 207 of file sq_query_helper.c.
References data, GNUNET_break, GNUNET_CRYPTO_rsa_signature_encode(), GNUNET_free, GNUNET_OK, and GNUNET_SYSERR.
Referenced by GNUNET_SQ_query_param_rsa_signature().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 242 of file sq_query_helper.c.
References bind_rsa_sig(), and GNUNET_SQ_QueryParam::conv.
|
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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 266 of file sq_query_helper.c.
References GNUNET_TIME_Absolute::abs_value_us, data, GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, and u.
Referenced by GNUNET_SQ_query_param_absolute_time().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 295 of file sq_query_helper.c.
References bind_abstime(), and GNUNET_SQ_QueryParam::conv.
Referenced by get_any(), get_typed(), namecache_sqlite_cache_block(), namecache_sqlite_expire_blocks(), peerstore_sqlite_expire_records(), peerstore_sqlite_store_record(), sqlite_plugin_del(), sqlite_plugin_get_closest(), sqlite_plugin_get_expiration(), and sqlite_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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 320 of file sq_query_helper.c.
References GNUNET_TIME_Absolute::abs_value_us, data, GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, GNUNET_TIME_absolute_ntoh(), and u.
Referenced by GNUNET_SQ_query_param_absolute_time_nbo().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 349 of file sq_query_helper.c.
References bind_nbotime(), and GNUNET_SQ_QueryParam::conv.
|
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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 375 of file sq_query_helper.c.
References data, GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, and u.
Referenced by GNUNET_SQ_query_param_uint16().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 399 of file sq_query_helper.c.
References bind_u16(), GNUNET_SQ_QueryParam::conv, and GNUNET_SQ_QueryParam::num_params.
|
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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 424 of file sq_query_helper.c.
References data, GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, and u.
Referenced by GNUNET_SQ_query_param_uint32().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 448 of file sq_query_helper.c.
References bind_u32(), GNUNET_SQ_QueryParam::conv, and GNUNET_SQ_QueryParam::num_params.
Referenced by get_any(), get_typed(), namestore_sqlite_store_records(), sqlite_plugin_get_closest(), sqlite_plugin_get_key(), sqlite_plugin_get_replication(), sqlite_plugin_get_zero_anonymity(), and sqlite_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) |
stmt | sqlite statement to bind parameters for |
off | offset of the argument to bind in stmt, numbered from 1, so immediately suitable for passing to sqlite3_bind -functions. |
Definition at line 473 of file sq_query_helper.c.
References data, GNUNET_assert, GNUNET_OK, GNUNET_SYSERR, and u.
Referenced by GNUNET_SQ_query_param_uint64().
struct GNUNET_SQ_QueryParam GNUNET_SQ_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 497 of file sq_query_helper.c.
References bind_u64(), GNUNET_SQ_QueryParam::conv, and GNUNET_SQ_QueryParam::num_params.
Referenced by delete_by_rowid(), namestore_sqlite_iterate_records(), namestore_sqlite_store_records(), peerstore_sqlite_iterate_records(), sqlite_plugin_del(), sqlite_plugin_get_key(), sqlite_plugin_get_replication(), sqlite_plugin_get_zero_anonymity(), and sqlite_plugin_put().