/* Copyright (c) 2014-2018 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "dict.h"
#include "doveadm.h"
#include "doveadm-print.h"
#include <stdio.h>
#include <unistd.h>
static int
{
bool set;
i_error("dictionary URI must be specified");
return -1;
}
key = "";
return -1;
}
if (username[0] == '\0' &&
return -1;
}
return -1;
}
return 0;
}
static int
{
}
struct doveadm_dict_ctx {
int ret;
const char *const *values;
const char *error;
};
void *context)
{
}
{
const char *key;
return;
} else {
for (i = 1; i < values_count; i++)
for (i = 0; i < values_count; i++)
}
dict_deinit(&dict);
}
{
const char *error;
return;
i_error("dict set: Missing value");
return;
}
}
dict_deinit(&dict);
}
{
const char *error;
const char *key;
return;
}
dict_deinit(&dict);
}
{
const char *error;
const char *key;
int ret;
return;
i_error("Missing difference");
dict_deinit(&dict);
return;
}
if (ret < 0) {
} else if (ret == 0) {
}
dict_deinit(&dict);
}
{
return;
doveadm_print_header_simple("key");
if ((iter_flags & DICT_ITERATE_FLAG_NO_VALUE) == 0)
doveadm_print_header_simple("value");
if ((iter_flags & DICT_ITERATE_FLAG_NO_VALUE) == 0)
}
}
dict_deinit(&dict);
}
{
.name = "dict get",
.cmd = cmd_dict_get,
.usage = "[-u <user>] <dict uri> <key>",
},
{
.name = "dict set",
.cmd = cmd_dict_set,
.usage = "[-u <user>] <dict uri> <key> <value>",
},
{
.name = "dict unset",
.cmd = cmd_dict_unset,
.usage = "[-u <user>] <dict uri> <key>",
},
{
.name = "dict inc",
.cmd = cmd_dict_inc,
.usage = "[-u <user>] <dict uri> <key> <diff>",
},
{
.name = "dict iter",
.cmd = cmd_dict_iter,
.usage = "[-u <user>] [-1RV] <dict uri> <prefix>",
}
};
void doveadm_register_dict_commands(void)
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(doveadm_cmd_dict); i++)
}