doveadm-cmd.c revision 36a052b7bd94ccb47abbb6b15c1380f03780ba20
/* Copyright (c) 2009-2r016 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "istream.h"
#include "str.h"
#include "net.h"
#include "doveadm-cmd.h"
#include "doveadm.h"
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
static struct doveadm_cmd *doveadm_commands[] = {
};
static struct doveadm_cmd_ver2 *doveadm_commands_ver2[] = {
};
{
}
{
else i_unreached();
}
}
{
const struct doveadm_cmd_ver2 *cmd;
return cmd;
}
return NULL;
}
const struct doveadm_cmd_ver2 *
{
int i;
const struct doveadm_cmd_ver2 *cmd;
const char *cptr;
for(i=0;i<argc;i++) {
}
/* cannot reuse i here because this needs be
done more than once */
/* make sure we don't overstep */
/* did not match */
/* do not accept abbreviations */
}
/* name was fully consumed */
}
return NULL;
}
static bool
const char *const *_argv[])
{
unsigned int len;
if (argc < 2)
return NULL;
return NULL;
/* more args */
return FALSE;
} else {
return FALSE;
}
return TRUE;
}
const struct doveadm_cmd *
const char *const *argv[])
{
const struct doveadm_cmd *cmd;
unsigned int cmd_name_len;
return cmd;
/* see if it matches a multi-word command */
return cmd;
}
}
return NULL;
}
void doveadm_cmds_init(void)
{
unsigned int i;
for (i = 0; i < N_ELEMENTS(doveadm_commands); i++)
for (i = 0; i < N_ELEMENTS(doveadm_commands_ver2); i++)
}
void doveadm_cmds_deinit(void)
{
}
static const struct doveadm_cmd_param*
const char *name)
{
}
return NULL;
}
{
const struct doveadm_cmd_param *param;
return TRUE;
}
return FALSE;
}
{
const struct doveadm_cmd_param *param;
return TRUE;
}
return FALSE;
}
{
const struct doveadm_cmd_param *param;
return TRUE;
}
return FALSE;
}
{
const struct doveadm_cmd_param *param;
return TRUE;
}
return FALSE;
}
{
const struct doveadm_cmd_param *param;
unsigned int count;
/* doveadm_cmd_params_null_terminate_arrays() should have been
called, which guarantees that we're NULL-terminated */
return TRUE;
}
return FALSE;
}
{
const struct doveadm_cmd_param *param;
return TRUE;
}
return FALSE;
}
{
struct doveadm_cmd_param *param;
}
}
{
struct doveadm_cmd_param *param;
}
}
}
static void
{
bool array_add_opt;
int i;
const char * const * cptr;
for(i=0;i<pargc;i++) {
/* istreams are special */
} else {
}
}
/* CMD_PARAM_BOOL is implicitly handled above */
if (array_add_opt)
}
}
}
}
}
void
{
unsigned int pargc;
const char **pargv;
}
static void
{
} else {
}
}
}
{
case CMD_PARAM_BOOL:
case CMD_PARAM_INT64:
}
break;
case CMD_PARAM_IP:
}
break;
case CMD_PARAM_STR:
break;
case CMD_PARAM_ARRAY:
break;
case CMD_PARAM_ISTREAM: {
} else {
}
}
}
}
bool doveadm_cmd_try_run_ver2(const char *cmd_name,
struct doveadm_cmd_context *cctx)
{
const struct doveadm_cmd_ver2 *cmd;
return FALSE;
return TRUE;
}
struct doveadm_cmd_context *cctx)
{
struct doveadm_cmd_param *param;
const char *cptr;
unsigned int pargc;
int c,li;
// build parameters
}
switch(c) {
case 0:
for(unsigned int i = 0; i < array_count(&pargv); i++) {
}
break;
case '?':
case ':':
return -1;
default:
// hunt the option
for(unsigned int i = 0; i < pargc; i++) {
}
}
}
/* process positional arguments */
struct doveadm_cmd_param *ptr;
break;
}
}
if (!found) {
i_error("Extraneous arguments found");
return -1;
}
}
return 0;
}