]> err.no Git - varnish/commitdiff
Hash out more files and cmd functions
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 15 Jun 2008 09:57:28 +0000 (09:57 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Sun, 15 Jun 2008 09:57:28 +0000 (09:57 +0000)
git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2667 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishtest/Makefile
varnish-cache/bin/varnishtest/vtc.c
varnish-cache/bin/varnishtest/vtc.h
varnish-cache/bin/varnishtest/vtc_client.c [new file with mode: 0644]
varnish-cache/bin/varnishtest/vtc_server.c
varnish-cache/bin/varnishtest/vtc_stats.c [new file with mode: 0644]
varnish-cache/bin/varnishtest/vtc_varnish.c [new file with mode: 0644]
varnish-cache/bin/varnishtest/vtc_vcl.c [new file with mode: 0644]

index cf8b40dd72b4bd7d92eb08d88221a0f74b56fc7c..f704e3b0a6d1b39d178ef04b6c0f2be77b83495d 100644 (file)
@@ -2,6 +2,10 @@ PROG           =       vtc
 
 SRCS           +=      vtc.c
 SRCS           +=      vtc_server.c
+SRCS           +=      vtc_client.c
+SRCS           +=      vtc_vcl.c
+SRCS           +=      vtc_stats.c
+SRCS           +=      vtc_varnish.c
 
 CFLAGS         +=      -g
 
index ae9ae16e76f284bef9a85136c77083f5fb04e4ee..f2f0cf31e739f00d7eebb8198d8df6681fcf9fae 100644 (file)
@@ -76,7 +76,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv)
                                p++;
                        } else if (*p == '{') { /* Braces */
                                nest_brace = 0;
-                               token_s[tn] = p + 1;
+                               token_s[tn] = p;
                                for (; *p != '\0'; p++) {
                                        if (*p == '{')
                                                nest_brace++;
@@ -86,8 +86,7 @@ parse_string(char *buf, const struct cmds *cmd, void *priv)
                                        }
                                }
                                assert(*p == '}');
-                               token_e[tn++] = p;
-                               p++;    /* Swallow closing brace */
+                               token_e[tn++] = ++p;
                        } else { /* other tokens */
                                token_s[tn] = p;
                                for (; *p != '\0' && !isspace(*p); p++)
@@ -119,20 +118,21 @@ parse_string(char *buf, const struct cmds *cmd, void *priv)
  * Execute a file
  */
 
-static void
-cmd_bogo(char **av, void *priv)
+void
+cmd_dump(char **av, void *priv)
 {
-       printf("cmd_bogo(%p)\n", priv);
+
+       printf("cmd_dump(%p)\n", priv);
        while (*av)
                printf("\t<%s>\n", *av++);
 }
 
 static struct cmds cmds[] = {
        { "server",     cmd_server },
-       { "client",     cmd_bogo },
-       { "vcl",        cmd_bogo },
-       { "stats",      cmd_bogo },
-       { "varnish",    cmd_bogo },
+       { "client",     cmd_client },
+       { "vcl",        cmd_vcl },
+       { "stats",      cmd_stats },
+       { "varnish",    cmd_varnish },
        { NULL,         NULL }
 };
 
index b73f2d5d082cc1d0dce8a3f6e7ff64606dc127c4..0b8d3c38417d761b56b3fdc831c86fd73f00289e 100644 (file)
@@ -10,6 +10,10 @@ struct cmds {
 
 void parse_string(char *buf, const struct cmds *cmd, void *priv);
 
-/* vtc_server.c */
+void cmd_dump(char **av, void *priv);
 void cmd_server(char **av, void *priv);
+void cmd_client(char **av, void *priv);
+void cmd_vcl(char **av, void *priv);
+void cmd_stats(char **av, void *priv);
+void cmd_varnish(char **av, void *priv);
 
diff --git a/varnish-cache/bin/varnishtest/vtc_client.c b/varnish-cache/bin/varnishtest/vtc_client.c
new file mode 100644 (file)
index 0000000..bc68624
--- /dev/null
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_client(char **av, void *priv)
+{
+
+       cmd_dump(av, priv);
+}
index b2a5c46bcca944d493b72e42de5f727e3cc5dd4f..debfeb2585b8d21875325ae5eade9407f45998db 100644 (file)
@@ -7,7 +7,5 @@ void
 cmd_server(char **av, void *priv)
 {
 
-       printf("cmd_server(%p)\n", priv);
-       while (*av)
-               printf("\t<%s>\n", *av++);
+       cmd_dump(av, priv);
 }
diff --git a/varnish-cache/bin/varnishtest/vtc_stats.c b/varnish-cache/bin/varnishtest/vtc_stats.c
new file mode 100644 (file)
index 0000000..1b68ceb
--- /dev/null
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_stats(char **av, void *priv)
+{
+
+       cmd_dump(av, priv);
+}
diff --git a/varnish-cache/bin/varnishtest/vtc_varnish.c b/varnish-cache/bin/varnishtest/vtc_varnish.c
new file mode 100644 (file)
index 0000000..1db6c3e
--- /dev/null
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_varnish(char **av, void *priv)
+{
+
+       cmd_dump(av, priv);
+}
diff --git a/varnish-cache/bin/varnishtest/vtc_vcl.c b/varnish-cache/bin/varnishtest/vtc_vcl.c
new file mode 100644 (file)
index 0000000..3d6f4a3
--- /dev/null
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_vcl(char **av, void *priv)
+{
+
+       cmd_dump(av, priv);
+}