/* Copyright (c) 2006-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "hex-binary.h"
#include "sql-api-private.h"
#ifdef BUILD_SQLITE
#include <sqlite3.h>
/* retry time if db is busy (in ms) */
struct sqlite_db {
const char *dbfile;
int rc;
};
struct sqlite_result {
unsigned int cols;
const char **row;
};
struct sqlite_transaction_context {
};
extern const struct sql_db driver_sqlite_db;
extern const struct sql_result driver_sqlite_result;
extern const struct sql_result driver_sqlite_error_result;
{
return 1;
return 1;
} else {
return -1;
}
}
{
}
{
}
{
}
static const char *
const char *string)
{
const char *p;
/* find the first ' */
for (p = string; *p != '\''; p++) {
if (*p == '\0')
return t_strdup_noconst(string);
}
/* @UNSAFE: escape ' with '' */
for (; *p != '\0'; p++) {
*dest++ = *p;
if (*p == '\'')
*dest++ = *p;
}
*dest++ = '\0';
return destbegin;
}
{
if (driver_sqlite_connect(_db) < 0)
return;
i_error("sqlite: exec(%s) failed: %s (%d)",
}
}
{
}
static struct sql_result *
{
int rc;
if (driver_sqlite_connect(_db) < 0) {
} else {
} else {
}
}
}
{
int rc;
return;
i_warning("sqlite: finalize failed: %s (%d)",
}
}
}
{
case SQLITE_ROW:
return 1;
case SQLITE_DONE:
return 0;
default:
return -1;
}
}
static unsigned int
{
}
static const char *
unsigned int idx)
{
}
const char *field_name)
{
unsigned int i;
return i;
}
return -1;
}
static const char *
unsigned int idx)
{
}
static const unsigned char *
{
}
static const char *
const char *field_name)
{
int idx;
if (idx < 0)
return NULL;
}
static const char *const *
{
unsigned int i;
}
}
{
}
static struct sql_transaction_context *
{
}
static void
{
(struct sqlite_transaction_context *)_ctx;
}
static void
{
(struct sqlite_transaction_context *)_ctx;
}
/* also does i_free(ctx) */
} else {
}
}
static int
const char **error_r)
{
(struct sqlite_transaction_context *)_ctx;
/* also does i_free(ctx) */
return -1;
}
return 0;
}
static void
unsigned int *affected_rows)
{
(struct sqlite_transaction_context *)_ctx;
return;
else if (affected_rows != NULL)
}
static const char *
{
}
.name = "sqlite",
.v = {
}
};
.v = {
}
};
static int
{
return -1;
}
.v = {
}
};
void driver_sqlite_init(void);
void driver_sqlite_deinit(void);
void driver_sqlite_init(void)
{
}
void driver_sqlite_deinit(void)
{
}
#endif