36 for (
unsigned int i = 0; NULL != params[i].
conv; i++)
39 params[i].
conv (params[i].conv_cls,
47 _ (
"Failure to bind %u-th SQL parameter\n"),
54 _ (
"Failure in sqlite3_reset (!)\n"));
80 for (
unsigned int i = 0; NULL != rs[i].
conv; i++)
82 if (NULL == rs[i].result_size)
85 rs[i].
conv (rs[i].cls,
91 for (
unsigned int k = 0; k < i; k++)
92 if (NULL != rs[k].cleaner)
106 for (
unsigned int i = 0; NULL != rs[i].
conv; i++)
107 if (NULL != rs[i].cleaner)
123 sqlite3_reset (stmt))
126 _ (
"Failed to reset sqlite statement with error: %s\n"),
127 sqlite3_errmsg (dbh));
static char * data
The data to insert into the dht.
static int result
Global testing status.
helper functions for Sqlite3 DB interactions
#define GNUNET_log_from(kind, comp,...)
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
@ GNUNET_ERROR_TYPE_WARNING
@ GNUNET_ERROR_TYPE_ERROR
static unsigned int size
Size of the "table".
enum GNUNET_GenericReturnValue GNUNET_SQ_extract_result(sqlite3_stmt *result, struct GNUNET_SQ_ResultSpec *rs)
Extract results from a query result according to the given specification.
void GNUNET_SQ_cleanup_result(struct GNUNET_SQ_ResultSpec *rs)
Free all memory that was allocated in rs during GNUNET_SQ_extract_result().
enum GNUNET_GenericReturnValue GNUNET_SQ_bind(sqlite3_stmt *stmt, const struct GNUNET_SQ_QueryParam *params)
Execute binding operations for a prepared statement.
void GNUNET_SQ_reset(sqlite3 *dbh, sqlite3_stmt *stmt)
Reset stmt and log error.
Description of a DB query parameter.
GNUNET_SQ_QueryConverter conv
Function for how to handle this type of entry.
unsigned int num_params
Number of parameters eaten by this operation.
Description of a DB result cell.
size_t * result_size
Where to store actual size of the result.
GNUNET_SQ_ResultConverter conv
What is the format of the result?
GNUNET_SQ_ResultCleanup cleaner
Function to clean up result data, NULL if cleanup is not necessary.
unsigned int num_params
Number of parameters (columns) eaten by this operation.
size_t dst_size
Allowed size for the data, 0 for variable-size (in this case, the type of dst is a void ** and we nee...