BIND 10 trac1980, updated. c39925183a24b63d5ca33446175b760c057238c9 [1980] Generate authors.bind from authors.xml
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed May 16 06:22:16 UTC 2012
The branch, trac1980 has been updated
via c39925183a24b63d5ca33446175b760c057238c9 (commit)
from e468025c7d318769ce621b0f6fe5c38d4895bad1 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit c39925183a24b63d5ca33446175b760c057238c9
Author: Mukund Sivaraman <muks at isc.org>
Date: Wed May 16 11:51:19 2012 +0530
[1980] Generate authors.bind from authors.xml
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/Makefile.am | 15 +++++
src/lib/datasrc/authors.cc | 55 ++++++++++++++++
src/lib/{asiodns/logger.cc => datasrc/authors.h} | 17 +++--
src/lib/datasrc/authors.xsl | 72 ++++++++++++++++++++++
src/lib/datasrc/static_datasrc.cc | 30 +++-------
src/lib/datasrc/tests/static_unittest.cc | 6 +-
6 files changed, 164 insertions(+), 31 deletions(-)
create mode 100644 src/lib/datasrc/authors.cc
copy src/lib/{asiodns/logger.cc => datasrc/authors.h} (78%)
create mode 100644 src/lib/datasrc/authors.xsl
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/Makefile.am b/src/lib/datasrc/Makefile.am
index 2cdb8ea..a165dc3 100644
--- a/src/lib/datasrc/Makefile.am
+++ b/src/lib/datasrc/Makefile.am
@@ -17,6 +17,7 @@ CLEANFILES += datasrc_config.h
lib_LTLIBRARIES = libdatasrc.la
libdatasrc_la_SOURCES = data_source.h data_source.cc
+libdatasrc_la_SOURCES += authors.h authors.cc
libdatasrc_la_SOURCES += static_datasrc.h static_datasrc.cc
libdatasrc_la_SOURCES += sqlite3_datasrc.h sqlite3_datasrc.cc
libdatasrc_la_SOURCES += query.h query.cc
@@ -60,3 +61,17 @@ datasrc_messages.h datasrc_messages.cc: Makefile datasrc_messages.mes
$(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/datasrc/datasrc_messages.mes
EXTRA_DIST = datasrc_messages.mes
+
+# for authors list
+authors.cc: $(top_srcdir)/authors.xml $(srcdir)/authors.xsl
+if HAVE_XSLTPROC
+ $(AM_V_GEN) $(XSLTPROC) $(srcdir)/authors.xsl $< > $(@) || rm -f $(@)
+else
+ @echo "*** xsltproc is required to regenerate $(@) ***"; exit 1;
+endif
+
+BUILT_SOURCES += \
+ authors.cc
+
+EXTRA_DIST += \
+ authors.xsl
diff --git a/src/lib/datasrc/authors.cc b/src/lib/datasrc/authors.cc
new file mode 100644
index 0000000..4be0ddc
--- /dev/null
+++ b/src/lib/datasrc/authors.cc
@@ -0,0 +1,55 @@
+
+/* NOTE: This file is auto-generated from authors.xml and authors.xsl. Do not edit it. */
+
+#include "authors.h"
+#include <cstdio>
+
+namespace isc {
+namespace datasrc {
+
+static const char * const authors[] =
+{
+ "Chen Zhengzhang (Jerry)",
+ "Dmitriy Volodin",
+ "Evan Hunt",
+ "Haidong Wang (Ocean)",
+ "Haikuo Zhang",
+ "Han Feng",
+ "Jelte Jansen",
+ "Jeremy C. Reed",
+ "Xie Jiagui (Kevin Tes)",
+ "Jin Jian",
+ "JINMEI Tatuya",
+ "Kazunori Fujiwara",
+ "Michael Graff",
+ "Michal Vaner",
+ "Mukund Sivaraman",
+ "Naoki Kambe",
+ "Shane Kerr",
+ "Shen Tingting",
+ "Stephen Morris",
+ "Yoshitaka Aharen",
+ "Zhang Likun",
+ NULL
+};
+
+static const char * const documenters[] =
+{
+ NULL
+};
+
+const char * const *
+get_authors (void)
+{
+ return authors;
+}
+
+const char * const *
+get_documenters (void)
+{
+ return documenters;
+}
+
+} // namespace isc::datasrc
+} // namespace isc
+
diff --git a/src/lib/datasrc/authors.h b/src/lib/datasrc/authors.h
new file mode 100644
index 0000000..bf239bf
--- /dev/null
+++ b/src/lib/datasrc/authors.h
@@ -0,0 +1,30 @@
+// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
+//
+// Permission to use, copy, modify, and/or distribute this software for any
+// purpose with or without fee is hereby granted, provided that the above
+// copyright notice and this permission notice appear in all copies.
+//
+// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
+// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
+// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
+// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+// PERFORMANCE OF THIS SOFTWARE.
+
+#ifndef __AUTHORS_H
+#define __AUTHORS_H
+
+namespace isc {
+namespace datasrc {
+
+const char * const *
+get_authors (void);
+
+const char * const *
+get_documenters (void);
+
+} // namespace isc::datasrc
+} // namespace isc
+
+#endif /* __AUTHORS_H */
diff --git a/src/lib/datasrc/authors.xsl b/src/lib/datasrc/authors.xsl
new file mode 100644
index 0000000..542f94c
--- /dev/null
+++ b/src/lib/datasrc/authors.xsl
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+
+ Simple XSL transformation to create a header file from
+ authors.xml. This file was adapted from GIMP.
+
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+
+ <xsl:output method="text" />
+
+ <xsl:template name="recent-contributor">
+ <xsl:param name="role" />
+ <xsl:apply-templates select="dc:contributor[contains(@role, $role)]" />
+ </xsl:template>
+
+ <xsl:template match="/dc:authors">
+<xsl:text>
+/* NOTE: This file is auto-generated from authors.xml and authors.xsl. Do not edit it. */
+
+#include "authors.h"
+#include <cstdio>
+
+namespace isc {
+namespace datasrc {
+
+static const char * const authors[] =
+{
+</xsl:text>
+ <xsl:call-template name="recent-contributor">
+ <xsl:with-param name="role" select="'author'"/>
+ </xsl:call-template>
+<xsl:text> NULL
+};
+</xsl:text>
+
+<xsl:text>
+static const char * const documenters[] =
+{
+</xsl:text>
+ <xsl:call-template name="recent-contributor">
+ <xsl:with-param name="role" select="'documenter'"/>
+ </xsl:call-template>
+<xsl:text> NULL
+};
+
+const char * const *
+get_authors (void)
+{
+ return authors;
+}
+
+const char * const *
+get_documenters (void)
+{
+ return documenters;
+}
+
+} // namespace isc::datasrc
+} // namespace isc
+
+</xsl:text>
+ </xsl:template>
+
+ <xsl:template match="dc:contributor"> "<xsl:apply-templates />",
+</xsl:template>
+
+</xsl:stylesheet>
diff --git a/src/lib/datasrc/static_datasrc.cc b/src/lib/datasrc/static_datasrc.cc
index 77d7a1d..40aacb9 100644
--- a/src/lib/datasrc/static_datasrc.cc
+++ b/src/lib/datasrc/static_datasrc.cc
@@ -12,7 +12,8 @@
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
-#include <config.h>
+#include "config.h"
+#include "authors.h"
#include <cassert>
@@ -69,27 +70,12 @@ StaticDataSrcImpl::StaticDataSrcImpl() :
{
authors = RRsetPtr(new RRset(authors_name, RRClass::CH(),
RRType::TXT(), RRTTL(0)));
- authors->addRdata(generic::TXT("Chen Zhengzhang")); // Jerry
- authors->addRdata(generic::TXT("Dmitriy Volodin"));
- authors->addRdata(generic::TXT("Evan Hunt"));
- authors->addRdata(generic::TXT("Haidong Wang")); // Ocean
- authors->addRdata(generic::TXT("Haikuo Zhang"));
- authors->addRdata(generic::TXT("Han Feng"));
- authors->addRdata(generic::TXT("Jelte Jansen"));
- authors->addRdata(generic::TXT("Jeremy C. Reed"));
- authors->addRdata(generic::TXT("Xie Jiagui")); // Kevin Tes
- authors->addRdata(generic::TXT("Jin Jian"));
- authors->addRdata(generic::TXT("JINMEI Tatuya"));
- authors->addRdata(generic::TXT("Kazunori Fujiwara"));
- authors->addRdata(generic::TXT("Michael Graff"));
- authors->addRdata(generic::TXT("Michal Vaner"));
- authors->addRdata(generic::TXT("Mukund Sivaraman"));
- authors->addRdata(generic::TXT("Naoki Kambe"));
- authors->addRdata(generic::TXT("Shane Kerr"));
- authors->addRdata(generic::TXT("Shen Tingting"));
- authors->addRdata(generic::TXT("Stephen Morris"));
- authors->addRdata(generic::TXT("Yoshitaka Aharen"));
- authors->addRdata(generic::TXT("Zhang Likun"));
+
+ const char * const * author_list = get_authors();
+ while (*author_list != NULL) {
+ authors->addRdata(generic::TXT(*author_list));
+ author_list++;
+ }
authors_ns = RRsetPtr(new RRset(authors_name, RRClass::CH(),
RRType::NS(), RRTTL(0)));
diff --git a/src/lib/datasrc/tests/static_unittest.cc b/src/lib/datasrc/tests/static_unittest.cc
index 2a19ecb..455bacd 100644
--- a/src/lib/datasrc/tests/static_unittest.cc
+++ b/src/lib/datasrc/tests/static_unittest.cc
@@ -52,15 +52,15 @@ protected:
version_data.push_back(PACKAGE_STRING);
// NOTE: in addition, the order of the following items matter.
- authors_data.push_back("Chen Zhengzhang");
+ authors_data.push_back("Chen Zhengzhang (Jerry)");
authors_data.push_back("Dmitriy Volodin");
authors_data.push_back("Evan Hunt");
- authors_data.push_back("Haidong Wang");
+ authors_data.push_back("Haidong Wang (Ocean)");
authors_data.push_back("Haikuo Zhang");
authors_data.push_back("Han Feng");
authors_data.push_back("Jelte Jansen");
authors_data.push_back("Jeremy C. Reed");
- authors_data.push_back("Xie Jiagui");
+ authors_data.push_back("Xie Jiagui (Kevin Tes)");
authors_data.push_back("Jin Jian");
authors_data.push_back("JINMEI Tatuya");
authors_data.push_back("Kazunori Fujiwara");
More information about the bind10-changes
mailing list