[master] 32d5bc3 Generate "tbl/vcc_types.h" from generate.py
Poul-Henning Kamp
phk at varnish-cache.org
Fri Oct 19 12:19:41 CEST 2012
commit 32d5bc323432144908cd5c7091c9443132646f0b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Fri Oct 19 10:19:04 2012 +0000
Generate "tbl/vcc_types.h" from generate.py
diff --git a/include/Makefile.am b/include/Makefile.am
index 15df374..2d15805 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -75,7 +75,7 @@ nobase_pkgdatainclude_HEADERS = \
vsb.h \
vsha256.h
-tbl/vrt_stv_var.h tbl/vcl_returns.h vcl.h vrt_obj.h: $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir)/include/vrt.h
+tbl/vrt_stv_var.h tbl/vcl_returns.h tbl/vcc_types.h vcl.h vrt_obj.h: $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir)/include/vrt.h
mkdir -p tbl
@PYTHON@ $(top_srcdir)/lib/libvcl/generate.py $(top_srcdir) $(top_builddir)
diff --git a/include/tbl/vcc_types.h b/include/tbl/vcc_types.h
deleted file mode 100644
index 469b56c..0000000
--- a/include/tbl/vcc_types.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*-
- * Copyright (c) 2010 Varnish Software AS
- * All rights reserved.
- *
- * Author: Poul-Henning Kamp <phk at phk.freebsd.dk>
- *
- * 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.
- *
- */
-
-/*lint -save -e525 -e539 */
-VCC_TYPE(VOID)
-VCC_TYPE(BACKEND)
-VCC_TYPE(BOOL)
-VCC_TYPE(INT)
-VCC_TYPE(TIME)
-VCC_TYPE(DURATION)
-VCC_TYPE(STRING)
-VCC_TYPE(STRING_LIST)
-VCC_TYPE(IP)
-VCC_TYPE(HEADER)
-VCC_TYPE(BYTES)
-VCC_TYPE(REAL)
-VCC_TYPE(ENUM)
-/*lint -restore */
diff --git a/lib/libvcl/generate.py b/lib/libvcl/generate.py
index ecc3a14..30dc711 100755
--- a/lib/libvcl/generate.py
+++ b/lib/libvcl/generate.py
@@ -484,6 +484,10 @@ vcltypes = {
'BYTES': "double",
'INT': "long",
'HEADER': "const char *",
+ 'VOID': "void",
+ 'REAL': "double",
+ 'STRING_LIST': "void*",
+ 'ENUM': "const char *",
}
#######################################################################
@@ -899,6 +903,19 @@ fo.write("""
fo.close()
#######################################################################
+ft = open(buildroot + "/include/tbl/vcc_types.h", "w")
+file_header(ft)
+
+ft.write("/*lint -save -e525 -e539 */\n")
+
+i = list(vcltypes.keys())
+i.sort()
+for j in i:
+ ft.write("VCC_TYPE(" + j + ")\n")
+ft.write("/*lint -restore */\n")
+ft.close()
+
+#######################################################################
fo = open(buildroot + "/include/tbl/vrt_stv_var.h", "w")
More information about the varnish-commit
mailing list