sql-api.c revision 903507ced4fed650d36782a897e5a56a1978367a
/* Copyright (c) 2004-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "sql-api-private.h"
#include <stdlib.h>
#include <time.h>
struct sql_db_module_register sql_db_module_register = { 0 };
void sql_drivers_init(void)
{
}
void sql_drivers_deinit(void)
{
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
return drivers[i];
}
return NULL;
}
{
i_fatal("sql_driver_register(%s): Already registered",
}
}
{
unsigned int i, count;
for (i = 0; i < count; i++) {
break;
}
}
}
{
else
return db;
}
{
}
{
}
{
break;
case SQL_DB_STATE_CONNECTING:
return 0;
default:
return 1;
}
/* don't try reconnecting more than once a second */
return -1;
}
{
}
{
}
{
}
{
}
{
}
{
}
{
return;
}
static const struct sql_field_def *
{
unsigned int i;
return &fields[i];
}
return NULL;
}
static void
{
const struct sql_field_def *def;
const char *name;
unsigned int i, count, field_size = 0;
for (i = 0; i < count; i++) {
case SQL_TYPE_STR:
field_size = sizeof(const char *);
break;
case SQL_TYPE_UINT:
field_size = sizeof(unsigned int);
break;
case SQL_TYPE_ULLONG:
field_size = sizeof(unsigned long long);
break;
case SQL_TYPE_BOOL:
field_size = sizeof(bool);
break;
}
} else {
}
}
}
const struct sql_field_def *fields,
{
}
{
unsigned int i, count;
const char *value;
void *ptr;
for (i = 0; i < count; i++) {
continue;
case SQL_TYPE_STR: {
break;
}
case SQL_TYPE_UINT: {
break;
}
case SQL_TYPE_ULLONG: {
break;
}
case SQL_TYPE_BOOL: {
break;
}
}
}
}
{
int ret;
return ret;
return 1;
}
{
}
unsigned int idx)
{
}
{
}
unsigned int idx)
{
}
const unsigned char *
{
}
const char *field_name)
{
}
{
}
{
}
static void
{
}
static int
{
return -1;
}
static const char *
{
return SQL_ERRSTR_NOT_CONNECTED;
}
{
}
{
}
const char **error_r)
{
}
{
}
{
}
unsigned int *affected_rows)
{
}
{
return;
}
}
const char *query, unsigned int *affected_rows)
{
struct sql_transaction_query *tquery;
else
}
struct sql_result sql_not_connected_result = {
.v = {
},
};