r2667 - trunk/varnish-cache/bin/varnishtest

phk at projects.linpro.no phk at projects.linpro.no
Sun Jun 15 11:57:28 CEST 2008


Author: phk
Date: 2008-06-15 11:57:28 +0200 (Sun, 15 Jun 2008)
New Revision: 2667

Added:
   trunk/varnish-cache/bin/varnishtest/vtc_client.c
   trunk/varnish-cache/bin/varnishtest/vtc_stats.c
   trunk/varnish-cache/bin/varnishtest/vtc_varnish.c
   trunk/varnish-cache/bin/varnishtest/vtc_vcl.c
Modified:
   trunk/varnish-cache/bin/varnishtest/Makefile
   trunk/varnish-cache/bin/varnishtest/vtc.c
   trunk/varnish-cache/bin/varnishtest/vtc.h
   trunk/varnish-cache/bin/varnishtest/vtc_server.c
Log:
Hash out more files and cmd functions



Modified: trunk/varnish-cache/bin/varnishtest/Makefile
===================================================================
--- trunk/varnish-cache/bin/varnishtest/Makefile	2008-06-15 09:50:13 UTC (rev 2666)
+++ trunk/varnish-cache/bin/varnishtest/Makefile	2008-06-15 09:57:28 UTC (rev 2667)
@@ -2,6 +2,10 @@
 
 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
 

Modified: trunk/varnish-cache/bin/varnishtest/vtc.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc.c	2008-06-15 09:50:13 UTC (rev 2666)
+++ trunk/varnish-cache/bin/varnishtest/vtc.c	2008-06-15 09:57:28 UTC (rev 2667)
@@ -76,7 +76,7 @@
 				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 @@
 					}
 				}
 				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 @@
  * 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 }
 };
 

Modified: trunk/varnish-cache/bin/varnishtest/vtc.h
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc.h	2008-06-15 09:50:13 UTC (rev 2666)
+++ trunk/varnish-cache/bin/varnishtest/vtc.h	2008-06-15 09:57:28 UTC (rev 2667)
@@ -10,6 +10,10 @@
 
 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);
 

Added: trunk/varnish-cache/bin/varnishtest/vtc_client.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_client.c	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/vtc_client.c	2008-06-15 09:57:28 UTC (rev 2667)
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_client(char **av, void *priv)
+{
+
+	cmd_dump(av, priv);
+}

Modified: trunk/varnish-cache/bin/varnishtest/vtc_server.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_server.c	2008-06-15 09:50:13 UTC (rev 2666)
+++ trunk/varnish-cache/bin/varnishtest/vtc_server.c	2008-06-15 09:57:28 UTC (rev 2667)
@@ -7,7 +7,5 @@
 cmd_server(char **av, void *priv)
 {
 
-	printf("cmd_server(%p)\n", priv);
-	while (*av)
-		printf("\t<%s>\n", *av++);
+	cmd_dump(av, priv);
 }

Added: trunk/varnish-cache/bin/varnishtest/vtc_stats.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_stats.c	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/vtc_stats.c	2008-06-15 09:57:28 UTC (rev 2667)
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_stats(char **av, void *priv)
+{
+
+	cmd_dump(av, priv);
+}

Added: trunk/varnish-cache/bin/varnishtest/vtc_varnish.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_varnish.c	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/vtc_varnish.c	2008-06-15 09:57:28 UTC (rev 2667)
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_varnish(char **av, void *priv)
+{
+
+	cmd_dump(av, priv);
+}

Added: trunk/varnish-cache/bin/varnishtest/vtc_vcl.c
===================================================================
--- trunk/varnish-cache/bin/varnishtest/vtc_vcl.c	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/vtc_vcl.c	2008-06-15 09:57:28 UTC (rev 2667)
@@ -0,0 +1,11 @@
+
+#include <stdio.h>
+
+#include "vtc.h"
+
+void
+cmd_vcl(char **av, void *priv)
+{
+
+	cmd_dump(av, priv);
+}




More information about the varnish-commit mailing list