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

Macroize the method function arguments



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@2777 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 25c68ea3
......@@ -172,7 +172,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv)
}
assert(cp->cmd != NULL);
cp->cmd(token_s, priv);
cp->cmd(token_s, priv, cmd);
}
}
......@@ -185,7 +185,7 @@ reset_cmds(const struct cmds *cmd)
{
for (; cmd->name != NULL; cmd++)
cmd->cmd(NULL, NULL);
cmd->cmd(NULL, NULL, NULL);
}
/**********************************************************************
......@@ -193,10 +193,11 @@ reset_cmds(const struct cmds *cmd)
*/
static void
cmd_test(char **av, void *priv)
cmd_test(CMD_ARGS)
{
(void)priv;
(void)cmd;
if (av == NULL)
return;
......@@ -212,11 +213,12 @@ cmd_test(char **av, void *priv)
*/
void
cmd_delay(char **av, void *priv)
cmd_delay(CMD_ARGS)
{
double f;
(void)priv;
(void)cmd;
if (av == NULL)
return;
AN(av[1]);
......@@ -234,9 +236,10 @@ cmd_delay(char **av, void *priv)
*/
void
cmd_dump(char **av, void *priv)
cmd_dump(CMD_ARGS)
{
(void)cmd;
if (av == NULL)
return;
printf("cmd_dump(%p)\n", priv);
......
......@@ -26,10 +26,12 @@
* $Id$
*/
typedef void cmd_f(char **av, void *priv);
struct vsb;
struct vtclog;
struct cmds;
#define CMD_ARGS char **av, void *priv, const struct cmds *cmd
typedef void cmd_f(CMD_ARGS);
struct cmds {
const char *name;
......
......@@ -161,11 +161,12 @@ client_run(struct client *c)
*/
void
cmd_client(char **av, void *priv)
cmd_client(CMD_ARGS)
{
struct client *c, *c2;
(void)priv;
(void)cmd;
if (av == NULL) {
/* Reset and free */
......
......@@ -116,13 +116,14 @@ cmd_var_resolve(struct http *hp, char *spec)
}
static void
cmd_http_expect(char **av, void *priv)
cmd_http_expect(CMD_ARGS)
{
struct http *hp;
char *lhs;
char *cmp;
char *rhs;
(void)cmd;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
assert(!strcmp(av[0], "expect"));
av++;
......@@ -305,10 +306,11 @@ http_rxhdr(struct http *hp)
*/
static void
cmd_http_rxresp(char **av, void *priv)
cmd_http_rxresp(CMD_ARGS)
{
struct http *hp;
(void)cmd;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(hp->client);
assert(!strcmp(av[0], "rxresp"));
......@@ -329,7 +331,7 @@ cmd_http_rxresp(char **av, void *priv)
*/
static void
cmd_http_txresp(char **av, void *priv)
cmd_http_txresp(CMD_ARGS)
{
struct http *hp;
struct vsb *vsb;
......@@ -341,6 +343,7 @@ cmd_http_txresp(char **av, void *priv)
const char *nl = "\r\n";
int l;
(void)cmd;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AZ(hp->client);
assert(!strcmp(av[0], "txresp"));
......@@ -408,10 +411,11 @@ cmd_http_txresp(char **av, void *priv)
*/
static void
cmd_http_rxreq(char **av, void *priv)
cmd_http_rxreq(CMD_ARGS)
{
struct http *hp;
(void)cmd;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AZ(hp->client);
assert(!strcmp(av[0], "rxreq"));
......@@ -432,7 +436,7 @@ cmd_http_rxreq(char **av, void *priv)
*/
static void
cmd_http_txreq(char **av, void *priv)
cmd_http_txreq(CMD_ARGS)
{
struct http *hp;
struct vsb *vsb;
......@@ -444,6 +448,7 @@ cmd_http_txreq(char **av, void *priv)
const char *nl = "\r\n";
int l;
(void)cmd;
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
AN(hp->client);
assert(!strcmp(av[0], "txreq"));
......
......@@ -203,11 +203,12 @@ cmd_server_genvcl(struct vsb *vsb)
*/
void
cmd_server(char **av, void *priv)
cmd_server(CMD_ARGS)
{
struct server *s, *s2;
(void)priv;
(void)cmd;
if (av == NULL) {
/* Reset and free */
......
......@@ -32,8 +32,8 @@
#include "vtc.h"
void
cmd_stats(char **av, void *priv)
cmd_stats(CMD_ARGS)
{
cmd_dump(av, priv);
cmd_dump(av, priv, cmd);
}
......@@ -409,11 +409,12 @@ varnish_vclbackend(struct varnish *v, char *vcl)
*/
void
cmd_varnish(char **av, void *priv)
cmd_varnish(CMD_ARGS)
{
struct varnish *v, *v2;
(void)priv;
(void)cmd;
if (av == NULL) {
/* Reset and free */
......
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