[build-vmoddir] 2d1341bbb build: Merge vdir.c and misc.c into vmod_directors.c

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Thu Jan 7 11:40:10 UTC 2021


commit 2d1341bbb51b54dcea389717a3b1445005db08b3
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Thu Jan 7 11:50:42 2021 +0100

    build: Merge vdir.c and misc.c into vmod_directors.c

diff --git a/vmod/Makefile.am b/vmod/Makefile.am
index 8888a24c0..32331da09 100644
--- a/vmod/Makefile.am
+++ b/vmod/Makefile.am
@@ -36,11 +36,10 @@ libvmod_debug_la_SOURCES = \
 	vmod_debug_dyn.c
 
 libvmod_directors_la_SOURCES = \
-	vdir.c \
-	vdir.h \
+	vmod_directors.c \
+	vmod_directors.h \
 	fall_back.c \
 	hash.c \
-	misc.c \
 	random.c \
 	round_robin.c \
 	vmod_shard.c \
diff --git a/vmod/fall_back.c b/vmod/fall_back.c
index 425c1093a..ac79dae47 100644
--- a/vmod/fall_back.c
+++ b/vmod/fall_back.c
@@ -37,7 +37,7 @@
 
 #include "vcc_directors_if.h"
 
-#include "vdir.h"
+#include "vmod_directors.h"
 #include "vsb.h"
 #include "vbm.h"
 
diff --git a/vmod/hash.c b/vmod/hash.c
index eeddffca2..2ab92fb7c 100644
--- a/vmod/hash.c
+++ b/vmod/hash.c
@@ -35,7 +35,7 @@
 
 #include "cache/cache.h"
 
-#include "vdir.h"
+#include "vmod_directors.h"
 
 #include "vcc_directors_if.h"
 
diff --git a/vmod/misc.c b/vmod/misc.c
deleted file mode 100644
index f43875d61..000000000
--- a/vmod/misc.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*-
- * Copyright 2019 UPLEX - Nils Goroll Systemoptimierung
- * All rights reserved.
- *
- * Author: Nils Goroll <nils.goroll at uplex.de>
- *
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * 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.
- */
-
-#include "config.h"
-
-#include "vdef.h"
-#include "vrt.h"
-#include "vcl.h"
-
-#include "vcc_directors_if.h"
-
-VCL_BACKEND
-VPFX(lookup)(VRT_CTX, VCL_STRING name)
-{
-	if ((ctx->method & VCL_MET_TASK_H) == 0) {
-		VRT_fail(ctx,
-		    "lookup() may only be called from vcl_init / vcl_fini");
-		return (NULL);
-	}
-
-	return (VRT_LookupDirector(ctx, name));
-}
diff --git a/vmod/random.c b/vmod/random.c
index b18e1f6fd..8fe711931 100644
--- a/vmod/random.c
+++ b/vmod/random.c
@@ -37,7 +37,7 @@
 #include "vbm.h"
 #include "vrnd.h"
 
-#include "vdir.h"
+#include "vmod_directors.h"
 
 #include "vcc_directors_if.h"
 
diff --git a/vmod/round_robin.c b/vmod/round_robin.c
index 230bcb02e..b365a7116 100644
--- a/vmod/round_robin.c
+++ b/vmod/round_robin.c
@@ -37,7 +37,7 @@
 
 #include "vcc_directors_if.h"
 
-#include "vdir.h"
+#include "vmod_directors.h"
 
 struct vmod_directors_round_robin {
 	unsigned				magic;
diff --git a/vmod/vdir.c b/vmod/vmod_directors.c
similarity index 95%
rename from vmod/vdir.c
rename to vmod/vmod_directors.c
index a4a24212c..c9ed4fc57 100644
--- a/vmod/vdir.c
+++ b/vmod/vmod_directors.c
@@ -1,8 +1,10 @@
 /*-
  * Copyright (c) 2013-2015 Varnish Software AS
+ * Copyright 2019 UPLEX - Nils Goroll Systemoptimierung
  * All rights reserved.
  *
  * Author: Poul-Henning Kamp <phk at FreeBSD.org>
+ * Author: Nils Goroll <nils.goroll at uplex.de>
  *
  * SPDX-License-Identifier: BSD-2-Clause
  *
@@ -36,9 +38,24 @@
 #include "cache/cache.h"
 
 #include "vbm.h"
+#include "vcl.h"
 #include "vsb.h"
 
-#include "vdir.h"
+#include "vcc_directors_if.h"
+
+#include "vmod_directors.h"
+
+VCL_BACKEND
+VPFX(lookup)(VRT_CTX, VCL_STRING name)
+{
+	if ((ctx->method & VCL_MET_TASK_H) == 0) {
+		VRT_fail(ctx,
+		    "lookup() may only be called from vcl_init / vcl_fini");
+		return (NULL);
+	}
+
+	return (VRT_LookupDirector(ctx, name));
+}
 
 static void
 vdir_expand(struct vdir *vd, unsigned n)
diff --git a/vmod/vdir.h b/vmod/vmod_directors.h
similarity index 100%
rename from vmod/vdir.h
rename to vmod/vmod_directors.h


More information about the varnish-commit mailing list