dict-commands.c revision 9261dbf0675204898c6557591c7aa376e23a52b2
/* Copyright (c) 2005-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ostream.h"
#include "str.h"
#include "dict-client.h"
#include "dict-settings.h"
#include "dict-connection.h"
#include "dict-commands.h"
#include <stdlib.h>
#define DICT_OUTPUT_OPTIMAL_SIZE 1024
struct dict_client_cmd {
int cmd;
};
{
const char *reply;
const char *value;
int ret;
i_error("dict client: LOOKUP: Can't lookup while iterating");
return -1;
}
/* <key> */
if (ret > 0) {
} else {
}
return 0;
}
{
str_truncate(str, 0);
/* continue later */
return 0;
}
/* flushed everything, continue */
}
}
/* finished iterating */
str_truncate(str, 0);
return 1;
}
{
const char *const *args;
unsigned int flags;
i_error("dict client: ITERATE: Already iterating");
return -1;
}
i_error("dict client: ITERATE: broken input");
return -1;
}
/* <flags> <path> */
return 0;
}
static struct dict_connection_transaction *
unsigned int id)
{
struct dict_connection_transaction *transaction;
return NULL;
return transaction;
}
return NULL;
}
static void
struct dict_connection_transaction *trans)
{
const struct dict_connection_transaction *transactions;
unsigned int i, count;
for (i = 0; i < count; i++) {
if (&transactions[i] == trans) {
break;
}
}
}
{
struct dict_connection_transaction *trans;
unsigned int id;
return -1;
}
return -1;
}
/* <id> */
return 0;
}
static int
const char *line,
struct dict_connection_transaction **trans_r)
{
unsigned int id;
return -1;
}
return -1;
}
return 0;
}
{
struct dict_connection_transaction *trans;
char chr;
int ret;
i_error("dict client: COMMIT: Can't commit while iterating");
return -1;
}
return -1;
switch (ret) {
case 1:
break;
case 0:
break;
default:
break;
}
return 0;
}
{
const char *reply;
char chr;
switch (ret) {
case 1:
break;
case 0:
break;
default:
break;
}
}
static int
{
struct dict_connection_transaction *trans;
i_error("dict client: COMMIT: Can't commit while iterating");
return -1;
}
return -1;
trans);
return 0;
}
{
struct dict_connection_transaction *trans;
return -1;
return 0;
}
{
struct dict_connection_transaction *trans;
const char *const *args;
/* <id> <key> <value> */
i_error("dict client: SET: broken input");
return -1;
}
return -1;
return 0;
}
{
struct dict_connection_transaction *trans;
const char *const *args;
/* <id> <key> */
i_error("dict client: UNSET: broken input");
return -1;
}
return -1;
return 0;
}
{
struct dict_connection_transaction *trans;
const char *const *args;
long long diff;
/* <id> <key> <diff> */
i_error("dict client: ATOMIC_INC: broken input");
return -1;
}
return -1;
return 0;
}
static struct dict_client_cmd cmds[] = {
{ DICT_PROTOCOL_CMD_SET, cmd_set },
{ 0, NULL }
};
{
unsigned int i;
return &cmds[i];
}
return NULL;
}
{
struct dict_client_cmd *cmd;
return -1;
}
}