doveadm.c revision 28b8434ca4cba2e310d13ffc55e895d658725f43
/* Copyright (c) 2009-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "str.h"
#include "env-util.h"
#include "execv-const.h"
#include "module-dir.h"
#include "master-service.h"
#include "master-service-settings.h"
#include "doveadm-print.h"
#include "doveadm-mail.h"
#include "doveadm-settings.h"
#include "doveadm.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
{
}
static void
{
char **lines;
/* split lines */
/* sort lines */
/* print lines, compress subcommands into a single line */
for (i = 0; i < count; i++) {
args = "";
} else {
args++;
}
if (*prefix != '\0') {
continue;
}
if (p == NULL) {
if (*prev_name != '\0') {
prev_name = "";
}
} else {
if (*prev_name != '\0')
} else {
}
}
}
if (*prev_name != '\0')
}
static void ATTR_NORETURN
{
const struct doveadm_cmd *cmd;
if (*prefix != '\0')
exit(1);
}
void usage(void)
{
}
static void ATTR_NORETURN
{
exit(0);
}
{
}
{
static char buf[64];
return buf;
}
const char *doveadm_plugin_getenv(const char *name)
{
const char *const *envs;
unsigned int i, count;
return NULL;
for (i = 0; i < count; i += 2) {
return envs[i+1];
}
return NULL;
}
static bool doveadm_has_subcommands(const char *cmd_name)
{
const struct doveadm_cmd *cmd;
return TRUE;
}
return doveadm_mail_has_subcommands(cmd_name);
}
{
const char *man_argv[3];
man_argv[0] = "man";
}
static struct doveadm_cmd doveadm_cmd_help = {
};
static bool
{
unsigned int len;
if (argc < 2)
return FALSE;
return FALSE;
/* more args */
}
return FALSE;
/* match */
return TRUE;
}
{
const struct doveadm_cmd *cmd;
unsigned int cmd_name_len;
return TRUE;
}
/* see if it matches a multi-word command */
return TRUE;
}
}
return FALSE;
}
static void doveadm_load_modules(void)
{
struct module_dir_load_settings mod_set;
/* some doveadm plugins have dependencies to mail plugins. we can load
only those whose dependencies have been loaded earlier, the rest are
ignored. */
}
static struct doveadm_cmd *doveadm_commands[] = {
};
{
static const struct setting_parser_info *set_roots[] = {
};
struct master_service_settings_input input;
struct master_service_settings_output output;
unsigned int i;
bool quick_init;
int c;
/* "+" is GNU extension to stop at the first non-option.
others just accept -+ option. */
while ((c = master_getopt(master_service)) > 0) {
switch (c) {
case 'D':
break;
case 'f':
break;
case 'v':
break;
default:
return FATAL_DEFAULT;
}
}
for (i = 0; i < N_ELEMENTS(doveadm_commands); i++)
/* special case commands: even if there is something wrong
with the config (e.g. mail_plugins), don't fail these
commands */
quick_init = TRUE;
} else {
quick_init = FALSE;
/* show usage after registering all plugins */
}
}
optind = 1;
if (!doveadm_debug) {
/* disable debugging unless -D is given */
i_set_debug_file("/dev/null");
}
if (doveadm_has_subcommands(argv[0]))
usage();
}
if (!quick_init) {
}
return 0;
}