diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-05-14 21:29:29 -0700 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-05-14 21:29:29 -0700 |
commit | e897aa91a2a5c68a2f795f6a0a995600f13a85f8 (patch) | |
tree | 75a17430ba9cec822651b881003f66da8c89d7f9 | |
parent | 3bf332a7b77e9ce9e5eb0a1dfd5f64f238f4f17f (diff) |
Convert to extension-less headers for API
37 files changed, 106 insertions, 78 deletions
diff --git a/configure.ac b/configure.ac index 8a81bde..9354db9 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ AC_PREREQ(2.60) AC_INIT([libstudxml], [__value__(version)], [studxml-users@codesynthesis.com]) AC_CONFIG_AUX_DIR([config]) AC_CONFIG_MACRO_DIR([m4]) -AC_CONFIG_SRCDIR([xml/exception.hxx]) +AC_CONFIG_SRCDIR([xml/exception]) AM_INIT_AUTOMAKE([-Wall -Werror foreign nostdinc subdir-objects dist-bzip2 dist-zip tar-ustar]) m4_equote()[m4_ifdef]m4_dquote()([AM_PROG_AR], [AM_PROG_AR]) # Required by automake 1.12. diff --git a/doc/intro.xhtml b/doc/intro.xhtml index 46eb03a..ea0b8c9 100644 --- a/doc/intro.xhtml +++ b/doc/intro.xhtml @@ -278,7 +278,7 @@ and US-ASCII input encodings.</p> <pre class="c++"> -#include <xml/parser.hxx> +#include <xml/parser> namespace xml { @@ -287,7 +287,7 @@ namespace xml </pre> <pre class="c++"> -#include <xml/serializer.hxx> +#include <xml/serializer> namespace xml { @@ -595,7 +595,7 @@ for (parser::event_type e: p) class to represent such names:</p> <pre class="c++"> -#include <xml/qname.hxx> +#include <xml/qname> namespace xml { @@ -993,6 +993,8 @@ cerr << p.next () << endl; the table:</p> <pre class="c++"> +#include <xml/content> + namespace xml { enum class content diff --git a/examples/hybrid/dom.cxx b/examples/hybrid/dom.cxx index cd1e0e0..c2ae6fd 100644 --- a/examples/hybrid/dom.cxx +++ b/examples/hybrid/dom.cxx @@ -1,8 +1,8 @@ // file : examples/hybrid/dom.cxx // copyright : not copyrighted - public domain -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> #include "dom.hxx" diff --git a/examples/hybrid/dom.hxx b/examples/hybrid/dom.hxx index 3e1f8e3..4d99feb 100644 --- a/examples/hybrid/dom.hxx +++ b/examples/hybrid/dom.hxx @@ -8,8 +8,8 @@ #include <string> #include <vector> -#include <xml/qname.hxx> -#include <xml/forward.hxx> +#include <xml/qname> +#include <xml/forward> // A simple, DOM-like in-memory representation of raw XML. It only supports // empty, simple, and complex content (no mixed content) and is not diff --git a/examples/hybrid/driver.cxx b/examples/hybrid/driver.cxx index ca7421a..c1f5a0e 100644 --- a/examples/hybrid/driver.cxx +++ b/examples/hybrid/driver.cxx @@ -4,8 +4,8 @@ #include <fstream> #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> #include "dom.hxx" diff --git a/examples/hybrid/makefile b/examples/hybrid/makefile index 8e4a4f8..fe9439b 100644 --- a/examples/hybrid/makefile +++ b/examples/hybrid/makefile @@ -32,7 +32,7 @@ $(out_base)/: $(driver) # $(dist): name := $(subst $(src_root)/examples/,,$(src_base)) $(dist): sources := $(cxx_tun) -$(dist): extras := README dom.xml +$(dist): extras := README position.xml $(dist): export extra_sources := $(filter-out driver.cxx,$(cxx_tun)) $(dist): export extra_headers := dom.hxx $(dist): export extra_dist := $(extras) $(name)-vc9.vcproj \ diff --git a/examples/inheritance/driver.cxx b/examples/inheritance/driver.cxx index d6cd5ea..c07a0ea 100644 --- a/examples/inheritance/driver.cxx +++ b/examples/inheritance/driver.cxx @@ -4,8 +4,8 @@ #include <fstream> #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> #include "position.hxx" diff --git a/examples/inheritance/position.cxx b/examples/inheritance/position.cxx index 9dde29e..1123efa 100644 --- a/examples/inheritance/position.cxx +++ b/examples/inheritance/position.cxx @@ -3,8 +3,8 @@ #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> #include "position.hxx" diff --git a/examples/inheritance/position.hxx b/examples/inheritance/position.hxx index d86995d..d6f3a3f 100644 --- a/examples/inheritance/position.hxx +++ b/examples/inheritance/position.hxx @@ -8,7 +8,7 @@ #include <vector> #include <iosfwd> -#include <xml/forward.hxx> // xml::{parser,serializer} forward declarations. +#include <xml/forward> // xml::{parser,serializer} forward declarations. class position { diff --git a/examples/performance/driver.cxx b/examples/performance/driver.cxx index 7d096d6..403e821 100644 --- a/examples/performance/driver.cxx +++ b/examples/performance/driver.cxx @@ -5,7 +5,7 @@ #include <fstream> #include <iostream> -#include <xml/parser.hxx> +#include <xml/parser> #include "time.hxx" diff --git a/examples/persistence/driver.cxx b/examples/persistence/driver.cxx index d62dd3b..8792716 100644 --- a/examples/persistence/driver.cxx +++ b/examples/persistence/driver.cxx @@ -4,8 +4,8 @@ #include <fstream> #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> #include "position.hxx" diff --git a/examples/persistence/position.cxx b/examples/persistence/position.cxx index 9f4f701..a0430b4 100644 --- a/examples/persistence/position.cxx +++ b/examples/persistence/position.cxx @@ -3,8 +3,8 @@ #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> #include "position.hxx" diff --git a/examples/persistence/position.hxx b/examples/persistence/position.hxx index 26b04f5..fb8c897 100644 --- a/examples/persistence/position.hxx +++ b/examples/persistence/position.hxx @@ -8,7 +8,7 @@ #include <vector> #include <iosfwd> -#include <xml/forward.hxx> // xml::{parser,serializer} forward declarations. +#include <xml/forward> // xml::{parser,serializer} forward declarations. enum object_type {building, mountain}; diff --git a/examples/processing/driver.cxx b/examples/processing/driver.cxx index 97669c5..18950b2 100644 --- a/examples/processing/driver.cxx +++ b/examples/processing/driver.cxx @@ -5,9 +5,9 @@ #include <fstream> #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> -#include <xml/value-traits.hxx> +#include <xml/parser> +#include <xml/serializer> +#include <xml/value-traits> using namespace std; using namespace xml; diff --git a/examples/roundtrip/driver.cxx b/examples/roundtrip/driver.cxx index b83988b..9b8d512 100644 --- a/examples/roundtrip/driver.cxx +++ b/examples/roundtrip/driver.cxx @@ -5,8 +5,8 @@ #include <fstream> #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> using namespace std; using namespace xml; diff --git a/examples/template/Makefile.am b/examples/template/Makefile.am index 64e4d1f..37d9509 100644 --- a/examples/template/Makefile.am +++ b/examples/template/Makefile.am @@ -11,3 +11,9 @@ AM_CPPFLAGS = -I'$(top_builddir)' -I'$(top_srcdir)' TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=example=1; export example; + +# Make sure make doesn't try to build the no-extension headers +# thinking that they are executable. Those are pulled in through +# auto-generated dependencies. +# +__foreach_w__(__f,__path__(xml_headers),$(top_srcdir)/xml/__f ): ; @: diff --git a/tests/parser/driver.cxx b/tests/parser/driver.cxx index 2afe522..4e0fbae 100644 --- a/tests/parser/driver.cxx +++ b/tests/parser/driver.cxx @@ -12,7 +12,7 @@ #include <iostream> #include <sstream> -#include <xml/parser.hxx> +#include <xml/parser> using namespace std; using namespace xml; diff --git a/tests/roundtrip/driver.cxx b/tests/roundtrip/driver.cxx index 48c96b4..e7a07f8 100644 --- a/tests/roundtrip/driver.cxx +++ b/tests/roundtrip/driver.cxx @@ -7,8 +7,8 @@ #include <cassert> #include <iostream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> using namespace std; using namespace xml; diff --git a/tests/serializer/driver.cxx b/tests/serializer/driver.cxx index 0f22107..796a384 100644 --- a/tests/serializer/driver.cxx +++ b/tests/serializer/driver.cxx @@ -11,7 +11,7 @@ #include <iostream> #include <sstream> -#include <xml/serializer.hxx> +#include <xml/serializer> using namespace std; using namespace xml; diff --git a/tests/template/Makefile.am b/tests/template/Makefile.am index 9d198f1..d8b5b50 100644 --- a/tests/template/Makefile.am +++ b/tests/template/Makefile.am @@ -13,3 +13,9 @@ TESTS=$(top_builddir)/tester TESTS_ENVIRONMENT=example=; export example; CLEANFILES = test.out + +# Make sure make doesn't try to build the no-extension headers +# thinking that they are executable. Those are pulled in through +# auto-generated dependencies. +# +__foreach_w__(__f,__path__(xml_headers),$(top_srcdir)/xml/__f ): ; @: diff --git a/xml/Makefile.am b/xml/Makefile.am index ebe357e..46be59f 100644 --- a/xml/Makefile.am +++ b/xml/Makefile.am @@ -20,5 +20,12 @@ endif libstudxml_la_SOURCES += __path__(genx_sources) nobase_studxmlinclude_HEADERS += __path__(genx_headers) +nobase_studxmlinclude_HEADERS += __path__(xml_headers) + +# Make sure make doesn't try to build the no-extension headers +# thinking that they are executable. +# +__foreach_w__(__f,__path__(xml_headers),__f $(top_srcdir)/xml/__f ): ; @: + AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -DLIBSTUDXML_DYNAMIC_LIB AM_LDFLAGS = -release __value__(interface_version) -no-undefined diff --git a/xml/content.hxx b/xml/content index 575ef1d..e37607f 100644 --- a/xml/content.hxx +++ b/xml/content @@ -1,9 +1,9 @@ -// file : xml/content.hxx +// file : xml/content -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_CONTENT_HXX -#define XML_CONTENT_HXX +#ifndef XML_CONTENT +#define XML_CONTENT #include <xml/details/pre.hxx> @@ -32,4 +32,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_CONTENT_HXX +#endif // XML_CONTENT diff --git a/xml/exception.hxx b/xml/exception index c9895bb..1fe1eb2 100644 --- a/xml/exception.hxx +++ b/xml/exception @@ -1,9 +1,9 @@ -// file : xml/exception.hxx +// file : xml/exception -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_EXCEPTION_HXX -#define XML_EXCEPTION_HXX +#ifndef XML_EXCEPTION +#define XML_EXCEPTION #include <xml/details/pre.hxx> @@ -18,4 +18,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_EXCEPTION_HXX +#endif // XML_EXCEPTION diff --git a/xml/forward.hxx b/xml/forward index bacd5f5..8d474c7 100644 --- a/xml/forward.hxx +++ b/xml/forward @@ -1,9 +1,9 @@ -// file : xml/forward.hxx +// file : xml/forward -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_FORWARD_HXX -#define XML_FORWARD_HXX +#ifndef XML_FORWARD +#define XML_FORWARD #include <xml/details/pre.hxx> @@ -16,4 +16,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_FORWARD_HXX +#endif // XML_FORWARD diff --git a/xml/makefile b/xml/makefile index 6c8f3b9..52203aa 100644 --- a/xml/makefile +++ b/xml/makefile @@ -5,6 +5,7 @@ include $(dir $(lastword $(MAKEFILE_LIST)))../build/bootstrap.make sources := qname.cxx parser.cxx serializer.cxx value-traits.cxx +xml_headers := content exception forward qname parser serializer value-traits # Expat. # @@ -72,6 +73,12 @@ $(out_base)/: $(studxml.l) # Dist. # + +# Set it for the out_root so that it is visible in examples/tests. See +# Makefile.am for why we need it there. +# +$(our_root)/%.dist: export xml_headers := $(xml_headers) + $(dist): export sources := $(sources) $(dist): export expat_sources := $(expat_sources) $(dist): export expat_headers := $(expat_headers) @@ -89,7 +96,7 @@ $(dist): export interface_version = $(shell sed -e \ $(dist): $(call dist-data,$(sources) $(expat_sources) $(genx_sources)) - $(call dist-data,$(headers) $(expat_headers) $(genx_headers)) + $(call dist-data,$(headers) $(xml_headers) $(expat_headers) $(genx_headers)) $(call dist-data,$(data_dist) details/config.h.in) $(call meta-vc9proj,libstudxml-vc9.vcproj) $(call meta-vc10proj,libstudxml-vc10.vcxproj) diff --git a/xml/parser.hxx b/xml/parser index 6f90522..a1b6250 100644 --- a/xml/parser.hxx +++ b/xml/parser @@ -1,9 +1,9 @@ -// file : xml/parser.hxx +// file : xml/parser -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_PARSER_HXX -#define XML_PARSER_HXX +#ifndef XML_PARSER +#define XML_PARSER #include <xml/details/pre.hxx> @@ -27,10 +27,10 @@ # error UTF-16 expat (XML_UNICODE defined) is not supported #endif -#include <xml/forward.hxx> -#include <xml/qname.hxx> -#include <xml/content.hxx> -#include <xml/exception.hxx> +#include <xml/forward> +#include <xml/qname> +#include <xml/content> +#include <xml/exception> #include <xml/details/export.hxx> @@ -470,4 +470,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_PARSER_HXX +#endif // XML_PARSER diff --git a/xml/parser.cxx b/xml/parser.cxx index 37f9f76..5e117b9 100644 --- a/xml/parser.cxx +++ b/xml/parser.cxx @@ -9,7 +9,7 @@ #include <ostream> #include <sstream> -#include <xml/parser.hxx> +#include <xml/parser> using namespace std; diff --git a/xml/parser.ixx b/xml/parser.ixx index e5656d4..b0bffab 100644 --- a/xml/parser.ixx +++ b/xml/parser.ixx @@ -4,7 +4,7 @@ #include <cassert> -#include <xml/value-traits.hxx> +#include <xml/value-traits> namespace xml { diff --git a/xml/parser.txx b/xml/parser.txx index 0167522..86d9ed7 100644 --- a/xml/parser.txx +++ b/xml/parser.txx @@ -2,7 +2,7 @@ // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#include <xml/value-traits.hxx> +#include <xml/value-traits> namespace xml { diff --git a/xml/qname.hxx b/xml/qname index 7ffd215..85d6424 100644 --- a/xml/qname.hxx +++ b/xml/qname @@ -1,16 +1,16 @@ -// file : xml/qname.hxx +// file : xml/qname -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_QNAME_HXX -#define XML_QNAME_HXX +#ifndef XML_QNAME +#define XML_QNAME #include <xml/details/pre.hxx> #include <string> #include <iosfwd> -#include <xml/forward.hxx> +#include <xml/forward> #include <xml/details/export.hxx> @@ -84,4 +84,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_QNAME_HXX +#endif // XML_QNAME diff --git a/xml/qname.cxx b/xml/qname.cxx index 2261ab8..de24e57 100644 --- a/xml/qname.cxx +++ b/xml/qname.cxx @@ -4,7 +4,7 @@ #include <ostream> -#include <xml/qname.hxx> +#include <xml/qname> using namespace std; diff --git a/xml/serializer.hxx b/xml/serializer index 4f57e48..6c55d51 100644 --- a/xml/serializer.hxx +++ b/xml/serializer @@ -1,9 +1,9 @@ -// file : xml/serializer.hxx +// file : xml/serializer -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_SERIALIZER_HXX -#define XML_SERIALIZER_HXX +#ifndef XML_SERIALIZER +#define XML_SERIALIZER #include <xml/details/pre.hxx> @@ -13,9 +13,9 @@ #include <xml/details/genx/genx.h> -#include <xml/forward.hxx> -#include <xml/qname.hxx> -#include <xml/exception.hxx> +#include <xml/forward> +#include <xml/qname> +#include <xml/exception> #include <xml/details/export.hxx> @@ -224,4 +224,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_SERIALIZER_HXX +#endif // XML_SERIALIZER diff --git a/xml/serializer.cxx b/xml/serializer.cxx index a6afcca..4d1da5b 100644 --- a/xml/serializer.cxx +++ b/xml/serializer.cxx @@ -5,7 +5,7 @@ #include <new> // std::bad_alloc #include <cstring> // std::strlen -#include <xml/serializer.hxx> +#include <xml/serializer> using namespace std; diff --git a/xml/serializer.ixx b/xml/serializer.ixx index 81631f2..ea3dcf0 100644 --- a/xml/serializer.ixx +++ b/xml/serializer.ixx @@ -2,7 +2,7 @@ // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#include <xml/value-traits.hxx> +#include <xml/value-traits> namespace xml { diff --git a/xml/value-traits.hxx b/xml/value-traits index ca86382..3bf10e0 100644 --- a/xml/value-traits.hxx +++ b/xml/value-traits @@ -1,16 +1,16 @@ -// file : xml/value-traits.hxx +// file : xml/value-traits -*- C++ -*- // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#ifndef XML_VALUE_TRAITS_HXX -#define XML_VALUE_TRAITS_HXX +#ifndef XML_VALUE_TRAITS +#define XML_VALUE_TRAITS #include <xml/details/pre.hxx> #include <string> #include <cstddef> // std::size_t -#include <xml/forward.hxx> +#include <xml/forward> #include <xml/details/export.hxx> @@ -50,4 +50,4 @@ namespace xml #include <xml/details/post.hxx> -#endif // XML_VALUE_TRAITS_HXX +#endif // XML_VALUE_TRAITS diff --git a/xml/value-traits.cxx b/xml/value-traits.cxx index 65aa1b6..3530c91 100644 --- a/xml/value-traits.cxx +++ b/xml/value-traits.cxx @@ -2,7 +2,7 @@ // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file -#include <xml/parser.hxx> +#include <xml/parser> using namespace std; diff --git a/xml/value-traits.txx b/xml/value-traits.txx index b76b8a3..3947a99 100644 --- a/xml/value-traits.txx +++ b/xml/value-traits.txx @@ -4,8 +4,8 @@ #include <sstream> -#include <xml/parser.hxx> -#include <xml/serializer.hxx> +#include <xml/parser> +#include <xml/serializer> namespace xml { |