Commit de8617e9 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make the arguments to CLI functions const-const.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2036 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 54563a39
......@@ -413,8 +413,8 @@ extern struct backend_method backend_method_round_robin;
/* cache_ban.c */
void AddBan(const char *, int hash);
void BAN_Init(void);
void cli_func_url_purge(struct cli *cli, char **av, void *priv);
void cli_func_hash_purge(struct cli *cli, char **av, void *priv);
void cli_func_url_purge(struct cli *cli, const char * const *av, void *priv);
void cli_func_hash_purge(struct cli *cli, const char * const *av, void *priv);
void BAN_NewObj(struct object *o);
int BAN_CheckObject(struct object *o, const char *url, const char *hash);
......
......@@ -102,7 +102,7 @@ BAN_CheckObject(struct object *o, const char *url, const char *hash)
}
void
cli_func_url_purge(struct cli *cli, char **av, void *priv)
cli_func_url_purge(struct cli *cli, const char * const *av, void *priv)
{
(void)priv;
......@@ -111,7 +111,7 @@ cli_func_url_purge(struct cli *cli, char **av, void *priv)
}
void
cli_func_hash_purge(struct cli *cli, char **av, void *priv)
cli_func_hash_purge(struct cli *cli, const char * const *av, void *priv)
{
(void)priv;
......
......@@ -47,7 +47,7 @@
/*--------------------------------------------------------------------*/
static void
cli_func_start(struct cli *cli, char **av, void *priv)
cli_func_start(struct cli *cli, const char * const *av, void *priv)
{
(void)cli;
......
......@@ -434,7 +434,7 @@ WRK_Init(void)
/*--------------------------------------------------------------------*/
void
cli_func_dump_pool(struct cli *cli, char **av, void *priv)
cli_func_dump_pool(struct cli *cli, const char * const *av, void *priv)
{
(void)cli;
......
......@@ -195,7 +195,7 @@ VCL_Load(const char *fn, const char *name, struct cli *cli)
/*--------------------------------------------------------------------*/
void
cli_func_config_list(struct cli *cli, char **av, void *priv)
cli_func_config_list(struct cli *cli, const char * const *av, void *priv)
{
struct vcls *vcl;
......@@ -210,7 +210,7 @@ cli_func_config_list(struct cli *cli, char **av, void *priv)
}
void
cli_func_config_load(struct cli *cli, char **av, void *priv)
cli_func_config_load(struct cli *cli, const char * const *av, void *priv)
{
(void)av;
......@@ -221,7 +221,7 @@ cli_func_config_load(struct cli *cli, char **av, void *priv)
}
void
cli_func_config_discard(struct cli *cli, char **av, void *priv)
cli_func_config_discard(struct cli *cli, const char * const *av, void *priv)
{
struct vcls *vcl;
......@@ -257,7 +257,7 @@ cli_func_config_discard(struct cli *cli, char **av, void *priv)
}
void
cli_func_config_use(struct cli *cli, char **av, void *priv)
cli_func_config_use(struct cli *cli, const char * const *av, void *priv)
{
struct vcls *vcl;
......
......@@ -435,7 +435,7 @@ mgt_run(int dflag, const char *T_arg)
/*--------------------------------------------------------------------*/
void
mcf_server_startstop(struct cli *cli, char **av, void *priv)
mcf_server_startstop(struct cli *cli, const char * const *av, void *priv)
{
(void)av;
......@@ -452,7 +452,7 @@ mcf_server_startstop(struct cli *cli, char **av, void *priv)
/*--------------------------------------------------------------------*/
void
mcf_server_status(struct cli *cli, char **av, void *priv)
mcf_server_status(struct cli *cli, const char * const *av, void *priv)
{
(void)av;
(void)priv;
......
......@@ -62,7 +62,7 @@ static int cli_i = -1, cli_o = -1;
/*--------------------------------------------------------------------*/
static void
mcf_stats(struct cli *cli, char **av, void *priv)
mcf_stats(struct cli *cli, const char * const *av, void *priv)
{
(void)av;
......@@ -82,10 +82,11 @@ mcf_stats(struct cli *cli, char **av, void *priv)
*/
static void
mcf_passthru(struct cli *cli, char **av, void *priv)
mcf_passthru(struct cli *cli, const char * const *av, void *priv)
{
struct vsb *sb;
char *p;
const char *p;
char *q;
unsigned u;
int i;
......@@ -127,10 +128,10 @@ mcf_passthru(struct cli *cli, char **av, void *priv)
xxxassert(i == vsb_len(sb));
vsb_delete(sb);
i = cli_readres(cli_i, &u, &p, params->cli_timeout);
i = cli_readres(cli_i, &u, &q, params->cli_timeout);
cli_result(cli, u);
cli_out(cli, "%s", p);
free(p);
cli_out(cli, "%s", q);
free(q);
}
......
......@@ -766,7 +766,7 @@ static struct parspec parspec[] = {
/*--------------------------------------------------------------------*/
void
mcf_param_show(struct cli *cli, char **av, void *priv)
mcf_param_show(struct cli *cli, const char * const *av, void *priv)
{
struct parspec *pp;
const char *p, *q;
......@@ -854,7 +854,7 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val)
/*--------------------------------------------------------------------*/
void
mcf_param_set(struct cli *cli, char **av, void *priv)
mcf_param_set(struct cli *cli, const char * const *av, void *priv)
{
(void)priv;
......
......@@ -474,7 +474,7 @@ mgt_vcc_init(void)
/*--------------------------------------------------------------------*/
void
mcf_config_inline(struct cli *cli, char **av, void *priv)
mcf_config_inline(struct cli *cli, const char * const *av, void *priv)
{
char *vf, *p;
struct vsb *sb;
......@@ -504,7 +504,7 @@ mcf_config_inline(struct cli *cli, char **av, void *priv)
}
void
mcf_config_load(struct cli *cli, char **av, void *priv)
mcf_config_load(struct cli *cli, const char * const *av, void *priv)
{
char *vf;
struct vsb *sb;
......@@ -550,7 +550,7 @@ mcf_find_vcl(struct cli *cli, const char *name)
}
void
mcf_config_use(struct cli *cli, char **av, void *priv)
mcf_config_use(struct cli *cli, const char * const *av, void *priv)
{
unsigned status;
char *p;
......@@ -577,7 +577,7 @@ mcf_config_use(struct cli *cli, char **av, void *priv)
}
void
mcf_config_discard(struct cli *cli, char **av, void *priv)
mcf_config_discard(struct cli *cli, const char * const *av, void *priv)
{
unsigned status;
char *p;
......@@ -602,7 +602,7 @@ mcf_config_discard(struct cli *cli, char **av, void *priv)
}
void
mcf_config_list(struct cli *cli, char **av, void *priv)
mcf_config_list(struct cli *cli, const char * const *av, void *priv)
{
unsigned status;
char *p;
......@@ -628,7 +628,7 @@ mcf_config_list(struct cli *cli, char **av, void *priv)
* XXX: This should take an option argument to show all (include) files
*/
void
mcf_config_show(struct cli *cli, char **av, void *priv)
mcf_config_show(struct cli *cli, const char * const *av, void *priv)
{
struct vclprog *vp;
void *dlh, *sym;
......
......@@ -37,7 +37,7 @@
struct cli; /* NB: struct cli is opaque at this level. */
typedef void cli_func_t(struct cli*, char **av, void *priv);
typedef void cli_func_t(struct cli*, const char * const *av, void *priv);
struct cli_proto {
/* These must match the CLI_* macros in cli.h */
......
......@@ -46,7 +46,7 @@
*/
void
cli_func_help(struct cli *cli, char **av, void *priv)
cli_func_help(struct cli *cli, const char * const *av, void *priv)
{
struct cli_proto *cp;
......@@ -123,7 +123,7 @@ cli_dispatch(struct cli *cli, struct cli_proto *clp, const char *line)
break;
}
cp->func(cli, av, cp->priv);
cp->func(cli, (const char * const *)av, cp->priv);
} while (0);
FreeArgv(av);
......
......@@ -179,7 +179,7 @@ cli_readres(int fd, unsigned *status, char **ptr, double tmo)
/*--------------------------------------------------------------------*/
void
cli_func_ping(struct cli *cli, char **av, void *priv)
cli_func_ping(struct cli *cli, const char * const *av, void *priv)
{
time_t t;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment