[master] aa35082 Simplify VUT options initialization

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Mon Sep 11 09:41:06 UTC 2017


commit aa35082583106c65d6c3166d169a9f11ee37d572
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Apr 18 09:27:48 2017 +0200

    Simplify VUT options initialization
    
    We don't need an indirection in a separate C file per VUT.

diff --git a/bin/varnishhist/Makefile.am b/bin/varnishhist/Makefile.am
index 281c05a..9c58a86 100644
--- a/bin/varnishhist/Makefile.am
+++ b/bin/varnishhist/Makefile.am
@@ -6,10 +6,10 @@ AM_CPPFLAGS = \
 
 bin_PROGRAMS = varnishhist
 
-varnishhist_SOURCES = varnishhist.c \
+varnishhist_SOURCES = \
+	varnishhist.c \
 	varnishhist_options.h \
-	varnishhist_profiles.h \
-	varnishhist_options.c
+	varnishhist_profiles.h
 
 varnishhist_CFLAGS = \
 	@SAN_CFLAGS@
diff --git a/bin/varnishhist/varnishhist.c b/bin/varnishhist/varnishhist.c
index 27afddc..6dc3aa9 100644
--- a/bin/varnishhist/varnishhist.c
+++ b/bin/varnishhist/varnishhist.c
@@ -42,6 +42,9 @@
 #include <string.h>
 #include <unistd.h>
 
+#define VOPT_DEFINITION
+#define VOPT_INC "varnishhist_options.h"
+
 #include "vdef.h"
 #include "vcurses.h"
 #include "vapi/vsl.h"
diff --git a/bin/varnishhist/varnishhist_options.c b/bin/varnishhist/varnishhist_options.c
deleted file mode 100644
index c4f5d27..0000000
--- a/bin/varnishhist/varnishhist_options.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * Copyright (c) 2014 Varnish Software AS
- * All rights reserved.
- *
- * Author: Martin Blix Grydeland <martin at varnish-software.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Option definitions for varnishhist
- */
-
-#include <stdlib.h>
-#define VOPT_DEFINITION
-#define VOPT_INC "varnishhist_options.h"
-#include "vapi/voptget.h"
diff --git a/bin/varnishlog/Makefile.am b/bin/varnishlog/Makefile.am
index 28d5e67..9fccdc5 100644
--- a/bin/varnishlog/Makefile.am
+++ b/bin/varnishlog/Makefile.am
@@ -8,8 +8,7 @@ bin_PROGRAMS = varnishlog
 
 varnishlog_SOURCES = \
 	varnishlog.c \
-	varnishlog_options.h \
-	varnishlog_options.c
+	varnishlog_options.h
 
 varnishlog_CFLAGS = \
 	@SAN_CFLAGS@
diff --git a/bin/varnishlog/varnishlog.c b/bin/varnishlog/varnishlog.c
index 87f98a3..8018f7b 100644
--- a/bin/varnishlog/varnishlog.c
+++ b/bin/varnishlog/varnishlog.c
@@ -39,6 +39,10 @@
 #include <errno.h>
 #include <stdint.h>
 
+#define VOPT_DEFINITION
+#define VOPT_INC "varnishlog_options.h"
+
+#include "vapi/vsm.h"
 #include "vapi/vsl.h"
 #include "vapi/voptget.h"
 #include "vas.h"
diff --git a/bin/varnishlog/varnishlog_options.c b/bin/varnishlog/varnishlog_options.c
deleted file mode 100644
index b12d3e4..0000000
--- a/bin/varnishlog/varnishlog_options.c
+++ /dev/null
@@ -1,35 +0,0 @@
-/*-
- * Copyright (c) 2006 Verdens Gang AS
- * Copyright (c) 2006-2014 Varnish Software AS
- * All rights reserved.
- *
- * Author: Martin Blix Grydeland <martin at varnish-software.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Option definitions for varnishlog
- */
-
-#include <stdlib.h>
-#define VOPT_DEFINITION
-#define VOPT_INC "varnishlog_options.h"
-#include "vapi/voptget.h"
diff --git a/bin/varnishncsa/Makefile.am b/bin/varnishncsa/Makefile.am
index b970910..cbed83b 100644
--- a/bin/varnishncsa/Makefile.am
+++ b/bin/varnishncsa/Makefile.am
@@ -9,7 +9,6 @@ bin_PROGRAMS = varnishncsa
 varnishncsa_SOURCES = \
 	varnishncsa.c \
 	varnishncsa_options.h \
-	varnishncsa_options.c \
 	base64.h \
 	base64.c
 
diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 99413a1..0fa722f 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -53,6 +53,9 @@
 #include <time.h>
 #include <math.h>
 
+#define VOPT_DEFINITION
+#define VOPT_INC "varnishncsa_options.h"
+
 #include "base64.h"
 #include "vapi/vsl.h"
 #include "vapi/voptget.h"
diff --git a/bin/varnishncsa/varnishncsa_options.c b/bin/varnishncsa/varnishncsa_options.c
deleted file mode 100644
index 44e3dfe..0000000
--- a/bin/varnishncsa/varnishncsa_options.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * Copyright (c) 2013-2015 Varnish Software AS
- * All rights reserved.
- *
- * Author: Martin Blix Grydeland <martin at varnish-software.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Option definitions for varnishlog
- */
-
-#include <stdlib.h>
-#define VOPT_DEFINITION
-#define VOPT_INC "varnishncsa_options.h"
-#include "vapi/voptget.h"
diff --git a/bin/varnishstat/Makefile.am b/bin/varnishstat/Makefile.am
index 9e404bb..c13bcd3 100644
--- a/bin/varnishstat/Makefile.am
+++ b/bin/varnishstat/Makefile.am
@@ -10,8 +10,7 @@ varnishstat_SOURCES = \
 	varnishstat.h \
 	varnishstat.c \
 	varnishstat_curses.c \
-	varnishstat_options.h \
-	varnishstat_options.c
+	varnishstat_options.h
 
 varnishstat_CFLAGS = \
 	@SAN_CFLAGS@
diff --git a/bin/varnishstat/varnishstat.c b/bin/varnishstat/varnishstat.c
index d114281..aa268c9 100644
--- a/bin/varnishstat/varnishstat.c
+++ b/bin/varnishstat/varnishstat.c
@@ -39,6 +39,9 @@
 #include <unistd.h>
 #include <math.h>
 
+#define VOPT_DEFINITION
+#define VOPT_INC "varnishstat_options.h"
+
 #include "vapi/voptget.h"
 #include "vapi/vsl.h"
 #include "vdef.h"
diff --git a/bin/varnishstat/varnishstat_options.c b/bin/varnishstat/varnishstat_options.c
deleted file mode 100644
index 60b8d28..0000000
--- a/bin/varnishstat/varnishstat_options.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * Copyright (c) 2016 Varnish Software AS
- * All rights reserved.
- *
- * Author: Federico G. Schwindt <fgsch at lodoss.net>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Option definitions for varnishstat
- */
-
-#include <stdlib.h>
-#define VOPT_DEFINITION
-#define VOPT_INC "varnishstat_options.h"
-#include "vapi/voptget.h"
diff --git a/bin/varnishtop/Makefile.am b/bin/varnishtop/Makefile.am
index 68adae8..d6923c1 100644
--- a/bin/varnishtop/Makefile.am
+++ b/bin/varnishtop/Makefile.am
@@ -6,9 +6,9 @@ AM_CPPFLAGS = \
 
 bin_PROGRAMS = varnishtop
 
-varnishtop_SOURCES = varnishtop.c \
-	varnishtop_options.h \
-	varnishtop_options.c
+varnishtop_SOURCES = \
+	varnishtop.c \
+	varnishtop_options.h
 
 
 varnishtop_CFLAGS = \
diff --git a/bin/varnishtop/varnishtop.c b/bin/varnishtop/varnishtop.c
index 1d7ebe0..07386ed 100644
--- a/bin/varnishtop/varnishtop.c
+++ b/bin/varnishtop/varnishtop.c
@@ -42,6 +42,9 @@
 #include <string.h>
 #include <unistd.h>
 
+#define VOPT_DEFINITION
+#define VOPT_INC "varnishtop_options.h"
+
 #include "vcurses.h"
 #include "vapi/vsl.h"
 #include "vapi/vsm.h"
diff --git a/bin/varnishtop/varnishtop_options.c b/bin/varnishtop/varnishtop_options.c
deleted file mode 100644
index 58d132e..0000000
--- a/bin/varnishtop/varnishtop_options.c
+++ /dev/null
@@ -1,34 +0,0 @@
-/*-
- * Copyright (c) 2014 Varnish Software AS
- * All rights reserved.
- *
- * Author: Martin Blix Grydeland <martin at varnish-software.com>
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * Option definitions for varnishtop
- */
-
-#include <stdlib.h>
-#define VOPT_DEFINITION
-#define VOPT_INC "varnishtop_options.h"
-#include "vapi/voptget.h"


More information about the varnish-commit mailing list