]> err.no Git - varnish/commitdiff
Macroize the method function arguments
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 22 Jun 2008 22:00:02 +0000 (22:00 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 22 Jun 2008 22:00:02 +0000 (22:00 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2777 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/vtc.c
varnish-cache/bin/varnishtest/vtc.h
varnish-cache/bin/varnishtest/vtc_client.c
varnish-cache/bin/varnishtest/vtc_http.c
varnish-cache/bin/varnishtest/vtc_server.c
varnish-cache/bin/varnishtest/vtc_stats.c
varnish-cache/bin/varnishtest/vtc_varnish.c

index 6b73271fd1c0640c82a8cddf35a5850c67600368..0f314f17edbdbc7c18af29d1d85deca164307ab9 100644 (file)
@@ -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);
index 75464d3a54859b2a8a7021a08dbd49e43416b0f5..0c0751fa951404fb28cb3fdcd77e5846d6f21627 100644 (file)
  * $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;
index d9574606cd4b5a2246502dd0b98f5b71df8f368e..7349be614e4d37c9b7ba96bcf3cc44c66cbea3a0 100644 (file)
@@ -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 */
index 6232753807ad742708d700a89700215d7e3a9dae..def5f93a6bae64a00e948981446fa6364db81033 100644 (file)
@@ -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"));
index d275517e20ac440af19394f4fabf70ce382ffa77..026296a007fc2329f7fbbb17fb69f32e2e65fa6a 100644 (file)
@@ -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 */
index eb23289cfa98b7dc5feac312b5341454996b38bb..1b84632dfd838bf5efb924b4ca5157bb5ea1aa7f 100644 (file)
@@ -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);
 }
index 2075c83070c64af9bf29a558310691988f24aa2b..bb290d2f5f8d4aa0210d05a5f40e02bc0c0e33bf 100644 (file)
@@ -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 */