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; ...@@ -413,8 +413,8 @@ extern struct backend_method backend_method_round_robin;
/* cache_ban.c */ /* cache_ban.c */
void AddBan(const char *, int hash); void AddBan(const char *, int hash);
void BAN_Init(void); void BAN_Init(void);
void cli_func_url_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, char **av, void *priv); void cli_func_hash_purge(struct cli *cli, const char * const *av, void *priv);
void BAN_NewObj(struct object *o); void BAN_NewObj(struct object *o);
int BAN_CheckObject(struct object *o, const char *url, const char *hash); 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) ...@@ -102,7 +102,7 @@ BAN_CheckObject(struct object *o, const char *url, const char *hash)
} }
void 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; (void)priv;
...@@ -111,7 +111,7 @@ cli_func_url_purge(struct cli *cli, char **av, void *priv) ...@@ -111,7 +111,7 @@ cli_func_url_purge(struct cli *cli, char **av, void *priv)
} }
void 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; (void)priv;
......
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static void 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; (void)cli;
......
...@@ -434,7 +434,7 @@ WRK_Init(void) ...@@ -434,7 +434,7 @@ WRK_Init(void)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
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; (void)cli;
......
...@@ -195,7 +195,7 @@ VCL_Load(const char *fn, const char *name, struct cli *cli) ...@@ -195,7 +195,7 @@ VCL_Load(const char *fn, const char *name, struct cli *cli)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void 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; struct vcls *vcl;
...@@ -210,7 +210,7 @@ cli_func_config_list(struct cli *cli, char **av, void *priv) ...@@ -210,7 +210,7 @@ cli_func_config_list(struct cli *cli, char **av, void *priv)
} }
void 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; (void)av;
...@@ -221,7 +221,7 @@ cli_func_config_load(struct cli *cli, char **av, void *priv) ...@@ -221,7 +221,7 @@ cli_func_config_load(struct cli *cli, char **av, void *priv)
} }
void 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; struct vcls *vcl;
...@@ -257,7 +257,7 @@ cli_func_config_discard(struct cli *cli, char **av, void *priv) ...@@ -257,7 +257,7 @@ cli_func_config_discard(struct cli *cli, char **av, void *priv)
} }
void 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; struct vcls *vcl;
......
...@@ -435,7 +435,7 @@ mgt_run(int dflag, const char *T_arg) ...@@ -435,7 +435,7 @@ mgt_run(int dflag, const char *T_arg)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void 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; (void)av;
...@@ -452,7 +452,7 @@ mcf_server_startstop(struct cli *cli, char **av, void *priv) ...@@ -452,7 +452,7 @@ mcf_server_startstop(struct cli *cli, char **av, void *priv)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void 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)av;
(void)priv; (void)priv;
......
...@@ -62,7 +62,7 @@ static int cli_i = -1, cli_o = -1; ...@@ -62,7 +62,7 @@ static int cli_i = -1, cli_o = -1;
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static void static void
mcf_stats(struct cli *cli, char **av, void *priv) mcf_stats(struct cli *cli, const char * const *av, void *priv)
{ {
(void)av; (void)av;
...@@ -82,10 +82,11 @@ mcf_stats(struct cli *cli, char **av, void *priv) ...@@ -82,10 +82,11 @@ mcf_stats(struct cli *cli, char **av, void *priv)
*/ */
static void 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; struct vsb *sb;
char *p; const char *p;
char *q;
unsigned u; unsigned u;
int i; int i;
...@@ -127,10 +128,10 @@ mcf_passthru(struct cli *cli, char **av, void *priv) ...@@ -127,10 +128,10 @@ mcf_passthru(struct cli *cli, char **av, void *priv)
xxxassert(i == vsb_len(sb)); xxxassert(i == vsb_len(sb));
vsb_delete(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_result(cli, u);
cli_out(cli, "%s", p); cli_out(cli, "%s", q);
free(p); free(q);
} }
......
...@@ -766,7 +766,7 @@ static struct parspec parspec[] = { ...@@ -766,7 +766,7 @@ static struct parspec parspec[] = {
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void 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; struct parspec *pp;
const char *p, *q; const char *p, *q;
...@@ -854,7 +854,7 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val) ...@@ -854,7 +854,7 @@ MCF_ParamSet(struct cli *cli, const char *param, const char *val)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void 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; (void)priv;
......
...@@ -474,7 +474,7 @@ mgt_vcc_init(void) ...@@ -474,7 +474,7 @@ mgt_vcc_init(void)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
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; char *vf, *p;
struct vsb *sb; struct vsb *sb;
...@@ -504,7 +504,7 @@ mcf_config_inline(struct cli *cli, char **av, void *priv) ...@@ -504,7 +504,7 @@ mcf_config_inline(struct cli *cli, char **av, void *priv)
} }
void 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; char *vf;
struct vsb *sb; struct vsb *sb;
...@@ -550,7 +550,7 @@ mcf_find_vcl(struct cli *cli, const char *name) ...@@ -550,7 +550,7 @@ mcf_find_vcl(struct cli *cli, const char *name)
} }
void 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; unsigned status;
char *p; char *p;
...@@ -577,7 +577,7 @@ mcf_config_use(struct cli *cli, char **av, void *priv) ...@@ -577,7 +577,7 @@ mcf_config_use(struct cli *cli, char **av, void *priv)
} }
void 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; unsigned status;
char *p; char *p;
...@@ -602,7 +602,7 @@ mcf_config_discard(struct cli *cli, char **av, void *priv) ...@@ -602,7 +602,7 @@ mcf_config_discard(struct cli *cli, char **av, void *priv)
} }
void 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; unsigned status;
char *p; char *p;
...@@ -628,7 +628,7 @@ mcf_config_list(struct cli *cli, char **av, void *priv) ...@@ -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 * XXX: This should take an option argument to show all (include) files
*/ */
void 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; struct vclprog *vp;
void *dlh, *sym; void *dlh, *sym;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
struct cli; /* NB: struct cli is opaque at this level. */ 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 { struct cli_proto {
/* These must match the CLI_* macros in cli.h */ /* These must match the CLI_* macros in cli.h */
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
*/ */
void 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; struct cli_proto *cp;
...@@ -123,7 +123,7 @@ cli_dispatch(struct cli *cli, struct cli_proto *clp, const char *line) ...@@ -123,7 +123,7 @@ cli_dispatch(struct cli *cli, struct cli_proto *clp, const char *line)
break; break;
} }
cp->func(cli, av, cp->priv); cp->func(cli, (const char * const *)av, cp->priv);
} while (0); } while (0);
FreeArgv(av); FreeArgv(av);
......
...@@ -179,7 +179,7 @@ cli_readres(int fd, unsigned *status, char **ptr, double tmo) ...@@ -179,7 +179,7 @@ cli_readres(int fd, unsigned *status, char **ptr, double tmo)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
void 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; 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